@mastra/deployer-cloud 1.36.0-alpha.5 → 1.36.0-alpha.6

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.
Files changed (22) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/studio/assets/{index-Cx7K4GOg.js → index-2415jwSF.js} +1 -1
  3. package/dist/studio/assets/{index-lPJ661h3.js → index-BKdXDppE.js} +1 -1
  4. package/dist/studio/assets/{index-Ci0q1Kw8.js → index-BNvRyoez.js} +1 -1
  5. package/dist/studio/assets/{index-DYfUBfrS.js → index-BPe0JR0b.js} +1 -1
  6. package/dist/studio/assets/{index-BDW6ei8o.js → index-BUIFyJIO.js} +1 -1
  7. package/dist/studio/assets/{index-DCKjfeBJ.js → index-Bl84VfP3.js} +1 -1
  8. package/dist/studio/assets/{index-CAMYjs1o.js → index-BuVGtMCP.js} +1 -1
  9. package/dist/studio/assets/{index-CZsQXykD.js → index-C9yuX5nG.js} +1 -1
  10. package/dist/studio/assets/{index-CatoXdfC.js → index-Cgq7s6Z4.js} +1 -1
  11. package/dist/studio/assets/{index-DyghTnKS.js → index-DKXOwyxi.js} +1 -1
  12. package/dist/studio/assets/{index-DkLdTAi-.js → index-DMhguNWQ.js} +1 -1
  13. package/dist/studio/assets/{index-DaHczYAf.js → index-DNr5mf81.js} +1 -1
  14. package/dist/studio/assets/{index-eglf7EVg.js → index-DlZamx3_.js} +1 -1
  15. package/dist/studio/assets/{index-DIZSuUX-.js → index-I7iKAQ5S.js} +1 -1
  16. package/dist/studio/assets/{index-3iSPup51.js → index-RteT7R9K.js} +1 -1
  17. package/dist/studio/assets/{index-BcwSHfoJ.js → index-j7GGKsyc.js} +1 -1
  18. package/dist/studio/assets/{index-A6BrMkSV.js → index-m7Q3snxP.js} +1 -1
  19. package/dist/studio/assets/{index-BrRW9JeA.js → index-r6bKOYRE.js} +1 -1
  20. package/dist/studio/assets/{main-CNw_H2Jk.js → main-CKZmrnJj.js} +5 -5
  21. package/dist/studio/index.html +1 -1
  22. package/package.json +4 -4
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DIZSuUX-.js","./index-CatoXdfC.js","./index-BrRW9JeA.js","./index-Cx7K4GOg.js","./index-eglf7EVg.js","./index-BcwSHfoJ.js","./index-CZsQXykD.js","./index-DyghTnKS.js","./index-CAMYjs1o.js","./index-3iSPup51.js","./index-lPJ661h3.js","./index-A6BrMkSV.js","./index-DaHczYAf.js","./index-DkLdTAi-.js","./index-DYfUBfrS.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-DCKjfeBJ.js","./index-Ci0q1Kw8.js","./index-BDW6ei8o.js"])))=>i.map(i=>d[i]);
2
- import{_ as rt}from"./index-CatoXdfC.js";function PXe(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var hC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var MW={exports:{}},VN={};var hje;function Q6t(){if(hje)return VN;hje=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var o in s)o!=="key"&&(a[o]=s[o])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:i,ref:s!==void 0?s:null,props:a}}return VN.Fragment=t,VN.jsx=n,VN.jsxs=n,VN}var mje;function Y6t(){return mje||(mje=1,MW.exports=Q6t()),MW.exports}var l=Y6t(),$W={exports:{}},Ar={},gje;function X6t(){if(gje)return Ar;gje=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),o=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"),p=Symbol.for("react.activity"),h=Symbol.iterator;function m(V){return V===null||typeof V!="object"?null:(V=h&&V[h]||V["@@iterator"],typeof V=="function"?V:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,b={};function S(V,$,W){this.props=V,this.context=$,this.refs=b,this.updater=W||g}S.prototype.isReactComponent={},S.prototype.setState=function(V,$){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,$,"setState")},S.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function w(){}w.prototype=S.prototype;function _(V,$,W){this.props=V,this.context=$,this.refs=b,this.updater=W||g}var O=_.prototype=new w;O.constructor=_,v(O,S.prototype),O.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,$,W){var G=W.ref;return{$$typeof:t,type:V,key:$,ref:G!==void 0?G:null,props:W}}function R(V,$){return I(V.type,$,V.props)}function P(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function U(V){var $={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(W){return $[W]})}var M=/\/+/g;function L(V,$){return typeof V=="object"&&V!==null&&V.key!=null?U(""+V.key):$.toString(36)}function F(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($){V.status==="pending"&&(V.status="fulfilled",V.value=$)},function($){V.status==="pending"&&(V.status="rejected",V.reason=$)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function z(V,$,W,G,K){var re=typeof V;(re==="undefined"||re==="boolean")&&(V=null);var J=!1;if(V===null)J=!0;else switch(re){case"bigint":case"string":case"number":J=!0;break;case"object":switch(V.$$typeof){case t:case n:J=!0;break;case f:return J=V._init,z(J(V._payload),$,W,G,K)}}if(J)return K=K(V),J=G===""?"."+L(V,0):G,E(K)?(W="",J!=null&&(W=J.replace(M,"$&/")+"/"),z(K,$,W,"",function(ie){return ie})):K!=null&&(P(K)&&(K=R(K,W+(K.key==null||V&&V.key===K.key?"":(""+K.key).replace(M,"$&/")+"/")+J)),$.push(K)),1;J=0;var ee=G===""?".":G+":";if(E(V))for(var se=0;se<V.length;se++)G=V[se],re=ee+L(G,se),J+=z(G,$,W,re,K);else if(se=m(V),typeof se=="function")for(V=se.call(V),se=0;!(G=V.next()).done;)G=G.value,re=ee+L(G,se++),J+=z(G,$,W,re,K);else if(re==="object"){if(typeof V.then=="function")return z(F(V),$,W,G,K);throw $=String(V),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return J}function q(V,$,W){if(V==null)return V;var G=[],K=0;return z(V,G,"","",function(re){return $.call(W,re,K++)}),G}function H(V){if(V._status===-1){var $=V._result;$=$(),$.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=$)}if(V._status===1)return V._result.default;throw V._result}var D=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=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($))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",V);return}console.error(V)},Y={map:q,forEach:function(V,$,W){q(V,function(){$.apply(this,arguments)},W)},count:function(V){var $=0;return q(V,function(){$++}),$},toArray:function(V){return q(V,function($){return $})||[]},only:function(V){if(!P(V))throw Error("React.Children.only expected to receive a single React element child.");return V}};return Ar.Activity=p,Ar.Children=Y,Ar.Component=S,Ar.Fragment=r,Ar.Profiler=a,Ar.PureComponent=_,Ar.StrictMode=s,Ar.Suspense=u,Ar.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Ar.__COMPILER_RUNTIME={__proto__:null,c:function(V){return j.H.useMemoCache(V)}},Ar.cache=function(V){return function(){return V.apply(null,arguments)}},Ar.cacheSignal=function(){return null},Ar.cloneElement=function(V,$,W){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var G=v({},V.props),K=V.key;if($!=null)for(re in $.key!==void 0&&(K=""+$.key),$)!N.call($,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&$.ref===void 0||(G[re]=$[re]);var re=arguments.length-2;if(re===1)G.children=W;else if(1<re){for(var J=Array(re),ee=0;ee<re;ee++)J[ee]=arguments[ee+2];G.children=J}return I(V.type,K,G)},Ar.createContext=function(V){return V={$$typeof:o,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:i,_context:V},V},Ar.createElement=function(V,$,W){var G,K={},re=null;if($!=null)for(G in $.key!==void 0&&(re=""+$.key),$)N.call($,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(K[G]=$[G]);var J=arguments.length-2;if(J===1)K.children=W;else if(1<J){for(var ee=Array(J),se=0;se<J;se++)ee[se]=arguments[se+2];K.children=ee}if(V&&V.defaultProps)for(G in J=V.defaultProps,J)K[G]===void 0&&(K[G]=J[G]);return I(V,re,K)},Ar.createRef=function(){return{current:null}},Ar.forwardRef=function(V){return{$$typeof:c,render:V}},Ar.isValidElement=P,Ar.lazy=function(V){return{$$typeof:f,_payload:{_status:-1,_result:V},_init:H}},Ar.memo=function(V,$){return{$$typeof:d,type:V,compare:$===void 0?null:$}},Ar.startTransition=function(V){var $=j.T,W={};j.T=W;try{var G=V(),K=j.S;K!==null&&K(W,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,D)}catch(re){D(re)}finally{$!==null&&W.types!==null&&($.types=W.types),j.T=$}},Ar.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ar.use=function(V){return j.H.use(V)},Ar.useActionState=function(V,$,W){return j.H.useActionState(V,$,W)},Ar.useCallback=function(V,$){return j.H.useCallback(V,$)},Ar.useContext=function(V){return j.H.useContext(V)},Ar.useDebugValue=function(){},Ar.useDeferredValue=function(V,$){return j.H.useDeferredValue(V,$)},Ar.useEffect=function(V,$){return j.H.useEffect(V,$)},Ar.useEffectEvent=function(V){return j.H.useEffectEvent(V)},Ar.useId=function(){return j.H.useId()},Ar.useImperativeHandle=function(V,$,W){return j.H.useImperativeHandle(V,$,W)},Ar.useInsertionEffect=function(V,$){return j.H.useInsertionEffect(V,$)},Ar.useLayoutEffect=function(V,$){return j.H.useLayoutEffect(V,$)},Ar.useMemo=function(V,$){return j.H.useMemo(V,$)},Ar.useOptimistic=function(V,$){return j.H.useOptimistic(V,$)},Ar.useReducer=function(V,$,W){return j.H.useReducer(V,$,W)},Ar.useRef=function(V){return j.H.useRef(V)},Ar.useState=function(V){return j.H.useState(V)},Ar.useSyncExternalStore=function(V,$,W){return j.H.useSyncExternalStore(V,$,W)},Ar.useTransition=function(){return j.H.useTransition()},Ar.version="19.2.6",Ar}var vje;function qT(){return vje||(vje=1,$W.exports=X6t()),$W.exports}var y=qT();const Oe=Qo(y),Zk=PXe({__proto__:null,default:Oe},[y]);var DW={exports:{}},HN={},LW={exports:{}},zW={};var yje;function K6t(){return yje||(yje=1,(function(e){function t(F,z){var q=F.length;F.push(z);e:for(;0<q;){var H=q-1>>>1,D=F[H];if(0<s(D,z))F[H]=z,F[q]=D,q=H;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var z=F[0],q=F.pop();if(q!==z){F[0]=q;e:for(var H=0,D=F.length,Y=D>>>1;H<Y;){var V=2*(H+1)-1,$=F[V],W=V+1,G=F[W];if(0>s($,q))W<D&&0>s(G,$)?(F[H]=G,F[W]=q,H=W):(F[H]=$,F[V]=q,H=V);else if(W<D&&0>s(G,q))F[H]=G,F[W]=q,H=W;else break e}}return z}function s(F,z){var q=F.sortIndex-z.sortIndex;return q!==0?q:F.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,o=i.now();e.unstable_now=function(){return i.now()-o}}var c=[],u=[],d=1,f=null,p=3,h=!1,m=!1,g=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function _(F){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=F)r(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=n(u)}}function O(F){if(g=!1,_(F),!m)if(n(c)!==null)m=!0,E||(E=!0,P());else{var z=n(u);z!==null&&L(O,z.startTime-F)}}var E=!1,T=-1,j=5,N=-1;function I(){return v?!0:!(e.unstable_now()-N<j)}function R(){if(v=!1,E){var F=e.unstable_now();N=F;var z=!0;try{e:{m=!1,g&&(g=!1,S(T),T=-1),h=!0;var q=p;try{t:{for(_(F),f=n(c);f!==null&&!(f.expirationTime>F&&I());){var H=f.callback;if(typeof H=="function"){f.callback=null,p=f.priorityLevel;var D=H(f.expirationTime<=F);if(F=e.unstable_now(),typeof D=="function"){f.callback=D,_(F),z=!0;break t}f===n(c)&&r(c),_(F)}else r(c);f=n(c)}if(f!==null)z=!0;else{var Y=n(u);Y!==null&&L(O,Y.startTime-F),z=!1}}break e}finally{f=null,p=q,h=!1}z=void 0}}finally{z?P():E=!1}}}var P;if(typeof w=="function")P=function(){w(R)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,M=U.port2;U.port1.onmessage=R,P=function(){M.postMessage(null)}}else P=function(){b(R,0)};function L(F,z){T=b(function(){F(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(F){switch(p){case 1:case 2:case 3:var z=3;break;default:z=p}var q=p;p=z;try{return F()}finally{p=q}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function(F,z){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var q=p;p=F;try{return z()}finally{p=q}},e.unstable_scheduleCallback=function(F,z,q){var H=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?H+q:H):q=H,F){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=q+D,F={id:d++,callback:z,priorityLevel:F,startTime:q,expirationTime:D,sortIndex:-1},q>H?(F.sortIndex=q,t(u,F),n(c)===null&&F===n(u)&&(g?(S(T),T=-1):g=!0,L(O,q-H))):(F.sortIndex=D,t(c,F),m||h||(m=!0,E||(E=!0,P()))),F},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(F){var z=p;return function(){var q=p;p=z;try{return F.apply(this,arguments)}finally{p=q}}}})(zW)),zW}var bje;function J6t(){return bje||(bje=1,LW.exports=K6t()),LW.exports}var FW={exports:{}},zc={};var xje;function ezt(){if(xje)return zc;xje=1;var e=qT();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 n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},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 o(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return zc.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,zc.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)},zc.flushSync=function(c){var u=i.T,d=r.p;try{if(i.T=null,r.p=2,c)return c()}finally{i.T=u,r.p=d,r.d.f()}},zc.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,r.d.C(c,u))},zc.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},zc.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=o(d,u.crossOrigin),p=typeof u.integrity=="string"?u.integrity:void 0,h=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?r.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:p,fetchPriority:h}):d==="script"&&r.d.X(c,{crossOrigin:f,integrity:p,fetchPriority:h,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},zc.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=o(u.as,u.crossOrigin);r.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&&r.d.M(c)},zc.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,f=o(d,u.crossOrigin);r.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})}},zc.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=o(u.as,u.crossOrigin);r.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 r.d.m(c)},zc.requestFormReset=function(c){r.d.r(c)},zc.unstable_batchedUpdates=function(c,u){return c(u)},zc.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},zc.useFormStatus=function(){return i.H.useHostTransitionStatus()},zc.version="19.2.6",zc}var wje;function MXe(){if(wje)return FW.exports;wje=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(),FW.exports=ezt(),FW.exports}var Sje;function tzt(){if(Sje)return HN;Sje=1;var e={env:{}};var t=J6t(),n=qT(),r=MXe();function s(x){var k="https://react.dev/errors/"+x;if(1<arguments.length){k+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)k+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+x+"; visit "+k+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(x){return!(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)}function i(x){var k=x,C=x;if(x.alternate)for(;k.return;)k=k.return;else{x=k;do k=x,(k.flags&4098)!==0&&(C=k.return),x=k.return;while(x)}return k.tag===3?C:null}function o(x){if(x.tag===13){var k=x.memoizedState;if(k===null&&(x=x.alternate,x!==null&&(k=x.memoizedState)),k!==null)return k.dehydrated}return null}function c(x){if(x.tag===31){var k=x.memoizedState;if(k===null&&(x=x.alternate,x!==null&&(k=x.memoizedState)),k!==null)return k.dehydrated}return null}function u(x){if(i(x)!==x)throw Error(s(188))}function d(x){var k=x.alternate;if(!k){if(k=i(x),k===null)throw Error(s(188));return k!==x?null:x}for(var C=x,A=k;;){var B=C.return;if(B===null)break;var Z=B.alternate;if(Z===null){if(A=B.return,A!==null){C=A;continue}break}if(B.child===Z.child){for(Z=B.child;Z;){if(Z===C)return u(B),x;if(Z===A)return u(B),k;Z=Z.sibling}throw Error(s(188))}if(C.return!==A.return)C=B,A=Z;else{for(var te=!1,pe=B.child;pe;){if(pe===C){te=!0,C=B,A=Z;break}if(pe===A){te=!0,A=B,C=Z;break}pe=pe.sibling}if(!te){for(pe=Z.child;pe;){if(pe===C){te=!0,C=Z,A=B;break}if(pe===A){te=!0,A=Z,C=B;break}pe=pe.sibling}if(!te)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?x:k}function f(x){var k=x.tag;if(k===5||k===26||k===27||k===6)return x;for(x=x.child;x!==null;){if(k=f(x),k!==null)return k;x=x.sibling}return null}var p=Object.assign,h=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),_=Symbol.for("react.context"),O=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"),R=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function U(x){return x===null||typeof x!="object"?null:(x=P&&x[P]||x["@@iterator"],typeof x=="function"?x:null)}var M=Symbol.for("react.client.reference");function L(x){if(x==null)return null;if(typeof x=="function")return x.$$typeof===M?null:x.displayName||x.name||null;if(typeof x=="string")return x;switch(x){case v:return"Fragment";case S:return"Profiler";case b:return"StrictMode";case E:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof x=="object")switch(x.$$typeof){case g:return"Portal";case _:return x.displayName||"Context";case w:return(x._context.displayName||"Context")+".Consumer";case O:var k=x.render;return x=x.displayName,x||(x=k.displayName||k.name||"",x=x!==""?"ForwardRef("+x+")":"ForwardRef"),x;case j:return k=x.displayName||null,k!==null?k:L(x.type)||"Memo";case N:k=x._payload,x=x._init;try{return L(x(k))}catch{}}return null}var F=Array.isArray,z=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},D=[],Y=-1;function V(x){return{current:x}}function $(x){0>Y||(x.current=D[Y],D[Y]=null,Y--)}function W(x,k){Y++,D[Y]=x.current,x.current=k}var G=V(null),K=V(null),re=V(null),J=V(null);function ee(x,k){switch(W(re,k),W(K,x),W(G,null),k.nodeType){case 9:case 11:x=(x=k.documentElement)&&(x=x.namespaceURI)?DTe(x):0;break;default:if(x=k.tagName,k=k.namespaceURI)k=DTe(k),x=LTe(k,x);else switch(x){case"svg":x=1;break;case"math":x=2;break;default:x=0}}$(G),W(G,x)}function se(){$(G),$(K),$(re)}function ie(x){x.memoizedState!==null&&W(J,x);var k=G.current,C=LTe(k,x.type);k!==C&&(W(K,x),W(G,C))}function Q(x){K.current===x&&($(G),$(K)),J.current===x&&($(J),FN._currentValue=H)}var ne,oe;function me(x){if(ne===void 0)try{throw Error()}catch(C){var k=C.stack.trim().match(/\n( *(at )?)/);ne=k&&k[1]||"",oe=-1<C.stack.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-I7iKAQ5S.js","./index-Cgq7s6Z4.js","./index-r6bKOYRE.js","./index-2415jwSF.js","./index-DlZamx3_.js","./index-j7GGKsyc.js","./index-C9yuX5nG.js","./index-DKXOwyxi.js","./index-BuVGtMCP.js","./index-RteT7R9K.js","./index-BKdXDppE.js","./index-m7Q3snxP.js","./index-DNr5mf81.js","./index-DMhguNWQ.js","./index-BPe0JR0b.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-Bl84VfP3.js","./index-BNvRyoez.js","./index-BUIFyJIO.js"])))=>i.map(i=>d[i]);
2
+ import{_ as rt}from"./index-Cgq7s6Z4.js";function PXe(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var hC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var MW={exports:{}},VN={};var hje;function Q6t(){if(hje)return VN;hje=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var o in s)o!=="key"&&(a[o]=s[o])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:i,ref:s!==void 0?s:null,props:a}}return VN.Fragment=t,VN.jsx=n,VN.jsxs=n,VN}var mje;function Y6t(){return mje||(mje=1,MW.exports=Q6t()),MW.exports}var l=Y6t(),$W={exports:{}},Ar={},gje;function X6t(){if(gje)return Ar;gje=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),o=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"),p=Symbol.for("react.activity"),h=Symbol.iterator;function m(V){return V===null||typeof V!="object"?null:(V=h&&V[h]||V["@@iterator"],typeof V=="function"?V:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,b={};function S(V,$,W){this.props=V,this.context=$,this.refs=b,this.updater=W||g}S.prototype.isReactComponent={},S.prototype.setState=function(V,$){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,$,"setState")},S.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function w(){}w.prototype=S.prototype;function _(V,$,W){this.props=V,this.context=$,this.refs=b,this.updater=W||g}var O=_.prototype=new w;O.constructor=_,v(O,S.prototype),O.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,$,W){var G=W.ref;return{$$typeof:t,type:V,key:$,ref:G!==void 0?G:null,props:W}}function R(V,$){return I(V.type,$,V.props)}function P(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function U(V){var $={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(W){return $[W]})}var M=/\/+/g;function L(V,$){return typeof V=="object"&&V!==null&&V.key!=null?U(""+V.key):$.toString(36)}function F(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($){V.status==="pending"&&(V.status="fulfilled",V.value=$)},function($){V.status==="pending"&&(V.status="rejected",V.reason=$)})),V.status){case"fulfilled":return V.value;case"rejected":throw V.reason}}throw V}function z(V,$,W,G,K){var re=typeof V;(re==="undefined"||re==="boolean")&&(V=null);var J=!1;if(V===null)J=!0;else switch(re){case"bigint":case"string":case"number":J=!0;break;case"object":switch(V.$$typeof){case t:case n:J=!0;break;case f:return J=V._init,z(J(V._payload),$,W,G,K)}}if(J)return K=K(V),J=G===""?"."+L(V,0):G,E(K)?(W="",J!=null&&(W=J.replace(M,"$&/")+"/"),z(K,$,W,"",function(ie){return ie})):K!=null&&(P(K)&&(K=R(K,W+(K.key==null||V&&V.key===K.key?"":(""+K.key).replace(M,"$&/")+"/")+J)),$.push(K)),1;J=0;var ee=G===""?".":G+":";if(E(V))for(var se=0;se<V.length;se++)G=V[se],re=ee+L(G,se),J+=z(G,$,W,re,K);else if(se=m(V),typeof se=="function")for(V=se.call(V),se=0;!(G=V.next()).done;)G=G.value,re=ee+L(G,se++),J+=z(G,$,W,re,K);else if(re==="object"){if(typeof V.then=="function")return z(F(V),$,W,G,K);throw $=String(V),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return J}function q(V,$,W){if(V==null)return V;var G=[],K=0;return z(V,G,"","",function(re){return $.call(W,re,K++)}),G}function H(V){if(V._status===-1){var $=V._result;$=$(),$.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=$)}if(V._status===1)return V._result.default;throw V._result}var D=typeof reportError=="function"?reportError:function(V){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=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($))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",V);return}console.error(V)},Y={map:q,forEach:function(V,$,W){q(V,function(){$.apply(this,arguments)},W)},count:function(V){var $=0;return q(V,function(){$++}),$},toArray:function(V){return q(V,function($){return $})||[]},only:function(V){if(!P(V))throw Error("React.Children.only expected to receive a single React element child.");return V}};return Ar.Activity=p,Ar.Children=Y,Ar.Component=S,Ar.Fragment=r,Ar.Profiler=a,Ar.PureComponent=_,Ar.StrictMode=s,Ar.Suspense=u,Ar.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Ar.__COMPILER_RUNTIME={__proto__:null,c:function(V){return j.H.useMemoCache(V)}},Ar.cache=function(V){return function(){return V.apply(null,arguments)}},Ar.cacheSignal=function(){return null},Ar.cloneElement=function(V,$,W){if(V==null)throw Error("The argument must be a React element, but you passed "+V+".");var G=v({},V.props),K=V.key;if($!=null)for(re in $.key!==void 0&&(K=""+$.key),$)!N.call($,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&$.ref===void 0||(G[re]=$[re]);var re=arguments.length-2;if(re===1)G.children=W;else if(1<re){for(var J=Array(re),ee=0;ee<re;ee++)J[ee]=arguments[ee+2];G.children=J}return I(V.type,K,G)},Ar.createContext=function(V){return V={$$typeof:o,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null},V.Provider=V,V.Consumer={$$typeof:i,_context:V},V},Ar.createElement=function(V,$,W){var G,K={},re=null;if($!=null)for(G in $.key!==void 0&&(re=""+$.key),$)N.call($,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(K[G]=$[G]);var J=arguments.length-2;if(J===1)K.children=W;else if(1<J){for(var ee=Array(J),se=0;se<J;se++)ee[se]=arguments[se+2];K.children=ee}if(V&&V.defaultProps)for(G in J=V.defaultProps,J)K[G]===void 0&&(K[G]=J[G]);return I(V,re,K)},Ar.createRef=function(){return{current:null}},Ar.forwardRef=function(V){return{$$typeof:c,render:V}},Ar.isValidElement=P,Ar.lazy=function(V){return{$$typeof:f,_payload:{_status:-1,_result:V},_init:H}},Ar.memo=function(V,$){return{$$typeof:d,type:V,compare:$===void 0?null:$}},Ar.startTransition=function(V){var $=j.T,W={};j.T=W;try{var G=V(),K=j.S;K!==null&&K(W,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,D)}catch(re){D(re)}finally{$!==null&&W.types!==null&&($.types=W.types),j.T=$}},Ar.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ar.use=function(V){return j.H.use(V)},Ar.useActionState=function(V,$,W){return j.H.useActionState(V,$,W)},Ar.useCallback=function(V,$){return j.H.useCallback(V,$)},Ar.useContext=function(V){return j.H.useContext(V)},Ar.useDebugValue=function(){},Ar.useDeferredValue=function(V,$){return j.H.useDeferredValue(V,$)},Ar.useEffect=function(V,$){return j.H.useEffect(V,$)},Ar.useEffectEvent=function(V){return j.H.useEffectEvent(V)},Ar.useId=function(){return j.H.useId()},Ar.useImperativeHandle=function(V,$,W){return j.H.useImperativeHandle(V,$,W)},Ar.useInsertionEffect=function(V,$){return j.H.useInsertionEffect(V,$)},Ar.useLayoutEffect=function(V,$){return j.H.useLayoutEffect(V,$)},Ar.useMemo=function(V,$){return j.H.useMemo(V,$)},Ar.useOptimistic=function(V,$){return j.H.useOptimistic(V,$)},Ar.useReducer=function(V,$,W){return j.H.useReducer(V,$,W)},Ar.useRef=function(V){return j.H.useRef(V)},Ar.useState=function(V){return j.H.useState(V)},Ar.useSyncExternalStore=function(V,$,W){return j.H.useSyncExternalStore(V,$,W)},Ar.useTransition=function(){return j.H.useTransition()},Ar.version="19.2.6",Ar}var vje;function qT(){return vje||(vje=1,$W.exports=X6t()),$W.exports}var y=qT();const Oe=Qo(y),Zk=PXe({__proto__:null,default:Oe},[y]);var DW={exports:{}},HN={},LW={exports:{}},zW={};var yje;function K6t(){return yje||(yje=1,(function(e){function t(F,z){var q=F.length;F.push(z);e:for(;0<q;){var H=q-1>>>1,D=F[H];if(0<s(D,z))F[H]=z,F[q]=D,q=H;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var z=F[0],q=F.pop();if(q!==z){F[0]=q;e:for(var H=0,D=F.length,Y=D>>>1;H<Y;){var V=2*(H+1)-1,$=F[V],W=V+1,G=F[W];if(0>s($,q))W<D&&0>s(G,$)?(F[H]=G,F[W]=q,H=W):(F[H]=$,F[V]=q,H=V);else if(W<D&&0>s(G,q))F[H]=G,F[W]=q,H=W;else break e}}return z}function s(F,z){var q=F.sortIndex-z.sortIndex;return q!==0?q:F.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,o=i.now();e.unstable_now=function(){return i.now()-o}}var c=[],u=[],d=1,f=null,p=3,h=!1,m=!1,g=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function _(F){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=F)r(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=n(u)}}function O(F){if(g=!1,_(F),!m)if(n(c)!==null)m=!0,E||(E=!0,P());else{var z=n(u);z!==null&&L(O,z.startTime-F)}}var E=!1,T=-1,j=5,N=-1;function I(){return v?!0:!(e.unstable_now()-N<j)}function R(){if(v=!1,E){var F=e.unstable_now();N=F;var z=!0;try{e:{m=!1,g&&(g=!1,S(T),T=-1),h=!0;var q=p;try{t:{for(_(F),f=n(c);f!==null&&!(f.expirationTime>F&&I());){var H=f.callback;if(typeof H=="function"){f.callback=null,p=f.priorityLevel;var D=H(f.expirationTime<=F);if(F=e.unstable_now(),typeof D=="function"){f.callback=D,_(F),z=!0;break t}f===n(c)&&r(c),_(F)}else r(c);f=n(c)}if(f!==null)z=!0;else{var Y=n(u);Y!==null&&L(O,Y.startTime-F),z=!1}}break e}finally{f=null,p=q,h=!1}z=void 0}}finally{z?P():E=!1}}}var P;if(typeof w=="function")P=function(){w(R)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,M=U.port2;U.port1.onmessage=R,P=function(){M.postMessage(null)}}else P=function(){b(R,0)};function L(F,z){T=b(function(){F(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(F){switch(p){case 1:case 2:case 3:var z=3;break;default:z=p}var q=p;p=z;try{return F()}finally{p=q}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function(F,z){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var q=p;p=F;try{return z()}finally{p=q}},e.unstable_scheduleCallback=function(F,z,q){var H=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?H+q:H):q=H,F){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=q+D,F={id:d++,callback:z,priorityLevel:F,startTime:q,expirationTime:D,sortIndex:-1},q>H?(F.sortIndex=q,t(u,F),n(c)===null&&F===n(u)&&(g?(S(T),T=-1):g=!0,L(O,q-H))):(F.sortIndex=D,t(c,F),m||h||(m=!0,E||(E=!0,P()))),F},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(F){var z=p;return function(){var q=p;p=z;try{return F.apply(this,arguments)}finally{p=q}}}})(zW)),zW}var bje;function J6t(){return bje||(bje=1,LW.exports=K6t()),LW.exports}var FW={exports:{}},zc={};var xje;function ezt(){if(xje)return zc;xje=1;var e=qT();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 n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},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 o(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return zc.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,zc.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)},zc.flushSync=function(c){var u=i.T,d=r.p;try{if(i.T=null,r.p=2,c)return c()}finally{i.T=u,r.p=d,r.d.f()}},zc.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,r.d.C(c,u))},zc.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},zc.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=o(d,u.crossOrigin),p=typeof u.integrity=="string"?u.integrity:void 0,h=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?r.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:p,fetchPriority:h}):d==="script"&&r.d.X(c,{crossOrigin:f,integrity:p,fetchPriority:h,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},zc.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=o(u.as,u.crossOrigin);r.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&&r.d.M(c)},zc.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,f=o(d,u.crossOrigin);r.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})}},zc.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=o(u.as,u.crossOrigin);r.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 r.d.m(c)},zc.requestFormReset=function(c){r.d.r(c)},zc.unstable_batchedUpdates=function(c,u){return c(u)},zc.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},zc.useFormStatus=function(){return i.H.useHostTransitionStatus()},zc.version="19.2.6",zc}var wje;function MXe(){if(wje)return FW.exports;wje=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(),FW.exports=ezt(),FW.exports}var Sje;function tzt(){if(Sje)return HN;Sje=1;var e={env:{}};var t=J6t(),n=qT(),r=MXe();function s(x){var k="https://react.dev/errors/"+x;if(1<arguments.length){k+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)k+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+x+"; visit "+k+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(x){return!(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)}function i(x){var k=x,C=x;if(x.alternate)for(;k.return;)k=k.return;else{x=k;do k=x,(k.flags&4098)!==0&&(C=k.return),x=k.return;while(x)}return k.tag===3?C:null}function o(x){if(x.tag===13){var k=x.memoizedState;if(k===null&&(x=x.alternate,x!==null&&(k=x.memoizedState)),k!==null)return k.dehydrated}return null}function c(x){if(x.tag===31){var k=x.memoizedState;if(k===null&&(x=x.alternate,x!==null&&(k=x.memoizedState)),k!==null)return k.dehydrated}return null}function u(x){if(i(x)!==x)throw Error(s(188))}function d(x){var k=x.alternate;if(!k){if(k=i(x),k===null)throw Error(s(188));return k!==x?null:x}for(var C=x,A=k;;){var B=C.return;if(B===null)break;var Z=B.alternate;if(Z===null){if(A=B.return,A!==null){C=A;continue}break}if(B.child===Z.child){for(Z=B.child;Z;){if(Z===C)return u(B),x;if(Z===A)return u(B),k;Z=Z.sibling}throw Error(s(188))}if(C.return!==A.return)C=B,A=Z;else{for(var te=!1,pe=B.child;pe;){if(pe===C){te=!0,C=B,A=Z;break}if(pe===A){te=!0,A=B,C=Z;break}pe=pe.sibling}if(!te){for(pe=Z.child;pe;){if(pe===C){te=!0,C=Z,A=B;break}if(pe===A){te=!0,A=Z,C=B;break}pe=pe.sibling}if(!te)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?x:k}function f(x){var k=x.tag;if(k===5||k===26||k===27||k===6)return x;for(x=x.child;x!==null;){if(k=f(x),k!==null)return k;x=x.sibling}return null}var p=Object.assign,h=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),_=Symbol.for("react.context"),O=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"),R=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function U(x){return x===null||typeof x!="object"?null:(x=P&&x[P]||x["@@iterator"],typeof x=="function"?x:null)}var M=Symbol.for("react.client.reference");function L(x){if(x==null)return null;if(typeof x=="function")return x.$$typeof===M?null:x.displayName||x.name||null;if(typeof x=="string")return x;switch(x){case v:return"Fragment";case S:return"Profiler";case b:return"StrictMode";case E:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof x=="object")switch(x.$$typeof){case g:return"Portal";case _:return x.displayName||"Context";case w:return(x._context.displayName||"Context")+".Consumer";case O:var k=x.render;return x=x.displayName,x||(x=k.displayName||k.name||"",x=x!==""?"ForwardRef("+x+")":"ForwardRef"),x;case j:return k=x.displayName||null,k!==null?k:L(x.type)||"Memo";case N:k=x._payload,x=x._init;try{return L(x(k))}catch{}}return null}var F=Array.isArray,z=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},D=[],Y=-1;function V(x){return{current:x}}function $(x){0>Y||(x.current=D[Y],D[Y]=null,Y--)}function W(x,k){Y++,D[Y]=x.current,x.current=k}var G=V(null),K=V(null),re=V(null),J=V(null);function ee(x,k){switch(W(re,k),W(K,x),W(G,null),k.nodeType){case 9:case 11:x=(x=k.documentElement)&&(x=x.namespaceURI)?DTe(x):0;break;default:if(x=k.tagName,k=k.namespaceURI)k=DTe(k),x=LTe(k,x);else switch(x){case"svg":x=1;break;case"math":x=2;break;default:x=0}}$(G),W(G,x)}function se(){$(G),$(K),$(re)}function ie(x){x.memoizedState!==null&&W(J,x);var k=G.current,C=LTe(k,x.type);k!==C&&(W(K,x),W(G,C))}function Q(x){K.current===x&&($(G),$(K)),J.current===x&&($(J),FN._currentValue=H)}var ne,oe;function me(x){if(ne===void 0)try{throw Error()}catch(C){var k=C.stack.trim().match(/\n( *(at )?)/);ne=k&&k[1]||"",oe=-1<C.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<C.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+ne+x+oe}var ce=!1;function be(x,k){if(!x||ce)return"";ce=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var A={DetermineComponentFrameRoot:function(){try{if(k){var yt=function(){throw Error()};if(Object.defineProperty(yt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(yt,[])}catch(it){var Je=it}Reflect.construct(x,[],yt)}else{try{yt.call()}catch(it){Je=it}x.call(yt.prototype)}}else{try{throw Error()}catch(it){Je=it}(yt=x())&&typeof yt.catch=="function"&&yt.catch(function(){})}}catch(it){if(it&&Je&&typeof it.stack=="string")return[it.stack,Je.stack]}return[null,null]}};A.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var B=Object.getOwnPropertyDescriptor(A.DetermineComponentFrameRoot,"name");B&&B.configurable&&Object.defineProperty(A.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var Z=A.DetermineComponentFrameRoot(),te=Z[0],pe=Z[1];if(te&&pe){var Ie=te.split(`
5
5
  `),Xe=pe.split(`
@@ -115,7 +115,7 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
115
115
  constructor(\${params}) {
116
116
  \${}
117
117
  }
118
- }`,{label:"class",detail:"definition",type:"keyword"}),vd('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),vd('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],jit=xve.concat([vd("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),vd("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),vd("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),dPe=new jrt,Nit=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function cA(e){return(t,n)=>{let r=t.node.getChild("VariableDefinition");return r&&n(r,e),!0}}const vpn=["FunctionDeclaration"],ypn={FunctionDeclaration:cA("function"),ClassDeclaration:cA("class"),ClassExpression:()=>!0,EnumDeclaration:cA("constant"),TypeAliasDeclaration:cA("type"),NamespaceDeclaration:cA("namespace"),VariableDefinition(e,t){e.matchContext(vpn)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function Ait(e,t){let n=dPe.get(t);if(n)return n;let r=[],s=!0;function a(i,o){let c=e.sliceString(i.from,i.to);r.push({label:c,type:o})}return t.cursor(Sa.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let o=ypn[i.name];if(o&&o(i,a)||Nit.has(i.name))return!1}else if(i.to-i.from>8192){for(let o of Ait(e,i.node))r.push(o);return!1}}),dPe.set(t,r),r}const aF=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,wve=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function Iit(e){let t=Ja(e.state).resolveInner(e.pos,-1);if(wve.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&aF.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let s=t;s;s=s.parent)Nit.has(s.name)&&(r=r.concat(Ait(e.state.doc,s)));return{options:r,from:n?t.from:e.pos,validFor:aF}}function lQ(e,t,n){var r;let s=[];for(;;){let a=t.firstChild,i;if(a?.name=="VariableName")return s.push(e(a)),{path:s.reverse(),name:n};if(a?.name=="MemberExpression"&&((r=i=a.lastChild)===null||r===void 0?void 0:r.name)=="PropertyName")s.push(e(i)),t=a;else return null}}function Rit(e){let t=r=>e.state.doc.sliceString(r.from,r.to),n=Ja(e.state).resolveInner(e.pos,-1);return n.name=="PropertyName"?lQ(t,n.parent,t(n)):(n.name=="."||n.name=="?.")&&n.parent.name=="MemberExpression"?lQ(t,n.parent,""):wve.indexOf(n.name)>-1?null:n.name=="VariableName"||n.to-n.from<20&&aF.test(t(n))?{path:[],name:t(n)}:n.name=="MemberExpression"?lQ(t,n,""):e.explicit?{path:[],name:""}:null}function bpn(e,t){let n=e,r=[],s=new Set;for(let a=0;;a++){for(let o of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(o)||s.has(o))continue;s.add(o);let c;try{c=n[o]}catch{continue}r.push({label:o,type:typeof c=="function"?/^[A-Z]/.test(o)?"class":t?"function":"method":t?"variable":"property",boost:-a})}let i=Object.getPrototypeOf(e);if(!i)return r;e=i}}function xpn(e){let t=new Map;return n=>{let r=Rit(n);if(!r)return null;let s=e;for(let i of r.path)if(s=s[i],!s)return null;let a=t.get(s);return a||t.set(s,a=bpn(s,!r.path.length)),{from:n.pos-r.name.length,options:a,validFor:aF}}}const dh=QS.define({name:"javascript",parser:gpn.configure({props:[r_.add({IfStatement:HE({except:/^\s*({|else\b)/}),TryStatement:HE({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:gcn,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:mcn({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":HE({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}}),s_.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":eve,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 n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let n=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,r=e.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?e.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Pit={test:e=>/^JSX/.test(e.name),facet:lB({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Sve=dh.configure({dialect:"ts"},"typescript"),kve=dh.configure({dialect:"jsx",props:[Xge.add(e=>e.isTop?[Pit]:void 0)]}),_ve=dh.configure({dialect:"jsx ts",props:[Xge.add(e=>e.isTop?[Pit]:void 0)]},"typescript");let Mit=e=>({label:e,type:"keyword"});const $it="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(Mit),wpn=$it.concat(["declare","implements","private","protected","public"].map(Mit));function iF(e={}){let t=e.jsx?e.typescript?_ve:kve:e.typescript?Sve:dh,n=e.typescript?jit.concat(wpn):xve.concat($it);return new XS(t,[dh.data.of({autocomplete:tun(wve,Aat(n))}),dh.data.of({autocomplete:Iit}),e.jsx?Dit:[]])}function Spn(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 fPe(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return e.sliceString(r.from,Math.min(r.to,n));return""}const kpn=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Dit=xt.inputHandler.of((e,t,n,r,s)=>{if((kpn?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=">"&&r!="/"||!dh.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,o=i.changeByRange(c=>{var u;let{head:d}=c,f=Ja(i).resolveInner(d-1,-1),p;if(f.name=="JSXStartTag"&&(f=f.parent),!(i.doc.sliceString(d-1,d)!=r||f.name=="JSXAttributeValue"&&f.to>d)){if(r==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(r=="/"&&f.name=="JSXStartCloseTag"){let h=f.parent,m=h.parent;if(m&&h.from==d-2&&((p=fPe(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${p}>`;return{range:ut.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(r==">"){let h=Spn(f);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(p=fPe(i.doc,h,d)))return{range:c,changes:{from:d,insert:`</${p}>`}}}}return{range:c}});return o.changes.empty?!1:(e.dispatch([a,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function _pn(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((n,r)=>{var s;!((s=n.meta.docs)===null||s===void 0)&&s.recommended&&(t.rules[r]=2)})),n=>{let{state:r}=n,s=[];for(let{from:a,to:i}of dh.findRegions(r)){let o=r.doc.lineAt(a),c={line:o.number-1,col:a-o.from,pos:a};for(let u of e.verify(r.sliceDoc(a,i),t))s.push(Opn(u,r.doc,c))}return s}}function pPe(e,t,n,r){return n.line(e+r.line).from+t+(e==1?r.col-1:-1)}function Opn(e,t,n){let r=pPe(e.line,e.column,t,n),s={from:r,to:e.endLine!=null&&e.endColumn!=1?pPe(e.endLine,e.endColumn,t,n):r,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,o=a[0]+n.pos-r,c=a[1]+n.pos-r;s.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+o,to:d+c,insert:i},scrollIntoView:!0})}}]}return s}const Y3=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Dit,completionPath:Rit,esLint:_pn,javascript:iF,javascriptLanguage:dh,jsxLanguage:kve,localCompletionSource:Iit,scopeCompletionSource:xpn,snippets:xve,tsxLanguage:_ve,typescriptLanguage:Sve,typescriptSnippets:jit},Symbol.toStringTag,{value:"Module"})),uA=["_blank","_self","_top","_parent"],cQ=["ascii","utf-8","utf-16","latin1","latin1"],uQ=["get","post","put","delete"],dQ=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],pf=["true","false"],Vn={},Epn={a:{attrs:{href:null,ping:null,type:null,media:null,target:uA,hreflang:null}},abbr:Vn,address:Vn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Vn,aside:Vn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Vn,base:{attrs:{href:null,target:uA}},bdi:Vn,bdo:Vn,blockquote:{attrs:{cite:null}},body:Vn,br:Vn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:dQ,formmethod:uQ,formnovalidate:["novalidate"],formtarget:uA,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Vn,center:Vn,cite:Vn,code:Vn,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:Vn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Vn,div:Vn,dl:Vn,dt:Vn,em:Vn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Vn,figure:Vn,footer:Vn,form:{attrs:{action:null,name:null,"accept-charset":cQ,autocomplete:["on","off"],enctype:dQ,method:uQ,novalidate:["novalidate"],target:uA}},h1:Vn,h2:Vn,h3:Vn,h4:Vn,h5:Vn,h6:Vn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Vn,hgroup:Vn,hr:Vn,html:{attrs:{manifest:null}},i:Vn,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:dQ,formmethod:uQ,formnovalidate:["novalidate"],formtarget:uA,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:Vn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Vn,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:Vn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:cQ,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:Vn,noscript:Vn,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:Vn,param:{attrs:{name:null,value:null}},pre:Vn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Vn,rt:Vn,ruby:Vn,samp:Vn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:cQ}},section:Vn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Vn,source:{attrs:{src:null,type:null,media:null}},span:Vn,strong:Vn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Vn,summary:Vn,sup:Vn,table:Vn,tbody:Vn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Vn,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:Vn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Vn,time:{attrs:{datetime:null}},title:Vn,tr:Vn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Vn,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:Vn},Lit={accesskey:null,class:null,contenteditable:pf,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:pf,autocorrect:pf,autocapitalize:pf,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":pf,"aria-autocomplete":["inline","list","both","none"],"aria-busy":pf,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":pf,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":pf,"aria-hidden":pf,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":pf,"aria-multiselectable":pf,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":pf,"aria-relevant":null,"aria-required":pf,"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},zit="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 zit)Lit[e]=null;let yP=class{constructor(t,n){this.tags={...Epn,...t},this.globalAttrs={...Lit,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};yP.default=new yP;function DC(e,t,n=e.length){if(!t)return"";let r=t.firstChild,s=r&&r.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,n)):""}function LC(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function Fit(e,t,n){let r=n.tags[DC(e,LC(t))];return r?.children||n.allTags}function Ove(e,t){let n=[];for(let r=LC(t);r&&!r.type.isTop;r=LC(r.parent)){let s=DC(e,r);if(s&&r.lastChild.name=="CloseTag")break;s&&n.indexOf(s)<0&&(t.name=="EndTag"||t.from>=r.firstChild.to)&&n.push(s)}return n}const Bit=/^[:\-\.\w\u00b7-\uffff]*$/;function hPe(e,t,n,r,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=LC(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:s,options:Fit(e.doc,i,t).map(o=>({label:o,type:"type"})).concat(Ove(e.doc,n).map((o,c)=>({label:"/"+o,apply:"/"+o+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function mPe(e,t,n,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:Ove(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:Bit}}function Cpn(e,t,n,r){let s=[],a=0;for(let i of Fit(e.doc,n,t))s.push({label:"<"+i,type:"type"});for(let i of Ove(e.doc,n))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:r,to:r,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Tpn(e,t,n,r,s){let a=LC(n),i=a?t.tags[DC(e.doc,a)]:null,o=i&&i.attrs?Object.keys(i.attrs):[],c=i&&i.globalAttrs===!1?o:o.length?o.concat(t.globalAttrNames):t.globalAttrNames;return{from:r,to:s,options:c.map(u=>({label:u,type:"property"})),validFor:Bit}}function jpn(e,t,n,r,s){var a;let i=(a=n.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),o=[],c;if(i){let u=e.sliceDoc(i.from,i.to),d=t.globalAttrs[u];if(!d){let f=LC(n),p=f?t.tags[DC(e.doc,f)]:null;d=p?.attrs&&p.attrs[u]}if(d){let f=e.sliceDoc(r,s).toLowerCase(),p='"',h='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,p="",h=e.sliceDoc(s,s+1)==f[0]?"":f[0],f=f.slice(1),r++):c=/^[^\s<>='"]*$/;for(let m of d)o.push({label:m,apply:p+m+h,type:"constant"})}}return{from:r,to:s,options:o,validFor:c}}function Uit(e,t){let{state:n,pos:r}=t,s=Ja(n).resolveInner(r,-1),a=s.resolve(r);for(let i=r,o;a==s&&(o=s.childBefore(i));){let c=o.lastChild;if(!c||!c.type.isError||c.from<c.to)break;a=s=o,i=c.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?mPe(n,s,s.from,r):hPe(n,e,s,s.from,r):s.name=="StartTag"||s.name=="IncompleteTag"?hPe(n,e,s,r,r):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?mPe(n,s,r,r):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?Tpn(n,e,s,s.name=="AttributeName"?s.from:r,r):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?jpn(n,e,s,s.name=="Is"?r:s.from,r):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?Cpn(n,e,s,r):null}function qit(e){return Uit(yP.default,e)}function Vit(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new yP(t,n):yP.default;return s=>Uit(r,s)}const Npn=dh.parser.configure({top:"SingleExpression"}),Hit=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:Sve.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:kve.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:_ve.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Npn},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:dh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:vP.parser}],Zit=[{name:"style",parser:vP.parser.configure({top:"Styles"})}].concat(zit.map(e=>({name:e,parser:dh.parser}))),Wit=QS.define({name:"html",parser:afn.configure({props:[r_.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,n;for(let r=e.node;;){let s=r.lastChild;if(!s||s.name!="Element"||s.to!=r.to)break;t=r=s}return t&&!((n=t.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),s_.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:n.name=="CloseTag"?n.from:e.to}}}),_at.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),JI=Wit.configure({wrap:bit(Hit,Zit)});function Git(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=bit((e.nestedLanguages||[]).concat(Hit),(e.nestedAttributes||[]).concat(Zit)));let r=n?Wit.configure({wrap:n,dialect:t}):t?JI.configure({dialect:t}):JI;return new XS(r,[JI.data.of({autocomplete:Vit(e)}),e.autoCloseTags!==!1?Qit:[],iF().support,Cit().support])}const gPe=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Qit=xt.inputHandler.of((e,t,n,r,s)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!JI.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,o=i.changeByRange(c=>{var u,d,f;let p=i.doc.sliceString(c.from-1,c.to)==r,{head:h}=c,m=Ja(i).resolveInner(h,-1),g;if(p&&r==">"&&m.name=="EndTag"){let v=m.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=DC(i.doc,v.parent,h))&&!gPe.has(g)){let b=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`</${g}>`;return{range:c,changes:{from:h,to:b,insert:S}}}}else if(p&&r=="/"&&m.name=="IncompleteCloseTag"){let v=m.parent;if(m.from==h-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=DC(i.doc,v,h))&&!gPe.has(g)){let b=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`${g}>`;return{range:ut.cursor(h+S.length,-1),changes:{from:h,to:b,insert:S}}}}return{range:c}});return o.changes.empty?!1:(e.dispatch([a,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Apn=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Qit,html:Git,htmlCompletionSource:qit,htmlCompletionSourceWith:Vit,htmlLanguage:JI},Symbol.toStringTag,{value:"Module"})),Yit=lB({commentTokens:{block:{open:"<!--",close:"-->"}}}),Xit=new _r,Kit=odn.configure({props:[s_.add(e=>!e.is("Block")||e.is("Document")||due(e)!=null||Ipn(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),Xit.add(due),r_.add({Document:()=>null}),u0.add({Document:Yit})]});function due(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Ipn(e){return e.name=="OrderedList"||e.name=="BulletList"}function Rpn(e,t){let n=e;for(;;){let r=n.nextSibling,s;if(!r||(s=due(r.type))!=null&&s<=t)break;n=r}return n.to}const Ppn=fat.of((e,t,n)=>{for(let r=Ja(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let s=r.type.prop(Xit);if(s==null)continue;let a=Rpn(r,s);if(a>n)return{from:n,to:a}}return null});function Eve(e){return new Lf(Yit,e,[],"markdown")}const Jit=Eve(Kit),Mpn=Kit.configure([ydn,xdn,bdn,wdn,{props:[s_.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),ek=Eve(Mpn);function $pn(e,t){return n=>{if(n&&e){let r=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?r=e(n):r=tt.matchLanguageName(e,n,!0),r instanceof tt)return r.support?r.support.language.parser:YS.getSkippingParser(r.load());if(r)return r.parser}return t?t.parser:null}}class fQ{constructor(t,n,r,s,a,i,o){this.node=t,this.from=n,this.to=r,this.spaceBefore=s,this.spaceAfter=a,this.type=i,this.item=o}blank(t,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;r.length<t;)r+=" ";return r}else{for(let s=this.to-this.from-r.length-this.spaceAfter.length;s>0;s--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(t,n){let r=this.node.name=="OrderedList"?String(+tot(this.item,t)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function eot(e,t){let n=[],r=[];for(let s=e;s;s=s.parent){if(s.name=="FencedCode")return r;(s.name=="ListItem"||s.name=="Blockquote")&&n.push(s)}for(let s=n.length-1;s>=0;s--){let a=n[s],i,o=t.lineAt(a.from),c=a.from-o.from;if(a.name=="Blockquote"&&(i=/^ *>( ?)/.exec(o.text.slice(c))))r.push(new fQ(a,c,c+i[0].length,"",i[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(i=/^( *)\d+([.)])( *)/.exec(o.text.slice(c)))){let u=i[3],d=i[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),r.push(new fQ(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(o.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]/," ")),r.push(new fQ(a.parent,c,c+d,i[1],u,f,a))}}return r}function tot(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function pQ(e,t,n,r=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let o=tot(a,t),c=+o[2];if(s>=0){if(c!=s+1)return;n.push({from:a.from+o[1].length,to:a.from+o[0].length,insert:String(s+2+r)})}s=c}let i=a.nextSibling;if(!i)break;a=i}}function Cve(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(ij)!=" ")return e;let r=Cm(e,4,n),s="";for(let a=r;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(n)}const not=(e={})=>({state:t,dispatch:n})=>{let r=Ja(t),{doc:s}=t,a=null,i=t.changeByRange(o=>{if(!o.empty||!ek.isActiveAt(t,o.from,-1)&&!ek.isActiveAt(t,o.from,1))return a={range:o};let c=o.from,u=s.lineAt(c),d=eot(r.resolveInner(c,-1),s);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return a={range:o};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return a={range:o};let p=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&p){let b=f.node.firstChild,S=f.node.getChild("ListItem","ListItem");if(b.to>=c||S&&S.to<c||u.from>0&&!/[^\s>]/.test(s.lineAt(u.from-1).text)||e.nonTightLists===!1){let w=d.length>1?d[d.length-2]:null,_,O="";w&&w.item?(_=u.from+w.from,O=w.marker(s,1)):_=u.from+(w?w.to:0);let E=[{from:_,to:c,insert:O}];return f.node.name=="OrderedList"&&pQ(f.item,s,E,-2),w&&w.node.name=="OrderedList"&&pQ(w.item,s,E),{range:ut.cursor(_+O.length),changes:E}}else{let w=yPe(d,t,u);return{range:ut.cursor(c+w.length+1),changes:{from:u.from,insert:w+t.lineBreak}}}}if(f.node.name=="Blockquote"&&p&&u.from){let b=s.lineAt(u.from-1),S=/>\s*$/.exec(b.text);if(S&&S.index==f.from){let w=t.changes([{from:b.from+S.index,to:b.to},{from:u.from+f.from,to:u.to}]);return{range:o.map(w),changes:w}}}let h=[];f.node.name=="OrderedList"&&pQ(f.item,s,h);let m=f.item&&f.item.from<u.from,g="";if(!m||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=f.to)for(let b=0,S=d.length-1;b<=S;b++)g+=b==S&&!m?d[b].marker(s,1):d[b].blank(b<S?Cm(u.text,4,d[b+1].from)-g.length:null);let v=c;for(;v>u.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return g=Cve(g,t),Dpn(f.node,t.doc)&&(g=yPe(d,t,u)+t.lineBreak+g),h.push({from:v,to:c,insert:t.lineBreak+g}),{range:ut.cursor(v+g.length+1),changes:h}});return a?!1:(n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},rot=not();function vPe(e){return e.name=="QuoteMark"||e.name=="ListMark"}function Dpn(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,r=e.getChild("ListItem","ListItem");if(!r)return!1;let s=t.lineAt(n.to),a=t.lineAt(r.from),i=/^[\s>]*$/.test(s.text);return s.number+(i?0:1)<a.number}function yPe(e,t,n){let r="";for(let s=0,a=e.length-2;s<=a;s++)r+=e[s].blank(s<a?Cm(n.text,4,e[s+1].from)-r.length:null,s<a);return Cve(r,t)}function Lpn(e,t){let n=e.resolveInner(t,-1),r=t;vPe(n)&&(r=n.from,n=n.parent);for(let s;s=n.childBefore(r);)if(vPe(s))r=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")n=s.lastChild,r=n.to;else break;return n}const sot=({state:e,dispatch:t})=>{let n=Ja(e),r=null,s=e.changeByRange(a=>{let i=a.from,{doc:o}=e;if(a.empty&&ek.isActiveAt(e,a.from)){let c=o.lineAt(i),u=eot(Lpn(n,i),o);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:ut.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 p=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let h=d.blank(Cm(c.text,4,d.to)-Cm(c.text,4,d.from));return p==c.from&&(h=Cve(h,e)),{range:ut.cursor(p+h.length),changes:{from:p,to:c.from+d.to,insert:h}}}if(p<i)return{range:ut.cursor(p),changes:{from:p,to:i}}}}}return r={range:a}});return r?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},aot=[{key:"Enter",run:rot},{key:"Backspace",run:sot}],iot=Git({matchClosingTags:!1});function Tve(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:s}=Jit,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:o=iot}=e;if(!(s instanceof fB))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[o.support,Ppn],d;i&&u.push(oot),n instanceof XS?(u.push(n.support),d=n.language):n&&(d=n);let f=t||d?$pn(t,d):void 0;c.push(cdn({codeParser:f,htmlParser:o.language.parser})),r&&u.push(Bm.high(aj.of(aot)));let p=Eve(s.configure(c));return a&&u.push(p.data.of({autocomplete:zpn})),new XS(p,u)}function zpn(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let s=Ja(t).resolveInner(n,-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:n-r[0].length,to:n,options:Fpn(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let hQ=null;function Fpn(){if(hQ)return hQ;let e=qit(new sve(ts.create({extensions:iot}),0,!0));return hQ=e?e.options:[]}const Bpn=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,oot=xt.domEventHandlers({paste:(e,t)=>{var n;let{main:r}=t.state.selection;if(r.empty)return!1;let s=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!ek.isActiveAt(t.state,r.from,1)))return!1;let a=Ja(t.state),i=!1;return a.iterate({from:r.from,to:r.to,enter:o=>{(o.from>r.from||Bpn.test(o.name))&&(i=!0)},leave:o=>{o.to<r.to&&(i=!0)}}),i?!1:(t.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),Upn=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:Jit,deleteMarkupBackward:sot,insertNewlineContinueMarkup:rot,insertNewlineContinueMarkupCommand:not,markdown:Tve,markdownKeymap:aot,markdownLanguage:ek,pasteURLAsLink:oot},Symbol.toStringTag,{value:"Module"}));function wt(e){return new XS(tve.define(e))}function Ox(e){return rt(()=>import("./index-DIZSuUX-.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const lot=[tt.of({name:"C",extensions:["c","h","ino"],load(){return rt(()=>import("./index-BrRW9JeA.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),tt.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return rt(()=>import("./index-BrRW9JeA.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),tt.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Ox("Cassandra")}}),tt.of({name:"CSS",extensions:["css"],load(){return rt(()=>Promise.resolve().then(()=>zfn),void 0,import.meta.url).then(e=>e.css())}}),tt.of({name:"Go",extensions:["go"],load(){return rt(()=>import("./index-Cx7K4GOg.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.go())}}),tt.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return rt(()=>Promise.resolve().then(()=>Apn),void 0,import.meta.url).then(e=>e.html())}}),tt.of({name:"Java",extensions:["java"],load(){return rt(()=>import("./index-eglf7EVg.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),tt.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return rt(()=>Promise.resolve().then(()=>Y3),void 0,import.meta.url).then(e=>e.javascript())}}),tt.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return rt(()=>import("./index-BcwSHfoJ.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),tt.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return rt(()=>Promise.resolve().then(()=>Jcn),void 0,import.meta.url).then(e=>e.json())}}),tt.of({name:"JSX",extensions:["jsx"],load(){return rt(()=>Promise.resolve().then(()=>Y3),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),tt.of({name:"LESS",extensions:["less"],load(){return rt(()=>import("./index-CZsQXykD.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),tt.of({name:"Liquid",extensions:["liquid"],load(){return rt(()=>import("./index-DyghTnKS.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),tt.of({name:"MariaDB SQL",load(){return Ox("MariaSQL")}}),tt.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return rt(()=>Promise.resolve().then(()=>Upn),void 0,import.meta.url).then(e=>e.markdown())}}),tt.of({name:"MS SQL",load(){return Ox("MSSQL")}}),tt.of({name:"MySQL",load(){return Ox("MySQL")}}),tt.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return rt(()=>import("./index-CAMYjs1o.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),tt.of({name:"PLSQL",extensions:["pls"],load(){return Ox("PLSQL")}}),tt.of({name:"PostgreSQL",load(){return Ox("PostgreSQL")}}),tt.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return rt(()=>import("./index-3iSPup51.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),tt.of({name:"Rust",extensions:["rs"],load(){return rt(()=>import("./index-lPJ661h3.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),tt.of({name:"Sass",extensions:["sass"],load(){return rt(()=>import("./index-A6BrMkSV.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),tt.of({name:"SCSS",extensions:["scss"],load(){return rt(()=>import("./index-A6BrMkSV.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),tt.of({name:"SQL",extensions:["sql"],load(){return Ox("StandardSQL")}}),tt.of({name:"SQLite",load(){return Ox("SQLite")}}),tt.of({name:"TSX",extensions:["tsx"],load(){return rt(()=>Promise.resolve().then(()=>Y3),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),tt.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return rt(()=>Promise.resolve().then(()=>Y3),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),tt.of({name:"WebAssembly",extensions:["wat","wast"],load(){return rt(()=>import("./index-DaHczYAf.js"),__vite__mapDeps([12,1]),import.meta.url).then(e=>e.wast())}}),tt.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return rt(()=>import("./index-DkLdTAi-.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),tt.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return rt(()=>import("./index-DYfUBfrS.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),tt.of({name:"APL",extensions:["dyalog","apl"],load(){return rt(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>wt(e.apl))}}),tt.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return rt(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>wt(e.asciiArmor))}}),tt.of({name:"ASN.1",extensions:["asn","asn1"],load(){return rt(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>wt(e.asn1({})))}}),tt.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return rt(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>wt(e.asterisk))}}),tt.of({name:"Brainfuck",extensions:["b","bf"],load(){return rt(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>wt(e.brainfuck))}}),tt.of({name:"Cobol",extensions:["cob","cpy"],load(){return rt(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>wt(e.cobol))}}),tt.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return rt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>wt(e.csharp))}}),tt.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return rt(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>wt(e.clojure))}}),tt.of({name:"ClojureScript",extensions:["cljs"],load(){return rt(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>wt(e.clojure))}}),tt.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return rt(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>wt(e.gss))}}),tt.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return rt(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>wt(e.cmake))}}),tt.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return rt(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>wt(e.coffeeScript))}}),tt.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return rt(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>wt(e.commonLisp))}}),tt.of({name:"Cypher",extensions:["cyp","cypher"],load(){return rt(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>wt(e.cypher))}}),tt.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return rt(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>wt(e.cython))}}),tt.of({name:"Crystal",extensions:["cr"],load(){return rt(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>wt(e.crystal))}}),tt.of({name:"D",extensions:["d"],load(){return rt(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>wt(e.d))}}),tt.of({name:"Dart",extensions:["dart"],load(){return rt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>wt(e.dart))}}),tt.of({name:"diff",extensions:["diff","patch"],load(){return rt(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>wt(e.diff))}}),tt.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return rt(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>wt(e.dockerFile))}}),tt.of({name:"DTD",extensions:["dtd"],load(){return rt(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>wt(e.dtd))}}),tt.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return rt(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>wt(e.dylan))}}),tt.of({name:"EBNF",load(){return rt(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>wt(e.ebnf))}}),tt.of({name:"ECL",extensions:["ecl"],load(){return rt(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>wt(e.ecl))}}),tt.of({name:"edn",extensions:["edn"],load(){return rt(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>wt(e.clojure))}}),tt.of({name:"Eiffel",extensions:["e"],load(){return rt(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>wt(e.eiffel))}}),tt.of({name:"Elm",extensions:["elm"],load(){return rt(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>wt(e.elm))}}),tt.of({name:"Erlang",extensions:["erl"],load(){return rt(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>wt(e.erlang))}}),tt.of({name:"Esper",load(){return rt(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>wt(e.esper))}}),tt.of({name:"Factor",extensions:["factor"],load(){return rt(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>wt(e.factor))}}),tt.of({name:"FCL",load(){return rt(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>wt(e.fcl))}}),tt.of({name:"Forth",extensions:["forth","fth","4th"],load(){return rt(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>wt(e.forth))}}),tt.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return rt(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>wt(e.fortran))}}),tt.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return rt(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>wt(e.fSharp))}}),tt.of({name:"Gas",extensions:["s"],load(){return rt(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>wt(e.gas))}}),tt.of({name:"Gherkin",extensions:["feature"],load(){return rt(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>wt(e.gherkin))}}),tt.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return rt(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>wt(e.groovy))}}),tt.of({name:"Haskell",extensions:["hs"],load(){return rt(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>wt(e.haskell))}}),tt.of({name:"Haxe",extensions:["hx"],load(){return rt(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>wt(e.haxe))}}),tt.of({name:"HXML",extensions:["hxml"],load(){return rt(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>wt(e.hxml))}}),tt.of({name:"HTTP",load(){return rt(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>wt(e.http))}}),tt.of({name:"IDL",extensions:["pro"],load(){return rt(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>wt(e.idl))}}),tt.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return rt(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>wt(e.jsonld))}}),tt.of({name:"Julia",extensions:["jl"],load(){return rt(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>wt(e.julia))}}),tt.of({name:"Kotlin",extensions:["kt","kts"],load(){return rt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>wt(e.kotlin))}}),tt.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return rt(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>wt(e.liveScript))}}),tt.of({name:"Lua",extensions:["lua"],load(){return rt(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>wt(e.lua))}}),tt.of({name:"mIRC",extensions:["mrc"],load(){return rt(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>wt(e.mirc))}}),tt.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return rt(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>wt(e.mathematica))}}),tt.of({name:"Modelica",extensions:["mo"],load(){return rt(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>wt(e.modelica))}}),tt.of({name:"MUMPS",extensions:["mps"],load(){return rt(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>wt(e.mumps))}}),tt.of({name:"Mbox",extensions:["mbox"],load(){return rt(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>wt(e.mbox))}}),tt.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return rt(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>wt(e.nginx))}}),tt.of({name:"NSIS",extensions:["nsh","nsi"],load(){return rt(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([18,16]),import.meta.url).then(e=>wt(e.nsis))}}),tt.of({name:"NTriples",extensions:["nt","nq"],load(){return rt(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>wt(e.ntriples))}}),tt.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return rt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>wt(e.objectiveC))}}),tt.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return rt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>wt(e.objectiveCpp))}}),tt.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return rt(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>wt(e.oCaml))}}),tt.of({name:"Octave",extensions:["m"],load(){return rt(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>wt(e.octave))}}),tt.of({name:"Oz",extensions:["oz"],load(){return rt(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>wt(e.oz))}}),tt.of({name:"Pascal",extensions:["p","pas"],load(){return rt(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>wt(e.pascal))}}),tt.of({name:"Perl",extensions:["pl","pm"],load(){return rt(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>wt(e.perl))}}),tt.of({name:"Pig",extensions:["pig"],load(){return rt(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>wt(e.pig))}}),tt.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return rt(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>wt(e.powerShell))}}),tt.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return rt(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>wt(e.properties))}}),tt.of({name:"ProtoBuf",extensions:["proto"],load(){return rt(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>wt(e.protobuf))}}),tt.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return rt(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>wt(e.pug))}}),tt.of({name:"Puppet",extensions:["pp"],load(){return rt(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>wt(e.puppet))}}),tt.of({name:"Q",extensions:["q"],load(){return rt(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>wt(e.q))}}),tt.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return rt(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>wt(e.r))}}),tt.of({name:"RPM Changes",load(){return rt(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>wt(e.rpmChanges))}}),tt.of({name:"RPM Spec",extensions:["spec"],load(){return rt(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>wt(e.rpmSpec))}}),tt.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return rt(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>wt(e.ruby))}}),tt.of({name:"SAS",extensions:["sas"],load(){return rt(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>wt(e.sas))}}),tt.of({name:"Scala",extensions:["scala"],load(){return rt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>wt(e.scala))}}),tt.of({name:"Scheme",extensions:["scm","ss"],load(){return rt(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>wt(e.scheme))}}),tt.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return rt(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>wt(e.shell))}}),tt.of({name:"Sieve",extensions:["siv","sieve"],load(){return rt(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>wt(e.sieve))}}),tt.of({name:"Smalltalk",extensions:["st"],load(){return rt(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>wt(e.smalltalk))}}),tt.of({name:"Solr",load(){return rt(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>wt(e.solr))}}),tt.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return rt(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>wt(e.sml))}}),tt.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return rt(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>wt(e.sparql))}}),tt.of({name:"Spreadsheet",alias:["excel","formula"],load(){return rt(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>wt(e.spreadsheet))}}),tt.of({name:"Squirrel",extensions:["nut"],load(){return rt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>wt(e.squirrel))}}),tt.of({name:"Stylus",extensions:["styl"],load(){return rt(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>wt(e.stylus))}}),tt.of({name:"Swift",extensions:["swift"],load(){return rt(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>wt(e.swift))}}),tt.of({name:"sTeX",load(){return rt(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>wt(e.stex))}}),tt.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return rt(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>wt(e.stex))}}),tt.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return rt(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>wt(e.verilog))}}),tt.of({name:"Tcl",extensions:["tcl"],load(){return rt(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>wt(e.tcl))}}),tt.of({name:"Textile",extensions:["textile"],load(){return rt(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>wt(e.textile))}}),tt.of({name:"TiddlyWiki",load(){return rt(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>wt(e.tiddlyWiki))}}),tt.of({name:"Tiki wiki",load(){return rt(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>wt(e.tiki))}}),tt.of({name:"TOML",extensions:["toml"],load(){return rt(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>wt(e.toml))}}),tt.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return rt(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>wt(e.troff))}}),tt.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return rt(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>wt(e.ttcn))}}),tt.of({name:"TTCN_CFG",extensions:["cfg"],load(){return rt(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>wt(e.ttcnCfg))}}),tt.of({name:"Turtle",extensions:["ttl"],load(){return rt(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>wt(e.turtle))}}),tt.of({name:"Web IDL",extensions:["webidl"],load(){return rt(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>wt(e.webIDL))}}),tt.of({name:"VB.NET",extensions:["vb"],load(){return rt(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>wt(e.vb))}}),tt.of({name:"VBScript",extensions:["vbs"],load(){return rt(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>wt(e.vbScript))}}),tt.of({name:"Velocity",extensions:["vtl"],load(){return rt(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>wt(e.velocity))}}),tt.of({name:"Verilog",extensions:["v"],load(){return rt(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>wt(e.verilog))}}),tt.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return rt(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>wt(e.vhdl))}}),tt.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return rt(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>wt(e.xQuery))}}),tt.of({name:"Yacas",extensions:["ys"],load(){return rt(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>wt(e.yacas))}}),tt.of({name:"Z80",extensions:["z80"],load(){return rt(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>wt(e.z80))}}),tt.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return rt(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>wt(e.mscgen))}}),tt.of({name:"Xù",extensions:["xu"],load(){return rt(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>wt(e.xu))}}),tt.of({name:"MsGenny",extensions:["msgenny"],load(){return rt(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>wt(e.msgenny))}}),tt.of({name:"Vue",extensions:["vue"],load(){return rt(()=>import("./index-DCKjfeBJ.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),tt.of({name:"Angular Template",load(){return rt(()=>import("./index-Ci0q1Kw8.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];function bP(){return bP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bP.apply(null,arguments)}var qpn=e=>{var{theme:t,settings:n={},styles:r=[]}=e,s={".cm-gutters":{}},a={};n.background&&(a.backgroundColor=n.background),n.backgroundImage&&(a.backgroundImage=n.backgroundImage),n.foreground&&(a.color=n.foreground),n.fontSize&&(a.fontSize=n.fontSize),(n.background||n.foreground)&&(s["&"]=a),n.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(s[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(s[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(s[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(s[".cm-content"]={caretColor:n.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var i={};n.gutterActiveForeground&&(i.color=n.gutterActiveForeground),n.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:n.lineHighlight},i.backgroundColor=n.lineHighlight),s[".cm-activeLineGutter"]=i,n.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:n.selection+" !important"}),n.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch});var o=xt.theme(s,{dark:t==="dark"}),c=Um.define(r),u=[o,Cw(c)];return u},Vpn={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)"},Hpn=[{tag:ae.comment,color:"#6272a4"},{tag:ae.string,color:"#f1fa8c"},{tag:ae.atom,color:"#bd93f9"},{tag:ae.meta,color:"#f8f8f2"},{tag:[ae.keyword,ae.operator,ae.tagName],color:"#ff79c6"},{tag:[ae.function(ae.propertyName),ae.propertyName],color:"#66d9ef"},{tag:[ae.definition(ae.variableName),ae.function(ae.variableName),ae.className,ae.attributeName],color:"#50fa7b"},{tag:ae.atom,color:"#bd93f9"}],lj=e=>{var{theme:t="dark",settings:n={},styles:r=[]}=e||{};return qpn({theme:t,settings:bP({},Vpn,n),styles:[...Hpn,...r]})};lj();function cot(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}const Zpn=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Nve(e.state,n.from);return r.line?Wpn(e):r.block?Qpn(e):!1};function jve(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let s=e(t,n);return s?(r(n.update(s)),!0):!1}}const Wpn=jve(Kpn,0),Gpn=jve(uot,0),Qpn=jve((e,t)=>uot(e,t,Xpn(t)),0);function Nve(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const dA=50;function Ypn(e,{open:t,close:n},r,s){let a=e.sliceDoc(r-dA,r),i=e.sliceDoc(s,s+dA),o=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(i)[0].length,u=a.length-o;if(a.slice(u-t.length,u)==t&&i.slice(c,c+n.length)==n)return{open:{pos:r-o,margin:o&&1},close:{pos:s+c,margin:c&&1}};let d,f;s-r<=2*dA?d=f=e.sliceDoc(r,s):(d=e.sliceDoc(r,r+dA),f=e.sliceDoc(s-dA,s));let p=/^\s*/.exec(d)[0].length,h=/\s*$/.exec(f)[0].length,m=f.length-h-n.length;return d.slice(p,p+t.length)==t&&f.slice(m,m+n.length)==n?{open:{pos:r+p+t.length,margin:/\s/.test(d.charAt(p+t.length))?1:0},close:{pos:s-h-n.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function Xpn(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),s=n.to<=r.to?r:e.doc.lineAt(n.to);s.from>r.from&&s.from==n.to&&(s=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=s.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:s.to})}return t}function uot(e,t,n=t.selection.ranges){let r=n.map(a=>Nve(t,a.from).block);if(!r.every(a=>a))return null;let s=n.map((a,i)=>Ypn(t,r[i],a.from,a.to));if(e!=2&&!s.every(a=>a))return{changes:t.changes(n.map((a,i)=>s[i]?[]:[{from:a.from,insert:r[i].open+" "},{from:a.to,insert:" "+r[i].close}]))};if(e!=1&&s.some(a=>a)){let a=[];for(let i=0,o;i<s.length;i++)if(o=s[i]){let c=r[i],{open:u,close:d}=o;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 Kpn(e,t,n=t.selection.ranges){let r=[],s=-1;for(let{from:a,to:i}of n){let o=r.length,c=1e9,u=Nve(t,a).line;if(u){for(let d=a;d<=i;){let f=t.doc.lineAt(d);if(f.from>s&&(a==i||i>f.from)){s=f.from;let p=/^\s*/.exec(f.text)[0].length,h=p==f.length,m=f.text.slice(p,p+u.length)==u?p:-1;p<f.text.length&&p<c&&(c=p),r.push({line:f,comment:m,token:u,indent:p,empty:h,single:!1})}d=f.to+1}if(c<1e9)for(let d=o;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=c);r.length==o+1&&(r[o].single=!0)}}if(e!=2&&r.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:o,token:c,indent:u,empty:d,single:f}of r)(f||!d)&&a.push({from:o.from+u,insert:c+" "});let i=t.changes(a);return{changes:i,selection:t.selection.map(i,1)}}else if(e!=1&&r.some(a=>a.comment>=0)){let a=[];for(let{line:i,comment:o,token:c}of r)if(o>=0){let u=i.from+o,d=u+c.length;i.text[d-i.from]==" "&&d++,a.push({from:u,to:d})}return{changes:a}}return null}const fue=Ev.define(),Jpn=Ev.define(),ehn=dn.define(),dot=dn.define({combine(e){return Cv(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,s)=>t(r,s)||n(r,s)})}}),fot=Yo.define({create(){return zg.empty},update(e,t){let n=t.state.facet(dot),r=t.annotation(fue);if(r){let c=Cd.fromTransaction(t,r.selection),u=r.side,d=u==0?e.undone:e.done;return c?d=oF(d,d.length,n.minDepth,c):d=mot(d,t.startState.selection),new zg(u==0?r.rest:d,u==0?d:r.rest)}let s=t.annotation(Jpn);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(ul.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Cd.fromTransaction(t),i=t.annotation(ul.time),o=t.annotation(ul.userEvent);return a?e=e.addChanges(a,i,o,n,t):t.selection&&(e=e.addSelection(t.startState.selection,i,o,n.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 zg(e.done.map(Cd.fromJSON),e.undone.map(Cd.fromJSON))}});function thn(e={}){return[fot,dot.of(e),xt.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?pot:t.inputType=="historyRedo"?pue:null;return r?(t.preventDefault(),r(n)):!1}})]}function pB(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let s=n.field(fot,!1);if(!s)return!1;let a=s.pop(e,n,t);return a?(r(a),!0):!1}}const pot=pB(0,!1),pue=pB(1,!1),nhn=pB(0,!0),rhn=pB(1,!0);class Cd{constructor(t,n,r,s,a){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=s,this.selectionsAfter=a}setSelAfter(t){return new Cd(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(t){return new Cd(t.changes&&ll.fromJSON(t.changes),[],t.mapped&&Kg.fromJSON(t.mapped),t.startSelection&&ut.fromJSON(t.startSelection),t.selectionsAfter.map(ut.fromJSON))}static fromTransaction(t,n){let r=eh;for(let s of t.startState.facet(ehn)){let a=s(t);a.length&&(r=r.concat(a))}return!r.length&&t.changes.empty?null:new Cd(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,eh)}static selection(t){return new Cd(void 0,eh,void 0,void 0,t)}}function oF(e,t,n,r){let s=t+1>n+20?t-n-1:0,a=e.slice(s,t);return a.push(r),a}function shn(e,t){let n=[],r=!1;return e.iterChangedRanges((s,a)=>n.push(s,a)),t.iterChangedRanges((s,a,i,o)=>{for(let c=0;c<n.length;){let u=n[c++],d=n[c++];o>=u&&i<=d&&(r=!0)}}),r}function ahn(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function hot(e,t){return e.length?t.length?e.concat(t):e:t}const eh=[],ihn=200;function mot(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-ihn));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),oF(e,e.length-1,1e9,n.setSelAfter(r)))}else return[Cd.selection([t])]}function ohn(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function mQ(e,t){if(!e.length)return e;let n=e.length,r=eh;for(;n;){let s=lhn(e[n-1],t,r);if(s.changes&&!s.changes.empty||s.effects.length){let a=e.slice(0,n);return a[n-1]=s,a}else t=s.mapped,n--,r=s.selectionsAfter}return r.length?[Cd.selection(r)]:eh}function lhn(e,t,n){let r=hot(e.selectionsAfter.length?e.selectionsAfter.map(o=>o.map(t)):eh,n);if(!e.changes)return Cd.selection(r);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new Cd(s,mr.mapEffects(e.effects,t),i,e.startSelection.map(a),r)}const chn=/^(input\.type|delete)($|\.)/;class zg{constructor(t,n,r=0,s=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new zg(this.done,this.undone):this}addChanges(t,n,r,s,a){let i=this.done,o=i[i.length-1];return o&&o.changes&&!o.changes.empty&&t.changes&&(!r||chn.test(r))&&(!o.selectionsAfter.length&&n-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,shn(o.changes,t.changes))||r=="input.type.compose")?i=oF(i,i.length-1,s.minDepth,new Cd(t.changes.compose(o.changes),hot(mr.mapEffects(t.effects,o.changes),o.effects),o.mapped,o.startSelection,eh)):i=oF(i,i.length,s.minDepth,t),new zg(i,eh,n,r)}addSelection(t,n,r,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:eh;return a.length>0&&n-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&ahn(a[a.length-1],t)?this:new zg(mot(this.done,t),this.undone,n,r)}addMapping(t){return new zg(mQ(this.done,t),mQ(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let s=t==0?this.done:this.undone;if(s.length==0)return null;let a=s[s.length-1],i=a.selectionsAfter[0]||n.selection;if(r&&a.selectionsAfter.length)return n.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:fue.of({side:t,rest:ohn(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let o=s.length==1?eh:s.slice(0,s.length-1);return a.mapped&&(o=mQ(o,a.mapped)),n.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:fue.of({side:t,rest:o,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}zg.empty=new zg(eh,eh);const uhn=[{key:"Mod-z",run:pot,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:pue,preventDefault:!0},{linux:"Ctrl-Shift-z",run:pue,preventDefault:!0},{key:"Mod-u",run:nhn,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:rhn,preventDefault:!0}];function cj(e,t){return ut.create(e.ranges.map(t),e.mainIndex)}function qm(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Vm({state:e,dispatch:t},n){let r=cj(e.selection,n);return r.eq(e.selection,!0)?!1:(t(qm(e,r)),!0)}function hB(e,t){return ut.cursor(t?e.to:e.from)}function got(e,t){return Vm(e,n=>n.empty?e.moveByChar(n,t):hB(n,t))}function xu(e){return e.textDirectionAt(e.state.selection.main.head)==ri.LTR}const vot=e=>got(e,!xu(e)),yot=e=>got(e,xu(e));function bot(e,t){return Vm(e,n=>n.empty?e.moveByGroup(n,t):hB(n,t))}const dhn=e=>bot(e,!xu(e)),fhn=e=>bot(e,xu(e));function phn(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function mB(e,t,n){let r=Ja(e).resolveInner(t.head),s=n?_r.closedBy:_r.openedBy;for(let c=t.head;;){let u=n?r.childAfter(c):r.childBefore(c);if(!u)break;phn(e,u,s)?r=u:c=n?u.to:u.from}let a=r.type.prop(s),i,o;return a&&(i=n?Lg(e,r.from,1):Lg(e,r.to,-1))&&i.matched?o=n?i.end.to:i.end.from:o=n?r.to:r.from,ut.cursor(o,n?-1:1)}const hhn=e=>Vm(e,t=>mB(e.state,t,!xu(e))),mhn=e=>Vm(e,t=>mB(e.state,t,xu(e)));function xot(e,t){return Vm(e,n=>{if(!n.empty)return hB(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const wot=e=>xot(e,!1),Sot=e=>xot(e,!0);function kot(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,s;if(t){for(let a of e.state.facet(xt.scrollMargins)){let i=a(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}s=e.scrollDOM.clientHeight-n-r}else s=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,s-5)}}function _ot(e,t){let n=kot(e),{state:r}=e,s=cj(r.selection,i=>i.empty?e.moveVertically(i,t,n.height):hB(i,t));if(s.eq(r.selection))return!1;let a;if(n.selfScroll){let i=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),c=o.top+n.marginTop,u=o.bottom-n.marginBottom;i&&i.top>c&&i.bottom<u&&(a=xt.scrollIntoView(s.main.head,{y:"start",yMargin:i.top-c}))}return e.dispatch(qm(r,s),{effects:a}),!0}const bPe=e=>_ot(e,!1),hue=e=>_ot(e,!0);function Tw(e,t,n){let r=e.lineBlockAt(t.head),s=e.moveToLineBoundary(t,n);if(s.head==t.head&&s.head!=(n?r.to:r.from)&&(s=e.moveToLineBoundary(t,n,!1)),!n&&s.head==r.from&&r.length){let a=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;a&&t.head!=r.from+a&&(s=ut.cursor(r.from+a))}return s}const ghn=e=>Vm(e,t=>Tw(e,t,!0)),vhn=e=>Vm(e,t=>Tw(e,t,!1)),yhn=e=>Vm(e,t=>Tw(e,t,!xu(e))),bhn=e=>Vm(e,t=>Tw(e,t,xu(e))),xhn=e=>Vm(e,t=>ut.cursor(e.lineBlockAt(t.head).from,1)),whn=e=>Vm(e,t=>ut.cursor(e.lineBlockAt(t.head).to,-1));function Shn(e,t,n){let r=!1,s=cj(e.selection,a=>{let i=Lg(e,a.head,-1)||Lg(e,a.head,1)||a.head>0&&Lg(e,a.head-1,1)||a.head<e.doc.length&&Lg(e,a.head+1,-1);if(!i||!i.end)return a;r=!0;let o=i.start.from==a.head?i.end.to:i.end.from;return ut.cursor(o)});return r?(t(qm(e,s)),!0):!1}const khn=({state:e,dispatch:t})=>Shn(e,t);function Rh(e,t){let n=cj(e.state.selection,r=>{let s=t(r);return ut.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(qm(e.state,n)),!0)}function Oot(e,t){return Rh(e,n=>e.moveByChar(n,t))}const Eot=e=>Oot(e,!xu(e)),Cot=e=>Oot(e,xu(e));function Tot(e,t){return Rh(e,n=>e.moveByGroup(n,t))}const _hn=e=>Tot(e,!xu(e)),Ohn=e=>Tot(e,xu(e)),Ehn=e=>Rh(e,t=>mB(e.state,t,!xu(e))),Chn=e=>Rh(e,t=>mB(e.state,t,xu(e)));function jot(e,t){return Rh(e,n=>e.moveVertically(n,t))}const Not=e=>jot(e,!1),Aot=e=>jot(e,!0);function Iot(e,t){return Rh(e,n=>e.moveVertically(n,t,kot(e).height))}const xPe=e=>Iot(e,!1),wPe=e=>Iot(e,!0),Thn=e=>Rh(e,t=>Tw(e,t,!0)),jhn=e=>Rh(e,t=>Tw(e,t,!1)),Nhn=e=>Rh(e,t=>Tw(e,t,!xu(e))),Ahn=e=>Rh(e,t=>Tw(e,t,xu(e))),Ihn=e=>Rh(e,t=>ut.cursor(e.lineBlockAt(t.head).from)),Rhn=e=>Rh(e,t=>ut.cursor(e.lineBlockAt(t.head).to)),SPe=({state:e,dispatch:t})=>(t(qm(e,{anchor:0})),!0),kPe=({state:e,dispatch:t})=>(t(qm(e,{anchor:e.doc.length})),!0),_Pe=({state:e,dispatch:t})=>(t(qm(e,{anchor:e.selection.main.anchor,head:0})),!0),OPe=({state:e,dispatch:t})=>(t(qm(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Phn=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Mhn=({state:e,dispatch:t})=>{let n=gB(e).map(({from:r,to:s})=>ut.range(r,Math.min(s+1,e.doc.length)));return t(e.update({selection:ut.create(n),userEvent:"select"})),!0},$hn=({state:e,dispatch:t})=>{let n=cj(e.selection,r=>{let s=Ja(e),a=s.resolveStack(r.from,1);if(r.empty){let i=s.resolveStack(r.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:o}=i;if((o.from<r.from&&o.to>=r.to||o.to>r.to&&o.from<=r.from)&&i.next)return ut.range(o.to,o.from)}return r});return n.eq(e.selection)?!1:(t(qm(e,n)),!0)};function Rot(e,t){let{state:n}=e,r=n.selection,s=n.selection.ranges.slice();for(let a of n.selection.ranges){let i=n.doc.lineAt(a.head);if(t?i.to<e.state.doc.length:i.from>0)for(let o=a;;){let c=e.moveVertically(o,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==o.head)break;o=c}}}return s.length==r.ranges.length?!1:(e.dispatch(qm(n,ut.create(s,s.length-1))),!0)}const Dhn=e=>Rot(e,!1),Lhn=e=>Rot(e,!0),zhn=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=ut.create([n.main]):n.main.empty||(r=ut.create([ut.cursor(n.main.head)])),r?(t(qm(e,r)),!0):!1};function BM(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,s=r.changeByRange(a=>{let{from:i,to:o}=a;if(i==o){let c=t(a);c<i?(n="delete.backward",c=X3(e,c,!1)):c>i&&(n="delete.forward",c=X3(e,c,!0)),i=Math.min(i,c),o=Math.max(o,c)}else i=X3(e,i,!1),o=X3(e,o,!0);return i==o?{range:a}:{changes:{from:i,to:o},range:ut.cursor(i,i<a.head?-1:1)}});return s.changes.empty?!1:(e.dispatch(r.update(s,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?xt.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function X3(e,t,n){if(e instanceof xt)for(let r of e.state.facet(xt.atomicRanges).map(s=>s(e)))r.between(t,t,(s,a)=>{s<t&&a>t&&(t=n?a:s)});return t}const Pot=(e,t,n)=>BM(e,r=>{let s=r.from,{state:a}=e,i=a.doc.lineAt(s),o,c;if(n&&!t&&s>i.from&&s<i.from+200&&!/[^ \t]/.test(o=i.text.slice(0,s-i.from))){if(o[o.length-1]==" ")return s-1;let u=Cm(o,a.tabSize),d=u%KS(a)||KS(a);for(let f=0;f<d&&o[o.length-1-f]==" ";f++)s--;c=s}else c=Zl(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=Zl(i.text,c-i.from,!1,!1)+i.from);return c}),mue=e=>Pot(e,!1,!0),Mot=e=>Pot(e,!0,!1),$ot=(e,t)=>BM(e,n=>{let r=n.head,{state:s}=e,a=s.doc.lineAt(r),i=s.charCategorizer(r);for(let o=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?s.doc.lines:1)&&(r+=t?1:-1);break}let c=Zl(a.text,r-a.from,t)+a.from,u=a.text.slice(Math.min(r,c)-a.from,Math.max(r,c)-a.from),d=i(u);if(o!=null&&d!=o)break;(u!=" "||r!=n.head)&&(o=d),r=c}return r}),Dot=e=>$ot(e,!1),Fhn=e=>$ot(e,!0),Bhn=e=>BM(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Uhn=e=>BM(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),qhn=e=>BM(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Vhn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:ia.of(["",""])},range:ut.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Hhn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let s=r.from,a=e.doc.lineAt(s),i=s==a.from?s-1:Zl(a.text,s-a.from,!1)+a.from,o=s==a.to?s+1:Zl(a.text,s-a.from,!0)+a.from;return{changes:{from:i,to:o,insert:e.doc.slice(s,o).append(e.doc.slice(i,s))},range:ut.cursor(o)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function gB(e){let t=[],n=-1;for(let r of e.selection.ranges){let s=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=s.number){let i=t[t.length-1];i.to=a.to,i.ranges.push(r)}else t.push({from:s.from,to:a.to,ranges:[r]});n=a.number+1}return t}function Lot(e,t,n){if(e.readOnly)return!1;let r=[],s=[];for(let a of gB(e)){if(n?a.to==e.doc.length:a.from==0)continue;let i=e.doc.lineAt(n?a.to+1:a.from-1),o=i.length+1;if(n){r.push({from:a.to,to:i.to},{from:a.from,insert:i.text+e.lineBreak});for(let c of a.ranges)s.push(ut.range(Math.min(e.doc.length,c.anchor+o),Math.min(e.doc.length,c.head+o)))}else{r.push({from:i.from,to:a.from},{from:a.to,insert:e.lineBreak+i.text});for(let c of a.ranges)s.push(ut.range(c.anchor-o,c.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:ut.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Zhn=({state:e,dispatch:t})=>Lot(e,t,!1),Whn=({state:e,dispatch:t})=>Lot(e,t,!0);function zot(e,t,n){if(e.readOnly)return!1;let r=[];for(let a of gB(e))n?r.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):r.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)});let s=e.changes(r);return t(e.update({changes:s,selection:e.selection.map(s,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Ghn=({state:e,dispatch:t})=>zot(e,t,!1),Qhn=({state:e,dispatch:t})=>zot(e,t,!0),Yhn=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(gB(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),r=cj(t.selection,s=>{let a;if(e.lineWrapping){let i=e.lineBlockAt(s.head),o=e.coordsAtPos(s.head,s.assoc||1);o&&(a=i.bottom+e.documentTop-o.bottom+e.defaultLineHeight/2)}return e.moveVertically(s,!0,a)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Xhn(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Ja(e).resolveInner(t),r=n.childBefore(t),s=n.childAfter(t),a;return r&&s&&r.to<=t&&s.from>=t&&(a=r.type.prop(_r.closedBy))&&a.indexOf(s.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const EPe=Fot(!1),Khn=Fot(!0);function Fot(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(s=>{let{from:a,to:i}=s,o=t.doc.lineAt(a),c=!e&&a==i&&Xhn(t,a);e&&(a=i=(i<=o.to?o:t.doc.lineAt(i)).to);let u=new cB(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=Kge(u,a);for(d==null&&(d=Cm(/^\s*/.exec(t.doc.lineAt(a).text)[0],t.tabSize));i<o.to&&/\s/.test(o.text[i-o.from]);)i++;c?{from:a,to:i}=c:a>o.from&&a<o.from+100&&!/\S/.test(o.text.slice(0,a))&&(a=o.from);let f=["",cP(t,d)];return c&&f.push(cP(t,u.lineIndent(o.from,-1))),{changes:{from:a,to:i,insert:ia.of(f)},range:ut.cursor(a+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Ave(e,t){let n=-1;return e.changeByRange(r=>{let s=[];for(let i=r.from;i<=r.to;){let o=e.doc.lineAt(i);o.number>n&&(r.empty||r.to>o.from)&&(t(o,s,r),n=o.number),i=o.to+1}let a=e.changes(s);return{changes:s,range:ut.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}const Jhn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new cB(e,{overrideIndentation:a=>{let i=n[a];return i??-1}}),s=Ave(e,(a,i,o)=>{let c=Kge(r,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=cP(e,c);(u!=d||o.from<a.from+u.length)&&(n[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},Bot=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Ave(e,(n,r)=>{r.push({from:n.from,insert:e.facet(ij)})}),{userEvent:"input.indent"})),!0),Uot=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Ave(e,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let a=Cm(s,e.tabSize),i=0,o=cP(e,Math.max(0,a-KS(e)));for(;i<s.length&&i<o.length&&s.charCodeAt(i)==o.charCodeAt(i);)i++;r.push({from:n.from+i,to:n.from+s.length,insert:o.slice(i)})}),{userEvent:"delete.dedent"})),!0),emn=e=>(e.setTabFocusMode(),!0),tmn=[{key:"Ctrl-b",run:vot,shift:Eot,preventDefault:!0},{key:"Ctrl-f",run:yot,shift:Cot},{key:"Ctrl-p",run:wot,shift:Not},{key:"Ctrl-n",run:Sot,shift:Aot},{key:"Ctrl-a",run:xhn,shift:Ihn},{key:"Ctrl-e",run:whn,shift:Rhn},{key:"Ctrl-d",run:Mot},{key:"Ctrl-h",run:mue},{key:"Ctrl-k",run:Bhn},{key:"Ctrl-Alt-h",run:Dot},{key:"Ctrl-o",run:Vhn},{key:"Ctrl-t",run:Hhn},{key:"Ctrl-v",run:hue}],nmn=[{key:"ArrowLeft",run:vot,shift:Eot,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:dhn,shift:_hn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:yhn,shift:Nhn,preventDefault:!0},{key:"ArrowRight",run:yot,shift:Cot,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:fhn,shift:Ohn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:bhn,shift:Ahn,preventDefault:!0},{key:"ArrowUp",run:wot,shift:Not,preventDefault:!0},{mac:"Cmd-ArrowUp",run:SPe,shift:_Pe},{mac:"Ctrl-ArrowUp",run:bPe,shift:xPe},{key:"ArrowDown",run:Sot,shift:Aot,preventDefault:!0},{mac:"Cmd-ArrowDown",run:kPe,shift:OPe},{mac:"Ctrl-ArrowDown",run:hue,shift:wPe},{key:"PageUp",run:bPe,shift:xPe},{key:"PageDown",run:hue,shift:wPe},{key:"Home",run:vhn,shift:jhn,preventDefault:!0},{key:"Mod-Home",run:SPe,shift:_Pe},{key:"End",run:ghn,shift:Thn,preventDefault:!0},{key:"Mod-End",run:kPe,shift:OPe},{key:"Enter",run:EPe,shift:EPe},{key:"Mod-a",run:Phn},{key:"Backspace",run:mue,shift:mue,preventDefault:!0},{key:"Delete",run:Mot,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Dot,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Fhn,preventDefault:!0},{mac:"Mod-Backspace",run:Uhn,preventDefault:!0},{mac:"Mod-Delete",run:qhn,preventDefault:!0}].concat(tmn.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),rmn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:hhn,shift:Ehn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:mhn,shift:Chn},{key:"Alt-ArrowUp",run:Zhn},{key:"Shift-Alt-ArrowUp",run:Ghn},{key:"Alt-ArrowDown",run:Whn},{key:"Shift-Alt-ArrowDown",run:Qhn},{key:"Mod-Alt-ArrowUp",run:Dhn},{key:"Mod-Alt-ArrowDown",run:Lhn},{key:"Escape",run:zhn},{key:"Mod-Enter",run:Khn},{key:"Alt-l",mac:"Ctrl-l",run:Mhn},{key:"Mod-i",run:$hn,preventDefault:!0},{key:"Mod-[",run:Uot},{key:"Mod-]",run:Bot},{key:"Mod-Alt-\\",run:Jhn},{key:"Shift-Mod-k",run:Yhn},{key:"Shift-Mod-\\",run:khn},{key:"Mod-/",run:Zpn},{key:"Alt-A",run:Gpn},{key:"Ctrl-m",mac:"Shift-Alt-m",run:emn}].concat(nmn),smn={key:"Tab",run:Bot,shift:Uot},CPe=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class ob{constructor(t,n,r=0,s=t.length,a,i){this.test=i,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,s),this.bufferStart=r,this.normalize=a?o=>a(CPe(o)):CPe,this.query=this.normalize(n)}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 wd(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 n=Rge(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=Cg(t);let s=this.normalize(n);if(s.length)for(let a=0,i=r,o=!0;;a++){let c=s.charCodeAt(a),u=this.match(c,i,o,this.bufferPos+this.bufferStart,a==s.length-1);if(u)return this.value=u,this;if(a==s.length-1)break;o&&a<n.length&&n.charCodeAt(a)==c?i++:o=!1}}}match(t,n,r,s,a){let i=null;for(let o=0;o<this.matches.length;){let c=this.matches[o],u=!1;this.query.charCodeAt(c.index)==t&&(c.index==this.query.length-1?i={from:c.from,to:s,precise:a&&c.precise}:(c.index++,u=!0)),u?o++:this.matches.splice(o,1)}return this.query.charCodeAt(0)==t&&(this.query.length==1?i={from:n,to:s,precise:r&&a}:this.matches.push({from:n,index:1,precise:r})),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(ob.prototype[Symbol.iterator]=function(){return this});const qot={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Ive="gm"+(/x/.unicode==null?"":"u");class Vot{constructor(t,n,r,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=qot,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new Hot(t,n,r,s,a);this.re=new RegExp(n,Ive+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=lF(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 n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,s=r+n[0].length;if(this.matchPos=lF(this.text,s+(r==s?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<s||r>this.value.to)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,precise:!0,match:n},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 gQ=new WeakMap;class WE{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let s=gQ.get(t);if(!s||s.from>=r||s.to<=n){let o=new WE(n,t.sliceString(n,r));return gQ.set(t,o),o}if(s.from==n&&s.to==r)return s;let{text:a,from:i}=s;return i>n&&(a=t.sliceString(n,i)+a,i=n),s.to<r&&(a+=t.sliceString(s.to,r)),gQ.set(t,new WE(i,a)),new WE(n,a.slice(n-i,r-i))}}class Hot{constructor(t,n,r,s,a){this.text=t,this.to=a,this.done=!1,this.value=qot,this.matchPos=lF(t,s),this.re=new RegExp(n,Ive+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=WE.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,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,s=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,precise:!0,match:n},this.matchPos=lF(this.text,s+(r==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=WE.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Vot.prototype[Symbol.iterator]=Hot.prototype[Symbol.iterator]=function(){return this});function amn(e){try{return new RegExp(e,Ive),!0}catch{return!1}}function lF(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}const imn=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:s}=Zln(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},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:r});return}let o=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=i,p=d?+d.slice(1):0,h=u?+u:o.number;if(u&&f){let v=h/100;c&&(v=v*(c=="-"?-1:1)+o.number/t.doc.lines),h=Math.round(t.doc.lines*v)}else u&&c&&(h=h*(c=="-"?-1:1)+o.number);let m=t.doc.line(Math.max(1,Math.min(t.doc.lines,h))),g=ut.cursor(m.from+Math.max(0,Math.min(p,m.length)));e.dispatch({effects:[r,xt.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},omn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},lmn=dn.define({combine(e){return Cv(e,omn,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function cmn(e){return[hmn,pmn]}const umn=hn.mark({class:"cm-selectionMatch"}),dmn=hn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function TPe(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=Bi.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=Bi.Word)}function fmn(e,t,n,r){return e(t.sliceDoc(n,n+1))==Bi.Word&&e(t.sliceDoc(r-1,r))==Bi.Word}const pmn=Hi.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(lmn),{state:n}=e,r=n.selection;if(r.ranges.length>1)return hn.none;let s=r.main,a,i=null;if(s.empty){if(!t.highlightWordAroundCursor)return hn.none;let c=n.wordAt(s.head);if(!c)return hn.none;i=n.charCategorizer(s.head),a=n.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c<t.minSelectionLength||c>200)return hn.none;if(t.wholeWords){if(a=n.sliceDoc(s.from,s.to),i=n.charCategorizer(s.head),!(TPe(i,n,s.from,s.to)&&fmn(i,n,s.from,s.to)))return hn.none}else if(a=n.sliceDoc(s.from,s.to),!a)return hn.none}let o=[];for(let c of e.visibleRanges){let u=new ob(n.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||TPe(i,n,d,f))&&(s.empty&&d<=s.from&&f>=s.to?o.push(dmn.range(d,f)):(d>=s.to||f<=s.from)&&o.push(umn.range(d,f)),o.length>t.maxMatches))return hn.none}}return hn.set(o)}},{decorations:e=>e.decorations}),hmn=xt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),mmn=({state:e,dispatch:t})=>{let{selection:n}=e,r=ut.create(n.ranges.map(s=>e.wordAt(s.head)||ut.cursor(s.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function gmn(e,t){let{main:n,ranges:r}=e.selection,s=e.wordAt(n.head),a=s&&s.from==n.from&&s.to==n.to;for(let i=!1,o=new ob(e.doc,t,r[r.length-1].to);;)if(o.next(),o.done){if(i)return null;o=new ob(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),i=!0}else{if(i&&r.some(c=>c.from==o.value.from))continue;if(a){let c=e.wordAt(o.value.from);if(!c||c.from!=o.value.from||c.to!=o.value.to)continue}return o.value}}const vmn=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(a=>a.from===a.to))return mmn({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(a=>e.sliceDoc(a.from,a.to)!=r))return!1;let s=gmn(e,r);return s?(t(e.update({selection:e.selection.addRange(ut.range(s.from,s.to),!1),effects:xt.scrollIntoView(s.to)})),!0):!1},uj=dn.define({combine(e){return Cv(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new Amn(t),scrollToMatch:t=>xt.scrollIntoView(t)})}});class Zot{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||amn(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,(n,r)=>r=="n"?`
118
+ }`,{label:"class",detail:"definition",type:"keyword"}),vd('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),vd('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],jit=xve.concat([vd("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),vd("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),vd("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),dPe=new jrt,Nit=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function cA(e){return(t,n)=>{let r=t.node.getChild("VariableDefinition");return r&&n(r,e),!0}}const vpn=["FunctionDeclaration"],ypn={FunctionDeclaration:cA("function"),ClassDeclaration:cA("class"),ClassExpression:()=>!0,EnumDeclaration:cA("constant"),TypeAliasDeclaration:cA("type"),NamespaceDeclaration:cA("namespace"),VariableDefinition(e,t){e.matchContext(vpn)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function Ait(e,t){let n=dPe.get(t);if(n)return n;let r=[],s=!0;function a(i,o){let c=e.sliceString(i.from,i.to);r.push({label:c,type:o})}return t.cursor(Sa.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let o=ypn[i.name];if(o&&o(i,a)||Nit.has(i.name))return!1}else if(i.to-i.from>8192){for(let o of Ait(e,i.node))r.push(o);return!1}}),dPe.set(t,r),r}const aF=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,wve=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function Iit(e){let t=Ja(e.state).resolveInner(e.pos,-1);if(wve.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&aF.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let s=t;s;s=s.parent)Nit.has(s.name)&&(r=r.concat(Ait(e.state.doc,s)));return{options:r,from:n?t.from:e.pos,validFor:aF}}function lQ(e,t,n){var r;let s=[];for(;;){let a=t.firstChild,i;if(a?.name=="VariableName")return s.push(e(a)),{path:s.reverse(),name:n};if(a?.name=="MemberExpression"&&((r=i=a.lastChild)===null||r===void 0?void 0:r.name)=="PropertyName")s.push(e(i)),t=a;else return null}}function Rit(e){let t=r=>e.state.doc.sliceString(r.from,r.to),n=Ja(e.state).resolveInner(e.pos,-1);return n.name=="PropertyName"?lQ(t,n.parent,t(n)):(n.name=="."||n.name=="?.")&&n.parent.name=="MemberExpression"?lQ(t,n.parent,""):wve.indexOf(n.name)>-1?null:n.name=="VariableName"||n.to-n.from<20&&aF.test(t(n))?{path:[],name:t(n)}:n.name=="MemberExpression"?lQ(t,n,""):e.explicit?{path:[],name:""}:null}function bpn(e,t){let n=e,r=[],s=new Set;for(let a=0;;a++){for(let o of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(o)||s.has(o))continue;s.add(o);let c;try{c=n[o]}catch{continue}r.push({label:o,type:typeof c=="function"?/^[A-Z]/.test(o)?"class":t?"function":"method":t?"variable":"property",boost:-a})}let i=Object.getPrototypeOf(e);if(!i)return r;e=i}}function xpn(e){let t=new Map;return n=>{let r=Rit(n);if(!r)return null;let s=e;for(let i of r.path)if(s=s[i],!s)return null;let a=t.get(s);return a||t.set(s,a=bpn(s,!r.path.length)),{from:n.pos-r.name.length,options:a,validFor:aF}}}const dh=QS.define({name:"javascript",parser:gpn.configure({props:[r_.add({IfStatement:HE({except:/^\s*({|else\b)/}),TryStatement:HE({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:gcn,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:mcn({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":HE({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}}),s_.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":eve,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 n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let n=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,r=e.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?e.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Pit={test:e=>/^JSX/.test(e.name),facet:lB({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Sve=dh.configure({dialect:"ts"},"typescript"),kve=dh.configure({dialect:"jsx",props:[Xge.add(e=>e.isTop?[Pit]:void 0)]}),_ve=dh.configure({dialect:"jsx ts",props:[Xge.add(e=>e.isTop?[Pit]:void 0)]},"typescript");let Mit=e=>({label:e,type:"keyword"});const $it="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(Mit),wpn=$it.concat(["declare","implements","private","protected","public"].map(Mit));function iF(e={}){let t=e.jsx?e.typescript?_ve:kve:e.typescript?Sve:dh,n=e.typescript?jit.concat(wpn):xve.concat($it);return new XS(t,[dh.data.of({autocomplete:tun(wve,Aat(n))}),dh.data.of({autocomplete:Iit}),e.jsx?Dit:[]])}function Spn(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 fPe(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return e.sliceString(r.from,Math.min(r.to,n));return""}const kpn=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Dit=xt.inputHandler.of((e,t,n,r,s)=>{if((kpn?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=">"&&r!="/"||!dh.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,o=i.changeByRange(c=>{var u;let{head:d}=c,f=Ja(i).resolveInner(d-1,-1),p;if(f.name=="JSXStartTag"&&(f=f.parent),!(i.doc.sliceString(d-1,d)!=r||f.name=="JSXAttributeValue"&&f.to>d)){if(r==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(r=="/"&&f.name=="JSXStartCloseTag"){let h=f.parent,m=h.parent;if(m&&h.from==d-2&&((p=fPe(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${p}>`;return{range:ut.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(r==">"){let h=Spn(f);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(p=fPe(i.doc,h,d)))return{range:c,changes:{from:d,insert:`</${p}>`}}}}return{range:c}});return o.changes.empty?!1:(e.dispatch([a,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function _pn(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((n,r)=>{var s;!((s=n.meta.docs)===null||s===void 0)&&s.recommended&&(t.rules[r]=2)})),n=>{let{state:r}=n,s=[];for(let{from:a,to:i}of dh.findRegions(r)){let o=r.doc.lineAt(a),c={line:o.number-1,col:a-o.from,pos:a};for(let u of e.verify(r.sliceDoc(a,i),t))s.push(Opn(u,r.doc,c))}return s}}function pPe(e,t,n,r){return n.line(e+r.line).from+t+(e==1?r.col-1:-1)}function Opn(e,t,n){let r=pPe(e.line,e.column,t,n),s={from:r,to:e.endLine!=null&&e.endColumn!=1?pPe(e.endLine,e.endColumn,t,n):r,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,o=a[0]+n.pos-r,c=a[1]+n.pos-r;s.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+o,to:d+c,insert:i},scrollIntoView:!0})}}]}return s}const Y3=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Dit,completionPath:Rit,esLint:_pn,javascript:iF,javascriptLanguage:dh,jsxLanguage:kve,localCompletionSource:Iit,scopeCompletionSource:xpn,snippets:xve,tsxLanguage:_ve,typescriptLanguage:Sve,typescriptSnippets:jit},Symbol.toStringTag,{value:"Module"})),uA=["_blank","_self","_top","_parent"],cQ=["ascii","utf-8","utf-16","latin1","latin1"],uQ=["get","post","put","delete"],dQ=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],pf=["true","false"],Vn={},Epn={a:{attrs:{href:null,ping:null,type:null,media:null,target:uA,hreflang:null}},abbr:Vn,address:Vn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Vn,aside:Vn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Vn,base:{attrs:{href:null,target:uA}},bdi:Vn,bdo:Vn,blockquote:{attrs:{cite:null}},body:Vn,br:Vn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:dQ,formmethod:uQ,formnovalidate:["novalidate"],formtarget:uA,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Vn,center:Vn,cite:Vn,code:Vn,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:Vn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Vn,div:Vn,dl:Vn,dt:Vn,em:Vn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Vn,figure:Vn,footer:Vn,form:{attrs:{action:null,name:null,"accept-charset":cQ,autocomplete:["on","off"],enctype:dQ,method:uQ,novalidate:["novalidate"],target:uA}},h1:Vn,h2:Vn,h3:Vn,h4:Vn,h5:Vn,h6:Vn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Vn,hgroup:Vn,hr:Vn,html:{attrs:{manifest:null}},i:Vn,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:dQ,formmethod:uQ,formnovalidate:["novalidate"],formtarget:uA,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:Vn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Vn,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:Vn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:cQ,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:Vn,noscript:Vn,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:Vn,param:{attrs:{name:null,value:null}},pre:Vn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Vn,rt:Vn,ruby:Vn,samp:Vn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:cQ}},section:Vn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Vn,source:{attrs:{src:null,type:null,media:null}},span:Vn,strong:Vn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Vn,summary:Vn,sup:Vn,table:Vn,tbody:Vn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Vn,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:Vn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Vn,time:{attrs:{datetime:null}},title:Vn,tr:Vn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Vn,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:Vn},Lit={accesskey:null,class:null,contenteditable:pf,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:pf,autocorrect:pf,autocapitalize:pf,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":pf,"aria-autocomplete":["inline","list","both","none"],"aria-busy":pf,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":pf,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":pf,"aria-hidden":pf,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":pf,"aria-multiselectable":pf,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":pf,"aria-relevant":null,"aria-required":pf,"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},zit="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 zit)Lit[e]=null;let yP=class{constructor(t,n){this.tags={...Epn,...t},this.globalAttrs={...Lit,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};yP.default=new yP;function DC(e,t,n=e.length){if(!t)return"";let r=t.firstChild,s=r&&r.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,n)):""}function LC(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function Fit(e,t,n){let r=n.tags[DC(e,LC(t))];return r?.children||n.allTags}function Ove(e,t){let n=[];for(let r=LC(t);r&&!r.type.isTop;r=LC(r.parent)){let s=DC(e,r);if(s&&r.lastChild.name=="CloseTag")break;s&&n.indexOf(s)<0&&(t.name=="EndTag"||t.from>=r.firstChild.to)&&n.push(s)}return n}const Bit=/^[:\-\.\w\u00b7-\uffff]*$/;function hPe(e,t,n,r,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=LC(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:s,options:Fit(e.doc,i,t).map(o=>({label:o,type:"type"})).concat(Ove(e.doc,n).map((o,c)=>({label:"/"+o,apply:"/"+o+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function mPe(e,t,n,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:Ove(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:Bit}}function Cpn(e,t,n,r){let s=[],a=0;for(let i of Fit(e.doc,n,t))s.push({label:"<"+i,type:"type"});for(let i of Ove(e.doc,n))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:r,to:r,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Tpn(e,t,n,r,s){let a=LC(n),i=a?t.tags[DC(e.doc,a)]:null,o=i&&i.attrs?Object.keys(i.attrs):[],c=i&&i.globalAttrs===!1?o:o.length?o.concat(t.globalAttrNames):t.globalAttrNames;return{from:r,to:s,options:c.map(u=>({label:u,type:"property"})),validFor:Bit}}function jpn(e,t,n,r,s){var a;let i=(a=n.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),o=[],c;if(i){let u=e.sliceDoc(i.from,i.to),d=t.globalAttrs[u];if(!d){let f=LC(n),p=f?t.tags[DC(e.doc,f)]:null;d=p?.attrs&&p.attrs[u]}if(d){let f=e.sliceDoc(r,s).toLowerCase(),p='"',h='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,p="",h=e.sliceDoc(s,s+1)==f[0]?"":f[0],f=f.slice(1),r++):c=/^[^\s<>='"]*$/;for(let m of d)o.push({label:m,apply:p+m+h,type:"constant"})}}return{from:r,to:s,options:o,validFor:c}}function Uit(e,t){let{state:n,pos:r}=t,s=Ja(n).resolveInner(r,-1),a=s.resolve(r);for(let i=r,o;a==s&&(o=s.childBefore(i));){let c=o.lastChild;if(!c||!c.type.isError||c.from<c.to)break;a=s=o,i=c.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?mPe(n,s,s.from,r):hPe(n,e,s,s.from,r):s.name=="StartTag"||s.name=="IncompleteTag"?hPe(n,e,s,r,r):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?mPe(n,s,r,r):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?Tpn(n,e,s,s.name=="AttributeName"?s.from:r,r):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?jpn(n,e,s,s.name=="Is"?r:s.from,r):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?Cpn(n,e,s,r):null}function qit(e){return Uit(yP.default,e)}function Vit(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new yP(t,n):yP.default;return s=>Uit(r,s)}const Npn=dh.parser.configure({top:"SingleExpression"}),Hit=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:Sve.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:kve.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:_ve.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Npn},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:dh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:vP.parser}],Zit=[{name:"style",parser:vP.parser.configure({top:"Styles"})}].concat(zit.map(e=>({name:e,parser:dh.parser}))),Wit=QS.define({name:"html",parser:afn.configure({props:[r_.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,n;for(let r=e.node;;){let s=r.lastChild;if(!s||s.name!="Element"||s.to!=r.to)break;t=r=s}return t&&!((n=t.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),s_.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:n.name=="CloseTag"?n.from:e.to}}}),_at.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),JI=Wit.configure({wrap:bit(Hit,Zit)});function Git(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=bit((e.nestedLanguages||[]).concat(Hit),(e.nestedAttributes||[]).concat(Zit)));let r=n?Wit.configure({wrap:n,dialect:t}):t?JI.configure({dialect:t}):JI;return new XS(r,[JI.data.of({autocomplete:Vit(e)}),e.autoCloseTags!==!1?Qit:[],iF().support,Cit().support])}const gPe=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Qit=xt.inputHandler.of((e,t,n,r,s)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!JI.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,o=i.changeByRange(c=>{var u,d,f;let p=i.doc.sliceString(c.from-1,c.to)==r,{head:h}=c,m=Ja(i).resolveInner(h,-1),g;if(p&&r==">"&&m.name=="EndTag"){let v=m.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=DC(i.doc,v.parent,h))&&!gPe.has(g)){let b=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`</${g}>`;return{range:c,changes:{from:h,to:b,insert:S}}}}else if(p&&r=="/"&&m.name=="IncompleteCloseTag"){let v=m.parent;if(m.from==h-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=DC(i.doc,v,h))&&!gPe.has(g)){let b=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`${g}>`;return{range:ut.cursor(h+S.length,-1),changes:{from:h,to:b,insert:S}}}}return{range:c}});return o.changes.empty?!1:(e.dispatch([a,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Apn=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Qit,html:Git,htmlCompletionSource:qit,htmlCompletionSourceWith:Vit,htmlLanguage:JI},Symbol.toStringTag,{value:"Module"})),Yit=lB({commentTokens:{block:{open:"<!--",close:"-->"}}}),Xit=new _r,Kit=odn.configure({props:[s_.add(e=>!e.is("Block")||e.is("Document")||due(e)!=null||Ipn(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),Xit.add(due),r_.add({Document:()=>null}),u0.add({Document:Yit})]});function due(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Ipn(e){return e.name=="OrderedList"||e.name=="BulletList"}function Rpn(e,t){let n=e;for(;;){let r=n.nextSibling,s;if(!r||(s=due(r.type))!=null&&s<=t)break;n=r}return n.to}const Ppn=fat.of((e,t,n)=>{for(let r=Ja(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let s=r.type.prop(Xit);if(s==null)continue;let a=Rpn(r,s);if(a>n)return{from:n,to:a}}return null});function Eve(e){return new Lf(Yit,e,[],"markdown")}const Jit=Eve(Kit),Mpn=Kit.configure([ydn,xdn,bdn,wdn,{props:[s_.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),ek=Eve(Mpn);function $pn(e,t){return n=>{if(n&&e){let r=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?r=e(n):r=tt.matchLanguageName(e,n,!0),r instanceof tt)return r.support?r.support.language.parser:YS.getSkippingParser(r.load());if(r)return r.parser}return t?t.parser:null}}class fQ{constructor(t,n,r,s,a,i,o){this.node=t,this.from=n,this.to=r,this.spaceBefore=s,this.spaceAfter=a,this.type=i,this.item=o}blank(t,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;r.length<t;)r+=" ";return r}else{for(let s=this.to-this.from-r.length-this.spaceAfter.length;s>0;s--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(t,n){let r=this.node.name=="OrderedList"?String(+tot(this.item,t)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function eot(e,t){let n=[],r=[];for(let s=e;s;s=s.parent){if(s.name=="FencedCode")return r;(s.name=="ListItem"||s.name=="Blockquote")&&n.push(s)}for(let s=n.length-1;s>=0;s--){let a=n[s],i,o=t.lineAt(a.from),c=a.from-o.from;if(a.name=="Blockquote"&&(i=/^ *>( ?)/.exec(o.text.slice(c))))r.push(new fQ(a,c,c+i[0].length,"",i[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(i=/^( *)\d+([.)])( *)/.exec(o.text.slice(c)))){let u=i[3],d=i[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),r.push(new fQ(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(o.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]/," ")),r.push(new fQ(a.parent,c,c+d,i[1],u,f,a))}}return r}function tot(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function pQ(e,t,n,r=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let o=tot(a,t),c=+o[2];if(s>=0){if(c!=s+1)return;n.push({from:a.from+o[1].length,to:a.from+o[0].length,insert:String(s+2+r)})}s=c}let i=a.nextSibling;if(!i)break;a=i}}function Cve(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(ij)!=" ")return e;let r=Cm(e,4,n),s="";for(let a=r;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(n)}const not=(e={})=>({state:t,dispatch:n})=>{let r=Ja(t),{doc:s}=t,a=null,i=t.changeByRange(o=>{if(!o.empty||!ek.isActiveAt(t,o.from,-1)&&!ek.isActiveAt(t,o.from,1))return a={range:o};let c=o.from,u=s.lineAt(c),d=eot(r.resolveInner(c,-1),s);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return a={range:o};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return a={range:o};let p=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&p){let b=f.node.firstChild,S=f.node.getChild("ListItem","ListItem");if(b.to>=c||S&&S.to<c||u.from>0&&!/[^\s>]/.test(s.lineAt(u.from-1).text)||e.nonTightLists===!1){let w=d.length>1?d[d.length-2]:null,_,O="";w&&w.item?(_=u.from+w.from,O=w.marker(s,1)):_=u.from+(w?w.to:0);let E=[{from:_,to:c,insert:O}];return f.node.name=="OrderedList"&&pQ(f.item,s,E,-2),w&&w.node.name=="OrderedList"&&pQ(w.item,s,E),{range:ut.cursor(_+O.length),changes:E}}else{let w=yPe(d,t,u);return{range:ut.cursor(c+w.length+1),changes:{from:u.from,insert:w+t.lineBreak}}}}if(f.node.name=="Blockquote"&&p&&u.from){let b=s.lineAt(u.from-1),S=/>\s*$/.exec(b.text);if(S&&S.index==f.from){let w=t.changes([{from:b.from+S.index,to:b.to},{from:u.from+f.from,to:u.to}]);return{range:o.map(w),changes:w}}}let h=[];f.node.name=="OrderedList"&&pQ(f.item,s,h);let m=f.item&&f.item.from<u.from,g="";if(!m||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=f.to)for(let b=0,S=d.length-1;b<=S;b++)g+=b==S&&!m?d[b].marker(s,1):d[b].blank(b<S?Cm(u.text,4,d[b+1].from)-g.length:null);let v=c;for(;v>u.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return g=Cve(g,t),Dpn(f.node,t.doc)&&(g=yPe(d,t,u)+t.lineBreak+g),h.push({from:v,to:c,insert:t.lineBreak+g}),{range:ut.cursor(v+g.length+1),changes:h}});return a?!1:(n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},rot=not();function vPe(e){return e.name=="QuoteMark"||e.name=="ListMark"}function Dpn(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,r=e.getChild("ListItem","ListItem");if(!r)return!1;let s=t.lineAt(n.to),a=t.lineAt(r.from),i=/^[\s>]*$/.test(s.text);return s.number+(i?0:1)<a.number}function yPe(e,t,n){let r="";for(let s=0,a=e.length-2;s<=a;s++)r+=e[s].blank(s<a?Cm(n.text,4,e[s+1].from)-r.length:null,s<a);return Cve(r,t)}function Lpn(e,t){let n=e.resolveInner(t,-1),r=t;vPe(n)&&(r=n.from,n=n.parent);for(let s;s=n.childBefore(r);)if(vPe(s))r=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")n=s.lastChild,r=n.to;else break;return n}const sot=({state:e,dispatch:t})=>{let n=Ja(e),r=null,s=e.changeByRange(a=>{let i=a.from,{doc:o}=e;if(a.empty&&ek.isActiveAt(e,a.from)){let c=o.lineAt(i),u=eot(Lpn(n,i),o);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:ut.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 p=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let h=d.blank(Cm(c.text,4,d.to)-Cm(c.text,4,d.from));return p==c.from&&(h=Cve(h,e)),{range:ut.cursor(p+h.length),changes:{from:p,to:c.from+d.to,insert:h}}}if(p<i)return{range:ut.cursor(p),changes:{from:p,to:i}}}}}return r={range:a}});return r?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},aot=[{key:"Enter",run:rot},{key:"Backspace",run:sot}],iot=Git({matchClosingTags:!1});function Tve(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:s}=Jit,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:o=iot}=e;if(!(s instanceof fB))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[o.support,Ppn],d;i&&u.push(oot),n instanceof XS?(u.push(n.support),d=n.language):n&&(d=n);let f=t||d?$pn(t,d):void 0;c.push(cdn({codeParser:f,htmlParser:o.language.parser})),r&&u.push(Bm.high(aj.of(aot)));let p=Eve(s.configure(c));return a&&u.push(p.data.of({autocomplete:zpn})),new XS(p,u)}function zpn(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let s=Ja(t).resolveInner(n,-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:n-r[0].length,to:n,options:Fpn(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let hQ=null;function Fpn(){if(hQ)return hQ;let e=qit(new sve(ts.create({extensions:iot}),0,!0));return hQ=e?e.options:[]}const Bpn=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,oot=xt.domEventHandlers({paste:(e,t)=>{var n;let{main:r}=t.state.selection;if(r.empty)return!1;let s=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!ek.isActiveAt(t.state,r.from,1)))return!1;let a=Ja(t.state),i=!1;return a.iterate({from:r.from,to:r.to,enter:o=>{(o.from>r.from||Bpn.test(o.name))&&(i=!0)},leave:o=>{o.to<r.to&&(i=!0)}}),i?!1:(t.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),Upn=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:Jit,deleteMarkupBackward:sot,insertNewlineContinueMarkup:rot,insertNewlineContinueMarkupCommand:not,markdown:Tve,markdownKeymap:aot,markdownLanguage:ek,pasteURLAsLink:oot},Symbol.toStringTag,{value:"Module"}));function wt(e){return new XS(tve.define(e))}function Ox(e){return rt(()=>import("./index-I7iKAQ5S.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const lot=[tt.of({name:"C",extensions:["c","h","ino"],load(){return rt(()=>import("./index-r6bKOYRE.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),tt.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return rt(()=>import("./index-r6bKOYRE.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),tt.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Ox("Cassandra")}}),tt.of({name:"CSS",extensions:["css"],load(){return rt(()=>Promise.resolve().then(()=>zfn),void 0,import.meta.url).then(e=>e.css())}}),tt.of({name:"Go",extensions:["go"],load(){return rt(()=>import("./index-2415jwSF.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.go())}}),tt.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return rt(()=>Promise.resolve().then(()=>Apn),void 0,import.meta.url).then(e=>e.html())}}),tt.of({name:"Java",extensions:["java"],load(){return rt(()=>import("./index-DlZamx3_.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),tt.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return rt(()=>Promise.resolve().then(()=>Y3),void 0,import.meta.url).then(e=>e.javascript())}}),tt.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return rt(()=>import("./index-j7GGKsyc.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),tt.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return rt(()=>Promise.resolve().then(()=>Jcn),void 0,import.meta.url).then(e=>e.json())}}),tt.of({name:"JSX",extensions:["jsx"],load(){return rt(()=>Promise.resolve().then(()=>Y3),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),tt.of({name:"LESS",extensions:["less"],load(){return rt(()=>import("./index-C9yuX5nG.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),tt.of({name:"Liquid",extensions:["liquid"],load(){return rt(()=>import("./index-DKXOwyxi.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),tt.of({name:"MariaDB SQL",load(){return Ox("MariaSQL")}}),tt.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return rt(()=>Promise.resolve().then(()=>Upn),void 0,import.meta.url).then(e=>e.markdown())}}),tt.of({name:"MS SQL",load(){return Ox("MSSQL")}}),tt.of({name:"MySQL",load(){return Ox("MySQL")}}),tt.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return rt(()=>import("./index-BuVGtMCP.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),tt.of({name:"PLSQL",extensions:["pls"],load(){return Ox("PLSQL")}}),tt.of({name:"PostgreSQL",load(){return Ox("PostgreSQL")}}),tt.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return rt(()=>import("./index-RteT7R9K.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),tt.of({name:"Rust",extensions:["rs"],load(){return rt(()=>import("./index-BKdXDppE.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),tt.of({name:"Sass",extensions:["sass"],load(){return rt(()=>import("./index-m7Q3snxP.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),tt.of({name:"SCSS",extensions:["scss"],load(){return rt(()=>import("./index-m7Q3snxP.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),tt.of({name:"SQL",extensions:["sql"],load(){return Ox("StandardSQL")}}),tt.of({name:"SQLite",load(){return Ox("SQLite")}}),tt.of({name:"TSX",extensions:["tsx"],load(){return rt(()=>Promise.resolve().then(()=>Y3),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),tt.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return rt(()=>Promise.resolve().then(()=>Y3),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),tt.of({name:"WebAssembly",extensions:["wat","wast"],load(){return rt(()=>import("./index-DNr5mf81.js"),__vite__mapDeps([12,1]),import.meta.url).then(e=>e.wast())}}),tt.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return rt(()=>import("./index-DMhguNWQ.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),tt.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return rt(()=>import("./index-BPe0JR0b.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),tt.of({name:"APL",extensions:["dyalog","apl"],load(){return rt(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>wt(e.apl))}}),tt.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return rt(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>wt(e.asciiArmor))}}),tt.of({name:"ASN.1",extensions:["asn","asn1"],load(){return rt(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>wt(e.asn1({})))}}),tt.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return rt(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>wt(e.asterisk))}}),tt.of({name:"Brainfuck",extensions:["b","bf"],load(){return rt(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>wt(e.brainfuck))}}),tt.of({name:"Cobol",extensions:["cob","cpy"],load(){return rt(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>wt(e.cobol))}}),tt.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return rt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>wt(e.csharp))}}),tt.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return rt(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>wt(e.clojure))}}),tt.of({name:"ClojureScript",extensions:["cljs"],load(){return rt(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>wt(e.clojure))}}),tt.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return rt(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>wt(e.gss))}}),tt.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return rt(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>wt(e.cmake))}}),tt.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return rt(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>wt(e.coffeeScript))}}),tt.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return rt(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>wt(e.commonLisp))}}),tt.of({name:"Cypher",extensions:["cyp","cypher"],load(){return rt(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>wt(e.cypher))}}),tt.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return rt(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>wt(e.cython))}}),tt.of({name:"Crystal",extensions:["cr"],load(){return rt(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>wt(e.crystal))}}),tt.of({name:"D",extensions:["d"],load(){return rt(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>wt(e.d))}}),tt.of({name:"Dart",extensions:["dart"],load(){return rt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>wt(e.dart))}}),tt.of({name:"diff",extensions:["diff","patch"],load(){return rt(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>wt(e.diff))}}),tt.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return rt(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>wt(e.dockerFile))}}),tt.of({name:"DTD",extensions:["dtd"],load(){return rt(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>wt(e.dtd))}}),tt.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return rt(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>wt(e.dylan))}}),tt.of({name:"EBNF",load(){return rt(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>wt(e.ebnf))}}),tt.of({name:"ECL",extensions:["ecl"],load(){return rt(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>wt(e.ecl))}}),tt.of({name:"edn",extensions:["edn"],load(){return rt(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>wt(e.clojure))}}),tt.of({name:"Eiffel",extensions:["e"],load(){return rt(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>wt(e.eiffel))}}),tt.of({name:"Elm",extensions:["elm"],load(){return rt(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>wt(e.elm))}}),tt.of({name:"Erlang",extensions:["erl"],load(){return rt(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>wt(e.erlang))}}),tt.of({name:"Esper",load(){return rt(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>wt(e.esper))}}),tt.of({name:"Factor",extensions:["factor"],load(){return rt(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>wt(e.factor))}}),tt.of({name:"FCL",load(){return rt(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>wt(e.fcl))}}),tt.of({name:"Forth",extensions:["forth","fth","4th"],load(){return rt(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>wt(e.forth))}}),tt.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return rt(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>wt(e.fortran))}}),tt.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return rt(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>wt(e.fSharp))}}),tt.of({name:"Gas",extensions:["s"],load(){return rt(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>wt(e.gas))}}),tt.of({name:"Gherkin",extensions:["feature"],load(){return rt(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>wt(e.gherkin))}}),tt.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return rt(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>wt(e.groovy))}}),tt.of({name:"Haskell",extensions:["hs"],load(){return rt(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>wt(e.haskell))}}),tt.of({name:"Haxe",extensions:["hx"],load(){return rt(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>wt(e.haxe))}}),tt.of({name:"HXML",extensions:["hxml"],load(){return rt(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>wt(e.hxml))}}),tt.of({name:"HTTP",load(){return rt(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>wt(e.http))}}),tt.of({name:"IDL",extensions:["pro"],load(){return rt(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>wt(e.idl))}}),tt.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return rt(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>wt(e.jsonld))}}),tt.of({name:"Julia",extensions:["jl"],load(){return rt(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>wt(e.julia))}}),tt.of({name:"Kotlin",extensions:["kt","kts"],load(){return rt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>wt(e.kotlin))}}),tt.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return rt(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>wt(e.liveScript))}}),tt.of({name:"Lua",extensions:["lua"],load(){return rt(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>wt(e.lua))}}),tt.of({name:"mIRC",extensions:["mrc"],load(){return rt(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>wt(e.mirc))}}),tt.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return rt(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>wt(e.mathematica))}}),tt.of({name:"Modelica",extensions:["mo"],load(){return rt(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>wt(e.modelica))}}),tt.of({name:"MUMPS",extensions:["mps"],load(){return rt(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>wt(e.mumps))}}),tt.of({name:"Mbox",extensions:["mbox"],load(){return rt(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>wt(e.mbox))}}),tt.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return rt(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>wt(e.nginx))}}),tt.of({name:"NSIS",extensions:["nsh","nsi"],load(){return rt(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([18,16]),import.meta.url).then(e=>wt(e.nsis))}}),tt.of({name:"NTriples",extensions:["nt","nq"],load(){return rt(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>wt(e.ntriples))}}),tt.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return rt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>wt(e.objectiveC))}}),tt.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return rt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>wt(e.objectiveCpp))}}),tt.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return rt(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>wt(e.oCaml))}}),tt.of({name:"Octave",extensions:["m"],load(){return rt(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>wt(e.octave))}}),tt.of({name:"Oz",extensions:["oz"],load(){return rt(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>wt(e.oz))}}),tt.of({name:"Pascal",extensions:["p","pas"],load(){return rt(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>wt(e.pascal))}}),tt.of({name:"Perl",extensions:["pl","pm"],load(){return rt(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>wt(e.perl))}}),tt.of({name:"Pig",extensions:["pig"],load(){return rt(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>wt(e.pig))}}),tt.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return rt(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>wt(e.powerShell))}}),tt.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return rt(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>wt(e.properties))}}),tt.of({name:"ProtoBuf",extensions:["proto"],load(){return rt(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>wt(e.protobuf))}}),tt.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return rt(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>wt(e.pug))}}),tt.of({name:"Puppet",extensions:["pp"],load(){return rt(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>wt(e.puppet))}}),tt.of({name:"Q",extensions:["q"],load(){return rt(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>wt(e.q))}}),tt.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return rt(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>wt(e.r))}}),tt.of({name:"RPM Changes",load(){return rt(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>wt(e.rpmChanges))}}),tt.of({name:"RPM Spec",extensions:["spec"],load(){return rt(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>wt(e.rpmSpec))}}),tt.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return rt(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>wt(e.ruby))}}),tt.of({name:"SAS",extensions:["sas"],load(){return rt(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>wt(e.sas))}}),tt.of({name:"Scala",extensions:["scala"],load(){return rt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>wt(e.scala))}}),tt.of({name:"Scheme",extensions:["scm","ss"],load(){return rt(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>wt(e.scheme))}}),tt.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return rt(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>wt(e.shell))}}),tt.of({name:"Sieve",extensions:["siv","sieve"],load(){return rt(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>wt(e.sieve))}}),tt.of({name:"Smalltalk",extensions:["st"],load(){return rt(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>wt(e.smalltalk))}}),tt.of({name:"Solr",load(){return rt(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>wt(e.solr))}}),tt.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return rt(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>wt(e.sml))}}),tt.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return rt(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>wt(e.sparql))}}),tt.of({name:"Spreadsheet",alias:["excel","formula"],load(){return rt(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>wt(e.spreadsheet))}}),tt.of({name:"Squirrel",extensions:["nut"],load(){return rt(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>wt(e.squirrel))}}),tt.of({name:"Stylus",extensions:["styl"],load(){return rt(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>wt(e.stylus))}}),tt.of({name:"Swift",extensions:["swift"],load(){return rt(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>wt(e.swift))}}),tt.of({name:"sTeX",load(){return rt(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>wt(e.stex))}}),tt.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return rt(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>wt(e.stex))}}),tt.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return rt(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>wt(e.verilog))}}),tt.of({name:"Tcl",extensions:["tcl"],load(){return rt(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>wt(e.tcl))}}),tt.of({name:"Textile",extensions:["textile"],load(){return rt(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>wt(e.textile))}}),tt.of({name:"TiddlyWiki",load(){return rt(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>wt(e.tiddlyWiki))}}),tt.of({name:"Tiki wiki",load(){return rt(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>wt(e.tiki))}}),tt.of({name:"TOML",extensions:["toml"],load(){return rt(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>wt(e.toml))}}),tt.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return rt(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>wt(e.troff))}}),tt.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return rt(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>wt(e.ttcn))}}),tt.of({name:"TTCN_CFG",extensions:["cfg"],load(){return rt(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>wt(e.ttcnCfg))}}),tt.of({name:"Turtle",extensions:["ttl"],load(){return rt(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>wt(e.turtle))}}),tt.of({name:"Web IDL",extensions:["webidl"],load(){return rt(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>wt(e.webIDL))}}),tt.of({name:"VB.NET",extensions:["vb"],load(){return rt(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>wt(e.vb))}}),tt.of({name:"VBScript",extensions:["vbs"],load(){return rt(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>wt(e.vbScript))}}),tt.of({name:"Velocity",extensions:["vtl"],load(){return rt(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>wt(e.velocity))}}),tt.of({name:"Verilog",extensions:["v"],load(){return rt(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>wt(e.verilog))}}),tt.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return rt(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>wt(e.vhdl))}}),tt.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return rt(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>wt(e.xQuery))}}),tt.of({name:"Yacas",extensions:["ys"],load(){return rt(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>wt(e.yacas))}}),tt.of({name:"Z80",extensions:["z80"],load(){return rt(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>wt(e.z80))}}),tt.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return rt(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>wt(e.mscgen))}}),tt.of({name:"Xù",extensions:["xu"],load(){return rt(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>wt(e.xu))}}),tt.of({name:"MsGenny",extensions:["msgenny"],load(){return rt(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>wt(e.msgenny))}}),tt.of({name:"Vue",extensions:["vue"],load(){return rt(()=>import("./index-Bl84VfP3.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),tt.of({name:"Angular Template",load(){return rt(()=>import("./index-BNvRyoez.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];function bP(){return bP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bP.apply(null,arguments)}var qpn=e=>{var{theme:t,settings:n={},styles:r=[]}=e,s={".cm-gutters":{}},a={};n.background&&(a.backgroundColor=n.background),n.backgroundImage&&(a.backgroundImage=n.backgroundImage),n.foreground&&(a.color=n.foreground),n.fontSize&&(a.fontSize=n.fontSize),(n.background||n.foreground)&&(s["&"]=a),n.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(s[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(s[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(s[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(s[".cm-content"]={caretColor:n.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var i={};n.gutterActiveForeground&&(i.color=n.gutterActiveForeground),n.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:n.lineHighlight},i.backgroundColor=n.lineHighlight),s[".cm-activeLineGutter"]=i,n.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:n.selection+" !important"}),n.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch});var o=xt.theme(s,{dark:t==="dark"}),c=Um.define(r),u=[o,Cw(c)];return u},Vpn={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)"},Hpn=[{tag:ae.comment,color:"#6272a4"},{tag:ae.string,color:"#f1fa8c"},{tag:ae.atom,color:"#bd93f9"},{tag:ae.meta,color:"#f8f8f2"},{tag:[ae.keyword,ae.operator,ae.tagName],color:"#ff79c6"},{tag:[ae.function(ae.propertyName),ae.propertyName],color:"#66d9ef"},{tag:[ae.definition(ae.variableName),ae.function(ae.variableName),ae.className,ae.attributeName],color:"#50fa7b"},{tag:ae.atom,color:"#bd93f9"}],lj=e=>{var{theme:t="dark",settings:n={},styles:r=[]}=e||{};return qpn({theme:t,settings:bP({},Vpn,n),styles:[...Hpn,...r]})};lj();function cot(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}const Zpn=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Nve(e.state,n.from);return r.line?Wpn(e):r.block?Qpn(e):!1};function jve(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let s=e(t,n);return s?(r(n.update(s)),!0):!1}}const Wpn=jve(Kpn,0),Gpn=jve(uot,0),Qpn=jve((e,t)=>uot(e,t,Xpn(t)),0);function Nve(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const dA=50;function Ypn(e,{open:t,close:n},r,s){let a=e.sliceDoc(r-dA,r),i=e.sliceDoc(s,s+dA),o=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(i)[0].length,u=a.length-o;if(a.slice(u-t.length,u)==t&&i.slice(c,c+n.length)==n)return{open:{pos:r-o,margin:o&&1},close:{pos:s+c,margin:c&&1}};let d,f;s-r<=2*dA?d=f=e.sliceDoc(r,s):(d=e.sliceDoc(r,r+dA),f=e.sliceDoc(s-dA,s));let p=/^\s*/.exec(d)[0].length,h=/\s*$/.exec(f)[0].length,m=f.length-h-n.length;return d.slice(p,p+t.length)==t&&f.slice(m,m+n.length)==n?{open:{pos:r+p+t.length,margin:/\s/.test(d.charAt(p+t.length))?1:0},close:{pos:s-h-n.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function Xpn(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),s=n.to<=r.to?r:e.doc.lineAt(n.to);s.from>r.from&&s.from==n.to&&(s=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=s.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:s.to})}return t}function uot(e,t,n=t.selection.ranges){let r=n.map(a=>Nve(t,a.from).block);if(!r.every(a=>a))return null;let s=n.map((a,i)=>Ypn(t,r[i],a.from,a.to));if(e!=2&&!s.every(a=>a))return{changes:t.changes(n.map((a,i)=>s[i]?[]:[{from:a.from,insert:r[i].open+" "},{from:a.to,insert:" "+r[i].close}]))};if(e!=1&&s.some(a=>a)){let a=[];for(let i=0,o;i<s.length;i++)if(o=s[i]){let c=r[i],{open:u,close:d}=o;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 Kpn(e,t,n=t.selection.ranges){let r=[],s=-1;for(let{from:a,to:i}of n){let o=r.length,c=1e9,u=Nve(t,a).line;if(u){for(let d=a;d<=i;){let f=t.doc.lineAt(d);if(f.from>s&&(a==i||i>f.from)){s=f.from;let p=/^\s*/.exec(f.text)[0].length,h=p==f.length,m=f.text.slice(p,p+u.length)==u?p:-1;p<f.text.length&&p<c&&(c=p),r.push({line:f,comment:m,token:u,indent:p,empty:h,single:!1})}d=f.to+1}if(c<1e9)for(let d=o;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=c);r.length==o+1&&(r[o].single=!0)}}if(e!=2&&r.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:o,token:c,indent:u,empty:d,single:f}of r)(f||!d)&&a.push({from:o.from+u,insert:c+" "});let i=t.changes(a);return{changes:i,selection:t.selection.map(i,1)}}else if(e!=1&&r.some(a=>a.comment>=0)){let a=[];for(let{line:i,comment:o,token:c}of r)if(o>=0){let u=i.from+o,d=u+c.length;i.text[d-i.from]==" "&&d++,a.push({from:u,to:d})}return{changes:a}}return null}const fue=Ev.define(),Jpn=Ev.define(),ehn=dn.define(),dot=dn.define({combine(e){return Cv(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,s)=>t(r,s)||n(r,s)})}}),fot=Yo.define({create(){return zg.empty},update(e,t){let n=t.state.facet(dot),r=t.annotation(fue);if(r){let c=Cd.fromTransaction(t,r.selection),u=r.side,d=u==0?e.undone:e.done;return c?d=oF(d,d.length,n.minDepth,c):d=mot(d,t.startState.selection),new zg(u==0?r.rest:d,u==0?d:r.rest)}let s=t.annotation(Jpn);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(ul.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Cd.fromTransaction(t),i=t.annotation(ul.time),o=t.annotation(ul.userEvent);return a?e=e.addChanges(a,i,o,n,t):t.selection&&(e=e.addSelection(t.startState.selection,i,o,n.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 zg(e.done.map(Cd.fromJSON),e.undone.map(Cd.fromJSON))}});function thn(e={}){return[fot,dot.of(e),xt.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?pot:t.inputType=="historyRedo"?pue:null;return r?(t.preventDefault(),r(n)):!1}})]}function pB(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let s=n.field(fot,!1);if(!s)return!1;let a=s.pop(e,n,t);return a?(r(a),!0):!1}}const pot=pB(0,!1),pue=pB(1,!1),nhn=pB(0,!0),rhn=pB(1,!0);class Cd{constructor(t,n,r,s,a){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=s,this.selectionsAfter=a}setSelAfter(t){return new Cd(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(t){return new Cd(t.changes&&ll.fromJSON(t.changes),[],t.mapped&&Kg.fromJSON(t.mapped),t.startSelection&&ut.fromJSON(t.startSelection),t.selectionsAfter.map(ut.fromJSON))}static fromTransaction(t,n){let r=eh;for(let s of t.startState.facet(ehn)){let a=s(t);a.length&&(r=r.concat(a))}return!r.length&&t.changes.empty?null:new Cd(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,eh)}static selection(t){return new Cd(void 0,eh,void 0,void 0,t)}}function oF(e,t,n,r){let s=t+1>n+20?t-n-1:0,a=e.slice(s,t);return a.push(r),a}function shn(e,t){let n=[],r=!1;return e.iterChangedRanges((s,a)=>n.push(s,a)),t.iterChangedRanges((s,a,i,o)=>{for(let c=0;c<n.length;){let u=n[c++],d=n[c++];o>=u&&i<=d&&(r=!0)}}),r}function ahn(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function hot(e,t){return e.length?t.length?e.concat(t):e:t}const eh=[],ihn=200;function mot(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-ihn));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),oF(e,e.length-1,1e9,n.setSelAfter(r)))}else return[Cd.selection([t])]}function ohn(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function mQ(e,t){if(!e.length)return e;let n=e.length,r=eh;for(;n;){let s=lhn(e[n-1],t,r);if(s.changes&&!s.changes.empty||s.effects.length){let a=e.slice(0,n);return a[n-1]=s,a}else t=s.mapped,n--,r=s.selectionsAfter}return r.length?[Cd.selection(r)]:eh}function lhn(e,t,n){let r=hot(e.selectionsAfter.length?e.selectionsAfter.map(o=>o.map(t)):eh,n);if(!e.changes)return Cd.selection(r);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new Cd(s,mr.mapEffects(e.effects,t),i,e.startSelection.map(a),r)}const chn=/^(input\.type|delete)($|\.)/;class zg{constructor(t,n,r=0,s=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new zg(this.done,this.undone):this}addChanges(t,n,r,s,a){let i=this.done,o=i[i.length-1];return o&&o.changes&&!o.changes.empty&&t.changes&&(!r||chn.test(r))&&(!o.selectionsAfter.length&&n-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,shn(o.changes,t.changes))||r=="input.type.compose")?i=oF(i,i.length-1,s.minDepth,new Cd(t.changes.compose(o.changes),hot(mr.mapEffects(t.effects,o.changes),o.effects),o.mapped,o.startSelection,eh)):i=oF(i,i.length,s.minDepth,t),new zg(i,eh,n,r)}addSelection(t,n,r,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:eh;return a.length>0&&n-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&ahn(a[a.length-1],t)?this:new zg(mot(this.done,t),this.undone,n,r)}addMapping(t){return new zg(mQ(this.done,t),mQ(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let s=t==0?this.done:this.undone;if(s.length==0)return null;let a=s[s.length-1],i=a.selectionsAfter[0]||n.selection;if(r&&a.selectionsAfter.length)return n.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:fue.of({side:t,rest:ohn(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let o=s.length==1?eh:s.slice(0,s.length-1);return a.mapped&&(o=mQ(o,a.mapped)),n.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:fue.of({side:t,rest:o,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}zg.empty=new zg(eh,eh);const uhn=[{key:"Mod-z",run:pot,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:pue,preventDefault:!0},{linux:"Ctrl-Shift-z",run:pue,preventDefault:!0},{key:"Mod-u",run:nhn,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:rhn,preventDefault:!0}];function cj(e,t){return ut.create(e.ranges.map(t),e.mainIndex)}function qm(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Vm({state:e,dispatch:t},n){let r=cj(e.selection,n);return r.eq(e.selection,!0)?!1:(t(qm(e,r)),!0)}function hB(e,t){return ut.cursor(t?e.to:e.from)}function got(e,t){return Vm(e,n=>n.empty?e.moveByChar(n,t):hB(n,t))}function xu(e){return e.textDirectionAt(e.state.selection.main.head)==ri.LTR}const vot=e=>got(e,!xu(e)),yot=e=>got(e,xu(e));function bot(e,t){return Vm(e,n=>n.empty?e.moveByGroup(n,t):hB(n,t))}const dhn=e=>bot(e,!xu(e)),fhn=e=>bot(e,xu(e));function phn(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function mB(e,t,n){let r=Ja(e).resolveInner(t.head),s=n?_r.closedBy:_r.openedBy;for(let c=t.head;;){let u=n?r.childAfter(c):r.childBefore(c);if(!u)break;phn(e,u,s)?r=u:c=n?u.to:u.from}let a=r.type.prop(s),i,o;return a&&(i=n?Lg(e,r.from,1):Lg(e,r.to,-1))&&i.matched?o=n?i.end.to:i.end.from:o=n?r.to:r.from,ut.cursor(o,n?-1:1)}const hhn=e=>Vm(e,t=>mB(e.state,t,!xu(e))),mhn=e=>Vm(e,t=>mB(e.state,t,xu(e)));function xot(e,t){return Vm(e,n=>{if(!n.empty)return hB(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const wot=e=>xot(e,!1),Sot=e=>xot(e,!0);function kot(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,s;if(t){for(let a of e.state.facet(xt.scrollMargins)){let i=a(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}s=e.scrollDOM.clientHeight-n-r}else s=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,s-5)}}function _ot(e,t){let n=kot(e),{state:r}=e,s=cj(r.selection,i=>i.empty?e.moveVertically(i,t,n.height):hB(i,t));if(s.eq(r.selection))return!1;let a;if(n.selfScroll){let i=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),c=o.top+n.marginTop,u=o.bottom-n.marginBottom;i&&i.top>c&&i.bottom<u&&(a=xt.scrollIntoView(s.main.head,{y:"start",yMargin:i.top-c}))}return e.dispatch(qm(r,s),{effects:a}),!0}const bPe=e=>_ot(e,!1),hue=e=>_ot(e,!0);function Tw(e,t,n){let r=e.lineBlockAt(t.head),s=e.moveToLineBoundary(t,n);if(s.head==t.head&&s.head!=(n?r.to:r.from)&&(s=e.moveToLineBoundary(t,n,!1)),!n&&s.head==r.from&&r.length){let a=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;a&&t.head!=r.from+a&&(s=ut.cursor(r.from+a))}return s}const ghn=e=>Vm(e,t=>Tw(e,t,!0)),vhn=e=>Vm(e,t=>Tw(e,t,!1)),yhn=e=>Vm(e,t=>Tw(e,t,!xu(e))),bhn=e=>Vm(e,t=>Tw(e,t,xu(e))),xhn=e=>Vm(e,t=>ut.cursor(e.lineBlockAt(t.head).from,1)),whn=e=>Vm(e,t=>ut.cursor(e.lineBlockAt(t.head).to,-1));function Shn(e,t,n){let r=!1,s=cj(e.selection,a=>{let i=Lg(e,a.head,-1)||Lg(e,a.head,1)||a.head>0&&Lg(e,a.head-1,1)||a.head<e.doc.length&&Lg(e,a.head+1,-1);if(!i||!i.end)return a;r=!0;let o=i.start.from==a.head?i.end.to:i.end.from;return ut.cursor(o)});return r?(t(qm(e,s)),!0):!1}const khn=({state:e,dispatch:t})=>Shn(e,t);function Rh(e,t){let n=cj(e.state.selection,r=>{let s=t(r);return ut.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(qm(e.state,n)),!0)}function Oot(e,t){return Rh(e,n=>e.moveByChar(n,t))}const Eot=e=>Oot(e,!xu(e)),Cot=e=>Oot(e,xu(e));function Tot(e,t){return Rh(e,n=>e.moveByGroup(n,t))}const _hn=e=>Tot(e,!xu(e)),Ohn=e=>Tot(e,xu(e)),Ehn=e=>Rh(e,t=>mB(e.state,t,!xu(e))),Chn=e=>Rh(e,t=>mB(e.state,t,xu(e)));function jot(e,t){return Rh(e,n=>e.moveVertically(n,t))}const Not=e=>jot(e,!1),Aot=e=>jot(e,!0);function Iot(e,t){return Rh(e,n=>e.moveVertically(n,t,kot(e).height))}const xPe=e=>Iot(e,!1),wPe=e=>Iot(e,!0),Thn=e=>Rh(e,t=>Tw(e,t,!0)),jhn=e=>Rh(e,t=>Tw(e,t,!1)),Nhn=e=>Rh(e,t=>Tw(e,t,!xu(e))),Ahn=e=>Rh(e,t=>Tw(e,t,xu(e))),Ihn=e=>Rh(e,t=>ut.cursor(e.lineBlockAt(t.head).from)),Rhn=e=>Rh(e,t=>ut.cursor(e.lineBlockAt(t.head).to)),SPe=({state:e,dispatch:t})=>(t(qm(e,{anchor:0})),!0),kPe=({state:e,dispatch:t})=>(t(qm(e,{anchor:e.doc.length})),!0),_Pe=({state:e,dispatch:t})=>(t(qm(e,{anchor:e.selection.main.anchor,head:0})),!0),OPe=({state:e,dispatch:t})=>(t(qm(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Phn=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Mhn=({state:e,dispatch:t})=>{let n=gB(e).map(({from:r,to:s})=>ut.range(r,Math.min(s+1,e.doc.length)));return t(e.update({selection:ut.create(n),userEvent:"select"})),!0},$hn=({state:e,dispatch:t})=>{let n=cj(e.selection,r=>{let s=Ja(e),a=s.resolveStack(r.from,1);if(r.empty){let i=s.resolveStack(r.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:o}=i;if((o.from<r.from&&o.to>=r.to||o.to>r.to&&o.from<=r.from)&&i.next)return ut.range(o.to,o.from)}return r});return n.eq(e.selection)?!1:(t(qm(e,n)),!0)};function Rot(e,t){let{state:n}=e,r=n.selection,s=n.selection.ranges.slice();for(let a of n.selection.ranges){let i=n.doc.lineAt(a.head);if(t?i.to<e.state.doc.length:i.from>0)for(let o=a;;){let c=e.moveVertically(o,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==o.head)break;o=c}}}return s.length==r.ranges.length?!1:(e.dispatch(qm(n,ut.create(s,s.length-1))),!0)}const Dhn=e=>Rot(e,!1),Lhn=e=>Rot(e,!0),zhn=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=ut.create([n.main]):n.main.empty||(r=ut.create([ut.cursor(n.main.head)])),r?(t(qm(e,r)),!0):!1};function BM(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,s=r.changeByRange(a=>{let{from:i,to:o}=a;if(i==o){let c=t(a);c<i?(n="delete.backward",c=X3(e,c,!1)):c>i&&(n="delete.forward",c=X3(e,c,!0)),i=Math.min(i,c),o=Math.max(o,c)}else i=X3(e,i,!1),o=X3(e,o,!0);return i==o?{range:a}:{changes:{from:i,to:o},range:ut.cursor(i,i<a.head?-1:1)}});return s.changes.empty?!1:(e.dispatch(r.update(s,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?xt.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function X3(e,t,n){if(e instanceof xt)for(let r of e.state.facet(xt.atomicRanges).map(s=>s(e)))r.between(t,t,(s,a)=>{s<t&&a>t&&(t=n?a:s)});return t}const Pot=(e,t,n)=>BM(e,r=>{let s=r.from,{state:a}=e,i=a.doc.lineAt(s),o,c;if(n&&!t&&s>i.from&&s<i.from+200&&!/[^ \t]/.test(o=i.text.slice(0,s-i.from))){if(o[o.length-1]==" ")return s-1;let u=Cm(o,a.tabSize),d=u%KS(a)||KS(a);for(let f=0;f<d&&o[o.length-1-f]==" ";f++)s--;c=s}else c=Zl(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=Zl(i.text,c-i.from,!1,!1)+i.from);return c}),mue=e=>Pot(e,!1,!0),Mot=e=>Pot(e,!0,!1),$ot=(e,t)=>BM(e,n=>{let r=n.head,{state:s}=e,a=s.doc.lineAt(r),i=s.charCategorizer(r);for(let o=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?s.doc.lines:1)&&(r+=t?1:-1);break}let c=Zl(a.text,r-a.from,t)+a.from,u=a.text.slice(Math.min(r,c)-a.from,Math.max(r,c)-a.from),d=i(u);if(o!=null&&d!=o)break;(u!=" "||r!=n.head)&&(o=d),r=c}return r}),Dot=e=>$ot(e,!1),Fhn=e=>$ot(e,!0),Bhn=e=>BM(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Uhn=e=>BM(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),qhn=e=>BM(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Vhn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:ia.of(["",""])},range:ut.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Hhn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let s=r.from,a=e.doc.lineAt(s),i=s==a.from?s-1:Zl(a.text,s-a.from,!1)+a.from,o=s==a.to?s+1:Zl(a.text,s-a.from,!0)+a.from;return{changes:{from:i,to:o,insert:e.doc.slice(s,o).append(e.doc.slice(i,s))},range:ut.cursor(o)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function gB(e){let t=[],n=-1;for(let r of e.selection.ranges){let s=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=s.number){let i=t[t.length-1];i.to=a.to,i.ranges.push(r)}else t.push({from:s.from,to:a.to,ranges:[r]});n=a.number+1}return t}function Lot(e,t,n){if(e.readOnly)return!1;let r=[],s=[];for(let a of gB(e)){if(n?a.to==e.doc.length:a.from==0)continue;let i=e.doc.lineAt(n?a.to+1:a.from-1),o=i.length+1;if(n){r.push({from:a.to,to:i.to},{from:a.from,insert:i.text+e.lineBreak});for(let c of a.ranges)s.push(ut.range(Math.min(e.doc.length,c.anchor+o),Math.min(e.doc.length,c.head+o)))}else{r.push({from:i.from,to:a.from},{from:a.to,insert:e.lineBreak+i.text});for(let c of a.ranges)s.push(ut.range(c.anchor-o,c.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:ut.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Zhn=({state:e,dispatch:t})=>Lot(e,t,!1),Whn=({state:e,dispatch:t})=>Lot(e,t,!0);function zot(e,t,n){if(e.readOnly)return!1;let r=[];for(let a of gB(e))n?r.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):r.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)});let s=e.changes(r);return t(e.update({changes:s,selection:e.selection.map(s,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Ghn=({state:e,dispatch:t})=>zot(e,t,!1),Qhn=({state:e,dispatch:t})=>zot(e,t,!0),Yhn=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(gB(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),r=cj(t.selection,s=>{let a;if(e.lineWrapping){let i=e.lineBlockAt(s.head),o=e.coordsAtPos(s.head,s.assoc||1);o&&(a=i.bottom+e.documentTop-o.bottom+e.defaultLineHeight/2)}return e.moveVertically(s,!0,a)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Xhn(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Ja(e).resolveInner(t),r=n.childBefore(t),s=n.childAfter(t),a;return r&&s&&r.to<=t&&s.from>=t&&(a=r.type.prop(_r.closedBy))&&a.indexOf(s.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const EPe=Fot(!1),Khn=Fot(!0);function Fot(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(s=>{let{from:a,to:i}=s,o=t.doc.lineAt(a),c=!e&&a==i&&Xhn(t,a);e&&(a=i=(i<=o.to?o:t.doc.lineAt(i)).to);let u=new cB(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=Kge(u,a);for(d==null&&(d=Cm(/^\s*/.exec(t.doc.lineAt(a).text)[0],t.tabSize));i<o.to&&/\s/.test(o.text[i-o.from]);)i++;c?{from:a,to:i}=c:a>o.from&&a<o.from+100&&!/\S/.test(o.text.slice(0,a))&&(a=o.from);let f=["",cP(t,d)];return c&&f.push(cP(t,u.lineIndent(o.from,-1))),{changes:{from:a,to:i,insert:ia.of(f)},range:ut.cursor(a+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Ave(e,t){let n=-1;return e.changeByRange(r=>{let s=[];for(let i=r.from;i<=r.to;){let o=e.doc.lineAt(i);o.number>n&&(r.empty||r.to>o.from)&&(t(o,s,r),n=o.number),i=o.to+1}let a=e.changes(s);return{changes:s,range:ut.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}const Jhn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new cB(e,{overrideIndentation:a=>{let i=n[a];return i??-1}}),s=Ave(e,(a,i,o)=>{let c=Kge(r,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=cP(e,c);(u!=d||o.from<a.from+u.length)&&(n[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},Bot=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Ave(e,(n,r)=>{r.push({from:n.from,insert:e.facet(ij)})}),{userEvent:"input.indent"})),!0),Uot=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Ave(e,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let a=Cm(s,e.tabSize),i=0,o=cP(e,Math.max(0,a-KS(e)));for(;i<s.length&&i<o.length&&s.charCodeAt(i)==o.charCodeAt(i);)i++;r.push({from:n.from+i,to:n.from+s.length,insert:o.slice(i)})}),{userEvent:"delete.dedent"})),!0),emn=e=>(e.setTabFocusMode(),!0),tmn=[{key:"Ctrl-b",run:vot,shift:Eot,preventDefault:!0},{key:"Ctrl-f",run:yot,shift:Cot},{key:"Ctrl-p",run:wot,shift:Not},{key:"Ctrl-n",run:Sot,shift:Aot},{key:"Ctrl-a",run:xhn,shift:Ihn},{key:"Ctrl-e",run:whn,shift:Rhn},{key:"Ctrl-d",run:Mot},{key:"Ctrl-h",run:mue},{key:"Ctrl-k",run:Bhn},{key:"Ctrl-Alt-h",run:Dot},{key:"Ctrl-o",run:Vhn},{key:"Ctrl-t",run:Hhn},{key:"Ctrl-v",run:hue}],nmn=[{key:"ArrowLeft",run:vot,shift:Eot,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:dhn,shift:_hn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:yhn,shift:Nhn,preventDefault:!0},{key:"ArrowRight",run:yot,shift:Cot,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:fhn,shift:Ohn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:bhn,shift:Ahn,preventDefault:!0},{key:"ArrowUp",run:wot,shift:Not,preventDefault:!0},{mac:"Cmd-ArrowUp",run:SPe,shift:_Pe},{mac:"Ctrl-ArrowUp",run:bPe,shift:xPe},{key:"ArrowDown",run:Sot,shift:Aot,preventDefault:!0},{mac:"Cmd-ArrowDown",run:kPe,shift:OPe},{mac:"Ctrl-ArrowDown",run:hue,shift:wPe},{key:"PageUp",run:bPe,shift:xPe},{key:"PageDown",run:hue,shift:wPe},{key:"Home",run:vhn,shift:jhn,preventDefault:!0},{key:"Mod-Home",run:SPe,shift:_Pe},{key:"End",run:ghn,shift:Thn,preventDefault:!0},{key:"Mod-End",run:kPe,shift:OPe},{key:"Enter",run:EPe,shift:EPe},{key:"Mod-a",run:Phn},{key:"Backspace",run:mue,shift:mue,preventDefault:!0},{key:"Delete",run:Mot,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Dot,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Fhn,preventDefault:!0},{mac:"Mod-Backspace",run:Uhn,preventDefault:!0},{mac:"Mod-Delete",run:qhn,preventDefault:!0}].concat(tmn.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),rmn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:hhn,shift:Ehn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:mhn,shift:Chn},{key:"Alt-ArrowUp",run:Zhn},{key:"Shift-Alt-ArrowUp",run:Ghn},{key:"Alt-ArrowDown",run:Whn},{key:"Shift-Alt-ArrowDown",run:Qhn},{key:"Mod-Alt-ArrowUp",run:Dhn},{key:"Mod-Alt-ArrowDown",run:Lhn},{key:"Escape",run:zhn},{key:"Mod-Enter",run:Khn},{key:"Alt-l",mac:"Ctrl-l",run:Mhn},{key:"Mod-i",run:$hn,preventDefault:!0},{key:"Mod-[",run:Uot},{key:"Mod-]",run:Bot},{key:"Mod-Alt-\\",run:Jhn},{key:"Shift-Mod-k",run:Yhn},{key:"Shift-Mod-\\",run:khn},{key:"Mod-/",run:Zpn},{key:"Alt-A",run:Gpn},{key:"Ctrl-m",mac:"Shift-Alt-m",run:emn}].concat(nmn),smn={key:"Tab",run:Bot,shift:Uot},CPe=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class ob{constructor(t,n,r=0,s=t.length,a,i){this.test=i,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,s),this.bufferStart=r,this.normalize=a?o=>a(CPe(o)):CPe,this.query=this.normalize(n)}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 wd(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 n=Rge(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=Cg(t);let s=this.normalize(n);if(s.length)for(let a=0,i=r,o=!0;;a++){let c=s.charCodeAt(a),u=this.match(c,i,o,this.bufferPos+this.bufferStart,a==s.length-1);if(u)return this.value=u,this;if(a==s.length-1)break;o&&a<n.length&&n.charCodeAt(a)==c?i++:o=!1}}}match(t,n,r,s,a){let i=null;for(let o=0;o<this.matches.length;){let c=this.matches[o],u=!1;this.query.charCodeAt(c.index)==t&&(c.index==this.query.length-1?i={from:c.from,to:s,precise:a&&c.precise}:(c.index++,u=!0)),u?o++:this.matches.splice(o,1)}return this.query.charCodeAt(0)==t&&(this.query.length==1?i={from:n,to:s,precise:r&&a}:this.matches.push({from:n,index:1,precise:r})),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(ob.prototype[Symbol.iterator]=function(){return this});const qot={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Ive="gm"+(/x/.unicode==null?"":"u");class Vot{constructor(t,n,r,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=qot,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new Hot(t,n,r,s,a);this.re=new RegExp(n,Ive+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=lF(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 n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,s=r+n[0].length;if(this.matchPos=lF(this.text,s+(r==s?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<s||r>this.value.to)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,precise:!0,match:n},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 gQ=new WeakMap;class WE{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let s=gQ.get(t);if(!s||s.from>=r||s.to<=n){let o=new WE(n,t.sliceString(n,r));return gQ.set(t,o),o}if(s.from==n&&s.to==r)return s;let{text:a,from:i}=s;return i>n&&(a=t.sliceString(n,i)+a,i=n),s.to<r&&(a+=t.sliceString(s.to,r)),gQ.set(t,new WE(i,a)),new WE(n,a.slice(n-i,r-i))}}class Hot{constructor(t,n,r,s,a){this.text=t,this.to=a,this.done=!1,this.value=qot,this.matchPos=lF(t,s),this.re=new RegExp(n,Ive+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=WE.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,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,s=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,precise:!0,match:n},this.matchPos=lF(this.text,s+(r==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=WE.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Vot.prototype[Symbol.iterator]=Hot.prototype[Symbol.iterator]=function(){return this});function amn(e){try{return new RegExp(e,Ive),!0}catch{return!1}}function lF(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}const imn=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:s}=Zln(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},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:r});return}let o=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=i,p=d?+d.slice(1):0,h=u?+u:o.number;if(u&&f){let v=h/100;c&&(v=v*(c=="-"?-1:1)+o.number/t.doc.lines),h=Math.round(t.doc.lines*v)}else u&&c&&(h=h*(c=="-"?-1:1)+o.number);let m=t.doc.line(Math.max(1,Math.min(t.doc.lines,h))),g=ut.cursor(m.from+Math.max(0,Math.min(p,m.length)));e.dispatch({effects:[r,xt.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},omn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},lmn=dn.define({combine(e){return Cv(e,omn,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function cmn(e){return[hmn,pmn]}const umn=hn.mark({class:"cm-selectionMatch"}),dmn=hn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function TPe(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=Bi.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=Bi.Word)}function fmn(e,t,n,r){return e(t.sliceDoc(n,n+1))==Bi.Word&&e(t.sliceDoc(r-1,r))==Bi.Word}const pmn=Hi.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(lmn),{state:n}=e,r=n.selection;if(r.ranges.length>1)return hn.none;let s=r.main,a,i=null;if(s.empty){if(!t.highlightWordAroundCursor)return hn.none;let c=n.wordAt(s.head);if(!c)return hn.none;i=n.charCategorizer(s.head),a=n.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c<t.minSelectionLength||c>200)return hn.none;if(t.wholeWords){if(a=n.sliceDoc(s.from,s.to),i=n.charCategorizer(s.head),!(TPe(i,n,s.from,s.to)&&fmn(i,n,s.from,s.to)))return hn.none}else if(a=n.sliceDoc(s.from,s.to),!a)return hn.none}let o=[];for(let c of e.visibleRanges){let u=new ob(n.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||TPe(i,n,d,f))&&(s.empty&&d<=s.from&&f>=s.to?o.push(dmn.range(d,f)):(d>=s.to||f<=s.from)&&o.push(umn.range(d,f)),o.length>t.maxMatches))return hn.none}}return hn.set(o)}},{decorations:e=>e.decorations}),hmn=xt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),mmn=({state:e,dispatch:t})=>{let{selection:n}=e,r=ut.create(n.ranges.map(s=>e.wordAt(s.head)||ut.cursor(s.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function gmn(e,t){let{main:n,ranges:r}=e.selection,s=e.wordAt(n.head),a=s&&s.from==n.from&&s.to==n.to;for(let i=!1,o=new ob(e.doc,t,r[r.length-1].to);;)if(o.next(),o.done){if(i)return null;o=new ob(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),i=!0}else{if(i&&r.some(c=>c.from==o.value.from))continue;if(a){let c=e.wordAt(o.value.from);if(!c||c.from!=o.value.from||c.to!=o.value.to)continue}return o.value}}const vmn=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(a=>a.from===a.to))return mmn({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(a=>e.sliceDoc(a.from,a.to)!=r))return!1;let s=gmn(e,r);return s?(t(e.update({selection:e.selection.addRange(ut.range(s.from,s.to),!1),effects:xt.scrollIntoView(s.to)})),!0):!1},uj=dn.define({combine(e){return Cv(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new Amn(t),scrollToMatch:t=>xt.scrollIntoView(t)})}});class Zot{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||amn(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,(n,r)=>r=="n"?`
119
119
  `:r=="r"?"\r":r=="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 kmn(this):new xmn(this)}getCursor(t,n=0,r){let s=t.doc?t:ts.create({doc:t});return r==null&&(r=s.doc.length),this.regexp?WO(this,s,n,r):ZO(this,s,n,r)}}class Wot{constructor(t){this.spec=t}}function ymn(e,t,n){return(r,s,a,i)=>{if(n&&!n(r,s,a,i))return!1;let o=r>=i&&s<=i+a.length?a.slice(r-i,s-i):t.doc.sliceString(r,s);return e(o,t,r,s)}}function ZO(e,t,n,r){let s;return e.wholeWord&&(s=bmn(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(s=ymn(e.test,t,s)),new ob(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:a=>a.toLowerCase(),s)}function bmn(e,t){return(n,r,s,a)=>((a>n||a+s.length<r)&&(a=Math.max(0,n-2),s=e.sliceString(a,Math.min(e.length,r+2))),(t(cF(s,n-a))!=Bi.Word||t(uF(s,n-a))!=Bi.Word)&&(t(uF(s,r-a))!=Bi.Word||t(cF(s,r-a))!=Bi.Word))}class xmn extends Wot{constructor(t){super(t)}nextMatch(t,n,r){let s=ZO(this.spec,t,r,t.doc.length).nextOverlapping();if(s.done){let a=Math.min(t.doc.length,n+this.spec.unquoted.length);s=ZO(this.spec,t,0,a).nextOverlapping()}return s.done||s.value.from==n&&s.value.to==r?null:s.value}prevMatchInRange(t,n,r){for(let s=r;;){let a=Math.max(n,s-1e4-this.spec.unquoted.length),i=ZO(this.spec,t,a,s),o=null;for(;!i.nextOverlapping().done;)o=i.value;if(o)return o;if(a==n)return null;s-=1e4}}prevMatch(t,n,r){let s=this.prevMatchInRange(t,0,n);return s||(s=this.prevMatchInRange(t,Math.max(0,r-this.spec.unquoted.length),t.doc.length)),s&&(s.from!=n||s.to!=r)?s:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,n){let r=ZO(this.spec,t,0,t.doc.length),s=[];for(;!r.next().done;){if(s.length>=n)return null;s.push(r.value)}return s}highlight(t,n,r,s){let a=ZO(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,t.doc.length));for(;!a.next().done;)s(a.value.from,a.value.to)}}function wmn(e,t,n){return(r,s,a)=>(!n||n(r,s,a))&&e(a[0],t,r,s)}function WO(e,t,n,r){let s;return e.wholeWord&&(s=Smn(t.charCategorizer(t.selection.main.head))),e.test&&(s=wmn(e.test,t,s)),new Vot(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:s},n,r)}function cF(e,t){return e.slice(Zl(e,t,!1),t)}function uF(e,t){return e.slice(t,Zl(e,t))}function Smn(e){return(t,n,r)=>!r[0].length||(e(cF(r.input,r.index))!=Bi.Word||e(uF(r.input,r.index))!=Bi.Word)&&(e(uF(r.input,r.index+r[0].length))!=Bi.Word||e(cF(r.input,r.index+r[0].length))!=Bi.Word)}class kmn extends Wot{nextMatch(t,n,r){let s=WO(this.spec,t,r,t.doc.length).next();return s.done&&(s=WO(this.spec,t,0,n).next()),s.done?null:s.value}prevMatchInRange(t,n,r){for(let s=1;;s++){let a=Math.max(n,r-s*1e4),i=WO(this.spec,t,a,r),o=null;for(;!i.next().done;)o=i.value;if(o&&(a==n||o.from>a+10))return o;if(a==n)return null}}prevMatch(t,n,r){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,r,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return t.match[0];if(r=="$")return"$";for(let s=r.length;s>0;s--){let a=+r.slice(0,s);if(a>0&&a<t.match.length)return t.match[a]+r.slice(s)}return n})}matchAll(t,n){let r=WO(this.spec,t,0,t.doc.length),s=[];for(;!r.next().done;){if(s.length>=n)return null;s.push(r.value)}return s}highlight(t,n,r,s){let a=WO(this.spec,t,Math.max(0,n-250),Math.min(r+250,t.doc.length));for(;!a.next().done;)s(a.value.from,a.value.to)}}const xP=mr.define(),Rve=mr.define(),k0=Yo.define({create(e){return new vQ(gue(e).create(),null)},update(e,t){for(let n of t.effects)n.is(xP)?e=new vQ(n.value.create(),e.panel):n.is(Rve)&&(e=new vQ(e.query,n.value?Pve:null));return e},provide:e=>lP.from(e,t=>t.panel)});class vQ{constructor(t,n){this.query=t,this.panel=n}}const _mn=hn.mark({class:"cm-searchMatch"}),Omn=hn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Emn=Hi.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(k0))}update(e){let t=e.state.field(k0);(t!=e.startState.field(k0)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return hn.none;let{view:n}=this,r=new ed;for(let s=0,a=n.visibleRanges,i=a.length;s<i;s++){let{from:o,to:c}=a[s];for(;s<i-1&&c>a[s+1].from-500;)c=a[++s].to;e.highlight(n.state,o,c,(u,d)=>{let f=n.state.selection.ranges.some(p=>p.from==u&&p.to==d);r.add(u,d,f?Omn:_mn)})}return r.finish()}},{decorations:e=>e.decorations});function UM(e){return t=>{let n=t.state.field(k0,!1);return n&&n.query.spec.valid?e(t,n):Yot(t)}}const dF=UM((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let s=ut.single(r.from,r.to),a=e.state.facet(uj);return e.dispatch({selection:s,effects:[Mve(e,r),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),Qot(e),!0}),fF=UM((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,s=t.prevMatch(n,r,r);if(!s)return!1;let a=ut.single(s.from,s.to),i=e.state.facet(uj);return e.dispatch({selection:a,effects:[Mve(e,s),i.scrollToMatch(a.main,e)],userEvent:"select.search"}),Qot(e),!0}),Cmn=UM((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:ut.create(n.map(r=>ut.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),Tmn=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:s}=n.main,a=[],i=0;for(let o=new ob(e.doc,e.sliceDoc(r,s));!o.next().done;){if(a.length>1e3)return!1;o.value.from==r&&(i=a.length),a.push(ut.range(o.value.from,o.value.to))}return t(e.update({selection:ut.create(a,i),userEvent:"select.search.matches"})),!0},jPe=UM((e,{query:t})=>{let{state:n}=e,{from:r,to:s}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let i=a,o=[],c,u,d=[];i.precise?i.from==r&&i.to==s&&(u=n.toText(t.getReplacement(i)),o.push({from:i.from,to:i.to,insert:u}),d.push(xt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))):i=t.nextMatch(n,i.from,i.to);let f=e.state.changes(o);return i&&(c=ut.single(i.from,i.to).map(f),d.push(Mve(e,i)),d.push(n.facet(uj).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),jmn=UM((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let s of t.matchAll(e.state,1e9)){let{from:a,to:i,precise:o}=s;o&&n.push({from:a,to:i,insert:t.getReplacement(s)})}if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:xt.announce.of(r),userEvent:"input.replace.all"}),!0});function Pve(e){return e.state.facet(uj).createPanel(e)}function gue(e,t){var n,r,s,a,i;let o=e.selection.main,c=o.empty||o.to>o.from+100?"":e.sliceDoc(o.from,o.to);if(t&&!c)return t;let u=e.facet(uj);return new Zot({search:((n=t?.literal)!==null&&n!==void 0?n:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(r=t?.caseSensitive)!==null&&r!==void 0?r: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 Got(e){let t=Yge(e,Pve);return t&&t.dom.querySelector("[main-field]")}function Qot(e){let t=Got(e);t&&t==e.root.activeElement&&t.select()}const Yot=e=>{let t=e.state.field(k0,!1);if(t&&t.panel){let n=Got(e);if(n&&n!=e.root.activeElement){let r=gue(e.state,t.query.spec);r.valid&&e.dispatch({effects:xP.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[Rve.of(!0),t?xP.of(gue(e.state,t.query.spec)):mr.appendConfig.of(Rmn)]});return!0},Xot=e=>{let t=e.state.field(k0,!1);if(!t||!t.panel)return!1;let n=Yge(e,Pve);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Rve.of(!1)}),!0},Nmn=[{key:"Mod-f",run:Yot,scope:"editor search-panel"},{key:"F3",run:dF,shift:fF,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:dF,shift:fF,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Xot,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Tmn},{key:"Mod-Alt-g",run:imn},{key:"Mod-d",run:vmn,preventDefault:!0}];class Amn{constructor(t){this.view=t;let n=this.query=t.state.field(k0).query.spec;this.commit=this.commit.bind(this),this.searchField=Wa("input",{value:n.search,placeholder:hf(t,"Find"),"aria-label":hf(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Wa("input",{value:n.replace,placeholder:hf(t,"Replace"),"aria-label":hf(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Wa("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Wa("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Wa("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(s,a,i){return Wa("button",{class:"cm-button",name:s,onclick:a,type:"button"},i)}this.dom=Wa("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,r("next",()=>dF(t),[hf(t,"next")]),r("prev",()=>fF(t),[hf(t,"previous")]),r("select",()=>Cmn(t),[hf(t,"all")]),Wa("label",null,[this.caseField,hf(t,"match case")]),Wa("label",null,[this.reField,hf(t,"regexp")]),Wa("label",null,[this.wordField,hf(t,"by word")]),...t.state.readOnly?[]:[Wa("br"),this.replaceField,r("replace",()=>jPe(t),[hf(t,"replace")]),r("replaceAll",()=>jmn(t),[hf(t,"replace all")])],Wa("button",{name:"close",onclick:()=>Xot(t),"aria-label":hf(t,"close"),type:"button"},["×"])])}commit(){let t=new Zot({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:xP.of(t)}))}keydown(t){nln(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?fF:dF)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),jPe(this.view))}update(t){for(let n of t.transactions)for(let r of n.effects)r.is(xP)&&!r.value.eq(this.query)&&this.setQuery(r.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(uj).top}}function hf(e,t){return e.state.phrase(t)}const K3=30,J3=/[\s\.,:;?!]/;function Mve(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),s=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-K3),i=Math.min(s,n+K3),o=e.state.sliceDoc(a,i);if(a!=r.from){for(let c=0;c<K3;c++)if(!J3.test(o[c+1])&&J3.test(o[c])){o=o.slice(c);break}}if(i!=s){for(let c=o.length-1;c>o.length-K3;c--)if(!J3.test(o[c-1])&&J3.test(o[c])){o=o.slice(0,c);break}}return xt.announce.of(`${e.state.phrase("current match")}. ${o} ${e.state.phrase("on line")} ${r.number}.`)}const Imn=xt.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"}}),Rmn=[k0,Bm.low(Emn),Imn];class NPe{constructor(t,n,r){this.from=t,this.to=n,this.diagnostic=r}}class J1{constructor(t,n,r){this.diagnostics=t,this.panel=n,this.selected=r}static init(t,n,r){let s=r.facet(wP).markerFilter;s&&(t=s(t,r));let a=t.slice().sort((d,f)=>d.from-f.from||d.to-f.to),i=new ed,o=[],c=0;for(let d=0;;){let f=d==a.length?null:a[d];if(!f&&!o.length)break;let p,h;for(o.length?(p=c,h=o.reduce((g,v)=>Math.min(g,v.to),f&&f.from>p?f.from:1e8)):(p=f.from,h=f.to,o.push(f),d++);d<a.length;){let g=a[d];if(g.from==p&&(g.to>g.from||g.to==p))o.push(g),d++,h=Math.min(g.to,h);else{h=Math.min(g.from,h);break}}let m=Zmn(o);if(o.some(g=>g.from==g.to||g.from==g.to-1&&r.doc.lineAt(g.from).to==g.from))i.add(p,p,hn.widget({widget:new Umn(m),diagnostics:o.slice()}));else{let g=o.reduce((v,b)=>b.markClass?v+" "+b.markClass:v,"");i.add(p,h,hn.mark({class:"cm-lintRange cm-lintRange-"+m+g,diagnostics:o.slice(),inclusiveEnd:o.some(v=>v.to>h)}))}c=h;for(let g=0;g<o.length;g++)o[g].to<=c&&o.splice(g--,1)}let u=i.finish();return new J1(u,n,zC(u))}}function zC(e,t=null,n=0){let r=null;return e.between(n,1e9,(s,a,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new NPe(s,a,t||i.diagnostics[0]);else{if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new NPe(r.from,a,r.diagnostic)}}),r}function Pmn(e,t){let n=t.pos,r=t.end||n,s=e.state.facet(wP).hideOn(e,n,r);if(s!=null)return s;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(i=>i.is(Kot))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function Mmn(e,t){return e.field(zf,!1)?t:t.concat(mr.appendConfig.of(Wmn))}const Kot=mr.define(),$ve=mr.define(),Jot=mr.define(),zf=Yo.define({create(){return new J1(hn.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,s=e.panel;if(e.selected){let a=t.changes.mapPos(e.selected.from,1);r=zC(n,e.selected.diagnostic,a)||zC(n,null,a)}!n.size&&s&&t.state.facet(wP).autoPanel&&(s=null),e=new J1(n,s,r)}for(let n of t.effects)if(n.is(Kot)){let r=t.state.facet(wP).autoPanel?n.value.length?SP.open:null:e.panel;e=J1.init(n.value,r,t.state)}else n.is($ve)?e=new J1(e.diagnostics,n.value?SP.open:null,e.selected):n.is(Jot)&&(e=new J1(e.diagnostics,e.panel,n.value));return e},provide:e=>[lP.from(e,t=>t.panel),xt.decorations.from(e,t=>t.diagnostics)]}),$mn=hn.mark({class:"cm-lintRange cm-lintRange-active"});function Dmn(e,t,n){let{diagnostics:r}=e.state.field(zf),s,a=-1,i=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||n>0)&&(t<u||n<0)))return s=d.diagnostics,a=c,i=u,!1});let o=e.state.facet(wP).tooltipFilter;return s&&o&&(s=o(s,e.state)),s?{pos:a,end:i,above:e.state.doc.lineAt(a).to<i,create(){return{dom:Lmn(e,s)}}}:null}function Lmn(e,t){return Wa("ul",{class:"cm-tooltip-lint"},t.map(n=>tlt(e,n,!1)))}const zmn=e=>{let t=e.state.field(zf,!1);(!t||!t.panel)&&e.dispatch({effects:Mmn(e.state,[$ve.of(!0)])});let n=Yge(e,SP.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},APe=e=>{let t=e.state.field(zf,!1);return!t||!t.panel?!1:(e.dispatch({effects:$ve.of(!1)}),!0)},Fmn=e=>{let t=e.state.field(zf,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return!r.value&&(r=t.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},Bmn=[{key:"Mod-Shift-m",run:zmn,preventDefault:!0},{key:"F8",run:Fmn}],wP=dn.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Cv(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:IPe,tooltipFilter:IPe,needsRefresh:(t,n)=>t?n?r=>t(r)||n(r):t:n,hideOn:(t,n)=>t?n?(r,s,a)=>t(r,s,a)||n(r,s,a):t:n,autoPanel:(t,n)=>t||n})}}});function IPe(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function elt(e){let t=[];if(e)e:for(let{name:n}of e){for(let r=0;r<n.length;r++){let s=n[r];if(/[a-zA-Z]/.test(s)&&!t.some(a=>a.toLowerCase()==s.toLowerCase())){t.push(s);continue e}}t.push("")}return t}function tlt(e,t,n){var r;let s=n?elt(t.actions):[];return Wa("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Wa("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(r=t.actions)===null||r===void 0?void 0:r.map((a,i)=>{let o=!1,c=h=>{if(h.preventDefault(),o)return;o=!0;let m=zC(e.state.field(zf).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),Wa("u",u.slice(d,d+1)),u.slice(d+1)],p=a.markClass?" "+a.markClass:"";return Wa("button",{type:"button",class:"cm-diagnosticAction"+p,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${s[i]})"`}.`},f)}),t.source&&Wa("div",{class:"cm-diagnosticSource"},t.source))}class Umn extends pp{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Wa("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class RPe{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=tlt(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class SP{constructor(t){this.view=t,this.items=[];let n=s=>{if(s.keyCode==27)APe(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=elt(a.actions);for(let o=0;o<i.length;o++)if(i[o].toUpperCase().charCodeAt(0)==s.keyCode){let c=zC(this.view.state.field(zf).diagnostics,a);c&&a.actions[o].apply(t,c.from,c.to)}}else return;s.preventDefault()},r=s=>{for(let a=0;a<this.items.length;a++)this.items[a].dom.contains(s.target)&&this.moveSelection(a)};this.list=Wa("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=Wa("div",{class:"cm-panel-lint"},this.list,Wa("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>APe(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(zf).selected;if(!t)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==t.diagnostic)return n;return-1}update(){let{diagnostics:t,selected:n}=this.view.state.field(zf),r=0,s=!1,a=null,i=new Set;for(t.between(0,this.view.state.doc.length,(o,c,{spec:u})=>{for(let d of u.diagnostics){if(i.has(d))continue;i.add(d);let f=-1,p;for(let h=r;h<this.items.length;h++)if(this.items[h].diagnostic==d){f=h;break}f<0?(p=new RPe(this.view,d),this.items.splice(r,0,p),s=!0):(p=this.items[f],f>r&&(this.items.splice(r,f-r),s=!0)),n&&p.diagnostic==n.diagnostic?p.dom.hasAttribute("aria-selected")||(p.dom.setAttribute("aria-selected","true"),a=p):p.dom.hasAttribute("aria-selected")&&p.dom.removeAttribute("aria-selected"),r++}});r<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 RPe(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:o,panel:c})=>{let u=c.height/this.list.offsetHeight;o.top<c.top?this.list.scrollTop-=(c.top-o.top)/u:o.bottom>c.bottom&&(this.list.scrollTop+=(o.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let t=this.list.firstChild;function n(){let r=t;t=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;t!=r.dom;)n();t=r.dom.nextSibling}else this.list.insertBefore(r.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(zf),r=zC(n.diagnostics,this.items[t].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:Jot.of(r)})}static open(t){return new SP(t)}}function qmn(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 eL(e){return qmn(`<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 Vmn=xt.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:eL("#d11")},".cm-lintRange-warning":{backgroundImage:eL("orange")},".cm-lintRange-info":{backgroundImage:eL("#999")},".cm-lintRange-hint":{backgroundImage:eL("#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 Hmn(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function Zmn(e){let t="hint",n=1;for(let r of e){let s=Hmn(r.severity);s>n&&(n=s,t=r.severity)}return t}const Wmn=[zf,xt.decorations.compute([zf],e=>{let{selected:t,panel:n}=e.field(zf);return!t||!n||t.from==t.to?hn.none:hn.set([$mn.range(t.from,t.to)])}),Vln(Dmn,{hideOn:Pmn}),Vmn];var PPe=function(t){t===void 0&&(t={});var{crosshairCursor:n=!1}=t,r=[];t.closeBracketsKeymap!==!1&&(r=r.concat(Bun)),t.defaultKeymap!==!1&&(r=r.concat(rmn)),t.searchKeymap!==!1&&(r=r.concat(Nmn)),t.historyKeymap!==!1&&(r=r.concat(uhn)),t.foldKeymap!==!1&&(r=r.concat(Ecn)),t.completionKeymap!==!1&&(r=r.concat(Bat)),t.lintKeymap!==!1&&(r=r.concat(Bmn));var s=[];return t.lineNumbers!==!1&&s.push(ncn()),t.highlightActiveLineGutter!==!1&&s.push(acn()),t.highlightSpecialChars!==!1&&s.push(yln()),t.history!==!1&&s.push(thn()),t.foldGutter!==!1&&s.push(Ncn()),t.drawSelection!==!1&&s.push(lln()),t.dropCursor!==!1&&s.push(pln()),t.allowMultipleSelections!==!1&&s.push(ts.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&s.push(ycn()),t.syntaxHighlighting!==!1&&s.push(Cw(Pcn,{fallback:!0})),t.bracketMatching!==!1&&s.push(Bcn()),t.closeBrackets!==!1&&s.push(Dun()),t.autocompletion!==!1&&s.push(Fat()),t.rectangularSelection!==!1&&s.push(Iln()),n!==!1&&s.push(Mln()),t.highlightActiveLine!==!1&&s.push(_ln()),t.highlightSelectionMatches!==!1&&s.push(cmn()),t.tabSize&&typeof t.tabSize=="number"&&s.push(ij.of(" ".repeat(t.tabSize))),s.concat([aj.of(r.flat())]).filter(Boolean)};const Gmn="#e5c07b",MPe="#e06c75",Qmn="#56b6c2",Ymn="#ffffff",v6="#abb2bf",vue="#7d8799",Xmn="#61afef",Kmn="#98c379",$Pe="#d19a66",Jmn="#c678dd",egn="#21252b",DPe="#2c313a",LPe="#282c34",yQ="#353a42",tgn="#3E4451",zPe="#528bff",ngn=xt.theme({"&":{color:v6,backgroundColor:LPe},".cm-content":{caretColor:zPe},".cm-cursor, .cm-dropCursor":{borderLeftColor:zPe},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:tgn},".cm-panels":{backgroundColor:egn,color:v6},".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:LPe,color:vue,border:"none"},".cm-activeLineGutter":{backgroundColor:DPe},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:yQ},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:yQ,borderBottomColor:yQ},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:DPe,color:v6}}},{dark:!0}),rgn=Um.define([{tag:ae.keyword,color:Jmn},{tag:[ae.name,ae.deleted,ae.character,ae.propertyName,ae.macroName],color:MPe},{tag:[ae.function(ae.variableName),ae.labelName],color:Xmn},{tag:[ae.color,ae.constant(ae.name),ae.standard(ae.name)],color:$Pe},{tag:[ae.definition(ae.name),ae.separator],color:v6},{tag:[ae.typeName,ae.className,ae.number,ae.changed,ae.annotation,ae.modifier,ae.self,ae.namespace],color:Gmn},{tag:[ae.operator,ae.operatorKeyword,ae.url,ae.escape,ae.regexp,ae.link,ae.special(ae.string)],color:Qmn},{tag:[ae.meta,ae.comment],color:vue},{tag:ae.strong,fontWeight:"bold"},{tag:ae.emphasis,fontStyle:"italic"},{tag:ae.strikethrough,textDecoration:"line-through"},{tag:ae.link,color:vue,textDecoration:"underline"},{tag:ae.heading,fontWeight:"bold",color:MPe},{tag:[ae.atom,ae.bool,ae.special(ae.variableName)],color:$Pe},{tag:[ae.processingInstruction,ae.string,ae.inserted],color:Kmn},{tag:ae.invalid,color:Ymn}]),sgn=[ngn,Cw(rgn)];var agn=xt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),ign=function(t){t===void 0&&(t={});var{indentWithTab:n=!0,editable:r=!0,readOnly:s=!1,theme:a="light",placeholder:i="",basicSetup:o=!0}=t,c=[];switch(n&&c.unshift(aj.of([smn])),o&&(typeof o=="boolean"?c.unshift(PPe()):c.unshift(PPe(o))),i&&c.unshift(Tln(i)),a){case"light":c.push(agn);break;case"dark":c.push(sgn);break;case"none":break;default:c.push(a);break}return r===!1&&c.push(xt.editable.of(!1)),s&&c.push(ts.readOnly.of(!0)),[...c]},ogn=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 lgn{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,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(n=>{try{n()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}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}}class FPe{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 bQ=null,cgn=()=>typeof window>"u"?new FPe:(bQ||(bQ=new FPe),bQ),BPe=Ev.define(),ugn=200,dgn=[];function fgn(e){var{value:t,selection:n,onChange:r,onStatistics:s,onCreateEditor:a,onUpdate:i,extensions:o=dgn,autoFocus:c,theme:u="light",height:d=null,minHeight:f=null,maxHeight:p=null,width:h=null,minWidth:m=null,maxWidth:g=null,placeholder:v="",editable:b=!0,readOnly:S=!1,indentWithTab:w=!0,basicSetup:_=!0,root:O,initialState:E}=e,[T,j]=y.useState(),[N,I]=y.useState(),[R,P]=y.useState(),U=y.useState(()=>({current:null}))[0],M=y.useState(()=>({current:null}))[0],L=xt.theme({"&":{height:d,minHeight:f,maxHeight:p,width:h,minWidth:m,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),F=xt.updateListener.of(H=>{if(H.docChanged&&typeof r=="function"&&!H.transactions.some(V=>V.annotation(BPe))){U.current?U.current.reset():(U.current=new lgn(()=>{if(M.current){var V=M.current;M.current=null,V()}U.current=null},ugn),cgn().add(U.current));var D=H.state.doc,Y=D.toString();r(Y,H)}s&&s(ogn(H))}),z=ign({theme:u,editable:b,readOnly:S,placeholder:v,indentWithTab:w,basicSetup:_}),q=[F,L,...z];return i&&typeof i=="function"&&q.push(xt.updateListener.of(i)),q=q.concat(o),y.useLayoutEffect(()=>{if(T&&!R){var H={doc:t,selection:n,extensions:q},D=E?ts.fromJSON(E.json,H,E.fields):ts.create(H);if(P(D),!N){var Y=new xt({state:D,parent:T,root:O});I(Y),a&&a(Y,D)}}return()=>{N&&(P(void 0),I(void 0))}},[T,R]),y.useEffect(()=>{e.container&&j(e.container)},[e.container]),y.useEffect(()=>()=>{N&&(N.destroy(),I(void 0)),U.current&&(U.current.cancel(),U.current=null)},[N]),y.useEffect(()=>{c&&N&&N.focus()},[c,N]),y.useEffect(()=>{N&&N.dispatch({effects:mr.reconfigure.of(q)})},[u,o,d,f,p,h,m,g,v,b,S,w,_,r,i]),y.useEffect(()=>{if(t!==void 0){var H=N?N.state.doc.toString():"";if(N&&t!==H){var D=U.current&&!U.current.isDone,Y=()=>{N&&t!==N.state.doc.toString()&&N.dispatch({changes:{from:0,to:N.state.doc.toString().length,insert:t||""},annotations:[BPe.of(!0)]})};D?M.current=Y:Y()}}},[t,N]),{state:R,setState:P,view:N,setView:I,container:T,setContainer:j}}var pgn=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],pu=y.forwardRef((e,t)=>{var{className:n,value:r="",selection:s,extensions:a=[],onChange:i,onStatistics:o,onCreateEditor:c,onUpdate:u,autoFocus:d,theme:f="light",height:p,minHeight:h,maxHeight:m,width:g,minWidth:v,maxWidth:b,basicSetup:S,placeholder:w,indentWithTab:_,editable:O,readOnly:E,root:T,initialState:j}=e,N=cot(e,pgn),I=y.useRef(null),{state:R,view:P,container:U,setContainer:M}=fgn({root:T,value:r,autoFocus:d,theme:f,height:p,minHeight:h,maxHeight:m,width:g,minWidth:v,maxWidth:b,basicSetup:S,placeholder:w,indentWithTab:_,editable:O,readOnly:E,selection:s,onChange:i,onStatistics:o,onCreateEditor:c,onUpdate:u,extensions:a,initialState:j});y.useImperativeHandle(t,()=>({editor:I.current,state:R,view:P}),[I,U,R,P]);var L=y.useCallback(z=>{I.current=z,M(z)},[M]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var F=typeof f=="string"?"cm-theme-"+f:"cm-theme";return l.jsx("div",bP({ref:L,className:""+F+(n?" "+n:"")},N))});pu.displayName="CodeMirror";const hgn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),nlt=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var mgn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ggn=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:i,...o},c)=>y.createElement("svg",{ref:c,...mgn,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:nlt("lucide",s),...o},[...i.map(([u,d])=>y.createElement(u,d)),...Array.isArray(a)?a:[a]]));const fn=(e,t)=>{const n=y.forwardRef(({className:r,...s},a)=>y.createElement(ggn,{ref:a,iconNode:t,className:nlt(`lucide-${hgn(e)}`,r),...s}));return n.displayName=`${e}`,n};const vgn=[["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 18h18",key:"1h113x"}],["path",{d:"M3 6h18",key:"d0wm0j"}]],pF=fn("AlignJustify",vgn);const ygn=[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],kP=fn("AlignLeft",ygn);const bgn=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],vB=fn("ArrowDown",bgn);const xgn=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],dj=fn("ArrowLeft",xgn);const wgn=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],tk=fn("ArrowRight",wgn);const Sgn=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],yB=fn("ArrowUp",Sgn);const kgn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],rlt=fn("Ban",kgn);const _gn=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],d0=fn("Braces",_gn);const Ogn=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],Egn=fn("Brain",Ogn);const Cgn=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],yue=fn("Calendar",Cgn);const Tgn=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jb=fn("Check",Tgn);const jgn=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Dve=fn("ChevronDown",jgn);const Ngn=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],slt=fn("ChevronLeft",Ngn);const Agn=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],nk=fn("ChevronRight",Agn);const Ign=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Rgn=fn("ChevronUp",Ign);const Pgn=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],Lve=fn("ChevronsDownUp",Pgn);const Mgn=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],$gn=fn("ChevronsDown",Mgn);const Dgn=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],Lgn=fn("ChevronsLeft",Dgn);const zgn=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],alt=fn("ChevronsRight",zgn);const Fgn=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],qM=fn("ChevronsUpDown",Fgn);const Bgn=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],Ugn=fn("ChevronsUp",Bgn);const qgn=[["path",{d:"M15.6 2.7a10 10 0 1 0 5.7 5.7",key:"1e0p6d"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M13.4 10.6 19 5",key:"1kr7tw"}]],Vgn=fn("CircleGauge",qgn);const Hgn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],ilt=fn("CircleSlash",Hgn);const Zgn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Wgn=fn("CircleX",Zgn);const Ggn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],olt=fn("Circle",Ggn);const Qgn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Ygn=fn("Clock",Qgn);const Xgn=[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]],Kgn=fn("Component",Xgn);const Jgn=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],llt=fn("Copy",Jgn);const evn=[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],tvn=fn("CornerDownRight",evn);const nvn=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],rvn=fn("EllipsisVertical",nvn);const svn=[["line",{x1:"5",x2:"19",y1:"9",y2:"9",key:"1nwqeh"}],["line",{x1:"5",x2:"19",y1:"15",y2:"15",key:"g8yjpy"}],["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}]],avn=fn("EqualNot",svn);const ivn=[["line",{x1:"5",x2:"19",y1:"9",y2:"9",key:"1nwqeh"}],["line",{x1:"5",x2:"19",y1:"15",y2:"15",key:"g8yjpy"}]],ovn=fn("Equal",ivn);const lvn=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16.2V21h-4.8",key:"1hrera"}],["path",{d:"M21 7.8V3h-4.8",key:"ul1q53"}],["path",{d:"M3 16.2V21h4.8",key:"1x04uo"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 7.8V3h4.8",key:"1ijppm"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],cvn=fn("Expand",lvn);const uvn=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],zve=fn("ExternalLink",uvn);const dvn=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],fvn=fn("Eye",dvn);const pvn=[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]],bue=fn("FileInput",pvn);const hvn=[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2",key:"1vk7w2"}],["path",{d:"M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6",key:"1jink5"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]],xue=fn("FileOutput",hvn);const mvn=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],gvn=fn("FileText",mvn);const vvn=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],yvn=fn("File",vvn);const bvn=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]],xvn=fn("Filter",bvn);const wvn=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3-3-3 3",key:"e37ymu"}],["path",{d:"m15 5-3 3-3-3",key:"19d6lf"}]],Svn=fn("FoldVertical",wvn);const kvn=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],_vn=fn("Folder",kvn);const Ovn=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Evn=fn("Gauge",Ovn);const Cvn=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Fve=fn("Hash",Cvn);const Tvn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Bve=fn("Info",Tvn);const jvn=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],Nvn=fn("Keyboard",jvn);const Avn=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],Ivn=fn("Lightbulb",Avn);const Rvn=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],clt=fn("Link2",Rvn);const Pvn=[["path",{d:"M10 18h4",key:"1ulq68"}],["path",{d:"M11 6H3",key:"1u26ik"}],["path",{d:"M15 6h6",key:"1jlkvy"}],["path",{d:"M18 9V3",key:"xwwp7m"}],["path",{d:"M7 12h8",key:"7a1bxv"}]],Mvn=fn("ListFilterPlus",Pvn);const $vn=[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]],Dvn=fn("ListTree",$vn);const Lvn=[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"m19 10-4 4",key:"1tz659"}],["path",{d:"m15 10 4 4",key:"1n7nei"}]],zvn=fn("ListX",Lvn);const Fvn=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],Uve=fn("List",Fvn);const Bvn=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Uvn=fn("Lock",Bvn);const qvn=[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]],Vvn=fn("LogIn",qvn);const Hvn=[["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M3 12h1",key:"lp3yf2"}],["path",{d:"M3 18h1",key:"1eiwyy"}],["path",{d:"M3 6h1",key:"rgxa97"}],["path",{d:"M8 12h1",key:"1con00"}],["path",{d:"M8 18h1",key:"13wk12"}],["path",{d:"M8 6h1",key:"tn6mkg"}]],Zvn=fn("Logs",Hvn);const Wvn=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],Gvn=fn("Menu",Wvn);const Qvn=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],Yvn=fn("OctagonAlert",Qvn);const Xvn=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Kvn=fn("PanelRight",Xvn);const Jvn=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],qve=fn("Plus",Jvn);const eyn=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],ult=fn("Save",eyn);const tyn=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],FC=fn("Search",tyn);const nyn=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]],ryn=fn("ShieldX",nyn);const syn=[["path",{d:"M21 6H3",key:"1jwq7v"}],["path",{d:"M10 12H3",key:"1ulcyk"}],["path",{d:"M10 18H3",key:"13769t"}],["circle",{cx:"17",cy:"15",r:"3",key:"1upz2a"}],["path",{d:"m21 19-1.9-1.9",key:"dwi7p8"}]],ayn=fn("TextSearch",syn);const iyn=[["path",{d:"M17 6.1H3",key:"wptmhv"}],["path",{d:"M21 12.1H3",key:"1j38uz"}],["path",{d:"M15.1 18H3",key:"1nb16a"}]],oyn=fn("Text",iyn);const lyn=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]],Vve=fn("ToggleLeft",lyn);const cyn=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],dlt=fn("Trash2",cyn);const uyn=[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]],dyn=fn("TrendingDown",uyn);const fyn=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],pyn=fn("TrendingUp",fyn);const hyn=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],VM=fn("TriangleAlert",hyn);const myn=[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]],Hve=fn("Type",myn);const gyn=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],vyn=fn("UnfoldVertical",gyn);const yyn=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],byn=fn("WandSparkles",yyn);const xyn=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Fd=fn("X",xyn);function wyn(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Syn=e=>{switch(e){case"success":return Oyn;case"info":return Cyn;case"warning":return Eyn;case"error":return Tyn;default:return null}},kyn=Array(12).fill(0),_yn=({visible:e,className:t})=>Oe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Oe.createElement("div",{className:"sonner-spinner"},kyn.map((n,r)=>Oe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Oyn=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Oe.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"})),Eyn=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Oe.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"})),Cyn=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Oe.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"})),Tyn=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Oe.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"})),jyn=Oe.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"},Oe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Oe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Nyn=()=>{const[e,t]=Oe.useState(document.hidden);return Oe.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let wue=1;class Ayn{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,a=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:wue++,i=this.toasts.find(c=>c.id===a),o=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:r}),{...c,...t,id:a,dismissible:o,title:r}):c):this.addToast({title:r,...s,dismissible:o,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,i;const o=s.then(async u=>{if(i=["resolve",u],Oe.isValidElement(u))a=!1,this.create({id:r,type:"default",message:u});else if(Ryn(u)&&!u.ok){a=!1;const f=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,m=typeof f=="object"&&!Oe.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...m})}else if(u instanceof Error){a=!1;const f=typeof n.error=="function"?await n.error(u):n.error,p=typeof n.description=="function"?await n.description(u):n.description,m=typeof f=="object"&&!Oe.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...m})}else if(n.success!==void 0){a=!1;const f=typeof n.success=="function"?await n.success(u):n.success,p=typeof n.description=="function"?await n.description(u):n.description,m=typeof f=="object"&&!Oe.isValidElement(f)?f:{message:f};this.create({id:r,type:"success",description:p,...m})}}).catch(async u=>{if(i=["reject",u],n.error!==void 0){a=!1;const d=typeof n.error=="function"?await n.error(u):n.error,f=typeof n.description=="function"?await n.description(u):n.description,h=typeof d=="object"&&!Oe.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:f,...h})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((u,d)=>o.then(()=>i[0]==="reject"?d(i[1]):u(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=n?.id||wue++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const bd=new Ayn,Iyn=(e,t)=>{const n=t?.id||wue++;return bd.addToast({title:e,...t,id:n}),n},Ryn=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Pyn=Iyn,Myn=()=>bd.toasts,$yn=()=>bd.getActiveToasts(),jm=Object.assign(Pyn,{success:bd.success,info:bd.info,warning:bd.warning,error:bd.error,custom:bd.custom,message:bd.message,promise:bd.promise,dismiss:bd.dismiss,loading:bd.loading},{getHistory:Myn,getToasts:$yn});wyn("[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 tL(e){return e.label!==void 0}const Dyn=3,Lyn="24px",zyn="16px",UPe=4e3,Fyn=356,Byn=14,Uyn=45,qyn=200;function ug(...e){return e.filter(Boolean).join(" ")}function Vyn(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Hyn=e=>{var t,n,r,s,a,i,o,c,u;const{invert:d,toast:f,unstyled:p,interacting:h,setHeights:m,visibleToasts:g,heights:v,index:b,toasts:S,expanded:w,removeToast:_,defaultRichColors:O,closeButton:E,style:T,cancelButtonStyle:j,actionButtonStyle:N,className:I="",descriptionClassName:R="",duration:P,position:U,gap:M,expandByDefault:L,classNames:F,icons:z,closeButtonAriaLabel:q="Close toast"}=e,[H,D]=Oe.useState(null),[Y,V]=Oe.useState(null),[$,W]=Oe.useState(!1),[G,K]=Oe.useState(!1),[re,J]=Oe.useState(!1),[ee,se]=Oe.useState(!1),[ie,Q]=Oe.useState(!1),[ne,oe]=Oe.useState(0),[me,ce]=Oe.useState(0),be=Oe.useRef(f.duration||P||UPe),Ce=Oe.useRef(null),je=Oe.useRef(null),We=b===0,Pe=b+1<=g,ze=f.type,Se=f.dismissible!==!1,le=f.className||"",ve=f.descriptionClassName||"",ue=Oe.useMemo(()=>v.findIndex(vt=>vt.toastId===f.id)||0,[v,f.id]),xe=Oe.useMemo(()=>{var vt;return(vt=f.closeButton)!=null?vt:E},[f.closeButton,E]),fe=Oe.useMemo(()=>f.duration||P||UPe,[f.duration,P]),ye=Oe.useRef(0),_e=Oe.useRef(0),qe=Oe.useRef(0),Ge=Oe.useRef(null),[ct,De]=U.split("-"),Ve=Oe.useMemo(()=>v.reduce((vt,Or,cr)=>cr>=ue?vt:vt+Or.height,0),[v,ue]),Ae=Nyn(),Ke=f.invert||d,Me=ze==="loading";_e.current=Oe.useMemo(()=>ue*M+Ve,[ue,Ve]),Oe.useEffect(()=>{be.current=fe},[fe]),Oe.useEffect(()=>{W(!0)},[]),Oe.useEffect(()=>{const vt=je.current;if(vt){const Or=vt.getBoundingClientRect().height;return ce(Or),m(cr=>[{toastId:f.id,height:Or,position:f.position},...cr]),()=>m(cr=>cr.filter(Ct=>Ct.toastId!==f.id))}},[m,f.id]),Oe.useLayoutEffect(()=>{if(!$)return;const vt=je.current,Or=vt.style.height;vt.style.height="auto";const cr=vt.getBoundingClientRect().height;vt.style.height=Or,ce(cr),m(Ct=>Ct.find(Fn=>Fn.toastId===f.id)?Ct.map(Fn=>Fn.toastId===f.id?{...Fn,height:cr}:Fn):[{toastId:f.id,height:cr,position:f.position},...Ct])},[$,f.title,f.description,m,f.id,f.jsx,f.action,f.cancel]);const ft=Oe.useCallback(()=>{K(!0),oe(_e.current),m(vt=>vt.filter(Or=>Or.toastId!==f.id)),setTimeout(()=>{_(f)},qyn)},[f,_,m,_e]);Oe.useEffect(()=>{if(f.promise&&ze==="loading"||f.duration===1/0||f.type==="loading")return;let vt;return w||h||Ae?(()=>{if(qe.current<ye.current){const Ct=new Date().getTime()-ye.current;be.current=be.current-Ct}qe.current=new Date().getTime()})():be.current!==1/0&&(ye.current=new Date().getTime(),vt=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),ft()},be.current)),()=>clearTimeout(vt)},[w,h,f,ze,Ae,ft]),Oe.useEffect(()=>{f.delete&&(ft(),f.onDismiss==null||f.onDismiss.call(f,f))},[ft,f.delete]);function kt(){var vt;if(z?.loading){var Or;return Oe.createElement("div",{className:ug(F?.loader,f==null||(Or=f.classNames)==null?void 0:Or.loader,"sonner-loader"),"data-visible":ze==="loading"},z.loading)}return Oe.createElement(_yn,{className:ug(F?.loader,f==null||(vt=f.classNames)==null?void 0:vt.loader),visible:ze==="loading"})}const Tn=f.icon||z?.[ze]||Syn(ze);var en,En;return Oe.createElement("li",{tabIndex:0,ref:je,className:ug(I,le,F?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,F?.default,F?.[ze],f==null||(n=f.classNames)==null?void 0:n[ze]),"data-sonner-toast":"","data-rich-colors":(en=f.richColors)!=null?en:O,"data-styled":!(f.jsx||f.unstyled||p),"data-mounted":$,"data-promise":!!f.promise,"data-swiped":ie,"data-removed":G,"data-visible":Pe,"data-y-position":ct,"data-x-position":De,"data-index":b,"data-front":We,"data-swiping":re,"data-dismissible":Se,"data-type":ze,"data-invert":Ke,"data-swipe-out":ee,"data-swipe-direction":Y,"data-expanded":!!(w||L&&$),"data-testid":f.testId,style:{"--index":b,"--toasts-before":b,"--z-index":S.length-b,"--offset":`${G?ne:_e.current}px`,"--initial-height":L?"auto":`${me}px`,...T,...f.style},onDragEnd:()=>{J(!1),D(null),Ge.current=null},onPointerDown:vt=>{vt.button!==2&&(Me||!Se||(Ce.current=new Date,oe(_e.current),vt.target.setPointerCapture(vt.pointerId),vt.target.tagName!=="BUTTON"&&(J(!0),Ge.current={x:vt.clientX,y:vt.clientY})))},onPointerUp:()=>{var vt,Or,cr;if(ee||!Se)return;Ge.current=null;const Ct=Number(((vt=je.current)==null?void 0:vt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Jt=Number(((Or=je.current)==null?void 0:Or.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Fn=new Date().getTime()-((cr=Ce.current)==null?void 0:cr.getTime()),on=H==="x"?Ct:Jt,Qr=Math.abs(on)/Fn;if(Math.abs(on)>=Uyn||Qr>.11){oe(_e.current),f.onDismiss==null||f.onDismiss.call(f,f),V(H==="x"?Ct>0?"right":"left":Jt>0?"down":"up"),ft(),se(!0);return}else{var ke,Re;(ke=je.current)==null||ke.style.setProperty("--swipe-amount-x","0px"),(Re=je.current)==null||Re.style.setProperty("--swipe-amount-y","0px")}Q(!1),J(!1),D(null)},onPointerMove:vt=>{var Or,cr,Ct;if(!Ge.current||!Se||((Or=window.getSelection())==null?void 0:Or.toString().length)>0)return;const Fn=vt.clientY-Ge.current.y,on=vt.clientX-Ge.current.x;var Qr;const ke=(Qr=e.swipeDirections)!=null?Qr:Vyn(U);!H&&(Math.abs(on)>1||Math.abs(Fn)>1)&&D(Math.abs(on)>Math.abs(Fn)?"x":"y");let Re={x:0,y:0};const Ne=nt=>1/(1.5+Math.abs(nt)/20);if(H==="y"){if(ke.includes("top")||ke.includes("bottom"))if(ke.includes("top")&&Fn<0||ke.includes("bottom")&&Fn>0)Re.y=Fn;else{const nt=Fn*Ne(Fn);Re.y=Math.abs(nt)<Math.abs(Fn)?nt:Fn}}else if(H==="x"&&(ke.includes("left")||ke.includes("right")))if(ke.includes("left")&&on<0||ke.includes("right")&&on>0)Re.x=on;else{const nt=on*Ne(on);Re.x=Math.abs(nt)<Math.abs(on)?nt:on}(Math.abs(Re.x)>0||Math.abs(Re.y)>0)&&Q(!0),(cr=je.current)==null||cr.style.setProperty("--swipe-amount-x",`${Re.x}px`),(Ct=je.current)==null||Ct.style.setProperty("--swipe-amount-y",`${Re.y}px`)}},xe&&!f.jsx&&ze!=="loading"?Oe.createElement("button",{"aria-label":q,"data-disabled":Me,"data-close-button":!0,onClick:Me||!Se?()=>{}:()=>{ft(),f.onDismiss==null||f.onDismiss.call(f,f)},className:ug(F?.closeButton,f==null||(r=f.classNames)==null?void 0:r.closeButton)},(En=z?.close)!=null?En:jyn):null,(ze||f.icon||f.promise)&&f.icon!==null&&(z?.[ze]!==null||f.icon)?Oe.createElement("div",{"data-icon":"",className:ug(F?.icon,f==null||(s=f.classNames)==null?void 0:s.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||kt():null,f.type!=="loading"?Tn:null):null,Oe.createElement("div",{"data-content":"",className:ug(F?.content,f==null||(a=f.classNames)==null?void 0:a.content)},Oe.createElement("div",{"data-title":"",className:ug(F?.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?Oe.createElement("div",{"data-description":"",className:ug(R,ve,F?.description,f==null||(o=f.classNames)==null?void 0:o.description)},typeof f.description=="function"?f.description():f.description):null),Oe.isValidElement(f.cancel)?f.cancel:f.cancel&&tL(f.cancel)?Oe.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||j,onClick:vt=>{tL(f.cancel)&&Se&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,vt),ft())},className:ug(F?.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,Oe.isValidElement(f.action)?f.action:f.action&&tL(f.action)?Oe.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||N,onClick:vt=>{tL(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,vt),!vt.defaultPrevented&&ft())},className:ug(F?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function qPe(){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 Zyn(e,t){const n={};return[e,t].forEach((r,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",o=a?zyn:Lyn;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${i}-${u}`]=o:n[`${i}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(o)}),n}const Wyn=Oe.forwardRef(function(t,n){const{id:r,invert:s,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:c,className:u,offset:d,mobileOffset:f,theme:p="light",richColors:h,duration:m,style:g,visibleToasts:v=Dyn,toastOptions:b,dir:S=qPe(),gap:w=Byn,icons:_,containerAriaLabel:O="Notifications"}=t,[E,T]=Oe.useState([]),j=Oe.useMemo(()=>r?E.filter($=>$.toasterId===r):E.filter($=>!$.toasterId),[E,r]),N=Oe.useMemo(()=>Array.from(new Set([a].concat(j.filter($=>$.position).map($=>$.position)))),[j,a]),[I,R]=Oe.useState([]),[P,U]=Oe.useState(!1),[M,L]=Oe.useState(!1),[F,z]=Oe.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=Oe.useRef(null),H=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=Oe.useRef(null),Y=Oe.useRef(!1),V=Oe.useCallback($=>{T(W=>{var G;return(G=W.find(K=>K.id===$.id))!=null&&G.delete||bd.dismiss($.id),W.filter(({id:K})=>K!==$.id)})},[]);return Oe.useEffect(()=>bd.subscribe($=>{if($.dismiss){requestAnimationFrame(()=>{T(W=>W.map(G=>G.id===$.id?{...G,delete:!0}:G))});return}setTimeout(()=>{Rme.flushSync(()=>{T(W=>{const G=W.findIndex(K=>K.id===$.id);return G!==-1?[...W.slice(0,G),{...W[G],...$},...W.slice(G+1)]:[$,...W]})})})}),[E]),Oe.useEffect(()=>{if(p!=="system"){z(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;const $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:W})=>{z(W?"dark":"light")})}catch{$.addListener(({matches:G})=>{try{z(G?"dark":"light")}catch(K){console.error(K)}})}},[p]),Oe.useEffect(()=>{E.length<=1&&U(!1)},[E]),Oe.useEffect(()=>{const $=W=>{var G;if(i.every(J=>W[J]||W.code===J)){var re;U(!0),(re=q.current)==null||re.focus()}W.code==="Escape"&&(document.activeElement===q.current||(G=q.current)!=null&&G.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[i]),Oe.useEffect(()=>{if(q.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,Y.current=!1)}},[q.current]),Oe.createElement("section",{ref:n,"aria-label":`${O} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map(($,W)=>{var G;const[K,re]=$.split("-");return j.length?Oe.createElement("ol",{key:$,dir:S==="auto"?qPe():S,tabIndex:-1,ref:q,className:u,"data-sonner-toaster":!0,"data-sonner-theme":F,"data-y-position":K,"data-x-position":re,style:{"--front-toast-height":`${((G=I[0])==null?void 0:G.height)||0}px`,"--width":`${Fyn}px`,"--gap":`${w}px`,...g,...Zyn(d,f)},onBlur:J=>{Y.current&&!J.currentTarget.contains(J.relatedTarget)&&(Y.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,D.current=J.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{M||U(!1)},onDragEnd:()=>U(!1),onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},j.filter(J=>!J.position&&W===0||J.position===$).map((J,ee)=>{var se,ie;return Oe.createElement(Hyn,{key:J.id,icons:_,index:ee,toast:J,defaultRichColors:h,duration:(se=b?.duration)!=null?se:m,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:s,visibleToasts:v,closeButton:(ie=b?.closeButton)!=null?ie:c,interacting:M,position:$,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,closeButtonAriaLabel:b?.closeButtonAriaLabel,removeToast:V,toasts:j.filter(Q=>Q.position==J.position),heights:I.filter(Q=>Q.position==J.position),setHeights:R,expandByDefault:o,gap:w,expanded:P,swipeDirections:t.swipeDirections})})):null}))});var xQ="focusScope.autoFocusOnMount",wQ="focusScope.autoFocusOnUnmount",VPe={bubbles:!1,cancelable:!0},Gyn="FocusScope",HM=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...i}=e,[o,c]=y.useState(null),u=Oc(s),d=Oc(a),f=y.useRef(null),p=pr(t,g=>c(g)),h=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let g=function(w){if(h.paused||!o)return;const _=w.target;o.contains(_)?f.current=_:qx(f.current,{select:!0})},v=function(w){if(h.paused||!o)return;const _=w.relatedTarget;_!==null&&(o.contains(_)||qx(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const O of w)O.removedNodes.length>0&&qx(o)};document.addEventListener("focusin",g),document.addEventListener("focusout",v);const S=new MutationObserver(b);return o&&S.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",v),S.disconnect()}}},[r,o,h.paused]),y.useEffect(()=>{if(o){ZPe.add(h);const g=document.activeElement;if(!o.contains(g)){const b=new CustomEvent(xQ,VPe);o.addEventListener(xQ,u),o.dispatchEvent(b),b.defaultPrevented||(Qyn(ebn(flt(o)),{select:!0}),document.activeElement===g&&qx(o))}return()=>{o.removeEventListener(xQ,u),setTimeout(()=>{const b=new CustomEvent(wQ,VPe);o.addEventListener(wQ,d),o.dispatchEvent(b),b.defaultPrevented||qx(g??document.body,{select:!0}),o.removeEventListener(wQ,d),ZPe.remove(h)},0)}}},[o,u,d,h]);const m=y.useCallback(g=>{if(!n&&!r||h.paused)return;const v=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,b=document.activeElement;if(v&&b){const S=g.currentTarget,[w,_]=Yyn(S);w&&_?!g.shiftKey&&b===_?(g.preventDefault(),n&&qx(w,{select:!0})):g.shiftKey&&b===w&&(g.preventDefault(),n&&qx(_,{select:!0})):b===S&&g.preventDefault()}},[n,r,h.paused]);return l.jsx(or.div,{tabIndex:-1,...i,ref:p,onKeyDown:m})});HM.displayName=Gyn;function Qyn(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(qx(r,{select:t}),document.activeElement!==n)return}function Yyn(e){const t=flt(e),n=HPe(t,e),r=HPe(t.reverse(),e);return[n,r]}function flt(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function HPe(e,t){for(const n of e)if(!Xyn(n,{upTo:t}))return n}function Xyn(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 Kyn(e){return e instanceof HTMLInputElement&&"select"in e}function qx(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Kyn(e)&&t&&e.select()}}var ZPe=Jyn();function Jyn(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=WPe(e,t),e.unshift(t)},remove(t){e=WPe(e,t),e[0]?.resume()}}}function WPe(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ebn(e){return e.filter(t=>t.tagName!=="A")}var SQ=0;function bB(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??GPe()),document.body.insertAdjacentElement("beforeend",e[1]??GPe()),SQ++,()=>{SQ===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),SQ--}},[])}function GPe(){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 jg=function(){return jg=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},jg.apply(this,arguments)};function plt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function tbn(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var y6="right-scroll-bar-position",b6="width-before-scroll-bar",nbn="with-scroll-bars-hidden",rbn="--removed-body-scroll-bar-size";function kQ(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function sbn(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var abn=typeof window<"u"?y.useLayoutEffect:y.useEffect,QPe=new WeakMap;function ibn(e,t){var n=sbn(null,function(r){return e.forEach(function(s){return kQ(s,r)})});return abn(function(){var r=QPe.get(n);if(r){var s=new Set(r),a=new Set(e),i=n.current;s.forEach(function(o){a.has(o)||kQ(o,null)}),a.forEach(function(o){s.has(o)||kQ(o,i)})}QPe.set(n,e)},[e]),n}function obn(e){return e}function lbn(e,t){t===void 0&&(t=obn);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var i=t(a,r);return n.push(i),function(){n=n.filter(function(o){return o!==i})}},assignSyncMedium:function(a){for(r=!0;n.length;){var i=n;n=[],i.forEach(a)}n={push:function(o){return a(o)},filter:function(){return n}}},assignMedium:function(a){r=!0;var i=[];if(n.length){var o=n;n=[],o.forEach(a),i=n}var c=function(){var d=i;i=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return s}function cbn(e){e===void 0&&(e={});var t=lbn(null);return t.options=jg({async:!0,ssr:!1},e),t}var hlt=function(e){var t=e.sideCar,n=plt(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,jg({},n))};hlt.isSideCarExport=!0;function ubn(e,t){return e.useMedium(t),hlt}var mlt=cbn(),_Q=function(){},xB=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:_Q,onWheelCapture:_Q,onTouchMoveCapture:_Q}),s=r[0],a=r[1],i=e.forwardProps,o=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,m=e.noIsolation,g=e.inert,v=e.allowPinchZoom,b=e.as,S=b===void 0?"div":b,w=e.gapMode,_=plt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=p,E=ibn([n,t]),T=jg(jg({},_),s);return y.createElement(y.Fragment,null,d&&y.createElement(O,{sideCar:mlt,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!v,lockRef:n,gapMode:w}),i?y.cloneElement(y.Children.only(o),jg(jg({},T),{ref:E})):y.createElement(S,jg({},T,{className:c,ref:E}),o))});xB.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xB.classNames={fullWidth:b6,zeroRight:y6};var dbn=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function fbn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=dbn();return t&&e.setAttribute("nonce",t),e}function pbn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function hbn(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var mbn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=fbn())&&(pbn(t,n),hbn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},gbn=function(){var e=mbn();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},glt=function(){var e=gbn(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},vbn={left:0,top:0,right:0,gap:0},OQ=function(e){return parseInt(e||"",10)||0},ybn=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[OQ(n),OQ(r),OQ(s)]},bbn=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vbn;var t=ybn(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},xbn=glt(),GE="data-scroll-locked",wbn=function(e,t,n,r){var s=e.left,a=e.top,i=e.right,o=e.gap;return n===void 0&&(n="margin"),`
120
120
  .`.concat(nbn,` {
121
121
  overflow: hidden `).concat(r,`;
@@ -285,7 +285,7 @@ ${K.current.stack}
285
285
  `).concat(_.x,",").concat(_.y),E=Kl(e.id)?DP("recharts-radial-line-"):e.id;return y.createElement("text",Ay({},r,{dominantBaseline:"central",className:La("recharts-radial-bar-label",i)}),y.createElement("defs",null,y.createElement("path",{id:E,d:O})),y.createElement("textPath",{xlinkHref:"#".concat(E)},n))},kqn=(e,t,n)=>{var{cx:r,cy:s,innerRadius:a,outerRadius:i,startAngle:o,endAngle:c}=e,u=(o+c)/2;if(n==="outside"){var{x:d,y:f}=xc(r,s,i+t,u);return{x:d,y:f,textAnchor:d>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:s,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:s,textAnchor:"middle",verticalAnchor:"end"};var p=(a+i)/2,{x:h,y:m}=xc(r,s,p,u);return{x:h,y:m,textAnchor:"middle",verticalAnchor:"middle"}},j6=e=>e!=null&&"cx"in e&&Kn(e.cx),_qn={angle:0,offset:5,zIndex:Zu.label,position:"middle",textBreakAll:!1};function Oqn(e){if(!j6(e))return e;var{cx:t,cy:n,outerRadius:r}=e,s=r*2;return{x:t-r,y:n-r,width:s,upperWidth:s,lowerWidth:s,height:s}}function Kx(e){var t=Qd(e,_qn),{viewBox:n,parentViewBox:r,position:s,value:a,children:i,content:o,className:c="",textBreakAll:u,labelRef:d}=t,f=bqn(),p=Ybt(),h=s==="center"?p:f??p,m,g,v;n==null?m=h:j6(n)?m=n:m=Qbe(n);var b=Oqn(m);if(!m||Kl(a)&&Kl(i)&&!y.isValidElement(o)&&typeof o!="function")return null;var S=xI(xI({},t),{},{viewBox:m});if(y.isValidElement(o)){var{labelRef:w}=S,_=K3e(S,dqn);return y.cloneElement(o,_)}if(typeof o=="function"){var{content:O}=S,E=K3e(S,fqn);if(g=y.createElement(o,E),y.isValidElement(g))return g}else g=xqn(t);var T=td(t);if(j6(m)){if(s==="insideStart"||s==="insideEnd"||s==="end")return Sqn(t,s,g,T,m);v=kqn(m,t.offset,t.position)}else{if(!b)return null;var j=uqn({viewBox:b,position:s,offset:t.offset,parentViewBox:j6(r)?void 0:r});v=xI(xI({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 y.createElement(Fb,{zIndex:t.zIndex},y.createElement(Kxe,Ay({ref:d,className:La("recharts-label",c)},T,v,{textAnchor:Hbt(T.textAnchor)?T.textAnchor:v.textAnchor,breakAll:u}),g))}Kx.displayName="Label";var Eqn=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?y.createElement(Kx,Ay({key:"label-implicit"},r)):uv(e)?y.createElement(Kx,Ay({key:"label-implicit",value:e},r)):y.isValidElement(e)?e.type===Kx?y.cloneElement(e,xI({key:"label-implicit"},r)):y.createElement(Kx,Ay({key:"label-implicit",content:e},r)):Jxe(e)?y.createElement(Kx,Ay({key:"label-implicit",content:e},r)):e&&typeof e=="object"?y.createElement(Kx,Ay({},e,{key:"label-implicit"},r)):null};function Cqn(e){var{label:t,labelRef:n}=e,r=Ybt();return Eqn(t,r,n)||null}var Tqn=["valueAccessor"],jqn=["dataKey","clockWise","id","textBreakAll","zIndex"];function E8(){return E8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E8.apply(null,arguments)}function eLe(e,t){if(e==null)return{};var n,r,s=Nqn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function Nqn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Aqn=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(nqn(t))return t},Xbt=y.createContext(void 0),Iqn=Xbt.Provider,Kbt=y.createContext(void 0);Kbt.Provider;function Rqn(){return y.useContext(Xbt)}function Pqn(){return y.useContext(Kbt)}function N6(e){var{valueAccessor:t=Aqn}=e,n=eLe(e,Tqn),{dataKey:r,clockWise:s,id:a,textBreakAll:i,zIndex:o}=n,c=eLe(n,jqn),u=Rqn(),d=Pqn(),f=u||d;return!f||!f.length?null:y.createElement(Fb,{zIndex:o??Zu.label},y.createElement(cb,{className:"recharts-label-list"},f.map((p,h)=>{var m,g=Kl(r)?t(p,h):Ql(p.payload,r),v=Kl(a)?{}:{id:"".concat(a,"-").concat(h)};return y.createElement(Kx,E8({key:"label-".concat(h)},td(p),c,v,{fill:(m=n.fill)!==null&&m!==void 0?m:p.fill,parentViewBox:p.parentViewBox,value:g,textBreakAll:i,viewBox:p.viewBox,index:h,zIndex:0}))})))}N6.displayName="LabelList";function Mqn(e){var{label:t}=e;return t?t===!0?y.createElement(N6,{key:"labelList-implicit"}):y.isValidElement(t)||Jxe(t)?y.createElement(N6,{key:"labelList-implicit",content:t}):typeof t=="object"?y.createElement(N6,E8({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Zde(){return Zde=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zde.apply(null,arguments)}var Jbt=e=>{var{cx:t,cy:n,r,className:s}=e,a=La("recharts-dot",s);return Kn(t)&&Kn(n)&&Kn(r)?y.createElement("circle",Zde({},cv(e),Fbe(e),{className:a,cx:t,cy:n,r})):null},$qn={radiusAxis:{},angleAxis:{}},ext=Su({name:"polarAxis",initialState:$qn,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:Lis,removeRadiusAxis:zis,addAngleAxis:Fis,removeAngleAxis:Bis}=ext.actions,Dqn=ext.reducer;function Lqn(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var IX={exports:{}},xa={};var tLe;function zqn(){if(tLe)return xa;tLe=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),i=Symbol.for("react.context"),o=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"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),m;m=Symbol.for("react.module.reference");function g(v){if(typeof v=="object"&&v!==null){var b=v.$$typeof;switch(b){case e:switch(v=v.type,v){case n:case s:case r:case u:case d:return v;default:switch(v=v&&v.$$typeof,v){case o:case i:case c:case p:case f:case a:return v;default:return b}}case t:return b}}}return xa.ContextConsumer=i,xa.ContextProvider=a,xa.Element=e,xa.ForwardRef=c,xa.Fragment=n,xa.Lazy=p,xa.Memo=f,xa.Portal=t,xa.Profiler=s,xa.StrictMode=r,xa.Suspense=u,xa.SuspenseList=d,xa.isAsyncMode=function(){return!1},xa.isConcurrentMode=function(){return!1},xa.isContextConsumer=function(v){return g(v)===i},xa.isContextProvider=function(v){return g(v)===a},xa.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},xa.isForwardRef=function(v){return g(v)===c},xa.isFragment=function(v){return g(v)===n},xa.isLazy=function(v){return g(v)===p},xa.isMemo=function(v){return g(v)===f},xa.isPortal=function(v){return g(v)===t},xa.isProfiler=function(v){return g(v)===s},xa.isStrictMode=function(v){return g(v)===r},xa.isSuspense=function(v){return g(v)===u},xa.isSuspenseList=function(v){return g(v)===d},xa.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===n||v===s||v===r||v===u||v===d||v===h||typeof v=="object"&&v!==null&&(v.$$typeof===p||v.$$typeof===f||v.$$typeof===a||v.$$typeof===i||v.$$typeof===c||v.$$typeof===m||v.getModuleId!==void 0)},xa.typeOf=g,xa}var nLe;function Fqn(){return nLe||(nLe=1,IX.exports=zqn()),IX.exports}Fqn();var txt=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,RX={},rLe;function Bqn(){return rLe||(rLe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const s=n[Symbol.toStringTag];return s==null||!Object.getOwnPropertyDescriptor(n,Symbol.toStringTag)?.writable?!1:n.toString()===`[object ${s}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(RX)),RX}var PX,sLe;function Uqn(){return sLe||(sLe=1,PX=Bqn().isPlainObject),PX}var qqn=Uqn();const Vqn=Qo(qqn);var aLe,iLe,oLe,lLe,cLe;function uLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function dLe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uLe(Object(n),!0).forEach(function(r){Hqn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hqn(e,t,n){return(t=Zqn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zqn(e){var t=Wqn(e,"string");return typeof t=="symbol"?t:t+""}function Wqn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function C8(){return C8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C8.apply(null,arguments)}function jA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var fLe=(e,t,n,r,s)=>{var a=n-r,i;return i=Oo(aLe||(aLe=jA(["M ",",",""])),e,t),i+=Oo(iLe||(iLe=jA(["L ",",",""])),e+n,t),i+=Oo(oLe||(oLe=jA(["L ",",",""])),e+n-a/2,t+s),i+=Oo(lLe||(lLe=jA(["L ",",",""])),e+n-a/2-r,t+s),i+=Oo(cLe||(cLe=jA(["L ",","," Z"])),e,t),i},Gqn={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Qqn=e=>{var t=Qd(e,Gqn),{x:n,y:r,upperWidth:s,lowerWidth:a,height:i,className:o}=t,{animationEasing:c,animationDuration:u,animationBegin:d,isUpdateAnimationActive:f}=t,p=y.useRef(null),[h,m]=y.useState(-1),g=y.useRef(s),v=y.useRef(a),b=y.useRef(i),S=y.useRef(n),w=y.useRef(r),_=Jbe(e,"trapezoid-");if(y.useEffect(()=>{if(p.current&&p.current.getTotalLength)try{var M=p.current.getTotalLength();M&&m(M)}catch{}},[]),n!==+n||r!==+r||s!==+s||a!==+a||i!==+i||s===0&&a===0||i===0)return null;var O=La("recharts-trapezoid",o);if(!f)return y.createElement("g",null,y.createElement("path",C8({},td(t),{className:O,d:fLe(n,r,s,a,i)})));var E=g.current,T=v.current,j=b.current,N=S.current,I=w.current,R="0px ".concat(h===-1?1:h,"px"),P="".concat(h,"px ").concat(h,"px"),U=pvt(["strokeDasharray"],u,c);return y.createElement(Kbe,{animationId:_,key:_,canBegin:h>0,duration:u,easing:c,isActive:f,begin:d},M=>{var L=_d(E,s,M),F=_d(T,a,M),z=_d(j,i,M),q=_d(N,n,M),H=_d(I,r,M);p.current&&(g.current=L,v.current=F,b.current=z,S.current=q,w.current=H);var D=M>0?{transition:U,strokeDasharray:P}:{strokeDasharray:R};return y.createElement("path",C8({},td(t),{className:O,d:fLe(q,H,L,F,z),ref:p,style:dLe(dLe({},D),t.style)}))})},Yqn=["option","shapeType","activeClassName","inActiveClassName"];function Xqn(e,t){if(e==null)return{};var n,r,s=Kqn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function Kqn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function pLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function T8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pLe(Object(n),!0).forEach(function(r){Jqn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jqn(e,t,n){return(t=eVn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eVn(e){var t=tVn(e,"string");return typeof t=="symbol"?t:t+""}function tVn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nVn(e,t){return T8(T8({},t),e)}function rVn(e,t){return e==="symbols"}function hLe(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return y.createElement(vvt,n);case"trapezoid":return y.createElement(Qqn,n);case"sector":return y.createElement(xvt,n);case"symbols":if(rVn(t))return y.createElement(rgt,n);break;case"curve":return y.createElement(fvt,n);default:return null}}function sVn(e){return y.isValidElement(e)?e.props:e}function aVn(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:s="recharts-shape"}=e,a=Xqn(e,Yqn),i;if(y.isValidElement(t))i=y.cloneElement(t,T8(T8({},a),sVn(t)));else if(typeof t=="function")i=t(a,a.index);else if(Vqn(t)&&typeof t!="boolean"){var o=nVn(t,a);i=y.createElement(hLe,{shapeType:n,elementProps:o})}else{var c=a;i=y.createElement(hLe,{shapeType:n,elementProps:c})}return a.isActive?y.createElement(cb,{className:r},i):y.createElement(cb,{className:s},i)}function iVn(e){var{tooltipEntrySettings:t}=e,n=hl(),r=Yd(),s=y.useRef(null);return y.useLayoutEffect(()=>{r||(s.current===null?n(m7n(t)):s.current!==t&&n(g7n({prev:s.current,next:t})),s.current=t)},[t,n,r]),y.useLayoutEffect(()=>()=>{s.current&&(n(v7n(s.current)),s.current=null)},[n]),null}function oVn(e){var{legendPayload:t}=e,n=hl(),r=Yd(),s=y.useRef(null);return y.useLayoutEffect(()=>{r||(s.current===null?n(T5n(t)):s.current!==t&&n(j5n({prev:s.current,next:t})),s.current=t)},[n,r,t]),y.useLayoutEffect(()=>()=>{s.current&&(n(N5n(s.current)),s.current=null)},[n]),null}var MX,lVn=()=>{var[e]=y.useState(()=>DP("uid-"));return e},cVn=(MX=Zk.useId)!==null&&MX!==void 0?MX:lVn;function uVn(e,t){var n=cVn();return t||(e?"".concat(e,"-").concat(n):n)}var dVn=y.createContext(void 0),fVn=e=>{var{id:t,type:n,children:r}=e,s=uVn("recharts-".concat(n),t);return y.createElement(dVn.Provider,{value:s},r(s))},pVn={cartesianItems:[],polarItems:[]},nxt=Su({name:"graphicalItems",initialState:pVn,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Ci()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,s=sh(e).cartesianItems.indexOf(n);s>-1&&(e.cartesianItems[s]=r)},prepare:Ci()},removeCartesianGraphicalItem:{reducer(e,t){var n=sh(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Ci()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Ci()},removePolarGraphicalItem:{reducer(e,t){var n=sh(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Ci()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,s=sh(e).polarItems.indexOf(n);s>-1&&(e.polarItems[s]=r)},prepare:Ci()}}}),{addCartesianGraphicalItem:hVn,replaceCartesianGraphicalItem:mVn,removeCartesianGraphicalItem:gVn,addPolarGraphicalItem:Uis,removePolarGraphicalItem:qis,replacePolarGraphicalItem:Vis}=nxt.actions,vVn=nxt.reducer,yVn=e=>{var t=hl(),n=y.useRef(null);return y.useLayoutEffect(()=>{n.current===null?t(hVn(e)):n.current!==e&&t(mVn({prev:n.current,next:e})),n.current=e},[t,e]),y.useLayoutEffect(()=>()=>{n.current&&(t(gVn(n.current)),n.current=null)},[t]),null},bVn=y.memo(yVn),xVn=["points"];function mLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function $X(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mLe(Object(n),!0).forEach(function(r){wVn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wVn(e,t,n){return(t=SVn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SVn(e){var t=kVn(e,"string");return typeof t=="symbol"?t:t+""}function kVn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function j8(){return j8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j8.apply(null,arguments)}function _Vn(e,t){if(e==null)return{};var n,r,s=OVn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function OVn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function EVn(e){var{option:t,dotProps:n,className:r}=e;if(y.isValidElement(t))return y.cloneElement(t,n);if(typeof t=="function")return t(n);var s=La(r,typeof t!="boolean"?t.className:""),a=n??{},{points:i}=a,o=_Vn(a,xVn);return y.createElement(Jbt,j8({},o,{className:s}))}function CVn(e,t){return e==null?!1:t?!0:e.length===1}function TVn(e){var{points:t,dot:n,className:r,dotClassName:s,dataKey:a,baseProps:i,needClip:o,clipPathId:c,zIndex:u=Zu.scatter}=e;if(!CVn(t,n))return null;var d=txt(n),f=DDn(n),p=t.map((m,g)=>{var v,b,S=$X($X($X({r:3},i),f),{},{index:g,cx:(v=m.x)!==null&&v!==void 0?v:void 0,cy:(b=m.y)!==null&&b!==void 0?b:void 0,dataKey:a,value:m.value,payload:m.payload,points:t});return y.createElement(EVn,{key:"dot-".concat(g),option:n,dotProps:S,className:s})}),h={};return o&&c!=null&&(h.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),y.createElement(Fb,{zIndex:u},y.createElement(cb,j8({className:r},h),p))}function gLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function vLe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gLe(Object(n),!0).forEach(function(r){jVn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jVn(e,t,n){return(t=NVn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NVn(e){var t=AVn(e,"string");return typeof t=="symbol"?t:t+""}function AVn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var IVn={xAxis:{},yAxis:{},zAxis:{}},rxt=Su({name:"cartesianAxis",initialState:IVn,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Ci()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:Ci()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Ci()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Ci()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:Ci()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Ci()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Ci()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:Ci()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Ci()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,s=e.yAxis[n];if(s){var a,i=s.widthHistory||[];if(i.length===3&&i[0]===i[2]&&r===i[1]&&r!==s.width&&Math.abs(r-((a=i[0])!==null&&a!==void 0?a:0))<=1)return;var o=[...i,r].slice(-3);e.yAxis[n]=vLe(vLe({},s),{},{width:r,widthHistory:o})}}}}),{addXAxis:RVn,replaceXAxis:PVn,removeXAxis:MVn,addYAxis:$Vn,replaceYAxis:DVn,removeYAxis:LVn,addZAxis:His,replaceZAxis:Zis,removeZAxis:Wis,updateYAxisWidth:zVn}=rxt.actions,FVn=rxt.reducer,BVn=et([Pc],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),UVn=et([BVn,Pb,Mb],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),e0e=()=>dr(UVn),qVn=()=>dr(mBn);function yLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function DX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yLe(Object(n),!0).forEach(function(r){VVn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VVn(e,t,n){return(t=HVn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HVn(e){var t=ZVn(e,"string");return typeof t=="symbol"?t:t+""}function ZVn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WVn=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:s,dataKey:a,clipPath:i}=e;if(s===!1||t.x==null||t.y==null)return null;var o={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=DX(DX(DX({},o),cU(s)),Fbe(s)),u;return y.isValidElement(s)?u=y.cloneElement(s,c):typeof s=="function"?u=s(c):u=y.createElement(Jbt,c),y.createElement(cb,{className:"recharts-active-dot",clipPath:i},u)};function GVn(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:s,clipPath:a,zIndex:i=Zu.activeDot}=e,o=dr(QP),c=qVn();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return Kl(u)?null:y.createElement(Fb,{zIndex:i},y.createElement(WVn,{point:u,childIndex:Number(o),mainColor:n,dataKey:s,activeDot:r,clipPath:a}))}var QVn=e=>{var{chartData:t}=e,n=hl(),r=Yd();return y.useEffect(()=>r?()=>{}:(n($3e(t)),()=>{n($3e(void 0))}),[t,n,r]),null},bLe={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},sxt=Su({name:"brush",initialState:bLe,reducers:{setBrushSettings(e,t){return t.payload==null?bLe:t.payload}}}),{setBrushSettings:Gis}=sxt.actions,YVn=sxt.reducer;function XVn(e){return(e%180+180)%180}var KVn=function(t){var{width:n,height:r}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=XVn(s),i=a*Math.PI/180,o=Math.atan(r/n),c=i>o&&i<Math.PI-o?r/Math.sin(i):n/Math.cos(i);return Math.abs(c)},JVn={dots:[],areas:[],lines:[]},axt=Su({name:"referenceElements",initialState:JVn,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=sh(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=sh(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=sh(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:Qis,removeDot:Yis,addArea:Xis,removeArea:Kis,addLine:Jis,removeLine:eos}=axt.actions,eHn=axt.reducer,tHn=y.createContext(void 0),nHn=e=>{var{children:t}=e,[n]=y.useState("".concat(DP("recharts"),"-clip")),r=e0e();if(r==null)return null;var{x:s,y:a,width:i,height:o}=r;return y.createElement(tHn.Provider,{value:n},y.createElement("defs",null,y.createElement("clipPath",{id:n},y.createElement("rect",{x:s,y:a,height:o,width:i}))),t)};function ixt(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var s=e[r];s!==void 0&&n.push(s)}return n}function rHn(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return KVn(r,n)}function sHn(e,t,n){var r=n==="width",{x:s,y:a,width:i,height:o}=e;return t===1?{start:r?s:a,end:r?s+i:a+o}:{start:r?s+i:a+o,end:r?s:a}}function XP(e,t,n,r,s){if(e*t<e*r||e*t>e*s)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-s)<=0}function aHn(e,t){return ixt(e,t+1)}function iHn(e,t,n,r,s){for(var a=(r||[]).slice(),{start:i,end:o}=t,c=0,u=1,d=i,f=function(){var m=r?.[c];if(m===void 0)return{v:ixt(r,u)};var g=c,v,b=()=>(v===void 0&&(v=n(m,g)),v),S=m.coordinate,w=c===0||XP(e,S,b,d,o);w||(c=0,d=i,u+=1),w&&(d=S+e*(b()/2+s),c+=u)},p;u<=a.length;)if(p=f(),p)return p.v;return[]}function oHn(e,t,n,r,s){var a=(r||[]).slice(),i=a.length;if(i===0)return[];for(var{start:o,end:c}=t,u=1;u<=i;u++){for(var d=(i-1)%u,f=o,p=!0,h=function(){var _=r[g];if(_==null)return 0;var O=g,E,T=()=>(E===void 0&&(E=n(_,O)),E),j=_.coordinate,N=g===d||XP(e,j,T,f,c);if(!N)return p=!1,1;N&&(f=j+e*(T()/2+s))},m,g=d;g<i&&(m=h(),!(m!==0&&m===1));g+=u);if(p){for(var v=[],b=d;b<i;b+=u){var S=r[b];S!=null&&v.push(S)}return v}}return[]}function xLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Vc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xLe(Object(n),!0).forEach(function(r){lHn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lHn(e,t,n){return(t=cHn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cHn(e){var t=uHn(e,"string");return typeof t=="symbol"?t:t+""}function uHn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dHn(e,t,n,r,s){for(var a=(r||[]).slice(),i=a.length,{start:o}=t,{end:c}=t,u=function(p){var h=a[p];if(h==null)return 1;var m=h,g,v=()=>(g===void 0&&(g=n(h,p)),g);if(p===i-1){var b=e*(m.coordinate+e*v()/2-c);a[p]=m=Vc(Vc({},m),{},{tickCoord:b>0?m.coordinate-b*e:m.coordinate})}else a[p]=m=Vc(Vc({},m),{},{tickCoord:m.coordinate});if(m.tickCoord!=null){var S=XP(e,m.tickCoord,v,o,c);S&&(c=m.tickCoord-e*(v()/2+s),a[p]=Vc(Vc({},m),{},{isShow:!0}))}},d=i-1;d>=0;d--)u(d);return a}function fHn(e,t,n,r,s,a){var i=(r||[]).slice(),o=i.length,{start:c,end:u}=t;if(a){var d=r[o-1];if(d!=null){var f=n(d,o-1),p=e*(d.coordinate+e*f/2-u);if(i[o-1]=d=Vc(Vc({},d),{},{tickCoord:p>0?d.coordinate-p*e:d.coordinate}),d.tickCoord!=null){var h=XP(e,d.tickCoord,()=>f,c,u);h&&(u=d.tickCoord-e*(f/2+s),i[o-1]=Vc(Vc({},d),{},{isShow:!0}))}}}for(var m=a?o-1:o,g=function(S){var w=i[S];if(w==null)return 1;var _=w,O,E=()=>(O===void 0&&(O=n(w,S)),O);if(S===0){var T=e*(_.coordinate-e*E()/2-c);i[S]=_=Vc(Vc({},_),{},{tickCoord:T<0?_.coordinate-T*e:_.coordinate})}else i[S]=_=Vc(Vc({},_),{},{tickCoord:_.coordinate});if(_.tickCoord!=null){var j=XP(e,_.tickCoord,E,c,u);j&&(c=_.tickCoord+e*(E()/2+s),i[S]=Vc(Vc({},_),{},{isShow:!0}))}},v=0;v<m;v++)g(v);return i}function t0e(e,t,n){var{tick:r,ticks:s,viewBox:a,minTickGap:i,orientation:o,interval:c,tickFormatter:u,unit:d,angle:f}=e;if(!s||!s.length||!r)return[];if(Kn(c)||w$.isSsr){var p;return(p=aHn(s,Kn(c)?c:0))!==null&&p!==void 0?p:[]}var h=[],m=o==="top"||o==="bottom"?"width":"height",g=d&&m==="width"?oR(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},v=(O,E)=>{var T=typeof u=="function"?u(O.value,E):O.value;return m==="width"?rHn(oR(T,{fontSize:t,letterSpacing:n}),g,f):oR(T,{fontSize:t,letterSpacing:n})[m]},b=s[0],S=s[1],w=s.length>=2&&b!=null&&S!=null?rh(S.coordinate-b.coordinate):1,_=sHn(a,w,m);return c==="equidistantPreserveStart"?iHn(w,_,v,s,i):c==="equidistantPreserveEnd"?oHn(w,_,v,s,i):(c==="preserveStart"||c==="preserveStartEnd"?h=fHn(w,_,v,s,i,c==="preserveStartEnd"):h=dHn(w,_,v,s,i),h.filter(O=>O.isShow))}var pHn=e=>{var{ticks:t,label:n,labelGapWithTick:r=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 o=n?n.getBoundingClientRect().width:0,c=s+a,u=i+c+o+(n?r:0);return Math.round(u)}return 0},hHn={xAxis:{},yAxis:{}},oxt=Su({name:"renderedTicks",initialState:hHn,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:s}=t.payload;e[n][r]=s},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:mHn,removeRenderedTicks:gHn}=oxt.actions,vHn=oxt.reducer,yHn=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function bHn(e,t){if(e==null)return{};var n,r,s=xHn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function xHn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function bk(){return bk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bk.apply(null,arguments)}function wLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function _o(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wLe(Object(n),!0).forEach(function(r){wHn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wHn(e,t,n){return(t=SHn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SHn(e){var t=kHn(e,"string");return typeof t=="symbol"?t:t+""}function kHn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Xy={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:Zu.axis};function _Hn(e){var{x:t,y:n,width:r,height:s,orientation:a,mirror:i,axisLine:o,otherSvgProps:c}=e;if(!o)return null;var u=_o(_o(_o({},c),cv(o)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!i||a==="bottom"&&i);u=_o(_o({},u),{},{x1:t,y1:n+d*s,x2:t+r,y2:n+d*s})}else{var f=+(a==="left"&&!i||a==="right"&&i);u=_o(_o({},u),{},{x1:t+f*r,y1:n,x2:t+f*r,y2:n+s})}return y.createElement("line",bk({},u,{className:La("recharts-cartesian-axis-line",pU(o,"className"))}))}function OHn(e,t,n,r,s,a,i,o,c){var u,d,f,p,h,m,g=o?-1:1,v=e.tickSize||i,b=Kn(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=d=e.coordinate,p=n+ +!o*s,f=p-g*v,m=f-g*c,h=b;break;case"left":f=p=e.coordinate,d=t+ +!o*r,u=d-g*v,h=u-g*c,m=b;break;case"right":f=p=e.coordinate,d=t+ +o*r,u=d+g*v,h=u+g*c,m=b;break;default:u=d=e.coordinate,p=n+ +o*s,f=p+g*v,m=f+g*c,h=b;break}return{line:{x1:u,y1:f,x2:d,y2:p},tick:{x:h,y:m}}}function EHn(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function CHn(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function THn(e){var{option:t,tickProps:n,value:r}=e,s,a=La(n.className,"recharts-cartesian-axis-tick-value");if(y.isValidElement(t))s=y.cloneElement(t,_o(_o({},n),{},{className:a}));else if(typeof t=="function")s=t(_o(_o({},n),{},{className:a}));else{var i="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(i=La(i,Lqn(t))),s=y.createElement(Kxe,bk({},n,{className:i}),r)}return s}function jHn(e){var{ticks:t,axisType:n,axisId:r}=e,s=hl();return y.useEffect(()=>{if(r==null||n==null)return Sj;var a=t.map(i=>({value:i.value,coordinate:i.coordinate,offset:i.offset,index:i.index}));return s(mHn({ticks:a,axisId:r,axisType:n})),()=>{s(gHn({axisId:r,axisType:n}))}},[s,t,r,n]),null}var NHn=y.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:s,stroke:a,tickFormatter:i,unit:o,padding:c,tickTextProps:u,orientation:d,mirror:f,x:p,y:h,width:m,height:g,tickSize:v,tickMargin:b,fontSize:S,letterSpacing:w,getTicksConfig:_,events:O,axisType:E,axisId:T}=e,j=t0e(_o(_o({},_),{},{ticks:n}),S,w),N=cv(_),I=cU(r),R=Hbt(N.textAnchor)?N.textAnchor:EHn(d,f),P=CHn(d,f),U={};typeof s=="object"&&(U=s);var M=_o(_o({},N),{},{fill:"none"},U),L=j.map(q=>_o({entry:q},OHn(q,p,h,m,g,d,v,f,b))),F=L.map(q=>{var{entry:H,line:D}=q;return y.createElement(cb,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(H.value,"-").concat(H.coordinate,"-").concat(H.tickCoord)},s&&y.createElement("line",bk({},M,D,{className:La("recharts-cartesian-axis-tick-line",pU(s,"className"))})))}),z=L.map((q,H)=>{var D,Y,{entry:V,tick:$}=q,W=_o(_o(_o(_o({verticalAnchor:P},N),{},{textAnchor:R,stroke:"none",fill:a},$),{},{index:H,payload:V,visibleTicksCount:j.length,tickFormatter:i,padding:c},u),{},{angle:(D=(Y=u?.angle)!==null&&Y!==void 0?Y:N.angle)!==null&&D!==void 0?D:0}),G=_o(_o({},W),I);return y.createElement(cb,bk({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},B4n(O,V,H)),r&&y.createElement(THn,{option:r,tickProps:G,value:"".concat(typeof i=="function"?i(V.value,H):V.value).concat(o||"")}))});return y.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(E,"-ticks")},y.createElement(jHn,{ticks:j,axisId:T,axisType:E}),z.length>0&&y.createElement(Fb,{zIndex:Zu.label},y.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(E,"-tick-labels"),ref:t},z)),F.length>0&&y.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(E,"-tick-lines")},F))}),AHn=y.forwardRef((e,t)=>{var{axisLine:n,width:r,height:s,className:a,hide:i,ticks:o,axisType:c,axisId:u}=e,d=bHn(e,yHn),[f,p]=y.useState(""),[h,m]=y.useState(""),g=y.useRef(null);y.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var b;return pHn({ticks:g.current,label:(b=e.labelRef)===null||b===void 0?void 0:b.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var v=y.useCallback(b=>{if(b){var S=b.getElementsByClassName("recharts-cartesian-axis-tick-value");g.current=S;var w=S[0];if(w){var _=window.getComputedStyle(w),O=_.fontSize,E=_.letterSpacing;(O!==f||E!==h)&&(p(O),m(E))}}},[f,h]);return i||r!=null&&r<=0||s!=null&&s<=0?null:y.createElement(Fb,{zIndex:e.zIndex},y.createElement(cb,{className:La("recharts-cartesian-axis",a)},y.createElement(_Hn,{x:e.x,y:e.y,width:r,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:cv(e)}),y.createElement(NHn,{ref:v,axisType:c,events:d,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:h,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:o,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:u}),y.createElement(vqn,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},y.createElement(Cqn,{label:e.label,labelRef:e.labelRef}),e.children)))}),n0e=y.forwardRef((e,t)=>{var n=Qd(e,Xy);return y.createElement(AHn,bk({},n,{ref:t}))});n0e.displayName="CartesianAxis";var IHn=["x1","y1","x2","y2","key"],RHn=["offset"],PHn=["xAxisId","yAxisId"],MHn=["xAxisId","yAxisId"];function SLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Jc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SLe(Object(n),!0).forEach(function(r){$Hn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Hn(e,t,n){return(t=DHn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DHn(e){var t=LHn(e,"string");return typeof t=="symbol"?t:t+""}function LHn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pS(){return pS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pS.apply(null,arguments)}function N8(e,t){if(e==null)return{};var n,r,s=zHn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function zHn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var FHn=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:s,width:a,height:i,ry:o}=e;return y.createElement("rect",{x:r,y:s,ry:o,width:a,height:i,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function lxt(e){var{option:t,lineItemProps:n}=e,r;if(y.isValidElement(t))r=y.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var s,{x1:a,y1:i,x2:o,y2:c,key:u}=n,d=N8(n,IHn),f=(s=cv(d))!==null&&s!==void 0?s:{},{offset:p}=f,h=N8(f,RHn);r=y.createElement("line",pS({},h,{x1:a,y1:i,x2:o,y2:c,fill:"none",key:u}))}return r}function BHn(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:s}=e;if(!r||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,o=N8(e,PHn),c=s.map((u,d)=>{var f=Jc(Jc({},o),{},{x1:t,y1:u,x2:t+n,y2:u,key:"line-".concat(d),index:d});return y.createElement(lxt,{key:"line-".concat(d),option:r,lineItemProps:f})});return y.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function UHn(e){var{y:t,height:n,vertical:r=!0,verticalPoints:s}=e;if(!r||!s||!s.length)return null;var{xAxisId:a,yAxisId:i}=e,o=N8(e,MHn),c=s.map((u,d)=>{var f=Jc(Jc({},o),{},{x1:u,y1:t,x2:u,y2:t+n,key:"line-".concat(d),index:d});return y.createElement(lxt,{option:r,lineItemProps:f,key:"line-".concat(d)})});return y.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function qHn(e){var{horizontalFill:t,fillOpacity:n,x:r,y:s,width:a,height:i,horizontalPoints:o,horizontal:c=!0}=e;if(!c||!t||!t.length||o==null)return null;var u=o.map(f=>Math.round(f+s-s)).sort((f,p)=>f-p);s!==u[0]&&u.unshift(0);var d=u.map((f,p)=>{var h=u[p+1],m=h==null,g=m?s+i-f:h-f;if(g<=0)return null;var v=p%t.length;return y.createElement("rect",{key:"react-".concat(p),y:f,x:r,height:g,width:a,stroke:"none",fill:t[v],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function VHn(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:s,y:a,width:i,height:o,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var u=c.map(f=>Math.round(f+s-s)).sort((f,p)=>f-p);s!==u[0]&&u.unshift(0);var d=u.map((f,p)=>{var h=u[p+1],m=h==null,g=m?s+i-f:h-f;if(g<=0)return null;var v=p%n.length;return y.createElement("rect",{key:"react-".concat(p),x:f,y:a,width:g,height:o,stroke:"none",fill:n[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var HHn=(e,t)=>{var{xAxis:n,width:r,height:s,offset:a}=e;return Vgt(t0e(Jc(Jc(Jc({},Xy),n),{},{ticks:Hgt(n),viewBox:{x:0,y:0,width:r,height:s}})),a.left,a.left+a.width,t)},ZHn=(e,t)=>{var{yAxis:n,width:r,height:s,offset:a}=e;return Vgt(t0e(Jc(Jc(Jc({},Xy),n),{},{ticks:Hgt(n),viewBox:{x:0,y:0,width:r,height:s}})),a.top,a.top+a.height,t)},WHn={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Zu.grid};function cxt(e){var t=Jgt(),n=evt(),r=Kgt(),s=Jc(Jc({},Qd(e,WHn)),{},{x:Kn(e.x)?e.x:r.left,y:Kn(e.y)?e.y:r.top,width:Kn(e.width)?e.width:r.width,height:Kn(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:i,x:o,y:c,width:u,height:d,syncWithTicks:f,horizontalValues:p,verticalValues:h}=s,m=Yd(),g=dr(N=>k3e(N,"xAxis",a,m)),v=dr(N=>k3e(N,"yAxis",i,m));if(!dv(u)||!dv(d)||!Kn(o)||!Kn(c))return null;var b=s.verticalCoordinatesGenerator||HHn,S=s.horizontalCoordinatesGenerator||ZHn,{horizontalPoints:w,verticalPoints:_}=s;if((!w||!w.length)&&typeof S=="function"){var O=p&&p.length,E=S({yAxis:v?Jc(Jc({},v),{},{ticks:O?p:v.ticks}):void 0,width:t??u,height:n??d,offset:r},O?!0:f);t8(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof E,"]")),Array.isArray(E)&&(w=E)}if((!_||!_.length)&&typeof b=="function"){var T=h&&h.length,j=b({xAxis:g?Jc(Jc({},g),{},{ticks:T?h:g.ticks}):void 0,width:t??u,height:n??d,offset:r},T?!0:f);t8(Array.isArray(j),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(_=j)}return y.createElement(Fb,{zIndex:s.zIndex},y.createElement("g",{className:"recharts-cartesian-grid"},y.createElement(FHn,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),y.createElement(qHn,pS({},s,{horizontalPoints:w})),y.createElement(VHn,pS({},s,{verticalPoints:_})),y.createElement(BHn,pS({},s,{offset:r,horizontalPoints:w,xAxis:g,yAxis:v})),y.createElement(UHn,pS({},s,{offset:r,verticalPoints:_,xAxis:g,yAxis:v}))))}cxt.displayName="CartesianGrid";var GHn={},uxt=Su({name:"errorBars",initialState:GHn,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:s}=t.payload;e[n]&&(e[n]=e[n].map(a=>a.dataKey===r.dataKey&&a.direction===r.direction?s:a))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(s=>s.dataKey!==r.dataKey||s.direction!==r.direction))}}}),{addErrorBar:tos,replaceErrorBar:nos,removeErrorBar:ros}=uxt.actions,QHn=uxt.reducer,YHn=["children"];function XHn(e,t){if(e==null)return{};var n,r,s=KHn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function KHn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var JHn={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},eZn=y.createContext(JHn);function tZn(e){var{children:t}=e,n=XHn(e,YHn);return y.createElement(eZn.Provider,{value:n},t)}function dxt(e,t){var n,r,s=dr(u=>Db(u,e)),a=dr(u=>Lb(u,t)),i=(n=s?.allowDataOverflow)!==null&&n!==void 0?n:Sl.allowDataOverflow,o=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:kl.allowDataOverflow,c=i||o;return{needClip:c,needClipX:i,needClipY:o}}function nZn(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,s=e0e(),{needClipX:a,needClipY:i,needClip:o}=dxt(t,n);if(!o||!s)return null;var{x:c,y:u,width:d,height:f}=s;return y.createElement("clipPath",{id:"clipPath-".concat(r)},y.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 fxt=(e,t,n,r)=>ubt(e,"xAxis",t,r),pxt=(e,t,n,r)=>cbt(e,"xAxis",t,r),hxt=(e,t,n,r)=>ubt(e,"yAxis",n,r),mxt=(e,t,n,r)=>cbt(e,"yAxis",n,r),rZn=et([ho,fxt,hxt,pxt,mxt],(e,t,n,r,s)=>Rb(e,"xAxis")?e8(t,r,!1):e8(n,s,!1)),sZn=(e,t,n,r,s)=>s;function aZn(e){return e.type==="line"}var iZn=et([Iyt,sZn],(e,t)=>e.filter(aZn).find(n=>n.id===t)),oZn=et([ho,fxt,hxt,pxt,mxt,iZn,rZn,S$],(e,t,n,r,s,a,i,o)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:d}=o;if(!(a==null||t==null||n==null||r==null||s==null||r.length===0||s.length===0||i==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:f,data:p}=a,h;if(p!=null&&p.length>0?h=p:h=c?.slice(u,d+1),h!=null)return TZn({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:s,dataKey:f,bandSize:i,displayedData:h})}});function lZn(e){var t=cU(e),n=3,r=2;if(t!=null){var{r:s,strokeWidth:a}=t,i=Number(s),o=Number(a);return(Number.isNaN(i)||i<0)&&(i=n),(Number.isNaN(o)||o<0)&&(o=r),{r:i,strokeWidth:o}}return{r:n,strokeWidth:r}}var cZn=["id"],uZn=["type","layout","connectNulls","needClip","shape"],dZn=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function KP(){return KP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KP.apply(null,arguments)}function kLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function kg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kLe(Object(n),!0).forEach(function(r){fZn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fZn(e,t,n){return(t=pZn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pZn(e){var t=hZn(e,"string");return typeof t=="symbol"?t:t+""}function hZn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function r0e(e,t){if(e==null)return{};var n,r,s=mZn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function mZn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var gZn=e=>{var{dataKey:t,name:n,stroke:r,legendType:s,hide:a}=e;return[{inactive:a,dataKey:t,type:s,color:r,value:Zgt(n,t),payload:e}]},vZn=y.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:s,fill:a,name:i,hide:o,unit:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:n,getPosition:Sj,settings:{stroke:r,strokeWidth:s,fill:a,dataKey:t,nameKey:void 0,name:Zgt(i,t),hide:o,type:u,color:r,unit:c,graphicalItemId:d}};return y.createElement(iVn,{tooltipEntrySettings:f})}),gxt=(e,t)=>"".concat(t,"px ").concat(e,"px");function yZn(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],s=0;s<t;++s)r.push(...n);return r}var bZn=(e,t,n)=>{var r=n.reduce((p,h)=>p+h,0);if(!r)return gxt(t,e);for(var s=Math.floor(e/r),a=e%r,i=[],o=0,c=0;o<n.length;c+=(u=n[o])!==null&&u!==void 0?u:0,++o){var u,d=n[o];if(d!=null&&c+d>a){i=[...n.slice(0,o),a-c];break}}var f=i.length%2===0?[0,t]:[t];return[...yZn(n,s),...i,...f].map(p=>"".concat(p,"px")).join(", ")};function xZn(e){var{clipPathId:t,points:n,props:r}=e,{dot:s,dataKey:a,needClip:i}=r,{id:o}=r,c=r0e(r,cZn),u=cv(c);return y.createElement(TVn,{points:n,dot:s,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:i,clipPathId:t})}function wZn(e){var{showLabels:t,children:n,points:r}=e,s=y.useMemo(()=>r?.map(a=>{var i,o,c={x:(i=a.x)!==null&&i!==void 0?i:0,y:(o=a.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return kg(kg({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return y.createElement(Iqn,{value:t?s:void 0},n)}function _Le(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:s,props:a}=e,{type:i,layout:o,connectNulls:c,needClip:u,shape:d}=a,f=r0e(a,uZn),p=kg(kg({},td(f)),{},{fill:"none",className:"recharts-line-curve",clipPath:u?"url(#clipPath-".concat(t,")"):void 0,points:r,type:i,layout:o,connectNulls:c,strokeDasharray:s??a.strokeDasharray});return y.createElement(y.Fragment,null,r?.length>1&&y.createElement(aVn,KP({shapeType:"curve",option:d},p,{pathRef:n})),y.createElement(xZn,{points:r,clipPathId:t,props:a}))}function SZn(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function kZn(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:s,longestAnimatedLengthRef:a}=e,{points:i,strokeDasharray:o,isAnimationActive:c,animationBegin:u,animationDuration:d,animationEasing:f,animateNewValues:p,width:h,height:m,onAnimationEnd:g,onAnimationStart:v}=n,b=s.current,S=Jbe(i,"recharts-line-"),w=y.useRef(S),[_,O]=y.useState(!1),E=!_,T=y.useCallback(()=>{typeof g=="function"&&g(),O(!1)},[g]),j=y.useCallback(()=>{typeof v=="function"&&v(),O(!0)},[v]),N=SZn(r.current),I=y.useRef(0);w.current!==S&&(I.current=a.current,w.current=S);var R=I.current;return y.createElement(wZn,{points:i,showLabels:E},n.children,y.createElement(Kbe,{animationId:S,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:T,onAnimationStart:j,key:S},P=>{var U=_d(R,N+R,P),M=Math.min(U,N),L;if(c)if(o){var F="".concat(o).split(/[,\s]+/gim).map(H=>parseFloat(H));L=bZn(M,N,F)}else L=gxt(N,M);else L=o==null?void 0:String(o);if(P>0&&N>0&&(s.current=i,a.current=Math.max(a.current,M)),b){var z=b.length/i.length,q=P===1?i:i.map((H,D)=>{var Y=Math.floor(D*z);if(b[Y]){var V=b[Y];return kg(kg({},H),{},{x:_d(V.x,H.x,P),y:_d(V.y,H.y,P)})}return p?kg(kg({},H),{},{x:_d(h*2,H.x,P),y:_d(m/2,H.y,P)}):kg(kg({},H),{},{x:H.x,y:H.y})});return s.current=q,y.createElement(_Le,{props:n,points:q,clipPathId:t,pathRef:r,strokeDasharray:L})}return y.createElement(_Le,{props:n,points:i,clipPathId:t,pathRef:r,strokeDasharray:L})}),y.createElement(Mqn,{label:n.label}))}function _Zn(e){var{clipPathId:t,props:n}=e,r=y.useRef(null),s=y.useRef(0),a=y.useRef(null);return y.createElement(kZn,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:s,pathRef:a})}var OZn=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:Ql(e.payload,t)}};class EZn extends y.Component{render(){var{hide:t,dot:n,points:r,className:s,xAxisId:a,yAxisId:i,top:o,left:c,width:u,height:d,id:f,needClip:p,zIndex:h}=this.props;if(t)return null;var m=La("recharts-line",s),g=f,{r:v,strokeWidth:b}=lZn(n),S=txt(n),w=v*2+b,_=p?"url(#clipPath-".concat(S?"":"dots-").concat(g,")"):void 0;return y.createElement(Fb,{zIndex:h},y.createElement(cb,{className:m},p&&y.createElement("defs",null,y.createElement(nZn,{clipPathId:g,xAxisId:a,yAxisId:i}),!S&&y.createElement("clipPath",{id:"clipPath-dots-".concat(g)},y.createElement("rect",{x:c-w/2,y:o-w/2,width:u+w,height:d+w}))),y.createElement(tZn,{xAxisId:a,yAxisId:i,data:r,dataPointFormatter:OZn,errorBarOffset:0},y.createElement(_Zn,{props:this.props,clipPathId:g}))),y.createElement(GVn,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:_}))}}var vxt={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:Zu.line,type:"linear"};function CZn(e){var t=Qd(e,vxt),{activeDot:n,animateNewValues:r,animationBegin:s,animationDuration:a,animationEasing:i,connectNulls:o,dot:c,hide:u,isAnimationActive:d,label:f,legendType:p,xAxisId:h,yAxisId:m,id:g}=t,v=r0e(t,dZn),{needClip:b}=dxt(h,m),S=e0e(),w=kj(),_=Yd(),O=dr(I=>oZn(I,h,m,_,g));if(w!=="horizontal"&&w!=="vertical"||O==null||S==null)return null;var{height:E,width:T,x:j,y:N}=S;return y.createElement(EZn,KP({},v,{id:g,connectNulls:o,dot:c,activeDot:n,animateNewValues:r,animationBegin:s,animationDuration:a,animationEasing:i,isAnimationActive:d,hide:u,label:f,legendType:p,xAxisId:h,yAxisId:m,points:O,layout:w,height:E,width:T,left:j,top:N,needClip:b}))}function TZn(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:s,yAxisTicks:a,dataKey:i,bandSize:o,displayedData:c}=e;return c.map((u,d)=>{var f=Ql(u,i);if(t==="horizontal"){var p=SDe({axis:n,ticks:s,bandSize:o,entry:u,index:d}),h=Kl(f)?null:r.scale.map(f);return{x:p,y:h??null,value:f,payload:u}}var m=Kl(f)?null:n.scale.map(f),g=SDe({axis:r,ticks:a,bandSize:o,entry:u,index:d});return m==null||g==null?null:{x:m,y:g,value:f,payload:u}}).filter(Boolean)}function jZn(e){var t=Qd(e,vxt),n=Yd();return y.createElement(fVn,{id:t.id,type:"line"},r=>y.createElement(y.Fragment,null,y.createElement(oVn,{legendPayload:gZn(t)}),y.createElement(vZn,{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:r}),y.createElement(bVn,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),y.createElement(CZn,KP({},t,{id:r}))))}var yxt=y.memo(jZn,IU);yxt.displayName="Line";var NZn=["domain","range"],AZn=["domain","range"];function OLe(e,t){if(e==null)return{};var n,r,s=IZn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function IZn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ELe(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 bxt(e,t){if(e===t)return!0;var{domain:n,range:r}=e,s=OLe(e,NZn),{domain:a,range:i}=t,o=OLe(t,AZn);return!ELe(n,a)||!ELe(r,i)?!1:IU(s,o)}var RZn=["type"],PZn=["dangerouslySetInnerHTML","ticks","scale"],MZn=["id","scale"];function Wde(){return Wde=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wde.apply(null,arguments)}function CLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function TLe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CLe(Object(n),!0).forEach(function(r){$Zn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Zn(e,t,n){return(t=DZn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DZn(e){var t=LZn(e,"string");return typeof t=="symbol"?t:t+""}function LZn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gde(e,t){if(e==null)return{};var n,r,s=zZn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function zZn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function FZn(e){var t=hl(),n=y.useRef(null),r=tvt(),{type:s}=e,a=Gde(e,RZn),i=MU(r,"xAxis",s),o=y.useMemo(()=>{if(i!=null)return TLe(TLe({},a),{},{type:i})},[a,i]);return y.useLayoutEffect(()=>{o!=null&&(n.current===null?t(RVn(o)):n.current!==o&&t(PVn({prev:n.current,next:o})),n.current=o)},[o,t]),y.useLayoutEffect(()=>()=>{n.current&&(t(MVn(n.current)),n.current=null)},[t]),null}var BZn=e=>{var{xAxisId:t,className:n}=e,r=dr(Ggt),s=Yd(),a="xAxis",i=dr(b=>lbt(b,a,t,s)),o=dr(b=>Y9n(b,t)),c=dr(b=>n7n(b,t)),u=dr(b=>Tyt(b,t));if(o==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:p}=e,h=Gde(e,PZn),{id:m,scale:g}=u,v=Gde(u,MZn);return y.createElement(n0e,Wde({},h,v,{x:c.x,y:c.y,width:o.width,height:o.height,className:La("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:i,axisType:a,axisId:t}))},UZn={allowDataOverflow:Sl.allowDataOverflow,allowDecimals:Sl.allowDecimals,allowDuplicatedCategory:Sl.allowDuplicatedCategory,angle:Sl.angle,axisLine:Xy.axisLine,height:Sl.height,hide:!1,includeHidden:Sl.includeHidden,interval:Sl.interval,label:!1,minTickGap:Sl.minTickGap,mirror:Sl.mirror,orientation:Sl.orientation,padding:Sl.padding,reversed:Sl.reversed,scale:Sl.scale,tick:Sl.tick,tickCount:Sl.tickCount,tickLine:Xy.tickLine,tickSize:Xy.tickSize,type:Sl.type,niceTicks:Sl.niceTicks,xAxisId:0},qZn=e=>{var t=Qd(e,UZn);return y.createElement(y.Fragment,null,y.createElement(FZn,{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}),y.createElement(BZn,t))},xxt=y.memo(qZn,bxt);xxt.displayName="XAxis";var VZn=["type"],HZn=["dangerouslySetInnerHTML","ticks","scale"],ZZn=["id","scale"];function Qde(){return Qde=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qde.apply(null,arguments)}function jLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function NLe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jLe(Object(n),!0).forEach(function(r){WZn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WZn(e,t,n){return(t=GZn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GZn(e){var t=QZn(e,"string");return typeof t=="symbol"?t:t+""}function QZn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yde(e,t){if(e==null)return{};var n,r,s=YZn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function YZn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function XZn(e){var t=hl(),n=y.useRef(null),r=tvt(),{type:s}=e,a=Yde(e,VZn),i=MU(r,"yAxis",s),o=y.useMemo(()=>{if(i!=null)return NLe(NLe({},a),{},{type:i})},[i,a]);return y.useLayoutEffect(()=>{o!=null&&(n.current===null?t($Vn(o)):n.current!==o&&t(DVn({prev:n.current,next:o})),n.current=o)},[o,t]),y.useLayoutEffect(()=>()=>{n.current&&(t(LVn(n.current)),n.current=null)},[t]),null}function KZn(e){var{yAxisId:t,className:n,width:r,label:s}=e,a=y.useRef(null),i=y.useRef(null),o=dr(Ggt),c=Yd(),u=hl(),d="yAxis",f=dr(E=>a7n(E,t)),p=dr(E=>s7n(E,t)),h=dr(E=>lbt(E,d,t,c)),m=dr(E=>jyt(E,t));if(y.useLayoutEffect(()=>{if(!(r!=="auto"||!f||Jxe(s)||y.isValidElement(s)||m==null)){var E=a.current;if(E){var T=E.getCalculatedWidth();Math.round(f.width)!==Math.round(T)&&u(zVn({id:t,width:T}))}}},[h,f,u,s,t,r,m]),f==null||p==null||m==null)return null;var{dangerouslySetInnerHTML:g,ticks:v,scale:b}=e,S=Yde(e,HZn),{id:w,scale:_}=m,O=Yde(m,ZZn);return y.createElement(n0e,Qde({},S,O,{ref:a,labelRef:i,x:p.x,y:p.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:f.width,height:f.height,className:La("recharts-".concat(d," ").concat(d),n),viewBox:o,ticks:h,axisType:d,axisId:t}))}var JZn={allowDataOverflow:kl.allowDataOverflow,allowDecimals:kl.allowDecimals,allowDuplicatedCategory:kl.allowDuplicatedCategory,angle:kl.angle,axisLine:Xy.axisLine,hide:!1,includeHidden:kl.includeHidden,interval:kl.interval,label:!1,minTickGap:kl.minTickGap,mirror:kl.mirror,orientation:kl.orientation,padding:kl.padding,reversed:kl.reversed,scale:kl.scale,tick:kl.tick,tickCount:kl.tickCount,tickLine:Xy.tickLine,tickSize:Xy.tickSize,type:kl.type,niceTicks:kl.niceTicks,width:kl.width,yAxisId:0},eWn=e=>{var t=Qd(e,JZn);return y.createElement(y.Fragment,null,y.createElement(XZn,{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}),y.createElement(KZn,t))},wxt=y.memo(eWn,bxt);wxt.displayName="YAxis";var tWn=(e,t)=>t,s0e=et([tWn,ho,Fvt,nc,Cbt,zb,TBn,Pc],MBn);function nWn(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function a0e(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(nWn(e)){var s=e.currentTarget.getBBox();n=s.width>0?t.width/s.width:1,r=s.height>0?t.height/s.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var i=(o,c)=>({relativeX:Math.round((o-t.left)/n),relativeY:Math.round((c-t.top)/r)});return"touches"in e?Array.from(e.touches).map(o=>i(o.clientX,o.clientY)):i(e.clientX,e.clientY)}var Sxt=rp("mouseClick"),kxt=v$();kxt.startListening({actionCreator:Sxt,effect:(e,t)=>{var n=e.payload,r=s0e(t.getState(),a0e(n));r?.activeIndex!=null&&t.dispatch(x7n({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var Xde=rp("mouseMove"),_xt=v$(),wO=null,b1=null,LX=null;_xt.startListening({actionCreator:Xde,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:s,throttledEvents:a}=r.eventSettings,i=a==="all"||a?.includes("mousemove");wO!==null&&(cancelAnimationFrame(wO),wO=null),b1!==null&&(typeof s!="number"||!i)&&(clearTimeout(b1),b1=null),LX=a0e(n);var o=()=>{var c=t.getState(),u=N$(c,c.tooltip.settings.shared);if(!LX){wO=null,b1=null;return}if(u==="axis"){var d=s0e(c,LX);d?.activeIndex!=null?t.dispatch(vbt({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(gbt())}wO=null,b1=null};if(!i){o();return}s==="raf"?wO=requestAnimationFrame(o):typeof s=="number"&&b1===null&&(b1=setTimeout(o,s))}});function rWn(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 ALe={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},Oxt=Su({name:"rootProps",initialState:ALe,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:ALe.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}}}),sWn=Oxt.reducer,{updateOptions:aWn}=Oxt.actions,iWn=null,oWn={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)},Ext=Su({name:"polarOptions",initialState:iWn,reducers:oWn}),{updatePolarOptions:sos}=Ext.actions,lWn=Ext.reducer,Cxt=rp("keyDown"),Txt=rp("focus"),jxt=rp("blur"),QU=v$(),SO=null,x1=null,$L=null;QU.startListening({actionCreator:Cxt,effect:(e,t)=>{$L=e.payload,SO!==null&&(cancelAnimationFrame(SO),SO=null);var n=t.getState(),{throttleDelay:r,throttledEvents:s}=n.eventSettings,a=s==="all"||s.includes("keydown");x1!==null&&(typeof r!="number"||!a)&&(clearTimeout(x1),x1=null);var i=()=>{try{var o=t.getState(),c=o.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=o.tooltip,d=$L;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=iR(u,yk(o),tT(o),nT(o)),p=f==null?-1:Number(f),h=!Number.isFinite(p)||p<0,m=zb(o),g=yk(o),v=N$(o,o.tooltip.settings.shared);if(d==="Enter"){if(h)return;var b=O8(o,v,"hover",String(u.index));t.dispatch(_8({active:!u.active,activeIndex:u.index,activeCoordinate:b}));return}var S=u7n(o),w=S==="left-to-right"?1:-1,_=d==="ArrowRight"?1:-1,O;if(h){var E=tT(o),T=nT(o),j=_*w,N=M=>({active:!1,index:String(M),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(O=-1,j>0){for(var I=0;I<g.length;I++)if(iR(N(I),g,E,T)!=null){O=I;break}}else for(var R=g.length-1;R>=0;R--)if(iR(N(R),g,E,T)!=null){O=R;break}if(O<0)return}else{O=p+_*w;var P=m?.length||g.length;if(P===0||O>=P||O<0)return}var U=O8(o,v,"hover",String(O));t.dispatch(_8({active:!0,activeIndex:O.toString(),activeCoordinate:U}))}finally{SO=null,x1=null}};if(!a){i();return}r==="raf"?SO=requestAnimationFrame(i):typeof r=="number"&&x1===null&&(i(),$L=null,x1=setTimeout(()=>{$L?i():(x1=null,SO=null)},r))}});QU.startListening({actionCreator:Txt,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:s}=n.tooltip;if(!s.active&&s.index==null){var a="0",i=N$(n,n.tooltip.settings.shared),o=O8(n,i,"hover",String(a));t.dispatch(_8({active:!0,activeIndex:a,activeCoordinate:o}))}}}});QU.startListening({actionCreator:jxt,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:s}=n.tooltip;s.active&&t.dispatch(_8({active:!1,activeIndex:s.index,activeCoordinate:s.coordinate}))}}});function Nxt(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var s=Reflect.get(n,r);return typeof s=="function"?s.bind(n):s}})}var Bp=rp("externalEvent"),Axt=v$(),DL=new Map,NA=new Map,zX=new Map;Axt.startListening({actionCreator:Bp,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var s=r.type,a=Nxt(r);zX.set(s,{handler:n,reactEvent:a});var i=DL.get(s);i!==void 0&&(cancelAnimationFrame(i),DL.delete(s));var o=t.getState(),{throttleDelay:c,throttledEvents:u}=o.eventSettings,d=u,f=d==="all"||d?.includes(s),p=NA.get(s);p!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(p),NA.delete(s));var h=()=>{var v=zX.get(s);try{if(!v)return;var{handler:b,reactEvent:S}=v,w=t.getState(),_={activeCoordinate:fBn(w),activeDataKey:cBn(w),activeIndex:QP(w),activeLabel:Nbt(w),activeTooltipIndex:QP(w),isTooltipActive:pBn(w)};b&&b(_,S)}finally{DL.delete(s),NA.delete(s),zX.delete(s)}};if(!f){h();return}if(c==="raf"){var m=requestAnimationFrame(h);DL.set(s,m)}else if(typeof c=="number"){if(!NA.has(s)){h();var g=setTimeout(h,c);NA.set(s,g)}}else h()}}});var cWn=et([Nj],e=>e.tooltipItemPayloads),uWn=et([cWn,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:s}=r;if(s!=null)return s(t)}}}),Ixt=rp("touchMove"),Rxt=v$(),w1=null,Tx=null,ILe=null,AA=null;Rxt.startListening({actionCreator:Ixt,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){AA=Nxt(n);var r=t.getState(),{throttleDelay:s,throttledEvents:a}=r.eventSettings,i=a==="all"||a.includes("touchmove");w1!==null&&(cancelAnimationFrame(w1),w1=null),Tx!==null&&(typeof s!="number"||!i)&&(clearTimeout(Tx),Tx=null),ILe=Array.from(n.touches).map(c=>a0e({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var o=()=>{if(AA!=null){var c=t.getState(),u=N$(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=ILe)===null||d===void 0?void 0:d[0];if(f==null){w1=null,Tx=null;return}var p=s0e(c,f);p?.activeIndex!=null&&t.dispatch(vbt({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate}))}else if(u==="item"){var h,m=AA.touches[0];if(document.elementFromPoint==null||m==null)return;var g=document.elementFromPoint(m.clientX,m.clientY);if(!g||!g.getAttribute)return;var v=g.getAttribute(LLn),b=(h=g.getAttribute(zLn))!==null&&h!==void 0?h:void 0,S=c_(c).find(O=>O.id===b);if(v==null||S==null||b==null)return;var{dataKey:w}=S,_=uWn(c,v,b);t.dispatch(b7n({activeDataKey:w,activeIndex:v,activeCoordinate:_,activeGraphicalItemId:b}))}w1=null,Tx=null}};if(!i){o();return}s==="raf"?w1=requestAnimationFrame(o):typeof s=="number"&&Tx===null&&(o(),AA=null,Tx=setTimeout(()=>{AA?o():(Tx=null,w1=null)},s))}}});var Pxt={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Mxt=Su({name:"eventSettings",initialState:Pxt,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:dWn}=Mxt.actions,fWn=Mxt.reducer,pWn=oht({brush:YVn,cartesianAxis:FVn,chartData:fUn,errorBars:QHn,eventSettings:fWn,graphicalItems:vVn,layout:kLn,legend:A5n,options:oUn,polarAxis:Dqn,polarOptions:lWn,referenceElements:eHn,renderedTicks:vHn,rootProps:sWn,tooltip:w7n,zIndex:GBn}),hWn=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return G3n({reducer:pWn,preloadedState:t,middleware:r=>{var s;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([kxt.middleware,_xt.middleware,QU.middleware,Axt.middleware,Rxt.middleware])},enhancers:r=>{var s=r;return typeof r=="function"&&(s=r()),s.concat(Ngt({type:"raf"}))},devTools:{serialize:{replacer:rWn},name:"recharts-".concat(n)}})};function mWn(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,s=Yd(),a=y.useRef(null);if(s)return n;a.current==null&&(a.current=hWn(t,r));var i=Ube;return y.createElement(ght,{context:i,store:a.current},n)}function gWn(e){var{layout:t,margin:n}=e,r=hl(),s=Yd();return y.useEffect(()=>{s||(r(xLn(t)),r(bLn(n)))},[r,s,t,n]),null}var vWn=y.memo(gWn,IU);function yWn(e){var t=hl();return y.useEffect(()=>{t(aWn(e))},[t,e]),null}var bWn=e=>{var t=hl();return y.useEffect(()=>{t(dWn(e))},[t,e]),null},xWn=y.memo(bWn,IU);function RLe(e){var{zIndex:t,isPanorama:n}=e,r=y.useRef(null),s=hl();return y.useLayoutEffect(()=>(r.current&&s(ZBn({zIndex:t,element:r.current,isPanorama:n})),()=>{s(WBn({zIndex:t,isPanorama:n}))}),[s,t,n]),y.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function PLe(e){var{children:t,isPanorama:n}=e,r=dr(DBn);if(!r||r.length===0)return t;var s=r.filter(i=>i<0),a=r.filter(i=>i>0);return y.createElement(y.Fragment,null,s.map(i=>y.createElement(RLe,{key:i,zIndex:i,isPanorama:n})),t,a.map(i=>y.createElement(RLe,{key:i,zIndex:i,isPanorama:n})))}var wWn=["children"];function SWn(e,t){if(e==null)return{};var n,r,s=kWn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function kWn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function A8(){return A8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A8.apply(null,arguments)}var _Wn={width:"100%",height:"100%",display:"block"},OWn=y.forwardRef((e,t)=>{var n=Jgt(),r=evt(),s=dvt();if(!dv(n)||!dv(r))return null;var{children:a,otherAttributes:i,title:o,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),y.createElement($mt,A8({},i,{title:o,desc:c,role:d,tabIndex:u,width:n,height:r,style:_Wn,ref:t}),a)}),EWn=e=>{var{children:t}=e,n=dr(CU);if(!n)return null;var{width:r,height:s,y:a,x:i}=n;return y.createElement($mt,{width:r,height:s,x:i,y:a},t)},MLe=y.forwardRef((e,t)=>{var{children:n}=e,r=SWn(e,wWn),s=Yd();return s?y.createElement(EWn,null,y.createElement(PLe,{isPanorama:!0},n)):y.createElement(OWn,A8({ref:t},r),y.createElement(PLe,{isPanorama:!1},n))});function CWn(){var e=hl(),[t,n]=y.useState(null),r=dr(DLn);return y.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),a=s.width/t.offsetWidth;oa(a)&&a!==r&&e(SLn(a))}},[t,e,r]),n}function $Le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function TWn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$Le(Object(n),!0).forEach(function(r){jWn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$Le(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jWn(e,t,n){return(t=NWn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NWn(e){var t=AWn(e,"string");return typeof t=="symbol"?t:t+""}function AWn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function T0(){return T0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T0.apply(null,arguments)}var IWn=()=>(wUn(),null);function I8(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var RWn=y.forwardRef((e,t)=>{var n,r,s=y.useRef(null),[a,i]=y.useState({containerWidth:I8((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:I8((r=e.style)===null||r===void 0?void 0:r.height)}),o=y.useCallback((u,d)=>{i(f=>{var p=Math.round(u),h=Math.round(d);return f.containerWidth===p&&f.containerHeight===h?f:{containerWidth:p,containerHeight:h}})},[]),c=y.useCallback(u=>{if(typeof t=="function"&&t(u),s.current!=null&&(s.current.disconnect(),s.current=null),u!=null&&typeof ResizeObserver<"u"){var{width:d,height:f}=u.getBoundingClientRect();o(d,f);var p=m=>{var g=m[0];if(g!=null){var{width:v,height:b}=g.contentRect;o(v,b)}},h=new ResizeObserver(p);h.observe(u),s.current=h}},[t,o]);return y.useEffect(()=>()=>{var u=s.current;u?.disconnect()},[o]),y.createElement(y.Fragment,null,y.createElement(b$,{width:a.containerWidth,height:a.containerHeight}),y.createElement("div",T0({ref:c},e)))}),PWn=y.forwardRef((e,t)=>{var{width:n,height:r}=e,[s,a]=y.useState({containerWidth:I8(n),containerHeight:I8(r)}),i=y.useCallback((c,u)=>{a(d=>{var f=Math.round(c),p=Math.round(u);return d.containerWidth===f&&d.containerHeight===p?d:{containerWidth:f,containerHeight:p}})},[]),o=y.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:u,height:d}=c.getBoundingClientRect();i(u,d)}},[t,i]);return y.createElement(y.Fragment,null,y.createElement(b$,{width:s.containerWidth,height:s.containerHeight}),y.createElement("div",T0({ref:o},e)))}),MWn=y.forwardRef((e,t)=>{var{width:n,height:r}=e;return y.createElement(y.Fragment,null,y.createElement(b$,{width:n,height:r}),y.createElement("div",T0({ref:t},e)))}),$Wn=y.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?y.createElement(PWn,T0({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?y.createElement(MWn,T0({},e,{width:n,height:r,ref:t})):y.createElement(y.Fragment,null,y.createElement(b$,{width:n,height:r}),y.createElement("div",T0({ref:t},e)))});function DWn(e){return e?RWn:$Wn}var LWn=y.forwardRef((e,t)=>{var{children:n,className:r,height:s,onClick:a,onContextMenu:i,onDoubleClick:o,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:f,onMouseUp:p,onTouchEnd:h,onTouchMove:m,onTouchStart:g,style:v,width:b,responsive:S,dispatchTouchEvents:w=!0}=e,_=y.useRef(null),O=hl(),[E,T]=y.useState(null),[j,N]=y.useState(null),I=CWn(),R=Gbe(),P=R?.width>0?R.width:b,U=R?.height>0?R.height:s,M=y.useCallback(se=>{I(se),typeof t=="function"&&t(se),T(se),N(se),se!=null&&(_.current=se)},[I,t,T,N]),L=y.useCallback(se=>{O(Sxt(se)),O(Bp({handler:a,reactEvent:se}))},[O,a]),F=y.useCallback(se=>{O(Xde(se)),O(Bp({handler:u,reactEvent:se}))},[O,u]),z=y.useCallback(se=>{O(gbt()),O(Bp({handler:d,reactEvent:se}))},[O,d]),q=y.useCallback(se=>{O(Xde(se)),O(Bp({handler:f,reactEvent:se}))},[O,f]),H=y.useCallback(()=>{O(Txt())},[O]),D=y.useCallback(()=>{O(jxt())},[O]),Y=y.useCallback(se=>{O(Cxt(se.key))},[O]),V=y.useCallback(se=>{O(Bp({handler:i,reactEvent:se}))},[O,i]),$=y.useCallback(se=>{O(Bp({handler:o,reactEvent:se}))},[O,o]),W=y.useCallback(se=>{O(Bp({handler:c,reactEvent:se}))},[O,c]),G=y.useCallback(se=>{O(Bp({handler:p,reactEvent:se}))},[O,p]),K=y.useCallback(se=>{O(Bp({handler:g,reactEvent:se}))},[O,g]),re=y.useCallback(se=>{w&&O(Ixt(se)),O(Bp({handler:m,reactEvent:se}))},[O,w,m]),J=y.useCallback(se=>{O(Bp({handler:h,reactEvent:se}))},[O,h]),ee=DWn(S);return y.createElement(Dbt.Provider,{value:E},y.createElement(VDn.Provider,{value:j},y.createElement(ee,{width:P??v?.width,height:U??v?.height,className:La("recharts-wrapper",r),style:TWn({position:"relative",cursor:"default",width:P,height:U},v),onClick:L,onContextMenu:V,onDoubleClick:$,onFocus:H,onBlur:D,onKeyDown:Y,onMouseDown:W,onMouseEnter:F,onMouseLeave:z,onMouseMove:q,onMouseUp:G,onTouchEnd:J,onTouchMove:re,onTouchStart:K,ref:M},y.createElement(IWn,null),n)))}),zWn=["width","height","responsive","children","className","style","compact","title","desc"];function FWn(e,t){if(e==null)return{};var n,r,s=BWn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function BWn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var UWn=y.forwardRef((e,t)=>{var{width:n,height:r,responsive:s,children:a,className:i,style:o,compact:c,title:u,desc:d}=e,f=FWn(e,zWn),p=cv(f);return c?y.createElement(y.Fragment,null,y.createElement(b$,{width:n,height:r}),y.createElement(MLe,{otherAttributes:p,title:u,desc:d},a)):y.createElement(LWn,{className:i,style:o,width:n,height:r,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},y.createElement(MLe,{otherAttributes:p,title:u,desc:d,ref:t},y.createElement(nHn,null,a)))});function Kde(){return Kde=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kde.apply(null,arguments)}function DLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function qWn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DLe(Object(n),!0).forEach(function(r){VWn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VWn(e,t,n){return(t=HWn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HWn(e){var t=ZWn(e,"string");return typeof t=="symbol"?t:t+""}function ZWn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WWn={top:5,right:5,bottom:5,left:5},GWn=qWn({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:WWn,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},Pxt),QWn=y.forwardRef(function(t,n){var r,s=Qd(t.categoricalChartProps,GWn),{chartName:a,defaultTooltipEventType:i,validateTooltipEventTypes:o,tooltipPayloadSearcher:c,categoricalChartProps:u}=t,d={chartName:a,defaultTooltipEventType:i,validateTooltipEventTypes:o,tooltipPayloadSearcher:c,eventEmitter:void 0};return y.createElement(mWn,{preloadedState:{options:d},reduxStoreName:(r=u.id)!==null&&r!==void 0?r:a},y.createElement(QVn,{chartData:u.data}),y.createElement(vWn,{layout:s.layout,margin:s.margin}),y.createElement(xWn,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),y.createElement(yWn,{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}),y.createElement(UWn,Kde({},s,{ref:n})))}),YWn=["axis"],XWn=y.forwardRef((e,t)=>y.createElement(QWn,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:YWn,tooltipPayloadSearcher:aUn,categoricalChartProps:e,ref:t}));function KWn(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function JWn(e,t){const n=getComputedStyle(e.ownerDocument.body),r=parseFloat(n.fontSize);return t*r}function eGn(e){return e/100*window.innerHeight}function tGn(e){return e/100*window.innerWidth}function nGn(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 wI({groupSize:e,panelElement:t,styleProp:n}){let r;const[s,a]=nGn(n);switch(a){case"%":{r=s/100*e;break}case"px":{r=s;break}case"rem":{r=JWn(t,s);break}case"em":{r=KWn(t,s);break}case"vh":{r=eGn(s);break}case"vw":{r=tGn(s);break}}return r}function Gu(e){return parseFloat(e.toFixed(3))}function rT({group:e}){const{orientation:t,panels:n}=e;return n.reduce((r,s)=>(r+=t==="horizontal"?s.element.offsetWidth:s.element.offsetHeight,r),0)}function Jde(e){const{panels:t}=e,n=rT({group:e});return n===0?t.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):t.map(r=>{const{element:s,panelConstraints:a}=r;let i=0;if(a.collapsedSize!==void 0){const d=wI({groupSize:n,panelElement:s,styleProp:a.collapsedSize});i=Gu(d/n*100)}let o;if(a.defaultSize!==void 0){const d=wI({groupSize:n,panelElement:s,styleProp:a.defaultSize});o=Gu(d/n*100)}let c=0;if(a.minSize!==void 0){const d=wI({groupSize:n,panelElement:s,styleProp:a.minSize});c=Gu(d/n*100)}let u=100;if(a.maxSize!==void 0){const d=wI({groupSize:n,panelElement:s,styleProp:a.maxSize});u=Gu(d/n*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:i,collapsible:a.collapsible===!0,defaultSize:o,disabled:a.disabled,minSize:c,maxSize:u,panelId:r.id}})}function Ga(e,t="Assertion error"){if(!e)throw Error(t)}function efe(e,t){return Array.from(t).sort(e==="horizontal"?rGn:sGn)}function rGn(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function sGn(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function $xt(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Dxt(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 aGn({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let s,a=Number.MAX_VALUE;for(const i of t){const{x:o,y:c}=Dxt(r,i),u=e==="horizontal"?o:c;u<a&&(a=u,s=i)}return Ga(s,"No rect found"),s}let LL;function iGn(){return LL===void 0&&(typeof matchMedia=="function"?LL=!!matchMedia("(pointer:coarse)").matches:LL=!1),LL}function Lxt(e){const{element:t,orientation:n,panels:r,separators:s}=e,a=efe(n,Array.from(t.children).filter($xt).map(m=>({element:m}))).map(({element:m})=>m),i=[];let o=!1,c=!1,u=-1,d=-1,f=0,p,h=[];{let m=-1;for(const g of a)g.hasAttribute("data-panel")&&(m++,g.hasAttribute("data-disabled")||(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 v=r.find(b=>b.element===g);if(v){if(p){const b=p.element.getBoundingClientRect(),S=g.getBoundingClientRect();let w;if(c){const _=n==="horizontal"?new DOMRect(b.right,b.top,0,b.height):new DOMRect(b.left,b.bottom,b.width,0),O=n==="horizontal"?new DOMRect(S.left,S.top,0,S.height):new DOMRect(S.left,S.top,S.width,0);switch(h.length){case 0:{w=[_,O];break}case 1:{const E=h[0],T=aGn({orientation:n,rects:[b,S],targetRect:E.element.getBoundingClientRect()});w=[E,T===b?O:_];break}default:{w=h;break}}}else h.length?w=h:w=[n==="horizontal"?new DOMRect(b.right,S.top,S.left-b.right,S.height):new DOMRect(S.left,b.bottom,S.width,S.top-b.bottom)];for(const _ of w){let O="width"in _?_:_.element.getBoundingClientRect();const E=iGn()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(O.width<E){const j=E-O.width;O=new DOMRect(O.x-j/2,O.y,O.width+j,O.height)}if(O.height<E){const j=E-O.height;O=new DOMRect(O.x,O.y-j/2,O.width,O.height+j)}const T=m<=u||m>d;!o&&!T&&i.push({group:e,groupSize:rT({group:e}),panels:[p,v],separator:"width"in _?void 0:_,rect:O}),o=!1}}c=!1,p=v,h=[]}}else if(g.hasAttribute("data-separator")){g.ariaDisabled!==null&&(o=!0);const v=s.find(b=>b.element===g);v?h.push(v):(p=void 0,h=[])}else c=!0}return i}let zxt=class{#e={};addListener(t,n){const r=this.#e[t];return r===void 0?this.#e[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=this.#e[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let s=!1,a=null;const i=Array.from(r);for(let o=0;o<i.length;o++){const c=i[o];try{c.call(null,n)}catch(u){a===null&&(s=!0,a=u)}}if(s)throw a}}removeAllListeners(){this.#e={}}removeListener(t,n){const r=this.#e[t];if(r!==void 0){const s=r.indexOf(n);s>=0&&r.splice(s,1)}}},qg=new Map;const Fxt=new zxt;function oGn(e){qg=new Map(qg),qg.delete(e)}function LLe(e,t){for(const[n]of qg)if(n.id===e)return n}function j0(e,t){for(const[n,r]of qg)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function u_(){return qg}function i0e(e,t){return Fxt.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function mb(e,t){const n=qg.get(e);qg=new Map(qg),qg.set(e,t),Fxt.emit("groupChange",{group:e,prev:n,next:t})}function lGn(e,t,n){let r,s={x:1/0,y:1/0};for(const a of t){const i=Dxt(n,a.rect);switch(e){case"horizontal":{i.x<=s.x&&(r=a,s=i);break}case"vertical":{i.y<=s.y&&(r=a,s=i);break}}}return r?{distance:s,hitRegion:r}:void 0}function cGn(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function uGn(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:BLe(e),b:BLe(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Ga(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:FLe(zLe(n.a)),b:FLe(zLe(n.b))};if(s.a===s.b){const a=r.childNodes,i={a:n.a.at(-1),b:n.b.at(-1)};let o=a.length;for(;o--;){const c=a[o];if(c===i.a)return 1;if(c===i.b)return-1}}return Math.sign(s.a-s.b)}const dGn=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function fGn(e){const t=getComputedStyle(Bxt(e)??e).display;return t==="flex"||t==="inline-flex"}function pGn(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||fGn(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"||dGn.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function zLe(e){let t=e.length;for(;t--;){const n=e[t];if(Ga(n,"Missing node"),pGn(n))return n}return null}function FLe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function BLe(e){const t=[];for(;e;)t.push(e),e=Bxt(e);return t}function Bxt(e){const{parentNode:t}=e;return cGn(t)?t.host:t}function hGn(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 mGn({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!$xt(n)||n.contains(e)||e.contains(n))return!0;if(uGn(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(hGn(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function o0e(e,t){const n=[];return t.forEach((r,s)=>{if(s.disabled)return;const a=Lxt(s),i=lGn(s.orientation,a,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&mGn({groupElement:s.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&n.push(i.hitRegion)}),n}function gGn(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Gc(e,t,n=0){return Math.abs(Gu(e)-Gu(t))<=n}function xg(e,t){return Gc(e,t)?0:e>t?1:-1}function bE({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:s=0,collapsible:a,disabled:i,maxSize:o=100,minSize:c=0}=t;if(i&&!e)return n;if(xg(r,c)<0)if(a){const u=(s+c)/2;xg(r,u)<0?r=s:r=c}else r=c;return r=Math.min(o,r),r=Gu(r),r}function JP({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:a}){if(Gc(e,0))return t;const i=a==="imperative-api",o=Object.values(t),c=Object.values(s),u=[...o],[d,f]=r;Ga(d!=null,"Invalid first pivot index"),Ga(f!=null,"Invalid second pivot index");let p=0;switch(a){case"keyboard":{{const g=e<0?f:d,v=n[g];Ga(v,`Panel constraints not found for index ${g}`);const{collapsedSize:b=0,collapsible:S,minSize:w=0}=v;if(S){const _=o[g];if(Ga(_!=null,`Previous layout not found for panel index ${g}`),Gc(_,b)){const O=w-_;xg(O,Math.abs(e))>0&&(e=e<0?0-O:O)}}}{const g=e<0?d:f,v=n[g];Ga(v,`No panel constraints found for index ${g}`);const{collapsedSize:b=0,collapsible:S,minSize:w=0}=v;if(S){const _=o[g];if(Ga(_!=null,`Previous layout not found for panel index ${g}`),Gc(_,w)){const O=_-b;xg(O,Math.abs(e))>0&&(e=e<0?0-O:O)}}}break}default:{const g=e<0?f:d,v=n[g];Ga(v,`Panel constraints not found for index ${g}`);const b=o[g],{collapsible:S,collapsedSize:w,minSize:_}=v;if(S&&xg(b,_)<0)if(e>0){const O=_-w,E=O/2,T=b+e;xg(T,_)<0&&(e=xg(e,E)<=0?0:O)}else{const O=_-w,E=100-O/2,T=b-e;xg(T,_)<0&&(e=xg(100+e,E)>0?0:-O)}break}}{const g=e<0?1:-1;let v=e<0?f:d,b=0;for(;;){const w=o[v];Ga(w!=null,`Previous layout not found for panel index ${v}`);const _=bE({overrideDisabledPanels:i,panelConstraints:n[v],prevSize:w,size:100})-w;if(b+=_,v+=g,v<0||v>=n.length)break}const S=Math.min(Math.abs(e),Math.abs(b));e=e<0?0-S:S}{let g=e<0?d:f;for(;g>=0&&g<n.length;){const v=Math.abs(e)-Math.abs(p),b=o[g];Ga(b!=null,`Previous layout not found for panel index ${g}`);const S=b-v,w=bE({overrideDisabledPanels:i,panelConstraints:n[g],prevSize:b,size:S});if(!Gc(b,w)&&(p+=b-w,u[g]=w,p.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?g--:g++}}if(gGn(c,u))return s;{const g=e<0?f:d,v=o[g];Ga(v!=null,`Previous layout not found for panel index ${g}`);const b=v+p,S=bE({overrideDisabledPanels:i,panelConstraints:n[g],prevSize:v,size:b});if(u[g]=S,!Gc(S,b)){let w=b-S,_=e<0?f:d;for(;_>=0&&_<n.length;){const O=u[_];Ga(O!=null,`Previous layout not found for panel index ${_}`);const E=O+w,T=bE({overrideDisabledPanels:i,panelConstraints:n[_],prevSize:O,size:E});if(Gc(O,T)||(w-=T-O,u[_]=T),Gc(w,0))break;e>0?_--:_++}}}const h=Object.values(u).reduce((g,v)=>v+g,0);if(!Gc(h,100,.1))return s;const m=Object.keys(s);return u.reduce((g,v,b)=>(g[m[b]]=v,g),{})}function xk(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||xg(e[n],t[n])!==0)return!1;return!0}function wk({layout:e,panelConstraints:t}){const n=Object.values(e),r=[...n],s=r.reduce((o,c)=>o+c,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(o=>`${o}%`).join(", ")}`);if(!Gc(s,100)&&r.length>0)for(let o=0;o<t.length;o++){const c=r[o];Ga(c!=null,`No layout data found for index ${o}`);const u=100/s*c;r[o]=u}let a=0;for(let o=0;o<t.length;o++){const c=n[o];Ga(c!=null,`No layout data found for index ${o}`);const u=r[o];Ga(u!=null,`No layout data found for index ${o}`);const d=bE({overrideDisabledPanels:!0,panelConstraints:t[o],prevSize:c,size:u});u!=d&&(a+=u-d,r[o]=d)}if(!Gc(a,0))for(let o=0;o<t.length;o++){const c=r[o];Ga(c!=null,`No layout data found for index ${o}`);const u=c+a,d=bE({overrideDisabledPanels:!0,panelConstraints:t[o],prevSize:c,size:u});if(c!==d&&(a-=d-c,r[o]=d,Gc(a,0)))break}const i=Object.keys(e);return r.reduce((o,c,u)=>(o[i[u]]=c,o),{})}function Uxt({groupId:e,panelId:t}){const n=()=>{const c=u_();for(const[u,{defaultLayoutDeferred:d,derivedPanelConstraints:f,layout:p,groupSize:h,separatorToPanels:m}]of c)if(u.id===e)return{defaultLayoutDeferred:d,derivedPanelConstraints:f,group:u,groupSize:h,layout:p,separatorToPanels:m};throw Error(`Group ${e} not found`)},r=()=>{const c=n().derivedPanelConstraints.find(u=>u.panelId===t);if(c!==void 0)return c;throw Error(`Panel constraints not found for Panel ${t}`)},s=()=>{const c=n().group.panels.find(u=>u.id===t);if(c!==void 0)return c;throw Error(`Layout not found for Panel ${t}`)},a=()=>{const c=n().layout[t];if(c!==void 0)return c;throw Error(`Layout not found for Panel ${t}`)},i=({nextSize:c,panels:u,prevLayout:d,derivedPanelConstraints:f})=>{const p=a(),h=u.findIndex(v=>v.id===t),m=h===0,g=h===u.length-1;if(g&&c<p&&(m||u.slice(0,h).every((v,b)=>{const S=f[b];return S?.collapsible&&Gc(S.collapsedSize,d[S.panelId])}))){const v=u.slice(0,h).reduce((b,S)=>b+d[S.id],0);return{...d,[t]:Gu(100-v)}}return JP({delta:g?p-c:c-p,initialLayout:d,panelConstraints:f,pivotIndices:g?[h-1,h]:[h,h+1],prevLayout:d,trigger:"imperative-api"})},o=c=>{const u=a();if(c===u)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:f,group:p,groupSize:h,layout:m,separatorToPanels:g}=n(),v=i({nextSize:c,panels:p.panels,prevLayout:m,derivedPanelConstraints:f}),b=wk({layout:v,panelConstraints:f});xk(m,b)||mb(p,{defaultLayoutDeferred:d,derivedPanelConstraints:f,groupSize:h,layout:b,separatorToPanels:g})};return{collapse:()=>{const{collapsible:c,collapsedSize:u}=r(),{mutableValues:d}=s(),f=a();c&&f!==u&&(d.expandToSize=f,o(u))},expand:()=>{const{collapsible:c,collapsedSize:u,minSize:d}=r(),{mutableValues:f}=s(),p=a();if(c&&p===u){let h=f.expandToSize??d;h===0&&(h=1),o(h)}},getSize:()=>{const{group:c}=n(),u=a(),{element:d}=s(),f=c.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:u,inPixels:f}},isCollapsed:()=>{const{collapsible:c,collapsedSize:u}=r(),d=a();return c&&Gc(u,d)},resize:c=>{const{group:u}=n(),{element:d}=s(),f=rT({group:u}),p=wI({groupSize:f,panelElement:d,styleProp:c}),h=Gu(p/f*100);o(h)}}}function ULe(e){if(e.defaultPrevented)return;const t=u_();o0e(e,t).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const r=n.panels.find(s=>s.panelConstraints.defaultSize!==void 0);if(r){const s=r.panelConstraints.defaultSize,a=Uxt({groupId:n.group.id,panelId:r.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function A6(e){const t=u_();for(const[n]of t)if(n.separators.some(r=>r.element===e))return n;throw Error("Could not find parent Group for separator element")}function qxt({groupId:e}){const t=()=>{const n=u_();for(const[r,s]of n)if(r.id===e)return{group:r,...s};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=t();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:s,group:a,groupSize:i,layout:o,separatorToPanels:c}=t(),u=wk({layout:n,panelConstraints:s});return r?o:(xk(o,u)||mb(a,{defaultLayoutDeferred:r,derivedPanelConstraints:s,groupSize:i,layout:u,separatorToPanels:c}),u)}}}function S1(e,t){const n=A6(e),r=j0(n.id,!0),s=n.separators.find(d=>d.element===e);Ga(s,"Matching separator not found");const a=r.separatorToPanels.get(s);Ga(a,"Matching panels not found");const i=a.map(d=>n.panels.indexOf(d)),o=qxt({groupId:n.id}).getLayout(),c=JP({delta:t,initialLayout:o,panelConstraints:r.derivedPanelConstraints,pivotIndices:i,prevLayout:o,trigger:"keyboard"}),u=wk({layout:c,panelConstraints:r.derivedPanelConstraints});xk(o,u)||mb(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:u,separatorToPanels:r.separatorToPanels})}function qLe(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=A6(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&S1(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&S1(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&S1(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&S1(t,-5);break}case"End":{e.preventDefault(),S1(t,100);break}case"Enter":{e.preventDefault();const r=A6(t),s=j0(r.id,!0),{derivedPanelConstraints:a,layout:i,separatorToPanels:o}=s,c=r.separators.find(p=>p.element===t);Ga(c,"Matching separator not found");const u=o.get(c);Ga(u,"Matching panels not found");const d=u[0],f=a.find(p=>p.panelId===d.id);if(Ga(f,"Panel metadata not found"),f.collapsible){const p=i[d.id],h=f.collapsedSize===p?r.mutableState.expandedPanelSizes[d.id]??f.minSize:f.collapsedSize;S1(t,h-p)}break}case"F6":{e.preventDefault();const r=A6(t).separators.map(i=>i.element),s=Array.from(r).findIndex(i=>i===e.currentTarget);Ga(s!==null,"Index not found");const a=e.shiftKey?s>0?s-1:r.length-1:s+1<r.length?s+1:0;r[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),S1(t,-100);break}}}let tC={cursorFlags:0,state:"inactive"};const l0e=new zxt;function Sk(){return tC}function vGn(e){return l0e.addListener("change",e)}function yGn(e){const t=tC,n={...tC};n.cursorFlags=e,tC=n,l0e.emit("change",{prev:t,next:n})}function nC(e){const t=tC;tC=e,l0e.emit("change",{prev:t,next:e})}function VLe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=u_(),n=o0e(e,t),r=new Map;let s=!1;n.forEach(a=>{a.separator&&(s||(s=!0,a.separator.element.focus({focusVisible:!1,preventScroll:!0})));const i=t.get(a.group);i&&r.set(a.group,i.layout)}),nC({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const bGn=e=>e,FX=()=>{},Vxt=1,Hxt=2,Zxt=4,Wxt=8,HLe=3,ZLe=12;let zL;function WLe(){return zL===void 0&&(zL=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(zL=!0)),zL}function xGn({cursorFlags:e,groups:t,state:n}){let r=0,s=0;switch(n){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{r++;break}case"vertical":{s++;break}}})}if(!(r===0&&s===0)){switch(n){case"active":{if(e&&WLe()){const a=(e&Vxt)!==0,i=(e&Hxt)!==0,o=(e&Zxt)!==0,c=(e&Wxt)!==0;if(a)return o?"se-resize":c?"ne-resize":"e-resize";if(i)return o?"sw-resize":c?"nw-resize":"w-resize";if(o)return"s-resize";if(c)return"n-resize"}break}}return WLe()?r>0&&s>0?"move":r>0?"ew-resize":"ns-resize":r>0&&s>0?"grab":r>0?"col-resize":"row-resize"}}const GLe=new WeakMap;function c0e(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=GLe.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));const r=Sk();switch(r.state){case"active":case"hover":{const s=xGn({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(i=>i.group),state:r.state}),a=`*, *:hover {cursor: ${s} !important; }`;if(t===a)return;t=a,s?n.cssRules.length===0?n.insertRule(a):n.replaceSync(a):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}GLe.set(e,{prevStyle:t,styleSheet:n})}function Gxt({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:s,pointerDownAtPoint:a,prevCursorFlags:i}){let o=0;n.forEach(u=>{const{group:d,groupSize:f}=u,{orientation:p,panels:h}=d,{disableCursor:m}=d.mutableState;let g=0;a?p==="horizontal"?g=(t.clientX-a.x)/f*100:g=(t.clientY-a.y)/f*100:p==="horizontal"?g=t.clientX<0?-100:100:g=t.clientY<0?-100:100;const v=r.get(d),b=s.get(d);if(!v||!b)return;const{defaultLayoutDeferred:S,derivedPanelConstraints:w,groupSize:_,layout:O,separatorToPanels:E}=b;if(w&&O&&E){const T=JP({delta:g,initialLayout:v,panelConstraints:w,pivotIndices:u.panels.map(j=>h.indexOf(j)),prevLayout:O,trigger:"mouse-or-touch"});if(xk(T,O)){if(g!==0&&!m)switch(p){case"horizontal":{o|=g<0?Vxt:Hxt;break}case"vertical":{o|=g<0?Zxt:Wxt;break}}}else mb(u.group,{defaultLayoutDeferred:S,derivedPanelConstraints:w,groupSize:_,layout:T,separatorToPanels:E})}});let c=0;t.movementX===0?c|=i&HLe:c|=o&HLe,t.movementY===0?c|=i&ZLe:c|=o&ZLe,yGn(c),c0e(e)}function QLe(e){const t=u_(),n=Sk();n.state==="active"&&Gxt({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function YLe(e){if(e.defaultPrevented)return;const t=Sk(),n=u_();switch(t.state){case"active":{if(e.buttons===0){nC({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(r=>{const s=j0(r.group.id,!0);mb(r.group,s)});return}for(const r of t.hitRegions)if(r.separator){const{element:s}=r.separator;s.hasPointerCapture?.(e.pointerId)||s.setPointerCapture?.(e.pointerId)}Gxt({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const r=o0e(e,n);r.length===0?t.state!=="inactive"&&nC({cursorFlags:0,state:"inactive"}):nC({cursorFlags:0,hitRegions:r,state:"hover"}),c0e(e.currentTarget);break}}}function XLe(e){e.relatedTarget instanceof HTMLIFrameElement&&Sk().state==="hover"&&nC({cursorFlags:0,state:"inactive"})}function KLe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Sk();t.state==="active"&&(nC({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(c0e(e.currentTarget),t.hitRegions.forEach(n=>{const r=j0(n.group.id,!0);mb(n.group,r)}),e.preventDefault()))}function JLe(e){let t=0,n=0;const r={};for(const a of e)if(a.defaultSize!==void 0){t++;const i=Gu(a.defaultSize);n+=i,r[a.panelId]=i}else r[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=Gu((100-n)/s);for(const i of e)i.defaultSize===void 0&&(r[i.panelId]=a)}return r}function wGn(e,t,n){if(!n[0])return;const r=e.panels.find(c=>c.element===t);if(!r||!r.onResize)return;const s=rT({group:e}),a=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,i=r.mutableValues.prevSize,o={asPercentage:Gu(a/s*100),inPixels:a};r.mutableValues.prevSize=o,r.onResize(o,r.id,i)}function SGn(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function kGn({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let s=0,a=0,i=!1;const o=new Map,c=[];for(const f of e.panels){const p=r[f.id]??0;if(f.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){i=!0;const h=p/100*n,m=Gu(h/t*100);o.set(f.id,m),s+=m}else c.push(f.id),a+=p}if(!i||c.length===0)return r;const u=100-s,d={...r};if(o.forEach((f,p)=>{d[p]=f}),a>0)for(const f of c){const p=r[f]??0;d[f]=Gu(p/a*u)}else{const f=Gu(u/c.length);for(const p of c)d[p]=f}return d}function _Gn(e,t){const n=e.map(s=>s.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n)if(!r.includes(s))return!1;return!0}const kO=new Map;function OGn(e){let t=!0;Ga(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,s=new Set,a=new n(m=>{for(const g of m){const{borderBoxSize:v,target:b}=g;if(b===e.element){if(t){const S=rT({group:e});if(S===0)return;const w=j0(e.id);if(!w)return;const _=Jde(e),O=w.defaultLayoutDeferred?JLe(_):w.layout,E=kGn({group:e,nextGroupSize:S,prevGroupSize:w.groupSize,prevLayout:O}),T=wk({layout:E,panelConstraints:_});if(!w.defaultLayoutDeferred&&xk(w.layout,T)&&SGn(w.derivedPanelConstraints,_)&&w.groupSize===S)return;mb(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:_,groupSize:S,layout:T,separatorToPanels:w.separatorToPanels})}}else wGn(e,b,v)}});a.observe(e.element),e.panels.forEach(m=>{Ga(!r.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),r.add(m.id),m.onResize&&a.observe(m.element)});const i=rT({group:e}),o=Jde(e),c=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(_Gn(e.panels,u)||(u=void 0));const d=e.mutableState.layouts[c]??u??JLe(o),f=wk({layout:d,panelConstraints:o}),p=e.element.ownerDocument;kO.set(p,(kO.get(p)??0)+1);const h=new Map;return Lxt(e).forEach(m=>{m.separator&&h.set(m.separator,m.panels)}),mb(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:o,groupSize:i,layout:f,separatorToPanels:h}),e.separators.forEach(m=>{Ga(!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",qLe)}),kO.get(p)===1&&(p.addEventListener("dblclick",ULe,!0),p.addEventListener("pointerdown",VLe,!0),p.addEventListener("pointerleave",QLe),p.addEventListener("pointermove",YLe),p.addEventListener("pointerout",XLe),p.addEventListener("pointerup",KLe,!0)),function(){t=!1,kO.set(p,Math.max(0,(kO.get(p)??0)-1)),oGn(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",qLe)}),kO.get(p)||(p.removeEventListener("dblclick",ULe,!0),p.removeEventListener("pointerdown",VLe,!0),p.removeEventListener("pointerleave",QLe),p.removeEventListener("pointermove",YLe),p.removeEventListener("pointerout",XLe),p.removeEventListener("pointerup",KLe,!0)),a.disconnect()}}function EGn(){const[e,t]=y.useState({}),n=y.useCallback(()=>t({}),[]);return[e,n]}function u0e(e){const t=y.useId();return`${e??t}`}const d_=typeof window<"u"?y.useLayoutEffect:y.useEffect;function lR(e){const t=y.useRef(e);return d_(()=>{t.current=e},[e]),y.useCallback((...n)=>t.current?.(...n),[t])}function d0e(...e){return lR(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function f0e(e){const t=y.useRef({...e});return d_(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const Qxt=y.createContext(null);function CGn(e,t){const n=y.useRef({getLayout:()=>({}),setLayout:bGn});y.useImperativeHandle(t,()=>n.current,[]),d_(()=>{Object.assign(n.current,qxt({groupId:e}))})}function YU({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:s,elementRef:a,groupRef:i,id:o,onLayoutChange:c,onLayoutChanged:u,orientation:d="horizontal",resizeTargetMinimumSize:f={coarse:20,fine:10},style:p,...h}){const m=y.useRef({onLayoutChange:{},onLayoutChanged:{}}),g=lR(R=>{xk(m.current.onLayoutChange,R)||(m.current.onLayoutChange=R,c?.(R))}),v=lR(R=>{xk(m.current.onLayoutChanged,R)||(m.current.onLayoutChanged=R,u?.(R))}),b=u0e(o),S=y.useRef(null),[w,_]=EGn(),O=y.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:f,separators:[]}),E=d0e(S,a);CGn(b,i);const T=lR((R,P)=>{const U=Sk(),M=LLe(R),L=j0(R);if(L){let F=!1;return U.state==="active"&&(F=U.hitRegions.some(z=>z.group===M)),{flexGrow:L.layout[P]??1,pointerEvents:F?"none":void 0}}if(n?.[P])return{flexGrow:n?.[P]}}),j=f0e({defaultLayout:n,disableCursor:r}),N=y.useMemo(()=>({get disableCursor(){return!!j.disableCursor},getPanelStyles:T,id:b,orientation:d,registerPanel:R=>{const P=O.current;return P.panels=efe(d,[...P.panels,R]),_(),()=>{P.panels=P.panels.filter(U=>U!==R),_()}},registerSeparator:R=>{const P=O.current;return P.separators=efe(d,[...P.separators,R]),_(),()=>{P.separators=P.separators.filter(U=>U!==R),_()}},updatePanelProps:(R,{disabled:P})=>{const U=O.current.panels.find(F=>F.id===R);U&&(U.panelConstraints.disabled=P);const M=LLe(b),L=j0(b);M&&L&&mb(M,{...L,derivedPanelConstraints:Jde(M)})},updateSeparatorProps:(R,{disabled:P,disableDoubleClick:U})=>{const M=O.current.separators.find(L=>L.id===R);M&&(M.disabled=P,M.disableDoubleClick=U)}}),[T,b,_,d,j]),I=y.useRef(null);return d_(()=>{const R=S.current;if(R===null)return;const P=O.current;let U;if(j.defaultLayout!==void 0&&Object.keys(j.defaultLayout).length===P.panels.length){U={};for(const D of P.panels){const Y=j.defaultLayout[D.id];Y!==void 0&&(U[D.id]=Y)}}const M={disabled:!!s,element:R,id:b,mutableState:{defaultLayout:U,disableCursor:!!j.disableCursor,expandedPanelSizes:O.current.lastExpandedPanelSizes,layouts:O.current.layouts},orientation:d,panels:P.panels,resizeTargetMinimumSize:P.resizeTargetMinimumSize,separators:P.separators};I.current=M;const L=OGn(M),{defaultLayoutDeferred:F,derivedPanelConstraints:z,layout:q}=j0(M.id,!0);!F&&z.length>0&&(g(q),v(q));const H=i0e(b,D=>{const{defaultLayoutDeferred:Y,derivedPanelConstraints:V,layout:$}=D.next;if(Y||V.length===0)return;const W=M.panels.map(({id:K})=>K).join(",");M.mutableState.layouts[W]=$,V.forEach(K=>{if(K.collapsible){const{layout:re}=D.prev??{};if(re){const J=Gc(K.collapsedSize,$[K.panelId]),ee=Gc(K.collapsedSize,re[K.panelId]);J&&!ee&&(M.mutableState.expandedPanelSizes[K.panelId]=re[K.panelId])}}});const G=Sk().state!=="active";g($),G&&v($)});return()=>{I.current=null,L(),H()}},[s,b,v,g,d,w,j]),y.useEffect(()=>{const R=I.current;R&&(R.mutableState.defaultLayout=n,R.mutableState.disableCursor=!!r)}),l.jsx(Qxt.Provider,{value:N,children:l.jsx("div",{...h,className:t,"data-group":!0,"data-testid":b,id:b,ref:E,style:{height:"100%",width:"100%",overflow:"hidden",...p,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:d==="horizontal"?"pan-y":"pan-x"},children:e})})}YU.displayName="Group";function I6(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function TGn({id:e,panelIds:t,storage:n}){const r=I6(e,[]),s=n.getItem(r);if(s)try{const a=JSON.parse(s);if(t){const i=t.join(","),o=a[i];if(o&&Array.isArray(o.layout)&&t.length===o.layout.length){const c={};for(let u=0;u<t.length;u++)c[t[u]]=o.layout[u];return c}}else{const i=Object.keys(a);if(i.length===1){const o=a[i[0]];if(o&&Array.isArray(o.layout)){const c=i[0].split(",");if(c.length===o.layout.length){const u={};for(let d=0;d<c.length;d++)u[c[d]]=o.layout[d];return u}}}}}catch{}}function p0e({debounceSaveMs:e=100,panelIds:t,storage:n=localStorage,...r}){const s=t!==void 0,a="id"in r?r.id:r.groupId,i=I6(a,t??[]),o=y.useSyncExternalStore(jGn,()=>n.getItem(i),()=>n.getItem(i)),c=y.useMemo(()=>{if(o){const g=JSON.parse(o),v=Object.values(g);if(Array.from(v).every(b=>typeof b=="number"))return g}},[o]),u=y.useMemo(()=>{if(!c)return TGn({id:a,panelIds:t,storage:n})},[c,a,t,n]),d=c??u,f=y.useRef(null),p=y.useCallback(()=>{const g=f.current;g&&(f.current=null,clearTimeout(g))},[]);y.useLayoutEffect(()=>()=>{p()},[p]);const h=y.useCallback(g=>{p();let v;s?v=I6(a,Object.keys(g)):v=I6(a,[]);try{n.setItem(v,JSON.stringify(g))}catch(b){console.error(b)}},[p,s,a,n]),m=y.useCallback(g=>{p(),e===0?h(g):f.current=setTimeout(()=>{h(g)},e)},[p,e,h]);return{defaultLayout:d,onLayoutChange:m,onLayoutChanged:h}}function jGn(){return function(){}}function h0e(){const e=y.useContext(Qxt);return Ga(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function NGn(e,t){const{id:n}=h0e(),r=y.useRef({collapse:FX,expand:FX,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:FX});y.useImperativeHandle(t,()=>r.current,[]),d_(()=>{Object.assign(r.current,Uxt({groupId:n,panelId:e}))})}function XU({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:s,disabled:a,elementRef:i,groupResizeBehavior:o="preserve-relative-size",id:c,maxSize:u="100%",minSize:d="0%",onResize:f,panelRef:p,style:h,...m}){const g=!!c,v=u0e(c),b=f0e({disabled:a}),S=y.useRef(null),w=d0e(S,i),{getPanelStyles:_,id:O,orientation:E,registerPanel:T,updatePanelProps:j}=h0e(),N=f!==null,I=lR((M,L,F)=>{f?.(M,c,F)});d_(()=>{const M=S.current;if(M!==null){const L={element:M,id:v,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:N?I:void 0,panelConstraints:{groupResizeBehavior:o,collapsedSize:n,collapsible:r,defaultSize:s,disabled:b.disabled,maxSize:u,minSize:d}};return T(L)}},[o,n,r,s,N,v,g,u,d,I,T,b]),y.useEffect(()=>{j(v,{disabled:a})},[a,v,j]),NGn(v,p);const R=()=>{const M=_(O,v);if(M)return JSON.stringify(M)},P=y.useSyncExternalStore(M=>i0e(O,M),R,R);let U;return P?U=JSON.parse(P):s?U={flexGrow:void 0,flexShrink:void 0,flexBasis:s}:U={flexGrow:1},l.jsx("div",{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":v,id:v,ref:w,style:{...AGn,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...U},children:l.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...h,touchAction:E==="horizontal"?"pan-y":"pan-x"},children:e})})}XU.displayName="Panel";const AGn={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function IGn(){return y.useRef(null)}function RGn({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let s,a;const i=e[n],o=t.find(c=>c.panelId===n);if(o){const c=o.maxSize,u=o.collapsible?o.collapsedSize:o.minSize,d=[r,r+1];a=wk({layout:JP({delta:u-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[n],s=wk({layout:JP({delta:c-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:s,valueMin:a,valueNow:i}}function Yxt({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:s,id:a,style:i,...o}){const c=u0e(a),u=f0e({disabled:n,disableDoubleClick:r}),[d,f]=y.useState({}),[p,h]=y.useState("inactive"),[m,g]=y.useState(!1),v=y.useRef(null),b=d0e(v,s),{disableCursor:S,id:w,orientation:_,registerSeparator:O,updateSeparatorProps:E}=h0e(),T=_==="horizontal"?"vertical":"horizontal";d_(()=>{const I=v.current;if(I!==null){const R={disabled:u.disabled,disableDoubleClick:u.disableDoubleClick,element:I,id:c},P=O(R),U=vGn(L=>{h(L.next.state!=="inactive"&&L.next.hitRegions.some(F=>F.separator===R)?L.next.state:"inactive")}),M=i0e(w,L=>{const{derivedPanelConstraints:F,layout:z,separatorToPanels:q}=L.next,H=q.get(R);if(H){const D=H[0],Y=H.indexOf(D);f(RGn({layout:z,panelConstraints:F,panelId:D.id,panelIndex:Y}))}});return()=>{U(),M(),P()}}},[w,c,O,u]),y.useEffect(()=>{E(c,{disabled:n,disableDoubleClick:r})},[n,r,c,E]);let j;n&&!S&&(j="not-allowed");let N;return n?N="disabled":p==="active"?N="active":m?N="focus":N=p,l.jsx("div",{...o,"aria-controls":d.valueControls,"aria-disabled":n||void 0,"aria-orientation":T,"aria-valuemax":d.valueMax,"aria-valuemin":d.valueMin,"aria-valuenow":d.valueNow,children:e,className:t,"data-separator":N,"data-testid":c,id:c,onBlur:()=>g(!1),onFocus:()=>g(!0),ref:b,role:"separator",style:{flexBasis:"auto",cursor:j,...i,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}Yxt.displayName="Separator";const e5e=e=>{let t;const n=new Set,r=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const p=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(h=>h(t,p))}},s=()=>t,o={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=t=e(r,s,o);return o},PGn=(e=>e?e5e(e):e5e),MGn=e=>e;function $Gn(e,t=MGn){const n=Oe.useSyncExternalStore(e.subscribe,Oe.useCallback(()=>t(e.getState()),[e,t]),Oe.useCallback(()=>t(e.getInitialState()),[e,t]));return Oe.useDebugValue(n),n}const t5e=e=>{const t=PGn(e),n=r=>$Gn(t,r);return Object.assign(n,t),n},m0e=(e=>e?t5e(e):t5e);function DGn(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var a;const i=c=>c===null?null:JSON.parse(c,void 0),o=(a=n.getItem(s))!=null?a:null;return o instanceof Promise?o.then(i):i(o)},setItem:(s,a)=>n.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>n.removeItem(s)}}const tfe=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return tfe(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return tfe(r)(n)}}}},LGn=(e,t)=>(n,r,s)=>{let a={storage:DGn(()=>window.localStorage),partialize:v=>v,version:0,merge:(v,b)=>({...b,...v}),...t},i=!1,o=0;const c=new Set,u=new Set;let d=a.storage;if(!d)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...v)},r,s);const f=()=>{const v=a.partialize({...r()});return d.setItem(a.name,{state:v,version:a.version})},p=s.setState;s.setState=(v,b)=>(p(v,b),f());const h=e((...v)=>(n(...v),f()),r,s);s.getInitialState=()=>h;let m;const g=()=>{var v,b;if(!d)return;const S=++o;i=!1,c.forEach(_=>{var O;return _((O=r())!=null?O:h)});const w=((b=a.onRehydrateStorage)==null?void 0:b.call(a,(v=r())!=null?v:h))||void 0;return tfe(d.getItem.bind(d))(a.name).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==a.version){if(a.migrate){const O=a.migrate(_.state,_.version);return O instanceof Promise?O.then(E=>[!0,E]):[!0,O]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,_.state];return[!1,void 0]}).then(_=>{var O;if(S!==o)return;const[E,T]=_;if(m=a.merge(T,(O=r())!=null?O:h),n(m,!0),E)return f()}).then(()=>{S===o&&(w?.(r(),void 0),m=r(),i=!0,u.forEach(_=>_(m)))}).catch(_=>{S===o&&w?.(void 0,_)})};return s.persist={setOptions:v=>{a={...a,...v},v.storage&&(d=v.storage)},clearStorage:()=>{d?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>g(),hasHydrated:()=>i,onHydrate:v=>(c.add(v),()=>{c.delete(v)}),onFinishHydration:v=>(u.add(v),()=>{u.delete(v)})},a.skipHydration||g(),m||h},zGn=LGn;var ea=(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))(ea||{});Gk().describe("Database record creation time");var FGn=Gk().describe("Database record last update time");FGn.nullable();var KU=Te({page:zR().int().min(0).optional().default(0).describe("Zero-indexed page number"),perPage:zR().int().min(1).max(100).optional().default(10).describe("Number of items per page")}).describe("Pagination options for list queries"),JU=Te({total:Tt().describe("Total number of items available"),page:Tt().describe("Current page"),perPage:sr([Tt(),Yt(!1)]).describe("Number of items per page, or false if pagination is disabled"),hasMore:To().describe("True if more pages are available")}),Dw=he().min(1).describe("Opaque cursor value for incremental polling"),eq=uo(["page","delta"]).describe("List mode: 'page' | 'delta', defaults to 'page' when omitted."),tq=zR().int().min(1).max(100).optional().describe("Maximum number of updates to return in one delta poll"),BGn={page:0,perPage:10},UGn=10;function nq(e,t){if(e.mode==="delta"){e.pagination!==void 0&&t.addIssue({code:"custom",path:["pagination"],message:"pagination is not allowed in delta mode"}),e.orderBy!==void 0&&t.addIssue({code:"custom",path:["orderBy"],message:"orderBy is not allowed in delta mode"});return}e.after!==void 0&&t.addIssue({code:"custom",path:["after"],message:"after is only allowed in delta mode"}),e.limit!==void 0&&t.addIssue({code:"custom",path:["limit"],message:"limit is only allowed in delta mode"})}function rq(e,t){return{mode:e.mode==="delta"?"delta":"page",filters:e.filters,pagination:e.pagination??t.pagination??BGn,orderBy:e.orderBy??t.orderBy,after:e.after,limit:e.limit??t.limit??UGn}}var sq=Te({limit:Tt().describe("Maximum number of updates requested for this delta poll"),hasMore:To().describe("True when more matching updates remain after this response")}).describe("Incremental polling metadata"),qGn=Te({start:rNe().optional().describe("Start of date range (inclusive by default)"),end:rNe().optional().describe("End of date range (inclusive by default)"),startExclusive:To().optional().describe("When true, excludes the start date from results (uses > instead of >=)"),endExclusive:To().optional().describe("When true, excludes the end date from results (uses < instead of <=)")}).describe("Date range filter for timestamps"),I$=uo(["ASC","DESC"]).describe("Sort direction: 'ASC' | 'DESC'"),Av=uo(["sum","avg","min","max","count","count_distinct","last"]).describe("Aggregation function"),f_=uo(["1m","5m","15m","1h","1d"]).describe("Time bucket interval"),g0e=uo(["previous_period","previous_day","previous_week"]).describe("Comparison period for aggregate queries"),p_=Rt(he()).min(1).describe("Fields to group by"),v0e=Rt(Tt().min(0).max(1)).min(1).describe("Percentile values (0-1)"),y0e={value:Tt().nullable().describe("Aggregated value"),previousValue:Tt().nullable().optional().describe("Value from comparison period"),changePercent:Tt().nullable().optional().describe("Percentage change from comparison period")},b0e=ta(he(),he().nullable()).describe("Dimension values for this group"),Aj=Tt().describe("Aggregated value"),Ij=Gk().describe("Bucket timestamp"),x0e=Tt().describe("Percentile value"),w0e=Tt().describe("Percentile value at this bucket"),Rj=mme(ea).describe("Entity type (e.g., 'agent' | 'processor' | 'tool' | 'workflow')"),VGn=he().describe('ID of the entity (e.g., "weatherAgent", "orderWorkflow")'),Xxt=he().describe("Name of the entity"),Kxt=he().describe("Human end-user who triggered execution"),Jxt=he().describe("Multi-tenant organization/account"),e0t=he().describe("Broader resource context (Mastra memory compatibility)"),t0t=he().describe("Unique execution run identifier"),n0t=he().describe("Session identifier for grouping traces"),r0t=he().describe("Conversation thread identifier"),s0t=he().describe("HTTP request ID for log correlation"),a0t=he().describe('Environment (e.g., "production" | "staging" | "development")'),HGn=he().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),i0t=he().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),o0t=he().describe("Name of the service"),l0t=mme(ea).describe("Entity type of the parent entity"),ZGn=he().describe("ID of the parent entity"),c0t=he().describe("Name of the parent entity"),u0t=mme(ea).describe("Entity type of the root entity"),WGn=he().describe("ID of the root entity"),d0t=he().describe("Name of the root entity"),f0t=he().describe("Version ID of the entity that produced this signal (e.g., agent version, workflow version)"),p0t=he().describe("Version ID of the parent entity that produced this signal"),h0t=he().describe("Version ID of the root entity that produced this signal"),aq=he().describe("Experiment or eval run identifier"),GGn=ta(he(),Xa()).describe('Arbitrary package/app version info (e.g., {"core": "1.0.0", "memory": "1.0.0", "gitSha": "abcd1234"})'),m0t=ta(he(),Xa()).describe("User-defined metadata for custom filtering"),g0t=Rt(he()).describe("Labels for filtering"),QGn={entityType:Rj.nullish(),entityId:VGn.nullish(),entityName:Xxt.nullish(),parentEntityType:l0t.nullish(),parentEntityId:ZGn.nullish(),parentEntityName:c0t.nullish(),rootEntityType:u0t.nullish(),rootEntityId:WGn.nullish(),rootEntityName:d0t.nullish(),userId:Kxt.nullish(),organizationId:Jxt.nullish(),resourceId:e0t.nullish(),runId:t0t.nullish(),sessionId:n0t.nullish(),threadId:r0t.nullish(),requestId:s0t.nullish(),environment:a0t.nullish(),serviceName:o0t.nullish(),scope:GGn.nullish(),entityVersionId:f0t.nullish(),parentEntityVersionId:p0t.nullish(),rootEntityVersionId:h0t.nullish(),experimentId:aq.nullish()},iq={...QGn,executionSource:i0t.nullish(),tags:g0t.nullish()};HGn.nullish();var oq={timestamp:qGn.optional().describe("Filter by timestamp range"),traceId:he().optional().describe("Filter by trace ID"),spanId:he().optional().describe("Filter by span ID"),entityType:Rj.optional(),entityName:Xxt.optional(),entityVersionId:f0t.optional(),parentEntityVersionId:p0t.optional(),rootEntityVersionId:h0t.optional(),userId:Kxt.optional(),organizationId:Jxt.optional(),experimentId:aq.optional(),serviceName:o0t.optional(),environment:a0t.optional(),parentEntityType:l0t.optional(),parentEntityName:c0t.optional(),rootEntityType:u0t.optional(),rootEntityName:d0t.optional(),resourceId:e0t.optional(),runId:t0t.optional(),sessionId:n0t.optional(),threadId:r0t.optional(),requestId:s0t.optional(),executionSource:i0t.optional(),tags:Rt(he()).optional().describe("Filter by tags (must have all specified tags)")},lq=he().describe("Unique trace identifier"),cq=he().describe("Unique span identifier within a trace"),R8=uo(["debug","info","warn","error","fatal"]),v0t=he().describe("Log message"),y0t=ta(he(),Xa()).describe("Structured data attached to the log"),b0t=Te({logId:he().nullish().describe("Unique id for this log event"),timestamp:Gk().describe("When the log was created"),level:R8.describe("Log severity level"),message:v0t,data:y0t.nullish(),traceId:lq.nullish(),spanId:cq.nullish(),...iq,source:he().nullish().describe("Execution source"),metadata:m0t.nullish()}).describe("Log record as stored in the database");Te({level:R8,message:v0t,data:y0t.optional(),tags:g0t.optional()}).describe("User-provided log input");var YGn=b0t;Te({logs:Rt(YGn)}).describe("Arguments for batch creating logs");var XGn=Te({...oq,source:he().optional().describe("Filter by execution source"),level:sr([R8,Rt(R8)]).optional().describe("Filter by log level(s)")}).describe("Filters for querying logs"),KGn=uo(["timestamp"]).describe("Field to order by: 'timestamp'"),JGn=Te({field:KGn.default("timestamp").describe("Field to order by"),direction:I$.default("DESC").describe("Sort direction")}).describe("Order by configuration");Te({mode:eq.optional(),filters:XGn.optional().describe("Optional filters to apply"),pagination:KU.optional(),orderBy:JGn.optional(),after:Dw.optional(),limit:tq}).strict().superRefine(nq).transform(e=>rq(e,{orderBy:{field:"timestamp",direction:"DESC"}})).describe("Arguments for listing logs");Te({pagination:JU.optional(),delta:sq.optional(),deltaCursor:Dw.optional(),logs:Rt(b0t)}).describe("Response from listing logs");var Pj=he().describe("Identifier of the scorer (e.g., relevance, accuracy)"),x0t=he().describe("Display name of the scorer"),w0t=he().describe("Version of the scorer"),hv=he().describe("How the score was produced (e.g., manual, automated, experiment)"),S0t=Tt().describe("Score value (range defined by scorer)"),k0t=he().describe("Explanation for the score"),_0t=Te({scoreId:he().nullish().describe("Unique id for this score event"),timestamp:Gk().describe("When the score was recorded"),traceId:lq.nullish().describe("Trace that anchors the scored target when available"),spanId:cq.nullish().describe("Span ID this score applies to"),scorerId:Pj,scorerName:x0t.nullish(),scorerVersion:w0t.nullish(),scoreSource:hv.nullish(),source:hv.nullish(),score:S0t,reason:k0t.nullish(),...iq,scoreTraceId:he().nullish().describe("Trace ID of the scoring run for debugging score generation"),metadata:ta(he(),Xa()).nullish().describe("User-defined metadata")}).describe("Score record as stored in the database");Te({scorerId:Pj,scorerName:x0t.optional(),scorerVersion:w0t.optional(),scoreSource:hv.optional(),source:hv.optional(),score:S0t,reason:k0t.optional(),metadata:ta(he(),Xa()).optional().describe("Additional scorer-specific metadata"),experimentId:aq.optional(),scoreTraceId:he().optional().describe("Trace ID of the scoring run for debugging score generation"),targetEntityType:Rj.optional().describe("Entity type the scorer evaluated when known")}).describe("User-provided score input");var S0e=_0t;Te({score:S0e}).describe("Arguments for creating a score");Te({score:S0e.omit({timestamp:!0})}).describe("Arguments for creating a score");Te({success:To()}).describe("Response from creating a score");Te({scores:Rt(S0e)}).describe("Arguments for batch recording scores");var R$=Te({...oq,scorerId:sr([he(),Rt(he())]).optional().describe("Filter by scorer ID(s)"),scoreSource:hv.optional().describe("Filter by how the score was produced"),source:hv.optional().describe("Filter by how the score was produced")}).describe("Filters for querying scores"),eQn=uo(["timestamp","score"]).describe("Field to order by: 'timestamp' | 'score'"),tQn=Te({field:eQn.default("timestamp").describe("Field to order by"),direction:I$.default("DESC").describe("Sort direction")}).describe("Order by configuration");Te({mode:eq.optional(),filters:R$.optional(),pagination:KU.optional(),orderBy:tQn.optional(),after:Dw.optional(),limit:tq}).strict().superRefine(nq).transform(e=>rq(e,{orderBy:{field:"timestamp",direction:"DESC"}})).describe("Arguments for listing scores");Te({pagination:JU.optional(),delta:sq.optional(),deltaCursor:Dw.optional(),scores:Rt(_0t)}).describe("Response from listing scores");Te({scorerId:Pj,scoreSource:hv.optional(),aggregation:Av,filters:R$.optional(),comparePeriod:g0e.optional()}).describe("Arguments for getting a score aggregate");Te(y0e);Te({scorerId:Pj,scoreSource:hv.optional(),groupBy:p_,aggregation:Av,filters:R$.optional()}).describe("Arguments for getting a score breakdown");Te({groups:Rt(Te({dimensions:b0e,value:Aj}))});Te({scorerId:Pj,scoreSource:hv.optional(),interval:f_,aggregation:Av,filters:R$.optional(),groupBy:p_.optional()}).describe("Arguments for getting score time series");Te({series:Rt(Te({name:he().describe("Series name (scorer ID or group key)"),points:Rt(Te({timestamp:Ij,value:Aj}))}))});Te({scorerId:Pj,scoreSource:hv.optional(),percentiles:v0e,interval:f_,filters:R$.optional()}).describe("Arguments for getting score percentiles");Te({series:Rt(Te({percentile:x0e,points:Rt(Te({timestamp:Ij,value:w0e}))}))});var mv=he().describe("Source of feedback (e.g., 'user', 'system', 'manual')"),Mj=he().describe("Type of feedback (e.g., 'thumbs', 'rating', 'correction')"),O0t=sr([Tt(),he()]).describe("Feedback value (rating number or correction text)"),E0t=he().describe("Additional comment or context"),P8=he().describe("User who provided the feedback");function k0e(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 uq=Te({feedbackId:he().nullish().describe("Unique id for this feedback event"),timestamp:Gk().describe("When the feedback was recorded"),traceId:lq.nullish().describe("Trace that anchors the feedback target when available"),spanId:cq.nullish().describe("Span ID this feedback applies to"),feedbackSource:mv.nullish(),source:mv.nullish(),feedbackType:Mj,value:O0t,comment:E0t.nullish(),feedbackUserId:P8.nullish(),...iq,sourceId:he().nullish().describe("ID of the source record this feedback is linked to (e.g. experiment result ID)"),metadata:ta(he(),Xa()).nullish().describe("User-defined metadata")}),nQn=Te(uq.shape).describe("Feedback record as stored in the database"),rQn=Te({feedbackSource:mv.optional(),source:mv.optional(),feedbackType:Mj,value:O0t,comment:E0t.optional(),feedbackUserId:P8.optional(),userId:P8.optional(),metadata:ta(he(),Xa()).optional().describe("Additional feedback-specific metadata"),experimentId:aq.optional(),sourceId:he().optional().describe("ID of the source record this feedback is linked to")});Te(rQn.shape).describe("User-provided feedback input");Te({feedback:bme(k0e,uq)}).describe("Arguments for creating feedback");Te({feedback:uq.omit({timestamp:!0})}).describe("Arguments for creating feedback");Te({success:To()}).describe("Response from creating feedback");Te({feedbacks:Rt(bme(k0e,uq))}).describe("Arguments for batch recording feedback");var C0t=Te({...oq,feedbackType:sr([he(),Rt(he())]).optional().describe("Filter by feedback type(s)"),feedbackSource:mv.optional(),source:mv.optional(),feedbackUserId:P8.optional()}),dq=Te(C0t.shape).describe("Filters for querying feedback"),sQn=uo(["timestamp"]).describe("Field to order by: 'timestamp'"),aQn=Te({field:sQn.default("timestamp").describe("Field to order by"),direction:I$.default("DESC").describe("Sort direction")}).describe("Order by configuration");Te({mode:eq.optional(),filters:bme(k0e,C0t).optional(),pagination:KU.optional(),orderBy:aQn.optional(),after:Dw.optional(),limit:tq}).strict().superRefine(nq).transform(e=>rq(e,{orderBy:{field:"timestamp",direction:"DESC"}})).describe("Arguments for listing feedback");Te({pagination:JU.optional(),delta:sq.optional(),deltaCursor:Dw.optional(),feedback:Rt(nQn)}).describe("Response from listing feedback");Te({feedbackType:Mj,feedbackSource:mv.optional(),aggregation:Av,filters:dq.optional(),comparePeriod:g0e.optional()}).describe("Arguments for getting a feedback aggregate over numeric values");Te(y0e);Te({feedbackType:Mj,feedbackSource:mv.optional(),groupBy:p_,aggregation:Av,filters:dq.optional()}).describe("Arguments for getting a feedback breakdown over numeric values");Te({groups:Rt(Te({dimensions:b0e,value:Aj}))});Te({feedbackType:Mj,feedbackSource:mv.optional(),interval:f_,aggregation:Av,filters:dq.optional(),groupBy:p_.optional()}).describe("Arguments for getting feedback time series over numeric values");Te({series:Rt(Te({name:he().describe("Series name (feedback type or group key)"),points:Rt(Te({timestamp:Ij,value:Aj}))}))});Te({feedbackType:Mj,feedbackSource:mv.optional(),percentiles:v0e,interval:f_,filters:dq.optional()}).describe("Arguments for getting feedback percentiles over numeric values");Te({series:Rt(Te({percentile:x0e,points:Rt(Te({timestamp:Ij,value:w0e}))}))});uo(["counter","gauge","histogram"]);var T0t=he().describe("Metric name (e.g., mastra_agent_duration_ms)"),j0t=Tt().describe("Metric value"),N0t=ta(he(),he()).describe("Metric labels for dimensional filtering"),A0t=he().describe("Model provider"),I0t=he().describe("Model"),iQn=Tt().describe("Estimated cost"),R0t=he().describe("Unit for the estimated cost (e.g., usd)"),oQn=ta(he(),Xa()).nullish().describe("Structured costing metadata"),P0t=Te({metricId:he().nullish().describe("Unique id for this metric event"),timestamp:Gk().describe("When the metric was recorded"),name:T0t,value:j0t,traceId:lq.nullish(),spanId:cq.nullish(),...iq,source:he().nullish().describe("Execution source"),provider:A0t.nullish(),model:I0t.nullish(),estimatedCost:iQn.nullish(),costUnit:R0t.nullish(),costMetadata:oQn.nullish(),labels:N0t.default({}),metadata:m0t.nullish()}).describe("Metric record as stored in the database");Te({name:T0t,value:j0t,labels:N0t.optional()}).describe("User-provided metric input");var lQn=P0t;Te({metrics:Rt(lQn)}).describe("Arguments for batch recording metrics");Te({type:Av,interval:f_.optional(),groupBy:p_.optional()}).describe("Metrics aggregation configuration");var P$=Te({...oq,name:Rt(he()).nonempty().optional().describe("Filter by metric name(s)"),source:he().optional().describe("Filter by execution source"),provider:A0t.optional(),model:I0t.optional(),costUnit:R0t.optional(),labels:ta(he(),he()).optional().describe("Exact match on label key-value pairs")}).describe("Filters for querying metrics"),cQn=uo(["timestamp"]).describe("Field to order by: 'timestamp'"),uQn=Te({field:cQn.default("timestamp").describe("Field to order by"),direction:I$.default("DESC").describe("Sort direction")}).describe("Order by configuration");Te({mode:eq.optional(),filters:P$.optional(),pagination:KU.optional(),orderBy:uQn.optional(),after:Dw.optional(),limit:tq}).strict().superRefine(nq).transform(e=>rq(e,{orderBy:{field:"timestamp",direction:"DESC"}})).describe("Arguments for listing metrics");Te({pagination:JU.optional(),delta:sq.optional(),deltaCursor:Dw.optional(),metrics:Rt(P0t)}).describe("Response from listing metrics");var dQn=["entityType","entityName","parentEntityType","parentEntityName","rootEntityType","rootEntityName","name","provider","model","environment","executionSource","serviceName","threadId","resourceId"],_0e=uo(dQn).optional().describe("Column to apply count_distinct over (required when aggregation is 'count_distinct'). Restricted to allowlisted metric dimensions."),sT={check:e=>e.aggregation!=="count_distinct"||e.distinctColumn!==void 0,options:{message:"distinctColumn is required when aggregation is 'count_distinct'",path:["distinctColumn"]}};Te({name:Rt(he()).nonempty().describe("Metric name(s) to aggregate"),aggregation:Av,distinctColumn:_0e,filters:P$.optional(),comparePeriod:g0e.optional()}).refine(sT.check,sT.options).describe("Arguments for getting a metric aggregate");Te({...y0e,estimatedCost:Tt().nullable().optional().describe("Aggregated estimated cost from the same filtered row set"),costUnit:he().nullable().optional().describe("Shared cost unit for the aggregated rows, or null when mixed/unknown"),previousEstimatedCost:Tt().nullable().optional().describe("Aggregated estimated cost from the comparison period"),costChangePercent:Tt().nullable().optional().describe("Percentage change in estimated cost from comparison period")});Te({name:Rt(he()).nonempty().describe("Metric name(s) to break down"),groupBy:p_,aggregation:Av,distinctColumn:_0e,filters:P$.optional(),limit:Tt().int().positive().max(1e3).optional().describe("Maximum number of groups to return (server-side TopK). Required for high-cardinality groupBy."),orderDirection:I$.optional().describe("Sort direction for the aggregated value (defaults to 'DESC' at the storage layer; pairs with limit for top/bottom-N).")}).refine(sT.check,sT.options).describe("Arguments for getting a metric breakdown");Te({groups:Rt(Te({dimensions:b0e,value:Aj,estimatedCost:Tt().nullable().optional().describe("Summed estimated cost for this group"),costUnit:he().nullable().optional().describe("Shared cost unit for this group, or null when mixed/unknown")}))});Te({name:Rt(he()).nonempty().describe("Metric name(s)"),interval:f_,aggregation:Av,distinctColumn:_0e,filters:P$.optional(),groupBy:p_.optional()}).refine(sT.check,sT.options).describe("Arguments for getting metric time series");Te({series:Rt(Te({name:he().describe("Series name (metric name or group key)"),costUnit:he().nullable().optional().describe("Shared cost unit for this series, or null when mixed/unknown"),points:Rt(Te({timestamp:Ij,value:Aj,estimatedCost:Tt().nullable().optional().describe("Summed estimated cost in this bucket")}))}))});Te({name:he().describe("Metric name"),percentiles:v0e,interval:f_,filters:P$.optional()}).describe("Arguments for getting metric percentiles");Te({series:Rt(Te({percentile:x0e,points:Rt(Te({timestamp:Ij,value:w0e}))}))});Te({prefix:he().optional().describe("Filter metric names by prefix"),limit:zR().int().min(1).optional().describe("Maximum number of names to return")}).describe("Arguments for getting metric names");Te({names:Rt(he()).describe("Distinct metric names")});Te({metricName:he().describe("Metric name to get label keys for")}).describe("Arguments for getting metric label keys");Te({keys:Rt(he()).describe("Distinct label keys for the metric")});Te({metricName:he().describe("Metric name"),labelKey:he().describe("Label key to get values for"),prefix:he().optional().describe("Filter values by prefix"),limit:zR().int().min(1).optional().describe("Maximum number of values to return")}).describe("Arguments for getting label values");Te({values:Rt(he()).describe("Distinct label values")});Te({}).describe("Arguments for getting entity types");Te({entityTypes:Rt(Rj).describe("Distinct entity types")});Te({entityType:Rj.optional().describe("Optional entity type filter")}).describe("Arguments for getting entity names");Te({names:Rt(he()).describe("Distinct entity names")});Te({}).describe("Arguments for getting service names");Te({serviceNames:Rt(he()).describe("Distinct service names")});Te({}).describe("Arguments for getting environments");Te({environments:Rt(he()).describe("Distinct environments")});Te({entityType:Rj.optional().describe("Optional entity type filter")}).describe("Arguments for getting tags");Te({tags:Rt(he()).describe("Distinct tags")});var h_=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(){}},fQn={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},pQn=class{#e=fQn;#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)}},hS=new pQn;function hQn(e){setTimeout(e,0)}var kk=typeof window>"u"||"Deno"in globalThis;function Qc(){}function mQn(e,t){return typeof e=="function"?e(t):e}function nfe(e){return typeof e=="number"&&e>=0&&e!==1/0}function M0t(e,t){return Math.max(e+(t||0)-Date.now(),0)}function N0(e,t){return typeof e=="function"?e(t):e}function Hp(e,t){return typeof e=="function"?e(t):e}function n5e(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:i,stale:o}=e;if(i){if(r){if(t.queryHash!==O0e(i,t.options))return!1}else if(!e2(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||s&&s!==t.state.fetchStatus||a&&!a(t))}function r5e(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(_k(t.options.mutationKey)!==_k(a))return!1}else if(!e2(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function O0e(e,t){return(t?.queryKeyHashFn||_k)(e)}function _k(e){return JSON.stringify(e,(t,n)=>rfe(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function e2(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>e2(e[n],t[n])):!1}var gQn=Object.prototype.hasOwnProperty;function E0e(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=s5e(e)&&s5e(t);if(!r&&!(rfe(e)&&rfe(t)))return t;const a=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),o=i.length,c=r?new Array(o):{};let u=0;for(let d=0;d<o;d++){const f=r?d:i[d],p=e[f],h=t[f];if(p===h){c[f]=p,(r?d<a:gQn.call(e,f))&&u++;continue}if(p===null||h===null||typeof p!="object"||typeof h!="object"){c[f]=h;continue}const m=E0e(p,h,n+1);c[f]=m,m===p&&u++}return a===o&&u===a?e:c}function t2(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function s5e(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function rfe(e){if(!a5e(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!a5e(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function a5e(e){return Object.prototype.toString.call(e)==="[object Object]"}function vQn(e){return new Promise(t=>{hS.setTimeout(t,e)})}function sfe(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?E0e(e,t):t}function yQn(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function bQn(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var C0e=Symbol();function $0t(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===C0e?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function T0e(e,t){return typeof e=="function"?e(...t):!!e}function xQn(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var wQn=class extends h_{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!kk&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},j0e=new wQn;function afe(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var SQn=hQn;function kQn(){let e=[],t=0,n=o=>{o()},r=o=>{o()},s=SQn;const a=o=>{t?e.push(o):s(()=>{n(o)})},i=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(c=>{n(c)})})})};return{batch:o=>{let c;t++;try{c=o()}finally{t--,t||i()}return c},batchCalls:o=>(...c)=>{a(()=>{o(...c)})},schedule:a,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}var Co=kQn(),_Qn=class extends h_{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!kk&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},M8=new _Qn;function OQn(e){return Math.min(1e3*2**e,3e4)}function D0t(e){return(e??"online")==="online"?M8.isOnline():!0}var ife=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function L0t(e){let t=!1,n=0,r;const s=afe(),a=()=>s.status!=="pending",i=g=>{if(!a()){const v=new ife(g);p(v),e.onCancel?.(v)}},o=()=>{t=!0},c=()=>{t=!1},u=()=>j0e.isFocused()&&(e.networkMode==="always"||M8.isOnline())&&e.canRun(),d=()=>D0t(e.networkMode)&&e.canRun(),f=g=>{a()||(r?.(),s.resolve(g))},p=g=>{a()||(r?.(),s.reject(g))},h=()=>new Promise(g=>{r=v=>{(a()||u())&&g(v)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let g;const v=n===0?e.initialPromise:void 0;try{g=v??e.fn()}catch(b){g=Promise.reject(b)}Promise.resolve(g).then(f).catch(b=>{if(a())return;const S=e.retry??(kk?0:3),w=e.retryDelay??OQn,_=typeof w=="function"?w(n,b):w,O=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,b);if(t||!O){p(b);return}n++,e.onFail?.(n,b),vQn(_).then(()=>u()?void 0:h()).then(()=>{t?p(b):m()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(r?.(),s),cancelRetry:o,continueRetry:c,canStart:d,start:()=>(d()?m():h().then(m),s)}}var z0t=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nfe(this.gcTime)&&(this.#e=hS.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(kk?1/0:300*1e3))}clearGcTimeout(){this.#e&&(hS.clearTimeout(this.#e),this.#e=void 0)}},EQn=class extends z0t{#e;#t;#n;#s;#r;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=o5e(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=o5e(this.options);t.data!==void 0&&(this.setState(i5e(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=sfe(this.state.data,e,this.options);return this.#i({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Qc).catch(Qc):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Hp(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===C0e||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>N0(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:!M0t(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.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.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const o=this.observers.find(c=>c.options.queryFn);o&&this.setOptions(o.options)}const n=new AbortController,r=o=>{Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},s=()=>{const o=$0t(this.options,t),u=(()=>{const d={client:this.#s,queryKey:this.queryKey,meta:this.meta};return r(d),d})();return this.#o=!1,this.options.persister?this.options.persister(o,u,this):o(u)},i=(()=>{const o={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return r(o),o})();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.#r=L0t({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:o=>{o instanceof ife&&o.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(o,c)=>{this.#i({type:"failed",failureCount:o,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 o=await this.#r.start();if(o===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(o),this.#n.config.onSuccess?.(o,this),this.#n.config.onSettled?.(o,this.state.error,this),o}catch(o){if(o instanceof ife){if(o.silent)return this.#r.promise;if(o.revert){if(this.state.data===void 0)throw o;return this.state.data}}throw this.#i({type:"error",error:o}),this.#n.config.onError?.(o,this),this.#n.config.onSettled?.(this.state.data,o,this),o}finally{this.scheduleGc()}}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...F0t(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...i5e(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Co.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function F0t(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:D0t(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function i5e(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function o5e(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var fq=class extends h_{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#o=afe(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#a;#o;#i;#h;#d;#f;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),l5e(this.#t,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ofe(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ofe(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,n=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 Hp(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&&!t2(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&c5e(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Hp(this.options.enabled,this.#t)!==Hp(t.enabled,this.#t)||N0(this.options.staleTime,this.#t)!==N0(t.staleTime,this.#t))&&this.#g();const s=this.#v();r&&(this.#t!==n||Hp(this.options.enabled,this.#t)!==Hp(t.enabled,this.#t)||s!==this.#l)&&this.#y(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return TQn(this,n)&&(this.#s=n,this.#a=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="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(n,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,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(Qc)),t}#g(){this.#x();const e=N0(this.options.staleTime,this.#t);if(kk||this.#s.isStale||!nfe(e))return;const n=M0t(this.#s.dataUpdatedAt,e)+1;this.#c=hS.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#l=e,!(kk||Hp(this.options.enabled,this.#t)===!1||!nfe(this.#l)||this.#l===0)&&(this.#u=hS.setInterval(()=>{(this.options.refetchIntervalInBackground||j0e.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#c&&(hS.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(hS.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,s=this.#s,a=this.#r,i=this.#a,c=e!==n?e.state:this.#n,{state:u}=e;let d={...u},f=!1,p;if(t._optimisticResults){const j=this.hasListeners(),N=!j&&l5e(e,t),I=j&&c5e(e,n,t,r);(N||I)&&(d={...d,...F0t(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:h,errorUpdatedAt:m,status:g}=d;p=d.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&g==="pending"){let j;s?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(j=s.data,v=!0):j=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,j!==void 0&&(g="success",p=sfe(s?.data,j,t),f=!0)}if(t.select&&p!==void 0&&!v)if(s&&p===a?.data&&t.select===this.#h)p=this.#d;else try{this.#h=t.select,p=t.select(p),p=sfe(s?.data,p,t),this.#d=p,this.#i=null}catch(j){this.#i=j}this.#i&&(h=this.#i,p=this.#d,m=Date.now(),g="error");const b=d.fetchStatus==="fetching",S=g==="pending",w=g==="error",_=S&&b,O=p!==void 0,T={status:g,fetchStatus:d.fetchStatus,isPending:S,isSuccess:g==="success",isError:w,isInitialLoading:_,isLoading:_,data:p,dataUpdatedAt:d.dataUpdatedAt,error:h,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:b,isRefetching:b&&!S,isLoadingError:w&&!O,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:w&&O,isStale:N0e(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Hp(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const j=T.data!==void 0,N=T.status==="error"&&!j,I=U=>{N?U.reject(T.error):j&&U.resolve(T.data)},R=()=>{const U=this.#o=T.promise=afe();I(U)},P=this.#o;switch(P.status){case"pending":e.queryHash===n.queryHash&&I(P);break;case"fulfilled":(N||T.data!==P.value)&&R();break;case"rejected":(!N||T.error!==P.reason)&&R();break}}return T}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#f=this.#t),t2(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!this.#p.size)return!0;const a=new Set(s??this.#p);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(i=>{const o=i;return this.#s[o]!==e[o]&&a.has(o)})};this.#k({listeners:n()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#k(e){Co.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function CQn(e,t){return Hp(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function l5e(e,t){return CQn(e,t)||e.state.data!==void 0&&ofe(e,t,t.refetchOnMount)}function ofe(e,t,n){if(Hp(t.enabled,e)!==!1&&N0(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&N0e(e,t)}return!1}function c5e(e,t,n,r){return(e!==t||Hp(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&N0e(e,n)}function N0e(e,t){return Hp(t.enabled,e)!==!1&&e.isStaleByTime(N0(t.staleTime,e))}function TQn(e,t){return!t2(e.getCurrentResult(),t)}function $8(e){return{onFetch:(t,n)=>{const r=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let o={pages:[],pageParams:[]},c=0;const u=async()=>{let d=!1;const f=m=>{xQn(m,()=>t.signal,()=>d=!0)},p=$0t(t.options,t.fetchOptions),h=async(m,g,v)=>{if(d)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const S=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:g,direction:v?"backward":"forward",meta:t.options.meta};return f(E),E})(),w=await p(S),{maxPages:_}=t.options,O=v?bQn:yQn;return{pages:O(m.pages,w,_),pageParams:O(m.pageParams,g,_)}};if(s&&a.length){const m=s==="backward",g=m?B0t:lfe,v={pages:a,pageParams:i},b=g(r,v);o=await h(v,b,m)}else{const m=e??a.length;do{const g=c===0?i[0]??r.initialPageParam:lfe(r,o);if(c>0&&g==null)break;o=await h(o,g),c++}while(c<m)}return o};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function lfe(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function B0t(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function jQn(e,t){return t?lfe(e,t)!=null:!1}function NQn(e,t){return!t||!e.getPreviousPageParam?!1:B0t(e,t)!=null}var AQn=class extends fq{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:$8()})}getOptimisticResult(e){return e.behavior=$8(),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:n}=e,r=super.createResult(e,t),{isFetching:s,isRefetching:a,isError:i,isRefetchError:o}=r,c=n.fetchMeta?.fetchMore?.direction,u=i&&c==="forward",d=s&&c==="forward",f=i&&c==="backward",p=s&&c==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:jQn(t,n.data),hasPreviousPage:NQn(t,n.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:p,isRefetchError:o&&!u&&!f,isRefetching:a&&!d&&!p}}},IQn=class extends z0t{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||U0t(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=L0t({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,i)=>{this.#r({type:"failed",failureCount:a,error:i})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",s=!this.#s.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const i=await this.options.onMutate?.(e,n);i!==this.state.context&&this.#r({type:"pending",context:i,variables:e,isPaused:s})}const a=await this.#s.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(i){Promise.reject(i)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(i){Promise.reject(i)}throw this.#r({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Co.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function U0t(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var RQn=class extends h_{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new IQn({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=FL(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=FL(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=FL(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(s=>s.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=FL(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Co.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>r5e(t,n))}findAll(e={}){return this.getAll().filter(t=>r5e(e,t))}notify(e){Co.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Co.batch(()=>Promise.all(e.map(t=>t.continue().catch(Qc))))}};function FL(e){return e.options.scope?.id}var PQn=class extends h_{#e;#t=void 0;#n;#s;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),t2(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&_k(n.mutationKey)!==_k(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(t,n){return this.#s=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??U0t();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){Co.batch(()=>{if(this.#s&&this.hasListeners()){const n=this.#t.variables,r=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,n,r,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(t.data,null,n,r,s)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#s.onError?.(t.error,n,r,s)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(void 0,t.error,n,r,s)}catch(a){Promise.reject(a)}}}this.listeners.forEach(n=>{n(this.#t)})})}};function u5e(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function MQn(e,t,n){const r=e.slice(0);return r[t]=n,r}var $Qn=class extends h_{#e;#t;#n;#s;#r;#a;#o;#i;#h;#d=[];constructor(e,t,n){super(),this.#e=e,this.#s=n,this.#n=[],this.#r=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#r.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#r.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#s=t,Co.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const s=r.map(d=>d.observer),a=s.map(d=>d.getCurrentResult()),i=n.length!==s.length,o=s.some((d,f)=>d!==n[f]),c=i||o,u=c?!0:a.some((d,f)=>{const p=this.#t[f];return!p||!t2(d,p)});!c&&!u||(c&&(this.#d=r,this.#r=s),this.#t=a,this.hasListeners()&&(c&&(u5e(n,s).forEach(d=>{d.destroy()}),u5e(s,n).forEach(d=>{d.subscribe(f=>{this.#l(d,f)})})),this.#p()))})}getCurrentResult(){return this.#t}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,t){const n=this.#u(e),r=n.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),s=n.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#c(a??r,t,s),()=>this.#f(r,n)]}#f(e,t){return t.map((n,r)=>{const s=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?s:n.observer.trackResult(s,a=>{t.forEach(i=>{i.observer.trackProp(a)})})})}#c(e,t,n){if(t){const r=this.#h,s=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((a,i)=>a!==r[i]));return(!this.#a||this.#t!==this.#i||s||t!==this.#o)&&(this.#o=t,this.#i=this.#t,n!==void 0&&(this.#h=n),this.#a=E0e(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#r.forEach(r=>{const s=r.options.queryHash;if(!s)return;const a=t.get(s);a?a.push(r):t.set(s,[r])});const n=[];return e.forEach(r=>{const s=this.#e.defaultQueryOptions(r),i=t.get(s.queryHash)?.shift()??new fq(this.#e,s);n.push({defaultedQueryOptions:s,observer:i})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#t=MQn(this.#t,n,t),this.#p())}#p(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#t,this.#d),n=this.#c(t,this.#s?.combine);e!==n&&Co.batch(()=>{this.listeners.forEach(r=>{r(this.#t)})})}}},DQn=class extends h_{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,s=t.queryHash??O0e(r,t);let a=this.get(s);return a||(a=new EQn({client:e,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),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(){Co.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>n5e(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>n5e(e,n)):t}notify(e){Co.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Co.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Co.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},LQn=class{#e;#t;#n;#s;#r;#a;#o;#i;constructor(e={}){this.#e=e.queryCache||new DQn,this.#t=e.mutationCache||new RQn,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=j0e.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=M8.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),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(N0(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(r.queryHash)?.state.data,i=mQn(t,a);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Co.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Co.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Co.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Co.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Qc).catch(Qc)}invalidateQueries(e,t={}){return Co.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Co.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(Qc)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Qc)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(N0(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Qc).catch(Qc)}fetchInfiniteQuery(e){return e.behavior=$8(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Qc).catch(Qc)}ensureInfiniteQueryData(e){return e.behavior=$8(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return M8.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(_k(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(r=>{e2(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(_k(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{e2(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=O0e(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===C0e&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},q0t=y.createContext(void 0),Ys=e=>{const t=y.useContext(q0t);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},zQn=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(q0t.Provider,{value:e,children:t})),V0t=y.createContext(!1),H0t=()=>y.useContext(V0t);V0t.Provider;function FQn(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var BQn=y.createContext(FQn()),Z0t=()=>y.useContext(BQn),W0t=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?T0e(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},G0t=e=>{y.useEffect(()=>{e.clearReset()},[e])},Q0t=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||T0e(n,[e.error,r])),Y0t=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},UQn=(e,t)=>e.isLoading&&e.isFetching&&!t,cfe=(e,t)=>e?.suspense&&t.isPending,ufe=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function qQn({queries:e,...t},n){const r=Ys(),s=H0t(),a=Z0t(),i=y.useMemo(()=>e.map(g=>{const v=r.defaultQueryOptions(g);return v._optimisticResults=s?"isRestoring":"optimistic",v}),[e,r,s]);i.forEach(g=>{Y0t(g);const v=r.getQueryCache().get(g.queryHash);W0t(g,a,v)}),G0t(a);const[o]=y.useState(()=>new $Qn(r,i,t)),[c,u,d]=o.getOptimisticResult(i,t.combine),f=!s&&t.subscribed!==!1;y.useSyncExternalStore(y.useCallback(g=>f?o.subscribe(Co.batchCalls(g)):Qc,[o,f]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),y.useEffect(()=>{o.setQueries(i,t)},[i,t,o]);const h=c.some((g,v)=>cfe(i[v],g))?c.flatMap((g,v)=>{const b=i[v];if(b&&cfe(b,g)){const S=new fq(r,b);return ufe(b,S,a)}return[]}):[];if(h.length>0)throw Promise.all(h);const m=c.find((g,v)=>{const b=i[v];return b&&Q0t({result:g,errorResetBoundary:a,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(m?.error)throw m.error;return u(d())}function X0t(e,t,n){const r=H0t(),s=Z0t(),a=Ys(),i=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const o=a.getQueryCache().get(i.queryHash);i._optimisticResults=r?"isRestoring":"optimistic",Y0t(i),W0t(i,s,o),G0t(s);const c=!a.getQueryCache().get(i.queryHash),[u]=y.useState(()=>new t(a,i)),d=u.getOptimisticResult(i),f=!r&&e.subscribed!==!1;if(y.useSyncExternalStore(y.useCallback(p=>{const h=f?u.subscribe(Co.batchCalls(p)):Qc;return u.updateResult(),h},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),y.useEffect(()=>{u.setOptions(i)},[i,u]),cfe(i,d))throw ufe(i,u,s);if(Q0t({result:d,errorResetBoundary:s,throwOnError:i.throwOnError,query:o,suspense:i.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(i,d),i.experimental_prefetchInRender&&!kk&&UQn(d,r)&&(c?ufe(i,u,s):o?.promise)?.catch(Qc).finally(()=>{u.updateResult()}),i.notifyOnChangeProps?d:u.trackResult(d)}function St(e,t){return X0t(e,fq)}function nr(e,t){const n=Ys(),[r]=y.useState(()=>new PQn(n,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);const s=y.useSyncExternalStore(y.useCallback(i=>r.subscribe(Co.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=y.useCallback((i,o)=>{r.mutate(i,o).catch(Qc)},[r]);if(s.error&&T0e(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function Lw(e,t){return X0t(e,AQn)}function _O(e,t,n){let r=n.initialDeps??[],s,a=!0;function i(){var o,c,u;let d;n.key&&((o=n.debug)!=null&&o.call(n))&&(d=Date.now());const f=e();if(!(f.length!==r.length||f.some((m,g)=>r[g]!==m)))return s;r=f;let h;if(n.key&&((c=n.debug)!=null&&c.call(n))&&(h=Date.now()),s=t(...f),n.key&&((u=n.debug)!=null&&u.call(n))){const m=Math.round((Date.now()-d)*100)/100,g=Math.round((Date.now()-h)*100)/100,v=g/16,b=(S,w)=>{for(S=String(S);S.length<w;)S=" "+S;return S};console.info(`%c⏱ ${b(g,5)} /${b(m,5)} ms`,`
286
286
  font-size: .6rem;
287
287
  font-weight: bold;
288
- color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(s),a=!1,s}return i.updateDeps=o=>{r=o},i}function d5e(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const VQn=(e,t)=>Math.abs(e-t)<1.01,HQn=(e,t,n)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)}},f5e=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},ZQn=e=>e,WQn=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let s=t;s<=n;s++)r.push(s);return r},GQn=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const s=i=>{const{width:o,height:c}=i;t({width:Math.round(o),height:Math.round(c)})};if(s(f5e(n)),!r.ResizeObserver)return()=>{};const a=new r.ResizeObserver(i=>{const o=()=>{const c=i[0];if(c?.borderBoxSize){const u=c.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(f5e(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},p5e={passive:!0},h5e=typeof window>"u"?!0:"onscrollend"in window,QQn=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let s=0;const a=e.options.useScrollendEvent&&h5e?()=>{}:HQn(r,()=>{t(s,!1)},e.options.isScrollingResetDelay),i=d=>()=>{const{horizontal:f,isRtl:p}=e.options;s=f?n.scrollLeft*(p&&-1||1):n.scrollTop,a(),t(s,d)},o=i(!0),c=i(!1);n.addEventListener("scroll",o,p5e);const u=e.options.useScrollendEvent&&h5e;return u&&n.addEventListener("scrollend",c,p5e),()=>{n.removeEventListener("scroll",o),u&&n.removeEventListener("scrollend",c)}},YQn=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},XQn=(e,{adjustments:t=0,behavior:n},r)=>{var s,a;const i=e+t;(a=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||a.call(s,{[r.options.horizontal?"left":"top"]:i,behavior:n})};class KQn{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var n,r,s;return((s=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(a=>{const i=()=>{const o=a.target,c=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(o,a,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=null},observe:s=>{var a;return(a=r())==null?void 0:a.observe(s,{box:"border-box"})},unobserve:s=>{var a;return(a=r())==null?void 0:a.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,s])=>{typeof s>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ZQn,rangeExtractor:WQn,onChange:()=>{},measureElement:YQn,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...n}},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=_O(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,a)=>{this.scrollAdjustments=0,this.scrollDirection=a?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=a,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const s=new Map,a=new Map;for(let i=r-1;i>=0;i--){const o=n[i];if(s.has(o.lane))continue;const c=a.get(o.lane);if(c==null||o.end>c.end?a.set(o.lane,o):o.end<c.end&&s.set(o.lane,!0),s.size===this.options.lanes)break}return a.size===this.options.lanes?Array.from(a.values()).sort((i,o)=>i.end===o.end?i.index-o.index:i.end-o.end)[0]:void 0},this.getMeasurementOptions=_O(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(n,r,s,a,i,o,c)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:s,getItemKey:a,enabled:i,lanes:o,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=_O(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:s,getItemKey:a,enabled:i,lanes:o,laneAssignmentMode:c},u)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const h of this.laneAssignments.keys())h>=n&&this.laneAssignments.delete(h);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const d=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const f=this.measurementsCache.slice(0,d),p=new Array(o).fill(void 0);for(let h=0;h<d;h++){const m=f[h];m&&(p[m.lane]=h)}for(let h=d;h<n;h++){const m=a(h),g=this.laneAssignments.get(h);let v,b;const S=c==="estimate"||u.has(m);if(g!==void 0&&this.options.lanes>1){v=g;const E=p[v],T=E!==void 0?f[E]:void 0;b=T?T.end+this.options.gap:r+s}else{const E=this.options.lanes===1?f[h-1]:this.getFurthestMeasurement(f,h);b=E?E.end+this.options.gap:r+s,v=E?E.lane:h%this.options.lanes,this.options.lanes>1&&S&&this.laneAssignments.set(h,v)}const w=u.get(m),_=typeof w=="number"?w:this.options.estimateSize(h),O=b+_;f[h]={index:h,start:b,size:_,end:O,key:m,lane:v},p[v]=h}return this.measurementsCache=f,f},{key:!1,debug:()=>this.options.debug}),this.calculateRange=_O(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,a)=>this.range=n.length>0&&r>0?JQn({measurements:n,outerSize:r,scrollOffset:s,lanes:a}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=_O(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,a,i)=>a===null||i===null?[]:n({startIndex:a,endIndex:i,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const a=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,s-a),o=Math.min(this.options.count-1,s+a);return n>=i&&n<=o}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((i,o)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(o))});return}const r=this.indexFromElement(n),s=this.options.getItemKey(r),a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var s;const a=this.measurementsCache[n];if(!a)return;const i=this.itemSizeCache.get(a.key)??a.size,o=r-i;o!==0&&(((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(a,o,this):a.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(a.index),this.itemSizeCache=new Map(this.itemSizeCache.set(a.key,r)),this.notify(!1))},this.getVirtualItems=_O(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let a=0,i=n.length;a<i;a++){const o=n[a],c=r[o];s.push(c)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return d5e(r[K0t(0,r.length-1,s=>d5e(r[s]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,s=0)=>{if(!this.scrollElement)return 0;const a=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=n>=i+a?"end":"start"),r==="center"?n+=(s-a)/2:r==="end"&&(n-=a);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getSize(),a=this.getScrollOffset(),i=this.measurementsCache[n];if(!i)return;if(r==="auto")if(i.end>=a+s-this.options.scrollPaddingEnd)r="end";else if(i.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,i.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:s="auto"}={})=>{const a=this.getOffsetForAlignment(n,r),i=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:i,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:s="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const a=this.getOffsetForIndex(n,r);if(!a)return;const[i,o]=a,c=this.now();this.scrollState={index:n,align:o,behavior:s,startedAt:c,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+n,a=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:a,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((n=r[r.length-1])==null?void 0:n.end)??0;else{const a=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&a.some(o=>o===null);){const o=r[i];a[o.lane]===null&&(a[o.lane]=o.end),i--}s=Math.max(...a.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,a=1,i=s!==this.scrollState.lastTargetOffset;if(!i&&VQn(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=a){this.scrollState=null;return}}else this.scrollState.stableFrames=0,i&&(this.scrollState.lastTargetOffset=s,this.scrollState.behavior="auto",this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const K0t=(e,t,n,r)=>{for(;e<=t;){const s=(e+t)/2|0,a=n(s);if(a<r)e=s+1;else if(a>r)t=s-1;else return s}return e>0?e-1:0};function JQn({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const s=e.length-1,a=c=>e[c].start;if(e.length<=r)return{startIndex:0,endIndex:s};let i=K0t(0,s,a,n),o=i;if(r===1)for(;o<s&&e[o].end<n+t;)o++;else if(r>1){const c=Array(r).fill(0);for(;o<s&&c.some(d=>d<n+t);){const d=e[o];c[d.lane]=d.end,o++}const u=Array(r).fill(n+t);for(;i>=0&&u.some(d=>d>=n);){const d=e[i];u[d.lane]=d.start,i--}i=Math.max(0,i-i%r),o=Math.min(s,o+(r-1-o%r))}return{startIndex:i,endIndex:o}}const m5e=typeof document<"u"?y.useLayoutEffect:y.useEffect;function eYn({useFlushSync:e=!0,...t}){const n=y.useReducer(()=>({}),{})[1],r={...t,onChange:(a,i)=>{var o;e&&i?Al.flushSync(n):n(),(o=t.onChange)==null||o.call(t,a,i)}},[s]=y.useState(()=>new KQn(r));return s.setOptions(r),m5e(()=>s._didMount(),[]),m5e(()=>s._willUpdate()),s}function J0t(e){return eYn({observeElementRect:GQn,observeElementOffset:QQn,scrollToFn:XQn,...e})}function ewt(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=ewt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function twt(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=ewt(e))&&(r&&(r+=" "),r+=t);return r}const tYn=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},nYn=(e,t)=>({classGroupId:e,validator:t}),nwt=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),D8="-",g5e=[],rYn="arbitrary..",sYn=e=>{const t=iYn(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return aYn(i);const o=i.split(D8),c=o[0]===""&&o.length>1?1:0;return rwt(o,c,t)},getConflictingClassGroupIds:(i,o)=>{if(o){const c=r[i],u=n[i];return c?u?tYn(u,c):c:u||g5e}return n[i]||g5e}}},rwt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const u=rwt(e,t+1,a);if(u)return u}const i=n.validators;if(i===null)return;const o=t===0?e.join(D8):e.slice(t).join(D8),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(o))return d.classGroupId}},aYn=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?rYn+r:void 0})(),iYn=e=>{const{theme:t,classGroups:n}=e;return oYn(n,t)},oYn=(e,t)=>{const n=nwt();for(const r in e){const s=e[r];A0e(s,n,r,t)}return n},A0e=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];lYn(i,t,n,r)}},lYn=(e,t,n,r)=>{if(typeof e=="string"){cYn(e,t,n);return}if(typeof e=="function"){uYn(e,t,n,r);return}dYn(e,t,n,r)},cYn=(e,t,n)=>{const r=e===""?t:swt(t,e);r.classGroupId=n},uYn=(e,t,n,r)=>{if(fYn(e)){A0e(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(nYn(n,e))},dYn=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[o,c]=s[i];A0e(c,swt(t,o),n,r)}},swt=(e,t)=>{let n=e;const r=t.split(D8),s=r.length;for(let a=0;a<s;a++){const i=r[a];let o=n.nextPart.get(i);o||(o=nwt(),n.nextPart.set(i,o)),n=o}return n},fYn=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,pYn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(a,i)=>{n[a]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let i=n[a];if(i!==void 0)return i;if((i=r[a])!==void 0)return s(a,i),i},set(a,i){a in n?n[a]=i:s(a,i)}}},dfe="!",v5e=":",hYn=[],y5e=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),mYn=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const a=[];let i=0,o=0,c=0,u;const d=s.length;for(let g=0;g<d;g++){const v=s[g];if(i===0&&o===0){if(v===v5e){a.push(s.slice(c,g)),c=g+1;continue}if(v==="/"){u=g;continue}}v==="["?i++:v==="]"?i--:v==="("?o++:v===")"&&o--}const f=a.length===0?s:s.slice(c);let p=f,h=!1;f.endsWith(dfe)?(p=f.slice(0,-1),h=!0):f.startsWith(dfe)&&(p=f.slice(1),h=!0);const m=u&&u>c?u-c:void 0;return y5e(a,h,p,m)};if(t){const s=t+v5e,a=r;r=i=>i.startsWith(s)?a(i.slice(s.length)):y5e(hYn,!1,i,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},gYn=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let a=0;a<n.length;a++){const i=n[a],o=i[0]==="[",c=t.has(i);o||c?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(i)):s.push(i)}return s.length>0&&(s.sort(),r.push(...s)),r}},vYn=e=>({cache:pYn(e.cacheSize),parseClassName:mYn(e),sortModifiers:gYn(e),...sYn(e)}),yYn=/\s+/,bYn=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],o=e.trim().split(yYn);let c="";for(let u=o.length-1;u>=0;u-=1){const d=o[u],{isExternal:f,modifiers:p,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}=n(d);if(f){c=d+(c.length>0?" "+c:c);continue}let v=!!g,b=r(v?m.substring(0,g):m);if(!b){if(!v){c=d+(c.length>0?" "+c:c);continue}if(b=r(m),!b){c=d+(c.length>0?" "+c:c);continue}v=!1}const S=p.length===0?"":p.length===1?p[0]:a(p).join(":"),w=h?S+dfe:S,_=w+b;if(i.indexOf(_)>-1)continue;i.push(_);const O=s(b,v);for(let E=0;E<O.length;++E){const T=O[E];i.push(w+T)}c=d+(c.length>0?" "+c:c)}return c},xYn=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=awt(n))&&(s&&(s+=" "),s+=r);return s},awt=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=awt(e[r]))&&(n&&(n+=" "),n+=t);return n},b5e=(e,...t)=>{let n,r,s,a;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return n=vYn(u),r=n.cache.get,s=n.cache.set,a=o,o(c)},o=c=>{const u=r(c);if(u)return u;const d=bYn(c,n);return s(c,d),d};return a=i,(...c)=>a(xYn(...c))},wYn=[],yl=e=>{const t=n=>n[e]||wYn;return t.isThemeGetter=!0,t},iwt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,owt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,SYn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,kYn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_Yn=/\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$/,OYn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,EYn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,CYn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jx=e=>SYn.test(e),is=e=>!!e&&!Number.isNaN(Number(e)),Nx=e=>!!e&&Number.isInteger(Number(e)),BX=e=>e.endsWith("%")&&is(e.slice(0,-1)),uy=e=>kYn.test(e),lwt=()=>!0,TYn=e=>_Yn.test(e)&&!OYn.test(e),I0e=()=>!1,jYn=e=>EYn.test(e),NYn=e=>CYn.test(e),AYn=e=>!Rn(e)&&!Ln(e),IYn=e=>zw(e,dwt,I0e),Rn=e=>iwt.test(e),k1=e=>zw(e,fwt,TYn),x5e=e=>zw(e,FYn,is),RYn=e=>zw(e,hwt,lwt),PYn=e=>zw(e,pwt,I0e),w5e=e=>zw(e,cwt,I0e),MYn=e=>zw(e,uwt,NYn),BL=e=>zw(e,mwt,jYn),Ln=e=>owt.test(e),IA=e=>m_(e,fwt),$Yn=e=>m_(e,pwt),S5e=e=>m_(e,cwt),DYn=e=>m_(e,dwt),LYn=e=>m_(e,uwt),UL=e=>m_(e,mwt,!0),zYn=e=>m_(e,hwt,!0),zw=(e,t,n)=>{const r=iwt.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},m_=(e,t,n=!1)=>{const r=owt.exec(e);return r?r[1]?t(r[1]):n:!1},cwt=e=>e==="position"||e==="percentage",uwt=e=>e==="image"||e==="url",dwt=e=>e==="length"||e==="size"||e==="bg-size",fwt=e=>e==="length",FYn=e=>e==="number",pwt=e=>e==="family-name",hwt=e=>e==="number"||e==="weight",mwt=e=>e==="shadow",k5e=()=>{const e=yl("color"),t=yl("font"),n=yl("text"),r=yl("font-weight"),s=yl("tracking"),a=yl("leading"),i=yl("breakpoint"),o=yl("container"),c=yl("spacing"),u=yl("radius"),d=yl("shadow"),f=yl("inset-shadow"),p=yl("text-shadow"),h=yl("drop-shadow"),m=yl("blur"),g=yl("perspective"),v=yl("aspect"),b=yl("ease"),S=yl("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[..._(),Ln,Rn],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[Ln,Rn,c],N=()=>[jx,"full","auto",...j()],I=()=>[Nx,"none","subgrid",Ln,Rn],R=()=>["auto",{span:["full",Nx,Ln,Rn]},Nx,Ln,Rn],P=()=>[Nx,"auto",Ln,Rn],U=()=>["auto","min","max","fr",Ln,Rn],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],L=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...j()],z=()=>[jx,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],q=()=>[jx,"screen","full","dvw","lvw","svw","min","max","fit",...j()],H=()=>[jx,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],D=()=>[e,Ln,Rn],Y=()=>[..._(),S5e,w5e,{position:[Ln,Rn]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",DYn,IYn,{size:[Ln,Rn]}],W=()=>[BX,IA,k1],G=()=>["","none","full",u,Ln,Rn],K=()=>["",is,IA,k1],re=()=>["solid","dashed","dotted","double"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[is,BX,S5e,w5e],se=()=>["","none",m,Ln,Rn],ie=()=>["none",is,Ln,Rn],Q=()=>["none",is,Ln,Rn],ne=()=>[is,Ln,Rn],oe=()=>[jx,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[uy],breakpoint:[uy],color:[lwt],container:[uy],"drop-shadow":[uy],ease:["in","out","in-out"],font:[AYn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[uy],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[uy],shadow:[uy],spacing:["px",is],text:[uy],"text-shadow":[uy],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",jx,Rn,Ln,v]}],container:["container"],columns:[{columns:[is,Rn,Ln,o]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"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:O()}],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:[Nx,"auto",Ln,Rn]}],basis:[{basis:[jx,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[is,jx,"auto","initial","none",Rn]}],grow:[{grow:["",is,Ln,Rn]}],shrink:[{shrink:["",is,Ln,Rn]}],order:[{order:[Nx,"first","last","none",Ln,Rn]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...L(),"normal"]}],"justify-self":[{"justify-self":["auto",...L()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...L(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...L(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...L(),"baseline"]}],"place-self":[{"place-self":["auto",...L()]}],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:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mbs:[{mbs:F()}],mbe:[{mbe:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"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",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...H()]}],"min-block-size":[{"min-block":["auto",...H()]}],"max-block-size":[{"max-block":["none",...H()]}],w:[{w:[o,"screen",...z()]}],"min-w":[{"min-w":[o,"screen","none",...z()]}],"max-w":[{"max-w":[o,"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",n,IA,k1]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,zYn,RYn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",BX,Rn]}],"font-family":[{font:[$Yn,PYn,t]}],"font-features":[{"font-features":[Rn]}],"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,Ln,Rn]}],"line-clamp":[{"line-clamp":[is,"none",Ln,x5e]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",Ln,Rn]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ln,Rn]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[is,"from-font","auto",Ln,k1]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[is,"auto",Ln,Rn]}],"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",Ln,Rn]}],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",Ln,Rn]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Nx,Ln,Rn],radial:["",Ln,Rn],conic:[Nx,Ln,Rn]},LYn,MYn]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],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:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-bs":[{"border-bs":K()}],"border-w-be":[{"border-be":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[is,Ln,Rn]}],"outline-w":[{outline:["",is,IA,k1]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",d,UL,BL]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",f,UL,BL]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[is,k1]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",p,UL,BL]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[is,Ln,Rn]}],"mix-blend":[{"mix-blend":[...J(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":J()}],"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":[is]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Ln,Rn]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[is]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ln,Rn]}],filter:[{filter:["","none",Ln,Rn]}],blur:[{blur:se()}],brightness:[{brightness:[is,Ln,Rn]}],contrast:[{contrast:[is,Ln,Rn]}],"drop-shadow":[{"drop-shadow":["","none",h,UL,BL]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",is,Ln,Rn]}],"hue-rotate":[{"hue-rotate":[is,Ln,Rn]}],invert:[{invert:["",is,Ln,Rn]}],saturate:[{saturate:[is,Ln,Rn]}],sepia:[{sepia:["",is,Ln,Rn]}],"backdrop-filter":[{"backdrop-filter":["","none",Ln,Rn]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[is,Ln,Rn]}],"backdrop-contrast":[{"backdrop-contrast":[is,Ln,Rn]}],"backdrop-grayscale":[{"backdrop-grayscale":["",is,Ln,Rn]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[is,Ln,Rn]}],"backdrop-invert":[{"backdrop-invert":["",is,Ln,Rn]}],"backdrop-opacity":[{"backdrop-opacity":[is,Ln,Rn]}],"backdrop-saturate":[{"backdrop-saturate":[is,Ln,Rn]}],"backdrop-sepia":[{"backdrop-sepia":["",is,Ln,Rn]}],"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",Ln,Rn]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[is,"initial",Ln,Rn]}],ease:[{ease:["linear","initial",b,Ln,Rn]}],delay:[{delay:[is,Ln,Rn]}],animate:[{animate:["none",S,Ln,Rn]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,Ln,Rn]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[Ln,Rn,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"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",Ln,Rn]}],"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",Ln,Rn]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[is,IA,k1,x5e]}],stroke:[{stroke:["none",...D()]}],"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"]}},BYn=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:s={},override:a={}})=>(SI(e,"cacheSize",t),SI(e,"prefix",n),SI(e,"experimentalParseClassName",r),qL(e.theme,a.theme),qL(e.classGroups,a.classGroups),qL(e.conflictingClassGroups,a.conflictingClassGroups),qL(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),SI(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),VL(e.theme,s.theme),VL(e.classGroups,s.classGroups),VL(e.conflictingClassGroups,s.conflictingClassGroups),VL(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),gwt(e,s,"orderSensitiveModifiers"),e),SI=(e,t,n)=>{n!==void 0&&(e[t]=n)},qL=(e,t)=>{if(t)for(const n in t)SI(e,n,t[n])},VL=(e,t)=>{if(t)for(const n in t)gwt(e,t,n)},gwt=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},UYn=(e,...t)=>typeof e=="function"?b5e(k5e,e,...t):b5e(()=>BYn(k5e(),e),...t),qYn=Object.keys({...Dy,...Tnn}),VYn=Object.keys(Pnn),HYn=Object.keys(jnn),ZYn=Object.keys(Nnn),WYn=Object.keys(Cnn),_1=Object.keys(Rnn),GYn=Object.keys(Ann).concat(Object.keys(Inn)),QYn=UYn({extend:{theme:{color:qYn,spacing:VYn,radius:WYn,leading:ZYn,shadow:GYn},classGroups:{"font-size":[{text:HYn}],h:[{h:_1}],w:[{w:_1}],size:[{size:_1}],"min-h":[{"min-h":_1}],"min-w":[{"min-w":_1}],"max-h":[{"max-h":_1}],"max-w":[{"max-w":_1}]}}});function X(...e){return QYn(twt(e))}const YYn={"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"},XYn={mono:"font-mono"},ge=({as:e="p",className:t,variant:n="ui-md",font:r,...s})=>l.jsx(e,{className:X(YYn[n],r&&XYn[r],t),...s}),Tr={colors:"transition-colors duration-normal ease-out-custom",all:"transition-all duration-normal ease-out-custom",opacity:"transition-opacity duration-normal ease-out-custom"},Fw={visible:"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},KYn={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},vwt=({src:e,name:t,size:n="sm",interactive:r=!1})=>l.jsx("div",{className:X(KYn[n],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",Tr.all,r&&"cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"),children:e?l.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):l.jsx(ge,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),JYn={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"},Be=({children:e,className:t,size:n="default",...r})=>l.jsx("span",{className:X("block",JYn[n],t),...r,children:e}),eXn={default:"text-neutral5 bg-surface4 border-border1",success:"text-notice-success-fg bg-notice-success/20 border-notice-success/20",error:"text-notice-destructive-fg bg-notice-destructive/20 border-notice-destructive/20",info:"text-notice-info-fg bg-notice-info/20 border-notice-info/20",warning:"text-notice-warning-fg bg-notice-warning/20 border-notice-warning/20"},Et=({icon:e,variant:t="default",className:n,children:r,...s})=>l.jsxs("div",{className:X("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border shrink-0",Tr.colors,e?"pl-2 pr-2.5":"px-2.5",eXn[t],n),...s,children:[e&&l.jsx(Be,{size:"sm",children:e}),r]}),tXn=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z",fill:"currentColor"})}),nXn=({children:e,label:t,className:n,listClassName:r})=>l.jsx("nav",{"aria-label":t,className:n,children:l.jsx("ol",{className:X("gap-0.5 flex items-center",r),children:e})}),rXn=({className:e,as:t,isCurrent:n,action:r,...s})=>{const a=t||"span";return l.jsxs(l.Fragment,{children:[l.jsxs("li",{className:X("flex h-full min-w-0 items-center gap-1",n?"shrink":"shrink-0"),children:[l.jsx(a,{"aria-current":n?"page":void 0,className:X("text-ui-md leading-ui-md flex min-w-0 items-center gap-2 truncate",Tr.colors,n?"text-neutral6 font-medium":"text-neutral3 hover:text-neutral5",e),...s}),r]}),!n&&l.jsx("li",{role:"separator",className:"flex h-full items-center",children:l.jsx(Be,{className:X("text-neutral2",Tr.colors),children:l.jsx(tXn,{})})})]})},_5e=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,O5e=twt,Mh=(e,t)=>n=>{var r;if(t?.variants==null)return O5e(e,n?.class,n?.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(u=>{const d=n?.[u],f=a?.[u];if(d===null)return null;const p=_5e(d)||_5e(f);return s[u][p]}),o=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...h}=d;return Object.entries(h).every(m=>{let[g,v]=m;return Array.isArray(v)?v.includes({...a,...o}[g]):{...a,...o}[g]===v})?[...u,f,p]:u},[]);return O5e(e,i,c,n?.class,n?.className)};function od({delay:e,delayDuration:t,timeout:n,skipDelayDuration:r,...s}){const a=e??t,i=n??r;return l.jsx(van,{...a!==void 0?{delay:a}:{},...i!==void 0?{timeout:i}:{},...s})}const Jn=Gsn,Qn=y.forwardRef(({asChild:e,render:t,children:n,...r},s)=>e&&y.isValidElement(n)?l.jsx(JAe,{ref:s,render:n,...r}):l.jsx(JAe,{ref:s,render:t,...r,children:n}));Qn.displayName="TooltipTrigger";const Yn=y.forwardRef(({className:e,side:t="top",sideOffset:n=8,align:r="center",alignOffset:s=0,children:a,...i},o)=>l.jsx(oan,{children:l.jsx(pan,{side:t,sideOffset:n,align:r,alignOffset:s,arrowPadding:10,className:"isolate z-[100]",children:l.jsxs(man,{ref:o,role:"tooltip",className:X("relative z-[100] flex flex-col origin-(--transform-origin) rounded-lg border border-border1 bg-surface3 px-2.5 py-1.5 text-ui-sm leading-ui-sm text-neutral5 shadow-dialog transition-[transform,scale,opacity] duration-150","data-[starting-style]:scale-95 data-[starting-style]:opacity-0","data-[ending-style]:scale-95 data-[ending-style]:opacity-0","data-[instant]:transition-none",e),...i,children:[a,l.jsx(gan,{className:X("flex","data-[side=top]:-bottom-[8px] data-[side=top]:rotate-180","data-[side=bottom]:-top-[8px]","data-[side=left]:-right-[10px] data-[side=left]:rotate-90","data-[side=right]:-left-[10px] data-[side=right]:-rotate-90"),children:l.jsx(sXn,{})})]})})}));Yn.displayName="TooltipContent";function sXn(){return l.jsxs("svg",{width:"12",height:"8",viewBox:"0 0 12 8",fill:"none",overflow:"visible",children:[l.jsx("path",{d:"M0 7L4 2Q6 0 8 2L12 7L12 8L0 8Z",className:"fill-surface3"}),l.jsx("path",{d:"M0 7.5L4 2.5Q6 0.5 8 2.5L12 7.5",className:"fill-none stroke-border1",strokeWidth:"1",strokeLinejoin:"round",strokeLinecap:"round"})]})}const no={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},pq="focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",ywt="focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",bwt="rounded-md",xwt="bg-surface2 border border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",R0e="outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",P0e="disabled:opacity-50 disabled:cursor-not-allowed",HL=X("gap-[.75em] rounded-full","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100"),M0e=Mh(X("inline-flex items-center justify-center leading-0 cursor-pointer","transition-all duration-normal ease-out-custom",P0e,R0e),{variants:{variant:{default:"bg-surface3 border border-border2 hover:bg-surface5 hover:text-neutral6 active:bg-surface6 text-neutral6",primary:"bg-neutral6 border border-transparent hover:bg-neutral6/90 active:bg-neutral6/80 text-surface1 font-medium",ghost:"bg-transparent border border-transparent hover:bg-neutral6/5 hover:text-neutral6 active:bg-neutral6/10 text-neutral4",outline:"bg-transparent border border-border1 hover:bg-surface3 hover:text-neutral6 active:bg-surface4 text-neutral5"},size:{sm:X(`${no.sm} text-ui-sm px-[.9em]`,HL),md:X(`${no.md} text-ui-md px-[.9em]`,HL),default:X(`${no.default} text-ui-md px-[1em]`,HL),lg:X(`${no.lg} text-ui-lg px-[1.15em]`,HL),"icon-sm":`${no.sm} w-form-sm rounded-full`,"icon-md":`${no.md} w-form-md rounded-full`,"icon-lg":`${no.lg} w-form-lg rounded-full`}},defaultVariants:{variant:"default",size:"default"}}),aXn={"icon-sm":"sm","icon-md":"default","icon-lg":"lg"};function wwt(e){const t=[];return Oe.Children.forEach(e,n=>{Oe.isValidElement(n)&&n.type===Oe.Fragment?t.push(...wwt(n.props.children)):t.push(n)}),t}function iXn(e){const t=wwt(e);return t.length>0&&t.every(n=>Oe.isValidElement(n))}function oXn(e){return typeof e=="string"&&e.startsWith("icon-")}const de=Oe.forwardRef(({className:e,as:t,size:n,variant:r="default",disabled:s,children:a,tooltip:i,"aria-label":o,...c},u)=>{const d=t||"button",f=oXn(n),p=n??"default",h=!f&&iXn(a),m=o??((f||h)&&typeof i=="string"?i:void 0),g=f?l.jsx(Be,{size:aXn[n],children:a}):a,v=l.jsx(d,{ref:u,disabled:s,"aria-label":m,className:X(M0e({variant:r,size:p}),h&&"[&>svg]:opacity-75",e),...c,children:g});return i?l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:v}),l.jsx(Yn,{children:i})]}):v});de.displayName="Button";function lXn(e,t=5){if(!e?.properties)return[];const n=[];function r(s,a,i){if(i>t)return;const o=Array.isArray(s.type)?s.type.join(" | "):s.type;if(n.push({path:a,label:a,description:s.description??s.title,type:o}),s.properties)for(const[c,u]of Object.entries(s.properties))r(u,`${a}.${c}`,i+1);if(s.items?.properties)for(const[c,u]of Object.entries(s.items.properties))r(u,`${a}[].${c}`,i+1)}for(const[s,a]of Object.entries(e.properties))r(a,s,1);return n}function cXn(e){const t=lXn(e);return Fat({override:[uXn(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function uXn(e){return t=>{const r=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!r)return null;const s=r[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 o=i.map(c=>({label:c.path,displayLabel:c.path,detail:c.type,info:c.description,apply:(u,d,f,p)=>{const g=u.state.sliceDoc(p,p+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:f,to:p,insert:g},selection:{anchor:f+g.length}})}}));return{from:a,options:o,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const dXn=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,fXn=hn.mark({class:"cm-variable-highlight"}),E5e=new eat({regexp:dXn,decoration:()=>fXn}),pXn=Hi.fromClass(class{decorations;constructor(e){this.decorations=E5e.createDeco(e)}update(e){this.decorations=E5e.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),hXn=pXn,Swt=({className:e,toastOptions:t,...n})=>l.jsx(Wyn,{...n,closeButton:!0,richColors:!0,className:X("mastra-toaster",e),toastOptions:{duration:5e3,...t}}),hq=(e,t)=>Array.isArray(e)?e.map(t):t(e),Fe=(e,t={})=>{if(Array.isArray(e))return e.map(n=>jm(n,t));if(Oe.isValidElement(e)||typeof e=="string")return jm(e,t);throw new Error("Invalid message type")};Fe.success=(e,t={})=>hq(e,n=>jm.success(n,t));Fe.error=(e,t={})=>hq(e,n=>jm.error(n,t));Fe.warning=(e,t={})=>hq(e,n=>jm.warning(n,t));Fe.info=(e,t={})=>hq(e,n=>jm.info(n,t));Fe.custom=(e,t={})=>jm(e,t);Fe.dismiss=e=>jm.dismiss(e);Fe.promise=({myPromise:e,loadingMessage:t,successMessage:n,errorMessage:r,onSuccess:s,onError:a,options:i={}})=>jm.promise(e,{loading:t??"Loading...",success:o=>(s?.(o),n),error:o=>(a?.(o),r||(o instanceof Error?o.message:"Error...")),...i});function Rm({text:e,copyMessage:t="Copied to clipboard!"}){const[n,r]=y.useState(!1),s=y.useRef(null),a=y.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{Fe.success(t),r(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{r(!1)},2e3)}).catch(()=>{Fe.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:n,handleCopy:a}}function la({content:e,copyMessage:t,tooltip:n="Copy to clipboard",size:r="sm",className:s}){const[a,i]=y.useState(!1),{handleCopy:o}=Rm({text:e,copyMessage:t}),c=()=>{o(),i(!0),setTimeout(()=>i(!1),2e3)};return l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx(de,{onClick:c,type:"button",size:r,className:s,"aria-label":a?"Copied!":n,children:a?l.jsx(jb,{}):l.jsx(llt,{})})}),l.jsx(Yn,{children:a?"Copied!":n})]})}const mXn="mastra-theme",gXn="mastra-playground-store",ffe=e=>e==="dark"||e==="light"||e==="system",vXn=e=>{try{const t=e.getItem(gXn);if(!t)return;const r=JSON.parse(t)?.state?.theme;return ffe(r)?r:void 0}catch{return}},yXn=(e=mXn)=>({get(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(e);if(ffe(t))return t;const n=vXn(window.localStorage);return n?(window.localStorage.setItem(e,n),n):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 n=r=>{if(r.key===e){if(r.newValue===null){t(null);return}ffe(r.newValue)&&t(r.newValue)}};return window.addEventListener("storage",n),()=>window.removeEventListener("storage",n)}}),kwt=y.createContext(null),_wt="(prefers-color-scheme: dark)",bXn=typeof window>"u"?y.useEffect:y.useLayoutEffect,Owt=()=>typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia(_wt).matches?"dark":"light",Ewt=e=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia(_wt);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},xXn=(e,t)=>{e.classList.remove(t==="dark"?"light":"dark"),e.classList.add(t)},Cwt=({children:e,defaultTheme:t="system",storageKey:n,target:r})=>{const s=y.useMemo(()=>yXn(n),[n]),a=y.useRef(null),[i,o]=y.useState(()=>s.get()??t),c=y.useSyncExternalStore(Ewt,Owt,()=>"dark");y.useEffect(()=>s.subscribe(f=>o(f??t)),[s,t]);const u=i==="system"?c:i;bXn(()=>{const f=r??(typeof window>"u"?null:window.document.documentElement);a.current&&a.current!==f&&a.current.classList.remove("dark","light"),f&&xXn(f,u),a.current=f},[u,r]);const d=y.useMemo(()=>({theme:i,resolvedTheme:u,systemTheme:c,setTheme:f=>{o(f),s.set(f)}}),[i,u,c,s]);return l.jsx(kwt.Provider,{value:d,children:e})},wXn=()=>{},$j=()=>{const e=y.useContext(kwt),t=y.useSyncExternalStore(Ewt,Owt,()=>"dark");return y.useMemo(()=>e??{theme:"system",resolvedTheme:t,systemTheme:t,setTheme:wXn},[e,t])};function SXn(){const e=lj({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:[ae.className,ae.propertyName],color:"var(--neutral6)"},{tag:ae.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[ae.heading1,ae.heading2,ae.heading3,ae.heading4,ae.heading5,ae.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:ae.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:ae.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:ae.link,color:"var(--accent3)",textDecoration:"underline"},{tag:ae.url,color:"var(--accent3)"},{tag:ae.monospace,color:"var(--neutral6)"},{tag:ae.strikethrough,textDecoration:"line-through"},{tag:ae.quote,fontStyle:"italic",color:"var(--neutral2)"}]}),t=xt.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 kXn(){const e=xt.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=Um.define([{tag:[ae.comment,ae.bracket],color:"var(--neutral2)"},{tag:[ae.string,ae.meta,ae.regexp],color:"var(--accent1)"},{tag:[ae.atom,ae.bool,ae.special(ae.variableName)],color:"var(--accent6)"},{tag:[ae.keyword,ae.operator,ae.tagName],color:"var(--accent2)"},{tag:[ae.function(ae.propertyName),ae.propertyName],color:"var(--accent5)"},{tag:[ae.definition(ae.variableName),ae.function(ae.variableName),ae.className,ae.attributeName],color:"var(--accent3)"},{tag:[ae.variableName,ae.number],color:"var(--accent5)"},{tag:[ae.name,ae.quote],color:"var(--accent1)"},{tag:ae.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[ae.heading1,ae.heading2,ae.heading3,ae.heading4,ae.heading5,ae.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:[ae.emphasis],fontStyle:"italic",color:"var(--neutral6)"},{tag:[ae.strong],fontWeight:"bold",color:"var(--neutral6)"},{tag:ae.link,color:"var(--accent3)",textDecoration:"underline"},{tag:ae.url,color:"var(--accent3)"},{tag:ae.monospace,color:"var(--neutral6)"},{tag:ae.strikethrough,textDecoration:"line-through"},{tag:[ae.deleted],color:"var(--accent2)"},{tag:ae.invalid,color:"var(--error)"},{tag:[ae.standard(ae.tagName)],color:"var(--accent1)"}]);return[e,Cw(t)]}const Bb=()=>{const e=$j().resolvedTheme==="dark";return y.useMemo(()=>e?SXn():kXn(),[e])},As=y.forwardRef(({data:e,value:t,onChange:n,showCopyButton:r=!0,className:s,language:a="json",highlightVariables:i=!1,placeholder:o,schema:c,autoFocus:u,lineNumbers:d=!0,editable:f,...p},h)=>{const m=Bb(),g=e?JSON.stringify(e,null,2):t??"",v=y.useMemo(()=>{const b=[];return a==="json"?b.push(Vf):a==="markdown"&&(b.push(Tve({base:ek,codeLanguages:lot})),b.push(xt.lineWrapping)),i&&a==="markdown"&&b.push(hXn),c&&a==="markdown"&&b.push(cXn(c)),f===!1&&b.push(ts.readOnly.of(!0)),b},[a,i,c,f]);return l.jsxs("div",{className:X("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...p,children:[r&&l.jsx(la,{content:g,className:"absolute top-2 right-2 z-20"}),l.jsx(pu,{ref:h,value:g,theme:m,extensions:v,onChange:n,editable:f,"aria-label":"Code editor",placeholder:o,height:"100%",style:{height:"100%"},autoFocus:u,basicSetup:{lineNumbers:d}})]})});async function Twt(e,t){const{codeToTokens:n,bundledLanguages:r}=await rt(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-BDW6ei8o.js");return{codeToTokens:a,bundledLanguages:i}},__vite__mapDeps([23,1]),import.meta.url);if(!(t in r))return null;const{tokens:s}=await n(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return s}function oi({iconSlot:e,titleSlot:t,descriptionSlot:n,actionSlot:r,className:s,as:a="h3"}){return l.jsxs("div",{className:X("flex flex-col items-center justify-center text-center py-10 px-6","transition-opacity duration-normal ease-out-custom",s),children:[e&&l.jsx("div",{className:"mb-4",children:e}),l.jsx(a,{className:"font-medium text-neutral5 text-ui-md",children:t}),n&&l.jsx("p",{className:"mt-1.5 text-neutral3 text-ui-sm max-w-md",children:n}),r&&l.jsx("div",{className:"mt-5",children:r})]})}const Go=e=>l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 8.82265 8.51434",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M6.76646 6.16953C6.56909 6.10559 6.40521 5.96585 6.31087 5.78107C6.21653 5.5963 6.19945 5.38161 6.2634 5.18424C6.32735 4.98687 6.46708 4.82299 6.65186 4.72865C6.83663 4.63431 7.05132 4.61723 7.24869 4.68118C7.45933 4.74996 7.6849 4.75913 7.90043 4.70768C8.11596 4.65622 8.31306 4.54615 8.46992 4.38963C8.62678 4.23312 8.73729 4.03626 8.78921 3.82084C8.84114 3.60542 8.83246 3.37984 8.76414 3.16904C8.69582 2.95825 8.57052 2.77046 8.4021 2.62646C8.23368 2.48246 8.02871 2.38785 7.80986 2.35311C7.59101 2.31836 7.36681 2.34484 7.16208 2.4296C6.95734 2.51436 6.78004 2.6541 6.64979 2.83337C6.39274 3.18567 6.05613 3.47228 5.66736 3.66987C5.27858 3.86747 4.84864 3.97046 4.41254 3.97046C3.97643 3.97046 3.54649 3.86747 3.15772 3.66987C2.76895 3.47228 2.43234 3.18567 2.17528 2.83337C2.04528 2.65368 1.86807 2.51346 1.66329 2.42826C1.45852 2.34306 1.23415 2.3162 1.01505 2.35065C0.795944 2.3851 0.590648 2.47951 0.421892 2.62344C0.253137 2.76736 0.127507 2.95519 0.0589124 3.16611C-0.00968171 3.37703 -0.0185632 3.60282 0.0332514 3.81848C0.0850661 4.03414 0.195555 4.23125 0.352484 4.38799C0.509413 4.54472 0.706659 4.65497 0.92238 4.70652C1.1381 4.75808 1.36388 4.74892 1.57472 4.68007C1.77224 4.61634 1.98698 4.63369 2.1717 4.72829C2.35643 4.82289 2.49601 4.987 2.55973 5.18452C2.62346 5.38203 2.60611 5.59677 2.51151 5.7815C2.41691 5.96623 2.2528 6.10581 2.05528 6.16953C1.84456 6.23788 1.65684 6.36317 1.51288 6.53155C1.36893 6.69993 1.27434 6.90485 1.23959 7.12364C1.20483 7.34242 1.23126 7.56656 1.31596 7.77126C1.40065 7.97597 1.5403 8.15326 1.71948 8.28354C1.89865 8.41382 2.11036 8.49201 2.33121 8.50946C2.55205 8.52692 2.77342 8.48296 2.97083 8.38244C3.16825 8.28193 3.33402 8.12877 3.44981 7.93992C3.56561 7.75106 3.62692 7.53386 3.62697 7.31233C3.62697 7.10501 3.70933 6.90619 3.85592 6.7596C4.00251 6.613 4.20134 6.53065 4.40865 6.53065C4.61596 6.53065 4.81479 6.613 4.96138 6.7596C5.10797 6.90619 5.19033 7.10501 5.19033 7.31233C5.19027 7.53399 5.25152 7.75136 5.36731 7.94037C5.4831 8.12939 5.64892 8.2827 5.84642 8.38334C6.04392 8.48399 6.26541 8.52804 6.4864 8.51063C6.70738 8.49322 6.91924 8.41502 7.09854 8.28469C7.27785 8.15436 7.41761 7.97698 7.50237 7.77216C7.58713 7.56734 7.61359 7.34307 7.57882 7.12414C7.54404 6.90522 7.44939 6.70018 7.30534 6.53171C7.16128 6.36323 6.97344 6.23789 6.76257 6.16953H6.76646Z",fill:"currentColor"}),l.jsx("path",{d:"M4.41198 2.40337C5.07565 2.40337 5.61367 1.86536 5.61367 1.20168C5.61367 0.538012 5.07565 0 4.41198 0C3.74831 0 3.2103 0.538012 3.2103 1.20168C3.2103 1.86536 3.74831 2.40337 4.41198 2.40337Z",fill:"currentColor"})]}),_Xn=e=>l.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"})]}),$0e=e=>l.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"})]}),D0e=e=>l.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"})]}),OXn=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),jwt=e=>l.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("g",{clipPath:"url(#clip0_21999_22095)",children:l.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"})}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_21999_22095",children:l.jsx("rect",{width:"14",height:"14",fill:"currentColor",transform:"translate(0.5 0.75)"})})})]}),Nwt=e=>l.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsxs("g",{clipPath:"url(#clip0_21999_20513)",children:[l.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"}),l.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"}),l.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"}),l.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"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_21999_20513",children:l.jsx("rect",{width:"12.2487",height:"12.2487",fill:"white",transform:"translate(1.375 1.28516)"})})})]}),EXn=e=>l.jsxs("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M3.84766 10.1444H9.11328",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"}),l.jsx("path",{d:"M11.1395 12.9536L1.82388 12.9535C1.4557 12.9535 1.15723 12.655 1.15723 12.2868V5.69147C1.15723 5.49041 1.24796 5.30009 1.40417 5.17351L6.07746 1.38658C6.32202 1.18841 6.67185 1.18829 6.91654 1.38629L11.5589 5.14286C11.7153 5.26944 11.8062 5.45989 11.8062 5.66111V12.287C11.8062 12.6552 11.5077 12.9536 11.1395 12.9536Z",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"})]}),CXn=e=>l.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"}),l.jsx("rect",{x:"7.92188",y:"6.46759",width:"1.41089",height:"1.56773",rx:"0.705445",fill:"currentColor"}),l.jsx("rect",{x:"10.4258",y:"4.35107",width:"1.41089",height:"3.72998",rx:"0.705445",fill:"currentColor"}),l.jsx("rect",{x:"12.9287",y:"2.23419",width:"1.41089",height:"5.75781",rx:"0.705445",fill:"currentColor"})]}),TXn=e=>l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 10.0412 8.39395",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M0 0.916539C0 0.410349 0.410349 0 0.916539 0C1.42273 0 1.83308 0.410349 1.83308 0.916539C1.83308 1.42273 1.42273 1.83308 0.916539 1.83308C0.410349 1.83308 0 1.42273 0 0.916539Z",fill:"currentColor"}),l.jsx("path",{d:"M2.88569 0.916539C2.88569 0.410349 3.29604 0 3.80223 0C4.30842 0 4.71877 0.410349 4.71877 0.916539C4.71877 1.42273 4.30842 1.83308 3.80223 1.83308C3.29604 1.83308 2.88569 1.42273 2.88569 0.916539Z",fill:"currentColor"}),l.jsx("path",{d:"M5.77139 0.916539C5.77139 0.410349 6.18174 0 6.68793 0H9.12465C9.63084 0 10.0412 0.410349 10.0412 0.916539C10.0412 1.42273 9.63084 1.83308 9.12465 1.83308H6.68793C6.18174 1.83308 5.77139 1.42273 5.77139 0.916539Z",fill:"currentColor"}),l.jsx("path",{d:"M0 4.19696C0 3.69077 0.410351 3.28042 0.916541 3.28042C1.42273 3.28042 1.83308 3.69077 1.83308 4.19696C1.83308 4.70315 1.42273 5.1135 0.916541 5.1135C0.410351 5.1135 0 4.70315 0 4.19696Z",fill:"currentColor"}),l.jsx("path",{d:"M2.8857 4.19694C2.8857 3.69075 3.29605 3.2804 3.80224 3.2804C4.30843 3.2804 4.71877 3.69075 4.71877 4.19694C4.71877 4.70313 4.30843 5.11348 3.80224 5.11348C3.29605 5.11348 2.8857 4.70313 2.8857 4.19694Z",fill:"currentColor"}),l.jsx("path",{d:"M5.77139 4.19694C5.77139 3.69075 6.18174 3.2804 6.68793 3.2804H9.12466C9.63085 3.2804 10.0412 3.69075 10.0412 4.19694C10.0412 4.70313 9.63085 5.11348 9.12466 5.11348H6.68793C6.18174 5.11348 5.77139 4.70313 5.77139 4.19694Z",fill:"currentColor"}),l.jsx("path",{d:"M0 7.47738C0 6.97119 0.410351 6.56084 0.916541 6.56084C1.42273 6.56084 1.83308 6.97119 1.83308 7.47738C1.83308 7.98357 1.42273 8.39392 0.916541 8.39392C0.410351 8.39392 0 7.98357 0 7.47738Z",fill:"currentColor"}),l.jsx("path",{d:"M2.8857 7.47741C2.8857 6.97122 3.29605 6.56087 3.80224 6.56087C4.30843 6.56087 4.71877 6.97122 4.71877 7.47741C4.71877 7.9836 4.30843 8.39395 3.80224 8.39395C3.29605 8.39395 2.8857 7.9836 2.8857 7.47741Z",fill:"currentColor"}),l.jsx("path",{d:"M5.77139 7.47741C5.77139 6.97122 6.18174 6.56087 6.68793 6.56087H9.12466C9.63085 6.56087 10.0412 6.97122 10.0412 7.47741C10.0412 7.9836 9.63085 8.39395 9.12466 8.39395H6.68793C6.18174 8.39395 5.77139 7.9836 5.77139 7.47741Z",fill:"currentColor"})]}),mq=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),jXn=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 11.185 11.185",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.57258 2.71626C9.57245 2.19794 9.14778 1.77075 8.61819 1.77075H2.56605C2.0377 1.77075 1.61179 2.19752 1.61165 2.71626V6.51162C1.61179 7.02856 2.03401 7.45487 2.5616 7.45713L3.12802 7.45935V9.21487L5.52178 7.55857L5.66764 7.45713H8.61819C9.14653 7.45713 9.57245 7.03036 9.57258 6.51162V2.71626ZM10.7099 6.51162C10.7097 7.66541 9.76766 8.59441 8.61819 8.59441H6.0223L3.51081 10.3336C3.25841 10.5083 2.86505 10.6555 2.4809 10.4558C2.09483 10.2551 1.99075 9.84577 1.99075 9.53473V8.51222C1.11705 8.26321 0.474488 7.46395 0.474378 6.51162V2.71626C0.474511 1.56248 1.41657 0.633479 2.56605 0.633479H8.61819C9.77051 0.633479 10.7097 1.56448 10.7099 2.71626V6.51162Z",fill:"currentColor"})}),Awt=e=>l.jsx("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),Cc=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 11.185 11.185",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.0293 1.16491L4.81958 0.801671L4.81955 0.801686L5.0293 1.16491ZM5.75391 1.16491L5.96365 0.801686L5.96363 0.801671L5.75391 1.16491ZM9.04492 3.06531L9.25474 2.70212L9.25467 2.70208L9.04492 3.06531ZM9.40723 7.49304L9.82666 7.49332V7.49304H9.40723ZM9.04492 8.11999L8.8352 7.75675L8.83518 7.75676L9.04492 8.11999ZM5.75391 10.0204L5.96363 10.3836L5.96365 10.3836L5.75391 10.0204ZM5.0293 10.0204L4.81955 10.3836L4.81963 10.3837L5.0293 10.0204ZM1.73828 8.11999L1.94803 7.75676L1.948 7.75675L1.73828 8.11999ZM1.37598 7.49304H0.956538L0.956538 7.49332L1.37598 7.49304ZM1.73828 3.06531L1.94802 3.42854L1.94803 3.42853L1.73828 3.06531ZM5.59277 3.38366L5.59283 2.96423H5.59277V3.38366ZM3.38379 5.59167L2.96435 5.59159V5.59167H3.38379ZM5.59277 7.80066V8.2201H5.59283L5.59277 7.80066ZM7.80078 5.59167H8.22022V5.59159L7.80078 5.59167ZM5.0293 1.16491L5.23902 1.52816C5.33331 1.47372 5.44989 1.47372 5.54419 1.52816L5.75391 1.16491L5.96363 0.801671C5.60978 0.59738 5.17342 0.59738 4.81958 0.801671L5.0293 1.16491ZM5.75391 1.16491L5.54416 1.52814L8.83518 3.42853L9.04492 3.06531L9.25467 2.70208L5.96365 0.801686L5.75391 1.16491ZM9.04492 3.06531L8.83511 3.42849C8.92979 3.48319 8.98779 3.5839 8.98779 3.69226H9.40723H9.82666C9.82666 3.28328 9.60799 2.90619 9.25474 2.70212L9.04492 3.06531ZM9.40723 3.69226H8.98779V7.49304H9.40723H9.82666V3.69226H9.40723ZM9.40723 7.49304L8.98779 7.49276C8.98772 7.6015 8.92949 7.70231 8.8352 7.75675L9.04492 8.11999L9.25464 8.48324C9.60821 8.2791 9.82639 7.90167 9.82666 7.49332L9.40723 7.49304ZM9.04492 8.11999L8.83518 7.75676L5.54416 9.65715L5.75391 10.0204L5.96365 10.3836L9.25467 8.48322L9.04492 8.11999ZM5.75391 10.0204L5.54419 9.65714C5.44996 9.71154 5.33331 9.71156 5.23897 9.65711L5.0293 10.0204L4.81963 10.3837C5.17339 10.5878 5.60977 10.5879 5.96363 10.3836L5.75391 10.0204ZM5.0293 10.0204L5.23904 9.65715L1.94803 7.75676L1.73828 8.11999L1.52854 8.48322L4.81955 10.3836L5.0293 10.0204ZM1.73828 8.11999L1.948 7.75675C1.85371 7.70231 1.79549 7.6015 1.79541 7.49276L1.37598 7.49304L0.956538 7.49332C0.956809 7.90167 1.17499 8.2791 1.52856 8.48324L1.73828 8.11999ZM1.37598 7.49304H1.79542V3.69226H1.37598H0.956538V7.49304H1.37598ZM1.37598 3.69226H1.79542C1.79542 3.58378 1.85339 3.48318 1.94802 3.42854L1.73828 3.06531L1.52854 2.70207C1.17507 2.90617 0.956538 3.2833 0.956538 3.69226H1.37598ZM1.73828 3.06531L1.94803 3.42853L5.23904 1.52814L5.0293 1.16491L4.81955 0.801686L1.52854 2.70208L1.73828 3.06531ZM5.59277 3.38366V2.96423C4.14162 2.96423 2.96463 4.14015 2.96435 5.59159L3.38379 5.59167L3.80323 5.59175C3.80342 4.60382 4.60458 3.8031 5.59277 3.8031V3.38366ZM3.38379 5.59167H2.96435C2.96435 7.04322 4.14132 8.2201 5.59277 8.2201V7.80066V7.38122C4.6046 7.38122 3.80323 6.57991 3.80323 5.59167H3.38379ZM5.59277 7.80066L5.59283 8.2201C7.04429 8.2199 8.22022 7.04294 8.22022 5.59167H7.80078H7.38134C7.38134 6.57999 6.58061 7.38108 5.59272 7.38122L5.59277 7.80066ZM7.80078 5.59167L8.22022 5.59159C8.21994 4.14043 7.04398 2.96443 5.59283 2.96423L5.59277 3.38366L5.59272 3.8031C6.58062 3.80324 7.38115 4.60374 7.38134 5.59175L7.80078 5.59167Z",fill:"currentColor"})}),Dj=e=>l.jsx(byn,{...e}),Iwt=e=>l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 9.45892 8.88606",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M8.53702 7.36403C8.98547 7.36403 9.34918 7.70502 9.34918 8.12535C9.34906 8.54559 8.9854 8.88606 8.53702 8.88606H5.6839C5.23552 8.88606 4.87186 8.54559 4.87174 8.12535C4.87174 7.70502 5.23545 7.36403 5.6839 7.36403H8.53702Z",fill:"currentColor"}),l.jsx("path",{d:"M8.53702 3.67209C8.98547 3.67209 9.34918 4.01309 9.34918 4.43342C9.34911 4.8537 8.98543 5.19413 8.53702 5.19413H5.6839C5.23549 5.19413 4.87181 4.8537 4.87174 4.43342C4.87174 4.01309 5.23545 3.67209 5.6839 3.67209H8.53702Z",fill:"currentColor"}),l.jsx("path",{d:"M8.67155 0C9.10635 2.06584e-05 9.45892 0.341006 9.45892 0.761326C9.45878 1.18153 9.10627 1.52201 8.67155 1.52203H2.88163C2.4469 1.52203 2.0944 1.18154 2.09427 0.761326C2.09427 0.340993 2.44681 3.80132e-08 2.88163 0H8.67155Z",fill:"currentColor"}),l.jsx("path",{d:"M0.757606 0.760086V4.01122H3.50594V4.76883H0.759466L0.762566 5.4291C0.76837 6.70703 1.8058 7.73972 3.08374 7.73973H3.67953V8.49796H3.08374C1.38863 8.49795 0.0120204 7.1273 0.00433981 5.4322L0 4.39188V0.760086H0.757606Z",fill:"currentColor"})]}),Tc=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 9.08789 8.97168",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M1.98047 5.00977C2.17347 5.00977 2.33002 5.16639 2.33008 5.35938C2.33008 5.55242 2.17351 5.70898 1.98047 5.70898C1.27292 5.70915 0.699436 6.2827 0.699219 6.99023C0.699219 7.69795 1.27279 8.2723 1.98047 8.27246C2.68829 8.27246 3.2627 7.69805 3.2627 6.99023C3.26291 6.79738 3.4194 6.64063 3.6123 6.64062C3.80503 6.64084 3.9617 6.79751 3.96191 6.99023C3.96191 8.08413 3.07437 8.97168 1.98047 8.97168C0.886706 8.97152 0 8.08403 0 6.99023C0.000217392 5.89662 0.886841 5.00993 1.98047 5.00977ZM7.10742 5.00977C8.20105 5.00992 9.08767 5.89662 9.08789 6.99023C9.08789 8.08404 8.20119 8.97152 7.10742 8.97168C6.01359 8.97159 5.12598 8.08408 5.12598 6.99023C5.1262 6.79757 5.28294 6.64092 5.47559 6.64062C5.66849 6.64063 5.82497 6.79738 5.8252 6.99023C5.8252 7.698 6.39968 8.27238 7.10742 8.27246C7.81511 8.2723 8.38867 7.69796 8.38867 6.99023C8.38845 6.2827 7.81497 5.70914 7.10742 5.70898C6.91445 5.7089 6.75781 5.55236 6.75781 5.35938C6.75788 5.16644 6.91449 5.00985 7.10742 5.00977ZM4.54395 0C5.44471 0 6.17465 0.730134 6.1748 1.63086C6.1748 2.27964 5.79613 2.83941 5.24768 3.102C5.0501 3.1966 4.89355 3.37979 4.89355 3.59885V4.08919C4.89355 4.21279 4.94266 4.33133 5.03006 4.41873L6.80071 6.18938C6.87996 6.26863 6.99535 6.29199 7.10742 6.29199C7.49331 6.29206 7.80642 6.60438 7.80664 6.99023C7.80664 7.37627 7.49344 7.68938 7.10742 7.68945C6.72134 7.68945 6.4082 7.37632 6.4082 6.99023C6.40827 6.87818 6.38483 6.76276 6.3056 6.68353L4.8726 5.25053C4.69056 5.06849 4.39541 5.06853 4.21343 5.25061L2.78139 6.68339C2.70211 6.76271 2.67963 6.87809 2.67969 6.99023C2.67969 7.37632 2.36655 7.68945 1.98047 7.68945C1.59452 7.68929 1.28125 7.37622 1.28125 6.99023C1.28146 6.60443 1.59466 6.29215 1.98047 6.29199C2.09246 6.29199 2.2079 6.26771 2.28711 6.18854L4.05776 4.41874C4.1452 4.33133 4.19434 4.21276 4.19434 4.08912V3.59881C4.19434 3.37977 4.03781 3.19659 3.84026 3.10199C3.29183 2.83937 2.91309 2.2796 2.91309 1.63086C2.91324 0.730162 3.64322 4.61864e-05 4.54395 0Z",fill:"currentColor"})}),Pm=e=>l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 9.52233 10.4982",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M2.39065 4.27882L4.93898 1.73049C5.10578 1.56368 5.37622 1.56368 5.54303 1.73049C5.70983 1.89729 5.70983 2.16773 5.54303 2.33454L2.9947 4.88287C2.53924 5.33834 2.53929 6.0768 2.99475 6.53226C3.45022 6.9877 4.18863 6.98771 4.64409 6.53226L7.19242 3.98393C7.35922 3.81713 7.62967 3.81714 7.79647 3.98393C7.96328 4.15074 7.96328 4.42118 7.79647 4.58798L5.24814 7.13631C4.45907 7.92537 3.17978 7.92536 2.39071 7.13631C1.60163 6.34724 1.60158 5.0679 2.39065 4.27882Z",fill:"currentColor"}),l.jsx("path",{d:"M3.50354 5.43862C3.5236 5.3983 3.55044 5.36049 3.58404 5.32688L6.06565 2.84527C6.52112 2.3898 6.52112 1.65128 6.06565 1.19581C5.61018 0.740366 4.87172 0.740412 4.41626 1.19587L0.729138 4.88287C0.562334 5.04967 0.291892 5.04968 0.125089 4.88287C-0.0416875 4.71607 -0.0417052 4.44562 0.125089 4.27882L3.81221 0.591824C4.60128 -0.197241 5.88062 -0.197289 6.6697 0.591765C7.12856 1.05062 7.32058 1.67529 7.24578 2.27292C7.84449 2.19687 8.47073 2.38872 8.93052 2.84849C9.7196 3.63757 9.7196 4.91697 8.93052 5.70605L8.20316 6.44191L6.20449 8.44058C5.83765 8.80741 5.83765 9.40219 6.20449 9.76902C6.37128 9.93582 6.37129 10.2063 6.20449 10.3731C6.03769 10.5399 5.76724 10.5399 5.60044 10.3731C4.9 9.67263 4.9 8.53697 5.60044 7.83653L7.59911 5.83786L8.32647 5.102C8.78194 4.64653 8.78194 3.90801 8.32647 3.45254C7.871 2.9971 7.13254 2.99714 6.67707 3.4526L4.17576 5.95392C4.00896 6.12072 3.73851 6.12071 3.57171 5.95392C3.43204 5.81425 3.40932 5.60193 3.50354 5.43862Z",fill:"currentColor"})]}),gq=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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 pfe(e){return l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 10.123 10.123",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.50195 1.53809H5.62109V0H6.75098V1.53809H7.5293L7.64258 1.54395C8.19939 1.60066 8.63379 2.0708 8.63379 2.64258V3.37305H10.123V4.50195H8.63379V5.62109H10.123V6.75H8.63379V7.57812L8.62891 7.69141C8.57589 8.2109 8.16211 8.62387 7.64258 8.67676L7.5293 8.68262H6.75098V10.123H5.62109V8.68262H4.50195V10.123H3.37305V8.68262H2.59375L2.48047 8.67676C1.96102 8.62383 1.54817 8.21082 1.49512 7.69141L1.48926 7.57812V6.75H0V5.62109H1.48926V4.50195H0V3.37305H1.48926V2.64258C1.48926 2.07084 1.92371 1.60071 2.48047 1.54395L2.59375 1.53809H3.37305V0H4.50195V1.53809ZM2.61914 7.55273H7.50488V2.66699H2.61914V7.55273Z",fill:"currentColor"})})}const Rwt=e=>l.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:[l.jsxs("g",{clipPath:"url(#clip0_1480_1723)",children:[l.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"}),l.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"}),l.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"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_1480_1723",children:l.jsx("rect",{width:"180",height:"107.763",fill:"white",transform:"translate(0.0625)"})})})]}),NXn=e=>l.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:l.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"})}),AXn=e=>l.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:l.jsx("g",{transform:"translate(0,2)",children:l.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"})})}),Pwt=e=>l.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:l.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}})}),IXn=e=>l.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"17",height:"18",fill:"none",...e,children:[l.jsx("mask",{id:"mask0_174_2406",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"17",height:"18",children:l.jsx("path",{d:"M17 0.5H0V17.5H17V0.5Z",fill:"white"})}),l.jsxs("g",{mask:"url(#mask0_174_2406)",children:[l.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"}),l.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"}),l.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"})]})]}),RXn=e=>l.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:[l.jsx("mask",{id:"mask0_4345_1846",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"160",height:"59",style:{maskType:"luminance"},children:l.jsx("path",{d:"M0.273438 0.219727H159.216V58.1817H0.273438V0.219727Z",fill:"white"})}),l.jsx("g",{mask:"url(#mask0_4345_1846)",children:l.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"})})]}),PXn=e=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 34 21",fill:"none",...e,children:l.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"})}),MXn=e=>l.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:[l.jsx("rect",{x:"15",y:"1",width:"32",height:"32",fill:"#FFCD00",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"143",y:"1",width:"32",height:"32",fill:"#FFCD00",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"15",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"47",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"111",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"143",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"15",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"47",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"79",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"111",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"143",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"15",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"79",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"143",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"15",y:"129",width:"32",height:"32",fill:"#FF0006",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"143",y:"129",width:"32",height:"32",fill:"#FF0006",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{y:"1",width:"16",height:"160",fill:"black"}),l.jsx("rect",{x:"63",y:"97",width:"16",height:"32",fill:"black"}),l.jsx("rect",{x:"95",y:"33",width:"16",height:"32",fill:"black"}),l.jsx("rect",{x:"127",y:"1",width:"16",height:"32",fill:"black"}),l.jsx("rect",{x:"127",y:"97",width:"16",height:"64",fill:"black"})]}),$Xn=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"128",height:"113",viewBox:"0 0 128 113",children:[l.jsxs("g",{clipPath:"url(#clip0_236_138)",...e,children:[l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_236_138",children:l.jsx("rect",{width:"128",height:"112.635",fill:"white"})})})]}),C5e=e=>l.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:l.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"})}),DXn=e=>l.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:l.jsxs("g",{children:[l.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"}),l.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"}),l.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"}),l.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"})]})}),LXn=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 9.55888 8.30616",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M0 7.18794V1.11823C-4.80684e-08 0.5005 0.5005 2.79299e-06 1.11823 0H3.17924C3.48658 0 3.78038 0.126314 3.99163 0.349532L5.09347 1.5135C5.14625 1.56923 5.21948 1.60085 5.29623 1.60088H8.44065C9.05838 1.60088 9.55888 2.10206 9.55888 2.7198V7.18794C9.55888 7.80567 9.05838 8.30616 8.44065 8.30616H1.11823C0.500524 8.30614 4.41663e-06 7.80565 0 7.18794ZM0.838331 7.18794C0.838332 7.34235 0.963819 7.46781 1.11823 7.46783H8.44065C8.59509 7.46783 8.72055 7.34237 8.72055 7.18794V2.7198C8.72055 2.56536 8.59509 2.4399 8.44065 2.4399H5.29623C4.98896 2.43986 4.69506 2.31353 4.48384 2.09037L3.38268 0.925714C3.32987 0.869949 3.25604 0.838331 3.17924 0.838331H1.11823C0.963799 0.838334 0.838331 0.963798 0.838331 1.11823V7.18794Z",fill:"currentColor"})}),zXn=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 11.185 11.185",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.13324 2.7965L2.18203 2.84592C1.82485 3.28847 1.55755 3.79653 1.39512 4.34155H2.38658C2.56011 3.8986 2.82333 3.49631 3.15971 3.15992C3.4961 2.82353 3.8984 2.56031 4.34134 2.38679V1.39533C3.79632 1.55775 3.28827 1.82506 2.84571 2.18224L2.7963 2.13345L1.85801 1.19516L1.52648 0.863634L0.863426 1.52669L1.19495 1.85822L2.13324 2.7965ZM9.00275 8.33927C9.35991 7.89671 9.62722 7.38866 9.78966 6.84365H8.7982C8.62471 7.28661 8.3615 7.68892 8.02511 8.02531C7.68871 8.3617 7.2864 8.62491 6.84344 8.79841V9.78987C7.38847 9.62746 7.89652 9.36015 8.33907 9.00296L8.38848 9.05175L9.32677 9.99003L9.6583 10.3216L10.3214 9.65851L9.98983 9.32698L9.05154 8.38869L9.00275 8.33927ZM9.00275 2.84592C9.35995 3.28846 9.62726 3.79651 9.78966 4.34155H8.7982C8.62467 3.8986 8.36145 3.49631 8.02506 3.15992C7.68868 2.82353 7.28638 2.56031 6.84344 2.38679V1.39533C7.38846 1.55775 7.89651 1.82506 8.33907 2.18224L8.38848 2.13345L9.32677 1.19516L9.6583 0.863634L10.3214 1.52669L9.98983 1.85822L9.05154 2.7965L9.00275 2.84592ZM1.39512 6.84365H2.38658C2.56011 7.28659 2.82333 7.68888 3.15971 8.02527C3.4961 8.36166 3.8984 8.62488 4.34134 8.79841V9.78987C3.79631 9.62747 3.28825 9.36016 2.84571 9.00296L2.7963 9.05175L1.85801 9.99003L1.52648 10.3216L0.863426 9.65851L1.19495 9.32698L2.13324 8.38869L2.18203 8.33927C1.82485 7.89672 1.55755 7.38867 1.39512 6.84365ZM5.59239 6.84365C5.92419 6.84365 6.2424 6.71184 6.47701 6.47722C6.71163 6.2426 6.84344 5.9244 6.84344 5.5926C6.84344 5.2608 6.71163 4.94259 6.47701 4.70797C6.2424 4.47336 5.92419 4.34155 5.59239 4.34155C5.26059 4.34155 4.94238 4.47336 4.70776 4.70797C4.47315 4.94259 4.34134 5.2608 4.34134 5.5926C4.34134 5.9244 4.47315 6.2426 4.70776 6.47722C4.94238 6.71184 5.26059 6.84365 5.59239 6.84365Z",fill:"currentColor"})}),FXn=e=>l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 8.94379 8.92126",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M6.13251 5.43413C6.51629 5.43413 6.82744 5.74533 6.82748 6.1291C6.82748 6.5129 6.51631 6.82407 6.13251 6.82407C5.74877 6.824 5.43754 6.51286 5.43754 6.1291C5.43759 5.74537 5.74879 5.4342 6.13251 5.43413Z",fill:"currentColor"}),l.jsx("path",{d:"M5.92771 2.29722C6.13122 2.09376 6.46147 2.09379 6.665 2.29722C6.86843 2.50075 6.86846 2.831 6.665 3.03451L3.03724 6.66227C2.83373 6.86578 2.5035 6.86572 2.29995 6.66227C2.0965 6.45872 2.09644 6.12849 2.29995 5.92498L5.92771 2.29722Z",fill:"currentColor"}),l.jsx("path",{d:"M2.842 2.12791C3.22572 2.12799 3.53694 2.43914 3.53696 2.82288C3.53696 3.20664 3.22573 3.51777 2.842 3.51785C2.45819 3.51785 2.14703 3.20668 2.14703 2.82288C2.14705 2.4391 2.45821 2.12791 2.842 2.12791Z",fill:"currentColor"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.38455 0.00887484C8.26052 0.0979278 8.94379 0.837945 8.94379 1.73742V7.18384C8.94369 8.08322 8.26046 8.82334 7.38455 8.91238L7.20705 8.92126H1.73742L1.55992 8.91238C0.683828 8.82351 0.000101213 8.08336 0 7.18384V1.73742C0 0.837813 0.683761 0.0977507 1.55992 0.00887484L1.73742 0H7.20705L7.38455 0.00887484ZM1.73742 0.839013C1.24121 0.839013 0.839013 1.24121 0.839013 1.73742V7.18384C0.839121 7.67996 1.24128 8.08293 1.73742 8.08293H7.20705C7.70305 8.08276 8.10535 7.67985 8.10546 7.18384V1.73742C8.10546 1.24131 7.70312 0.83918 7.20705 0.839013H1.73742Z",fill:"currentColor"})]}),BXn=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 8.64637 9.45103",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M7.80735 5.87241C7.63209 5.97219 7.43696 6.06166 7.22844 6.13866C6.46456 6.42068 5.43714 6.58649 4.32296 6.58649C3.20873 6.58649 2.18135 6.4207 1.41747 6.13866C1.20889 6.06164 1.01385 5.97223 0.838558 5.87241V7.59003C0.838558 7.62341 0.855765 7.70759 1.00172 7.83512C1.14707 7.96201 1.38219 8.09563 1.70829 8.21605C2.3572 8.45563 3.28149 8.61268 4.32296 8.61269C5.36456 8.61269 6.28937 8.45568 6.9383 8.21605C7.26428 8.09566 7.49888 7.96198 7.64419 7.83512C7.79024 7.70754 7.80735 7.62342 7.80735 7.59003V5.87241ZM7.80735 3.00789C7.63214 3.10763 7.4369 3.19647 7.22844 3.27345C6.46455 3.55549 5.43719 3.72129 4.32296 3.72129C3.20868 3.72128 2.18136 3.55552 1.41747 3.27345C1.20896 3.19645 1.01381 3.10766 0.838558 3.00789V4.72551C0.838558 4.7589 0.855657 4.84301 1.00172 4.97059C1.14707 5.09749 1.38219 5.23111 1.70829 5.35153C2.3572 5.59109 3.28154 5.74747 4.32296 5.74748C5.36456 5.74748 6.28937 5.59116 6.9383 5.35153C7.26432 5.23112 7.49887 5.09747 7.64419 4.97059C7.7536 4.87505 7.79089 4.80404 7.80257 4.76033L7.80735 4.72551V3.00789ZM7.80735 1.86099C7.80735 1.82758 7.79045 1.74291 7.64419 1.61522C7.49887 1.48838 7.26421 1.35534 6.9383 1.23497C6.28937 0.995339 5.36456 0.838331 4.32296 0.838331C3.28149 0.83834 2.3572 0.995383 1.70829 1.23497C1.38219 1.35539 1.14707 1.48832 1.00172 1.61522C0.855475 1.7429 0.838558 1.82758 0.838558 1.86099C0.838673 1.89462 0.855968 1.97882 1.00172 2.10607C1.14707 2.23297 1.38219 2.3659 1.70829 2.48632C2.3572 2.7259 3.28149 2.88295 4.32296 2.88296C5.36456 2.88296 6.28937 2.72595 6.9383 2.48632C7.26421 2.36595 7.49887 2.23291 7.64419 2.10607C7.78996 1.97881 7.80724 1.89462 7.80735 1.86099ZM8.64637 7.59003C8.64637 7.95465 8.44458 8.25006 8.1958 8.46728C7.94608 8.68529 7.60876 8.86274 7.22844 9.00318C6.46455 9.28522 5.43718 9.45102 4.32296 9.45102C3.20869 9.45101 2.18135 9.28525 1.41747 9.00318C1.03715 8.86274 0.699831 8.68529 0.450113 8.46728C0.201377 8.25007 0.000227451 7.9546 0.000227451 7.59003V1.86099C0.000227451 1.49643 0.201388 1.20095 0.450113 0.983742C0.699831 0.765728 1.03715 0.588275 1.41747 0.447838C2.18136 0.165769 3.20868 8.74396e-06 4.32296 0C5.43719 0 6.46455 0.165797 7.22844 0.447838C7.60876 0.588275 7.94608 0.765728 8.1958 0.983742C8.44457 1.20096 8.64637 1.49638 8.64637 1.86099V7.59003Z",fill:"currentColor"})}),Mwt=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 9.83952 9.3295",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.67171 0.838331H6.70163V4.05307L9.68767 8.09999C10.0634 8.6093 9.69869 9.32932 9.06643 9.3295H0.772551C0.140289 9.3293 -0.223777 8.60929 0.151995 8.09999L3.13804 4.05307V0.838331H2.17136V0H7.67171V0.838331ZM3.97705 4.32955L3.89513 4.44015L2.34681 6.53802H7.49285L5.94453 4.44015L5.86261 4.32955V0.860859H3.97705V4.32955Z",fill:"currentColor"})}),UXn=e=>l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 8.98824 8.33142",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M5.70011e-05 6.409V0H1.04865V6.409C1.04875 6.89152 1.43994 7.28283 1.92248 7.28283H8.3581V8.33142H1.92248C0.860814 8.33142 0.000149953 7.47065 5.70011e-05 6.409Z",fill:"currentColor"}),l.jsx("path",{d:"M8.08006 0.945713C8.27714 0.733828 8.6087 0.72151 8.82077 0.918405C9.03289 1.11551 9.04518 1.44767 8.84808 1.6598L6.08595 4.63218C5.90127 4.83085 5.59525 4.85557 5.38074 4.68953L4.03177 3.64571L2.74765 5.07183C2.55386 5.28688 2.22206 5.30441 2.00694 5.11074C1.79189 4.91695 1.77435 4.58515 1.96803 4.37003L3.57915 2.58278L3.65357 2.51451C3.83887 2.37494 4.09997 2.37165 4.28982 2.51861L5.64358 3.56652L8.08006 0.945713Z",fill:"currentColor"})]}),hp=({children:e,className:t,onClick:n})=>l.jsx("div",{tabIndex:n?0:void 0,onKeyDown:r=>{n&&(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),n?.())},className:X("flex gap-3 group/entity bg-surface3 rounded-xl border border-border1 py-3 px-4",n&&"cursor-pointer hover:bg-surface4 transition-all",t),onClick:n,children:e}),$wt=({children:e,className:t,style:n})=>l.jsx(Be,{size:"lg",className:X("text-neutral3 mt-1 shrink-0",t),style:n,children:e}),mp=({children:e,className:t})=>l.jsx(ge,{as:"p",variant:"ui-lg",className:X("text-neutral6 font-medium",t),children:e}),gp=({children:e,className:t})=>l.jsx(ge,{as:"div",variant:"ui-sm",className:X("text-neutral3",t),children:e}),vp=({children:e,className:t})=>l.jsx("div",{className:X("flex-1 w-full",t),children:e});function na({resource:e,title:t,description:n,actionSlot:r,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 l.jsx(oi,{className:s,iconSlot:l.jsx(Be,{size:"lg",className:"text-neutral3",children:l.jsx(ryn,{})}),titleSlot:t??a,descriptionSlot:n??i,actionSlot:r})}function ua({title:e,description:t,className:n}){const[r,s]=y.useState(!1),a=Ze(),i=y.useCallback(async()=>{try{s(!0);const{baseUrl:o="",apiPrefix:c}=a.options||{},u=(c||"/api").trim(),d=(u.startsWith("/")?u:`/${u}`).replace(/\/$/,""),f=new URLSearchParams({redirect_uri:window.location.href}),p=`${o}${d}/auth/sso/login?${f}`,h=await fetch(p,{credentials:"include",headers:{"Content-Type":"application/json"}});if(h.ok){const m=await h.json();window.location.href=m.url}}finally{s(!1)}},[a]);return l.jsx(oi,{className:n,iconSlot:l.jsx(Be,{size:"lg",className:"text-neutral3",children:l.jsx(Vvn,{})}),titleSlot:e??"Session Expired",descriptionSlot:t??"Your session has expired. Please log in again to continue.",actionSlot:l.jsx(de,{variant:"default",onClick:i,disabled:r,children:r?"Redirecting...":"Log in"})})}const L0e=({children:e,border:t=!0,className:n})=>l.jsx("header",{className:X("h-header-default z-50 flex w-full items-center gap-4 bg-transparent px-3",{"border-b border-border1":t},n),children:e}),Dwt=({children:e})=>l.jsx(ge,{as:"h1",variant:"ui-md",className:"text-neutral6 flex items-center gap-2",children:e}),qXn=({children:e})=>l.jsx("div",{className:"ml-auto flex items-center gap-3",children:e}),Ky=e=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 34 21",fill:"none",...e,children:l.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"})}),VXn={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},HXn=({className:e,children:t,size:n="default",style:r})=>l.jsx("table",{className:X("w-full",VXn[n],e),style:r,children:t}),ZXn=({className:e,children:t})=>l.jsx("thead",{children:l.jsx("tr",{className:X("h-table-header border-b border-border1 bg-surface2/80",e),children:t})}),WXn=({className:e,children:t,...n})=>l.jsx("th",{className:X("text-neutral2 text-ui-xs h-full whitespace-nowrap text-left font-medium uppercase tracking-wide first:pl-3 last:pr-3",e),...n,children:t}),GXn=({className:e,children:t,...n})=>l.jsx("tbody",{className:X("",e),...n,children:t}),QXn=y.forwardRef(({className:e,children:t,selected:n=!1,style:r,onClick:s,isActive:a=!1,...i},o)=>{const c=y.useRef(null);y.useEffect(()=>{o&&(typeof o=="function"?o(c.current):o.current=c.current)},[o]),y.useEffect(()=>{a&&c.current&&(c.current.focus(),c.current.scrollIntoView({block:"nearest"}))},[a]);const u=d=>{d.key==="Enter"&&s&&s()};return l.jsx("tr",{className:X("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",n&&"bg-surface4",s&&"cursor-pointer",e),style:r,onClick:s,ref:c,tabIndex:s?0:void 0,onKeyDown:u,"data-active":a||void 0,...i,children:t})}),YXn=({className:e,children:t,...n})=>l.jsx("td",{className:X("text-neutral5 first:pl-3 last:pr-3",e),...n,children:l.jsx("div",{className:X("flex h-full w-full shrink-0 items-center"),children:t})}),XXn=Mh(X("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:X(xwt,R0e,P0e),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"}}),iu=y.forwardRef(({className:e,size:t,testId:n,variant:r,error:s,...a},i)=>l.jsx("textarea",{className:X(XXn({variant:r,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":n,ref:i,"aria-invalid":s,...a}));iu.displayName="Textarea";const KXn=axn,JXn=ixn,Lwt=oxn;function Gt({open:e,onOpenChange:t,children:n}){return l.jsx(KXn,{open:e,onOpenChange:t,children:n})}const z0e=y.forwardRef(({className:e,...t},n)=>l.jsx(Klt,{ref:n,className:X("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));z0e.displayName=Klt.displayName;const zwt=y.forwardRef(({className:e,...t},n)=>l.jsxs(Lwt,{children:[l.jsx(z0e,{}),l.jsx(Jlt,{ref:n,className:X("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})]}));zwt.displayName=Jlt.displayName;const Fwt=({className:e,...t})=>l.jsx("div",{className:X("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});Fwt.displayName="AlertDialogHeader";const Bwt=({className:e,...t})=>l.jsx("div",{className:X("flex flex-col-reverse gap-1.5 px-4 py-2.5 sm:flex-row sm:justify-end",e),...t});Bwt.displayName="AlertDialogFooter";const Uwt=({className:e,...t})=>l.jsx("div",{className:X("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});Uwt.displayName="AlertDialogBody";const qwt=y.forwardRef(({className:e,...t},n)=>l.jsx(nct,{ref:n,className:X("text-ui-md font-medium",e),...t}));qwt.displayName=nct.displayName;const Vwt=y.forwardRef(({className:e,...t},n)=>l.jsx(rct,{ref:n,className:X("text-ui-sm text-neutral3",e),...t}));Vwt.displayName=rct.displayName;const Hwt=y.forwardRef(({className:e,...t},n)=>l.jsx(ect,{ref:n,className:X(M0e({variant:"primary",size:"default"}),e),...t}));Hwt.displayName=ect.displayName;const Zwt=y.forwardRef(({className:e,...t},n)=>l.jsx(tct,{ref:n,className:X(M0e({variant:"default",size:"default"}),e),...t}));Zwt.displayName=tct.displayName;Gt.Trigger=JXn;Gt.Portal=Lwt;Gt.Overlay=z0e;Gt.Content=zwt;Gt.Header=Fwt;Gt.Footer=Bwt;Gt.Body=Uwt;Gt.Title=qwt;Gt.Description=Vwt;Gt.Action=Hwt;Gt.Cancel=Zwt;const oo=y.forwardRef(({className:e,...t},n)=>l.jsx(Yve,{ref:n,className:X("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",Tr.all,"hover:border-neutral5 hover:shadow-md",pq,"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:l.jsx(oct,{className:X("flex items-center justify-center text-current","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:l.jsx(jb,{className:"h-3.5 w-3.5 stroke-3"})})}));oo.displayName=Yve.displayName;const Mm=mxn,wh=Oe.forwardRef(({className:e,children:t,...n},r)=>l.jsx(Kve,{ref:r,className:X("-outline-offset-2",Tr.colors,Fw.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-state=open]>svg]:rotate-90",e),...n,children:t}));wh.displayName=Kve.displayName;const Sh=Oe.forwardRef(({className:e,children:t,...n},r)=>l.jsx(eye,{ref:r,className:X("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),...n,children:t}));Sh.displayName=eye.displayName;const Cr={root:"flex flex-col gap-1.5",trigger:X("inline-flex w-full min-w-32 select-none items-center justify-between gap-1.5 whitespace-nowrap cursor-pointer","rounded-lg border bg-transparent px-2.5 text-ui-smd leading-ui-sm text-neutral4","outline-none transition-colors duration-normal ease-out-custom","focus:outline-none focus-visible:outline-none","disabled:cursor-not-allowed disabled:opacity-50"),triggerDefault:X("border-border1","hover:bg-surface2 hover:text-neutral6 hover:border-border2 active:bg-surface3","focus-visible:border-border2","data-[popup-open]:bg-surface3 data-[popup-open]:text-neutral6 data-[popup-open]:border-border2"),triggerGhost:X("border-transparent","hover:bg-surface2 hover:text-neutral6 active:bg-surface3","data-[popup-open]:bg-surface3 data-[popup-open]:text-neutral6"),triggerLink:X("border-transparent px-0","hover:text-neutral6","data-[popup-open]:text-neutral6"),triggerError:"border-accent2 hover:border-accent2 focus-visible:border-accent2",chevron:"ml-2 h-4 w-4 shrink-0 text-neutral3 opacity-70",placeholder:"text-neutral3",popup:X("min-w-(--anchor-width) w-max max-w-(--available-width) rounded-xl border border-border1 bg-surface3 text-neutral4","shadow-dialog","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:X("flex items-center border-b border-border1 px-2.5 py-1.5",Tr.colors),searchIcon:X("mr-2 h-3.5 w-3.5 shrink-0 text-neutral3",Tr.colors),searchInput:X("flex h-7 w-full rounded-md bg-transparent py-1 text-ui-smd leading-ui-sm text-neutral6","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-none focus:outline-none focus-visible:outline-none",Tr.colors),empty:"not-empty:block hidden py-4 text-center text-ui-smd text-neutral3",list:"max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1",item:X("group/item relative flex cursor-pointer select-none items-center gap-2 rounded-md","pl-2.5 pr-2 py-1.5 min-h-8","text-ui-smd leading-ui-sm text-neutral4","outline-none focus:outline-none focus-visible:outline-none",Tr.colors,"data-highlighted:bg-surface4 data-highlighted:text-neutral6","data-selected:text-neutral6"),itemMulti:X("relative flex cursor-pointer select-none items-center gap-2.5 rounded-md","pl-2 pr-2.5 py-1.5 min-h-8","text-ui-smd leading-ui-sm text-neutral4","outline-none focus:outline-none focus-visible:outline-none",Tr.colors,"data-highlighted:bg-surface4 data-highlighted:text-neutral6","data-selected:text-neutral6"),itemRightSlot:"ml-auto flex items-center gap-2 shrink-0",checkContainer:"flex h-4 w-4 shrink-0 items-center justify-center text-accent1",checkIcon:"h-3.5 w-3.5",checkbox:"flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border",checkboxSelected:"bg-accent1 border-accent1",checkboxUnselected:"border-border2",checkboxIcon:"h-3 w-3 text-surface1",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-ui-sm text-neutral3 truncate",optionEnd:"ml-auto flex items-center shrink-0",error:"text-ui-sm text-accent2"},eKn={default:Cr.triggerDefault,ghost:Cr.triggerGhost,link:Cr.triggerLink};function jc({options:e,value:t,onValueChange:n,placeholder:r="Select option...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:o=!1,variant:c="default",size:u="default",open:d,onOpenChange:f,container:p,error:h}){const m=e.find(v=>v.value===t)??null,g=v=>{v&&n?.(v.value)};return l.jsxs("div",{className:Cr.root,children:[l.jsxs(Sct,{items:e,value:m,onValueChange:g,disabled:o,open:d,onOpenChange:f,children:[l.jsxs(Nct,{className:X(Cr.trigger,eKn[c],no[u],h&&Cr.triggerError,i),children:[l.jsxs("span",{className:"flex items-center gap-2 min-w-0 flex-1",children:[m?.start,l.jsx("span",{className:"truncate",children:l.jsx($xn,{placeholder:r})})]}),l.jsx(qM,{className:Cr.chevron})]}),l.jsx(Pct,{container:p,children:l.jsx(Mct,{align:"start",sideOffset:4,className:Cr.positioner,children:l.jsxs($ct,{className:Cr.popup,children:[l.jsxs("div",{className:Cr.searchContainer,children:[l.jsx(FC,{className:Cr.searchIcon}),l.jsx(jct,{className:Cr.searchInput,placeholder:s})]}),l.jsx(Bct,{className:Cr.empty,children:a}),l.jsx(Ict,{className:Cr.list,children:v=>l.jsxs(Fct,{value:v,className:Cr.item,children:[v.start,l.jsxs("span",{className:Cr.optionText,children:[l.jsx("span",{className:Cr.optionLabel,children:v.label}),v.description&&l.jsx("span",{className:Cr.optionDescription,children:v.description})]}),l.jsxs("span",{className:Cr.itemRightSlot,children:[v.end?l.jsx("div",{className:Cr.optionEnd,children:v.end}):null,l.jsx("span",{className:Cr.checkContainer,children:l.jsx(p0n,{children:l.jsx(jb,{className:Cr.checkIcon})})})]})]},v.value)})]})})})]}),h&&l.jsx("span",{className:Cr.error,children:h})]})}function Wwt({options:e,value:t=[],onValueChange:n,placeholder:r="Select options...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:o=!1,size:c="md",open:u,onOpenChange:d,container:f,error:p}){const h=e.filter(v=>t.includes(v.value)),m=v=>{v&&n?.(v.map(b=>b.value))},g=h.length===0?r:`${h.length} selected`;return l.jsxs("div",{className:Cr.root,children:[l.jsxs(Sct,{multiple:!0,items:e,value:h,onValueChange:m,disabled:o,open:u,onOpenChange:d,children:[l.jsxs(Nct,{className:X(Cr.trigger,no[c],p&&Cr.triggerError,i),children:[l.jsx("span",{className:X("truncate",h.length===0&&Cr.placeholder),children:g}),l.jsx(qM,{className:Cr.chevron})]}),l.jsx(Pct,{container:f,children:l.jsx(Mct,{align:"start",sideOffset:4,className:Cr.positioner,children:l.jsxs($ct,{className:Cr.popup,children:[l.jsxs("div",{className:Cr.searchContainer,children:[l.jsx(FC,{className:Cr.searchIcon}),l.jsx(jct,{className:Cr.searchInput,placeholder:s})]}),l.jsx(Bct,{className:Cr.empty,children:a}),l.jsx(Ict,{className:Cr.list,children:v=>{const b=t.includes(v.value);return l.jsxs(Fct,{value:v,className:Cr.itemMulti,children:[l.jsx("span",{className:X(Cr.checkbox,b?Cr.checkboxSelected:Cr.checkboxUnselected),children:b&&l.jsx(jb,{className:Cr.checkboxIcon})}),l.jsxs("span",{className:Cr.optionContent,children:[v.start,l.jsxs("span",{className:Cr.optionText,children:[l.jsx("span",{className:Cr.optionLabel,children:v.label}),v.description&&l.jsx("span",{className:Cr.optionDescription,children:v.description})]}),v.end?l.jsx("div",{className:Cr.optionEnd,children:v.end}):null]})]},v.value)}})]})})})]}),p&&l.jsx("span",{className:Cr.error,children:p})]})}const Lr=WM,Gwt=Llt,tKn=GM,nKn=XM,Qwt=y.forwardRef(({className:e,...t},n)=>l.jsx(fj,{ref:n,className:X("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));Qwt.displayName=fj.displayName;const Ir=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(tKn,{children:[l.jsx(Qwt,{}),l.jsxs(pj,{ref:r,className:X("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),...n,children:[t,l.jsx(XM,{asChild:!0,children:l.jsx(de,{variant:"ghost",size:"sm",className:"absolute top-3 right-3","aria-label":"Close",children:l.jsx(Fd,{})})})]})]}));Ir.displayName=pj.displayName;const zr=({className:e,...t})=>l.jsx("div",{className:X("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});zr.displayName="DialogHeader";const ap=({className:e,...t})=>l.jsx("div",{className:X("flex flex-col-reverse gap-1.5 px-4 py-2.5 sm:flex-row sm:justify-end",e),...t});ap.displayName="DialogFooter";const ns=({className:e,...t})=>l.jsx("div",{className:X("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});ns.displayName="DialogBody";const Rr=y.forwardRef(({className:e,...t},n)=>l.jsx(QM,{ref:n,className:X("text-ui-md font-medium",e),...t}));Rr.displayName=QM.displayName;const ha=y.forwardRef(({className:e,...t},n)=>l.jsx(YM,{ref:n,className:X("sr-only",e),...t}));ha.displayName=YM.displayName;const Ywt=y.forwardRef(({className:e,...t},n)=>l.jsx(Gd,{ref:n,className:X("flex h-full w-full flex-col overflow-hidden rounded-xl bg-surface3 text-neutral4",e),...t}));Ywt.displayName=Gd.displayName;const rKn=({children:e,title:t="Command Palette",description:n="Search for commands and actions",...r})=>{const s=y.useCallback((i,o)=>{const c=i.toLowerCase();return o.toLowerCase().split(/\s+/).filter(Boolean).every(p=>c.includes(p))?1:0},[]),a=y.useCallback(i=>{i.stopPropagation()},[]);return l.jsx(Lr,{...r,children:l.jsxs(Ir,{className:"overflow-hidden p-0",children:[l.jsx(Rr,{className:"sr-only",children:t}),l.jsx(ha,{className:"sr-only",children:n}),l.jsx(Ywt,{filter:s,onKeyDown:a,className:X("**:[[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})]})})},Xwt=y.forwardRef(({className:e,...t},n)=>l.jsxs("div",{className:X("flex items-center border-b border-border1 px-3",Tr.colors),"cmdk-input-wrapper":"",children:[l.jsx(FC,{className:X("mr-2 h-4 w-4 shrink-0 text-neutral3",Tr.colors)}),l.jsx(Gd.Input,{ref:n,className:X("flex h-10 w-full rounded-md bg-transparent py-3 text-ui-smd leading-ui-sm text-neutral6","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-none focus:outline-none focus-visible:outline-none",Tr.colors,e),...t})]}));Xwt.displayName=Gd.Input.displayName;const Kwt=y.forwardRef(({className:e,...t},n)=>l.jsx(Gd.List,{ref:n,className:X("max-h-dropdown-max-height overflow-y-auto overflow-x-hidden",e),...t}));Kwt.displayName=Gd.List.displayName;const Jwt=y.forwardRef((e,t)=>l.jsx(Gd.Empty,{ref:t,className:"py-6 text-center text-ui-smd text-neutral3",...e}));Jwt.displayName=Gd.Empty.displayName;const Vx=y.forwardRef(({className:e,...t},n)=>l.jsx(Gd.Group,{ref:n,className:X("overflow-hidden p-1 text-neutral4","**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:pt-1.5 **:[[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:text-ui-xs [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:uppercase **:[[cmdk-group-heading]]:tracking-wider **:[[cmdk-group-heading]]:text-neutral3",e),...t}));Vx.displayName=Gd.Group.displayName;const q1=y.forwardRef(({className:e,...t},n)=>l.jsx(Gd.Separator,{ref:n,className:X("-mx-1 h-px bg-border1",e),...t}));q1.displayName=Gd.Separator.displayName;const wl=y.forwardRef(({className:e,...t},n)=>l.jsx(Gd.Item,{ref:n,className:X("relative flex cursor-pointer select-none items-center gap-2.5 rounded-lg px-2 py-1.5 text-ui-smd leading-ui-sm text-neutral4","outline-none focus:outline-none focus-visible:outline-none",Tr.colors,"data-[selected=true]:bg-surface4 data-[selected=true]:text-neutral6","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-neutral3 data-[selected=true]:[&_svg]:text-neutral6",e),...t}));wl.displayName=Gd.Item.displayName;const e1t=({className:e,...t})=>l.jsx("span",{className:X("ml-auto text-ui-xs tabular-nums tracking-wider text-neutral3",e),...t});e1t.displayName="CommandShortcut";const Ii=xwn,Ri=wwn,wi=y.forwardRef(({className:e,children:t,size:n="default",...r},s)=>l.jsxs(Sut,{ref:s,className:X("inline-flex w-full cursor-pointer select-none items-center justify-between gap-1.5 whitespace-nowrap",no[n],"rounded-lg border border-border1 bg-transparent px-2.5 text-ui-smd leading-ui-sm text-neutral4","outline-none transition-colors duration-normal ease-out-custom","hover:bg-surface3 hover:text-neutral6 hover:border-border2 active:bg-surface4","focus:outline-none focus-visible:outline-none focus-visible:border-border2","data-[state=open]:bg-surface3 data-[state=open]:text-neutral6 data-[state=open]:border-border2","data-[placeholder]:text-neutral3","disabled:cursor-not-allowed disabled:opacity-50","[&>span]:truncate",e),...r,children:[t,l.jsx(Swn,{asChild:!0,children:l.jsx(Dve,{className:X("h-4 w-4 shrink-0 text-neutral3 opacity-70",Tr.colors)})})]}));wi.displayName=Sut.displayName;const Si=y.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>l.jsx(kwn,{children:l.jsx(kut,{ref:s,className:X("relative z-50 min-w-32 max-h-dropdown-max-height overflow-y-auto overflow-x-hidden rounded-xl border border-border1 bg-surface3 text-neutral4 shadow-dialog 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-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:l.jsx(_wn,{className:X("p-1",n==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t})})}));Si.displayName=kut.displayName;const vs=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(_ut,{ref:r,className:X("relative flex w-full cursor-pointer select-none items-center gap-2.5 rounded-lg py-1.5 pl-2 pr-8 text-neutral4 text-ui-smd leading-ui-sm","outline-none focus:outline-none focus-visible:outline-none",Tr.colors,"hover:bg-surface4 hover:text-neutral6","focus:bg-surface4 focus:text-neutral6","data-[highlighted]:bg-surface4 data-[highlighted]:text-neutral6","data-[state=checked]:text-neutral6","data-disabled:pointer-events-none data-disabled:opacity-50",e),...n,children:[l.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(Ewn,{children:l.jsx(jb,{className:"h-4 w-4 text-neutral6"})})}),l.jsx(Own,{children:t})]}));vs.displayName=_ut.displayName;const ku=({children:e,defaultTab:t,value:n,onValueChange:r,className:s})=>l.jsx(Twn,{defaultValue:t,value:n,onValueChange:r?a=>r(a):void 0,className:X("overflow-y-auto",s),children:e}),sKn=Mh("flex items-center relative text-ui-lg",{variants:{variant:{line:"w-max min-w-full border-b border-border1",pill:"w-fit gap-1 rounded-full bg-surface2 p-1","pill-ghost":"w-fit gap-1 rounded-full p-1"}},defaultVariants:{variant:"line"}}),_u=({children:e,className:t,variant:n,sticky:r})=>{const s=n??"line";return l.jsx("div",{className:X("w-full overflow-x-auto",r&&"sticky top-0 z-10 bg-surface2"),children:l.jsxs(n1n,{"data-variant":s,className:X("group/tabs-list",sKn({variant:s}),t),children:[e,s==="line"&&l.jsx(c2e,{className:X("absolute bottom-0 left-0 bg-neutral3","w-[var(--active-tab-width)] h-0.5","transition-all duration-200 ease-in-out"),style:{transform:"translateX(var(--active-tab-left))"}}),(s==="pill"||s==="pill-ghost")&&l.jsx(c2e,{className:X("absolute top-1/2 left-0 z-0 rounded-full bg-surface4","w-[var(--active-tab-width)] h-[calc(100%-0.5rem)]","transition-all duration-200 ease-in-out"),style:{transform:"translateY(-50%) translateX(var(--active-tab-left))"}})]})})},Hr=({children:e,value:t,onClick:n,onClose:r,disabled:s,className:a})=>l.jsxs(Nwn,{value:t,disabled:s,className:X("text-ui-md font-normal text-neutral3","whitespace-nowrap shrink-0 flex items-center justify-center gap-1.5 outline-none cursor-pointer",Tr.colors,Fw.visible,"hover:text-neutral4","data-[active]:text-neutral5","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[disabled]:hover:text-neutral3","group-data-[variant=line]/tabs-list:py-2 group-data-[variant=line]/tabs-list:px-5","group-data-[variant=line]/tabs-list:border-b-2 group-data-[variant=line]/tabs-list:border-transparent","group-data-[variant=pill]/tabs-list:relative group-data-[variant=pill]/tabs-list:z-10","group-data-[variant=pill]/tabs-list:py-1 group-data-[variant=pill]/tabs-list:px-3","group-data-[variant=pill]/tabs-list:rounded-full","group-data-[variant=pill-ghost]/tabs-list:relative group-data-[variant=pill-ghost]/tabs-list:z-10","group-data-[variant=pill-ghost]/tabs-list:py-1 group-data-[variant=pill-ghost]/tabs-list:px-3","group-data-[variant=pill-ghost]/tabs-list:rounded-full",a),onClick:n,children:[e,r&&l.jsx("button",{onClick:i=>{i.stopPropagation(),r()},className:X("p-0.5 hover:bg-surface4 rounded",Tr.colors,"hover:text-neutral5"),"aria-label":"Close tab",children:l.jsx(Fd,{className:"w-3 h-3"})})]}),_s=({children:e,value:t,className:n})=>l.jsx(Bwn,{value:t,className:X("grid py-3 overflow-y-auto ring-offset-background",Fw.visible,n),children:e});function aKn({code:e,options:t,value:n,onValueChange:r,selector:s="select",fileName:a,lang:i,copyMessage:o,copyTooltip:c,className:u}){const d=t&&t.length>0,f=d&&s==="tabs",p=d&&s==="select",h=n??t?.[0]?.value;return l.jsxs("figure",{className:X("group relative flex w-full flex-col overflow-hidden rounded-2xl border border-border2/40 bg-surface2",u),children:[f&&t&&l.jsx(ku,{defaultTab:t[0].value,value:h,onValueChange:r??(()=>{}),children:l.jsx(_u,{children:t.map(m=>l.jsx(Hr,{value:m.value,children:m.label},m.value))})}),p&&t&&l.jsx("div",{className:"flex items-center border-b border-border2/40 px-2 py-1.5",children:l.jsxs(Ii,{value:h,onValueChange:r,children:[l.jsx(wi,{size:"sm",variant:"ghost",children:l.jsx(Ri,{})}),l.jsx(Si,{children:t.map(m=>l.jsx(vs,{value:m.value,children:m.label},m.value))})]})}),!d&&a&&l.jsx("div",{className:"flex items-center border-b border-border2/40 px-4 py-2",children:l.jsx("figcaption",{className:"font-mono text-ui-sm text-neutral4",children:a})}),l.jsxs("div",{className:"relative",children:[l.jsx(iKn,{code:e,lang:i}),l.jsx(la,{content:e,copyMessage:o,tooltip:c,size:"sm",className:X("absolute top-2 right-2 opacity-100 pointer-fine:opacity-0 group-hover:opacity-100 group-focus-within:opacity-100",Tr.opacity)})]})]})}function iKn({code:e,lang:t}){const[n,r]=y.useState(null);y.useEffect(()=>{if(!t){r(null);return}r(null);let a=!1;return Twt(e,t).then(i=>{!a&&i&&r(i)}).catch(()=>{}),()=>{a=!0}},[e,t]);const s="px-4 py-3 font-mono text-ui-sm text-neutral5 whitespace-pre-wrap break-all";return!t||!n?l.jsx("pre",{className:s,children:e}):l.jsx("pre",{className:s,children:l.jsx("code",{children:n.map((a,i)=>l.jsxs(y.Fragment,{children:[l.jsx("span",{children:a.map((o,c)=>l.jsx("span",{className:"text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",children:o.content},c))}),i!==n.length-1&&`
288
+ color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(s),a=!1,s}return i.updateDeps=o=>{r=o},i}function d5e(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const VQn=(e,t)=>Math.abs(e-t)<1.01,HQn=(e,t,n)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)}},f5e=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},ZQn=e=>e,WQn=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let s=t;s<=n;s++)r.push(s);return r},GQn=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const s=i=>{const{width:o,height:c}=i;t({width:Math.round(o),height:Math.round(c)})};if(s(f5e(n)),!r.ResizeObserver)return()=>{};const a=new r.ResizeObserver(i=>{const o=()=>{const c=i[0];if(c?.borderBoxSize){const u=c.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(f5e(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},p5e={passive:!0},h5e=typeof window>"u"?!0:"onscrollend"in window,QQn=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let s=0;const a=e.options.useScrollendEvent&&h5e?()=>{}:HQn(r,()=>{t(s,!1)},e.options.isScrollingResetDelay),i=d=>()=>{const{horizontal:f,isRtl:p}=e.options;s=f?n.scrollLeft*(p&&-1||1):n.scrollTop,a(),t(s,d)},o=i(!0),c=i(!1);n.addEventListener("scroll",o,p5e);const u=e.options.useScrollendEvent&&h5e;return u&&n.addEventListener("scrollend",c,p5e),()=>{n.removeEventListener("scroll",o),u&&n.removeEventListener("scrollend",c)}},YQn=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},XQn=(e,{adjustments:t=0,behavior:n},r)=>{var s,a;const i=e+t;(a=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||a.call(s,{[r.options.horizontal?"left":"top"]:i,behavior:n})};class KQn{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var n,r,s;return((s=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(a=>{const i=()=>{const o=a.target,c=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(o,a,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=null},observe:s=>{var a;return(a=r())==null?void 0:a.observe(s,{box:"border-box"})},unobserve:s=>{var a;return(a=r())==null?void 0:a.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,s])=>{typeof s>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ZQn,rangeExtractor:WQn,onChange:()=>{},measureElement:YQn,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...n}},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=_O(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,a)=>{this.scrollAdjustments=0,this.scrollDirection=a?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=a,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const s=new Map,a=new Map;for(let i=r-1;i>=0;i--){const o=n[i];if(s.has(o.lane))continue;const c=a.get(o.lane);if(c==null||o.end>c.end?a.set(o.lane,o):o.end<c.end&&s.set(o.lane,!0),s.size===this.options.lanes)break}return a.size===this.options.lanes?Array.from(a.values()).sort((i,o)=>i.end===o.end?i.index-o.index:i.end-o.end)[0]:void 0},this.getMeasurementOptions=_O(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(n,r,s,a,i,o,c)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:s,getItemKey:a,enabled:i,lanes:o,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=_O(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:s,getItemKey:a,enabled:i,lanes:o,laneAssignmentMode:c},u)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const h of this.laneAssignments.keys())h>=n&&this.laneAssignments.delete(h);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const d=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const f=this.measurementsCache.slice(0,d),p=new Array(o).fill(void 0);for(let h=0;h<d;h++){const m=f[h];m&&(p[m.lane]=h)}for(let h=d;h<n;h++){const m=a(h),g=this.laneAssignments.get(h);let v,b;const S=c==="estimate"||u.has(m);if(g!==void 0&&this.options.lanes>1){v=g;const E=p[v],T=E!==void 0?f[E]:void 0;b=T?T.end+this.options.gap:r+s}else{const E=this.options.lanes===1?f[h-1]:this.getFurthestMeasurement(f,h);b=E?E.end+this.options.gap:r+s,v=E?E.lane:h%this.options.lanes,this.options.lanes>1&&S&&this.laneAssignments.set(h,v)}const w=u.get(m),_=typeof w=="number"?w:this.options.estimateSize(h),O=b+_;f[h]={index:h,start:b,size:_,end:O,key:m,lane:v},p[v]=h}return this.measurementsCache=f,f},{key:!1,debug:()=>this.options.debug}),this.calculateRange=_O(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,a)=>this.range=n.length>0&&r>0?JQn({measurements:n,outerSize:r,scrollOffset:s,lanes:a}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=_O(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,a,i)=>a===null||i===null?[]:n({startIndex:a,endIndex:i,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const a=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,s-a),o=Math.min(this.options.count-1,s+a);return n>=i&&n<=o}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((i,o)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(o))});return}const r=this.indexFromElement(n),s=this.options.getItemKey(r),a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var s;const a=this.measurementsCache[n];if(!a)return;const i=this.itemSizeCache.get(a.key)??a.size,o=r-i;o!==0&&(((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(a,o,this):a.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(a.index),this.itemSizeCache=new Map(this.itemSizeCache.set(a.key,r)),this.notify(!1))},this.getVirtualItems=_O(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let a=0,i=n.length;a<i;a++){const o=n[a],c=r[o];s.push(c)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return d5e(r[K0t(0,r.length-1,s=>d5e(r[s]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,s=0)=>{if(!this.scrollElement)return 0;const a=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=n>=i+a?"end":"start"),r==="center"?n+=(s-a)/2:r==="end"&&(n-=a);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getSize(),a=this.getScrollOffset(),i=this.measurementsCache[n];if(!i)return;if(r==="auto")if(i.end>=a+s-this.options.scrollPaddingEnd)r="end";else if(i.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,i.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:s="auto"}={})=>{const a=this.getOffsetForAlignment(n,r),i=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:i,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:s="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const a=this.getOffsetForIndex(n,r);if(!a)return;const[i,o]=a,c=this.now();this.scrollState={index:n,align:o,behavior:s,startedAt:c,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+n,a=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:a,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((n=r[r.length-1])==null?void 0:n.end)??0;else{const a=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&a.some(o=>o===null);){const o=r[i];a[o.lane]===null&&(a[o.lane]=o.end),i--}s=Math.max(...a.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,a=1,i=s!==this.scrollState.lastTargetOffset;if(!i&&VQn(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=a){this.scrollState=null;return}}else this.scrollState.stableFrames=0,i&&(this.scrollState.lastTargetOffset=s,this.scrollState.behavior="auto",this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const K0t=(e,t,n,r)=>{for(;e<=t;){const s=(e+t)/2|0,a=n(s);if(a<r)e=s+1;else if(a>r)t=s-1;else return s}return e>0?e-1:0};function JQn({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const s=e.length-1,a=c=>e[c].start;if(e.length<=r)return{startIndex:0,endIndex:s};let i=K0t(0,s,a,n),o=i;if(r===1)for(;o<s&&e[o].end<n+t;)o++;else if(r>1){const c=Array(r).fill(0);for(;o<s&&c.some(d=>d<n+t);){const d=e[o];c[d.lane]=d.end,o++}const u=Array(r).fill(n+t);for(;i>=0&&u.some(d=>d>=n);){const d=e[i];u[d.lane]=d.start,i--}i=Math.max(0,i-i%r),o=Math.min(s,o+(r-1-o%r))}return{startIndex:i,endIndex:o}}const m5e=typeof document<"u"?y.useLayoutEffect:y.useEffect;function eYn({useFlushSync:e=!0,...t}){const n=y.useReducer(()=>({}),{})[1],r={...t,onChange:(a,i)=>{var o;e&&i?Al.flushSync(n):n(),(o=t.onChange)==null||o.call(t,a,i)}},[s]=y.useState(()=>new KQn(r));return s.setOptions(r),m5e(()=>s._didMount(),[]),m5e(()=>s._willUpdate()),s}function J0t(e){return eYn({observeElementRect:GQn,observeElementOffset:QQn,scrollToFn:XQn,...e})}function ewt(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=ewt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function twt(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=ewt(e))&&(r&&(r+=" "),r+=t);return r}const tYn=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},nYn=(e,t)=>({classGroupId:e,validator:t}),nwt=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),D8="-",g5e=[],rYn="arbitrary..",sYn=e=>{const t=iYn(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return aYn(i);const o=i.split(D8),c=o[0]===""&&o.length>1?1:0;return rwt(o,c,t)},getConflictingClassGroupIds:(i,o)=>{if(o){const c=r[i],u=n[i];return c?u?tYn(u,c):c:u||g5e}return n[i]||g5e}}},rwt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const u=rwt(e,t+1,a);if(u)return u}const i=n.validators;if(i===null)return;const o=t===0?e.join(D8):e.slice(t).join(D8),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(o))return d.classGroupId}},aYn=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?rYn+r:void 0})(),iYn=e=>{const{theme:t,classGroups:n}=e;return oYn(n,t)},oYn=(e,t)=>{const n=nwt();for(const r in e){const s=e[r];A0e(s,n,r,t)}return n},A0e=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];lYn(i,t,n,r)}},lYn=(e,t,n,r)=>{if(typeof e=="string"){cYn(e,t,n);return}if(typeof e=="function"){uYn(e,t,n,r);return}dYn(e,t,n,r)},cYn=(e,t,n)=>{const r=e===""?t:swt(t,e);r.classGroupId=n},uYn=(e,t,n,r)=>{if(fYn(e)){A0e(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(nYn(n,e))},dYn=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[o,c]=s[i];A0e(c,swt(t,o),n,r)}},swt=(e,t)=>{let n=e;const r=t.split(D8),s=r.length;for(let a=0;a<s;a++){const i=r[a];let o=n.nextPart.get(i);o||(o=nwt(),n.nextPart.set(i,o)),n=o}return n},fYn=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,pYn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(a,i)=>{n[a]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let i=n[a];if(i!==void 0)return i;if((i=r[a])!==void 0)return s(a,i),i},set(a,i){a in n?n[a]=i:s(a,i)}}},dfe="!",v5e=":",hYn=[],y5e=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),mYn=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const a=[];let i=0,o=0,c=0,u;const d=s.length;for(let g=0;g<d;g++){const v=s[g];if(i===0&&o===0){if(v===v5e){a.push(s.slice(c,g)),c=g+1;continue}if(v==="/"){u=g;continue}}v==="["?i++:v==="]"?i--:v==="("?o++:v===")"&&o--}const f=a.length===0?s:s.slice(c);let p=f,h=!1;f.endsWith(dfe)?(p=f.slice(0,-1),h=!0):f.startsWith(dfe)&&(p=f.slice(1),h=!0);const m=u&&u>c?u-c:void 0;return y5e(a,h,p,m)};if(t){const s=t+v5e,a=r;r=i=>i.startsWith(s)?a(i.slice(s.length)):y5e(hYn,!1,i,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},gYn=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let a=0;a<n.length;a++){const i=n[a],o=i[0]==="[",c=t.has(i);o||c?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(i)):s.push(i)}return s.length>0&&(s.sort(),r.push(...s)),r}},vYn=e=>({cache:pYn(e.cacheSize),parseClassName:mYn(e),sortModifiers:gYn(e),...sYn(e)}),yYn=/\s+/,bYn=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],o=e.trim().split(yYn);let c="";for(let u=o.length-1;u>=0;u-=1){const d=o[u],{isExternal:f,modifiers:p,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}=n(d);if(f){c=d+(c.length>0?" "+c:c);continue}let v=!!g,b=r(v?m.substring(0,g):m);if(!b){if(!v){c=d+(c.length>0?" "+c:c);continue}if(b=r(m),!b){c=d+(c.length>0?" "+c:c);continue}v=!1}const S=p.length===0?"":p.length===1?p[0]:a(p).join(":"),w=h?S+dfe:S,_=w+b;if(i.indexOf(_)>-1)continue;i.push(_);const O=s(b,v);for(let E=0;E<O.length;++E){const T=O[E];i.push(w+T)}c=d+(c.length>0?" "+c:c)}return c},xYn=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=awt(n))&&(s&&(s+=" "),s+=r);return s},awt=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=awt(e[r]))&&(n&&(n+=" "),n+=t);return n},b5e=(e,...t)=>{let n,r,s,a;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return n=vYn(u),r=n.cache.get,s=n.cache.set,a=o,o(c)},o=c=>{const u=r(c);if(u)return u;const d=bYn(c,n);return s(c,d),d};return a=i,(...c)=>a(xYn(...c))},wYn=[],yl=e=>{const t=n=>n[e]||wYn;return t.isThemeGetter=!0,t},iwt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,owt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,SYn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,kYn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_Yn=/\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$/,OYn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,EYn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,CYn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jx=e=>SYn.test(e),is=e=>!!e&&!Number.isNaN(Number(e)),Nx=e=>!!e&&Number.isInteger(Number(e)),BX=e=>e.endsWith("%")&&is(e.slice(0,-1)),uy=e=>kYn.test(e),lwt=()=>!0,TYn=e=>_Yn.test(e)&&!OYn.test(e),I0e=()=>!1,jYn=e=>EYn.test(e),NYn=e=>CYn.test(e),AYn=e=>!Rn(e)&&!Ln(e),IYn=e=>zw(e,dwt,I0e),Rn=e=>iwt.test(e),k1=e=>zw(e,fwt,TYn),x5e=e=>zw(e,FYn,is),RYn=e=>zw(e,hwt,lwt),PYn=e=>zw(e,pwt,I0e),w5e=e=>zw(e,cwt,I0e),MYn=e=>zw(e,uwt,NYn),BL=e=>zw(e,mwt,jYn),Ln=e=>owt.test(e),IA=e=>m_(e,fwt),$Yn=e=>m_(e,pwt),S5e=e=>m_(e,cwt),DYn=e=>m_(e,dwt),LYn=e=>m_(e,uwt),UL=e=>m_(e,mwt,!0),zYn=e=>m_(e,hwt,!0),zw=(e,t,n)=>{const r=iwt.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},m_=(e,t,n=!1)=>{const r=owt.exec(e);return r?r[1]?t(r[1]):n:!1},cwt=e=>e==="position"||e==="percentage",uwt=e=>e==="image"||e==="url",dwt=e=>e==="length"||e==="size"||e==="bg-size",fwt=e=>e==="length",FYn=e=>e==="number",pwt=e=>e==="family-name",hwt=e=>e==="number"||e==="weight",mwt=e=>e==="shadow",k5e=()=>{const e=yl("color"),t=yl("font"),n=yl("text"),r=yl("font-weight"),s=yl("tracking"),a=yl("leading"),i=yl("breakpoint"),o=yl("container"),c=yl("spacing"),u=yl("radius"),d=yl("shadow"),f=yl("inset-shadow"),p=yl("text-shadow"),h=yl("drop-shadow"),m=yl("blur"),g=yl("perspective"),v=yl("aspect"),b=yl("ease"),S=yl("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[..._(),Ln,Rn],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[Ln,Rn,c],N=()=>[jx,"full","auto",...j()],I=()=>[Nx,"none","subgrid",Ln,Rn],R=()=>["auto",{span:["full",Nx,Ln,Rn]},Nx,Ln,Rn],P=()=>[Nx,"auto",Ln,Rn],U=()=>["auto","min","max","fr",Ln,Rn],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],L=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...j()],z=()=>[jx,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],q=()=>[jx,"screen","full","dvw","lvw","svw","min","max","fit",...j()],H=()=>[jx,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],D=()=>[e,Ln,Rn],Y=()=>[..._(),S5e,w5e,{position:[Ln,Rn]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",DYn,IYn,{size:[Ln,Rn]}],W=()=>[BX,IA,k1],G=()=>["","none","full",u,Ln,Rn],K=()=>["",is,IA,k1],re=()=>["solid","dashed","dotted","double"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[is,BX,S5e,w5e],se=()=>["","none",m,Ln,Rn],ie=()=>["none",is,Ln,Rn],Q=()=>["none",is,Ln,Rn],ne=()=>[is,Ln,Rn],oe=()=>[jx,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[uy],breakpoint:[uy],color:[lwt],container:[uy],"drop-shadow":[uy],ease:["in","out","in-out"],font:[AYn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[uy],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[uy],shadow:[uy],spacing:["px",is],text:[uy],"text-shadow":[uy],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",jx,Rn,Ln,v]}],container:["container"],columns:[{columns:[is,Rn,Ln,o]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"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:O()}],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:[Nx,"auto",Ln,Rn]}],basis:[{basis:[jx,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[is,jx,"auto","initial","none",Rn]}],grow:[{grow:["",is,Ln,Rn]}],shrink:[{shrink:["",is,Ln,Rn]}],order:[{order:[Nx,"first","last","none",Ln,Rn]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...L(),"normal"]}],"justify-self":[{"justify-self":["auto",...L()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...L(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...L(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...L(),"baseline"]}],"place-self":[{"place-self":["auto",...L()]}],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:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mbs:[{mbs:F()}],mbe:[{mbe:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"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",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...H()]}],"min-block-size":[{"min-block":["auto",...H()]}],"max-block-size":[{"max-block":["none",...H()]}],w:[{w:[o,"screen",...z()]}],"min-w":[{"min-w":[o,"screen","none",...z()]}],"max-w":[{"max-w":[o,"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",n,IA,k1]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,zYn,RYn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",BX,Rn]}],"font-family":[{font:[$Yn,PYn,t]}],"font-features":[{"font-features":[Rn]}],"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,Ln,Rn]}],"line-clamp":[{"line-clamp":[is,"none",Ln,x5e]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",Ln,Rn]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ln,Rn]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[is,"from-font","auto",Ln,k1]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[is,"auto",Ln,Rn]}],"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",Ln,Rn]}],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",Ln,Rn]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Nx,Ln,Rn],radial:["",Ln,Rn],conic:[Nx,Ln,Rn]},LYn,MYn]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],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:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-bs":[{"border-bs":K()}],"border-w-be":[{"border-be":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[is,Ln,Rn]}],"outline-w":[{outline:["",is,IA,k1]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",d,UL,BL]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",f,UL,BL]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[is,k1]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",p,UL,BL]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[is,Ln,Rn]}],"mix-blend":[{"mix-blend":[...J(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":J()}],"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":[is]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Ln,Rn]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[is]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ln,Rn]}],filter:[{filter:["","none",Ln,Rn]}],blur:[{blur:se()}],brightness:[{brightness:[is,Ln,Rn]}],contrast:[{contrast:[is,Ln,Rn]}],"drop-shadow":[{"drop-shadow":["","none",h,UL,BL]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",is,Ln,Rn]}],"hue-rotate":[{"hue-rotate":[is,Ln,Rn]}],invert:[{invert:["",is,Ln,Rn]}],saturate:[{saturate:[is,Ln,Rn]}],sepia:[{sepia:["",is,Ln,Rn]}],"backdrop-filter":[{"backdrop-filter":["","none",Ln,Rn]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[is,Ln,Rn]}],"backdrop-contrast":[{"backdrop-contrast":[is,Ln,Rn]}],"backdrop-grayscale":[{"backdrop-grayscale":["",is,Ln,Rn]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[is,Ln,Rn]}],"backdrop-invert":[{"backdrop-invert":["",is,Ln,Rn]}],"backdrop-opacity":[{"backdrop-opacity":[is,Ln,Rn]}],"backdrop-saturate":[{"backdrop-saturate":[is,Ln,Rn]}],"backdrop-sepia":[{"backdrop-sepia":["",is,Ln,Rn]}],"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",Ln,Rn]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[is,"initial",Ln,Rn]}],ease:[{ease:["linear","initial",b,Ln,Rn]}],delay:[{delay:[is,Ln,Rn]}],animate:[{animate:["none",S,Ln,Rn]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,Ln,Rn]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[Ln,Rn,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"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",Ln,Rn]}],"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",Ln,Rn]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[is,IA,k1,x5e]}],stroke:[{stroke:["none",...D()]}],"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"]}},BYn=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:s={},override:a={}})=>(SI(e,"cacheSize",t),SI(e,"prefix",n),SI(e,"experimentalParseClassName",r),qL(e.theme,a.theme),qL(e.classGroups,a.classGroups),qL(e.conflictingClassGroups,a.conflictingClassGroups),qL(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),SI(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),VL(e.theme,s.theme),VL(e.classGroups,s.classGroups),VL(e.conflictingClassGroups,s.conflictingClassGroups),VL(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),gwt(e,s,"orderSensitiveModifiers"),e),SI=(e,t,n)=>{n!==void 0&&(e[t]=n)},qL=(e,t)=>{if(t)for(const n in t)SI(e,n,t[n])},VL=(e,t)=>{if(t)for(const n in t)gwt(e,t,n)},gwt=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},UYn=(e,...t)=>typeof e=="function"?b5e(k5e,e,...t):b5e(()=>BYn(k5e(),e),...t),qYn=Object.keys({...Dy,...Tnn}),VYn=Object.keys(Pnn),HYn=Object.keys(jnn),ZYn=Object.keys(Nnn),WYn=Object.keys(Cnn),_1=Object.keys(Rnn),GYn=Object.keys(Ann).concat(Object.keys(Inn)),QYn=UYn({extend:{theme:{color:qYn,spacing:VYn,radius:WYn,leading:ZYn,shadow:GYn},classGroups:{"font-size":[{text:HYn}],h:[{h:_1}],w:[{w:_1}],size:[{size:_1}],"min-h":[{"min-h":_1}],"min-w":[{"min-w":_1}],"max-h":[{"max-h":_1}],"max-w":[{"max-w":_1}]}}});function X(...e){return QYn(twt(e))}const YYn={"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"},XYn={mono:"font-mono"},ge=({as:e="p",className:t,variant:n="ui-md",font:r,...s})=>l.jsx(e,{className:X(YYn[n],r&&XYn[r],t),...s}),Tr={colors:"transition-colors duration-normal ease-out-custom",all:"transition-all duration-normal ease-out-custom",opacity:"transition-opacity duration-normal ease-out-custom"},Fw={visible:"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},KYn={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},vwt=({src:e,name:t,size:n="sm",interactive:r=!1})=>l.jsx("div",{className:X(KYn[n],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",Tr.all,r&&"cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"),children:e?l.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):l.jsx(ge,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),JYn={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"},Be=({children:e,className:t,size:n="default",...r})=>l.jsx("span",{className:X("block",JYn[n],t),...r,children:e}),eXn={default:"text-neutral5 bg-surface4 border-border1",success:"text-notice-success-fg bg-notice-success/20 border-notice-success/20",error:"text-notice-destructive-fg bg-notice-destructive/20 border-notice-destructive/20",info:"text-notice-info-fg bg-notice-info/20 border-notice-info/20",warning:"text-notice-warning-fg bg-notice-warning/20 border-notice-warning/20"},Et=({icon:e,variant:t="default",className:n,children:r,...s})=>l.jsxs("div",{className:X("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border shrink-0",Tr.colors,e?"pl-2 pr-2.5":"px-2.5",eXn[t],n),...s,children:[e&&l.jsx(Be,{size:"sm",children:e}),r]}),tXn=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z",fill:"currentColor"})}),nXn=({children:e,label:t,className:n,listClassName:r})=>l.jsx("nav",{"aria-label":t,className:n,children:l.jsx("ol",{className:X("gap-0.5 flex items-center",r),children:e})}),rXn=({className:e,as:t,isCurrent:n,action:r,...s})=>{const a=t||"span";return l.jsxs(l.Fragment,{children:[l.jsxs("li",{className:X("flex h-full min-w-0 items-center gap-1",n?"shrink":"shrink-0"),children:[l.jsx(a,{"aria-current":n?"page":void 0,className:X("text-ui-md leading-ui-md flex min-w-0 items-center gap-2 truncate",Tr.colors,n?"text-neutral6 font-medium":"text-neutral3 hover:text-neutral5",e),...s}),r]}),!n&&l.jsx("li",{role:"separator",className:"flex h-full items-center",children:l.jsx(Be,{className:X("text-neutral2",Tr.colors),children:l.jsx(tXn,{})})})]})},_5e=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,O5e=twt,Mh=(e,t)=>n=>{var r;if(t?.variants==null)return O5e(e,n?.class,n?.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(u=>{const d=n?.[u],f=a?.[u];if(d===null)return null;const p=_5e(d)||_5e(f);return s[u][p]}),o=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...h}=d;return Object.entries(h).every(m=>{let[g,v]=m;return Array.isArray(v)?v.includes({...a,...o}[g]):{...a,...o}[g]===v})?[...u,f,p]:u},[]);return O5e(e,i,c,n?.class,n?.className)};function od({delay:e,delayDuration:t,timeout:n,skipDelayDuration:r,...s}){const a=e??t,i=n??r;return l.jsx(van,{...a!==void 0?{delay:a}:{},...i!==void 0?{timeout:i}:{},...s})}const Jn=Gsn,Qn=y.forwardRef(({asChild:e,render:t,children:n,...r},s)=>e&&y.isValidElement(n)?l.jsx(JAe,{ref:s,render:n,...r}):l.jsx(JAe,{ref:s,render:t,...r,children:n}));Qn.displayName="TooltipTrigger";const Yn=y.forwardRef(({className:e,side:t="top",sideOffset:n=8,align:r="center",alignOffset:s=0,children:a,...i},o)=>l.jsx(oan,{children:l.jsx(pan,{side:t,sideOffset:n,align:r,alignOffset:s,arrowPadding:10,className:"isolate z-[100]",children:l.jsxs(man,{ref:o,role:"tooltip",className:X("relative z-[100] flex flex-col origin-(--transform-origin) rounded-lg border border-border1 bg-surface3 px-2.5 py-1.5 text-ui-sm leading-ui-sm text-neutral5 shadow-dialog transition-[transform,scale,opacity] duration-150","data-[starting-style]:scale-95 data-[starting-style]:opacity-0","data-[ending-style]:scale-95 data-[ending-style]:opacity-0","data-[instant]:transition-none",e),...i,children:[a,l.jsx(gan,{className:X("flex","data-[side=top]:-bottom-[8px] data-[side=top]:rotate-180","data-[side=bottom]:-top-[8px]","data-[side=left]:-right-[10px] data-[side=left]:rotate-90","data-[side=right]:-left-[10px] data-[side=right]:-rotate-90"),children:l.jsx(sXn,{})})]})})}));Yn.displayName="TooltipContent";function sXn(){return l.jsxs("svg",{width:"12",height:"8",viewBox:"0 0 12 8",fill:"none",overflow:"visible",children:[l.jsx("path",{d:"M0 7L4 2Q6 0 8 2L12 7L12 8L0 8Z",className:"fill-surface3"}),l.jsx("path",{d:"M0 7.5L4 2.5Q6 0.5 8 2.5L12 7.5",className:"fill-none stroke-border1",strokeWidth:"1",strokeLinejoin:"round",strokeLinecap:"round"})]})}const no={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},pq="focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",ywt="focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",bwt="rounded-md",xwt="bg-surface2 border border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",R0e="outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",P0e="disabled:opacity-50 disabled:cursor-not-allowed",HL=X("gap-[.75em] rounded-full","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100"),M0e=Mh(X("inline-flex items-center justify-center leading-0 cursor-pointer","transition-all duration-normal ease-out-custom",P0e,R0e),{variants:{variant:{default:"bg-surface3 border border-border2 hover:bg-surface5 hover:text-neutral6 active:bg-surface6 text-neutral6",primary:"bg-neutral6 border border-transparent hover:bg-neutral6/90 active:bg-neutral6/80 text-surface1 font-medium",ghost:"bg-transparent border border-transparent hover:bg-neutral6/5 hover:text-neutral6 active:bg-neutral6/10 text-neutral4",outline:"bg-transparent border border-border1 hover:bg-surface3 hover:text-neutral6 active:bg-surface4 text-neutral5"},size:{sm:X(`${no.sm} text-ui-sm px-[.9em]`,HL),md:X(`${no.md} text-ui-md px-[.9em]`,HL),default:X(`${no.default} text-ui-md px-[1em]`,HL),lg:X(`${no.lg} text-ui-lg px-[1.15em]`,HL),"icon-sm":`${no.sm} w-form-sm rounded-full`,"icon-md":`${no.md} w-form-md rounded-full`,"icon-lg":`${no.lg} w-form-lg rounded-full`}},defaultVariants:{variant:"default",size:"default"}}),aXn={"icon-sm":"sm","icon-md":"default","icon-lg":"lg"};function wwt(e){const t=[];return Oe.Children.forEach(e,n=>{Oe.isValidElement(n)&&n.type===Oe.Fragment?t.push(...wwt(n.props.children)):t.push(n)}),t}function iXn(e){const t=wwt(e);return t.length>0&&t.every(n=>Oe.isValidElement(n))}function oXn(e){return typeof e=="string"&&e.startsWith("icon-")}const de=Oe.forwardRef(({className:e,as:t,size:n,variant:r="default",disabled:s,children:a,tooltip:i,"aria-label":o,...c},u)=>{const d=t||"button",f=oXn(n),p=n??"default",h=!f&&iXn(a),m=o??((f||h)&&typeof i=="string"?i:void 0),g=f?l.jsx(Be,{size:aXn[n],children:a}):a,v=l.jsx(d,{ref:u,disabled:s,"aria-label":m,className:X(M0e({variant:r,size:p}),h&&"[&>svg]:opacity-75",e),...c,children:g});return i?l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:v}),l.jsx(Yn,{children:i})]}):v});de.displayName="Button";function lXn(e,t=5){if(!e?.properties)return[];const n=[];function r(s,a,i){if(i>t)return;const o=Array.isArray(s.type)?s.type.join(" | "):s.type;if(n.push({path:a,label:a,description:s.description??s.title,type:o}),s.properties)for(const[c,u]of Object.entries(s.properties))r(u,`${a}.${c}`,i+1);if(s.items?.properties)for(const[c,u]of Object.entries(s.items.properties))r(u,`${a}[].${c}`,i+1)}for(const[s,a]of Object.entries(e.properties))r(a,s,1);return n}function cXn(e){const t=lXn(e);return Fat({override:[uXn(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function uXn(e){return t=>{const r=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!r)return null;const s=r[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 o=i.map(c=>({label:c.path,displayLabel:c.path,detail:c.type,info:c.description,apply:(u,d,f,p)=>{const g=u.state.sliceDoc(p,p+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:f,to:p,insert:g},selection:{anchor:f+g.length}})}}));return{from:a,options:o,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const dXn=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,fXn=hn.mark({class:"cm-variable-highlight"}),E5e=new eat({regexp:dXn,decoration:()=>fXn}),pXn=Hi.fromClass(class{decorations;constructor(e){this.decorations=E5e.createDeco(e)}update(e){this.decorations=E5e.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),hXn=pXn,Swt=({className:e,toastOptions:t,...n})=>l.jsx(Wyn,{...n,closeButton:!0,richColors:!0,className:X("mastra-toaster",e),toastOptions:{duration:5e3,...t}}),hq=(e,t)=>Array.isArray(e)?e.map(t):t(e),Fe=(e,t={})=>{if(Array.isArray(e))return e.map(n=>jm(n,t));if(Oe.isValidElement(e)||typeof e=="string")return jm(e,t);throw new Error("Invalid message type")};Fe.success=(e,t={})=>hq(e,n=>jm.success(n,t));Fe.error=(e,t={})=>hq(e,n=>jm.error(n,t));Fe.warning=(e,t={})=>hq(e,n=>jm.warning(n,t));Fe.info=(e,t={})=>hq(e,n=>jm.info(n,t));Fe.custom=(e,t={})=>jm(e,t);Fe.dismiss=e=>jm.dismiss(e);Fe.promise=({myPromise:e,loadingMessage:t,successMessage:n,errorMessage:r,onSuccess:s,onError:a,options:i={}})=>jm.promise(e,{loading:t??"Loading...",success:o=>(s?.(o),n),error:o=>(a?.(o),r||(o instanceof Error?o.message:"Error...")),...i});function Rm({text:e,copyMessage:t="Copied to clipboard!"}){const[n,r]=y.useState(!1),s=y.useRef(null),a=y.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{Fe.success(t),r(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{r(!1)},2e3)}).catch(()=>{Fe.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:n,handleCopy:a}}function la({content:e,copyMessage:t,tooltip:n="Copy to clipboard",size:r="sm",className:s}){const[a,i]=y.useState(!1),{handleCopy:o}=Rm({text:e,copyMessage:t}),c=()=>{o(),i(!0),setTimeout(()=>i(!1),2e3)};return l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx(de,{onClick:c,type:"button",size:r,className:s,"aria-label":a?"Copied!":n,children:a?l.jsx(jb,{}):l.jsx(llt,{})})}),l.jsx(Yn,{children:a?"Copied!":n})]})}const mXn="mastra-theme",gXn="mastra-playground-store",ffe=e=>e==="dark"||e==="light"||e==="system",vXn=e=>{try{const t=e.getItem(gXn);if(!t)return;const r=JSON.parse(t)?.state?.theme;return ffe(r)?r:void 0}catch{return}},yXn=(e=mXn)=>({get(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(e);if(ffe(t))return t;const n=vXn(window.localStorage);return n?(window.localStorage.setItem(e,n),n):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 n=r=>{if(r.key===e){if(r.newValue===null){t(null);return}ffe(r.newValue)&&t(r.newValue)}};return window.addEventListener("storage",n),()=>window.removeEventListener("storage",n)}}),kwt=y.createContext(null),_wt="(prefers-color-scheme: dark)",bXn=typeof window>"u"?y.useEffect:y.useLayoutEffect,Owt=()=>typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia(_wt).matches?"dark":"light",Ewt=e=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia(_wt);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},xXn=(e,t)=>{e.classList.remove(t==="dark"?"light":"dark"),e.classList.add(t)},Cwt=({children:e,defaultTheme:t="system",storageKey:n,target:r})=>{const s=y.useMemo(()=>yXn(n),[n]),a=y.useRef(null),[i,o]=y.useState(()=>s.get()??t),c=y.useSyncExternalStore(Ewt,Owt,()=>"dark");y.useEffect(()=>s.subscribe(f=>o(f??t)),[s,t]);const u=i==="system"?c:i;bXn(()=>{const f=r??(typeof window>"u"?null:window.document.documentElement);a.current&&a.current!==f&&a.current.classList.remove("dark","light"),f&&xXn(f,u),a.current=f},[u,r]);const d=y.useMemo(()=>({theme:i,resolvedTheme:u,systemTheme:c,setTheme:f=>{o(f),s.set(f)}}),[i,u,c,s]);return l.jsx(kwt.Provider,{value:d,children:e})},wXn=()=>{},$j=()=>{const e=y.useContext(kwt),t=y.useSyncExternalStore(Ewt,Owt,()=>"dark");return y.useMemo(()=>e??{theme:"system",resolvedTheme:t,systemTheme:t,setTheme:wXn},[e,t])};function SXn(){const e=lj({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:[ae.className,ae.propertyName],color:"var(--neutral6)"},{tag:ae.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[ae.heading1,ae.heading2,ae.heading3,ae.heading4,ae.heading5,ae.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:ae.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:ae.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:ae.link,color:"var(--accent3)",textDecoration:"underline"},{tag:ae.url,color:"var(--accent3)"},{tag:ae.monospace,color:"var(--neutral6)"},{tag:ae.strikethrough,textDecoration:"line-through"},{tag:ae.quote,fontStyle:"italic",color:"var(--neutral2)"}]}),t=xt.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 kXn(){const e=xt.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=Um.define([{tag:[ae.comment,ae.bracket],color:"var(--neutral2)"},{tag:[ae.string,ae.meta,ae.regexp],color:"var(--accent1)"},{tag:[ae.atom,ae.bool,ae.special(ae.variableName)],color:"var(--accent6)"},{tag:[ae.keyword,ae.operator,ae.tagName],color:"var(--accent2)"},{tag:[ae.function(ae.propertyName),ae.propertyName],color:"var(--accent5)"},{tag:[ae.definition(ae.variableName),ae.function(ae.variableName),ae.className,ae.attributeName],color:"var(--accent3)"},{tag:[ae.variableName,ae.number],color:"var(--accent5)"},{tag:[ae.name,ae.quote],color:"var(--accent1)"},{tag:ae.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[ae.heading1,ae.heading2,ae.heading3,ae.heading4,ae.heading5,ae.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:[ae.emphasis],fontStyle:"italic",color:"var(--neutral6)"},{tag:[ae.strong],fontWeight:"bold",color:"var(--neutral6)"},{tag:ae.link,color:"var(--accent3)",textDecoration:"underline"},{tag:ae.url,color:"var(--accent3)"},{tag:ae.monospace,color:"var(--neutral6)"},{tag:ae.strikethrough,textDecoration:"line-through"},{tag:[ae.deleted],color:"var(--accent2)"},{tag:ae.invalid,color:"var(--error)"},{tag:[ae.standard(ae.tagName)],color:"var(--accent1)"}]);return[e,Cw(t)]}const Bb=()=>{const e=$j().resolvedTheme==="dark";return y.useMemo(()=>e?SXn():kXn(),[e])},As=y.forwardRef(({data:e,value:t,onChange:n,showCopyButton:r=!0,className:s,language:a="json",highlightVariables:i=!1,placeholder:o,schema:c,autoFocus:u,lineNumbers:d=!0,editable:f,...p},h)=>{const m=Bb(),g=e?JSON.stringify(e,null,2):t??"",v=y.useMemo(()=>{const b=[];return a==="json"?b.push(Vf):a==="markdown"&&(b.push(Tve({base:ek,codeLanguages:lot})),b.push(xt.lineWrapping)),i&&a==="markdown"&&b.push(hXn),c&&a==="markdown"&&b.push(cXn(c)),f===!1&&b.push(ts.readOnly.of(!0)),b},[a,i,c,f]);return l.jsxs("div",{className:X("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...p,children:[r&&l.jsx(la,{content:g,className:"absolute top-2 right-2 z-20"}),l.jsx(pu,{ref:h,value:g,theme:m,extensions:v,onChange:n,editable:f,"aria-label":"Code editor",placeholder:o,height:"100%",style:{height:"100%"},autoFocus:u,basicSetup:{lineNumbers:d}})]})});async function Twt(e,t){const{codeToTokens:n,bundledLanguages:r}=await rt(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-BUIFyJIO.js");return{codeToTokens:a,bundledLanguages:i}},__vite__mapDeps([23,1]),import.meta.url);if(!(t in r))return null;const{tokens:s}=await n(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return s}function oi({iconSlot:e,titleSlot:t,descriptionSlot:n,actionSlot:r,className:s,as:a="h3"}){return l.jsxs("div",{className:X("flex flex-col items-center justify-center text-center py-10 px-6","transition-opacity duration-normal ease-out-custom",s),children:[e&&l.jsx("div",{className:"mb-4",children:e}),l.jsx(a,{className:"font-medium text-neutral5 text-ui-md",children:t}),n&&l.jsx("p",{className:"mt-1.5 text-neutral3 text-ui-sm max-w-md",children:n}),r&&l.jsx("div",{className:"mt-5",children:r})]})}const Go=e=>l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 8.82265 8.51434",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M6.76646 6.16953C6.56909 6.10559 6.40521 5.96585 6.31087 5.78107C6.21653 5.5963 6.19945 5.38161 6.2634 5.18424C6.32735 4.98687 6.46708 4.82299 6.65186 4.72865C6.83663 4.63431 7.05132 4.61723 7.24869 4.68118C7.45933 4.74996 7.6849 4.75913 7.90043 4.70768C8.11596 4.65622 8.31306 4.54615 8.46992 4.38963C8.62678 4.23312 8.73729 4.03626 8.78921 3.82084C8.84114 3.60542 8.83246 3.37984 8.76414 3.16904C8.69582 2.95825 8.57052 2.77046 8.4021 2.62646C8.23368 2.48246 8.02871 2.38785 7.80986 2.35311C7.59101 2.31836 7.36681 2.34484 7.16208 2.4296C6.95734 2.51436 6.78004 2.6541 6.64979 2.83337C6.39274 3.18567 6.05613 3.47228 5.66736 3.66987C5.27858 3.86747 4.84864 3.97046 4.41254 3.97046C3.97643 3.97046 3.54649 3.86747 3.15772 3.66987C2.76895 3.47228 2.43234 3.18567 2.17528 2.83337C2.04528 2.65368 1.86807 2.51346 1.66329 2.42826C1.45852 2.34306 1.23415 2.3162 1.01505 2.35065C0.795944 2.3851 0.590648 2.47951 0.421892 2.62344C0.253137 2.76736 0.127507 2.95519 0.0589124 3.16611C-0.00968171 3.37703 -0.0185632 3.60282 0.0332514 3.81848C0.0850661 4.03414 0.195555 4.23125 0.352484 4.38799C0.509413 4.54472 0.706659 4.65497 0.92238 4.70652C1.1381 4.75808 1.36388 4.74892 1.57472 4.68007C1.77224 4.61634 1.98698 4.63369 2.1717 4.72829C2.35643 4.82289 2.49601 4.987 2.55973 5.18452C2.62346 5.38203 2.60611 5.59677 2.51151 5.7815C2.41691 5.96623 2.2528 6.10581 2.05528 6.16953C1.84456 6.23788 1.65684 6.36317 1.51288 6.53155C1.36893 6.69993 1.27434 6.90485 1.23959 7.12364C1.20483 7.34242 1.23126 7.56656 1.31596 7.77126C1.40065 7.97597 1.5403 8.15326 1.71948 8.28354C1.89865 8.41382 2.11036 8.49201 2.33121 8.50946C2.55205 8.52692 2.77342 8.48296 2.97083 8.38244C3.16825 8.28193 3.33402 8.12877 3.44981 7.93992C3.56561 7.75106 3.62692 7.53386 3.62697 7.31233C3.62697 7.10501 3.70933 6.90619 3.85592 6.7596C4.00251 6.613 4.20134 6.53065 4.40865 6.53065C4.61596 6.53065 4.81479 6.613 4.96138 6.7596C5.10797 6.90619 5.19033 7.10501 5.19033 7.31233C5.19027 7.53399 5.25152 7.75136 5.36731 7.94037C5.4831 8.12939 5.64892 8.2827 5.84642 8.38334C6.04392 8.48399 6.26541 8.52804 6.4864 8.51063C6.70738 8.49322 6.91924 8.41502 7.09854 8.28469C7.27785 8.15436 7.41761 7.97698 7.50237 7.77216C7.58713 7.56734 7.61359 7.34307 7.57882 7.12414C7.54404 6.90522 7.44939 6.70018 7.30534 6.53171C7.16128 6.36323 6.97344 6.23789 6.76257 6.16953H6.76646Z",fill:"currentColor"}),l.jsx("path",{d:"M4.41198 2.40337C5.07565 2.40337 5.61367 1.86536 5.61367 1.20168C5.61367 0.538012 5.07565 0 4.41198 0C3.74831 0 3.2103 0.538012 3.2103 1.20168C3.2103 1.86536 3.74831 2.40337 4.41198 2.40337Z",fill:"currentColor"})]}),_Xn=e=>l.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"})]}),$0e=e=>l.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"})]}),D0e=e=>l.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"})]}),OXn=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),jwt=e=>l.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("g",{clipPath:"url(#clip0_21999_22095)",children:l.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"})}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_21999_22095",children:l.jsx("rect",{width:"14",height:"14",fill:"currentColor",transform:"translate(0.5 0.75)"})})})]}),Nwt=e=>l.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsxs("g",{clipPath:"url(#clip0_21999_20513)",children:[l.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"}),l.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"}),l.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"}),l.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"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_21999_20513",children:l.jsx("rect",{width:"12.2487",height:"12.2487",fill:"white",transform:"translate(1.375 1.28516)"})})})]}),EXn=e=>l.jsxs("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M3.84766 10.1444H9.11328",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"}),l.jsx("path",{d:"M11.1395 12.9536L1.82388 12.9535C1.4557 12.9535 1.15723 12.655 1.15723 12.2868V5.69147C1.15723 5.49041 1.24796 5.30009 1.40417 5.17351L6.07746 1.38658C6.32202 1.18841 6.67185 1.18829 6.91654 1.38629L11.5589 5.14286C11.7153 5.26944 11.8062 5.45989 11.8062 5.66111V12.287C11.8062 12.6552 11.5077 12.9536 11.1395 12.9536Z",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"})]}),CXn=e=>l.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.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"}),l.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"}),l.jsx("rect",{x:"7.92188",y:"6.46759",width:"1.41089",height:"1.56773",rx:"0.705445",fill:"currentColor"}),l.jsx("rect",{x:"10.4258",y:"4.35107",width:"1.41089",height:"3.72998",rx:"0.705445",fill:"currentColor"}),l.jsx("rect",{x:"12.9287",y:"2.23419",width:"1.41089",height:"5.75781",rx:"0.705445",fill:"currentColor"})]}),TXn=e=>l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 10.0412 8.39395",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M0 0.916539C0 0.410349 0.410349 0 0.916539 0C1.42273 0 1.83308 0.410349 1.83308 0.916539C1.83308 1.42273 1.42273 1.83308 0.916539 1.83308C0.410349 1.83308 0 1.42273 0 0.916539Z",fill:"currentColor"}),l.jsx("path",{d:"M2.88569 0.916539C2.88569 0.410349 3.29604 0 3.80223 0C4.30842 0 4.71877 0.410349 4.71877 0.916539C4.71877 1.42273 4.30842 1.83308 3.80223 1.83308C3.29604 1.83308 2.88569 1.42273 2.88569 0.916539Z",fill:"currentColor"}),l.jsx("path",{d:"M5.77139 0.916539C5.77139 0.410349 6.18174 0 6.68793 0H9.12465C9.63084 0 10.0412 0.410349 10.0412 0.916539C10.0412 1.42273 9.63084 1.83308 9.12465 1.83308H6.68793C6.18174 1.83308 5.77139 1.42273 5.77139 0.916539Z",fill:"currentColor"}),l.jsx("path",{d:"M0 4.19696C0 3.69077 0.410351 3.28042 0.916541 3.28042C1.42273 3.28042 1.83308 3.69077 1.83308 4.19696C1.83308 4.70315 1.42273 5.1135 0.916541 5.1135C0.410351 5.1135 0 4.70315 0 4.19696Z",fill:"currentColor"}),l.jsx("path",{d:"M2.8857 4.19694C2.8857 3.69075 3.29605 3.2804 3.80224 3.2804C4.30843 3.2804 4.71877 3.69075 4.71877 4.19694C4.71877 4.70313 4.30843 5.11348 3.80224 5.11348C3.29605 5.11348 2.8857 4.70313 2.8857 4.19694Z",fill:"currentColor"}),l.jsx("path",{d:"M5.77139 4.19694C5.77139 3.69075 6.18174 3.2804 6.68793 3.2804H9.12466C9.63085 3.2804 10.0412 3.69075 10.0412 4.19694C10.0412 4.70313 9.63085 5.11348 9.12466 5.11348H6.68793C6.18174 5.11348 5.77139 4.70313 5.77139 4.19694Z",fill:"currentColor"}),l.jsx("path",{d:"M0 7.47738C0 6.97119 0.410351 6.56084 0.916541 6.56084C1.42273 6.56084 1.83308 6.97119 1.83308 7.47738C1.83308 7.98357 1.42273 8.39392 0.916541 8.39392C0.410351 8.39392 0 7.98357 0 7.47738Z",fill:"currentColor"}),l.jsx("path",{d:"M2.8857 7.47741C2.8857 6.97122 3.29605 6.56087 3.80224 6.56087C4.30843 6.56087 4.71877 6.97122 4.71877 7.47741C4.71877 7.9836 4.30843 8.39395 3.80224 8.39395C3.29605 8.39395 2.8857 7.9836 2.8857 7.47741Z",fill:"currentColor"}),l.jsx("path",{d:"M5.77139 7.47741C5.77139 6.97122 6.18174 6.56087 6.68793 6.56087H9.12466C9.63085 6.56087 10.0412 6.97122 10.0412 7.47741C10.0412 7.9836 9.63085 8.39395 9.12466 8.39395H6.68793C6.18174 8.39395 5.77139 7.9836 5.77139 7.47741Z",fill:"currentColor"})]}),mq=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),jXn=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 11.185 11.185",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.57258 2.71626C9.57245 2.19794 9.14778 1.77075 8.61819 1.77075H2.56605C2.0377 1.77075 1.61179 2.19752 1.61165 2.71626V6.51162C1.61179 7.02856 2.03401 7.45487 2.5616 7.45713L3.12802 7.45935V9.21487L5.52178 7.55857L5.66764 7.45713H8.61819C9.14653 7.45713 9.57245 7.03036 9.57258 6.51162V2.71626ZM10.7099 6.51162C10.7097 7.66541 9.76766 8.59441 8.61819 8.59441H6.0223L3.51081 10.3336C3.25841 10.5083 2.86505 10.6555 2.4809 10.4558C2.09483 10.2551 1.99075 9.84577 1.99075 9.53473V8.51222C1.11705 8.26321 0.474488 7.46395 0.474378 6.51162V2.71626C0.474511 1.56248 1.41657 0.633479 2.56605 0.633479H8.61819C9.77051 0.633479 10.7097 1.56448 10.7099 2.71626V6.51162Z",fill:"currentColor"})}),Awt=e=>l.jsx("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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"})}),Cc=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 11.185 11.185",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.0293 1.16491L4.81958 0.801671L4.81955 0.801686L5.0293 1.16491ZM5.75391 1.16491L5.96365 0.801686L5.96363 0.801671L5.75391 1.16491ZM9.04492 3.06531L9.25474 2.70212L9.25467 2.70208L9.04492 3.06531ZM9.40723 7.49304L9.82666 7.49332V7.49304H9.40723ZM9.04492 8.11999L8.8352 7.75675L8.83518 7.75676L9.04492 8.11999ZM5.75391 10.0204L5.96363 10.3836L5.96365 10.3836L5.75391 10.0204ZM5.0293 10.0204L4.81955 10.3836L4.81963 10.3837L5.0293 10.0204ZM1.73828 8.11999L1.94803 7.75676L1.948 7.75675L1.73828 8.11999ZM1.37598 7.49304H0.956538L0.956538 7.49332L1.37598 7.49304ZM1.73828 3.06531L1.94802 3.42854L1.94803 3.42853L1.73828 3.06531ZM5.59277 3.38366L5.59283 2.96423H5.59277V3.38366ZM3.38379 5.59167L2.96435 5.59159V5.59167H3.38379ZM5.59277 7.80066V8.2201H5.59283L5.59277 7.80066ZM7.80078 5.59167H8.22022V5.59159L7.80078 5.59167ZM5.0293 1.16491L5.23902 1.52816C5.33331 1.47372 5.44989 1.47372 5.54419 1.52816L5.75391 1.16491L5.96363 0.801671C5.60978 0.59738 5.17342 0.59738 4.81958 0.801671L5.0293 1.16491ZM5.75391 1.16491L5.54416 1.52814L8.83518 3.42853L9.04492 3.06531L9.25467 2.70208L5.96365 0.801686L5.75391 1.16491ZM9.04492 3.06531L8.83511 3.42849C8.92979 3.48319 8.98779 3.5839 8.98779 3.69226H9.40723H9.82666C9.82666 3.28328 9.60799 2.90619 9.25474 2.70212L9.04492 3.06531ZM9.40723 3.69226H8.98779V7.49304H9.40723H9.82666V3.69226H9.40723ZM9.40723 7.49304L8.98779 7.49276C8.98772 7.6015 8.92949 7.70231 8.8352 7.75675L9.04492 8.11999L9.25464 8.48324C9.60821 8.2791 9.82639 7.90167 9.82666 7.49332L9.40723 7.49304ZM9.04492 8.11999L8.83518 7.75676L5.54416 9.65715L5.75391 10.0204L5.96365 10.3836L9.25467 8.48322L9.04492 8.11999ZM5.75391 10.0204L5.54419 9.65714C5.44996 9.71154 5.33331 9.71156 5.23897 9.65711L5.0293 10.0204L4.81963 10.3837C5.17339 10.5878 5.60977 10.5879 5.96363 10.3836L5.75391 10.0204ZM5.0293 10.0204L5.23904 9.65715L1.94803 7.75676L1.73828 8.11999L1.52854 8.48322L4.81955 10.3836L5.0293 10.0204ZM1.73828 8.11999L1.948 7.75675C1.85371 7.70231 1.79549 7.6015 1.79541 7.49276L1.37598 7.49304L0.956538 7.49332C0.956809 7.90167 1.17499 8.2791 1.52856 8.48324L1.73828 8.11999ZM1.37598 7.49304H1.79542V3.69226H1.37598H0.956538V7.49304H1.37598ZM1.37598 3.69226H1.79542C1.79542 3.58378 1.85339 3.48318 1.94802 3.42854L1.73828 3.06531L1.52854 2.70207C1.17507 2.90617 0.956538 3.2833 0.956538 3.69226H1.37598ZM1.73828 3.06531L1.94803 3.42853L5.23904 1.52814L5.0293 1.16491L4.81955 0.801686L1.52854 2.70208L1.73828 3.06531ZM5.59277 3.38366V2.96423C4.14162 2.96423 2.96463 4.14015 2.96435 5.59159L3.38379 5.59167L3.80323 5.59175C3.80342 4.60382 4.60458 3.8031 5.59277 3.8031V3.38366ZM3.38379 5.59167H2.96435C2.96435 7.04322 4.14132 8.2201 5.59277 8.2201V7.80066V7.38122C4.6046 7.38122 3.80323 6.57991 3.80323 5.59167H3.38379ZM5.59277 7.80066L5.59283 8.2201C7.04429 8.2199 8.22022 7.04294 8.22022 5.59167H7.80078H7.38134C7.38134 6.57999 6.58061 7.38108 5.59272 7.38122L5.59277 7.80066ZM7.80078 5.59167L8.22022 5.59159C8.21994 4.14043 7.04398 2.96443 5.59283 2.96423L5.59277 3.38366L5.59272 3.8031C6.58062 3.80324 7.38115 4.60374 7.38134 5.59175L7.80078 5.59167Z",fill:"currentColor"})}),Dj=e=>l.jsx(byn,{...e}),Iwt=e=>l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 9.45892 8.88606",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M8.53702 7.36403C8.98547 7.36403 9.34918 7.70502 9.34918 8.12535C9.34906 8.54559 8.9854 8.88606 8.53702 8.88606H5.6839C5.23552 8.88606 4.87186 8.54559 4.87174 8.12535C4.87174 7.70502 5.23545 7.36403 5.6839 7.36403H8.53702Z",fill:"currentColor"}),l.jsx("path",{d:"M8.53702 3.67209C8.98547 3.67209 9.34918 4.01309 9.34918 4.43342C9.34911 4.8537 8.98543 5.19413 8.53702 5.19413H5.6839C5.23549 5.19413 4.87181 4.8537 4.87174 4.43342C4.87174 4.01309 5.23545 3.67209 5.6839 3.67209H8.53702Z",fill:"currentColor"}),l.jsx("path",{d:"M8.67155 0C9.10635 2.06584e-05 9.45892 0.341006 9.45892 0.761326C9.45878 1.18153 9.10627 1.52201 8.67155 1.52203H2.88163C2.4469 1.52203 2.0944 1.18154 2.09427 0.761326C2.09427 0.340993 2.44681 3.80132e-08 2.88163 0H8.67155Z",fill:"currentColor"}),l.jsx("path",{d:"M0.757606 0.760086V4.01122H3.50594V4.76883H0.759466L0.762566 5.4291C0.76837 6.70703 1.8058 7.73972 3.08374 7.73973H3.67953V8.49796H3.08374C1.38863 8.49795 0.0120204 7.1273 0.00433981 5.4322L0 4.39188V0.760086H0.757606Z",fill:"currentColor"})]}),Tc=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 9.08789 8.97168",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M1.98047 5.00977C2.17347 5.00977 2.33002 5.16639 2.33008 5.35938C2.33008 5.55242 2.17351 5.70898 1.98047 5.70898C1.27292 5.70915 0.699436 6.2827 0.699219 6.99023C0.699219 7.69795 1.27279 8.2723 1.98047 8.27246C2.68829 8.27246 3.2627 7.69805 3.2627 6.99023C3.26291 6.79738 3.4194 6.64063 3.6123 6.64062C3.80503 6.64084 3.9617 6.79751 3.96191 6.99023C3.96191 8.08413 3.07437 8.97168 1.98047 8.97168C0.886706 8.97152 0 8.08403 0 6.99023C0.000217392 5.89662 0.886841 5.00993 1.98047 5.00977ZM7.10742 5.00977C8.20105 5.00992 9.08767 5.89662 9.08789 6.99023C9.08789 8.08404 8.20119 8.97152 7.10742 8.97168C6.01359 8.97159 5.12598 8.08408 5.12598 6.99023C5.1262 6.79757 5.28294 6.64092 5.47559 6.64062C5.66849 6.64063 5.82497 6.79738 5.8252 6.99023C5.8252 7.698 6.39968 8.27238 7.10742 8.27246C7.81511 8.2723 8.38867 7.69796 8.38867 6.99023C8.38845 6.2827 7.81497 5.70914 7.10742 5.70898C6.91445 5.7089 6.75781 5.55236 6.75781 5.35938C6.75788 5.16644 6.91449 5.00985 7.10742 5.00977ZM4.54395 0C5.44471 0 6.17465 0.730134 6.1748 1.63086C6.1748 2.27964 5.79613 2.83941 5.24768 3.102C5.0501 3.1966 4.89355 3.37979 4.89355 3.59885V4.08919C4.89355 4.21279 4.94266 4.33133 5.03006 4.41873L6.80071 6.18938C6.87996 6.26863 6.99535 6.29199 7.10742 6.29199C7.49331 6.29206 7.80642 6.60438 7.80664 6.99023C7.80664 7.37627 7.49344 7.68938 7.10742 7.68945C6.72134 7.68945 6.4082 7.37632 6.4082 6.99023C6.40827 6.87818 6.38483 6.76276 6.3056 6.68353L4.8726 5.25053C4.69056 5.06849 4.39541 5.06853 4.21343 5.25061L2.78139 6.68339C2.70211 6.76271 2.67963 6.87809 2.67969 6.99023C2.67969 7.37632 2.36655 7.68945 1.98047 7.68945C1.59452 7.68929 1.28125 7.37622 1.28125 6.99023C1.28146 6.60443 1.59466 6.29215 1.98047 6.29199C2.09246 6.29199 2.2079 6.26771 2.28711 6.18854L4.05776 4.41874C4.1452 4.33133 4.19434 4.21276 4.19434 4.08912V3.59881C4.19434 3.37977 4.03781 3.19659 3.84026 3.10199C3.29183 2.83937 2.91309 2.2796 2.91309 1.63086C2.91324 0.730162 3.64322 4.61864e-05 4.54395 0Z",fill:"currentColor"})}),Pm=e=>l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 9.52233 10.4982",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M2.39065 4.27882L4.93898 1.73049C5.10578 1.56368 5.37622 1.56368 5.54303 1.73049C5.70983 1.89729 5.70983 2.16773 5.54303 2.33454L2.9947 4.88287C2.53924 5.33834 2.53929 6.0768 2.99475 6.53226C3.45022 6.9877 4.18863 6.98771 4.64409 6.53226L7.19242 3.98393C7.35922 3.81713 7.62967 3.81714 7.79647 3.98393C7.96328 4.15074 7.96328 4.42118 7.79647 4.58798L5.24814 7.13631C4.45907 7.92537 3.17978 7.92536 2.39071 7.13631C1.60163 6.34724 1.60158 5.0679 2.39065 4.27882Z",fill:"currentColor"}),l.jsx("path",{d:"M3.50354 5.43862C3.5236 5.3983 3.55044 5.36049 3.58404 5.32688L6.06565 2.84527C6.52112 2.3898 6.52112 1.65128 6.06565 1.19581C5.61018 0.740366 4.87172 0.740412 4.41626 1.19587L0.729138 4.88287C0.562334 5.04967 0.291892 5.04968 0.125089 4.88287C-0.0416875 4.71607 -0.0417052 4.44562 0.125089 4.27882L3.81221 0.591824C4.60128 -0.197241 5.88062 -0.197289 6.6697 0.591765C7.12856 1.05062 7.32058 1.67529 7.24578 2.27292C7.84449 2.19687 8.47073 2.38872 8.93052 2.84849C9.7196 3.63757 9.7196 4.91697 8.93052 5.70605L8.20316 6.44191L6.20449 8.44058C5.83765 8.80741 5.83765 9.40219 6.20449 9.76902C6.37128 9.93582 6.37129 10.2063 6.20449 10.3731C6.03769 10.5399 5.76724 10.5399 5.60044 10.3731C4.9 9.67263 4.9 8.53697 5.60044 7.83653L7.59911 5.83786L8.32647 5.102C8.78194 4.64653 8.78194 3.90801 8.32647 3.45254C7.871 2.9971 7.13254 2.99714 6.67707 3.4526L4.17576 5.95392C4.00896 6.12072 3.73851 6.12071 3.57171 5.95392C3.43204 5.81425 3.40932 5.60193 3.50354 5.43862Z",fill:"currentColor"})]}),gq=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.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 pfe(e){return l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 10.123 10.123",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.50195 1.53809H5.62109V0H6.75098V1.53809H7.5293L7.64258 1.54395C8.19939 1.60066 8.63379 2.0708 8.63379 2.64258V3.37305H10.123V4.50195H8.63379V5.62109H10.123V6.75H8.63379V7.57812L8.62891 7.69141C8.57589 8.2109 8.16211 8.62387 7.64258 8.67676L7.5293 8.68262H6.75098V10.123H5.62109V8.68262H4.50195V10.123H3.37305V8.68262H2.59375L2.48047 8.67676C1.96102 8.62383 1.54817 8.21082 1.49512 7.69141L1.48926 7.57812V6.75H0V5.62109H1.48926V4.50195H0V3.37305H1.48926V2.64258C1.48926 2.07084 1.92371 1.60071 2.48047 1.54395L2.59375 1.53809H3.37305V0H4.50195V1.53809ZM2.61914 7.55273H7.50488V2.66699H2.61914V7.55273Z",fill:"currentColor"})})}const Rwt=e=>l.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:[l.jsxs("g",{clipPath:"url(#clip0_1480_1723)",children:[l.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"}),l.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"}),l.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"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_1480_1723",children:l.jsx("rect",{width:"180",height:"107.763",fill:"white",transform:"translate(0.0625)"})})})]}),NXn=e=>l.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:l.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"})}),AXn=e=>l.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:l.jsx("g",{transform:"translate(0,2)",children:l.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"})})}),Pwt=e=>l.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:l.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}})}),IXn=e=>l.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",width:"17",height:"18",fill:"none",...e,children:[l.jsx("mask",{id:"mask0_174_2406",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"17",height:"18",children:l.jsx("path",{d:"M17 0.5H0V17.5H17V0.5Z",fill:"white"})}),l.jsxs("g",{mask:"url(#mask0_174_2406)",children:[l.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"}),l.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"}),l.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"})]})]}),RXn=e=>l.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:[l.jsx("mask",{id:"mask0_4345_1846",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"160",height:"59",style:{maskType:"luminance"},children:l.jsx("path",{d:"M0.273438 0.219727H159.216V58.1817H0.273438V0.219727Z",fill:"white"})}),l.jsx("g",{mask:"url(#mask0_4345_1846)",children:l.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"})})]}),PXn=e=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 34 21",fill:"none",...e,children:l.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"})}),MXn=e=>l.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:[l.jsx("rect",{x:"15",y:"1",width:"32",height:"32",fill:"#FFCD00",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"143",y:"1",width:"32",height:"32",fill:"#FFCD00",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"15",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"47",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"111",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"143",y:"33",width:"32",height:"32",fill:"#FFA400",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"15",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"47",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"79",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"111",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"143",y:"65",width:"32",height:"32",fill:"#FF7100",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"15",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"79",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"143",y:"97",width:"32",height:"32",fill:"#FF4902",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"15",y:"129",width:"32",height:"32",fill:"#FF0006",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{x:"143",y:"129",width:"32",height:"32",fill:"#FF0006",stroke:"#636363","stroke-opacity":"0.2",strokeWidth:"0.5"}),l.jsx("rect",{y:"1",width:"16",height:"160",fill:"black"}),l.jsx("rect",{x:"63",y:"97",width:"16",height:"32",fill:"black"}),l.jsx("rect",{x:"95",y:"33",width:"16",height:"32",fill:"black"}),l.jsx("rect",{x:"127",y:"1",width:"16",height:"32",fill:"black"}),l.jsx("rect",{x:"127",y:"97",width:"16",height:"64",fill:"black"})]}),$Xn=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"128",height:"113",viewBox:"0 0 128 113",children:[l.jsxs("g",{clipPath:"url(#clip0_236_138)",...e,children:[l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_236_138",children:l.jsx("rect",{width:"128",height:"112.635",fill:"white"})})})]}),C5e=e=>l.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:l.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"})}),DXn=e=>l.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:l.jsxs("g",{children:[l.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"}),l.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"}),l.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"}),l.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"})]})}),LXn=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 9.55888 8.30616",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M0 7.18794V1.11823C-4.80684e-08 0.5005 0.5005 2.79299e-06 1.11823 0H3.17924C3.48658 0 3.78038 0.126314 3.99163 0.349532L5.09347 1.5135C5.14625 1.56923 5.21948 1.60085 5.29623 1.60088H8.44065C9.05838 1.60088 9.55888 2.10206 9.55888 2.7198V7.18794C9.55888 7.80567 9.05838 8.30616 8.44065 8.30616H1.11823C0.500524 8.30614 4.41663e-06 7.80565 0 7.18794ZM0.838331 7.18794C0.838332 7.34235 0.963819 7.46781 1.11823 7.46783H8.44065C8.59509 7.46783 8.72055 7.34237 8.72055 7.18794V2.7198C8.72055 2.56536 8.59509 2.4399 8.44065 2.4399H5.29623C4.98896 2.43986 4.69506 2.31353 4.48384 2.09037L3.38268 0.925714C3.32987 0.869949 3.25604 0.838331 3.17924 0.838331H1.11823C0.963799 0.838334 0.838331 0.963798 0.838331 1.11823V7.18794Z",fill:"currentColor"})}),zXn=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 11.185 11.185",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.13324 2.7965L2.18203 2.84592C1.82485 3.28847 1.55755 3.79653 1.39512 4.34155H2.38658C2.56011 3.8986 2.82333 3.49631 3.15971 3.15992C3.4961 2.82353 3.8984 2.56031 4.34134 2.38679V1.39533C3.79632 1.55775 3.28827 1.82506 2.84571 2.18224L2.7963 2.13345L1.85801 1.19516L1.52648 0.863634L0.863426 1.52669L1.19495 1.85822L2.13324 2.7965ZM9.00275 8.33927C9.35991 7.89671 9.62722 7.38866 9.78966 6.84365H8.7982C8.62471 7.28661 8.3615 7.68892 8.02511 8.02531C7.68871 8.3617 7.2864 8.62491 6.84344 8.79841V9.78987C7.38847 9.62746 7.89652 9.36015 8.33907 9.00296L8.38848 9.05175L9.32677 9.99003L9.6583 10.3216L10.3214 9.65851L9.98983 9.32698L9.05154 8.38869L9.00275 8.33927ZM9.00275 2.84592C9.35995 3.28846 9.62726 3.79651 9.78966 4.34155H8.7982C8.62467 3.8986 8.36145 3.49631 8.02506 3.15992C7.68868 2.82353 7.28638 2.56031 6.84344 2.38679V1.39533C7.38846 1.55775 7.89651 1.82506 8.33907 2.18224L8.38848 2.13345L9.32677 1.19516L9.6583 0.863634L10.3214 1.52669L9.98983 1.85822L9.05154 2.7965L9.00275 2.84592ZM1.39512 6.84365H2.38658C2.56011 7.28659 2.82333 7.68888 3.15971 8.02527C3.4961 8.36166 3.8984 8.62488 4.34134 8.79841V9.78987C3.79631 9.62747 3.28825 9.36016 2.84571 9.00296L2.7963 9.05175L1.85801 9.99003L1.52648 10.3216L0.863426 9.65851L1.19495 9.32698L2.13324 8.38869L2.18203 8.33927C1.82485 7.89672 1.55755 7.38867 1.39512 6.84365ZM5.59239 6.84365C5.92419 6.84365 6.2424 6.71184 6.47701 6.47722C6.71163 6.2426 6.84344 5.9244 6.84344 5.5926C6.84344 5.2608 6.71163 4.94259 6.47701 4.70797C6.2424 4.47336 5.92419 4.34155 5.59239 4.34155C5.26059 4.34155 4.94238 4.47336 4.70776 4.70797C4.47315 4.94259 4.34134 5.2608 4.34134 5.5926C4.34134 5.9244 4.47315 6.2426 4.70776 6.47722C4.94238 6.71184 5.26059 6.84365 5.59239 6.84365Z",fill:"currentColor"})}),FXn=e=>l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 8.94379 8.92126",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M6.13251 5.43413C6.51629 5.43413 6.82744 5.74533 6.82748 6.1291C6.82748 6.5129 6.51631 6.82407 6.13251 6.82407C5.74877 6.824 5.43754 6.51286 5.43754 6.1291C5.43759 5.74537 5.74879 5.4342 6.13251 5.43413Z",fill:"currentColor"}),l.jsx("path",{d:"M5.92771 2.29722C6.13122 2.09376 6.46147 2.09379 6.665 2.29722C6.86843 2.50075 6.86846 2.831 6.665 3.03451L3.03724 6.66227C2.83373 6.86578 2.5035 6.86572 2.29995 6.66227C2.0965 6.45872 2.09644 6.12849 2.29995 5.92498L5.92771 2.29722Z",fill:"currentColor"}),l.jsx("path",{d:"M2.842 2.12791C3.22572 2.12799 3.53694 2.43914 3.53696 2.82288C3.53696 3.20664 3.22573 3.51777 2.842 3.51785C2.45819 3.51785 2.14703 3.20668 2.14703 2.82288C2.14705 2.4391 2.45821 2.12791 2.842 2.12791Z",fill:"currentColor"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.38455 0.00887484C8.26052 0.0979278 8.94379 0.837945 8.94379 1.73742V7.18384C8.94369 8.08322 8.26046 8.82334 7.38455 8.91238L7.20705 8.92126H1.73742L1.55992 8.91238C0.683828 8.82351 0.000101213 8.08336 0 7.18384V1.73742C0 0.837813 0.683761 0.0977507 1.55992 0.00887484L1.73742 0H7.20705L7.38455 0.00887484ZM1.73742 0.839013C1.24121 0.839013 0.839013 1.24121 0.839013 1.73742V7.18384C0.839121 7.67996 1.24128 8.08293 1.73742 8.08293H7.20705C7.70305 8.08276 8.10535 7.67985 8.10546 7.18384V1.73742C8.10546 1.24131 7.70312 0.83918 7.20705 0.839013H1.73742Z",fill:"currentColor"})]}),BXn=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 8.64637 9.45103",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M7.80735 5.87241C7.63209 5.97219 7.43696 6.06166 7.22844 6.13866C6.46456 6.42068 5.43714 6.58649 4.32296 6.58649C3.20873 6.58649 2.18135 6.4207 1.41747 6.13866C1.20889 6.06164 1.01385 5.97223 0.838558 5.87241V7.59003C0.838558 7.62341 0.855765 7.70759 1.00172 7.83512C1.14707 7.96201 1.38219 8.09563 1.70829 8.21605C2.3572 8.45563 3.28149 8.61268 4.32296 8.61269C5.36456 8.61269 6.28937 8.45568 6.9383 8.21605C7.26428 8.09566 7.49888 7.96198 7.64419 7.83512C7.79024 7.70754 7.80735 7.62342 7.80735 7.59003V5.87241ZM7.80735 3.00789C7.63214 3.10763 7.4369 3.19647 7.22844 3.27345C6.46455 3.55549 5.43719 3.72129 4.32296 3.72129C3.20868 3.72128 2.18136 3.55552 1.41747 3.27345C1.20896 3.19645 1.01381 3.10766 0.838558 3.00789V4.72551C0.838558 4.7589 0.855657 4.84301 1.00172 4.97059C1.14707 5.09749 1.38219 5.23111 1.70829 5.35153C2.3572 5.59109 3.28154 5.74747 4.32296 5.74748C5.36456 5.74748 6.28937 5.59116 6.9383 5.35153C7.26432 5.23112 7.49887 5.09747 7.64419 4.97059C7.7536 4.87505 7.79089 4.80404 7.80257 4.76033L7.80735 4.72551V3.00789ZM7.80735 1.86099C7.80735 1.82758 7.79045 1.74291 7.64419 1.61522C7.49887 1.48838 7.26421 1.35534 6.9383 1.23497C6.28937 0.995339 5.36456 0.838331 4.32296 0.838331C3.28149 0.83834 2.3572 0.995383 1.70829 1.23497C1.38219 1.35539 1.14707 1.48832 1.00172 1.61522C0.855475 1.7429 0.838558 1.82758 0.838558 1.86099C0.838673 1.89462 0.855968 1.97882 1.00172 2.10607C1.14707 2.23297 1.38219 2.3659 1.70829 2.48632C2.3572 2.7259 3.28149 2.88295 4.32296 2.88296C5.36456 2.88296 6.28937 2.72595 6.9383 2.48632C7.26421 2.36595 7.49887 2.23291 7.64419 2.10607C7.78996 1.97881 7.80724 1.89462 7.80735 1.86099ZM8.64637 7.59003C8.64637 7.95465 8.44458 8.25006 8.1958 8.46728C7.94608 8.68529 7.60876 8.86274 7.22844 9.00318C6.46455 9.28522 5.43718 9.45102 4.32296 9.45102C3.20869 9.45101 2.18135 9.28525 1.41747 9.00318C1.03715 8.86274 0.699831 8.68529 0.450113 8.46728C0.201377 8.25007 0.000227451 7.9546 0.000227451 7.59003V1.86099C0.000227451 1.49643 0.201388 1.20095 0.450113 0.983742C0.699831 0.765728 1.03715 0.588275 1.41747 0.447838C2.18136 0.165769 3.20868 8.74396e-06 4.32296 0C5.43719 0 6.46455 0.165797 7.22844 0.447838C7.60876 0.588275 7.94608 0.765728 8.1958 0.983742C8.44457 1.20096 8.64637 1.49638 8.64637 1.86099V7.59003Z",fill:"currentColor"})}),Mwt=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 9.83952 9.3295",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.67171 0.838331H6.70163V4.05307L9.68767 8.09999C10.0634 8.6093 9.69869 9.32932 9.06643 9.3295H0.772551C0.140289 9.3293 -0.223777 8.60929 0.151995 8.09999L3.13804 4.05307V0.838331H2.17136V0H7.67171V0.838331ZM3.97705 4.32955L3.89513 4.44015L2.34681 6.53802H7.49285L5.94453 4.44015L5.86261 4.32955V0.860859H3.97705V4.32955Z",fill:"currentColor"})}),UXn=e=>l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 8.98824 8.33142",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M5.70011e-05 6.409V0H1.04865V6.409C1.04875 6.89152 1.43994 7.28283 1.92248 7.28283H8.3581V8.33142H1.92248C0.860814 8.33142 0.000149953 7.47065 5.70011e-05 6.409Z",fill:"currentColor"}),l.jsx("path",{d:"M8.08006 0.945713C8.27714 0.733828 8.6087 0.72151 8.82077 0.918405C9.03289 1.11551 9.04518 1.44767 8.84808 1.6598L6.08595 4.63218C5.90127 4.83085 5.59525 4.85557 5.38074 4.68953L4.03177 3.64571L2.74765 5.07183C2.55386 5.28688 2.22206 5.30441 2.00694 5.11074C1.79189 4.91695 1.77435 4.58515 1.96803 4.37003L3.57915 2.58278L3.65357 2.51451C3.83887 2.37494 4.09997 2.37165 4.28982 2.51861L5.64358 3.56652L8.08006 0.945713Z",fill:"currentColor"})]}),hp=({children:e,className:t,onClick:n})=>l.jsx("div",{tabIndex:n?0:void 0,onKeyDown:r=>{n&&(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),n?.())},className:X("flex gap-3 group/entity bg-surface3 rounded-xl border border-border1 py-3 px-4",n&&"cursor-pointer hover:bg-surface4 transition-all",t),onClick:n,children:e}),$wt=({children:e,className:t,style:n})=>l.jsx(Be,{size:"lg",className:X("text-neutral3 mt-1 shrink-0",t),style:n,children:e}),mp=({children:e,className:t})=>l.jsx(ge,{as:"p",variant:"ui-lg",className:X("text-neutral6 font-medium",t),children:e}),gp=({children:e,className:t})=>l.jsx(ge,{as:"div",variant:"ui-sm",className:X("text-neutral3",t),children:e}),vp=({children:e,className:t})=>l.jsx("div",{className:X("flex-1 w-full",t),children:e});function na({resource:e,title:t,description:n,actionSlot:r,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 l.jsx(oi,{className:s,iconSlot:l.jsx(Be,{size:"lg",className:"text-neutral3",children:l.jsx(ryn,{})}),titleSlot:t??a,descriptionSlot:n??i,actionSlot:r})}function ua({title:e,description:t,className:n}){const[r,s]=y.useState(!1),a=Ze(),i=y.useCallback(async()=>{try{s(!0);const{baseUrl:o="",apiPrefix:c}=a.options||{},u=(c||"/api").trim(),d=(u.startsWith("/")?u:`/${u}`).replace(/\/$/,""),f=new URLSearchParams({redirect_uri:window.location.href}),p=`${o}${d}/auth/sso/login?${f}`,h=await fetch(p,{credentials:"include",headers:{"Content-Type":"application/json"}});if(h.ok){const m=await h.json();window.location.href=m.url}}finally{s(!1)}},[a]);return l.jsx(oi,{className:n,iconSlot:l.jsx(Be,{size:"lg",className:"text-neutral3",children:l.jsx(Vvn,{})}),titleSlot:e??"Session Expired",descriptionSlot:t??"Your session has expired. Please log in again to continue.",actionSlot:l.jsx(de,{variant:"default",onClick:i,disabled:r,children:r?"Redirecting...":"Log in"})})}const L0e=({children:e,border:t=!0,className:n})=>l.jsx("header",{className:X("h-header-default z-50 flex w-full items-center gap-4 bg-transparent px-3",{"border-b border-border1":t},n),children:e}),Dwt=({children:e})=>l.jsx(ge,{as:"h1",variant:"ui-md",className:"text-neutral6 flex items-center gap-2",children:e}),qXn=({children:e})=>l.jsx("div",{className:"ml-auto flex items-center gap-3",children:e}),Ky=e=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 34 21",fill:"none",...e,children:l.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"})}),VXn={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},HXn=({className:e,children:t,size:n="default",style:r})=>l.jsx("table",{className:X("w-full",VXn[n],e),style:r,children:t}),ZXn=({className:e,children:t})=>l.jsx("thead",{children:l.jsx("tr",{className:X("h-table-header border-b border-border1 bg-surface2/80",e),children:t})}),WXn=({className:e,children:t,...n})=>l.jsx("th",{className:X("text-neutral2 text-ui-xs h-full whitespace-nowrap text-left font-medium uppercase tracking-wide first:pl-3 last:pr-3",e),...n,children:t}),GXn=({className:e,children:t,...n})=>l.jsx("tbody",{className:X("",e),...n,children:t}),QXn=y.forwardRef(({className:e,children:t,selected:n=!1,style:r,onClick:s,isActive:a=!1,...i},o)=>{const c=y.useRef(null);y.useEffect(()=>{o&&(typeof o=="function"?o(c.current):o.current=c.current)},[o]),y.useEffect(()=>{a&&c.current&&(c.current.focus(),c.current.scrollIntoView({block:"nearest"}))},[a]);const u=d=>{d.key==="Enter"&&s&&s()};return l.jsx("tr",{className:X("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",n&&"bg-surface4",s&&"cursor-pointer",e),style:r,onClick:s,ref:c,tabIndex:s?0:void 0,onKeyDown:u,"data-active":a||void 0,...i,children:t})}),YXn=({className:e,children:t,...n})=>l.jsx("td",{className:X("text-neutral5 first:pl-3 last:pr-3",e),...n,children:l.jsx("div",{className:X("flex h-full w-full shrink-0 items-center"),children:t})}),XXn=Mh(X("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:X(xwt,R0e,P0e),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"}}),iu=y.forwardRef(({className:e,size:t,testId:n,variant:r,error:s,...a},i)=>l.jsx("textarea",{className:X(XXn({variant:r,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":n,ref:i,"aria-invalid":s,...a}));iu.displayName="Textarea";const KXn=axn,JXn=ixn,Lwt=oxn;function Gt({open:e,onOpenChange:t,children:n}){return l.jsx(KXn,{open:e,onOpenChange:t,children:n})}const z0e=y.forwardRef(({className:e,...t},n)=>l.jsx(Klt,{ref:n,className:X("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));z0e.displayName=Klt.displayName;const zwt=y.forwardRef(({className:e,...t},n)=>l.jsxs(Lwt,{children:[l.jsx(z0e,{}),l.jsx(Jlt,{ref:n,className:X("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})]}));zwt.displayName=Jlt.displayName;const Fwt=({className:e,...t})=>l.jsx("div",{className:X("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});Fwt.displayName="AlertDialogHeader";const Bwt=({className:e,...t})=>l.jsx("div",{className:X("flex flex-col-reverse gap-1.5 px-4 py-2.5 sm:flex-row sm:justify-end",e),...t});Bwt.displayName="AlertDialogFooter";const Uwt=({className:e,...t})=>l.jsx("div",{className:X("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});Uwt.displayName="AlertDialogBody";const qwt=y.forwardRef(({className:e,...t},n)=>l.jsx(nct,{ref:n,className:X("text-ui-md font-medium",e),...t}));qwt.displayName=nct.displayName;const Vwt=y.forwardRef(({className:e,...t},n)=>l.jsx(rct,{ref:n,className:X("text-ui-sm text-neutral3",e),...t}));Vwt.displayName=rct.displayName;const Hwt=y.forwardRef(({className:e,...t},n)=>l.jsx(ect,{ref:n,className:X(M0e({variant:"primary",size:"default"}),e),...t}));Hwt.displayName=ect.displayName;const Zwt=y.forwardRef(({className:e,...t},n)=>l.jsx(tct,{ref:n,className:X(M0e({variant:"default",size:"default"}),e),...t}));Zwt.displayName=tct.displayName;Gt.Trigger=JXn;Gt.Portal=Lwt;Gt.Overlay=z0e;Gt.Content=zwt;Gt.Header=Fwt;Gt.Footer=Bwt;Gt.Body=Uwt;Gt.Title=qwt;Gt.Description=Vwt;Gt.Action=Hwt;Gt.Cancel=Zwt;const oo=y.forwardRef(({className:e,...t},n)=>l.jsx(Yve,{ref:n,className:X("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",Tr.all,"hover:border-neutral5 hover:shadow-md",pq,"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:l.jsx(oct,{className:X("flex items-center justify-center text-current","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:l.jsx(jb,{className:"h-3.5 w-3.5 stroke-3"})})}));oo.displayName=Yve.displayName;const Mm=mxn,wh=Oe.forwardRef(({className:e,children:t,...n},r)=>l.jsx(Kve,{ref:r,className:X("-outline-offset-2",Tr.colors,Fw.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-state=open]>svg]:rotate-90",e),...n,children:t}));wh.displayName=Kve.displayName;const Sh=Oe.forwardRef(({className:e,children:t,...n},r)=>l.jsx(eye,{ref:r,className:X("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),...n,children:t}));Sh.displayName=eye.displayName;const Cr={root:"flex flex-col gap-1.5",trigger:X("inline-flex w-full min-w-32 select-none items-center justify-between gap-1.5 whitespace-nowrap cursor-pointer","rounded-lg border bg-transparent px-2.5 text-ui-smd leading-ui-sm text-neutral4","outline-none transition-colors duration-normal ease-out-custom","focus:outline-none focus-visible:outline-none","disabled:cursor-not-allowed disabled:opacity-50"),triggerDefault:X("border-border1","hover:bg-surface2 hover:text-neutral6 hover:border-border2 active:bg-surface3","focus-visible:border-border2","data-[popup-open]:bg-surface3 data-[popup-open]:text-neutral6 data-[popup-open]:border-border2"),triggerGhost:X("border-transparent","hover:bg-surface2 hover:text-neutral6 active:bg-surface3","data-[popup-open]:bg-surface3 data-[popup-open]:text-neutral6"),triggerLink:X("border-transparent px-0","hover:text-neutral6","data-[popup-open]:text-neutral6"),triggerError:"border-accent2 hover:border-accent2 focus-visible:border-accent2",chevron:"ml-2 h-4 w-4 shrink-0 text-neutral3 opacity-70",placeholder:"text-neutral3",popup:X("min-w-(--anchor-width) w-max max-w-(--available-width) rounded-xl border border-border1 bg-surface3 text-neutral4","shadow-dialog","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:X("flex items-center border-b border-border1 px-2.5 py-1.5",Tr.colors),searchIcon:X("mr-2 h-3.5 w-3.5 shrink-0 text-neutral3",Tr.colors),searchInput:X("flex h-7 w-full rounded-md bg-transparent py-1 text-ui-smd leading-ui-sm text-neutral6","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-none focus:outline-none focus-visible:outline-none",Tr.colors),empty:"not-empty:block hidden py-4 text-center text-ui-smd text-neutral3",list:"max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1",item:X("group/item relative flex cursor-pointer select-none items-center gap-2 rounded-md","pl-2.5 pr-2 py-1.5 min-h-8","text-ui-smd leading-ui-sm text-neutral4","outline-none focus:outline-none focus-visible:outline-none",Tr.colors,"data-highlighted:bg-surface4 data-highlighted:text-neutral6","data-selected:text-neutral6"),itemMulti:X("relative flex cursor-pointer select-none items-center gap-2.5 rounded-md","pl-2 pr-2.5 py-1.5 min-h-8","text-ui-smd leading-ui-sm text-neutral4","outline-none focus:outline-none focus-visible:outline-none",Tr.colors,"data-highlighted:bg-surface4 data-highlighted:text-neutral6","data-selected:text-neutral6"),itemRightSlot:"ml-auto flex items-center gap-2 shrink-0",checkContainer:"flex h-4 w-4 shrink-0 items-center justify-center text-accent1",checkIcon:"h-3.5 w-3.5",checkbox:"flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border",checkboxSelected:"bg-accent1 border-accent1",checkboxUnselected:"border-border2",checkboxIcon:"h-3 w-3 text-surface1",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-ui-sm text-neutral3 truncate",optionEnd:"ml-auto flex items-center shrink-0",error:"text-ui-sm text-accent2"},eKn={default:Cr.triggerDefault,ghost:Cr.triggerGhost,link:Cr.triggerLink};function jc({options:e,value:t,onValueChange:n,placeholder:r="Select option...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:o=!1,variant:c="default",size:u="default",open:d,onOpenChange:f,container:p,error:h}){const m=e.find(v=>v.value===t)??null,g=v=>{v&&n?.(v.value)};return l.jsxs("div",{className:Cr.root,children:[l.jsxs(Sct,{items:e,value:m,onValueChange:g,disabled:o,open:d,onOpenChange:f,children:[l.jsxs(Nct,{className:X(Cr.trigger,eKn[c],no[u],h&&Cr.triggerError,i),children:[l.jsxs("span",{className:"flex items-center gap-2 min-w-0 flex-1",children:[m?.start,l.jsx("span",{className:"truncate",children:l.jsx($xn,{placeholder:r})})]}),l.jsx(qM,{className:Cr.chevron})]}),l.jsx(Pct,{container:p,children:l.jsx(Mct,{align:"start",sideOffset:4,className:Cr.positioner,children:l.jsxs($ct,{className:Cr.popup,children:[l.jsxs("div",{className:Cr.searchContainer,children:[l.jsx(FC,{className:Cr.searchIcon}),l.jsx(jct,{className:Cr.searchInput,placeholder:s})]}),l.jsx(Bct,{className:Cr.empty,children:a}),l.jsx(Ict,{className:Cr.list,children:v=>l.jsxs(Fct,{value:v,className:Cr.item,children:[v.start,l.jsxs("span",{className:Cr.optionText,children:[l.jsx("span",{className:Cr.optionLabel,children:v.label}),v.description&&l.jsx("span",{className:Cr.optionDescription,children:v.description})]}),l.jsxs("span",{className:Cr.itemRightSlot,children:[v.end?l.jsx("div",{className:Cr.optionEnd,children:v.end}):null,l.jsx("span",{className:Cr.checkContainer,children:l.jsx(p0n,{children:l.jsx(jb,{className:Cr.checkIcon})})})]})]},v.value)})]})})})]}),h&&l.jsx("span",{className:Cr.error,children:h})]})}function Wwt({options:e,value:t=[],onValueChange:n,placeholder:r="Select options...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:i,disabled:o=!1,size:c="md",open:u,onOpenChange:d,container:f,error:p}){const h=e.filter(v=>t.includes(v.value)),m=v=>{v&&n?.(v.map(b=>b.value))},g=h.length===0?r:`${h.length} selected`;return l.jsxs("div",{className:Cr.root,children:[l.jsxs(Sct,{multiple:!0,items:e,value:h,onValueChange:m,disabled:o,open:u,onOpenChange:d,children:[l.jsxs(Nct,{className:X(Cr.trigger,no[c],p&&Cr.triggerError,i),children:[l.jsx("span",{className:X("truncate",h.length===0&&Cr.placeholder),children:g}),l.jsx(qM,{className:Cr.chevron})]}),l.jsx(Pct,{container:f,children:l.jsx(Mct,{align:"start",sideOffset:4,className:Cr.positioner,children:l.jsxs($ct,{className:Cr.popup,children:[l.jsxs("div",{className:Cr.searchContainer,children:[l.jsx(FC,{className:Cr.searchIcon}),l.jsx(jct,{className:Cr.searchInput,placeholder:s})]}),l.jsx(Bct,{className:Cr.empty,children:a}),l.jsx(Ict,{className:Cr.list,children:v=>{const b=t.includes(v.value);return l.jsxs(Fct,{value:v,className:Cr.itemMulti,children:[l.jsx("span",{className:X(Cr.checkbox,b?Cr.checkboxSelected:Cr.checkboxUnselected),children:b&&l.jsx(jb,{className:Cr.checkboxIcon})}),l.jsxs("span",{className:Cr.optionContent,children:[v.start,l.jsxs("span",{className:Cr.optionText,children:[l.jsx("span",{className:Cr.optionLabel,children:v.label}),v.description&&l.jsx("span",{className:Cr.optionDescription,children:v.description})]}),v.end?l.jsx("div",{className:Cr.optionEnd,children:v.end}):null]})]},v.value)}})]})})})]}),p&&l.jsx("span",{className:Cr.error,children:p})]})}const Lr=WM,Gwt=Llt,tKn=GM,nKn=XM,Qwt=y.forwardRef(({className:e,...t},n)=>l.jsx(fj,{ref:n,className:X("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));Qwt.displayName=fj.displayName;const Ir=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(tKn,{children:[l.jsx(Qwt,{}),l.jsxs(pj,{ref:r,className:X("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),...n,children:[t,l.jsx(XM,{asChild:!0,children:l.jsx(de,{variant:"ghost",size:"sm",className:"absolute top-3 right-3","aria-label":"Close",children:l.jsx(Fd,{})})})]})]}));Ir.displayName=pj.displayName;const zr=({className:e,...t})=>l.jsx("div",{className:X("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});zr.displayName="DialogHeader";const ap=({className:e,...t})=>l.jsx("div",{className:X("flex flex-col-reverse gap-1.5 px-4 py-2.5 sm:flex-row sm:justify-end",e),...t});ap.displayName="DialogFooter";const ns=({className:e,...t})=>l.jsx("div",{className:X("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});ns.displayName="DialogBody";const Rr=y.forwardRef(({className:e,...t},n)=>l.jsx(QM,{ref:n,className:X("text-ui-md font-medium",e),...t}));Rr.displayName=QM.displayName;const ha=y.forwardRef(({className:e,...t},n)=>l.jsx(YM,{ref:n,className:X("sr-only",e),...t}));ha.displayName=YM.displayName;const Ywt=y.forwardRef(({className:e,...t},n)=>l.jsx(Gd,{ref:n,className:X("flex h-full w-full flex-col overflow-hidden rounded-xl bg-surface3 text-neutral4",e),...t}));Ywt.displayName=Gd.displayName;const rKn=({children:e,title:t="Command Palette",description:n="Search for commands and actions",...r})=>{const s=y.useCallback((i,o)=>{const c=i.toLowerCase();return o.toLowerCase().split(/\s+/).filter(Boolean).every(p=>c.includes(p))?1:0},[]),a=y.useCallback(i=>{i.stopPropagation()},[]);return l.jsx(Lr,{...r,children:l.jsxs(Ir,{className:"overflow-hidden p-0",children:[l.jsx(Rr,{className:"sr-only",children:t}),l.jsx(ha,{className:"sr-only",children:n}),l.jsx(Ywt,{filter:s,onKeyDown:a,className:X("**:[[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})]})})},Xwt=y.forwardRef(({className:e,...t},n)=>l.jsxs("div",{className:X("flex items-center border-b border-border1 px-3",Tr.colors),"cmdk-input-wrapper":"",children:[l.jsx(FC,{className:X("mr-2 h-4 w-4 shrink-0 text-neutral3",Tr.colors)}),l.jsx(Gd.Input,{ref:n,className:X("flex h-10 w-full rounded-md bg-transparent py-3 text-ui-smd leading-ui-sm text-neutral6","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-none focus:outline-none focus-visible:outline-none",Tr.colors,e),...t})]}));Xwt.displayName=Gd.Input.displayName;const Kwt=y.forwardRef(({className:e,...t},n)=>l.jsx(Gd.List,{ref:n,className:X("max-h-dropdown-max-height overflow-y-auto overflow-x-hidden",e),...t}));Kwt.displayName=Gd.List.displayName;const Jwt=y.forwardRef((e,t)=>l.jsx(Gd.Empty,{ref:t,className:"py-6 text-center text-ui-smd text-neutral3",...e}));Jwt.displayName=Gd.Empty.displayName;const Vx=y.forwardRef(({className:e,...t},n)=>l.jsx(Gd.Group,{ref:n,className:X("overflow-hidden p-1 text-neutral4","**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:pt-1.5 **:[[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:text-ui-xs [&_[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:uppercase **:[[cmdk-group-heading]]:tracking-wider **:[[cmdk-group-heading]]:text-neutral3",e),...t}));Vx.displayName=Gd.Group.displayName;const q1=y.forwardRef(({className:e,...t},n)=>l.jsx(Gd.Separator,{ref:n,className:X("-mx-1 h-px bg-border1",e),...t}));q1.displayName=Gd.Separator.displayName;const wl=y.forwardRef(({className:e,...t},n)=>l.jsx(Gd.Item,{ref:n,className:X("relative flex cursor-pointer select-none items-center gap-2.5 rounded-lg px-2 py-1.5 text-ui-smd leading-ui-sm text-neutral4","outline-none focus:outline-none focus-visible:outline-none",Tr.colors,"data-[selected=true]:bg-surface4 data-[selected=true]:text-neutral6","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-neutral3 data-[selected=true]:[&_svg]:text-neutral6",e),...t}));wl.displayName=Gd.Item.displayName;const e1t=({className:e,...t})=>l.jsx("span",{className:X("ml-auto text-ui-xs tabular-nums tracking-wider text-neutral3",e),...t});e1t.displayName="CommandShortcut";const Ii=xwn,Ri=wwn,wi=y.forwardRef(({className:e,children:t,size:n="default",...r},s)=>l.jsxs(Sut,{ref:s,className:X("inline-flex w-full cursor-pointer select-none items-center justify-between gap-1.5 whitespace-nowrap",no[n],"rounded-lg border border-border1 bg-transparent px-2.5 text-ui-smd leading-ui-sm text-neutral4","outline-none transition-colors duration-normal ease-out-custom","hover:bg-surface3 hover:text-neutral6 hover:border-border2 active:bg-surface4","focus:outline-none focus-visible:outline-none focus-visible:border-border2","data-[state=open]:bg-surface3 data-[state=open]:text-neutral6 data-[state=open]:border-border2","data-[placeholder]:text-neutral3","disabled:cursor-not-allowed disabled:opacity-50","[&>span]:truncate",e),...r,children:[t,l.jsx(Swn,{asChild:!0,children:l.jsx(Dve,{className:X("h-4 w-4 shrink-0 text-neutral3 opacity-70",Tr.colors)})})]}));wi.displayName=Sut.displayName;const Si=y.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>l.jsx(kwn,{children:l.jsx(kut,{ref:s,className:X("relative z-50 min-w-32 max-h-dropdown-max-height overflow-y-auto overflow-x-hidden rounded-xl border border-border1 bg-surface3 text-neutral4 shadow-dialog 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-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:l.jsx(_wn,{className:X("p-1",n==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t})})}));Si.displayName=kut.displayName;const vs=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(_ut,{ref:r,className:X("relative flex w-full cursor-pointer select-none items-center gap-2.5 rounded-lg py-1.5 pl-2 pr-8 text-neutral4 text-ui-smd leading-ui-sm","outline-none focus:outline-none focus-visible:outline-none",Tr.colors,"hover:bg-surface4 hover:text-neutral6","focus:bg-surface4 focus:text-neutral6","data-[highlighted]:bg-surface4 data-[highlighted]:text-neutral6","data-[state=checked]:text-neutral6","data-disabled:pointer-events-none data-disabled:opacity-50",e),...n,children:[l.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(Ewn,{children:l.jsx(jb,{className:"h-4 w-4 text-neutral6"})})}),l.jsx(Own,{children:t})]}));vs.displayName=_ut.displayName;const ku=({children:e,defaultTab:t,value:n,onValueChange:r,className:s})=>l.jsx(Twn,{defaultValue:t,value:n,onValueChange:r?a=>r(a):void 0,className:X("overflow-y-auto",s),children:e}),sKn=Mh("flex items-center relative text-ui-lg",{variants:{variant:{line:"w-max min-w-full border-b border-border1",pill:"w-fit gap-1 rounded-full bg-surface2 p-1","pill-ghost":"w-fit gap-1 rounded-full p-1"}},defaultVariants:{variant:"line"}}),_u=({children:e,className:t,variant:n,sticky:r})=>{const s=n??"line";return l.jsx("div",{className:X("w-full overflow-x-auto",r&&"sticky top-0 z-10 bg-surface2"),children:l.jsxs(n1n,{"data-variant":s,className:X("group/tabs-list",sKn({variant:s}),t),children:[e,s==="line"&&l.jsx(c2e,{className:X("absolute bottom-0 left-0 bg-neutral3","w-[var(--active-tab-width)] h-0.5","transition-all duration-200 ease-in-out"),style:{transform:"translateX(var(--active-tab-left))"}}),(s==="pill"||s==="pill-ghost")&&l.jsx(c2e,{className:X("absolute top-1/2 left-0 z-0 rounded-full bg-surface4","w-[var(--active-tab-width)] h-[calc(100%-0.5rem)]","transition-all duration-200 ease-in-out"),style:{transform:"translateY(-50%) translateX(var(--active-tab-left))"}})]})})},Hr=({children:e,value:t,onClick:n,onClose:r,disabled:s,className:a})=>l.jsxs(Nwn,{value:t,disabled:s,className:X("text-ui-md font-normal text-neutral3","whitespace-nowrap shrink-0 flex items-center justify-center gap-1.5 outline-none cursor-pointer",Tr.colors,Fw.visible,"hover:text-neutral4","data-[active]:text-neutral5","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[disabled]:hover:text-neutral3","group-data-[variant=line]/tabs-list:py-2 group-data-[variant=line]/tabs-list:px-5","group-data-[variant=line]/tabs-list:border-b-2 group-data-[variant=line]/tabs-list:border-transparent","group-data-[variant=pill]/tabs-list:relative group-data-[variant=pill]/tabs-list:z-10","group-data-[variant=pill]/tabs-list:py-1 group-data-[variant=pill]/tabs-list:px-3","group-data-[variant=pill]/tabs-list:rounded-full","group-data-[variant=pill-ghost]/tabs-list:relative group-data-[variant=pill-ghost]/tabs-list:z-10","group-data-[variant=pill-ghost]/tabs-list:py-1 group-data-[variant=pill-ghost]/tabs-list:px-3","group-data-[variant=pill-ghost]/tabs-list:rounded-full",a),onClick:n,children:[e,r&&l.jsx("button",{onClick:i=>{i.stopPropagation(),r()},className:X("p-0.5 hover:bg-surface4 rounded",Tr.colors,"hover:text-neutral5"),"aria-label":"Close tab",children:l.jsx(Fd,{className:"w-3 h-3"})})]}),_s=({children:e,value:t,className:n})=>l.jsx(Bwn,{value:t,className:X("grid py-3 overflow-y-auto ring-offset-background",Fw.visible,n),children:e});function aKn({code:e,options:t,value:n,onValueChange:r,selector:s="select",fileName:a,lang:i,copyMessage:o,copyTooltip:c,className:u}){const d=t&&t.length>0,f=d&&s==="tabs",p=d&&s==="select",h=n??t?.[0]?.value;return l.jsxs("figure",{className:X("group relative flex w-full flex-col overflow-hidden rounded-2xl border border-border2/40 bg-surface2",u),children:[f&&t&&l.jsx(ku,{defaultTab:t[0].value,value:h,onValueChange:r??(()=>{}),children:l.jsx(_u,{children:t.map(m=>l.jsx(Hr,{value:m.value,children:m.label},m.value))})}),p&&t&&l.jsx("div",{className:"flex items-center border-b border-border2/40 px-2 py-1.5",children:l.jsxs(Ii,{value:h,onValueChange:r,children:[l.jsx(wi,{size:"sm",variant:"ghost",children:l.jsx(Ri,{})}),l.jsx(Si,{children:t.map(m=>l.jsx(vs,{value:m.value,children:m.label},m.value))})]})}),!d&&a&&l.jsx("div",{className:"flex items-center border-b border-border2/40 px-4 py-2",children:l.jsx("figcaption",{className:"font-mono text-ui-sm text-neutral4",children:a})}),l.jsxs("div",{className:"relative",children:[l.jsx(iKn,{code:e,lang:i}),l.jsx(la,{content:e,copyMessage:o,tooltip:c,size:"sm",className:X("absolute top-2 right-2 opacity-100 pointer-fine:opacity-0 group-hover:opacity-100 group-focus-within:opacity-100",Tr.opacity)})]})]})}function iKn({code:e,lang:t}){const[n,r]=y.useState(null);y.useEffect(()=>{if(!t){r(null);return}r(null);let a=!1;return Twt(e,t).then(i=>{!a&&i&&r(i)}).catch(()=>{}),()=>{a=!0}},[e,t]);const s="px-4 py-3 font-mono text-ui-sm text-neutral5 whitespace-pre-wrap break-all";return!t||!n?l.jsx("pre",{className:s,children:e}):l.jsx("pre",{className:s,children:l.jsx("code",{children:n.map((a,i)=>l.jsxs(y.Fragment,{children:[l.jsx("span",{children:a.map((o,c)=>l.jsx("span",{className:"text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",children:o.content},c))}),i!==n.length-1&&`
289
289
  `]},i))})})}function t1t({children:e,className:t}){return l.jsx("div",{className:X("border border-border1 rounded-xl px-4 py-3 bg-surface-overlay-soft",t),children:e})}const oKn=ySn,lKn=bSn,cKn=a$,uKn=SSn,dKn=xSn,F0e=X("relative flex cursor-pointer select-none items-center gap-2.5 rounded-lg px-2 py-1.5 text-ui-smd leading-ui-sm transition-colors text-neutral4 hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 data-[highlighted]:bg-surface4 data-[highlighted]:text-neutral6 data-disabled:pointer-events-none data-disabled:opacity-50 [&>span]:truncate [&_svg]:size-4 [&_svg]:shrink-0 outline-none focus:outline-none focus-visible:outline-none focus-visible:ring-0","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-60 [&:hover>svg]:opacity-100"),n1t=y.forwardRef(({className:e,children:t,...n},r)=>l.jsx(Tdt,{ref:r,className:X("cursor-pointer outline-none",e),...n,children:t}));n1t.displayName=Tdt.displayName;const r1t=y.forwardRef(({className:e,inset:t,children:n,...r},s)=>l.jsxs(Mdt,{ref:s,className:X(F0e,"data-[state=open]:bg-surface4",t&&"pl-8",e),...r,children:[n,l.jsx("span",{className:"ml-auto pl-2",children:l.jsx(Dve,{className:"-rotate-90 opacity-50"})})]}));r1t.displayName=Mdt.displayName;const s1t=y.forwardRef(({className:e,...t},n)=>l.jsx(a$,{children:l.jsx(FB,{ref:n,className:X("bg-surface3 text-neutral4 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 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 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 border-border1 p-1 shadow-dialog",e),...t})}));s1t.displayName=FB.displayName;const a1t=y.forwardRef(({className:e,container:t,sideOffset:n=8,...r},s)=>l.jsx(a$,{container:t,children:l.jsx(jdt,{ref:s,sideOffset:n,className:X("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 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 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 border-border1 p-1 shadow-dialog",e),...r})}));a1t.displayName=jdt.displayName;const i1t=y.forwardRef(({className:e,...t},n)=>l.jsx(Adt,{ref:n,className:X(F0e,e),...t}));i1t.displayName=Adt.displayName;const o1t=y.forwardRef(({className:e,children:t,checked:n,...r},s)=>l.jsxs(Idt,{ref:s,className:X(F0e,"w-full",e),checked:n,...r,children:[l.jsx("div",{className:"border border-border2 flex h-4 w-4 items-center justify-center rounded-sm",children:n&&l.jsx(jb,{})}),t]}));o1t.displayName=Idt.displayName;const l1t=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Rdt,{ref:r,className:X("relative flex cursor-pointer select-none items-center rounded-lg py-1.5 pl-8 pr-2 text-ui-smd leading-ui-sm transition-colors text-neutral4 hover:text-neutral6 focus:text-neutral6 hover:bg-surface4 focus:bg-surface4 data-[highlighted]:bg-surface4 data-[highlighted]:text-neutral6 data-disabled:pointer-events-none data-disabled:opacity-50 outline-none focus:outline-none focus-visible:outline-none focus-visible:ring-0",e),...n,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(wSn,{children:l.jsx(olt,{className:"h-2 w-2 fill-current"})})}),t]}));l1t.displayName=Rdt.displayName;const c1t=y.forwardRef(({className:e,inset:t,...n},r)=>l.jsx(Ndt,{ref:r,className:X("px-2 pt-1.5 pb-1 text-ui-xs font-medium uppercase tracking-wider text-neutral3",t&&"pl-8",e),...n}));c1t.displayName=Ndt.displayName;const u1t=y.forwardRef(({className:e,...t},n)=>l.jsx(Pdt,{ref:n,className:X("bg-border1 -mx-1 my-1 h-px",e),...t}));u1t.displayName=Pdt.displayName;const d1t=({className:e,...t})=>l.jsx("span",{className:X("ml-auto text-xs tracking-widest opacity-60",e),...t});d1t.displayName="DropdownMenuShortcut";function _t({open:e,onOpenChange:t,children:n,modal:r}){return l.jsx(oKn,{modal:r,open:e,onOpenChange:t,children:n})}_t.Trigger=n1t;_t.Content=a1t;_t.Group=lKn;_t.Portal=cKn;_t.Item=i1t;_t.CheckboxItem=o1t;_t.RadioItem=l1t;_t.Label=c1t;_t.Separator=u1t;_t.Shortcut=d1t;_t.Sub=uKn;_t.SubContent=s1t;_t.SubTrigger=r1t;_t.RadioGroup=dKn;const ZL=({label:e,children:t})=>l.jsxs("div",{className:"space-y-2",children:[l.jsx(ge,{as:"p",variant:"ui-md",className:"text-neutral3",children:e}),t]});function rs({className:e,...t}){return l.jsx("div",{className:X("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 f1t=({icon:e,title:t,isLoading:n,children:r})=>l.jsx("div",{className:"p-3 pb-1 w-full overflow-x-hidden",children:l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-3",children:[l.jsxs("div",{className:"text-neutral6 flex min-w-0 items-center gap-2",children:[l.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center",children:l.jsx(Be,{size:"lg",children:e})}),n?l.jsx(rs,{className:"h-3 w-32"}):l.jsx(ge,{variant:"header-md",as:"h2",className:"truncate font-medium",children:t})]}),r]})});function fKn({children:e,className:t}){return l.jsx("div",{className:X("grid gap-2 text-neutral4",t),children:e})}function pKn({children:e}){return l.jsxs("p",{className:X("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:[l.jsx(VM,{})," ",e]})}function hKn({children:e}){return l.jsx("p",{className:"text-neutral3 text-ui-sm",children:e})}function mKn({children:e,name:t,required:n,size:r="default",className:s}){return l.jsxs("label",{htmlFor:`input-${t}`,className:X("text-ui-smd text-neutral3 flex justify-between items-center ","in-[.horizontal-field-block]:grid in-[.horizontal-field-block]:content-start",{"text-ui-md":r==="bigger"},s),children:[e,n&&l.jsx("i",{className:"text-neutral2 text-xs",children:"(required)"})]})}function gKn({children:e,className:t,layout:n="vertical",labelColumnWidth:r}){return l.jsx("div",{className:X("grid gap-2 text-neutral4",{"horizontal-field-block grid-cols-[auto_1fr] items-baseline":n==="horizontal"},t),style:n==="horizontal"&&r?{gridTemplateColumns:`${r} 1fr`}:void 0,children:e})}const qo=Object.assign({},{Layout:gKn,Column:fKn,Label:mKn,HelpText:hKn,ErrorMsg:pKn});function vKn({children:e,className:t}){return l.jsx("div",{className:X("grid gap-6 content-start",t),children:e})}function yKn({children:e,className:t,columns:n=1,gap:r}){return l.jsx("div",{className:X("grid",{"grid-cols-1":n===1,"grid-cols-2":n===2},r??"gap-6",t),children:e})}Object.assign(yKn,{Column:vKn});const bKn=Mh(X("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:X(xwt,R0e,P0e),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${no.sm} text-ui-sm px-[.75em]`,md:`${no.md} text-ui-md px-[.75em]`,default:`${no.default} text-ui-md px-[.85em]`,lg:`${no.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),Sn=y.forwardRef(({className:e,size:t,testId:n,variant:r,type:s,error:a,...i},o)=>l.jsx("input",{type:s,className:X(bKn({variant:r,size:t}),a&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":n,ref:o,"aria-invalid":a,...i}));Sn.displayName="Input";function Ok({name:e,value:t,label:n,labelIsHidden:r=!1,labelColumnWidth:s,helpText:a,errorMsg:i,required:o=!1,disabled:c=!1,labelSize:u,layout:d="vertical",placeholder:f,size:p="default",testId:h,className:m,...g}){return l.jsxs(qo.Layout,{layout:d,labelColumnWidth:s,className:m,children:[d==="horizontal"?l.jsx(qo.Column,{children:l.jsx(qo.Label,{name:e,required:o,size:u||"bigger",children:r?l.jsx(tp,{children:n}):n})}):null,l.jsxs(qo.Column,{children:[!r&&d==="vertical"?l.jsx(qo.Label,{name:e,required:o,size:u||"default",children:n}):null,l.jsx(Sn,{name:e,disabled:c,required:o,value:t,placeholder:f,"data-testid":h,size:p,...g}),a&&l.jsx(qo.HelpText,{children:a}),i&&l.jsx(qo.ErrorMsg,{children:i})]})]})}function rw({name:e,helpText:t,errorMsg:n,required:r=!1,disabled:s=!1,value:a,label:i,labelIsHidden:o=!1,layout:c="vertical",placeholder:u="Search...",onChange:d,onReset:f,className:p,size:h,isMinimized:m,onMinimizedChange:g}){const v=y.useRef(null);return y.useEffect(()=>{m===!1&&v.current?.focus()},[m]),m?l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx(de,{size:h||"sm","aria-label":i||"Search",disabled:s,onClick:()=>g?.(!1),children:l.jsx(FC,{})})}),l.jsx(Yn,{children:i||"Search"})]}):l.jsxs(qo.Layout,{layout:c,className:p,children:[c==="horizontal"?l.jsx(qo.Column,{children:l.jsx(qo.Label,{name:e,required:r,children:o?l.jsx(tp,{children:i}):i})}):null,l.jsxs(qo.Column,{children:[c==="vertical"&&i&&!o?l.jsx(qo.Label,{name:e,required:r,children:i}):null,l.jsxs("div",{className:"relative group",children:[l.jsx(Sn,{ref:v,name:e,disabled:s,value:a,placeholder:u,onChange:d,size:h,className:X(h==="sm"&&"pl-8 pr-8",h==="md"&&"pl-9 pr-9",(!h||h==="default")&&"pl-10 pr-10",h==="lg"&&"pl-11 pr-11")}),l.jsx(FC,{"aria-hidden":"true",className:X("text-neutral4 opacity-50 group-has-focus:opacity-100 absolute left-3 top-1/2 -translate-y-1/2",h==="sm"&&"w-3.5 h-3.5",h==="md"&&"w-4 h-4",(!h||h==="default")&&"w-[1.125rem] h-[1.125rem]",h==="lg"&&"w-5 h-5")}),f&&(a||m===!1)&&l.jsx(de,{variant:"ghost",size:h||"default","aria-label":"Clear search",onClick:()=>{a&&f(),m===!1&&g?.(!0)},className:"absolute top-1/2 right-0 -translate-y-1/2",children:l.jsx(Fd,{})})]}),t&&l.jsx(qo.HelpText,{children:t}),n&&l.jsx(qo.ErrorMsg,{children:n})]})]})}function Yl({name:e,helpText:t,errorMsg:n,required:r=!1,disabled:s=!1,size:a="default",value:i,label:o,labelIsHidden:c=!1,layout:u="vertical",labelColumnWidth:d,options:f,placeholder:p="Select an option",onValueChange:h,className:m}){return l.jsxs(qo.Layout,{layout:u,labelColumnWidth:d,className:m,children:[u==="horizontal"?l.jsx(qo.Column,{children:l.jsx(qo.Label,{name:e,required:r,children:c?l.jsx(tp,{children:o}):o})}):null,l.jsxs(qo.Column,{children:[u==="vertical"&&o&&!c?l.jsx(qo.Label,{name:e,required:r,children:o}):null,l.jsxs(Ii,{"aria-label":c?o:void 0,name:e,value:i,onValueChange:h,disabled:s,children:[l.jsx(wi,{size:a,children:l.jsx(Ri,{placeholder:p})}),l.jsx(Si,{children:f.map(g=>l.jsx(vs,{value:g.value,children:g.label},g.value))})]}),t&&l.jsx(qo.HelpText,{children:t}),n&&l.jsx(qo.ErrorMsg,{children:n})]})]})}const B0e=y.createContext("md"),xKn=X("group/input-group relative flex w-full min-w-0 items-stretch","bg-surface2 border border-border1 text-neutral6","hover:border-border2",bwt,ywt,Tr.all,"has-[:disabled]:opacity-50 has-[:disabled]:cursor-not-allowed","has-[[aria-invalid=true]]:border-error has-[[aria-invalid=true]]:focus-within:ring-error has-[[aria-invalid=true]]:focus-within:shadow-glow-accent2","has-[>[data-align=block-start]]:flex-col","has-[>[data-align=block-end]]:flex-col","has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:pl-0","has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:pr-0","has-[>[data-align=block-start]]:[&>[data-slot=input-group-control]]:flex-none has-[>[data-align=block-start]]:[&>[data-slot=input-group-control]]:w-full","has-[>[data-align=block-end]]:[&>[data-slot=input-group-control]]:flex-none has-[>[data-align=block-end]]:[&>[data-slot=input-group-control]]:w-full"),wKn=y.forwardRef(({className:e,size:t="md",...n},r)=>l.jsx(B0e.Provider,{value:t,children:l.jsx("div",{ref:r,role:"group","data-slot":"input-group",className:X(xKn,e),...n})}));wKn.displayName="InputGroup";const SKn=Mh(X("flex items-center justify-center gap-2 text-neutral3 select-none","group-has-[:disabled]/input-group:opacity-50","[&>svg:not([class*='size-'])]:size-4"),{variants:{align:{"inline-start":"order-first pl-3 pr-1 has-[>button]:pl-1","inline-end":"order-last pr-3 pl-1 has-[>button]:pr-1","block-start":"order-first w-full justify-start px-3 pt-2 pb-1 border-b border-border1","block-end":"order-last w-full justify-start px-3 pb-2 pt-1 border-t border-border1"}},defaultVariants:{align:"inline-start"}}),kKn=y.forwardRef(({className:e,align:t="inline-start",onClick:n,...r},s)=>l.jsx("div",{ref:s,role:"group","data-slot":"input-group-addon","data-align":t,className:X(SKn({align:t}),e),onClick:a=>{a.target.closest('button, input, textarea, [role="button"]')||a.currentTarget.parentElement?.querySelector("[data-slot=input-group-control]")?.focus(),n?.(a)},...r}));kKn.displayName="InputGroupAddon";const p1t={sm:"text-ui-sm",md:"text-ui-md",default:"text-ui-md",lg:"text-ui-lg"},_Kn=y.forwardRef(({className:e,testId:t,error:n,type:r="text",...s},a)=>{const i=y.useContext(B0e);return l.jsx("input",{ref:a,type:r,"data-slot":"input-group-control","data-testid":t,"aria-invalid":n,className:X("flex-1 min-w-0 bg-transparent text-neutral6 px-3 outline-hidden",no[i],p1t[i],"placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70","disabled:cursor-not-allowed",e),...s})});_Kn.displayName="InputGroupInput";const OKn=y.forwardRef(({className:e,testId:t,error:n,...r},s)=>{const a=y.useContext(B0e);return l.jsx("textarea",{ref:s,"data-slot":"input-group-control","data-testid":t,"aria-invalid":n,className:X("flex-1 min-w-0 min-h-[60px] resize-y bg-transparent text-neutral6 px-3 py-2 outline-hidden",p1t[a],"placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70","disabled:cursor-not-allowed",e),...r})});OKn.displayName="InputGroupTextarea";const EKn=y.forwardRef(({className:e,...t},n)=>l.jsx("span",{ref:n,className:X("flex items-center gap-2 text-ui-sm text-neutral3 [&_svg]:pointer-events-none","[&_svg:not([class*='size-'])]:size-4",e),...t}));EKn.displayName="InputGroupText";const CKn=y.forwardRef(({size:e="icon-sm",variant:t="ghost",type:n="button",...r},s)=>l.jsx(de,{ref:s,type:n,size:e,variant:t,...r}));CKn.displayName="InputGroupButton";const TKn=Mh("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),jt=y.forwardRef(({className:e,...t},n)=>l.jsx(Ddt,{ref:n,className:X(TKn(),e),...t}));jt.displayName=Ddt.displayName;function aT({children:e}){const t=e.replace(/\\n/g,`
290
290
  `);return l.jsx(cft,{remarkPlugins:[Rft],components:NKn,className:"space-y-3",children:t})}const h1t=Oe.memo(({children:e,language:t,...n})=>{const[r,s]=y.useState([]);return y.useEffect(()=>{Twt(e,t).then(a=>{a&&s(a)})},[e,t]),r.length?l.jsx("pre",{...n,children:l.jsx("code",{children:r.map((a,i)=>l.jsxs(l.Fragment,{children:[l.jsx("span",{children:a.map((o,c)=>{const u=typeof o.htmlStyle=="string"?void 0:o.htmlStyle;return l.jsx("span",{className:"text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",style:u,children:o.content},c)})},i),i!==r.length-1&&`
291
291
  `]}))})}):l.jsx("pre",{...n,children:e})});h1t.displayName="HighlightedCode";const jKn=({children:e,className:t,language:n,...r})=>{const s=typeof e=="string"?e:hfe(e),a=X("overflow-x-scroll rounded-md border bg-surface1/50 p-4 font-mono text-sm [scrollbar-width:none]",t);return l.jsxs("div",{className:"group/code relative mb-4",children:[l.jsx(y.Suspense,{fallback:l.jsx("pre",{className:a,...r,children:e}),children:l.jsx(h1t,{language:n,className:a,children:s})}),l.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:l.jsx(la,{content:s,copyMessage:"Copied code to clipboard"})})]})};function hfe(e){if(typeof e=="string")return e;if(e?.props?.children){let t=e.props.children;return Array.isArray(t)?t.map(n=>hfe(n)).join(""):hfe(t)}return""}const NKn={h1:({children:e,...t})=>l.jsx("h1",{className:"text-2xl font-semibold",...t,children:e}),h2:({children:e,...t})=>l.jsx("h2",{className:"font-semibold text-xl",...t,children:e}),h3:({children:e,...t})=>l.jsx("h3",{className:"font-semibold text-lg",...t,children:e}),h4:({children:e,...t})=>l.jsx("h4",{className:"font-semibold text-base",...t,children:e}),h5:({children:e,...t})=>l.jsx("h5",{className:"font-medium",...t,children:e}),strong:({children:e,...t})=>l.jsx("strong",{className:"font-semibold",...t,children:e}),a:({children:e,...t})=>l.jsx("a",{className:"underline underline-offset-2",...t,children:e}),blockquote:({children:e,...t})=>l.jsx("blockquote",{className:"border-l-2 border-neutral6 pl-4",...t,children:e}),code:({children:e,className:t,...n})=>{const r=/language-(\w+)/.exec(t||"");return r?l.jsx(jKn,{className:t,language:r[1],...n,children:e}):l.jsx("code",{className:X("font-mono [:not(pre)>&]:rounded-md [:not(pre)>&]:bg-surface1/50 [:not(pre)>&]:px-1 [:not(pre)>&]:py-0.5"),...n,children:e})},pre:({children:e})=>e,ol:({children:e,...t})=>l.jsx("ol",{className:"list-decimal space-y-2 pl-6",...t,children:e}),ul:({children:e,...t})=>l.jsx("ul",{className:"list-disc space-y-2 pl-6",...t,children:e}),li:({children:e,...t})=>l.jsx("li",{className:"my-1.5",...t,children:e}),table:({children:e,...t})=>l.jsx("table",{className:"w-full border-collapse overflow-y-auto rounded-md border border-neutral6/20",...t,children:e}),th:({children:e,...t})=>l.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})=>l.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})=>l.jsx("tr",{className:"m-0 border-t p-0 even:bg-surface4",...t,children:e}),p:({children:e,...t})=>l.jsx("p",{className:"whitespace-pre-wrap leading-relaxed",...t,children:e}),hr:({...e})=>l.jsx("hr",{className:"border-neutral6/20",...e})};function AKn({children:e,className:t}){return l.jsx("div",{className:X("flex items-center gap-1 shrink-0",t),children:e})}function IKn({children:e,className:t}){return l.jsx("div",{className:X("overflow-x-auto ",t),children:e})}function m1t({children:e,className:t}){return l.jsx("p",{className:X("text-ui-md text-neutral2 leading-tight mt-0.5",t),children:e})}function RKn({message:e="Failed to load data",className:t}){return l.jsx("div",{className:X("flex flex-col gap-3 items-center justify-center",t),children:l.jsx("p",{className:"text-ui-sm text-accent2",children:e})})}const PKn={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};function Qt({color:e,className:t,size:n="md"}){return l.jsx("svg",{className:X("animate-spin",PKn[n],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:l.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:e||"currentColor",className:"text-accent1"})})}function MKn({className:e}){return l.jsx("div",{className:X("flex items-center justify-center",e),children:l.jsx(Qt,{size:"md",color:Dy.neutral1})})}function $Kn({message:e="No data yet",className:t}){return l.jsx("div",{className:X("flex items-center justify-center h-full",t),children:l.jsx("p",{className:"text-neutral1 text-sm",children:e})})}function T5e({children:e,className:t}){return l.jsx(t1t,{className:X("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 DKn({value:e,label:t,className:n}){return l.jsxs("div",{className:X("grid justify-end content-start text-right gap-1",n),children:[l.jsx("span",{className:"text-ui-lg font-semibold text-neutral4 leading-none",children:e}),t&&l.jsx("span",{className:"text-ui-md text-neutral2",children:t})]})}function g1t({children:e,className:t,as:n="h2"}){return l.jsx(n,{className:X("text-ui-md font-normal text-neutral4",t),children:e})}function LKn(e){if("children"in e)return l.jsx("div",{className:e.className,children:e.children});const{title:t,description:n,titleAs:r}=e;return l.jsxs("div",{className:e.className,children:[l.jsx(g1t,{as:r,children:t}),n&&l.jsx(m1t,{children:n})]})}function zKn({children:e,className:t}){return l.jsx("div",{className:X("flex items-start gap-4 [&>:first-child]:flex-1 [&>:first-child]:min-w-0",t),children:e})}function FKn({changePct:e,prevValue:t,lowerIsBetter:n,className:r}){const s=n?e<0:e>=0;return l.jsxs("div",{className:X("flex items-center gap-1 text-sm text-neutral1 flex-wrap",r),children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:X("[&>svg]:w-4 [&>svg]:h-4",s?"text-green-600":"text-red-600"),children:e>=0?l.jsx(pyn,{}):l.jsx(dyn,{})}),l.jsx("span",{className:X(s?"text-green-600":"text-red-600"),children:`${e>=0?"+":"-"}${Math.abs(e).toFixed(1)}%`})]}),t&&l.jsxs("div",{children:["vs previous ",l.jsx("b",{className:"text-neutral2 font-semibold",children:t})]})]})}function BKn({message:e="Failed to load data",className:t}){return l.jsx("span",{className:X("text-ui-sm text-accent2",t),children:e})}function UKn({children:e,className:t}){return l.jsx("span",{className:X("text-ui-md text-neutral3 leading-relaxed",t),children:e})}function qKn({className:e}){return l.jsx("span",{className:X("text-sm",e),children:l.jsx(Qt,{size:"md",color:Dy.neutral1})})}function VKn({message:e="No previous value to compare",className:t}){return l.jsx("span",{className:X("text-sm text-neutral1",t),children:e})}function HKn({message:e="No data yet",className:t}){return l.jsx("span",{className:X("text-sm text-neutral1",t),children:e})}function ZKn({children:e,className:t}){return l.jsx(t1t,{className:X("flex-1 min-w-72",t),children:l.jsx("div",{className:"grid gap-1",children:e})})}function WKn({children:e,className:t}){return l.jsx("strong",{className:X("text-header-lg text-neutral4 font-semibold",t),children:e})}const qr=Object.assign(ZKn,{Label:UKn,Value:WKn,Change:FKn,NoChange:VKn,NoData:HKn,Error:BKn,Loading:qKn}),Vt=Object.assign(T5e,{Root:T5e,Kpi:qr,TopBar:zKn,Actions:AKn,TitleAndDescription:LKn,Title:g1t,Description:m1t,Summary:DKn,Loading:MKn,Error:RKn,Content:IKn,NoData:$Kn});function mfe({children:e,className:t}){return l.jsx("div",{className:X("flex flex-wrap gap-8",t),children:e})}const $h=pTn,yp=hTn,Xd=y.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>l.jsx(mTn,{children:l.jsx(Vft,{ref:s,align:t,sideOffset:n,className:X("z-50 w-72 rounded-xl border border-border1 bg-surface3 text-neutral5 shadow-dialog 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-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",e&&/\bp[trblxy]?-\S+/.test(e)?!1:"py-3.5 px-3",e),...r})}));Xd.displayName=Vft.displayName;function v1t({children:e,...t}){const[n,r]=y.useState(!1),s=y.useRef(void 0),a=y.useCallback(()=>{clearTimeout(s.current),r(!0)},[]),i=y.useCallback(()=>{s.current=setTimeout(()=>r(!1),150)},[]);return y.useEffect(()=>()=>clearTimeout(s.current),[]),l.jsx($h,{open:n,onOpenChange:r,...t,children:l.jsx("span",{onMouseEnter:a,onMouseLeave:i,onFocusCapture:a,onBlurCapture:i,style:{display:"contents"},children:e})})}function U0e({disabled:e,onClear:t,onRemoveAll:n,onSave:r,onRemoveSaved:s}){const a=!!(n||r||s),i=!!t;return!i&&!a?null:l.jsxs("div",{className:"flex items-center gap-2",children:[i&&l.jsxs(de,{disabled:e,size:"md",onClick:()=>t(),children:[l.jsx(Fd,{}),"Clear"]}),a&&l.jsxs(_t,{children:[l.jsx(_t.Trigger,{asChild:!0,children:l.jsx(de,{disabled:e,size:"md","aria-label":"More filter actions",children:l.jsx(rvn,{})})}),l.jsxs(_t.Content,{align:"end",children:[n&&l.jsxs(_t.Item,{onSelect:()=>n(),children:[l.jsx(Fd,{}),"Remove all filters"]}),n&&(r||s)&&l.jsx(_t.Separator,{}),r&&l.jsxs(_t.Item,{onSelect:()=>r(),children:[l.jsx(ult,{}),"Save filters for next time"]}),s&&l.jsxs(_t.Item,{onSelect:()=>s(),children:[l.jsx(dlt,{}),"Remove saved filters"]})]})]})]})}const y1t=y.createContext("horizontal"),GKn=Mh(X("flex","[&>*:focus-visible]:relative [&>*:focus-visible]:z-10"),{variants:{orientation:{horizontal:"flex-row items-center",vertical:"flex-col items-stretch"},spacing:{default:"gap-2",close:"gap-0"}},compoundVariants:[{orientation:"horizontal",spacing:"close",className:X("[&>*:not(:last-child)]:rounded-r-none","[&>*:not(:first-child)]:rounded-l-none","[&>*:not([data-slot=buttons-group-separator]):not(:first-child)]:-ml-px")},{orientation:"vertical",spacing:"close",className:X("[&>*:not(:last-child)]:rounded-b-none","[&>*:not(:first-child)]:rounded-t-none","[&>:first-child]:rounded-t-xl","[&>:last-child]:rounded-b-xl","[&>*:not([data-slot=buttons-group-separator]):not(:first-child)]:-mt-px")}],defaultVariants:{orientation:"horizontal",spacing:"default"}}),Nr=y.forwardRef(({children:e,className:t,orientation:n="horizontal",spacing:r="default",...s},a)=>l.jsx(y1t.Provider,{value:n,children:l.jsx("div",{ref:a,role:"group","data-slot":"buttons-group","data-orientation":n,className:X(GKn({orientation:n,spacing:r}),t),...s,children:e})}));Nr.displayName="ButtonsGroup";const QKn=y.forwardRef(({className:e,orientation:t,...n},r)=>{const s=y.useContext(y1t),a=t??(s==="vertical"?"horizontal":"vertical");return l.jsx("div",{ref:r,role:"separator","aria-orientation":a,"data-slot":"buttons-group-separator",className:X("self-stretch bg-border1",a==="vertical"?"w-px":"h-px",e),...n})});QKn.displayName="ButtonsGroupSeparator";const YKn=Mh(X("inline-flex items-center justify-center bg-surface3 border border-border1 text-neutral5 select-none","rounded-full gap-[.75em] px-[1em] whitespace-nowrap shrink-0","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-50"),{variants:{size:{sm:`${no.sm} text-ui-sm`,md:`${no.md} text-ui-md`,default:`${no.default} text-ui-md`,lg:`${no.lg} text-ui-lg`}},defaultVariants:{size:"default"}}),ih=y.forwardRef(({className:e,size:t="default",...n},r)=>l.jsx("div",{ref:r,"data-slot":"buttons-group-text",className:X(YKn({size:t}),e),...n}));ih.displayName="ButtonsGroupText";const Lj=y.forwardRef(({className:e,...t},n)=>l.jsx(rpt,{className:X("grid gap-2",e),...t,ref:n}));Lj.displayName=rpt.displayName;const Qu=y.forwardRef(({className:e,...t},n)=>l.jsx(spt,{ref:n,className:X("aspect-square h-4 w-4 rounded-full border border-neutral3 text-neutral6","shadow-sm",Tr.all,"hover:border-neutral5 hover:shadow-md",pq,"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:l.jsx(OTn,{className:X("flex items-center justify-center","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:l.jsx(olt,{className:"h-2 w-2 fill-accent1 text-accent1"})})}));Qu.displayName=spt.displayName;function b1t({field:e,tokens:t,onChange:n}){const[r,s]=y.useState(""),a=y.useMemo(()=>{const u=r.trim().toLowerCase();return u?e.options.filter(d=>d.label.toLowerCase().includes(u)):e.options},[e.options,r]),i=y.useMemo(()=>t.find(u=>u.fieldId===e.id),[t,e.id]),o=typeof i?.value=="string"?i.value:e.multi?void 0:e.defaultValue,c=y.useMemo(()=>Array.isArray(i?.value)?i.value:typeof i?.value=="string"?[i.value]:[],[i]);return l.jsxs(l.Fragment,{children:[e.searchable!==!1&&l.jsx(Sn,{size:"sm",value:r,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?l.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 text-ui-sm text-neutral3",children:[l.jsx(Qt,{size:"sm",className:"w-3 h-3",color:"var(--neutral3)"}),"Loading options…"]}):a.length===0?l.jsx("div",{className:"px-2 py-1.5 text-ui-sm text-neutral3",children:e.emptyText??"No option found."}):e.multi?l.jsx("div",{className:"max-h-[80dvh] overflow-auto",children:a.map(u=>{const d=c.includes(u.value);return l.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:[l.jsx(oo,{"data-pick-multi-item":"",checked:d,onCheckedChange:f=>{const h=f===!0?c.includes(u.value)?c:[...c,u.value]:c.filter(m=>m!==u.value);n(e.id,h)},className:"shrink-0"}),l.jsx("span",{className:"truncate min-w-0 flex-1",children:u.label})]},u.value)})}):l.jsxs(Lj,{value:o??"",onValueChange:u=>n(e.id,u),className:"max-h-[80dvh] gap-0 overflow-auto",children:[a.map(u=>l.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:[l.jsx(Qu,{"data-pick-multi-item":"",value:u.value,className:"shrink-0"}),l.jsx("span",{className:"truncate min-w-0 flex-1",children:u.label})]},u.value)),!e.omitAnyOption&&l.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:[l.jsx(Qu,{"data-pick-multi-item":"",value:"Any",className:"shrink-0"}),l.jsx("span",{className:"truncate min-w-0 flex-1",children:"Any"})]})]})]})}function q0e(e){return Array.isArray(e)?e.length===0?"Any":e.join(", "):e}const XKn="This filter is set by the current context and cannot be removed here.";function KKn(e,t){return e.kind==="pick-multi"&&e.options?Array.isArray(t)?t.length===0?"Any":t.map(n=>e.options.find(r=>r.value===n)?.label??n).join(", "):e.options.find(n=>n.value===t)?.label??t:q0e(t)}function JKn({field:e,value:t,tooltipContent:n}){const r=KKn(e,t),s=`${e.label} filter is locked by context`;return l.jsx(od,{delayDuration:150,children:l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsxs(Nr,{spacing:"close","data-locked-field-id":e.id,"data-property-filter-pill":"locked",tabIndex:0,"aria-label":s,children:[l.jsx(ih,{size:"md",children:e.label}),l.jsx(ih,{size:"md",children:"is"}),l.jsx(ih,{size:"md",children:r}),l.jsx(ih,{size:"md",children:l.jsx(Uvn,{})})]})}),l.jsx(Yn,{children:n})]})})}function eJn({field:e,value:t,onChange:n,onRemove:r,disabled:s,autoFocus:a}){const[i,o]=y.useState(t),c=y.useRef(null);return y.useEffect(()=>{i.trim()!==t&&o(t)},[t]),y.useEffect(()=>{a&&c.current?.focus()},[a]),l.jsxs(Nr,{spacing:"close",children:[l.jsx(ih,{size:"md",children:e.label}),l.jsx(ih,{size:"md",children:"is"}),l.jsx(Sn,{ref:c,size:"md",disabled:s,value:i,placeholder:e.placeholder??`Enter ${e.label}`,onChange:u=>{const d=u.target.value;o(d),d.trim()!==t&&n(d)},onKeyDown:u=>{if(u.key==="Enter"){u.preventDefault();const d=i.trim();d!==t&&n(d)}else u.key==="Escape"&&(u.preventDefault(),o(t),u.target.blur())}}),l.jsx(de,{type:"button",disabled:s,"aria-label":`Remove ${e.label} filter`,size:"md",onMouseDown:u=>u.preventDefault(),onClick:r,children:l.jsx(Fd,{})})]})}function tJn({field:e,token:t,tokens:n,onChange:r,onRemove:s,disabled:a}){const[i,o]=y.useState(!1);return l.jsxs(Nr,{spacing:"close",children:[l.jsx(ih,{size:"md",children:e.label}),l.jsx(ih,{size:"md",children:"is"}),l.jsxs($h,{open:i,onOpenChange:o,children:[l.jsx(yp,{asChild:!0,children:l.jsx(de,{type:"button",disabled:a,size:"md",children:q0e(t.value)})}),l.jsx(Xd,{align:"start",sideOffset:8,className:"w-64 p-2","data-pick-multi-panel":!0,children:l.jsx(b1t,{field:e,tokens:n,onChange:r})})]}),l.jsx(de,{type:"button",disabled:a,"aria-label":`Remove ${e.label} filter`,size:"md",onClick:s,children:l.jsx(Fd,{})})]})}function V0e({fields:e,tokens:t,onTokensChange:n,disabled:r,autoFocusFieldId:s,lockedFieldIds:a,lockedTooltipContent:i=XKn}){if(t.length===0)return null;const o=new Set(a??[]),c=(d,f)=>{const p=[...t];p[d]=f,n(p)},u=d=>{n(t.filter((f,p)=>p!==d))};return l.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:t.map((d,f)=>{const p=e.find(h=>h.id===d.fieldId);return p?o.has(d.fieldId)?l.jsx(JKn,{field:p,value:d.value,tooltipContent:i},`${d.fieldId}-${f}`):p.kind==="text"&&typeof d.value=="string"?l.jsx(eJn,{field:p,value:d.value,disabled:r,autoFocus:s===d.fieldId,onChange:h=>c(f,{fieldId:d.fieldId,value:h}),onRemove:()=>u(f)},`${d.fieldId}-${f}`):p.kind==="pick-multi"?l.jsx(tJn,{field:p,token:d,tokens:t,disabled:r,onChange:(h,m)=>{if(m===void 0){u(f);return}c(f,{fieldId:h,value:m})},onRemove:()=>u(f)},`${d.fieldId}-${f}`):l.jsxs(Nr,{spacing:"close",children:[l.jsx(ih,{size:"md",children:p.label}),l.jsx(ih,{size:"md",children:"is"}),l.jsx(ih,{size:"md",children:q0e(d.value)}),l.jsx(de,{type:"button",disabled:r,size:"md","aria-label":`Remove ${p.label} filter`,onClick:()=>u(f),children:l.jsx(Fd,{})})]},`${d.fieldId}-${f}`):null})})}function H0e({fields:e,tokens:t,onTokensChange:n,label:r="Add Filter",disabled:s,size:a,onStartTextFilter:i,hiddenFieldIds:o}){const c=y.useMemo(()=>{if(!o||o.length===0)return e;const M=new Set(o);return e.filter(L=>!M.has(L.id))},[e,o]),[u,d]=y.useState(!1),[f,p]=y.useState(),[h,m]=y.useState(""),[g,v]=y.useState([]),[b,S]=y.useState(),[w,_]=y.useState(),O=y.useRef(null),E=y.useRef(!1),T=y.useCallback(M=>{_(L=>L===M?void 0:M)},[]),j=y.useCallback(()=>_(void 0),[]);y.useEffect(()=>{u||_(void 0)},[u]);const N=y.useMemo(()=>c.find(M=>M.id===f),[c,f]),I=y.useMemo(()=>{const M=new Set;for(const L of t){const F=e.find(z=>z.id===L.fieldId);F&&F.kind!=="pick-multi"&&M.add(L.fieldId)}return M},[t,e]),R=y.useCallback(()=>{p(void 0),m(""),v([]),S(void 0)},[]);y.useEffect(()=>{u||R()},[u,R]),y.useEffect(()=>{u&&N?.kind==="text"&&O.current?.focus()},[u,N]);const P=y.useCallback((M,L)=>{const F=t.findIndex(H=>H.fieldId===M);if(L===void 0||Array.isArray(L)&&L.length===0){if(F===-1)return;n(t.filter((H,D)=>D!==F));return}if(F===-1){n([...t,{fieldId:M,value:L}]);return}const q=[...t];q[F]={fieldId:M,value:L},n(q)},[n,t]),U=y.useCallback(()=>{if(!N){S("Choose a property first.");return}if(I.has(N.id)){S(`Remove the existing ${N.label} filter before adding another.`);return}if(N.kind==="text"&&!h.trim()){S(`Enter a value for ${N.label}.`);return}if(N.kind==="multi-select"&&g.length===0){S(`Choose at least one ${N.label.toLowerCase()} value.`);return}const M=N.kind==="multi-select"?{fieldId:N.id,value:g}:{fieldId:N.id,value:h.trim()};n([...t,M]),d(!1)},[g,n,N,I,h,t]);return l.jsxs($h,{open:u,onOpenChange:d,children:[l.jsx(yp,{asChild:!0,children:l.jsxs(de,{variant:"outline",size:a,disabled:s,children:[l.jsx(Mvn,{}),r]})}),l.jsx(Xd,{align:"end",className:"p-3 w-64",onOpenAutoFocus:M=>M.preventDefault(),onCloseAutoFocus:M=>{E.current&&(E.current=!1,M.preventDefault())},children:l.jsxs("div",{className:"grid gap-3",children:[N&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{type:"button","aria-label":"Back to properties",className:"text-neutral3 hover:text-neutral6 transition-colors",onClick:()=>{p(void 0),m(""),v([]),S(void 0)},children:l.jsx(dj,{className:"h-4 w-4"})}),l.jsx(xvn,{className:"h-4 w-4 shrink-0 text-neutral3"}),l.jsx("span",{className:"text-ui-sm text-neutral3",children:`${N.label} · is`})]}),!N&&l.jsx("div",{role:"menu",className:"max-h-[80dvh] overflow-auto",onKeyDown:M=>{if(M.key!=="ArrowDown"&&M.key!=="ArrowUp"&&M.key!=="Home"&&M.key!=="End")return;const L=Array.from(M.currentTarget.querySelectorAll("[data-filter-item]:not([disabled])"));if(L.length===0)return;M.preventDefault();const F=document.activeElement,z=L.findIndex(H=>H===F);let q;M.key==="Home"?q=0:M.key==="End"?q=L.length-1:M.key==="ArrowDown"?q=z<0?0:(z+1)%L.length:q=z<=0?L.length-1:z-1,L[q]?.focus()},children:c.length>0?c.map(M=>{const L=I.has(M.id);return M.kind==="pick-multi"?l.jsx(nJn,{field:M,tokens:t,onChange:P,open:w===M.id,onToggle:T,onClose:j},M.id):l.jsxs("button",{type:"button",role:"menuitem","data-filter-item":"",className:X("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",L?"cursor-not-allowed text-neutral2 opacity-70":"text-neutral4 hover:bg-surface4 hover:text-neutral6"),disabled:L,onClick:()=>{if(S(void 0),M.kind==="text"){n([...t,{fieldId:M.id,value:""}]),i?.(M.id),E.current=!0,d(!1);return}p(M.id)},children:[l.jsx("span",{className:"truncate",children:M.label}),L?l.jsx("span",{className:"ml-auto text-neutral3",children:"In use"}):l.jsx(qve,{className:"ml-auto h-4 w-4 text-neutral3 opacity-0 transition-opacity group-hover:opacity-100 group-focus:opacity-100"})]},M.id)}):l.jsx("div",{className:"px-2 py-1.5 text-ui-sm text-neutral3",children:"No matching property."})}),N&&N.kind==="text"&&l.jsx(Sn,{ref:O,size:"md",value:h,onChange:M=>{m(M.target.value),S(void 0)},placeholder:N.placeholder??`Enter ${N.label}`,onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),U())}}),N&&N.kind==="multi-select"&&l.jsx(Wwt,{options:N.options??[],value:g,onValueChange:M=>{v(M),S(void 0)},placeholder:N.placeholder??`Choose ${N.label}`,searchPlaceholder:`Search ${N.label.toLowerCase()}...`,emptyText:N.emptyText??"No option found.",size:"md"}),b&&l.jsx("div",{className:"text-ui-sm text-red-500",children:b}),N&&N.kind!=="pick-multi"&&l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(de,{variant:"ghost",size:"md",onClick:()=>d(!1),children:"Cancel"}),l.jsx(de,{variant:"outline",size:"md",onClick:U,children:"Add filter"})]})]})})]})}function nJn({field:e,tokens:t,onChange:n,open:r,onToggle:s,onClose:a}){const i=y.useRef(null);return l.jsxs($h,{open:r,onOpenChange:o=>{o?s(e.id):a()},children:[l.jsx(yp,{asChild:!0,children:l.jsxs("button",{type:"button",role:"menuitem","data-filter-item":"",className:X("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:o=>{o.key!=="ArrowRight"&&o.key!=="ArrowLeft"||(r||s(e.id),o.preventDefault(),requestAnimationFrame(()=>{i.current?.querySelector('input, button, [tabindex]:not([tabindex="-1"])')?.focus()}))},children:[r&&l.jsx(nk,{className:"h-4 w-4 text-neutral3 shrink-0"}),l.jsx("span",{className:"truncate",children:e.label}),!r&&l.jsx(nk,{className:"h-4 w-4 ml-auto text-neutral3 shrink-0"})]})}),l.jsx(Xd,{ref:i,side:"right",align:"start",sideOffset:8,className:"w-64 p-2",onOpenAutoFocus:o=>o.preventDefault(),onKeyDown:o=>{if(o.key!=="ArrowDown"&&o.key!=="ArrowUp"&&o.key!=="Home"&&o.key!=="End")return;const c=Array.from(o.currentTarget.querySelectorAll("[data-pick-multi-item]:not([disabled])"));if(c.length===0)return;o.preventDefault(),o.stopPropagation();const u=document.activeElement,d=c.findIndex(p=>p===u);let f;o.key==="Home"?f=0:o.key==="End"?f=c.length-1:o.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:l.jsx(b1t,{field:e,tokens:t,onChange:n})})]})}const rJn=8,x1t=(e,{enabled:t=!0})=>{const n=y.useRef(t),r=y.useRef(null),s=y.useRef(!1),a=y.useRef(null);Oe.useEffect(()=>{if(!t||!e?.current)return;const i=e.current,o=()=>{n.current&&(r.current!==null&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{n.current&&(i.scrollTop=i.scrollHeight),r.current=null}))},c=new MutationObserver(o);c.observe(i,{childList:!0,subtree:!0,characterData:!0});const u=new ResizeObserver(o);u.observe(i);const d=()=>{r.current!==null&&(cancelAnimationFrame(r.current),r.current=null)},f=()=>{n.current=!1,d()},p=()=>{s.current=!0,a.current!==null&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>{s.current=!1,a.current=null},250)},h=v=>{p(),v.deltaY<0&&f()},m=v=>{p(),["ArrowUp","PageUp","Home"].includes(v.key)&&f()},g=v=>{const b=v.target,S=b.scrollTop+b.clientHeight,w=b.scrollHeight;if(S>=w-rJn){n.current=!0;return}s.current&&(n.current=!1,d())};return i.addEventListener("wheel",h,{passive:!0}),i.addEventListener("touchmove",p,{passive:!0}),i.addEventListener("pointerdown",p),i.addEventListener("keydown",m),i.addEventListener("scroll",g),o(),()=>{i.removeEventListener("wheel",h),i.removeEventListener("touchmove",p),i.removeEventListener("pointerdown",p),i.removeEventListener("keydown",m),i.removeEventListener("scroll",g),c.disconnect(),u.disconnect(),d(),a.current!==null&&(window.clearTimeout(a.current),a.current=null)}},[t,e])};function sJn(e,t){if(e===!1)return{top:!1,bottom:!1,left:!1,right:!1};const n=t==="vertical"||t==="both",r=t==="horizontal"||t==="both",s={top:n,bottom:n,left:r,right:r};return e===!0||e===void 0||(e.y!==void 0&&(s.top=e.y,s.bottom=e.y),e.x!==void 0&&(s.left=e.x,s.right=e.x),e.top!==void 0&&(s.top=e.top),e.bottom!==void 0&&(s.bottom=e.bottom),e.left!==void 0&&(s.left=e.left),e.right!==void 0&&(s.right=e.right)),s}function aJn(e){return X(e.top&&"data-[overflow-y-start]:mask-t-from-[calc(100%-2rem)]",e.bottom&&"data-[overflow-y-end]:mask-b-from-[calc(100%-2rem)]",e.left&&"data-[overflow-x-start]:mask-l-from-[calc(100%-2rem)]",e.right&&"data-[overflow-x-end]:mask-r-from-[calc(100%-2rem)]")}const Ps=y.forwardRef(({className:e,children:t,viewPortClassName:n,maxHeight:r,autoScroll:s=!1,orientation:a="vertical",mask:i,showMask:o,...c},u)=>{const d=y.useRef(null);x1t(d,{enabled:s});const p=sJn(i!==void 0?i:o,a),h={};r&&(h.maxHeight=r),a==="vertical"?(h.overflowX="hidden",h.overflowY="scroll"):a==="horizontal"&&(h.overflowX="scroll",h.overflowY="hidden");const m=a==="vertical"?{minWidth:"0px"}:a==="horizontal"?{minHeight:"0px"}:void 0;return l.jsxs(NTn,{ref:u,className:X("relative overflow-hidden",e),...c,children:[l.jsx(PTn,{ref:d,className:X("h-full w-full rounded-[inherit]",aJn(p),n),style:h,children:l.jsx(zTn,{style:m,children:t})}),(a==="vertical"||a==="both")&&l.jsx(gfe,{orientation:"vertical"}),(a==="horizontal"||a==="both")&&l.jsx(gfe,{orientation:"horizontal"}),a==="both"&&l.jsx(BTn,{})]})});Ps.displayName="ScrollArea";const gfe=y.forwardRef(({className:e,orientation:t="vertical",...n},r)=>l.jsx(LTn,{ref:r,orientation:t,className:X("flex touch-none select-none transition-opacity duration-normal ease-out-custom","opacity-0 data-[hovering]:opacity-100 data-[scrolling]:opacity-100 data-[scrolling]:duration-0",t==="vertical"&&"h-full w-1.5 p-px",t==="horizontal"&&"h-1.5 w-full flex-col p-px",e),...n,children:l.jsx(FTn,{className:"relative flex-1 rounded-full bg-neutral4/30 hover:bg-neutral4/60 transition-colors duration-normal"})}));gfe.displayName="ScrollBar";const j5e={sm:no.sm,md:no.md,lg:no.lg,default:no.default},Rg=({onSearch:e,label:t,placeholder:n,debounceMs:r=300,size:s="md"})=>{const a=y.useId(),i=y.useRef(null),o=gj(u=>{e(u)},r);y.useEffect(()=>()=>{o.cancel()},[o]),y.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=>{o(u.target.value)};return l.jsxs("div",{className:X("border border-border1 flex w-full items-center gap-2 overflow-hidden pl-2 pr-1",bwt,ywt,Tr.all,"hover:border-neutral2",j5e[s]),children:[l.jsx(FC,{className:X("text-neutral3 h-4 w-4",Tr.colors)}),l.jsxs("div",{className:"flex-1",children:[l.jsx("label",{htmlFor:a,className:"sr-only",children:t}),l.jsx("input",{id:a,type:"text",placeholder:n,className:X("bg-transparent text-ui-md placeholder:text-neutral3 block w-full px-2 outline-hidden",j5e[s]),name:a,ref:i,onChange:c})]})]})},iJn=({children:e})=>l.jsx("div",{className:"px-3 py-2.5 border-b border-border1",children:e}),L8=y.forwardRef(({className:e,...t},n)=>l.jsxs(_pt,{ref:n,className:X("relative flex w-full touch-none select-none items-center group",e),...t,children:[l.jsx(ajn,{className:X("relative h-1.5 w-full grow overflow-hidden rounded-full bg-neutral2",Tr.colors),children:l.jsx(ijn,{className:X("absolute h-full bg-accent1",Tr.all)})}),l.jsx(ojn,{className:X("block h-4 w-4 rounded-full border-2 border-accent1 bg-white shadow-md","transition-all duration-normal ease-out-custom",pq,"hover:scale-110 hover:shadow-lg","active:scale-95","disabled:pointer-events-none disabled:opacity-50")})]}));L8.displayName=_pt.displayName;const Nc=y.forwardRef(({className:e,...t},n)=>l.jsx(Npt,{className:X("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent",Tr.all,pq,"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:n,children:l.jsx(fjn,{className:X("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")})}));Nc.displayName=Npt.displayName;function w1t({children:e,untilChar:t,charCount:n,copy:r,withTooltip:s=!0,className:a,as:i="span",...o}){const c=e;let u=c,d=!1;if(t!==void 0){const p=c.indexOf(t);p!==-1&&(u=c.slice(0,p),d=!0)}else n!==void 0&&c.length>n&&(u=c.slice(0,n),d=!0);if(!d)return l.jsx(ge,{as:i,className:a,...o,children:c});const f=l.jsxs(ge,{as:"span",className:"cursor-default",variant:o.variant,font:o.font,children:[u,"..."]});return l.jsxs(ge,{as:i,className:X("group inline-flex items-center gap-1",a),...o,children:[s?l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:f}),l.jsx(Yn,{children:c})]}):f,r&&l.jsx(la,{content:c,className:"opacity-0 group-hover:opacity-100 transition-opacity"})]})}const S1t=y.createContext(void 0);function Z0e(){return y.useContext(S1t)}function fr({children:e,className:t,style:n}){const r=k1t("MainContentLayout"),s=Z0e();return l.jsxs("main",{className:X("grid grid-rows-[auto_1fr] h-full items-start content-start",t),style:{...n,...r?{border:"3px dotted red"}:{}},children:[s&&l.jsx("h1",{className:"sr-only",children:s}),e]})}function kh({children:e,className:t,isCentered:n=!1,isDivided:r=!1,hasLeftServiceColumn:s=!1,style:a}){const i=k1t("MainContentContent"),o=W0e({isCentered:n,isDivided:r,hasLeftServiceColumn:s,className:t});return l.jsx("div",{className:o,style:{...a,...i?{border:"3px dotted orange"}:{}},children:e})}const W0e=({isCentered:e,isDivided:t,hasLeftServiceColumn:n,className:r})=>X("grid overflow-y-auto h-full ","overflow-x-auto min-w-min",{"items-start content-start":!e&&!t&&!n,"grid place-items-center":e,"grid-cols-[1fr_1fr]":t&&!n,"grid-cols-[12rem_1fr_1fr]":t&&n,"grid-cols-[auto_1fr]":!t&&n},r);function k1t(e){try{const t=localStorage.getItem("add-dev-style-to-components");return t?t.split(",").map(r=>r.trim()).filter(Boolean).includes(e):!1}catch(t){return console.error("Error reading or parsing localStorage:",t),!1}}function oJn({children:e,className:t}){return l.jsx("div",{className:X("grid content-start",t),children:e})}function lJn({children:e,isLoading:t}){return l.jsx("p",{className:X("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?l.jsx(l.Fragment,{children:" "}):l.jsx(l.Fragment,{children:e})})}function cJn({children:e,title:t,description:n,icon:r,className:s,withMargins:a=!0}){const i=t==="loading",o=n==="loading";return e?l.jsx("header",{className:X("grid grid-cols-[1fr_auto] gap-16 w-full ",{"mt-[6vh] mb-[4vh]":a},s),children:e}):l.jsxs("header",{className:X("grid gap-2 pt-8 pb-8 ",s),children:[l.jsx("h1",{className:X("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?l.jsx(l.Fragment,{children:" "}):l.jsxs(l.Fragment,{children:[r&&r," ",t]})}),n&&l.jsx("p",{className:X("text-neutral4 text-sm m-0",{"bg-surface4 w-[40rem] max-w-[80%] rounded-md animate-pulse":o}),children:o?l.jsx(l.Fragment,{children:" "}):n})]})}function uJn({children:e,isLoading:t,size:n="default"}){return l.jsx("h1",{className:X("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":n==="smaller"}),children:t?l.jsx(l.Fragment,{children:" "}):l.jsx(l.Fragment,{children:e})})}const Wn=Object.assign(cJn,{Title:uJn,Description:lJn,Column:oJn});function sw({children:e,className:t}){return l.jsx("div",{className:X("grid gap-12",t),children:e})}function vfe({className:e,classNames:t,showOutsideDays:n=!0,...r}){return l.jsx(WIn,{showOutsideDays:n,className:X("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:X("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_next:X("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:X("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",r.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:X("bg-accent1! text-white! hover:bg-accent1/80! focus:bg-accent1/80! focus:text-white!",r.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},...r})}const UX=["12","1","2","3","4","5","6","7","8","9","10","11"],WL=["00","15","30","45","59"],GL=["AM","PM"];function N5e({defaultValue:e,onValueChange:t,className:n}){const[r,s]=y.useState("12"),[a,i]=y.useState("00"),[o,c]=y.useState("AM");y.useEffect(()=>{if(e){const p=/^(\d{1,2}):(\d{2})(?::\d{2})?\s*(AM|PM|am|pm)?$/,h=e.match(p);if(h){let m=parseInt(h[1],10);const g=parseInt(h[2],10),v=h[3]?.toUpperCase();m>=1&&m<=12&&g>=0&&g<=59&&(s(m.toString()),i(g===0?"00":g.toString()),c(v||"AM"))}}},[e]);const u=p=>{s(p),t(`${UX[+p]}:${a} ${o}`.trim())},d=p=>{i(WL[+p]),t(`${r}:${WL[+p]} ${o}`.trim())},f=p=>{c(GL[+p]),t(`${r}:${a} ${GL[+p]}`.trim())};return l.jsxs("div",{className:X("flex gap-2 items-center",n),children:[l.jsxs(Ii,{name:"hour",value:UX.indexOf(r).toString(),onValueChange:u,children:[l.jsx(wi,{size:"sm",children:l.jsx(Ri,{placeholder:"Select..."})}),l.jsx(Si,{children:UX.map((p,h)=>l.jsx(vs,{value:`${h}`,children:p},p))})]}),":",l.jsxs(Ii,{name:"minute",value:WL.indexOf(a).toString(),onValueChange:d,children:[l.jsx(wi,{size:"sm",children:l.jsx(Ri,{placeholder:"Select..."})}),l.jsx(Si,{children:WL.map((p,h)=>l.jsx(vs,{value:`${h}`,children:p},p))})]}),l.jsxs(Ii,{name:"period",value:GL.indexOf(o).toString(),onValueChange:f,children:[l.jsx(wi,{size:"sm",children:l.jsx(Ri,{placeholder:"Select..."})}),l.jsx(Si,{children:GL.map((p,h)=>l.jsx(vs,{value:`${h}`,children:p},p))})]})]})}y.forwardRef(({value:e,placeholder:t,className:n,...r},s)=>l.jsxs(de,{ref:s,className:X("justify-start",n),...r,children:[l.jsx(yue,{className:"h-4 w-4"}),e?l.jsx("span",{className:"text-white",children:kn(e,"PP p")}):l.jsx("span",{className:"text-gray",children:t??"Pick a date"})]}));function _1t({children:e}){return l.jsx("ul",{className:"grid bg-surface3 overflow-y-auto",children:e})}function O1t(e){return!e||e.length===0?"":e?.map(t=>t.size).join(" ")}function E1t({entry:e,isSelected:t,onClick:n,children:r,columns:s}){const a=()=>{n?.(e?.id)};return l.jsx("li",{className:X("border-t text-neutral5 border-border1 last:border-b-0 text-ui-md","[&:last-child>button]:rounded-b-lg",Tr.colors,{"bg-accent1Dark":t}),children:l.jsx("button",{onClick:a,className:X("grid w-full px-6 gap-6 text-left items-center min-h-12",Tr.colors,Fw.visible,{"hover:bg-surface4":e&&!t}),style:{gridTemplateColumns:O1t(s)},disabled:!e,children:r})})}function dJn({children:e,isLoading:t}){return l.jsx("div",{className:"text-neutral4 text-ui-md truncate ",children:t?l.jsx("div",{className:"bg-surface4 rounded-md animate-pulse text-transparent h-4 select-none"}):e})}function fJn({status:e}){return l.jsxs("div",{className:X("flex justify-center items-center w-full relative"),children:[e?l.jsx("div",{className:X("w-[0.6rem] h-[0.6rem] rounded-full",{"bg-green-600":e==="success","bg-red-700":e==="failed"})}):l.jsx("div",{className:"text-neutral2 text-ui-sm leading-none",children:"-"}),l.jsxs(tp,{children:["Status: ",e||"not provided"]})]})}function C1t({columns:e}){return l.jsx("div",{className:X("sticky top-0 bg-surface4 z-10 rounded-t-lg px-6"),children:l.jsx("div",{className:X("grid gap-6 text-left uppercase py-3 text-neutral3 text-ui-sm"),style:{gridTemplateColumns:O1t(e)},children:e?.map(t=>l.jsx("span",{children:t.label||t.name},t.name))})})}function pJn({children:e,message:t,className:n,type:r}){return!e&&!t?null:l.jsx("div",{className:X("grid border-t border-border1",n),children:t?l.jsxs("p",{className:X("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":r==="error"}),children:[r==="error"?l.jsx(VM,{}):l.jsx(Bve,{})," ",t]}):e})}function hJn({isLoading:e,hasMore:t,setEndOfListElement:n,loadingText:r="Loading more data...",noMoreDataText:s="No more data to load"}){return n?l.jsxs("div",{ref:n,className:"text-ui-md text-neutral3 opacity-50 flex mt-8 justify-center",children:[e&&r,!t&&!e&&s]}):null}function mJn({currentPage:e,hasMore:t,onNextPage:n,onPrevPage:r}){const s=typeof e=="number"&&e>0||t;return l.jsxs("div",{className:X("flex pt-6 items-center justify-center text-neutral3 text-ui-md gap-8"),children:[l.jsxs("span",{children:["Page ",l.jsx("b",{children:e?e+1:"1"})]}),s&&l.jsxs("div",{className:X("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&&l.jsxs("button",{onClick:r,children:[l.jsx(dj,{}),"Previous"]}),t&&l.jsxs("button",{onClick:n,children:["Next",l.jsx(tk,{})]})]})]})}function gJn({children:e}){return l.jsx("div",{className:"grid",children:e})}function T1t({children:e}){return l.jsx("div",{className:X("rounded-lg border border-border1 overflow-clip"),children:e})}const Aa=Object.assign(gJn,{Header:C1t,Trim:T1t,Entries:_1t,Entry:E1t,Message:pJn,NextPageLoading:hJn,Pagination:mJn,EntryText:dJn,EntryStatus:fJn}),A5e=["75%","50%","65%","90%","60%","80%"];function vJn({columns:e,numberOfRows:t=3}){const n=(r,s)=>{const a=(r+s+(e?.length||0)+(t||0))%A5e.length;return A5e[a]};return l.jsx(_1t,{children:Array.from({length:t}).map((r,s)=>l.jsx(E1t,{columns:e,children:(e||[]).map((a,i)=>{const o=`${a.name}-${i}`;return l.jsx("div",{className:"bg-surface4 rounded-md animate-pulse text-transparent h-4 select-none",style:{width:`${n(s,i)}`}},o)})},s))})}function j1t({columns:e,numberOfRows:t}){return l.jsx(Aa,{children:l.jsxs(T1t,{children:[l.jsx(C1t,{columns:e}),l.jsx(vJn,{columns:e,numberOfRows:t})]})})}function yJn({entries:e,id:t,update:n}){const r=e.findIndex(a=>a.id===t);if(r<e.length-1)return()=>{const a=e[r+1];n(a.id)}}function bJn({entries:e,id:t,update:n}){const r=e.findIndex(a=>a.id===t);if(r>0)return()=>{const a=e[r-1];n(a.id)}}const N1t=y.createContext(null);function xJn({children:e,value:t}){return l.jsx(N1t.Provider,{value:t,children:e})}function vq(){const e=y.useContext(N1t);if(!e)throw new Error("useJSONSchemaForm must be used within a JSONSchemaForm.Root");return e}let wJn=0;function yq(e={}){return{id:`field-${Date.now()}-${wJn++}`,name:"",type:"string",nullable:!1,optional:!1,...e}}function SJn(e){return e==="text"?"string":e}function A1t(e){const t=SJn(e.type),r={type:e.nullable?[t,"null"]:t};if(e.description&&(r.description=e.description),e.type==="object"&&e.properties&&e.properties.length>0){const{properties:s,required:a}=I1t(e.properties);r.properties=s,a.length>0&&(r.required=a)}return e.type==="array"&&e.items&&(r.items=A1t(e.items)),r}function I1t(e){const t={},n=[];for(const r of e)r.name.trim()&&(t[r.name]=A1t(r),r.optional||n.push(r.name));return{properties:t,required:n}}function kJn(e){const{properties:t,required:n}=I1t(e),r={type:"object",properties:t};return n.length>0&&(r.required=n),r}function R1t(e){if(Array.isArray(e)){const t=e.includes("null");return{type:e.find(r=>r!=="null")||"string",nullable:t}}return{type:e||"string",nullable:!1}}function P1t(e){return["string","number","boolean","object","array"].includes(e)?e:"string"}function M1t(e){const{type:t,nullable:n}=R1t(e.type);return yq({name:"",type:P1t(t),description:e.description,nullable:n,optional:!1,properties:e.properties?bq({properties:e.properties,required:e.required}):void 0,items:e.items?M1t(e.items):void 0})}function bq(e){if(!e?.properties)return[];const t=new Set(e.required||[]);return Object.entries(e.properties).map(([n,r])=>{const{type:s,nullable:a}=R1t(r.type);return yq({name:n,type:P1t(s),description:r.description,nullable:a,optional:!t.has(n),properties:r.properties?bq({properties:r.properties,required:r.required}):void 0,items:r.items?M1t(r.items):void 0})})}function yfe(e,t,n,r){if(t.length===0)return e.map(i=>i.id===n?{...i,...r}:i);const[s,...a]=t;return e.map(i=>i.id!==s?i:i.type==="object"?{...i,properties:yfe(i.properties||[],a,n,r)}:i.type==="array"&&i.items?{...i,items:{...i.items,properties:yfe(i.items.properties||[],a,n,r)}}:i)}function bfe(e,t,n){if(t.length===0)return[...e,n];const[r,...s]=t;return e.map(a=>a.id!==r?a:a.type==="object"?{...a,properties:bfe(a.properties||[],s,n)}:a.type==="array"&&a.items?{...a,items:{...a.items,properties:bfe(a.items.properties||[],s,n)}}:a)}function xfe(e,t,n){if(t.length===0)return e.filter(a=>a.id!==n);const[r,...s]=t;return e.map(a=>a.id!==r?a:a.type==="object"?{...a,properties:xfe(a.properties||[],s,n)}:a.type==="array"&&a.items?{...a,items:{...a.items,properties:xfe(a.items.properties||[],s,n)}}:a)}function _Jn({onChange:e,onFieldsChange:t,defaultValue:n,maxDepth:r=5,className:s,children:a}){const[i,o]=y.useState(()=>n||[]),c=y.useRef("");y.useEffect(()=>{const h=kJn(i),m=JSON.stringify(h);m!==c.current&&(c.current=m,e?.(h))},[i,e]),y.useEffect(()=>{t?.(i)},[i,t]);const u=y.useCallback(h=>{const m=yq();o(g=>bfe(g,h,m))},[]),d=y.useCallback((h,m)=>{o(g=>xfe(g,h,m))},[]),f=y.useCallback((h,m,g)=>{o(v=>yfe(v,h,m,g))},[]),p=y.useMemo(()=>({fields:i,addField:u,removeField:d,updateField:f,maxDepth:r}),[i,u,d,f,r]);return l.jsx(xJn,{value:p,children:l.jsx("div",{className:X(s),children:a})})}const $1t=y.createContext(null);function OJn({children:e,value:t}){return l.jsx($1t.Provider,{value:t,children:e})}function zj(){const e=y.useContext($1t);if(!e)throw new Error("useJSONSchemaFormField must be used within a JSONSchemaForm.Field");return e}function EJn({field:e,parentPath:t=[],depth:n=0,className:r,children:s}){const{updateField:a,removeField:i}=vq(),o=y.useCallback(d=>{a(t,e.id,d)},[a,t,e.id]),c=y.useCallback(()=>{i(t,e.id)},[i,t,e.id]),u=y.useMemo(()=>({field:e,parentPath:t,depth:n,update:o,remove:c}),[e,t,n,o,c]);return l.jsx(OJn,{value:u,children:l.jsx("div",{className:X(r),children:s})})}const D1t=y.createContext(null);function CJn({children:e,value:t}){return l.jsx(D1t.Provider,{value:t,children:e})}function L1t(){return y.useContext(D1t)}function TJn({className:e,children:t}){const{fields:n}=vq(),r=L1t(),s=r?r.fields:n,a=r?r.parentPath:[],i=r?r.depth:0;return s.length===0?null:l.jsx("div",{className:e,children:s.map((o,c)=>t(o,c,{parentPath:a,depth:i}))})}function jJn(e){const{field:t,update:n}=zj(),r=y.useCallback(s=>{n({name:s.target.value})},[n]);return l.jsx(Ok,{...e,size:"md",labelIsHidden:!0,name:`field-name-${t.id}`,value:t.name,onChange:r})}const NJn=[{value:"string",label:"String",icon:l.jsx(Be,{size:"sm",children:l.jsx(Hve,{})})},{value:"number",label:"Number",icon:l.jsx(Be,{size:"sm",children:l.jsx(Fve,{})})},{value:"boolean",label:"Boolean",icon:l.jsx(Be,{size:"sm",children:l.jsx(Vve,{})})},{value:"text",label:"Text",icon:l.jsx(Be,{size:"sm",children:l.jsx(kP,{})})},{value:"object",label:"Object",icon:l.jsx(Be,{size:"sm",children:l.jsx(d0,{})})},{value:"array",label:"Array",icon:l.jsx(Be,{size:"sm",children:l.jsx(Uve,{})})}];function AJn({className:e,...t}){const{field:n,update:r}=zj(),s=y.useCallback(a=>{r({type:a})},[r]);return l.jsx(Yl,{className:X("w-28 shrink-0",e),name:`field-type-${n.id}`,label:"Select type",labelIsHidden:!0,value:n.type,onValueChange:s,options:NJn,size:"md",...t})}function IJn({label:e="Optional",labelClassName:t,className:n,...r}){const{field:s,update:a}=zj(),i=y.useCallback(o=>{a({optional:o===!0})},[a]);return l.jsxs("label",{className:X("flex items-center gap-2 text-ui-sm text-neutral3 cursor-pointer",t),children:[l.jsx(oo,{...r,className:n,checked:s.optional,onCheckedChange:i}),e]})}function RJn({label:e="Nullable",labelClassName:t,className:n,...r}){const{field:s,update:a}=zj(),i=y.useCallback(o=>{a({nullable:o===!0})},[a]);return l.jsxs("label",{className:X("flex items-center gap-2 text-ui-sm text-neutral3 cursor-pointer",t),children:[l.jsx(oo,{...r,className:n,checked:s.nullable,onCheckedChange:i}),e]})}function PJn({children:e,tooltip:t="Remove field",...n}){const{remove:r}=zj();return l.jsx(de,{...n,tooltip:t,onClick:r,size:"icon-md",children:e||l.jsx(dlt,{})})}function MJn({className:e,children:t}){const{maxDepth:n,updateField:r}=vq(),{field:s,parentPath:a,depth:i}=zj(),o=s.type==="object"||s.type==="array",c=i>=n;if(y.useEffect(()=>{s.type==="object"&&!s.properties&&r(a,s.id,{properties:[]}),s.type==="array"&&!s.items&&r(a,s.id,{items:yq({name:"items",type:"object",properties:[]})})},[s.type,s.properties,s.items,s.id,a,r]),!o||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 l.jsx(CJn,{value:{parentPath:u,depth:d,fields:f},children:l.jsx("div",{className:X("pl-4 border-l border-border1 mt-2",e),children:t})})}function $Jn({children:e,...t}){const{addField:n}=vq(),r=L1t(),s=r?r.parentPath:[],a=y.useCallback(()=>{n(s)},[n,s]);return l.jsx(de,{type:"button",...t,onClick:a,children:e||"Add field"})}const Fi={Root:_Jn,Field:EJn,FieldList:TJn,FieldName:jJn,FieldType:AJn,FieldOptional:IJn,FieldNullable:RJn,FieldRemove:PJn,NestedFields:MJn,AddField:$Jn};function g_({data:e,className:t,labelsAreHidden:n,isLoading:r,LinkComponent:s}){const a=({children:i})=>n?l.jsx(tp,{children:i}):i;return!e||e.length===0?null:l.jsx("dl",{className:X("grid grid-cols-[auto_1fr] gap-x-4 items-start content-start",t),children:e.map(({label:i,value:o,icon:c,separator:u},d)=>{const f=Array.isArray(o);return l.jsxs(Oe.Fragment,{children:[l.jsxs("dt",{className:X("text-neutral3 text-ui-md flex items-center gap-8 justify-between min-h-9"),children:[l.jsxs("span",{className:X("flex items-center gap-2","[&>svg]:w-[1.4em] [&>svg]:h-[1.4em] [&>svg]:text-neutral3 [&>svg]:opacity-50",{"[&>svg]:opacity-20":r}),children:[c," ",l.jsx(a,{children:i})]}),!n&&l.jsx("span",{className:X("text-neutral3","[&>svg]:w-[1em] [&>svg]:h-[1em] [&>svg]:text-neutral3"),children:u})]}),l.jsx("dd",{className:X("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:r?l.jsx("span",{className:X("bg-surface4 rounded-e-lg w-full"),style:{width:`${Math.floor(Math.random()*61)+50}%`},children:" "}):f?o?.map(p=>p.path&&s?l.jsx(I5e,{description:p.description,children:l.jsxs(s,{href:p.path,children:[p?.name," ",l.jsx(nk,{})]})},p.id):p.path?l.jsx(I5e,{description:p.description,children:l.jsxs("a",{href:p.path,children:[p?.name," ",l.jsx(nk,{})]})},p.id):l.jsx("span",{children:p?.name},p.id)):l.jsx(l.Fragment,{children:o||l.jsx("span",{className:"text-neutral3 text-ui-sm",children:"n/a"})})})]},i+d)})})}function I5e({description:e,children:t}){return e?l.jsxs(Kye,{openDelay:250,children:[l.jsx(Jye,{asChild:!0,children:t}),l.jsx(ebe,{children:l.jsxs(tbe,{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,l.jsx(nbe,{className:"fill-surface5"})]})})]}):t}function DJn({className:e,children:t,...n}){return l.jsx("div",{className:X("mt-auto",e),...n,children:t})}const R5e="sidebar:state",P5e="sidebar:width",M5e="--sidebar-width",G0e=Oe.createContext(null),Q0e=Oe.createContext(null);function xq(){const e=Oe.useContext(G0e),t=Oe.useContext(Q0e);if(!e||!t)throw new Error("useMainSidebar must be used within a MainSidebarProvider.");return{...e,...t}}function wq(){const e=Oe.useContext(G0e),t=Oe.useContext(Q0e);return!e||!t?null:{...e,...t}}const qX=(e,t,n)=>Math.min(n,Math.max(t,e)),LJn=typeof window<"u"?Oe.useLayoutEffect:Oe.useEffect;function zJn({children:e,defaultState:t="default",defaultWidth:n=240,minWidth:r=200,maxWidth:s=480,collapseBelow:a,collapsedWidth:i=64,disableKeyboardShortcut:o=!1,storageKey:c,mobileBreakpoint:u=1024,mobileWidth:d=360,LinkComponent:f}){const p=Math.max(0,Math.min(r,s)),h=Math.max(p,s),m=Math.max(0,Math.min(i,h)),g=qX(n,p,h),v=a??p,b=c?`${c}:${R5e}`:R5e,S=c?`${c}:${P5e}`:P5e,w=()=>{if(typeof window>"u")return{state:t,width:g};try{let ee=t,se=g;const ie=window.localStorage.getItem(b);(ie==="collapsed"||ie==="default")&&(ee=ie);const Q=window.localStorage.getItem(S);if(Q!==null){const ne=Number(Q);Number.isFinite(ne)&&(se=qX(ne,p,h))}return{state:ee,width:se}}catch{return{state:t,width:g}}},_=Oe.useRef(null);_.current===null&&(_.current=w());const O=_.current,[E,T]=Oe.useState(O.state),[j,N]=Oe.useState(O.width),[I,R]=Oe.useState(!1),[P,U]=Oe.useState(!1),M=Oe.useRef(O.width),L=Oe.useRef(O.state);L.current=E;const F=Oe.useRef(null);Oe.useEffect(()=>{if(typeof window>"u")return;const ee=window.matchMedia(`(max-width: ${u-1}px)`),se=()=>R(ee.matches);return se(),ee.addEventListener("change",se),()=>ee.removeEventListener("change",se)},[u]),Oe.useEffect(()=>{!I&&P&&U(!1)},[I,P]);const z=Oe.useCallback(ee=>{const se=F.current;se&&se.style.setProperty(M5e,`${ee}px`)},[]);LJn(()=>{z(E==="collapsed"?m:M.current)},[E,m,z]);const q=Oe.useCallback(ee=>{try{window.localStorage.setItem(b,ee)}catch{}},[b]),H=Oe.useCallback(()=>{if(I){U(ee=>!ee);return}T(ee=>{const se=ee==="default"?"collapsed":"default";return L.current=se,q(se),se})},[I,q]),D=Oe.useCallback(ee=>{const se=qX(ee,p,h);M.current=se,z(se)},[p,h,z]),Y=Oe.useCallback(()=>{L.current="collapsed",q("collapsed"),T("collapsed")},[q]),V=Oe.useCallback(()=>{L.current="default",q("default"),T("default")},[q]),$=Oe.useCallback(()=>{N(M.current);try{window.localStorage.setItem(b,L.current),window.localStorage.setItem(S,String(M.current))}catch{}},[b,S]),W=Oe.useCallback(ee=>{const se=F.current;se&&(ee?se.setAttribute("data-sidebar-gesture","active"):se.removeAttribute("data-sidebar-gesture"))},[]);Oe.useEffect(()=>{if(o)return;const ee=se=>{if(se.code!=="KeyB"||!(se.metaKey||se.ctrlKey)||se.altKey||se.shiftKey)return;const ie=se.target;if(ie){const Q=ie.tagName;if(Q==="INPUT"||Q==="TEXTAREA"||Q==="SELECT"||ie.isContentEditable)return}se.preventDefault(),H()};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[o,H]);const G=I?"default":E,K=Oe.useMemo(()=>({state:G,desktopState:E,width:j,minWidth:p,maxWidth:h,collapseBelow:v,collapsedWidth:m,isMobile:I,toggleSidebar:H,setWidth:D,collapse:Y,expand:V,commit:$,setGestureActive:W,LinkComponent:f}),[G,E,j,p,h,v,m,I,H,D,Y,V,$,W,f]),re=Oe.useMemo(()=>({openMobile:P,setOpenMobile:U}),[P]),J={[M5e]:`${O.state==="collapsed"?m:O.width}px`,"--sidebar-width-mobile":`${d}px`,display:"contents"};return l.jsx("div",{ref:F,"data-sidebar-scope":!0,"data-sidebar-state":E,"data-sidebar-mobile":I?"true":"false",style:J,suppressHydrationWarning:!0,children:l.jsx(G0e.Provider,{value:K,children:l.jsx(Q0e.Provider,{value:re,children:e})})})}function FJn({className:e,icon:t,"aria-label":n="Open navigation menu",onClick:r,...s}){const{isMobile:a,setOpenMobile:i}=xq();return l.jsx("button",{type:"button","aria-label":n,"aria-hidden":!a,tabIndex:a?0:-1,"data-mobile-only":!0,...s,onClick:o=>{r?.(o),o.defaultPrevented||i(!0)},className:X("inline-flex size-10 items-center justify-center rounded-md","in-data-[sidebar-mobile=false]:hidden","text-neutral4 hover:text-neutral6 hover:bg-sidebar-nav-hover","focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1",e),children:t??l.jsx(Gvn,{className:"size-5"})})}function BJn({"aria-label":e="Main",children:t,className:n,...r}){return l.jsx("nav",{"aria-label":e,className:X("flex flex-col flex-1 min-h-0",n),...r,children:l.jsx(Ps,{className:"flex-1 min-h-0",viewPortClassName:"px-0.5",children:t})})}function z1t({children:e,className:t,state:n,href:r,isActive:s,LinkComponent:a,...i}){const o=wq(),c=n??o?.state??"default",u=o?.isMobile??!1,d=a??o?.LinkComponent??"a",f=c==="default"&&!u;return l.jsx("div",{className:X("min-w-0 min-h-8 flex items-center mt-2 mb-0.5",t),children:f?l.jsx("header",{...i,className:X("min-w-0 max-w-full truncate text-ui-sm font-medium pl-3",{"text-neutral5":s,"text-neutral3/70":!s}),children:r?l.jsx(d,{href:r,className:X("block min-w-0 truncate transition-colors duration-normal",{"hover:text-neutral5":!s,"text-neutral5":s}),children:e}):e}):l.jsxs(l.Fragment,{children:[l.jsx(tp,{asChild:!0,children:l.jsx("header",{...i,children:e})}),l.jsx("div",{"aria-hidden":"true",className:"mx-3 h-px flex-1 bg-border1"})]})})}function F1t({children:e,className:t,state:n,...r}){const s=wq();return(n??s?.state??"default")==="collapsed"?l.jsx(tp,{children:e}):l.jsx("span",{...r,className:X("min-w-0 flex-1 truncate text-left",t),children:e})}const UJn=({isActive:e,isCollapsed:t,isFeatured:n}={})=>X("flex items-center text-ui-md text-neutral3 rounded-lg h-9 min-w-0 whitespace-nowrap","transition-all duration-normal ease-out-custom motion-reduce:transition-none","[&_svg]:w-4 [&_svg]:h-4 [&_svg]:shrink-0 [&_svg]:text-neutral3/70 [&_svg]:transition-colors [&_svg]:duration-normal motion-reduce:[&_svg]:transition-none","hover:bg-sidebar-nav-hover hover:text-neutral6 [&:hover_svg]:text-neutral5","focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring",!t&&"w-full gap-2.5 py-1 px-3 justify-start",t&&"w-full p-0 justify-center",e&&"text-neutral6 bg-sidebar-nav-active hover:bg-sidebar-nav-active hover:text-neutral6 [&_svg]:text-neutral6 [&:hover_svg]:text-neutral6",t&&!e&&"[&_svg]:text-neutral3",n&&"my-2 bg-accent1Dark hover:bg-accent1Darker text-accent1 hover:text-accent1 border border-accent1/30",n&&"dark:bg-accent1 dark:hover:bg-accent1/90 dark:text-black dark:hover:text-black dark:border-transparent",n&&"[&_svg]:text-accent1 [&:hover_svg]:text-accent1 dark:[&_svg]:text-black/75 dark:[&:hover_svg]:text-black");function B1t({link:e,state:t,children:n,isActive:r,className:s,LinkComponent:a,asChild:i=!1,...o}){const c=wq(),u=t??c?.state??"default",d=a??c?.LinkComponent??"a",f=u==="collapsed",p=e?.variant==="featured",m=!!(e?.url&&/^(https?:)?\/\//.test(e.url))?{target:"_blank",rel:"noreferrer"}:{},g=e?f||!!e.tooltipMsg:!1,v=UJn({isActive:r,isCollapsed:f,isFeatured:p});let b=null;return i?b=l.jsx(E0n,{className:v,children:n}):e&&(b=l.jsxs(d,{href:e.url,...m,className:v,children:[e.icon,l.jsx(F1t,{state:u,children:e.name}),n]})),l.jsx("li",{...o,className:X("flex relative min-w-0",s),children:e&&g&&Oe.isValidElement(b)?l.jsxs(Jn,{children:[l.jsx(Qn,{render:b}),l.jsx(Yn,{side:"right",align:"center",sideOffset:16,children:e.tooltipMsg?f?`${e.name} | ${e.tooltipMsg}`:e.tooltipMsg:e.name})]}):b??n})}function U1t({className:e,children:t,...n}){return l.jsx("ul",{className:X("grid grid-cols-[minmax(0,1fr)] gap-1 items-start content-center",e),...n,children:t})}function q1t({className:e,children:t,...n}){return l.jsx("section",{className:X("grid grid-cols-[minmax(0,1fr)] items-start content-center relative",e),...n,children:t})}function V1t({className:e,...t}){return l.jsx("div",{role:"separator","aria-orientation":"horizontal",className:X("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),...t})}const $5e=10,qJn=5;function VJn({children:e,className:t}){const{state:n,width:r,minWidth:s,maxWidth:a,collapseBelow:i,collapsedWidth:o,isMobile:c,openMobile:u,setOpenMobile:d,setWidth:f,collapse:p,expand:h,commit:m,toggleSidebar:g,setGestureActive:v}=xq(),b=n==="collapsed",S=b&&o===0,w=y.useRef(!1),_=y.useRef(null);y.useEffect(()=>()=>{_.current?.(),_.current=null},[]);const O=y.useCallback(I=>{if(I.button!==0)return;I.preventDefault(),w.current=!1;const R=I.clientX,P=I.currentTarget,U=I.pointerId,M=P.parentElement,L=M?M.getBoundingClientRect().left:0,F=document.body.style.cursor,z=document.body.style.userSelect,q=D=>{if(D.pointerId!==U)return;const Y=D.clientX-R;if(!w.current){if(Math.abs(Y)<=qJn)return;w.current=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none",v(!0)}const V=D.clientX-L;if(i>0&&V<i){p();return}h(),f(V)},H=D=>{D&&D.pointerId!==U||(window.removeEventListener("pointermove",q),window.removeEventListener("pointerup",H),window.removeEventListener("pointercancel",H),document.body.style.cursor=F,document.body.style.userSelect=z,v(!1),m(),_.current=null)};_.current=()=>H(),window.addEventListener("pointermove",q),window.addEventListener("pointerup",H),window.addEventListener("pointercancel",H)},[i,f,h,p,m,v]),E=y.useCallback(()=>{if(w.current){w.current=!1;return}g()},[g]),T=y.useCallback(I=>{switch(I.key){case"Enter":case" ":{I.preventDefault(),g();return}case"ArrowLeft":{if(I.preventDefault(),b)return;f(r-$5e),m();return}case"ArrowRight":{if(I.preventDefault(),b){h(),m();return}f(r+$5e),m();return}case"Home":{I.preventDefault(),h(),f(s),m();return}case"End":{I.preventDefault(),h(),f(a),m();return}}},[b,r,s,a,f,h,m,g]),j=y.useCallback(I=>{const R=I.target.closest("a");!R||!R.hasAttribute("href")||I.button!==0||I.metaKey||I.ctrlKey||I.shiftKey||I.altKey||R.target==="_blank"||R.hasAttribute("download")||d(!1)},[d]);if(c)return l.jsx(WM,{open:u,onOpenChange:d,children:l.jsxs(GM,{children:[l.jsx(fj,{className:X("fixed inset-0 z-40 bg-overlay backdrop-blur-sm","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0")}),l.jsxs(pj,{className:X("fixed inset-y-0 left-0 z-50 flex h-full flex-col","w-3/4 max-w-(--sidebar-width-mobile)","bg-surface2 shadow-xl","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:slide-in-from-left data-[state=closed]:slide-out-to-left","duration-200",t),children:[l.jsx(tp,{asChild:!0,children:l.jsx(QM,{children:"Navigation"})}),l.jsx(tp,{asChild:!0,children:l.jsx(YM,{children:"Primary site navigation drawer"})}),l.jsx("div",{onClick:j,className:"flex flex-col h-full min-h-0 px-4 py-2 overflow-hidden",children:e})]})]})});const N=b?o:r;return l.jsxs("div",{className:X("sidebar-layout group/sidebar relative shrink-0 self-stretch min-h-0","w-(--sidebar-width)","transition-[width] duration-220 ease-[cubic-bezier(0.32,0.72,0,1)]","motion-reduce:transition-none","in-data-[sidebar-gesture=active]:transition-none",t,S&&"border-r-0 border-transparent"),children:[l.jsx("div",{className:X("flex flex-col h-full min-h-0 overflow-hidden","transition-opacity duration-200 motion-reduce:transition-none",b?"px-2":"px-4",S&&"opacity-0 pointer-events-none px-0"),children:e}),l.jsx("div",{role:"separator","aria-orientation":"vertical","aria-valuenow":b?void 0:N,"aria-valuemin":b?void 0:s,"aria-valuemax":b?void 0:a,"aria-valuetext":b?"collapsed":`${N} pixels`,"aria-label":`Resize sidebar. Arrow keys to resize, Enter to ${b?"expand":"collapse"}.`,tabIndex:0,onPointerDown:O,onClick:E,onKeyDown:T,className:X("group absolute top-0 -right-1 z-10 h-full w-2 cursor-col-resize touch-none","flex items-center justify-center","focus-visible:outline-hidden"),children:l.jsx("span",{"aria-hidden":!0,className:X("block h-10 w-0.5 translate-x-0 group-hover:translate-x-1.5 rounded-full bg-transparent scale-50 group-hover:scale-100","transition duration-150 ease-out motion-reduce:transition-none pointer-events-none","group-hover:bg-surface5","group-focus-visible:bg-accent1","in-data-[sidebar-gesture=active]:bg-accent1")})})]})}function HJn({sections:e,isActive:t,className:n}){const r=y.useId();return l.jsx(l.Fragment,{children:e.map(s=>{const a=s.links.length>0&&s.separator,i=s.title?`${r}-${s.key}`:void 0;return l.jsxs(q1t,{className:n,"aria-labelledby":i,"aria-label":i?void 0:s.key,children:[a?l.jsx(V1t,{}):null,s.title?l.jsx(z1t,{id:i,href:s.href,isActive:s.isHeaderActive,children:s.title}):null,l.jsx(U1t,{children:s.links.map(o=>l.jsx(B1t,{link:o,isActive:t?.(o,s.links)??o.isActive},o.name))})]},s.key)})})}function ZJn({className:e,onClick:t,...n}){const{desktopState:r,toggleSidebar:s}=xq(),a=r==="collapsed";return l.jsxs(Jn,{children:[l.jsx(Qn,{render:l.jsx("button",{type:"button","aria-label":"Toggle sidebar","aria-expanded":!a,...n,onClick:i=>{t?.(i),i.defaultPrevented||s()},className:X("flex items-center justify-center text-neutral3 rounded-md","size-9",a?"mx-auto":"ml-auto","hover:bg-sidebar-nav-hover hover:text-neutral6","transition-all duration-normal ease-out-custom","focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring","[&_svg]:w-4 [&_svg]:h-4 [&_svg]:text-neutral3 [&:hover_svg]:text-neutral5 [&_svg]:transition-transform [&_svg]:duration-normal",e),children:l.jsx(Kvn,{className:X({"rotate-180":a})})})}),l.jsxs(Yn,{children:["Toggle Sidebar",l.jsxs("div",{className:"flex items-center gap-1 [&>svg]:w-[1em] [&>svg]:h-[1em]",children:[l.jsx(Nvn,{})," Ctrl+B"]})]})]})}const xf=Object.assign(VJn,{Bottom:DJn,Nav:BJn,NavSection:q1t,NavLink:B1t,NavLabel:F1t,NavHeader:z1t,NavList:U1t,NavSeparator:V1t,Sections:HJn,Trigger:ZJn,MobileTrigger:FJn});function H1t({children:e,isLoading:t}){return l.jsx("p",{className:X("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?l.jsx(l.Fragment,{children:" "}):l.jsx(l.Fragment,{children:e})})}function Z1t({children:e,isLoading:t,size:n="default"}){return l.jsx("h1",{className:X("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":n==="smaller"}),children:t?l.jsx(l.Fragment,{children:" "}):l.jsx(l.Fragment,{children:e})})}function WJn({children:e,className:t,title:n,description:r,icon:s,isLoading:a}){const i=e===void 0&&n!==void 0;return l.jsx("header",{className:X("w-full grid",t),children:i?l.jsxs(l.Fragment,{children:[l.jsxs(Z1t,{isLoading:a,children:[s," ",n]}),r!==void 0&&l.jsx(H1t,{isLoading:a,children:r})]}):e})}Object.assign(WJn,{Title:Z1t,Description:H1t});function GJn({children:e,className:t}){return l.jsx("header",{className:X("grid items-center grid-cols-[1fr_auto]",t),children:e})}function QJn({headingLevel:e="h2",children:t,className:n}){const r=e;return l.jsx(r,{className:X("flex items-center gap-2 text-ui-lg font-bold text-neutral4","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50",n),children:t})}function W1t({children:e,className:t}){return l.jsx("section",{className:X("grid gap-4",t),children:e})}function v_({children:e,className:t}){return l.jsx("section",{className:X("grid gap-2",t),children:e})}const ql=Object.assign(W1t,{Header:GJn,Heading:QJn});function YJn({title:e,description:t,tone:n="default",id:r,className:s,descriptionClassName:a}){const i=n==="danger";return l.jsxs(l.Fragment,{children:[l.jsx("h3",{id:r,className:X("font-serif text-header-md font-normal leading-tight tracking-normal",i?"text-accent2":"text-neutral4",s),children:e}),t!=null&&l.jsx("p",{className:X("mt-2 max-w-[62ch] font-sans text-[13.5px] leading-ui-xs",i?"text-accent2/70":"text-neutral3",a),children:t})]})}function D5e({title:e,description:t,action:n,variant:r="default",fillHeight:s=!1,className:a,contentClassName:i,children:o}){const c=r==="danger";return l.jsxs("section",{"data-variant":r,className:X("overflow-hidden rounded-2xl border",s&&"flex h-full flex-col",c?"border-accent2/25":"border-border1",a),children:[l.jsxs("div",{className:X("flex flex-col gap-3 px-7 pt-7 pb-6 sm:flex-row sm:items-start sm:justify-between sm:gap-6",c?"bg-accent2/8":"bg-surface-overlay-soft"),children:[l.jsx("div",{className:"min-w-0",children:l.jsx(YJn,{title:e,description:t,tone:c?"danger":"default"})}),n!=null?l.jsx("div",{className:"shrink-0",children:n}):null]}),l.jsx("div",{className:X("min-w-0 px-7 pt-6 pb-7",s&&"flex-1",c?"bg-accent2/4":null,i),children:o})]})}function XJn({label:e,description:t,htmlFor:n,className:r,children:s}){return l.jsxs("div",{className:X("flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",r),"data-slot":"settings-row",children:[l.jsxs("div",{children:[n?l.jsx(jt,{htmlFor:n,className:"text-sm font-medium",children:e}):l.jsx("p",{className:"text-sm font-medium",children:e}),t&&l.jsx("p",{className:"text-sm text-neutral3",children:t})]}),s]})}function KJn(){return lj({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8125rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"#939393",background:"transparent"},styles:[{tag:[ae.className,ae.propertyName]}]})}function JJn(){const e=xt.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=Um.define([{tag:[ae.comment,ae.bracket],color:"var(--neutral2)"},{tag:[ae.string,ae.meta,ae.regexp],color:"var(--accent1)"},{tag:[ae.atom,ae.bool,ae.special(ae.variableName)],color:"var(--accent6)"},{tag:[ae.keyword,ae.operator,ae.tagName],color:"var(--accent2)"},{tag:[ae.function(ae.propertyName),ae.propertyName],color:"var(--accent5)"},{tag:[ae.definition(ae.variableName),ae.function(ae.variableName),ae.className,ae.attributeName],color:"var(--accent3)"},{tag:[ae.variableName,ae.number],color:"var(--accent5)"},{tag:[ae.name,ae.quote],color:"var(--accent1)"}]);return[e,Cw(t)]}const eer=()=>{const e=$j().resolvedTheme==="dark";return y.useMemo(()=>e?KJn():JJn(),[e])};function ter({codeStr:e="",title:t,icon:n,simplified:r=!1}){const s=eer(),[a,i]=y.useState(!1),o=y.useMemo(()=>{try{const u=JSON.parse(e);return wfe(u||"")}catch{return!1}},[e]),c=a?e?.replace(/\\n/g,`
@@ -662,7 +662,7 @@ Token usage: ${n} input + ${r} output = ${s} total`:`The model stopped generatin
662
662
  "groundTruth": "Expected result (optional)",
663
663
  "metadata": { "key": "value" } // optional
664
664
  }
665
- ]`})]})]})}function wts({errors:e,maxErrors:t=5}){if(e.length===0)return null;const n=e.slice(0,t),r=e.length-t;return l.jsxs("div",{className:"bg-accent2/10 border border-accent2/30 rounded-md p-3",children:[l.jsxs("div",{className:"flex items-center gap-2 text-accent2 mb-2",children:[l.jsx(Be,{children:l.jsx(Vy,{className:"w-4 h-4"})}),l.jsxs("span",{className:"font-medium text-sm",children:[e.length," validation error",e.length!==1?"s":""]})]}),l.jsx("ul",{className:"text-sm text-accent2/80 space-y-1",children:n.map((s,a)=>l.jsxs("li",{className:"flex gap-2",children:[l.jsx("span",{className:"shrink-0",children:"•"}),l.jsx("span",{children:s.message})]},a))}),r>0&&l.jsxs("div",{className:"text-xs text-accent2/60 mt-2",children:["+",r," more error",r!==1?"s":""]})]})}function Sts({datasetId:e,open:t,onOpenChange:n,onSuccess:r}){const[s,a]=y.useState("upload"),[i,o]=y.useState(null),[c,u]=y.useState({current:0,total:0}),[d,f]=y.useState(null),[p,h]=y.useState(!1),{parseFile:m,isParsing:g,error:v}=Tes(),{batchInsertItems:b}=Di(),S=y.useCallback(async I=>{try{const R=await m(I);o(R),a("preview")}catch{}},[m]),w=y.useCallback(async()=>{if(!i||i.items.length===0)return;a("importing"),h(!0);const{items:I}=i;u({current:0,total:I.length});try{await b.mutateAsync({datasetId:e,items:I.map(R=>({input:R.input,groundTruth:R.groundTruth,metadata:R.metadata}))}),f({success:I.length,errors:0})}catch{f({success:0,errors:I.length})}u({current:I.length,total:I.length}),h(!1),a("complete")},[i,b,e]),_=y.useCallback(()=>{n(!1),r?.(),d&&d.success>0&&Fe.success(`Imported ${d.success} item${d.success!==1?"s":""}`),setTimeout(()=>{a("upload"),o(null),u({current:0,total:0}),f(null)},150)},[n,r,d]),O=y.useCallback(()=>{p||(n(!1),setTimeout(()=>{a("upload"),o(null),u({current:0,total:0}),f(null)},150))},[p,n]),E=i&&i.items.length>0&&i.errors.length===0,T=()=>{switch(s){case"upload":return l.jsx(xts,{onFileSelect:S,isParsing:g,error:v?.message});case"preview":return i?l.jsx("div",{className:"flex flex-col gap-4",children:i.errors.length>0?l.jsxs(l.Fragment,{children:[l.jsx(wts,{errors:i.errors}),l.jsx("div",{className:"text-sm text-neutral4",children:"Please fix the errors in your JSON file and try again."})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"text-sm text-neutral4",children:["Found ",i.items.length," valid item",i.items.length!==1?"s":""," to import."]}),l.jsx(bts,{items:i.items,maxRows:5})]})}):null;case"importing":return l.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[l.jsx(Qt,{size:"lg"}),l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Importing items..."}),l.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[c.current," of ",c.total]})]})]});case"complete":return l.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[l.jsx("div",{className:"text-4xl",children:d&&d.errors===0?"✓":"⚠"}),l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Import Complete"}),l.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[d?.success??0," item",d?.success!==1?"s":""," imported",d&&d.errors>0&&l.jsxs("span",{className:"text-accent2",children:[" ","(",d.errors," error",d.errors!==1?"s":"",")"]})]})]})]})}},j=()=>{switch(s){case"upload":return l.jsx(de,{onClick:O,children:"Cancel"});case"preview":return l.jsxs(l.Fragment,{children:[l.jsx(de,{onClick:()=>a("upload"),children:"Back"}),l.jsxs(de,{variant:"primary",onClick:w,disabled:!E,children:["Import ",i?.items.length??0," Item",i?.items.length!==1?"s":""]})]});case"importing":return null;case"complete":return l.jsx(de,{variant:"primary",onClick:_,children:"Done"})}},N={upload:"Import JSON",preview:"Preview Data",importing:"Importing",complete:"Import Complete"};return l.jsx(Lr,{open:t,onOpenChange:O,children:l.jsxs(Ir,{className:"max-w-2xl max-h-[90vh]",children:[l.jsxs(zr,{children:[l.jsx(Rr,{children:N[s]}),l.jsx(ha,{children:"Import dataset items from a JSON file."})]}),l.jsx(ns,{className:"min-h-[200px] max-h-[50vh] overflow-y-auto",children:T()}),l.jsx(ap,{className:"px-6 pt-4 flex justify-end gap-2",children:j()})]})})}function kts({dataset:e,isLoading:t=!1,onEditClick:n,onDuplicateClick:r,onDeleteClick:s,experimentTriggerSlot:a,disableExperimentTrigger:i=!1,onExperimentClick:o,className:c}){return l.jsxs(Wn,{className:c,children:[l.jsxs(Wn.Column,{children:[l.jsxs(Wn.Title,{isLoading:t,children:[l.jsx(U0,{})," ",e?.name]}),l.jsx(Wn.Description,{isLoading:t,children:e?.description}),l.jsxs(Wn.Description,{isLoading:t,children:[l.jsxs(fs,{children:[l.jsx(xC,{})," Created at ",e?.createdAt?kn(new Date(e.createdAt),"MMM d, yyyy"):""]}),l.jsxs(fs,{children:[l.jsx(kw,{})," Latest version v",e?.version??""]})]})]}),l.jsx(Wn.Column,{children:l.jsxs(Nr,{children:[a?i?l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx("span",{className:"cursor-not-allowed",children:l.jsx("div",{className:"pointer-events-none opacity-50",inert:!0,"aria-disabled":"true",children:a})})}),l.jsx(Yn,{children:"Add items to the dataset before running an experiment"})]}):a:o?i?l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx("span",{className:"cursor-not-allowed",children:l.jsxs(de,{disabled:!0,tabIndex:-1,children:[l.jsx(rb,{}),"Run Experiment"]})})}),l.jsx(Yn,{children:"Add items to the dataset before running an experiment"})]}):l.jsxs(de,{onClick:o,children:[l.jsx(rb,{}),"Run Experiment"]}):null,l.jsxs(_t,{children:[l.jsx(_t.Trigger,{asChild:!0,children:l.jsx(de,{size:"default","aria-label":"Dataset actions menu",children:l.jsx(iet,{})})}),l.jsxs(_t.Content,{align:"end",className:"w-48",children:[l.jsxs(_t.Item,{onSelect:n,children:[l.jsx(Cb,{})," Edit Dataset"]}),l.jsxs(_t.Item,{onSelect:r,children:[l.jsx(Jf,{})," Duplicate Dataset"]}),l.jsxs(_t.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[l.jsx(Zd,{})," Delete Dataset"]})]})]})]})})]})}const wLt=e=>{const t=Ze(),{data:n}=mM(e),r=n?.experiments;return St({queryKey:["dataset-review-items",e,r?.map(s=>s.id)],queryFn:async()=>!r||r.length===0?[]:(await Promise.all(r.map(async a=>{if(!a.datasetId)return[];try{const{results:i}=await t.listDatasetExperimentResults(a.datasetId,a.id);return i.filter(o=>o.status==="needs-review").map(o=>({id:o.id,input:o.input,output:o.output,error:o.error,itemId:o.itemId,experimentId:o.experimentId,datasetId:a.datasetId??void 0,traceId:o.traceId??void 0,scores:o.scores?Object.fromEntries(o.scores.map(c=>[c.scorerId,c.score??0])):{},tags:o.tags??[],comment:""}))}catch{return[]}}))).flat(),enabled:!!e&&!!r&&r.length>0,refetchOnWindowFocus:!1})},_ts=e=>{const t=Ze(),{data:n}=mM(e),r=n?.experiments;return St({queryKey:["dataset-completed-items",e,r?.map(s=>s.id)],queryFn:async()=>!r||r.length===0?[]:(await Promise.all(r.map(async a=>{if(!a.datasetId)return[];try{const{results:i}=await t.listDatasetExperimentResults(a.datasetId,a.id);return i.filter(o=>o.status==="complete").map(o=>({id:o.id,input:o.input,output:o.output,error:o.error,itemId:o.itemId,experimentId:o.experimentId,datasetId:a.datasetId??void 0,traceId:o.traceId??void 0,scores:o.scores?Object.fromEntries(o.scores.map(c=>[c.scorerId,c.score??0])):{},tags:o.tags??[],comment:""}))}catch{return[]}}))).flat(),enabled:!!e&&!!r&&r.length>0,refetchOnWindowFocus:!1})};function Ots(e,t){if(typeof e=="string")return e.length>t?e.slice(0,t)+"...":e;try{const n=JSON.stringify(e);return n.length>t?n.slice(0,t)+"...":n}catch{return String(e)}}const Ets=X("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 uXe({className:e,children:t,...n}){return l.jsx(a$,{children:l.jsx(FB,{className:X(Ets,e),...n,children:t})})}function Cts({datasetId:e}){const t=Ze(),{data:n}=Ub(e),{data:r,isLoading:s}=wLt(e),{data:a,isLoading:i}=_ts(e),{updateExperimentResult:o}=Di(),[c,u]=y.useState(null),[d,f]=y.useState(null),[p,h]=y.useState(new Set),[m,g]=y.useState(!1),[v,b]=y.useState(!1),[S,w]=y.useState(!1),[_,O]=y.useState(""),[E,T]=y.useState(""),[j,N]=y.useState(""),[I,R]=y.useState([]),[P,U]=y.useState(!1),[M,L]=y.useState(null),F=M??r??[];y.useEffect(()=>{r&&M===null&&L(r)},[r]);const z=y.useMemo(()=>{const fe=new Set;if(n?.tags)for(const ye of n.tags)fe.add(ye);for(const ye of F)for(const _e of ye.tags)fe.add(_e);return[...fe].sort()},[n,F]),q=y.useCallback(fe=>{!n||!e||(n.tags??[]).includes(fe)},[n,e]),H=y.useMemo(()=>d?d==="__untagged__"?F.filter(fe=>fe.tags.length===0):F.filter(fe=>fe.tags.includes(d)):F,[F,d]),D=y.useMemo(()=>{const fe=new Map;for(const ye of F)for(const _e of ye.tags)fe.set(_e,(fe.get(_e)??0)+1);return[...fe.entries()].sort((ye,_e)=>_e[1]-ye[1])},[F]),Y=y.useMemo(()=>F.filter(fe=>fe.tags.length===0).length,[F]),V=y.useMemo(()=>{let fe=0;return d&&fe++,m&&fe++,fe},[d,m]),$=y.useCallback((fe,ye)=>{L(qe=>(qe??[]).map(Ge=>Ge.id===fe?{...Ge,tags:ye}:Ge));const _e=F.find(qe=>qe.id===fe);_e?.experimentId&&_e?.datasetId&&o.mutate({datasetId:_e.datasetId,experimentId:_e.experimentId,resultId:_e.id,tags:ye})},[F,o]),W=y.useCallback((fe,ye)=>{const _e=F.find(qe=>qe.id===fe);_e?.traceId&&ye!==void 0&&t.createFeedback({feedback:{traceId:_e.traceId,source:"studio",feedbackSource:"studio",feedbackType:"rating",value:ye==="positive"?1:-1,experimentId:_e.experimentId??void 0,sourceId:_e.id}}).catch(()=>{}),L(qe=>(qe??[]).map(Ge=>Ge.id===fe?{...Ge,rating:ye}:Ge))},[F,t]),G=y.useCallback((fe,ye)=>{const _e=F.find(qe=>qe.id===fe);_e?.traceId&&t.createFeedback({feedback:{traceId:_e.traceId,source:"studio",feedbackSource:"studio",feedbackType:"comment",value:ye,comment:ye,experimentId:_e.experimentId??void 0,sourceId:_e.id}}).catch(()=>{}),L(qe=>(qe??[]).map(Ge=>Ge.id===fe?{...Ge,comment:ye}:Ge))},[F,t]),K=y.useCallback(fe=>{const ye=F.find(_e=>_e.id===fe);L(_e=>(_e??[]).filter(qe=>qe.id!==fe)),h(_e=>{const qe=new Set(_e);return qe.delete(fe),qe}),c===fe&&u(null),ye?.experimentId&&ye?.datasetId&&o.mutate({datasetId:ye.datasetId,experimentId:ye.experimentId,resultId:ye.id,status:null})},[F,o,c]),re=y.useCallback(fe=>{const ye=F.find(_e=>_e.id===fe);L(_e=>(_e??[]).filter(qe=>qe.id!==fe)),h(_e=>{const qe=new Set(_e);return qe.delete(fe),qe}),c===fe&&u(null),ye?.experimentId&&ye?.datasetId&&o.mutate({datasetId:ye.datasetId,experimentId:ye.experimentId,resultId:ye.id,status:"complete"})},[F,o,c]),J=y.useMemo(()=>{const fe=m?a??[]:H;return!m||!d?fe:d==="__untagged__"?fe.filter(ye=>ye.tags.length===0):fe.filter(ye=>ye.tags.includes(d))},[m,a,H,d]),ee=m?i:!1,se=y.useMemo(()=>new Set(J.map(fe=>fe.id)),[J]),ie=y.useMemo(()=>[...p].filter(fe=>se.has(fe)).length,[p,se]),Q=J.length>0&&ie===J.length,ne=ie>0&&!Q,oe=y.useCallback(fe=>{h(ye=>{const _e=new Set(ye);return _e.has(fe)?_e.delete(fe):_e.add(fe),_e})},[]),me=y.useCallback(()=>{h(Q?new Set:new Set(J.map(fe=>fe.id)))},[Q,J]),ce=y.useCallback(fe=>{for(const ye of p){const _e=F.find(qe=>qe.id===ye);_e&&!_e.tags.includes(fe)&&$(ye,[..._e.tags,fe])}},[F,p,$]),be=y.useCallback(fe=>{for(const ye of p){const _e=F.find(qe=>qe.id===ye);_e&&_e.tags.includes(fe)&&$(ye,_e.tags.filter(qe=>qe!==fe))}},[F,p,$]),Ce=y.useCallback(()=>{for(const fe of p)re(fe);h(new Set)},[p,re]),je=y.useCallback(()=>{for(const fe of p)K(fe);h(new Set)},[p,K]),We=y.useCallback(()=>{O(""),w(!0)},[]),Pe=y.useCallback(async()=>{if(!(!E||!j)){b(!0),w(!1);try{const fe=F.filter(_e=>p.has(_e.id));if(fe.length===0){b(!1);return}const ye=await t.clusterFailures({modelId:`${E}/${j}`,items:fe.map(_e=>({id:_e.id,input:_e.input,output:_e.output??void 0,error:typeof _e.error=="string"?_e.error:_e.error?String(_e.error):void 0,scores:_e.scores,existingTags:_e.tags.length>0?_e.tags:void 0})),availableTags:z.length>0?z:void 0,prompt:_||void 0});ye.proposedTags&&ye.proposedTags.length>0&&(R(ye.proposedTags.map(_e=>({..._e,accepted:!0}))),U(!0))}catch(fe){console.error("Analysis failed:",fe)}finally{b(!1)}}},[E,j,F,p,t,z,_]),ze=y.useCallback(()=>{for(const fe of I){if(!fe.accepted)continue;const ye=F.find(_e=>_e.id===fe.itemId);if(ye){const _e=[...new Set([...ye.tags,...fe.tags])];$(ye.id,_e)}}U(!1)},[I,F,$]),Se=y.useCallback(fe=>{u(ye=>ye===fe?null:fe)},[]),le=y.useMemo(()=>c?J.find(fe=>fe.id===c)??null:null,[c,J]),ve=y.useCallback(()=>{if(!c||J.length===0)return;const fe=J.findIndex(ye=>ye.id===c);fe<J.length-1&&u(J[fe+1].id)},[c,J]),ue=y.useCallback(()=>{if(!c||J.length===0)return;const fe=J.findIndex(ye=>ye.id===c);fe>0&&u(J[fe-1].id)},[c,J]),xe=le?"2rem 1fr 10rem 8rem":"2rem 1fr 10rem 8rem 6rem 6rem";return s?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx(Qt,{className:"w-6 h-6"})}):l.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[l.jsx(Lr,{open:S,onOpenChange:w,children:l.jsxs(Ir,{children:[l.jsxs(zr,{children:[l.jsx(Rr,{children:"Analyze Items"}),l.jsx(ha,{children:"Use an LLM to automatically suggest tags for the selected items."})]}),l.jsxs("div",{className:"space-y-4 py-2",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsxs("div",{children:[l.jsx(jt,{className:"text-xs mb-1 block",children:"Provider"}),l.jsx(Fv,{value:E,onValueChange:T})]}),l.jsxs("div",{children:[l.jsx(jt,{className:"text-xs mb-1 block",children:"Model"}),l.jsx(Bv,{llmId:E,value:j,onValueChange:N})]})]}),l.jsxs(ge,{variant:"ui-xs",className:"text-neutral3",children:[p.size," item",p.size!==1?"s":""," will be analyzed"]}),l.jsxs("div",{children:[l.jsx(jt,{className:"text-xs",children:"Instructions (optional)"}),l.jsx(iu,{value:_,onChange:fe=>O(fe.target.value),placeholder:"E.g., Focus on safety issues and factual errors...",rows:3,className:"text-xs mt-1"})]})]}),l.jsxs(ap,{children:[l.jsx(de,{variant:"outline",onClick:()=>w(!1),children:"Cancel"}),l.jsxs(de,{onClick:Pe,disabled:!E||!j||v,children:[v?l.jsx(Qt,{className:"w-4 h-4 mr-1"}):null,"Analyze"]})]})]})}),l.jsx(Lr,{open:P,onOpenChange:U,children:l.jsxs(Ir,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[l.jsxs(zr,{children:[l.jsx(Rr,{children:"Review Proposed Tags"}),l.jsxs(ha,{children:[I.filter(fe=>fe.accepted).length," of ",I.length," proposals selected"]})]}),l.jsx("div",{className:"space-y-3 py-2",children:I.map((fe,ye)=>{const _e=F.find(qe=>qe.id===fe.itemId);return l.jsx("div",{className:X("p-3 border rounded-lg",!fe.accepted&&"opacity-50"),children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(oo,{checked:fe.accepted,onCheckedChange:qe=>R(Ge=>Ge.map((ct,De)=>De===ye?{...ct,accepted:!!qe}:ct))}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx(ge,{variant:"ui-xs",className:"text-neutral4 truncate block",children:_e?typeof _e.input=="string"?_e.input.slice(0,100):JSON.stringify(_e.input).slice(0,100):fe.itemId}),l.jsx("div",{className:"flex gap-1 flex-wrap mt-1.5",children:fe.tags.map((qe,Ge)=>l.jsx(dLt,{tag:qe,onRename:ct=>R(De=>De.map((Ve,Ae)=>Ae===ye?{...Ve,tags:Ve.tags.map((Ke,Me)=>Me===Ge?ct:Ke)}:Ve)),onRemove:()=>R(ct=>ct.map((De,Ve)=>Ve===ye?{...De,tags:De.tags.filter((Ae,Ke)=>Ke!==Ge)}:De))},`${qe}-${Ge}`))}),fe.reason&&l.jsx(ge,{variant:"ui-xs",className:"text-neutral3 mt-1 block italic",children:fe.reason})]})]})},fe.itemId)})}),l.jsxs(ap,{children:[l.jsx(de,{variant:"outline",onClick:()=>U(!1),children:"Cancel"}),l.jsxs(de,{onClick:ze,disabled:I.filter(fe=>fe.accepted).length===0,children:["Accept ",I.filter(fe=>fe.accepted).length," proposals"]})]})]})}),l.jsxs(Yf,{className:le?"grid-cols-[1fr_1fr]":"",children:[l.jsxs(An,{children:[l.jsxs(An.Toolbar,{children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(_t,{children:[l.jsx(_t.Trigger,{asChild:!0,children:l.jsxs(de,{variant:"outline",size:"md",children:[l.jsx(cet,{}),"Filter",V>0&&l.jsx("span",{className:X("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})]})}),l.jsxs(_t.Content,{align:"start",className:X("min-w-48"),children:[l.jsxs(_t.Sub,{children:[l.jsxs(_t.SubTrigger,{children:["Status",m&&l.jsx("span",{className:X("ml-auto text-ui-sm text-accent1"),children:"1"})]}),l.jsxs(uXe,{children:[l.jsx(_t.CheckboxItem,{checked:!m,onCheckedChange:()=>{g(!1),u(null)},onSelect:fe=>fe.preventDefault(),children:"Review Queue"}),l.jsx(_t.CheckboxItem,{checked:m,onCheckedChange:()=>{g(!0),u(null)},onSelect:fe=>fe.preventDefault(),children:"Completed"})]})]}),l.jsxs(_t.Sub,{children:[l.jsxs(_t.SubTrigger,{children:["Tags",d&&l.jsx("span",{className:X("ml-auto text-ui-sm text-accent1"),children:"1"})]}),l.jsxs(uXe,{children:[l.jsx(_t.CheckboxItem,{checked:!d,onCheckedChange:()=>f(null),onSelect:fe=>fe.preventDefault(),children:"All"}),Y>0&&l.jsx(_t.CheckboxItem,{checked:d==="__untagged__",onCheckedChange:()=>f(d==="__untagged__"?null:"__untagged__"),onSelect:fe=>fe.preventDefault(),children:"Untagged"}),D.length>0&&l.jsx(_t.Separator,{}),D.map(([fe])=>l.jsx(_t.CheckboxItem,{checked:d===fe,onCheckedChange:()=>f(d===fe?null:fe),onSelect:ye=>ye.preventDefault(),children:fe},fe))]})]}),V>0&&l.jsxs(l.Fragment,{children:[l.jsx(_t.Separator,{}),l.jsxs(_t.Item,{onSelect:()=>{f(null),g(!1),u(null)},children:[l.jsx(Pr,{}),"Clear all filters"]})]})]})]}),V>0&&l.jsxs(de,{variant:"outline",size:"md",onClick:()=>{f(null),g(!1),u(null)},children:[l.jsx(Pr,{}),"Reset"]})]}),!m&&p.size>0&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(uLt,{selectedCount:p.size,vocabulary:z,onApplyTag:ce,onRemoveTag:be,onNewTag:fe=>ce(fe)}),l.jsxs(_t,{children:[l.jsx(_t.Trigger,{asChild:!0,children:l.jsxs(de,{disabled:v,children:[v?l.jsx(Qt,{className:"w-4 h-4"}):l.jsx(Be,{size:"sm",children:l.jsx(ys,{})}),"Actions"]})}),l.jsxs(_t.Content,{align:"end",children:[l.jsxs(_t.Item,{onSelect:Ce,children:[l.jsx(Be,{size:"sm",children:l.jsx(US,{})}),"Complete"]}),l.jsxs(_t.Item,{onSelect:je,children:[l.jsx(Be,{size:"sm",children:l.jsx(Zd,{})}),"Remove"]}),l.jsx(_t.Separator,{}),l.jsxs(_t.Item,{onSelect:We,children:[l.jsx(Be,{size:"sm",children:l.jsx(kC,{})}),"Analyze"]})]})]})]})]}),ee?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx(Qt,{className:"w-6 h-6"})}):J.length===0?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsxs("div",{className:"text-center px-8",children:[l.jsx(ge,{variant:"ui-sm",className:"text-neutral3 block",children:m?"No completed reviews yet":"No items to review"}),l.jsx(ge,{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."})]})}):l.jsxs(we,{columns:xe,children:[l.jsxs(we.Top,{children:[!m&&l.jsx(we.TopCell,{children:l.jsx(oo,{checked:Q?!0:ne?"indeterminate":!1,onCheckedChange:()=>me(),"aria-label":"Select all"})}),m&&l.jsx(we.TopCell,{children:" "}),l.jsx(we.TopCell,{children:"Input"}),l.jsx(we.TopCell,{children:"Comment"}),l.jsx(we.TopCell,{children:"Tags"}),!le&&l.jsx(we.TopCell,{children:"Rating"}),!le&&l.jsx(we.TopCell,{children:"Scores"})]}),l.jsx(we.Rows,{children:J.map(fe=>{const ye=fe.scores?Object.entries(fe.scores):[];return l.jsxs(we.Row,{onClick:()=>Se(fe.id),selected:c===fe.id,children:[l.jsx(we.Cell,{children:m?fe.error?l.jsx("div",{className:"w-2 h-2 rounded-full bg-red-700",title:"Error"}):l.jsx("div",{className:"w-2 h-2 rounded-full bg-green-600",title:"Success"}):l.jsx(oo,{checked:p.has(fe.id),onCheckedChange:()=>oe(fe.id),onClick:_e=>_e.stopPropagation(),"aria-label":`Select item ${fe.id}`})}),l.jsx(we.NameCell,{children:Ots(fe.input,80)}),l.jsx(we.Cell,{children:fe.comment?l.jsx(ge,{variant:"ui-xs",className:"text-neutral3 truncate",children:fe.comment}):l.jsx(ge,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),l.jsx(we.Cell,{children:fe.tags.length>0?l.jsx(ge,{variant:"ui-xs",className:"text-neutral4 truncate",children:fe.tags.join(", ")}):l.jsx(ge,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),!le&&l.jsxs(we.Cell,{children:[fe.rating==="positive"&&l.jsx(Be,{size:"sm",className:"text-positive1",children:l.jsx(jme,{})}),fe.rating==="negative"&&l.jsx(Be,{size:"sm",className:"text-negative1",children:l.jsx(Tme,{})}),!fe.rating&&l.jsx(ge,{variant:"ui-xs",className:"text-neutral2",children:"—"})]}),!le&&l.jsx(we.Cell,{children:ye.length>0?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Be,{size:"sm",className:"text-neutral3",children:l.jsx(cu,{})}),l.jsx(ge,{variant:"ui-xs",className:"text-neutral4 font-mono",children:ye[0][1].toFixed(2)}),ye.length>1&&l.jsxs(Et,{variant:"default",children:["+",ye.length-1]})]}):l.jsx(ge,{variant:"ui-xs",className:"text-neutral2",children:"—"})})]},fe.id)})})]})]}),le&&l.jsx(cLt,{item:le,isCompleted:m,tagVocabulary:z,onRate:fe=>W(le.id,fe),onSetTags:fe=>{$(le.id,fe);for(const ye of fe)z.includes(ye)||q(ye)},onComment:fe=>G(le.id,fe),onRemove:()=>K(le.id),onComplete:m?void 0:()=>re(le.id),onPrevious:ue,onNext:ve,onClose:()=>u(null)})]})]})}function Tts({datasetId:e,onExperimentClick:t,onEditClick:n,onDeleteClick:r,onAddItemClick:s,experimentTriggerSlot:a,onNavigateToDataset:i,activeDatasetVersion:o,onVersionSelect:c,initialTab:u,onTabChange:d}){const{navigate:f}=an(),[p,h]=y.useState(u??"items"),m=en=>{h(en),d?.(en)},[g,v]=y.useState(!1),[b,S]=y.useState(!1),[w,_]=y.useState(!1),[O,E]=y.useState([]),[T,j]=y.useState(!1),[N,I]=y.useState([]),[R,P]=y.useState(!1),[U,M]=y.useState([]),[L,F]=y.useState(!1),[z,q]=y.useState(0),[H,D]=y.useState(null),[Y,V]=y.useState(""),[$]=qTn(Y,300),[W,G]=y.useState(null),re=o!==void 0?o:W,{data:J,isLoading:ee}=Ub(e),{data:se=[],total:ie,isLoading:Q,setEndOfListElement:ne,isFetchingNextPage:oe,hasNextPage:me}=UT(e,$||void 0,re),{data:ce=[],total:be,isLoading:Ce}=UT(e,void 0,re),[je,We]=y.useState({}),{data:Pe,isLoading:ze}=mM(e,void 0,je),{data:Se}=mM(e),{deleteItems:le}=Di(),ve=Pe?.experiments??[],ue=Se?.experiments??[],xe=Hes({hasSearchQuery:!!$,filteredItemsLength:se.length,unfilteredItemsTotal:be,itemsTotal:ie}),{data:fe}=wLt(e),ye=fe?.length??0,_e=en=>{D(en)},qe=()=>{D(null)},Ge=en=>{const En=en.isCurrent?null:en;c?c(En):G(en.isCurrent?null:en.version)},ct=en=>{E(en),_(!0)},De=en=>{I(en),j(!0)},Ve=en=>{j(en),en||(I([]),q(En=>En+1))},Ae=en=>{f(`/datasets/${e}/items?items=${en.join(",")}`)},Ke=en=>{f(`/datasets/${e}/versions?ids=${en.join(",")}`)},Me=en=>{M(en),P(!0)},ft=async()=>{await le.mutateAsync({datasetId:e,itemIds:U}),Fe.success(`Deleted ${U.length} items`),P(!1),M([]),q(en=>en+1)},kt=en=>{_(!1),E([]),q(En=>En+1),i?.(en)},Tn=en=>{_(en),en||(E([]),q(En=>En+1))};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-rows-[auto_1fr] mx-auto h-full w-full max-w-[120rem] px-12 pb-4",children:[l.jsx(kts,{dataset:J,isLoading:ee,onEditClick:n,onDuplicateClick:()=>F(!0),onDeleteClick:r,experimentTriggerSlot:a,disableExperimentTrigger:!Ce&&ce.length===0,onExperimentClick:t}),l.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:l.jsxs(ku,{defaultTab:"items",value:p,onValueChange:m,className:"grid grid-rows-[auto_1fr] h-full",children:[l.jsxs(_u,{children:[l.jsxs(Hr,{value:"items",children:["Items ",l.jsx(ai,{color:"gray",children:xe})]}),l.jsxs(Hr,{value:"experiments",children:["Experiments",l.jsx(ai,{color:"gray",children:ve.length})]}),l.jsxs(Hr,{value:"review",children:["Review",ye>0&&l.jsx(ai,{color:"orange",children:ye})]})]}),l.jsx(_s,{value:"items",className:"grid overflow-auto mt-5",children:l.jsx(yts,{datasetId:e,items:se,isLoading:Q,featuredItemId:H,onItemSelect:_e,onItemClose:qe,onAddClick:s??(()=>{}),onImportClick:()=>v(!0),onImportJsonClick:()=>S(!0),onBulkDeleteClick:Me,onCreateDatasetClick:ct,onAddToDatasetClick:De,onCompareItemsClick:Ae,datasetName:J?.name,clearSelectionTrigger:z,setEndOfListElement:ne,isFetchingNextPage:oe,hasNextPage:me,searchQuery:Y,onSearchChange:V,activeDatasetVersion:re,currentDatasetVersion:J?.version,onVersionSelect:Ge,onCompareVersionsClick:Ke})}),l.jsx(_s,{value:"experiments",className:"grid overflow-auto mt-5",children:l.jsx(ots,{experiments:ve,allExperiments:ue,isLoading:ze,datasetId:e,filters:je,onFiltersChange:We})}),l.jsx(_s,{value:"review",className:"overflow-auto mt-0",children:l.jsx(Cts,{datasetId:e})})]})})]}),l.jsx(Jes,{datasetId:e,open:g,onOpenChange:v}),l.jsx(Sts,{datasetId:e,open:b,onOpenChange:S}),l.jsx(Fes,{open:w,onOpenChange:Tn,items:O,onSuccess:kt}),l.jsx(Bes,{open:T,onOpenChange:Ve,items:N,currentDatasetId:e}),l.jsx(Ues,{open:L,onOpenChange:F,sourceDatasetId:e,sourceDatasetName:J?.name||"",sourceDatasetDescription:J?.description,onSuccess:i}),l.jsx(Gt,{open:R,onOpenChange:P,children:l.jsxs(Gt.Content,{children:[l.jsxs(Gt.Header,{children:[l.jsx(Gt.Title,{children:"Delete Items"}),l.jsxs(Gt.Description,{children:["Are you sure you want to delete ",U.length," item",U.length!==1?"s":"","? This action cannot be undone."]})]}),l.jsxs(Gt.Footer,{children:[l.jsx(Gt.Cancel,{children:"Cancel"}),l.jsx(Gt.Action,{onClick:ft,children:le.isPending?"Deleting...":"Delete"})]})]})})]})}function jts(e){if(!(e instanceof Error))return null;const t=e.message.match(/- ({.*})$/);if(!t)return null;try{const n=JSON.parse(t[1]);if(n.field&&Array.isArray(n.errors))return{field:n.field,errors:n.errors}}catch{}return null}function dXe({field:e,errors:t}){return t.length?l.jsx("div",{className:"mt-2 space-y-1",children:t.map((n,r)=>l.jsxs("p",{className:"text-xs text-destructive",children:[l.jsxs("code",{className:"bg-destructive/10 px-1 rounded",children:[e,n.path!=="/"?n.path:""]}),": ",n.message]},r))}):null}function Nts({datasetId:e,open:t,onOpenChange:n,onSuccess:r}){const[s,a]=y.useState("{}"),[i,o]=y.useState(""),[c,u]=y.useState(""),[d,f]=y.useState(null),{addItem:p}=Di(),h=async b=>{b.preventDefault();let S;try{S=JSON.parse(s)}catch{Fe.error("Input must be valid JSON");return}let w;if(i.trim())try{w=JSON.parse(i)}catch{Fe.error("Ground Truth must be valid JSON");return}let _;if(c.trim())try{_=JSON.parse(c)}catch{Fe.error("Expected Trajectory must be valid JSON");return}try{await p.mutateAsync({datasetId:e,input:S,groundTruth:w,expectedTrajectory:_}),Fe.success("Item added successfully"),f(null),a("{}"),o(""),u(""),n(!1),r?.()}catch(O){const E=jts(O);E?f(E):Fe.error(`Failed to add item: ${O instanceof Error?O.message:"Unknown error"}`)}},m=b=>{a(b),d?.field==="input"&&f(null)},g=b=>{o(b),d?.field==="groundTruth"&&f(null)},v=()=>{a("{}"),o(""),u(""),f(null),n(!1)};return l.jsx(Lr,{open:t,onOpenChange:n,children:l.jsxs(Ir,{className:"max-w-lg",children:[l.jsx(zr,{children:l.jsx(Rr,{children:"Add Item"})}),l.jsx(ns,{children:l.jsxs("form",{onSubmit:h,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(jt,{htmlFor:"item-input",children:"Input (JSON) *"}),l.jsx(As,{value:s,onChange:m,showCopyButton:!1,className:"min-h-[120px]"}),d?.field==="input"&&l.jsx(dXe,{field:"input",errors:d.errors})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(jt,{htmlFor:"item-ground-truth",children:"Ground Truth (JSON, optional)"}),l.jsx(As,{value:i,onChange:g,showCopyButton:!1,className:"min-h-[80px]"}),d?.field==="groundTruth"&&l.jsx(dXe,{field:"groundTruth",errors:d.errors})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(jt,{htmlFor:"item-trajectory",children:"Expected Trajectory (JSON, optional)"}),l.jsx(As,{value:c,onChange:u,showCopyButton:!1,className:"min-h-[80px]"})]}),l.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[l.jsx(de,{type:"button",onClick:v,children:"Cancel"}),l.jsx(de,{type:"submit",variant:"primary",disabled:p.isPending,children:p.isPending?"Adding...":"Add Item"})]})]})})]})})}function Ats({selectedScorers:e,setSelectedScorers:t,disabled:n=!1,container:r}){const{data:s,isLoading:a}=Op(),i=y.useMemo(()=>s?Object.entries(s).map(([o,c])=>({value:o,label:c.scorer?.config?.name||o,description:c.scorer?.config?.description||""})):[],[s]);return l.jsxs("div",{className:"grid gap-2",children:[l.jsx(jt,{children:"Scorers (Optional)"}),l.jsx(Wwt,{options:i,value:e,onValueChange:t,placeholder:"Select scorers...",searchPlaceholder:"Search scorers...",emptyText:"No scorers available",disabled:n||a,container:r})]})}const Its=[{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"}];function Rts({targetType:e,setTargetType:t,targetId:n,setTargetId:r,container:s}){const{data:a,isLoading:i}=Lv(),{data:o,isLoading:c}=Bw(),{data:u,isLoading:d}=Op(),f=e==="agent"?Object.entries(a??{}).map(([g,v])=>({value:g,label:v.name??g})):e==="workflow"?Object.entries(o??{}).map(([g,v])=>({value:g,label:v.name??g})):e==="scorer"?Object.entries(u??{}).map(([g,v])=>({value:g,label:v.scorer?.config?.name??g})):[],p=e==="agent"&&i||e==="workflow"&&c||e==="scorer"&&d,h=g=>{t(g),r("")},m=e==="agent"?"Agent":e==="workflow"?"Workflow":"Scorer";return l.jsxs("div",{className:"grid gap-6",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(jt,{children:"Target Type"}),l.jsx(jc,{options:Its,value:e,onValueChange:h,placeholder:"Select target type",searchPlaceholder:"Search types...",emptyText:"No types available",container:s})]}),e&&l.jsxs("div",{className:"grid gap-2",children:[l.jsx(jt,{children:m}),l.jsx(jc,{options:f,value:n,onValueChange:r,placeholder:`Select ${e}`,searchPlaceholder:"Search...",emptyText:"No targets available",disabled:p,container:s})]})]})}function Pts({datasetId:e,version:t,open:n,onOpenChange:r,onSuccess:s}){const a=y.useRef(null),[i,o]=y.useState(""),[c,u]=y.useState(""),[d,f]=y.useState([]),{triggerExperiment:p}=Di(),h=i&&c,m=p.isPending,g=async()=>{if(h)try{const b=await p.mutateAsync({datasetId:e,targetType:i,targetId:c,scorerIds:d.length>0?d:void 0,version:t});jm.success("Experiment triggered successfully"),r(!1),s?.(b.experimentId),o(""),u(""),f([])}catch(b){const S=b instanceof Error?b.message:"Failed to trigger experiment";jm.error(S)}},v=()=>{m||(r(!1),o(""),u(""),f([]))};return l.jsx(Lr,{open:n,onOpenChange:v,children:l.jsxs(Ir,{ref:a,children:[l.jsxs(zr,{children:[l.jsx(Rr,{children:"Run Experiment"}),l.jsx(ha,{children:t?`Execute items from ${kn(new Date(t),"MMM d, yyyy")} version against a target.`:"Execute all items in this dataset against a target."})]}),l.jsxs(ns,{className:"grid gap-6",children:[l.jsx(Rts,{targetType:i,setTargetType:o,targetId:c,setTargetId:u,container:a}),i&&i!=="scorer"&&l.jsx(Ats,{selectedScorers:d,setSelectedScorers:f,disabled:m,container:a})]}),l.jsxs(ap,{className:"px-6 pt-4",children:[l.jsx(de,{onClick:v,disabled:m,children:"Cancel"}),l.jsx(de,{variant:"primary",onClick:g,disabled:!h||m,children:m?l.jsxs(l.Fragment,{children:[l.jsx(Qt,{className:"w-4 h-4"}),"Running..."]}):"Run"})]})]})})}const SLt=e=>{const t=Ze();return St({queryKey:["experiment-trace-light",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return t.getTraceLight(e)},enabled:!!e})},fXe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"score",label:"Score",size:"1fr"}];function Mts({result:e,scores:t,onPrevious:n,onNext:r,onClose:s,onShowTrace:a,onScoreClick:i,featuredScoreId:o}){const c=!!e?.error,u=Joe(e?.input),d=Joe(e?.output);return l.jsxs(l.Fragment,{children:[l.jsxs(An.Toolbar,{children:[l.jsx(Bj,{onPrevious:n,onNext:r,previousAriaLabel:"View previous result details",nextAriaLabel:"View next result details"}),l.jsxs(Nr,{children:[l.jsxs(de,{onClick:a,disabled:!e.traceId,children:[l.jsx(Eme,{}),"Show Trace"]}),l.jsx(de,{onClick:s,"aria-label":"Close result details panel",children:l.jsx(Pr,{})})]})]}),l.jsxs(An.Content,{children:[l.jsx(Wn,{withMargins:!1,children:l.jsxs(Wn.Column,{children:[l.jsxs(Wn.Title,{size:"smaller",children:[l.jsx(rb,{})," ",e.id]}),l.jsx(Wn.Description,{children:l.jsxs(fs,{children:[l.jsx(q0,{})," ",e.itemId]})})]})}),c&&l.jsx(Hn,{variant:"destructive",title:"Error",children:l.jsx(Hn.Message,{children:Joe(e?.error&&typeof e.error=="object"?e.error.message:e?.error)})}),t&&t.length>0&&l.jsxs(qt,{className:"grid-rows-[auto_auto] overflow-visible",children:[l.jsxs(qt.Header,{columns:fXe,children:[l.jsx(qt.HeaderCol,{children:"Scorer"}),l.jsx(qt.HeaderCol,{children:"Score"})]}),l.jsx(qt.Items,{children:t.map(f=>l.jsx(qt.Row,{children:l.jsxs(qt.RowButton,{item:{id:f.id},columns:fXe,isFeatured:o===f.id,onClick:i,children:[l.jsx(qt.TextCell,{children:f.scorerId}),l.jsx(qt.TextCell,{className:"font-mono",children:f.score.toFixed(3)})]})},f.id))})]}),(e.status||Array.isArray(e.tags)&&e.tags.length>0)&&l.jsxs("div",{className:"grid gap-2",children:[l.jsxs("h4",{className:"text-sm font-medium text-neutral5 flex items-center gap-2",children:[l.jsx(QT,{className:"w-4 h-4"})," Review Status"]}),l.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[e.status&&l.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=>l.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-surface4 text-neutral4",children:f},f))]})]}),l.jsx(nn.CodeSection,{title:"Input",icon:l.jsx(q0,{}),codeStr:u}),l.jsx(nn.CodeSection,{title:"Output",icon:l.jsx(qf,{}),codeStr:d}),l.jsxs("div",{className:"grid gap-2",children:[l.jsxs("h4",{className:"text-sm font-medium text-neutral5 flex items-center gap-2",children:[l.jsx(xC,{className:"w-4 h-4"})," Created"]}),l.jsx("p",{className:"text-sm text-neutral4",children:kn(new Date(e.createdAt),"MMM d, yyyy 'at' h:mm a")})]})]})]})}function Joe(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function $ts({span:e}){return e?l.jsxs(l.Fragment,{children:[l.jsx(nn.CodeSection,{title:"Input",icon:l.jsx(V0,{}),codeStr:JSON.stringify(e.input||null,null,2)}),l.jsx(nn.CodeSection,{title:"Output",icon:l.jsx(qf,{}),codeStr:JSON.stringify(e.output||null,null,2)}),l.jsx(nn.CodeSection,{title:"Metadata",icon:l.jsx(yh,{}),codeStr:JSON.stringify(e.metadata||null,null,2)}),l.jsx(nn.CodeSection,{title:"Attributes",icon:l.jsx(yh,{}),codeStr:JSON.stringify(e.attributes||null,null,2)})]}):null}function Dts({traceId:e,spanId:t,onNext:n,onPrevious:r,onClose:s}){const{data:a}=Ck(e,t),i=a?.span;return l.jsxs(l.Fragment,{children:[l.jsxs(An.Toolbar,{children:[l.jsx(Bj,{onPrevious:r,onNext:n,previousAriaLabel:"View previous span details",nextAriaLabel:"View next span details"}),l.jsx(de,{onClick:s,"aria-label":"Close span details",children:l.jsx(Pr,{})})]}),l.jsxs(An.Content,{children:[l.jsx(Wn,{withMargins:!1,children:l.jsx(Wn.Column,{children:l.jsxs(Wn.Title,{size:"smaller",children:[l.jsx(yh,{})," Span ",Qf(t)]})})}),l.jsx($ts,{span:i})]})]})}const Lts=e=>{if(!e||e.length===0)return[];const t=e.reduce((o,c)=>{const u=c?.endedAt?new Date(c.endedAt):void 0;return u&&(!o||u>o)?u:o},null),n=new Map,r=[];e.forEach(o=>{const c=new Date(o.startedAt),u=o.endedAt?new Date(o.endedAt):void 0,d={id:o.spanId,name:o.name,type:o.spanType,latency:u?u.getTime()-c.getTime():0,startTime:c.toISOString(),endTime:u?u.toISOString():void 0,spans:[],parentSpanId:o.parentSpanId};n.set(o.spanId,d)}),e.forEach(o=>{const c=n.get(o.spanId);if(o?.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}r.push(c)}else{const u=n.get(o.parentSpanId);u?u.spans.push(c):r.push(c)}});const s=o=>o.sort((c,u)=>new Date(c.startTime).getTime()-new Date(u.startTime).getTime()),a=s(r),i=o=>{o.forEach(c=>{c.spans&&c.spans.length>0&&(c.spans=s(c.spans),i(c.spans))})};return i(a),a};function kLt(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(n=>{t.push(n.id),t.push(...kLt(n))}),t}const pXe=["agent","workflow","model","mcp","tool","workspace","other"];function _Lt(e){const t=e?.toLowerCase().split("_")[0],n={agent:{icon:l.jsx(Go,{}),color:"oklch(0.75 0.15 250)",label:"Agent",bgColor:"bg-oklch(0.75 0.15 250 / 0.1)",typePrefix:"agent"},workflow:{icon:l.jsx(Tc,{}),color:"oklch(0.75 0.15 200)",label:"Workflow",bgColor:"bg-oklch(0.75 0.15 200 / 0.1)",typePrefix:"workflow"},model:{icon:l.jsx(Mg,{}),color:"oklch(0.75 0.15 320)",label:"Model",bgColor:"bg-oklch(0.75 0.15 320 / 0.1)",typePrefix:"model"},mcp:{icon:l.jsx(Pm,{}),color:"oklch(0.75 0.15 160)",label:"MCP",bgColor:"bg-oklch(0.75 0.15 160 / 0.1)",typePrefix:"mcp"},tool:{icon:l.jsx(Cc,{}),color:"oklch(0.75 0.15 100)",label:"Tool",bgColor:"bg-oklch(0.75 0.15 100 / 0.1)",typePrefix:"tool"},workspace:{icon:l.jsx(gq,{}),color:"oklch(0.75 0.15 40)",label:"Workspace",bgColor:"bg-oklch(0.75 0.15 40 / 0.1)",typePrefix:"workspace"}};return t in n?n[t]:{typePrefix:"other"}}function zts({isSelected:e,isFaded:t,isExpanded:n,toggleChildren:r,expandAllDescendants:s,totalDescendants:a=0,allDescendantsExpanded:i,numOfChildren:o}){return l.jsx("div",{className:X("flex items-center justify-end h-full px-3",{"opacity-30 [&:hover]:opacity-60":t,"bg-surface4":e}),children:o&&o>0?l.jsxs("div",{className:"flex gap-1",children:[l.jsxs(hXe,{onClick:()=>r?.(),children:[i?a:o," ",n?i?l.jsx(XJe,{}):l.jsx(Sw,{}):l.jsx(ys,{})]}),a>(o??0)&&!i&&l.jsxs(hXe,{onClick:()=>s?.(),children:[a," ",l.jsx(YJe,{})]})]}):null})}function hXe({onClick:e,children:t,className:n}){return l.jsx("button",{onClick:e,className:X("h-full",n),children:l.jsx("div",{className:X("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 Fts({isLastChild:e,hasChildren:t=!1,expanded:n=!1}){return l.jsx("div",{className:X("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&&l.jsx("span",{className:X("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:n?l.jsx(eet,{}):l.jsx(JJe,{})})})}function Bts({span:e,spanUI:t,isFaded:n,depth:r=0,onSpanClick:s,selectedSpanId:a,isLastChild:i,hasChildren:o,isRootSpan:c,isExpanded:u,toggleChildren:d}){return l.jsxs("div",{className:"flex overflow-x-auto",style:{paddingLeft:`${r*1.5}rem`},children:[!c&&l.jsx("button",{onClick:()=>d?.(),disabled:!o,className:X({"cursor-default":!o,"cursor-pointer":o}),children:l.jsx(Fts,{isLastChild:i,hasChildren:!!o,expanded:u})}),l.jsx("button",{className:"truncate",onClick:()=>s?.(e.id),children:e.name})]})}function OLt({span:e,depth:t=0,onSpanClick:n,selectedSpanId:r,isLastChild:s,overallLatency:a,overallStartTime:i,overallEndTime:o,fadedTypes:c,searchPhrase:u,featuredSpanIds:d,expandedSpanIds:f,setExpandedSpanIds:p}){const h=e.spans&&e.spans.length>0,m=e.spans?e.spans.length:0,g=kLt(e),v=g.length,b=t===0,S=_Lt(e?.type),w=f?f.includes(e.id):!1,_=d&&d.length>0?!d.includes(e.id):!1,E=(c&&c.length>0?c.includes(S?.typePrefix||""):!1)||_;y.useEffect(()=>{b&&p?.([e.id])},[b,e.id,p]),y.useEffect(()=>{if(!d||!e.spans||e.spans.length===0)return;const I=e.spans.some(R=>d.includes(R.id));!w&&I&&T()},[d,e.spans,e.id,w,p,f]);const T=()=>{if(!(!p||!f))if(w){const I=[e.id,...g];p(f.filter(R=>!I.includes(R)))}else p([...f,e.id])},j=()=>{!p||!f||p([...f,e.id,...g])},N=g.every(I=>f?.includes(I));return l.jsxs(l.Fragment,{children:[l.jsx(Bts,{span:e,spanUI:S,isFaded:E,depth:t,onSpanClick:n,selectedSpanId:r,isLastChild:s,hasChildren:h,isRootSpan:b,isExpanded:w,toggleChildren:T}),l.jsx(zts,{isSelected:r===e.id,isFaded:E,isExpanded:w,toggleChildren:T,expandAllDescendants:j,totalDescendants:v,allDescendantsExpanded:N,numOfChildren:m}),h&&w&&e.spans?.map((I,R,P)=>{const U=R===P.length-1;return l.jsx(OLt,{span:I,depth:t+1,onSpanClick:n,selectedSpanId:r,isLastChild:U,overallLatency:a,overallStartTime:i,fadedTypes:c,searchPhrase:u,expandedSpanIds:f,setExpandedSpanIds:p,featuredSpanIds:d},I.id)})]})}function Uts({hierarchicalSpans:e=[],onSpanClick:t,selectedSpanId:n,isLoading:r,fadedTypes:s,expandedSpanIds:a,setExpandedSpanIds:i,featuredSpanIds:o}){const c=e?.[0]?.latency||0,u=e?.[0]?.startTime||"",d=e?.[0]?.endTime||"";return l.jsx(l.Fragment,{children:r?l.jsxs("div",{className:X("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:[l.jsx(Qt,{})," Loading Trace Timeline ..."]}):l.jsx("div",{className:"grid grid-cols-[1fr_auto]",children:e?.map(f=>l.jsx(OLt,{span:f,onSpanClick:t,selectedSpanId:n,overallLatency:c,overallStartTime:u,overallEndTime:d,fadedTypes:s,featuredSpanIds:o,expandedSpanIds:a,setExpandedSpanIds:i},f.id))})})}function qts({spans:e=[],fadedTypes:t,onLegendClick:n,onLegendReset:r,onSearchPhraseChange:s,traceId:a}){const[i,o]=y.useState("");y.useEffect(()=>{o("")},[a]);const c=pXe.filter(p=>e.some(h=>h?.spanType?.startsWith(p)))||[],u=e.some(p=>!pXe.some(m=>p?.spanType?.startsWith(m))),d=p=>{n?.(p)};y.useEffect(()=>{f(i)},[i,s]);const f=cpt(p=>{s?.(p)},1e3);return l.jsxs("div",{className:"flex gap-3 items-center justify-between",children:[l.jsx("div",{className:"flex",children:l.jsx(rw,{name:"search-spans",label:"Find span by name",labelIsHidden:!0,placeholder:"Look for span name",value:i,onChange:p=>{o(p.target.value)},onReset:()=>o("")})}),l.jsxs(Nr,{spacing:"close",children:[c.map(p=>{const h=_Lt(p),m=t?.includes(p);return l.jsx(y.Fragment,{children:l.jsxs(de,{onClick:()=>d(p),className:m?"opacity-40":"",style:{color:m?void 0:h?.color,backgroundColor:h?.bgColor},children:[h?.icon&&l.jsx(Be,{children:h.icon}),h?.label]})},p)}),u&&l.jsxs(de,{onClick:()=>d("other"),className:t?.includes("other")?"opacity-40":"",children:[l.jsx(Be,{children:l.jsx(O7,{})}),"Other"]}),l.jsx(de,{onClick:r,disabled:t?.length===0,children:l.jsx(Be,{children:l.jsx(Pr,{})})})]})]})}function Vts({traceId:e,selectedSpanId:t,onSpanSelect:n,onClose:r}){const{data:s,isLoading:a}=SLt(e),i=s?.spans??[],[o,c]=y.useState(""),[u,d]=y.useState([]),[f,p]=y.useState([]),[h,m]=y.useState([]),g=y.useMemo(()=>Lts(i),[i]);y.useEffect(()=>{if(o.trim()===""){p([]);return}const w=o.toLowerCase(),_=i.filter(O=>O.name.toLowerCase().includes(w)).map(O=>O.spanId);p(_)},[o,i]),y.useEffect(()=>{c(""),d([]),p([]),m([])},[e]);const v=w=>{n?.(t===w?void 0:w)},b=w=>{d(_=>_.includes(w)?_.filter(O=>O!==w):[..._,w])},S=()=>{d([])};return l.jsxs(l.Fragment,{children:[l.jsx(An.Toolbar,{children:l.jsx(de,{onClick:r,"aria-label":"Close trace panel",children:l.jsx(Pr,{})})}),l.jsxs(An.Content,{children:[l.jsx(Wn,{withMargins:!1,children:l.jsx(Wn.Column,{children:l.jsxs(Wn.Title,{size:"smaller",children:[l.jsx(kc,{})," Trace ",Qf(e)]})})}),l.jsx(qts,{spans:i,fadedTypes:u,onLegendClick:b,onLegendReset:S,searchPhrase:o,onSearchPhraseChange:c,traceId:e}),l.jsx(Uts,{hierarchicalSpans:g,onSpanClick:v,selectedSpanId:t,isLoading:a,fadedTypes:u,expandedSpanIds:h,setExpandedSpanIds:m,featuredSpanIds:f})]})]})}function Hts({results:e,isLoading:t,featuredResultId:n,onResultClick:r,columns:s,scoresByItemId:a,scorerIds:i,setEndOfListElement:o,isFetchingNextPage:c,hasNextPage:u}){const d=s.map(f=>f.size).join(" ");return t?l.jsxs(we,{columns:d,children:[l.jsx(we.Top,{children:s.map(f=>l.jsx(we.TopCell,{children:f.label},f.name))}),l.jsx("div",{className:"flex items-center justify-center py-20 col-span-full",children:l.jsx(Qt,{})})]}):e.length===0?l.jsxs(we,{columns:d,children:[l.jsx(we.Top,{children:s.map(f=>l.jsx(we.TopCell,{children:f.label},f.name))}),l.jsx(we.NoMatch,{message:"No results yet"})]}):l.jsxs(we,{columns:d,children:[l.jsx(we.Top,{children:s.map(f=>l.jsx(we.TopCell,{children:f.label},f.name))}),l.jsxs(we.Rows,{children:[e.map(f=>{const p=!!f.error,h=f.id===n;return l.jsxs(we.Row,{onClick:()=>r(f.id),selected:h,children:[l.jsx(we.TextCell,{children:l.jsx("span",{className:"truncate block font-mono",children:f.itemId})}),l.jsx(we.Cell,{children:l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx("div",{className:"flex items-center justify-center w-10 relative bg-transparent h-full",children:l.jsx("div",{className:X("w-2 h-2 rounded-full",p?"bg-red-700":"bg-green-600")})})}),l.jsx(Yn,{children:p?"Error":"Success"})]})}),s.some(m=>m.name==="input")&&l.jsx(we.TextCell,{children:l.jsx("span",{className:"truncate block font-mono",children:Wts(Zts(f.input),200)})}),i?.map(m=>{const v=a?.[f.itemId]?.find(b=>b.scorerId===m);return l.jsx(we.TextCell,{children:l.jsx("span",{className:"font-mono",children:v!=null?v.score.toFixed(3):"-"})},m)})]},f.id)}),l.jsxs("div",{ref:o,className:"h-1 col-span-full",children:[c&&l.jsx("div",{className:"flex justify-center py-4",children:l.jsx(Qt,{})}),!u&&e.length>0&&l.jsx(ge,{variant:"ui-xs",className:"text-icon3 text-center py-4 block",children:"All results loaded"})]})]})]})}function Zts(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function Wts(e,t){return e.length<=t?e:e.slice(0,t-1)+"..."}function Gts(e){const t=e.scorer;return t?.hasJudge===!1?!0:t?.hasJudge===!0?!1:!e.preprocessPrompt&&!e.analyzePrompt&&!e.generateScorePrompt&&!e.generateReasonPrompt}function Qts({score:e,onNext:t,onPrevious:n,onClose:r}){const s=Gts(e),a=s?"N/A — code-based scorer":"N/A — step not configured";return l.jsxs(l.Fragment,{children:[l.jsxs(An.Toolbar,{children:[l.jsx(Bj,{onPrevious:n,onNext:t,previousAriaLabel:"View previous score details",nextAriaLabel:"View next score details"}),l.jsx(de,{onClick:r,"aria-label":"Close score details",children:l.jsx(Pr,{})})]}),l.jsxs(An.Content,{children:[l.jsx(Wn,{withMargins:!1,children:l.jsx(Wn.Column,{children:l.jsxs(Wn.Title,{size:"smaller",children:[l.jsx(cu,{})," ",e.scorerId]})})}),l.jsxs(sw,{children:[l.jsx(nn.CodeSection,{title:`Score: ${e.score}`,icon:l.jsx(cu,{}),codeStr:e.reason||a,simplified:!0}),l.jsx(nn.CodeSection,{title:"Input",icon:l.jsx(q0,{}),codeStr:JSON.stringify(e.input??null,null,2)}),l.jsx(nn.CodeSection,{title:"Output",icon:l.jsx(qf,{}),codeStr:JSON.stringify(e.output??null,null,2)}),!s&&l.jsxs(l.Fragment,{children:[l.jsx(nn.CodeSection,{title:"Preprocess Prompt",icon:l.jsx(Zc,{}),codeStr:e.preprocessPrompt||a,simplified:!0}),l.jsx(nn.CodeSection,{title:"Analyze Prompt",icon:l.jsx(Zc,{}),codeStr:e.analyzePrompt||a,simplified:!0}),l.jsx(nn.CodeSection,{title:"Generate Score Prompt",icon:l.jsx(Zc,{}),codeStr:e.generateScorePrompt||a,simplified:!0}),l.jsx(nn.CodeSection,{title:"Generate Reason Prompt",icon:l.jsx(Zc,{}),codeStr:e.generateReasonPrompt||a,simplified:!0})]})]})]})]})}const mXe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"avg",label:"Avg Score",size:"1fr"},{name:"count",label:"Items Scored",size:"1fr"}];function Yts({scoresByItemId:e,experimentStatus:t}){const n=y.useMemo(()=>{if(!e)return[];const r={};for(const s of Object.values(e))for(const a of s)r[a.scorerId]||(r[a.scorerId]={sum:0,count:0}),r[a.scorerId].sum+=a.score,r[a.scorerId].count++;return Object.entries(r).map(([s,{sum:a,count:i}])=>({scorerId:s,avg:a/i,count:i})).sort((s,a)=>s.scorerId.localeCompare(a.scorerId))},[e]);if(n.length===0){const r=t==="running"||t==="pending",s=e!==void 0;let a,i;return r?(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…"),l.jsx("div",{className:"flex h-full items-center justify-center py-12",children:l.jsx(oi,{iconSlot:l.jsx(cu,{className:"w-8 h-8 text-neutral3"}),titleSlot:a,descriptionSlot:i})})}return l.jsxs(qt,{children:[l.jsxs(qt.Header,{columns:mXe,children:[l.jsx(qt.HeaderCol,{children:"Scorer"}),l.jsx(qt.HeaderCol,{children:"Avg Score"}),l.jsx(qt.HeaderCol,{children:"Items Scored"})]}),l.jsx(qt.Scroller,{children:l.jsx(qt.Items,{children:n.map(({scorerId:r,avg:s,count:a})=>l.jsxs(qt.Row,{columns:mXe,children:[l.jsx(qt.TextCell,{children:r}),l.jsx(qt.TextCell,{className:"font-mono",children:s.toFixed(3)}),l.jsx(qt.TextCell,{className:"font-mono",children:a})]},r))})})]})}function ELt({experimentId:e,experimentStatus:t,results:n,isLoading:r,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i}){const[o,c]=y.useState(null),[u,d]=y.useState(null),[f,p]=y.useState(void 0),[h,m]=y.useState(null),g=n.find(z=>z.id===o)??null,{data:v}=tLt(e,t),b=y.useMemo(()=>{if(!v)return[];const z=new Set;for(const q of Object.values(v))for(const H of q)z.add(H.scorerId);return[...z].sort()},[v]),{data:S}=SLt(u),w=S?.spans??[],_=()=>{if(!f)return;const z=w.findIndex(q=>q.spanId===f);if(z>=0&&z<w.length-1)return()=>p(w[z+1].spanId)},O=()=>{if(!f)return;const z=w.findIndex(q=>q.spanId===f);if(z>0)return()=>p(w[z-1].spanId)},E=z=>{c(z),d(null),p(void 0),m(null)},T=z=>{E(z===o?null:z)},j=()=>{E(null)},N=()=>{if(!g)return;const z=n.findIndex(q=>q.id===g.id);if(z>=0&&z<n.length-1)return()=>E(n[z+1].id)},I=()=>{if(!g)return;const z=n.findIndex(q=>q.id===g.id);if(z>0)return()=>E(n[z-1].id)},R=g?v?.[g.itemId]:void 0,P=R?.find(z=>z.id===h)??null,U=z=>{m(z===h?null:z),d(null),p(void 0)},M=()=>{if(!h||!R)return;const z=R.findIndex(q=>q.id===h);if(z>=0&&z<R.length-1)return()=>m(R[z+1].id)},L=()=>{if(!h||!R)return;const z=R.findIndex(q=>q.id===h);if(z>0)return()=>m(R[z-1].id)},F=y.useMemo(()=>[{name:"itemId",label:"Item ID",size:"5rem"},{name:"status",label:"Status",size:"3rem"},{name:"input",label:"Input",size:"1fr"},...o?[]:b.map(z=>({name:z,label:z,size:"1fr"}))],[o,b]);return l.jsxs(ku,{defaultTab:"summary",className:"grid grid-rows-[auto_1fr] h-full overflow-hidden",children:[l.jsxs(_u,{children:[l.jsx(Hr,{value:"summary",children:"Summary"}),l.jsx(Hr,{value:"results",children:"Results"})]}),l.jsx(_s,{value:"summary",className:"overflow-y-auto mt-5",children:l.jsx(Yts,{scoresByItemId:v,experimentStatus:t})}),l.jsx(_s,{value:"results",className:"grid overflow-hidden mt-5",children:l.jsxs(Yf,{className:g?"grid-cols-[1fr_2fr]":void 0,children:[l.jsx(An,{children:l.jsx(Hts,{results:n,isLoading:r,featuredResultId:o,onResultClick:T,columns:F,scoresByItemId:v,scorerIds:o?void 0:b,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i})}),g&&l.jsxs(ver,{numOfColumns:1+(!u&&h?1:0)+(u?1:0)+(f?1:0),minColumnWidth:"35rem",children:[g&&l.jsx(An,{withLeftSeparator:!0,children:l.jsx(Mts,{result:g,scores:R,onPrevious:I(),onNext:N(),onClose:j,onScoreClick:U,featuredScoreId:h,onShowTrace:()=>{d(g.traceId??null),p(void 0),m(null)}})}),g&&!u&&P&&l.jsx(An,{withLeftSeparator:!0,children:l.jsx(Qts,{score:P,onNext:M(),onPrevious:L(),onClose:()=>m(null)})}),g&&u&&l.jsx(An,{withLeftSeparator:!0,children:l.jsx(Vts,{traceId:u,selectedSpanId:f,onSpanSelect:p,onClose:()=>{d(null),p(void 0)}})}),g&&u&&f&&l.jsx(An,{withLeftSeparator:!0,children:l.jsx(Dts,{traceId:u,spanId:f,onNext:_(),onPrevious:O(),onClose:()=>p(void 0)})})]})]})})]})}const Xts={pending:l.jsx(Qk,{}),running:l.jsx(xz,{}),completed:l.jsx(Ka,{}),failed:l.jsx(Pr,{})};function Kts({experiment:e,className:t}){const n=e.status,r=e.totalItems-e.succeededCount-e.failedCount;return l.jsxs("div",{className:X("grid justify-items-end gap-3",t),children:[l.jsxs("div",{className:"flex p-1 px-3 text-ui-lg capitalize text-neutral4 gap-2 items-center bg-surface5 rounded-lg ",children:[l.jsx("span",{className:X("w-5 h-5 flex items-center justify-center rounded-full text-black","[&>svg]:w-4 [&>svg]:h-4",{"bg-green-700":n==="completed","bg-red-700":n==="failed","bg-cyan-600":n==="running","bg-yellow-600":n==="pending"}),children:Xts[n]}),e.status]}),l.jsxs("div",{className:X("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:[l.jsxs("span",{children:["Total: ",l.jsx("b",{children:e.totalItems})]}),l.jsxs("span",{children:["Succeeded: ",l.jsx("b",{children:e.succeededCount})]}),l.jsxs("span",{children:["Failed: ",l.jsx("b",{children:e.failedCount})]}),(n==="pending"||n==="running")&&l.jsxs("span",{children:["Pending: ",l.jsx("b",{children:r})]})]})]})}function CLt({experimentId:e,experiment:t}){const{Link:n,paths:r}=an(),{data:s}=Lv(),{data:a}=Bw(),{data:i}=Op(),o=()=>{switch(t.targetType){case"agent":return r.agentLink(t.targetId);case"workflow":return r.workflowLink(t.targetId);case"scorer":return r.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 l.jsxs(Wn,{children:[l.jsxs(Wn.Column,{children:[l.jsxs(Wn.Title,{children:[l.jsx(tet,{}),e," ",e&&l.jsx(la,{content:e})]}),l.jsxs(Wn.Description,{children:[l.jsxs(fs,{children:[l.jsx(xC,{})," Created at ",kn(new Date(t.createdAt),"MMM d, yyyy 'at' h:mm a")]}),t.completedAt&&l.jsxs(fs,{children:[l.jsx(xC,{})," Completed at ",kn(new Date(t.completedAt),"MMM d, yyyy 'at' h:mm a")]})]}),l.jsxs(Wn.Description,{children:[l.jsxs(fs,{children:[l.jsx(zWt,{})," Target",l.jsx(n,{href:o(),children:c()})]}),t.agentVersion&&l.jsxs(fs,{children:[l.jsx(C7,{})," Version",t.targetType==="agent"&&t.targetId?l.jsx(n,{href:`${r.agentLink(t.targetId)}/editor?version=${encodeURIComponent(t.agentVersion)}`,className:"font-mono text-xs underline hover:text-accent1",children:t.agentVersion}):l.jsx("span",{className:"font-mono text-xs",children:t.agentVersion}),l.jsx(la,{content:t.agentVersion})]})]})]}),l.jsx(Wn.Column,{children:l.jsx(Kts,{experiment:t})})]})}function ROe({delta:e}){const t=e>0?l.jsx(ai,{size:"small",color:"green",intensity:"muted",children:l.jsx(zle,{})}):e<0?l.jsx(ai,{size:"small",color:"red",intensity:"muted",children:l.jsx(gZt,{})}):null;return l.jsxs("span",{className:X("font-mono text-sm text-neutral4 min-w-20"),children:[l.jsx("span",{className:"w-3 inline-block",children:e>0?"+ ":e<0?"- ":""}),Math.abs(e).toFixed(2)," ",t]})}function z5(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function Jts({item:e,baselineId:t,contenderId:n,baselineVersion:r,contenderVersion:s,onPrevious:a,onNext:i,onClose:o}){const c=e.results[t],u=e.results[n],d=!!(c&&u),f=new Set;if(c)for(const h of Object.keys(c.scores))f.add(h);if(u)for(const h of Object.keys(u.scores))f.add(h);const p=[...f].sort();return l.jsxs(An,{withLeftSeparator:!0,children:[l.jsxs(An.Toolbar,{children:[l.jsx(Bj,{onPrevious:a,onNext:i,previousAriaLabel:"Previous comparison item",nextAriaLabel:"Next comparison item"}),l.jsx(Nr,{children:l.jsx(de,{onClick:o,"aria-label":"Close comparison detail panel",children:l.jsx(Pr,{})})})]}),l.jsxs(An.Content,{className:"pb-6",children:[l.jsx(Wn,{withMargins:!1,children:l.jsx(Wn.Column,{children:l.jsxs(Wn.Title,{size:"smaller",children:[l.jsx(q0,{})," ",e.itemId]})})}),d?l.jsx(l.Fragment,{children:l.jsxs(sw,{children:[p.length>0&&l.jsxs("div",{className:"grid gap-3",children:[l.jsx("h4",{className:"text-sm font-medium text-neutral5",children:"Scores"}),l.jsx("div",{className:"grid gap-2",children:p.map(h=>{const m=c?.scores[h]??null,g=u?.scores[h]??null,v=m!=null&&g!=null?g-m:null;return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2 rounded-lg bg-surface2",children:[l.jsx("span",{className:"text-sm text-neutral5 font-medium",children:h}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("span",{className:"text-sm text-neutral3",children:[m!=null?m.toFixed(3):"-"," →"," ",g!=null?g.toFixed(3):"-"]}),v!=null&&l.jsx(ROe,{delta:v})]})]},h)})})]}),l.jsx(nn.CodeSection,{title:l.jsxs(l.Fragment,{children:[l.jsx(ai,{color:"purple",children:"Baseline "})," Experiment Output"]}),icon:l.jsx(qf,{}),codeStr:z5(c?.output)}),l.jsx(nn.CodeSection,{title:l.jsxs(l.Fragment,{children:[l.jsx(ai,{color:"cyan",children:"Contender "})," Experiment Output"]}),icon:l.jsx(qf,{}),codeStr:z5(u?.output)}),l.jsx(nn.CodeSection,{title:"Item Input",icon:l.jsx(V0,{}),codeStr:z5(e.input)}),l.jsx(nn.CodeSection,{title:"Item Ground Truth",icon:l.jsx(bet,{}),codeStr:z5(e.groundTruth)})]})}):l.jsx(Hn,{variant:"warning",title:"Comparison not available",children:l.jsx(Hn.Message,{children:(()=>{const h=c?"Contender":"Baseline",m=c?s:r;return l.jsxs(l.Fragment,{children:["The ",h," experiment was run against dataset",m!=null?` v. ${m}`:"",", which does not contain this item."]})})()})})]})]})}function ens({items:e,baselineId:t,contenderId:n,scorerIds:r,featuredItemId:s,columns:a,onItemClick:i}){return l.jsx(An,{children:l.jsxs(qt,{children:[l.jsxs(qt.Header,{columns:a,children:[l.jsx(qt.HeaderCol,{children:"Item ID"}),!s&&r.map(o=>l.jsx(qt.HeaderCol,{className:"flex justify-center",children:o},o))]}),l.jsx(qt.Scroller,{children:l.jsx(qt.Items,{children:e.map(o=>{const c=o.results[t],u=o.results[n],d=!!(c&&u);return l.jsx(qt.Row,{children:l.jsxs(qt.RowButton,{item:{id:o.itemId},columns:a,isFeatured:s===o.itemId,onClick:i,children:[l.jsx(qt.IdCell,{id:o.itemId,className:d?"":"text-neutral1"}),!s&&l.jsx(l.Fragment,{children:r.map(f=>{const p=c?.scores[f]??null,h=u?.scores[f]??null,m=p!=null&&h!=null?h-p:null;return l.jsx(qt.Cell,{className:"flex items-center gap-5 justify-center font-mono",children:m!=null?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"flex items-center text-neutral2 min-w-24",children:[p?.toFixed(2)," → ",h?.toFixed(2)]}),l.jsx(ROe,{delta:m})]}):l.jsx("span",{className:"text-neutral1",children:"-"})},f)})})]})},o.itemId)})})})]})})}const tns={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 gXe({datasetId:e,experiment:t,type:n}){const{Link:r}=an(),{label:s,color:a,customStyle:i}=tns[n];if(!t)return null;const o=t.createdAt?new Date(t.createdAt):null;return l.jsxs("div",{className:`grid border-2 border-border1 rounded-lg p-5 gap-3 ${i}`,children:[l.jsxs("div",{className:"flex items-center gap-3 w-full overflow-clip",children:[n==="contender"&&l.jsxs(ai,{size:"small",color:a,children:[s,l.jsx(kS,{})]}),l.jsx(de,{as:r,href:`/datasets/${e}/experiments/${t.id}`,children:l.jsx("span",{className:"truncate min-w-0",children:t.id})}),n==="baseline"&&l.jsxs(ai,{size:"small",color:a,children:[l.jsx(Eb,{})," ",s]})]}),l.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-ui-sm text-neutral3",children:[l.jsxs(fs,{children:[l.jsx(bet,{})," ",t.targetType," / ",t.targetId]}),l.jsxs(fs,{children:[l.jsx(uet,{})," v",t.datasetVersion??"—"]}),o&&l.jsxs(fs,{children:[l.jsx(QJe,{})," ",kn(o,"MMM d, yyyy HH:mm")]})]})]})}function nns({datasetId:e,experimentIdA:t,experimentIdB:n,onSwap:r}){const[s,a]=y.useState(null),{data:i,isLoading:o,error:c}=yes(e,t,n),{data:u}=d7(e,t),{data:d}=d7(e,n),f=u&&d&&u.datasetVersion!==d.datasetVersion,p=y.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]),h=y.useMemo(()=>{if(!i||p.length===0)return[];const T=i.baselineId,j=t===T?n:t;return p.map(N=>{let I=0,R=0,P=0,U=0;for(const z of i.items){const q=z.results[T]?.scores[N],H=z.results[j]?.scores[N];q!=null&&(I+=q,P++),H!=null&&(R+=H,U++)}const M=P>0?I/P:null,L=U>0?R/U:null,F=M!=null&&L!=null?L-M:null;return{scorerId:N,avgA:M,avgB:L,delta:F}})},[i,p,t,n]),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=y.useMemo(()=>[{name:"itemId",label:"Item ID",size:"8rem"},...s?[]:p.map(T=>({name:T,label:T,size:"1fr"}))],[p,s]),v=i?.items.find(T=>T.itemId===s)??null,b=T=>{a(T===s?null:T)},S=()=>{a(null)},w=()=>{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)},_=()=>{if(!i||!s)return;const T=i.items.findIndex(j=>j.itemId===s);if(T>0)return()=>a(i.items[T-1].itemId)};if(o)return l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx(Qt,{})});if(c)return l.jsx(Hn,{variant:"warning",title:"Error loading comparison",children:l.jsx(Hn.Message,{children:c instanceof Error?c.message:"Unknown error"})});if(!i||i.items.length===0)return l.jsx("div",{className:"text-neutral4 text-sm text-center py-8",children:"No comparison data"});const O=i.baselineId,E=t===O?n:t;return l.jsxs("div",{className:"grid gap-10",children:[u&&d&&l.jsxs("div",{className:X("relative grid xl:grid-cols-[1fr_auto_1fr] gap-4 xl:gap-0"),children:[l.jsx(gXe,{datasetId:e,experiment:u,type:"baseline"}),l.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:l.jsx("div",{className:"relative z-1 bg-surface2 rounded-lg p-2",children:l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx(de,{onClick:r,children:"VS"})}),l.jsx(Yn,{children:"Switch the order"})]})})}),l.jsx(gXe,{datasetId:e,experiment:d,type:"contender"})]}),f&&l.jsx(Hn,{variant:"warning",title:"Version mismatch",children:l.jsxs(Hn.Message,{children:["These experiments used different dataset versions (v",u.datasetVersion," vs v",d.datasetVersion,"). Results may not be directly comparable."]})}),h.length>0&&l.jsxs(qt,{children:[l.jsxs(qt.Header,{columns:m,children:[l.jsx(qt.HeaderCol,{children:"Scorer"}),l.jsx(qt.HeaderCol,{className:"flex justify-center",children:l.jsxs(F5e,{children:[l.jsx(ai,{color:"purple",size:"small",intensity:"muted",children:"Baseline"}),l.jsx(ai,{color:"purple",size:"small",children:"Avg"})]})}),l.jsx(qt.HeaderCol,{className:"flex justify-center",children:l.jsxs(F5e,{children:[l.jsx(ai,{color:"cyan",size:"small",intensity:"muted",children:"Contender"}),l.jsx(ai,{color:"cyan",size:"small",children:"Avg"})]})}),l.jsx(qt.HeaderCol,{className:"flex justify-center",children:"Delta"})]}),l.jsx(qt.Scroller,{children:l.jsx(qt.Items,{children:h.map(({scorerId:T,avgA:j,avgB:N,delta:I})=>l.jsxs(qt.Row,{columns:m,children:[l.jsx(qt.TextCell,{children:T}),l.jsx(qt.TextCell,{className:"text-center font-mono",children:j!=null?j.toFixed(3):"-"}),l.jsx(qt.TextCell,{className:"text-center font-mono",children:N!=null?N.toFixed(3):"-"}),l.jsx(qt.TextCell,{className:"flex justify-center",children:I!=null?l.jsx(ROe,{delta:I}):"-"})]},T))})})]}),l.jsxs(Yf,{className:X({"grid-cols-[1fr_2fr]":!!v}),children:[l.jsx(ens,{items:i.items,baselineId:O,contenderId:E,scorerIds:p,featuredItemId:s,columns:g,onItemClick:b}),!!v&&l.jsx(Jts,{item:v,baselineId:O,contenderId:E,baselineVersion:u?.datasetVersion,contenderVersion:d?.datasetVersion,onPrevious:_(),onNext:w(),onClose:S})]})]})}function rns({datasetId:e,itemId:t,onVersionSelect:n,onCompareVersionsClick:r,activeVersion:s}){const{data:a,isLoading:i}=IOe(e,t),[o,c]=y.useState(!1),[u,d]=y.useState(new Set),f=b=>{n?.(b)},p=b=>s==null?b.isLatest:b.datasetVersion===s,h=b=>{d(S=>{const w=new Set(S);if(w.has(b))w.delete(b);else if(w.size>=2){const[_]=Array.from(w);return new Set([_,b])}else w.add(b);return w})},m=()=>{c(!1),d(new Set)},g=()=>{c(!0)},v=()=>{u.size===2&&r?.([...u])};return l.jsxs(An,{className:"min-w-56",children:[o?l.jsx(An.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:l.jsxs(Nr,{children:[l.jsx(de,{onClick:m,children:"Cancel"}),l.jsx(de,{variant:"primary",disabled:u.size!==2,onClick:v,tooltip:u.size!==2?"Check 2 versions to compare":void 0,className:"grow",children:"Compare"})]})}):l.jsx(l.Fragment,{children:(a||[]).length>1&&l.jsx(An.Toolbar,{children:l.jsxs(de,{onClick:g,className:"w-full",children:[l.jsx(H0,{})," Compare Ver."]})})}),i?l.jsx(sns,{}):l.jsxs(qt,{children:[l.jsx(qt.Header,{children:l.jsx(qt.HeaderCol,{children:"Item Version History"})}),l.jsx(qt.Scroller,{children:l.jsx(qt.Items,{children:a?.map(b=>{const S=String(b.datasetVersion),w=typeof b.updatedAt=="string"?new Date(b.updatedAt):b.updatedAt;return l.jsxs(qt.Row,{isSelected:o&&u.has(S),children:[o&&l.jsx(qt.LabelCell,{children:l.jsx(oo,{checked:u.has(S),disabled:b.isDeleted,onCheckedChange:()=>{},onClick:_=>{_.stopPropagation(),b.isDeleted||h(S)},"aria-label":`Select version ${b.datasetVersion}`})}),l.jsx(qt.RowButton,{item:b,columns:[{name:"version",label:"Item Version History",size:"1fr"}],isFeatured:p(b),onClick:()=>f(b),className:"py-2",children:l.jsx(qt.VersionCell,{version:b.datasetVersion,date:w,isLatest:b.isLatest,isDeleted:b.isDeleted})})]},String(b.datasetVersion))})})})]})]})}function sns(){return l.jsxs(qt,{children:[l.jsx(qt.Header,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:l.jsx(qt.HeaderCol,{children:"Item Version History"})}),l.jsx(qt.Items,{children:Array.from({length:3}).map((e,t)=>l.jsx(qt.Row,{children:l.jsx(qt.RowButton,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:l.jsx(qt.TextCell,{isLoading:!0,children:"Loading..."})})},t))})]})}function ans(e,t){if(t){const n=typeof t=="string"?new Date(t):t;return`v${e} ${kn(n,"MMM dd 'at' H:mm:ss a")}`}return`v${e}`}function ins({datasetId:e,versionA:t,versionB:n,onVersionChange:r}){const{data:s}=NOe(e),a=(s??[]).map(i=>({value:String(i.version),label:`${ans(i.version,i.createdAt)}${i.isCurrent?" (current)":""}`}));return l.jsxs(An.Toolbar,{className:"grid grid-cols-[1fr_1fr_1fr_10rem] gap-4 w-full",children:[l.jsx("div",{}),l.jsx(Yl,{label:"Version A",labelIsHidden:!0,name:"version-a",placeholder:"Select version",options:a,value:t??"",onValueChange:i=>r?.(i,n??"")}),l.jsx(Yl,{label:"Version B",labelIsHidden:!0,name:"version-b",options:a,value:n??"",onValueChange:i=>r?.(t??"",i)}),l.jsx("div",{})]})}const ons=[{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"}],lns={added:{color:"blue",borderColor:"border-blue-900",icon:l.jsx(Cs,{}),tooltip:"Added in this version"},changed:{color:"orange",borderColor:"border-yellow-900",icon:l.jsx(vet,{}),tooltip:"Changed in this version"},same:{color:"green",borderColor:"border-green-900",icon:l.jsx(YWt,{}),tooltip:"Same in both versions"}};function ele({red:e=!1,tooltip:t}){return l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx(EZt,{className:X("text-neutral3/40 w-5 h-5 ",{"text-red-900":e})})}),t&&l.jsx(Yn,{children:t})]})}function M1({variant:e,version:t}){if(!e)return l.jsxs("span",{className:"text-ui-md text-neutral4",children:["v. ",t]});const{color:n,icon:r,tooltip:s}=lns[e];return l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsxs("div",{className:"grid grid-cols-[1fr_auto]",children:[t!==void 0&&l.jsxs("span",{className:"pr-3 text-ui-md text-neutral4 min-w-16 flex justify-end",children:["v. ",t]}),l.jsx(ai,{color:n,size:"small",children:r})]})}),l.jsx(Yn,{children:s})]})}function cns(e,t){return e&&t&&e.datasetVersion===t.datasetVersion?"same":e&&t&&e.datasetVersion!==t.datasetVersion?"changed":e?"added":"removed"}function uns({datasetId:e,versionA:t,versionB:n,allItems:r,itemsAMap:s,itemsBMap:a}){const{Link:i}=an(),o=t>n;return l.jsx(qt,{children:l.jsx(qt.Scroller,{children:l.jsx(qt.Items,{children:r.map(({id:c})=>{const u=s.get(c),d=a.get(c),f=cns(u,d);return l.jsxs(qt.Row,{columns:ons,children:[l.jsx(qt.IdCell,{id:c,isShortened:!1}),f!=="same"?l.jsxs(l.Fragment,{children:[u?.datasetVersion?l.jsx(qt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!d&&o?l.jsx(M1,{variant:"added",version:u.datasetVersion}):f==="changed"&&o?l.jsx(M1,{variant:"changed",version:u.datasetVersion}):l.jsx(M1,{version:u.datasetVersion})}):l.jsx(qt.Cell,{className:"justify-center flex items-center",children:l.jsx(ele,{red:o,tooltip:o?"Deleted in this version":"Not present in this version"})}),d?.datasetVersion?l.jsx(qt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!u&&!o?l.jsx(M1,{variant:"added",version:d.datasetVersion}):f==="changed"&&!o?l.jsx(M1,{variant:"changed",version:d.datasetVersion}):l.jsx(M1,{version:d.datasetVersion})}):l.jsx(qt.Cell,{className:"justify-center flex items-center",children:l.jsx(ele,{red:!o,tooltip:o?"Not present in this version":"Deleted in this version"})})]}):l.jsx(qt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"col-span-2 gap-2",children:l.jsx(M1,{variant:"same",version:d?.datasetVersion})}),f==="changed"?l.jsx(qt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}/versions?ids=${u?.datasetVersion},${d?.datasetVersion}`,children:"Compare"}):l.jsx(qt.Cell,{children:l.jsx(ele,{tooltip:l.jsxs(l.Fragment,{children:["Comparing is available",l.jsx("br",{})," only for changed items"]})})})]},c)})})})})}const vXe={needsReview:"#facc15",complete:"#22c55e"},dns=[{label:"Needs Review",color:vXe.needsReview},{label:"Reviewed",color:vXe.complete}];function fns({reviewSummary:e,experiments:t,datasets:n,isLoading:r,isError:s}){const{data:a,maxVal:i,totalInPipeline:o}=y.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(n)for(const m of n)d.set(m.id,m.name);let f=0,p=0;const h=[];for(const m of e.counts){const g=m.needsReview+m.complete;if(g===0)continue;p+=g,g>f&&(f=g);const v=u.get(m.experimentId),b=v?.datasetId?d.get(v.datasetId):void 0,S=b?`${b} · ${m.experimentId.slice(0,8)}`:m.experimentId.slice(0,8);h.push({name:S,values:[m.needsReview,m.complete]})}return{data:h,maxVal:f,totalInPipeline:p}},[e,t,n]),c=a.length>0;return l.jsxs(Vt,{children:[l.jsxs(Vt.TopBar,{children:[l.jsx(Vt.TitleAndDescription,{title:"Review Pipeline",description:"Items in review across experiments."}),c&&l.jsx(Vt.Summary,{value:String(o),label:"Items in pipeline"})]}),r?l.jsx(Vt.Loading,{}):s?l.jsx(Vt.Error,{message:"Failed to load review data"}):l.jsx(Vt.Content,{children:c?l.jsx(iT,{data:a,segments:dns,maxVal:i,fmt:u=>String(u)}):l.jsx(Vt.NoData,{message:"No items have been sent to review yet"})})]})}function POe(){const e=Ze();return St({queryKey:["experiment-review-summary"],queryFn:()=>e.getExperimentReviewSummary()})}function TLt(e){const t=new Map;if(!e?.counts)return t;for(const n of e.counts)t.set(n.experimentId,{needsReview:n.needsReview,complete:n.complete,total:n.total});return t}function pns(e,t){const n=new Map,r=TLt(e);if(!r.size||!t)return n;for(const s of t){const a=r.get(s.id);if(!a||!s.datasetId||a.needsReview+a.complete===0)continue;const o=n.get(s.datasetId)??{needsReview:0,complete:0};o.needsReview+=a.needsReview,o.complete+=a.complete,n.set(s.datasetId,o)}return n}function hns(e){return e?.counts?e.counts.reduce((t,n)=>({needsReview:t.needsReview+n.needsReview,complete:t.complete+n.complete,inPipeline:t.inPipeline+n.needsReview+n.complete}),{needsReview:0,complete:0,inPipeline:0}):{needsReview:0,complete:0,inPipeline:0}}const mns=10;function gns(){const[e,t]=y.useState(!1),[n,r]=y.useState(""),[s,a]=y.useState("all"),[i,o]=y.useState("all"),[c,u]=y.useState("all"),[d,f]=y.useState(0),{data:p,isLoading:h,error:m}=Rv({page:d,perPage:mns}),{data:g,isLoading:v,error:b}=AH(),{data:S}=POe(),w=y.useMemo(()=>p?.datasets??[],[p?.datasets]),_=p?.pagination?.hasMore??!1,O=y.useMemo(()=>g?.experiments??[],[g?.experiments]),E=y.useMemo(()=>$es(w),[w]),T=y.useMemo(()=>pns(S,O),[S,O]),j=h||v,N=m||b,I=()=>t(!0),R=y.useCallback(()=>f(H=>H+1),[]),P=y.useCallback(()=>f(H=>Math.max(0,H-1)),[]),U=y.useCallback(H=>{r(H),f(0)},[]),M=y.useCallback(H=>{a(H),f(0)},[]),L=y.useCallback(H=>{o(H),f(0)},[]),F=y.useCallback(H=>{u(H),f(0)},[]);if(N&&zs(N))return l.jsx(ir,{children:l.jsx(ua,{})});if(N&&Bs(N))return l.jsx(ir,{children:l.jsx(na,{resource:"datasets"})});if(N)return l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load datasets",message:N.message})});if(w.length===0&&!j&&d===0)return l.jsxs(l.Fragment,{children:[l.jsx(ir,{children:l.jsx(Des,{onCreateClick:I})}),l.jsx(Qhe,{open:e,onOpenChange:t})]});const z=s!=="all"||i!=="all"||c!=="all"||n!=="",q=()=>{r(""),a("all"),o("all"),u("all"),f(0)};return l.jsxs(wn,{children:[l.jsx(wn.TopArea,{children:l.jsx(zes,{search:n,onSearchChange:U,targetFilter:s,onTargetFilterChange:M,experimentFilter:i,onExperimentFilterChange:L,tagFilter:c,onTagFilterChange:F,tagOptions:E,onReset:q,hasActiveFilters:z,onCreateClick:I})}),l.jsx(Res,{datasets:w,experiments:O,reviewByDataset:T,isLoading:j,search:n,targetFilter:s,experimentFilter:i,tagFilter:c,currentPage:d,hasMore:_,onNextPage:R,onPrevPage:P}),l.jsx(Qhe,{open:e,onOpenChange:t})]})}const vns=new Set(["items","experiments","review"]);function yns(){const{datasetId:e}=Mr(),t=bu(),[n,r]=fo(),s=n.get("tab"),a=s&&vns.has(s)?s:"items",i=E=>{r(E==="items"?{}:{tab:E},{replace:!0})},[o,c]=y.useState(!1),[u,d]=y.useState(!1),[f,p]=y.useState(!1),[h,m]=y.useState(!1),[g,v]=y.useState(null),{data:b,error:S}=Ub(e??"");if(!e)return l.jsx(fr,{children:l.jsx(kh,{children:l.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(S&&zs(S))return l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})});if(S&&Bs(S))return l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"datasets"})})});const w=E=>{t(`/datasets/${e}/experiments/${E}`)},_=()=>{t("/datasets")},O=E=>{v(E?.version??null)};return l.jsx(fr,{children:l.jsxs(kh,{className:"content-stretch",children:[l.jsx(Tts,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>p(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:O,initialTab:a,onTabChange:i,experimentTriggerSlot:l.jsxs(de,{variant:"primary",onClick:()=>c(!0),children:[l.jsx(rb,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),l.jsx(Pts,{datasetId:e,version:g??void 0,open:o,onOpenChange:c,onSuccess:w}),l.jsx(Nts,{datasetId:e,open:u,onOpenChange:d}),b&&l.jsx(qes,{open:f,onOpenChange:p,dataset:{id:b.id,name:b.name,description:b?.description||"",inputSchema:b.inputSchema,groundTruthSchema:b.groundTruthSchema}}),b&&l.jsx(Ves,{open:h,onOpenChange:m,datasetId:b.id,datasetName:b.name,onSuccess:_})]})})}function bns(){const{datasetId:e,experimentId:t}=Mr(),{data:n,isLoading:r,error:s}=d7(e,t),{data:a,isLoading:i,setEndOfListElement:o,isFetchingNextPage:c,hasNextPage:u}=NH({datasetId:e,experimentId:t,experimentStatus:n?.status});return!e||!t?null:r?l.jsx(fr,{children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Qt,{})})}):s&&zs(s)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})}):s&&Bs(s)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"datasets"})})}):s||!n?l.jsx(fr,{children:l.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",s instanceof Error?s.message:"Unknown error"]})}):l.jsx(fr,{children:l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[l.jsx(CLt,{experimentId:t,experiment:n}),l.jsx(ELt,{experimentId:t,experimentStatus:n?.status,results:a??[],isLoading:i,setEndOfListElement:o,isFetchingNextPage:c,hasNextPage:u})]})})})}function xns(){const{datasetId:e}=Mr(),[t,n]=fo(),{error:r}=Ub(e??""),s=t.get("baseline")??"",a=t.get("contender")??"";return r&&zs(r)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})}):r&&Bs(r)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"datasets"})})}):!e||!s||!a?l.jsx(fr,{children:l.jsx(kh,{children:l.jsxs("div",{className:"text-neutral4 text-center py-8",children:[l.jsx("p",{children:"Select two experiments to compare."}),l.jsxs("p",{className:"text-sm mt-2",children:["Use the URL format: /datasets/","{datasetId}","/experiments?baseline=","{experimentIdA}","&contender=","{experimentIdB}"]})]})})}):l.jsx(fr,{children:l.jsx(kh,{children:l.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[l.jsxs(Wn,{children:[l.jsxs(Wn.Column,{children:[l.jsxs(Wn.Title,{children:[l.jsx(H0,{})," Dataset Experiments Comparison"]}),l.jsxs(Wn.Description,{children:["Comparing"," ",l.jsx(qi,{to:`/datasets/${e}/experiments/${s}`,children:s.slice(0,8)})," vs"," ",l.jsx(qi,{to:`/datasets/${e}/experiments/${a}`,children:a.slice(0,8)})]})]}),l.jsx(Wn.Column,{children:l.jsxs(de,{as:qi,to:`/datasets/${e}`,children:[l.jsx(Eb,{}),"Back to Dataset"]})})]}),l.jsx(nns,{datasetId:e,experimentIdA:s,experimentIdB:a,onSwap:()=>{n({baseline:a,contender:s})}})]})})})}function wns(){const{datasetId:e,itemId:t}=Mr(),{Link:n}=an(),r=bu(),{data:s,isLoading:a,error:i}=IOe(e??"",t??""),{updateItem:o,deleteItem:c}=Di(),{data:u}=Ub(e??""),d=s?.[0]??null,f=d?.isDeleted??!1,[p,h]=y.useState(null),m=y.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,[v,b]=y.useState(!1),[S,w]=y.useState(m.input),[_,O]=y.useState(m.groundTruth),[E,T]=y.useState(m.metadata),[j,N]=y.useState(g);g!==j&&(N(g),w(m.input),O(m.groundTruth),T(m.metadata));const[I,R]=y.useState(!1),P=V=>{h(f?V:V.isLatest?null:V)},U=()=>{h(null)},M=!f&&p!=null,L=()=>{M||b(!0)},F=()=>{M||R(!0)},z=async()=>{if(!e||!t)return;let V;try{V=JSON.parse(S)}catch{Fe.error("Input must be valid JSON");return}let $;if(_.trim())try{$=JSON.parse(_)}catch{Fe.error("Ground Truth must be valid JSON");return}let W;if(E.trim())try{W=JSON.parse(E)}catch{Fe.error("Metadata must be valid JSON");return}try{await o.mutateAsync({datasetId:e,itemId:t,input:V,groundTruth:$,metadata:W}),Fe.success("Item updated successfully"),b(!1)}catch(G){Fe.error(`Failed to update item: ${G instanceof Error?G.message:"Unknown error"}`)}},q=()=>{d&&(w(JSON.stringify(d.input,null,2)),O(d.groundTruth?JSON.stringify(d.groundTruth,null,2):""),T(d.metadata?JSON.stringify(d.metadata,null,2):"")),b(!1)},H=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),Fe.success("Item deleted successfully"),R(!1),r(`/datasets/${e}`)}catch(V){Fe.error(`Failed to delete item: ${V instanceof Error?V.message:"Unknown error"}`)}},D=p??d,Y=D?{id:t??"",datasetId:e??"",datasetVersion:D.datasetVersion,input:D.input,groundTruth:D.groundTruth,metadata:D.metadata,createdAt:D.createdAt,updatedAt:D.updatedAt}:null;return i&&zs(i)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})}):i&&Bs(i)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"datasets"})})}):a?null:!e||!t||!s||s.length===0?l.jsx(fr,{children:l.jsx(kh,{children:l.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):l.jsxs(l.Fragment,{children:[l.jsx(fr,{children:l.jsx("div",{className:"h-full overflow-hidden px-6 pb-4",children:l.jsxs("div",{className:"grid gap-6 max-w-[60rem] mx-auto grid-rows-[auto_1fr] h-full",children:[l.jsxs(Wn,{children:[l.jsxs(Wn.Column,{children:[l.jsxs(Wn.Title,{children:[l.jsx(q0,{}),t," ",l.jsx(la,{content:t})]}),l.jsx(Wn.Description,{children:l.jsxs(fs,{children:["Item of ",l.jsx(U0,{})," ",u?.name]})}),l.jsxs(Wn.Description,{children:[l.jsxs(fs,{children:[l.jsx(xC,{})," Created at"," ",d?.createdAt?kn(new Date(d.createdAt),"MMM d, yyyy"):""]}),l.jsxs(fs,{children:[l.jsx(kw,{})," Latest version v",d?.datasetVersion??""]})]})]}),l.jsx(Wn.Column,{children:!v&&!f&&l.jsxs(Nr,{children:[l.jsxs(de,{onClick:L,disabled:M,title:M?"Return to latest version to edit":void 0,children:[l.jsx(vet,{})," Edit"]}),l.jsxs(de,{onClick:F,disabled:M,title:M?"Return to latest version to delete":void 0,children:[l.jsx(Zd,{})," Delete"]})]})})]}),l.jsxs(Yf,{className:v?"grid-cols-1":"grid-cols-[1fr_auto]",children:[l.jsxs(An,{withRightSeparator:!v,children:[f&&d&&l.jsx(Hn,{variant:"destructive",title:"Item deleted",children:l.jsxs(Hn.Message,{children:["This item was deleted at version v",d.datasetVersion]})}),!f&&M&&p&&l.jsx(Hn,{variant:"warning",title:"Previous version",action:l.jsxs(Hn.Button,{onClick:U,children:[l.jsx(X1,{})," Return to the latest version"]}),children:l.jsxs(Hn.Message,{children:["Viewing version v",p.datasetVersion]})}),v?l.jsx(bLt,{inputValue:S,setInputValue:w,groundTruthValue:_,setGroundTruthValue:O,metadataValue:E,setMetadataValue:T,validationErrors:null,onSave:z,onCancel:q,isSaving:o.isPending}):Y?l.jsx(IH,{item:Y,Link:n}):l.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!v&&l.jsx(An,{children:l.jsx(rns,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:P,onCompareVersionsClick:V=>{r(`/datasets/${e}/items/${t}/versions?ids=${V.join(",")}`)},activeVersion:p?.datasetVersion??null})})]})]})})}),l.jsx(Gt,{open:I,onOpenChange:R,children:l.jsxs(Gt.Content,{children:[l.jsxs(Gt.Header,{children:[l.jsx(Gt.Title,{children:"Delete Item"}),l.jsx(Gt.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),l.jsxs(Gt.Footer,{children:[l.jsx(Gt.Cancel,{children:"Cancel"}),l.jsx(Gt.Action,{onClick:H,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function yXe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function Sns(){const{datasetId:e}=Mr(),[t,n]=fo(),r=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=Ub(e??""),{Link:i}=an(),[o,c]=y.useState(!1),{data:u}=Zhe(e??"",r[0]??""),{data:d}=Zhe(e??"",r[1]??"");return a&&zs(a)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})}):a&&Bs(a)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"datasets"})})}):!e||r.length<2?l.jsx(fr,{children:l.jsx(kh,{children:l.jsx("div",{className:"text-neutral4 text-center py-8",children:l.jsx("p",{children:"Select at least two items to compare."})})})}):l.jsxs(fr,{children:[l.jsx(Pv,{owner:"dataset-items-compare",children:l.jsxs(de,{as:qi,to:`/datasets/${e}`,variant:"outline",children:[l.jsx(Eb,{}),"Back to Dataset"]})}),l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:X("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":o}),children:[l.jsxs(Wn,{children:[l.jsxs(Wn.Column,{children:[l.jsxs(Wn.Title,{children:[l.jsx(H0,{}),"Compare Dataset Items"]}),l.jsx(Wn.Description,{children:l.jsxs(fs,{children:["Comparing ",r.length," items of"," ",l.jsx(qi,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:s?.name||e?.slice(0,8)})]})})]}),l.jsx(Wn.Column,{children:l.jsx(Nr,{children:l.jsx(de,{variant:"primary",onClick:()=>c(f=>!f),children:o?l.jsxs(l.Fragment,{children:[l.jsx(aet,{})," Default View"]}):l.jsxs(l.Fragment,{children:[l.jsx(UWt,{})," Diff View"]})})})})]}),l.jsx(Yf,{className:"grid-cols-[1fr_3vw_1fr]",children:r.map((f,p)=>l.jsxs(y.Fragment,{children:[l.jsx(kns,{datasetId:e,itemId:f,Link:i,idx:p,itemIds:r,showContent:!o,onItemChange:h=>{const m=[...r];m[p]=h,n({items:m.join(",")})}}),p==0&&l.jsx("div",{className:X("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),o&&u&&d&&l.jsx(Q1t,{codeA:yXe(u),codeB:yXe(d)})]})})]})}function kns({datasetId:e,itemId:t,Link:n,idx:r,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:o,isLoading:c}=Zhe(e,t),{data:u}=UT(e),d=new Set(s.filter((p,h)=>h!==r)),f=(u??[]).map(p=>({value:p.id,label:p.id,disabled:d.has(p.id)}));return l.jsxs(An,{children:[l.jsxs(An.Toolbar,{className:"flex gap-4",children:[l.jsx(Dwe,{label:"Item",name:`compare-item-${r}`,value:t,onValueChange:a,options:f,placeholder:"Select item",labelIsHidden:!0}),l.jsxs(de,{as:n,to:`/datasets/${e}/items/${t}`,children:[l.jsx(kw,{}),"Versions"]})]}),i&&l.jsx(An.Content,{children:c?l.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):o?l.jsxs(l.Fragment,{children:[l.jsx(xLt,{item:o}),l.jsx(IH,{item:o,Link:n})]}):l.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function bXe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function _ns(){const{datasetId:e,itemId:t}=Mr(),[n,r]=fo(),[s,a]=y.useState(!1),i=n.get("ids")?.split(",").map(Number).filter(h=>!isNaN(h)&&h>0)??[],{data:o,error:c}=Ub(e??""),{Link:u}=an(),{data:d}=IOe(e??"",t??""),{data:f}=Khe(e??"",t??"",i[0]??0,o?.version),{data:p}=Khe(e??"",t??"",i[1]??0,o?.version);return c&&zs(c)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})}):c&&Bs(c)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"datasets"})})}):!e||!t||i.length<2?l.jsx(fr,{children:l.jsx(kh,{children:l.jsx("div",{className:"text-neutral4 text-center py-8",children:l.jsx("p",{children:"Select at least two versions to compare."})})})}):l.jsxs(fr,{children:[l.jsx(Pv,{owner:"dataset-item-versions-compare",children:l.jsxs(de,{as:qi,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[l.jsx(Eb,{}),"Back to Item"]})}),l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:X("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":s}),children:[l.jsxs(Wn,{children:[l.jsxs(Wn.Column,{children:[l.jsxs(Wn.Title,{children:[l.jsx(H0,{}),"Compare Dataset Item Versions"]}),l.jsx(Wn.Description,{children:l.jsxs(fs,{children:["Comparing ",i.length," versions of"," ",l.jsx(qi,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),l.jsx(Wn.Column,{children:l.jsx(Nr,{children:l.jsx(de,{variant:"primary",onClick:()=>a(h=>!h),children:s?l.jsxs(l.Fragment,{children:[l.jsx(aet,{})," Default View"]}):l.jsxs(l.Fragment,{children:[l.jsx(OGt,{})," Diff View"]})})})})]}),l.jsx(Yf,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((h,m)=>l.jsxs(y.Fragment,{children:[l.jsx(Ons,{datasetId:e,itemId:t,datasetVersion:h,latestVersion:o?.version,allVersions:d??[],versionNumbers:i,Link:u,idx:m,showContent:!s,onVersionChange:g=>{const v=[...i];v[m]=g,r({ids:v.join(",")})}}),m===0&&l.jsx("div",{className:X("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},h))}),s&&f&&p&&l.jsx(Q1t,{codeA:bXe(f),codeB:bXe(p)})]})})]})}function Ons({datasetId:e,itemId:t,datasetVersion:n,latestVersion:r,allVersions:s,versionNumbers:a,Link:i,idx:o,showContent:c=!0,onVersionChange:u}){const{data:d,isLoading:f}=Khe(e,t,n,r),p=new Set(a.filter((g,v)=>v!==o)),h=s.map(g=>{const v=typeof g.updatedAt=="string"?new Date(g.updatedAt):g.updatedAt;return{value:String(g.datasetVersion),label:l.jsxs(l.Fragment,{children:[l.jsxs("b",{children:["v. ",g.datasetVersion]})," - ",kn(v,"MMM d, yyyy h:mm a"),g.isLatest?l.jsx(ai,{color:"blue",size:"small",children:"Latest"}):null]}),disabled:p.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 l.jsxs(An,{children:[l.jsxs(An.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[l.jsx(kw,{className:"w-6 h-6 opacity-50"}),l.jsx(Dwe,{label:"Version",name:`compare-version-${o}`,value:String(n),onValueChange:g=>u(Number(g)),options:h,placeholder:"Select version",labelIsHidden:!0,className:"w-full"})]}),c&&l.jsx(An.Content,{children:f?l.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):!d||!m?l.jsxs("div",{className:"text-neutral4 text-sm",children:["Version ",n," not found"]}):l.jsx(IH,{item:m,Link:i})})]})}function Ens(){const{datasetId:e}=Mr(),[t]=fo(),n=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],r=bu(),{data:s,error:a}=Ub(e??""),i=UT(e??"",void 0,n[0]??null),o=UT(e??"",void 0,n[1]??null),c=y.useMemo(()=>i.data??[],[i.data]),u=y.useMemo(()=>o.data??[],[o.data]),d=y.useMemo(()=>{const g=new Map;for(const v of[...c,...u])g.has(v.id)||g.set(v.id,{id:v.id,createdAt:new Date(v.createdAt)});return[...g.values()].sort((v,b)=>b.createdAt.getTime()-v.createdAt.getTime())},[c,u]),f=y.useMemo(()=>new Map(c.map(g=>[g.id,g])),[c]),p=y.useMemo(()=>new Map(u.map(g=>[g.id,g])),[u]);if(a&&zs(a))return l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})});if(a&&Bs(a))return l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"datasets"})})});if(!e||n.length<2)return l.jsx(fr,{children:l.jsx(kh,{children:l.jsx("div",{className:"text-neutral4 text-center py-8",children:l.jsx("p",{children:"Select at least two versions to compare."})})})});const h=(g,v,b)=>{r(`/datasets/${e}/items/${g}/versions?ids=${v?.datasetVersion??""},${b?.datasetVersion??""}`)},m=(g,v)=>{r(`/datasets/${e}/versions?ids=${g},${v}`,{replace:!0})};return l.jsx(fr,{children:l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:"grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[l.jsxs(Wn,{children:[l.jsxs(Wn.Column,{children:[l.jsxs(Wn.Title,{children:[l.jsx(qQt,{})," Compare Dataset Versions"]}),l.jsx(Wn.Description,{children:l.jsxs(fs,{children:[l.jsx(kw,{})," Comparing ",n.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),l.jsx(Wn.Column,{children:l.jsxs(de,{as:qi,to:`/datasets/${e}`,children:[l.jsx(Eb,{}),"Back to Dataset"]})})]}),l.jsx(Yf,{children:l.jsxs(An,{children:[l.jsx(ins,{datasetId:e,versionA:String(n[0]),versionB:String(n[1]),onVersionChange:m}),l.jsx(uns,{datasetId:e,versionA:n[0],versionB:n[1],allItems:d,itemsAMap:f,itemsBMap:p,onItemClick:h})]})})]})})})}function Cns(e){if(!e||e.length<2)return null;const t=[...e].sort((i,o)=>new Date(i.createdAt).getTime()-new Date(o.createdAt).getTime()),n=Math.floor(t.length/2),r=n,s=t.length-n;if(r===0)return null;const a=(s-r)/r*100;return{changePct:Math.round(a*10)/10,prevValue:String(r)}}function Tns({scorers:e,datasets:t,experiments:n,avgScore:r,prevAvgScore:s,totalNeedsReview:a,isLoadingScorers:i,isLoadingDatasets:o,isLoadingExperiments:c,isLoadingScores:u,isLoadingReview:d}){const f=e?Object.keys(e).length:void 0,p=t?.length,h=n?.length,m=r!=null&&s!=null&&s!==0?{changePct:Math.round((r-s)/s*100*10)/10,prevValue:String(s)}:null,g=Cns(n);return l.jsxs(l.Fragment,{children:[l.jsxs(qr,{children:[l.jsx(qr.Label,{children:"Total Scorers"}),i?l.jsx(qr.Loading,{}):f!=null?l.jsxs(l.Fragment,{children:[l.jsx(qr.Value,{children:String(f)}),l.jsx(qr.NoChange,{message:"Static count"})]}):l.jsx(qr.NoData,{})]}),l.jsxs(qr,{children:[l.jsx(qr.Label,{children:"Total Datasets"}),o?l.jsx(qr.Loading,{}):p!=null?l.jsxs(l.Fragment,{children:[l.jsx(qr.Value,{children:String(p)}),l.jsx(qr.NoChange,{message:"Static count"})]}):l.jsx(qr.NoData,{})]}),l.jsxs(qr,{children:[l.jsx(qr.Label,{children:"Avg Score"}),u?l.jsx(qr.Loading,{}):r!=null?l.jsxs(l.Fragment,{children:[l.jsx(qr.Value,{children:String(r)}),m?l.jsx(qr.Change,{changePct:m.changePct,prevValue:m.prevValue}):l.jsx(qr.NoChange,{})]}):l.jsx(qr.NoData,{})]}),l.jsxs(qr,{children:[l.jsx(qr.Label,{children:"Total Experiments"}),c?l.jsx(qr.Loading,{}):h!=null?l.jsxs(l.Fragment,{children:[l.jsx(qr.Value,{children:String(h)}),g?l.jsx(qr.Change,{changePct:g.changePct,prevValue:g.prevValue}):l.jsx(qr.NoChange,{})]}):l.jsx(qr.NoData,{})]}),l.jsxs(qr,{children:[l.jsx(qr.Label,{children:"Needs Review"}),d?l.jsx(qr.Loading,{}):a!=null?l.jsxs(l.Fragment,{children:[l.jsx(qr.Value,{children:String(a)}),a>0?l.jsx(qr.NoChange,{message:"items pending review"}):l.jsx(qr.NoChange,{message:"All caught up"})]}):l.jsx(qr.NoData,{})]})]})}const jns=[{value:"all",label:"All statuses"},{value:"completed",label:"Completed"},{value:"running",label:"Running"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}],xXe="auto 1fr auto auto auto auto auto auto auto";function Nns(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const Ans={completed:"success",running:"warning",failed:"error",pending:"neutral"};function Ins({experiments:e,datasets:t,reviewByExperiment:n,isLoading:r,search:s="",statusFilter:a="all",datasetFilter:i="all"}){const{paths:o,Link:c}=an(),u=y.useMemo(()=>{const p=new Map;return t?.forEach(h=>p.set(h.id,h.name)),p},[t]),d=y.useMemo(()=>[...e].sort((p,h)=>{const m=p.createdAt?new Date(p.createdAt).getTime():0;return(h.createdAt?new Date(h.createdAt).getTime():0)-m}),[e]),f=y.useMemo(()=>{const p=s.toLowerCase();return d.filter(h=>{const m=h.datasetId?u.get(h.datasetId)??"":"",g=!p||h.id.toLowerCase().includes(p)||m.toLowerCase().includes(p)||(h.targetId??"").toLowerCase().includes(p),v=a==="all"||h.status===a,b=i==="all"||h.datasetId===i;return g&&v&&b})},[d,s,u,a,i]);return r?l.jsx(Dd,{columns:xXe}):l.jsxs(we,{columns:xXe,children:[l.jsxs(we.Top,{children:[l.jsx(we.TopCell,{children:"Experiment"}),l.jsx(we.TopCell,{children:"Dataset"}),l.jsx(we.TopCell,{children:"Target"}),l.jsx(we.TopCell,{children:"Status"}),l.jsx(we.TopCell,{className:"text-center",children:"Items"}),l.jsx(we.TopCell,{className:"text-center",children:"Succeeded"}),l.jsx(we.TopCell,{className:"text-center",children:"Failed"}),l.jsx(we.TopCell,{className:"text-center",children:"Review"}),l.jsx(we.TopCell,{children:"Date"})]}),f.map(p=>{const h=p.datasetId?u.get(p.datasetId)??p.datasetId.slice(0,8):"—",m=p.status??"pending",g=p.succeededCount??0,v=p.failedCount??0,b=p.totalItems??0,S=b>0?Math.round(g/b*100):0;return l.jsxs(we.RowLink,{to:o.experimentLink(p.id),LinkComponent:c,children:[l.jsx(we.NameCell,{className:"font-mono",children:p.id.slice(0,8)}),l.jsx(we.TextCell,{children:h}),l.jsx(we.Cell,{children:l.jsxs("span",{className:"truncate",children:[p.targetType," ",p.targetId]})}),l.jsx(we.Cell,{children:l.jsx(Ek,{variant:Ans[m]??"neutral",withDot:!0,children:m})}),l.jsx(we.TextCell,{className:"text-center",children:b}),l.jsx(we.TextCell,{className:"text-center",children:l.jsxs("span",{className:g>0?"text-accent1":"",children:[g," (",S,"%)"]})}),l.jsx(we.TextCell,{className:"text-center",children:l.jsx("span",{className:v>0?"text-accent2":"",children:v})}),l.jsx(we.Cell,{className:"text-center",children:(()=>{const w=n?.get(p.id);if(!w)return l.jsx("span",{className:"text-neutral2",children:"—"});const _=w.needsReview+w.complete;return _===0?l.jsx("span",{className:"text-neutral2",children:"—"}):w.needsReview>0?l.jsxs(Et,{variant:"warning",children:[w.needsReview," pending"]}):l.jsxs(Et,{variant:"success",children:[w.complete,"/",_," reviewed"]})})()}),l.jsx(we.TextCell,{children:Nns(p.createdAt)})]},p.id)})]})}function Rns(e){return[{value:"all",label:"All datasets"},...(e??[]).map(t=>({value:t.id,label:t.name}))]}const F5={completed:"#22c55e",running:"#facc15",pending:"#fb923c",failed:"#f87171"},Pns=[{label:"Completed",color:F5.completed},{label:"Running",color:F5.running},{label:"Pending",color:F5.pending},{label:"Failed",color:F5.failed}];function Mns({experiments:e,datasets:t,isLoading:n,isError:r}){const{data:s,maxVal:a}=y.useMemo(()=>{if(!e||e.length===0)return{data:[],maxVal:0};const o=new Map;if(t)for(const f of t)o.set(f.id,f.name);const c=new Map;for(const f of e){const p=f.datasetId??"unknown";c.has(p)||c.set(p,{completed:0,running:0,pending:0,failed:0});const h=c.get(p),m=f.status;m in h&&h[m]++}let u=0;return{data:Array.from(c.entries()).map(([f,p])=>{const h=p.completed+p.running+p.pending+p.failed;return h>u&&(u=h),{name:o.get(f)??f.slice(0,12),values:[p.completed,p.running,p.pending,p.failed]}}),maxVal:u}},[e,t]),i=s.length>0;return l.jsxs(Vt,{children:[l.jsxs(Vt.TopBar,{children:[l.jsx(Vt.TitleAndDescription,{title:"Experiments by Dataset",description:"Experiment status breakdown per dataset."}),i&&l.jsx(Vt.Summary,{value:String(e?.length??0),label:"Total experiments"})]}),n?l.jsx(Vt.Loading,{}):r?l.jsx(Vt.Error,{message:"Failed to load experiments data"}):l.jsx(Vt.Content,{children:i?l.jsx(iT,{data:s,segments:Pns,maxVal:a,fmt:o=>String(o)}):l.jsx(Vt.NoData,{message:"No experiments have been run yet"})})]})}const $ns=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(oi,{iconSlot:l.jsx(Hd,{}),titleSlot:"No Experiments yet",descriptionSlot:l.jsxs(l.Fragment,{children:["Run an experiment from a dataset to evaluate ",l.jsx("br",{}),"your agents and workflows."]}),actionSlot:l.jsx("div",{className:"flex flex-col items-center gap-2",children:l.jsxs(de,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",children:["Experiments Documentation ",l.jsx(Da,{})]})})})});function Dns({search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:i,onReset:o,hasActiveFilters:c}){return l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(Iv,{label:"Search experiments",placeholder:"Filter by experiment, dataset, or target",value:e,onSearch:t}),l.jsxs(Nr,{children:[l.jsx(Yl,{label:"Status",labelIsHidden:!0,name:"filter-status",options:[...jns],value:n,onValueChange:r,className:"whitespace-nowrap"}),l.jsx(Yl,{label:"Dataset",labelIsHidden:!0,name:"filter-dataset",options:i,value:s,onValueChange:a,className:"whitespace-nowrap"}),o&&c&&l.jsxs(de,{onClick:o,size:"sm",variant:"default",children:[l.jsx(Pr,{className:"size-3"})," Reset"]})]})]})}function Lns(){const{data:e,isLoading:t,error:n}=Op(),{data:r,isLoading:s,error:a}=Rv(),{data:i,isLoading:o,error:c}=AH(),{data:u,isLoading:d,isError:f,error:p}=RGr(),{data:h,isLoading:m,isError:g,error:v}=POe(),b=r?.datasets,S=i?.experiments,w=y.useMemo(()=>hns(h),[h]),_=n||a||c||p||v;return _&&zs(_)?l.jsx(ir,{children:l.jsx(ua,{})}):_&&Bs(_)?l.jsx(ir,{children:l.jsx(na,{resource:"evaluation"})}):_?l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load evaluation data",message:_.message})}):l.jsx(wn,{width:"wide",height:"full",children:l.jsxs("div",{className:"flex flex-col gap-6",children:[l.jsx(mfe,{children:l.jsx(Tns,{scorers:e,datasets:b,experiments:S,avgScore:u?.avgScore??null,prevAvgScore:u?.prevAvgScore??null,totalNeedsReview:w.needsReview,isLoadingScorers:t,isLoadingDatasets:s,isLoadingExperiments:o,isLoadingScores:d,isLoadingReview:m})}),l.jsx(kGr,{summaryData:u?.summaryData??[],overTimeData:u?.overTimeData??[],scorerNames:u?.scorerNames??[],avgScore:u?.avgScore??null,isLoading:d,isError:f}),l.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[l.jsx(Les,{experiments:S,isLoading:o,isError:!!c}),l.jsx(Mns,{experiments:S,datasets:b,isLoading:o,isError:!!c})]}),l.jsx(fns,{reviewSummary:h,experiments:S,datasets:b,isLoading:m,isError:!!g})]})})}function zns(){const[e,t]=y.useState(""),[n,r]=y.useState("all"),[s,a]=y.useState("all"),{data:i,isLoading:o,error:c}=Rv(),{data:u,isLoading:d,error:f}=AH(),{data:p}=POe(),h=y.useMemo(()=>i?.datasets??[],[i?.datasets]),m=y.useMemo(()=>u?.experiments??[],[u?.experiments]),g=y.useMemo(()=>Rns(h),[h]),v=y.useMemo(()=>TLt(p),[p]),b=o||d,S=f||c;if(S&&zs(S))return l.jsx(ir,{children:l.jsx(ua,{})});if(f&&Bs(f))return l.jsx(ir,{children:l.jsx(na,{resource:"experiments"})});if(c&&Bs(c))return l.jsx(ir,{children:l.jsx(na,{resource:"datasets"})});if(S)return l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load experiments",message:S.message})});if(m.length===0&&!b)return l.jsx(ir,{children:l.jsx($ns,{})});const w=n!=="all"||s!=="all"||e!=="",_=()=>{t(""),r("all"),a("all")};return l.jsxs(wn,{children:[l.jsx(wn.TopArea,{children:l.jsx(Dns,{search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:g,onReset:_,hasActiveFilters:w})}),l.jsx(Ins,{experiments:m,datasets:h,reviewByExperiment:v,isLoading:b,search:e,statusFilter:n,datasetFilter:s})]})}function Fns(){const{experimentId:e}=Mr(),{data:t,isLoading:n}=AH(),s=t?.experiments?.find(h=>h.id===e)?.datasetId??"",{data:a,isLoading:i,error:o}=d7(s,e??""),{data:c,isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:p}=NH({datasetId:s,experimentId:e??"",experimentStatus:a?.status});return e?n||i||!s?l.jsx(fr,{children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Qt,{})})}):o&&zs(o)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})}):o&&Bs(o)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"datasets"})})}):o||!a?l.jsx(fr,{children:l.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",o instanceof Error?o.message:"Unknown error"]})}):l.jsx(fr,{children:l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[l.jsx(CLt,{experimentId:e,experiment:a}),l.jsx(ELt,{experimentId:e,experimentStatus:a?.status,results:c??[],isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:p})]})})}):null}function jLt({redirectUri:e,onSuccess:t,initialMode:n="signin",errorMessage:r}){const{data:s,isLoading:a}=Uj(),{mutate:i,isPending:o,error:c}=UJr(),{mutate:u,isPending:d,error:f}=VJr(),{mutate:p,isPending:h}=fLt(),[m,g]=y.useState(n),[v,b]=y.useState(""),[S,w]=y.useState(""),[_,O]=y.useState("");if(a)return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:l.jsx("div",{className:"text-neutral3",children:"Loading..."})});if(!s?.enabled||!s?.login)return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:l.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,R=m==="signin"||!I,P=R?o:d,U=R?c:f,M=()=>{t?t():e?window.location.href=e:window.location.href="/"},L=q=>{q.preventDefault(),R?i({email:S,password:_},{onSuccess:M}):u({email:S,password:_,name:v||void 0},{onSuccess:M})},F=()=>{p({redirectUri:e},{onSuccess:q=>{window.location.href=q.url}})},z=()=>{g(R?"signup":"signin")};return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:l.jsxs("div",{className:"w-full max-w-sm space-y-6 rounded-lg border border-border1 bg-surface2 p-8",children:[l.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[l.jsx(Ky,{className:"h-10 w-10"}),l.jsx("h1",{className:"text-xl font-semibold text-neutral6",children:R?"Sign in to Mastra Studio":"Create your account"})]}),E.description&&l.jsxs("div",{className:"flex items-start gap-2.5 rounded-md border border-border1 bg-surface1 p-3",children:[l.jsx(det,{className:"mt-0.5 h-4 w-4 shrink-0 text-neutral4"}),l.jsx("p",{className:"text-sm text-neutral3",children:E.description})]}),r&&l.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:r}),j&&l.jsxs("form",{onSubmit:L,className:"space-y-4",children:[!R&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"name",className:"block text-sm text-neutral4",children:"Name"}),l.jsx(Sn,{id:"name",type:"text",value:v,onChange:q=>b(q.target.value),placeholder:"Your name",variant:"default",size:"lg"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"email",className:"block text-sm text-neutral4",children:"Email"}),l.jsx(Sn,{id:"email",type:"email",value:S,onChange:q=>w(q.target.value),placeholder:"you@example.com",required:!0,variant:"default",size:"lg"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"password",className:"block text-sm text-neutral4",children:"Password"}),l.jsx(Sn,{id:"password",type:"password",value:_,onChange:q=>O(q.target.value),placeholder:R?"Enter your password":"Create a password",required:!0,variant:"default",size:"lg"})]}),U&&l.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:U.message}),l.jsx(de,{type:"submit",disabled:P,className:"w-full",size:"lg",children:P?R?"Signing in...":"Creating account...":R?"Sign in":"Create account"}),I&&l.jsxs("div",{className:"text-center text-sm",children:[l.jsx("span",{className:"text-neutral3",children:R?"Don't have an account? ":"Already have an account? "}),l.jsx("button",{type:"button",onClick:z,className:"text-neutral6 hover:underline",children:R?"Sign up":"Sign in"})]})]}),T&&j&&l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex items-center",children:l.jsx("div",{className:"w-full border-t border-border1"})}),l.jsx("div",{className:"relative flex justify-center text-sm",children:l.jsx("span",{className:"bg-surface2 px-2 text-neutral3",children:"or continue with"})})]}),T&&N&&l.jsxs(de,{onClick:F,disabled:h,className:"w-full",size:"lg",variant:"outline",children:[N.icon&&l.jsx("span",{className:"mr-2",children:N.icon}),h?"Redirecting...":N.text||"Sign in"]})]})})}function Bns(){const[e]=fo(),t=bu(),n=e.get("redirect")||"/",s=e.get("mode")==="signup"?"signup":"signin",a=e.get("error_description")||e.get("error")||null,i=()=>{n.startsWith("http")?window.location.href=n:t(n,{replace:!0})};return l.jsx(jLt,{redirectUri:n,onSuccess:i,initialMode:s,errorMessage:a})}function Uns(){const[e,t]=fo(),n=Rar(e,t),r=$ar(e,t),[s,a]=y.useState(),[i,o]=y.useState(!1),{data:c=[],isPending:u}=fwe(),{data:d=[],isPending:f}=pwe({entityType:n.selectedEntityOption?.entityType,rootOnly:!0}),{data:p=[],isPending:h}=hwe(),{data:m=[],isPending:g}=mwe(),v=y.useMemo(()=>nsr({availableTags:c,availableRootEntityNames:d,availableServiceNames:m,availableEnvironments:p,loading:{tags:u,entityNames:f,serviceNames:g,environments:h}}),[c,d,m,p,u,f,g,h]),b=y.useMemo(()=>isr({rootEntityType:n.selectedEntityOption?.entityType,dateFrom:n.selectedDateFrom,dateTo:n.selectedDateTo,tokens:n.filterTokens}),[n.filterTokens,n.selectedDateFrom,n.selectedDateTo,n.selectedEntityOption]),{data:S=[],isLoading:w,error:_,isFetchingNextPage:O,hasNextPage:E,setEndOfListElement:T}=Aar({filters:b}),{logIdMap:j,featuredLog:N,handleLogClick:I,handlePreviousLog:R,handleNextLog:P}=zar(S,n.featuredLogId,n.handleFeaturedChange,n.featuredTraceId),{data:U,isLoading:M}=dwe(n.featuredTraceId??null),{data:L,isLoading:F}=Ck(n.featuredTraceId??"",n.featuredSpanId??""),z=y.useCallback(()=>n.applyFilterTokens(osr(v,n.filterTokens)),[v,n]),q=y.useCallback(()=>n.handleFeaturedChange({logId:null}),[n]),H=y.useCallback(K=>n.handleFeaturedChange({traceId:K,spanId:null}),[n]),D=y.useCallback((K,re)=>n.handleFeaturedChange({traceId:K,spanId:re}),[n]),Y=y.useCallback(()=>{n.handleFeaturedChange({traceId:null,spanId:null}),o(!1)},[n]),V=y.useCallback(()=>n.handleFeaturedChange({spanId:null}),[n]),$=y.useCallback(K=>n.handleFeaturedChange({spanId:K??null}),[n]),W=l.jsxs(wn.TopArea,{children:[l.jsx(wn.Row,{children:l.jsxs(wn.Column,{className:"flex flex-wrap items-start justify-start gap-2",children:[l.jsx(gSt,{preset:n.datePreset,onPresetChange:n.handleDatePresetChange,dateFrom:n.selectedDateFrom,dateTo:n.selectedDateTo,onDateChange:n.handleDateChange,disabled:w,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),l.jsx(H0e,{fields:v,tokens:n.filterTokens,onTokensChange:n.handleFilterTokensChange,disabled:w,onStartTextFilter:a})]})}),l.jsx(kar,{isLoading:w,filterFields:v,filterTokens:n.filterTokens,onFilterTokensChange:n.handleFilterTokensChange,onClear:z,onRemoveAll:n.handleRemoveAll,onSave:r.handleSave,onRemoveSaved:r.hasSavedFilters?r.handleRemoveSaved:void 0,autoFocusFilterFieldId:s})]});if(_)return l.jsxs(wn,{width:"wide",height:"full",children:[W,l.jsx(wn.MainArea,{isCentered:!0,children:l.jsx(yar,{error:_,resource:"logs",errorTitle:"Failed to load logs"})})]});const G=!!n.selectedEntityOption||n.filterTokens.length>0;return S.length===0&&!w&&!G?l.jsxs(wn,{width:"wide",height:"full",children:[W,l.jsx(wn.MainArea,{isCentered:!0,children:l.jsx(Car,{datePreset:n.datePreset,dateFrom:n.selectedDateFrom,dateTo:n.selectedDateTo})})]}):l.jsxs(wn,{width:"wide",height:"full",children:[W,l.jsx(bar,{logCollapsed:i,listSlot:l.jsx(Sar,{logs:S,isLoading:w,isFetchingNextPage:O,hasNextPage:E,setEndOfListElement:T,logIdMap:j,featuredLogId:n.featuredLogId,onLogClick:I}),logPanelSlot:N?l.jsx(gar,{log:N,onClose:q,onTraceClick:H,onSpanClick:D,onPrevious:R,onNext:P,collapsed:i,onCollapsedChange:o}):null,tracePanelSlot:n.featuredTraceId?l.jsx(Usr,{traceId:n.featuredTraceId,spans:U?.spans,isLoading:M,onClose:Y,onSpanSelect:$,selectedSpanId:n.featuredSpanId}):null,spanPanelSlot:n.featuredTraceId&&n.featuredSpanId?l.jsx(Bsr,{spanId:n.featuredSpanId,span:L?.span,isLoading:F,onClose:V}):null})]})}function qns({server:e}){const{paths:t,Link:n}=an(),s=Ze().options.baseUrl,a=s?`${s}/api/mcp/${e.id}/sse`:"",{data:i}=d4t(e),o=Object.values(i||{}),c=o.length,u=o.filter(p=>p.toolType==="agent").length,d=o.filter(p=>p.toolType==="workflow").length,f=_h(e.name,50);return l.jsxs(we.RowLink,{to:t.mcpServerLink(e.id),LinkComponent:n,children:[l.jsx(we.NameCell,{children:f}),l.jsx(we.DescriptionCell,{children:a}),l.jsx(we.TextCell,{className:"text-center",children:u||""}),l.jsx(we.TextCell,{className:"text-center",children:c||""}),l.jsx(we.TextCell,{className:"text-center",children:d||""})]})}function Vns({mcpServers:e,isLoading:t,search:n=""}){const r=y.useMemo(()=>{const s=n.toLowerCase();return e.filter(a=>a.name?.toLowerCase().includes(s)||a.id?.toLowerCase().includes(s))},[e,n]);return t?l.jsx(Dd,{columns:"auto 1fr auto auto auto"}):l.jsxs(we,{columns:"auto 1fr auto auto auto",children:[l.jsxs(we.Top,{children:[l.jsx(we.TopCell,{children:"Name"}),l.jsx(we.TopCell,{children:"URL"}),l.jsx(we.TopCellSmart,{long:"Agents",short:l.jsx(Go,{}),tooltip:"Agent Tools",className:"text-center"}),l.jsx(we.TopCellSmart,{long:"Tools",short:l.jsx(Cc,{}),tooltip:"Tools",className:"text-center"}),l.jsx(we.TopCellSmart,{long:"Workflows",short:l.jsx(Tc,{}),tooltip:"Workflow Tools",className:"text-center"})]}),r.length===0&&n?l.jsx(we.NoMatch,{message:"No MCP Servers match your search"}):null,r.map(s=>l.jsx(qns,{server:s},s.id))]})}const Hns=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(oi,{iconSlot:l.jsx(Hd,{}),titleSlot:"No MCP Servers yet",descriptionSlot:l.jsxs(l.Fragment,{children:["MCP servers are not configured yet. ",l.jsx("br",{}),"More information in the documentation."]}),actionSlot:l.jsxs(de,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",children:["MCP Documentation ",l.jsx(Da,{})]})})}),Zns=()=>{const{data:e=[],isLoading:t,error:n}=hH(),[r,s]=y.useState("");return n&&zs(n)?l.jsx(ir,{children:l.jsx(ua,{})}):n&&Bs(n)?l.jsx(ir,{children:l.jsx(na,{resource:"MCP servers"})}):n?l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load MCP servers",message:n.message})}):e.length===0&&!t?l.jsx(ir,{children:l.jsx(Hns,{})}):l.jsxs(wn,{children:[l.jsx(wn.TopArea,{children:l.jsx("div",{className:"max-w-120",children:l.jsx(Iv,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})}),l.jsx(Vns,{mcpServers:e,isLoading:t,search:r})]})},Wns=(e,t)=>{const n=new Map,r=Object.keys(t);for(const s of r){const a=t[s],i=a.tools,o=Object.keys(i);for(const c of o){const u=i[c];n.has(u.id)||n.set(u.id,{...u,agents:[]}),n.get(u.id).agents.push({...a,id:s})}}for(const[s,a]of Object.entries(e))n.has(a.id)||n.set(a.id,{...a,agents:[]});return Array.from(n.values())};function Gns({tools:e,agents:t,isLoading:n,search:r=""}){const{paths:s,Link:a}=an(),i=y.useMemo(()=>Wns(e,t),[e,t]),o=y.useMemo(()=>i.filter(c=>c.id.toLowerCase().includes(r.toLowerCase())),[i,r]);return n?l.jsx(Dd,{columns:"auto 1fr auto"}):l.jsxs(we,{columns:"auto 1fr auto",children:[l.jsxs(we.Top,{children:[l.jsx(we.TopCell,{children:"Name"}),l.jsx(we.TopCell,{children:"Description"}),l.jsx(we.TopCellSmart,{long:"Agents",short:l.jsx(Go,{}),tooltip:"Attached Agents",className:"text-center"})]}),o.length===0&&r?l.jsx(we.NoMatch,{message:"No Tools match your search"}):null,o.map(c=>{const u=_h(c.id,50),d=_h(c.description??"",200),f=c.agents.length;return l.jsxs(we.RowLink,{to:s.toolLink(c.id),LinkComponent:a,children:[l.jsx(we.NameCell,{children:u}),l.jsx(we.DescriptionCell,{children:d}),l.jsx(we.TextCell,{className:"text-center",children:f||""})]},c.id)})]})}const Qns=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(oi,{iconSlot:l.jsx(Hd,{}),titleSlot:"No Tools yet",descriptionSlot:l.jsxs(l.Fragment,{children:["Mastra tools are not configured yet. ",l.jsx("br",{}),"More information in the documentation."]}),actionSlot:l.jsxs(de,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",children:["Tools Documentation ",l.jsx(Da,{})]})})}),Yns=()=>{const e=Ze();return nr({mutationFn:async({toolId:t,input:n,requestContext:r})=>{const s=new bC;Object.entries(r??{}).forEach(([a,i])=>{s.set(a,i)});try{return await e.getTool(t).execute({data:n,requestContext:s})}catch(a){throw Fe.error("Error executing dev tool"),console.error("Error executing dev tool:",a),a}}})},Xns=({toolId:e})=>{const{canExecute:t}=qb(),n=t("tools"),{data:r={}}=Lv(),s=y.useMemo(()=>{for(const g of Object.values(r))if(g.tools){const v=Object.values(g.tools).find(b=>b.id===e);if(v)return v}return null},[r,e]),{data:a,isLoading:i,error:o}=mYr(e,{enabled:!s}),c=s||a,{mutateAsync:u,isPending:d,data:f}=Yns(),{requestContext:p}=Us();y.useEffect(()=>{if(o){const g=o instanceof Error?o.message:"Failed to load tool";Fe.error(`Error loading tool: ${g}`)}},[o]);const h=async(g,v)=>{if(!c)return;const b={...p??{},...v??{}};return u({toolId:c.id,input:g,requestContext:b})},m=c?.inputSchema?bv(gv(bb(c?.inputSchema))):ds({});return i?l.jsxs("div",{className:"p-6",children:[l.jsx(rs,{className:"h-8 w-48 mb-4"}),l.jsx(rs,{className:"h-32 w-full"})]}):o?null:c?n?l.jsx(xOe,{executionResult:f,isExecutingTool:d,zodInputSchema:m,handleExecuteTool:h,toolDescription:c.description,toolId:c.id,requestContextSchema:c.requestContextSchema}):l.jsx("div",{className:"py-12 text-center px-6",children:l.jsx(ge,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})}):l.jsx("div",{className:"py-12 text-center px-6",children:l.jsx(ge,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})})};function Kns({value:e,onValueChange:t,placeholder:n="Select a tool...",searchPlaceholder:r="Search tools...",emptyText:s="No tools found.",className:a,disabled:i=!1,variant:o="default"}){const{data:c={},isLoading:u,isError:d,error:f}=TH(),{data:p={},isLoading:h,isError:m,error:g}=Lv(),{navigate:v,paths:b}=an();y.useEffect(()=>{if(d){const O=f instanceof Error?f.message:"Failed to load tools";Fe.error(`Error loading tools: ${O}`)}},[d,f]),y.useEffect(()=>{if(m){const O=g instanceof Error?g.message:"Failed to load agents";Fe.error(`Error loading agents: ${O}`)}},[m,g]);const S=new Map;Object.values(p).forEach(O=>{O.tools&&Object.values(O.tools).forEach(E=>{S.has(E.id)||S.set(E.id,E)})}),Object.values(c).forEach(O=>{S.has(O.id)||S.set(O.id,O)});const w=Array.from(S.values()).map(O=>({label:O.id,value:O.id})),_=O=>{t?t(O):O&&O!==e&&v(b.toolLink(O))};return l.jsx(jc,{options:w,value:e,onValueChange:_,placeholder:u||h?"Loading tools...":n,searchPlaceholder:r,emptyText:s,className:a,disabled:i||u||h||d||m,variant:o})}const Jns=({isLoading:e,server:t})=>{const[{sseUrl:n,httpStreamUrl:r},s]=y.useState({sseUrl:"",httpStreamUrl:""});if(y.useEffect(()=>{if(!t)return;const i=window.MASTRA_SERVER_HOST,o=window.MASTRA_SERVER_PORT;let c=null;i&&o&&(c=`http://${i}:${o}`);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 l.jsx(kh,{children:l.jsx(ge,{as:"h1",variant:"header-md",className:"text-neutral3 font-medium py-20 text-center",children:"Server not found"})});const a=`npx -y mcp-remote ${n}`;return l.jsxs(kh,{isDivided:!0,children:[l.jsxs("div",{className:"px-8 py-12 mx-auto max-w-2xl w-full",children:[l.jsx(ge,{as:"h1",variant:"header-md",className:"text-neutral6 font-medium pb-4",children:t.name}),l.jsxs("div",{className:"flex items-center gap-1 pb-6",children:[l.jsx(Et,{icon:l.jsx(gq,{className:"text-neutral6"}),className:"rounded-r-sm text-neutral4!",children:"Version"}),l.jsx(Et,{className:"rounded-l-sm text-neutral4!",children:t.version_detail.version})]}),l.jsx(ge,{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."}),l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[l.jsx(Et,{icon:l.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"HTTP"}),children:"Regular HTTP Endpoint"}),l.jsx(ge,{className:"text-neutral3 pt-1 pb-2",children:"Use for stateless HTTP transport with streamable responses."}),l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(ge,{className:"px-2 py-1 bg-surface4 rounded-lg",children:r}),l.jsx("div",{className:"pt-1",children:l.jsx(la,{tooltip:"Copy HTTP Stream URL",content:r})})]})]}),l.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[l.jsx(Et,{icon:l.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"SSE"}),children:"Server-Sent Events"}),l.jsx(ge,{className:"text-neutral3 pt-1 pb-2",children:"Use for real-time communication via SSE."}),l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(ge,{className:"px-2 py-1 bg-surface4 rounded-lg",children:n}),l.jsx("div",{className:"pt-1",children:l.jsx(la,{tooltip:"Copy SSE URL",content:n})})]})]}),l.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[l.jsx(Et,{icon:l.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"CLI"}),children:"Command Line"}),l.jsx(ge,{className:"text-neutral3 pt-1 pb-2",children:"Use for local command-line access via npx and mcp-remote."}),l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(ge,{className:"px-2 py-1 bg-surface4 rounded-lg",children:a}),l.jsx("div",{className:"pt-1",children:l.jsx(la,{tooltip:"Copy Command Line Config",content:a})})]})]})]})]}),l.jsx("div",{className:"h-full overflow-y-scroll border-l border-border1",children:l.jsx(ers,{server:t})})]})},ers=({server:e})=>{const{data:t={},isLoading:n}=d4t(e);if(n)return null;const r=Object.keys(t);return l.jsxs("div",{className:"p-5 overflow-y-scroll",children:[l.jsxs("div",{className:"text-neutral6 flex gap-2 items-center",children:[l.jsx(Be,{size:"lg",className:"bg-surface4 rounded-md p-1",children:l.jsx(Pm,{})}),l.jsx(ge,{variant:"header-md",as:"h2",className:"font-medium",children:"Available Tools"})]}),l.jsx("div",{className:"flex flex-col gap-2 pt-6",children:r.map(s=>{const a=t[s];return l.jsx(nrs,{tool:a,serverId:e.id},s)})})]})};function trs(e){if(!e)return!1;const t=e.ui;return!!(typeof t?.resourceUri=="string"&&t.resourceUri.startsWith("ui://")||typeof e["ui/resourceUri"]=="string"&&e["ui/resourceUri"].startsWith("ui://"))}const nrs=({tool:e,serverId:t})=>{const n=y.useRef(null),{Link:r,paths:s}=an(),a=v3t[e.toolType||"tool"],i=trs(e._meta);return l.jsxs(hp,{onClick:()=>n.current?.click(),children:[l.jsx($wt,{children:l.jsx(a,{className:"group-hover/entity:text-accent6"})}),l.jsxs(vp,{children:[l.jsx(mp,{children:l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(r,{ref:n,href:s.mcpServerToolLink(t,e.id),children:e.id}),i&&l.jsx(Et,{className:"text-[10px] py-0",children:"App"})]})}),l.jsx(gp,{children:e.description})]})]})},rrs=()=>{const{serverId:e}=Mr(),{data:t=[],isLoading:n}=hH(),r=t.find(s=>s.id===e);return l.jsx("div",{className:"h-full w-full overflow-hidden",children:l.jsx(Jns,{isLoading:n,server:r})})};function srs(e){if(!e)return;const t=e.ui;if(t?.resourceUri)return t.resourceUri;const n=e["ui/resourceUri"];if(typeof n=="string")return n}const ars=({toolId:e,serverId:t})=>{const{canExecute:n}=qb(),r=n("tools"),s=Ze(),{data:a,isLoading:i,error:o}=U_e(t,e),{mutateAsync:c,isPending:u,data:d}=yFr(t,e),f=a?srs(a._meta):void 0,{data:p}=St({queryKey:["mcp-app-resource",t,f],queryFn:async()=>f?(await s.readMcpServerResource(t,f)).contents[0]?.text??null:null,enabled:!!f}),h=y.useCallback(async(v,b)=>await c(b),[c]);y.useEffect(()=>{if(o){const v=o instanceof Error?o.message:"Failed to load tool";Fe.error(`Error loading tool: ${v}`)}},[o]);const m=async v=>{if(a)return await c(v)};if(i)return l.jsxs("div",{className:"p-6",children:[l.jsx(rs,{className:"h-8 w-48 mb-4"}),l.jsx(rs,{className:"h-32 w-full"})]});if(o)return null;if(!a)return l.jsx("div",{className:"py-12 text-center px-6",children:l.jsx(ge,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})});if(!r)return l.jsx("div",{className:"py-12 text-center px-6",children:l.jsx(ge,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})});let g;try{g=bv(gv(a.inputSchema))}catch(v){console.error("Error processing input schema:",v),Fe.error("Failed to process tool input schema."),g=ds({})}return l.jsxs("div",{className:"flex flex-col gap-4",children:[p&&l.jsx("div",{className:"border-b border-border1 p-4",children:l.jsx(u4t,{html:p,toolName:a.name??a.id,onToolCall:h})}),l.jsx(xOe,{executionResult:d,isExecutingTool:u,zodInputSchema:g,handleExecuteTool:m,toolDescription:a.description||"",toolId:a.id})]})},irs=()=>{const{serverId:e,toolId:t}=Mr(),{data:n,isLoading:r}=U_e(e,t);return r||!n?null:l.jsx("div",{className:"h-full w-full overflow-y-auto",children:l.jsx(ars,{toolId:t,serverId:e})})},wXe={agents:ea.AGENT,workflows:ea.WORKFLOW_RUN,tools:ea.TOOL};function ors(){const{data:e,isLoading:t,isError:n}=Vrr(),{getTracesHref:r,getBucketTracesHref:s}=B$(),{Link:a}=an(),i=bu();return l.jsx(Rrr,{data:e,isLoading:t,isError:n,onPointClick:(o,c)=>{const u=new Date(String(c.rawTimestamp)).getTime();Number.isFinite(u)&&i(s({rootEntityType:wXe[o]},u,"1h"))},actions:o=>l.jsx(Nq,{href:r({rootEntityType:wXe[o]}),LinkComponent:a})})}function lrs(){const e=Qrr(),t=Yrr(),{getTracesHref:n}=B$(),{Link:r}=an();return l.jsx(Mrr,{threads:{data:e.data,isLoading:e.isLoading,isError:e.isError},resources:{data:t.data,isLoading:t.isLoading,isError:t.isError},LinkComponent:r,getThreadRowHref:s=>n({threadId:s.threadId,...s.resourceId?{resourceId:s.resourceId}:{}}),getResourceRowHref:s=>n({resourceId:s.resourceId})})}function crs(){const{data:e,isLoading:t,isError:n}=ASt();return l.jsx(L$,{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:n})}function urs(){const{data:e,isLoading:t,isError:n}=Brr();return l.jsx(L$,{label:"Total Model Cost",value:e?.cost!=null?Jy(e.cost,e.costUnit):null,prevValue:e?.previousCost!=null?Jy(e.previousCost,e.costUnit):void 0,changePct:e?.costChangePercent??null,isLoading:t,isError:n})}function drs(){const{data:e,isLoading:t,isError:n}=Urr();return l.jsx(L$,{label:"Total Tokens",value:e?.value!=null?su(e.value):null,prevValue:e?.previousValue!=null?su(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:n})}function frs(){const{data:e,isLoading:t,isError:n}=Wrr();return l.jsx(L$,{label:"Total Threads",value:e?.value!=null?su(e.value):null,prevValue:e?.previousValue!=null?su(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:n})}function prs(){const{data:e,isLoading:t,isError:n}=Grr();return l.jsx(L$,{label:"Total Resources",value:e?.value!=null?su(e.value):null,prevValue:e?.previousValue!=null?su(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:n})}function hrs({onClear:e,onRemoveAll:t,onSave:n,onRemoveSaved:r,isLoading:s,filterFields:a,filterTokens:i,onFilterTokensChange:o,autoFocusFilterFieldId:c}){const u=i.length>0,d=i.some(f=>mrs(f,a));return l.jsxs("div",{className:X("grid grid-cols-[1fr_auto] gap-3 items-start"),children:[l.jsx(V0e,{fields:a,tokens:i,onTokensChange:o,disabled:s,autoFocusFieldId:c}),u&&l.jsx(U0e,{disabled:s,onClear:d?e:void 0,onRemoveAll:t,onSave:n,onRemoveSaved:r})]})}function mrs(e,t){const n=t.find(r=>r.id===e.fieldId);return n?n.kind==="text"?typeof e.value=="string"&&e.value.trim()!=="":n.kind==="pick-multi"?n.multi?Array.isArray(e.value)&&e.value.length>0:typeof e.value=="string"&&e.value!==""&&e.value!=="Any":n.kind==="multi-select"?Array.isArray(e.value)&&e.value.length>0:!1:!1}function grs(){const{data:e,isLoading:t,isError:n}=qrr(),{getTracesHref:r}=B$(),{Link:s}=an();return l.jsx($rr,{rows:e,isLoading:t,isError:n,LinkComponent:s,getRowHref:()=>r({rootEntityType:ea.AGENT}),actions:l.jsx(Nq,{href:r({rootEntityType:ea.AGENT}),LinkComponent:s})})}function vrs(){const{data:e,isLoading:t,isError:n}=Zrr(),{getTracesHref:r}=B$(),{Link:s}=an();return l.jsx(Lrr,{data:e,isLoading:t,isError:n,LinkComponent:s,getRowHref:a=>r({rootEntityType:ea.AGENT,entityName:a.name}),actions:l.jsx(Nq,{href:r({rootEntityType:ea.AGENT}),LinkComponent:s})})}const B5={agents:ea.AGENT,workflows:ea.WORKFLOW_RUN,tools:ea.TOOL};function yrs(){const{data:e,isLoading:t,isError:n}=Hrr(),{getTracesHref:r,getLogsHref:s}=B$(),{Link:a}=an();return l.jsx(zrr,{data:e,isLoading:t,isError:n,LinkComponent:a,getRowHref:(i,o)=>r({rootEntityType:B5[i],entityName:o.name}),getErrorSegmentHref:(i,o)=>o.errors>0?s({rootEntityType:B5[i],entityName:o.name,status:"error"}):void 0,actions:i=>l.jsxs(l.Fragment,{children:[l.jsx(Nq,{href:r({rootEntityType:B5[i]}),LinkComponent:a}),l.jsx(Arr,{href:s({rootEntityType:B5[i],status:"error"}),LinkComponent:a})]})})}const brs=new Set(["ObservabilityStorageClickhouseVNext","ObservabilityStorageDuckDB","ObservabilityInMemory"]),tle="period";function xrs(){const[e,t]=fo(),n=e.get(tle),r=jSt(n)?n:"24h",s=y.useMemo(()=>wrr(e),[e.toString()]),a=y.useCallback(c=>{t(u=>{const d=new URLSearchParams(u);return c==="24h"?d.delete(tle):d.set(tle,c),d},{replace:!0})},[t]),i=y.useCallback(c=>{t(u=>{const d=new URLSearchParams(u);return krr(d,c),d},{replace:!0})},[t]),o=y.useRef(!1);return y.useEffect(()=>{if(o.current||(o.current=!0,brr(e)))return;const c=TSt();c&&t(u=>{const d=new URLSearchParams(u);for(const[f,p]of c)d.append(f,p);return d},{replace:!0})},[]),l.jsx(jrr,{preset:r,filterTokens:s,onPresetChange:a,onFilterTokensChange:i,children:l.jsx(wrs,{})})}function wrs(){const[e]=fo(),{error:t,isLoading:n}=ASt(),{filterTokens:r,setFilterTokens:s}=jq(),[a,i]=y.useState(),{data:o,isLoading:c}=wH(),u=o?.observabilityStorageType,d=u?brs.has(u):!1,f=u==="ObservabilityInMemory",{data:p,isLoading:h}=fwe(),{data:m,isLoading:g}=pwe(),{data:v,isLoading:b}=mwe(),{data:S,isLoading:w}=hwe(),_=y.useMemo(()=>xrr({availableTags:p??[],availableEntityNames:m??[],availableServiceNames:v??[],availableEnvironments:S??[],loading:{tags:h,entityNames:g,serviceNames:b,environments:w}}),[p,m,v,S,h,g,b,w]),[O,E]=y.useState(()=>TSt()!==null),T=y.useCallback(()=>{vrr(e),E(!0),Fe.success("Filters setting for Metrics saved")},[e]),j=y.useCallback(()=>{yrr(),E(!1),Fe.success("Filters setting for Metrics cleared up")},[]),N=y.useCallback(()=>{s([])},[s]),I=y.useCallback(()=>{const R=r.map(P=>{const U=_.find(M=>M.id===P.fieldId);return U?U.kind==="text"?{fieldId:P.fieldId,value:""}:U.kind==="pick-multi"?U.multi?{fieldId:P.fieldId,value:[]}:{fieldId:P.fieldId,value:"Any"}:U.kind==="multi-select"?{fieldId:P.fieldId,value:[]}:P:P});s(R)},[_,r,s]);return t&&zs(t)?l.jsx(ir,{children:l.jsx(ua,{})}):t&&Bs(t)?l.jsx(ir,{children:l.jsx(na,{resource:"metrics"})}):t?l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load metrics",message:t.message})}):l.jsxs(wn,{width:"wide",height:"full",children:[l.jsxs(wn.TopArea,{children:[l.jsx(wn.Row,{children:l.jsxs(wn.Column,{className:"flex flex-wrap items-start justify-start gap-2",children:[l.jsx(Nrr,{}),l.jsx(H0e,{fields:_,tokens:r,onTokensChange:s,disabled:n,onStartTextFilter:i})]})}),l.jsx(hrs,{isLoading:n,filterFields:_,filterTokens:r,onFilterTokensChange:s,onClear:I,onRemoveAll:N,onSave:T,onRemoveSaved:O?j:void 0,autoFocusFilterFieldId:a})]}),c?null:d?l.jsxs("div",{className:"grid gap-8 content-start pb-10",children:[f&&l.jsx(Hn,{variant:"info",title:"Metrics are not persisted",children:l.jsx(Hn.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."})}),l.jsxs(mfe,{children:[l.jsx(crs,{}),l.jsx(urs,{}),l.jsx(drs,{}),l.jsx(frs,{}),l.jsx(prs,{})]}),l.jsxs(mfe,{children:[l.jsx(grs,{}),l.jsx(vrs,{}),l.jsx(lrs,{}),l.jsx(yrs,{}),l.jsx(ors,{})]})]}):l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(oi,{iconSlot:l.jsx(Hd,{}),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:l.jsxs(de,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/observability/metrics/overview",target:"_blank",rel:"noopener noreferrer",children:["Metrics Documentation ",l.jsx(Da,{})]})})})]})}const Srs=[{title:"Metrics",description:"View system performance metrics, request latencies, and throughput across your agents and workflows.",icon:VZt,href:"/metrics"},{title:"Traces",description:"Explore distributed traces to debug and understand the execution flow of your AI operations.",icon:kc,href:"/observability"}];function krs(){return l.jsx($tr,{children:l.jsx("div",{className:"px-6 overflow-y-auto",children:l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:Srs.map(e=>l.jsxs(qi,{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:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),l.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),l.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})})}const _rs=[{title:"Agents",description:"Create and manage AI agents with tools, memory, and custom instructions.",icon:Go,href:"/agents"},{title:"Prompts",description:"Design and version reusable prompt templates for your agents.",icon:lu,href:"/prompts"},{title:"Workflows",description:"Build step-based execution flows with suspend, resume, and branching.",icon:Tc,href:"/workflows"},{title:"Processors",description:"Configure data processors for transforming and routing information.",icon:wC,href:"/processors"},{title:"MCP Servers",description:"Connect to Model Context Protocol servers for external tool access.",icon:Pm,href:"/mcps"},{title:"Tools",description:"Browse and test the tools available to your agents and workflows.",icon:Cc,href:"/tools"},{title:"Workspaces",description:"Organize your projects and resources into isolated workspaces.",icon:ZT,href:"/workspaces"},{title:"Request Context",description:"Inspect request-scoped context propagation for dynamic configuration.",icon:T7,href:"/request-context"}];function Ors(){return l.jsx(wn,{width:"narrow",children:l.jsx(wn.MainArea,{children:l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:_rs.map(e=>l.jsxs(qi,{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:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),l.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),l.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})})}function Ers(){const{paths:e}=an(),{data:t,isLoading:n,error:r}=_3t(),{isCmsAvailable:s}=ZD(),[a,i]=y.useState(""),o=t?.promptBlocks??[];return r&&zs(r)?l.jsx(ir,{children:l.jsx(ua,{})}):r&&Bs(r)?l.jsx(ir,{children:l.jsx(na,{resource:"prompt blocks"})}):r?l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load prompt blocks",message:r.message})}):o.length===0&&!n?l.jsx(ir,{children:l.jsx(aYr,{})}):l.jsxs(wn,{children:[l.jsx(wn.TopArea,{children:l.jsxs(wn.Row,{align:"center",stack:"responsive",children:[l.jsx("div",{className:"max-w-120 flex-1",children:l.jsx(Iv,{onSearch:i,label:"Filter prompts",placeholder:"Filter by name or description"})}),s&&l.jsxs(de,{as:qi,to:e.cmsPromptBlockCreateLink(),variant:"primary",className:"shrink-0",children:[l.jsx(Cs,{}),"Create Prompt"]})]})}),l.jsx(sYr,{promptBlocks:o,isLoading:n,search:a})]})}function Crs(){return l.jsx(wn,{width:"narrow",children:l.jsx(wn.MainArea,{children:l.jsx(lWr,{children:l.jsx(e3t,{})})})})}const Trs=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:WWt,href:"/swagger-ui",external:!1},{title:"Documentation",description:"Read the official Mastra documentation for guides, references, and tutorials.",icon:GJe,href:"https://mastra.ai/en/docs",external:!0},{title:"Github",description:"Browse the source code, report issues, and contribute to the Mastra project.",icon:Da,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:VR,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:set,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:LZt,href:"https://mastra.ai/contact?ref=studio",external:!0}];function jrs(){return l.jsx(wn,{width:"narrow",children:l.jsx(wn.MainArea,{children:l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:Trs.map(e=>l.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:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),l.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title}),e.external&&l.jsx(Da,{className:"h-3.5 w-3.5 text-icon3 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]}),l.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})})}function Nrs(){const{data:e={},isLoading:t,error:n}=Op(),[r,s]=y.useState(""),[a,i]=y.useState("all");if(n&&zs(n))return l.jsx(ir,{children:l.jsx(ua,{})});if(n&&Bs(n))return l.jsx(ir,{children:l.jsx(na,{resource:"scorers"})});if(n)return l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load scorers",message:n.message})});if(Object.keys(e).length===0&&!t)return l.jsx(ir,{children:l.jsx(OGr,{})});const o=a!=="all"||r!=="",c=()=>{s(""),i("all")};return l.jsxs(wn,{children:[l.jsx(wn.TopArea,{children:l.jsx(CGr,{search:r,onSearchChange:s,sourceFilter:a,onSourceFilterChange:i,onReset:c,hasActiveFilters:o})}),l.jsx(_Gr,{scorers:e,isLoading:t,search:r,sourceFilter:a})]})}function Ars(){const{scorerId:e}=Mr(),[t,n]=fo(),r=t.get("scoreId")??void 0,[s,a]=y.useState(r),[i,o]=y.useState({value:"all",label:"All Entities",type:"ALL"}),{scorer:c,error:u}=wGr(e),{data:d={},isLoading:f,error:p}=Lv(),{isLoading:h,error:m}=Bw(),{data:g=[],isLoading:v,error:b,isFetchingNextPage:S,hasNextPage:w,setEndOfListElement:_}=xGr({scorerId:e,entityId:i?.value==="all"?void 0:i?.value,entityType:i?.type==="ALL"?void 0:i?.type}),O=y.useMemo(()=>c?.agentIds?.filter(H=>d[H]).map(H=>({value:H,label:d[H].name,type:"AGENT"}))||[],[c?.agentIds,d]),E=y.useMemo(()=>c?.workflowIds?.map(H=>({value:H,label:H,type:"WORKFLOW"}))||[],[c?.workflowIds]),T=y.useMemo(()=>[{value:"all",label:"All Entities",type:"ALL"},...O,...E],[O,E]),j=t.get("entity")??"all",N=T.find(H=>H.value===j);N&&N.value!==i?.value&&o(N),y.useEffect(()=>{if(u){const H=u instanceof Error?u.message:"Failed to load scorer";Fe.error(`Error loading scorer: ${H}`)}},[u]),y.useEffect(()=>{if(p){const H=p instanceof Error?p.message:"Failed to load agents";Fe.error(`Error loading agents: ${H}`)}},[p]),y.useEffect(()=>{if(m){const H=m instanceof Error?m.message:"Failed to load workflows";Fe.error(`Error loading workflows: ${H}`)}},[m]);const I=H=>{H?.value&&n(D=>{const Y=new URLSearchParams(D);return Y.set("entity",H.value),Y})};y.useEffect(()=>{const H=t.get("scoreId")??void 0;if(H===s)return;if(!H){a(void 0);return}g.find(Y=>Y.id===H)&&a(H)},[t,g]);const R=y.useCallback(H=>{a(H||void 0),n(D=>{const Y=new URLSearchParams(D);return H?Y.set("scoreId",H):Y.delete("scoreId"),Y})},[n]);if(!c)return null;const P=zs(u)||zs(p)||zs(m),U=u&&Bs(u),M=!P&&!U&&(u||p||m),L=!v&&g.length===0,F=i?.value!=="all",z=c?.scorer?.source==="stored"?l.jsx(Pv,{owner:"scorer-detail",children:l.jsxs(de,{variant:"default",as:qi,to:`/cms/scorers/${e}/edit`,size:"sm",children:[l.jsx(Cb,{})," Edit"]})}):null;if(P||U||M||L&&!F){const H=(u instanceof Error?u.message:void 0)??(p instanceof Error?p.message:void 0)??(m instanceof Error?m.message:void 0)??"An unexpected error occurred";return l.jsxs(wn,{width:"wide",height:"full",children:[z,l.jsx(wn.MainArea,{isCentered:!0,children:P?l.jsx(ua,{}):U?l.jsx(na,{resource:"scorers"}):M?l.jsx(Jl,{title:"Failed to load scorer",message:H}):l.jsx(pGr,{})})]})}return l.jsxs(wn,{width:"wide",children:[z,l.jsx(wn.TopArea,{children:l.jsx(gGr,{selectedEntity:i,entityOptions:T,onEntityChange:I,onReset:()=>{n(H=>{const D=new URLSearchParams(H);return D.set("entity","all"),D})},isLoading:v||f||h})}),l.jsx(fGr,{scores:g,isLoading:v,selectedScoreId:s,isFetchingNextPage:S,hasNextPage:w,setEndOfListElement:_,onScoreClick:R,errorMsg:b?.message})]})}const NLt=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],Irs=e=>NLt.some(t=>t.value===e),Rrs=()=>{const{baseUrl:e,headers:t,apiPrefix:n}=cOe(),{theme:r,setTheme:s}=$j();return l.jsx(wn,{width:"narrow",children:l.jsxs(wn.MainArea,{className:"flex flex-col gap-5 mt-6",children:[l.jsx(D5e,{title:"Theme",description:"Customize the appearance of the studio.",children:l.jsx(XJn,{label:"Theme mode",htmlFor:"theme",children:l.jsxs(Ii,{value:r,onValueChange:a=>{Irs(a)&&s(a)},children:[l.jsx(wi,{id:"theme",className:"w-full sm:w-48",children:l.jsx(Ri,{})}),l.jsx(Si,{children:NLt.map(a=>l.jsx(vs,{value:a.value,children:a.label},a.value))})]})})}),l.jsx(D5e,{title:"Mastra Connection",description:"Configure the Mastra instance URL, API prefix, and request headers used by the studio.",children:l.jsx(r3t,{initialConfig:{baseUrl:e,headers:t,apiPrefix:n}})})]})})};function Prs(){const[e]=fo(),t=bu(),n=e.get("redirect")||"/",r=()=>{n.startsWith("http")?window.location.href=n:t(n,{replace:!0})};return l.jsx(jLt,{redirectUri:n,onSuccess:r,initialMode:"signup"})}function Mrs(e){return e.replace(/\/$/,"").split("/").pop()}function RH({children:e,className:t}){return l.jsx("div",{className:X("border border-border1 rounded-lg mt-12 py-8 lg:min-h-[25rem] transition-height px-4 lg:px-12",t),children:e})}function $rs({templates:e,linkComponent:t,className:n,isLoading:r}){const s=t||"a";return r?l.jsx("div",{className:X("grid gap-y-4",n),children:Array.from({length:5}).map((a,i)=>l.jsx("div",{className:"h-16 bg-surface3 animate-pulse rounded-lg"},i))}):l.jsx("div",{className:X("grid gap-y-4",n),children:e.map(a=>{const i=a?.agents||a?.tools||a?.networks||a?.workflows||a?.mcp;return l.jsxs("article",{className:X("border border-border1 rounded-lg overflow-hidden w-full grid grid-cols-[1fr_auto] bg-surface3 transition-colors hover:bg-surface4"),children:[l.jsxs(s,{to:`/templates/${a.slug}`,className:X("grid [&:hover_p]:text-neutral5",{"grid-cols-[8rem_1fr] lg:grid-cols-[12rem_1fr]":a.imageURL}),children:[a.imageURL&&l.jsx("div",{className:X("overflow-hidden"),children:l.jsx("div",{className:"w-full h-full bg-cover thumb transition-scale duration-150",style:{backgroundImage:`url(${a.imageURL})`}})}),l.jsxs("div",{className:X("grid py-3 px-6 w-full gap-0.5","[&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:text-neutral3"),children:[l.jsx("h2",{className:"text-ui-lg text-neutral5",children:a.title}),l.jsx("p",{className:"text-ui-md text-neutral4 transition-colors duration-500",children:a.description}),l.jsxs("div",{className:"hidden 2xl:flex text-neutral3 text-ui-md flex-wrap items-center gap-4 mt-3",children:[i&&l.jsxs("ul",{className:X("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&&l.jsxs("li",{children:[l.jsx(Go,{})," ",a.agents.length]}),a?.tools&&a.tools.length>0&&l.jsxs("li",{children:[l.jsx(Cc,{})," ",a.tools.length]}),a?.networks&&a.networks.length>0&&l.jsxs("li",{children:[l.jsx(het,{})," ",a.networks.length]}),a?.workflows&&a.workflows.length>0&&l.jsxs("li",{children:[l.jsx(A7,{})," ",a.workflows.length]}),a?.mcp&&a.mcp.length>0&&l.jsxs("li",{children:[l.jsx(Pm,{})," ",a.mcp.length]})]}),i&&a.supportedProviders&&l.jsx("small",{children:"|"}),l.jsx("div",{className:"flex items-center text-neutral3 gap-4",children:a.supportedProviders.map(o=>l.jsx("span",{className:"",children:o},o))})]})]})]}),l.jsx("a",{href:a.githubUrl,className:X("group items-center gap-2 text-ui-md ml-auto pr-4 hidden","lg:flex"),target:"_blank",rel:"noopener noreferrer",children:l.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:[l.jsx(jwt,{})," ",Mrs(a.githubUrl)]})})]},a.slug)})})}function Drs({tagOptions:e,selectedTag:t,providerOptions:n,selectedProvider:r,onTagChange:s,onProviderChange:a,searchTerm:i,onSearchChange:o,onReset:c,className:u,isLoading:d}){return d?l.jsxs("div",{className:X("h-[6.5rem] flex items-center gap-8","[&>div]:bg-surface3 [&>div]:w-48 [&>div]:h-8 [&>div]:animate-pulse",u),children:[l.jsx("div",{})," ",l.jsx("div",{})," ",l.jsx("div",{})]}):l.jsxs("div",{className:X("flex flex-wrap mx-auto sticky top-0 gap-4 bg-surface2 py-8",u),children:[l.jsx(rw,{name:"search-templates",label:"Search templates",labelIsHidden:!0,value:i,onChange:f=>o?.(f.target.value),placeholder:"Search Template"}),l.jsx(Yl,{label:"Filter by tag",labelIsHidden:!0,name:"filter-tag",value:t,onValueChange:s,options:e}),l.jsx(Yl,{label:"Filter by provider",labelIsHidden:!0,name:"filter-provider",value:r,onValueChange:a,options:n}),c&&l.jsxs(de,{onClick:c,children:["Reset ",l.jsx(Pr,{})]})]})}function Lrs(){const{data:e,isLoading:t}=tir(),{templates:n,tags:r,providers:s}=e??{templates:[],tags:[],providers:[]},[a,i]=y.useState("all"),[o,c]=y.useState("all"),[u,d]=y.useState(""),f=[{value:"all",label:"Any tag"}];(r||[]).forEach(S=>{f.push({value:S,label:S})});const p=[{value:"all",label:"Any provider"}];(s||[]).forEach(S=>{p.push({value:S,label:S})});const h=(S,w)=>{w==="tag"?i(S):w==="provider"&&c(S)},m=S=>{d(S)},g=()=>{i("all"),c("all"),d("")},v=n.filter(S=>!(u&&!S.title.toLowerCase().includes(u)&&!S.description.toLowerCase().includes(u)||a!=="all"&&!S.tags.includes(a)||o!=="all"&&!S.supportedProviders.includes(o))),b=u||a!=="all"||o!=="all";return l.jsxs(fr,{children:[l.jsx(L0e,{children:l.jsxs(Dwt,{children:[l.jsx(Be,{children:l.jsx(_S,{})}),"Templates"]})}),l.jsxs("div",{className:X("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[l.jsx(Drs,{selectedTag:a,onTagChange:S=>h(S,"tag"),tagOptions:f,selectedProvider:o,onProviderChange:S=>h(S,"provider"),providerOptions:p,searchTerm:u,onSearchChange:m,onReset:b?g:void 0,className:"max-w-[80rem]",isLoading:t}),l.jsx($rs,{templates:v,linkComponent:qi,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const zrs="1.36.0-alpha.5";function Frs({errorMsg:e,validationErrors:t}){const n=typeof e=="string"?e:e!=null?String(e):void 0,r=n?.includes("Invalid schema for function"),s=n?.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.":r?"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:l.jsx(Vy,{className:"text-yellow-500"}),title:"Template Installed with Warnings"}:{icon:l.jsx(xGt,{}),title:"Template Installation Failed"},{icon:o,title:c}=i();return l.jsxs(RH,{className:"space-y-4 text-neutral3 mb-8 content-center",children:[l.jsxs("div",{className:X("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[o,l.jsxs("div",{className:"text-center space-y-2",children:[l.jsx("p",{className:"text-ui-md font-medium text-neutral5",children:c}),l.jsx("p",{className:"text-ui-md text-neutral3",children:a()})]})]}),t&&t.length>0&&l.jsxs("details",{className:"text-xs",children:[l.jsxs("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:["Show Validation Issues (",t.length,")"]}),l.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)=>l.jsxs("div",{className:"border-l-2 border-red-400 pl-2",children:[l.jsx("div",{className:"font-medium text-red-600 dark:text-red-400",children:u.type==="typescript"?"🔴 TypeScript Error":"⚠️ Lint Error"}),l.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))})]}),n&&!s&&l.jsxs("details",{className:"text-xs",children:[l.jsx("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:"Show Details"}),l.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:l.jsx("div",{className:"whitespace-pre-wrap wrap-break-word",children:n})})]})]})}function Brs({providerOptions:e,selectedProvider:t,onProviderChange:n,variables:r,errors:s,handleInstallTemplate:a,handleVariableChange:i,isLoadingEnvVars:o,isInstalling:c,defaultModelProvider:u,defaultModelId:d,onModelUpdate:f}){return l.jsx(RH,{children:l.jsxs("div",{className:"max-w-[40rem] my-4 p-4 lg:p-8 mx-auto gap-8 grid",children:[l.jsxs("h2",{className:X("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 ",l.jsx(met,{})]}),l.jsx(Yl,{name:"template-provider",options:e,label:"Template AI Model Provider",onValueChange:n,value:t,placeholder:"Select",layout:"horizontal"}),t&&Object.entries(r||{}).length>0&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-neutral3 text-ui-md",children:"Set required Environmental Variables"}),l.jsx("div",{className:"grid grid-cols-[1fr_1fr] gap-4 items-start",children:o?l.jsxs("div",{className:X("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:[l.jsx(Qt,{})," Loading variables..."]}):Object.entries(r).map(([p,h])=>l.jsxs(y.Fragment,{children:[l.jsx(Ok,{name:`env-${p}`,labelIsHidden:!0,label:"Key",value:p,disabled:!0,className:"w-full"}),l.jsx(Ok,{name:p,labelIsHidden:!0,label:"Value",value:h,onChange:i,errorMsg:s.includes(p)?"Value is required.":"",autoComplete:"off",className:"w-full"})]},p))}),l.jsxs("div",{className:"border-t border-border1 pt-12 mt-3.5 relative",children:[l.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"}),l.jsx("h3",{className:"text-neutral4 text-ui-lg",children:"Set AI Model for Template Installation"}),l.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"}),l.jsx(t3t,{defaultProvider:u||"",defaultModel:d||"",updateModel:f||(()=>Promise.resolve({message:"Updated"})),closeEditor:()=>{},autoSave:!0,selectProviderPlaceholder:"Provider"})]})]}),t&&!o&&l.jsx(de,{className:X("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?l.jsxs(l.Fragment,{children:[l.jsx(Qt,{className:"w-4 h-4"})," Installing..."]}):l.jsxs(l.Fragment,{children:["Install ",l.jsx(kS,{})]})})]})})}function Urs({title:e,description:t,githubUrl:n,isLoading:r,infoData:s,templateSlug:a}){const i=a?`feat/install-template-${a}`:"feat/install-template-[slug]";return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:X("grid mt-8 items-center"),children:l.jsxs("div",{className:X("text-header-lg flex items-center gap-3","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50",{"[&>svg]:opacity-20":r}),children:[l.jsx(_S,{}),l.jsx("h2",{className:X({"bg-surface4 flex rounded-lg min-w-[50%]":r}),children:r?l.jsx(l.Fragment,{children:" "}):e})]})}),l.jsxs("div",{className:"grid lg:grid-cols-[1fr_1fr] gap-x-24",children:[l.jsxs("div",{className:"grid",children:[l.jsx("p",{className:X("mb-4 text-ui-md text-neutral4 mt-2 leading-7",{"bg-surface4 rounded-lg ":r}),children:r?l.jsx(l.Fragment,{children:" "}):t}),!r&&a&&l.jsxs("div",{className:X("bg-surface2 border border-surface4 rounded-lg p-4 mb-4","flex items-start gap-3"),children:[l.jsx("div",{className:"shrink-0 mt-0.5",children:l.jsx(_w,{className:"w-[1.1em] h-[1.1em] text-blue-500"})}),l.jsxs("div",{className:"flex-1 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(C7,{className:"w-[1em] h-[1em] text-neutral4"}),l.jsx("span",{className:"text-ui-md font-medium text-neutral5",children:"A new Git branch will be created"})]}),l.jsxs("div",{className:"text-ui-sm text-neutral4 space-y-1",children:[l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:"Branch name:"})," ",l.jsx("code",{className:"bg-surface3 px-1.5 py-0.5 rounded text-ui-sm font-mono",children:i})]}),l.jsx("div",{children:"This ensures safe installation with easy rollback if needed. Your main branch remains unchanged."})]})]})]}),n&&l.jsxs("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 mt-auto text-neutral3 text-ui-md hover:text-neutral5",children:[l.jsx(jwt,{}),n?.split("/")?.pop()]})]}),s&&l.jsx(g_,{data:s,labelsAreHidden:!0,isLoading:r})]})]})}function qrs({name:e,streamResult:t,workflowInfo:n}){const r=t?.phase||"initializing",s=t?.payload?.workflowState,a=t?.payload?.currentStep,i=t?.error,o=s?.steps||{},c=Object.keys(o).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:n?.allSteps?m in n.allSteps:!0,d=Object.entries(o).filter(([m,g])=>u(m)),f=d.length,p=()=>{switch(r){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..."}},h=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 l.jsxs(RH,{className:"space-y-6 text-neutral3 mb-8 content-center",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h3",{className:"text-lg font-semibold text-neutral5",children:p()}),t?.runId&&l.jsxs("div",{className:"mt-2 text-ui-sm text-neutral3",children:["Run ID: ",t.runId]})]}),c&&f>0&&!["error"].includes(r)&&l.jsx("div",{className:"max-w-[30rem] w-full mx-auto px-6",children:l.jsx(der,{steps:h})}),i&&r==="error"&&l.jsxs("div",{className:X("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:[l.jsx(uQt,{}),i||"Something went wrong"]}),c&&l.jsx(uer,{steps:h,currentStep:a,className:"pb-4"}),!c&&r==="initializing"&&l.jsxs("div",{className:"text-center text-sm text-neutral3 grid gap-4 justify-items-center",children:[l.jsx(Qt,{}),l.jsx("p",{children:"This may take some time..."})]})]})}function Vrs({name:e,installedEntities:t}){return l.jsxs(RH,{className:X("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[l.jsx(met,{}),l.jsx("h2",{className:"text-header-md",children:"Done!"}),l.jsxs("p",{className:"text-ui-md text-center text-neutral3 ",children:["The ",l.jsx("b",{className:"text-neutral4",children:e})," template has been successfully installed.",t&&t.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("br",{})," Installed entities are listed below."]})]}),t&&t.length>0&&l.jsx(g_,{data:t})]})}function Hrs(){const{templateSlug:e}=Mr(),[t,n]=fo(),[r,s]=y.useState(""),[a,i]=y.useState(""),[o,c]=y.useState(""),[u,d]=y.useState({}),[f,p]=y.useState([]),[h,m]=y.useState(null),[g,v]=y.useState(!1),[b,S]=y.useState(""),[w,_]=y.useState(!1),[O,E]=y.useState(!1),[T,j]=y.useState([]),{data:N,isLoading:I}=nir({repoOrSlug:e,owner:"mastra-ai"}),P=zrs?.includes("beta")??!1?"beta":"main",{data:U,isLoading:M}=rir({repo:N?.githubUrl?new URL(N.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:P}),{data:L,isLoading:F}=sir(),{mutateAsync:z,isPending:q}=air(),{mutateAsync:H}=iir(),{streamInstall:D,streamResult:Y,isStreaming:V}=lir(L),{observeInstall:$,streamResult:W,isStreaming:G}=cir(L);y.useEffect(()=>{const ne=t.get("runId");ne&&!g&&!h&&!V&&!G&&(console.info("🔄 Checking completed run after hot reload:",{runId:ne}),S(ne),H({runId:ne}).then(oe=>{const me=oe.snapshot;if(me?.status==="success"&&me?.result?.success)v(!0);else if(me?.result?.success===!1)if(me?.result?.validationResults&&!me?.result?.validationResults?.valid&&me?.result?.validationResults?.remainingErrors>0){const{remainingErrors:be,errors:Ce}=me.result.validationResults,je=`Template installation completed but ${be} validation issue${be>1?"s":""} remain unresolved.`;m(je),j(Ce||[])}else{const be=me?.result?.message||me?.result?.error||"Template installation failed";m(typeof be=="string"?be:String(be))}}).catch(oe=>{console.error("❌ Failed to fetch run details:",oe),m("Failed to retrieve installation status after reload")}))},[t,g,h,V,G,H]),y.useEffect(()=>{const ne=t.get("runId"),oe=t.get("resume"),me=t.get("provider");if(ne&&oe==="true"&&me&&!V&&!G&&!w&&!O&&L){S(ne),_(!0);try{H({runId:ne}).then(ce=>{if(ce.snapshot?.status==="running")return $.mutateAsync({runId:ne})}).then(()=>{n(ce=>{const be=new URLSearchParams(ce);return be.delete("resume"),be})}).catch(ce=>{console.error("❌ Failed to resume template installation:",ce),ce.message?.includes("404")||ce.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(ce){console.error("❌ Auto-resume failed with error:",ce),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,V,G,w,O,L,H,$,n]);const K=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],re=[{key:"tools",label:"Tools",value:N?.tools?.length?N.tools.map(ne=>ne).join(", "):"n/a",icon:l.jsx(Cc,{})},{key:"agents",label:"Agents",value:N?.agents?.length?N.agents.map(ne=>ne).join(", "):"n/a",icon:l.jsx(Go,{})},{key:"workflows",label:"Workflows",value:N?.workflows?.length?N.workflows.map(ne=>ne).join(", "):"n/a",icon:l.jsx(A7,{})},{key:"providers",label:"Providers",value:N?.supportedProviders?.length?N.supportedProviders.join(", "):"n/a",icon:l.jsx(Mg,{})},{key:"tags",label:"Tags",value:N?.tags?.length?N.tags.join(", "):"n/a",icon:l.jsx(QT,{})}],J=[{...re[0]},{...re[1]},{...re[2]}].filter(ne=>ne.value!=="n/a");y.useEffect(()=>{U&&d(U)},[U]),y.useEffect(()=>{const ne=Y||W;ne?.phase==="error"&&ne?.error&&m(typeof ne.error=="string"?ne.error:String(ne.error))},[Y?.phase,Y?.error,W?.phase,W?.error]);const ee=ne=>{s(ne)},se=async ne=>(i(ne.provider),c(ne.modelId),{message:"Model updated successfully"}),ie=async()=>{const ne=Object.entries(u).reduce((oe,[me,ce])=>(ce===""&&oe.push(me),oe),[]);if(ne.length>0){p(ne);return}if(N){m(null),v(!1),S(""),E(!0);try{const me={repo:N.githubUrl||`https://github.com/mastra-ai/template-${N.slug}`,ref:P,slug:N.slug,variables:u},{runId:ce}=await z({});S(ce),n(be=>{const Ce=new URLSearchParams(be);return Ce.set("runId",ce),Ce.set("resume","true"),Ce.set("provider",r||"openai"),Ce}),await D.mutateAsync({inputData:me,selectedModel:{provider:a,modelId:o},runId:ce})}catch(oe){E(!1),m(oe?.message||"Template installation failed"),console.error("Template installation failed",oe)}}},Q=ne=>{const{name:oe,value:me}=ne.target;me.trim()===""?p(ce=>[...ce,oe]):p(ce=>ce.filter(be=>be!==oe)),d(ce=>({...ce,[oe]:me}))};return l.jsx(fr,{children:l.jsx("div",{className:X("w-full lg:px-12 h-full overflow-y-scroll"),children:l.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[l.jsx(Urs,{isLoading:I,title:N?.title,description:N?.longDescription,imageURL:N?.imageURL,githubUrl:N?.githubUrl,infoData:re,templateSlug:e}),N&&l.jsxs(l.Fragment,{children:[(V||G)&&l.jsx(qrs,{name:N.title,streamResult:G?W:Y,runId:b,workflowInfo:L}),g&&l.jsx(Vrs,{name:N.title,installedEntities:J,linkComponent:qi}),h&&l.jsx(Frs,{errorMsg:h,validationErrors:T.length>0?T:Y?.validationResults?.errors||W?.validationResults?.errors}),!V&&!G&&!g&&!h&&l.jsx(Brs,{providerOptions:K,selectedProvider:r,onProviderChange:ee,variables:u,setVariables:d,errors:f,setErrors:p,handleInstallTemplate:ie,handleVariableChange:Q,isLoadingEnvVars:M||F,isInstalling:q,defaultModelProvider:a,defaultModelId:o,onModelUpdate:se})]})]})})})}const Zrs=()=>{const{toolId:e,agentId:t}=Mr();return l.jsx("div",{className:"h-full w-full overflow-y-auto",children:l.jsx(eQr,{toolId:e,agentId:t})})},Wrs=()=>{const{toolId:e}=Mr();return l.jsx("div",{className:"h-full w-full overflow-y-hidden",children:l.jsx(Xns,{toolId:e})})};function Grs(){const{traceId:e}=Mr(),[t,n]=fo(),r=bu(),s=t.get("spanId")||void 0,a=t.get("tab"),i=a==="scoring"?"scoring":a==="feedback"?"feedback":"details",o=t.get("scoreId")||void 0,[c,u]=y.useState(s??null),[d,f]=y.useState(),[p,h]=y.useState(i),[m,g]=y.useState(0),[v,b]=y.useState(!1),{data:S,isLoading:w,error:_}=dwe(e),O=y.useMemo(()=>S?.spans??[],[S?.spans]),E=y.useMemo(()=>O.find(se=>se.parentSpanId==null),[O]),{data:T,isLoading:j}=Ck(e,c??"");y.useEffect(()=>g(0),[e,c]);const{data:N,isLoading:I}=Op(),{data:R,isLoading:P}=yOe({traceId:e,spanId:c??void 0,page:m}),[U,M]=y.useState(0);y.useEffect(()=>M(0),[e,c]);const{data:L,isLoading:F}=gLt({traceId:e,page:U});y.useEffect(()=>{if(o&&R?.scores&&!d){const se=R.scores.find(ie=>ie.id===o);se&&f(se)}},[o,R?.scores,d]);const z=y.useCallback(se=>{const ie=new URLSearchParams(t);for(const[Q,ne]of Object.entries(se))ne===null||ne===""?ie.delete(Q):ie.set(Q,ne);n(ie,{replace:!0})},[t,n]),q=y.useCallback(se=>{const ie=se??null,Q=ie===c;u(ie),Q||(f(void 0),h("details"),z({spanId:ie,tab:null,scoreId:null}))},[c,z]),H=y.useCallback(()=>{u(null),f(void 0),h("details"),z({spanId:null,tab:null,scoreId:null})},[z]),D=y.useCallback(se=>{u(se),f(void 0),h("details"),z({spanId:se,tab:null,scoreId:null})},[z]),{handlePreviousSpan:Y,handleNextSpan:V}=qSt(O,c,D),$=y.useCallback(se=>{const ie=se;h(ie),f(void 0),z({tab:ie==="details"?null:ie,scoreId:null})},[z]),W=y.useCallback(se=>{f(se),z({scoreId:se.id})},[z]),G=y.useCallback(()=>{f(void 0),z({scoreId:null})},[z]),K=y.useCallback(()=>{r("/observability")},[r]),re=y.useCallback(()=>{h("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]),J=E?l.jsx(Pv,{owner:"trace-detail",children:l.jsxs(Nr,{children:[l.jsxs(de,{tooltip:"Evaluate Trace","aria-label":"Evaluate Trace",onClick:re,children:[l.jsx(bz,{}),"Evaluate"]}),l.jsxs(de,{tooltip:"Save as Dataset Item","aria-label":"Save as Dataset Item",onClick:()=>b(!0),children:[l.jsx(uu,{}),"Save"]})]})}):null,ee=E?l.jsx(wn.Row,{children:l.jsx(wn.Column,{children:l.jsx(DSt,{rootSpan:E,numOfCol:3})})}):null;return _?l.jsxs(wn,{height:"full",children:[J,ee&&l.jsx(wn.TopArea,{children:ee}),l.jsx(wn.MainArea,{isCentered:!0,children:l.jsx(USt,{error:_,resource:"traces",errorTitle:"Failed to load trace"})})]}):l.jsxs(wn,{children:[J,ee&&l.jsx(wn.TopArea,{children:ee}),l.jsx(TOe,{rootSpanId:E?.spanId,traceId:e,isOpen:v,onClose:()=>b(!1)}),l.jsxs("div",{className:X("grid h-full min-h-0 gap-4 overflow-hidden items-start mt-4",c?"grid-cols-[2fr_3fr]":"grid-cols-[1fr]"),children:[l.jsx(FSt,{traceId:e,spans:O,isLoading:w,onClose:K,onSpanSelect:q,onEvaluateTrace:re,initialSpanId:c,placement:"trace-page",timelineChartWidth:c?"default":"wide"}),c&&!w&&l.jsxs("div",{className:X("grid gap-4 max-h-full min-h-0 overflow-auto",d?"grid-rows-[1fr_1fr]":"grid-rows-[1fr]"),children:[l.jsx(BSt,{traceId:e,spanId:c,span:T?.span,isLoading:j,onClose:H,onPrevious:Y,onNext:V,activeTab:p,onTabChange:$,feedbackTabBadge:L?.pagination?.total??void 0,feedbackTabSlot:()=>l.jsx(hLt,{feedbackData:L,onPageChange:M,isLoadingFeedbackData:F}),scoringTabBadge:R?.pagination?.total??void 0,scoringTabSlot:({span:se,traceId:ie,spanId:Q})=>l.jsxs("div",{className:"grid gap-6",children:[l.jsx(COe,{traceId:ie,isTopLevelSpan:!se.parentSpanId,spanId:Q,entityType:se.attributes?.agentId||se.entityType===ea.AGENT?"Agent":se.attributes?.workflowId||se.entityType===ea.WORKFLOW_RUN?"Workflow":void 0,scorers:N,isLoadingScorers:I}),l.jsx(mLt,{scoresData:R,onPageChange:g,isLoadingScoresData:P,onScoreSelect:W})]})}),d&&l.jsx(gOe,{score:d,onClose:G})]})]})]})}function Qrs(){const{data:e,isLoading:t,error:n}=Bw(),[r,s]=y.useState("");return n&&zs(n)?l.jsx(ir,{children:l.jsx(ua,{})}):n&&Bs(n)?l.jsx(ir,{children:l.jsx(na,{resource:"workflows"})}):n?l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load workflows",message:n.message})}):Object.keys(e||{}).length===0&&!t?l.jsx(ir,{children:l.jsx(g2r,{})}):l.jsxs(wn,{children:[l.jsx(wn.TopArea,{children:l.jsxs(wn.Row,{align:"center",stack:"responsive",children:[l.jsx("div",{className:"max-w-120 flex-1",children:l.jsx(Iv,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})}),l.jsxs(de,{as:qi,to:"/workflows/schedules",variant:"primary",className:"shrink-0",children:[l.jsx(xM,{}),"Schedules"]})]})}),l.jsx(m2r,{workflows:e||{},isLoading:t,search:r})]})}const Yrs={active:"bg-accent1",paused:"bg-accent3"},Xrs={active:"text-accent1",paused:"text-accent3"},ALt=({status:e})=>l.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[l.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${Yrs[e]}`,"aria-hidden":!0}),l.jsx("span",{className:`text-ui-sm ${Xrs[e]}`,children:e})]}),pC=e=>!e||e<=0?"—":new Date(e).toLocaleString(),CR=e=>{if(!e||e<=0)return"—";const t=e-Date.now(),n=Math.abs(t),r=Math.floor(n/1e3);if(r<60)return t>=0?`in ${r}s`:`${r}s ago`;const s=Math.floor(r/60);if(s<60)return t>=0?`in ${s}m`:`${s}m ago`;const a=Math.floor(s/60);if(a<24)return t>=0?`in ${a}h`:`${a}h ago`;const i=Math.floor(a/24);return t>=0?`in ${i}d`:`${i}d ago`};function ILt({status:e}){const{icon:t,color:n}=Krs(e);return l.jsxs("span",{className:`inline-flex items-center gap-1.5 whitespace-nowrap text-ui-sm ${n}`,children:[l.jsx("span",{className:"inline-flex shrink-0 items-center","aria-hidden":!0,children:t}),l.jsx("span",{children:e})]})}function Krs(e){switch(e){case"success":return{icon:l.jsx(Ka,{size:14}),color:"text-accent1"};case"failed":return{icon:l.jsx(Pr,{size:14}),color:"text-accent2"};case"running":return{icon:l.jsx(Qt,{}),color:"text-neutral3"};case"suspended":return{icon:l.jsx(wme,{size:14}),color:"text-accent3"};case"canceled":return{icon:l.jsx(Hd,{size:14}),color:"text-neutral3"};case"pending":case"waiting":return{icon:l.jsx(Qk,{size:14}),color:"text-neutral3"};default:return{icon:null,color:"text-neutral3"}}}const SXe="auto auto auto auto 1fr";function Jrs(e){if(e===void 0)return"—";if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return`${t}m ${n}s`}function ess(e){const t=Math.abs(e),n=e<0?"-":"";return t<1e3?`${n}${t}ms`:t<6e4?`${n}${(t/1e3).toFixed(1)}s`:t<36e5?`${n}${(t/6e4).toFixed(1)}m`:`${n}${(t/36e5).toFixed(1)}h`}const tss=3e4,nss=5*6e4;function rss({triggers:e,isLoading:t,workflowId:n,hasNextPage:r,isFetchingNextPage:s,setEndOfListElement:a}){const{Link:i,paths:o}=an();return t?l.jsx(Dd,{columns:SXe}):e.length===0?l.jsx(ge,{variant:"ui-md",className:"text-neutral4 p-4",children:"No trigger history yet."}):l.jsxs(we,{columns:SXe,children:[l.jsxs(we.Top,{children:[l.jsx(we.TopCell,{children:"Run"}),l.jsx(we.TopCell,{children:"Status"}),l.jsx(we.TopCell,{children:"Started"}),l.jsx(we.TopCell,{children:"Duration"}),l.jsx(we.TopCell,{children:" "})]}),e.map(c=>{const u=c.actualFireAt-c.scheduledFireAt,d=ess(u),f=`Scheduled ${pC(c.scheduledFireAt)} — published ${pC(c.actualFireAt)} (drift ${d})`,p=c.outcome==="failed",h=p?c.error:c.run?.error,m=Math.abs(u),g=!p&&m>tss&&m<=nss,v=`${c.scheduleId}-${c.runId}-${c.actualFireAt}`,b=l.jsx("span",{className:n&&!p?"text-accent1 font-mono text-ui-sm whitespace-nowrap":"text-neutral3 font-mono text-ui-sm whitespace-nowrap",children:c.runId}),S=l.jsxs(l.Fragment,{children:[l.jsx(we.NameCell,{children:b}),l.jsx(we.TextCell,{children:l.jsxs("span",{className:"inline-flex items-center gap-2",children:[p?l.jsxs("span",{className:"inline-flex items-center gap-1.5 whitespace-nowrap text-ui-sm text-accent2",children:[l.jsx(Vy,{size:14}),"publish failed"]}):c.run?l.jsx(ILt,{status:c.run.status}):l.jsx("span",{className:"inline-flex items-center gap-1.5 whitespace-nowrap text-ui-sm text-neutral3",children:"pending"}),h?l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx("span",{className:"text-accent2 inline-flex",children:l.jsx(Vy,{size:14})})}),l.jsx(Yn,{children:h})]}):null]})}),l.jsx(we.TextCell,{children:l.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[l.jsx("span",{title:f,children:CR(c.actualFireAt)}),g?l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx("span",{className:"text-accent3 inline-flex",children:l.jsx(Vy,{size:14})})}),l.jsxs(Yn,{children:["Published ",d," after the scheduled fire time"]})]}):null]})}),l.jsx(we.TextCell,{children:c.run?l.jsx("span",{children:Jrs(c.run.durationMs)}):l.jsx("span",{className:"text-neutral4",children:"—"})}),l.jsx(we.TextCell,{children:" "})]});return n&&c.run&&!p?l.jsx(we.RowLink,{to:o.workflowRunLink(n,c.runId),LinkComponent:i,children:S},v):l.jsx(we.Row,{children:S},v)}),a?l.jsxs("div",{ref:a,className:"h-1 col-span-full",children:[s?l.jsx("div",{className:"flex justify-center py-4",children:l.jsx(Qt,{})}):null,!r&&e.length>0?l.jsx(ge,{variant:"ui-xs",className:"text-neutral4 text-center py-4 block",children:"All triggers loaded"}):null]}):null]})}const sss=e=>{const t=Ze();return St({queryKey:["schedule",e],enabled:!!e,queryFn:async()=>{if(!e)throw new Error("scheduleId is required");return t.getSchedule(e)}})},kXe=25,ass=e=>{const t=Ze(),{inView:n,setRef:r}=y_(),s=Lw({queryKey:["schedule-triggers",e],enabled:!!e,initialPageParam:void 0,queryFn:async({pageParam:u})=>e?t.listScheduleTriggers(e,{limit:kXe,toActualFireAt:u}):{triggers:[]},getNextPageParam:u=>{if(!(!u?.triggers?.length||u.triggers.length<kXe))return u.triggers[u.triggers.length-1].actualFireAt},refetchInterval:u=>(u.state.data?.pages.flatMap(p=>p.triggers)??[]).some(p=>p.run?p.run.status==="pending"||p.run.status==="running"||p.run.status==="waiting":p.outcome==="published")?5e3:!1}),a=s.data?.pages.flatMap(u=>u?.triggers??[])??[],{hasNextPage:i,isFetchingNextPage:o,fetchNextPage:c}=s;return y.useEffect(()=>{n&&i&&!o&&c()},[n,i,o,c]),{...s,data:a,setEndOfListElement:r}},iss=e=>{const t=Ze(),n=Ys();return nr({mutationFn:async r=>{if(!e)throw new Error("scheduleId is required");return r==="pause"?t.pauseSchedule(e):t.resumeSchedule(e)},onSuccess:(r,s)=>{n.invalidateQueries({queryKey:["schedule",e]}),n.invalidateQueries({queryKey:["schedules"]}),Fe.success(s==="pause"?"Schedule paused":"Schedule resumed")},onError:r=>{Fe.error(r.message)}})};function U5({label:e,children:t}){return l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx(ge,{variant:"ui-xs",className:"text-neutral4 uppercase tracking-wide",children:e}),l.jsx("div",{className:"text-ui-md",children:t})]})}function oss(){const{scheduleId:e}=Mr(),{paths:t}=an(),{data:n,error:r}=sss(e),{data:s,isLoading:a,error:i,hasNextPage:o,isFetchingNextPage:c,setEndOfListElement:u}=ass(e),d=iss(e);if(r&&zs(r))return l.jsx(ir,{children:l.jsx(ua,{})});if(r&&Bs(r))return l.jsx(ir,{children:l.jsx(na,{resource:"schedules"})});if(r)return l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load schedule",message:r.message})});const f=n?.target.type==="workflow"?n.target.workflowId:void 0;return l.jsxs(wn,{children:[l.jsx(wn.TopArea,{children:l.jsx(wn.Row,{className:"justify-end",children:l.jsxs(wn.Column,{className:"flex justify-end gap-2",children:[l.jsxs(de,{as:qi,to:t.schedulesLink(),variant:"ghost",children:[l.jsx(Eb,{}),"Back to schedules"]}),f?l.jsx(de,{as:qi,to:t.workflowLink(f),variant:"ghost",children:"Open workflow"}):null,n?l.jsx(de,{onClick:()=>d.mutate(n.status==="active"?"pause":"resume"),disabled:d.isPending,"data-testid":"schedule-toggle-button",children:n.status==="active"?l.jsxs(l.Fragment,{children:[l.jsx(Cme,{}),"Pause"]}):l.jsxs(l.Fragment,{children:[l.jsx(rb,{}),"Resume"]})}):null]})})}),n?l.jsxs("div",{className:"grid gap-6 h-full overflow-hidden grid-cols-[minmax(0,20rem)_1fr]",children:[l.jsxs("div",{className:"flex flex-col gap-4 border border-border1 rounded-md p-4 h-fit",children:[l.jsx(U5,{label:"Workflow",children:f?l.jsx(qi,{to:t.workflowLink(f),className:"text-accent1 hover:underline",children:f}):"—"}),l.jsxs(U5,{label:"Cron",children:[l.jsx("code",{className:"font-mono text-ui-md",children:n.cron}),n.timezone?l.jsx("span",{className:"text-neutral4 ml-2 text-ui-sm",children:n.timezone}):null]}),l.jsx(U5,{label:"Status",children:l.jsx(ALt,{status:n.status})}),l.jsx(U5,{label:"Next fire",children:l.jsx("span",{title:pC(n.nextFireAt),children:CR(n.nextFireAt)})})]}),l.jsxs("div",{className:"overflow-y-auto","data-testid":"schedule-triggers-panel",children:[l.jsx(ge,{variant:"ui-md",className:"mb-3",children:"Trigger history"}),i?l.jsx(Jl,{title:"Failed to load trigger history",message:i.message}):l.jsx(rss,{triggers:s??[],isLoading:a,workflowId:f,hasNextPage:o,isFetchingNextPage:c,setEndOfListElement:u})]})]}):null]})}const _Xe="minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto auto auto";function lss({schedules:e,isLoading:t,search:n=""}){const{paths:r,Link:s}=an(),a=y.useMemo(()=>{const i=n.toLowerCase();return i?e.filter(o=>o.id.toLowerCase().includes(i)||o.target.workflowId.toLowerCase().includes(i)):e},[e,n]);return t?l.jsx(Dd,{columns:_Xe}):l.jsxs(we,{columns:_Xe,children:[l.jsxs(we.Top,{children:[l.jsx(we.TopCell,{children:"Workflow"}),l.jsx(we.TopCell,{children:"Schedule ID"}),l.jsx(we.TopCell,{children:"Cron"}),l.jsx(we.TopCell,{children:"Status"}),l.jsx(we.TopCell,{children:"Next fire"}),l.jsx(we.TopCell,{children:"Last run"})]}),a.length===0&&n?l.jsx(we.NoMatch,{message:"No schedules match your search"}):null,a.length===0&&!n?l.jsx(we.NoMatch,{message:"No schedules configured"}):null,a.map(i=>l.jsxs(we.RowLink,{to:r.scheduleLink(i.id),LinkComponent:s,children:[l.jsx(we.NameCell,{children:l.jsx("span",{className:"truncate",children:i.target.workflowId})}),l.jsx(we.TextCell,{children:l.jsx("span",{className:"truncate font-mono text-ui-sm",title:i.id,children:i.id})}),l.jsx(we.TextCell,{children:l.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[l.jsx("code",{className:"font-mono text-ui-sm",children:i.cron}),i.timezone?l.jsx("span",{className:"text-neutral4 text-ui-xs",children:i.timezone}):null]})}),l.jsx(we.TextCell,{children:l.jsx(ALt,{status:i.status})}),l.jsx(we.TextCell,{children:l.jsx("span",{className:"whitespace-nowrap",title:pC(i.nextFireAt),children:CR(i.nextFireAt)})}),l.jsx(we.TextCell,{children:i.lastRun?l.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[l.jsx(ILt,{status:i.lastRun.status}),l.jsx("span",{className:"text-neutral4 text-ui-sm",title:pC(i.lastFireAt),children:i.lastFireAt?CR(i.lastFireAt):""})]}):i.lastFireAt?l.jsx("span",{className:"whitespace-nowrap",title:pC(i.lastFireAt),children:CR(i.lastFireAt)}):l.jsx("span",{className:"text-neutral4",children:"Never"})})]},i.id))]})}function css({workflowId:e}={}){const{data:t,isLoading:n,error:r}=gwe(e?{workflowId:e}:{}),[s,a]=y.useState("");return r?l.jsx(Jl,{title:"Failed to load schedules",message:r.message}):l.jsxs("div",{className:"grid grid-rows-[auto_1fr] gap-4 h-full overflow-hidden",children:[l.jsx("div",{className:"max-w-120",children:l.jsx(Iv,{onSearch:a,label:"Filter schedules",placeholder:"Filter by id or workflow"})}),l.jsx("div",{className:"overflow-y-auto",children:l.jsx(lss,{schedules:t??[],isLoading:n,search:s})})]})}function uss(){const[e]=fo(),t=e.get("workflowId")??void 0,{error:n}=gwe(t?{workflowId:t}:{});return n&&zs(n)?l.jsx(ir,{children:l.jsx(ua,{})}):n&&Bs(n)?l.jsx(ir,{children:l.jsx(na,{resource:"schedules"})}):l.jsx(wn,{children:l.jsx("div",{className:"h-full pt-6",children:l.jsx(css,{workflowId:t})})})}const OXe=()=>{const{workflowId:e}=Mr(),{data:t,isLoading:n,error:r}=q$(e);return r&&zs(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})}):r&&Bs(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"workflows"})}):l.jsx(fIt,{workflowId:e,workflow:t??void 0,isLoading:n})};function dss(e){if(!e)return null;switch(e.icon||e.provider){case"aws-s3":case"s3":return l.jsx(Rwt,{className:"h-4 w-4 text-[#FF9900]"});case"google-cloud":case"google-cloud-storage":case"gcs":return l.jsx(Nwt,{className:"h-4 w-4"});case"azure-blob":case"azure":return l.jsx(Pwt,{className:"h-4 w-4 text-[#0078D4]"});case"cloudflare":case"cloudflare-r2":case"r2":return l.jsx(KW,{className:"h-4 w-4 text-[#F38020]"});case"minio":return l.jsx(Ble,{className:"h-4 w-4 text-red-400"});case"database":return l.jsx(U0,{className:"h-4 w-4 text-emerald-400"});case"local":case"folder":return l.jsx(ZT,{className:"h-4 w-4 text-amber-400"});case"hard-drive":return l.jsx(Ble,{className:"h-4 w-4 text-slate-400"});case"cloud":return l.jsx(KW,{className:"h-4 w-4 text-sky-400"});default:return l.jsx(KW,{className:"h-4 w-4 text-neutral4"})}}function RLt(e,t=!1){const{name:n,type:r,mount:s}=e;if(r==="directory")return s?dss(s):t?l.jsx(HT,{className:"h-4 w-4 text-amber-400"}):l.jsx(ZT,{className:"h-4 w-4 text-amber-400"});switch(n.split(".").pop()?.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":return l.jsx(q0,{className:"h-4 w-4 text-blue-400"});case"json":return l.jsx(wM,{className:"h-4 w-4 text-yellow-400"});case"md":case"mdx":return l.jsx(lu,{className:"h-4 w-4 text-neutral4"});case"png":case"jpg":case"jpeg":case"gif":case"svg":case"webp":return l.jsx(_me,{className:"h-4 w-4 text-purple-400"});default:return l.jsx(Sme,{className:"h-4 w-4 text-neutral4"})}}function PLt(e){if(e==null||Number.isNaN(e))return"";if(e<0)return"-"+PLt(-e);if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB","TB"],r=Math.min(Math.floor(Math.log(e)/Math.log(t)),n.length-1);return parseFloat((e/Math.pow(t,r)).toFixed(1))+" "+n[r]}function fss(e){if("body"in e&&e.body&&typeof e.body=="object"){const r=e.body;if(typeof r.error=="string")return r.error;if(typeof r.message=="string")return r.message}const t=e.message,n=t.lastIndexOf(" - {");if(n!==-1)try{const r=t.slice(n+3),s=JSON.parse(r);if(s.error)return s.error;if(s.message)return s.message}catch{}return t.includes("status: 404")?"Directory not found":t}function MLt(e){return e==="."||e===""}function pss({path:e,onNavigate:t}){const r=MLt(e)?[]:e.split("/").filter(Boolean);return l.jsxs("div",{className:"flex items-center gap-1 text-sm overflow-x-auto",children:[l.jsx("button",{onClick:()=>t("."),className:"p-1 rounded hover:bg-surface4 text-neutral5 hover:text-neutral6 transition-colors","aria-label":"Workspace root",children:l.jsx(HT,{className:"h-4 w-4"})}),r.map((s,a)=>{const i=r.slice(0,a+1).join("/");return l.jsxs("div",{className:"flex items-center",children:[l.jsx(wa,{className:"h-4 w-4 text-neutral3"}),l.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 hss({entries:e,currentPath:t,isLoading:n,error:r,onNavigate:s,onFileSelect:a,onRefresh:i,onUpload:o,onCreateDirectory:c,onDelete:u,isCreatingDirectory:d,isDeleting:f}){const[p,h]=y.useState(null),m=[...e].sort((S,w)=>S.type==="directory"&&w.type!=="directory"?-1:S.type!=="directory"&&w.type==="directory"?1:S.name.localeCompare(w.name)),g=MLt(t),v=S=>{const w=g?S.name:`${t}/${S.name}`;S.type==="directory"?s(w):a?.(w)},b=S=>{const w=g?S.name:`${t}/${S.name}`;h(w)};return l.jsxs("div",{className:"rounded-lg border border-border1 overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface3 border-b border-border1",children:[l.jsx(pss,{path:t,onNavigate:s}),l.jsxs("div",{className:"flex items-center gap-1",children:[i&&l.jsx(de,{variant:"ghost",size:"md",onClick:i,disabled:n,"aria-label":"Refresh files",children:l.jsx(WT,{className:`h-4 w-4 ${n?"animate-spin":""}`})}),c&&l.jsx(de,{variant:"ghost",size:"md",disabled:d,"aria-label":"Create directory",onClick:()=>{const S=prompt("Directory name:");if(S){const w=g?S:`${t}/${S}`;c(w)}},children:d?l.jsx(xi,{className:"h-4 w-4 animate-spin"}):l.jsx(E7,{className:"h-4 w-4"})}),o&&l.jsx(de,{variant:"ghost",size:"md",onClick:o,"aria-label":"Upload files",children:l.jsx(N7,{className:"h-4 w-4"})})]})]}),l.jsx("div",{className:"max-h-[400px] overflow-auto",children:n?l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(xi,{className:"h-6 w-6 animate-spin text-neutral3"})}):r?l.jsxs("div",{className:"py-12 px-4 text-center",children:[l.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-red-500/10 mb-4",children:l.jsx(UR,{className:"h-6 w-6 text-red-400"})}),l.jsx("p",{className:"text-sm text-neutral6 font-medium mb-1",children:"Failed to load directory"}),l.jsx("p",{className:"text-xs text-neutral4 max-w-sm mx-auto",children:fss(r)})]}):m.length===0?l.jsx("div",{className:"py-12 text-center text-neutral4 text-sm",children:g?"Workspace is empty":"Directory is empty"}):l.jsx(od,{children:l.jsxs("ul",{children:[!g&&l.jsx("li",{children:l.jsxs("button",{onClick:()=>{const S=t.split("/").slice(0,-1).join("/")||".";s(S)},className:"w-full flex items-center gap-3 px-4 py-2 hover:bg-surface4 transition-colors text-left",children:[l.jsx(HT,{className:"h-4 w-4 text-amber-400"}),l.jsx("span",{className:"text-sm text-neutral5",children:".."})]})}),m.map(S=>{const w=S.mount?.displayName||S.mount?.provider,_=S.mount?.status==="error";return l.jsx("li",{className:"group",children:l.jsxs("div",{className:"flex items-center hover:bg-surface4 transition-colors",children:[l.jsxs("button",{onClick:()=>v(S),className:"flex-1 flex items-center gap-3 px-4 py-2 text-left",children:[RLt(S),l.jsx("span",{className:"text-sm text-neutral6 flex-1 truncate",children:S.name}),S.mount&&_&&l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx("span",{tabIndex:0,className:"flex items-center",children:l.jsx(UR,{className:"h-4 w-4 text-red-400"})})}),l.jsxs(Yn,{className:"max-w-xs",children:[l.jsx("span",{className:"text-red-400",children:"Error:"})," ",S.mount.error||"Failed to connect to this filesystem"]})]}),S.mount&&w&&(S.mount.description?l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx("span",{tabIndex:0,className:`text-xs px-1.5 py-0.5 rounded ${_?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:w})}),l.jsx(Yn,{children:S.mount.description})]}):l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${_?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:w})),S.type==="file"&&S.size!==void 0&&l.jsx("span",{className:"text-xs text-neutral3 tabular-nums",children:PLt(S.size)})]}),u&&!S.mount&&l.jsx("button",{onClick:()=>b(S),"aria-label":`Delete ${S.name}`,className:"p-2 opacity-0 group-hover:opacity-100 hover:text-red-400 text-neutral3 transition-all",children:l.jsx(Zd,{className:"h-3.5 w-3.5"})})]})},S.name)})]})})}),l.jsx(Gt,{open:!!p,onOpenChange:S=>!f&&!S&&h(null),children:l.jsxs(Gt.Content,{children:[l.jsxs(Gt.Header,{children:[l.jsx(Gt.Title,{children:"Delete Item"}),l.jsxs(Gt.Description,{children:['Are you sure you want to delete "',p,'"? This action cannot be undone.']})]}),l.jsxs(Gt.Footer,{children:[l.jsx(Gt.Cancel,{disabled:f,children:"Cancel"}),l.jsxs(Gt.Action,{disabled:f,onClick:async()=>{try{p&&u&&await u(p)}finally{h(null)}},children:[f?l.jsx(xi,{className:"h-4 w-4 animate-spin mr-2"}):null,"Delete"]})]})]})})]})}function mss(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 gss({content:e,language:t}){return l.jsx(rOe,{language:t,style:sOe.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},codeTagProps:{style:{fontFamily:"var(--geist-mono), ui-monospace, monospace"}},children:e})}function vss({path:e,content:t,isLoading:n,mimeType:r,onClose:s}){const a=e.split("/").pop()||e,i=a.split(".").pop()?.toLowerCase(),o=r?.startsWith("image/")||["png","jpg","jpeg","gif","svg","webp"].includes(i||""),c=mss(i);return l.jsxs("div",{className:"rounded-lg border border-border1 overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface3 border-b border-border1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[RLt({name:a,type:"file"}),l.jsx("span",{className:"text-sm font-medium text-neutral6",children:a})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(la,{content:t,copyMessage:"Copied file content"}),s&&l.jsx(de,{variant:"ghost",size:"md",onClick:s,children:"Close"})]})]}),l.jsx("div",{className:"max-h-[500px] overflow-auto h-full",style:{backgroundColor:"black"},children:n?l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(xi,{className:"h-6 w-6 animate-spin text-neutral3"})}):o?l.jsx("div",{className:"p-4 flex items-center justify-center",children:l.jsx("img",{src:`data:${r||"image/png"};base64,${btoa(t)}`,alt:a,className:"max-w-full max-h-[400px] object-contain"})}):c?l.jsx(gss,{content:t,language:c}):l.jsx("pre",{className:"p-4 text-sm text-neutral5 whitespace-pre-wrap font-mono overflow-x-auto",children:t})})]})}const yss=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(oi,{iconSlot:l.jsx(Hd,{}),titleSlot:"No Workspaces yet",descriptionSlot:l.jsxs(l.Fragment,{children:["Add a workspace to your Mastra configuration to ",l.jsx("br",{}),"manage files, skills, and enable semantic search."]}),actionSlot:l.jsxs(de,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",l.jsx(Da,{})]})})}),bss=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(oi,{iconSlot:l.jsx(NWt,{}),titleSlot:"Workspace Not Configured",descriptionSlot:l.jsxs(l.Fragment,{children:["No workspace is configured. Add a workspace to your ",l.jsx("br",{}),"Mastra configuration to manage files, skills, and enable semantic search."]}),actionSlot:l.jsxs(de,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",l.jsx(Da,{})]})})}),xss=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(oi,{iconSlot:l.jsx(UR,{}),titleSlot:"Workspace Not Supported",descriptionSlot:l.jsxs(l.Fragment,{children:["The workspace feature requires a newer version of ",l.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),".",l.jsx("br",{}),"Please upgrade your dependencies to enable workspace functionality."]}),actionSlot:l.jsxs(de,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",l.jsx(Da,{})]})})}),nle={bm25:{label:"Keyword",icon:l.jsx(lu,{className:"h-3.5 w-3.5"}),color:"bg-blue-500/10 text-blue-400 border-blue-500/30"},vector:{label:"Semantic",icon:l.jsx(kC,{className:"h-3.5 w-3.5"}),color:"bg-purple-500/10 text-purple-400 border-purple-500/30"},hybrid:{label:"Hybrid",icon:l.jsx(pYt,{className:"h-3.5 w-3.5"}),color:"bg-amber-500/10 text-amber-400 border-amber-500/30"}};function $Lt(e){return e.id.replace(/#chunk-\d+$/,"")}function wss({onSearch:e,isSearching:t,searchResults:n,canBM25:r,canVector:s,onViewResult:a}){const[i,o]=y.useState(""),[c,u]=y.useState(5),d=()=>r&&s?"hybrid":r?"bm25":s?"vector":"bm25",[f,p]=y.useState(d()),h=g=>{g.preventDefault(),i.trim()&&e({query:i.trim(),topK:c,mode:f})},m=[...r?["bm25"]:[],...s?["vector"]:[],...r&&s?["hybrid"]:[]];return l.jsxs("div",{className:"rounded-lg bg-surface4",children:[l.jsxs("form",{onSubmit:h,className:"p-4",children:[l.jsxs("div",{className:"flex gap-3 items-center",children:[l.jsxs("div",{className:"flex-1 relative",children:[l.jsx(GT,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),l.jsx(Sn,{value:i,onChange:g=>o(g.target.value),placeholder:"Search workspace files...",className:"pl-9 h-10 bg-surface2 border-border1"})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"text-xs text-neutral4",children:"Top"}),l.jsx(Sn,{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"})]}),l.jsx(de,{type:"submit",disabled:t||!i.trim(),size:"lg",className:"h-10 px-4",children:t?l.jsx(xi,{className:"h-4 w-4 animate-spin"}):"Search"})]}),m.length>0&&l.jsx("div",{className:"flex gap-2 mt-3",children:m.map(g=>{const v=nle[g],b=f===g;return l.jsxs("button",{type:"button",onClick:()=>p(g),className:`
665
+ ]`})]})]})}function wts({errors:e,maxErrors:t=5}){if(e.length===0)return null;const n=e.slice(0,t),r=e.length-t;return l.jsxs("div",{className:"bg-accent2/10 border border-accent2/30 rounded-md p-3",children:[l.jsxs("div",{className:"flex items-center gap-2 text-accent2 mb-2",children:[l.jsx(Be,{children:l.jsx(Vy,{className:"w-4 h-4"})}),l.jsxs("span",{className:"font-medium text-sm",children:[e.length," validation error",e.length!==1?"s":""]})]}),l.jsx("ul",{className:"text-sm text-accent2/80 space-y-1",children:n.map((s,a)=>l.jsxs("li",{className:"flex gap-2",children:[l.jsx("span",{className:"shrink-0",children:"•"}),l.jsx("span",{children:s.message})]},a))}),r>0&&l.jsxs("div",{className:"text-xs text-accent2/60 mt-2",children:["+",r," more error",r!==1?"s":""]})]})}function Sts({datasetId:e,open:t,onOpenChange:n,onSuccess:r}){const[s,a]=y.useState("upload"),[i,o]=y.useState(null),[c,u]=y.useState({current:0,total:0}),[d,f]=y.useState(null),[p,h]=y.useState(!1),{parseFile:m,isParsing:g,error:v}=Tes(),{batchInsertItems:b}=Di(),S=y.useCallback(async I=>{try{const R=await m(I);o(R),a("preview")}catch{}},[m]),w=y.useCallback(async()=>{if(!i||i.items.length===0)return;a("importing"),h(!0);const{items:I}=i;u({current:0,total:I.length});try{await b.mutateAsync({datasetId:e,items:I.map(R=>({input:R.input,groundTruth:R.groundTruth,metadata:R.metadata}))}),f({success:I.length,errors:0})}catch{f({success:0,errors:I.length})}u({current:I.length,total:I.length}),h(!1),a("complete")},[i,b,e]),_=y.useCallback(()=>{n(!1),r?.(),d&&d.success>0&&Fe.success(`Imported ${d.success} item${d.success!==1?"s":""}`),setTimeout(()=>{a("upload"),o(null),u({current:0,total:0}),f(null)},150)},[n,r,d]),O=y.useCallback(()=>{p||(n(!1),setTimeout(()=>{a("upload"),o(null),u({current:0,total:0}),f(null)},150))},[p,n]),E=i&&i.items.length>0&&i.errors.length===0,T=()=>{switch(s){case"upload":return l.jsx(xts,{onFileSelect:S,isParsing:g,error:v?.message});case"preview":return i?l.jsx("div",{className:"flex flex-col gap-4",children:i.errors.length>0?l.jsxs(l.Fragment,{children:[l.jsx(wts,{errors:i.errors}),l.jsx("div",{className:"text-sm text-neutral4",children:"Please fix the errors in your JSON file and try again."})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"text-sm text-neutral4",children:["Found ",i.items.length," valid item",i.items.length!==1?"s":""," to import."]}),l.jsx(bts,{items:i.items,maxRows:5})]})}):null;case"importing":return l.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[l.jsx(Qt,{size:"lg"}),l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Importing items..."}),l.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[c.current," of ",c.total]})]})]});case"complete":return l.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[l.jsx("div",{className:"text-4xl",children:d&&d.errors===0?"✓":"⚠"}),l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-lg font-medium text-neutral1",children:"Import Complete"}),l.jsxs("div",{className:"text-sm text-neutral4 mt-1",children:[d?.success??0," item",d?.success!==1?"s":""," imported",d&&d.errors>0&&l.jsxs("span",{className:"text-accent2",children:[" ","(",d.errors," error",d.errors!==1?"s":"",")"]})]})]})]})}},j=()=>{switch(s){case"upload":return l.jsx(de,{onClick:O,children:"Cancel"});case"preview":return l.jsxs(l.Fragment,{children:[l.jsx(de,{onClick:()=>a("upload"),children:"Back"}),l.jsxs(de,{variant:"primary",onClick:w,disabled:!E,children:["Import ",i?.items.length??0," Item",i?.items.length!==1?"s":""]})]});case"importing":return null;case"complete":return l.jsx(de,{variant:"primary",onClick:_,children:"Done"})}},N={upload:"Import JSON",preview:"Preview Data",importing:"Importing",complete:"Import Complete"};return l.jsx(Lr,{open:t,onOpenChange:O,children:l.jsxs(Ir,{className:"max-w-2xl max-h-[90vh]",children:[l.jsxs(zr,{children:[l.jsx(Rr,{children:N[s]}),l.jsx(ha,{children:"Import dataset items from a JSON file."})]}),l.jsx(ns,{className:"min-h-[200px] max-h-[50vh] overflow-y-auto",children:T()}),l.jsx(ap,{className:"px-6 pt-4 flex justify-end gap-2",children:j()})]})})}function kts({dataset:e,isLoading:t=!1,onEditClick:n,onDuplicateClick:r,onDeleteClick:s,experimentTriggerSlot:a,disableExperimentTrigger:i=!1,onExperimentClick:o,className:c}){return l.jsxs(Wn,{className:c,children:[l.jsxs(Wn.Column,{children:[l.jsxs(Wn.Title,{isLoading:t,children:[l.jsx(U0,{})," ",e?.name]}),l.jsx(Wn.Description,{isLoading:t,children:e?.description}),l.jsxs(Wn.Description,{isLoading:t,children:[l.jsxs(fs,{children:[l.jsx(xC,{})," Created at ",e?.createdAt?kn(new Date(e.createdAt),"MMM d, yyyy"):""]}),l.jsxs(fs,{children:[l.jsx(kw,{})," Latest version v",e?.version??""]})]})]}),l.jsx(Wn.Column,{children:l.jsxs(Nr,{children:[a?i?l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx("span",{className:"cursor-not-allowed",children:l.jsx("div",{className:"pointer-events-none opacity-50",inert:!0,"aria-disabled":"true",children:a})})}),l.jsx(Yn,{children:"Add items to the dataset before running an experiment"})]}):a:o?i?l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx("span",{className:"cursor-not-allowed",children:l.jsxs(de,{disabled:!0,tabIndex:-1,children:[l.jsx(rb,{}),"Run Experiment"]})})}),l.jsx(Yn,{children:"Add items to the dataset before running an experiment"})]}):l.jsxs(de,{onClick:o,children:[l.jsx(rb,{}),"Run Experiment"]}):null,l.jsxs(_t,{children:[l.jsx(_t.Trigger,{asChild:!0,children:l.jsx(de,{size:"default","aria-label":"Dataset actions menu",children:l.jsx(iet,{})})}),l.jsxs(_t.Content,{align:"end",className:"w-48",children:[l.jsxs(_t.Item,{onSelect:n,children:[l.jsx(Cb,{})," Edit Dataset"]}),l.jsxs(_t.Item,{onSelect:r,children:[l.jsx(Jf,{})," Duplicate Dataset"]}),l.jsxs(_t.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[l.jsx(Zd,{})," Delete Dataset"]})]})]})]})})]})}const wLt=e=>{const t=Ze(),{data:n}=mM(e),r=n?.experiments;return St({queryKey:["dataset-review-items",e,r?.map(s=>s.id)],queryFn:async()=>!r||r.length===0?[]:(await Promise.all(r.map(async a=>{if(!a.datasetId)return[];try{const{results:i}=await t.listDatasetExperimentResults(a.datasetId,a.id);return i.filter(o=>o.status==="needs-review").map(o=>({id:o.id,input:o.input,output:o.output,error:o.error,itemId:o.itemId,experimentId:o.experimentId,datasetId:a.datasetId??void 0,traceId:o.traceId??void 0,scores:o.scores?Object.fromEntries(o.scores.map(c=>[c.scorerId,c.score??0])):{},tags:o.tags??[],comment:""}))}catch{return[]}}))).flat(),enabled:!!e&&!!r&&r.length>0,refetchOnWindowFocus:!1})},_ts=e=>{const t=Ze(),{data:n}=mM(e),r=n?.experiments;return St({queryKey:["dataset-completed-items",e,r?.map(s=>s.id)],queryFn:async()=>!r||r.length===0?[]:(await Promise.all(r.map(async a=>{if(!a.datasetId)return[];try{const{results:i}=await t.listDatasetExperimentResults(a.datasetId,a.id);return i.filter(o=>o.status==="complete").map(o=>({id:o.id,input:o.input,output:o.output,error:o.error,itemId:o.itemId,experimentId:o.experimentId,datasetId:a.datasetId??void 0,traceId:o.traceId??void 0,scores:o.scores?Object.fromEntries(o.scores.map(c=>[c.scorerId,c.score??0])):{},tags:o.tags??[],comment:""}))}catch{return[]}}))).flat(),enabled:!!e&&!!r&&r.length>0,refetchOnWindowFocus:!1})};function Ots(e,t){if(typeof e=="string")return e.length>t?e.slice(0,t)+"...":e;try{const n=JSON.stringify(e);return n.length>t?n.slice(0,t)+"...":n}catch{return String(e)}}const Ets=X("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 uXe({className:e,children:t,...n}){return l.jsx(a$,{children:l.jsx(FB,{className:X(Ets,e),...n,children:t})})}function Cts({datasetId:e}){const t=Ze(),{data:n}=Ub(e),{data:r,isLoading:s}=wLt(e),{data:a,isLoading:i}=_ts(e),{updateExperimentResult:o}=Di(),[c,u]=y.useState(null),[d,f]=y.useState(null),[p,h]=y.useState(new Set),[m,g]=y.useState(!1),[v,b]=y.useState(!1),[S,w]=y.useState(!1),[_,O]=y.useState(""),[E,T]=y.useState(""),[j,N]=y.useState(""),[I,R]=y.useState([]),[P,U]=y.useState(!1),[M,L]=y.useState(null),F=M??r??[];y.useEffect(()=>{r&&M===null&&L(r)},[r]);const z=y.useMemo(()=>{const fe=new Set;if(n?.tags)for(const ye of n.tags)fe.add(ye);for(const ye of F)for(const _e of ye.tags)fe.add(_e);return[...fe].sort()},[n,F]),q=y.useCallback(fe=>{!n||!e||(n.tags??[]).includes(fe)},[n,e]),H=y.useMemo(()=>d?d==="__untagged__"?F.filter(fe=>fe.tags.length===0):F.filter(fe=>fe.tags.includes(d)):F,[F,d]),D=y.useMemo(()=>{const fe=new Map;for(const ye of F)for(const _e of ye.tags)fe.set(_e,(fe.get(_e)??0)+1);return[...fe.entries()].sort((ye,_e)=>_e[1]-ye[1])},[F]),Y=y.useMemo(()=>F.filter(fe=>fe.tags.length===0).length,[F]),V=y.useMemo(()=>{let fe=0;return d&&fe++,m&&fe++,fe},[d,m]),$=y.useCallback((fe,ye)=>{L(qe=>(qe??[]).map(Ge=>Ge.id===fe?{...Ge,tags:ye}:Ge));const _e=F.find(qe=>qe.id===fe);_e?.experimentId&&_e?.datasetId&&o.mutate({datasetId:_e.datasetId,experimentId:_e.experimentId,resultId:_e.id,tags:ye})},[F,o]),W=y.useCallback((fe,ye)=>{const _e=F.find(qe=>qe.id===fe);_e?.traceId&&ye!==void 0&&t.createFeedback({feedback:{traceId:_e.traceId,source:"studio",feedbackSource:"studio",feedbackType:"rating",value:ye==="positive"?1:-1,experimentId:_e.experimentId??void 0,sourceId:_e.id}}).catch(()=>{}),L(qe=>(qe??[]).map(Ge=>Ge.id===fe?{...Ge,rating:ye}:Ge))},[F,t]),G=y.useCallback((fe,ye)=>{const _e=F.find(qe=>qe.id===fe);_e?.traceId&&t.createFeedback({feedback:{traceId:_e.traceId,source:"studio",feedbackSource:"studio",feedbackType:"comment",value:ye,comment:ye,experimentId:_e.experimentId??void 0,sourceId:_e.id}}).catch(()=>{}),L(qe=>(qe??[]).map(Ge=>Ge.id===fe?{...Ge,comment:ye}:Ge))},[F,t]),K=y.useCallback(fe=>{const ye=F.find(_e=>_e.id===fe);L(_e=>(_e??[]).filter(qe=>qe.id!==fe)),h(_e=>{const qe=new Set(_e);return qe.delete(fe),qe}),c===fe&&u(null),ye?.experimentId&&ye?.datasetId&&o.mutate({datasetId:ye.datasetId,experimentId:ye.experimentId,resultId:ye.id,status:null})},[F,o,c]),re=y.useCallback(fe=>{const ye=F.find(_e=>_e.id===fe);L(_e=>(_e??[]).filter(qe=>qe.id!==fe)),h(_e=>{const qe=new Set(_e);return qe.delete(fe),qe}),c===fe&&u(null),ye?.experimentId&&ye?.datasetId&&o.mutate({datasetId:ye.datasetId,experimentId:ye.experimentId,resultId:ye.id,status:"complete"})},[F,o,c]),J=y.useMemo(()=>{const fe=m?a??[]:H;return!m||!d?fe:d==="__untagged__"?fe.filter(ye=>ye.tags.length===0):fe.filter(ye=>ye.tags.includes(d))},[m,a,H,d]),ee=m?i:!1,se=y.useMemo(()=>new Set(J.map(fe=>fe.id)),[J]),ie=y.useMemo(()=>[...p].filter(fe=>se.has(fe)).length,[p,se]),Q=J.length>0&&ie===J.length,ne=ie>0&&!Q,oe=y.useCallback(fe=>{h(ye=>{const _e=new Set(ye);return _e.has(fe)?_e.delete(fe):_e.add(fe),_e})},[]),me=y.useCallback(()=>{h(Q?new Set:new Set(J.map(fe=>fe.id)))},[Q,J]),ce=y.useCallback(fe=>{for(const ye of p){const _e=F.find(qe=>qe.id===ye);_e&&!_e.tags.includes(fe)&&$(ye,[..._e.tags,fe])}},[F,p,$]),be=y.useCallback(fe=>{for(const ye of p){const _e=F.find(qe=>qe.id===ye);_e&&_e.tags.includes(fe)&&$(ye,_e.tags.filter(qe=>qe!==fe))}},[F,p,$]),Ce=y.useCallback(()=>{for(const fe of p)re(fe);h(new Set)},[p,re]),je=y.useCallback(()=>{for(const fe of p)K(fe);h(new Set)},[p,K]),We=y.useCallback(()=>{O(""),w(!0)},[]),Pe=y.useCallback(async()=>{if(!(!E||!j)){b(!0),w(!1);try{const fe=F.filter(_e=>p.has(_e.id));if(fe.length===0){b(!1);return}const ye=await t.clusterFailures({modelId:`${E}/${j}`,items:fe.map(_e=>({id:_e.id,input:_e.input,output:_e.output??void 0,error:typeof _e.error=="string"?_e.error:_e.error?String(_e.error):void 0,scores:_e.scores,existingTags:_e.tags.length>0?_e.tags:void 0})),availableTags:z.length>0?z:void 0,prompt:_||void 0});ye.proposedTags&&ye.proposedTags.length>0&&(R(ye.proposedTags.map(_e=>({..._e,accepted:!0}))),U(!0))}catch(fe){console.error("Analysis failed:",fe)}finally{b(!1)}}},[E,j,F,p,t,z,_]),ze=y.useCallback(()=>{for(const fe of I){if(!fe.accepted)continue;const ye=F.find(_e=>_e.id===fe.itemId);if(ye){const _e=[...new Set([...ye.tags,...fe.tags])];$(ye.id,_e)}}U(!1)},[I,F,$]),Se=y.useCallback(fe=>{u(ye=>ye===fe?null:fe)},[]),le=y.useMemo(()=>c?J.find(fe=>fe.id===c)??null:null,[c,J]),ve=y.useCallback(()=>{if(!c||J.length===0)return;const fe=J.findIndex(ye=>ye.id===c);fe<J.length-1&&u(J[fe+1].id)},[c,J]),ue=y.useCallback(()=>{if(!c||J.length===0)return;const fe=J.findIndex(ye=>ye.id===c);fe>0&&u(J[fe-1].id)},[c,J]),xe=le?"2rem 1fr 10rem 8rem":"2rem 1fr 10rem 8rem 6rem 6rem";return s?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx(Qt,{className:"w-6 h-6"})}):l.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[l.jsx(Lr,{open:S,onOpenChange:w,children:l.jsxs(Ir,{children:[l.jsxs(zr,{children:[l.jsx(Rr,{children:"Analyze Items"}),l.jsx(ha,{children:"Use an LLM to automatically suggest tags for the selected items."})]}),l.jsxs("div",{className:"space-y-4 py-2",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsxs("div",{children:[l.jsx(jt,{className:"text-xs mb-1 block",children:"Provider"}),l.jsx(Fv,{value:E,onValueChange:T})]}),l.jsxs("div",{children:[l.jsx(jt,{className:"text-xs mb-1 block",children:"Model"}),l.jsx(Bv,{llmId:E,value:j,onValueChange:N})]})]}),l.jsxs(ge,{variant:"ui-xs",className:"text-neutral3",children:[p.size," item",p.size!==1?"s":""," will be analyzed"]}),l.jsxs("div",{children:[l.jsx(jt,{className:"text-xs",children:"Instructions (optional)"}),l.jsx(iu,{value:_,onChange:fe=>O(fe.target.value),placeholder:"E.g., Focus on safety issues and factual errors...",rows:3,className:"text-xs mt-1"})]})]}),l.jsxs(ap,{children:[l.jsx(de,{variant:"outline",onClick:()=>w(!1),children:"Cancel"}),l.jsxs(de,{onClick:Pe,disabled:!E||!j||v,children:[v?l.jsx(Qt,{className:"w-4 h-4 mr-1"}):null,"Analyze"]})]})]})}),l.jsx(Lr,{open:P,onOpenChange:U,children:l.jsxs(Ir,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[l.jsxs(zr,{children:[l.jsx(Rr,{children:"Review Proposed Tags"}),l.jsxs(ha,{children:[I.filter(fe=>fe.accepted).length," of ",I.length," proposals selected"]})]}),l.jsx("div",{className:"space-y-3 py-2",children:I.map((fe,ye)=>{const _e=F.find(qe=>qe.id===fe.itemId);return l.jsx("div",{className:X("p-3 border rounded-lg",!fe.accepted&&"opacity-50"),children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(oo,{checked:fe.accepted,onCheckedChange:qe=>R(Ge=>Ge.map((ct,De)=>De===ye?{...ct,accepted:!!qe}:ct))}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx(ge,{variant:"ui-xs",className:"text-neutral4 truncate block",children:_e?typeof _e.input=="string"?_e.input.slice(0,100):JSON.stringify(_e.input).slice(0,100):fe.itemId}),l.jsx("div",{className:"flex gap-1 flex-wrap mt-1.5",children:fe.tags.map((qe,Ge)=>l.jsx(dLt,{tag:qe,onRename:ct=>R(De=>De.map((Ve,Ae)=>Ae===ye?{...Ve,tags:Ve.tags.map((Ke,Me)=>Me===Ge?ct:Ke)}:Ve)),onRemove:()=>R(ct=>ct.map((De,Ve)=>Ve===ye?{...De,tags:De.tags.filter((Ae,Ke)=>Ke!==Ge)}:De))},`${qe}-${Ge}`))}),fe.reason&&l.jsx(ge,{variant:"ui-xs",className:"text-neutral3 mt-1 block italic",children:fe.reason})]})]})},fe.itemId)})}),l.jsxs(ap,{children:[l.jsx(de,{variant:"outline",onClick:()=>U(!1),children:"Cancel"}),l.jsxs(de,{onClick:ze,disabled:I.filter(fe=>fe.accepted).length===0,children:["Accept ",I.filter(fe=>fe.accepted).length," proposals"]})]})]})}),l.jsxs(Yf,{className:le?"grid-cols-[1fr_1fr]":"",children:[l.jsxs(An,{children:[l.jsxs(An.Toolbar,{children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(_t,{children:[l.jsx(_t.Trigger,{asChild:!0,children:l.jsxs(de,{variant:"outline",size:"md",children:[l.jsx(cet,{}),"Filter",V>0&&l.jsx("span",{className:X("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})]})}),l.jsxs(_t.Content,{align:"start",className:X("min-w-48"),children:[l.jsxs(_t.Sub,{children:[l.jsxs(_t.SubTrigger,{children:["Status",m&&l.jsx("span",{className:X("ml-auto text-ui-sm text-accent1"),children:"1"})]}),l.jsxs(uXe,{children:[l.jsx(_t.CheckboxItem,{checked:!m,onCheckedChange:()=>{g(!1),u(null)},onSelect:fe=>fe.preventDefault(),children:"Review Queue"}),l.jsx(_t.CheckboxItem,{checked:m,onCheckedChange:()=>{g(!0),u(null)},onSelect:fe=>fe.preventDefault(),children:"Completed"})]})]}),l.jsxs(_t.Sub,{children:[l.jsxs(_t.SubTrigger,{children:["Tags",d&&l.jsx("span",{className:X("ml-auto text-ui-sm text-accent1"),children:"1"})]}),l.jsxs(uXe,{children:[l.jsx(_t.CheckboxItem,{checked:!d,onCheckedChange:()=>f(null),onSelect:fe=>fe.preventDefault(),children:"All"}),Y>0&&l.jsx(_t.CheckboxItem,{checked:d==="__untagged__",onCheckedChange:()=>f(d==="__untagged__"?null:"__untagged__"),onSelect:fe=>fe.preventDefault(),children:"Untagged"}),D.length>0&&l.jsx(_t.Separator,{}),D.map(([fe])=>l.jsx(_t.CheckboxItem,{checked:d===fe,onCheckedChange:()=>f(d===fe?null:fe),onSelect:ye=>ye.preventDefault(),children:fe},fe))]})]}),V>0&&l.jsxs(l.Fragment,{children:[l.jsx(_t.Separator,{}),l.jsxs(_t.Item,{onSelect:()=>{f(null),g(!1),u(null)},children:[l.jsx(Pr,{}),"Clear all filters"]})]})]})]}),V>0&&l.jsxs(de,{variant:"outline",size:"md",onClick:()=>{f(null),g(!1),u(null)},children:[l.jsx(Pr,{}),"Reset"]})]}),!m&&p.size>0&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(uLt,{selectedCount:p.size,vocabulary:z,onApplyTag:ce,onRemoveTag:be,onNewTag:fe=>ce(fe)}),l.jsxs(_t,{children:[l.jsx(_t.Trigger,{asChild:!0,children:l.jsxs(de,{disabled:v,children:[v?l.jsx(Qt,{className:"w-4 h-4"}):l.jsx(Be,{size:"sm",children:l.jsx(ys,{})}),"Actions"]})}),l.jsxs(_t.Content,{align:"end",children:[l.jsxs(_t.Item,{onSelect:Ce,children:[l.jsx(Be,{size:"sm",children:l.jsx(US,{})}),"Complete"]}),l.jsxs(_t.Item,{onSelect:je,children:[l.jsx(Be,{size:"sm",children:l.jsx(Zd,{})}),"Remove"]}),l.jsx(_t.Separator,{}),l.jsxs(_t.Item,{onSelect:We,children:[l.jsx(Be,{size:"sm",children:l.jsx(kC,{})}),"Analyze"]})]})]})]})]}),ee?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx(Qt,{className:"w-6 h-6"})}):J.length===0?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsxs("div",{className:"text-center px-8",children:[l.jsx(ge,{variant:"ui-sm",className:"text-neutral3 block",children:m?"No completed reviews yet":"No items to review"}),l.jsx(ge,{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."})]})}):l.jsxs(we,{columns:xe,children:[l.jsxs(we.Top,{children:[!m&&l.jsx(we.TopCell,{children:l.jsx(oo,{checked:Q?!0:ne?"indeterminate":!1,onCheckedChange:()=>me(),"aria-label":"Select all"})}),m&&l.jsx(we.TopCell,{children:" "}),l.jsx(we.TopCell,{children:"Input"}),l.jsx(we.TopCell,{children:"Comment"}),l.jsx(we.TopCell,{children:"Tags"}),!le&&l.jsx(we.TopCell,{children:"Rating"}),!le&&l.jsx(we.TopCell,{children:"Scores"})]}),l.jsx(we.Rows,{children:J.map(fe=>{const ye=fe.scores?Object.entries(fe.scores):[];return l.jsxs(we.Row,{onClick:()=>Se(fe.id),selected:c===fe.id,children:[l.jsx(we.Cell,{children:m?fe.error?l.jsx("div",{className:"w-2 h-2 rounded-full bg-red-700",title:"Error"}):l.jsx("div",{className:"w-2 h-2 rounded-full bg-green-600",title:"Success"}):l.jsx(oo,{checked:p.has(fe.id),onCheckedChange:()=>oe(fe.id),onClick:_e=>_e.stopPropagation(),"aria-label":`Select item ${fe.id}`})}),l.jsx(we.NameCell,{children:Ots(fe.input,80)}),l.jsx(we.Cell,{children:fe.comment?l.jsx(ge,{variant:"ui-xs",className:"text-neutral3 truncate",children:fe.comment}):l.jsx(ge,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),l.jsx(we.Cell,{children:fe.tags.length>0?l.jsx(ge,{variant:"ui-xs",className:"text-neutral4 truncate",children:fe.tags.join(", ")}):l.jsx(ge,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),!le&&l.jsxs(we.Cell,{children:[fe.rating==="positive"&&l.jsx(Be,{size:"sm",className:"text-positive1",children:l.jsx(jme,{})}),fe.rating==="negative"&&l.jsx(Be,{size:"sm",className:"text-negative1",children:l.jsx(Tme,{})}),!fe.rating&&l.jsx(ge,{variant:"ui-xs",className:"text-neutral2",children:"—"})]}),!le&&l.jsx(we.Cell,{children:ye.length>0?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Be,{size:"sm",className:"text-neutral3",children:l.jsx(cu,{})}),l.jsx(ge,{variant:"ui-xs",className:"text-neutral4 font-mono",children:ye[0][1].toFixed(2)}),ye.length>1&&l.jsxs(Et,{variant:"default",children:["+",ye.length-1]})]}):l.jsx(ge,{variant:"ui-xs",className:"text-neutral2",children:"—"})})]},fe.id)})})]})]}),le&&l.jsx(cLt,{item:le,isCompleted:m,tagVocabulary:z,onRate:fe=>W(le.id,fe),onSetTags:fe=>{$(le.id,fe);for(const ye of fe)z.includes(ye)||q(ye)},onComment:fe=>G(le.id,fe),onRemove:()=>K(le.id),onComplete:m?void 0:()=>re(le.id),onPrevious:ue,onNext:ve,onClose:()=>u(null)})]})]})}function Tts({datasetId:e,onExperimentClick:t,onEditClick:n,onDeleteClick:r,onAddItemClick:s,experimentTriggerSlot:a,onNavigateToDataset:i,activeDatasetVersion:o,onVersionSelect:c,initialTab:u,onTabChange:d}){const{navigate:f}=an(),[p,h]=y.useState(u??"items"),m=en=>{h(en),d?.(en)},[g,v]=y.useState(!1),[b,S]=y.useState(!1),[w,_]=y.useState(!1),[O,E]=y.useState([]),[T,j]=y.useState(!1),[N,I]=y.useState([]),[R,P]=y.useState(!1),[U,M]=y.useState([]),[L,F]=y.useState(!1),[z,q]=y.useState(0),[H,D]=y.useState(null),[Y,V]=y.useState(""),[$]=qTn(Y,300),[W,G]=y.useState(null),re=o!==void 0?o:W,{data:J,isLoading:ee}=Ub(e),{data:se=[],total:ie,isLoading:Q,setEndOfListElement:ne,isFetchingNextPage:oe,hasNextPage:me}=UT(e,$||void 0,re),{data:ce=[],total:be,isLoading:Ce}=UT(e,void 0,re),[je,We]=y.useState({}),{data:Pe,isLoading:ze}=mM(e,void 0,je),{data:Se}=mM(e),{deleteItems:le}=Di(),ve=Pe?.experiments??[],ue=Se?.experiments??[],xe=Hes({hasSearchQuery:!!$,filteredItemsLength:se.length,unfilteredItemsTotal:be,itemsTotal:ie}),{data:fe}=wLt(e),ye=fe?.length??0,_e=en=>{D(en)},qe=()=>{D(null)},Ge=en=>{const En=en.isCurrent?null:en;c?c(En):G(en.isCurrent?null:en.version)},ct=en=>{E(en),_(!0)},De=en=>{I(en),j(!0)},Ve=en=>{j(en),en||(I([]),q(En=>En+1))},Ae=en=>{f(`/datasets/${e}/items?items=${en.join(",")}`)},Ke=en=>{f(`/datasets/${e}/versions?ids=${en.join(",")}`)},Me=en=>{M(en),P(!0)},ft=async()=>{await le.mutateAsync({datasetId:e,itemIds:U}),Fe.success(`Deleted ${U.length} items`),P(!1),M([]),q(en=>en+1)},kt=en=>{_(!1),E([]),q(En=>En+1),i?.(en)},Tn=en=>{_(en),en||(E([]),q(En=>En+1))};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-rows-[auto_1fr] mx-auto h-full w-full max-w-[120rem] px-12 pb-4",children:[l.jsx(kts,{dataset:J,isLoading:ee,onEditClick:n,onDuplicateClick:()=>F(!0),onDeleteClick:r,experimentTriggerSlot:a,disableExperimentTrigger:!Ce&&ce.length===0,onExperimentClick:t}),l.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:l.jsxs(ku,{defaultTab:"items",value:p,onValueChange:m,className:"grid grid-rows-[auto_1fr] h-full",children:[l.jsxs(_u,{children:[l.jsxs(Hr,{value:"items",children:["Items ",l.jsx(ai,{color:"gray",children:xe})]}),l.jsxs(Hr,{value:"experiments",children:["Experiments",l.jsx(ai,{color:"gray",children:ve.length})]}),l.jsxs(Hr,{value:"review",children:["Review",ye>0&&l.jsx(ai,{color:"orange",children:ye})]})]}),l.jsx(_s,{value:"items",className:"grid overflow-auto mt-5",children:l.jsx(yts,{datasetId:e,items:se,isLoading:Q,featuredItemId:H,onItemSelect:_e,onItemClose:qe,onAddClick:s??(()=>{}),onImportClick:()=>v(!0),onImportJsonClick:()=>S(!0),onBulkDeleteClick:Me,onCreateDatasetClick:ct,onAddToDatasetClick:De,onCompareItemsClick:Ae,datasetName:J?.name,clearSelectionTrigger:z,setEndOfListElement:ne,isFetchingNextPage:oe,hasNextPage:me,searchQuery:Y,onSearchChange:V,activeDatasetVersion:re,currentDatasetVersion:J?.version,onVersionSelect:Ge,onCompareVersionsClick:Ke})}),l.jsx(_s,{value:"experiments",className:"grid overflow-auto mt-5",children:l.jsx(ots,{experiments:ve,allExperiments:ue,isLoading:ze,datasetId:e,filters:je,onFiltersChange:We})}),l.jsx(_s,{value:"review",className:"overflow-auto mt-0",children:l.jsx(Cts,{datasetId:e})})]})})]}),l.jsx(Jes,{datasetId:e,open:g,onOpenChange:v}),l.jsx(Sts,{datasetId:e,open:b,onOpenChange:S}),l.jsx(Fes,{open:w,onOpenChange:Tn,items:O,onSuccess:kt}),l.jsx(Bes,{open:T,onOpenChange:Ve,items:N,currentDatasetId:e}),l.jsx(Ues,{open:L,onOpenChange:F,sourceDatasetId:e,sourceDatasetName:J?.name||"",sourceDatasetDescription:J?.description,onSuccess:i}),l.jsx(Gt,{open:R,onOpenChange:P,children:l.jsxs(Gt.Content,{children:[l.jsxs(Gt.Header,{children:[l.jsx(Gt.Title,{children:"Delete Items"}),l.jsxs(Gt.Description,{children:["Are you sure you want to delete ",U.length," item",U.length!==1?"s":"","? This action cannot be undone."]})]}),l.jsxs(Gt.Footer,{children:[l.jsx(Gt.Cancel,{children:"Cancel"}),l.jsx(Gt.Action,{onClick:ft,children:le.isPending?"Deleting...":"Delete"})]})]})})]})}function jts(e){if(!(e instanceof Error))return null;const t=e.message.match(/- ({.*})$/);if(!t)return null;try{const n=JSON.parse(t[1]);if(n.field&&Array.isArray(n.errors))return{field:n.field,errors:n.errors}}catch{}return null}function dXe({field:e,errors:t}){return t.length?l.jsx("div",{className:"mt-2 space-y-1",children:t.map((n,r)=>l.jsxs("p",{className:"text-xs text-destructive",children:[l.jsxs("code",{className:"bg-destructive/10 px-1 rounded",children:[e,n.path!=="/"?n.path:""]}),": ",n.message]},r))}):null}function Nts({datasetId:e,open:t,onOpenChange:n,onSuccess:r}){const[s,a]=y.useState("{}"),[i,o]=y.useState(""),[c,u]=y.useState(""),[d,f]=y.useState(null),{addItem:p}=Di(),h=async b=>{b.preventDefault();let S;try{S=JSON.parse(s)}catch{Fe.error("Input must be valid JSON");return}let w;if(i.trim())try{w=JSON.parse(i)}catch{Fe.error("Ground Truth must be valid JSON");return}let _;if(c.trim())try{_=JSON.parse(c)}catch{Fe.error("Expected Trajectory must be valid JSON");return}try{await p.mutateAsync({datasetId:e,input:S,groundTruth:w,expectedTrajectory:_}),Fe.success("Item added successfully"),f(null),a("{}"),o(""),u(""),n(!1),r?.()}catch(O){const E=jts(O);E?f(E):Fe.error(`Failed to add item: ${O instanceof Error?O.message:"Unknown error"}`)}},m=b=>{a(b),d?.field==="input"&&f(null)},g=b=>{o(b),d?.field==="groundTruth"&&f(null)},v=()=>{a("{}"),o(""),u(""),f(null),n(!1)};return l.jsx(Lr,{open:t,onOpenChange:n,children:l.jsxs(Ir,{className:"max-w-lg",children:[l.jsx(zr,{children:l.jsx(Rr,{children:"Add Item"})}),l.jsx(ns,{children:l.jsxs("form",{onSubmit:h,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(jt,{htmlFor:"item-input",children:"Input (JSON) *"}),l.jsx(As,{value:s,onChange:m,showCopyButton:!1,className:"min-h-[120px]"}),d?.field==="input"&&l.jsx(dXe,{field:"input",errors:d.errors})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(jt,{htmlFor:"item-ground-truth",children:"Ground Truth (JSON, optional)"}),l.jsx(As,{value:i,onChange:g,showCopyButton:!1,className:"min-h-[80px]"}),d?.field==="groundTruth"&&l.jsx(dXe,{field:"groundTruth",errors:d.errors})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(jt,{htmlFor:"item-trajectory",children:"Expected Trajectory (JSON, optional)"}),l.jsx(As,{value:c,onChange:u,showCopyButton:!1,className:"min-h-[80px]"})]}),l.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[l.jsx(de,{type:"button",onClick:v,children:"Cancel"}),l.jsx(de,{type:"submit",variant:"primary",disabled:p.isPending,children:p.isPending?"Adding...":"Add Item"})]})]})})]})})}function Ats({selectedScorers:e,setSelectedScorers:t,disabled:n=!1,container:r}){const{data:s,isLoading:a}=Op(),i=y.useMemo(()=>s?Object.entries(s).map(([o,c])=>({value:o,label:c.scorer?.config?.name||o,description:c.scorer?.config?.description||""})):[],[s]);return l.jsxs("div",{className:"grid gap-2",children:[l.jsx(jt,{children:"Scorers (Optional)"}),l.jsx(Wwt,{options:i,value:e,onValueChange:t,placeholder:"Select scorers...",searchPlaceholder:"Search scorers...",emptyText:"No scorers available",disabled:n||a,container:r})]})}const Its=[{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"}];function Rts({targetType:e,setTargetType:t,targetId:n,setTargetId:r,container:s}){const{data:a,isLoading:i}=Lv(),{data:o,isLoading:c}=Bw(),{data:u,isLoading:d}=Op(),f=e==="agent"?Object.entries(a??{}).map(([g,v])=>({value:g,label:v.name??g})):e==="workflow"?Object.entries(o??{}).map(([g,v])=>({value:g,label:v.name??g})):e==="scorer"?Object.entries(u??{}).map(([g,v])=>({value:g,label:v.scorer?.config?.name??g})):[],p=e==="agent"&&i||e==="workflow"&&c||e==="scorer"&&d,h=g=>{t(g),r("")},m=e==="agent"?"Agent":e==="workflow"?"Workflow":"Scorer";return l.jsxs("div",{className:"grid gap-6",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(jt,{children:"Target Type"}),l.jsx(jc,{options:Its,value:e,onValueChange:h,placeholder:"Select target type",searchPlaceholder:"Search types...",emptyText:"No types available",container:s})]}),e&&l.jsxs("div",{className:"grid gap-2",children:[l.jsx(jt,{children:m}),l.jsx(jc,{options:f,value:n,onValueChange:r,placeholder:`Select ${e}`,searchPlaceholder:"Search...",emptyText:"No targets available",disabled:p,container:s})]})]})}function Pts({datasetId:e,version:t,open:n,onOpenChange:r,onSuccess:s}){const a=y.useRef(null),[i,o]=y.useState(""),[c,u]=y.useState(""),[d,f]=y.useState([]),{triggerExperiment:p}=Di(),h=i&&c,m=p.isPending,g=async()=>{if(h)try{const b=await p.mutateAsync({datasetId:e,targetType:i,targetId:c,scorerIds:d.length>0?d:void 0,version:t});jm.success("Experiment triggered successfully"),r(!1),s?.(b.experimentId),o(""),u(""),f([])}catch(b){const S=b instanceof Error?b.message:"Failed to trigger experiment";jm.error(S)}},v=()=>{m||(r(!1),o(""),u(""),f([]))};return l.jsx(Lr,{open:n,onOpenChange:v,children:l.jsxs(Ir,{ref:a,children:[l.jsxs(zr,{children:[l.jsx(Rr,{children:"Run Experiment"}),l.jsx(ha,{children:t?`Execute items from ${kn(new Date(t),"MMM d, yyyy")} version against a target.`:"Execute all items in this dataset against a target."})]}),l.jsxs(ns,{className:"grid gap-6",children:[l.jsx(Rts,{targetType:i,setTargetType:o,targetId:c,setTargetId:u,container:a}),i&&i!=="scorer"&&l.jsx(Ats,{selectedScorers:d,setSelectedScorers:f,disabled:m,container:a})]}),l.jsxs(ap,{className:"px-6 pt-4",children:[l.jsx(de,{onClick:v,disabled:m,children:"Cancel"}),l.jsx(de,{variant:"primary",onClick:g,disabled:!h||m,children:m?l.jsxs(l.Fragment,{children:[l.jsx(Qt,{className:"w-4 h-4"}),"Running..."]}):"Run"})]})]})})}const SLt=e=>{const t=Ze();return St({queryKey:["experiment-trace-light",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return t.getTraceLight(e)},enabled:!!e})},fXe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"score",label:"Score",size:"1fr"}];function Mts({result:e,scores:t,onPrevious:n,onNext:r,onClose:s,onShowTrace:a,onScoreClick:i,featuredScoreId:o}){const c=!!e?.error,u=Joe(e?.input),d=Joe(e?.output);return l.jsxs(l.Fragment,{children:[l.jsxs(An.Toolbar,{children:[l.jsx(Bj,{onPrevious:n,onNext:r,previousAriaLabel:"View previous result details",nextAriaLabel:"View next result details"}),l.jsxs(Nr,{children:[l.jsxs(de,{onClick:a,disabled:!e.traceId,children:[l.jsx(Eme,{}),"Show Trace"]}),l.jsx(de,{onClick:s,"aria-label":"Close result details panel",children:l.jsx(Pr,{})})]})]}),l.jsxs(An.Content,{children:[l.jsx(Wn,{withMargins:!1,children:l.jsxs(Wn.Column,{children:[l.jsxs(Wn.Title,{size:"smaller",children:[l.jsx(rb,{})," ",e.id]}),l.jsx(Wn.Description,{children:l.jsxs(fs,{children:[l.jsx(q0,{})," ",e.itemId]})})]})}),c&&l.jsx(Hn,{variant:"destructive",title:"Error",children:l.jsx(Hn.Message,{children:Joe(e?.error&&typeof e.error=="object"?e.error.message:e?.error)})}),t&&t.length>0&&l.jsxs(qt,{className:"grid-rows-[auto_auto] overflow-visible",children:[l.jsxs(qt.Header,{columns:fXe,children:[l.jsx(qt.HeaderCol,{children:"Scorer"}),l.jsx(qt.HeaderCol,{children:"Score"})]}),l.jsx(qt.Items,{children:t.map(f=>l.jsx(qt.Row,{children:l.jsxs(qt.RowButton,{item:{id:f.id},columns:fXe,isFeatured:o===f.id,onClick:i,children:[l.jsx(qt.TextCell,{children:f.scorerId}),l.jsx(qt.TextCell,{className:"font-mono",children:f.score.toFixed(3)})]})},f.id))})]}),(e.status||Array.isArray(e.tags)&&e.tags.length>0)&&l.jsxs("div",{className:"grid gap-2",children:[l.jsxs("h4",{className:"text-sm font-medium text-neutral5 flex items-center gap-2",children:[l.jsx(QT,{className:"w-4 h-4"})," Review Status"]}),l.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[e.status&&l.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=>l.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-surface4 text-neutral4",children:f},f))]})]}),l.jsx(nn.CodeSection,{title:"Input",icon:l.jsx(q0,{}),codeStr:u}),l.jsx(nn.CodeSection,{title:"Output",icon:l.jsx(qf,{}),codeStr:d}),l.jsxs("div",{className:"grid gap-2",children:[l.jsxs("h4",{className:"text-sm font-medium text-neutral5 flex items-center gap-2",children:[l.jsx(xC,{className:"w-4 h-4"})," Created"]}),l.jsx("p",{className:"text-sm text-neutral4",children:kn(new Date(e.createdAt),"MMM d, yyyy 'at' h:mm a")})]})]})]})}function Joe(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function $ts({span:e}){return e?l.jsxs(l.Fragment,{children:[l.jsx(nn.CodeSection,{title:"Input",icon:l.jsx(V0,{}),codeStr:JSON.stringify(e.input||null,null,2)}),l.jsx(nn.CodeSection,{title:"Output",icon:l.jsx(qf,{}),codeStr:JSON.stringify(e.output||null,null,2)}),l.jsx(nn.CodeSection,{title:"Metadata",icon:l.jsx(yh,{}),codeStr:JSON.stringify(e.metadata||null,null,2)}),l.jsx(nn.CodeSection,{title:"Attributes",icon:l.jsx(yh,{}),codeStr:JSON.stringify(e.attributes||null,null,2)})]}):null}function Dts({traceId:e,spanId:t,onNext:n,onPrevious:r,onClose:s}){const{data:a}=Ck(e,t),i=a?.span;return l.jsxs(l.Fragment,{children:[l.jsxs(An.Toolbar,{children:[l.jsx(Bj,{onPrevious:r,onNext:n,previousAriaLabel:"View previous span details",nextAriaLabel:"View next span details"}),l.jsx(de,{onClick:s,"aria-label":"Close span details",children:l.jsx(Pr,{})})]}),l.jsxs(An.Content,{children:[l.jsx(Wn,{withMargins:!1,children:l.jsx(Wn.Column,{children:l.jsxs(Wn.Title,{size:"smaller",children:[l.jsx(yh,{})," Span ",Qf(t)]})})}),l.jsx($ts,{span:i})]})]})}const Lts=e=>{if(!e||e.length===0)return[];const t=e.reduce((o,c)=>{const u=c?.endedAt?new Date(c.endedAt):void 0;return u&&(!o||u>o)?u:o},null),n=new Map,r=[];e.forEach(o=>{const c=new Date(o.startedAt),u=o.endedAt?new Date(o.endedAt):void 0,d={id:o.spanId,name:o.name,type:o.spanType,latency:u?u.getTime()-c.getTime():0,startTime:c.toISOString(),endTime:u?u.toISOString():void 0,spans:[],parentSpanId:o.parentSpanId};n.set(o.spanId,d)}),e.forEach(o=>{const c=n.get(o.spanId);if(o?.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}r.push(c)}else{const u=n.get(o.parentSpanId);u?u.spans.push(c):r.push(c)}});const s=o=>o.sort((c,u)=>new Date(c.startTime).getTime()-new Date(u.startTime).getTime()),a=s(r),i=o=>{o.forEach(c=>{c.spans&&c.spans.length>0&&(c.spans=s(c.spans),i(c.spans))})};return i(a),a};function kLt(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(n=>{t.push(n.id),t.push(...kLt(n))}),t}const pXe=["agent","workflow","model","mcp","tool","workspace","other"];function _Lt(e){const t=e?.toLowerCase().split("_")[0],n={agent:{icon:l.jsx(Go,{}),color:"oklch(0.75 0.15 250)",label:"Agent",bgColor:"bg-oklch(0.75 0.15 250 / 0.1)",typePrefix:"agent"},workflow:{icon:l.jsx(Tc,{}),color:"oklch(0.75 0.15 200)",label:"Workflow",bgColor:"bg-oklch(0.75 0.15 200 / 0.1)",typePrefix:"workflow"},model:{icon:l.jsx(Mg,{}),color:"oklch(0.75 0.15 320)",label:"Model",bgColor:"bg-oklch(0.75 0.15 320 / 0.1)",typePrefix:"model"},mcp:{icon:l.jsx(Pm,{}),color:"oklch(0.75 0.15 160)",label:"MCP",bgColor:"bg-oklch(0.75 0.15 160 / 0.1)",typePrefix:"mcp"},tool:{icon:l.jsx(Cc,{}),color:"oklch(0.75 0.15 100)",label:"Tool",bgColor:"bg-oklch(0.75 0.15 100 / 0.1)",typePrefix:"tool"},workspace:{icon:l.jsx(gq,{}),color:"oklch(0.75 0.15 40)",label:"Workspace",bgColor:"bg-oklch(0.75 0.15 40 / 0.1)",typePrefix:"workspace"}};return t in n?n[t]:{typePrefix:"other"}}function zts({isSelected:e,isFaded:t,isExpanded:n,toggleChildren:r,expandAllDescendants:s,totalDescendants:a=0,allDescendantsExpanded:i,numOfChildren:o}){return l.jsx("div",{className:X("flex items-center justify-end h-full px-3",{"opacity-30 [&:hover]:opacity-60":t,"bg-surface4":e}),children:o&&o>0?l.jsxs("div",{className:"flex gap-1",children:[l.jsxs(hXe,{onClick:()=>r?.(),children:[i?a:o," ",n?i?l.jsx(XJe,{}):l.jsx(Sw,{}):l.jsx(ys,{})]}),a>(o??0)&&!i&&l.jsxs(hXe,{onClick:()=>s?.(),children:[a," ",l.jsx(YJe,{})]})]}):null})}function hXe({onClick:e,children:t,className:n}){return l.jsx("button",{onClick:e,className:X("h-full",n),children:l.jsx("div",{className:X("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 Fts({isLastChild:e,hasChildren:t=!1,expanded:n=!1}){return l.jsx("div",{className:X("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&&l.jsx("span",{className:X("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:n?l.jsx(eet,{}):l.jsx(JJe,{})})})}function Bts({span:e,spanUI:t,isFaded:n,depth:r=0,onSpanClick:s,selectedSpanId:a,isLastChild:i,hasChildren:o,isRootSpan:c,isExpanded:u,toggleChildren:d}){return l.jsxs("div",{className:"flex overflow-x-auto",style:{paddingLeft:`${r*1.5}rem`},children:[!c&&l.jsx("button",{onClick:()=>d?.(),disabled:!o,className:X({"cursor-default":!o,"cursor-pointer":o}),children:l.jsx(Fts,{isLastChild:i,hasChildren:!!o,expanded:u})}),l.jsx("button",{className:"truncate",onClick:()=>s?.(e.id),children:e.name})]})}function OLt({span:e,depth:t=0,onSpanClick:n,selectedSpanId:r,isLastChild:s,overallLatency:a,overallStartTime:i,overallEndTime:o,fadedTypes:c,searchPhrase:u,featuredSpanIds:d,expandedSpanIds:f,setExpandedSpanIds:p}){const h=e.spans&&e.spans.length>0,m=e.spans?e.spans.length:0,g=kLt(e),v=g.length,b=t===0,S=_Lt(e?.type),w=f?f.includes(e.id):!1,_=d&&d.length>0?!d.includes(e.id):!1,E=(c&&c.length>0?c.includes(S?.typePrefix||""):!1)||_;y.useEffect(()=>{b&&p?.([e.id])},[b,e.id,p]),y.useEffect(()=>{if(!d||!e.spans||e.spans.length===0)return;const I=e.spans.some(R=>d.includes(R.id));!w&&I&&T()},[d,e.spans,e.id,w,p,f]);const T=()=>{if(!(!p||!f))if(w){const I=[e.id,...g];p(f.filter(R=>!I.includes(R)))}else p([...f,e.id])},j=()=>{!p||!f||p([...f,e.id,...g])},N=g.every(I=>f?.includes(I));return l.jsxs(l.Fragment,{children:[l.jsx(Bts,{span:e,spanUI:S,isFaded:E,depth:t,onSpanClick:n,selectedSpanId:r,isLastChild:s,hasChildren:h,isRootSpan:b,isExpanded:w,toggleChildren:T}),l.jsx(zts,{isSelected:r===e.id,isFaded:E,isExpanded:w,toggleChildren:T,expandAllDescendants:j,totalDescendants:v,allDescendantsExpanded:N,numOfChildren:m}),h&&w&&e.spans?.map((I,R,P)=>{const U=R===P.length-1;return l.jsx(OLt,{span:I,depth:t+1,onSpanClick:n,selectedSpanId:r,isLastChild:U,overallLatency:a,overallStartTime:i,fadedTypes:c,searchPhrase:u,expandedSpanIds:f,setExpandedSpanIds:p,featuredSpanIds:d},I.id)})]})}function Uts({hierarchicalSpans:e=[],onSpanClick:t,selectedSpanId:n,isLoading:r,fadedTypes:s,expandedSpanIds:a,setExpandedSpanIds:i,featuredSpanIds:o}){const c=e?.[0]?.latency||0,u=e?.[0]?.startTime||"",d=e?.[0]?.endTime||"";return l.jsx(l.Fragment,{children:r?l.jsxs("div",{className:X("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:[l.jsx(Qt,{})," Loading Trace Timeline ..."]}):l.jsx("div",{className:"grid grid-cols-[1fr_auto]",children:e?.map(f=>l.jsx(OLt,{span:f,onSpanClick:t,selectedSpanId:n,overallLatency:c,overallStartTime:u,overallEndTime:d,fadedTypes:s,featuredSpanIds:o,expandedSpanIds:a,setExpandedSpanIds:i},f.id))})})}function qts({spans:e=[],fadedTypes:t,onLegendClick:n,onLegendReset:r,onSearchPhraseChange:s,traceId:a}){const[i,o]=y.useState("");y.useEffect(()=>{o("")},[a]);const c=pXe.filter(p=>e.some(h=>h?.spanType?.startsWith(p)))||[],u=e.some(p=>!pXe.some(m=>p?.spanType?.startsWith(m))),d=p=>{n?.(p)};y.useEffect(()=>{f(i)},[i,s]);const f=cpt(p=>{s?.(p)},1e3);return l.jsxs("div",{className:"flex gap-3 items-center justify-between",children:[l.jsx("div",{className:"flex",children:l.jsx(rw,{name:"search-spans",label:"Find span by name",labelIsHidden:!0,placeholder:"Look for span name",value:i,onChange:p=>{o(p.target.value)},onReset:()=>o("")})}),l.jsxs(Nr,{spacing:"close",children:[c.map(p=>{const h=_Lt(p),m=t?.includes(p);return l.jsx(y.Fragment,{children:l.jsxs(de,{onClick:()=>d(p),className:m?"opacity-40":"",style:{color:m?void 0:h?.color,backgroundColor:h?.bgColor},children:[h?.icon&&l.jsx(Be,{children:h.icon}),h?.label]})},p)}),u&&l.jsxs(de,{onClick:()=>d("other"),className:t?.includes("other")?"opacity-40":"",children:[l.jsx(Be,{children:l.jsx(O7,{})}),"Other"]}),l.jsx(de,{onClick:r,disabled:t?.length===0,children:l.jsx(Be,{children:l.jsx(Pr,{})})})]})]})}function Vts({traceId:e,selectedSpanId:t,onSpanSelect:n,onClose:r}){const{data:s,isLoading:a}=SLt(e),i=s?.spans??[],[o,c]=y.useState(""),[u,d]=y.useState([]),[f,p]=y.useState([]),[h,m]=y.useState([]),g=y.useMemo(()=>Lts(i),[i]);y.useEffect(()=>{if(o.trim()===""){p([]);return}const w=o.toLowerCase(),_=i.filter(O=>O.name.toLowerCase().includes(w)).map(O=>O.spanId);p(_)},[o,i]),y.useEffect(()=>{c(""),d([]),p([]),m([])},[e]);const v=w=>{n?.(t===w?void 0:w)},b=w=>{d(_=>_.includes(w)?_.filter(O=>O!==w):[..._,w])},S=()=>{d([])};return l.jsxs(l.Fragment,{children:[l.jsx(An.Toolbar,{children:l.jsx(de,{onClick:r,"aria-label":"Close trace panel",children:l.jsx(Pr,{})})}),l.jsxs(An.Content,{children:[l.jsx(Wn,{withMargins:!1,children:l.jsx(Wn.Column,{children:l.jsxs(Wn.Title,{size:"smaller",children:[l.jsx(kc,{})," Trace ",Qf(e)]})})}),l.jsx(qts,{spans:i,fadedTypes:u,onLegendClick:b,onLegendReset:S,searchPhrase:o,onSearchPhraseChange:c,traceId:e}),l.jsx(Uts,{hierarchicalSpans:g,onSpanClick:v,selectedSpanId:t,isLoading:a,fadedTypes:u,expandedSpanIds:h,setExpandedSpanIds:m,featuredSpanIds:f})]})]})}function Hts({results:e,isLoading:t,featuredResultId:n,onResultClick:r,columns:s,scoresByItemId:a,scorerIds:i,setEndOfListElement:o,isFetchingNextPage:c,hasNextPage:u}){const d=s.map(f=>f.size).join(" ");return t?l.jsxs(we,{columns:d,children:[l.jsx(we.Top,{children:s.map(f=>l.jsx(we.TopCell,{children:f.label},f.name))}),l.jsx("div",{className:"flex items-center justify-center py-20 col-span-full",children:l.jsx(Qt,{})})]}):e.length===0?l.jsxs(we,{columns:d,children:[l.jsx(we.Top,{children:s.map(f=>l.jsx(we.TopCell,{children:f.label},f.name))}),l.jsx(we.NoMatch,{message:"No results yet"})]}):l.jsxs(we,{columns:d,children:[l.jsx(we.Top,{children:s.map(f=>l.jsx(we.TopCell,{children:f.label},f.name))}),l.jsxs(we.Rows,{children:[e.map(f=>{const p=!!f.error,h=f.id===n;return l.jsxs(we.Row,{onClick:()=>r(f.id),selected:h,children:[l.jsx(we.TextCell,{children:l.jsx("span",{className:"truncate block font-mono",children:f.itemId})}),l.jsx(we.Cell,{children:l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx("div",{className:"flex items-center justify-center w-10 relative bg-transparent h-full",children:l.jsx("div",{className:X("w-2 h-2 rounded-full",p?"bg-red-700":"bg-green-600")})})}),l.jsx(Yn,{children:p?"Error":"Success"})]})}),s.some(m=>m.name==="input")&&l.jsx(we.TextCell,{children:l.jsx("span",{className:"truncate block font-mono",children:Wts(Zts(f.input),200)})}),i?.map(m=>{const v=a?.[f.itemId]?.find(b=>b.scorerId===m);return l.jsx(we.TextCell,{children:l.jsx("span",{className:"font-mono",children:v!=null?v.score.toFixed(3):"-"})},m)})]},f.id)}),l.jsxs("div",{ref:o,className:"h-1 col-span-full",children:[c&&l.jsx("div",{className:"flex justify-center py-4",children:l.jsx(Qt,{})}),!u&&e.length>0&&l.jsx(ge,{variant:"ui-xs",className:"text-icon3 text-center py-4 block",children:"All results loaded"})]})]})]})}function Zts(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function Wts(e,t){return e.length<=t?e:e.slice(0,t-1)+"..."}function Gts(e){const t=e.scorer;return t?.hasJudge===!1?!0:t?.hasJudge===!0?!1:!e.preprocessPrompt&&!e.analyzePrompt&&!e.generateScorePrompt&&!e.generateReasonPrompt}function Qts({score:e,onNext:t,onPrevious:n,onClose:r}){const s=Gts(e),a=s?"N/A — code-based scorer":"N/A — step not configured";return l.jsxs(l.Fragment,{children:[l.jsxs(An.Toolbar,{children:[l.jsx(Bj,{onPrevious:n,onNext:t,previousAriaLabel:"View previous score details",nextAriaLabel:"View next score details"}),l.jsx(de,{onClick:r,"aria-label":"Close score details",children:l.jsx(Pr,{})})]}),l.jsxs(An.Content,{children:[l.jsx(Wn,{withMargins:!1,children:l.jsx(Wn.Column,{children:l.jsxs(Wn.Title,{size:"smaller",children:[l.jsx(cu,{})," ",e.scorerId]})})}),l.jsxs(sw,{children:[l.jsx(nn.CodeSection,{title:`Score: ${e.score}`,icon:l.jsx(cu,{}),codeStr:e.reason||a,simplified:!0}),l.jsx(nn.CodeSection,{title:"Input",icon:l.jsx(q0,{}),codeStr:JSON.stringify(e.input??null,null,2)}),l.jsx(nn.CodeSection,{title:"Output",icon:l.jsx(qf,{}),codeStr:JSON.stringify(e.output??null,null,2)}),!s&&l.jsxs(l.Fragment,{children:[l.jsx(nn.CodeSection,{title:"Preprocess Prompt",icon:l.jsx(Zc,{}),codeStr:e.preprocessPrompt||a,simplified:!0}),l.jsx(nn.CodeSection,{title:"Analyze Prompt",icon:l.jsx(Zc,{}),codeStr:e.analyzePrompt||a,simplified:!0}),l.jsx(nn.CodeSection,{title:"Generate Score Prompt",icon:l.jsx(Zc,{}),codeStr:e.generateScorePrompt||a,simplified:!0}),l.jsx(nn.CodeSection,{title:"Generate Reason Prompt",icon:l.jsx(Zc,{}),codeStr:e.generateReasonPrompt||a,simplified:!0})]})]})]})]})}const mXe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"avg",label:"Avg Score",size:"1fr"},{name:"count",label:"Items Scored",size:"1fr"}];function Yts({scoresByItemId:e,experimentStatus:t}){const n=y.useMemo(()=>{if(!e)return[];const r={};for(const s of Object.values(e))for(const a of s)r[a.scorerId]||(r[a.scorerId]={sum:0,count:0}),r[a.scorerId].sum+=a.score,r[a.scorerId].count++;return Object.entries(r).map(([s,{sum:a,count:i}])=>({scorerId:s,avg:a/i,count:i})).sort((s,a)=>s.scorerId.localeCompare(a.scorerId))},[e]);if(n.length===0){const r=t==="running"||t==="pending",s=e!==void 0;let a,i;return r?(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…"),l.jsx("div",{className:"flex h-full items-center justify-center py-12",children:l.jsx(oi,{iconSlot:l.jsx(cu,{className:"w-8 h-8 text-neutral3"}),titleSlot:a,descriptionSlot:i})})}return l.jsxs(qt,{children:[l.jsxs(qt.Header,{columns:mXe,children:[l.jsx(qt.HeaderCol,{children:"Scorer"}),l.jsx(qt.HeaderCol,{children:"Avg Score"}),l.jsx(qt.HeaderCol,{children:"Items Scored"})]}),l.jsx(qt.Scroller,{children:l.jsx(qt.Items,{children:n.map(({scorerId:r,avg:s,count:a})=>l.jsxs(qt.Row,{columns:mXe,children:[l.jsx(qt.TextCell,{children:r}),l.jsx(qt.TextCell,{className:"font-mono",children:s.toFixed(3)}),l.jsx(qt.TextCell,{className:"font-mono",children:a})]},r))})})]})}function ELt({experimentId:e,experimentStatus:t,results:n,isLoading:r,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i}){const[o,c]=y.useState(null),[u,d]=y.useState(null),[f,p]=y.useState(void 0),[h,m]=y.useState(null),g=n.find(z=>z.id===o)??null,{data:v}=tLt(e,t),b=y.useMemo(()=>{if(!v)return[];const z=new Set;for(const q of Object.values(v))for(const H of q)z.add(H.scorerId);return[...z].sort()},[v]),{data:S}=SLt(u),w=S?.spans??[],_=()=>{if(!f)return;const z=w.findIndex(q=>q.spanId===f);if(z>=0&&z<w.length-1)return()=>p(w[z+1].spanId)},O=()=>{if(!f)return;const z=w.findIndex(q=>q.spanId===f);if(z>0)return()=>p(w[z-1].spanId)},E=z=>{c(z),d(null),p(void 0),m(null)},T=z=>{E(z===o?null:z)},j=()=>{E(null)},N=()=>{if(!g)return;const z=n.findIndex(q=>q.id===g.id);if(z>=0&&z<n.length-1)return()=>E(n[z+1].id)},I=()=>{if(!g)return;const z=n.findIndex(q=>q.id===g.id);if(z>0)return()=>E(n[z-1].id)},R=g?v?.[g.itemId]:void 0,P=R?.find(z=>z.id===h)??null,U=z=>{m(z===h?null:z),d(null),p(void 0)},M=()=>{if(!h||!R)return;const z=R.findIndex(q=>q.id===h);if(z>=0&&z<R.length-1)return()=>m(R[z+1].id)},L=()=>{if(!h||!R)return;const z=R.findIndex(q=>q.id===h);if(z>0)return()=>m(R[z-1].id)},F=y.useMemo(()=>[{name:"itemId",label:"Item ID",size:"5rem"},{name:"status",label:"Status",size:"3rem"},{name:"input",label:"Input",size:"1fr"},...o?[]:b.map(z=>({name:z,label:z,size:"1fr"}))],[o,b]);return l.jsxs(ku,{defaultTab:"summary",className:"grid grid-rows-[auto_1fr] h-full overflow-hidden",children:[l.jsxs(_u,{children:[l.jsx(Hr,{value:"summary",children:"Summary"}),l.jsx(Hr,{value:"results",children:"Results"})]}),l.jsx(_s,{value:"summary",className:"overflow-y-auto mt-5",children:l.jsx(Yts,{scoresByItemId:v,experimentStatus:t})}),l.jsx(_s,{value:"results",className:"grid overflow-hidden mt-5",children:l.jsxs(Yf,{className:g?"grid-cols-[1fr_2fr]":void 0,children:[l.jsx(An,{children:l.jsx(Hts,{results:n,isLoading:r,featuredResultId:o,onResultClick:T,columns:F,scoresByItemId:v,scorerIds:o?void 0:b,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i})}),g&&l.jsxs(ver,{numOfColumns:1+(!u&&h?1:0)+(u?1:0)+(f?1:0),minColumnWidth:"35rem",children:[g&&l.jsx(An,{withLeftSeparator:!0,children:l.jsx(Mts,{result:g,scores:R,onPrevious:I(),onNext:N(),onClose:j,onScoreClick:U,featuredScoreId:h,onShowTrace:()=>{d(g.traceId??null),p(void 0),m(null)}})}),g&&!u&&P&&l.jsx(An,{withLeftSeparator:!0,children:l.jsx(Qts,{score:P,onNext:M(),onPrevious:L(),onClose:()=>m(null)})}),g&&u&&l.jsx(An,{withLeftSeparator:!0,children:l.jsx(Vts,{traceId:u,selectedSpanId:f,onSpanSelect:p,onClose:()=>{d(null),p(void 0)}})}),g&&u&&f&&l.jsx(An,{withLeftSeparator:!0,children:l.jsx(Dts,{traceId:u,spanId:f,onNext:_(),onPrevious:O(),onClose:()=>p(void 0)})})]})]})})]})}const Xts={pending:l.jsx(Qk,{}),running:l.jsx(xz,{}),completed:l.jsx(Ka,{}),failed:l.jsx(Pr,{})};function Kts({experiment:e,className:t}){const n=e.status,r=e.totalItems-e.succeededCount-e.failedCount;return l.jsxs("div",{className:X("grid justify-items-end gap-3",t),children:[l.jsxs("div",{className:"flex p-1 px-3 text-ui-lg capitalize text-neutral4 gap-2 items-center bg-surface5 rounded-lg ",children:[l.jsx("span",{className:X("w-5 h-5 flex items-center justify-center rounded-full text-black","[&>svg]:w-4 [&>svg]:h-4",{"bg-green-700":n==="completed","bg-red-700":n==="failed","bg-cyan-600":n==="running","bg-yellow-600":n==="pending"}),children:Xts[n]}),e.status]}),l.jsxs("div",{className:X("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:[l.jsxs("span",{children:["Total: ",l.jsx("b",{children:e.totalItems})]}),l.jsxs("span",{children:["Succeeded: ",l.jsx("b",{children:e.succeededCount})]}),l.jsxs("span",{children:["Failed: ",l.jsx("b",{children:e.failedCount})]}),(n==="pending"||n==="running")&&l.jsxs("span",{children:["Pending: ",l.jsx("b",{children:r})]})]})]})}function CLt({experimentId:e,experiment:t}){const{Link:n,paths:r}=an(),{data:s}=Lv(),{data:a}=Bw(),{data:i}=Op(),o=()=>{switch(t.targetType){case"agent":return r.agentLink(t.targetId);case"workflow":return r.workflowLink(t.targetId);case"scorer":return r.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 l.jsxs(Wn,{children:[l.jsxs(Wn.Column,{children:[l.jsxs(Wn.Title,{children:[l.jsx(tet,{}),e," ",e&&l.jsx(la,{content:e})]}),l.jsxs(Wn.Description,{children:[l.jsxs(fs,{children:[l.jsx(xC,{})," Created at ",kn(new Date(t.createdAt),"MMM d, yyyy 'at' h:mm a")]}),t.completedAt&&l.jsxs(fs,{children:[l.jsx(xC,{})," Completed at ",kn(new Date(t.completedAt),"MMM d, yyyy 'at' h:mm a")]})]}),l.jsxs(Wn.Description,{children:[l.jsxs(fs,{children:[l.jsx(zWt,{})," Target",l.jsx(n,{href:o(),children:c()})]}),t.agentVersion&&l.jsxs(fs,{children:[l.jsx(C7,{})," Version",t.targetType==="agent"&&t.targetId?l.jsx(n,{href:`${r.agentLink(t.targetId)}/editor?version=${encodeURIComponent(t.agentVersion)}`,className:"font-mono text-xs underline hover:text-accent1",children:t.agentVersion}):l.jsx("span",{className:"font-mono text-xs",children:t.agentVersion}),l.jsx(la,{content:t.agentVersion})]})]})]}),l.jsx(Wn.Column,{children:l.jsx(Kts,{experiment:t})})]})}function ROe({delta:e}){const t=e>0?l.jsx(ai,{size:"small",color:"green",intensity:"muted",children:l.jsx(zle,{})}):e<0?l.jsx(ai,{size:"small",color:"red",intensity:"muted",children:l.jsx(gZt,{})}):null;return l.jsxs("span",{className:X("font-mono text-sm text-neutral4 min-w-20"),children:[l.jsx("span",{className:"w-3 inline-block",children:e>0?"+ ":e<0?"- ":""}),Math.abs(e).toFixed(2)," ",t]})}function z5(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function Jts({item:e,baselineId:t,contenderId:n,baselineVersion:r,contenderVersion:s,onPrevious:a,onNext:i,onClose:o}){const c=e.results[t],u=e.results[n],d=!!(c&&u),f=new Set;if(c)for(const h of Object.keys(c.scores))f.add(h);if(u)for(const h of Object.keys(u.scores))f.add(h);const p=[...f].sort();return l.jsxs(An,{withLeftSeparator:!0,children:[l.jsxs(An.Toolbar,{children:[l.jsx(Bj,{onPrevious:a,onNext:i,previousAriaLabel:"Previous comparison item",nextAriaLabel:"Next comparison item"}),l.jsx(Nr,{children:l.jsx(de,{onClick:o,"aria-label":"Close comparison detail panel",children:l.jsx(Pr,{})})})]}),l.jsxs(An.Content,{className:"pb-6",children:[l.jsx(Wn,{withMargins:!1,children:l.jsx(Wn.Column,{children:l.jsxs(Wn.Title,{size:"smaller",children:[l.jsx(q0,{})," ",e.itemId]})})}),d?l.jsx(l.Fragment,{children:l.jsxs(sw,{children:[p.length>0&&l.jsxs("div",{className:"grid gap-3",children:[l.jsx("h4",{className:"text-sm font-medium text-neutral5",children:"Scores"}),l.jsx("div",{className:"grid gap-2",children:p.map(h=>{const m=c?.scores[h]??null,g=u?.scores[h]??null,v=m!=null&&g!=null?g-m:null;return l.jsxs("div",{className:"flex items-center justify-between gap-4 px-3 py-2 rounded-lg bg-surface2",children:[l.jsx("span",{className:"text-sm text-neutral5 font-medium",children:h}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("span",{className:"text-sm text-neutral3",children:[m!=null?m.toFixed(3):"-"," →"," ",g!=null?g.toFixed(3):"-"]}),v!=null&&l.jsx(ROe,{delta:v})]})]},h)})})]}),l.jsx(nn.CodeSection,{title:l.jsxs(l.Fragment,{children:[l.jsx(ai,{color:"purple",children:"Baseline "})," Experiment Output"]}),icon:l.jsx(qf,{}),codeStr:z5(c?.output)}),l.jsx(nn.CodeSection,{title:l.jsxs(l.Fragment,{children:[l.jsx(ai,{color:"cyan",children:"Contender "})," Experiment Output"]}),icon:l.jsx(qf,{}),codeStr:z5(u?.output)}),l.jsx(nn.CodeSection,{title:"Item Input",icon:l.jsx(V0,{}),codeStr:z5(e.input)}),l.jsx(nn.CodeSection,{title:"Item Ground Truth",icon:l.jsx(bet,{}),codeStr:z5(e.groundTruth)})]})}):l.jsx(Hn,{variant:"warning",title:"Comparison not available",children:l.jsx(Hn.Message,{children:(()=>{const h=c?"Contender":"Baseline",m=c?s:r;return l.jsxs(l.Fragment,{children:["The ",h," experiment was run against dataset",m!=null?` v. ${m}`:"",", which does not contain this item."]})})()})})]})]})}function ens({items:e,baselineId:t,contenderId:n,scorerIds:r,featuredItemId:s,columns:a,onItemClick:i}){return l.jsx(An,{children:l.jsxs(qt,{children:[l.jsxs(qt.Header,{columns:a,children:[l.jsx(qt.HeaderCol,{children:"Item ID"}),!s&&r.map(o=>l.jsx(qt.HeaderCol,{className:"flex justify-center",children:o},o))]}),l.jsx(qt.Scroller,{children:l.jsx(qt.Items,{children:e.map(o=>{const c=o.results[t],u=o.results[n],d=!!(c&&u);return l.jsx(qt.Row,{children:l.jsxs(qt.RowButton,{item:{id:o.itemId},columns:a,isFeatured:s===o.itemId,onClick:i,children:[l.jsx(qt.IdCell,{id:o.itemId,className:d?"":"text-neutral1"}),!s&&l.jsx(l.Fragment,{children:r.map(f=>{const p=c?.scores[f]??null,h=u?.scores[f]??null,m=p!=null&&h!=null?h-p:null;return l.jsx(qt.Cell,{className:"flex items-center gap-5 justify-center font-mono",children:m!=null?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"flex items-center text-neutral2 min-w-24",children:[p?.toFixed(2)," → ",h?.toFixed(2)]}),l.jsx(ROe,{delta:m})]}):l.jsx("span",{className:"text-neutral1",children:"-"})},f)})})]})},o.itemId)})})})]})})}const tns={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 gXe({datasetId:e,experiment:t,type:n}){const{Link:r}=an(),{label:s,color:a,customStyle:i}=tns[n];if(!t)return null;const o=t.createdAt?new Date(t.createdAt):null;return l.jsxs("div",{className:`grid border-2 border-border1 rounded-lg p-5 gap-3 ${i}`,children:[l.jsxs("div",{className:"flex items-center gap-3 w-full overflow-clip",children:[n==="contender"&&l.jsxs(ai,{size:"small",color:a,children:[s,l.jsx(kS,{})]}),l.jsx(de,{as:r,href:`/datasets/${e}/experiments/${t.id}`,children:l.jsx("span",{className:"truncate min-w-0",children:t.id})}),n==="baseline"&&l.jsxs(ai,{size:"small",color:a,children:[l.jsx(Eb,{})," ",s]})]}),l.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-ui-sm text-neutral3",children:[l.jsxs(fs,{children:[l.jsx(bet,{})," ",t.targetType," / ",t.targetId]}),l.jsxs(fs,{children:[l.jsx(uet,{})," v",t.datasetVersion??"—"]}),o&&l.jsxs(fs,{children:[l.jsx(QJe,{})," ",kn(o,"MMM d, yyyy HH:mm")]})]})]})}function nns({datasetId:e,experimentIdA:t,experimentIdB:n,onSwap:r}){const[s,a]=y.useState(null),{data:i,isLoading:o,error:c}=yes(e,t,n),{data:u}=d7(e,t),{data:d}=d7(e,n),f=u&&d&&u.datasetVersion!==d.datasetVersion,p=y.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]),h=y.useMemo(()=>{if(!i||p.length===0)return[];const T=i.baselineId,j=t===T?n:t;return p.map(N=>{let I=0,R=0,P=0,U=0;for(const z of i.items){const q=z.results[T]?.scores[N],H=z.results[j]?.scores[N];q!=null&&(I+=q,P++),H!=null&&(R+=H,U++)}const M=P>0?I/P:null,L=U>0?R/U:null,F=M!=null&&L!=null?L-M:null;return{scorerId:N,avgA:M,avgB:L,delta:F}})},[i,p,t,n]),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=y.useMemo(()=>[{name:"itemId",label:"Item ID",size:"8rem"},...s?[]:p.map(T=>({name:T,label:T,size:"1fr"}))],[p,s]),v=i?.items.find(T=>T.itemId===s)??null,b=T=>{a(T===s?null:T)},S=()=>{a(null)},w=()=>{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)},_=()=>{if(!i||!s)return;const T=i.items.findIndex(j=>j.itemId===s);if(T>0)return()=>a(i.items[T-1].itemId)};if(o)return l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx(Qt,{})});if(c)return l.jsx(Hn,{variant:"warning",title:"Error loading comparison",children:l.jsx(Hn.Message,{children:c instanceof Error?c.message:"Unknown error"})});if(!i||i.items.length===0)return l.jsx("div",{className:"text-neutral4 text-sm text-center py-8",children:"No comparison data"});const O=i.baselineId,E=t===O?n:t;return l.jsxs("div",{className:"grid gap-10",children:[u&&d&&l.jsxs("div",{className:X("relative grid xl:grid-cols-[1fr_auto_1fr] gap-4 xl:gap-0"),children:[l.jsx(gXe,{datasetId:e,experiment:u,type:"baseline"}),l.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:l.jsx("div",{className:"relative z-1 bg-surface2 rounded-lg p-2",children:l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx(de,{onClick:r,children:"VS"})}),l.jsx(Yn,{children:"Switch the order"})]})})}),l.jsx(gXe,{datasetId:e,experiment:d,type:"contender"})]}),f&&l.jsx(Hn,{variant:"warning",title:"Version mismatch",children:l.jsxs(Hn.Message,{children:["These experiments used different dataset versions (v",u.datasetVersion," vs v",d.datasetVersion,"). Results may not be directly comparable."]})}),h.length>0&&l.jsxs(qt,{children:[l.jsxs(qt.Header,{columns:m,children:[l.jsx(qt.HeaderCol,{children:"Scorer"}),l.jsx(qt.HeaderCol,{className:"flex justify-center",children:l.jsxs(F5e,{children:[l.jsx(ai,{color:"purple",size:"small",intensity:"muted",children:"Baseline"}),l.jsx(ai,{color:"purple",size:"small",children:"Avg"})]})}),l.jsx(qt.HeaderCol,{className:"flex justify-center",children:l.jsxs(F5e,{children:[l.jsx(ai,{color:"cyan",size:"small",intensity:"muted",children:"Contender"}),l.jsx(ai,{color:"cyan",size:"small",children:"Avg"})]})}),l.jsx(qt.HeaderCol,{className:"flex justify-center",children:"Delta"})]}),l.jsx(qt.Scroller,{children:l.jsx(qt.Items,{children:h.map(({scorerId:T,avgA:j,avgB:N,delta:I})=>l.jsxs(qt.Row,{columns:m,children:[l.jsx(qt.TextCell,{children:T}),l.jsx(qt.TextCell,{className:"text-center font-mono",children:j!=null?j.toFixed(3):"-"}),l.jsx(qt.TextCell,{className:"text-center font-mono",children:N!=null?N.toFixed(3):"-"}),l.jsx(qt.TextCell,{className:"flex justify-center",children:I!=null?l.jsx(ROe,{delta:I}):"-"})]},T))})})]}),l.jsxs(Yf,{className:X({"grid-cols-[1fr_2fr]":!!v}),children:[l.jsx(ens,{items:i.items,baselineId:O,contenderId:E,scorerIds:p,featuredItemId:s,columns:g,onItemClick:b}),!!v&&l.jsx(Jts,{item:v,baselineId:O,contenderId:E,baselineVersion:u?.datasetVersion,contenderVersion:d?.datasetVersion,onPrevious:_(),onNext:w(),onClose:S})]})]})}function rns({datasetId:e,itemId:t,onVersionSelect:n,onCompareVersionsClick:r,activeVersion:s}){const{data:a,isLoading:i}=IOe(e,t),[o,c]=y.useState(!1),[u,d]=y.useState(new Set),f=b=>{n?.(b)},p=b=>s==null?b.isLatest:b.datasetVersion===s,h=b=>{d(S=>{const w=new Set(S);if(w.has(b))w.delete(b);else if(w.size>=2){const[_]=Array.from(w);return new Set([_,b])}else w.add(b);return w})},m=()=>{c(!1),d(new Set)},g=()=>{c(!0)},v=()=>{u.size===2&&r?.([...u])};return l.jsxs(An,{className:"min-w-56",children:[o?l.jsx(An.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:l.jsxs(Nr,{children:[l.jsx(de,{onClick:m,children:"Cancel"}),l.jsx(de,{variant:"primary",disabled:u.size!==2,onClick:v,tooltip:u.size!==2?"Check 2 versions to compare":void 0,className:"grow",children:"Compare"})]})}):l.jsx(l.Fragment,{children:(a||[]).length>1&&l.jsx(An.Toolbar,{children:l.jsxs(de,{onClick:g,className:"w-full",children:[l.jsx(H0,{})," Compare Ver."]})})}),i?l.jsx(sns,{}):l.jsxs(qt,{children:[l.jsx(qt.Header,{children:l.jsx(qt.HeaderCol,{children:"Item Version History"})}),l.jsx(qt.Scroller,{children:l.jsx(qt.Items,{children:a?.map(b=>{const S=String(b.datasetVersion),w=typeof b.updatedAt=="string"?new Date(b.updatedAt):b.updatedAt;return l.jsxs(qt.Row,{isSelected:o&&u.has(S),children:[o&&l.jsx(qt.LabelCell,{children:l.jsx(oo,{checked:u.has(S),disabled:b.isDeleted,onCheckedChange:()=>{},onClick:_=>{_.stopPropagation(),b.isDeleted||h(S)},"aria-label":`Select version ${b.datasetVersion}`})}),l.jsx(qt.RowButton,{item:b,columns:[{name:"version",label:"Item Version History",size:"1fr"}],isFeatured:p(b),onClick:()=>f(b),className:"py-2",children:l.jsx(qt.VersionCell,{version:b.datasetVersion,date:w,isLatest:b.isLatest,isDeleted:b.isDeleted})})]},String(b.datasetVersion))})})})]})]})}function sns(){return l.jsxs(qt,{children:[l.jsx(qt.Header,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:l.jsx(qt.HeaderCol,{children:"Item Version History"})}),l.jsx(qt.Items,{children:Array.from({length:3}).map((e,t)=>l.jsx(qt.Row,{children:l.jsx(qt.RowButton,{columns:[{name:"version",label:"Item Version History",size:"1fr"}],children:l.jsx(qt.TextCell,{isLoading:!0,children:"Loading..."})})},t))})]})}function ans(e,t){if(t){const n=typeof t=="string"?new Date(t):t;return`v${e} ${kn(n,"MMM dd 'at' H:mm:ss a")}`}return`v${e}`}function ins({datasetId:e,versionA:t,versionB:n,onVersionChange:r}){const{data:s}=NOe(e),a=(s??[]).map(i=>({value:String(i.version),label:`${ans(i.version,i.createdAt)}${i.isCurrent?" (current)":""}`}));return l.jsxs(An.Toolbar,{className:"grid grid-cols-[1fr_1fr_1fr_10rem] gap-4 w-full",children:[l.jsx("div",{}),l.jsx(Yl,{label:"Version A",labelIsHidden:!0,name:"version-a",placeholder:"Select version",options:a,value:t??"",onValueChange:i=>r?.(i,n??"")}),l.jsx(Yl,{label:"Version B",labelIsHidden:!0,name:"version-b",options:a,value:n??"",onValueChange:i=>r?.(t??"",i)}),l.jsx("div",{})]})}const ons=[{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"}],lns={added:{color:"blue",borderColor:"border-blue-900",icon:l.jsx(Cs,{}),tooltip:"Added in this version"},changed:{color:"orange",borderColor:"border-yellow-900",icon:l.jsx(vet,{}),tooltip:"Changed in this version"},same:{color:"green",borderColor:"border-green-900",icon:l.jsx(YWt,{}),tooltip:"Same in both versions"}};function ele({red:e=!1,tooltip:t}){return l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx(EZt,{className:X("text-neutral3/40 w-5 h-5 ",{"text-red-900":e})})}),t&&l.jsx(Yn,{children:t})]})}function M1({variant:e,version:t}){if(!e)return l.jsxs("span",{className:"text-ui-md text-neutral4",children:["v. ",t]});const{color:n,icon:r,tooltip:s}=lns[e];return l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsxs("div",{className:"grid grid-cols-[1fr_auto]",children:[t!==void 0&&l.jsxs("span",{className:"pr-3 text-ui-md text-neutral4 min-w-16 flex justify-end",children:["v. ",t]}),l.jsx(ai,{color:n,size:"small",children:r})]})}),l.jsx(Yn,{children:s})]})}function cns(e,t){return e&&t&&e.datasetVersion===t.datasetVersion?"same":e&&t&&e.datasetVersion!==t.datasetVersion?"changed":e?"added":"removed"}function uns({datasetId:e,versionA:t,versionB:n,allItems:r,itemsAMap:s,itemsBMap:a}){const{Link:i}=an(),o=t>n;return l.jsx(qt,{children:l.jsx(qt.Scroller,{children:l.jsx(qt.Items,{children:r.map(({id:c})=>{const u=s.get(c),d=a.get(c),f=cns(u,d);return l.jsxs(qt.Row,{columns:ons,children:[l.jsx(qt.IdCell,{id:c,isShortened:!1}),f!=="same"?l.jsxs(l.Fragment,{children:[u?.datasetVersion?l.jsx(qt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!d&&o?l.jsx(M1,{variant:"added",version:u.datasetVersion}):f==="changed"&&o?l.jsx(M1,{variant:"changed",version:u.datasetVersion}):l.jsx(M1,{version:u.datasetVersion})}):l.jsx(qt.Cell,{className:"justify-center flex items-center",children:l.jsx(ele,{red:o,tooltip:o?"Deleted in this version":"Not present in this version"})}),d?.datasetVersion?l.jsx(qt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"gap-2",children:!u&&!o?l.jsx(M1,{variant:"added",version:d.datasetVersion}):f==="changed"&&!o?l.jsx(M1,{variant:"changed",version:d.datasetVersion}):l.jsx(M1,{version:d.datasetVersion})}):l.jsx(qt.Cell,{className:"justify-center flex items-center",children:l.jsx(ele,{red:!o,tooltip:o?"Not present in this version":"Deleted in this version"})})]}):l.jsx(qt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}`,className:"col-span-2 gap-2",children:l.jsx(M1,{variant:"same",version:d?.datasetVersion})}),f==="changed"?l.jsx(qt.LinkCell,{LinkComponent:i,href:`/datasets/${e}/items/${c}/versions?ids=${u?.datasetVersion},${d?.datasetVersion}`,children:"Compare"}):l.jsx(qt.Cell,{children:l.jsx(ele,{tooltip:l.jsxs(l.Fragment,{children:["Comparing is available",l.jsx("br",{})," only for changed items"]})})})]},c)})})})})}const vXe={needsReview:"#facc15",complete:"#22c55e"},dns=[{label:"Needs Review",color:vXe.needsReview},{label:"Reviewed",color:vXe.complete}];function fns({reviewSummary:e,experiments:t,datasets:n,isLoading:r,isError:s}){const{data:a,maxVal:i,totalInPipeline:o}=y.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(n)for(const m of n)d.set(m.id,m.name);let f=0,p=0;const h=[];for(const m of e.counts){const g=m.needsReview+m.complete;if(g===0)continue;p+=g,g>f&&(f=g);const v=u.get(m.experimentId),b=v?.datasetId?d.get(v.datasetId):void 0,S=b?`${b} · ${m.experimentId.slice(0,8)}`:m.experimentId.slice(0,8);h.push({name:S,values:[m.needsReview,m.complete]})}return{data:h,maxVal:f,totalInPipeline:p}},[e,t,n]),c=a.length>0;return l.jsxs(Vt,{children:[l.jsxs(Vt.TopBar,{children:[l.jsx(Vt.TitleAndDescription,{title:"Review Pipeline",description:"Items in review across experiments."}),c&&l.jsx(Vt.Summary,{value:String(o),label:"Items in pipeline"})]}),r?l.jsx(Vt.Loading,{}):s?l.jsx(Vt.Error,{message:"Failed to load review data"}):l.jsx(Vt.Content,{children:c?l.jsx(iT,{data:a,segments:dns,maxVal:i,fmt:u=>String(u)}):l.jsx(Vt.NoData,{message:"No items have been sent to review yet"})})]})}function POe(){const e=Ze();return St({queryKey:["experiment-review-summary"],queryFn:()=>e.getExperimentReviewSummary()})}function TLt(e){const t=new Map;if(!e?.counts)return t;for(const n of e.counts)t.set(n.experimentId,{needsReview:n.needsReview,complete:n.complete,total:n.total});return t}function pns(e,t){const n=new Map,r=TLt(e);if(!r.size||!t)return n;for(const s of t){const a=r.get(s.id);if(!a||!s.datasetId||a.needsReview+a.complete===0)continue;const o=n.get(s.datasetId)??{needsReview:0,complete:0};o.needsReview+=a.needsReview,o.complete+=a.complete,n.set(s.datasetId,o)}return n}function hns(e){return e?.counts?e.counts.reduce((t,n)=>({needsReview:t.needsReview+n.needsReview,complete:t.complete+n.complete,inPipeline:t.inPipeline+n.needsReview+n.complete}),{needsReview:0,complete:0,inPipeline:0}):{needsReview:0,complete:0,inPipeline:0}}const mns=10;function gns(){const[e,t]=y.useState(!1),[n,r]=y.useState(""),[s,a]=y.useState("all"),[i,o]=y.useState("all"),[c,u]=y.useState("all"),[d,f]=y.useState(0),{data:p,isLoading:h,error:m}=Rv({page:d,perPage:mns}),{data:g,isLoading:v,error:b}=AH(),{data:S}=POe(),w=y.useMemo(()=>p?.datasets??[],[p?.datasets]),_=p?.pagination?.hasMore??!1,O=y.useMemo(()=>g?.experiments??[],[g?.experiments]),E=y.useMemo(()=>$es(w),[w]),T=y.useMemo(()=>pns(S,O),[S,O]),j=h||v,N=m||b,I=()=>t(!0),R=y.useCallback(()=>f(H=>H+1),[]),P=y.useCallback(()=>f(H=>Math.max(0,H-1)),[]),U=y.useCallback(H=>{r(H),f(0)},[]),M=y.useCallback(H=>{a(H),f(0)},[]),L=y.useCallback(H=>{o(H),f(0)},[]),F=y.useCallback(H=>{u(H),f(0)},[]);if(N&&zs(N))return l.jsx(ir,{children:l.jsx(ua,{})});if(N&&Bs(N))return l.jsx(ir,{children:l.jsx(na,{resource:"datasets"})});if(N)return l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load datasets",message:N.message})});if(w.length===0&&!j&&d===0)return l.jsxs(l.Fragment,{children:[l.jsx(ir,{children:l.jsx(Des,{onCreateClick:I})}),l.jsx(Qhe,{open:e,onOpenChange:t})]});const z=s!=="all"||i!=="all"||c!=="all"||n!=="",q=()=>{r(""),a("all"),o("all"),u("all"),f(0)};return l.jsxs(wn,{children:[l.jsx(wn.TopArea,{children:l.jsx(zes,{search:n,onSearchChange:U,targetFilter:s,onTargetFilterChange:M,experimentFilter:i,onExperimentFilterChange:L,tagFilter:c,onTagFilterChange:F,tagOptions:E,onReset:q,hasActiveFilters:z,onCreateClick:I})}),l.jsx(Res,{datasets:w,experiments:O,reviewByDataset:T,isLoading:j,search:n,targetFilter:s,experimentFilter:i,tagFilter:c,currentPage:d,hasMore:_,onNextPage:R,onPrevPage:P}),l.jsx(Qhe,{open:e,onOpenChange:t})]})}const vns=new Set(["items","experiments","review"]);function yns(){const{datasetId:e}=Mr(),t=bu(),[n,r]=fo(),s=n.get("tab"),a=s&&vns.has(s)?s:"items",i=E=>{r(E==="items"?{}:{tab:E},{replace:!0})},[o,c]=y.useState(!1),[u,d]=y.useState(!1),[f,p]=y.useState(!1),[h,m]=y.useState(!1),[g,v]=y.useState(null),{data:b,error:S}=Ub(e??"");if(!e)return l.jsx(fr,{children:l.jsx(kh,{children:l.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(S&&zs(S))return l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})});if(S&&Bs(S))return l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"datasets"})})});const w=E=>{t(`/datasets/${e}/experiments/${E}`)},_=()=>{t("/datasets")},O=E=>{v(E?.version??null)};return l.jsx(fr,{children:l.jsxs(kh,{className:"content-stretch",children:[l.jsx(Tts,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>p(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:O,initialTab:a,onTabChange:i,experimentTriggerSlot:l.jsxs(de,{variant:"primary",onClick:()=>c(!0),children:[l.jsx(rb,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),l.jsx(Pts,{datasetId:e,version:g??void 0,open:o,onOpenChange:c,onSuccess:w}),l.jsx(Nts,{datasetId:e,open:u,onOpenChange:d}),b&&l.jsx(qes,{open:f,onOpenChange:p,dataset:{id:b.id,name:b.name,description:b?.description||"",inputSchema:b.inputSchema,groundTruthSchema:b.groundTruthSchema}}),b&&l.jsx(Ves,{open:h,onOpenChange:m,datasetId:b.id,datasetName:b.name,onSuccess:_})]})})}function bns(){const{datasetId:e,experimentId:t}=Mr(),{data:n,isLoading:r,error:s}=d7(e,t),{data:a,isLoading:i,setEndOfListElement:o,isFetchingNextPage:c,hasNextPage:u}=NH({datasetId:e,experimentId:t,experimentStatus:n?.status});return!e||!t?null:r?l.jsx(fr,{children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Qt,{})})}):s&&zs(s)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})}):s&&Bs(s)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"datasets"})})}):s||!n?l.jsx(fr,{children:l.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",s instanceof Error?s.message:"Unknown error"]})}):l.jsx(fr,{children:l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[l.jsx(CLt,{experimentId:t,experiment:n}),l.jsx(ELt,{experimentId:t,experimentStatus:n?.status,results:a??[],isLoading:i,setEndOfListElement:o,isFetchingNextPage:c,hasNextPage:u})]})})})}function xns(){const{datasetId:e}=Mr(),[t,n]=fo(),{error:r}=Ub(e??""),s=t.get("baseline")??"",a=t.get("contender")??"";return r&&zs(r)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})}):r&&Bs(r)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"datasets"})})}):!e||!s||!a?l.jsx(fr,{children:l.jsx(kh,{children:l.jsxs("div",{className:"text-neutral4 text-center py-8",children:[l.jsx("p",{children:"Select two experiments to compare."}),l.jsxs("p",{className:"text-sm mt-2",children:["Use the URL format: /datasets/","{datasetId}","/experiments?baseline=","{experimentIdA}","&contender=","{experimentIdB}"]})]})})}):l.jsx(fr,{children:l.jsx(kh,{children:l.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[l.jsxs(Wn,{children:[l.jsxs(Wn.Column,{children:[l.jsxs(Wn.Title,{children:[l.jsx(H0,{})," Dataset Experiments Comparison"]}),l.jsxs(Wn.Description,{children:["Comparing"," ",l.jsx(qi,{to:`/datasets/${e}/experiments/${s}`,children:s.slice(0,8)})," vs"," ",l.jsx(qi,{to:`/datasets/${e}/experiments/${a}`,children:a.slice(0,8)})]})]}),l.jsx(Wn.Column,{children:l.jsxs(de,{as:qi,to:`/datasets/${e}`,children:[l.jsx(Eb,{}),"Back to Dataset"]})})]}),l.jsx(nns,{datasetId:e,experimentIdA:s,experimentIdB:a,onSwap:()=>{n({baseline:a,contender:s})}})]})})})}function wns(){const{datasetId:e,itemId:t}=Mr(),{Link:n}=an(),r=bu(),{data:s,isLoading:a,error:i}=IOe(e??"",t??""),{updateItem:o,deleteItem:c}=Di(),{data:u}=Ub(e??""),d=s?.[0]??null,f=d?.isDeleted??!1,[p,h]=y.useState(null),m=y.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,[v,b]=y.useState(!1),[S,w]=y.useState(m.input),[_,O]=y.useState(m.groundTruth),[E,T]=y.useState(m.metadata),[j,N]=y.useState(g);g!==j&&(N(g),w(m.input),O(m.groundTruth),T(m.metadata));const[I,R]=y.useState(!1),P=V=>{h(f?V:V.isLatest?null:V)},U=()=>{h(null)},M=!f&&p!=null,L=()=>{M||b(!0)},F=()=>{M||R(!0)},z=async()=>{if(!e||!t)return;let V;try{V=JSON.parse(S)}catch{Fe.error("Input must be valid JSON");return}let $;if(_.trim())try{$=JSON.parse(_)}catch{Fe.error("Ground Truth must be valid JSON");return}let W;if(E.trim())try{W=JSON.parse(E)}catch{Fe.error("Metadata must be valid JSON");return}try{await o.mutateAsync({datasetId:e,itemId:t,input:V,groundTruth:$,metadata:W}),Fe.success("Item updated successfully"),b(!1)}catch(G){Fe.error(`Failed to update item: ${G instanceof Error?G.message:"Unknown error"}`)}},q=()=>{d&&(w(JSON.stringify(d.input,null,2)),O(d.groundTruth?JSON.stringify(d.groundTruth,null,2):""),T(d.metadata?JSON.stringify(d.metadata,null,2):"")),b(!1)},H=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),Fe.success("Item deleted successfully"),R(!1),r(`/datasets/${e}`)}catch(V){Fe.error(`Failed to delete item: ${V instanceof Error?V.message:"Unknown error"}`)}},D=p??d,Y=D?{id:t??"",datasetId:e??"",datasetVersion:D.datasetVersion,input:D.input,groundTruth:D.groundTruth,metadata:D.metadata,createdAt:D.createdAt,updatedAt:D.updatedAt}:null;return i&&zs(i)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})}):i&&Bs(i)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"datasets"})})}):a?null:!e||!t||!s||s.length===0?l.jsx(fr,{children:l.jsx(kh,{children:l.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):l.jsxs(l.Fragment,{children:[l.jsx(fr,{children:l.jsx("div",{className:"h-full overflow-hidden px-6 pb-4",children:l.jsxs("div",{className:"grid gap-6 max-w-[60rem] mx-auto grid-rows-[auto_1fr] h-full",children:[l.jsxs(Wn,{children:[l.jsxs(Wn.Column,{children:[l.jsxs(Wn.Title,{children:[l.jsx(q0,{}),t," ",l.jsx(la,{content:t})]}),l.jsx(Wn.Description,{children:l.jsxs(fs,{children:["Item of ",l.jsx(U0,{})," ",u?.name]})}),l.jsxs(Wn.Description,{children:[l.jsxs(fs,{children:[l.jsx(xC,{})," Created at"," ",d?.createdAt?kn(new Date(d.createdAt),"MMM d, yyyy"):""]}),l.jsxs(fs,{children:[l.jsx(kw,{})," Latest version v",d?.datasetVersion??""]})]})]}),l.jsx(Wn.Column,{children:!v&&!f&&l.jsxs(Nr,{children:[l.jsxs(de,{onClick:L,disabled:M,title:M?"Return to latest version to edit":void 0,children:[l.jsx(vet,{})," Edit"]}),l.jsxs(de,{onClick:F,disabled:M,title:M?"Return to latest version to delete":void 0,children:[l.jsx(Zd,{})," Delete"]})]})})]}),l.jsxs(Yf,{className:v?"grid-cols-1":"grid-cols-[1fr_auto]",children:[l.jsxs(An,{withRightSeparator:!v,children:[f&&d&&l.jsx(Hn,{variant:"destructive",title:"Item deleted",children:l.jsxs(Hn.Message,{children:["This item was deleted at version v",d.datasetVersion]})}),!f&&M&&p&&l.jsx(Hn,{variant:"warning",title:"Previous version",action:l.jsxs(Hn.Button,{onClick:U,children:[l.jsx(X1,{})," Return to the latest version"]}),children:l.jsxs(Hn.Message,{children:["Viewing version v",p.datasetVersion]})}),v?l.jsx(bLt,{inputValue:S,setInputValue:w,groundTruthValue:_,setGroundTruthValue:O,metadataValue:E,setMetadataValue:T,validationErrors:null,onSave:z,onCancel:q,isSaving:o.isPending}):Y?l.jsx(IH,{item:Y,Link:n}):l.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!v&&l.jsx(An,{children:l.jsx(rns,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:P,onCompareVersionsClick:V=>{r(`/datasets/${e}/items/${t}/versions?ids=${V.join(",")}`)},activeVersion:p?.datasetVersion??null})})]})]})})}),l.jsx(Gt,{open:I,onOpenChange:R,children:l.jsxs(Gt.Content,{children:[l.jsxs(Gt.Header,{children:[l.jsx(Gt.Title,{children:"Delete Item"}),l.jsx(Gt.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),l.jsxs(Gt.Footer,{children:[l.jsx(Gt.Cancel,{children:"Cancel"}),l.jsx(Gt.Action,{onClick:H,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function yXe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function Sns(){const{datasetId:e}=Mr(),[t,n]=fo(),r=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=Ub(e??""),{Link:i}=an(),[o,c]=y.useState(!1),{data:u}=Zhe(e??"",r[0]??""),{data:d}=Zhe(e??"",r[1]??"");return a&&zs(a)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})}):a&&Bs(a)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"datasets"})})}):!e||r.length<2?l.jsx(fr,{children:l.jsx(kh,{children:l.jsx("div",{className:"text-neutral4 text-center py-8",children:l.jsx("p",{children:"Select at least two items to compare."})})})}):l.jsxs(fr,{children:[l.jsx(Pv,{owner:"dataset-items-compare",children:l.jsxs(de,{as:qi,to:`/datasets/${e}`,variant:"outline",children:[l.jsx(Eb,{}),"Back to Dataset"]})}),l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:X("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":o}),children:[l.jsxs(Wn,{children:[l.jsxs(Wn.Column,{children:[l.jsxs(Wn.Title,{children:[l.jsx(H0,{}),"Compare Dataset Items"]}),l.jsx(Wn.Description,{children:l.jsxs(fs,{children:["Comparing ",r.length," items of"," ",l.jsx(qi,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:s?.name||e?.slice(0,8)})]})})]}),l.jsx(Wn.Column,{children:l.jsx(Nr,{children:l.jsx(de,{variant:"primary",onClick:()=>c(f=>!f),children:o?l.jsxs(l.Fragment,{children:[l.jsx(aet,{})," Default View"]}):l.jsxs(l.Fragment,{children:[l.jsx(UWt,{})," Diff View"]})})})})]}),l.jsx(Yf,{className:"grid-cols-[1fr_3vw_1fr]",children:r.map((f,p)=>l.jsxs(y.Fragment,{children:[l.jsx(kns,{datasetId:e,itemId:f,Link:i,idx:p,itemIds:r,showContent:!o,onItemChange:h=>{const m=[...r];m[p]=h,n({items:m.join(",")})}}),p==0&&l.jsx("div",{className:X("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),o&&u&&d&&l.jsx(Q1t,{codeA:yXe(u),codeB:yXe(d)})]})})]})}function kns({datasetId:e,itemId:t,Link:n,idx:r,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:o,isLoading:c}=Zhe(e,t),{data:u}=UT(e),d=new Set(s.filter((p,h)=>h!==r)),f=(u??[]).map(p=>({value:p.id,label:p.id,disabled:d.has(p.id)}));return l.jsxs(An,{children:[l.jsxs(An.Toolbar,{className:"flex gap-4",children:[l.jsx(Dwe,{label:"Item",name:`compare-item-${r}`,value:t,onValueChange:a,options:f,placeholder:"Select item",labelIsHidden:!0}),l.jsxs(de,{as:n,to:`/datasets/${e}/items/${t}`,children:[l.jsx(kw,{}),"Versions"]})]}),i&&l.jsx(An.Content,{children:c?l.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):o?l.jsxs(l.Fragment,{children:[l.jsx(xLt,{item:o}),l.jsx(IH,{item:o,Link:n})]}):l.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function bXe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function _ns(){const{datasetId:e,itemId:t}=Mr(),[n,r]=fo(),[s,a]=y.useState(!1),i=n.get("ids")?.split(",").map(Number).filter(h=>!isNaN(h)&&h>0)??[],{data:o,error:c}=Ub(e??""),{Link:u}=an(),{data:d}=IOe(e??"",t??""),{data:f}=Khe(e??"",t??"",i[0]??0,o?.version),{data:p}=Khe(e??"",t??"",i[1]??0,o?.version);return c&&zs(c)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})}):c&&Bs(c)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"datasets"})})}):!e||!t||i.length<2?l.jsx(fr,{children:l.jsx(kh,{children:l.jsx("div",{className:"text-neutral4 text-center py-8",children:l.jsx("p",{children:"Select at least two versions to compare."})})})}):l.jsxs(fr,{children:[l.jsx(Pv,{owner:"dataset-item-versions-compare",children:l.jsxs(de,{as:qi,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[l.jsx(Eb,{}),"Back to Item"]})}),l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:X("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":s}),children:[l.jsxs(Wn,{children:[l.jsxs(Wn.Column,{children:[l.jsxs(Wn.Title,{children:[l.jsx(H0,{}),"Compare Dataset Item Versions"]}),l.jsx(Wn.Description,{children:l.jsxs(fs,{children:["Comparing ",i.length," versions of"," ",l.jsx(qi,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),l.jsx(Wn.Column,{children:l.jsx(Nr,{children:l.jsx(de,{variant:"primary",onClick:()=>a(h=>!h),children:s?l.jsxs(l.Fragment,{children:[l.jsx(aet,{})," Default View"]}):l.jsxs(l.Fragment,{children:[l.jsx(OGt,{})," Diff View"]})})})})]}),l.jsx(Yf,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((h,m)=>l.jsxs(y.Fragment,{children:[l.jsx(Ons,{datasetId:e,itemId:t,datasetVersion:h,latestVersion:o?.version,allVersions:d??[],versionNumbers:i,Link:u,idx:m,showContent:!s,onVersionChange:g=>{const v=[...i];v[m]=g,r({ids:v.join(",")})}}),m===0&&l.jsx("div",{className:X("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},h))}),s&&f&&p&&l.jsx(Q1t,{codeA:bXe(f),codeB:bXe(p)})]})})]})}function Ons({datasetId:e,itemId:t,datasetVersion:n,latestVersion:r,allVersions:s,versionNumbers:a,Link:i,idx:o,showContent:c=!0,onVersionChange:u}){const{data:d,isLoading:f}=Khe(e,t,n,r),p=new Set(a.filter((g,v)=>v!==o)),h=s.map(g=>{const v=typeof g.updatedAt=="string"?new Date(g.updatedAt):g.updatedAt;return{value:String(g.datasetVersion),label:l.jsxs(l.Fragment,{children:[l.jsxs("b",{children:["v. ",g.datasetVersion]})," - ",kn(v,"MMM d, yyyy h:mm a"),g.isLatest?l.jsx(ai,{color:"blue",size:"small",children:"Latest"}):null]}),disabled:p.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 l.jsxs(An,{children:[l.jsxs(An.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[l.jsx(kw,{className:"w-6 h-6 opacity-50"}),l.jsx(Dwe,{label:"Version",name:`compare-version-${o}`,value:String(n),onValueChange:g=>u(Number(g)),options:h,placeholder:"Select version",labelIsHidden:!0,className:"w-full"})]}),c&&l.jsx(An.Content,{children:f?l.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):!d||!m?l.jsxs("div",{className:"text-neutral4 text-sm",children:["Version ",n," not found"]}):l.jsx(IH,{item:m,Link:i})})]})}function Ens(){const{datasetId:e}=Mr(),[t]=fo(),n=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],r=bu(),{data:s,error:a}=Ub(e??""),i=UT(e??"",void 0,n[0]??null),o=UT(e??"",void 0,n[1]??null),c=y.useMemo(()=>i.data??[],[i.data]),u=y.useMemo(()=>o.data??[],[o.data]),d=y.useMemo(()=>{const g=new Map;for(const v of[...c,...u])g.has(v.id)||g.set(v.id,{id:v.id,createdAt:new Date(v.createdAt)});return[...g.values()].sort((v,b)=>b.createdAt.getTime()-v.createdAt.getTime())},[c,u]),f=y.useMemo(()=>new Map(c.map(g=>[g.id,g])),[c]),p=y.useMemo(()=>new Map(u.map(g=>[g.id,g])),[u]);if(a&&zs(a))return l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})});if(a&&Bs(a))return l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"datasets"})})});if(!e||n.length<2)return l.jsx(fr,{children:l.jsx(kh,{children:l.jsx("div",{className:"text-neutral4 text-center py-8",children:l.jsx("p",{children:"Select at least two versions to compare."})})})});const h=(g,v,b)=>{r(`/datasets/${e}/items/${g}/versions?ids=${v?.datasetVersion??""},${b?.datasetVersion??""}`)},m=(g,v)=>{r(`/datasets/${e}/versions?ids=${g},${v}`,{replace:!0})};return l.jsx(fr,{children:l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:"grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[l.jsxs(Wn,{children:[l.jsxs(Wn.Column,{children:[l.jsxs(Wn.Title,{children:[l.jsx(qQt,{})," Compare Dataset Versions"]}),l.jsx(Wn.Description,{children:l.jsxs(fs,{children:[l.jsx(kw,{})," Comparing ",n.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),l.jsx(Wn.Column,{children:l.jsxs(de,{as:qi,to:`/datasets/${e}`,children:[l.jsx(Eb,{}),"Back to Dataset"]})})]}),l.jsx(Yf,{children:l.jsxs(An,{children:[l.jsx(ins,{datasetId:e,versionA:String(n[0]),versionB:String(n[1]),onVersionChange:m}),l.jsx(uns,{datasetId:e,versionA:n[0],versionB:n[1],allItems:d,itemsAMap:f,itemsBMap:p,onItemClick:h})]})})]})})})}function Cns(e){if(!e||e.length<2)return null;const t=[...e].sort((i,o)=>new Date(i.createdAt).getTime()-new Date(o.createdAt).getTime()),n=Math.floor(t.length/2),r=n,s=t.length-n;if(r===0)return null;const a=(s-r)/r*100;return{changePct:Math.round(a*10)/10,prevValue:String(r)}}function Tns({scorers:e,datasets:t,experiments:n,avgScore:r,prevAvgScore:s,totalNeedsReview:a,isLoadingScorers:i,isLoadingDatasets:o,isLoadingExperiments:c,isLoadingScores:u,isLoadingReview:d}){const f=e?Object.keys(e).length:void 0,p=t?.length,h=n?.length,m=r!=null&&s!=null&&s!==0?{changePct:Math.round((r-s)/s*100*10)/10,prevValue:String(s)}:null,g=Cns(n);return l.jsxs(l.Fragment,{children:[l.jsxs(qr,{children:[l.jsx(qr.Label,{children:"Total Scorers"}),i?l.jsx(qr.Loading,{}):f!=null?l.jsxs(l.Fragment,{children:[l.jsx(qr.Value,{children:String(f)}),l.jsx(qr.NoChange,{message:"Static count"})]}):l.jsx(qr.NoData,{})]}),l.jsxs(qr,{children:[l.jsx(qr.Label,{children:"Total Datasets"}),o?l.jsx(qr.Loading,{}):p!=null?l.jsxs(l.Fragment,{children:[l.jsx(qr.Value,{children:String(p)}),l.jsx(qr.NoChange,{message:"Static count"})]}):l.jsx(qr.NoData,{})]}),l.jsxs(qr,{children:[l.jsx(qr.Label,{children:"Avg Score"}),u?l.jsx(qr.Loading,{}):r!=null?l.jsxs(l.Fragment,{children:[l.jsx(qr.Value,{children:String(r)}),m?l.jsx(qr.Change,{changePct:m.changePct,prevValue:m.prevValue}):l.jsx(qr.NoChange,{})]}):l.jsx(qr.NoData,{})]}),l.jsxs(qr,{children:[l.jsx(qr.Label,{children:"Total Experiments"}),c?l.jsx(qr.Loading,{}):h!=null?l.jsxs(l.Fragment,{children:[l.jsx(qr.Value,{children:String(h)}),g?l.jsx(qr.Change,{changePct:g.changePct,prevValue:g.prevValue}):l.jsx(qr.NoChange,{})]}):l.jsx(qr.NoData,{})]}),l.jsxs(qr,{children:[l.jsx(qr.Label,{children:"Needs Review"}),d?l.jsx(qr.Loading,{}):a!=null?l.jsxs(l.Fragment,{children:[l.jsx(qr.Value,{children:String(a)}),a>0?l.jsx(qr.NoChange,{message:"items pending review"}):l.jsx(qr.NoChange,{message:"All caught up"})]}):l.jsx(qr.NoData,{})]})]})}const jns=[{value:"all",label:"All statuses"},{value:"completed",label:"Completed"},{value:"running",label:"Running"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}],xXe="auto 1fr auto auto auto auto auto auto auto";function Nns(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const Ans={completed:"success",running:"warning",failed:"error",pending:"neutral"};function Ins({experiments:e,datasets:t,reviewByExperiment:n,isLoading:r,search:s="",statusFilter:a="all",datasetFilter:i="all"}){const{paths:o,Link:c}=an(),u=y.useMemo(()=>{const p=new Map;return t?.forEach(h=>p.set(h.id,h.name)),p},[t]),d=y.useMemo(()=>[...e].sort((p,h)=>{const m=p.createdAt?new Date(p.createdAt).getTime():0;return(h.createdAt?new Date(h.createdAt).getTime():0)-m}),[e]),f=y.useMemo(()=>{const p=s.toLowerCase();return d.filter(h=>{const m=h.datasetId?u.get(h.datasetId)??"":"",g=!p||h.id.toLowerCase().includes(p)||m.toLowerCase().includes(p)||(h.targetId??"").toLowerCase().includes(p),v=a==="all"||h.status===a,b=i==="all"||h.datasetId===i;return g&&v&&b})},[d,s,u,a,i]);return r?l.jsx(Dd,{columns:xXe}):l.jsxs(we,{columns:xXe,children:[l.jsxs(we.Top,{children:[l.jsx(we.TopCell,{children:"Experiment"}),l.jsx(we.TopCell,{children:"Dataset"}),l.jsx(we.TopCell,{children:"Target"}),l.jsx(we.TopCell,{children:"Status"}),l.jsx(we.TopCell,{className:"text-center",children:"Items"}),l.jsx(we.TopCell,{className:"text-center",children:"Succeeded"}),l.jsx(we.TopCell,{className:"text-center",children:"Failed"}),l.jsx(we.TopCell,{className:"text-center",children:"Review"}),l.jsx(we.TopCell,{children:"Date"})]}),f.map(p=>{const h=p.datasetId?u.get(p.datasetId)??p.datasetId.slice(0,8):"—",m=p.status??"pending",g=p.succeededCount??0,v=p.failedCount??0,b=p.totalItems??0,S=b>0?Math.round(g/b*100):0;return l.jsxs(we.RowLink,{to:o.experimentLink(p.id),LinkComponent:c,children:[l.jsx(we.NameCell,{className:"font-mono",children:p.id.slice(0,8)}),l.jsx(we.TextCell,{children:h}),l.jsx(we.Cell,{children:l.jsxs("span",{className:"truncate",children:[p.targetType," ",p.targetId]})}),l.jsx(we.Cell,{children:l.jsx(Ek,{variant:Ans[m]??"neutral",withDot:!0,children:m})}),l.jsx(we.TextCell,{className:"text-center",children:b}),l.jsx(we.TextCell,{className:"text-center",children:l.jsxs("span",{className:g>0?"text-accent1":"",children:[g," (",S,"%)"]})}),l.jsx(we.TextCell,{className:"text-center",children:l.jsx("span",{className:v>0?"text-accent2":"",children:v})}),l.jsx(we.Cell,{className:"text-center",children:(()=>{const w=n?.get(p.id);if(!w)return l.jsx("span",{className:"text-neutral2",children:"—"});const _=w.needsReview+w.complete;return _===0?l.jsx("span",{className:"text-neutral2",children:"—"}):w.needsReview>0?l.jsxs(Et,{variant:"warning",children:[w.needsReview," pending"]}):l.jsxs(Et,{variant:"success",children:[w.complete,"/",_," reviewed"]})})()}),l.jsx(we.TextCell,{children:Nns(p.createdAt)})]},p.id)})]})}function Rns(e){return[{value:"all",label:"All datasets"},...(e??[]).map(t=>({value:t.id,label:t.name}))]}const F5={completed:"#22c55e",running:"#facc15",pending:"#fb923c",failed:"#f87171"},Pns=[{label:"Completed",color:F5.completed},{label:"Running",color:F5.running},{label:"Pending",color:F5.pending},{label:"Failed",color:F5.failed}];function Mns({experiments:e,datasets:t,isLoading:n,isError:r}){const{data:s,maxVal:a}=y.useMemo(()=>{if(!e||e.length===0)return{data:[],maxVal:0};const o=new Map;if(t)for(const f of t)o.set(f.id,f.name);const c=new Map;for(const f of e){const p=f.datasetId??"unknown";c.has(p)||c.set(p,{completed:0,running:0,pending:0,failed:0});const h=c.get(p),m=f.status;m in h&&h[m]++}let u=0;return{data:Array.from(c.entries()).map(([f,p])=>{const h=p.completed+p.running+p.pending+p.failed;return h>u&&(u=h),{name:o.get(f)??f.slice(0,12),values:[p.completed,p.running,p.pending,p.failed]}}),maxVal:u}},[e,t]),i=s.length>0;return l.jsxs(Vt,{children:[l.jsxs(Vt.TopBar,{children:[l.jsx(Vt.TitleAndDescription,{title:"Experiments by Dataset",description:"Experiment status breakdown per dataset."}),i&&l.jsx(Vt.Summary,{value:String(e?.length??0),label:"Total experiments"})]}),n?l.jsx(Vt.Loading,{}):r?l.jsx(Vt.Error,{message:"Failed to load experiments data"}):l.jsx(Vt.Content,{children:i?l.jsx(iT,{data:s,segments:Pns,maxVal:a,fmt:o=>String(o)}):l.jsx(Vt.NoData,{message:"No experiments have been run yet"})})]})}const $ns=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(oi,{iconSlot:l.jsx(Hd,{}),titleSlot:"No Experiments yet",descriptionSlot:l.jsxs(l.Fragment,{children:["Run an experiment from a dataset to evaluate ",l.jsx("br",{}),"your agents and workflows."]}),actionSlot:l.jsx("div",{className:"flex flex-col items-center gap-2",children:l.jsxs(de,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",children:["Experiments Documentation ",l.jsx(Da,{})]})})})});function Dns({search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:i,onReset:o,hasActiveFilters:c}){return l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(Iv,{label:"Search experiments",placeholder:"Filter by experiment, dataset, or target",value:e,onSearch:t}),l.jsxs(Nr,{children:[l.jsx(Yl,{label:"Status",labelIsHidden:!0,name:"filter-status",options:[...jns],value:n,onValueChange:r,className:"whitespace-nowrap"}),l.jsx(Yl,{label:"Dataset",labelIsHidden:!0,name:"filter-dataset",options:i,value:s,onValueChange:a,className:"whitespace-nowrap"}),o&&c&&l.jsxs(de,{onClick:o,size:"sm",variant:"default",children:[l.jsx(Pr,{className:"size-3"})," Reset"]})]})]})}function Lns(){const{data:e,isLoading:t,error:n}=Op(),{data:r,isLoading:s,error:a}=Rv(),{data:i,isLoading:o,error:c}=AH(),{data:u,isLoading:d,isError:f,error:p}=RGr(),{data:h,isLoading:m,isError:g,error:v}=POe(),b=r?.datasets,S=i?.experiments,w=y.useMemo(()=>hns(h),[h]),_=n||a||c||p||v;return _&&zs(_)?l.jsx(ir,{children:l.jsx(ua,{})}):_&&Bs(_)?l.jsx(ir,{children:l.jsx(na,{resource:"evaluation"})}):_?l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load evaluation data",message:_.message})}):l.jsx(wn,{width:"wide",height:"full",children:l.jsxs("div",{className:"flex flex-col gap-6",children:[l.jsx(mfe,{children:l.jsx(Tns,{scorers:e,datasets:b,experiments:S,avgScore:u?.avgScore??null,prevAvgScore:u?.prevAvgScore??null,totalNeedsReview:w.needsReview,isLoadingScorers:t,isLoadingDatasets:s,isLoadingExperiments:o,isLoadingScores:d,isLoadingReview:m})}),l.jsx(kGr,{summaryData:u?.summaryData??[],overTimeData:u?.overTimeData??[],scorerNames:u?.scorerNames??[],avgScore:u?.avgScore??null,isLoading:d,isError:f}),l.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[l.jsx(Les,{experiments:S,isLoading:o,isError:!!c}),l.jsx(Mns,{experiments:S,datasets:b,isLoading:o,isError:!!c})]}),l.jsx(fns,{reviewSummary:h,experiments:S,datasets:b,isLoading:m,isError:!!g})]})})}function zns(){const[e,t]=y.useState(""),[n,r]=y.useState("all"),[s,a]=y.useState("all"),{data:i,isLoading:o,error:c}=Rv(),{data:u,isLoading:d,error:f}=AH(),{data:p}=POe(),h=y.useMemo(()=>i?.datasets??[],[i?.datasets]),m=y.useMemo(()=>u?.experiments??[],[u?.experiments]),g=y.useMemo(()=>Rns(h),[h]),v=y.useMemo(()=>TLt(p),[p]),b=o||d,S=f||c;if(S&&zs(S))return l.jsx(ir,{children:l.jsx(ua,{})});if(f&&Bs(f))return l.jsx(ir,{children:l.jsx(na,{resource:"experiments"})});if(c&&Bs(c))return l.jsx(ir,{children:l.jsx(na,{resource:"datasets"})});if(S)return l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load experiments",message:S.message})});if(m.length===0&&!b)return l.jsx(ir,{children:l.jsx($ns,{})});const w=n!=="all"||s!=="all"||e!=="",_=()=>{t(""),r("all"),a("all")};return l.jsxs(wn,{children:[l.jsx(wn.TopArea,{children:l.jsx(Dns,{search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:g,onReset:_,hasActiveFilters:w})}),l.jsx(Ins,{experiments:m,datasets:h,reviewByExperiment:v,isLoading:b,search:e,statusFilter:n,datasetFilter:s})]})}function Fns(){const{experimentId:e}=Mr(),{data:t,isLoading:n}=AH(),s=t?.experiments?.find(h=>h.id===e)?.datasetId??"",{data:a,isLoading:i,error:o}=d7(s,e??""),{data:c,isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:p}=NH({datasetId:s,experimentId:e??"",experimentStatus:a?.status});return e?n||i||!s?l.jsx(fr,{children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Qt,{})})}):o&&zs(o)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})}):o&&Bs(o)?l.jsx(fr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"datasets"})})}):o||!a?l.jsx(fr,{children:l.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",o instanceof Error?o.message:"Unknown error"]})}):l.jsx(fr,{children:l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[l.jsx(CLt,{experimentId:e,experiment:a}),l.jsx(ELt,{experimentId:e,experimentStatus:a?.status,results:c??[],isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:p})]})})}):null}function jLt({redirectUri:e,onSuccess:t,initialMode:n="signin",errorMessage:r}){const{data:s,isLoading:a}=Uj(),{mutate:i,isPending:o,error:c}=UJr(),{mutate:u,isPending:d,error:f}=VJr(),{mutate:p,isPending:h}=fLt(),[m,g]=y.useState(n),[v,b]=y.useState(""),[S,w]=y.useState(""),[_,O]=y.useState("");if(a)return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:l.jsx("div",{className:"text-neutral3",children:"Loading..."})});if(!s?.enabled||!s?.login)return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:l.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,R=m==="signin"||!I,P=R?o:d,U=R?c:f,M=()=>{t?t():e?window.location.href=e:window.location.href="/"},L=q=>{q.preventDefault(),R?i({email:S,password:_},{onSuccess:M}):u({email:S,password:_,name:v||void 0},{onSuccess:M})},F=()=>{p({redirectUri:e},{onSuccess:q=>{window.location.href=q.url}})},z=()=>{g(R?"signup":"signin")};return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface1",children:l.jsxs("div",{className:"w-full max-w-sm space-y-6 rounded-lg border border-border1 bg-surface2 p-8",children:[l.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[l.jsx(Ky,{className:"h-10 w-10"}),l.jsx("h1",{className:"text-xl font-semibold text-neutral6",children:R?"Sign in to Mastra Studio":"Create your account"})]}),E.description&&l.jsxs("div",{className:"flex items-start gap-2.5 rounded-md border border-border1 bg-surface1 p-3",children:[l.jsx(det,{className:"mt-0.5 h-4 w-4 shrink-0 text-neutral4"}),l.jsx("p",{className:"text-sm text-neutral3",children:E.description})]}),r&&l.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:r}),j&&l.jsxs("form",{onSubmit:L,className:"space-y-4",children:[!R&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"name",className:"block text-sm text-neutral4",children:"Name"}),l.jsx(Sn,{id:"name",type:"text",value:v,onChange:q=>b(q.target.value),placeholder:"Your name",variant:"default",size:"lg"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"email",className:"block text-sm text-neutral4",children:"Email"}),l.jsx(Sn,{id:"email",type:"email",value:S,onChange:q=>w(q.target.value),placeholder:"you@example.com",required:!0,variant:"default",size:"lg"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"password",className:"block text-sm text-neutral4",children:"Password"}),l.jsx(Sn,{id:"password",type:"password",value:_,onChange:q=>O(q.target.value),placeholder:R?"Enter your password":"Create a password",required:!0,variant:"default",size:"lg"})]}),U&&l.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:U.message}),l.jsx(de,{type:"submit",disabled:P,className:"w-full",size:"lg",children:P?R?"Signing in...":"Creating account...":R?"Sign in":"Create account"}),I&&l.jsxs("div",{className:"text-center text-sm",children:[l.jsx("span",{className:"text-neutral3",children:R?"Don't have an account? ":"Already have an account? "}),l.jsx("button",{type:"button",onClick:z,className:"text-neutral6 hover:underline",children:R?"Sign up":"Sign in"})]})]}),T&&j&&l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex items-center",children:l.jsx("div",{className:"w-full border-t border-border1"})}),l.jsx("div",{className:"relative flex justify-center text-sm",children:l.jsx("span",{className:"bg-surface2 px-2 text-neutral3",children:"or continue with"})})]}),T&&N&&l.jsxs(de,{onClick:F,disabled:h,className:"w-full",size:"lg",variant:"outline",children:[N.icon&&l.jsx("span",{className:"mr-2",children:N.icon}),h?"Redirecting...":N.text||"Sign in"]})]})})}function Bns(){const[e]=fo(),t=bu(),n=e.get("redirect")||"/",s=e.get("mode")==="signup"?"signup":"signin",a=e.get("error_description")||e.get("error")||null,i=()=>{n.startsWith("http")?window.location.href=n:t(n,{replace:!0})};return l.jsx(jLt,{redirectUri:n,onSuccess:i,initialMode:s,errorMessage:a})}function Uns(){const[e,t]=fo(),n=Rar(e,t),r=$ar(e,t),[s,a]=y.useState(),[i,o]=y.useState(!1),{data:c=[],isPending:u}=fwe(),{data:d=[],isPending:f}=pwe({entityType:n.selectedEntityOption?.entityType,rootOnly:!0}),{data:p=[],isPending:h}=hwe(),{data:m=[],isPending:g}=mwe(),v=y.useMemo(()=>nsr({availableTags:c,availableRootEntityNames:d,availableServiceNames:m,availableEnvironments:p,loading:{tags:u,entityNames:f,serviceNames:g,environments:h}}),[c,d,m,p,u,f,g,h]),b=y.useMemo(()=>isr({rootEntityType:n.selectedEntityOption?.entityType,dateFrom:n.selectedDateFrom,dateTo:n.selectedDateTo,tokens:n.filterTokens}),[n.filterTokens,n.selectedDateFrom,n.selectedDateTo,n.selectedEntityOption]),{data:S=[],isLoading:w,error:_,isFetchingNextPage:O,hasNextPage:E,setEndOfListElement:T}=Aar({filters:b}),{logIdMap:j,featuredLog:N,handleLogClick:I,handlePreviousLog:R,handleNextLog:P}=zar(S,n.featuredLogId,n.handleFeaturedChange,n.featuredTraceId),{data:U,isLoading:M}=dwe(n.featuredTraceId??null),{data:L,isLoading:F}=Ck(n.featuredTraceId??"",n.featuredSpanId??""),z=y.useCallback(()=>n.applyFilterTokens(osr(v,n.filterTokens)),[v,n]),q=y.useCallback(()=>n.handleFeaturedChange({logId:null}),[n]),H=y.useCallback(K=>n.handleFeaturedChange({traceId:K,spanId:null}),[n]),D=y.useCallback((K,re)=>n.handleFeaturedChange({traceId:K,spanId:re}),[n]),Y=y.useCallback(()=>{n.handleFeaturedChange({traceId:null,spanId:null}),o(!1)},[n]),V=y.useCallback(()=>n.handleFeaturedChange({spanId:null}),[n]),$=y.useCallback(K=>n.handleFeaturedChange({spanId:K??null}),[n]),W=l.jsxs(wn.TopArea,{children:[l.jsx(wn.Row,{children:l.jsxs(wn.Column,{className:"flex flex-wrap items-start justify-start gap-2",children:[l.jsx(gSt,{preset:n.datePreset,onPresetChange:n.handleDatePresetChange,dateFrom:n.selectedDateFrom,dateTo:n.selectedDateTo,onDateChange:n.handleDateChange,disabled:w,presets:["last-24h","last-3d","last-7d","last-14d","last-30d","custom"]}),l.jsx(H0e,{fields:v,tokens:n.filterTokens,onTokensChange:n.handleFilterTokensChange,disabled:w,onStartTextFilter:a})]})}),l.jsx(kar,{isLoading:w,filterFields:v,filterTokens:n.filterTokens,onFilterTokensChange:n.handleFilterTokensChange,onClear:z,onRemoveAll:n.handleRemoveAll,onSave:r.handleSave,onRemoveSaved:r.hasSavedFilters?r.handleRemoveSaved:void 0,autoFocusFilterFieldId:s})]});if(_)return l.jsxs(wn,{width:"wide",height:"full",children:[W,l.jsx(wn.MainArea,{isCentered:!0,children:l.jsx(yar,{error:_,resource:"logs",errorTitle:"Failed to load logs"})})]});const G=!!n.selectedEntityOption||n.filterTokens.length>0;return S.length===0&&!w&&!G?l.jsxs(wn,{width:"wide",height:"full",children:[W,l.jsx(wn.MainArea,{isCentered:!0,children:l.jsx(Car,{datePreset:n.datePreset,dateFrom:n.selectedDateFrom,dateTo:n.selectedDateTo})})]}):l.jsxs(wn,{width:"wide",height:"full",children:[W,l.jsx(bar,{logCollapsed:i,listSlot:l.jsx(Sar,{logs:S,isLoading:w,isFetchingNextPage:O,hasNextPage:E,setEndOfListElement:T,logIdMap:j,featuredLogId:n.featuredLogId,onLogClick:I}),logPanelSlot:N?l.jsx(gar,{log:N,onClose:q,onTraceClick:H,onSpanClick:D,onPrevious:R,onNext:P,collapsed:i,onCollapsedChange:o}):null,tracePanelSlot:n.featuredTraceId?l.jsx(Usr,{traceId:n.featuredTraceId,spans:U?.spans,isLoading:M,onClose:Y,onSpanSelect:$,selectedSpanId:n.featuredSpanId}):null,spanPanelSlot:n.featuredTraceId&&n.featuredSpanId?l.jsx(Bsr,{spanId:n.featuredSpanId,span:L?.span,isLoading:F,onClose:V}):null})]})}function qns({server:e}){const{paths:t,Link:n}=an(),s=Ze().options.baseUrl,a=s?`${s}/api/mcp/${e.id}/sse`:"",{data:i}=d4t(e),o=Object.values(i||{}),c=o.length,u=o.filter(p=>p.toolType==="agent").length,d=o.filter(p=>p.toolType==="workflow").length,f=_h(e.name,50);return l.jsxs(we.RowLink,{to:t.mcpServerLink(e.id),LinkComponent:n,children:[l.jsx(we.NameCell,{children:f}),l.jsx(we.DescriptionCell,{children:a}),l.jsx(we.TextCell,{className:"text-center",children:u||""}),l.jsx(we.TextCell,{className:"text-center",children:c||""}),l.jsx(we.TextCell,{className:"text-center",children:d||""})]})}function Vns({mcpServers:e,isLoading:t,search:n=""}){const r=y.useMemo(()=>{const s=n.toLowerCase();return e.filter(a=>a.name?.toLowerCase().includes(s)||a.id?.toLowerCase().includes(s))},[e,n]);return t?l.jsx(Dd,{columns:"auto 1fr auto auto auto"}):l.jsxs(we,{columns:"auto 1fr auto auto auto",children:[l.jsxs(we.Top,{children:[l.jsx(we.TopCell,{children:"Name"}),l.jsx(we.TopCell,{children:"URL"}),l.jsx(we.TopCellSmart,{long:"Agents",short:l.jsx(Go,{}),tooltip:"Agent Tools",className:"text-center"}),l.jsx(we.TopCellSmart,{long:"Tools",short:l.jsx(Cc,{}),tooltip:"Tools",className:"text-center"}),l.jsx(we.TopCellSmart,{long:"Workflows",short:l.jsx(Tc,{}),tooltip:"Workflow Tools",className:"text-center"})]}),r.length===0&&n?l.jsx(we.NoMatch,{message:"No MCP Servers match your search"}):null,r.map(s=>l.jsx(qns,{server:s},s.id))]})}const Hns=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(oi,{iconSlot:l.jsx(Hd,{}),titleSlot:"No MCP Servers yet",descriptionSlot:l.jsxs(l.Fragment,{children:["MCP servers are not configured yet. ",l.jsx("br",{}),"More information in the documentation."]}),actionSlot:l.jsxs(de,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",children:["MCP Documentation ",l.jsx(Da,{})]})})}),Zns=()=>{const{data:e=[],isLoading:t,error:n}=hH(),[r,s]=y.useState("");return n&&zs(n)?l.jsx(ir,{children:l.jsx(ua,{})}):n&&Bs(n)?l.jsx(ir,{children:l.jsx(na,{resource:"MCP servers"})}):n?l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load MCP servers",message:n.message})}):e.length===0&&!t?l.jsx(ir,{children:l.jsx(Hns,{})}):l.jsxs(wn,{children:[l.jsx(wn.TopArea,{children:l.jsx("div",{className:"max-w-120",children:l.jsx(Iv,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})}),l.jsx(Vns,{mcpServers:e,isLoading:t,search:r})]})},Wns=(e,t)=>{const n=new Map,r=Object.keys(t);for(const s of r){const a=t[s],i=a.tools,o=Object.keys(i);for(const c of o){const u=i[c];n.has(u.id)||n.set(u.id,{...u,agents:[]}),n.get(u.id).agents.push({...a,id:s})}}for(const[s,a]of Object.entries(e))n.has(a.id)||n.set(a.id,{...a,agents:[]});return Array.from(n.values())};function Gns({tools:e,agents:t,isLoading:n,search:r=""}){const{paths:s,Link:a}=an(),i=y.useMemo(()=>Wns(e,t),[e,t]),o=y.useMemo(()=>i.filter(c=>c.id.toLowerCase().includes(r.toLowerCase())),[i,r]);return n?l.jsx(Dd,{columns:"auto 1fr auto"}):l.jsxs(we,{columns:"auto 1fr auto",children:[l.jsxs(we.Top,{children:[l.jsx(we.TopCell,{children:"Name"}),l.jsx(we.TopCell,{children:"Description"}),l.jsx(we.TopCellSmart,{long:"Agents",short:l.jsx(Go,{}),tooltip:"Attached Agents",className:"text-center"})]}),o.length===0&&r?l.jsx(we.NoMatch,{message:"No Tools match your search"}):null,o.map(c=>{const u=_h(c.id,50),d=_h(c.description??"",200),f=c.agents.length;return l.jsxs(we.RowLink,{to:s.toolLink(c.id),LinkComponent:a,children:[l.jsx(we.NameCell,{children:u}),l.jsx(we.DescriptionCell,{children:d}),l.jsx(we.TextCell,{className:"text-center",children:f||""})]},c.id)})]})}const Qns=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(oi,{iconSlot:l.jsx(Hd,{}),titleSlot:"No Tools yet",descriptionSlot:l.jsxs(l.Fragment,{children:["Mastra tools are not configured yet. ",l.jsx("br",{}),"More information in the documentation."]}),actionSlot:l.jsxs(de,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",children:["Tools Documentation ",l.jsx(Da,{})]})})}),Yns=()=>{const e=Ze();return nr({mutationFn:async({toolId:t,input:n,requestContext:r})=>{const s=new bC;Object.entries(r??{}).forEach(([a,i])=>{s.set(a,i)});try{return await e.getTool(t).execute({data:n,requestContext:s})}catch(a){throw Fe.error("Error executing dev tool"),console.error("Error executing dev tool:",a),a}}})},Xns=({toolId:e})=>{const{canExecute:t}=qb(),n=t("tools"),{data:r={}}=Lv(),s=y.useMemo(()=>{for(const g of Object.values(r))if(g.tools){const v=Object.values(g.tools).find(b=>b.id===e);if(v)return v}return null},[r,e]),{data:a,isLoading:i,error:o}=mYr(e,{enabled:!s}),c=s||a,{mutateAsync:u,isPending:d,data:f}=Yns(),{requestContext:p}=Us();y.useEffect(()=>{if(o){const g=o instanceof Error?o.message:"Failed to load tool";Fe.error(`Error loading tool: ${g}`)}},[o]);const h=async(g,v)=>{if(!c)return;const b={...p??{},...v??{}};return u({toolId:c.id,input:g,requestContext:b})},m=c?.inputSchema?bv(gv(bb(c?.inputSchema))):ds({});return i?l.jsxs("div",{className:"p-6",children:[l.jsx(rs,{className:"h-8 w-48 mb-4"}),l.jsx(rs,{className:"h-32 w-full"})]}):o?null:c?n?l.jsx(xOe,{executionResult:f,isExecutingTool:d,zodInputSchema:m,handleExecuteTool:h,toolDescription:c.description,toolId:c.id,requestContextSchema:c.requestContextSchema}):l.jsx("div",{className:"py-12 text-center px-6",children:l.jsx(ge,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})}):l.jsx("div",{className:"py-12 text-center px-6",children:l.jsx(ge,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})})};function Kns({value:e,onValueChange:t,placeholder:n="Select a tool...",searchPlaceholder:r="Search tools...",emptyText:s="No tools found.",className:a,disabled:i=!1,variant:o="default"}){const{data:c={},isLoading:u,isError:d,error:f}=TH(),{data:p={},isLoading:h,isError:m,error:g}=Lv(),{navigate:v,paths:b}=an();y.useEffect(()=>{if(d){const O=f instanceof Error?f.message:"Failed to load tools";Fe.error(`Error loading tools: ${O}`)}},[d,f]),y.useEffect(()=>{if(m){const O=g instanceof Error?g.message:"Failed to load agents";Fe.error(`Error loading agents: ${O}`)}},[m,g]);const S=new Map;Object.values(p).forEach(O=>{O.tools&&Object.values(O.tools).forEach(E=>{S.has(E.id)||S.set(E.id,E)})}),Object.values(c).forEach(O=>{S.has(O.id)||S.set(O.id,O)});const w=Array.from(S.values()).map(O=>({label:O.id,value:O.id})),_=O=>{t?t(O):O&&O!==e&&v(b.toolLink(O))};return l.jsx(jc,{options:w,value:e,onValueChange:_,placeholder:u||h?"Loading tools...":n,searchPlaceholder:r,emptyText:s,className:a,disabled:i||u||h||d||m,variant:o})}const Jns=({isLoading:e,server:t})=>{const[{sseUrl:n,httpStreamUrl:r},s]=y.useState({sseUrl:"",httpStreamUrl:""});if(y.useEffect(()=>{if(!t)return;const i=window.MASTRA_SERVER_HOST,o=window.MASTRA_SERVER_PORT;let c=null;i&&o&&(c=`http://${i}:${o}`);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 l.jsx(kh,{children:l.jsx(ge,{as:"h1",variant:"header-md",className:"text-neutral3 font-medium py-20 text-center",children:"Server not found"})});const a=`npx -y mcp-remote ${n}`;return l.jsxs(kh,{isDivided:!0,children:[l.jsxs("div",{className:"px-8 py-12 mx-auto max-w-2xl w-full",children:[l.jsx(ge,{as:"h1",variant:"header-md",className:"text-neutral6 font-medium pb-4",children:t.name}),l.jsxs("div",{className:"flex items-center gap-1 pb-6",children:[l.jsx(Et,{icon:l.jsx(gq,{className:"text-neutral6"}),className:"rounded-r-sm text-neutral4!",children:"Version"}),l.jsx(Et,{className:"rounded-l-sm text-neutral4!",children:t.version_detail.version})]}),l.jsx(ge,{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."}),l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[l.jsx(Et,{icon:l.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"HTTP"}),children:"Regular HTTP Endpoint"}),l.jsx(ge,{className:"text-neutral3 pt-1 pb-2",children:"Use for stateless HTTP transport with streamable responses."}),l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(ge,{className:"px-2 py-1 bg-surface4 rounded-lg",children:r}),l.jsx("div",{className:"pt-1",children:l.jsx(la,{tooltip:"Copy HTTP Stream URL",content:r})})]})]}),l.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[l.jsx(Et,{icon:l.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"SSE"}),children:"Server-Sent Events"}),l.jsx(ge,{className:"text-neutral3 pt-1 pb-2",children:"Use for real-time communication via SSE."}),l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(ge,{className:"px-2 py-1 bg-surface4 rounded-lg",children:n}),l.jsx("div",{className:"pt-1",children:l.jsx(la,{tooltip:"Copy SSE URL",content:n})})]})]}),l.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[l.jsx(Et,{icon:l.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"CLI"}),children:"Command Line"}),l.jsx(ge,{className:"text-neutral3 pt-1 pb-2",children:"Use for local command-line access via npx and mcp-remote."}),l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(ge,{className:"px-2 py-1 bg-surface4 rounded-lg",children:a}),l.jsx("div",{className:"pt-1",children:l.jsx(la,{tooltip:"Copy Command Line Config",content:a})})]})]})]})]}),l.jsx("div",{className:"h-full overflow-y-scroll border-l border-border1",children:l.jsx(ers,{server:t})})]})},ers=({server:e})=>{const{data:t={},isLoading:n}=d4t(e);if(n)return null;const r=Object.keys(t);return l.jsxs("div",{className:"p-5 overflow-y-scroll",children:[l.jsxs("div",{className:"text-neutral6 flex gap-2 items-center",children:[l.jsx(Be,{size:"lg",className:"bg-surface4 rounded-md p-1",children:l.jsx(Pm,{})}),l.jsx(ge,{variant:"header-md",as:"h2",className:"font-medium",children:"Available Tools"})]}),l.jsx("div",{className:"flex flex-col gap-2 pt-6",children:r.map(s=>{const a=t[s];return l.jsx(nrs,{tool:a,serverId:e.id},s)})})]})};function trs(e){if(!e)return!1;const t=e.ui;return!!(typeof t?.resourceUri=="string"&&t.resourceUri.startsWith("ui://")||typeof e["ui/resourceUri"]=="string"&&e["ui/resourceUri"].startsWith("ui://"))}const nrs=({tool:e,serverId:t})=>{const n=y.useRef(null),{Link:r,paths:s}=an(),a=v3t[e.toolType||"tool"],i=trs(e._meta);return l.jsxs(hp,{onClick:()=>n.current?.click(),children:[l.jsx($wt,{children:l.jsx(a,{className:"group-hover/entity:text-accent6"})}),l.jsxs(vp,{children:[l.jsx(mp,{children:l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(r,{ref:n,href:s.mcpServerToolLink(t,e.id),children:e.id}),i&&l.jsx(Et,{className:"text-[10px] py-0",children:"App"})]})}),l.jsx(gp,{children:e.description})]})]})},rrs=()=>{const{serverId:e}=Mr(),{data:t=[],isLoading:n}=hH(),r=t.find(s=>s.id===e);return l.jsx("div",{className:"h-full w-full overflow-hidden",children:l.jsx(Jns,{isLoading:n,server:r})})};function srs(e){if(!e)return;const t=e.ui;if(t?.resourceUri)return t.resourceUri;const n=e["ui/resourceUri"];if(typeof n=="string")return n}const ars=({toolId:e,serverId:t})=>{const{canExecute:n}=qb(),r=n("tools"),s=Ze(),{data:a,isLoading:i,error:o}=U_e(t,e),{mutateAsync:c,isPending:u,data:d}=yFr(t,e),f=a?srs(a._meta):void 0,{data:p}=St({queryKey:["mcp-app-resource",t,f],queryFn:async()=>f?(await s.readMcpServerResource(t,f)).contents[0]?.text??null:null,enabled:!!f}),h=y.useCallback(async(v,b)=>await c(b),[c]);y.useEffect(()=>{if(o){const v=o instanceof Error?o.message:"Failed to load tool";Fe.error(`Error loading tool: ${v}`)}},[o]);const m=async v=>{if(a)return await c(v)};if(i)return l.jsxs("div",{className:"p-6",children:[l.jsx(rs,{className:"h-8 w-48 mb-4"}),l.jsx(rs,{className:"h-32 w-full"})]});if(o)return null;if(!a)return l.jsx("div",{className:"py-12 text-center px-6",children:l.jsx(ge,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})});if(!r)return l.jsx("div",{className:"py-12 text-center px-6",children:l.jsx(ge,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})});let g;try{g=bv(gv(a.inputSchema))}catch(v){console.error("Error processing input schema:",v),Fe.error("Failed to process tool input schema."),g=ds({})}return l.jsxs("div",{className:"flex flex-col gap-4",children:[p&&l.jsx("div",{className:"border-b border-border1 p-4",children:l.jsx(u4t,{html:p,toolName:a.name??a.id,onToolCall:h})}),l.jsx(xOe,{executionResult:d,isExecutingTool:u,zodInputSchema:g,handleExecuteTool:m,toolDescription:a.description||"",toolId:a.id})]})},irs=()=>{const{serverId:e,toolId:t}=Mr(),{data:n,isLoading:r}=U_e(e,t);return r||!n?null:l.jsx("div",{className:"h-full w-full overflow-y-auto",children:l.jsx(ars,{toolId:t,serverId:e})})},wXe={agents:ea.AGENT,workflows:ea.WORKFLOW_RUN,tools:ea.TOOL};function ors(){const{data:e,isLoading:t,isError:n}=Vrr(),{getTracesHref:r,getBucketTracesHref:s}=B$(),{Link:a}=an(),i=bu();return l.jsx(Rrr,{data:e,isLoading:t,isError:n,onPointClick:(o,c)=>{const u=new Date(String(c.rawTimestamp)).getTime();Number.isFinite(u)&&i(s({rootEntityType:wXe[o]},u,"1h"))},actions:o=>l.jsx(Nq,{href:r({rootEntityType:wXe[o]}),LinkComponent:a})})}function lrs(){const e=Qrr(),t=Yrr(),{getTracesHref:n}=B$(),{Link:r}=an();return l.jsx(Mrr,{threads:{data:e.data,isLoading:e.isLoading,isError:e.isError},resources:{data:t.data,isLoading:t.isLoading,isError:t.isError},LinkComponent:r,getThreadRowHref:s=>n({threadId:s.threadId,...s.resourceId?{resourceId:s.resourceId}:{}}),getResourceRowHref:s=>n({resourceId:s.resourceId})})}function crs(){const{data:e,isLoading:t,isError:n}=ASt();return l.jsx(L$,{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:n})}function urs(){const{data:e,isLoading:t,isError:n}=Brr();return l.jsx(L$,{label:"Total Model Cost",value:e?.cost!=null?Jy(e.cost,e.costUnit):null,prevValue:e?.previousCost!=null?Jy(e.previousCost,e.costUnit):void 0,changePct:e?.costChangePercent??null,isLoading:t,isError:n})}function drs(){const{data:e,isLoading:t,isError:n}=Urr();return l.jsx(L$,{label:"Total Tokens",value:e?.value!=null?su(e.value):null,prevValue:e?.previousValue!=null?su(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:n})}function frs(){const{data:e,isLoading:t,isError:n}=Wrr();return l.jsx(L$,{label:"Total Threads",value:e?.value!=null?su(e.value):null,prevValue:e?.previousValue!=null?su(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:n})}function prs(){const{data:e,isLoading:t,isError:n}=Grr();return l.jsx(L$,{label:"Total Resources",value:e?.value!=null?su(e.value):null,prevValue:e?.previousValue!=null?su(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:n})}function hrs({onClear:e,onRemoveAll:t,onSave:n,onRemoveSaved:r,isLoading:s,filterFields:a,filterTokens:i,onFilterTokensChange:o,autoFocusFilterFieldId:c}){const u=i.length>0,d=i.some(f=>mrs(f,a));return l.jsxs("div",{className:X("grid grid-cols-[1fr_auto] gap-3 items-start"),children:[l.jsx(V0e,{fields:a,tokens:i,onTokensChange:o,disabled:s,autoFocusFieldId:c}),u&&l.jsx(U0e,{disabled:s,onClear:d?e:void 0,onRemoveAll:t,onSave:n,onRemoveSaved:r})]})}function mrs(e,t){const n=t.find(r=>r.id===e.fieldId);return n?n.kind==="text"?typeof e.value=="string"&&e.value.trim()!=="":n.kind==="pick-multi"?n.multi?Array.isArray(e.value)&&e.value.length>0:typeof e.value=="string"&&e.value!==""&&e.value!=="Any":n.kind==="multi-select"?Array.isArray(e.value)&&e.value.length>0:!1:!1}function grs(){const{data:e,isLoading:t,isError:n}=qrr(),{getTracesHref:r}=B$(),{Link:s}=an();return l.jsx($rr,{rows:e,isLoading:t,isError:n,LinkComponent:s,getRowHref:()=>r({rootEntityType:ea.AGENT}),actions:l.jsx(Nq,{href:r({rootEntityType:ea.AGENT}),LinkComponent:s})})}function vrs(){const{data:e,isLoading:t,isError:n}=Zrr(),{getTracesHref:r}=B$(),{Link:s}=an();return l.jsx(Lrr,{data:e,isLoading:t,isError:n,LinkComponent:s,getRowHref:a=>r({rootEntityType:ea.AGENT,entityName:a.name}),actions:l.jsx(Nq,{href:r({rootEntityType:ea.AGENT}),LinkComponent:s})})}const B5={agents:ea.AGENT,workflows:ea.WORKFLOW_RUN,tools:ea.TOOL};function yrs(){const{data:e,isLoading:t,isError:n}=Hrr(),{getTracesHref:r,getLogsHref:s}=B$(),{Link:a}=an();return l.jsx(zrr,{data:e,isLoading:t,isError:n,LinkComponent:a,getRowHref:(i,o)=>r({rootEntityType:B5[i],entityName:o.name}),getErrorSegmentHref:(i,o)=>o.errors>0?s({rootEntityType:B5[i],entityName:o.name,status:"error"}):void 0,actions:i=>l.jsxs(l.Fragment,{children:[l.jsx(Nq,{href:r({rootEntityType:B5[i]}),LinkComponent:a}),l.jsx(Arr,{href:s({rootEntityType:B5[i],status:"error"}),LinkComponent:a})]})})}const brs=new Set(["ObservabilityStorageClickhouseVNext","ObservabilityStorageDuckDB","ObservabilityInMemory"]),tle="period";function xrs(){const[e,t]=fo(),n=e.get(tle),r=jSt(n)?n:"24h",s=y.useMemo(()=>wrr(e),[e.toString()]),a=y.useCallback(c=>{t(u=>{const d=new URLSearchParams(u);return c==="24h"?d.delete(tle):d.set(tle,c),d},{replace:!0})},[t]),i=y.useCallback(c=>{t(u=>{const d=new URLSearchParams(u);return krr(d,c),d},{replace:!0})},[t]),o=y.useRef(!1);return y.useEffect(()=>{if(o.current||(o.current=!0,brr(e)))return;const c=TSt();c&&t(u=>{const d=new URLSearchParams(u);for(const[f,p]of c)d.append(f,p);return d},{replace:!0})},[]),l.jsx(jrr,{preset:r,filterTokens:s,onPresetChange:a,onFilterTokensChange:i,children:l.jsx(wrs,{})})}function wrs(){const[e]=fo(),{error:t,isLoading:n}=ASt(),{filterTokens:r,setFilterTokens:s}=jq(),[a,i]=y.useState(),{data:o,isLoading:c}=wH(),u=o?.observabilityStorageType,d=u?brs.has(u):!1,f=u==="ObservabilityInMemory",{data:p,isLoading:h}=fwe(),{data:m,isLoading:g}=pwe(),{data:v,isLoading:b}=mwe(),{data:S,isLoading:w}=hwe(),_=y.useMemo(()=>xrr({availableTags:p??[],availableEntityNames:m??[],availableServiceNames:v??[],availableEnvironments:S??[],loading:{tags:h,entityNames:g,serviceNames:b,environments:w}}),[p,m,v,S,h,g,b,w]),[O,E]=y.useState(()=>TSt()!==null),T=y.useCallback(()=>{vrr(e),E(!0),Fe.success("Filters setting for Metrics saved")},[e]),j=y.useCallback(()=>{yrr(),E(!1),Fe.success("Filters setting for Metrics cleared up")},[]),N=y.useCallback(()=>{s([])},[s]),I=y.useCallback(()=>{const R=r.map(P=>{const U=_.find(M=>M.id===P.fieldId);return U?U.kind==="text"?{fieldId:P.fieldId,value:""}:U.kind==="pick-multi"?U.multi?{fieldId:P.fieldId,value:[]}:{fieldId:P.fieldId,value:"Any"}:U.kind==="multi-select"?{fieldId:P.fieldId,value:[]}:P:P});s(R)},[_,r,s]);return t&&zs(t)?l.jsx(ir,{children:l.jsx(ua,{})}):t&&Bs(t)?l.jsx(ir,{children:l.jsx(na,{resource:"metrics"})}):t?l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load metrics",message:t.message})}):l.jsxs(wn,{width:"wide",height:"full",children:[l.jsxs(wn.TopArea,{children:[l.jsx(wn.Row,{children:l.jsxs(wn.Column,{className:"flex flex-wrap items-start justify-start gap-2",children:[l.jsx(Nrr,{}),l.jsx(H0e,{fields:_,tokens:r,onTokensChange:s,disabled:n,onStartTextFilter:i})]})}),l.jsx(hrs,{isLoading:n,filterFields:_,filterTokens:r,onFilterTokensChange:s,onClear:I,onRemoveAll:N,onSave:T,onRemoveSaved:O?j:void 0,autoFocusFilterFieldId:a})]}),c?null:d?l.jsxs("div",{className:"grid gap-8 content-start pb-10",children:[f&&l.jsx(Hn,{variant:"info",title:"Metrics are not persisted",children:l.jsx(Hn.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."})}),l.jsxs(mfe,{children:[l.jsx(crs,{}),l.jsx(urs,{}),l.jsx(drs,{}),l.jsx(frs,{}),l.jsx(prs,{})]}),l.jsxs(mfe,{children:[l.jsx(grs,{}),l.jsx(vrs,{}),l.jsx(lrs,{}),l.jsx(yrs,{}),l.jsx(ors,{})]})]}):l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(oi,{iconSlot:l.jsx(Hd,{}),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:l.jsxs(de,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/observability/metrics/overview",target:"_blank",rel:"noopener noreferrer",children:["Metrics Documentation ",l.jsx(Da,{})]})})})]})}const Srs=[{title:"Metrics",description:"View system performance metrics, request latencies, and throughput across your agents and workflows.",icon:VZt,href:"/metrics"},{title:"Traces",description:"Explore distributed traces to debug and understand the execution flow of your AI operations.",icon:kc,href:"/observability"}];function krs(){return l.jsx($tr,{children:l.jsx("div",{className:"px-6 overflow-y-auto",children:l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:Srs.map(e=>l.jsxs(qi,{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:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),l.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),l.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})})}const _rs=[{title:"Agents",description:"Create and manage AI agents with tools, memory, and custom instructions.",icon:Go,href:"/agents"},{title:"Prompts",description:"Design and version reusable prompt templates for your agents.",icon:lu,href:"/prompts"},{title:"Workflows",description:"Build step-based execution flows with suspend, resume, and branching.",icon:Tc,href:"/workflows"},{title:"Processors",description:"Configure data processors for transforming and routing information.",icon:wC,href:"/processors"},{title:"MCP Servers",description:"Connect to Model Context Protocol servers for external tool access.",icon:Pm,href:"/mcps"},{title:"Tools",description:"Browse and test the tools available to your agents and workflows.",icon:Cc,href:"/tools"},{title:"Workspaces",description:"Organize your projects and resources into isolated workspaces.",icon:ZT,href:"/workspaces"},{title:"Request Context",description:"Inspect request-scoped context propagation for dynamic configuration.",icon:T7,href:"/request-context"}];function Ors(){return l.jsx(wn,{width:"narrow",children:l.jsx(wn.MainArea,{children:l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:_rs.map(e=>l.jsxs(qi,{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:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),l.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title})]}),l.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})})}function Ers(){const{paths:e}=an(),{data:t,isLoading:n,error:r}=_3t(),{isCmsAvailable:s}=ZD(),[a,i]=y.useState(""),o=t?.promptBlocks??[];return r&&zs(r)?l.jsx(ir,{children:l.jsx(ua,{})}):r&&Bs(r)?l.jsx(ir,{children:l.jsx(na,{resource:"prompt blocks"})}):r?l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load prompt blocks",message:r.message})}):o.length===0&&!n?l.jsx(ir,{children:l.jsx(aYr,{})}):l.jsxs(wn,{children:[l.jsx(wn.TopArea,{children:l.jsxs(wn.Row,{align:"center",stack:"responsive",children:[l.jsx("div",{className:"max-w-120 flex-1",children:l.jsx(Iv,{onSearch:i,label:"Filter prompts",placeholder:"Filter by name or description"})}),s&&l.jsxs(de,{as:qi,to:e.cmsPromptBlockCreateLink(),variant:"primary",className:"shrink-0",children:[l.jsx(Cs,{}),"Create Prompt"]})]})}),l.jsx(sYr,{promptBlocks:o,isLoading:n,search:a})]})}function Crs(){return l.jsx(wn,{width:"narrow",children:l.jsx(wn.MainArea,{children:l.jsx(lWr,{children:l.jsx(e3t,{})})})})}const Trs=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:WWt,href:"/swagger-ui",external:!1},{title:"Documentation",description:"Read the official Mastra documentation for guides, references, and tutorials.",icon:GJe,href:"https://mastra.ai/en/docs",external:!0},{title:"Github",description:"Browse the source code, report issues, and contribute to the Mastra project.",icon:Da,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:VR,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:set,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:LZt,href:"https://mastra.ai/contact?ref=studio",external:!0}];function jrs(){return l.jsx(wn,{width:"narrow",children:l.jsx(wn.MainArea,{children:l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:Trs.map(e=>l.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:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx(e.icon,{className:"h-5 w-5 text-icon3 group-hover:text-accent1 transition-colors"}),l.jsx("span",{className:"text-ui-md font-medium text-text1",children:e.title}),e.external&&l.jsx(Da,{className:"h-3.5 w-3.5 text-icon3 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]}),l.jsx("p",{className:"text-ui-sm text-text3 leading-relaxed",children:e.description})]},e.href))})})})}function Nrs(){const{data:e={},isLoading:t,error:n}=Op(),[r,s]=y.useState(""),[a,i]=y.useState("all");if(n&&zs(n))return l.jsx(ir,{children:l.jsx(ua,{})});if(n&&Bs(n))return l.jsx(ir,{children:l.jsx(na,{resource:"scorers"})});if(n)return l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load scorers",message:n.message})});if(Object.keys(e).length===0&&!t)return l.jsx(ir,{children:l.jsx(OGr,{})});const o=a!=="all"||r!=="",c=()=>{s(""),i("all")};return l.jsxs(wn,{children:[l.jsx(wn.TopArea,{children:l.jsx(CGr,{search:r,onSearchChange:s,sourceFilter:a,onSourceFilterChange:i,onReset:c,hasActiveFilters:o})}),l.jsx(_Gr,{scorers:e,isLoading:t,search:r,sourceFilter:a})]})}function Ars(){const{scorerId:e}=Mr(),[t,n]=fo(),r=t.get("scoreId")??void 0,[s,a]=y.useState(r),[i,o]=y.useState({value:"all",label:"All Entities",type:"ALL"}),{scorer:c,error:u}=wGr(e),{data:d={},isLoading:f,error:p}=Lv(),{isLoading:h,error:m}=Bw(),{data:g=[],isLoading:v,error:b,isFetchingNextPage:S,hasNextPage:w,setEndOfListElement:_}=xGr({scorerId:e,entityId:i?.value==="all"?void 0:i?.value,entityType:i?.type==="ALL"?void 0:i?.type}),O=y.useMemo(()=>c?.agentIds?.filter(H=>d[H]).map(H=>({value:H,label:d[H].name,type:"AGENT"}))||[],[c?.agentIds,d]),E=y.useMemo(()=>c?.workflowIds?.map(H=>({value:H,label:H,type:"WORKFLOW"}))||[],[c?.workflowIds]),T=y.useMemo(()=>[{value:"all",label:"All Entities",type:"ALL"},...O,...E],[O,E]),j=t.get("entity")??"all",N=T.find(H=>H.value===j);N&&N.value!==i?.value&&o(N),y.useEffect(()=>{if(u){const H=u instanceof Error?u.message:"Failed to load scorer";Fe.error(`Error loading scorer: ${H}`)}},[u]),y.useEffect(()=>{if(p){const H=p instanceof Error?p.message:"Failed to load agents";Fe.error(`Error loading agents: ${H}`)}},[p]),y.useEffect(()=>{if(m){const H=m instanceof Error?m.message:"Failed to load workflows";Fe.error(`Error loading workflows: ${H}`)}},[m]);const I=H=>{H?.value&&n(D=>{const Y=new URLSearchParams(D);return Y.set("entity",H.value),Y})};y.useEffect(()=>{const H=t.get("scoreId")??void 0;if(H===s)return;if(!H){a(void 0);return}g.find(Y=>Y.id===H)&&a(H)},[t,g]);const R=y.useCallback(H=>{a(H||void 0),n(D=>{const Y=new URLSearchParams(D);return H?Y.set("scoreId",H):Y.delete("scoreId"),Y})},[n]);if(!c)return null;const P=zs(u)||zs(p)||zs(m),U=u&&Bs(u),M=!P&&!U&&(u||p||m),L=!v&&g.length===0,F=i?.value!=="all",z=c?.scorer?.source==="stored"?l.jsx(Pv,{owner:"scorer-detail",children:l.jsxs(de,{variant:"default",as:qi,to:`/cms/scorers/${e}/edit`,size:"sm",children:[l.jsx(Cb,{})," Edit"]})}):null;if(P||U||M||L&&!F){const H=(u instanceof Error?u.message:void 0)??(p instanceof Error?p.message:void 0)??(m instanceof Error?m.message:void 0)??"An unexpected error occurred";return l.jsxs(wn,{width:"wide",height:"full",children:[z,l.jsx(wn.MainArea,{isCentered:!0,children:P?l.jsx(ua,{}):U?l.jsx(na,{resource:"scorers"}):M?l.jsx(Jl,{title:"Failed to load scorer",message:H}):l.jsx(pGr,{})})]})}return l.jsxs(wn,{width:"wide",children:[z,l.jsx(wn.TopArea,{children:l.jsx(gGr,{selectedEntity:i,entityOptions:T,onEntityChange:I,onReset:()=>{n(H=>{const D=new URLSearchParams(H);return D.set("entity","all"),D})},isLoading:v||f||h})}),l.jsx(fGr,{scores:g,isLoading:v,selectedScoreId:s,isFetchingNextPage:S,hasNextPage:w,setEndOfListElement:_,onScoreClick:R,errorMsg:b?.message})]})}const NLt=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],Irs=e=>NLt.some(t=>t.value===e),Rrs=()=>{const{baseUrl:e,headers:t,apiPrefix:n}=cOe(),{theme:r,setTheme:s}=$j();return l.jsx(wn,{width:"narrow",children:l.jsxs(wn.MainArea,{className:"flex flex-col gap-5 mt-6",children:[l.jsx(D5e,{title:"Theme",description:"Customize the appearance of the studio.",children:l.jsx(XJn,{label:"Theme mode",htmlFor:"theme",children:l.jsxs(Ii,{value:r,onValueChange:a=>{Irs(a)&&s(a)},children:[l.jsx(wi,{id:"theme",className:"w-full sm:w-48",children:l.jsx(Ri,{})}),l.jsx(Si,{children:NLt.map(a=>l.jsx(vs,{value:a.value,children:a.label},a.value))})]})})}),l.jsx(D5e,{title:"Mastra Connection",description:"Configure the Mastra instance URL, API prefix, and request headers used by the studio.",children:l.jsx(r3t,{initialConfig:{baseUrl:e,headers:t,apiPrefix:n}})})]})})};function Prs(){const[e]=fo(),t=bu(),n=e.get("redirect")||"/",r=()=>{n.startsWith("http")?window.location.href=n:t(n,{replace:!0})};return l.jsx(jLt,{redirectUri:n,onSuccess:r,initialMode:"signup"})}function Mrs(e){return e.replace(/\/$/,"").split("/").pop()}function RH({children:e,className:t}){return l.jsx("div",{className:X("border border-border1 rounded-lg mt-12 py-8 lg:min-h-[25rem] transition-height px-4 lg:px-12",t),children:e})}function $rs({templates:e,linkComponent:t,className:n,isLoading:r}){const s=t||"a";return r?l.jsx("div",{className:X("grid gap-y-4",n),children:Array.from({length:5}).map((a,i)=>l.jsx("div",{className:"h-16 bg-surface3 animate-pulse rounded-lg"},i))}):l.jsx("div",{className:X("grid gap-y-4",n),children:e.map(a=>{const i=a?.agents||a?.tools||a?.networks||a?.workflows||a?.mcp;return l.jsxs("article",{className:X("border border-border1 rounded-lg overflow-hidden w-full grid grid-cols-[1fr_auto] bg-surface3 transition-colors hover:bg-surface4"),children:[l.jsxs(s,{to:`/templates/${a.slug}`,className:X("grid [&:hover_p]:text-neutral5",{"grid-cols-[8rem_1fr] lg:grid-cols-[12rem_1fr]":a.imageURL}),children:[a.imageURL&&l.jsx("div",{className:X("overflow-hidden"),children:l.jsx("div",{className:"w-full h-full bg-cover thumb transition-scale duration-150",style:{backgroundImage:`url(${a.imageURL})`}})}),l.jsxs("div",{className:X("grid py-3 px-6 w-full gap-0.5","[&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:text-neutral3"),children:[l.jsx("h2",{className:"text-ui-lg text-neutral5",children:a.title}),l.jsx("p",{className:"text-ui-md text-neutral4 transition-colors duration-500",children:a.description}),l.jsxs("div",{className:"hidden 2xl:flex text-neutral3 text-ui-md flex-wrap items-center gap-4 mt-3",children:[i&&l.jsxs("ul",{className:X("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&&l.jsxs("li",{children:[l.jsx(Go,{})," ",a.agents.length]}),a?.tools&&a.tools.length>0&&l.jsxs("li",{children:[l.jsx(Cc,{})," ",a.tools.length]}),a?.networks&&a.networks.length>0&&l.jsxs("li",{children:[l.jsx(het,{})," ",a.networks.length]}),a?.workflows&&a.workflows.length>0&&l.jsxs("li",{children:[l.jsx(A7,{})," ",a.workflows.length]}),a?.mcp&&a.mcp.length>0&&l.jsxs("li",{children:[l.jsx(Pm,{})," ",a.mcp.length]})]}),i&&a.supportedProviders&&l.jsx("small",{children:"|"}),l.jsx("div",{className:"flex items-center text-neutral3 gap-4",children:a.supportedProviders.map(o=>l.jsx("span",{className:"",children:o},o))})]})]})]}),l.jsx("a",{href:a.githubUrl,className:X("group items-center gap-2 text-ui-md ml-auto pr-4 hidden","lg:flex"),target:"_blank",rel:"noopener noreferrer",children:l.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:[l.jsx(jwt,{})," ",Mrs(a.githubUrl)]})})]},a.slug)})})}function Drs({tagOptions:e,selectedTag:t,providerOptions:n,selectedProvider:r,onTagChange:s,onProviderChange:a,searchTerm:i,onSearchChange:o,onReset:c,className:u,isLoading:d}){return d?l.jsxs("div",{className:X("h-[6.5rem] flex items-center gap-8","[&>div]:bg-surface3 [&>div]:w-48 [&>div]:h-8 [&>div]:animate-pulse",u),children:[l.jsx("div",{})," ",l.jsx("div",{})," ",l.jsx("div",{})]}):l.jsxs("div",{className:X("flex flex-wrap mx-auto sticky top-0 gap-4 bg-surface2 py-8",u),children:[l.jsx(rw,{name:"search-templates",label:"Search templates",labelIsHidden:!0,value:i,onChange:f=>o?.(f.target.value),placeholder:"Search Template"}),l.jsx(Yl,{label:"Filter by tag",labelIsHidden:!0,name:"filter-tag",value:t,onValueChange:s,options:e}),l.jsx(Yl,{label:"Filter by provider",labelIsHidden:!0,name:"filter-provider",value:r,onValueChange:a,options:n}),c&&l.jsxs(de,{onClick:c,children:["Reset ",l.jsx(Pr,{})]})]})}function Lrs(){const{data:e,isLoading:t}=tir(),{templates:n,tags:r,providers:s}=e??{templates:[],tags:[],providers:[]},[a,i]=y.useState("all"),[o,c]=y.useState("all"),[u,d]=y.useState(""),f=[{value:"all",label:"Any tag"}];(r||[]).forEach(S=>{f.push({value:S,label:S})});const p=[{value:"all",label:"Any provider"}];(s||[]).forEach(S=>{p.push({value:S,label:S})});const h=(S,w)=>{w==="tag"?i(S):w==="provider"&&c(S)},m=S=>{d(S)},g=()=>{i("all"),c("all"),d("")},v=n.filter(S=>!(u&&!S.title.toLowerCase().includes(u)&&!S.description.toLowerCase().includes(u)||a!=="all"&&!S.tags.includes(a)||o!=="all"&&!S.supportedProviders.includes(o))),b=u||a!=="all"||o!=="all";return l.jsxs(fr,{children:[l.jsx(L0e,{children:l.jsxs(Dwt,{children:[l.jsx(Be,{children:l.jsx(_S,{})}),"Templates"]})}),l.jsxs("div",{className:X("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[l.jsx(Drs,{selectedTag:a,onTagChange:S=>h(S,"tag"),tagOptions:f,selectedProvider:o,onProviderChange:S=>h(S,"provider"),providerOptions:p,searchTerm:u,onSearchChange:m,onReset:b?g:void 0,className:"max-w-[80rem]",isLoading:t}),l.jsx($rs,{templates:v,linkComponent:qi,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const zrs="1.36.0-alpha.6";function Frs({errorMsg:e,validationErrors:t}){const n=typeof e=="string"?e:e!=null?String(e):void 0,r=n?.includes("Invalid schema for function"),s=n?.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.":r?"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:l.jsx(Vy,{className:"text-yellow-500"}),title:"Template Installed with Warnings"}:{icon:l.jsx(xGt,{}),title:"Template Installation Failed"},{icon:o,title:c}=i();return l.jsxs(RH,{className:"space-y-4 text-neutral3 mb-8 content-center",children:[l.jsxs("div",{className:X("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[o,l.jsxs("div",{className:"text-center space-y-2",children:[l.jsx("p",{className:"text-ui-md font-medium text-neutral5",children:c}),l.jsx("p",{className:"text-ui-md text-neutral3",children:a()})]})]}),t&&t.length>0&&l.jsxs("details",{className:"text-xs",children:[l.jsxs("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:["Show Validation Issues (",t.length,")"]}),l.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)=>l.jsxs("div",{className:"border-l-2 border-red-400 pl-2",children:[l.jsx("div",{className:"font-medium text-red-600 dark:text-red-400",children:u.type==="typescript"?"🔴 TypeScript Error":"⚠️ Lint Error"}),l.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))})]}),n&&!s&&l.jsxs("details",{className:"text-xs",children:[l.jsx("summary",{className:"cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center",children:"Show Details"}),l.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:l.jsx("div",{className:"whitespace-pre-wrap wrap-break-word",children:n})})]})]})}function Brs({providerOptions:e,selectedProvider:t,onProviderChange:n,variables:r,errors:s,handleInstallTemplate:a,handleVariableChange:i,isLoadingEnvVars:o,isInstalling:c,defaultModelProvider:u,defaultModelId:d,onModelUpdate:f}){return l.jsx(RH,{children:l.jsxs("div",{className:"max-w-[40rem] my-4 p-4 lg:p-8 mx-auto gap-8 grid",children:[l.jsxs("h2",{className:X("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 ",l.jsx(met,{})]}),l.jsx(Yl,{name:"template-provider",options:e,label:"Template AI Model Provider",onValueChange:n,value:t,placeholder:"Select",layout:"horizontal"}),t&&Object.entries(r||{}).length>0&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-neutral3 text-ui-md",children:"Set required Environmental Variables"}),l.jsx("div",{className:"grid grid-cols-[1fr_1fr] gap-4 items-start",children:o?l.jsxs("div",{className:X("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:[l.jsx(Qt,{})," Loading variables..."]}):Object.entries(r).map(([p,h])=>l.jsxs(y.Fragment,{children:[l.jsx(Ok,{name:`env-${p}`,labelIsHidden:!0,label:"Key",value:p,disabled:!0,className:"w-full"}),l.jsx(Ok,{name:p,labelIsHidden:!0,label:"Value",value:h,onChange:i,errorMsg:s.includes(p)?"Value is required.":"",autoComplete:"off",className:"w-full"})]},p))}),l.jsxs("div",{className:"border-t border-border1 pt-12 mt-3.5 relative",children:[l.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"}),l.jsx("h3",{className:"text-neutral4 text-ui-lg",children:"Set AI Model for Template Installation"}),l.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"}),l.jsx(t3t,{defaultProvider:u||"",defaultModel:d||"",updateModel:f||(()=>Promise.resolve({message:"Updated"})),closeEditor:()=>{},autoSave:!0,selectProviderPlaceholder:"Provider"})]})]}),t&&!o&&l.jsx(de,{className:X("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?l.jsxs(l.Fragment,{children:[l.jsx(Qt,{className:"w-4 h-4"})," Installing..."]}):l.jsxs(l.Fragment,{children:["Install ",l.jsx(kS,{})]})})]})})}function Urs({title:e,description:t,githubUrl:n,isLoading:r,infoData:s,templateSlug:a}){const i=a?`feat/install-template-${a}`:"feat/install-template-[slug]";return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:X("grid mt-8 items-center"),children:l.jsxs("div",{className:X("text-header-lg flex items-center gap-3","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50",{"[&>svg]:opacity-20":r}),children:[l.jsx(_S,{}),l.jsx("h2",{className:X({"bg-surface4 flex rounded-lg min-w-[50%]":r}),children:r?l.jsx(l.Fragment,{children:" "}):e})]})}),l.jsxs("div",{className:"grid lg:grid-cols-[1fr_1fr] gap-x-24",children:[l.jsxs("div",{className:"grid",children:[l.jsx("p",{className:X("mb-4 text-ui-md text-neutral4 mt-2 leading-7",{"bg-surface4 rounded-lg ":r}),children:r?l.jsx(l.Fragment,{children:" "}):t}),!r&&a&&l.jsxs("div",{className:X("bg-surface2 border border-surface4 rounded-lg p-4 mb-4","flex items-start gap-3"),children:[l.jsx("div",{className:"shrink-0 mt-0.5",children:l.jsx(_w,{className:"w-[1.1em] h-[1.1em] text-blue-500"})}),l.jsxs("div",{className:"flex-1 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(C7,{className:"w-[1em] h-[1em] text-neutral4"}),l.jsx("span",{className:"text-ui-md font-medium text-neutral5",children:"A new Git branch will be created"})]}),l.jsxs("div",{className:"text-ui-sm text-neutral4 space-y-1",children:[l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:"Branch name:"})," ",l.jsx("code",{className:"bg-surface3 px-1.5 py-0.5 rounded text-ui-sm font-mono",children:i})]}),l.jsx("div",{children:"This ensures safe installation with easy rollback if needed. Your main branch remains unchanged."})]})]})]}),n&&l.jsxs("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 mt-auto text-neutral3 text-ui-md hover:text-neutral5",children:[l.jsx(jwt,{}),n?.split("/")?.pop()]})]}),s&&l.jsx(g_,{data:s,labelsAreHidden:!0,isLoading:r})]})]})}function qrs({name:e,streamResult:t,workflowInfo:n}){const r=t?.phase||"initializing",s=t?.payload?.workflowState,a=t?.payload?.currentStep,i=t?.error,o=s?.steps||{},c=Object.keys(o).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:n?.allSteps?m in n.allSteps:!0,d=Object.entries(o).filter(([m,g])=>u(m)),f=d.length,p=()=>{switch(r){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..."}},h=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 l.jsxs(RH,{className:"space-y-6 text-neutral3 mb-8 content-center",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h3",{className:"text-lg font-semibold text-neutral5",children:p()}),t?.runId&&l.jsxs("div",{className:"mt-2 text-ui-sm text-neutral3",children:["Run ID: ",t.runId]})]}),c&&f>0&&!["error"].includes(r)&&l.jsx("div",{className:"max-w-[30rem] w-full mx-auto px-6",children:l.jsx(der,{steps:h})}),i&&r==="error"&&l.jsxs("div",{className:X("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:[l.jsx(uQt,{}),i||"Something went wrong"]}),c&&l.jsx(uer,{steps:h,currentStep:a,className:"pb-4"}),!c&&r==="initializing"&&l.jsxs("div",{className:"text-center text-sm text-neutral3 grid gap-4 justify-items-center",children:[l.jsx(Qt,{}),l.jsx("p",{children:"This may take some time..."})]})]})}function Vrs({name:e,installedEntities:t}){return l.jsxs(RH,{className:X("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[l.jsx(met,{}),l.jsx("h2",{className:"text-header-md",children:"Done!"}),l.jsxs("p",{className:"text-ui-md text-center text-neutral3 ",children:["The ",l.jsx("b",{className:"text-neutral4",children:e})," template has been successfully installed.",t&&t.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("br",{})," Installed entities are listed below."]})]}),t&&t.length>0&&l.jsx(g_,{data:t})]})}function Hrs(){const{templateSlug:e}=Mr(),[t,n]=fo(),[r,s]=y.useState(""),[a,i]=y.useState(""),[o,c]=y.useState(""),[u,d]=y.useState({}),[f,p]=y.useState([]),[h,m]=y.useState(null),[g,v]=y.useState(!1),[b,S]=y.useState(""),[w,_]=y.useState(!1),[O,E]=y.useState(!1),[T,j]=y.useState([]),{data:N,isLoading:I}=nir({repoOrSlug:e,owner:"mastra-ai"}),P=zrs?.includes("beta")??!1?"beta":"main",{data:U,isLoading:M}=rir({repo:N?.githubUrl?new URL(N.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:P}),{data:L,isLoading:F}=sir(),{mutateAsync:z,isPending:q}=air(),{mutateAsync:H}=iir(),{streamInstall:D,streamResult:Y,isStreaming:V}=lir(L),{observeInstall:$,streamResult:W,isStreaming:G}=cir(L);y.useEffect(()=>{const ne=t.get("runId");ne&&!g&&!h&&!V&&!G&&(console.info("🔄 Checking completed run after hot reload:",{runId:ne}),S(ne),H({runId:ne}).then(oe=>{const me=oe.snapshot;if(me?.status==="success"&&me?.result?.success)v(!0);else if(me?.result?.success===!1)if(me?.result?.validationResults&&!me?.result?.validationResults?.valid&&me?.result?.validationResults?.remainingErrors>0){const{remainingErrors:be,errors:Ce}=me.result.validationResults,je=`Template installation completed but ${be} validation issue${be>1?"s":""} remain unresolved.`;m(je),j(Ce||[])}else{const be=me?.result?.message||me?.result?.error||"Template installation failed";m(typeof be=="string"?be:String(be))}}).catch(oe=>{console.error("❌ Failed to fetch run details:",oe),m("Failed to retrieve installation status after reload")}))},[t,g,h,V,G,H]),y.useEffect(()=>{const ne=t.get("runId"),oe=t.get("resume"),me=t.get("provider");if(ne&&oe==="true"&&me&&!V&&!G&&!w&&!O&&L){S(ne),_(!0);try{H({runId:ne}).then(ce=>{if(ce.snapshot?.status==="running")return $.mutateAsync({runId:ne})}).then(()=>{n(ce=>{const be=new URLSearchParams(ce);return be.delete("resume"),be})}).catch(ce=>{console.error("❌ Failed to resume template installation:",ce),ce.message?.includes("404")||ce.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(ce){console.error("❌ Auto-resume failed with error:",ce),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,V,G,w,O,L,H,$,n]);const K=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],re=[{key:"tools",label:"Tools",value:N?.tools?.length?N.tools.map(ne=>ne).join(", "):"n/a",icon:l.jsx(Cc,{})},{key:"agents",label:"Agents",value:N?.agents?.length?N.agents.map(ne=>ne).join(", "):"n/a",icon:l.jsx(Go,{})},{key:"workflows",label:"Workflows",value:N?.workflows?.length?N.workflows.map(ne=>ne).join(", "):"n/a",icon:l.jsx(A7,{})},{key:"providers",label:"Providers",value:N?.supportedProviders?.length?N.supportedProviders.join(", "):"n/a",icon:l.jsx(Mg,{})},{key:"tags",label:"Tags",value:N?.tags?.length?N.tags.join(", "):"n/a",icon:l.jsx(QT,{})}],J=[{...re[0]},{...re[1]},{...re[2]}].filter(ne=>ne.value!=="n/a");y.useEffect(()=>{U&&d(U)},[U]),y.useEffect(()=>{const ne=Y||W;ne?.phase==="error"&&ne?.error&&m(typeof ne.error=="string"?ne.error:String(ne.error))},[Y?.phase,Y?.error,W?.phase,W?.error]);const ee=ne=>{s(ne)},se=async ne=>(i(ne.provider),c(ne.modelId),{message:"Model updated successfully"}),ie=async()=>{const ne=Object.entries(u).reduce((oe,[me,ce])=>(ce===""&&oe.push(me),oe),[]);if(ne.length>0){p(ne);return}if(N){m(null),v(!1),S(""),E(!0);try{const me={repo:N.githubUrl||`https://github.com/mastra-ai/template-${N.slug}`,ref:P,slug:N.slug,variables:u},{runId:ce}=await z({});S(ce),n(be=>{const Ce=new URLSearchParams(be);return Ce.set("runId",ce),Ce.set("resume","true"),Ce.set("provider",r||"openai"),Ce}),await D.mutateAsync({inputData:me,selectedModel:{provider:a,modelId:o},runId:ce})}catch(oe){E(!1),m(oe?.message||"Template installation failed"),console.error("Template installation failed",oe)}}},Q=ne=>{const{name:oe,value:me}=ne.target;me.trim()===""?p(ce=>[...ce,oe]):p(ce=>ce.filter(be=>be!==oe)),d(ce=>({...ce,[oe]:me}))};return l.jsx(fr,{children:l.jsx("div",{className:X("w-full lg:px-12 h-full overflow-y-scroll"),children:l.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[l.jsx(Urs,{isLoading:I,title:N?.title,description:N?.longDescription,imageURL:N?.imageURL,githubUrl:N?.githubUrl,infoData:re,templateSlug:e}),N&&l.jsxs(l.Fragment,{children:[(V||G)&&l.jsx(qrs,{name:N.title,streamResult:G?W:Y,runId:b,workflowInfo:L}),g&&l.jsx(Vrs,{name:N.title,installedEntities:J,linkComponent:qi}),h&&l.jsx(Frs,{errorMsg:h,validationErrors:T.length>0?T:Y?.validationResults?.errors||W?.validationResults?.errors}),!V&&!G&&!g&&!h&&l.jsx(Brs,{providerOptions:K,selectedProvider:r,onProviderChange:ee,variables:u,setVariables:d,errors:f,setErrors:p,handleInstallTemplate:ie,handleVariableChange:Q,isLoadingEnvVars:M||F,isInstalling:q,defaultModelProvider:a,defaultModelId:o,onModelUpdate:se})]})]})})})}const Zrs=()=>{const{toolId:e,agentId:t}=Mr();return l.jsx("div",{className:"h-full w-full overflow-y-auto",children:l.jsx(eQr,{toolId:e,agentId:t})})},Wrs=()=>{const{toolId:e}=Mr();return l.jsx("div",{className:"h-full w-full overflow-y-hidden",children:l.jsx(Xns,{toolId:e})})};function Grs(){const{traceId:e}=Mr(),[t,n]=fo(),r=bu(),s=t.get("spanId")||void 0,a=t.get("tab"),i=a==="scoring"?"scoring":a==="feedback"?"feedback":"details",o=t.get("scoreId")||void 0,[c,u]=y.useState(s??null),[d,f]=y.useState(),[p,h]=y.useState(i),[m,g]=y.useState(0),[v,b]=y.useState(!1),{data:S,isLoading:w,error:_}=dwe(e),O=y.useMemo(()=>S?.spans??[],[S?.spans]),E=y.useMemo(()=>O.find(se=>se.parentSpanId==null),[O]),{data:T,isLoading:j}=Ck(e,c??"");y.useEffect(()=>g(0),[e,c]);const{data:N,isLoading:I}=Op(),{data:R,isLoading:P}=yOe({traceId:e,spanId:c??void 0,page:m}),[U,M]=y.useState(0);y.useEffect(()=>M(0),[e,c]);const{data:L,isLoading:F}=gLt({traceId:e,page:U});y.useEffect(()=>{if(o&&R?.scores&&!d){const se=R.scores.find(ie=>ie.id===o);se&&f(se)}},[o,R?.scores,d]);const z=y.useCallback(se=>{const ie=new URLSearchParams(t);for(const[Q,ne]of Object.entries(se))ne===null||ne===""?ie.delete(Q):ie.set(Q,ne);n(ie,{replace:!0})},[t,n]),q=y.useCallback(se=>{const ie=se??null,Q=ie===c;u(ie),Q||(f(void 0),h("details"),z({spanId:ie,tab:null,scoreId:null}))},[c,z]),H=y.useCallback(()=>{u(null),f(void 0),h("details"),z({spanId:null,tab:null,scoreId:null})},[z]),D=y.useCallback(se=>{u(se),f(void 0),h("details"),z({spanId:se,tab:null,scoreId:null})},[z]),{handlePreviousSpan:Y,handleNextSpan:V}=qSt(O,c,D),$=y.useCallback(se=>{const ie=se;h(ie),f(void 0),z({tab:ie==="details"?null:ie,scoreId:null})},[z]),W=y.useCallback(se=>{f(se),z({scoreId:se.id})},[z]),G=y.useCallback(()=>{f(void 0),z({scoreId:null})},[z]),K=y.useCallback(()=>{r("/observability")},[r]),re=y.useCallback(()=>{h("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]),J=E?l.jsx(Pv,{owner:"trace-detail",children:l.jsxs(Nr,{children:[l.jsxs(de,{tooltip:"Evaluate Trace","aria-label":"Evaluate Trace",onClick:re,children:[l.jsx(bz,{}),"Evaluate"]}),l.jsxs(de,{tooltip:"Save as Dataset Item","aria-label":"Save as Dataset Item",onClick:()=>b(!0),children:[l.jsx(uu,{}),"Save"]})]})}):null,ee=E?l.jsx(wn.Row,{children:l.jsx(wn.Column,{children:l.jsx(DSt,{rootSpan:E,numOfCol:3})})}):null;return _?l.jsxs(wn,{height:"full",children:[J,ee&&l.jsx(wn.TopArea,{children:ee}),l.jsx(wn.MainArea,{isCentered:!0,children:l.jsx(USt,{error:_,resource:"traces",errorTitle:"Failed to load trace"})})]}):l.jsxs(wn,{children:[J,ee&&l.jsx(wn.TopArea,{children:ee}),l.jsx(TOe,{rootSpanId:E?.spanId,traceId:e,isOpen:v,onClose:()=>b(!1)}),l.jsxs("div",{className:X("grid h-full min-h-0 gap-4 overflow-hidden items-start mt-4",c?"grid-cols-[2fr_3fr]":"grid-cols-[1fr]"),children:[l.jsx(FSt,{traceId:e,spans:O,isLoading:w,onClose:K,onSpanSelect:q,onEvaluateTrace:re,initialSpanId:c,placement:"trace-page",timelineChartWidth:c?"default":"wide"}),c&&!w&&l.jsxs("div",{className:X("grid gap-4 max-h-full min-h-0 overflow-auto",d?"grid-rows-[1fr_1fr]":"grid-rows-[1fr]"),children:[l.jsx(BSt,{traceId:e,spanId:c,span:T?.span,isLoading:j,onClose:H,onPrevious:Y,onNext:V,activeTab:p,onTabChange:$,feedbackTabBadge:L?.pagination?.total??void 0,feedbackTabSlot:()=>l.jsx(hLt,{feedbackData:L,onPageChange:M,isLoadingFeedbackData:F}),scoringTabBadge:R?.pagination?.total??void 0,scoringTabSlot:({span:se,traceId:ie,spanId:Q})=>l.jsxs("div",{className:"grid gap-6",children:[l.jsx(COe,{traceId:ie,isTopLevelSpan:!se.parentSpanId,spanId:Q,entityType:se.attributes?.agentId||se.entityType===ea.AGENT?"Agent":se.attributes?.workflowId||se.entityType===ea.WORKFLOW_RUN?"Workflow":void 0,scorers:N,isLoadingScorers:I}),l.jsx(mLt,{scoresData:R,onPageChange:g,isLoadingScoresData:P,onScoreSelect:W})]})}),d&&l.jsx(gOe,{score:d,onClose:G})]})]})]})}function Qrs(){const{data:e,isLoading:t,error:n}=Bw(),[r,s]=y.useState("");return n&&zs(n)?l.jsx(ir,{children:l.jsx(ua,{})}):n&&Bs(n)?l.jsx(ir,{children:l.jsx(na,{resource:"workflows"})}):n?l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load workflows",message:n.message})}):Object.keys(e||{}).length===0&&!t?l.jsx(ir,{children:l.jsx(g2r,{})}):l.jsxs(wn,{children:[l.jsx(wn.TopArea,{children:l.jsxs(wn.Row,{align:"center",stack:"responsive",children:[l.jsx("div",{className:"max-w-120 flex-1",children:l.jsx(Iv,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})}),l.jsxs(de,{as:qi,to:"/workflows/schedules",variant:"primary",className:"shrink-0",children:[l.jsx(xM,{}),"Schedules"]})]})}),l.jsx(m2r,{workflows:e||{},isLoading:t,search:r})]})}const Yrs={active:"bg-accent1",paused:"bg-accent3"},Xrs={active:"text-accent1",paused:"text-accent3"},ALt=({status:e})=>l.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[l.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${Yrs[e]}`,"aria-hidden":!0}),l.jsx("span",{className:`text-ui-sm ${Xrs[e]}`,children:e})]}),pC=e=>!e||e<=0?"—":new Date(e).toLocaleString(),CR=e=>{if(!e||e<=0)return"—";const t=e-Date.now(),n=Math.abs(t),r=Math.floor(n/1e3);if(r<60)return t>=0?`in ${r}s`:`${r}s ago`;const s=Math.floor(r/60);if(s<60)return t>=0?`in ${s}m`:`${s}m ago`;const a=Math.floor(s/60);if(a<24)return t>=0?`in ${a}h`:`${a}h ago`;const i=Math.floor(a/24);return t>=0?`in ${i}d`:`${i}d ago`};function ILt({status:e}){const{icon:t,color:n}=Krs(e);return l.jsxs("span",{className:`inline-flex items-center gap-1.5 whitespace-nowrap text-ui-sm ${n}`,children:[l.jsx("span",{className:"inline-flex shrink-0 items-center","aria-hidden":!0,children:t}),l.jsx("span",{children:e})]})}function Krs(e){switch(e){case"success":return{icon:l.jsx(Ka,{size:14}),color:"text-accent1"};case"failed":return{icon:l.jsx(Pr,{size:14}),color:"text-accent2"};case"running":return{icon:l.jsx(Qt,{}),color:"text-neutral3"};case"suspended":return{icon:l.jsx(wme,{size:14}),color:"text-accent3"};case"canceled":return{icon:l.jsx(Hd,{size:14}),color:"text-neutral3"};case"pending":case"waiting":return{icon:l.jsx(Qk,{size:14}),color:"text-neutral3"};default:return{icon:null,color:"text-neutral3"}}}const SXe="auto auto auto auto 1fr";function Jrs(e){if(e===void 0)return"—";if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return`${t}m ${n}s`}function ess(e){const t=Math.abs(e),n=e<0?"-":"";return t<1e3?`${n}${t}ms`:t<6e4?`${n}${(t/1e3).toFixed(1)}s`:t<36e5?`${n}${(t/6e4).toFixed(1)}m`:`${n}${(t/36e5).toFixed(1)}h`}const tss=3e4,nss=5*6e4;function rss({triggers:e,isLoading:t,workflowId:n,hasNextPage:r,isFetchingNextPage:s,setEndOfListElement:a}){const{Link:i,paths:o}=an();return t?l.jsx(Dd,{columns:SXe}):e.length===0?l.jsx(ge,{variant:"ui-md",className:"text-neutral4 p-4",children:"No trigger history yet."}):l.jsxs(we,{columns:SXe,children:[l.jsxs(we.Top,{children:[l.jsx(we.TopCell,{children:"Run"}),l.jsx(we.TopCell,{children:"Status"}),l.jsx(we.TopCell,{children:"Started"}),l.jsx(we.TopCell,{children:"Duration"}),l.jsx(we.TopCell,{children:" "})]}),e.map(c=>{const u=c.actualFireAt-c.scheduledFireAt,d=ess(u),f=`Scheduled ${pC(c.scheduledFireAt)} — published ${pC(c.actualFireAt)} (drift ${d})`,p=c.outcome==="failed",h=p?c.error:c.run?.error,m=Math.abs(u),g=!p&&m>tss&&m<=nss,v=`${c.scheduleId}-${c.runId}-${c.actualFireAt}`,b=l.jsx("span",{className:n&&!p?"text-accent1 font-mono text-ui-sm whitespace-nowrap":"text-neutral3 font-mono text-ui-sm whitespace-nowrap",children:c.runId}),S=l.jsxs(l.Fragment,{children:[l.jsx(we.NameCell,{children:b}),l.jsx(we.TextCell,{children:l.jsxs("span",{className:"inline-flex items-center gap-2",children:[p?l.jsxs("span",{className:"inline-flex items-center gap-1.5 whitespace-nowrap text-ui-sm text-accent2",children:[l.jsx(Vy,{size:14}),"publish failed"]}):c.run?l.jsx(ILt,{status:c.run.status}):l.jsx("span",{className:"inline-flex items-center gap-1.5 whitespace-nowrap text-ui-sm text-neutral3",children:"pending"}),h?l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx("span",{className:"text-accent2 inline-flex",children:l.jsx(Vy,{size:14})})}),l.jsx(Yn,{children:h})]}):null]})}),l.jsx(we.TextCell,{children:l.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[l.jsx("span",{title:f,children:CR(c.actualFireAt)}),g?l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx("span",{className:"text-accent3 inline-flex",children:l.jsx(Vy,{size:14})})}),l.jsxs(Yn,{children:["Published ",d," after the scheduled fire time"]})]}):null]})}),l.jsx(we.TextCell,{children:c.run?l.jsx("span",{children:Jrs(c.run.durationMs)}):l.jsx("span",{className:"text-neutral4",children:"—"})}),l.jsx(we.TextCell,{children:" "})]});return n&&c.run&&!p?l.jsx(we.RowLink,{to:o.workflowRunLink(n,c.runId),LinkComponent:i,children:S},v):l.jsx(we.Row,{children:S},v)}),a?l.jsxs("div",{ref:a,className:"h-1 col-span-full",children:[s?l.jsx("div",{className:"flex justify-center py-4",children:l.jsx(Qt,{})}):null,!r&&e.length>0?l.jsx(ge,{variant:"ui-xs",className:"text-neutral4 text-center py-4 block",children:"All triggers loaded"}):null]}):null]})}const sss=e=>{const t=Ze();return St({queryKey:["schedule",e],enabled:!!e,queryFn:async()=>{if(!e)throw new Error("scheduleId is required");return t.getSchedule(e)}})},kXe=25,ass=e=>{const t=Ze(),{inView:n,setRef:r}=y_(),s=Lw({queryKey:["schedule-triggers",e],enabled:!!e,initialPageParam:void 0,queryFn:async({pageParam:u})=>e?t.listScheduleTriggers(e,{limit:kXe,toActualFireAt:u}):{triggers:[]},getNextPageParam:u=>{if(!(!u?.triggers?.length||u.triggers.length<kXe))return u.triggers[u.triggers.length-1].actualFireAt},refetchInterval:u=>(u.state.data?.pages.flatMap(p=>p.triggers)??[]).some(p=>p.run?p.run.status==="pending"||p.run.status==="running"||p.run.status==="waiting":p.outcome==="published")?5e3:!1}),a=s.data?.pages.flatMap(u=>u?.triggers??[])??[],{hasNextPage:i,isFetchingNextPage:o,fetchNextPage:c}=s;return y.useEffect(()=>{n&&i&&!o&&c()},[n,i,o,c]),{...s,data:a,setEndOfListElement:r}},iss=e=>{const t=Ze(),n=Ys();return nr({mutationFn:async r=>{if(!e)throw new Error("scheduleId is required");return r==="pause"?t.pauseSchedule(e):t.resumeSchedule(e)},onSuccess:(r,s)=>{n.invalidateQueries({queryKey:["schedule",e]}),n.invalidateQueries({queryKey:["schedules"]}),Fe.success(s==="pause"?"Schedule paused":"Schedule resumed")},onError:r=>{Fe.error(r.message)}})};function U5({label:e,children:t}){return l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx(ge,{variant:"ui-xs",className:"text-neutral4 uppercase tracking-wide",children:e}),l.jsx("div",{className:"text-ui-md",children:t})]})}function oss(){const{scheduleId:e}=Mr(),{paths:t}=an(),{data:n,error:r}=sss(e),{data:s,isLoading:a,error:i,hasNextPage:o,isFetchingNextPage:c,setEndOfListElement:u}=ass(e),d=iss(e);if(r&&zs(r))return l.jsx(ir,{children:l.jsx(ua,{})});if(r&&Bs(r))return l.jsx(ir,{children:l.jsx(na,{resource:"schedules"})});if(r)return l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load schedule",message:r.message})});const f=n?.target.type==="workflow"?n.target.workflowId:void 0;return l.jsxs(wn,{children:[l.jsx(wn.TopArea,{children:l.jsx(wn.Row,{className:"justify-end",children:l.jsxs(wn.Column,{className:"flex justify-end gap-2",children:[l.jsxs(de,{as:qi,to:t.schedulesLink(),variant:"ghost",children:[l.jsx(Eb,{}),"Back to schedules"]}),f?l.jsx(de,{as:qi,to:t.workflowLink(f),variant:"ghost",children:"Open workflow"}):null,n?l.jsx(de,{onClick:()=>d.mutate(n.status==="active"?"pause":"resume"),disabled:d.isPending,"data-testid":"schedule-toggle-button",children:n.status==="active"?l.jsxs(l.Fragment,{children:[l.jsx(Cme,{}),"Pause"]}):l.jsxs(l.Fragment,{children:[l.jsx(rb,{}),"Resume"]})}):null]})})}),n?l.jsxs("div",{className:"grid gap-6 h-full overflow-hidden grid-cols-[minmax(0,20rem)_1fr]",children:[l.jsxs("div",{className:"flex flex-col gap-4 border border-border1 rounded-md p-4 h-fit",children:[l.jsx(U5,{label:"Workflow",children:f?l.jsx(qi,{to:t.workflowLink(f),className:"text-accent1 hover:underline",children:f}):"—"}),l.jsxs(U5,{label:"Cron",children:[l.jsx("code",{className:"font-mono text-ui-md",children:n.cron}),n.timezone?l.jsx("span",{className:"text-neutral4 ml-2 text-ui-sm",children:n.timezone}):null]}),l.jsx(U5,{label:"Status",children:l.jsx(ALt,{status:n.status})}),l.jsx(U5,{label:"Next fire",children:l.jsx("span",{title:pC(n.nextFireAt),children:CR(n.nextFireAt)})})]}),l.jsxs("div",{className:"overflow-y-auto","data-testid":"schedule-triggers-panel",children:[l.jsx(ge,{variant:"ui-md",className:"mb-3",children:"Trigger history"}),i?l.jsx(Jl,{title:"Failed to load trigger history",message:i.message}):l.jsx(rss,{triggers:s??[],isLoading:a,workflowId:f,hasNextPage:o,isFetchingNextPage:c,setEndOfListElement:u})]})]}):null]})}const _Xe="minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto auto auto";function lss({schedules:e,isLoading:t,search:n=""}){const{paths:r,Link:s}=an(),a=y.useMemo(()=>{const i=n.toLowerCase();return i?e.filter(o=>o.id.toLowerCase().includes(i)||o.target.workflowId.toLowerCase().includes(i)):e},[e,n]);return t?l.jsx(Dd,{columns:_Xe}):l.jsxs(we,{columns:_Xe,children:[l.jsxs(we.Top,{children:[l.jsx(we.TopCell,{children:"Workflow"}),l.jsx(we.TopCell,{children:"Schedule ID"}),l.jsx(we.TopCell,{children:"Cron"}),l.jsx(we.TopCell,{children:"Status"}),l.jsx(we.TopCell,{children:"Next fire"}),l.jsx(we.TopCell,{children:"Last run"})]}),a.length===0&&n?l.jsx(we.NoMatch,{message:"No schedules match your search"}):null,a.length===0&&!n?l.jsx(we.NoMatch,{message:"No schedules configured"}):null,a.map(i=>l.jsxs(we.RowLink,{to:r.scheduleLink(i.id),LinkComponent:s,children:[l.jsx(we.NameCell,{children:l.jsx("span",{className:"truncate",children:i.target.workflowId})}),l.jsx(we.TextCell,{children:l.jsx("span",{className:"truncate font-mono text-ui-sm",title:i.id,children:i.id})}),l.jsx(we.TextCell,{children:l.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[l.jsx("code",{className:"font-mono text-ui-sm",children:i.cron}),i.timezone?l.jsx("span",{className:"text-neutral4 text-ui-xs",children:i.timezone}):null]})}),l.jsx(we.TextCell,{children:l.jsx(ALt,{status:i.status})}),l.jsx(we.TextCell,{children:l.jsx("span",{className:"whitespace-nowrap",title:pC(i.nextFireAt),children:CR(i.nextFireAt)})}),l.jsx(we.TextCell,{children:i.lastRun?l.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[l.jsx(ILt,{status:i.lastRun.status}),l.jsx("span",{className:"text-neutral4 text-ui-sm",title:pC(i.lastFireAt),children:i.lastFireAt?CR(i.lastFireAt):""})]}):i.lastFireAt?l.jsx("span",{className:"whitespace-nowrap",title:pC(i.lastFireAt),children:CR(i.lastFireAt)}):l.jsx("span",{className:"text-neutral4",children:"Never"})})]},i.id))]})}function css({workflowId:e}={}){const{data:t,isLoading:n,error:r}=gwe(e?{workflowId:e}:{}),[s,a]=y.useState("");return r?l.jsx(Jl,{title:"Failed to load schedules",message:r.message}):l.jsxs("div",{className:"grid grid-rows-[auto_1fr] gap-4 h-full overflow-hidden",children:[l.jsx("div",{className:"max-w-120",children:l.jsx(Iv,{onSearch:a,label:"Filter schedules",placeholder:"Filter by id or workflow"})}),l.jsx("div",{className:"overflow-y-auto",children:l.jsx(lss,{schedules:t??[],isLoading:n,search:s})})]})}function uss(){const[e]=fo(),t=e.get("workflowId")??void 0,{error:n}=gwe(t?{workflowId:t}:{});return n&&zs(n)?l.jsx(ir,{children:l.jsx(ua,{})}):n&&Bs(n)?l.jsx(ir,{children:l.jsx(na,{resource:"schedules"})}):l.jsx(wn,{children:l.jsx("div",{className:"h-full pt-6",children:l.jsx(css,{workflowId:t})})})}const OXe=()=>{const{workflowId:e}=Mr(),{data:t,isLoading:n,error:r}=q$(e);return r&&zs(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})}):r&&Bs(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"workflows"})}):l.jsx(fIt,{workflowId:e,workflow:t??void 0,isLoading:n})};function dss(e){if(!e)return null;switch(e.icon||e.provider){case"aws-s3":case"s3":return l.jsx(Rwt,{className:"h-4 w-4 text-[#FF9900]"});case"google-cloud":case"google-cloud-storage":case"gcs":return l.jsx(Nwt,{className:"h-4 w-4"});case"azure-blob":case"azure":return l.jsx(Pwt,{className:"h-4 w-4 text-[#0078D4]"});case"cloudflare":case"cloudflare-r2":case"r2":return l.jsx(KW,{className:"h-4 w-4 text-[#F38020]"});case"minio":return l.jsx(Ble,{className:"h-4 w-4 text-red-400"});case"database":return l.jsx(U0,{className:"h-4 w-4 text-emerald-400"});case"local":case"folder":return l.jsx(ZT,{className:"h-4 w-4 text-amber-400"});case"hard-drive":return l.jsx(Ble,{className:"h-4 w-4 text-slate-400"});case"cloud":return l.jsx(KW,{className:"h-4 w-4 text-sky-400"});default:return l.jsx(KW,{className:"h-4 w-4 text-neutral4"})}}function RLt(e,t=!1){const{name:n,type:r,mount:s}=e;if(r==="directory")return s?dss(s):t?l.jsx(HT,{className:"h-4 w-4 text-amber-400"}):l.jsx(ZT,{className:"h-4 w-4 text-amber-400"});switch(n.split(".").pop()?.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":return l.jsx(q0,{className:"h-4 w-4 text-blue-400"});case"json":return l.jsx(wM,{className:"h-4 w-4 text-yellow-400"});case"md":case"mdx":return l.jsx(lu,{className:"h-4 w-4 text-neutral4"});case"png":case"jpg":case"jpeg":case"gif":case"svg":case"webp":return l.jsx(_me,{className:"h-4 w-4 text-purple-400"});default:return l.jsx(Sme,{className:"h-4 w-4 text-neutral4"})}}function PLt(e){if(e==null||Number.isNaN(e))return"";if(e<0)return"-"+PLt(-e);if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB","TB"],r=Math.min(Math.floor(Math.log(e)/Math.log(t)),n.length-1);return parseFloat((e/Math.pow(t,r)).toFixed(1))+" "+n[r]}function fss(e){if("body"in e&&e.body&&typeof e.body=="object"){const r=e.body;if(typeof r.error=="string")return r.error;if(typeof r.message=="string")return r.message}const t=e.message,n=t.lastIndexOf(" - {");if(n!==-1)try{const r=t.slice(n+3),s=JSON.parse(r);if(s.error)return s.error;if(s.message)return s.message}catch{}return t.includes("status: 404")?"Directory not found":t}function MLt(e){return e==="."||e===""}function pss({path:e,onNavigate:t}){const r=MLt(e)?[]:e.split("/").filter(Boolean);return l.jsxs("div",{className:"flex items-center gap-1 text-sm overflow-x-auto",children:[l.jsx("button",{onClick:()=>t("."),className:"p-1 rounded hover:bg-surface4 text-neutral5 hover:text-neutral6 transition-colors","aria-label":"Workspace root",children:l.jsx(HT,{className:"h-4 w-4"})}),r.map((s,a)=>{const i=r.slice(0,a+1).join("/");return l.jsxs("div",{className:"flex items-center",children:[l.jsx(wa,{className:"h-4 w-4 text-neutral3"}),l.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 hss({entries:e,currentPath:t,isLoading:n,error:r,onNavigate:s,onFileSelect:a,onRefresh:i,onUpload:o,onCreateDirectory:c,onDelete:u,isCreatingDirectory:d,isDeleting:f}){const[p,h]=y.useState(null),m=[...e].sort((S,w)=>S.type==="directory"&&w.type!=="directory"?-1:S.type!=="directory"&&w.type==="directory"?1:S.name.localeCompare(w.name)),g=MLt(t),v=S=>{const w=g?S.name:`${t}/${S.name}`;S.type==="directory"?s(w):a?.(w)},b=S=>{const w=g?S.name:`${t}/${S.name}`;h(w)};return l.jsxs("div",{className:"rounded-lg border border-border1 overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface3 border-b border-border1",children:[l.jsx(pss,{path:t,onNavigate:s}),l.jsxs("div",{className:"flex items-center gap-1",children:[i&&l.jsx(de,{variant:"ghost",size:"md",onClick:i,disabled:n,"aria-label":"Refresh files",children:l.jsx(WT,{className:`h-4 w-4 ${n?"animate-spin":""}`})}),c&&l.jsx(de,{variant:"ghost",size:"md",disabled:d,"aria-label":"Create directory",onClick:()=>{const S=prompt("Directory name:");if(S){const w=g?S:`${t}/${S}`;c(w)}},children:d?l.jsx(xi,{className:"h-4 w-4 animate-spin"}):l.jsx(E7,{className:"h-4 w-4"})}),o&&l.jsx(de,{variant:"ghost",size:"md",onClick:o,"aria-label":"Upload files",children:l.jsx(N7,{className:"h-4 w-4"})})]})]}),l.jsx("div",{className:"max-h-[400px] overflow-auto",children:n?l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(xi,{className:"h-6 w-6 animate-spin text-neutral3"})}):r?l.jsxs("div",{className:"py-12 px-4 text-center",children:[l.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-red-500/10 mb-4",children:l.jsx(UR,{className:"h-6 w-6 text-red-400"})}),l.jsx("p",{className:"text-sm text-neutral6 font-medium mb-1",children:"Failed to load directory"}),l.jsx("p",{className:"text-xs text-neutral4 max-w-sm mx-auto",children:fss(r)})]}):m.length===0?l.jsx("div",{className:"py-12 text-center text-neutral4 text-sm",children:g?"Workspace is empty":"Directory is empty"}):l.jsx(od,{children:l.jsxs("ul",{children:[!g&&l.jsx("li",{children:l.jsxs("button",{onClick:()=>{const S=t.split("/").slice(0,-1).join("/")||".";s(S)},className:"w-full flex items-center gap-3 px-4 py-2 hover:bg-surface4 transition-colors text-left",children:[l.jsx(HT,{className:"h-4 w-4 text-amber-400"}),l.jsx("span",{className:"text-sm text-neutral5",children:".."})]})}),m.map(S=>{const w=S.mount?.displayName||S.mount?.provider,_=S.mount?.status==="error";return l.jsx("li",{className:"group",children:l.jsxs("div",{className:"flex items-center hover:bg-surface4 transition-colors",children:[l.jsxs("button",{onClick:()=>v(S),className:"flex-1 flex items-center gap-3 px-4 py-2 text-left",children:[RLt(S),l.jsx("span",{className:"text-sm text-neutral6 flex-1 truncate",children:S.name}),S.mount&&_&&l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx("span",{tabIndex:0,className:"flex items-center",children:l.jsx(UR,{className:"h-4 w-4 text-red-400"})})}),l.jsxs(Yn,{className:"max-w-xs",children:[l.jsx("span",{className:"text-red-400",children:"Error:"})," ",S.mount.error||"Failed to connect to this filesystem"]})]}),S.mount&&w&&(S.mount.description?l.jsxs(Jn,{children:[l.jsx(Qn,{asChild:!0,children:l.jsx("span",{tabIndex:0,className:`text-xs px-1.5 py-0.5 rounded ${_?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:w})}),l.jsx(Yn,{children:S.mount.description})]}):l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${_?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:w})),S.type==="file"&&S.size!==void 0&&l.jsx("span",{className:"text-xs text-neutral3 tabular-nums",children:PLt(S.size)})]}),u&&!S.mount&&l.jsx("button",{onClick:()=>b(S),"aria-label":`Delete ${S.name}`,className:"p-2 opacity-0 group-hover:opacity-100 hover:text-red-400 text-neutral3 transition-all",children:l.jsx(Zd,{className:"h-3.5 w-3.5"})})]})},S.name)})]})})}),l.jsx(Gt,{open:!!p,onOpenChange:S=>!f&&!S&&h(null),children:l.jsxs(Gt.Content,{children:[l.jsxs(Gt.Header,{children:[l.jsx(Gt.Title,{children:"Delete Item"}),l.jsxs(Gt.Description,{children:['Are you sure you want to delete "',p,'"? This action cannot be undone.']})]}),l.jsxs(Gt.Footer,{children:[l.jsx(Gt.Cancel,{disabled:f,children:"Cancel"}),l.jsxs(Gt.Action,{disabled:f,onClick:async()=>{try{p&&u&&await u(p)}finally{h(null)}},children:[f?l.jsx(xi,{className:"h-4 w-4 animate-spin mr-2"}):null,"Delete"]})]})]})})]})}function mss(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 gss({content:e,language:t}){return l.jsx(rOe,{language:t,style:sOe.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},codeTagProps:{style:{fontFamily:"var(--geist-mono), ui-monospace, monospace"}},children:e})}function vss({path:e,content:t,isLoading:n,mimeType:r,onClose:s}){const a=e.split("/").pop()||e,i=a.split(".").pop()?.toLowerCase(),o=r?.startsWith("image/")||["png","jpg","jpeg","gif","svg","webp"].includes(i||""),c=mss(i);return l.jsxs("div",{className:"rounded-lg border border-border1 overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface3 border-b border-border1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[RLt({name:a,type:"file"}),l.jsx("span",{className:"text-sm font-medium text-neutral6",children:a})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(la,{content:t,copyMessage:"Copied file content"}),s&&l.jsx(de,{variant:"ghost",size:"md",onClick:s,children:"Close"})]})]}),l.jsx("div",{className:"max-h-[500px] overflow-auto h-full",style:{backgroundColor:"black"},children:n?l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(xi,{className:"h-6 w-6 animate-spin text-neutral3"})}):o?l.jsx("div",{className:"p-4 flex items-center justify-center",children:l.jsx("img",{src:`data:${r||"image/png"};base64,${btoa(t)}`,alt:a,className:"max-w-full max-h-[400px] object-contain"})}):c?l.jsx(gss,{content:t,language:c}):l.jsx("pre",{className:"p-4 text-sm text-neutral5 whitespace-pre-wrap font-mono overflow-x-auto",children:t})})]})}const yss=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(oi,{iconSlot:l.jsx(Hd,{}),titleSlot:"No Workspaces yet",descriptionSlot:l.jsxs(l.Fragment,{children:["Add a workspace to your Mastra configuration to ",l.jsx("br",{}),"manage files, skills, and enable semantic search."]}),actionSlot:l.jsxs(de,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",l.jsx(Da,{})]})})}),bss=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(oi,{iconSlot:l.jsx(NWt,{}),titleSlot:"Workspace Not Configured",descriptionSlot:l.jsxs(l.Fragment,{children:["No workspace is configured. Add a workspace to your ",l.jsx("br",{}),"Mastra configuration to manage files, skills, and enable semantic search."]}),actionSlot:l.jsxs(de,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",l.jsx(Da,{})]})})}),xss=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(oi,{iconSlot:l.jsx(UR,{}),titleSlot:"Workspace Not Supported",descriptionSlot:l.jsxs(l.Fragment,{children:["The workspace feature requires a newer version of ",l.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),".",l.jsx("br",{}),"Please upgrade your dependencies to enable workspace functionality."]}),actionSlot:l.jsxs(de,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",l.jsx(Da,{})]})})}),nle={bm25:{label:"Keyword",icon:l.jsx(lu,{className:"h-3.5 w-3.5"}),color:"bg-blue-500/10 text-blue-400 border-blue-500/30"},vector:{label:"Semantic",icon:l.jsx(kC,{className:"h-3.5 w-3.5"}),color:"bg-purple-500/10 text-purple-400 border-purple-500/30"},hybrid:{label:"Hybrid",icon:l.jsx(pYt,{className:"h-3.5 w-3.5"}),color:"bg-amber-500/10 text-amber-400 border-amber-500/30"}};function $Lt(e){return e.id.replace(/#chunk-\d+$/,"")}function wss({onSearch:e,isSearching:t,searchResults:n,canBM25:r,canVector:s,onViewResult:a}){const[i,o]=y.useState(""),[c,u]=y.useState(5),d=()=>r&&s?"hybrid":r?"bm25":s?"vector":"bm25",[f,p]=y.useState(d()),h=g=>{g.preventDefault(),i.trim()&&e({query:i.trim(),topK:c,mode:f})},m=[...r?["bm25"]:[],...s?["vector"]:[],...r&&s?["hybrid"]:[]];return l.jsxs("div",{className:"rounded-lg bg-surface4",children:[l.jsxs("form",{onSubmit:h,className:"p-4",children:[l.jsxs("div",{className:"flex gap-3 items-center",children:[l.jsxs("div",{className:"flex-1 relative",children:[l.jsx(GT,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),l.jsx(Sn,{value:i,onChange:g=>o(g.target.value),placeholder:"Search workspace files...",className:"pl-9 h-10 bg-surface2 border-border1"})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"text-xs text-neutral4",children:"Top"}),l.jsx(Sn,{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"})]}),l.jsx(de,{type:"submit",disabled:t||!i.trim(),size:"lg",className:"h-10 px-4",children:t?l.jsx(xi,{className:"h-4 w-4 animate-spin"}):"Search"})]}),m.length>0&&l.jsx("div",{className:"flex gap-2 mt-3",children:m.map(g=>{const v=nle[g],b=f===g;return l.jsxs("button",{type:"button",onClick:()=>p(g),className:`
666
666
  inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-xs font-medium border transition-colors
667
667
  ${b?v.color:"bg-surface2 text-neutral4 border-transparent hover:bg-surface3"}
668
668
  `,children:[v.icon,v.label]},g)})})]}),n&&l.jsxs("div",{className:"border-t border-border1",children:[l.jsxs("div",{className:"px-4 py-2 flex items-center justify-between text-xs",children:[l.jsxs("span",{className:"text-neutral4",children:[n.results.length," result",n.results.length!==1?"s":"",' for "',l.jsx("span",{className:"text-neutral6",children:n.query}),'"']}),l.jsx("span",{className:`px-1.5 py-0.5 rounded ${nle[n.mode].color}`,children:nle[n.mode].label})]}),n.results.length===0?l.jsx("div",{className:"px-4 py-8 text-center text-neutral4 text-sm",children:"No results found. Try a different query."}):l.jsx("ul",{className:"max-h-[320px] overflow-auto",children:n.results.map((g,v)=>l.jsx(Sss,{result:g,rank:v+1,onClick:()=>a?.($Lt(g))},`${g.id}-${v}`))})]})]})}function Sss({result:e,rank:t,onClick:n}){const r=Math.min(100,Math.max(0,e.score*100)),s=$Lt(e);return l.jsx("li",{className:"border-t border-border1 first:border-t-0",children:l.jsxs("button",{onClick:n,className:"w-full px-4 py-3 text-left hover:bg-surface5 transition-colors flex gap-3",children:[l.jsx("span",{className:"text-xs text-neutral3 tabular-nums w-4 shrink-0",children:t}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(HT,{className:"h-3.5 w-3.5 text-neutral4 shrink-0"}),l.jsx("span",{className:"font-mono text-sm text-neutral6 truncate",children:s}),l.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[l.jsx("div",{className:"w-12 h-1 rounded-full bg-surface2 overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full bg-accent1",style:{width:`${r}%`}})}),l.jsx("span",{className:"text-ui-xs text-neutral3 tabular-nums",children:e.score.toFixed(2)})]})]}),l.jsx("p",{className:"text-xs text-neutral4 line-clamp-2",children:e.content}),e.lineRange&&l.jsxs("p",{className:"text-xs text-neutral3 mt-1",children:["Lines ",e.lineRange.start,"–",e.lineRange.end]})]})]})})}function kss({onSearch:e,results:t,isSearching:n,onResultClick:r}){const[s,a]=y.useState(""),[i,o]=y.useState(5),[c,u]=y.useState(!0),d=f=>{f.preventDefault(),s.trim()&&e({query:s.trim(),topK:i,includeReferences:c})};return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("form",{onSubmit:d,className:"space-y-3",children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("div",{className:"flex-1 relative",children:[l.jsx(GT,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),l.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"})]}),l.jsx(de,{type:"submit",disabled:!s.trim()||n,children:n?l.jsx(xi,{className:"h-4 w-4 animate-spin"}):"Search"})]}),l.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[l.jsxs("label",{className:"flex items-center gap-2 text-neutral4",children:[l.jsx("span",{children:"Results:"}),l.jsxs("select",{value:i,onChange:f=>o(Number(f.target.value)),className:"px-2 py-1 rounded bg-surface3 border border-border1 text-neutral5",children:[l.jsx("option",{value:3,children:"3"}),l.jsx("option",{value:5,children:"5"}),l.jsx("option",{value:10,children:"10"}),l.jsx("option",{value:20,children:"20"})]})]}),l.jsxs("label",{className:"flex items-center gap-2 text-neutral4 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:c,onChange:f=>u(f.target.checked),className:"rounded border-border1 bg-surface3"}),l.jsx("span",{children:"Include references"})]})]})]}),t.length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("h3",{className:"text-sm font-medium text-neutral5",children:["Found ",t.length," result",t.length!==1?"s":""]}),l.jsx("div",{className:"space-y-2",children:t.map((f,p)=>l.jsx(_ss,{result:f,onClick:()=>r?.(f)},`${f.skillName}-${f.source}-${p}`))})]})]})}function _ss({result:e,onClick:t}){const n=e.source!=="SKILL.md";return l.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:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"p-1.5 rounded bg-surface5 shrink-0 mt-0.5",children:n?l.jsx(lu,{className:"h-3.5 w-3.5 text-neutral4"}):l.jsx(Dj,{className:"h-3.5 w-3.5 text-neutral4"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("span",{className:"font-medium text-neutral6",children:e.skillName}),l.jsx("span",{className:"text-xs text-neutral3",children:e.source}),l.jsxs("span",{className:"ml-auto text-xs text-neutral3",children:["Score: ",e.score.toFixed(3)]})]}),l.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&&l.jsxs("p",{className:"text-xs text-neutral3 mt-2",children:["Lines ",e.lineRange.start,"–",e.lineRange.end]})]})]})})}function Oss({skillName:e,onUpdate:t,isUpdating:n}){return l.jsx(de,{variant:"default",size:"icon-sm",disabled:n,tooltip:`Update ${e}`,onClick:t,children:n?l.jsx(xi,{className:"h-4 w-4 animate-spin"}):l.jsx(ME,{className:"h-4 w-4"})})}function Ess({skillName:e,onRemove:t,isRemoving:n}){return l.jsxs(Gt,{children:[l.jsx(Gt.Trigger,{asChild:!0,children:l.jsx(de,{variant:"default",size:"icon-sm",disabled:n,tooltip:`Remove ${e}`,children:n?l.jsx(xi,{className:"h-4 w-4 animate-spin"}):l.jsx(Zd,{className:"h-4 w-4"})})}),l.jsxs(Gt.Content,{children:[l.jsxs(Gt.Header,{children:[l.jsx(Gt.Title,{children:"Remove Skill"}),l.jsxs(Gt.Description,{children:['Are you sure you want to remove the skill "',e,'"? This action cannot be undone.']})]}),l.jsxs(Gt.Footer,{children:[l.jsx(Gt.Cancel,{children:"Cancel"}),l.jsx(Gt.Action,{onClick:t,children:"Remove"})]})]})]})}const Css=".agents/skills/",MOe=[{name:"name",label:"Skill",size:"1fr"},{name:"description",label:"Description",size:"2fr"}],DLt=[...MOe,{name:"actions",label:"",size:"48px"}];function Tss(e,t){if(!e||!t||t.length===0)return null;for(const n of t)if(e.startsWith(n+"/")||e===n)return n;return null}function jss({skills:e,isLoading:t,isSkillsConfigured:n=!0,hasUndiscoveredAgentSkills:r=!1,basePath:s="/workspace/skills",onAddSkill:a,onUpdateSkill:i,onRemoveSkill:o,updatingSkillName:c,removingSkillName:u,mountPaths:d}){const{navigate:f}=an(),p=d&&d.length>0,h=S=>S.path?.includes(Css)??!1,m=e.some(h),g=!!o||!!i,v=g&&m,b=v?DLt:MOe;return!n&&!t?l.jsx(Ass,{onAddSkill:a}):t?l.jsx(Nss,{hasRowActions:g}):l.jsxs("div",{className:"space-y-4",children:[a&&l.jsx("div",{className:"flex items-center gap-4",children:l.jsxs(de,{variant:"default",size:"sm",onClick:a,children:[l.jsx(Be,{children:l.jsx(Cs,{className:"h-4 w-4"})}),"Add Skill"]})}),r&&l.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[l.jsx(Vy,{className:"h-5 w-5 text-amber-500 shrink-0 mt-0.5"}),l.jsxs("div",{className:"text-sm",children:[l.jsx("p",{className:"font-medium text-amber-500",children:"Skills installed but not discovered"}),l.jsxs("p",{className:"text-neutral4 mt-1",children:["You have skills in ",l.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."]})]})]}),l.jsx(Aa,{children:l.jsxs(Aa.Trim,{children:[l.jsx(Aa.Header,{columns:b}),e.length>0?l.jsx(Aa.Entries,{children:e.map(S=>{const w={id:S.path,name:S.name,description:S.description||"—"},_=p?Tss(S.path,d):null;return l.jsxs(Aa.Entry,{entry:w,columns:b,onClick:()=>{const O=`${s}/${encodeURIComponent(S.name)}?path=${encodeURIComponent(S.path)}`;f(O)},children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"p-1.5 rounded bg-surface5",children:l.jsx(Dj,{className:"h-3.5 w-3.5 text-neutral4"})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("span",{className:"font-medium text-neutral6",children:S.name}),S.path&&l.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[_&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral3 shrink-0",children:_}),l.jsx("span",{className:"text-[11px] text-neutral3 truncate",title:S.path,children:S.path})]})]})]}),l.jsx(Aa.EntryText,{children:S.description||"—"}),v&&l.jsx("div",{className:"flex justify-end gap-1",onClick:O=>O.stopPropagation(),children:h(S)&&l.jsxs(l.Fragment,{children:[i&&l.jsx(Oss,{skillName:S.name,onUpdate:()=>i(S.name),isUpdating:c===S.name}),o&&l.jsx(Ess,{skillName:S.name,onRemove:()=>o(S.name),isRemoving:u===S.name})]})})]},S.path)})}):l.jsx(Aa.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 Nss({hasRowActions:e}){const t=e?DLt:MOe;return l.jsx(Aa,{children:l.jsxs(Aa.Trim,{children:[l.jsx(Aa.Header,{columns:t}),l.jsx(Aa.Entries,{children:Array.from({length:3}).map((n,r)=>l.jsxs(Aa.Entry,{columns:t,isLoading:!0,children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"h-7 w-7 rounded bg-surface4 animate-pulse"}),l.jsxs("div",{children:[l.jsx("div",{className:"h-4 w-32 rounded bg-surface4 animate-pulse"}),l.jsx("div",{className:"h-3 w-40 rounded bg-surface4 animate-pulse mt-1"})]})]}),l.jsx("div",{className:"h-4 w-48 rounded bg-surface4 animate-pulse"}),e&&l.jsx("div",{className:"h-4 w-6 rounded bg-surface4 animate-pulse"})]},r))})]})})}function Ass({onAddSkill:e}){return l.jsx("div",{className:"grid place-items-center py-16",children:l.jsxs("div",{className:"flex flex-col items-center text-center max-w-md",children:[l.jsx("div",{className:"p-4 rounded-full bg-surface4 mb-4",children:l.jsx(Dj,{className:"h-8 w-8 text-neutral3"})}),l.jsx("h2",{className:"text-lg font-medium text-neutral6 mb-2",children:"Skills Not Configured"}),l.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."}),l.jsxs("div",{className:"flex gap-3",children:[e&&l.jsxs(de,{size:"lg",variant:"default",onClick:e,children:[l.jsx(Be,{children:l.jsx(Cs,{className:"h-4 w-4"})}),"Add Skill from skills.sh"]}),l.jsxs(de,{size:"lg",variant:"default",as:"a",href:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[l.jsx(Be,{children:l.jsx(TZt,{className:"h-4 w-4"})}),"Learn about Skills"]})]})]})})}function Iss(e){switch(e.type){case"external":return{icon:l.jsx(_S,{className:"h-3.5 w-3.5"}),label:"External Package",path:e.packagePath};case"local":return{icon:l.jsx($Gt,{className:"h-3.5 w-3.5"}),label:"Local Project",path:e.projectPath};case"managed":return{icon:l.jsx(Y5,{className:"h-3.5 w-3.5"}),label:"Managed",path:e.mastraPath}}}function Rss({skill:e,rawSkillMd:t,onReferenceClick:n}){const[r,s]=y.useState(new Set(["instructions"])),[a,i]=y.useState(!1),o=Iss(e.source),c=u=>{s(d=>{const f=new Set(d);return f.has(u)?f.delete(u):f.add(u),f})};return l.jsxs("div",{className:"space-y-6 min-w-0 overflow-hidden",children:[l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:"p-3 rounded-lg bg-surface5",children:l.jsx(Dj,{className:"h-6 w-6 text-neutral4"})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("h1",{className:"text-xl font-semibold text-neutral6",children:e.name}),l.jsx("p",{className:"text-sm text-neutral4 mt-1",children:e.description})]})]}),l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[l.jsx(rI,{label:"Source",value:o.label,icon:o.icon}),l.jsx(rI,{label:"Path",value:e.path,icon:l.jsx(HT,{className:"h-3.5 w-3.5"})}),e.license&&l.jsx(rI,{label:"License",value:e.license}),e.compatibility!=null&&l.jsx(rI,{label:"Compatibility",value:e.compatibility}),l.jsx(rI,{label:"References",value:`${e.references.length} files`,icon:l.jsx(lu,{className:"h-3.5 w-3.5"})})]}),l.jsx(q5,{title:"Instructions",isExpanded:r.has("instructions"),onToggle:()=>c("instructions"),headerAction:l.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?l.jsx(kc,{className:"h-3.5 w-3.5"}):l.jsx(nGt,{className:"h-3.5 w-3.5"}),a?"Rendered":"Source"]}),children:a?l.jsx("div",{style:{backgroundColor:"black"},className:"rounded-lg overflow-x-auto w-0 min-w-full",children:l.jsx(rOe,{language:"markdown",style:sOe.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},children:t??e.instructions})}):l.jsx(aT,{children:e.instructions})}),e.references.length>0&&l.jsx(q5,{title:`References (${e.references.length})`,isExpanded:r.has("references"),onToggle:()=>c("references"),children:l.jsx("div",{className:"space-y-1",children:e.references.map(u=>l.jsxs("button",{onClick:()=>n?.(u),className:"flex items-center gap-2 w-full px-3 py-2 rounded hover:bg-surface4 text-left transition-colors",children:[l.jsx(lu,{className:"h-4 w-4 text-neutral3"}),l.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),e.scripts.length>0&&l.jsx(q5,{title:`Scripts (${e.scripts.length})`,isExpanded:r.has("scripts"),onToggle:()=>c("scripts"),children:l.jsx("div",{className:"space-y-1",children:e.scripts.map(u=>l.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded bg-surface3",children:[l.jsx(TWt,{className:"h-4 w-4 text-neutral3"}),l.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),e.assets.length>0&&l.jsx(q5,{title:`Assets (${e.assets.length})`,isExpanded:r.has("assets"),onToggle:()=>c("assets"),children:l.jsx("div",{className:"space-y-1",children:e.assets.map(u=>l.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded bg-surface3",children:[l.jsx(_me,{className:"h-4 w-4 text-neutral3"}),l.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),l.jsx("div",{className:"pt-4 border-t border-border1",children:l.jsxs("p",{className:"text-xs text-neutral3",children:["Path: ",l.jsx("code",{className:"px-1 py-0.5 rounded bg-surface4",children:e.path})]})})]})}function LLt(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 n=t[0],r=e[n];return Array.isArray(r)?`${n}: ${r.join(", ")}`:`${n}: ${LLt(r)}`}return`{${t.join(", ")}}`}return String(e)}function rI({label:e,value:t,icon:n}){const r=LLt(t);return l.jsxs("div",{className:"p-3 rounded-lg bg-surface3",children:[l.jsx("p",{className:"text-xs text-neutral3 mb-1",children:e}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[n&&l.jsx("span",{className:"text-neutral4",children:n}),l.jsx("p",{className:"text-sm font-medium text-neutral5 truncate",title:r,children:r})]})]})}function q5({title:e,isExpanded:t,onToggle:n,headerAction:r,children:s}){return l.jsxs("div",{className:"border border-border1 rounded-lg overflow-hidden min-w-0",children:[l.jsxs("div",{className:"flex items-center bg-surface3 hover:bg-surface4 transition-colors",children:[l.jsxs("button",{onClick:n,className:"flex items-center gap-2 flex-1 px-4 py-3",children:[t?l.jsx(ys,{className:"h-4 w-4 text-neutral3"}):l.jsx(wa,{className:"h-4 w-4 text-neutral3"}),l.jsx("span",{className:"text-sm font-medium text-neutral5",children:e})]}),r&&l.jsx("div",{className:"pr-3",children:r})]}),t&&l.jsx("div",{className:"p-4 bg-surface2 overflow-x-auto w-0 min-w-full",children:s})]})}function Pss({open:e,onOpenChange:t,skillName:n,referencePath:r,content:s,isLoading:a,error:i}){const{isCopied:o,copyToClipboard:c}=mV({copiedDuration:2e3});if(!e)return null;const u=()=>{s&&c(s)};return l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),l.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:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border1 bg-surface3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"p-1.5 rounded bg-surface5",children:l.jsx(lu,{className:"h-4 w-4 text-neutral4"})}),l.jsxs("div",{children:[l.jsx("h2",{id:"reference-viewer-title",className:"text-base font-medium text-neutral6",children:r}),l.jsxs("p",{className:"text-xs text-neutral3",children:["from ",n]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(de,{size:"md",variant:"default",onClick:u,disabled:!s||a,children:[l.jsx(Be,{children:o?l.jsx(Ka,{className:"h-3.5 w-3.5 text-green-400"}):l.jsx(Jf,{className:"h-3.5 w-3.5"})}),o?"Copied!":"Copy"]}),l.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:l.jsx(Pr,{className:"h-4 w-4"})})]})]}),l.jsx("div",{className:"flex-1 overflow-auto p-6",children:a?l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx("div",{className:"h-6 w-6 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})}):i?l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[l.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load reference"}),l.jsx("p",{className:"text-sm text-neutral3",children:i})]}):s?l.jsx("pre",{className:"whitespace-pre-wrap text-sm text-neutral5 font-mono bg-surface3 p-4 rounded-lg overflow-auto",children:s}):l.jsx("div",{className:"flex items-center justify-center py-12 text-neutral3",children:"No content available"})})]})]})}function EXe(e){return`${e.topSource}/${e.name}`}function CXe(e){const t=Z3t(e.topSource,e.name);return t?`${t.owner}/${t.repo}/${e.name}`:null}function Mss({open:e,onOpenChange:t,workspaceId:n,onInstall:r,isInstalling:s,installedSkillIds:a=[],installedSkillNames:i=[],writableMounts:o,installedSkillPaths:c}){const[u,d]=y.useState(""),[f,p]=y.useState(null),[h,m]=y.useState(o&&o.length>0?o[0]?.path:void 0),{data:g,isLoading:v}=wXr(n),b=xXr(n),S=y.useMemo(()=>f?.topSource?Z3t(f.topSource,f.name):null,[f]),w=y.useMemo(()=>!S||!f?null:`https://skills.sh/${S.owner}/${S.repo}/${f.name}`,[S,f]),{data:_,isLoading:O}=SXr(n,S?.owner,S?.repo,f?.name,{enabled:!!S&&!!f}),E=gj(M=>{M.trim().length>=2&&b.mutate(M)},300),T=y.useCallback(M=>{d(M),E(M)},[E]),j=y.useMemo(()=>u.trim().length>=2?b.data?.skills??[]:g?.skills??[],[u,b.data,g]),N=b.isPending,I=u.trim().length>=2,R=y.useMemo(()=>{if(!f)return!1;const M=CXe(f);return!!(M&&a.includes(M)||i.includes(f.name))},[f,a,i]),P=y.useCallback(()=>{!f||!S||r({repository:`${S.owner}/${S.repo}`,skillName:f.name,mount:o&&o.length>1?h:void 0})},[f,S,r,o,h]),U=y.useCallback(M=>{M||(d(""),p(null),m(o?.[0]?.path)),t(M)},[t,o]);return l.jsx(Lr,{open:e,onOpenChange:U,children:l.jsxs(Ir,{className:"max-w-4xl h-[80vh] flex flex-col",children:[l.jsxs(zr,{children:[l.jsx(Rr,{children:"Add Skill"}),l.jsx(ha,{children:"Search and install skills from the community registry"})]}),l.jsxs(ns,{className:"flex-1 flex flex-col gap-4 overflow-hidden max-h-none",children:[l.jsxs("div",{className:"relative",children:[l.jsx(GT,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral3"}),l.jsx(Sn,{placeholder:"Search skills...",value:u,onChange:M=>T(M.target.value),className:"pl-9"})]}),l.jsxs("div",{className:"flex flex-1 gap-4 min-h-0",children:[l.jsxs("div",{className:"w-1/2 flex flex-col min-h-0",children:[l.jsx("div",{className:"text-xs font-medium text-neutral4 uppercase tracking-wide mb-2",children:I?"Search Results":"Popular Skills"}),l.jsx(Ps,{className:"flex-1 border border-border1 rounded-lg",children:v||N?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx(xi,{className:"h-6 w-6 animate-spin text-neutral3"})}):j.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-neutral4",children:[l.jsx(_S,{className:"h-8 w-8 mb-2"}),l.jsx("p",{className:"text-sm",children:I?"No skills found":"No skills available"})]}):l.jsx("div",{className:"p-2 space-y-1",children:j.map(M=>{const L=EXe(M),F=CXe(M),z=F&&a.includes(F)||i.includes(M.name),q=f?EXe(f):null;return l.jsx("button",{onClick:()=>p(M),className:X("w-full text-left px-3 py-2 rounded-md transition-colors","hover:bg-surface4",q===L&&"bg-surface5 border border-accent1"),children:l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-medium text-sm text-neutral6 truncate",children:M.name}),z&&l.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:[l.jsx(Ka,{className:"h-2.5 w-2.5"}),"Installed"]})]}),l.jsx("div",{className:"text-xs text-neutral4 truncate",children:M.topSource})]}),l.jsxs("div",{className:"flex items-center gap-1 text-xs text-neutral3 shrink-0",children:[l.jsx(ME,{className:"h-3 w-3"}),l.jsx("span",{children:M.installs.toLocaleString()})]})]})},L)})})})]}),l.jsxs("div",{className:"w-1/2 flex flex-col min-h-0",children:[l.jsx("div",{className:"text-xs font-medium text-neutral4 uppercase tracking-wide mb-2",children:"Preview"}),l.jsx("div",{className:"flex-1 border border-border1 rounded-lg overflow-hidden flex flex-col",children:f?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"p-4 border-b border-border1 bg-surface3",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"p-2 rounded-lg bg-surface5",children:l.jsx(Dj,{className:"h-5 w-5 text-neutral4"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("h3",{className:"font-semibold text-neutral6 truncate",children:f.name}),l.jsxs("div",{className:"flex items-center gap-3 mt-1 text-xs text-neutral4",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(TGt,{className:"h-3 w-3"}),f.topSource]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(ME,{className:"h-3 w-3"}),f.installs.toLocaleString()," installs"]})]})]}),S&&l.jsx("a",{href:`https://github.com/${S.owner}/${S.repo}`,target:"_blank",rel:"noopener noreferrer",className:"text-neutral4 hover:text-neutral5 transition-colors",title:"View on GitHub",children:l.jsx(Da,{className:"h-4 w-4"})})]})}),O?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx(xi,{className:"h-6 w-6 animate-spin text-neutral3"})}):_?l.jsx(Ps,{className:"flex-1",children:l.jsx("div",{className:"p-4",children:l.jsx(aT,{children:_})})}):l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-neutral4",children:[l.jsx(_S,{className:"h-8 w-8 mb-2"}),l.jsx("p",{className:"text-sm",children:"Preview unavailable"}),w&&l.jsxs("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"text-xs mt-2 text-accent1 hover:underline flex items-center gap-1",children:["View on skills.sh ",l.jsx(Da,{className:"h-3 w-3"})]})]})]}):l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-neutral4",children:[l.jsx(_S,{className:"h-8 w-8 mb-2"}),l.jsx("p",{className:"text-sm",children:"Select a skill to preview"})]})})]})]}),f&&l.jsxs("div",{className:"flex flex-col gap-3 pt-4 border-t border-border1",children:[o&&o.length>1&&l.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-surface3 border border-border1",children:[l.jsx(ZT,{className:"h-4 w-4 text-icon4 shrink-0"}),l.jsx("label",{htmlFor:"mount-select",className:"text-sm text-icon5 whitespace-nowrap font-medium",children:"Install to"}),l.jsx("select",{id:"mount-select",value:h??"",onChange:M=>m(M.target.value),className:"flex-1 text-sm px-3 py-1.5 rounded-md border border-border1 bg-surface2 text-icon6",children:o.map(M=>{const L=M.displayName??M.name??M.provider??"unknown";return l.jsxs("option",{value:M.path,children:[L," (",M.path,")"]},M.path)})})]}),l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[R&&o&&o.length>1&&f&&c?.[f.name]&&(()=>{const M=c[f.name],L=o.find(F=>M.startsWith(F.path+"/")||M===F.path);return L?l.jsxs("span",{className:"text-xs text-icon4",children:["Installed at ",L.path]}):null})(),l.jsx(de,{variant:"default",onClick:()=>U(!1),children:"Cancel"}),l.jsx(de,{variant:"primary",onClick:P,disabled:!S||s||R,"data-testid":"install-skill-button",children:s?l.jsxs(l.Fragment,{children:[l.jsx(xi,{className:"h-4 w-4 mr-2 animate-spin"}),"Installing..."]}):R?l.jsxs(l.Fragment,{children:[l.jsx(Ka,{className:"h-4 w-4 mr-2"}),"Already Installed"]}):l.jsxs(l.Fragment,{children:[l.jsx(ME,{className:"h-4 w-4 mr-2"}),"Install"]})})]})]})]})]})})}function TXe(){const{workspaceId:e}=Mr(),[t,n]=fo(),r=bu(),[s,a]=y.useState(!1),[i,o]=y.useState(!1),[c,u]=y.useState(!1),[d,f]=y.useState(null),[p,h]=y.useState(null),[m,g]=y.useState(!1),v=t.get("file"),b=t.get("tab"),{data:S,error:w,isLoading:_}=V3t(),O=S?.workspaces??[],E=e??O[0]?.id,{data:T,isLoading:j,error:N}=uXr(E),I=zs(w)||zs(N),R=Bs(w)||Bs(N),P=t.get("path")||".",U=Uhe(w)||Uhe(N),M=E?O.find(Me=>Me.id===E):void 0,L=Me=>{const ft=new URLSearchParams(t);for(const[kt,Tn]of Object.entries(Me))Tn===null?ft.delete(kt):ft.set(kt,Tn);n(ft)},F=Me=>{g(!1),a(!1),r(`/workspaces/${Me}`)},z=Me=>{L({path:Me==="."||Me===""?null:Me,file:null})},q=Me=>{L({file:Me})},H=Me=>{L({tab:Me})},D=P,Y=v,{data:V,isLoading:$,error:W,refetch:G}=dXr(D,{enabled:T?.isWorkspaceConfigured&&T?.capabilities?.hasFilesystem,workspaceId:E}),K=pXr(),re=hXr(),{data:J,isLoading:ee}=H3t(Y??"",{enabled:!!Y,workspaceId:E}),{data:se,isLoading:ie,refetch:Q}=gXr({workspaceId:E}),ne=kXr(),oe=_Xr(),me=OXr(),ce=T?.isWorkspaceConfigured??!1,be=T?.capabilities?.hasFilesystem??!1,Ce=T?.capabilities?.hasSkills??!1,je=T?.capabilities?.canBM25??!1,We=T?.capabilities?.canVector??!1,Pe=M?.safety?.readOnly??!1,ze=be&&!Pe,Se=T?.mounts,le=Se?.filter(Me=>!Me.readOnly).map(Me=>({path:Me.path,displayName:Me.displayName,icon:Me.icon,provider:Me.provider,name:Me.name})),ve=Se&&Se.length>1?Se.map(Me=>Me.path):void 0,ue=y.useCallback(Me=>{E&&ne.mutate({...Me,workspaceId:E},{onSuccess:async ft=>{if(ft.success){u(!1);const{data:kt,error:Tn}=await Q();if(Tn||!kt){Fe.success(`Skill "${ft.skillName}" installed successfully (${ft.filesWritten} files)`);return}kt.skills.some(En=>En.name===ft.skillName)?Fe.success(`Skill "${ft.skillName}" installed successfully (${ft.filesWritten} files)`):(g(!0),Fe.warning(`Skill "${ft.skillName}" installed to .agents/skills but not discovered. Add .agents/skills to your workspace skills paths.`))}else Fe.error("Failed to install skill")},onError:ft=>{Fe.error(`Failed to install skill: ${ft instanceof Error?ft.message:"Unknown error"}`)}})},[E,ne,Q]),xe=y.useCallback(Me=>{E&&(h(Me),oe.mutate({workspaceId:E,skillName:Me},{onSuccess:ft=>{if(h(null),ft.updated.length>0){const kt=ft.updated[0];kt.success?(Fe.success(`Skill "${Me}" updated successfully (${kt.filesWritten} files)`),Q()):Fe.error(`Failed to update skill: ${kt.error??"Unknown error"}`)}else Fe.error("Failed to update skill: No update result returned")},onError:ft=>{h(null),Fe.error(`Failed to update skill: ${ft instanceof Error?ft.message:"Unknown error"}`)}}))},[E,oe,Q]),fe=y.useCallback(Me=>{E&&(f(Me),me.mutate({workspaceId:E,skillName:Me},{onSuccess:ft=>{f(null),ft.success?(Fe.success(`Skill "${ft.skillName}" removed successfully`),Q()):Fe.error(`Failed to remove skill "${ft.skillName}"`)},onError:ft=>{f(null),Fe.error(`Failed to remove skill: ${ft instanceof Error?ft.message:"Unknown error"}`)}}))},[E,me,Q]),_e=b==="files"&&be?"files":b==="skills"&&Ce?"skills":be?"files":Ce?"skills":"files",qe=se?.skills??[],Ge=se?.isSkillsConfigured??!1,ct=V?.entries??[],De=be&&(je||We),Ve=Ce&&Ge&&qe.length>0,Ae=De||Ve;if(_)return l.jsx(ir,{children:l.jsx(Qt,{})});if(I)return l.jsx(ir,{children:l.jsx(ua,{})});if(R)return l.jsx(ir,{children:l.jsx(na,{resource:"workspaces"})});if(U)return l.jsx(ir,{children:l.jsx(xss,{})});const Ke=w||N;return Ke?l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load workspace",message:Ke.message})}):!_&&O.length===0?l.jsx(ir,{children:l.jsx(yss,{})}):!j&&!_&&!ce?l.jsx(ir,{children:l.jsx(bss,{})}):l.jsxs(wn,{children:[Ae&&l.jsx(wn.TopArea,{children:l.jsx(wn.Row,{className:"justify-end",children:l.jsx(de,{onClick:()=>a(!s),tooltip:"Search workspace","aria-label":"Search workspace",children:l.jsx(GT,{})})})}),l.jsxs(wn.MainArea,{className:"grid content-start gap-6",children:[O.length>1&&l.jsxs("div",{className:"relative",children:[l.jsxs("button",{onClick:()=>o(!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:[M?.source==="agent"?l.jsx(XW,{className:"h-4 w-4 text-accent1"}):l.jsx(Y5,{className:"h-4 w-4 text-neutral4"}),l.jsxs("span",{className:"flex-1 text-left truncate",children:[M?.name??"Select workspace",M?.source==="agent"&&M.agentName&&l.jsxs("span",{className:"text-neutral4 ml-1",children:["(",M.agentName,")"]})]}),l.jsx(ys,{className:`h-4 w-4 text-neutral4 transition-transform ${i?"rotate-180":""}`})]}),i&&l.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:O.map(Me=>l.jsxs("button",{onClick:()=>{F(Me.id),o(!1)},className:`flex items-center gap-3 px-3 py-2 w-full text-left hover:bg-surface3 transition-colors ${M?.id===Me.id?"bg-surface3":""}`,children:[Me.source==="agent"?l.jsx(XW,{className:"h-4 w-4 text-accent1 shrink-0"}):l.jsx(Y5,{className:"h-4 w-4 text-neutral4 shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-neutral6 truncate",children:Me.name}),l.jsx("div",{className:"text-xs text-neutral4 truncate",children:Me.source==="agent"?`Agent: ${Me.agentName}`:"Global workspace"})]}),l.jsxs("div",{className:"flex gap-1 shrink-0",children:[Me.safety?.readOnly&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"}),Me.capabilities.hasFilesystem&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"FS"}),Me.capabilities.hasSandbox&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Sandbox"}),Me.capabilities.hasSkills&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Skills"})]})]},Me.id))})]}),O.length===1&&M&&l.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral4",children:[M.source==="agent"?l.jsx(XW,{className:"h-4 w-4 text-accent1"}):l.jsx(Y5,{className:"h-4 w-4"}),l.jsx("span",{children:M.name}),M.source==="agent"&&M.agentName&&l.jsxs("span",{className:"text-neutral3",children:["(",M.agentName,")"]}),Pe&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"})]}),s&&Ae&&E&&l.jsx($ss,{workspaceId:E,canSearchFiles:De,canSearchSkills:Ve,canBM25:je,canVector:We,showInitWarning:!j&&T?.status!=="ready",onViewFileResult:Me=>{L({file:Me,tab:"files"})},onViewSkillResult:(Me,ft)=>{E&&r(`/workspaces/${E}/skills/${encodeURIComponent(Me)}?path=${encodeURIComponent(ft)}`)}},E),(be||Ce)&&l.jsxs(ku,{value:_e,onValueChange:H,defaultTab:_e,children:[l.jsxs(_u,{children:[be&&l.jsxs(Hr,{value:"files",children:[l.jsx(lu,{className:"h-4 w-4"}),"Files"]}),Ce&&l.jsxs(Hr,{value:"skills",children:[l.jsx(xet,{className:"h-4 w-4"}),"Skills",Ge&&qe.length>0&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:qe.length})]})]}),be&&l.jsx(_s,{value:"files",className:"pb-8",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[l.jsx(hss,{entries:ct,currentPath:D,isLoading:$,error:W,onNavigate:z,onFileSelect:q,onRefresh:()=>G(),onCreateDirectory:Pe?void 0:Me=>re.mutate({path:Me,workspaceId:E}),onDelete:Pe?void 0:Me=>K.mutate({path:Me,recursive:!0,force:!0,workspaceId:E})}),Y&&l.jsx(vss,{path:Y,content:J?.content??"",isLoading:ee,mimeType:J?.mimeType,onClose:()=>q(null)})]})}),Ce&&l.jsx(_s,{value:"skills",className:"pb-8",children:l.jsx(jss,{skills:qe,isLoading:ie,isSkillsConfigured:Ge,hasUndiscoveredAgentSkills:m,basePath:E?`/workspaces/${E}/skills`:"/workspaces",onAddSkill:ze?()=>u(!0):void 0,onUpdateSkill:ze?xe:void 0,onRemoveSkill:ze?fe:void 0,updatingSkillName:p??void 0,removingSkillName:d??void 0,mountPaths:ve})})]}),!be&&!Ce&&!j&&l.jsx("div",{className:"py-12 text-center text-neutral4",children:l.jsx("p",{children:"No workspace capabilities are configured."})})]}),E&&ze&&l.jsx(Mss,{open:c,onOpenChange:u,workspaceId:E,onInstall:ue,isInstalling:ne.isPending,installedSkillIds:qe.filter(Me=>Me.skillsShSource).map(Me=>`${Me.skillsShSource.owner}/${Me.skillsShSource.repo}/${Me.name}`),installedSkillNames:qe.filter(Me=>!Me.skillsShSource).map(Me=>Me.name),writableMounts:le,installedSkillPaths:Object.fromEntries(qe.filter(Me=>Me.path).map(Me=>[Me.name,Me.path]))})]})}function $ss({workspaceId:e,canSearchFiles:t,canSearchSkills:n,canBM25:r,canVector:s,showInitWarning:a,onViewFileResult:i,onViewSkillResult:o}){const c=mXr(),u=bXr();return l.jsxs("div",{className:"border border-border1 rounded-lg p-4 bg-surface2 space-y-4",children:[t&&l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[l.jsx(lu,{className:"h-4 w-4"}),"Search Indexed Files"]}),a&&l.jsxs("p",{className:"text-xs text-amber-400 mb-3",children:["File search requires ",l.jsx("code",{className:"text-amber-300",children:"workspace.init()"})," to index files from your configured ",l.jsx("code",{className:"text-amber-300",children:"autoIndexPaths"}),"."]}),l.jsx(wss,{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:r,canVector:s,onViewResult:i})]}),n&&l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[l.jsx(xet,{className:"h-4 w-4"}),"Search Skills"]}),l.jsx(kss,{onSearch:d=>u.mutate({...d,workspaceId:e}),results:u.data?.results??[],isSearching:u.isPending,onResultClick:d=>o(d.skillName,d.skillPath)})]})]})}function Dss(e,t){return e==null||t==null?null:e in t?e:null}const zLt=[{key:"primitives",title:"Primitives",items:[{name:"Agents",url:"/agents",Icon:Go,docs:{href:"https://mastra.ai/en/docs/agents/overview",label:"Agents documentation"},isOnMastraPlatform:!0,requiredPermission:"agents:read"},{name:"Prompts",url:"/prompts",Icon:jXn,docs:{href:"https://mastra.ai/en/docs/agents/agent-instructions#prompt-blocks",label:"Prompts documentation"},isOnMastraPlatform:!0},{name:"Workflows",url:"/workflows",Icon:Tc,docs:{href:"https://mastra.ai/en/docs/workflows/overview",label:"Workflows documentation"},isOnMastraPlatform:!0,requiredPermission:"workflows:read"},{name:"Processors",url:"/processors",Icon:pfe,docs:{href:"https://mastra.ai/en/docs/agents/processors",label:"Processors documentation"},isOnMastraPlatform:!1,requiredPermission:"processors:read"},{name:"MCP Servers",url:"/mcps",Icon:Pm,docs:{href:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",label:"MCP documentation"},isOnMastraPlatform:!0,requiredPermission:"mcps:read"},{name:"Tools",url:"/tools",Icon:Cc,docs:{href:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",label:"Tools documentation"},isOnMastraPlatform:!0,requiredPermission:"tools:read"},{name:"Workspaces",url:"/workspaces",Icon:LXn,docs:{href:"https://mastra.ai/en/docs/workspace/overview",label:"Workspaces documentation"},isOnMastraPlatform:!0,requiredPermission:"workspaces:read"},{name:"Request Context",url:"/request-context",Icon:zXn,isOnMastraPlatform:!0}]},{key:"evaluation",title:"Evaluation",items:[{name:"Overview",url:"/evaluation",Icon:EXn,isOnMastraPlatform:!0},{name:"Scorers",url:"/scorers",Icon:FXn,docs:{href:"https://mastra.ai/en/docs/evals/overview",label:"Scorers documentation"},isOnMastraPlatform:!0,requiredPermission:"scorers:read"},{name:"Datasets",url:"/datasets",Icon:BXn,docs:{href:"https://mastra.ai/en/docs/evals/datasets/overview",label:"Datasets documentation"},isOnMastraPlatform:!0,requiredAnyPermission:["datasets:read"]},{name:"Experiments",url:"/experiments",Icon:Mwt,docs:{href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",label:"Experiments documentation"},isOnMastraPlatform:!0,requiredAnyPermission:["datasets:read"]}]},{key:"observability",title:"Observability",items:[{name:"Metrics",url:"/metrics",Icon:UXn,docs:{href:"https://mastra.ai/en/docs/observability/overview",label:"Metrics documentation"},isOnMastraPlatform:!0,requiredPermission:"observability:read"},{name:"Traces",url:"/observability",activePaths:["/traces"],Icon:Iwt,docs:{href:"https://mastra.ai/en/docs/observability/tracing/overview",label:"Traces documentation"},isOnMastraPlatform:!0,requiredPermission:"observability:read"},{name:"Logs",url:"/logs",Icon:TXn,docs:{href:"https://mastra.ai/en/docs/observability/logging",label:"Logs documentation"},isOnMastraPlatform:!0,requiredPermission:"observability:read"}]}],FLt=[{name:"Settings",url:"/settings",Icon:Awt,isOnMastraPlatform:!1},{name:"Resources",url:"/resources",Icon:GJe,isOnMastraPlatform:!0}],Lss=[{name:"Evaluation",url:"/evaluation",Icon:Mwt,docs:{href:"https://mastra.ai/en/docs/evals/overview",label:"Evaluation documentation"}},{name:"Observability",url:"/observability-overview",Icon:Iwt,docs:{href:"https://mastra.ai/en/docs/observability/overview",label:"Observability documentation"}},{name:"Primitives",url:"/primitives",Icon:Go}],zss=[...Lss,...zLt.flatMap(e=>e.items),...FLt];function $Oe(e){return zss.find(t=>t.url===e)}function rm(e,t){const n=$Oe(e);if(!n)throw new Error(`navCrumb: unknown nav url "${e}"`);return{id:`nav:${e}`,label:n.name,icon:n.Icon,to:e,...t}}function nl(e){const t=$Oe(e);if(!t)throw new Error(`navHandle: unknown nav url "${e}"`);return{crumbs:[{id:`nav:${e}`,label:t.name,icon:t.Icon}],docs:t.docs}}function Bc(e,t){const n=$Oe(e);if(!n)throw new Error(`navHandleWithChildren: unknown nav url "${e}"`);return{crumbs:[{id:`nav:${e}`,label:n.name,icon:n.Icon,to:e},...t],docs:n.docs}}function Fss(){const{skillName:e,workspaceId:t}=Mr(),[n]=fo(),r=Ys(),s=e?decodeURIComponent(e):"",a=n.get("path"),i=a?decodeURIComponent(a):void 0,o=n.get("agentId"),c=o?decodeURIComponent(o):null,d=r.getQueriesData({queryKey:["agents"]})?.[0]?.[1]??null,f=Dss(c,d),p=y.useMemo(()=>f?[rm("/agents"),{id:"agent",label:f,to:`/agents/${encodeURIComponent(f)}`},{id:"skill",label:s}]:null,[f,s]),[h,m]=y.useState(null),{data:g,isLoading:v,error:b}=vXr(s,{workspaceId:t,path:i}),{data:S}=H3t(g?.path?`${g.path}/SKILL.md`:"",{enabled:!!g?.path,workspaceId:t}),{data:w,isLoading:_}=yXr(s,h??"",{enabled:!!h,workspaceId:t,path:i});return v?l.jsxs(fr,{children:[p&&l.jsx($A,{crumbs:p}),l.jsx("div",{className:"grid place-items-center h-full",children:l.jsx("div",{className:"h-8 w-8 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})})]}):b&&zs(b)?l.jsxs(fr,{children:[p&&l.jsx($A,{crumbs:p}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})})]}):b&&Bs(b)?l.jsxs(fr,{children:[p&&l.jsx($A,{crumbs:p}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"workspaces"})})]}):b||!g?l.jsxs(fr,{children:[p&&l.jsx($A,{crumbs:p}),l.jsx("div",{className:"grid place-items-center h-full",children:l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load skill"}),l.jsx("p",{className:"text-sm text-neutral3",children:b?.message??"Skill not found"})]})})]}):l.jsxs(fr,{children:[p&&l.jsx($A,{crumbs:p}),l.jsx("div",{className:"grid overflow-y-auto overflow-x-hidden h-full",children:l.jsx("div",{className:"max-w-[100rem] px-[3rem] mx-auto py-8 h-full w-full overflow-x-hidden",children:l.jsx(Rss,{skill:g,rawSkillMd:S?.content,onReferenceClick:m})})}),l.jsx(Pss,{open:!!h,onOpenChange:O=>!O&&m(null),skillName:g.name,referencePath:h??"",content:w?.content,isLoading:_})]})}const BLt=()=>{const e=window.MASTRA_CLOUD_API_ENDPOINT;return{isMastraPlatform:!!e,mastraPlatformEndpoint:e}};function jXe(e){const{Icon:t}=e;return{name:e.name,url:e.url,icon:l.jsx(t,{})}}function rle(e,t){const n=r=>t===r||t.startsWith(r+"/");return n(e.url)?!0:e.activePaths?.some(n)??!1}function Bss(){const{Link:e}=an(),{state:t,isMobile:n}=xq(),s=Rc().pathname,{isMastraPlatform:a}=BLt(),{data:i}=Uj(),{isCmsAvailable:o,isLoading:c}=ZD(),{hasPermission:u,hasAnyPermission:d,rbacEnabled:f,isAuthenticated:p,isLoading:h}=qb(),m=i&&Q$(i),g=new Set(["/prompts"]),v=S=>g.has(S.url)&&!o&&!c||a&&!S.isOnMastraPlatform?!1:f&&p&&h?!0:!(S.requiredPermission&&!u(S.requiredPermission)||S.requiredAnyPermission&&!d(S.requiredAnyPermission)),b=FLt.filter(v);return l.jsxs(xf,{children:[l.jsx("div",{className:"pt-3 mb-4",children:t==="collapsed"?l.jsxs("div",{className:"flex flex-col gap-3 items-center",children:[l.jsxs("div",{className:"relative grid place-items-center size-9",children:[l.jsx(Ky,{className:X("h-[1.5rem] w-[1.5rem] shrink-0 transition-opacity duration-150",!n&&"group-hover/sidebar:opacity-0")}),!n&&l.jsx("div",{className:"absolute inset-0 opacity-0 transition-opacity duration-150 group-hover/sidebar:opacity-100",children:l.jsx(xf.Trigger,{})})]}),m&&l.jsx(Xhe,{})]}):m?l.jsxs("span",{className:"flex items-center justify-between pl-3 pr-2",children:[l.jsxs("span",{className:"flex items-center gap-2 flex-1 min-w-0",children:[l.jsx(Ky,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),l.jsx("span",{className:"font-serif text-sm whitespace-nowrap truncate",children:"Mastra Studio"}),!n&&l.jsx(xf.Trigger,{})]}),l.jsx(Xhe,{})]}):l.jsxs("span",{className:"flex items-center gap-2 pl-3 pr-2",children:[l.jsx(Ky,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),l.jsx("span",{className:"font-serif text-sm whitespace-nowrap truncate",children:"Mastra Studio"}),!n&&l.jsx(xf.Trigger,{})]})}),l.jsx(xf.Nav,{children:zLt.map(S=>{const w=S.items.filter(v),_=w.some(E=>rle(E,s)),O=!!(S.href&&s===S.href&&!_);return l.jsxs(xf.NavSection,{children:[S.title?l.jsx(xf.NavHeader,{LinkComponent:e,state:t,href:S.href,isActive:O,children:S.title}):null,l.jsx(xf.NavList,{children:w.map(E=>l.jsx(xf.NavLink,{LinkComponent:e,state:t,link:jXe(E),isActive:rle(E,s)},E.name))})]},S.key)})}),l.jsxs(xf.Bottom,{className:"pb-3",children:[b.length>0&&l.jsx(xf.NavList,{children:b.map(S=>l.jsx(xf.NavLink,{LinkComponent:e,state:t,link:jXe(S),isActive:rle(S,s)},S.name))}),t!=="collapsed"&&l.jsxs(l.Fragment,{children:[l.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"mx-6 my-2 h-px bg-border1"}),l.jsx(rGr,{collapsed:!1})]})]})]})}function ULt({children:e,loginUrl:t="/login",signupUrl:n="/signup"}){const{data:r,isLoading:s}=Uj();if(s)return l.jsx(l.Fragment,{children:e});if(!r?.enabled)return l.jsx(l.Fragment,{children:e});if(Q$(r))return l.jsx(l.Fragment,{children:e});const a=typeof window<"u"?window.location.href:void 0;if(!r.login)return l.jsx("div",{className:"flex h-full w-full items-center justify-center",children:l.jsxs("div",{className:"flex flex-col items-center space-y-6 text-center",children:[l.jsx(Ky,{className:"h-16 w-16 opacity-50"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-neutral6",children:"Authentication Required"}),l.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 o=new URL(n,window.location.origin);a&&o.searchParams.set("redirect",a),window.location.href=o.toString()};return l.jsx("div",{className:"flex h-full w-full items-center justify-center",children:l.jsxs("div",{className:"flex flex-col items-center space-y-6 text-center",children:[l.jsx(Ky,{className:"h-16 w-16 opacity-50"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-xl font-semibold text-neutral6",children:"Sign in to continue"}),l.jsx("p",{className:"max-w-sm text-neutral3",children:"You need to sign in to access this page."})]}),r.login.description&&l.jsxs("div",{className:"flex items-start gap-2.5 rounded-md border border-border1 bg-surface2 p-3 text-left",children:[l.jsx(det,{className:"mt-0.5 h-4 w-4 shrink-0 text-neutral4"}),l.jsx("p",{className:"max-w-sm text-sm text-neutral3",children:r.login.description})]}),l.jsx(pLt,{config:r.login,redirectUri:a,loginUrl:t}),(r.login.type==="credentials"||r.login.type==="both")&&r.login.signUpEnabled!==!1&&l.jsxs("div",{className:"text-sm",children:[l.jsx("span",{className:"text-neutral3",children:"Don't have an account? "}),l.jsx("button",{type:"button",onClick:i,className:"text-neutral6 hover:underline",children:"Sign up"})]})]})})}const qLt="experimental-ui:",VLt="current",Uss=Oe.createContext(null);function qss(e,t){const n=window.localStorage.getItem(qLt+e);return n&&t.has(n)?n:VLt}function Vss({experiments:e,children:t}){const n=Oe.useMemo(()=>new Map(e.map(c=>[c.key,new Set(c.variants.map(u=>u.value))])),[e]),[r,s]=Oe.useState({});Oe.useLayoutEffect(()=>{const c={};for(const u of e){const d=n.get(u.key);c[u.key]=qss(u.key,d)}s(c)},[e,n]);const a=Oe.useCallback(c=>r[c]??VLt,[r]),i=Oe.useCallback((c,u)=>{window.localStorage.setItem(qLt+c,u),s(d=>({...d,[c]:u}))},[]),o=Oe.useMemo(()=>({experiments:e,getVariant:a,setVariant:i}),[e,a,i]);return l.jsx(Uss.Provider,{value:o,children:t})}const Hss=[{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"}]}],Zss=()=>({experimentalUIEnabled:typeof window<"u"&&window.MASTRA_EXPERIMENTAL_UI==="true"}),Wss=()=>{const[e,t]=y.useState(!1),n=y.useCallback(()=>{t(r=>!r)},[]);return y.useEffect(()=>{const r=s=>{s.key==="k"&&(s.metaKey||s.ctrlKey)&&(s.preventDefault(),n())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[n]),{open:e,setOpen:t,toggle:n}},DOe=()=>{const{requestContext:e}=Us(),t=Ze();return St({queryKey:["processors"],queryFn:()=>t.listProcessors(e)})},HLt=(e,t)=>{const n=Ze(),{requestContext:r}=Us();return St({queryKey:["processor",e],queryFn:()=>n.getProcessor(e).details(r),enabled:!!e})},Gss=()=>{const e=Ze(),{requestContext:t}=Us();return nr({mutationFn:async({processorId:n,phase:r,messages:s,agentId:a})=>e.getProcessor(n).execute({phase:r,messages:s,agentId:a,requestContext:t})})},Qss=()=>{const{open:e,setOpen:t}=Wss(),{navigate:n,paths:r}=an(),{isMastraPlatform:s}=BLt(),a=wq(),{data:i={}}=Lv(),{data:o={}}=Bw(),{data:c={}}=TH(),{data:u={}}=DOe(),{data:d=[]}=hH(),{data:f={}}=Op(),p=S=>{n(S),t(!1)},h=Object.entries(i),m=Object.entries(o),g=Object.entries(c),v=Object.values(u).filter(S=>S.phases&&S.phases.length>0),b=Object.entries(f);return l.jsxs(rKn,{open:e,onOpenChange:t,title:"Navigation",description:"Search and navigate to any entity",children:[l.jsx(Xwt,{placeholder:"Search or navigate..."}),l.jsxs(Kwt,{children:[l.jsx(Jwt,{children:"No results found."}),l.jsxs(Vx,{heading:"Navigation",children:[a&&l.jsxs(wl,{value:"toggle sidebar collapse expand",onSelect:()=>{a.toggleSidebar(),t(!1)},children:[l.jsx(get,{className:"text-neutral3"}),l.jsx("span",{children:"Toggle Sidebar"}),l.jsx(e1t,{children:"Ctrl+B"})]}),l.jsxs(wl,{value:"all agents",onSelect:()=>p("/agents"),children:[l.jsx(Go,{className:"text-neutral3"}),l.jsx("span",{children:"All Agents"})]}),l.jsxs(wl,{value:"all workflows",onSelect:()=>p("/workflows"),children:[l.jsx(Tc,{className:"text-neutral3"}),l.jsx("span",{children:"All Workflows"})]}),l.jsxs(wl,{value:"all tools",onSelect:()=>p("/tools"),children:[l.jsx(Cc,{className:"text-neutral3"}),l.jsx("span",{children:"All Tools"})]}),l.jsxs(wl,{value:"all scorers",onSelect:()=>p("/scorers"),children:[l.jsx(cu,{className:"text-neutral3"}),l.jsx("span",{children:"All Scorers"})]}),l.jsxs(wl,{value:"all processors",onSelect:()=>p("/processors"),children:[l.jsx(wC,{className:"text-neutral3"}),l.jsx("span",{children:"All Processors"})]}),l.jsxs(wl,{value:"all mcp servers",onSelect:()=>p("/mcps"),children:[l.jsx(Pm,{className:"text-neutral3"}),l.jsx("span",{children:"All MCP Servers"})]}),l.jsxs(wl,{value:"observability traces",onSelect:()=>p("/observability"),children:[l.jsx(kc,{className:"text-neutral3"}),l.jsx("span",{children:"Observability"})]}),!s&&l.jsxs(l.Fragment,{children:[l.jsxs(wl,{value:"settings",onSelect:()=>p("/settings"),children:[l.jsx(Awt,{className:"text-neutral3"}),l.jsx("span",{children:"Settings"})]}),l.jsxs(wl,{value:"templates",onSelect:()=>p("/templates"),children:[l.jsx(_S,{className:"text-neutral3"}),l.jsx("span",{children:"Templates"})]})]})]}),h.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(q1,{}),l.jsx(Vx,{heading:"Agents",children:h.map(([S,w])=>l.jsxs(Oe.Fragment,{children:[l.jsxs(wl,{value:`${w.name} chat agent`,onSelect:()=>p(r.agentLink(S)),children:[l.jsx(Go,{className:"text-neutral3"}),l.jsxs("span",{children:[w.name,": Chat"]})]}),l.jsxs(wl,{value:`${w.name} traces agent observability`,onSelect:()=>p(`/observability?entity=${S}`),children:[l.jsx(kc,{className:"text-neutral3"}),l.jsxs("span",{children:[w.name,": Traces"]})]})]},S))})]}),m.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(q1,{}),l.jsx(Vx,{heading:"Workflows",children:m.map(([S,w])=>l.jsxs(Oe.Fragment,{children:[l.jsxs(wl,{value:`${w.name} graph workflow view`,onSelect:()=>p(r.workflowLink(S)),children:[l.jsx(Tc,{className:"text-neutral3"}),l.jsxs("span",{children:[w.name,": Graph"]})]}),l.jsxs(wl,{value:`${w.name} traces workflow observability`,onSelect:()=>p(`/observability?entity=${w.name}`),children:[l.jsx(kc,{className:"text-neutral3"}),l.jsxs("span",{children:[w.name,": Traces"]})]})]},S))})]}),g.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(q1,{}),l.jsx(Vx,{heading:"Tools",children:g.map(([S,w])=>l.jsxs(wl,{value:`tool ${w.id}`,onSelect:()=>p(r.toolLink(S)),children:[l.jsx(Cc,{className:"text-neutral3"}),l.jsx("span",{children:w.id})]},S))})]}),b.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(q1,{}),l.jsx(Vx,{heading:"Scorers",children:b.map(([S,w])=>{const _=w.scorer?.config?.name||w.scorer?.config?.id||S;return l.jsxs(wl,{value:`scorer ${_}`,onSelect:()=>p(r.scorerLink(S)),children:[l.jsx(cu,{className:"text-neutral3"}),l.jsx("span",{children:_})]},S)})})]}),v.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(q1,{}),l.jsx(Vx,{heading:"Processors",children:v.map(S=>{const w=S.name||S.id,_=S.isWorkflow?r.workflowLink(S.id)+"/graph":r.processorLink(S.id);return l.jsxs(wl,{value:`processor ${w}`,onSelect:()=>p(_),children:[l.jsx(wC,{className:"text-neutral3"}),l.jsx("span",{children:w})]},S.id)})})]}),d.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(q1,{}),l.jsx(Vx,{heading:"MCP Servers",children:d.map(S=>l.jsxs(wl,{value:`mcp server ${S.name}`,onSelect:()=>p(r.mcpServerLink(S.id)),children:[l.jsx(Pm,{className:"text-neutral3"}),l.jsx("span",{children:S.name})]},S.id))})]})]})]})};function Yss(){return l.jsxs("header",{className:"lg:hidden sticky top-0 z-20 flex h-12 shrink-0 items-center gap-3 border-b border-border1 bg-surface1 px-3",children:[l.jsx(xf.MobileTrigger,{}),l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(Ky,{className:"size-[1.5rem] shrink-0"}),l.jsx("span",{className:"font-serif text-sm whitespace-nowrap",children:"Mastra Studio"})]})]})}function Xss({children:e}){const{data:t,isFetched:n}=Uj(),{pathname:r}=Rc(),{crumbs:s}=ZSt(),a=WSt(),i=Gar(a??s),c=!(n&&t?.enabled&&!Q$(t));return l.jsxs(l.Fragment,{children:[l.jsx(Qss,{}),l.jsxs("div",{className:X("h-full",c&&"lg:grid lg:grid-cols-[auto_1fr] lg:grid-rows-[1fr]"),children:[c&&l.jsx(Bss,{}),l.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[c&&l.jsx(Yss,{}),c&&l.jsx("div",{className:"mx-1.5 mt-1 shrink-0 lg:mx-2 lg:mt-1.5",children:l.jsx(Har,{})}),l.jsx(S1t.Provider,{value:i,children:l.jsx("div",{className:X("ml-0 mx-1.5 mb-1.5 flex-1 min-h-0 overflow-y-auto [--studio-frame-radius:1.5rem] [--studio-frame-inset:0.5rem] rounded-studio-frame border border-border1 bg-surface2 shadow-main-frame lg:mx-2 lg:mb-2 lg:ml-0",c?"mt-0":"mt-1.5 lg:mt-2 h-[calc(100%-1.5rem)]"),children:l.jsx(ULt,{children:l.jsx(Vtr,{resetKeys:[r],children:e})})})})]})]})]})}const Kss=({children:e})=>{const{experimentalUIEnabled:t}=Zss();return l.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[l.jsx(Swt,{position:"bottom-right"}),l.jsx(Cwt,{defaultTheme:"dark",children:l.jsx(od,{delayDuration:0,children:l.jsx(Vss,{experiments:t?Hss:[],children:l.jsx(zJn,{children:l.jsx(Bar,{children:l.jsx(Zar,{children:l.jsx(Xss,{children:e})})})})})})})]})},Jss=({children:e})=>l.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[l.jsx(Swt,{position:"bottom-right"}),l.jsx(Cwt,{defaultTheme:"dark",children:l.jsx(od,{delayDuration:0,children:l.jsx("div",{className:"h-full overflow-y-auto",children:l.jsx(ULt,{children:e})})})})]});function sle(){const{agentId:e}=Mr();return e?l.jsx(WGr,{value:e,variant:"ghost",size:"sm"}):null}function eas(){const{toolId:e}=Mr();return e??null}const tas=({children:e})=>{const{agentId:t}=Mr(),n=Rc(),{isCmsAvailable:r}=ZD(),{hasObservability:s}=oGr(),a=Jhe.has("datasets"),i=r&&a,o=s&&a,{data:c}=ld(t),u=ou(c?.provider??""),d=c?.modelId??"",f=c?.requestContextSchema,p=n.pathname.includes("/editor")?"versions":n.pathname.includes("/evaluate")?"evaluate":n.pathname.includes("/review")?"review":n.pathname.includes("/traces")?"traces":"chat",h=(p==="versions"||p==="evaluate"||p==="review")&&(i||o),m=l.jsxs(fr,{children:[l.jsx(iJr,{agentId:t,activeTab:p,showPlayground:i,showObservability:o,rightSlot:h?l.jsx(oJr,{requestContextSchema:f}):void 0}),e]});return l.jsx(U$,{children:l.jsx(tWr,{defaultProvider:u,defaultModel:d,children:l.jsx(WKr,{children:l.jsx(nWr,{children:m})})})})};function NXe(){const{serverId:e}=Mr();return e?l.jsx(P3t,{value:e,variant:"ghost"}):null}function nas(){const{serverId:e,toolId:t}=Mr(),{data:n}=U_e(e??"",t??"",{enabled:!!e&&!!t});return n?.name??t??null}function ras({value:e,onValueChange:t,placeholder:n="Select a processor...",searchPlaceholder:r="Search processors...",emptyText:s="No processors found.",className:a,disabled:i=!1,variant:o="default"}){const{data:c={},isLoading:u,isError:d,error:f}=DOe(),{navigate:p,paths:h}=an();y.useEffect(()=>{if(d){const v=f instanceof Error?f.message:"Failed to load processors";Fe.error(`Error loading processors: ${v}`)}},[d,f]);const m=Object.keys(c).filter(v=>{const b=c[v];return b?.phases&&b.phases.length>0}).map(v=>({label:c[v]?.name||v,value:v})),g=v=>{t?t(v):v&&v!==e&&(c[v]?.isWorkflow?p(h.workflowLink(v)+"/graph"):p(h.processorLink(v)))};return l.jsx(jc,{options:m,value:e,onValueChange:g,placeholder:u?"Loading processors...":n,searchPlaceholder:r,emptyText:s,className:a,disabled:i||u||d,variant:o})}function sas(){const{processorId:e}=Mr();return e?l.jsx(ras,{value:e,variant:"ghost"}):null}function aas(){const{promptBlockId:e}=Mr(),{data:t,isLoading:n}=WD(e,{status:"draft"});return e?n?l.jsx(rs,{className:"h-5 w-36"}):t?.name??"Prompt block not found":null}function ias(){const{scorerId:e}=Mr();return e?l.jsx(SGr,{value:e,variant:"ghost"}):null}function oas(){const{scorerId:e}=Mr(),{data:t,isLoading:n}=p3t(e,{status:"draft"});return e?n?l.jsx(rs,{className:"h-5 w-36"}):t?.name??"Scorer not found":null}function las(){const{toolId:e}=Mr();return e?l.jsx(Kns,{value:e,variant:"ghost"}):null}function cas(){const{traceId:e}=Mr();return e?l.jsx(w1t,{untilChar:"-",copy:!0,children:e}):null}function uas(){const{workflowId:e}=Mr();return e?l.jsx(v2r,{value:e,variant:"ghost"}):null}function das(){const{runId:e}=Mr();return e?l.jsx(w1t,{untilChar:"-",copy:!0,children:e}):null}const fas=({children:e,options:t})=>{const n=new LQn({...t,defaultOptions:{...t?.defaultOptions,queries:{retry:Gnr,...t?.defaultOptions?.queries}}});return l.jsx(zQn,{client:n,children:e})},pas=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(oi,{iconSlot:l.jsx(Hd,{}),titleSlot:"No Processors yet",descriptionSlot:"Configure processors. Add input or output processors to your agents to transform messages.",actionSlot:l.jsxs(de,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",children:["Processors Documentation ",l.jsx(Da,{})]})})}),has=["input","inputStep","outputStep","outputStream","outputResult"];function mas({processors:e,isLoading:t,search:n=""}){const{paths:r,Link:s}=an(),a=y.useMemo(()=>Object.values(e??{}).filter(o=>o.phases&&o.phases.length>0),[e]),i=y.useMemo(()=>{const o=n.toLowerCase();return a.filter(c=>c.id.toLowerCase().includes(o)||(c.name||"").toLowerCase().includes(o))},[a,n]);return t?l.jsx(Dd,{columns:"auto 1fr auto auto auto auto auto auto"}):l.jsxs(we,{columns:"auto 1fr auto auto auto auto auto auto",children:[l.jsxs(we.Top,{children:[l.jsx(we.TopCell,{children:"Name"}),l.jsx(we.TopCell,{children:"Description"}),l.jsx(we.TopCellSmart,{long:"Input",short:"Input",tooltip:"Contains Input phase",className:"text-center"}),l.jsx(we.TopCellSmart,{long:"Input Step",short:l.jsxs(l.Fragment,{children:[l.jsx(V0,{})," Step"]}),tooltip:"Contains Input Step phase",className:"text-center"}),l.jsx(we.TopCellSmart,{long:"Output Step",short:l.jsxs(l.Fragment,{children:[l.jsx(qf,{})," Step"]}),tooltip:"Contains Output Step phase",className:"text-center"}),l.jsx(we.TopCellSmart,{long:"Output Stream",short:l.jsxs(l.Fragment,{children:[l.jsx(qf,{})," Stream"]}),tooltip:"Contains Output Stream phase",className:"text-center"}),l.jsx(we.TopCellSmart,{long:"Output Result",short:l.jsxs(l.Fragment,{children:[l.jsx(qf,{})," Result"]}),tooltip:"Contains Output Result phase",className:"text-center"}),l.jsx(we.TopCellSmart,{short:"Used by",long:"Used by Agents",className:"text-center"})]}),i.length===0&&n?l.jsx(we.NoMatch,{message:"No Processors match your search"}):null,i.map(o=>{const c=_h(o.name||o.id,50),u=_h(o.description??"",200),d=o.agentIds?.length??0,f=new Set(o.phases||[]),p=o.isWorkflow?r.workflowLink(o.id)+"/graph":r.processorLink(o.id);return l.jsxs(we.RowLink,{to:p,LinkComponent:s,children:[l.jsx(we.NameCell,{children:c}),l.jsx(we.DescriptionCell,{children:u}),has.map(h=>l.jsx(we.TextCell,{className:"text-center",children:f.has(h)&&l.jsx(Ka,{className:"size-4 mx-auto"})},h)),l.jsx(we.TextCell,{className:"text-center",children:d||""})]},o.id)})]})}function gas(){const{data:e={},isLoading:t,error:n}=DOe(),[r,s]=y.useState("");return n&&zs(n)?l.jsx(ir,{children:l.jsx(ua,{})}):n&&Bs(n)?l.jsx(ir,{children:l.jsx(na,{resource:"processors"})}):n?l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load processors",message:n.message})}):Object.keys(e).length===0&&!t?l.jsx(ir,{children:l.jsx(pas,{})}):l.jsxs(wn,{children:[l.jsx(wn.TopArea,{children:l.jsx("div",{className:"max-w-120",children:l.jsx(Iv,{onSearch:s,label:"Filter processors",placeholder:"Filter by name"})})}),l.jsx(mas,{processors:e,isLoading:t,search:r})]})}const vas={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 yas({processorId:e}){const{data:t,isLoading:n,error:r}=HLt(e);return y.useEffect(()=>{if(r){const s=r instanceof Error?r.message:"Failed to load processor";Fe.error(`Error loading processor: ${s}`)}},[r]),n?l.jsxs("div",{className:"p-6",children:[l.jsx(rs,{className:"h-8 w-48 mb-4"}),l.jsx(rs,{className:"h-32 w-full"})]}):r?null:t?l.jsx(bas,{processor:t}):l.jsx("div",{className:"py-12 text-center px-6",children:l.jsx(ge,{variant:"header-md",className:"text-neutral3",children:"Processor not found"})})}function bas({processor:e}){const t=Bb(),n=y.useId(),[r,s]=y.useState(e.phases[0]||"input"),[a,i]=y.useState(e.configurations[0]?.agentId||""),[o,c]=y.useState("Hello, this is a test message."),[u,d]=y.useState(null),[f,p]=y.useState(),h=Gss(),m=async()=>{p(void 0),d(null);const b=r==="outputStep"||r==="outputResult"?"assistant":"user",S=[{id:crypto.randomUUID(),role:b,createdAt:new Date,content:{format:2,parts:[{type:"text",text:o}]}}];try{const w=await h.mutateAsync({processorId:e.id,phase:r,messages:S,agentId:a||void 0});d(w),!w.success&&w.error&&p(w.error)}catch(w){p(w.message||"An error occurred")}},g=u?JSON.stringify(u,null,2):"{}";return l.jsxs(kh,{hasLeftServiceColumn:!0,className:"relative",children:[l.jsxs("div",{className:"bg-surface2 border-r border-border1 w-[22rem] overflow-y-auto",children:[l.jsx(xas,{processor:e}),l.jsxs("div",{className:"p-5 space-y-5",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ge,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Phase"}),l.jsxs(Ii,{value:r,onValueChange:v=>s(v),children:[l.jsx(wi,{className:"w-full",children:l.jsx(Ri,{placeholder:"Select phase"})}),l.jsx(Si,{children:e.phases.map(v=>l.jsx(vs,{value:v,children:v},v))})]}),l.jsx(ge,{variant:"ui-xs",className:"text-neutral4",children:vas[r]})]}),e.configurations.length>1&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(ge,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Agent Configuration"}),l.jsxs(Ii,{value:a,onValueChange:i,children:[l.jsx(wi,{className:"w-full",children:l.jsx(Ri,{placeholder:"Select agent"})}),l.jsx(Si,{children:e.configurations.map(v=>l.jsxs(vs,{value:v.agentId,children:[v.agentName," (",v.type,")"]},v.agentId))})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ge,{as:"label",htmlFor:n,variant:"ui-sm",className:"text-neutral3",children:"Test Message"}),l.jsx("textarea",{id:n,value:o,onChange:v=>c(v.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"})]}),l.jsx(de,{onClick:m,disabled:h.isPending||r==="outputStream",className:"w-full",children:h.isPending?"Running...":"Run Processor"}),r==="outputStream"&&l.jsx(ge,{variant:"ui-xs",className:"text-accent6",children:"Output Stream phase cannot be executed directly. Use streaming instead."}),u&&l.jsxs("div",{className:"space-y-2 pt-4 border-t border-border1",children:[l.jsx(ge,{variant:"ui-sm",className:"text-neutral3",children:"Status"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Et,{variant:u.success?"success":"error",children:u.success?"Success":"Failed"}),u.tripwire?.triggered&&l.jsx(Et,{variant:"info",children:"Tripwire Triggered"})]}),u.tripwire?.triggered&&u.tripwire.reason&&l.jsxs("div",{className:"mt-2 p-3 bg-accent6Dark rounded-md border border-accent6/20",children:[l.jsx(ge,{variant:"ui-sm",className:"text-accent6 font-medium",children:"Tripwire Reason"}),l.jsx(ge,{variant:"ui-sm",className:"text-neutral3 mt-1",children:u.tripwire.reason})]})]})]})]}),l.jsx("div",{className:"absolute top-4 right-4 z-10",children:l.jsx(la,{content:g,tooltip:"Copy JSON result to clipboard"})}),l.jsx("div",{className:"p-5 h-full relative overflow-x-auto overflow-y-auto",children:l.jsx(pu,{value:f||g,editable:!0,theme:t,extensions:[Vf]})})]})}function xas({processor:e}){return l.jsxs("div",{className:"px-5 pt-5 pb-4 border-b border-border1",children:[l.jsx(ge,{variant:"header-md",className:"text-neutral1 mb-2",children:e.name||e.id}),e.name&&e.name!==e.id&&l.jsx(ge,{variant:"ui-sm",className:"text-neutral4 mb-3",children:e.id}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-3",children:e.phases.map(t=>l.jsx(Et,{variant:"default",children:t},t))}),l.jsx("div",{className:"mt-3",children:l.jsxs(ge,{variant:"ui-xs",className:"text-neutral4",children:["Attached to ",e.configurations.length," agent",e.configurations.length!==1?"s":""]})})]})}function was(){const{processorId:e}=Mr(),{data:t,isLoading:n,error:r}=HLt(e);return r&&zs(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(ua,{})}):r&&Bs(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(na,{resource:"processors"})}):!n&&t?.isWorkflow?l.jsx(qtn,{to:`/workflows/${e}/graph`,replace:!0}):n?l.jsxs("div",{className:"p-6",children:[l.jsx(rs,{className:"h-8 w-48 mb-4"}),l.jsx(rs,{className:"h-32 w-full"})]}):l.jsx("div",{className:"h-full w-full overflow-y-hidden",children:l.jsx(yas,{processorId:e})})}function Sas(){const{data:e={},isLoading:t,error:n}=Lv(),{data:r={},isLoading:s,error:a}=TH(),[i,o]=y.useState(""),c=t||s,u=a||n;return u&&zs(u)?l.jsx(ir,{children:l.jsx(ua,{})}):u&&Bs(u)?l.jsx(ir,{children:l.jsx(na,{resource:"tools"})}):u?l.jsx(ir,{children:l.jsx(Jl,{title:"Failed to load tools",message:u.message})}):Object.keys(r).length===0&&!c?l.jsx(ir,{children:l.jsx(Qns,{})}):l.jsxs(wn,{children:[l.jsx(wn.TopArea,{children:l.jsx("div",{className:"max-w-120",children:l.jsx(Iv,{onSearch:o,label:"Filter tools",placeholder:"Filter by name"})})}),l.jsx(Gns,{tools:r,agents:e,isLoading:c,search:i})]})}const ZLt={agentLink:e=>`/agents/${e}/chat/new`,agentToolLink:(e,t)=>`/agents/${e}/tools/${t}`,agentSkillLink:(e,t,n,r)=>r?`/workspaces/${r}/skills/${encodeURIComponent(t)}?agentId=${encodeURIComponent(e)}${n?`&path=${encodeURIComponent(n)}`:""}`:"/workspaces",agentsLink:()=>"/agents",agentNewThreadLink:e=>`/agents/${e}/chat/new`,agentThreadLink:(e,t,n)=>n?`/agents/${e}/chat/${t}?messageId=${n}`:`/agents/${e}/chat/${t}`,workflowsLink:()=>"/workflows",workflowLink:e=>`/workflows/${e}`,schedulesLink:()=>"/workflows/schedules",scheduleLink:e=>`/workflows/schedules/${encodeURIComponent(e)}`,networkLink:e=>`/networks/v-next/${e}/chat`,networkNewThreadLink:e=>`/networks/v-next/${e}/chat/${ao()}`,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,n)=>n?`/workspaces/${n}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/workspaces",workspaceLink:e=>e?`/workspaces/${e}`:"/workspaces",workspaceSkillLink:(e,t,n)=>n?`/workspaces/${n}/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}`},kas=()=>{const e=bu(),t=n=>e(n,{viewTransition:!0});return l.jsx(HSt,{Link:sV,navigate:t,paths:ZLt,children:l.jsx(Kss,{children:l.jsx(CC,{})})})},_as=()=>{const e=bu(),t=n=>e(n,{viewTransition:!0});return l.jsx(HSt,{Link:sV,navigate:t,paths:ZLt,children:l.jsx(Jss,{children:l.jsx(CC,{})})})},Oas=!!window.MASTRA_CLOUD_API_ENDPOINT,AXe=Jhe.has("datasets"),IXe=[{index:!0,element:l.jsx(ses,{})},{path:"instruction-blocks",element:l.jsx(aes,{})},{path:"tools",element:l.jsx(ces,{})},{path:"agents",element:l.jsx(tes,{})},{path:"scorers",element:l.jsx(oes,{})},{path:"workflows",element:l.jsx(des,{})},{path:"skills",element:l.jsx(les,{})},{path:"memory",element:l.jsx(ies,{})},{path:"variables",element:l.jsx(ues,{})}],RXe={id:"workflow-schedules",label:"Schedules",icon:xM,to:"/workflows/schedules"},Fx=e=>{if(!e)return"";try{return decodeURIComponent(e)}catch{return e}},Eas=[{path:"/login",element:l.jsx(Bns,{})},{path:"/signup",element:l.jsx(Prs,{})},{element:l.jsx(_as,{}),children:[{path:"/agents/:agentId/session",element:l.jsx(QYe,{})},{path:"/agents/:agentId/session/:threadId",element:l.jsx(QYe,{})}]},{element:l.jsx(kas,{}),children:[...Oas?[]:[{path:"/settings",element:l.jsx(Rrs,{}),handle:nl("/settings")},{path:"/templates",element:l.jsx(Lrs,{}),handle:{crumbs:[{id:"templates",label:"Templates"}]}},{path:"/templates/:templateSlug",element:l.jsx(Hrs,{}),handle:{crumbs:({params:e})=>[{id:"templates",label:"Templates",to:"/templates"},{id:"template",label:Fx(e.templateSlug)}]}}],{path:"/logs",element:l.jsx(Uns,{}),handle:nl("/logs")},{path:"/primitives",element:l.jsx(Ors,{}),handle:nl("/primitives")},{path:"/evaluation",element:l.jsx(Lns,{}),handle:nl("/evaluation")},{path:"/scorers",element:l.jsx(Nrs,{}),handle:nl("/scorers")},{path:"/scorers/:scorerId",element:l.jsx(Ars,{}),handle:Bc("/scorers",[{id:"scorer",Component:ias,heading:"Scorer"}])},{path:"/metrics",element:l.jsx(xrs,{}),handle:nl("/metrics")},{path:"/observability-overview",element:l.jsx(krs,{}),handle:nl("/observability-overview")},{path:"/observability",element:l.jsx(vLt,{}),handle:nl("/observability")},{path:"/traces/:traceId",element:l.jsx(Grs,{}),handle:Bc("/observability",[{id:"trace",Component:cas,heading:"Trace"}])},{path:"/resources",element:l.jsx(jrs,{}),handle:nl("/resources")},{path:"/agents",element:l.jsx(Zxr,{}),handle:nl("/agents")},{path:"/cms/agents/create",element:l.jsx(nes,{}),handle:Bc("/agents",[{id:"create-agent",label:"Create agent"}]),children:IXe},{path:"/cms/agents/:agentId/edit",element:l.jsx(res,{}),handle:Bc("/agents",[{id:"agent",Component:sle,heading:"Agent"}]),children:IXe},{path:"/cms/scorers/create",element:l.jsx(mes,{}),handle:Bc("/scorers",[{id:"create-scorer",label:"Create scorer"}])},{path:"/cms/scorers/:scorerId/edit",element:l.jsx(ves,{}),handle:Bc("/scorers",[{id:"scorer",Component:oas,heading:"Scorer"}])},{path:"/prompts",element:l.jsx(Ers,{}),handle:nl("/prompts")},{path:"/cms/prompts/create",element:l.jsx(fes,{}),handle:Bc("/prompts",[{id:"create-prompt-block",label:"Create prompt block"}])},{path:"/cms/prompts/:promptBlockId/edit",element:l.jsx(hes,{}),handle:Bc("/prompts",[{id:"prompt-block",Component:aas,heading:"Prompt block"}])},{path:"/agents/:agentId/tools/:toolId",element:l.jsx(Zrs,{}),handle:Bc("/agents",[{id:"agent",Component:sle,heading:"Agent"},{id:"agent-tool",Component:eas,heading:"Agent tool"}])},{path:"/agents/:agentId",element:l.jsx(tas,{children:l.jsx(CC,{})}),handle:Bc("/agents",[{id:"agent",Component:sle,heading:"Agent"}]),children:[{index:!0,loader:({params:e})=>uG(`/agents/${e.agentId}/chat`)},{path:"chat",element:l.jsx(WYe,{})},{path:"chat/:threadId",element:l.jsx(WYe,{})},...AXe?[{path:"editor",element:l.jsx(GJr,{})},{path:"evaluate",element:l.jsx(WJr,{})},{path:"review",element:l.jsx(QJr,{})}]:[],{path:"traces",element:l.jsx(ees,{})}]},{path:"/tools",element:l.jsx(Sas,{}),handle:nl("/tools")},{path:"/tools/:toolId",element:l.jsx(Wrs,{}),handle:Bc("/tools",[{id:"tool",Component:las,heading:"Tool"}])},{path:"/processors",element:l.jsx(gas,{}),handle:nl("/processors")},{path:"/processors/:processorId",element:l.jsx(was,{}),handle:Bc("/processors",[{id:"processor",Component:sas,heading:"Processor"}])},{path:"/mcps",element:l.jsx(Zns,{}),handle:nl("/mcps")},{path:"/mcps/:serverId",element:l.jsx(rrs,{}),handle:Bc("/mcps",[{id:"mcp-server",Component:NXe,heading:"MCP server"}])},{path:"/mcps/:serverId/tools/:toolId",element:l.jsx(irs,{}),handle:Bc("/mcps",[{id:"mcp-server",Component:NXe,heading:"MCP server"},{id:"mcp-server-tool",Component:nas,heading:"MCP server tool"}])},{path:"/workspaces",element:l.jsx(TXe,{}),handle:nl("/workspaces")},{path:"/workspaces/:workspaceId",element:l.jsx(TXe,{}),handle:nl("/workspaces")},{path:"/workspaces/:workspaceId/skills/:skillName",element:l.jsx(Fss,{}),handle:{crumbs:({params:e})=>[rm("/workspaces"),{id:"workspace",label:Fx(e.workspaceId),to:e.workspaceId?`/workspaces/${encodeURIComponent(e.workspaceId)}`:void 0},{id:"skill",label:Fx(e.skillName)}]}},{path:"/workflows",element:l.jsx(Qrs,{}),handle:nl("/workflows")},{path:"/workflows/schedules",element:l.jsx(uss,{}),handle:Bc("/workflows",[RXe])},{path:"/workflows/schedules/:scheduleId",element:l.jsx(oss,{}),handle:{crumbs:({params:e})=>[rm("/workflows"),RXe,{id:"schedule",label:Fx(e.scheduleId),icon:xM}]}},{path:"/workflows/:workflowId",element:l.jsx(_yr,{children:l.jsx(CC,{})}),handle:Bc("/workflows",[{id:"workflow",Component:uas,heading:"Workflow"}]),children:[{index:!0,loader:({params:e})=>uG(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:l.jsx(OXe,{})},{path:"graph/:runId",element:l.jsx(OXe,{}),handle:{crumbs:[{id:"workflow-run",Component:das,heading:"Workflow run"}]}}]},...AXe?[{path:"/datasets",element:l.jsx(gns,{}),handle:nl("/datasets")},{path:"/datasets/:datasetId",element:l.jsx(yns,{}),handle:{crumbs:()=>[rm("/datasets"),{id:"dataset",Component:O1,heading:"Dataset"}]}},{path:"/datasets/:datasetId/items/:itemId",element:l.jsx(wns,{}),handle:{crumbs:({params:e})=>[rm("/datasets"),{id:"dataset",Component:O1,heading:"Dataset"},{id:"dataset-item",label:Fx(e.itemId)}]}},{path:"/datasets/:datasetId/items/:itemId/versions",element:l.jsx(_ns,{}),handle:{crumbs:({params:e})=>[rm("/datasets"),{id:"dataset",Component:O1,heading:"Dataset"},{id:"dataset-item",label:Fx(e.itemId),to:e.datasetId&&e.itemId?`/datasets/${encodeURIComponent(e.datasetId)}/items/${encodeURIComponent(e.itemId)}`:void 0},{id:"dataset-item-versions",label:"Versions"}]}},{path:"/datasets/:datasetId/experiments/:experimentId",element:l.jsx(bns,{}),handle:{crumbs:({params:e})=>[rm("/datasets"),{id:"dataset",Component:O1,heading:"Dataset"},{id:"dataset-experiment",label:Fx(e.experimentId)}]}},{path:"/experiments",element:l.jsx(zns,{}),handle:nl("/experiments")},{path:"/experiments/:experimentId",element:l.jsx(Fns,{}),handle:{crumbs:({params:e})=>[rm("/experiments"),{id:"experiment",label:Fx(e.experimentId)}]}},{path:"/datasets/:datasetId/experiments",element:l.jsx(xns,{}),handle:{crumbs:()=>[rm("/datasets"),{id:"dataset",Component:O1,heading:"Dataset"},{id:"dataset-experiments",label:"Experiments"}]}},{path:"/datasets/:datasetId/items",element:l.jsx(Sns,{}),handle:{crumbs:()=>[rm("/datasets"),{id:"dataset",Component:O1,heading:"Dataset"},{id:"dataset-items",label:"Items"}]}},{path:"/datasets/:datasetId/versions",element:l.jsx(Ens,{}),handle:{crumbs:()=>[rm("/datasets"),{id:"dataset",Component:O1,heading:"Dataset"},{id:"dataset-versions",label:"Versions"}]}}]:[],{index:!0,loader:()=>uG("/agents")},{path:"/request-context",element:l.jsx(Crs,{}),handle:nl("/request-context")}]}];function Cas(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:n,apiPrefix:r,isLoading:s}=cOe(),a=y.useMemo(()=>t?DJr(t,r):void 0,[t,r]),i=y.useMemo(()=>({...n,"x-mastra-client-type":"studio"}),[n]),o=y.useMemo(()=>mnn(Eas,{basename:e}),[e]);return s?null:t?l.jsx(UJt,{baseUrl:t,headers:i,apiPrefix:r,customFetch:a,children:l.jsx(Dxr,{children:l.jsx(Ftn,{router:o})})}):l.jsx(iGr,{})}function Tas(){const e=window.MASTRA_SERVER_PROTOCOL||"http",t=window.MASTRA_SERVER_HOST||"localhost",n=window.MASTRA_SERVER_PORT||4111,r=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}:${n}`);return l.jsx(fas,{children:l.jsx(wWr,{endpoint:i,defaultApiPrefix:r,children:l.jsx(Cas,{})})})}rzt.createRoot(document.getElementById("root")).render(l.jsx(y.StrictMode,{children:l.jsx(Tas,{})}));const xls=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{Nrt as A,Oit as B,Irt as C,_at as D,fp as E,dh as F,xls as G,Sa as I,QS as L,jrt as N,GKt as a,uJt as b,bls as c,XNe as d,XS as e,iJt as f,HE as g,cJt as h,r_ as i,s_ as j,n_ as k,tun as l,Aat as m,HS as n,Ja as o,gcn as p,mcn as q,eve as r,Hme as s,ae as t,Fz as u,vd as v,JKt as w,xt as x,ut as y,Git as z};