@mastra/deployer-vercel 1.1.31 → 1.1.32-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/studio/assets/{index-f6blmeem.js → index-B0YqEr4W.js} +1 -1
- package/dist/studio/assets/{index-Dk8FtwwN.js → index-B9VB8F4i.js} +1 -1
- package/dist/studio/assets/{index-lR9r49aF.js → index-BSYtQhGq.js} +1 -1
- package/dist/studio/assets/{index-IJJMlwDq.js → index-BW42zsbk.js} +1 -1
- package/dist/studio/assets/{index-800CHMMy.js → index-CCMtfxHu.js} +1 -1
- package/dist/studio/assets/{index-N_GK67CF.js → index-CP_Zlo21.js} +1 -1
- package/dist/studio/assets/{index-O0wBkvx7.js → index-CXTirSmg.js} +1 -1
- package/dist/studio/assets/{index-Dx1nb-Qd.js → index-CbmketnY.js} +1 -1
- package/dist/studio/assets/{index-Bt7FWeVy.js → index-CduAROfO.js} +1 -1
- package/dist/studio/assets/{index-CxmKUBmC.js → index-CjSA3WIu.js} +1 -1
- package/dist/studio/assets/{index-CLd1jyjj.js → index-CsKePgCu.js} +1 -1
- package/dist/studio/assets/{index-CF0ott0E.js → index-DcjJamdO.js} +1 -1
- package/dist/studio/assets/{index-qajSBKss.js → index-DfB4wS6e.js} +1 -1
- package/dist/studio/assets/{index-DGYKLFP0.js → index-DpKU3WC0.js} +1 -1
- package/dist/studio/assets/{index-DJ0xFqTy.js → index-Dw_1xL1F.js} +1 -1
- package/dist/studio/assets/{index-DJRGlaRq.js → index-DyYP_FJl.js} +1 -1
- package/dist/studio/assets/{index-Cq-1GGqP.js → index-t6GJJU4Z.js} +1 -1
- package/dist/studio/assets/{index-BEkMUKAe.js → index-w7hK1iP_.js} +1 -1
- package/dist/studio/assets/{main-CbjjImiL.js → main-D4jzKiH-.js} +7 -7
- package/dist/studio/index.html +1 -1
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{_ as at}from"./index-800CHMMy.js";function dKe(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 $C=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function el(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var VW={exports:{}},cN={};var $je;function P6t(){if($je)return cN;$je=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 cN.Fragment=t,cN.jsx=n,cN.jsxs=n,cN}var Dje;function M6t(){return Dje||(Dje=1,VW.exports=P6t()),VW.exports}var l=M6t(),HW={exports:{}},Ir={},Lje;function $6t(){if(Lje)return Ir;Lje=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,$,Z){this.props=V,this.context=$,this.refs=b,this.updater=Z||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 O(V,$,Z){this.props=V,this.context=$,this.refs=b,this.updater=Z||g}var E=O.prototype=new w;E.constructor=O,v(E,S.prototype),E.isPureReactComponent=!0;var _=Array.isArray;function C(){}var j={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function N(V,$,Z){var G=Z.ref;return{$$typeof:t,type:V,key:$,ref:G!==void 0?G:null,props:Z}}function R(V,$){return N(V.type,$,V.props)}function P(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function B(V){var $={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(Z){return $[Z]})}var M=/\/+/g;function L(V,$){return typeof V=="object"&&V!==null&&V.key!=null?B(""+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(C,C):(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,$,Z,G,K){var ne=typeof V;(ne==="undefined"||ne==="boolean")&&(V=null);var ee=!1;if(V===null)ee=!0;else switch(ne){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(V.$$typeof){case t:case n:ee=!0;break;case f:return ee=V._init,z(ee(V._payload),$,Z,G,K)}}if(ee)return K=K(V),ee=G===""?"."+L(V,0):G,_(K)?(Z="",ee!=null&&(Z=ee.replace(M,"$&/")+"/"),z(K,$,Z,"",function(ae){return ae})):K!=null&&(P(K)&&(K=R(K,Z+(K.key==null||V&&V.key===K.key?"":(""+K.key).replace(M,"$&/")+"/")+ee)),$.push(K)),1;ee=0;var J=G===""?".":G+":";if(_(V))for(var se=0;se<V.length;se++)G=V[se],ne=J+L(G,se),ee+=z(G,$,Z,ne,K);else if(se=m(V),typeof se=="function")for(V=se.call(V),se=0;!(G=V.next()).done;)G=G.value,ne=J+L(G,se++),ee+=z(G,$,Z,ne,K);else if(ne==="object"){if(typeof V.then=="function")return z(F(V),$,Z,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 ee}function U(V,$,Z){if(V==null)return V;var G=[],K=0;return z(V,G,"","",function(ne){return $.call(Z,ne,K++)}),G}function H(V){if(V._status===-1){var $=V._result;$=$(),$.then(function(Z){(V._status===0||V._status===-1)&&(V._status=1,V._result=Z)},function(Z){(V._status===0||V._status===-1)&&(V._status=2,V._result=Z)}),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:U,forEach:function(V,$,Z){U(V,function(){$.apply(this,arguments)},Z)},count:function(V){var $=0;return U(V,function(){$++}),$},toArray:function(V){return U(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 Ir.Activity=p,Ir.Children=Y,Ir.Component=S,Ir.Fragment=r,Ir.Profiler=a,Ir.PureComponent=O,Ir.StrictMode=s,Ir.Suspense=u,Ir.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Ir.__COMPILER_RUNTIME={__proto__:null,c:function(V){return j.H.useMemoCache(V)}},Ir.cache=function(V){return function(){return V.apply(null,arguments)}},Ir.cacheSignal=function(){return null},Ir.cloneElement=function(V,$,Z){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(ne in $.key!==void 0&&(K=""+$.key),$)!I.call($,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&$.ref===void 0||(G[ne]=$[ne]);var ne=arguments.length-2;if(ne===1)G.children=Z;else if(1<ne){for(var ee=Array(ne),J=0;J<ne;J++)ee[J]=arguments[J+2];G.children=ee}return N(V.type,K,G)},Ir.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},Ir.createElement=function(V,$,Z){var G,K={},ne=null;if($!=null)for(G in $.key!==void 0&&(ne=""+$.key),$)I.call($,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(K[G]=$[G]);var ee=arguments.length-2;if(ee===1)K.children=Z;else if(1<ee){for(var J=Array(ee),se=0;se<ee;se++)J[se]=arguments[se+2];K.children=J}if(V&&V.defaultProps)for(G in ee=V.defaultProps,ee)K[G]===void 0&&(K[G]=ee[G]);return N(V,ne,K)},Ir.createRef=function(){return{current:null}},Ir.forwardRef=function(V){return{$$typeof:c,render:V}},Ir.isValidElement=P,Ir.lazy=function(V){return{$$typeof:f,_payload:{_status:-1,_result:V},_init:H}},Ir.memo=function(V,$){return{$$typeof:d,type:V,compare:$===void 0?null:$}},Ir.startTransition=function(V){var $=j.T,Z={};j.T=Z;try{var G=V(),K=j.S;K!==null&&K(Z,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(C,D)}catch(ne){D(ne)}finally{$!==null&&Z.types!==null&&($.types=Z.types),j.T=$}},Ir.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ir.use=function(V){return j.H.use(V)},Ir.useActionState=function(V,$,Z){return j.H.useActionState(V,$,Z)},Ir.useCallback=function(V,$){return j.H.useCallback(V,$)},Ir.useContext=function(V){return j.H.useContext(V)},Ir.useDebugValue=function(){},Ir.useDeferredValue=function(V,$){return j.H.useDeferredValue(V,$)},Ir.useEffect=function(V,$){return j.H.useEffect(V,$)},Ir.useEffectEvent=function(V){return j.H.useEffectEvent(V)},Ir.useId=function(){return j.H.useId()},Ir.useImperativeHandle=function(V,$,Z){return j.H.useImperativeHandle(V,$,Z)},Ir.useInsertionEffect=function(V,$){return j.H.useInsertionEffect(V,$)},Ir.useLayoutEffect=function(V,$){return j.H.useLayoutEffect(V,$)},Ir.useMemo=function(V,$){return j.H.useMemo(V,$)},Ir.useOptimistic=function(V,$){return j.H.useOptimistic(V,$)},Ir.useReducer=function(V,$,Z){return j.H.useReducer(V,$,Z)},Ir.useRef=function(V){return j.H.useRef(V)},Ir.useState=function(V){return j.H.useState(V)},Ir.useSyncExternalStore=function(V,$,Z){return j.H.useSyncExternalStore(V,$,Z)},Ir.useTransition=function(){return j.H.useTransition()},Ir.version="19.2.6",Ir}var zje;function uj(){return zje||(zje=1,HW.exports=$6t()),HW.exports}var y=uj();const Ee=el(y),dj=dKe({__proto__:null,default:Ee},[y]);var ZW={exports:{}},uN={},WW={exports:{}},GW={};var Fje;function D6t(){return Fje||(Fje=1,(function(e){function t(F,z){var U=F.length;F.push(z);e:for(;0<U;){var H=U-1>>>1,D=F[H];if(0<s(D,z))F[H]=z,F[U]=D,U=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],U=F.pop();if(U!==z){F[0]=U;e:for(var H=0,D=F.length,Y=D>>>1;H<Y;){var V=2*(H+1)-1,$=F[V],Z=V+1,G=F[Z];if(0>s($,U))Z<D&&0>s(G,$)?(F[H]=G,F[Z]=U,H=Z):(F[H]=$,F[V]=U,H=V);else if(Z<D&&0>s(G,U))F[H]=G,F[Z]=U,H=Z;else break e}}return z}function s(F,z){var U=F.sortIndex-z.sortIndex;return U!==0?U: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 O(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 E(F){if(g=!1,O(F),!m)if(n(c)!==null)m=!0,_||(_=!0,P());else{var z=n(u);z!==null&&L(E,z.startTime-F)}}var _=!1,C=-1,j=5,I=-1;function N(){return v?!0:!(e.unstable_now()-I<j)}function R(){if(v=!1,_){var F=e.unstable_now();I=F;var z=!0;try{e:{m=!1,g&&(g=!1,S(C),C=-1),h=!0;var U=p;try{t:{for(O(F),f=n(c);f!==null&&!(f.expirationTime>F&&N());){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,O(F),z=!0;break t}f===n(c)&&r(c),O(F)}else r(c);f=n(c)}if(f!==null)z=!0;else{var Y=n(u);Y!==null&&L(E,Y.startTime-F),z=!1}}break e}finally{f=null,p=U,h=!1}z=void 0}}finally{z?P():_=!1}}}var P;if(typeof w=="function")P=function(){w(R)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,M=B.port2;B.port1.onmessage=R,P=function(){M.postMessage(null)}}else P=function(){b(R,0)};function L(F,z){C=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 U=p;p=z;try{return F()}finally{p=U}},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 U=p;p=F;try{return z()}finally{p=U}},e.unstable_scheduleCallback=function(F,z,U){var H=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?H+U:H):U=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=U+D,F={id:d++,callback:z,priorityLevel:F,startTime:U,expirationTime:D,sortIndex:-1},U>H?(F.sortIndex=U,t(u,F),n(c)===null&&F===n(u)&&(g?(S(C),C=-1):g=!0,L(E,U-H))):(F.sortIndex=D,t(c,F),m||h||(m=!0,_||(_=!0,P()))),F},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(F){var z=p;return function(){var U=p;p=z;try{return F.apply(this,arguments)}finally{p=U}}}})(GW)),GW}var Bje;function L6t(){return Bje||(Bje=1,WW.exports=D6t()),WW.exports}var QW={exports:{}},zc={};var Uje;function z6t(){if(Uje)return zc;Uje=1;var e=uj();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 qje;function fKe(){if(qje)return QW.exports;qje=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(),QW.exports=z6t(),QW.exports}var Vje;function F6t(){if(Vje)return uN;Vje=1;var e={env:{}};var t=L6t(),n=uj(),r=fKe();function s(x){var k="https://react.dev/errors/"+x;if(1<arguments.length){k+="?args[]="+encodeURIComponent(arguments[1]);for(var T=2;T<arguments.length;T++)k+="&args[]="+encodeURIComponent(arguments[T])}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,T=x;if(x.alternate)for(;k.return;)k=k.return;else{x=k;do k=x,(k.flags&4098)!==0&&(T=k.return),x=k.return;while(x)}return k.tag===3?T: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 T=x,A=k;;){var q=T.return;if(q===null)break;var W=q.alternate;if(W===null){if(A=q.return,A!==null){T=A;continue}break}if(q.child===W.child){for(W=q.child;W;){if(W===T)return u(q),x;if(W===A)return u(q),k;W=W.sibling}throw Error(s(188))}if(T.return!==A.return)T=q,A=W;else{for(var re=!1,me=q.child;me;){if(me===T){re=!0,T=q,A=W;break}if(me===A){re=!0,A=q,T=W;break}me=me.sibling}if(!re){for(me=W.child;me;){if(me===T){re=!0,T=W,A=q;break}if(me===A){re=!0,A=W,T=q;break}me=me.sibling}if(!re)throw Error(s(189))}}if(T.alternate!==A)throw Error(s(190))}if(T.tag!==3)throw Error(s(188));return T.stateNode.current===T?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"),O=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),R=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function B(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 _:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if(typeof x=="object")switch(x.$$typeof){case g:return"Portal";case O:return x.displayName||"Context";case w:return(x._context.displayName||"Context")+".Consumer";case E: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 I: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,U=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 Z(x,k){Y++,D[Y]=x.current,x.current=k}var G=V(null),K=V(null),ne=V(null),ee=V(null);function J(x,k){switch(Z(ne,k),Z(K,x),Z(G,null),k.nodeType){case 9:case 11:x=(x=k.documentElement)&&(x=x.namespaceURI)?aje(x):0;break;default:if(x=k.tagName,k=k.namespaceURI)k=aje(k),x=ije(k,x);else switch(x){case"svg":x=1;break;case"math":x=2;break;default:x=0}}$(G),Z(G,x)}function se(){$(G),$(K),$(ne)}function ae(x){x.memoizedState!==null&&Z(ee,x);var k=G.current,T=ije(k,x.type);k!==T&&(Z(K,x),Z(G,T))}function Q(x){K.current===x&&($(G),$(K)),ee.current===x&&($(ee),aN._currentValue=H)}var te,le;function fe(x){if(te===void 0)try{throw Error()}catch(T){var k=T.stack.trim().match(/\n( *(at )?)/);te=k&&k[1]||"",le=-1<T.stack.indexOf(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CjSA3WIu.js","./index-CCMtfxHu.js","./index-CduAROfO.js","./index-DyYP_FJl.js","./index-DpKU3WC0.js","./index-CXTirSmg.js","./index-t6GJJU4Z.js","./index-BSYtQhGq.js","./index-B9VB8F4i.js","./index-CsKePgCu.js","./index-BW42zsbk.js","./index-CP_Zlo21.js","./index-B0YqEr4W.js","./index-CbmketnY.js","./index-Dw_1xL1F.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-DfB4wS6e.js","./index-w7hK1iP_.js","./index-DcjJamdO.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as at}from"./index-CCMtfxHu.js";function dKe(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 $C=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function el(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var VW={exports:{}},cN={};var $je;function P6t(){if($je)return cN;$je=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 cN.Fragment=t,cN.jsx=n,cN.jsxs=n,cN}var Dje;function M6t(){return Dje||(Dje=1,VW.exports=P6t()),VW.exports}var l=M6t(),HW={exports:{}},Ir={},Lje;function $6t(){if(Lje)return Ir;Lje=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,$,Z){this.props=V,this.context=$,this.refs=b,this.updater=Z||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 O(V,$,Z){this.props=V,this.context=$,this.refs=b,this.updater=Z||g}var E=O.prototype=new w;E.constructor=O,v(E,S.prototype),E.isPureReactComponent=!0;var _=Array.isArray;function C(){}var j={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function N(V,$,Z){var G=Z.ref;return{$$typeof:t,type:V,key:$,ref:G!==void 0?G:null,props:Z}}function R(V,$){return N(V.type,$,V.props)}function P(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function B(V){var $={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(Z){return $[Z]})}var M=/\/+/g;function L(V,$){return typeof V=="object"&&V!==null&&V.key!=null?B(""+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(C,C):(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,$,Z,G,K){var ne=typeof V;(ne==="undefined"||ne==="boolean")&&(V=null);var ee=!1;if(V===null)ee=!0;else switch(ne){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(V.$$typeof){case t:case n:ee=!0;break;case f:return ee=V._init,z(ee(V._payload),$,Z,G,K)}}if(ee)return K=K(V),ee=G===""?"."+L(V,0):G,_(K)?(Z="",ee!=null&&(Z=ee.replace(M,"$&/")+"/"),z(K,$,Z,"",function(ae){return ae})):K!=null&&(P(K)&&(K=R(K,Z+(K.key==null||V&&V.key===K.key?"":(""+K.key).replace(M,"$&/")+"/")+ee)),$.push(K)),1;ee=0;var J=G===""?".":G+":";if(_(V))for(var se=0;se<V.length;se++)G=V[se],ne=J+L(G,se),ee+=z(G,$,Z,ne,K);else if(se=m(V),typeof se=="function")for(V=se.call(V),se=0;!(G=V.next()).done;)G=G.value,ne=J+L(G,se++),ee+=z(G,$,Z,ne,K);else if(ne==="object"){if(typeof V.then=="function")return z(F(V),$,Z,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 ee}function U(V,$,Z){if(V==null)return V;var G=[],K=0;return z(V,G,"","",function(ne){return $.call(Z,ne,K++)}),G}function H(V){if(V._status===-1){var $=V._result;$=$(),$.then(function(Z){(V._status===0||V._status===-1)&&(V._status=1,V._result=Z)},function(Z){(V._status===0||V._status===-1)&&(V._status=2,V._result=Z)}),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:U,forEach:function(V,$,Z){U(V,function(){$.apply(this,arguments)},Z)},count:function(V){var $=0;return U(V,function(){$++}),$},toArray:function(V){return U(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 Ir.Activity=p,Ir.Children=Y,Ir.Component=S,Ir.Fragment=r,Ir.Profiler=a,Ir.PureComponent=O,Ir.StrictMode=s,Ir.Suspense=u,Ir.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Ir.__COMPILER_RUNTIME={__proto__:null,c:function(V){return j.H.useMemoCache(V)}},Ir.cache=function(V){return function(){return V.apply(null,arguments)}},Ir.cacheSignal=function(){return null},Ir.cloneElement=function(V,$,Z){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(ne in $.key!==void 0&&(K=""+$.key),$)!I.call($,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&$.ref===void 0||(G[ne]=$[ne]);var ne=arguments.length-2;if(ne===1)G.children=Z;else if(1<ne){for(var ee=Array(ne),J=0;J<ne;J++)ee[J]=arguments[J+2];G.children=ee}return N(V.type,K,G)},Ir.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},Ir.createElement=function(V,$,Z){var G,K={},ne=null;if($!=null)for(G in $.key!==void 0&&(ne=""+$.key),$)I.call($,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(K[G]=$[G]);var ee=arguments.length-2;if(ee===1)K.children=Z;else if(1<ee){for(var J=Array(ee),se=0;se<ee;se++)J[se]=arguments[se+2];K.children=J}if(V&&V.defaultProps)for(G in ee=V.defaultProps,ee)K[G]===void 0&&(K[G]=ee[G]);return N(V,ne,K)},Ir.createRef=function(){return{current:null}},Ir.forwardRef=function(V){return{$$typeof:c,render:V}},Ir.isValidElement=P,Ir.lazy=function(V){return{$$typeof:f,_payload:{_status:-1,_result:V},_init:H}},Ir.memo=function(V,$){return{$$typeof:d,type:V,compare:$===void 0?null:$}},Ir.startTransition=function(V){var $=j.T,Z={};j.T=Z;try{var G=V(),K=j.S;K!==null&&K(Z,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(C,D)}catch(ne){D(ne)}finally{$!==null&&Z.types!==null&&($.types=Z.types),j.T=$}},Ir.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ir.use=function(V){return j.H.use(V)},Ir.useActionState=function(V,$,Z){return j.H.useActionState(V,$,Z)},Ir.useCallback=function(V,$){return j.H.useCallback(V,$)},Ir.useContext=function(V){return j.H.useContext(V)},Ir.useDebugValue=function(){},Ir.useDeferredValue=function(V,$){return j.H.useDeferredValue(V,$)},Ir.useEffect=function(V,$){return j.H.useEffect(V,$)},Ir.useEffectEvent=function(V){return j.H.useEffectEvent(V)},Ir.useId=function(){return j.H.useId()},Ir.useImperativeHandle=function(V,$,Z){return j.H.useImperativeHandle(V,$,Z)},Ir.useInsertionEffect=function(V,$){return j.H.useInsertionEffect(V,$)},Ir.useLayoutEffect=function(V,$){return j.H.useLayoutEffect(V,$)},Ir.useMemo=function(V,$){return j.H.useMemo(V,$)},Ir.useOptimistic=function(V,$){return j.H.useOptimistic(V,$)},Ir.useReducer=function(V,$,Z){return j.H.useReducer(V,$,Z)},Ir.useRef=function(V){return j.H.useRef(V)},Ir.useState=function(V){return j.H.useState(V)},Ir.useSyncExternalStore=function(V,$,Z){return j.H.useSyncExternalStore(V,$,Z)},Ir.useTransition=function(){return j.H.useTransition()},Ir.version="19.2.6",Ir}var zje;function uj(){return zje||(zje=1,HW.exports=$6t()),HW.exports}var y=uj();const Ee=el(y),dj=dKe({__proto__:null,default:Ee},[y]);var ZW={exports:{}},uN={},WW={exports:{}},GW={};var Fje;function D6t(){return Fje||(Fje=1,(function(e){function t(F,z){var U=F.length;F.push(z);e:for(;0<U;){var H=U-1>>>1,D=F[H];if(0<s(D,z))F[H]=z,F[U]=D,U=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],U=F.pop();if(U!==z){F[0]=U;e:for(var H=0,D=F.length,Y=D>>>1;H<Y;){var V=2*(H+1)-1,$=F[V],Z=V+1,G=F[Z];if(0>s($,U))Z<D&&0>s(G,$)?(F[H]=G,F[Z]=U,H=Z):(F[H]=$,F[V]=U,H=V);else if(Z<D&&0>s(G,U))F[H]=G,F[Z]=U,H=Z;else break e}}return z}function s(F,z){var U=F.sortIndex-z.sortIndex;return U!==0?U: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 O(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 E(F){if(g=!1,O(F),!m)if(n(c)!==null)m=!0,_||(_=!0,P());else{var z=n(u);z!==null&&L(E,z.startTime-F)}}var _=!1,C=-1,j=5,I=-1;function N(){return v?!0:!(e.unstable_now()-I<j)}function R(){if(v=!1,_){var F=e.unstable_now();I=F;var z=!0;try{e:{m=!1,g&&(g=!1,S(C),C=-1),h=!0;var U=p;try{t:{for(O(F),f=n(c);f!==null&&!(f.expirationTime>F&&N());){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,O(F),z=!0;break t}f===n(c)&&r(c),O(F)}else r(c);f=n(c)}if(f!==null)z=!0;else{var Y=n(u);Y!==null&&L(E,Y.startTime-F),z=!1}}break e}finally{f=null,p=U,h=!1}z=void 0}}finally{z?P():_=!1}}}var P;if(typeof w=="function")P=function(){w(R)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,M=B.port2;B.port1.onmessage=R,P=function(){M.postMessage(null)}}else P=function(){b(R,0)};function L(F,z){C=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 U=p;p=z;try{return F()}finally{p=U}},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 U=p;p=F;try{return z()}finally{p=U}},e.unstable_scheduleCallback=function(F,z,U){var H=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?H+U:H):U=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=U+D,F={id:d++,callback:z,priorityLevel:F,startTime:U,expirationTime:D,sortIndex:-1},U>H?(F.sortIndex=U,t(u,F),n(c)===null&&F===n(u)&&(g?(S(C),C=-1):g=!0,L(E,U-H))):(F.sortIndex=D,t(c,F),m||h||(m=!0,_||(_=!0,P()))),F},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(F){var z=p;return function(){var U=p;p=z;try{return F.apply(this,arguments)}finally{p=U}}}})(GW)),GW}var Bje;function L6t(){return Bje||(Bje=1,WW.exports=D6t()),WW.exports}var QW={exports:{}},zc={};var Uje;function z6t(){if(Uje)return zc;Uje=1;var e=uj();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 qje;function fKe(){if(qje)return QW.exports;qje=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(),QW.exports=z6t(),QW.exports}var Vje;function F6t(){if(Vje)return uN;Vje=1;var e={env:{}};var t=L6t(),n=uj(),r=fKe();function s(x){var k="https://react.dev/errors/"+x;if(1<arguments.length){k+="?args[]="+encodeURIComponent(arguments[1]);for(var T=2;T<arguments.length;T++)k+="&args[]="+encodeURIComponent(arguments[T])}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,T=x;if(x.alternate)for(;k.return;)k=k.return;else{x=k;do k=x,(k.flags&4098)!==0&&(T=k.return),x=k.return;while(x)}return k.tag===3?T: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 T=x,A=k;;){var q=T.return;if(q===null)break;var W=q.alternate;if(W===null){if(A=q.return,A!==null){T=A;continue}break}if(q.child===W.child){for(W=q.child;W;){if(W===T)return u(q),x;if(W===A)return u(q),k;W=W.sibling}throw Error(s(188))}if(T.return!==A.return)T=q,A=W;else{for(var re=!1,me=q.child;me;){if(me===T){re=!0,T=q,A=W;break}if(me===A){re=!0,A=q,T=W;break}me=me.sibling}if(!re){for(me=W.child;me;){if(me===T){re=!0,T=W,A=q;break}if(me===A){re=!0,A=W,T=q;break}me=me.sibling}if(!re)throw Error(s(189))}}if(T.alternate!==A)throw Error(s(190))}if(T.tag!==3)throw Error(s(188));return T.stateNode.current===T?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"),O=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),R=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function B(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 _:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if(typeof x=="object")switch(x.$$typeof){case g:return"Portal";case O:return x.displayName||"Context";case w:return(x._context.displayName||"Context")+".Consumer";case E: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 I: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,U=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 Z(x,k){Y++,D[Y]=x.current,x.current=k}var G=V(null),K=V(null),ne=V(null),ee=V(null);function J(x,k){switch(Z(ne,k),Z(K,x),Z(G,null),k.nodeType){case 9:case 11:x=(x=k.documentElement)&&(x=x.namespaceURI)?aje(x):0;break;default:if(x=k.tagName,k=k.namespaceURI)k=aje(k),x=ije(k,x);else switch(x){case"svg":x=1;break;case"math":x=2;break;default:x=0}}$(G),Z(G,x)}function se(){$(G),$(K),$(ne)}function ae(x){x.memoizedState!==null&&Z(ee,x);var k=G.current,T=ije(k,x.type);k!==T&&(Z(K,x),Z(G,T))}function Q(x){K.current===x&&($(G),$(K)),ee.current===x&&($(ee),aN._currentValue=H)}var te,le;function fe(x){if(te===void 0)try{throw Error()}catch(T){var k=T.stack.trim().match(/\n( *(at )?)/);te=k&&k[1]||"",le=-1<T.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<T.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+te+x+le}var ce=!1;function ye(x,k){if(!x||ce)return"";ce=!0;var T=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var A={DetermineComponentFrameRoot:function(){try{if(k){var xt=function(){throw Error()};if(Object.defineProperty(xt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xt,[])}catch(lt){var et=lt}Reflect.construct(x,[],xt)}else{try{xt.call()}catch(lt){et=lt}x.call(xt.prototype)}}else{try{throw Error()}catch(lt){et=lt}(xt=x())&&typeof xt.catch=="function"&&xt.catch(function(){})}}catch(lt){if(lt&&et&&typeof lt.stack=="string")return[lt.stack,et.stack]}return[null,null]}};A.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var q=Object.getOwnPropertyDescriptor(A.DetermineComponentFrameRoot,"name");q&&q.configurable&&Object.defineProperty(A.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var W=A.DetermineComponentFrameRoot(),re=W[0],me=W[1];if(re&&me){var Ae=re.split(`
|
|
5
5
|
`),Xe=me.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"}),wd('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),wd('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],uot=zve.concat([wd("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),wd("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),wd("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),DPe=new dst,dot=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function CN(e){return(t,n)=>{let r=t.node.getChild("VariableDefinition");return r&&n(r,e),!0}}const Rfn=["FunctionDeclaration"],Pfn={FunctionDeclaration:CN("function"),ClassDeclaration:CN("class"),ClassExpression:()=>!0,EnumDeclaration:CN("constant"),TypeAliasDeclaration:CN("type"),NamespaceDeclaration:CN("namespace"),VariableDefinition(e,t){e.matchContext(Rfn)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function fot(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(Oa.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let o=Pfn[i.name];if(o&&o(i,a)||dot.has(i.name))return!1}else if(i.to-i.from>8192){for(let o of fot(e,i.node))r.push(o);return!1}}),DPe.set(t,r),r}const vF=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Fve=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function pot(e){let t=ri(e.state).resolveInner(e.pos,-1);if(Fve.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&vF.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let s=t;s;s=s.parent)dot.has(s.name)&&(r=r.concat(fot(e.state.doc,s)));return{options:r,from:n?t.from:e.pos,validFor:vF}}function yQ(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 hot(e){let t=r=>e.state.doc.sliceString(r.from,r.to),n=ri(e.state).resolveInner(e.pos,-1);return n.name=="PropertyName"?yQ(t,n.parent,t(n)):(n.name=="."||n.name=="?.")&&n.parent.name=="MemberExpression"?yQ(t,n.parent,""):Fve.indexOf(n.name)>-1?null:n.name=="VariableName"||n.to-n.from<20&&vF.test(t(n))?{path:[],name:t(n)}:n.name=="MemberExpression"?yQ(t,n,""):e.explicit?{path:[],name:""}:null}function Mfn(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 $fn(e){let t=new Map;return n=>{let r=hot(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=Mfn(s,!r.path.length)),{from:n.pos-r.name.length,options:a,validFor:vF}}}const fh=pk.define({name:"javascript",parser:Afn.configure({props:[wO.add({IfStatement:fC({except:/^\s*({|else\b)/}),TryStatement:fC({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Aln,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:Nln({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":fC({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}}),SO.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":bve,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:"$"}}),mot={test:e=>/^JSX/.test(e.name),facet:_B({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Bve=fh.configure({dialect:"ts"},"typescript"),Uve=fh.configure({dialect:"jsx",props:[gve.add(e=>e.isTop?[mot]:void 0)]}),qve=fh.configure({dialect:"jsx ts",props:[gve.add(e=>e.isTop?[mot]:void 0)]},"typescript");let got=e=>({label:e,type:"keyword"});const vot="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(got),Dfn=vot.concat(["declare","implements","private","protected","public"].map(got));function yF(e={}){let t=e.jsx?e.typescript?qve:Uve:e.typescript?Bve:fh,n=e.typescript?uot.concat(Dfn):zve.concat(vot);return new mk(t,[fh.data.of({autocomplete:vcn(Fve,fit(n))}),fh.data.of({autocomplete:pot}),e.jsx?yot:[]])}function Lfn(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 LPe(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 zfn=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),yot=St.inputHandler.of((e,t,n,r,s)=>{if((zfn?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=">"&&r!="/"||!fh.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,o=i.changeByRange(c=>{var u;let{head:d}=c,f=ri(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=LPe(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${p}>`;return{range:ft.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(r==">"){let h=Lfn(f);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(p=LPe(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 Ffn(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 fh.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(Bfn(u,r.doc,c))}return s}}function zPe(e,t,n,r){return n.line(e+r.line).from+t+(e==1?r.col-1:-1)}function Bfn(e,t,n){let r=zPe(e.line,e.column,t,n),s={from:r,to:e.endLine!=null&&e.endColumn!=1?zPe(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 aL=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:yot,completionPath:hot,esLint:Ffn,javascript:yF,javascriptLanguage:fh,jsxLanguage:Uve,localCompletionSource:pot,scopeCompletionSource:$fn,snippets:zve,tsxLanguage:qve,typescriptLanguage:Bve,typescriptSnippets:uot},Symbol.toStringTag,{value:"Module"})),TN=["_blank","_self","_top","_parent"],bQ=["ascii","utf-8","utf-16","latin1","latin1"],xQ=["get","post","put","delete"],wQ=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],vf=["true","false"],Gn={},Ufn={a:{attrs:{href:null,ping:null,type:null,media:null,target:TN,hreflang:null}},abbr:Gn,address:Gn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Gn,aside:Gn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Gn,base:{attrs:{href:null,target:TN}},bdi:Gn,bdo:Gn,blockquote:{attrs:{cite:null}},body:Gn,br:Gn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:wQ,formmethod:xQ,formnovalidate:["novalidate"],formtarget:TN,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Gn,center:Gn,cite:Gn,code:Gn,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:Gn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Gn,div:Gn,dl:Gn,dt:Gn,em:Gn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Gn,figure:Gn,footer:Gn,form:{attrs:{action:null,name:null,"accept-charset":bQ,autocomplete:["on","off"],enctype:wQ,method:xQ,novalidate:["novalidate"],target:TN}},h1:Gn,h2:Gn,h3:Gn,h4:Gn,h5:Gn,h6:Gn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Gn,hgroup:Gn,hr:Gn,html:{attrs:{manifest:null}},i:Gn,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:wQ,formmethod:xQ,formnovalidate:["novalidate"],formtarget:TN,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:Gn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Gn,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:Gn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:bQ,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:Gn,noscript:Gn,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:Gn,param:{attrs:{name:null,value:null}},pre:Gn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Gn,rt:Gn,ruby:Gn,samp:Gn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:bQ}},section:Gn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Gn,source:{attrs:{src:null,type:null,media:null}},span:Gn,strong:Gn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Gn,summary:Gn,sup:Gn,table:Gn,tbody:Gn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Gn,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:Gn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Gn,time:{attrs:{datetime:null}},title:Gn,tr:Gn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Gn,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:Gn},bot={accesskey:null,class:null,contenteditable:vf,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:vf,autocorrect:vf,autocapitalize:vf,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":vf,"aria-autocomplete":["inline","list","both","none"],"aria-busy":vf,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":vf,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":vf,"aria-hidden":vf,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":vf,"aria-multiselectable":vf,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":vf,"aria-relevant":null,"aria-required":vf,"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},xot="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 xot)bot[e]=null;let LP=class{constructor(t,n){this.tags={...Ufn,...t},this.globalAttrs={...bot,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};LP.default=new LP;function aT(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 iT(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function wot(e,t,n){let r=n.tags[aT(e,iT(t))];return r?.children||n.allTags}function Vve(e,t){let n=[];for(let r=iT(t);r&&!r.type.isTop;r=iT(r.parent)){let s=aT(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 Sot=/^[:\-\.\w\u00b7-\uffff]*$/;function FPe(e,t,n,r,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=iT(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:s,options:wot(e.doc,i,t).map(o=>({label:o,type:"type"})).concat(Vve(e.doc,n).map((o,c)=>({label:"/"+o,apply:"/"+o+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function BPe(e,t,n,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:Vve(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:Sot}}function qfn(e,t,n,r){let s=[],a=0;for(let i of wot(e.doc,n,t))s.push({label:"<"+i,type:"type"});for(let i of Vve(e.doc,n))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:r,to:r,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Vfn(e,t,n,r,s){let a=iT(n),i=a?t.tags[aT(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:Sot}}function Hfn(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=iT(n),p=f?t.tags[aT(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 kot(e,t){let{state:n,pos:r}=t,s=ri(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)?BPe(n,s,s.from,r):FPe(n,e,s,s.from,r):s.name=="StartTag"||s.name=="IncompleteTag"?FPe(n,e,s,r,r):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?BPe(n,s,r,r):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?Vfn(n,e,s,s.name=="AttributeName"?s.from:r,r):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?Hfn(n,e,s,s.name=="Is"?r:s.from,r):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?qfn(n,e,s,r):null}function Oot(e){return kot(LP.default,e)}function _ot(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new LP(t,n):LP.default;return s=>kot(r,s)}const Zfn=fh.parser.configure({top:"SingleExpression"}),Eot=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:Bve.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Uve.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:qve.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Zfn},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:fh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:DP.parser}],Cot=[{name:"style",parser:DP.parser.configure({top:"Styles"})}].concat(xot.map(e=>({name:e,parser:fh.parser}))),Tot=pk.define({name:"html",parser:wdn.configure({props:[wO.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}}),SO.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}}}),ait.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),bR=Tot.configure({wrap:eot(Eot,Cot)});function jot(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=eot((e.nestedLanguages||[]).concat(Eot),(e.nestedAttributes||[]).concat(Cot)));let r=n?Tot.configure({wrap:n,dialect:t}):t?bR.configure({dialect:t}):bR;return new mk(r,[bR.data.of({autocomplete:_ot(e)}),e.autoCloseTags!==!1?Iot:[],yF().support,lot().support])}const UPe=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Iot=St.inputHandler.of((e,t,n,r,s)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!bR.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=ri(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=aT(i.doc,v.parent,h))&&!UPe.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=aT(i.doc,v,h))&&!UPe.has(g)){let b=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`${g}>`;return{range:ft.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)}),Wfn=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Iot,html:jot,htmlCompletionSource:Oot,htmlCompletionSourceWith:_ot,htmlLanguage:bR},Symbol.toStringTag,{value:"Module"})),Not=_B({commentTokens:{block:{open:"<!--",close:"-->"}}}),Aot=new _r,Rot=kun.configure({props:[SO.add(e=>!e.is("Block")||e.is("Document")||xue(e)!=null||Gfn(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),Aot.add(xue),wO.add({Document:()=>null}),m0.add({Document:Not})]});function xue(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Gfn(e){return e.name=="OrderedList"||e.name=="BulletList"}function Qfn(e,t){let n=e;for(;;){let r=n.nextSibling,s;if(!r||(s=xue(r.type))!=null&&s<=t)break;n=r}return n.to}const Yfn=Wat.of((e,t,n)=>{for(let r=ri(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let s=r.type.prop(Aot);if(s==null)continue;let a=Qfn(r,s);if(a>n)return{from:n,to:a}}return null});function Hve(e){return new Bf(Not,e,[],"markdown")}const Pot=Hve(Rot),Xfn=Rot.configure([Pun,$un,Mun,Dun,{props:[SO.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),yk=Hve(Xfn);function Kfn(e,t){return n=>{if(n&&e){let r=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?r=e(n):r=nt.matchLanguageName(e,n,!0),r instanceof nt)return r.support?r.support.language.parser:hk.getSkippingParser(r.load());if(r)return r.parser}return t?t.parser:null}}class SQ{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(+$ot(this.item,t)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function Mot(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 SQ(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 SQ(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 SQ(a.parent,c,c+d,i[1],u,f,a))}}return r}function $ot(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function kQ(e,t,n,r=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let o=$ot(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 Zve(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(Ej)!=" ")return e;let r=Nm(e,4,n),s="";for(let a=r;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(n)}const Dot=(e={})=>({state:t,dispatch:n})=>{let r=ri(t),{doc:s}=t,a=null,i=t.changeByRange(o=>{if(!o.empty||!yk.isActiveAt(t,o.from,-1)&&!yk.isActiveAt(t,o.from,1))return a={range:o};let c=o.from,u=s.lineAt(c),d=Mot(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,E="";w&&w.item?(O=u.from+w.from,E=w.marker(s,1)):O=u.from+(w?w.to:0);let _=[{from:O,to:c,insert:E}];return f.node.name=="OrderedList"&&kQ(f.item,s,_,-2),w&&w.node.name=="OrderedList"&&kQ(w.item,s,_),{range:ft.cursor(O+E.length),changes:_}}else{let w=VPe(d,t,u);return{range:ft.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"&&kQ(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?Nm(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=Zve(g,t),Jfn(f.node,t.doc)&&(g=VPe(d,t,u)+t.lineBreak+g),h.push({from:v,to:c,insert:t.lineBreak+g}),{range:ft.cursor(v+g.length+1),changes:h}});return a?!1:(n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},Lot=Dot();function qPe(e){return e.name=="QuoteMark"||e.name=="ListMark"}function Jfn(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 VPe(e,t,n){let r="";for(let s=0,a=e.length-2;s<=a;s++)r+=e[s].blank(s<a?Nm(n.text,4,e[s+1].from)-r.length:null,s<a);return Zve(r,t)}function epn(e,t){let n=e.resolveInner(t,-1),r=t;qPe(n)&&(r=n.from,n=n.parent);for(let s;s=n.childBefore(r);)if(qPe(s))r=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")n=s.lastChild,r=n.to;else break;return n}const zot=({state:e,dispatch:t})=>{let n=ri(e),r=null,s=e.changeByRange(a=>{let i=a.from,{doc:o}=e;if(a.empty&&yk.isActiveAt(e,a.from)){let c=o.lineAt(i),u=Mot(epn(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:ft.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(Nm(c.text,4,d.to)-Nm(c.text,4,d.from));return p==c.from&&(h=Zve(h,e)),{range:ft.cursor(p+h.length),changes:{from:p,to:c.from+d.to,insert:h}}}if(p<i)return{range:ft.cursor(p),changes:{from:p,to:i}}}}}return r={range:a}});return r?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},Fot=[{key:"Enter",run:Lot},{key:"Backspace",run:zot}],Bot=jot({matchClosingTags:!1});function Wve(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:s}=Pot,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:o=Bot}=e;if(!(s instanceof jB))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[o.support,Yfn],d;i&&u.push(Uot),n instanceof mk?(u.push(n.support),d=n.language):n&&(d=n);let f=t||d?Kfn(t,d):void 0;c.push(_un({codeParser:f,htmlParser:o.language.parser})),r&&u.push(Zm.high(_j.of(Fot)));let p=Hve(s.configure(c));return a&&u.push(p.data.of({autocomplete:tpn})),new mk(p,u)}function tpn(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let s=ri(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:npn(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let OQ=null;function npn(){if(OQ)return OQ;let e=Oot(new kve(es.create({extensions:Bot}),0,!0));return OQ=e?e.options:[]}const rpn=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Uot=St.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),!yk.isActiveAt(t.state,r.from,1)))return!1;let a=ri(t.state),i=!1;return a.iterate({from:r.from,to:r.to,enter:o=>{(o.from>r.from||rpn.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)}}),spn=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:Pot,deleteMarkupBackward:zot,insertNewlineContinueMarkup:Lot,insertNewlineContinueMarkupCommand:Dot,markdown:Wve,markdownKeymap:Fot,markdownLanguage:yk,pasteURLAsLink:Uot},Symbol.toStringTag,{value:"Module"}));function kt(e){return new mk(xve.define(e))}function Nx(e){return at(()=>import("./index-CxmKUBmC.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const qot=[nt.of({name:"C",extensions:["c","h","ino"],load(){return at(()=>import("./index-Bt7FWeVy.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),nt.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return at(()=>import("./index-Bt7FWeVy.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),nt.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Nx("Cassandra")}}),nt.of({name:"CSS",extensions:["css"],load(){return at(()=>Promise.resolve().then(()=>tfn),void 0,import.meta.url).then(e=>e.css())}}),nt.of({name:"Go",extensions:["go"],load(){return at(()=>import("./index-DJRGlaRq.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.go())}}),nt.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return at(()=>Promise.resolve().then(()=>Wfn),void 0,import.meta.url).then(e=>e.html())}}),nt.of({name:"Java",extensions:["java"],load(){return at(()=>import("./index-DGYKLFP0.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),nt.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return at(()=>Promise.resolve().then(()=>aL),void 0,import.meta.url).then(e=>e.javascript())}}),nt.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return at(()=>import("./index-O0wBkvx7.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),nt.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return at(()=>Promise.resolve().then(()=>mcn),void 0,import.meta.url).then(e=>e.json())}}),nt.of({name:"JSX",extensions:["jsx"],load(){return at(()=>Promise.resolve().then(()=>aL),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),nt.of({name:"LESS",extensions:["less"],load(){return at(()=>import("./index-Cq-1GGqP.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),nt.of({name:"Liquid",extensions:["liquid"],load(){return at(()=>import("./index-lR9r49aF.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),nt.of({name:"MariaDB SQL",load(){return Nx("MariaSQL")}}),nt.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return at(()=>Promise.resolve().then(()=>spn),void 0,import.meta.url).then(e=>e.markdown())}}),nt.of({name:"MS SQL",load(){return Nx("MSSQL")}}),nt.of({name:"MySQL",load(){return Nx("MySQL")}}),nt.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return at(()=>import("./index-Dk8FtwwN.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),nt.of({name:"PLSQL",extensions:["pls"],load(){return Nx("PLSQL")}}),nt.of({name:"PostgreSQL",load(){return Nx("PostgreSQL")}}),nt.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return at(()=>import("./index-CLd1jyjj.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),nt.of({name:"Rust",extensions:["rs"],load(){return at(()=>import("./index-IJJMlwDq.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),nt.of({name:"Sass",extensions:["sass"],load(){return at(()=>import("./index-N_GK67CF.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),nt.of({name:"SCSS",extensions:["scss"],load(){return at(()=>import("./index-N_GK67CF.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),nt.of({name:"SQL",extensions:["sql"],load(){return Nx("StandardSQL")}}),nt.of({name:"SQLite",load(){return Nx("SQLite")}}),nt.of({name:"TSX",extensions:["tsx"],load(){return at(()=>Promise.resolve().then(()=>aL),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),nt.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return at(()=>Promise.resolve().then(()=>aL),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),nt.of({name:"WebAssembly",extensions:["wat","wast"],load(){return at(()=>import("./index-f6blmeem.js"),__vite__mapDeps([12,1]),import.meta.url).then(e=>e.wast())}}),nt.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return at(()=>import("./index-Dx1nb-Qd.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),nt.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return at(()=>import("./index-DJ0xFqTy.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),nt.of({name:"APL",extensions:["dyalog","apl"],load(){return at(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>kt(e.apl))}}),nt.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return at(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>kt(e.asciiArmor))}}),nt.of({name:"ASN.1",extensions:["asn","asn1"],load(){return at(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>kt(e.asn1({})))}}),nt.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return at(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>kt(e.asterisk))}}),nt.of({name:"Brainfuck",extensions:["b","bf"],load(){return at(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>kt(e.brainfuck))}}),nt.of({name:"Cobol",extensions:["cob","cpy"],load(){return at(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>kt(e.cobol))}}),nt.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return at(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>kt(e.csharp))}}),nt.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return at(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>kt(e.clojure))}}),nt.of({name:"ClojureScript",extensions:["cljs"],load(){return at(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>kt(e.clojure))}}),nt.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return at(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>kt(e.gss))}}),nt.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return at(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>kt(e.cmake))}}),nt.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return at(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>kt(e.coffeeScript))}}),nt.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return at(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>kt(e.commonLisp))}}),nt.of({name:"Cypher",extensions:["cyp","cypher"],load(){return at(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>kt(e.cypher))}}),nt.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return at(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>kt(e.cython))}}),nt.of({name:"Crystal",extensions:["cr"],load(){return at(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>kt(e.crystal))}}),nt.of({name:"D",extensions:["d"],load(){return at(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>kt(e.d))}}),nt.of({name:"Dart",extensions:["dart"],load(){return at(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>kt(e.dart))}}),nt.of({name:"diff",extensions:["diff","patch"],load(){return at(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>kt(e.diff))}}),nt.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return at(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>kt(e.dockerFile))}}),nt.of({name:"DTD",extensions:["dtd"],load(){return at(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>kt(e.dtd))}}),nt.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return at(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>kt(e.dylan))}}),nt.of({name:"EBNF",load(){return at(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>kt(e.ebnf))}}),nt.of({name:"ECL",extensions:["ecl"],load(){return at(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>kt(e.ecl))}}),nt.of({name:"edn",extensions:["edn"],load(){return at(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>kt(e.clojure))}}),nt.of({name:"Eiffel",extensions:["e"],load(){return at(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>kt(e.eiffel))}}),nt.of({name:"Elm",extensions:["elm"],load(){return at(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>kt(e.elm))}}),nt.of({name:"Erlang",extensions:["erl"],load(){return at(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>kt(e.erlang))}}),nt.of({name:"Esper",load(){return at(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>kt(e.esper))}}),nt.of({name:"Factor",extensions:["factor"],load(){return at(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>kt(e.factor))}}),nt.of({name:"FCL",load(){return at(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>kt(e.fcl))}}),nt.of({name:"Forth",extensions:["forth","fth","4th"],load(){return at(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>kt(e.forth))}}),nt.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return at(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>kt(e.fortran))}}),nt.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return at(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>kt(e.fSharp))}}),nt.of({name:"Gas",extensions:["s"],load(){return at(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>kt(e.gas))}}),nt.of({name:"Gherkin",extensions:["feature"],load(){return at(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>kt(e.gherkin))}}),nt.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return at(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>kt(e.groovy))}}),nt.of({name:"Haskell",extensions:["hs"],load(){return at(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>kt(e.haskell))}}),nt.of({name:"Haxe",extensions:["hx"],load(){return at(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>kt(e.haxe))}}),nt.of({name:"HXML",extensions:["hxml"],load(){return at(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>kt(e.hxml))}}),nt.of({name:"HTTP",load(){return at(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>kt(e.http))}}),nt.of({name:"IDL",extensions:["pro"],load(){return at(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>kt(e.idl))}}),nt.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return at(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>kt(e.jsonld))}}),nt.of({name:"Julia",extensions:["jl"],load(){return at(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>kt(e.julia))}}),nt.of({name:"Kotlin",extensions:["kt","kts"],load(){return at(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>kt(e.kotlin))}}),nt.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return at(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>kt(e.liveScript))}}),nt.of({name:"Lua",extensions:["lua"],load(){return at(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>kt(e.lua))}}),nt.of({name:"mIRC",extensions:["mrc"],load(){return at(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>kt(e.mirc))}}),nt.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return at(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>kt(e.mathematica))}}),nt.of({name:"Modelica",extensions:["mo"],load(){return at(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>kt(e.modelica))}}),nt.of({name:"MUMPS",extensions:["mps"],load(){return at(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>kt(e.mumps))}}),nt.of({name:"Mbox",extensions:["mbox"],load(){return at(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>kt(e.mbox))}}),nt.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return at(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>kt(e.nginx))}}),nt.of({name:"NSIS",extensions:["nsh","nsi"],load(){return at(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([18,16]),import.meta.url).then(e=>kt(e.nsis))}}),nt.of({name:"NTriples",extensions:["nt","nq"],load(){return at(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>kt(e.ntriples))}}),nt.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return at(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>kt(e.objectiveC))}}),nt.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return at(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>kt(e.objectiveCpp))}}),nt.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return at(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>kt(e.oCaml))}}),nt.of({name:"Octave",extensions:["m"],load(){return at(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>kt(e.octave))}}),nt.of({name:"Oz",extensions:["oz"],load(){return at(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>kt(e.oz))}}),nt.of({name:"Pascal",extensions:["p","pas"],load(){return at(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>kt(e.pascal))}}),nt.of({name:"Perl",extensions:["pl","pm"],load(){return at(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>kt(e.perl))}}),nt.of({name:"Pig",extensions:["pig"],load(){return at(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>kt(e.pig))}}),nt.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return at(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>kt(e.powerShell))}}),nt.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return at(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>kt(e.properties))}}),nt.of({name:"ProtoBuf",extensions:["proto"],load(){return at(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>kt(e.protobuf))}}),nt.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return at(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>kt(e.pug))}}),nt.of({name:"Puppet",extensions:["pp"],load(){return at(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>kt(e.puppet))}}),nt.of({name:"Q",extensions:["q"],load(){return at(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>kt(e.q))}}),nt.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return at(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>kt(e.r))}}),nt.of({name:"RPM Changes",load(){return at(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>kt(e.rpmChanges))}}),nt.of({name:"RPM Spec",extensions:["spec"],load(){return at(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>kt(e.rpmSpec))}}),nt.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return at(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>kt(e.ruby))}}),nt.of({name:"SAS",extensions:["sas"],load(){return at(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>kt(e.sas))}}),nt.of({name:"Scala",extensions:["scala"],load(){return at(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>kt(e.scala))}}),nt.of({name:"Scheme",extensions:["scm","ss"],load(){return at(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>kt(e.scheme))}}),nt.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return at(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>kt(e.shell))}}),nt.of({name:"Sieve",extensions:["siv","sieve"],load(){return at(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>kt(e.sieve))}}),nt.of({name:"Smalltalk",extensions:["st"],load(){return at(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>kt(e.smalltalk))}}),nt.of({name:"Solr",load(){return at(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>kt(e.solr))}}),nt.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return at(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>kt(e.sml))}}),nt.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return at(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>kt(e.sparql))}}),nt.of({name:"Spreadsheet",alias:["excel","formula"],load(){return at(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>kt(e.spreadsheet))}}),nt.of({name:"Squirrel",extensions:["nut"],load(){return at(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>kt(e.squirrel))}}),nt.of({name:"Stylus",extensions:["styl"],load(){return at(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>kt(e.stylus))}}),nt.of({name:"Swift",extensions:["swift"],load(){return at(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>kt(e.swift))}}),nt.of({name:"sTeX",load(){return at(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>kt(e.stex))}}),nt.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return at(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>kt(e.stex))}}),nt.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return at(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>kt(e.verilog))}}),nt.of({name:"Tcl",extensions:["tcl"],load(){return at(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>kt(e.tcl))}}),nt.of({name:"Textile",extensions:["textile"],load(){return at(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>kt(e.textile))}}),nt.of({name:"TiddlyWiki",load(){return at(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>kt(e.tiddlyWiki))}}),nt.of({name:"Tiki wiki",load(){return at(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>kt(e.tiki))}}),nt.of({name:"TOML",extensions:["toml"],load(){return at(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>kt(e.toml))}}),nt.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return at(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>kt(e.troff))}}),nt.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return at(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>kt(e.ttcn))}}),nt.of({name:"TTCN_CFG",extensions:["cfg"],load(){return at(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>kt(e.ttcnCfg))}}),nt.of({name:"Turtle",extensions:["ttl"],load(){return at(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>kt(e.turtle))}}),nt.of({name:"Web IDL",extensions:["webidl"],load(){return at(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>kt(e.webIDL))}}),nt.of({name:"VB.NET",extensions:["vb"],load(){return at(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>kt(e.vb))}}),nt.of({name:"VBScript",extensions:["vbs"],load(){return at(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>kt(e.vbScript))}}),nt.of({name:"Velocity",extensions:["vtl"],load(){return at(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>kt(e.velocity))}}),nt.of({name:"Verilog",extensions:["v"],load(){return at(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>kt(e.verilog))}}),nt.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return at(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>kt(e.vhdl))}}),nt.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return at(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>kt(e.xQuery))}}),nt.of({name:"Yacas",extensions:["ys"],load(){return at(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>kt(e.yacas))}}),nt.of({name:"Z80",extensions:["z80"],load(){return at(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>kt(e.z80))}}),nt.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return at(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>kt(e.mscgen))}}),nt.of({name:"Xù",extensions:["xu"],load(){return at(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>kt(e.xu))}}),nt.of({name:"MsGenny",extensions:["msgenny"],load(){return at(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>kt(e.msgenny))}}),nt.of({name:"Vue",extensions:["vue"],load(){return at(()=>import("./index-qajSBKss.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),nt.of({name:"Angular Template",load(){return at(()=>import("./index-BEkMUKAe.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];function zP(){return zP=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},zP.apply(null,arguments)}var apn=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=St.theme(s,{dark:t==="dark"}),c=Wm.define(r),u=[o,Lw(c)];return u},ipn={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)"},opn=[{tag:oe.comment,color:"#6272a4"},{tag:oe.string,color:"#f1fa8c"},{tag:oe.atom,color:"#bd93f9"},{tag:oe.meta,color:"#f8f8f2"},{tag:[oe.keyword,oe.operator,oe.tagName],color:"#ff79c6"},{tag:[oe.function(oe.propertyName),oe.propertyName],color:"#66d9ef"},{tag:[oe.definition(oe.variableName),oe.function(oe.variableName),oe.className,oe.attributeName],color:"#50fa7b"},{tag:oe.atom,color:"#bd93f9"}],Tj=e=>{var{theme:t="dark",settings:n={},styles:r=[]}=e||{};return apn({theme:t,settings:zP({},ipn,n),styles:[...opn,...r]})};Tj();function Vot(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 lpn=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Qve(e.state,n.from);return r.line?cpn(e):r.block?dpn(e):!1};function Gve(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 cpn=Gve(hpn,0),upn=Gve(Hot,0),dpn=Gve((e,t)=>Hot(e,t,ppn(t)),0);function Qve(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const jN=50;function fpn(e,{open:t,close:n},r,s){let a=e.sliceDoc(r-jN,r),i=e.sliceDoc(s,s+jN),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*jN?d=f=e.sliceDoc(r,s):(d=e.sliceDoc(r,r+jN),f=e.sliceDoc(s-jN,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 ppn(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 Hot(e,t,n=t.selection.ranges){let r=n.map(a=>Qve(t,a.from).block);if(!r.every(a=>a))return null;let s=n.map((a,i)=>fpn(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 hpn(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=Qve(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 wue=Rv.define(),mpn=Rv.define(),gpn=gn.define(),Zot=gn.define({combine(e){return Pv(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)})}}),Wot=tl.define({create(){return Hg.empty},update(e,t){let n=t.state.facet(Zot),r=t.annotation(wue);if(r){let c=Nd.fromTransaction(t,r.selection),u=r.side,d=u==0?e.undone:e.done;return c?d=bF(d,d.length,n.minDepth,c):d=Yot(d,t.startState.selection),new Hg(u==0?r.rest:d,u==0?d:r.rest)}let s=t.annotation(mpn);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(hl.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Nd.fromTransaction(t),i=t.annotation(hl.time),o=t.annotation(hl.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 Hg(e.done.map(Nd.fromJSON),e.undone.map(Nd.fromJSON))}});function vpn(e={}){return[Wot,Zot.of(e),St.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?Got:t.inputType=="historyRedo"?Sue:null;return r?(t.preventDefault(),r(n)):!1}})]}function IB(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let s=n.field(Wot,!1);if(!s)return!1;let a=s.pop(e,n,t);return a?(r(a),!0):!1}}const Got=IB(0,!1),Sue=IB(1,!1),ypn=IB(0,!0),bpn=IB(1,!0);class Nd{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 Nd(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 Nd(t.changes&&fl.fromJSON(t.changes),[],t.mapped&&sv.fromJSON(t.mapped),t.startSelection&&ft.fromJSON(t.startSelection),t.selectionsAfter.map(ft.fromJSON))}static fromTransaction(t,n){let r=th;for(let s of t.startState.facet(gpn)){let a=s(t);a.length&&(r=r.concat(a))}return!r.length&&t.changes.empty?null:new Nd(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,th)}static selection(t){return new Nd(void 0,th,void 0,void 0,t)}}function bF(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 xpn(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 wpn(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function Qot(e,t){return e.length?t.length?e.concat(t):e:t}const th=[],Spn=200;function Yot(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Spn));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),bF(e,e.length-1,1e9,n.setSelAfter(r)))}else return[Nd.selection([t])]}function kpn(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 _Q(e,t){if(!e.length)return e;let n=e.length,r=th;for(;n;){let s=Opn(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?[Nd.selection(r)]:th}function Opn(e,t,n){let r=Qot(e.selectionsAfter.length?e.selectionsAfter.map(o=>o.map(t)):th,n);if(!e.changes)return Nd.selection(r);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new Nd(s,mr.mapEffects(e.effects,t),i,e.startSelection.map(a),r)}const _pn=/^(input\.type|delete)($|\.)/;class Hg{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 Hg(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||_pn.test(r))&&(!o.selectionsAfter.length&&n-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,xpn(o.changes,t.changes))||r=="input.type.compose")?i=bF(i,i.length-1,s.minDepth,new Nd(t.changes.compose(o.changes),Qot(mr.mapEffects(t.effects,o.changes),o.effects),o.mapped,o.startSelection,th)):i=bF(i,i.length,s.minDepth,t),new Hg(i,th,n,r)}addSelection(t,n,r,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:th;return a.length>0&&n-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&wpn(a[a.length-1],t)?this:new Hg(Yot(this.done,t),this.undone,n,r)}addMapping(t){return new Hg(_Q(this.done,t),_Q(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:wue.of({side:t,rest:kpn(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let o=s.length==1?th:s.slice(0,s.length-1);return a.mapped&&(o=_Q(o,a.mapped)),n.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:wue.of({side:t,rest:o,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Hg.empty=new Hg(th,th);const Epn=[{key:"Mod-z",run:Got,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Sue,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Sue,preventDefault:!0},{key:"Mod-u",run:ypn,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:bpn,preventDefault:!0}];function jj(e,t){return ft.create(e.ranges.map(t),e.mainIndex)}function Gm(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Qm({state:e,dispatch:t},n){let r=jj(e.selection,n);return r.eq(e.selection,!0)?!1:(t(Gm(e,r)),!0)}function NB(e,t){return ft.cursor(t?e.to:e.from)}function Xot(e,t){return Qm(e,n=>n.empty?e.moveByChar(n,t):NB(n,t))}function Ou(e){return e.textDirectionAt(e.state.selection.main.head)==oi.LTR}const Kot=e=>Xot(e,!Ou(e)),Jot=e=>Xot(e,Ou(e));function elt(e,t){return Qm(e,n=>n.empty?e.moveByGroup(n,t):NB(n,t))}const Cpn=e=>elt(e,!Ou(e)),Tpn=e=>elt(e,Ou(e));function jpn(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 AB(e,t,n){let r=ri(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;jpn(e,u,s)?r=u:c=n?u.to:u.from}let a=r.type.prop(s),i,o;return a&&(i=n?Vg(e,r.from,1):Vg(e,r.to,-1))&&i.matched?o=n?i.end.to:i.end.from:o=n?r.to:r.from,ft.cursor(o,n?-1:1)}const Ipn=e=>Qm(e,t=>AB(e.state,t,!Ou(e))),Npn=e=>Qm(e,t=>AB(e.state,t,Ou(e)));function tlt(e,t){return Qm(e,n=>{if(!n.empty)return NB(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const nlt=e=>tlt(e,!1),rlt=e=>tlt(e,!0);function slt(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,s;if(t){for(let a of e.state.facet(St.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 alt(e,t){let n=slt(e),{state:r}=e,s=jj(r.selection,i=>i.empty?e.moveVertically(i,t,n.height):NB(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=St.scrollIntoView(s.main.head,{y:"start",yMargin:i.top-c}))}return e.dispatch(Gm(r,s),{effects:a}),!0}const HPe=e=>alt(e,!1),kue=e=>alt(e,!0);function zw(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=ft.cursor(r.from+a))}return s}const Apn=e=>Qm(e,t=>zw(e,t,!0)),Rpn=e=>Qm(e,t=>zw(e,t,!1)),Ppn=e=>Qm(e,t=>zw(e,t,!Ou(e))),Mpn=e=>Qm(e,t=>zw(e,t,Ou(e))),$pn=e=>Qm(e,t=>ft.cursor(e.lineBlockAt(t.head).from,1)),Dpn=e=>Qm(e,t=>ft.cursor(e.lineBlockAt(t.head).to,-1));function Lpn(e,t,n){let r=!1,s=jj(e.selection,a=>{let i=Vg(e,a.head,-1)||Vg(e,a.head,1)||a.head>0&&Vg(e,a.head-1,1)||a.head<e.doc.length&&Vg(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 ft.cursor(o)});return r?(t(Gm(e,s)),!0):!1}const zpn=({state:e,dispatch:t})=>Lpn(e,t);function Mh(e,t){let n=jj(e.state.selection,r=>{let s=t(r);return ft.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(Gm(e.state,n)),!0)}function ilt(e,t){return Mh(e,n=>e.moveByChar(n,t))}const olt=e=>ilt(e,!Ou(e)),llt=e=>ilt(e,Ou(e));function clt(e,t){return Mh(e,n=>e.moveByGroup(n,t))}const Fpn=e=>clt(e,!Ou(e)),Bpn=e=>clt(e,Ou(e)),Upn=e=>Mh(e,t=>AB(e.state,t,!Ou(e))),qpn=e=>Mh(e,t=>AB(e.state,t,Ou(e)));function ult(e,t){return Mh(e,n=>e.moveVertically(n,t))}const dlt=e=>ult(e,!1),flt=e=>ult(e,!0);function plt(e,t){return Mh(e,n=>e.moveVertically(n,t,slt(e).height))}const ZPe=e=>plt(e,!1),WPe=e=>plt(e,!0),Vpn=e=>Mh(e,t=>zw(e,t,!0)),Hpn=e=>Mh(e,t=>zw(e,t,!1)),Zpn=e=>Mh(e,t=>zw(e,t,!Ou(e))),Wpn=e=>Mh(e,t=>zw(e,t,Ou(e))),Gpn=e=>Mh(e,t=>ft.cursor(e.lineBlockAt(t.head).from)),Qpn=e=>Mh(e,t=>ft.cursor(e.lineBlockAt(t.head).to)),GPe=({state:e,dispatch:t})=>(t(Gm(e,{anchor:0})),!0),QPe=({state:e,dispatch:t})=>(t(Gm(e,{anchor:e.doc.length})),!0),YPe=({state:e,dispatch:t})=>(t(Gm(e,{anchor:e.selection.main.anchor,head:0})),!0),XPe=({state:e,dispatch:t})=>(t(Gm(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Ypn=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Xpn=({state:e,dispatch:t})=>{let n=RB(e).map(({from:r,to:s})=>ft.range(r,Math.min(s+1,e.doc.length)));return t(e.update({selection:ft.create(n),userEvent:"select"})),!0},Kpn=({state:e,dispatch:t})=>{let n=jj(e.selection,r=>{let s=ri(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 ft.range(o.to,o.from)}return r});return n.eq(e.selection)?!1:(t(Gm(e,n)),!0)};function hlt(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(Gm(n,ft.create(s,s.length-1))),!0)}const Jpn=e=>hlt(e,!1),ehn=e=>hlt(e,!0),thn=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=ft.create([n.main]):n.main.empty||(r=ft.create([ft.cursor(n.main.head)])),r?(t(Gm(e,r)),!0):!1};function u$(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=iL(e,c,!1)):c>i&&(n="delete.forward",c=iL(e,c,!0)),i=Math.min(i,c),o=Math.max(o,c)}else i=iL(e,i,!1),o=iL(e,o,!0);return i==o?{range:a}:{changes:{from:i,to:o},range:ft.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"?St.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function iL(e,t,n){if(e instanceof St)for(let r of e.state.facet(St.atomicRanges).map(s=>s(e)))r.between(t,t,(s,a)=>{s<t&&a>t&&(t=n?a:s)});return t}const mlt=(e,t,n)=>u$(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=Nm(o,a.tabSize),d=u%gk(a)||gk(a);for(let f=0;f<d&&o[o.length-1-f]==" ";f++)s--;c=s}else c=Xl(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=Xl(i.text,c-i.from,!1,!1)+i.from);return c}),Oue=e=>mlt(e,!1,!0),glt=e=>mlt(e,!0,!1),vlt=(e,t)=>u$(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=Xl(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}),ylt=e=>vlt(e,!1),nhn=e=>vlt(e,!0),rhn=e=>u$(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),shn=e=>u$(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),ahn=e=>u$(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),ihn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:la.of(["",""])},range:ft.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},ohn=({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:Xl(a.text,s-a.from,!1)+a.from,o=s==a.to?s+1:Xl(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:ft.cursor(o)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function RB(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 blt(e,t,n){if(e.readOnly)return!1;let r=[],s=[];for(let a of RB(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(ft.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(ft.range(c.anchor-o,c.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:ft.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const lhn=({state:e,dispatch:t})=>blt(e,t,!1),chn=({state:e,dispatch:t})=>blt(e,t,!0);function xlt(e,t,n){if(e.readOnly)return!1;let r=[];for(let a of RB(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 uhn=({state:e,dispatch:t})=>xlt(e,t,!1),dhn=({state:e,dispatch:t})=>xlt(e,t,!0),fhn=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(RB(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),r=jj(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 phn(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=ri(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 KPe=wlt(!1),hhn=wlt(!0);function wlt(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&&phn(t,a);e&&(a=i=(i<=o.to?o:t.doc.lineAt(i)).to);let u=new EB(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=vve(u,a);for(d==null&&(d=Nm(/^\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=["",jP(t,d)];return c&&f.push(jP(t,u.lineIndent(o.from,-1))),{changes:{from:a,to:i,insert:la.of(f)},range:ft.cursor(a+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Yve(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:ft.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}const mhn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new EB(e,{overrideIndentation:a=>{let i=n[a];return i??-1}}),s=Yve(e,(a,i,o)=>{let c=vve(r,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=jP(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},Slt=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Yve(e,(n,r)=>{r.push({from:n.from,insert:e.facet(Ej)})}),{userEvent:"input.indent"})),!0),klt=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Yve(e,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let a=Nm(s,e.tabSize),i=0,o=jP(e,Math.max(0,a-gk(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),ghn=e=>(e.setTabFocusMode(),!0),vhn=[{key:"Ctrl-b",run:Kot,shift:olt,preventDefault:!0},{key:"Ctrl-f",run:Jot,shift:llt},{key:"Ctrl-p",run:nlt,shift:dlt},{key:"Ctrl-n",run:rlt,shift:flt},{key:"Ctrl-a",run:$pn,shift:Gpn},{key:"Ctrl-e",run:Dpn,shift:Qpn},{key:"Ctrl-d",run:glt},{key:"Ctrl-h",run:Oue},{key:"Ctrl-k",run:rhn},{key:"Ctrl-Alt-h",run:ylt},{key:"Ctrl-o",run:ihn},{key:"Ctrl-t",run:ohn},{key:"Ctrl-v",run:kue}],yhn=[{key:"ArrowLeft",run:Kot,shift:olt,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Cpn,shift:Fpn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Ppn,shift:Zpn,preventDefault:!0},{key:"ArrowRight",run:Jot,shift:llt,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Tpn,shift:Bpn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Mpn,shift:Wpn,preventDefault:!0},{key:"ArrowUp",run:nlt,shift:dlt,preventDefault:!0},{mac:"Cmd-ArrowUp",run:GPe,shift:YPe},{mac:"Ctrl-ArrowUp",run:HPe,shift:ZPe},{key:"ArrowDown",run:rlt,shift:flt,preventDefault:!0},{mac:"Cmd-ArrowDown",run:QPe,shift:XPe},{mac:"Ctrl-ArrowDown",run:kue,shift:WPe},{key:"PageUp",run:HPe,shift:ZPe},{key:"PageDown",run:kue,shift:WPe},{key:"Home",run:Rpn,shift:Hpn,preventDefault:!0},{key:"Mod-Home",run:GPe,shift:YPe},{key:"End",run:Apn,shift:Vpn,preventDefault:!0},{key:"Mod-End",run:QPe,shift:XPe},{key:"Enter",run:KPe,shift:KPe},{key:"Mod-a",run:Ypn},{key:"Backspace",run:Oue,shift:Oue,preventDefault:!0},{key:"Delete",run:glt,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ylt,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:nhn,preventDefault:!0},{mac:"Mod-Backspace",run:shn,preventDefault:!0},{mac:"Mod-Delete",run:ahn,preventDefault:!0}].concat(vhn.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),bhn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Ipn,shift:Upn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Npn,shift:qpn},{key:"Alt-ArrowUp",run:lhn},{key:"Shift-Alt-ArrowUp",run:uhn},{key:"Alt-ArrowDown",run:chn},{key:"Shift-Alt-ArrowDown",run:dhn},{key:"Mod-Alt-ArrowUp",run:Jpn},{key:"Mod-Alt-ArrowDown",run:ehn},{key:"Escape",run:thn},{key:"Mod-Enter",run:hhn},{key:"Alt-l",mac:"Ctrl-l",run:Xpn},{key:"Mod-i",run:Kpn,preventDefault:!0},{key:"Mod-[",run:klt},{key:"Mod-]",run:Slt},{key:"Mod-Alt-\\",run:mhn},{key:"Shift-Mod-k",run:fhn},{key:"Shift-Mod-\\",run:zpn},{key:"Mod-/",run:lpn},{key:"Alt-A",run:upn},{key:"Ctrl-m",mac:"Shift-Alt-m",run:ghn}].concat(yhn),xhn={key:"Tab",run:Slt,shift:klt},JPe=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class pb{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(JPe(o)):JPe,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 _d(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=Kge(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=Ag(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"&&(pb.prototype[Symbol.iterator]=function(){return this});const Olt={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Xve="gm"+(/x/.unicode==null?"":"u");class _lt{constructor(t,n,r,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=Olt,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new Elt(t,n,r,s,a);this.re=new RegExp(n,Xve+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=xF(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=xF(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 EQ=new WeakMap;class hC{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let s=EQ.get(t);if(!s||s.from>=r||s.to<=n){let o=new hC(n,t.sliceString(n,r));return EQ.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)),EQ.set(t,new hC(i,a)),new hC(n,a.slice(n-i,r-i))}}class Elt{constructor(t,n,r,s,a){this.text=t,this.to=a,this.done=!1,this.value=Olt,this.matchPos=xF(t,s),this.re=new RegExp(n,Xve+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=hC.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=xF(this.text,s+(r==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=hC.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(_lt.prototype[Symbol.iterator]=Elt.prototype[Symbol.iterator]=function(){return this});function whn(e){try{return new RegExp(e,Xve),!0}catch{return!1}}function xF(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 Shn=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:s}=lln(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=ft.cursor(m.from+Math.max(0,Math.min(p,m.length)));e.dispatch({effects:[r,St.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},khn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ohn=gn.define({combine(e){return Pv(e,khn,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function _hn(e){return[Ihn,jhn]}const Ehn=xn.mark({class:"cm-selectionMatch"}),Chn=xn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function e2e(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=Zi.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=Zi.Word)}function Thn(e,t,n,r){return e(t.sliceDoc(n,n+1))==Zi.Word&&e(t.sliceDoc(r-1,r))==Zi.Word}const jhn=Qi.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(Ohn),{state:n}=e,r=n.selection;if(r.ranges.length>1)return xn.none;let s=r.main,a,i=null;if(s.empty){if(!t.highlightWordAroundCursor)return xn.none;let c=n.wordAt(s.head);if(!c)return xn.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 xn.none;if(t.wholeWords){if(a=n.sliceDoc(s.from,s.to),i=n.charCategorizer(s.head),!(e2e(i,n,s.from,s.to)&&Thn(i,n,s.from,s.to)))return xn.none}else if(a=n.sliceDoc(s.from,s.to),!a)return xn.none}let o=[];for(let c of e.visibleRanges){let u=new pb(n.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||e2e(i,n,d,f))&&(s.empty&&d<=s.from&&f>=s.to?o.push(Chn.range(d,f)):(d>=s.to||f<=s.from)&&o.push(Ehn.range(d,f)),o.length>t.maxMatches))return xn.none}}return xn.set(o)}},{decorations:e=>e.decorations}),Ihn=St.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Nhn=({state:e,dispatch:t})=>{let{selection:n}=e,r=ft.create(n.ranges.map(s=>e.wordAt(s.head)||ft.cursor(s.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Ahn(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 pb(e.doc,t,r[r.length-1].to);;)if(o.next(),o.done){if(i)return null;o=new pb(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 Rhn=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(a=>a.from===a.to))return Nhn({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=Ahn(e,r);return s?(t(e.update({selection:e.selection.addRange(ft.range(s.from,s.to),!1),effects:St.scrollIntoView(s.to)})),!0):!1},Ij=gn.define({combine(e){return Pv(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new Whn(t),scrollToMatch:t=>St.scrollIntoView(t)})}});class Clt{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||whn(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"}),wd('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),wd('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],uot=zve.concat([wd("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),wd("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),wd("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),DPe=new dst,dot=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function CN(e){return(t,n)=>{let r=t.node.getChild("VariableDefinition");return r&&n(r,e),!0}}const Rfn=["FunctionDeclaration"],Pfn={FunctionDeclaration:CN("function"),ClassDeclaration:CN("class"),ClassExpression:()=>!0,EnumDeclaration:CN("constant"),TypeAliasDeclaration:CN("type"),NamespaceDeclaration:CN("namespace"),VariableDefinition(e,t){e.matchContext(Rfn)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function fot(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(Oa.IncludeAnonymous).iterate(i=>{if(s)s=!1;else if(i.name){let o=Pfn[i.name];if(o&&o(i,a)||dot.has(i.name))return!1}else if(i.to-i.from>8192){for(let o of fot(e,i.node))r.push(o);return!1}}),DPe.set(t,r),r}const vF=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Fve=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function pot(e){let t=ri(e.state).resolveInner(e.pos,-1);if(Fve.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&vF.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let s=t;s;s=s.parent)dot.has(s.name)&&(r=r.concat(fot(e.state.doc,s)));return{options:r,from:n?t.from:e.pos,validFor:vF}}function yQ(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 hot(e){let t=r=>e.state.doc.sliceString(r.from,r.to),n=ri(e.state).resolveInner(e.pos,-1);return n.name=="PropertyName"?yQ(t,n.parent,t(n)):(n.name=="."||n.name=="?.")&&n.parent.name=="MemberExpression"?yQ(t,n.parent,""):Fve.indexOf(n.name)>-1?null:n.name=="VariableName"||n.to-n.from<20&&vF.test(t(n))?{path:[],name:t(n)}:n.name=="MemberExpression"?yQ(t,n,""):e.explicit?{path:[],name:""}:null}function Mfn(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 $fn(e){let t=new Map;return n=>{let r=hot(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=Mfn(s,!r.path.length)),{from:n.pos-r.name.length,options:a,validFor:vF}}}const fh=pk.define({name:"javascript",parser:Afn.configure({props:[wO.add({IfStatement:fC({except:/^\s*({|else\b)/}),TryStatement:fC({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Aln,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:Nln({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":fC({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}}),SO.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":bve,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:"$"}}),mot={test:e=>/^JSX/.test(e.name),facet:_B({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Bve=fh.configure({dialect:"ts"},"typescript"),Uve=fh.configure({dialect:"jsx",props:[gve.add(e=>e.isTop?[mot]:void 0)]}),qve=fh.configure({dialect:"jsx ts",props:[gve.add(e=>e.isTop?[mot]:void 0)]},"typescript");let got=e=>({label:e,type:"keyword"});const vot="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(got),Dfn=vot.concat(["declare","implements","private","protected","public"].map(got));function yF(e={}){let t=e.jsx?e.typescript?qve:Uve:e.typescript?Bve:fh,n=e.typescript?uot.concat(Dfn):zve.concat(vot);return new mk(t,[fh.data.of({autocomplete:vcn(Fve,fit(n))}),fh.data.of({autocomplete:pot}),e.jsx?yot:[]])}function Lfn(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 LPe(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 zfn=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),yot=St.inputHandler.of((e,t,n,r,s)=>{if((zfn?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=">"&&r!="/"||!fh.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:i}=a,o=i.changeByRange(c=>{var u;let{head:d}=c,f=ri(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=LPe(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${p}>`;return{range:ft.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(r==">"){let h=Lfn(f);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(p=LPe(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 Ffn(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 fh.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(Bfn(u,r.doc,c))}return s}}function zPe(e,t,n,r){return n.line(e+r.line).from+t+(e==1?r.col-1:-1)}function Bfn(e,t,n){let r=zPe(e.line,e.column,t,n),s={from:r,to:e.endLine!=null&&e.endColumn!=1?zPe(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 aL=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:yot,completionPath:hot,esLint:Ffn,javascript:yF,javascriptLanguage:fh,jsxLanguage:Uve,localCompletionSource:pot,scopeCompletionSource:$fn,snippets:zve,tsxLanguage:qve,typescriptLanguage:Bve,typescriptSnippets:uot},Symbol.toStringTag,{value:"Module"})),TN=["_blank","_self","_top","_parent"],bQ=["ascii","utf-8","utf-16","latin1","latin1"],xQ=["get","post","put","delete"],wQ=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],vf=["true","false"],Gn={},Ufn={a:{attrs:{href:null,ping:null,type:null,media:null,target:TN,hreflang:null}},abbr:Gn,address:Gn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Gn,aside:Gn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Gn,base:{attrs:{href:null,target:TN}},bdi:Gn,bdo:Gn,blockquote:{attrs:{cite:null}},body:Gn,br:Gn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:wQ,formmethod:xQ,formnovalidate:["novalidate"],formtarget:TN,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Gn,center:Gn,cite:Gn,code:Gn,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:Gn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Gn,div:Gn,dl:Gn,dt:Gn,em:Gn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Gn,figure:Gn,footer:Gn,form:{attrs:{action:null,name:null,"accept-charset":bQ,autocomplete:["on","off"],enctype:wQ,method:xQ,novalidate:["novalidate"],target:TN}},h1:Gn,h2:Gn,h3:Gn,h4:Gn,h5:Gn,h6:Gn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Gn,hgroup:Gn,hr:Gn,html:{attrs:{manifest:null}},i:Gn,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:wQ,formmethod:xQ,formnovalidate:["novalidate"],formtarget:TN,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:Gn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Gn,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:Gn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:bQ,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:Gn,noscript:Gn,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:Gn,param:{attrs:{name:null,value:null}},pre:Gn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Gn,rt:Gn,ruby:Gn,samp:Gn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:bQ}},section:Gn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Gn,source:{attrs:{src:null,type:null,media:null}},span:Gn,strong:Gn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Gn,summary:Gn,sup:Gn,table:Gn,tbody:Gn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Gn,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:Gn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Gn,time:{attrs:{datetime:null}},title:Gn,tr:Gn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Gn,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:Gn},bot={accesskey:null,class:null,contenteditable:vf,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:vf,autocorrect:vf,autocapitalize:vf,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":vf,"aria-autocomplete":["inline","list","both","none"],"aria-busy":vf,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":vf,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":vf,"aria-hidden":vf,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":vf,"aria-multiselectable":vf,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":vf,"aria-relevant":null,"aria-required":vf,"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},xot="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 xot)bot[e]=null;let LP=class{constructor(t,n){this.tags={...Ufn,...t},this.globalAttrs={...bot,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};LP.default=new LP;function aT(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 iT(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function wot(e,t,n){let r=n.tags[aT(e,iT(t))];return r?.children||n.allTags}function Vve(e,t){let n=[];for(let r=iT(t);r&&!r.type.isTop;r=iT(r.parent)){let s=aT(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 Sot=/^[:\-\.\w\u00b7-\uffff]*$/;function FPe(e,t,n,r,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",i=iT(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:s,options:wot(e.doc,i,t).map(o=>({label:o,type:"type"})).concat(Vve(e.doc,n).map((o,c)=>({label:"/"+o,apply:"/"+o+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function BPe(e,t,n,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:Vve(e.doc,t).map((a,i)=>({label:a,apply:a+s,type:"type",boost:99-i})),validFor:Sot}}function qfn(e,t,n,r){let s=[],a=0;for(let i of wot(e.doc,n,t))s.push({label:"<"+i,type:"type"});for(let i of Vve(e.doc,n))s.push({label:"</"+i+">",type:"type",boost:99-a++});return{from:r,to:r,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Vfn(e,t,n,r,s){let a=iT(n),i=a?t.tags[aT(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:Sot}}function Hfn(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=iT(n),p=f?t.tags[aT(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 kot(e,t){let{state:n,pos:r}=t,s=ri(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)?BPe(n,s,s.from,r):FPe(n,e,s,s.from,r):s.name=="StartTag"||s.name=="IncompleteTag"?FPe(n,e,s,r,r):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?BPe(n,s,r,r):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?Vfn(n,e,s,s.name=="AttributeName"?s.from:r,r):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?Hfn(n,e,s,s.name=="Is"?r:s.from,r):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?qfn(n,e,s,r):null}function Oot(e){return kot(LP.default,e)}function _ot(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new LP(t,n):LP.default;return s=>kot(r,s)}const Zfn=fh.parser.configure({top:"SingleExpression"}),Eot=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:Bve.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Uve.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:qve.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Zfn},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:fh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:DP.parser}],Cot=[{name:"style",parser:DP.parser.configure({top:"Styles"})}].concat(xot.map(e=>({name:e,parser:fh.parser}))),Tot=pk.define({name:"html",parser:wdn.configure({props:[wO.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}}),SO.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}}}),ait.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),bR=Tot.configure({wrap:eot(Eot,Cot)});function jot(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=eot((e.nestedLanguages||[]).concat(Eot),(e.nestedAttributes||[]).concat(Cot)));let r=n?Tot.configure({wrap:n,dialect:t}):t?bR.configure({dialect:t}):bR;return new mk(r,[bR.data.of({autocomplete:_ot(e)}),e.autoCloseTags!==!1?Iot:[],yF().support,lot().support])}const UPe=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Iot=St.inputHandler.of((e,t,n,r,s)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!bR.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=ri(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=aT(i.doc,v.parent,h))&&!UPe.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=aT(i.doc,v,h))&&!UPe.has(g)){let b=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`${g}>`;return{range:ft.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)}),Wfn=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Iot,html:jot,htmlCompletionSource:Oot,htmlCompletionSourceWith:_ot,htmlLanguage:bR},Symbol.toStringTag,{value:"Module"})),Not=_B({commentTokens:{block:{open:"<!--",close:"-->"}}}),Aot=new _r,Rot=kun.configure({props:[SO.add(e=>!e.is("Block")||e.is("Document")||xue(e)!=null||Gfn(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),Aot.add(xue),wO.add({Document:()=>null}),m0.add({Document:Not})]});function xue(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Gfn(e){return e.name=="OrderedList"||e.name=="BulletList"}function Qfn(e,t){let n=e;for(;;){let r=n.nextSibling,s;if(!r||(s=xue(r.type))!=null&&s<=t)break;n=r}return n.to}const Yfn=Wat.of((e,t,n)=>{for(let r=ri(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let s=r.type.prop(Aot);if(s==null)continue;let a=Qfn(r,s);if(a>n)return{from:n,to:a}}return null});function Hve(e){return new Bf(Not,e,[],"markdown")}const Pot=Hve(Rot),Xfn=Rot.configure([Pun,$un,Mun,Dun,{props:[SO.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),yk=Hve(Xfn);function Kfn(e,t){return n=>{if(n&&e){let r=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?r=e(n):r=nt.matchLanguageName(e,n,!0),r instanceof nt)return r.support?r.support.language.parser:hk.getSkippingParser(r.load());if(r)return r.parser}return t?t.parser:null}}class SQ{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(+$ot(this.item,t)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function Mot(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 SQ(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 SQ(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 SQ(a.parent,c,c+d,i[1],u,f,a))}}return r}function $ot(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function kQ(e,t,n,r=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let o=$ot(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 Zve(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(Ej)!=" ")return e;let r=Nm(e,4,n),s="";for(let a=r;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(n)}const Dot=(e={})=>({state:t,dispatch:n})=>{let r=ri(t),{doc:s}=t,a=null,i=t.changeByRange(o=>{if(!o.empty||!yk.isActiveAt(t,o.from,-1)&&!yk.isActiveAt(t,o.from,1))return a={range:o};let c=o.from,u=s.lineAt(c),d=Mot(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,E="";w&&w.item?(O=u.from+w.from,E=w.marker(s,1)):O=u.from+(w?w.to:0);let _=[{from:O,to:c,insert:E}];return f.node.name=="OrderedList"&&kQ(f.item,s,_,-2),w&&w.node.name=="OrderedList"&&kQ(w.item,s,_),{range:ft.cursor(O+E.length),changes:_}}else{let w=VPe(d,t,u);return{range:ft.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"&&kQ(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?Nm(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=Zve(g,t),Jfn(f.node,t.doc)&&(g=VPe(d,t,u)+t.lineBreak+g),h.push({from:v,to:c,insert:t.lineBreak+g}),{range:ft.cursor(v+g.length+1),changes:h}});return a?!1:(n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},Lot=Dot();function qPe(e){return e.name=="QuoteMark"||e.name=="ListMark"}function Jfn(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 VPe(e,t,n){let r="";for(let s=0,a=e.length-2;s<=a;s++)r+=e[s].blank(s<a?Nm(n.text,4,e[s+1].from)-r.length:null,s<a);return Zve(r,t)}function epn(e,t){let n=e.resolveInner(t,-1),r=t;qPe(n)&&(r=n.from,n=n.parent);for(let s;s=n.childBefore(r);)if(qPe(s))r=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")n=s.lastChild,r=n.to;else break;return n}const zot=({state:e,dispatch:t})=>{let n=ri(e),r=null,s=e.changeByRange(a=>{let i=a.from,{doc:o}=e;if(a.empty&&yk.isActiveAt(e,a.from)){let c=o.lineAt(i),u=Mot(epn(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:ft.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(Nm(c.text,4,d.to)-Nm(c.text,4,d.from));return p==c.from&&(h=Zve(h,e)),{range:ft.cursor(p+h.length),changes:{from:p,to:c.from+d.to,insert:h}}}if(p<i)return{range:ft.cursor(p),changes:{from:p,to:i}}}}}return r={range:a}});return r?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},Fot=[{key:"Enter",run:Lot},{key:"Backspace",run:zot}],Bot=jot({matchClosingTags:!1});function Wve(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:s}=Pot,completeHTMLTags:a=!0,pasteURLAsLink:i=!0,htmlTagLanguage:o=Bot}=e;if(!(s instanceof jB))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[o.support,Yfn],d;i&&u.push(Uot),n instanceof mk?(u.push(n.support),d=n.language):n&&(d=n);let f=t||d?Kfn(t,d):void 0;c.push(_un({codeParser:f,htmlParser:o.language.parser})),r&&u.push(Zm.high(_j.of(Fot)));let p=Hve(s.configure(c));return a&&u.push(p.data.of({autocomplete:tpn})),new mk(p,u)}function tpn(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let s=ri(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:npn(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let OQ=null;function npn(){if(OQ)return OQ;let e=Oot(new kve(es.create({extensions:Bot}),0,!0));return OQ=e?e.options:[]}const rpn=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Uot=St.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),!yk.isActiveAt(t.state,r.from,1)))return!1;let a=ri(t.state),i=!1;return a.iterate({from:r.from,to:r.to,enter:o=>{(o.from>r.from||rpn.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)}}),spn=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:Pot,deleteMarkupBackward:zot,insertNewlineContinueMarkup:Lot,insertNewlineContinueMarkupCommand:Dot,markdown:Wve,markdownKeymap:Fot,markdownLanguage:yk,pasteURLAsLink:Uot},Symbol.toStringTag,{value:"Module"}));function kt(e){return new mk(xve.define(e))}function Nx(e){return at(()=>import("./index-CjSA3WIu.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const qot=[nt.of({name:"C",extensions:["c","h","ino"],load(){return at(()=>import("./index-CduAROfO.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),nt.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return at(()=>import("./index-CduAROfO.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),nt.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Nx("Cassandra")}}),nt.of({name:"CSS",extensions:["css"],load(){return at(()=>Promise.resolve().then(()=>tfn),void 0,import.meta.url).then(e=>e.css())}}),nt.of({name:"Go",extensions:["go"],load(){return at(()=>import("./index-DyYP_FJl.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.go())}}),nt.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return at(()=>Promise.resolve().then(()=>Wfn),void 0,import.meta.url).then(e=>e.html())}}),nt.of({name:"Java",extensions:["java"],load(){return at(()=>import("./index-DpKU3WC0.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),nt.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return at(()=>Promise.resolve().then(()=>aL),void 0,import.meta.url).then(e=>e.javascript())}}),nt.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return at(()=>import("./index-CXTirSmg.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),nt.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return at(()=>Promise.resolve().then(()=>mcn),void 0,import.meta.url).then(e=>e.json())}}),nt.of({name:"JSX",extensions:["jsx"],load(){return at(()=>Promise.resolve().then(()=>aL),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),nt.of({name:"LESS",extensions:["less"],load(){return at(()=>import("./index-t6GJJU4Z.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),nt.of({name:"Liquid",extensions:["liquid"],load(){return at(()=>import("./index-BSYtQhGq.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),nt.of({name:"MariaDB SQL",load(){return Nx("MariaSQL")}}),nt.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return at(()=>Promise.resolve().then(()=>spn),void 0,import.meta.url).then(e=>e.markdown())}}),nt.of({name:"MS SQL",load(){return Nx("MSSQL")}}),nt.of({name:"MySQL",load(){return Nx("MySQL")}}),nt.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return at(()=>import("./index-B9VB8F4i.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),nt.of({name:"PLSQL",extensions:["pls"],load(){return Nx("PLSQL")}}),nt.of({name:"PostgreSQL",load(){return Nx("PostgreSQL")}}),nt.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return at(()=>import("./index-CsKePgCu.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),nt.of({name:"Rust",extensions:["rs"],load(){return at(()=>import("./index-BW42zsbk.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),nt.of({name:"Sass",extensions:["sass"],load(){return at(()=>import("./index-CP_Zlo21.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),nt.of({name:"SCSS",extensions:["scss"],load(){return at(()=>import("./index-CP_Zlo21.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),nt.of({name:"SQL",extensions:["sql"],load(){return Nx("StandardSQL")}}),nt.of({name:"SQLite",load(){return Nx("SQLite")}}),nt.of({name:"TSX",extensions:["tsx"],load(){return at(()=>Promise.resolve().then(()=>aL),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),nt.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return at(()=>Promise.resolve().then(()=>aL),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),nt.of({name:"WebAssembly",extensions:["wat","wast"],load(){return at(()=>import("./index-B0YqEr4W.js"),__vite__mapDeps([12,1]),import.meta.url).then(e=>e.wast())}}),nt.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return at(()=>import("./index-CbmketnY.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),nt.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return at(()=>import("./index-Dw_1xL1F.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),nt.of({name:"APL",extensions:["dyalog","apl"],load(){return at(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>kt(e.apl))}}),nt.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return at(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>kt(e.asciiArmor))}}),nt.of({name:"ASN.1",extensions:["asn","asn1"],load(){return at(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>kt(e.asn1({})))}}),nt.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return at(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>kt(e.asterisk))}}),nt.of({name:"Brainfuck",extensions:["b","bf"],load(){return at(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>kt(e.brainfuck))}}),nt.of({name:"Cobol",extensions:["cob","cpy"],load(){return at(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>kt(e.cobol))}}),nt.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return at(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>kt(e.csharp))}}),nt.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return at(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>kt(e.clojure))}}),nt.of({name:"ClojureScript",extensions:["cljs"],load(){return at(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>kt(e.clojure))}}),nt.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return at(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>kt(e.gss))}}),nt.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return at(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>kt(e.cmake))}}),nt.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return at(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>kt(e.coffeeScript))}}),nt.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return at(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>kt(e.commonLisp))}}),nt.of({name:"Cypher",extensions:["cyp","cypher"],load(){return at(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>kt(e.cypher))}}),nt.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return at(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>kt(e.cython))}}),nt.of({name:"Crystal",extensions:["cr"],load(){return at(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>kt(e.crystal))}}),nt.of({name:"D",extensions:["d"],load(){return at(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>kt(e.d))}}),nt.of({name:"Dart",extensions:["dart"],load(){return at(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>kt(e.dart))}}),nt.of({name:"diff",extensions:["diff","patch"],load(){return at(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>kt(e.diff))}}),nt.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return at(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>kt(e.dockerFile))}}),nt.of({name:"DTD",extensions:["dtd"],load(){return at(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>kt(e.dtd))}}),nt.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return at(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>kt(e.dylan))}}),nt.of({name:"EBNF",load(){return at(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>kt(e.ebnf))}}),nt.of({name:"ECL",extensions:["ecl"],load(){return at(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>kt(e.ecl))}}),nt.of({name:"edn",extensions:["edn"],load(){return at(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>kt(e.clojure))}}),nt.of({name:"Eiffel",extensions:["e"],load(){return at(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>kt(e.eiffel))}}),nt.of({name:"Elm",extensions:["elm"],load(){return at(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>kt(e.elm))}}),nt.of({name:"Erlang",extensions:["erl"],load(){return at(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>kt(e.erlang))}}),nt.of({name:"Esper",load(){return at(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>kt(e.esper))}}),nt.of({name:"Factor",extensions:["factor"],load(){return at(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>kt(e.factor))}}),nt.of({name:"FCL",load(){return at(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>kt(e.fcl))}}),nt.of({name:"Forth",extensions:["forth","fth","4th"],load(){return at(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>kt(e.forth))}}),nt.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return at(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>kt(e.fortran))}}),nt.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return at(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>kt(e.fSharp))}}),nt.of({name:"Gas",extensions:["s"],load(){return at(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>kt(e.gas))}}),nt.of({name:"Gherkin",extensions:["feature"],load(){return at(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>kt(e.gherkin))}}),nt.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return at(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>kt(e.groovy))}}),nt.of({name:"Haskell",extensions:["hs"],load(){return at(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>kt(e.haskell))}}),nt.of({name:"Haxe",extensions:["hx"],load(){return at(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>kt(e.haxe))}}),nt.of({name:"HXML",extensions:["hxml"],load(){return at(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>kt(e.hxml))}}),nt.of({name:"HTTP",load(){return at(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>kt(e.http))}}),nt.of({name:"IDL",extensions:["pro"],load(){return at(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>kt(e.idl))}}),nt.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return at(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>kt(e.jsonld))}}),nt.of({name:"Julia",extensions:["jl"],load(){return at(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>kt(e.julia))}}),nt.of({name:"Kotlin",extensions:["kt","kts"],load(){return at(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>kt(e.kotlin))}}),nt.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return at(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>kt(e.liveScript))}}),nt.of({name:"Lua",extensions:["lua"],load(){return at(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>kt(e.lua))}}),nt.of({name:"mIRC",extensions:["mrc"],load(){return at(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>kt(e.mirc))}}),nt.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return at(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>kt(e.mathematica))}}),nt.of({name:"Modelica",extensions:["mo"],load(){return at(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>kt(e.modelica))}}),nt.of({name:"MUMPS",extensions:["mps"],load(){return at(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>kt(e.mumps))}}),nt.of({name:"Mbox",extensions:["mbox"],load(){return at(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>kt(e.mbox))}}),nt.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return at(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>kt(e.nginx))}}),nt.of({name:"NSIS",extensions:["nsh","nsi"],load(){return at(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([18,16]),import.meta.url).then(e=>kt(e.nsis))}}),nt.of({name:"NTriples",extensions:["nt","nq"],load(){return at(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>kt(e.ntriples))}}),nt.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return at(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>kt(e.objectiveC))}}),nt.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return at(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>kt(e.objectiveCpp))}}),nt.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return at(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>kt(e.oCaml))}}),nt.of({name:"Octave",extensions:["m"],load(){return at(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>kt(e.octave))}}),nt.of({name:"Oz",extensions:["oz"],load(){return at(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>kt(e.oz))}}),nt.of({name:"Pascal",extensions:["p","pas"],load(){return at(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>kt(e.pascal))}}),nt.of({name:"Perl",extensions:["pl","pm"],load(){return at(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>kt(e.perl))}}),nt.of({name:"Pig",extensions:["pig"],load(){return at(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>kt(e.pig))}}),nt.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return at(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>kt(e.powerShell))}}),nt.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return at(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>kt(e.properties))}}),nt.of({name:"ProtoBuf",extensions:["proto"],load(){return at(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>kt(e.protobuf))}}),nt.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return at(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>kt(e.pug))}}),nt.of({name:"Puppet",extensions:["pp"],load(){return at(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>kt(e.puppet))}}),nt.of({name:"Q",extensions:["q"],load(){return at(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>kt(e.q))}}),nt.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return at(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>kt(e.r))}}),nt.of({name:"RPM Changes",load(){return at(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>kt(e.rpmChanges))}}),nt.of({name:"RPM Spec",extensions:["spec"],load(){return at(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>kt(e.rpmSpec))}}),nt.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return at(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>kt(e.ruby))}}),nt.of({name:"SAS",extensions:["sas"],load(){return at(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>kt(e.sas))}}),nt.of({name:"Scala",extensions:["scala"],load(){return at(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>kt(e.scala))}}),nt.of({name:"Scheme",extensions:["scm","ss"],load(){return at(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>kt(e.scheme))}}),nt.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return at(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>kt(e.shell))}}),nt.of({name:"Sieve",extensions:["siv","sieve"],load(){return at(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>kt(e.sieve))}}),nt.of({name:"Smalltalk",extensions:["st"],load(){return at(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>kt(e.smalltalk))}}),nt.of({name:"Solr",load(){return at(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>kt(e.solr))}}),nt.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return at(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>kt(e.sml))}}),nt.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return at(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>kt(e.sparql))}}),nt.of({name:"Spreadsheet",alias:["excel","formula"],load(){return at(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>kt(e.spreadsheet))}}),nt.of({name:"Squirrel",extensions:["nut"],load(){return at(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>kt(e.squirrel))}}),nt.of({name:"Stylus",extensions:["styl"],load(){return at(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>kt(e.stylus))}}),nt.of({name:"Swift",extensions:["swift"],load(){return at(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>kt(e.swift))}}),nt.of({name:"sTeX",load(){return at(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>kt(e.stex))}}),nt.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return at(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>kt(e.stex))}}),nt.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return at(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>kt(e.verilog))}}),nt.of({name:"Tcl",extensions:["tcl"],load(){return at(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>kt(e.tcl))}}),nt.of({name:"Textile",extensions:["textile"],load(){return at(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>kt(e.textile))}}),nt.of({name:"TiddlyWiki",load(){return at(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>kt(e.tiddlyWiki))}}),nt.of({name:"Tiki wiki",load(){return at(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>kt(e.tiki))}}),nt.of({name:"TOML",extensions:["toml"],load(){return at(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>kt(e.toml))}}),nt.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return at(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>kt(e.troff))}}),nt.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return at(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>kt(e.ttcn))}}),nt.of({name:"TTCN_CFG",extensions:["cfg"],load(){return at(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>kt(e.ttcnCfg))}}),nt.of({name:"Turtle",extensions:["ttl"],load(){return at(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>kt(e.turtle))}}),nt.of({name:"Web IDL",extensions:["webidl"],load(){return at(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>kt(e.webIDL))}}),nt.of({name:"VB.NET",extensions:["vb"],load(){return at(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>kt(e.vb))}}),nt.of({name:"VBScript",extensions:["vbs"],load(){return at(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>kt(e.vbScript))}}),nt.of({name:"Velocity",extensions:["vtl"],load(){return at(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>kt(e.velocity))}}),nt.of({name:"Verilog",extensions:["v"],load(){return at(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>kt(e.verilog))}}),nt.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return at(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>kt(e.vhdl))}}),nt.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return at(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>kt(e.xQuery))}}),nt.of({name:"Yacas",extensions:["ys"],load(){return at(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>kt(e.yacas))}}),nt.of({name:"Z80",extensions:["z80"],load(){return at(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>kt(e.z80))}}),nt.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return at(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>kt(e.mscgen))}}),nt.of({name:"Xù",extensions:["xu"],load(){return at(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>kt(e.xu))}}),nt.of({name:"MsGenny",extensions:["msgenny"],load(){return at(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>kt(e.msgenny))}}),nt.of({name:"Vue",extensions:["vue"],load(){return at(()=>import("./index-DfB4wS6e.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),nt.of({name:"Angular Template",load(){return at(()=>import("./index-w7hK1iP_.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];function zP(){return zP=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},zP.apply(null,arguments)}var apn=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=St.theme(s,{dark:t==="dark"}),c=Wm.define(r),u=[o,Lw(c)];return u},ipn={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)"},opn=[{tag:oe.comment,color:"#6272a4"},{tag:oe.string,color:"#f1fa8c"},{tag:oe.atom,color:"#bd93f9"},{tag:oe.meta,color:"#f8f8f2"},{tag:[oe.keyword,oe.operator,oe.tagName],color:"#ff79c6"},{tag:[oe.function(oe.propertyName),oe.propertyName],color:"#66d9ef"},{tag:[oe.definition(oe.variableName),oe.function(oe.variableName),oe.className,oe.attributeName],color:"#50fa7b"},{tag:oe.atom,color:"#bd93f9"}],Tj=e=>{var{theme:t="dark",settings:n={},styles:r=[]}=e||{};return apn({theme:t,settings:zP({},ipn,n),styles:[...opn,...r]})};Tj();function Vot(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 lpn=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Qve(e.state,n.from);return r.line?cpn(e):r.block?dpn(e):!1};function Gve(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 cpn=Gve(hpn,0),upn=Gve(Hot,0),dpn=Gve((e,t)=>Hot(e,t,ppn(t)),0);function Qve(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const jN=50;function fpn(e,{open:t,close:n},r,s){let a=e.sliceDoc(r-jN,r),i=e.sliceDoc(s,s+jN),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*jN?d=f=e.sliceDoc(r,s):(d=e.sliceDoc(r,r+jN),f=e.sliceDoc(s-jN,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 ppn(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 Hot(e,t,n=t.selection.ranges){let r=n.map(a=>Qve(t,a.from).block);if(!r.every(a=>a))return null;let s=n.map((a,i)=>fpn(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 hpn(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=Qve(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 wue=Rv.define(),mpn=Rv.define(),gpn=gn.define(),Zot=gn.define({combine(e){return Pv(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)})}}),Wot=tl.define({create(){return Hg.empty},update(e,t){let n=t.state.facet(Zot),r=t.annotation(wue);if(r){let c=Nd.fromTransaction(t,r.selection),u=r.side,d=u==0?e.undone:e.done;return c?d=bF(d,d.length,n.minDepth,c):d=Yot(d,t.startState.selection),new Hg(u==0?r.rest:d,u==0?d:r.rest)}let s=t.annotation(mpn);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(hl.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Nd.fromTransaction(t),i=t.annotation(hl.time),o=t.annotation(hl.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 Hg(e.done.map(Nd.fromJSON),e.undone.map(Nd.fromJSON))}});function vpn(e={}){return[Wot,Zot.of(e),St.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?Got:t.inputType=="historyRedo"?Sue:null;return r?(t.preventDefault(),r(n)):!1}})]}function IB(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let s=n.field(Wot,!1);if(!s)return!1;let a=s.pop(e,n,t);return a?(r(a),!0):!1}}const Got=IB(0,!1),Sue=IB(1,!1),ypn=IB(0,!0),bpn=IB(1,!0);class Nd{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 Nd(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 Nd(t.changes&&fl.fromJSON(t.changes),[],t.mapped&&sv.fromJSON(t.mapped),t.startSelection&&ft.fromJSON(t.startSelection),t.selectionsAfter.map(ft.fromJSON))}static fromTransaction(t,n){let r=th;for(let s of t.startState.facet(gpn)){let a=s(t);a.length&&(r=r.concat(a))}return!r.length&&t.changes.empty?null:new Nd(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,th)}static selection(t){return new Nd(void 0,th,void 0,void 0,t)}}function bF(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 xpn(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 wpn(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function Qot(e,t){return e.length?t.length?e.concat(t):e:t}const th=[],Spn=200;function Yot(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Spn));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),bF(e,e.length-1,1e9,n.setSelAfter(r)))}else return[Nd.selection([t])]}function kpn(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 _Q(e,t){if(!e.length)return e;let n=e.length,r=th;for(;n;){let s=Opn(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?[Nd.selection(r)]:th}function Opn(e,t,n){let r=Qot(e.selectionsAfter.length?e.selectionsAfter.map(o=>o.map(t)):th,n);if(!e.changes)return Nd.selection(r);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(a):a;return new Nd(s,mr.mapEffects(e.effects,t),i,e.startSelection.map(a),r)}const _pn=/^(input\.type|delete)($|\.)/;class Hg{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 Hg(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||_pn.test(r))&&(!o.selectionsAfter.length&&n-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,xpn(o.changes,t.changes))||r=="input.type.compose")?i=bF(i,i.length-1,s.minDepth,new Nd(t.changes.compose(o.changes),Qot(mr.mapEffects(t.effects,o.changes),o.effects),o.mapped,o.startSelection,th)):i=bF(i,i.length,s.minDepth,t),new Hg(i,th,n,r)}addSelection(t,n,r,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:th;return a.length>0&&n-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&wpn(a[a.length-1],t)?this:new Hg(Yot(this.done,t),this.undone,n,r)}addMapping(t){return new Hg(_Q(this.done,t),_Q(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:wue.of({side:t,rest:kpn(s),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let o=s.length==1?th:s.slice(0,s.length-1);return a.mapped&&(o=_Q(o,a.mapped)),n.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:wue.of({side:t,rest:o,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Hg.empty=new Hg(th,th);const Epn=[{key:"Mod-z",run:Got,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Sue,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Sue,preventDefault:!0},{key:"Mod-u",run:ypn,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:bpn,preventDefault:!0}];function jj(e,t){return ft.create(e.ranges.map(t),e.mainIndex)}function Gm(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Qm({state:e,dispatch:t},n){let r=jj(e.selection,n);return r.eq(e.selection,!0)?!1:(t(Gm(e,r)),!0)}function NB(e,t){return ft.cursor(t?e.to:e.from)}function Xot(e,t){return Qm(e,n=>n.empty?e.moveByChar(n,t):NB(n,t))}function Ou(e){return e.textDirectionAt(e.state.selection.main.head)==oi.LTR}const Kot=e=>Xot(e,!Ou(e)),Jot=e=>Xot(e,Ou(e));function elt(e,t){return Qm(e,n=>n.empty?e.moveByGroup(n,t):NB(n,t))}const Cpn=e=>elt(e,!Ou(e)),Tpn=e=>elt(e,Ou(e));function jpn(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 AB(e,t,n){let r=ri(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;jpn(e,u,s)?r=u:c=n?u.to:u.from}let a=r.type.prop(s),i,o;return a&&(i=n?Vg(e,r.from,1):Vg(e,r.to,-1))&&i.matched?o=n?i.end.to:i.end.from:o=n?r.to:r.from,ft.cursor(o,n?-1:1)}const Ipn=e=>Qm(e,t=>AB(e.state,t,!Ou(e))),Npn=e=>Qm(e,t=>AB(e.state,t,Ou(e)));function tlt(e,t){return Qm(e,n=>{if(!n.empty)return NB(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const nlt=e=>tlt(e,!1),rlt=e=>tlt(e,!0);function slt(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,s;if(t){for(let a of e.state.facet(St.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 alt(e,t){let n=slt(e),{state:r}=e,s=jj(r.selection,i=>i.empty?e.moveVertically(i,t,n.height):NB(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=St.scrollIntoView(s.main.head,{y:"start",yMargin:i.top-c}))}return e.dispatch(Gm(r,s),{effects:a}),!0}const HPe=e=>alt(e,!1),kue=e=>alt(e,!0);function zw(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=ft.cursor(r.from+a))}return s}const Apn=e=>Qm(e,t=>zw(e,t,!0)),Rpn=e=>Qm(e,t=>zw(e,t,!1)),Ppn=e=>Qm(e,t=>zw(e,t,!Ou(e))),Mpn=e=>Qm(e,t=>zw(e,t,Ou(e))),$pn=e=>Qm(e,t=>ft.cursor(e.lineBlockAt(t.head).from,1)),Dpn=e=>Qm(e,t=>ft.cursor(e.lineBlockAt(t.head).to,-1));function Lpn(e,t,n){let r=!1,s=jj(e.selection,a=>{let i=Vg(e,a.head,-1)||Vg(e,a.head,1)||a.head>0&&Vg(e,a.head-1,1)||a.head<e.doc.length&&Vg(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 ft.cursor(o)});return r?(t(Gm(e,s)),!0):!1}const zpn=({state:e,dispatch:t})=>Lpn(e,t);function Mh(e,t){let n=jj(e.state.selection,r=>{let s=t(r);return ft.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(Gm(e.state,n)),!0)}function ilt(e,t){return Mh(e,n=>e.moveByChar(n,t))}const olt=e=>ilt(e,!Ou(e)),llt=e=>ilt(e,Ou(e));function clt(e,t){return Mh(e,n=>e.moveByGroup(n,t))}const Fpn=e=>clt(e,!Ou(e)),Bpn=e=>clt(e,Ou(e)),Upn=e=>Mh(e,t=>AB(e.state,t,!Ou(e))),qpn=e=>Mh(e,t=>AB(e.state,t,Ou(e)));function ult(e,t){return Mh(e,n=>e.moveVertically(n,t))}const dlt=e=>ult(e,!1),flt=e=>ult(e,!0);function plt(e,t){return Mh(e,n=>e.moveVertically(n,t,slt(e).height))}const ZPe=e=>plt(e,!1),WPe=e=>plt(e,!0),Vpn=e=>Mh(e,t=>zw(e,t,!0)),Hpn=e=>Mh(e,t=>zw(e,t,!1)),Zpn=e=>Mh(e,t=>zw(e,t,!Ou(e))),Wpn=e=>Mh(e,t=>zw(e,t,Ou(e))),Gpn=e=>Mh(e,t=>ft.cursor(e.lineBlockAt(t.head).from)),Qpn=e=>Mh(e,t=>ft.cursor(e.lineBlockAt(t.head).to)),GPe=({state:e,dispatch:t})=>(t(Gm(e,{anchor:0})),!0),QPe=({state:e,dispatch:t})=>(t(Gm(e,{anchor:e.doc.length})),!0),YPe=({state:e,dispatch:t})=>(t(Gm(e,{anchor:e.selection.main.anchor,head:0})),!0),XPe=({state:e,dispatch:t})=>(t(Gm(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Ypn=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Xpn=({state:e,dispatch:t})=>{let n=RB(e).map(({from:r,to:s})=>ft.range(r,Math.min(s+1,e.doc.length)));return t(e.update({selection:ft.create(n),userEvent:"select"})),!0},Kpn=({state:e,dispatch:t})=>{let n=jj(e.selection,r=>{let s=ri(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 ft.range(o.to,o.from)}return r});return n.eq(e.selection)?!1:(t(Gm(e,n)),!0)};function hlt(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(Gm(n,ft.create(s,s.length-1))),!0)}const Jpn=e=>hlt(e,!1),ehn=e=>hlt(e,!0),thn=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=ft.create([n.main]):n.main.empty||(r=ft.create([ft.cursor(n.main.head)])),r?(t(Gm(e,r)),!0):!1};function u$(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=iL(e,c,!1)):c>i&&(n="delete.forward",c=iL(e,c,!0)),i=Math.min(i,c),o=Math.max(o,c)}else i=iL(e,i,!1),o=iL(e,o,!0);return i==o?{range:a}:{changes:{from:i,to:o},range:ft.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"?St.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function iL(e,t,n){if(e instanceof St)for(let r of e.state.facet(St.atomicRanges).map(s=>s(e)))r.between(t,t,(s,a)=>{s<t&&a>t&&(t=n?a:s)});return t}const mlt=(e,t,n)=>u$(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=Nm(o,a.tabSize),d=u%gk(a)||gk(a);for(let f=0;f<d&&o[o.length-1-f]==" ";f++)s--;c=s}else c=Xl(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=Xl(i.text,c-i.from,!1,!1)+i.from);return c}),Oue=e=>mlt(e,!1,!0),glt=e=>mlt(e,!0,!1),vlt=(e,t)=>u$(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=Xl(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}),ylt=e=>vlt(e,!1),nhn=e=>vlt(e,!0),rhn=e=>u$(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),shn=e=>u$(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),ahn=e=>u$(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),ihn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:la.of(["",""])},range:ft.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},ohn=({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:Xl(a.text,s-a.from,!1)+a.from,o=s==a.to?s+1:Xl(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:ft.cursor(o)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function RB(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 blt(e,t,n){if(e.readOnly)return!1;let r=[],s=[];for(let a of RB(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(ft.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(ft.range(c.anchor-o,c.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:ft.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const lhn=({state:e,dispatch:t})=>blt(e,t,!1),chn=({state:e,dispatch:t})=>blt(e,t,!0);function xlt(e,t,n){if(e.readOnly)return!1;let r=[];for(let a of RB(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 uhn=({state:e,dispatch:t})=>xlt(e,t,!1),dhn=({state:e,dispatch:t})=>xlt(e,t,!0),fhn=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(RB(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),r=jj(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 phn(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=ri(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 KPe=wlt(!1),hhn=wlt(!0);function wlt(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&&phn(t,a);e&&(a=i=(i<=o.to?o:t.doc.lineAt(i)).to);let u=new EB(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=vve(u,a);for(d==null&&(d=Nm(/^\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=["",jP(t,d)];return c&&f.push(jP(t,u.lineIndent(o.from,-1))),{changes:{from:a,to:i,insert:la.of(f)},range:ft.cursor(a+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Yve(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:ft.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}const mhn=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new EB(e,{overrideIndentation:a=>{let i=n[a];return i??-1}}),s=Yve(e,(a,i,o)=>{let c=vve(r,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=jP(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},Slt=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Yve(e,(n,r)=>{r.push({from:n.from,insert:e.facet(Ej)})}),{userEvent:"input.indent"})),!0),klt=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Yve(e,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let a=Nm(s,e.tabSize),i=0,o=jP(e,Math.max(0,a-gk(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),ghn=e=>(e.setTabFocusMode(),!0),vhn=[{key:"Ctrl-b",run:Kot,shift:olt,preventDefault:!0},{key:"Ctrl-f",run:Jot,shift:llt},{key:"Ctrl-p",run:nlt,shift:dlt},{key:"Ctrl-n",run:rlt,shift:flt},{key:"Ctrl-a",run:$pn,shift:Gpn},{key:"Ctrl-e",run:Dpn,shift:Qpn},{key:"Ctrl-d",run:glt},{key:"Ctrl-h",run:Oue},{key:"Ctrl-k",run:rhn},{key:"Ctrl-Alt-h",run:ylt},{key:"Ctrl-o",run:ihn},{key:"Ctrl-t",run:ohn},{key:"Ctrl-v",run:kue}],yhn=[{key:"ArrowLeft",run:Kot,shift:olt,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Cpn,shift:Fpn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Ppn,shift:Zpn,preventDefault:!0},{key:"ArrowRight",run:Jot,shift:llt,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Tpn,shift:Bpn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Mpn,shift:Wpn,preventDefault:!0},{key:"ArrowUp",run:nlt,shift:dlt,preventDefault:!0},{mac:"Cmd-ArrowUp",run:GPe,shift:YPe},{mac:"Ctrl-ArrowUp",run:HPe,shift:ZPe},{key:"ArrowDown",run:rlt,shift:flt,preventDefault:!0},{mac:"Cmd-ArrowDown",run:QPe,shift:XPe},{mac:"Ctrl-ArrowDown",run:kue,shift:WPe},{key:"PageUp",run:HPe,shift:ZPe},{key:"PageDown",run:kue,shift:WPe},{key:"Home",run:Rpn,shift:Hpn,preventDefault:!0},{key:"Mod-Home",run:GPe,shift:YPe},{key:"End",run:Apn,shift:Vpn,preventDefault:!0},{key:"Mod-End",run:QPe,shift:XPe},{key:"Enter",run:KPe,shift:KPe},{key:"Mod-a",run:Ypn},{key:"Backspace",run:Oue,shift:Oue,preventDefault:!0},{key:"Delete",run:glt,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ylt,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:nhn,preventDefault:!0},{mac:"Mod-Backspace",run:shn,preventDefault:!0},{mac:"Mod-Delete",run:ahn,preventDefault:!0}].concat(vhn.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),bhn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Ipn,shift:Upn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Npn,shift:qpn},{key:"Alt-ArrowUp",run:lhn},{key:"Shift-Alt-ArrowUp",run:uhn},{key:"Alt-ArrowDown",run:chn},{key:"Shift-Alt-ArrowDown",run:dhn},{key:"Mod-Alt-ArrowUp",run:Jpn},{key:"Mod-Alt-ArrowDown",run:ehn},{key:"Escape",run:thn},{key:"Mod-Enter",run:hhn},{key:"Alt-l",mac:"Ctrl-l",run:Xpn},{key:"Mod-i",run:Kpn,preventDefault:!0},{key:"Mod-[",run:klt},{key:"Mod-]",run:Slt},{key:"Mod-Alt-\\",run:mhn},{key:"Shift-Mod-k",run:fhn},{key:"Shift-Mod-\\",run:zpn},{key:"Mod-/",run:lpn},{key:"Alt-A",run:upn},{key:"Ctrl-m",mac:"Shift-Alt-m",run:ghn}].concat(yhn),xhn={key:"Tab",run:Slt,shift:klt},JPe=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class pb{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(JPe(o)):JPe,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 _d(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=Kge(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=Ag(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"&&(pb.prototype[Symbol.iterator]=function(){return this});const Olt={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Xve="gm"+(/x/.unicode==null?"":"u");class _lt{constructor(t,n,r,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=Olt,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new Elt(t,n,r,s,a);this.re=new RegExp(n,Xve+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let i=t.lineAt(s);this.curLineStart=i.from,this.matchPos=xF(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=xF(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 EQ=new WeakMap;class hC{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let s=EQ.get(t);if(!s||s.from>=r||s.to<=n){let o=new hC(n,t.sliceString(n,r));return EQ.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)),EQ.set(t,new hC(i,a)),new hC(n,a.slice(n-i,r-i))}}class Elt{constructor(t,n,r,s,a){this.text=t,this.to=a,this.done=!1,this.value=Olt,this.matchPos=xF(t,s),this.re=new RegExp(n,Xve+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=hC.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=xF(this.text,s+(r==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=hC.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(_lt.prototype[Symbol.iterator]=Elt.prototype[Symbol.iterator]=function(){return this});function whn(e){try{return new RegExp(e,Xve),!0}catch{return!1}}function xF(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 Shn=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:s}=lln(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=ft.cursor(m.from+Math.max(0,Math.min(p,m.length)));e.dispatch({effects:[r,St.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},khn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ohn=gn.define({combine(e){return Pv(e,khn,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function _hn(e){return[Ihn,jhn]}const Ehn=xn.mark({class:"cm-selectionMatch"}),Chn=xn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function e2e(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=Zi.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=Zi.Word)}function Thn(e,t,n,r){return e(t.sliceDoc(n,n+1))==Zi.Word&&e(t.sliceDoc(r-1,r))==Zi.Word}const jhn=Qi.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(Ohn),{state:n}=e,r=n.selection;if(r.ranges.length>1)return xn.none;let s=r.main,a,i=null;if(s.empty){if(!t.highlightWordAroundCursor)return xn.none;let c=n.wordAt(s.head);if(!c)return xn.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 xn.none;if(t.wholeWords){if(a=n.sliceDoc(s.from,s.to),i=n.charCategorizer(s.head),!(e2e(i,n,s.from,s.to)&&Thn(i,n,s.from,s.to)))return xn.none}else if(a=n.sliceDoc(s.from,s.to),!a)return xn.none}let o=[];for(let c of e.visibleRanges){let u=new pb(n.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||e2e(i,n,d,f))&&(s.empty&&d<=s.from&&f>=s.to?o.push(Chn.range(d,f)):(d>=s.to||f<=s.from)&&o.push(Ehn.range(d,f)),o.length>t.maxMatches))return xn.none}}return xn.set(o)}},{decorations:e=>e.decorations}),Ihn=St.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Nhn=({state:e,dispatch:t})=>{let{selection:n}=e,r=ft.create(n.ranges.map(s=>e.wordAt(s.head)||ft.cursor(s.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Ahn(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 pb(e.doc,t,r[r.length-1].to);;)if(o.next(),o.done){if(i)return null;o=new pb(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 Rhn=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(a=>a.from===a.to))return Nhn({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=Ahn(e,r);return s?(t(e.update({selection:e.selection.addRange(ft.range(s.from,s.to),!1),effects:St.scrollIntoView(s.to)})),!0):!1},Ij=gn.define({combine(e){return Pv(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new Whn(t),scrollToMatch:t=>St.scrollIntoView(t)})}});class Clt{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||whn(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 zhn(this):new $hn(this)}getCursor(t,n=0,r){let s=t.doc?t:es.create({doc:t});return r==null&&(r=s.doc.length),this.regexp?hE(this,s,n,r):pE(this,s,n,r)}}class Tlt{constructor(t){this.spec=t}}function Phn(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 pE(e,t,n,r){let s;return e.wholeWord&&(s=Mhn(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(s=Phn(e.test,t,s)),new pb(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:a=>a.toLowerCase(),s)}function Mhn(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(wF(s,n-a))!=Zi.Word||t(SF(s,n-a))!=Zi.Word)&&(t(SF(s,r-a))!=Zi.Word||t(wF(s,r-a))!=Zi.Word))}class $hn extends Tlt{constructor(t){super(t)}nextMatch(t,n,r){let s=pE(this.spec,t,r,t.doc.length).nextOverlapping();if(s.done){let a=Math.min(t.doc.length,n+this.spec.unquoted.length);s=pE(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=pE(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=pE(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=pE(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 Dhn(e,t,n){return(r,s,a)=>(!n||n(r,s,a))&&e(a[0],t,r,s)}function hE(e,t,n,r){let s;return e.wholeWord&&(s=Lhn(t.charCategorizer(t.selection.main.head))),e.test&&(s=Dhn(e.test,t,s)),new _lt(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:s},n,r)}function wF(e,t){return e.slice(Xl(e,t,!1),t)}function SF(e,t){return e.slice(t,Xl(e,t))}function Lhn(e){return(t,n,r)=>!r[0].length||(e(wF(r.input,r.index))!=Zi.Word||e(SF(r.input,r.index))!=Zi.Word)&&(e(SF(r.input,r.index+r[0].length))!=Zi.Word||e(wF(r.input,r.index+r[0].length))!=Zi.Word)}class zhn extends Tlt{nextMatch(t,n,r){let s=hE(this.spec,t,r,t.doc.length).next();return s.done&&(s=hE(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=hE(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=hE(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=hE(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 FP=mr.define(),Kve=mr.define(),T0=tl.define({create(e){return new CQ(_ue(e).create(),null)},update(e,t){for(let n of t.effects)n.is(FP)?e=new CQ(n.value.create(),e.panel):n.is(Kve)&&(e=new CQ(e.query,n.value?Jve:null));return e},provide:e=>TP.from(e,t=>t.panel)});class CQ{constructor(t,n){this.query=t,this.panel=n}}const Fhn=xn.mark({class:"cm-searchMatch"}),Bhn=xn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Uhn=Qi.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(T0))}update(e){let t=e.state.field(T0);(t!=e.startState.field(T0)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return xn.none;let{view:n}=this,r=new rd;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?Bhn:Fhn)})}return r.finish()}},{decorations:e=>e.decorations});function d$(e){return t=>{let n=t.state.field(T0,!1);return n&&n.query.spec.valid?e(t,n):Nlt(t)}}const kF=d$((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let s=ft.single(r.from,r.to),a=e.state.facet(Ij);return e.dispatch({selection:s,effects:[eye(e,r),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),Ilt(e),!0}),OF=d$((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,s=t.prevMatch(n,r,r);if(!s)return!1;let a=ft.single(s.from,s.to),i=e.state.facet(Ij);return e.dispatch({selection:a,effects:[eye(e,s),i.scrollToMatch(a.main,e)],userEvent:"select.search"}),Ilt(e),!0}),qhn=d$((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:ft.create(n.map(r=>ft.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),Vhn=({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 pb(e.doc,e.sliceDoc(r,s));!o.next().done;){if(a.length>1e3)return!1;o.value.from==r&&(i=a.length),a.push(ft.range(o.value.from,o.value.to))}return t(e.update({selection:ft.create(a,i),userEvent:"select.search.matches"})),!0},t2e=d$((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(St.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=ft.single(i.from,i.to).map(f),d.push(eye(e,i)),d.push(n.facet(Ij).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),Hhn=d$((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:St.announce.of(r),userEvent:"input.replace.all"}),!0});function Jve(e){return e.state.facet(Ij).createPanel(e)}function _ue(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(Ij);return new Clt({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 jlt(e){let t=mve(e,Jve);return t&&t.dom.querySelector("[main-field]")}function Ilt(e){let t=jlt(e);t&&t==e.root.activeElement&&t.select()}const Nlt=e=>{let t=e.state.field(T0,!1);if(t&&t.panel){let n=jlt(e);if(n&&n!=e.root.activeElement){let r=_ue(e.state,t.query.spec);r.valid&&e.dispatch({effects:FP.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[Kve.of(!0),t?FP.of(_ue(e.state,t.query.spec)):mr.appendConfig.of(Qhn)]});return!0},Alt=e=>{let t=e.state.field(T0,!1);if(!t||!t.panel)return!1;let n=mve(e,Jve);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Kve.of(!1)}),!0},Zhn=[{key:"Mod-f",run:Nlt,scope:"editor search-panel"},{key:"F3",run:kF,shift:OF,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:kF,shift:OF,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Alt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Vhn},{key:"Mod-Alt-g",run:Shn},{key:"Mod-d",run:Rhn,preventDefault:!0}];class Whn{constructor(t){this.view=t;let n=this.query=t.state.field(T0).query.spec;this.commit=this.commit.bind(this),this.searchField=Ya("input",{value:n.search,placeholder:yf(t,"Find"),"aria-label":yf(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ya("input",{value:n.replace,placeholder:yf(t,"Replace"),"aria-label":yf(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ya("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Ya("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Ya("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(s,a,i){return Ya("button",{class:"cm-button",name:s,onclick:a,type:"button"},i)}this.dom=Ya("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,r("next",()=>kF(t),[yf(t,"next")]),r("prev",()=>OF(t),[yf(t,"previous")]),r("select",()=>qhn(t),[yf(t,"all")]),Ya("label",null,[this.caseField,yf(t,"match case")]),Ya("label",null,[this.reField,yf(t,"regexp")]),Ya("label",null,[this.wordField,yf(t,"by word")]),...t.state.readOnly?[]:[Ya("br"),this.replaceField,r("replace",()=>t2e(t),[yf(t,"replace")]),r("replaceAll",()=>Hhn(t),[yf(t,"replace all")])],Ya("button",{name:"close",onclick:()=>Alt(t),"aria-label":yf(t,"close"),type:"button"},["×"])])}commit(){let t=new Clt({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:FP.of(t)}))}keydown(t){yon(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?OF:kF)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),t2e(this.view))}update(t){for(let n of t.transactions)for(let r of n.effects)r.is(FP)&&!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(Ij).top}}function yf(e,t){return e.state.phrase(t)}const oL=30,lL=/[\s\.,:;?!]/;function eye(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-oL),i=Math.min(s,n+oL),o=e.state.sliceDoc(a,i);if(a!=r.from){for(let c=0;c<oL;c++)if(!lL.test(o[c+1])&&lL.test(o[c])){o=o.slice(c);break}}if(i!=s){for(let c=o.length-1;c>o.length-oL;c--)if(!lL.test(o[c-1])&&lL.test(o[c])){o=o.slice(0,c);break}}return St.announce.of(`${e.state.phrase("current match")}. ${o} ${e.state.phrase("on line")} ${r.number}.`)}const Ghn=St.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"}}),Qhn=[T0,Zm.low(Uhn),Ghn];class n2e{constructor(t,n,r){this.from=t,this.to=n,this.diagnostic=r}}class hS{constructor(t,n,r){this.diagnostics=t,this.panel=n,this.selected=r}static init(t,n,r){let s=r.facet(BP).markerFilter;s&&(t=s(t,r));let a=t.slice().sort((d,f)=>d.from-f.from||d.to-f.to),i=new rd,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=lmn(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,xn.widget({widget:new smn(m),diagnostics:o.slice()}));else{let g=o.reduce((v,b)=>b.markClass?v+" "+b.markClass:v,"");i.add(p,h,xn.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 hS(u,n,oT(u))}}function oT(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 n2e(s,a,t||i.diagnostics[0]);else{if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new n2e(r.from,a,r.diagnostic)}}),r}function Yhn(e,t){let n=t.pos,r=t.end||n,s=e.state.facet(BP).hideOn(e,n,r);if(s!=null)return s;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(i=>i.is(Rlt))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function Xhn(e,t){return e.field(Uf,!1)?t:t.concat(mr.appendConfig.of(cmn))}const Rlt=mr.define(),tye=mr.define(),Plt=mr.define(),Uf=tl.define({create(){return new hS(xn.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=oT(n,e.selected.diagnostic,a)||oT(n,null,a)}!n.size&&s&&t.state.facet(BP).autoPanel&&(s=null),e=new hS(n,s,r)}for(let n of t.effects)if(n.is(Rlt)){let r=t.state.facet(BP).autoPanel?n.value.length?UP.open:null:e.panel;e=hS.init(n.value,r,t.state)}else n.is(tye)?e=new hS(e.diagnostics,n.value?UP.open:null,e.selected):n.is(Plt)&&(e=new hS(e.diagnostics,e.panel,n.value));return e},provide:e=>[TP.from(e,t=>t.panel),St.decorations.from(e,t=>t.diagnostics)]}),Khn=xn.mark({class:"cm-lintRange cm-lintRange-active"});function Jhn(e,t,n){let{diagnostics:r}=e.state.field(Uf),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(BP).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:emn(e,s)}}}:null}function emn(e,t){return Ya("ul",{class:"cm-tooltip-lint"},t.map(n=>$lt(e,n,!1)))}const tmn=e=>{let t=e.state.field(Uf,!1);(!t||!t.panel)&&e.dispatch({effects:Xhn(e.state,[tye.of(!0)])});let n=mve(e,UP.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},r2e=e=>{let t=e.state.field(Uf,!1);return!t||!t.panel?!1:(e.dispatch({effects:tye.of(!1)}),!0)},nmn=e=>{let t=e.state.field(Uf,!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)},rmn=[{key:"Mod-Shift-m",run:tmn,preventDefault:!0},{key:"F8",run:nmn}],BP=gn.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Pv(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:s2e,tooltipFilter:s2e,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 s2e(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function Mlt(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 $lt(e,t,n){var r;let s=n?Mlt(t.actions):[];return Ya("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Ya("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=oT(e.state.field(Uf).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),Ya("u",u.slice(d,d+1)),u.slice(d+1)],p=a.markClass?" "+a.markClass:"";return Ya("button",{type:"button",class:"cm-diagnosticAction"+p,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${s[i]})"`}.`},f)}),t.source&&Ya("div",{class:"cm-diagnosticSource"},t.source))}class smn extends gp{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Ya("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class a2e{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=$lt(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class UP{constructor(t){this.view=t,this.items=[];let n=s=>{if(s.keyCode==27)r2e(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=Mlt(a.actions);for(let o=0;o<i.length;o++)if(i[o].toUpperCase().charCodeAt(0)==s.keyCode){let c=oT(this.view.state.field(Uf).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=Ya("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=Ya("div",{class:"cm-panel-lint"},this.list,Ya("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>r2e(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Uf).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(Uf),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 a2e(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 a2e(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(Uf),r=oT(n.diagnostics,this.items[t].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:Plt.of(r)})}static open(t){return new UP(t)}}function amn(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 cL(e){return amn(`<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 imn=St.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:cL("#d11")},".cm-lintRange-warning":{backgroundImage:cL("orange")},".cm-lintRange-info":{backgroundImage:cL("#999")},".cm-lintRange-hint":{backgroundImage:cL("#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 omn(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function lmn(e){let t="hint",n=1;for(let r of e){let s=omn(r.severity);s>n&&(n=s,t=r.severity)}return t}const cmn=[Uf,St.decorations.compute([Uf],e=>{let{selected:t,panel:n}=e.field(Uf);return!t||!n||t.from==t.to?xn.none:xn.set([Khn.range(t.from,t.to)])}),iln(Jhn,{hideOn:Yhn}),imn];var i2e=function(t){t===void 0&&(t={});var{crosshairCursor:n=!1}=t,r=[];t.closeBracketsKeymap!==!1&&(r=r.concat(run)),t.defaultKeymap!==!1&&(r=r.concat(bhn)),t.searchKeymap!==!1&&(r=r.concat(Zhn)),t.historyKeymap!==!1&&(r=r.concat(Epn)),t.foldKeymap!==!1&&(r=r.concat(Uln)),t.completionKeymap!==!1&&(r=r.concat(Sit)),t.lintKeymap!==!1&&(r=r.concat(rmn));var s=[];return t.lineNumbers!==!1&&s.push(yln()),t.highlightActiveLineGutter!==!1&&s.push(wln()),t.highlightSpecialChars!==!1&&s.push(Pon()),t.history!==!1&&s.push(vpn()),t.foldGutter!==!1&&s.push(Zln()),t.drawSelection!==!1&&s.push(Oon()),t.dropCursor!==!1&&s.push(jon()),t.allowMultipleSelections!==!1&&s.push(es.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&s.push(Pln()),t.syntaxHighlighting!==!1&&s.push(Lw(Yln,{fallback:!0})),t.bracketMatching!==!1&&s.push(rcn()),t.closeBrackets!==!1&&s.push(Jcn()),t.autocompletion!==!1&&s.push(wit()),t.rectangularSelection!==!1&&s.push(Gon()),n!==!1&&s.push(Xon()),t.highlightActiveLine!==!1&&s.push(Fon()),t.highlightSelectionMatches!==!1&&s.push(_hn()),t.tabSize&&typeof t.tabSize=="number"&&s.push(Ej.of(" ".repeat(t.tabSize))),s.concat([_j.of(r.flat())]).filter(Boolean)};const umn="#e5c07b",o2e="#e06c75",dmn="#56b6c2",fmn="#ffffff",C6="#abb2bf",Eue="#7d8799",pmn="#61afef",hmn="#98c379",l2e="#d19a66",mmn="#c678dd",gmn="#21252b",c2e="#2c313a",u2e="#282c34",TQ="#353a42",vmn="#3E4451",d2e="#528bff",ymn=St.theme({"&":{color:C6,backgroundColor:u2e},".cm-content":{caretColor:d2e},".cm-cursor, .cm-dropCursor":{borderLeftColor:d2e},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:vmn},".cm-panels":{backgroundColor:gmn,color:C6},".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:u2e,color:Eue,border:"none"},".cm-activeLineGutter":{backgroundColor:c2e},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:TQ},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:TQ,borderBottomColor:TQ},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:c2e,color:C6}}},{dark:!0}),bmn=Wm.define([{tag:oe.keyword,color:mmn},{tag:[oe.name,oe.deleted,oe.character,oe.propertyName,oe.macroName],color:o2e},{tag:[oe.function(oe.variableName),oe.labelName],color:pmn},{tag:[oe.color,oe.constant(oe.name),oe.standard(oe.name)],color:l2e},{tag:[oe.definition(oe.name),oe.separator],color:C6},{tag:[oe.typeName,oe.className,oe.number,oe.changed,oe.annotation,oe.modifier,oe.self,oe.namespace],color:umn},{tag:[oe.operator,oe.operatorKeyword,oe.url,oe.escape,oe.regexp,oe.link,oe.special(oe.string)],color:dmn},{tag:[oe.meta,oe.comment],color:Eue},{tag:oe.strong,fontWeight:"bold"},{tag:oe.emphasis,fontStyle:"italic"},{tag:oe.strikethrough,textDecoration:"line-through"},{tag:oe.link,color:Eue,textDecoration:"underline"},{tag:oe.heading,fontWeight:"bold",color:o2e},{tag:[oe.atom,oe.bool,oe.special(oe.variableName)],color:l2e},{tag:[oe.processingInstruction,oe.string,oe.inserted],color:hmn},{tag:oe.invalid,color:fmn}]),xmn=[ymn,Lw(bmn)];var wmn=St.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Smn=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(_j.of([xhn])),o&&(typeof o=="boolean"?c.unshift(i2e()):c.unshift(i2e(o))),i&&c.unshift(Von(i)),a){case"light":c.push(wmn);break;case"dark":c.push(xmn);break;case"none":break;default:c.push(a);break}return r===!1&&c.push(St.editable.of(!1)),s&&c.push(es.readOnly.of(!0)),[...c]},kmn=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 Omn{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 f2e{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 jQ=null,_mn=()=>typeof window>"u"?new f2e:(jQ||(jQ=new f2e),jQ),p2e=Rv.define(),Emn=200,Cmn=[];function Tmn(e){var{value:t,selection:n,onChange:r,onStatistics:s,onCreateEditor:a,onUpdate:i,extensions:o=Cmn,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:O=!0,root:E,initialState:_}=e,[C,j]=y.useState(),[I,N]=y.useState(),[R,P]=y.useState(),B=y.useState(()=>({current:null}))[0],M=y.useState(()=>({current:null}))[0],L=St.theme({"&":{height:d,minHeight:f,maxHeight:p,width:h,minWidth:m,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),F=St.updateListener.of(H=>{if(H.docChanged&&typeof r=="function"&&!H.transactions.some(V=>V.annotation(p2e))){B.current?B.current.reset():(B.current=new Omn(()=>{if(M.current){var V=M.current;M.current=null,V()}B.current=null},Emn),_mn().add(B.current));var D=H.state.doc,Y=D.toString();r(Y,H)}s&&s(kmn(H))}),z=Smn({theme:u,editable:b,readOnly:S,placeholder:v,indentWithTab:w,basicSetup:O}),U=[F,L,...z];return i&&typeof i=="function"&&U.push(St.updateListener.of(i)),U=U.concat(o),y.useLayoutEffect(()=>{if(C&&!R){var H={doc:t,selection:n,extensions:U},D=_?es.fromJSON(_.json,H,_.fields):es.create(H);if(P(D),!I){var Y=new St({state:D,parent:C,root:E});N(Y),a&&a(Y,D)}}return()=>{I&&(P(void 0),N(void 0))}},[C,R]),y.useEffect(()=>{e.container&&j(e.container)},[e.container]),y.useEffect(()=>()=>{I&&(I.destroy(),N(void 0)),B.current&&(B.current.cancel(),B.current=null)},[I]),y.useEffect(()=>{c&&I&&I.focus()},[c,I]),y.useEffect(()=>{I&&I.dispatch({effects:mr.reconfigure.of(U)})},[u,o,d,f,p,h,m,g,v,b,S,w,O,r,i]),y.useEffect(()=>{if(t!==void 0){var H=I?I.state.doc.toString():"";if(I&&t!==H){var D=B.current&&!B.current.isDone,Y=()=>{I&&t!==I.state.doc.toString()&&I.dispatch({changes:{from:0,to:I.state.doc.toString().length,insert:t||""},annotations:[p2e.of(!0)]})};D?M.current=Y:Y()}}},[t,I]),{state:R,setState:P,view:I,setView:N,container:C,setContainer:j}}var jmn=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],gu=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:O,editable:E,readOnly:_,root:C,initialState:j}=e,I=Vot(e,jmn),N=y.useRef(null),{state:R,view:P,container:B,setContainer:M}=Tmn({root:C,value:r,autoFocus:d,theme:f,height:p,minHeight:h,maxHeight:m,width:g,minWidth:v,maxWidth:b,basicSetup:S,placeholder:w,indentWithTab:O,editable:E,readOnly:_,selection:s,onChange:i,onStatistics:o,onCreateEditor:c,onUpdate:u,extensions:a,initialState:j});y.useImperativeHandle(t,()=>({editor:N.current,state:R,view:P}),[N,B,R,P]);var L=y.useCallback(z=>{N.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",zP({ref:L,className:""+F+(n?" "+n:"")},I))});gu.displayName="CodeMirror";const Imn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Dlt=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var Nmn={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 Amn=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,...Nmn,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Dlt("lucide",s),...o},[...i.map(([u,d])=>y.createElement(u,d)),...Array.isArray(a)?a:[a]]));const bn=(e,t)=>{const n=y.forwardRef(({className:r,...s},a)=>y.createElement(Amn,{ref:a,iconNode:t,className:Dlt(`lucide-${Imn(e)}`,r),...s}));return n.displayName=`${e}`,n};const Rmn=[["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 18h18",key:"1h113x"}],["path",{d:"M3 6h18",key:"d0wm0j"}]],_F=bn("AlignJustify",Rmn);const Pmn=[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],qP=bn("AlignLeft",Pmn);const Mmn=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],PB=bn("ArrowDown",Mmn);const $mn=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Nj=bn("ArrowLeft",$mn);const Dmn=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],bk=bn("ArrowRight",Dmn);const Lmn=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],MB=bn("ArrowUp",Lmn);const zmn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],Llt=bn("Ban",zmn);const Fmn=[["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"}]],g0=bn("Braces",Fmn);const Bmn=[["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"}]],Umn=bn("Brain",Bmn);const qmn=[["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"}]],Cue=bn("Calendar",qmn);const Vmn=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Lb=bn("Check",Vmn);const Hmn=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],nye=bn("ChevronDown",Hmn);const Zmn=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],zlt=bn("ChevronLeft",Zmn);const Wmn=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],xk=bn("ChevronRight",Wmn);const Gmn=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Qmn=bn("ChevronUp",Gmn);const Ymn=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],rye=bn("ChevronsDownUp",Ymn);const Xmn=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],Kmn=bn("ChevronsDown",Xmn);const Jmn=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],egn=bn("ChevronsLeft",Jmn);const tgn=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],Flt=bn("ChevronsRight",tgn);const ngn=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],f$=bn("ChevronsUpDown",ngn);const rgn=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],sgn=bn("ChevronsUp",rgn);const agn=[["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"}]],ign=bn("CircleGauge",agn);const ogn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],Blt=bn("CircleSlash",ogn);const lgn=[["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"}]],cgn=bn("CircleX",lgn);const ugn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ult=bn("Circle",ugn);const dgn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],fgn=bn("Clock",dgn);const pgn=[["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"}]],hgn=bn("Component",pgn);const mgn=[["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"}]],qlt=bn("Copy",mgn);const ggn=[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],vgn=bn("CornerDownRight",ggn);const ygn=[["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"}]],bgn=bn("EllipsisVertical",ygn);const xgn=[["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"}]],wgn=bn("EqualNot",xgn);const Sgn=[["line",{x1:"5",x2:"19",y1:"9",y2:"9",key:"1nwqeh"}],["line",{x1:"5",x2:"19",y1:"15",y2:"15",key:"g8yjpy"}]],kgn=bn("Equal",Sgn);const Ogn=[["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"}]],_gn=bn("Expand",Ogn);const Egn=[["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"}]],sye=bn("ExternalLink",Egn);const Cgn=[["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"}]],Tgn=bn("Eye",Cgn);const jgn=[["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"}]],Tue=bn("FileInput",jgn);const Ign=[["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"}]],jue=bn("FileOutput",Ign);const Ngn=[["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"}]],Agn=bn("FileText",Ngn);const Rgn=[["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"}]],Pgn=bn("File",Rgn);const Mgn=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]],$gn=bn("Filter",Mgn);const Dgn=[["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"}]],Lgn=bn("FoldVertical",Dgn);const zgn=[["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"}]],Fgn=bn("Folder",zgn);const Bgn=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Ugn=bn("Gauge",Bgn);const qgn=[["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"}]],aye=bn("Hash",qgn);const Vgn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],iye=bn("Info",Vgn);const Hgn=[["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"}]],Zgn=bn("Keyboard",Hgn);const Wgn=[["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"}]],Ggn=bn("Lightbulb",Wgn);const Qgn=[["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"}]],Vlt=bn("Link2",Qgn);const Ygn=[["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"}]],Xgn=bn("ListFilterPlus",Ygn);const Kgn=[["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"}]],Jgn=bn("ListTree",Kgn);const evn=[["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"}]],tvn=bn("ListX",evn);const nvn=[["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"}]],oye=bn("List",nvn);const rvn=[["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"}]],svn=bn("Lock",rvn);const avn=[["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"}]],ivn=bn("LogIn",avn);const ovn=[["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"}]],lvn=bn("Logs",ovn);const cvn=[["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"}]],uvn=bn("Menu",cvn);const dvn=[["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"}]],fvn=bn("OctagonAlert",dvn);const pvn=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],hvn=bn("PanelRight",pvn);const mvn=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],lye=bn("Plus",mvn);const gvn=[["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"}]],Hlt=bn("Save",gvn);const vvn=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],lT=bn("Search",vvn);const yvn=[["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"}]],bvn=bn("ShieldX",yvn);const xvn=[["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"}]],wvn=bn("TextSearch",xvn);const Svn=[["path",{d:"M17 6.1H3",key:"wptmhv"}],["path",{d:"M21 12.1H3",key:"1j38uz"}],["path",{d:"M15.1 18H3",key:"1nb16a"}]],kvn=bn("Text",Svn);const Ovn=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]],cye=bn("ToggleLeft",Ovn);const _vn=[["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"}]],Zlt=bn("Trash2",_vn);const Evn=[["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"}]],Cvn=bn("TrendingDown",Evn);const Tvn=[["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"}]],jvn=bn("TrendingUp",Tvn);const Ivn=[["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"}]],p$=bn("TriangleAlert",Ivn);const Nvn=[["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"}]],uye=bn("Type",Nvn);const Avn=[["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"}]],Rvn=bn("UnfoldVertical",Avn);const Pvn=[["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"}]],Mvn=bn("WandSparkles",Pvn);const $vn=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hd=bn("X",$vn);function Dvn(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 Lvn=e=>{switch(e){case"success":return Bvn;case"info":return qvn;case"warning":return Uvn;case"error":return Vvn;default:return null}},zvn=Array(12).fill(0),Fvn=({visible:e,className:t})=>Ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ee.createElement("div",{className:"sonner-spinner"},zvn.map((n,r)=>Ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Bvn=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ee.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"})),Uvn=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ee.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"})),qvn=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ee.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"})),Vvn=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ee.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"})),Hvn=Ee.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"},Ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Zvn=()=>{const[e,t]=Ee.useState(document.hidden);return Ee.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Iue=1;class Wvn{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:Iue++,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],Ee.isValidElement(u))a=!1,this.create({id:r,type:"default",message:u});else if(Qvn(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"&&!Ee.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"&&!Ee.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"&&!Ee.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"&&!Ee.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||Iue++;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 kd=new Wvn,Gvn=(e,t)=>{const n=t?.id||Iue++;return kd.addToast({title:e,...t,id:n}),n},Qvn=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Yvn=Gvn,Xvn=()=>kd.toasts,Kvn=()=>kd.getActiveToasts(),Rm=Object.assign(Yvn,{success:kd.success,info:kd.info,warning:kd.warning,error:kd.error,custom:kd.custom,message:kd.message,promise:kd.promise,dismiss:kd.dismiss,loading:kd.loading},{getHistory:Xvn,getToasts:Kvn});Dvn("[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 uL(e){return e.label!==void 0}const Jvn=3,eyn="24px",tyn="16px",h2e=4e3,nyn=356,ryn=14,syn=45,ayn=200;function gg(...e){return e.filter(Boolean).join(" ")}function iyn(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const oyn=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:O,defaultRichColors:E,closeButton:_,style:C,cancelButtonStyle:j,actionButtonStyle:I,className:N="",descriptionClassName:R="",duration:P,position:B,gap:M,expandByDefault:L,classNames:F,icons:z,closeButtonAriaLabel:U="Close toast"}=e,[H,D]=Ee.useState(null),[Y,V]=Ee.useState(null),[$,Z]=Ee.useState(!1),[G,K]=Ee.useState(!1),[ne,ee]=Ee.useState(!1),[J,se]=Ee.useState(!1),[ae,Q]=Ee.useState(!1),[te,le]=Ee.useState(0),[fe,ce]=Ee.useState(0),ye=Ee.useRef(f.duration||P||h2e),we=Ee.useRef(null),ke=Ee.useRef(null),Re=b===0,De=b+1<=g,Ue=f.type,ot=f.dismissible!==!1,pe=f.className||"",de=f.descriptionClassName||"",ie=Ee.useMemo(()=>v.findIndex(Tt=>Tt.toastId===f.id)||0,[v,f.id]),ge=Ee.useMemo(()=>{var Tt;return(Tt=f.closeButton)!=null?Tt:_},[f.closeButton,_]),ue=Ee.useMemo(()=>f.duration||P||h2e,[f.duration,P]),xe=Ee.useRef(0),Se=Ee.useRef(0),Fe=Ee.useRef(0),ze=Ee.useRef(null),[Ke,Ne]=B.split("-"),qe=Ee.useMemo(()=>v.reduce((Tt,Ft,ur)=>ur>=ie?Tt:Tt+Ft.height,0),[v,ie]),Ie=Zvn(),Ge=f.invert||d,Le=Ue==="loading";Se.current=Ee.useMemo(()=>ie*M+qe,[ie,qe]),Ee.useEffect(()=>{ye.current=ue},[ue]),Ee.useEffect(()=>{Z(!0)},[]),Ee.useEffect(()=>{const Tt=ke.current;if(Tt){const Ft=Tt.getBoundingClientRect().height;return ce(Ft),m(ur=>[{toastId:f.id,height:Ft,position:f.position},...ur]),()=>m(ur=>ur.filter(_t=>_t.toastId!==f.id))}},[m,f.id]),Ee.useLayoutEffect(()=>{if(!$)return;const Tt=ke.current,Ft=Tt.style.height;Tt.style.height="auto";const ur=Tt.getBoundingClientRect().height;Tt.style.height=Ft,ce(ur),m(_t=>_t.find(Mt=>Mt.toastId===f.id)?_t.map(Mt=>Mt.toastId===f.id?{...Mt,height:ur}:Mt):[{toastId:f.id,height:ur,position:f.position},..._t])},[$,f.title,f.description,m,f.id,f.jsx,f.action,f.cancel]);const Je=Ee.useCallback(()=>{K(!0),le(Se.current),m(Tt=>Tt.filter(Ft=>Ft.toastId!==f.id)),setTimeout(()=>{O(f)},ayn)},[f,O,m,Se]);Ee.useEffect(()=>{if(f.promise&&Ue==="loading"||f.duration===1/0||f.type==="loading")return;let Tt;return w||h||Ie?(()=>{if(Fe.current<xe.current){const _t=new Date().getTime()-xe.current;ye.current=ye.current-_t}Fe.current=new Date().getTime()})():ye.current!==1/0&&(xe.current=new Date().getTime(),Tt=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Je()},ye.current)),()=>clearTimeout(Tt)},[w,h,f,Ue,Ie,Je]),Ee.useEffect(()=>{f.delete&&(Je(),f.onDismiss==null||f.onDismiss.call(f,f))},[Je,f.delete]);function st(){var Tt;if(z?.loading){var Ft;return Ee.createElement("div",{className:gg(F?.loader,f==null||(Ft=f.classNames)==null?void 0:Ft.loader,"sonner-loader"),"data-visible":Ue==="loading"},z.loading)}return Ee.createElement(Fvn,{className:gg(F?.loader,f==null||(Tt=f.classNames)==null?void 0:Tt.loader),visible:Ue==="loading"})}const fn=f.icon||z?.[Ue]||Lvn(Ue);var Nt,Mn;return Ee.createElement("li",{tabIndex:0,ref:ke,className:gg(N,pe,F?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,F?.default,F?.[Ue],f==null||(n=f.classNames)==null?void 0:n[Ue]),"data-sonner-toast":"","data-rich-colors":(Nt=f.richColors)!=null?Nt:E,"data-styled":!(f.jsx||f.unstyled||p),"data-mounted":$,"data-promise":!!f.promise,"data-swiped":ae,"data-removed":G,"data-visible":De,"data-y-position":Ke,"data-x-position":Ne,"data-index":b,"data-front":Re,"data-swiping":ne,"data-dismissible":ot,"data-type":Ue,"data-invert":Ge,"data-swipe-out":J,"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?te:Se.current}px`,"--initial-height":L?"auto":`${fe}px`,...C,...f.style},onDragEnd:()=>{ee(!1),D(null),ze.current=null},onPointerDown:Tt=>{Tt.button!==2&&(Le||!ot||(we.current=new Date,le(Se.current),Tt.target.setPointerCapture(Tt.pointerId),Tt.target.tagName!=="BUTTON"&&(ee(!0),ze.current={x:Tt.clientX,y:Tt.clientY})))},onPointerUp:()=>{var Tt,Ft,ur;if(J||!ot)return;ze.current=null;const _t=Number(((Tt=ke.current)==null?void 0:Tt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Rt=Number(((Ft=ke.current)==null?void 0:Ft.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Mt=new Date().getTime()-((ur=we.current)==null?void 0:ur.getTime()),vn=H==="x"?_t:Rt,_n=Math.abs(vn)/Mt;if(Math.abs(vn)>=syn||_n>.11){le(Se.current),f.onDismiss==null||f.onDismiss.call(f,f),V(H==="x"?_t>0?"right":"left":Rt>0?"down":"up"),Je(),se(!0);return}else{var _e,Pe;(_e=ke.current)==null||_e.style.setProperty("--swipe-amount-x","0px"),(Pe=ke.current)==null||Pe.style.setProperty("--swipe-amount-y","0px")}Q(!1),ee(!1),D(null)},onPointerMove:Tt=>{var Ft,ur,_t;if(!ze.current||!ot||((Ft=window.getSelection())==null?void 0:Ft.toString().length)>0)return;const Mt=Tt.clientY-ze.current.y,vn=Tt.clientX-ze.current.x;var _n;const _e=(_n=e.swipeDirections)!=null?_n:iyn(B);!H&&(Math.abs(vn)>1||Math.abs(Mt)>1)&&D(Math.abs(vn)>Math.abs(Mt)?"x":"y");let Pe={x:0,y:0};const je=rt=>1/(1.5+Math.abs(rt)/20);if(H==="y"){if(_e.includes("top")||_e.includes("bottom"))if(_e.includes("top")&&Mt<0||_e.includes("bottom")&&Mt>0)Pe.y=Mt;else{const rt=Mt*je(Mt);Pe.y=Math.abs(rt)<Math.abs(Mt)?rt:Mt}}else if(H==="x"&&(_e.includes("left")||_e.includes("right")))if(_e.includes("left")&&vn<0||_e.includes("right")&&vn>0)Pe.x=vn;else{const rt=vn*je(vn);Pe.x=Math.abs(rt)<Math.abs(vn)?rt:vn}(Math.abs(Pe.x)>0||Math.abs(Pe.y)>0)&&Q(!0),(ur=ke.current)==null||ur.style.setProperty("--swipe-amount-x",`${Pe.x}px`),(_t=ke.current)==null||_t.style.setProperty("--swipe-amount-y",`${Pe.y}px`)}},ge&&!f.jsx&&Ue!=="loading"?Ee.createElement("button",{"aria-label":U,"data-disabled":Le,"data-close-button":!0,onClick:Le||!ot?()=>{}:()=>{Je(),f.onDismiss==null||f.onDismiss.call(f,f)},className:gg(F?.closeButton,f==null||(r=f.classNames)==null?void 0:r.closeButton)},(Mn=z?.close)!=null?Mn:Hvn):null,(Ue||f.icon||f.promise)&&f.icon!==null&&(z?.[Ue]!==null||f.icon)?Ee.createElement("div",{"data-icon":"",className:gg(F?.icon,f==null||(s=f.classNames)==null?void 0:s.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||st():null,f.type!=="loading"?fn:null):null,Ee.createElement("div",{"data-content":"",className:gg(F?.content,f==null||(a=f.classNames)==null?void 0:a.content)},Ee.createElement("div",{"data-title":"",className:gg(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?Ee.createElement("div",{"data-description":"",className:gg(R,de,F?.description,f==null||(o=f.classNames)==null?void 0:o.description)},typeof f.description=="function"?f.description():f.description):null),Ee.isValidElement(f.cancel)?f.cancel:f.cancel&&uL(f.cancel)?Ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||j,onClick:Tt=>{uL(f.cancel)&&ot&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Tt),Je())},className:gg(F?.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,Ee.isValidElement(f.action)?f.action:f.action&&uL(f.action)?Ee.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||I,onClick:Tt=>{uL(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Tt),!Tt.defaultPrevented&&Je())},className:gg(F?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function m2e(){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 lyn(e,t){const n={};return[e,t].forEach((r,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",o=a?tyn:eyn;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 cyn=Ee.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=Jvn,toastOptions:b,dir:S=m2e(),gap:w=ryn,icons:O,containerAriaLabel:E="Notifications"}=t,[_,C]=Ee.useState([]),j=Ee.useMemo(()=>r?_.filter($=>$.toasterId===r):_.filter($=>!$.toasterId),[_,r]),I=Ee.useMemo(()=>Array.from(new Set([a].concat(j.filter($=>$.position).map($=>$.position)))),[j,a]),[N,R]=Ee.useState([]),[P,B]=Ee.useState(!1),[M,L]=Ee.useState(!1),[F,z]=Ee.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=Ee.useRef(null),H=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=Ee.useRef(null),Y=Ee.useRef(!1),V=Ee.useCallback($=>{C(Z=>{var G;return(G=Z.find(K=>K.id===$.id))!=null&&G.delete||kd.dismiss($.id),Z.filter(({id:K})=>K!==$.id)})},[]);return Ee.useEffect(()=>kd.subscribe($=>{if($.dismiss){requestAnimationFrame(()=>{C(Z=>Z.map(G=>G.id===$.id?{...G,delete:!0}:G))});return}setTimeout(()=>{Bme.flushSync(()=>{C(Z=>{const G=Z.findIndex(K=>K.id===$.id);return G!==-1?[...Z.slice(0,G),{...Z[G],...$},...Z.slice(G+1)]:[$,...Z]})})})}),[_]),Ee.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:Z})=>{z(Z?"dark":"light")})}catch{$.addListener(({matches:G})=>{try{z(G?"dark":"light")}catch(K){console.error(K)}})}},[p]),Ee.useEffect(()=>{_.length<=1&&B(!1)},[_]),Ee.useEffect(()=>{const $=Z=>{var G;if(i.every(ee=>Z[ee]||Z.code===ee)){var ne;B(!0),(ne=U.current)==null||ne.focus()}Z.code==="Escape"&&(document.activeElement===U.current||(G=U.current)!=null&&G.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[i]),Ee.useEffect(()=>{if(U.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,Y.current=!1)}},[U.current]),Ee.createElement("section",{ref:n,"aria-label":`${E} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},I.map(($,Z)=>{var G;const[K,ne]=$.split("-");return j.length?Ee.createElement("ol",{key:$,dir:S==="auto"?m2e():S,tabIndex:-1,ref:U,className:u,"data-sonner-toaster":!0,"data-sonner-theme":F,"data-y-position":K,"data-x-position":ne,style:{"--front-toast-height":`${((G=N[0])==null?void 0:G.height)||0}px`,"--width":`${nyn}px`,"--gap":`${w}px`,...g,...lyn(d,f)},onBlur:ee=>{Y.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(Y.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,D.current=ee.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{M||B(!1)},onDragEnd:()=>B(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},j.filter(ee=>!ee.position&&Z===0||ee.position===$).map((ee,J)=>{var se,ae;return Ee.createElement(oyn,{key:ee.id,icons:O,index:J,toast:ee,defaultRichColors:h,duration:(se=b?.duration)!=null?se:m,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:s,visibleToasts:v,closeButton:(ae=b?.closeButton)!=null?ae: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==ee.position),heights:N.filter(Q=>Q.position==ee.position),setHeights:R,expandByDefault:o,gap:w,expanded:P,swipeDirections:t.swipeDirections})})):null}))});let g2e={},v2e={},y2e="";function uyn(e){if(typeof document>"u")return!1;const t=Vr(e);return Li(t).innerWidth-t.documentElement.clientWidth>0}function dyn(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Vr(e),r=n.documentElement,s=n.body,a=Mw(r)?r:s,i=a.style.overflowY,o=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",a.style.overflowY="scroll";const c=a.offsetWidth;a.style.overflowY="hidden";const u=a.offsetWidth;return a.style.overflowY=i,r.style.scrollbarGutter=o,c===u}function fyn(e){const t=Vr(e),n=t.documentElement,r=t.body,s=Mw(n)?n:r,a={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,a)}}function pyn(e){const t=Vr(e),n=t.documentElement,r=t.body,s=Li(n);let a=0,i=0,o=!1;const c=Od.create();if(kge&&(s.visualViewport?.scale??1)!==1)return()=>{};function u(){const h=s.getComputedStyle(n),m=s.getComputedStyle(r),b=(h.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=n.scrollTop,i=n.scrollLeft,g2e={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},y2e=n.style.scrollBehavior,v2e={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const S=n.scrollHeight>n.clientHeight,w=n.scrollWidth>n.clientWidth,O=h.overflowY==="scroll"||m.overflowY==="scroll",E=h.overflowX==="scroll"||m.overflowX==="scroll",_=Math.max(0,s.innerWidth-r.clientWidth),C=Math.max(0,s.innerHeight-r.clientHeight),j=parseFloat(m.marginTop)+parseFloat(m.marginBottom),I=parseFloat(m.marginLeft)+parseFloat(m.marginRight),N=Mw(n)?n:r;if(o=dyn(e),o){n.style.scrollbarGutter=b,N.style.overflowY="hidden",N.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:b,overflowY:"hidden",overflowX:"hidden"}),(S||O)&&(n.style.overflowY="scroll"),(w||E)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:j||C?`calc(100dvh - ${j+C}px)`:"100dvh",width:I||_?`calc(100vw - ${I+_}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=a,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,g2e),Object.assign(r.style,v2e),o||(n.scrollTop=a,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=y2e)}function f(){d(),c.request(u)}u();const p=Jr(s,"resize",f);return()=>{c.cancel(),d(),typeof s.removeEventListener=="function"&&p()}}class hyn{lockCount=0;restore=null;timeoutLock=xh.create();timeoutUnlock=xh.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Vr(t).documentElement,s=Li(r).getComputedStyle(r).overflowY;if(s==="hidden"||s==="clip"){this.restore=_i;return}const a=Oge||!uyn(t);this.restore=a?fyn(t):pyn(t)}}const myn=new hyn;function Wlt(e=!0,t=null){Zt(()=>{if(e)return myn.acquire(t)},[e,t])}function gyn(e){const{store:t,parentContext:n,actionsRef:r,isDrawer:s}=e,a=t.useState("open");Grt(t,a),oB(t);const{forceUnmount:i}=lB(a,t),o=y.useCallback(()=>{t.setOpen(!1,yn(eB))},[t]);return y.useImperativeHandle(r,()=>({unmount:i,close:o}),[i,o]),{parentContext:n,isDrawer:s}}function vyn({store:e,dialogRoot:t}){const{parentContext:n,isDrawer:r}=t,s=e.useState("open"),a=e.useState("disablePointerDismissal"),i=e.useState("modal"),o=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,d]=y.useState(0),[f,p]=y.useState(0),h=u===0,m=t$(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(S){if(!e.context.outsidePressEnabledRef.current||"button"in S&&S.button!==0||"touches"in S&&S.touches.length!==1)return!1;const w=mo(S);if(h&&!a){const O=w;return i&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===O||e.context.backdropRef.current===O||In(O,o)&&!O?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:h});Wlt(s&&i===!0,o),e.useContextCallback("onNestedDialogOpen",(S,w)=>{d(S),p(w)}),e.useContextCallback("onNestedDialogClose",()=>{d(0),p(0)}),y.useEffect(()=>(n?.onNestedDialogOpen&&s&&n.onNestedDialogOpen(u+1,f+(r?1:0)),n?.onNestedDialogClose&&!s&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&s&&n.onNestedDialogClose()}),[r,s,u,f,n]);const g=m.reference??ya,v=m.trigger??ya,b=y.useMemo(()=>ou(bO,m.floating),[m.floating]);return cB(e,{activeTriggerProps:g,inactiveTriggerProps:v,popupProps:b,nestedOpenDialogCount:u,nestedOpenDrawerCount:f}),null}const Glt=y.createContext(!1),Qlt=y.createContext(void 0);function Fw(e){const t=y.useContext(Qlt);if(e===!1&&t===void 0)throw new Error(js(27));return t}const yyn={...dB,modal:bt(e=>e.modal),nested:bt(e=>e.nested),nestedOpenDialogCount:bt(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:bt(e=>e.nestedOpenDrawerCount),disablePointerDismissal:bt(e=>e.disablePointerDismissal),openMethod:bt(e=>e.openMethod),descriptionElementId:bt(e=>e.descriptionElementId),titleElementId:bt(e=>e.titleElementId),viewportElement:bt(e=>e.viewportElement),role:bt(e=>e.role)};class dye extends n${constructor(t,n,r=!1){const s=new Sj,a=byn(t);a.floatingRootContext=Uge(s,n,r),super(a,{popupRef:y.createRef(),backdropRef:y.createRef(),internalBackdropRef:y.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:s,onOpenChange:void 0,onOpenChangeComplete:void 0},yyn)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t};Bge(r,t,n.trigger),this.update(r)};static useStore(t,n){return Fge(t,(s,a)=>new dye(n,s,a),!0).store}}function byn(e={}){return{...uB(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function Ylt(e,t="dialog"){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:a,onOpenChangeComplete:i,disablePointerDismissal:o=!1,modal:c=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:p=null}=e,h=t==="drawer",m=t==="alert-dialog",g=m?!0:c,v=m||o,b=m?"alertdialog":"dialog",S=Fw(!0),O={modal:g,disablePointerDismissal:v,nested:!!S,role:b},E=dye.useStore(d?.store,{open:s,openProp:r,activeTriggerId:p,triggerIdProp:f,...O});YM(()=>{const P=r===void 0&&E.state.open===!1&&s===!0?{open:!0,activeTriggerId:p}:null;m?E.update(P?{...O,...P}:O):P&&E.update(P)}),E.useControlledProp("openProp",r),E.useControlledProp("triggerIdProp",f),E.useSyncedValues(O),E.useContextCallback("onOpenChange",a),E.useContextCallback("onOpenChangeComplete",i);const _=E.useState("open"),C=E.useState("mounted"),j=E.useState("payload"),I=gyn({store:E,actionsRef:u,parentContext:S?.store.context,isDrawer:h}),N=_||C,R=y.useMemo(()=>({store:E}),[E]);return l.jsx(Glt.Provider,{value:!1,children:l.jsxs(Qlt.Provider,{value:R,children:[N&&l.jsx(vyn,{store:E,dialogRoot:I}),typeof n=="function"?n({payload:j}):n]})})}function xyn(e){return Ylt(e,"alert-dialog")}const wyn={...Dw,...Hm},Xlt=y.forwardRef(function(t,n){const{render:r,className:s,style:a,forceRender:i=!1,...o}=t,{store:c}=Fw(),u=c.useState("open"),d=c.useState("nested"),f=c.useState("mounted"),p=c.useState("transitionStatus");return vr("div",t,{state:{open:u,transitionStatus:p},ref:[c.context.backdropRef,n],stateAttributesMapping:wyn,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},o],enabled:i||!d})}),Klt=y.createContext(void 0);function fye(e=!1){const t=y.useContext(Klt);if(t===void 0&&!e)throw new Error(js(16));return t}function Syn(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:a}=e,i=r&&t!==!1,o=r&&t===!1;return{props:y.useMemo(()=>{const u={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return r||(u.tabIndex=s,!a&&n&&(u.tabIndex=t?s:-1)),(a&&(t||i)||!a&&n)&&(u["aria-disabled"]=n),a&&(!t||o)&&(u.disabled=n),u},[r,n,t,i,o,a,s])}}function Mv(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:a}=e,i=y.useRef(null),o=fye(!0),c=a??o!==void 0,{props:u}=Syn({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:s}),d=y.useCallback(()=>{const h=i.current;IQ(h)&&c&&t&&u.disabled===void 0&&h.disabled&&(h.disabled=!1)},[t,u.disabled,c]);Zt(d,[d]);const f=y.useCallback((h={})=>{const{onClick:m,onMouseDown:g,onKeyUp:v,onKeyDown:b,onPointerDown:S,...w}=h;return ou({onClick(O){if(t){O.preventDefault();return}m?.(O)},onMouseDown(O){t||g?.(O)},onKeyDown(O){if(t||(Vz(O),b?.(O),O.baseUIHandlerPrevented))return;const E=O.target===O.currentTarget,_=O.currentTarget,C=IQ(_),j=!s&&kyn(_),I=E&&(s?C:!j),N=O.key==="Enter",R=O.key===" ",P=_.getAttribute("role"),B=P?.startsWith("menuitem")||P==="option"||P==="gridcell";if(E&&c&&R){if(O.defaultPrevented&&B)return;O.preventDefault(),j||s&&C?(_.click(),O.preventBaseUIHandler()):I&&(m?.(O),O.preventBaseUIHandler());return}I&&(!s&&(R||N)&&O.preventDefault(),!s&&N&&m?.(O))},onKeyUp(O){if(!t){if(Vz(O),v?.(O),O.target===O.currentTarget&&s&&c&&IQ(O.currentTarget)&&O.key===" "){O.preventDefault();return}O.baseUIHandlerPrevented||O.target===O.currentTarget&&!s&&!c&&O.key===" "&&m?.(O)}},onPointerDown(O){if(t){O.preventDefault();return}S?.(O)}},s?{type:"button"}:{role:"button"},u,w)},[t,u,c,s]),p=Pt(h=>{i.current=h,d()});return{getButtonProps:f,buttonRef:p}}function IQ(e){return _a(e)&&e.tagName==="BUTTON"}function kyn(e){return!!(e?.tagName==="A"&&e?.href)}const $B=y.forwardRef(function(t,n){const{render:r,className:s,style:a,disabled:i=!1,nativeButton:o=!0,...c}=t,{store:u}=Fw(),d=u.useState("open"),{getButtonProps:f,buttonRef:p}=Mv({disabled:i,native:o}),h={disabled:i};function m(g){d&&u.setOpen(!1,yn(Ege,g.nativeEvent))}return vr("button",t,{state:h,ref:[n,p],props:[{onClick:m},c,f]})}),Jlt=y.forwardRef(function(t,n){const{render:r,className:s,style:a,id:i,...o}=t,{store:c}=Fw(),u=Dl(i);return c.useSyncedValueWithCleanup("descriptionElementId",u),vr("p",t,{ref:n,props:[{id:u},o]})});let Oyn=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),_yn=(function(e){return e[e.open=SS.open]="open",e[e.closed=SS.closed]="closed",e[e.startingStyle=SS.startingStyle]="startingStyle",e[e.endingStyle=SS.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const ect=y.createContext(void 0);function Eyn(){const e=y.useContext(ect);if(e===void 0)throw new Error(js(26));return e}const mC="ArrowUp",ES="ArrowDown",VP="ArrowLeft",gC="ArrowRight",h$="Home",m$="End",tct="PageUp",nct="PageDown",rct=new Set([VP,gC]),Cyn=new Set([VP,gC,h$,m$]),sct=new Set([mC,ES]),Tyn=new Set([mC,ES,h$,m$]),act=new Set([...rct,...sct]),Aj=new Set([...act,h$,m$]),jyn="Shift",Iyn="Control",Nyn="Alt",Ayn="Meta",Ryn=new Set([jyn,Iyn,Nyn,Ayn]);function Pyn(e){return _a(e)&&e.tagName==="INPUT"}function b2e(e){return!!(Pyn(e)&&e.selectionStart!=null||_a(e)&&e.tagName==="TEXTAREA")}function x2e(e,t,n,r){if(!e||!t||!t.scrollTo)return;let s=e.scrollLeft,a=e.scrollTop;const i=e.clientWidth<e.scrollWidth,o=e.clientHeight<e.scrollHeight;if(i&&r!=="vertical"){const c=w2e(e,t,"left"),u=dL(e),d=dL(t);n==="ltr"&&(c+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight?s=c+t.offsetWidth+d.scrollMarginRight-e.clientWidth+u.scrollPaddingRight:c-d.scrollMarginLeft<e.scrollLeft+u.scrollPaddingLeft&&(s=c-d.scrollMarginLeft-u.scrollPaddingLeft)),n==="rtl"&&(c-d.scrollMarginRight<e.scrollLeft+u.scrollPaddingLeft?s=c-d.scrollMarginLeft-u.scrollPaddingLeft:c+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight&&(s=c+t.offsetWidth+d.scrollMarginRight-e.clientWidth+u.scrollPaddingRight))}if(o&&r!=="horizontal"){const c=w2e(e,t,"top"),u=dL(e),d=dL(t);c-d.scrollMarginTop<e.scrollTop+u.scrollPaddingTop?a=c-d.scrollMarginTop-u.scrollPaddingTop:c+t.offsetHeight+d.scrollMarginBottom>e.scrollTop+e.clientHeight-u.scrollPaddingBottom&&(a=c+t.offsetHeight+d.scrollMarginBottom-e.clientHeight+u.scrollPaddingBottom)}e.scrollTo({left:s,top:a,behavior:"auto"})}function w2e(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let s=0;for(;t.offsetParent&&(s+=t[r],t.offsetParent!==e);)t=t.offsetParent;return s}function dL(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const Myn={...Dw,...Hm,nestedDialogOpen(e){return e?{[_yn.nestedDialogOpen]:""}:null}},ict=y.forwardRef(function(t,n){const{render:r,className:s,style:a,finalFocus:i,initialFocus:o,...c}=t,{store:u}=Fw(),d=u.useState("descriptionElementId"),f=u.useState("disablePointerDismissal"),p=u.useState("floatingRootContext"),h=u.useState("popupProps"),m=u.useState("modal"),g=u.useState("mounted"),v=u.useState("nested"),b=u.useState("nestedOpenDialogCount"),S=u.useState("open"),w=u.useState("openMethod"),O=u.useState("titleElementId"),E=u.useState("transitionStatus"),_=u.useState("role"),C=p.useState("floatingId"),j=c.id??C;Eyn(),Rh({open:S,ref:u.context.popupRef,onComplete(){S&&u.context.onOpenChangeComplete?.(!0)}});function I(L){return L==="touch"?u.context.popupRef.current:!0}const N=o===void 0?I:o,R=b>0,P=u.useStateSetter("popupElement"),M=vr("div",t,{state:{open:S,nested:v,transitionStatus:E,nestedDialogOpen:R},props:[h,{id:j,"aria-labelledby":O??void 0,"aria-describedby":d??void 0,role:_,...bO,hidden:!g,onKeyDown(L){Aj.has(L.key)&&L.stopPropagation()},style:{[Oyn.nestedDialogs]:b}},c],ref:[n,u.context.popupRef,P],stateAttributesMapping:Myn});return l.jsx(rB,{context:p,openInteractionType:w,disabled:!g,closeOnFocusOut:!f,initialFocus:N,returnFocus:i,modal:m!==!1,restoreFocus:"popup",children:M})}),DB=y.forwardRef(function(t,n){const{cutout:r,...s}=t;let a;if(r){const i=r.getBoundingClientRect();a=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return l.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})}),oct=y.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,{store:a}=Fw(),i=a.useState("mounted"),o=a.useState("modal"),c=a.useState("open");return i||r?l.jsx(ect.Provider,{value:r,children:l.jsxs(nB,{ref:n,...s,children:[i&&o===!0&&l.jsx(DB,{ref:a.context.internalBackdropRef,inert:s$(!c)}),t.children]})}):null}),lct=y.forwardRef(function(t,n){const{render:r,className:s,style:a,id:i,...o}=t,{store:c}=Fw(),u=Dl(i);return c.useSyncedValueWithCleanup("titleElementId",u),vr("h2",t,{ref:n,props:[{id:u},o]})});function $yn(e){const t=y.useRef(""),n=y.useCallback(s=>{s.defaultPrevented||(t.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:y.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,t.current),t.current=""},[e]),onPointerDown:n}}function PE(e,t){const n=y.useRef(e),r=Pt(t);Zt(()=>{n.current!==e&&r(n.current)},[e,r]),Zt(()=>{n.current=e},[e])}function pye(e,t){const n=Pt((a,i)=>{(typeof e=="function"?e():e)||t(i||(Oge?"touch":""))}),{onClick:r,onPointerDown:s}=$yn(n);return y.useMemo(()=>({onClick:r,onPointerDown:s}),[r,s])}function cct(e){const[t,n]=y.useState(null),r=pye(e,n);return PE(e,s=>{s&&!e&&n(null)}),y.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}const uct=y.forwardRef(function(t,n){const{render:r,className:s,style:a,disabled:i=!1,nativeButton:o=!0,id:c,payload:u,handle:d,...f}=t,p=Fw(!0),h=d?.store??p?.store;if(!h)throw new Error(js(79));const m=Dl(c),g=h.useState("floatingRootContext"),v=h.useState("isOpenedByTrigger",m),b=h.useState("triggerPopupId",m),S=y.useRef(null),{registerTrigger:w,isMountedByThisTrigger:O}=iB(m,S,h,{payload:u}),{getButtonProps:E,buttonRef:_}=Mv({disabled:i,native:o}),C=wj(g,{enabled:g!=null}),j=pye(()=>h.select("open"),R=>{h.set("openMethod",R)}),I={disabled:i,open:v},N=h.useState("triggerProps",O);return vr("button",t,{state:I,ref:[_,n,w,S],props:[C.reference,N,j,{[Rge]:"",id:m,"aria-haspopup":"dialog","aria-expanded":v,"aria-controls":b},f,E],stateAttributesMapping:mB})}),Dyn=uct;function LB(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var zB="Checkbox",[Lyn]=Vm(zB),[zyn,hye]=Lyn(zB);function Fyn(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:a,form:i,name:o,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[p,h]=ew({prop:n,defaultProp:s??!1,onChange:c,caller:zB}),[m,g]=y.useState(null),[v,b]=y.useState(null),S=y.useRef(!1),w=m?!!i||!!m.closest("form"):!0,O={checked:p,disabled:a,setChecked:h,control:m,setControl:g,name:o,form:i,value:d,hasConsumerStoppedPropagationRef:S,required:u,defaultChecked:j0(s)?!1:s,isFormControl:w,bubbleInput:v,setBubbleInput:b};return l.jsx(zyn,{scope:t,...O,children:Byn(f)?f(O):r})}var dct="CheckboxTrigger",fct=y.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:a,value:i,disabled:o,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:m}=hye(dct,e),g=Ts(s,d),v=y.useRef(c);return y.useEffect(()=>{const b=a?.form;if(b){const S=()=>f(v.current);return b.addEventListener("reset",S),()=>b.removeEventListener("reset",S)}},[a,f]),l.jsx(us.button,{type:"button",role:"checkbox","aria-checked":j0(c)?"mixed":c,"aria-required":u,"data-state":vct(c),"data-disabled":o?"":void 0,disabled:o,value:i,...r,ref:g,onKeyDown:qn(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:qn(n,b=>{f(S=>j0(S)?!0:!S),m&&h&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})})});fct.displayName=dct;var mye=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:a,required:i,disabled:o,value:c,onCheckedChange:u,form:d,...f}=e;return l.jsx(Fyn,{__scopeCheckbox:n,checked:s,defaultChecked:a,disabled:o,required:i,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:p})=>l.jsxs(l.Fragment,{children:[l.jsx(fct,{...f,ref:t,__scopeCheckbox:n}),p&&l.jsx(gct,{__scopeCheckbox:n})]})})});mye.displayName=zB;var pct="CheckboxIndicator",hct=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,a=hye(pct,n);return l.jsx(Mb,{present:r||j0(a.checked)||a.checked===!0,children:l.jsx(us.span,{"data-state":vct(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});hct.displayName=pct;var mct="CheckboxBubbleInput",gct=y.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:a,defaultChecked:i,required:o,disabled:c,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:h}=hye(mct,e),m=Ts(n,h),g=LB(a),v=H7(r);y.useEffect(()=>{const S=p;if(!S)return;const w=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(w,"checked").set,_=!s.current;if(g!==a&&E){const C=new Event("click",{bubbles:_});S.indeterminate=j0(a),E.call(S,j0(a)?!1:a),S.dispatchEvent(C)}},[p,g,a,s]);const b=y.useRef(j0(a)?!1:a);return l.jsx(us.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??b.current,required:o,disabled:c,name:u,value:d,form:f,...t,tabIndex:-1,ref:m,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});gct.displayName=mct;function Byn(e){return typeof e=="function"}function j0(e){return e==="indeterminate"}function vct(e){return j0(e)?"indeterminate":e?"checked":"unchecked"}function I0({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=y.useRef(e!==void 0),[a,i]=y.useState(t),o=s?e:a,c=y.useCallback(u=>{s||i(u)},[]);return[o,c]}function Uyn(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:s}=e,[a,i]=I0({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:o,setMounted:c,transitionStatus:u}=yO(a,!0,!0),d=Dl(),[f,p]=y.useState(),h=f??d,m=Pt(g=>{const v=!a,b=yn(hv,g.nativeEvent);r(v,b),!b.isCanceled&&i(v)});return y.useMemo(()=>({disabled:s,handleTrigger:m,mounted:o,open:a,panelId:h,setMounted:c,setOpen:i,setPanelIdState:p,transitionStatus:u}),[s,m,o,a,h,c,i,p,u])}const yct=y.createContext(void 0);function bct(){const e=y.useContext(yct);if(e===void 0)throw new Error(js(15));return e}let gye=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=ub.startingStyle]="startingStyle",e[e.endingStyle=ub.endingStyle]="endingStyle",e})({}),qyn=(function(e){return e.panelOpen="data-panel-open",e})({});const Vyn={[gye.open]:""},Hyn={[gye.closed]:""},Zyn={open(e){return e?{[qyn.panelOpen]:""}:null}},Wyn={open(e){return e?Vyn:Hyn}},xct={...Wyn,...Hm},Gyn=y.forwardRef(function(t,n){const{render:r,className:s,defaultOpen:a=!1,disabled:i=!1,onOpenChange:o,open:c,style:u,...d}=t,f=Pt(o),p=Uyn({open:c,defaultOpen:a,onOpenChange:f,disabled:i}),h=y.useMemo(()=>({open:p.open,disabled:p.disabled,transitionStatus:p.transitionStatus}),[p.open,p.disabled,p.transitionStatus]),m=y.useMemo(()=>({...p,onOpenChange:f,state:h}),[p,f,h]),g=vr("div",t,{state:h,ref:n,props:d,stateAttributesMapping:xct});return l.jsx(yct.Provider,{value:m,children:g})}),Qyn={...Zyn,...Hm},Yyn=y.forwardRef(function(t,n){const{panelId:r,open:s,handleTrigger:a,state:i,disabled:o}=bct(),{className:c,disabled:u=o,id:d,render:f,nativeButton:p=!0,style:h,...m}=t,{getButtonProps:g,buttonRef:v}=Mv({disabled:u,focusableWhenDisabled:!0,native:p});return vr("button",t,{state:i,ref:[n,v],props:[{"aria-controls":s?r:void 0,"aria-expanded":s,onClick:a},m,g],stateAttributesMapping:Qyn})}),IN={height:void 0,width:void 0};function Xyn(e){const{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:s,mounted:a,onOpenChange:i,open:o,setMounted:c,setOpen:u,transitionStatus:d}=e,f=y.useRef(null),p=y.useRef(null),[h,m]=y.useState(IN),g=y.useRef(IN),v=y.useRef(!1),b=y.useRef(o),S=y.useRef(!1),[w,O]=y.useState(!1),E=y.useRef(null),_=Im(t,f),C=uo({mounted:a,open:o}),j=aB(f,!1,!1),I=!o&&!a,N=w?"idle":d,R=o&&(b.current||S.current),P=!o&&a&&p.current==="css-animation"&&h.height===void 0&&h.width===void 0?g.current:h,B=n&&I&&p.current!=="css-animation",M=Pt((H,D=!0)=>{D&&(g.current=H),m(H)}),L=Pt(()=>{E.current?.(),E.current=null}),F=Pt(H=>{L(),E.current=()=>{E.current=null,H()}}),z=Pt(()=>{o&&a&&p.current==="css-animation"&&(S.current=!0)});Zt(()=>{!w||d==="starting"||O(!1)},[w,d]),y.useEffect(()=>()=>{z(),L()},[z,L]),Zt(()=>{const H=f.current;if(!H)return;!o&&E.current&&L();const D=Kyn(H,R);if(p.current=D,o&&d==="idle"&&b.current&&D==="css-animation"){g.current=T_(H);return}if(o&&d==="starting"){const $=v.current;if(v.current=!1,D==="none"){M(T_(H)),O(!0);return}if(D==="css-transition"){const Z=Jyn(H);if(M(T_(H)),!$)return Z;const G=NN(H,"transition-duration","0s");return F(G),O(!0),Z}if(D==="css-animation"){if(M(T_(H)),!$){NN(H,"animation-name","none")();return}const Z=NN(H,"animation-name","none"),G=NN(H,"animation-duration","0s");Z(),F(G),O(!0);return}}if(!o&&a&&(d==="idle"||d==="starting")){if(D==="none"){M(IN,!1),c(!1);return}D==="css-animation"&&(b.current=!1,S.current=!1),M(T_(H));return}if(d!=="ending")return;if(D==="none"){c(!1);return}const Y=T_(H);if(!((Y.height??0)>0||(Y.width??0)>0)){c(!1);return}M(Y),D==="css-animation"&&NN(H,"animation-name","none")()},[a,o,L,M,c,F,R,d]),Rh({enabled:o&&a&&N==="idle",open:!0,ref:f,onComplete(){o&&M(IN,!1)}}),y.useEffect(()=>{if(o||!a||N!=="ending"||!f.current)return;const D=new AbortController;let Y=-1;function V(){C.current.open||(c(!1),M(IN,!1))}return Y=Od.request(()=>{D.signal.aborted||j(V,D.signal)}),()=>{Od.cancel(Y),D.abort()}},[C,a,o,N,j,M,c]),Zt(()=>{const H=f.current;!H||!n||!I||H.setAttribute("hidden","until-found")},[I,n]),y.useEffect(function(){const D=f.current;if(!D)return;function Y(V){v.current=!0,u(!0),i(!0,yn(Kc,V))}return Jr(D,"beforematch",Y)},[i,u]);const U=s||n||a||o;return{height:P.height,props:{...B?{[gye.startingStyle]:""}:void 0,hidden:I,id:r},ref:_,shouldPreventOpenAnimation:R,shouldRender:U,transitionStatus:N,width:P.width}}function T_(e){return{height:e.scrollHeight,width:e.scrollWidth}}function Kyn(e,t=!1){const n=Li(e).getComputedStyle(e),r=(n.animationName.split(",").map(a=>a.trim()).some(a=>a!==""&&a!=="none")||t)&&S2e(n.animationDuration),s=S2e(n.transitionDuration);return r&&s||s?"css-transition":r?"css-animation":"none"}function S2e(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function NN(e,t,n){const r=e.style.getPropertyValue(t),s=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===""){e.style.removeProperty(t);return}e.style.setProperty(t,r,s)}}function Jyn(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(s=>{e.style.setProperty(s,"initial","important")});function n(){Object.entries(t).forEach(([s,a])=>{if(a===""){e.style.removeProperty(s);return}e.style.setProperty(s,a)})}const r=Od.request(n);return()=>{Od.cancel(r),n()}}let k2e=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});const ebn=y.forwardRef(function(t,n){const{className:r,hiddenUntilFound:s,keepMounted:a,render:i,id:o,style:c,...u}=t,{mounted:d,onOpenChange:f,open:p,panelId:h,setMounted:m,setPanelIdState:g,setOpen:v,state:b,transitionStatus:S}=bct(),w=s??!1,O=a??!1;Zt(()=>{if(o)return g(o),()=>{g(void 0)}},[o,g]);const{height:E,props:_,ref:C,shouldPreventOpenAnimation:j,shouldRender:I,transitionStatus:N,width:R}=Xyn({externalRef:n,hiddenUntilFound:w,id:h,keepMounted:O,mounted:d,onOpenChange:f,open:p,setMounted:m,setOpen:v,transitionStatus:S}),P={...b,transitionStatus:N},B=Crt(c,P),M=vr("div",{...t,style:void 0},{state:P,ref:C,props:[_,{style:{[k2e.collapsiblePanelHeight]:E===void 0?"auto":`${E}px`,[k2e.collapsiblePanelWidth]:R===void 0?"auto":`${R}px`}},u,B?{style:B}:void 0,j?{style:{animationName:"none"}}:void 0],stateAttributesMapping:xct});return I?M:null}),wct=y.createContext(void 0),Sct=y.createContext(void 0),kct=y.createContext(void 0),Oct=y.createContext("");function $v(){const e=y.useContext(wct);if(!e)throw new Error(js(22));return e}function FB(){const e=y.useContext(Sct);if(!e)throw new Error(js(23));return e}function Bw(){const e=y.useContext(kct);if(!e)throw new Error(js(24));return e}function _ct(){return y.useContext(Oct)}const tbn=(e,t)=>Object.is(e,t);function wk(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function nbn(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:wk(t,r,n))}function Nue(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:wk(r,t,n))}function rbn(e,t,n){return e.filter(r=>!wk(t,r,n))}function Aue(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function vye(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function sbn(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(vye(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function Vu(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Aue(e)}function AN(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Aue(e.value):Aue(e)}function Ect(e,t,n){function r(){return Vu(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const s=t,a=vye(s)?s.flatMap(i=>i.items):s;if(e==null||typeof e!="object"){const i=a.find(o=>o.value===e);return i&&i.label!=null?i.label:r()}if("value"in e){const i=a.find(o=>o&&o.value===e.value);if(i&&i.label!=null)return i.label}}return r()}function abn(e,t,n){return e.reduce((r,s,a)=>(a>0&&r.push(", "),r.push(l.jsx(y.Fragment,{children:Ect(s,t,n)},a)),r),[])}const nn={id:bt(e=>e.id),labelId:bt(e=>e.labelId),items:bt(e=>e.items),selectedValue:bt(e=>e.selectedValue),hasSelectionChips:bt(e=>{const t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:bt(e=>{const{selectedValue:t,selectionMode:n}=e;return t==null?!1:n==="multiple"&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:bt((e,t)=>t?sbn(e.items):!1),open:bt(e=>e.open),mounted:bt(e=>e.mounted),forceMounted:bt(e=>e.forceMounted),inline:bt(e=>e.inline),activeIndex:bt(e=>e.activeIndex),selectedIndex:bt(e=>e.selectedIndex),isActive:bt((e,t)=>e.activeIndex===t),isSelected:bt((e,t)=>{const n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(s=>wk(t,s,n)):wk(t,r,n)}),transitionStatus:bt(e=>e.transitionStatus),popupProps:bt(e=>e.popupProps),inputProps:bt(e=>e.inputProps),triggerProps:bt(e=>e.triggerProps),itemProps:bt(e=>e.itemProps),positionerElement:bt(e=>e.positionerElement),listElement:bt(e=>e.listElement),triggerElement:bt(e=>e.triggerElement),inputElement:bt(e=>e.inputElement),inputGroupElement:bt(e=>e.inputGroupElement),popupSide:bt(e=>e.popupSide),openMethod:bt(e=>e.openMethod),inputInsidePopup:bt(e=>e.inputInsidePopup),inputOwnsFormValue:bt(e=>e.inputOwnsFormValue),selectionMode:bt(e=>e.selectionMode),name:bt(e=>e.name),form:bt(e=>e.form),disabled:bt(e=>e.disabled),readOnly:bt(e=>e.readOnly),required:bt(e=>e.required),grid:bt(e=>e.grid),virtualized:bt(e=>e.virtualized),itemToStringLabel:bt(e=>e.itemToStringLabel),isItemEqualToValue:bt(e=>e.isItemEqualToValue),modal:bt(e=>e.modal),autoHighlight:bt(e=>e.autoHighlight),submitOnItemClick:bt(e=>e.submitOnItemClick)};let O2e=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const ibn={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},ME={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},obn={disabled:!1,...ME},Cct={valid(e){return e===null?null:e?{[O2e.valid]:""}:{[O2e.invalid]:""}}},Tct={invalid:void 0,name:void 0,validityData:{state:ibn,errors:[],error:"",value:"",initialValue:null},setValidityData:_i,disabled:void 0,touched:ME.touched,setTouched:_i,dirty:ME.dirty,setDirty:_i,filled:ME.filled,setFilled:_i,focused:ME.focused,setFocused:_i,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:obn,markedDirtyRef:{current:!1},registerFieldControl:_i,validation:{getValidationProps:(e=ya)=>e,getInputValidationProps:(e=ya)=>e,inputRef:{current:null},commit:async()=>{}}},jct=y.createContext(Tct);function Rj(e=!0){const t=y.useContext(jct);if(t.setValidityData===_i&&!e)throw new Error(js(28));return t}function Ict(e,t,n,r,s=!0){const{registerFieldControl:a}=Rj(),i=y.useRef(null);i.current||(i.current=Symbol()),Zt(()=>{const o=i.current;return!o||!s?void 0:(a(o,{controlRef:e,getValue:r,id:t,value:n}),()=>{a(o,void 0)})},[e,s,r,t,a,n])}const lbn=y.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:_i,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Nct(){return y.useContext(lbn)}const cbn=y.createContext({controlId:void 0,registerControlId:_i,labelId:void 0,setLabelId:_i,messageIds:[],setMessageIds:_i,getDescriptionProps:e=>e});function BB(){return y.useContext(cbn)}function yye(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:s,registerControlId:a}=BB(),i=Dl(t),o=n?s:void 0,c=mu(()=>Symbol("labelable-control")),u=y.useRef(!1),d=y.useRef(t!=null),f=Pt(()=>{!u.current||a===_i||(u.current=!1,a(c.current,void 0))});return Zt(()=>{if(a===_i)return;let p;if(n){const h=r?.current;zr(h)&&h.closest("label")!=null?p=t??null:p=o??i}else if(t!=null)d.current=!0,p=t;else if(d.current)p=i;else{f();return}if(p===void 0){f();return}u.current=!0,a(c.current,p)},[t,r,o,a,n,i,c,f]),y.useEffect(()=>f,[f]),s??i}function ubn(e,t){return(n,r)=>{if(n==null)return!1;const s=Vu(n,t);return e.contains(s,r)}}function dbn(e,t,n){return(r,s)=>{if(r==null)return!1;if(!s)return!0;const a=Vu(r,t),i=n!=null?Vu(n,t):"";return i&&e.contains(i,s)&&i.length===s.length?!0:e.contains(a,s)}}const _2e=new Map;function fbn(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${Act(e.locale)}|${JSON.stringify(t)}`,r=_2e.get(n);if(r)return r;const s=new Intl.Collator(e.locale,t),a={contains(i,o,c){if(!o)return!0;const u=Vu(i,c);for(let d=0;d<=u.length-o.length;d+=1)if(s.compare(u.slice(d,d+o.length),o)===0)return!0;return!1},startsWith(i,o,c){if(!o)return!0;const u=Vu(i,c);return s.compare(u.slice(0,o.length),o)===0},endsWith(i,o,c){if(!o)return!0;const u=Vu(i,c),d=o.length;return u.length>=d&&s.compare(u.slice(u.length-d),o)===0}};return _2e.set(n,a),a}function Act(e){return Array.isArray(e)?e.map(t=>Act(t)).join(","):e==null?"":String(e)}const pbn=fbn,Rct=Symbol("none"),j1={value:Rct,index:-1};function hbn(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:s,onSelectedValueChange:a,defaultInputValue:i,inputValue:o,open:c,defaultOpen:u=!1,selectionMode:d="none",onItemHighlighted:f,name:p,form:h,disabled:m=!1,readOnly:g=!1,required:v=!1,inputRef:b,grid:S=!1,items:w,filteredItems:O,filter:E,openOnInputClick:_=!0,autoHighlight:C=!1,keepHighlight:j=!1,highlightItemOnHover:I=!0,loopFocus:N=!0,itemToStringLabel:R,itemToStringValue:P,isItemEqualToValue:B=tbn,virtualized:M=!1,inline:L=!1,fillInputOnItemPress:F=!0,modal:z=!1,limit:U=-1,autoComplete:H="list",formAutoComplete:D,locale:Y,submitOnItemClick:V=!1}=e,{clearErrors:$}=Nct(),{setDirty:Z,validityData:G,shouldValidateOnChange:K,setFilled:ne,name:ee,disabled:J,setTouched:se,setFocused:ae,validationMode:Q,validation:te}=Rj(),le=Db(),fe=yye({id:t}),ce=pbn({locale:Y}),[ye,we]=y.useState(!1),[ke,Re]=y.useState(null),De=y.useRef([]),Ue=y.useRef([]),ot=y.useRef(null),pe=y.useRef(null),de=y.useRef(null),ie=y.useRef(null),ge=y.useRef(null),ue=y.useRef(!0),xe=y.useRef(!1),Se=y.useRef(null),Fe=y.useRef(null),ze=y.useRef(null),Ke=y.useRef(j1),Ne=y.useRef(null),qe=y.useRef([]),Ie=y.useRef([]),Ge=J||m,Le=ee??p,Je=d==="multiple",st=d==="single",fn=o!==void 0||i!==void 0,Nt=w!==void 0,Mn=O!==void 0;let Tt;C==="always"?Tt="always":Tt=C?"input-change":!1;const[Ft,ur]=I0({controlled:s,default:Je?r??Bg:r,name:"Combobox",state:"selectedValue"}),_t=y.useMemo(()=>E===null?()=>!0:E!==void 0?E:st&&!ye?dbn(ce,R,Ft):ubn(ce,R),[E,st,Ft,ye,ce,R]),Rt=mu(()=>fn?i??"":st?Vu(Ft,R):"").current,[Mt,vn]=I0({controlled:o,default:Rt,name:"Combobox",state:"inputValue"}),[_n,_e]=I0({controlled:c,default:u,name:"Combobox",state:"open"}),Pe=vye(w),je=ke??(Mt===""?"":String(Mt).trim()),rt=st?Vu(Ft,R):"",ht=st&&!ye&&je!==""&&rt!==""&&rt.length===je.length&&ce.contains(rt,je),$t=ht?"":je,Gt=Nt&&Mn&&ht,At=y.useMemo(()=>w?Pe?w.flatMap(an=>an.items):w:Bg,[w,Pe]),dt=y.useMemo(()=>{if(O&&!Gt)return O;if(!w)return Bg;if(Pe){const Hn=w,ms=[];let ha=0;for(const qi of Hn){if(U>-1&&ha>=U)break;const ja=$t===""?qi.items:qi.items.filter(lf=>_t(lf,$t,R));if(ja.length===0)continue;const Zh=U>-1?U-ha:1/0,pd=ja.slice(0,Zh);if(pd.length>0){const lf={...qi,items:pd};ms.push(lf),ha+=pd.length}}return ms}if($t==="")return U>-1?At.slice(0,U):At;const an=[];for(const Hn of At){if(U>-1&&an.length>=U)break;_t(Hn,$t,R)&&an.push(Hn)}return an},[O,Gt,w,Pe,$t,U,_t,R,At]),yt=y.useMemo(()=>Pe?dt.flatMap(Hn=>Hn.items):dt,[dt,Pe]),ct=mu(()=>new Hrt({id:fe,labelId:void 0,selectedValue:Ft,open:_n,filter:_t,query:je,items:w,selectionMode:d,listRef:De,labelsRef:Ue,popupRef:ot,emptyRef:ge,inputRef:pe,startDismissRef:de,endDismissRef:ie,keyboardActiveRef:ue,chipsContainerRef:Se,clearRef:Fe,valuesRef:qe,allValuesRef:Ie,selectionEventRef:ze,name:Le,form:h,disabled:Ge,readOnly:g,required:v,grid:S,isGrouped:Pe,virtualized:M,openOnInputClick:_,itemToStringLabel:R,isItemEqualToValue:B,modal:z,autoHighlight:Tt,submitOnItemClick:V,hasInputValue:fn,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:L,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},itemProps:ya,positionerElement:null,listElement:null,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:d==="none",onOpenChangeComplete:n||_i,setOpen:_i,setInputValue:_i,setSelectedValue:_i,setIndices:_i,onItemHighlighted:_i,handleSelection:_i,forceMount:_i,requestSubmit:_i})).current,cn=d==="none"?Mt:Ft,Sr=y.useMemo(()=>d==="none"?cn:Array.isArray(Ft)?Ft.map(an=>AN(an,P)):AN(Ft,P),[cn,P,d,Ft]),xr=Pt(f),Qr=Pt(n),Hs=Yt(ct,nn.activeIndex),Ii=Yt(ct,nn.selectedIndex),Cr=Yt(ct,nn.positionerElement),xi=Yt(ct,nn.listElement),Bo=Yt(ct,nn.triggerElement),xl=Yt(ct,nn.inputElement),pa=Yt(ct,nn.inputGroupElement),Ta=Yt(ct,nn.inline),wl=Yt(ct,nn.inputInsidePopup),cc=Yt(ct,nn.inputOwnsFormValue),Bl=uo(Bo),{mounted:Tp,setMounted:Uh,transitionStatus:Fr}=yO(_n),{openMethod:ro,triggerProps:uc}=cct(_n),Lc=Pt(()=>Sr);Ict(wl?Bl:pe,fe,cn,Lc);const ss=Pt(()=>{w?Ue.current=yt.map(an=>Vu(an,R)):ct.set("forceMounted",!0)}),Uo=y.useRef(Ft);Zt(()=>{Ft!==Uo.current&&ss()},[ss,Ft]);const Sl=Pt(an=>{ct.update(an);const Hn=an.type||"none";if(an.activeIndex!==void 0)if(an.activeIndex===null)Ke.current!==j1&&(Ke.current=j1,xr(void 0,fS(Hn,void 0,{index:-1})));else{const ms=qe.current[an.activeIndex];Ke.current={value:ms,index:an.activeIndex},xr(ms,fS(Hn,void 0,{index:an.activeIndex}))}}),Ul=Pt((an,Hn)=>{if(xe.current=Hn.reason===Iy,e.onInputValueChange?.(an,Hn),!Hn.isCanceled){if(Hn.reason===wS){const ms=Hn.event,ha=ms.inputType;if(ms.type==="compositionend"||ha!=null&&ha!==""&&ha!=="insertReplacementText"){const ja=an.trim()!=="";ja&&we(!0),Ne.current={hasQuery:ja},ja&&Tt&&ct.state.activeIndex==null&&ct.set("activeIndex",0)}}vn(an)}}),qh=Pt((an,Hn)=>{if(_n!==an&&(Hn.reason==="escape-key"&&Nt&&yt.length===0&&!ct.state.emptyRef.current&&Hn.allowPropagation(),e.onOpenChange?.(an,Hn),!Hn.isCanceled&&(an&&Je&&wl&&!Ta&&ke!==null&&(we(!1),Re(null),Mt!==""&&Ul("",yn(Iy,Hn.event))),!an&&ye&&(st?(Ta||Re(je),je===""&&we(!1)):Je&&(Ta||Re(je),wl&&Sl({activeIndex:null}),(!wl||Ta)&&Ul("",yn(Iy,Hn.event)))),_e(an),!an&&wl&&(Hn.reason===tw||Hn.reason===J7)&&(se(!0),ae(!1),Q==="onBlur")))){const ms=d==="none"?Mt:Ft;te.commit(ms)}}),ag=Pt((an,Hn)=>{if(a?.(an,Hn),Hn.isCanceled)return;ur(an),(d==="none"&&ot.current&&F||st&&!ct.state.inputInsidePopup)&&Ul(Vu(an,R),yn(Hn.reason,Hn.event)),st&&an!=null&&Hn.reason!==wS&&ye&&!Ta&&Re(je)}),sx=Pt((an,Hn)=>{let ms=Hn;if(ms===void 0){if(Hs===null)return;ms=qe.current[Hs]}const ha=mo(an),qi=ze.current??an;ze.current=null;const ja=yn(JM,qi),Zh=ha?.closest("a")?.getAttribute("href");if(Zh){Zh.startsWith("#")&&qh(!1,ja);return}if(Je){const pd=Array.isArray(Ft)?Ft:[],SI=nbn(pd,ms,ct.state.isItemEqualToValue)?rbn(pd,ms,ct.state.isItemEqualToValue):[...pd,ms];if(ag(SI,ja),!(pe.current?pe.current.value.trim()!=="":!1))return;ct.state.inputInsidePopup?Ul("",yn(Iy,ja.event)):qh(!1,ja)}else ag(ms,ja),qh(!1,ja)}),n1=Pt(()=>{if(!ct.state.submitOnItemClick)return;const an=te.inputRef.current?.form??ct.state.inputElement?.form;an&&typeof an.requestSubmit=="function"&&an.requestSubmit()}),nl=Pt(()=>{if(Uh(!1),Qr?.(!1),we(!1),Re(null),Sl(d==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Je&&pe.current&&pe.current.value!==""&&!xe.current&&Ul("",yn(Iy)),st)if(ct.state.inputInsidePopup)pe.current&&pe.current.value!==""&&Ul("",yn(Iy));else{const an=Vu(Ft,R);pe.current&&pe.current.value!==an&&Ul(an,yn(an===""?Iy:Kc))}}),r1=y.useMemo(()=>Ta&&Cr?{current:Cr.closest('[role="dialog"]')}:ot,[Ta,Cr]);Rh({enabled:!e.actionsRef,open:_n,ref:r1,onComplete(){_n||nl()}}),y.useImperativeHandle(e.actionsRef,()=>({unmount:nl}),[nl]),Zt(function(){if(_n||d==="none")return;const Hn=w?At:Ie.current;if(Je){const ms=Array.isArray(Ft)?Ft:[],ha=ms[ms.length-1],qi=Nue(Hn,ha,B);Sl({selectedIndex:qi===-1?null:qi})}else{const ms=Nue(Hn,Ft,B);Sl({selectedIndex:ms===-1?null:ms})}},[_n,Ft,w,d,At,Je,B,Sl]),Zt(()=>{w&&(qe.current=yt,De.current.length=yt.length)},[w,yt]),Zt(()=>{const an=Ne.current;if(an&&(an.hasQuery?Tt&&ct.set("activeIndex",0):Tt==="always"&&ct.set("activeIndex",0),Ne.current=null),!_n&&!Ta)return;const ms=Nt||Mn?yt:qe.current,ha=ct.state.activeIndex;if(ha==null){if(Tt==="always"&&ms.length>0){ct.set("activeIndex",0);return}Ke.current!==j1&&(Ke.current=j1,ct.state.onItemHighlighted(void 0,fS(Kc,void 0,{index:-1})));return}if(ha>=ms.length){Ke.current!==j1&&(Ke.current=j1,ct.state.onItemHighlighted(void 0,fS(Kc,void 0,{index:-1}))),ct.set("activeIndex",null);return}const qi=ms[ha],ja=Ke.current.value,Zh=ja!==Rct&&wk(qi,ja,ct.state.isItemEqualToValue);(Ke.current.index!==ha||!Zh)&&(Ke.current={value:qi,index:ha},ct.state.onItemHighlighted(qi,fS(Kc,void 0,{index:ha})))},[Hs,Tt,Mn,Nt,yt,Ta,_n,ct]),Zt(()=>{if(d==="none"){ne(String(Mt)!=="");return}ne(Je?Array.isArray(Ft)&&Ft.length>0:Ft!=null)},[ne,d,Mt,Ft,Je]),y.useEffect(()=>{Nt&&Tt&&yt.length===0&&Sl({activeIndex:null})},[Nt,Tt,yt.length,Sl]),PE(je,()=>{!_n||je===""||je===String(Rt)||we(!0)}),PE(Ft,()=>{if(d!=="none"&&($(Le),Z(Ft!==G.initialValue),K()?te.commit(Ft):te.commit(Ft,!0),st&&!fn&&!wl)){const an=Vu(Ft,R);Mt!==an&&Ul(an,yn(Kc))}}),PE(Mt,()=>{d==="none"&&($(Le),Z(Mt!==G.initialValue),K()?te.commit(Mt):te.commit(Mt,!0))}),PE(w,()=>{if(!st||fn||wl||ye)return;const an=Vu(Ft,R);Mt!==an&&Ul(an,yn(Kc))});const Yv=Yrt({open:Ta?!0:_n,onOpenChange:qh,elements:{reference:wl?Bo:xl,floating:Cr}});let ig,og;Ta||(ig=S?"grid":"listbox",og=_n?"true":"false");const s1=y.useMemo(()=>{const an=xl?.tagName==="INPUT",Hn=xl==null||an,ms=Hn||_n,ha=Hn?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return ms&&(ha.role="combobox",ha["aria-expanded"]=og,ha["aria-haspopup"]=ig,ha["aria-controls"]=_n?xi?.id:void 0,ha["aria-autocomplete"]=H),{reference:ha,floating:{role:"presentation"}}},[xl,_n,og,ig,xi?.id,H]),xI=wj(Yv,{enabled:!g&&!Ge&&_,event:"mousedown-only",toggle:!1,touchOpenDelay:wl?0:100,reason:Mnn}),Vh=t$(Yv,{enabled:!g&&!Ge&&!Ta,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:Ta?!0:void 0,outsidePress(an){const Hn=mo(an);return!In(Bo,Hn)&&!In(Fe.current,Hn)&&!In(Se.current,Hn)&&!In(pa,Hn)}}),ax=Jrt(Yv,{enabled:!g&&!Ge,id:fe,listRef:De,activeIndex:Hs,selectedIndex:Ii,virtual:!0,loopFocus:N,allowEscape:N&&!Tt,focusItemOnOpen:ye||d==="none"&&!Tt?!1:"auto",focusItemOnHover:I,resetOnPointerLeave:!j,cols:S?2:1,orientation:S?"horizontal":void 0,rtl:le==="rtl",disabledIndices:Bg,onNavigate(an,Hn){!Hn&&!_n||Fr==="ending"||Sl(Hn?{activeIndex:an,type:ue.current?"keyboard":"pointer"}:{activeIndex:an})}}),WO=y.useMemo(()=>ou(ax.reference,Vh.reference,xI.reference,s1.reference),[ax.reference,Vh.reference,xI.reference,s1.reference]),GO=y.useMemo(()=>ou(bO,ax.floating,Vh.floating,s1.floating),[ax.floating,Vh.floating,s1.floating]),a1=y.useMemo(()=>{const an=ax.item;return an?{...an,onFocus:void 0}:ya},[ax.item]);YM(()=>{ct.update({inline:L,popupProps:GO,inputProps:WO,triggerProps:uc,itemProps:a1,setOpen:qh,setInputValue:Ul,setSelectedValue:ag,setIndices:Sl,onItemHighlighted:xr,handleSelection:sx,forceMount:ss,requestSubmit:n1})}),Zt(()=>{ct.update({id:fe,selectedValue:Ft,open:_n,mounted:Tp,transitionStatus:Fr,items:w,inline:L,popupProps:GO,inputProps:WO,triggerProps:uc,openMethod:ro,itemProps:a1,selectionMode:d,name:Le,form:h,disabled:Ge,readOnly:g,required:v,grid:S,isGrouped:Pe,virtualized:M,onOpenChangeComplete:Qr,openOnInputClick:_,itemToStringLabel:R,modal:z,autoHighlight:Tt,isItemEqualToValue:B,submitOnItemClick:V,hasInputValue:fn,requestSubmit:n1,inputOwnsFormValue:d==="none"&&(L||!ct.state.inputInsidePopup)})},[ct,fe,Ft,_n,Tp,Fr,w,GO,WO,a1,ro,uc,d,Le,Ge,g,v,te,S,Pe,M,Qr,_,R,z,B,V,fn,L,n1,Tt,h]);const VH=Im(b,te.inputRef),HH=y.useMemo(()=>({query:je,hasItems:Nt,filteredItems:dt,flatFilteredItems:yt}),[je,Nt,dt,yt]),QO=y.useMemo(()=>Array.isArray(cn)?"":AN(cn,P),[cn,P]),Hh=Je&&Array.isArray(Ft)&&Ft.length>0,i1=Je||d==="none"&&cc?void 0:Le,wI=y.useMemo(()=>!Je||!Array.isArray(Ft)||!Le?null:Ft.map(an=>{const Hn=AN(an,P);return l.jsx("input",{type:"hidden",form:h,name:Le,value:Hn},Hn)}),[Je,Ft,h,Le,P]),ix=l.jsxs(y.Fragment,{children:[e.children,l.jsx("input",{...te.getInputValidationProps({onFocus(){if(wl){Bo?.focus();return}(pe.current||Bo)?.focus()},onChange(an){if(an.nativeEvent.defaultPrevented||Ge||g){an.preventBaseUIHandler?.();return}const Hn=an.currentTarget.value,ms=yn(Kc,an.nativeEvent);function ha(){if(Je)return;if(d==="none"){Z(Hn!==G.initialValue),Ul(Hn,ms),K()&&te.commit(Hn);return}const qi=qe.current.find(ja=>AN(ja,P).toLowerCase()===Hn.toLowerCase()||Vu(ja,R).toLowerCase()===Hn.toLowerCase());qi!=null&&(Z(qi!==G.initialValue),ag?.(qi,ms),K()&&te.commit(qi))}w?ha():(ss(),queueMicrotask(ha))}}),id:fe&&i1==null?`${fe}-hidden-input`:void 0,form:h,name:i1,autoComplete:D,disabled:Ge,required:v&&!Hh,readOnly:g,value:QO,ref:VH,style:i1?drt:Uz,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),wI]});return l.jsx(wct.Provider,{value:ct,children:l.jsx(Sct.Provider,{value:Yv,children:l.jsx(kct.Provider,{value:HH,children:l.jsx(Oct.Provider,{value:Mt,children:ix})})})})}function Pct(e){const{multiple:t=!1,defaultValue:n,value:r,onValueChange:s,autoComplete:a,...i}=e;return l.jsx(hbn,{...i,selectionMode:t?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:s,formAutoComplete:a})}function mbn(e){return e==null?void 0:`${e}-label`}function bye(e,t){return e??t}function gbn(e){const{children:t,placeholder:n}=e,r=$v(),s=Yt(r,nn.itemToStringLabel),a=Yt(r,nn.selectedValue),i=Yt(r,nn.items),o=Yt(r,nn.selectionMode)==="multiple",c=Yt(r,nn.hasSelectedValue),u=!c&&n!=null&&t==null,d=Yt(r,nn.hasNullItemLabel,u);let f=null;return typeof t=="function"?f=t(a):t!=null?f=t:!c&&n!=null&&!d?f=n:o&&Array.isArray(a)?f=abn(a,i,s):f=Ect(a,i,s),l.jsx(y.Fragment,{children:f})}const Mct={...Gz,...Cct,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null},vbn=y.createContext(void 0);function ybn(){return y.useContext(vbn)}const $ct=y.createContext(void 0);function xye(e){const t=y.useContext($ct);if(t===void 0&&!e)throw new Error(js(21));return t}const Dct=y.forwardRef(function(t,n){const r=$v(),{buttonRef:s,getButtonProps:a}=Mv({native:!1}),i=Im(n,s);function o(u){r.state.setOpen(!1,yn(Ege,u.nativeEvent,u.currentTarget))}const c=a({onClick:o});return l.jsx("span",{ref:i,...c,"aria-label":"Dismiss",tabIndex:void 0,style:drt})}),Lct=y.forwardRef(function(t,n){const{render:r,className:s,disabled:a=!1,id:i,style:o,...c}=t,{state:u,disabled:d,setTouched:f,setFocused:p,validationMode:h,validation:m}=Rj(),{labelId:g}=BB(),v=ybn(),S=!!xye(!0),w=$v(),{filteredItems:O}=Bw(),E=_ct(),_=Db(),C=Yt(w,nn.required),j=Yt(w,nn.disabled),I=Yt(w,nn.readOnly),N=Yt(w,nn.name),R=Yt(w,nn.form),P=Yt(w,nn.selectionMode),B=Yt(w,nn.autoHighlight),M=Yt(w,nn.inputProps),L=Yt(w,nn.triggerProps),F=Yt(w,nn.open),z=Yt(w,nn.mounted),U=Yt(w,nn.selectedValue),H=Yt(w,nn.popupSide),D=Yt(w,nn.positionerElement),Y=Yt(w,nn.id),V=Yt(w,nn.inline),$=Yt(w,nn.modal),Z=!!B,G=z&&D?H:null,K=d||j||a,ne=O.length===0,ee=S||V,J=!ee||$,se=Dl(i??(ee?void 0:Y)),ae=bye(g,void 0),Q=S?ME:u,[te,le]=y.useState(null),fe=y.useRef(!1),ce=y.useRef(null),ye=y.useRef(!1),we=P==="none"&&!S,ke=Pt(de=>{const ie=S||w.state.inline;ie&&!w.state.hasInputValue&&w.state.setInputValue("",yn(Kc)),w.update({inputElement:de,inputInsidePopup:ie,inputOwnsFormValue:we})}),Re=S||!m?c:m.getValidationProps(c),De={...Q,open:F,disabled:K,readOnly:I,popupSide:G,listEmpty:ne};function Ue(de){if(!v)return;let ie;const{highlightedChipIndex:ge}=v,ue=v.chipsRef.current.length,xe=_==="rtl",Se=xe?"ArrowRight":"ArrowLeft",Fe=xe?"ArrowLeft":"ArrowRight";if(ge!==void 0){if(de.key===Se)de.preventDefault(),ge>0?ie=ge-1:ie=void 0;else if(de.key===Fe)de.preventDefault(),ge<ue-1?ie=ge+1:ie=void 0;else if(de.key==="Backspace"||de.key==="Delete"){de.preventDefault();const ze=ge>=U.length-1?U.length-2:ge;ie=ze>=0?ze:void 0,w.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return ie}return de.key===Se&&(de.currentTarget.selectionStart??0)===0&&U.length>0?(de.preventDefault(),ie=ue>0?ue-1:void 0):de.key==="Backspace"&&de.currentTarget.value===""&&U.length>0&&(w.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),de.preventDefault()),ie}const ot=vr("input",t,{state:De,ref:[n,w.state.inputRef,ke],props:[M,L,{type:"text",value:t.value??te??E,"aria-readonly":I||void 0,"aria-required":C||void 0,"aria-labelledby":ae,disabled:K,readOnly:I,required:P==="none"?C:void 0,form:R,...we&&N&&{name:N},id:se,onFocus(){if(p(!0),!V||!ye.current)return;ye.current=!1;const de=ce.current;de==null||!Object.hasOwn(w.state.valuesRef.current,de)||w.state.setIndices({activeIndex:de})},onBlur(){f(!0),p(!1);const de=w.state.activeIndex;if(V&&de!==null&&B!=="always"&&(ce.current=de,ye.current=!0,w.state.setIndices({activeIndex:null})),h==="onBlur"){const ie=P==="none"?E:U;m.commit(ie)}},onCompositionStart(de){Lz||(fe.current=!0,le(de.currentTarget.value))},onCompositionEnd(de){fe.current=!1;const ie=de.currentTarget.value;le(null),w.state.setInputValue(ie,yn(wS,de.nativeEvent))},onChange(de){const ie=de.nativeEvent.inputType,ge=!ie||ie==="insertReplacementText",ue=fe.current||!ge;if(fe.current){const ze=de.currentTarget.value;le(ze),ze===""&&!w.state.openOnInputClick&&!w.state.inputInsidePopup&&w.state.setOpen(!1,yn(Iy,de.nativeEvent));const Ke=ze.trim(),Ne=Z&&Ke!=="";!I&&!K&&Ke&&ue&&(w.state.setOpen(!0,yn(wS,de.nativeEvent)),Z||w.state.setIndices({activeIndex:null,selectedIndex:null,type:w.state.keyboardActiveRef.current?"keyboard":"pointer"})),F&&w.state.activeIndex!==null&&!Ne&&w.state.setIndices({activeIndex:null,selectedIndex:null,type:w.state.keyboardActiveRef.current?"keyboard":"pointer"});return}w.state.setInputValue(de.currentTarget.value,yn(wS,de.nativeEvent));const xe=de.currentTarget.value==="",Se=yn(Iy,de.nativeEvent);xe&&!w.state.inputInsidePopup&&(P==="single"&&w.state.setSelectedValue(null,Se),w.state.openOnInputClick||w.state.setOpen(!1,Se));const Fe=de.currentTarget.value.trim();!I&&!K&&Fe&&ue&&(w.state.setOpen(!0,yn(wS,de.nativeEvent)),Z||w.state.setIndices({activeIndex:null,selectedIndex:null,type:w.state.keyboardActiveRef.current?"keyboard":"pointer"})),F&&w.state.activeIndex!==null&&!Z&&w.state.setIndices({activeIndex:null,selectedIndex:null,type:w.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(de){if(K||I||de.ctrlKey||de.shiftKey||de.altKey||de.metaKey)return;w.state.keyboardActiveRef.current=!0;const ie=de.currentTarget,ge=ie.scrollWidth-ie.clientWidth,ue=_==="rtl";if(de.key==="Home"){Wl(de);const Fe=JNe&&ue?ie.value.length:0;ie.setSelectionRange(Fe,Fe),ie.scrollLeft=0;return}if(de.key==="End"){Wl(de);const Fe=JNe&&ue?0:ie.value.length;ie.setSelectionRange(Fe,Fe),ie.scrollLeft=ue?-ge:ge;return}if(!z&&de.key==="Escape"){const Fe=P==="multiple"&&Array.isArray(U)?U.length===0:U===null,ze=yn(xj,de.nativeEvent),Ke=P==="multiple"?[]:null;w.state.setInputValue("",ze),w.state.setSelectedValue(Ke,ze),!Fe&&!w.state.inline&&!ze.isPropagationAllowed&&de.stopPropagation();return}if(v&&de.key==="Backspace"&&ie.value===""&&v.highlightedChipIndex===void 0&&Array.isArray(U)&&U.length>0){const Fe=v.chipsRef.current.length,ze=Fe>0?Fe-1:U.length-1,Ke=U.filter((Ne,qe)=>qe!==ze);w.state.setIndices({activeIndex:null,selectedIndex:null,type:w.state.keyboardActiveRef.current?"keyboard":"pointer"}),w.state.setSelectedValue(Ke,yn(Kc,de.nativeEvent));return}const xe=v?.highlightedChipIndex!==void 0,Se=Ue(de);if(v?.setHighlightedChipIndex(Se),Se!==void 0?v?.chipsRef.current[Se]?.focus():xe&&w.state.inputRef.current?.focus(),de.which!==229&&de.key==="Enter"&&F){const Fe=w.state.activeIndex,ze=de.nativeEvent;if(Fe===null){if(V)return;w.state.setOpen(!1,yn(Kc,ze));return}Wl(de);const Ke=w.state.listRef.current[Fe];Ke&&(w.state.selectionEventRef.current=ze,Ke.click(),w.state.selectionEventRef.current=null)}},onPointerMove(){w.state.keyboardActiveRef.current=!1},onPointerDown(){w.state.keyboardActiveRef.current=!1}},Re],stateAttributesMapping:Mct}),pe=S?l.jsx(jct.Provider,{value:Tct,children:ot}):ot;return l.jsxs(y.Fragment,{children:[F&&J&&l.jsx(Dct,{ref:w.state.startDismissRef}),pe]})});function zct(e){const t=e.getBoundingClientRect(),n=Li(e),r=n.getComputedStyle(e,"::before"),s=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||s.content!=="none"))return t;const i=parseFloat(r.width)||0,o=parseFloat(r.height)||0,c=parseFloat(s.width)||0,u=parseFloat(s.height)||0,d=Math.max(t.width,i,c),f=Math.max(t.height,o,u),p=d-t.width,h=f-t.height;return{left:t.left-p/2,right:t.right+p/2,top:t.top-h/2,bottom:t.bottom+h/2}}const fL=2,Fct=y.forwardRef(function(t,n){const{render:r,className:s,nativeButton:a=!0,disabled:i=!1,id:o,style:c,...u}=t,{state:d,disabled:f,setTouched:p,setFocused:h,validationMode:m,validation:g}=Rj(),{labelId:v}=BB(),b=$v(),{filteredItems:S}=Bw(),w=Yt(b,nn.selectionMode),O=Yt(b,nn.disabled),E=Yt(b,nn.readOnly),_=Yt(b,nn.required),C=Yt(b,nn.mounted),j=Yt(b,nn.popupSide),I=Yt(b,nn.positionerElement),N=Yt(b,nn.listElement),R=Yt(b,nn.triggerProps),P=Yt(b,nn.triggerElement),B=Yt(b,nn.inputInsidePopup),M=Yt(b,nn.id),L=Yt(b,nn.labelId),F=Yt(b,nn.open),z=Yt(b,nn.selectedValue),U=Yt(b,nn.activeIndex),H=Yt(b,nn.selectedIndex),D=Yt(b,nn.hasSelectedValue),Y=FB(),V=_ct(),$=Jo(),Z=f||O||i,G=S.length===0,K=C&&I?j:null;yye({id:B?o:void 0});const ne=B?o??M:o,ee=bye(v,L),J=y.useRef("");function se(ke){J.current=ke.pointerType}const ae=Y.useState("domReferenceElement");y.useEffect(()=>{B&&P&&P!==ae&&Y.set("domReferenceElement",P)},[P,ae,Y,B]);const{reference:Q}=est(Y,{enabled:!F&&!E&&!O&&w==="single",listRef:b.state.labelsRef,activeIndex:U,selectedIndex:H,onMatch(ke){const Re=b.state.valuesRef.current[ke];Re!==void 0&&b.state.setSelectedValue(Re,yn("none"))}}),{reference:te}=wj(Y,{enabled:!E&&!O,event:"mousedown"}),{buttonRef:le,getButtonProps:fe}=Mv({native:a,disabled:Z}),ce={...d,open:F,disabled:Z,popupSide:K,listEmpty:G,placeholder:w==="none"?!1:!D},ye=Pt(ke=>{b.set("triggerElement",ke)});return vr("button",t,{ref:[n,le,ye],state:ce,props:[R,te,Q,{id:ne,tabIndex:B?0:-1,role:B?"combobox":void 0,"aria-expanded":F?"true":"false","aria-haspopup":B?"dialog":"listbox","aria-controls":F?N?.id:void 0,"aria-required":B&&_||void 0,"aria-labelledby":ee,onPointerDown:se,onPointerEnter:se,onFocus(){h(!0),!(Z||E)&&$.start(0,b.state.forceMount)},onBlur(ke){if(!In(I,ke.relatedTarget)&&(p(!0),h(!1),m==="onBlur")){const Re=w==="none"?V:z;g.commit(Re)}},onMouseDown(ke){if(Z||E||(B||Y.set("domReferenceElement",ke.currentTarget),b.state.forceMount(),J.current!=="touch"&&(b.state.inputRef.current?.focus(),B||ke.preventDefault()),F))return;const Re=Vr(ke.currentTarget);function De(Ue){if(!P)return;const ot=mo(Ue),pe=b.state.positionerElement,de=b.state.listElement;if(In(P,ot)||In(pe,ot)||In(de,ot)||ot===P)return;const ie=zct(P),ge=Ue.clientX>=ie.left-fL&&Ue.clientX<=ie.right+fL,ue=Ue.clientY>=ie.top-fL&&Ue.clientY<=ie.bottom+fL;ge&&ue||b.state.setOpen(!1,yn("cancel-open",Ue))}B&&Re.addEventListener("mouseup",De,{once:!0})},onKeyDown(ke){Z||E||(ke.key==="ArrowDown"||ke.key==="ArrowUp")&&(Wl(ke),b.state.setOpen(!0,yn(Bz,ke.nativeEvent)),b.state.inputRef.current?.focus())}},g?g.getValidationProps(u):u,fe],stateAttributesMapping:Mct})}),bbn=y.createContext(null);function xbn(){return y.useContext(bbn)}function wbn(e){const{children:t}=e,{filteredItems:n}=Bw(),r=xbn(),s=r?r.items:n;return s?l.jsx(y.Fragment,{children:s.map(t)}):null}const Bct=y.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Sbn(){return y.useContext(Bct)}function g$(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:s}=e,a=Pt(s),i=y.useRef(0),o=mu(Obn).current,c=mu(kbn).current,[u,d]=y.useState(0),f=y.useRef(u),p=Pt((b,S)=>{c.set(b,S??null),f.current+=1,d(f.current)}),h=Pt(b=>{c.delete(b),f.current+=1,d(f.current)}),m=y.useMemo(()=>{const b=new Map;return Array.from(c.keys()).filter(w=>w.isConnected).sort(_bn).forEach((w,O)=>{const E=c.get(w)??{};b.set(w,{...E,index:O})}),b},[c,u]);Zt(()=>{if(typeof MutationObserver!="function"||m.size===0)return;const b=new MutationObserver(S=>{const w=new Set,O=E=>w.has(E)?w.delete(E):w.add(E);S.forEach(E=>{E.removedNodes.forEach(O),E.addedNodes.forEach(O)}),w.size===0&&(f.current+=1,d(f.current))});return m.forEach((S,w)=>{w.parentElement&&b.observe(w.parentElement,{childList:!0})}),()=>{b.disconnect()}},[m]),Zt(()=>{f.current===u&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),i.current=m.size),a(m)},[a,m,n,r,u]),Zt(()=>()=>{n.current=[]},[n]),Zt(()=>()=>{r&&(r.current=[])},[r]);const g=Pt(b=>(o.add(b),()=>{o.delete(b)}));Zt(()=>{o.forEach(b=>b(m))},[o,m]);const v=y.useMemo(()=>({register:p,unregister:h,subscribeMapChange:g,elementsRef:n,labelsRef:r,nextIndexRef:i}),[p,h,g,n,r,i]);return l.jsx(Bct.Provider,{value:v,children:t})}function kbn(){return new Map}function Obn(){return new Set}function _bn(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Uct=y.forwardRef(function(t,n){var r;const{render:s,className:a,style:i,children:o,...c}=t,u=$v(),d=FB(),f=!!xye(!0),{filteredItems:p,hasItems:h}=Bw(),m=Yt(u,nn.selectionMode),g=Yt(u,nn.grid),v=Yt(u,nn.popupProps),b=Yt(u,nn.virtualized),S=m==="multiple",w=p.length===0,O=Pt(N=>{u.set("positionerElement",N)}),E=Pt(N=>{u.set("listElement",N)}),_=y.useMemo(()=>typeof o=="function"?r||(r=l.jsx(wbn,{children:o})):o,[o]),C={empty:w},j=d.useState("floatingId"),I=vr("div",t,{state:C,ref:[n,E,f?null:O],props:[v,{children:_,tabIndex:-1,id:j,role:g?"grid":"listbox","aria-multiselectable":S?"true":void 0,onKeyDown(N){if(!(u.state.disabled||u.state.readOnly)&&N.key==="Enter"){const R=u.state.activeIndex;if(R==null)return;Wl(N);const P=N.nativeEvent,B=u.state.listRef.current[R];B&&(u.state.selectionEventRef.current=P,B.click(),u.state.selectionEventRef.current=null)}},onKeyDownCapture(){u.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){u.state.keyboardActiveRef.current=!1}},c]});return b?I:l.jsx(g$,{elementsRef:u.state.listRef,labelsRef:h?void 0:u.state.labelsRef,children:I})}),Ebn="",Cbn=200;function Tbn(e){const t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);let n=null;for(;t.nextNode();){const r=t.currentNode;r.nodeValue!==""&&(n=r)}return n}function jbn(){const e=Jo(),t=y.useRef(null);return y.useEffect(()=>{if(Oge)return;const n=t.current;if(n==null)return;const r=Tbn(n);if(r==null)return;const s=r.nodeValue??"",a=`${s}${Ebn}`;return r.nodeValue=a,e.start(Cbn,()=>{r.nodeValue===a&&(r.nodeValue=s)}),()=>{e.clear(),r.nodeValue===a&&(r.nodeValue=s)}},[t,e]),t}const qct=y.createContext(void 0);function Ibn(){const e=y.useContext(qct);if(e===void 0)throw new Error(js(20));return e}const Vct=y.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,a=$v(),i=Yt(a,nn.mounted),o=Yt(a,nn.forceMounted);return i||r||o?l.jsx(qct.Provider,{value:r,children:l.jsx(nB,{ref:n,...s})}):null}),Nbn=20;function wye(e,t,n,r){const[s,a]=y.useState(!1);Zt(()=>{if(!e||!t||n==null){a(!1);return}const i=Vr(n).documentElement.clientWidth,o=n.offsetWidth;a(i>0&&o>0&&o>=i-Nbn)},[e,t,n]),Wlt(e&&(!t||s),r)}const Hct=y.forwardRef(function(t,n){const{render:r,className:s,anchor:a,positionMethod:i="absolute",side:o="bottom",align:c="center",sideOffset:u=0,alignOffset:d=0,collisionBoundary:f="clipping-ancestors",collisionPadding:p=5,arrowPadding:h=5,sticky:m=!1,disableAnchorTracking:g=!1,collisionAvoidance:v=Prt,style:b,...S}=t,w=$v(),{filteredItems:O}=Bw(),E=FB(),_=Ibn(),C=Yt(w,nn.modal),j=Yt(w,nn.open),I=Yt(w,nn.mounted),N=Yt(w,nn.openMethod),R=Yt(w,nn.positionerElement),P=Yt(w,nn.triggerElement),B=Yt(w,nn.inputElement),M=Yt(w,nn.inputGroupElement),L=Yt(w,nn.inputInsidePopup),F=Yt(w,nn.transitionStatus),z=O.length===0,H=gB({anchor:a??(L?P:M??B),floatingRootContext:E,positionMethod:i,mounted:I,side:o,sideOffset:u,align:c,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:p,sticky:m,disableAnchorTracking:g,keepMounted:_,collisionAvoidance:v,lazyFlip:!0});wye(j&&C,N==="touch",R,P);const D={open:j,side:H.side,align:H.align,anchorHidden:H.anchorHidden,empty:z};Zt(()=>{w.set("popupSide",H.side)},[w,H.side]);const Y=Pt($=>{w.set("positionerElement",$)}),V=vB(t,D,{styles:H.positionerStyles,transitionStatus:F,props:S,refs:[n,Y],hidden:!I,inert:!j});return l.jsxs($ct.Provider,{value:H,children:[I&&C&&l.jsx(DB,{inert:s$(!j),cutout:M??B??P}),V]})}),Abn={...Dw,...Hm},Zct=y.forwardRef(function(t,n){const{render:r,className:s,style:a,initialFocus:i,finalFocus:o,...c}=t,u=$v(),d=xye(),f=FB(),{filteredItems:p}=Bw(),h=Yt(u,nn.mounted),m=Yt(u,nn.open),g=Yt(u,nn.openMethod),v=Yt(u,nn.transitionStatus),b=Yt(u,nn.inputInsidePopup),S=Yt(u,nn.inputElement),w=Yt(u,nn.modal),O=p.length===0;Rh({open:m,ref:u.state.popupRef,onComplete(){m&&u.state.onOpenChangeComplete(!0)}});const E={open:m,side:d.side,align:d.align,anchorHidden:d.anchorHidden,transitionStatus:v,empty:O},_=vr("div",t,{state:E,ref:[n,u.state.popupRef],props:[{role:b?"dialog":"presentation",tabIndex:-1,onFocus(R){const P=mo(R.nativeEvent);g!=="touch"&&(In(u.state.listElement,P)||P===R.currentTarget)&&u.state.inputRef.current?.focus()}},r$(v),c],stateAttributesMapping:Abn}),j=i===void 0?b?R=>R==="touch"?u.state.popupRef.current:S:!1:i;let I;o!=null?I=o:I=b?void 0:!1;const N=!b||w;return l.jsx(rB,{context:f,disabled:!h,modal:N,openInteractionType:g,initialFocus:j,returnFocus:I,getInsideElements:()=>[u.state.startDismissRef.current,u.state.endDismissRef.current],children:l.jsxs(y.Fragment,{children:[_,N&&l.jsx(Dct,{ref:u.state.endDismissRef})]})})});let Wct=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Uw(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:s,index:a}=e,{register:i,unregister:o,subscribeMapChange:c,elementsRef:u,labelsRef:d,nextIndexRef:f}=Sbn(),p=y.useRef(-1),[h,m]=y.useState(a??(s===Wct.GuessFromOrder?()=>{if(p.current===-1){const b=f.current;f.current+=1,p.current=b}return p.current}:-1)),g=y.useRef(null),v=y.useCallback(b=>{if(g.current=b,h!==-1&&b!==null&&(u.current[h]=b,d)){const S=t!==void 0;d.current[h]=S?t:r?.current?.textContent??b.textContent}},[h,u,d,t,r]);return Zt(()=>{if(a!=null)return;const b=g.current;if(b)return i(b,n),()=>{o(b)}},[a,i,o,n]),Zt(()=>{if(a==null)return c(b=>{const S=g.current?b.get(g.current)?.index:null;S!=null&&m(S)})},[a,c,m]),y.useMemo(()=>({ref:v,index:h}),[h,v])}const Gct=y.createContext(void 0);function Qct(){const e=y.useContext(Gct);if(!e)throw new Error(js(19));return e}const Rbn=y.createContext(!1);function Pbn(){return y.useContext(Rbn)}const Yct=y.memo(y.forwardRef(function(t,n){const{render:r,className:s,style:a,value:i=null,index:o,disabled:c=!1,nativeButton:u=!1,...d}=t,f=y.useRef(!1),p=y.useRef(null),h=Uw({index:o,textRef:p,indexGuessBehavior:Wct.GuessFromOrder}),m=$v(),g=Pbn(),{flatFilteredItems:v,hasItems:b}=Bw(),S=Yt(m,nn.open),w=Yt(m,nn.selectionMode),O=Yt(m,nn.readOnly),E=Yt(m,nn.virtualized),_=Yt(m,nn.isItemEqualToValue),C=w!=="none",j=o??(E?Nue(v,i,_):h.index),I=h.index!==-1,N=Yt(m,nn.id),R=Yt(m,nn.isActive,j),P=Yt(m,nn.isSelected,i),B=Yt(m,nn.itemProps),M=y.useRef(null),L=N!=null&&I?`${N}-${j}`:void 0,F=P&&C;Zt(()=>{if(!(I&&(E||o!=null)))return;const G=m.state.listRef.current;return G[j]=M.current,()=>{delete G[j]}},[I,E,j,o,m]),Zt(()=>{if(!I||b)return;const Z=m.state.valuesRef.current;return Z[j]=i,w!=="none"&&m.state.allValuesRef.current.push(i),()=>{delete Z[j]}},[I,b,j,i,m,w]),Zt(()=>{if(!S){f.current=!1;return}if(!I||b)return;const Z=m.state.selectedValue,G=Array.isArray(Z)?Z[Z.length-1]:Z;wk(i,G,_)&&m.set("selectedIndex",j)},[I,b,S,m,j,i,_]);const{getButtonProps:z,buttonRef:U}=Mv({disabled:c,focusableWhenDisabled:!0,native:u,composite:!0}),H={disabled:c,selected:F,highlighted:R};function D(Z){function G(){m.state.handleSelection(Z,i)}m.state.submitOnItemClick?(Lo.flushSync(G),m.state.requestSubmit()):G()}const Y={id:L,role:g?"gridcell":"option","aria-selected":C?F:void 0,tabIndex:void 0,onPointerDownCapture(Z){f.current=!0,Z.preventDefault()},onMouseDown(Z){Z.preventDefault()},onClick(Z){c||O||D(Z.nativeEvent)},onMouseUp(Z){const G=f.current;f.current=!1,!(c||O||Z.button!==0||G||!R)&&D(Z.nativeEvent)}},V=vr("div",t,{ref:[U,n,h.ref,M],state:H,props:[B,Y,d,z]}),$=y.useMemo(()=>({selected:F,textRef:p}),[F,p]);return l.jsx(Gct.Provider,{value:$,children:V})})),Mbn=y.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:s}=Qct();return r||s?l.jsx($bn,{...t,ref:n}):null}),$bn=y.memo(y.forwardRef((e,t)=>{const{render:n,className:r,style:s,keepMounted:a,...i}=e,{selected:o}=Qct(),c=y.useRef(null),{transitionStatus:u,setMounted:d}=yO(o),p=vr("span",e,{ref:[t,c],state:{selected:o,transitionStatus:u},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:Hm});return Rh({open:o,ref:c,onComplete(){o||d(!1)}}),p})),Xct=y.forwardRef(function(t,n){const{render:r,className:s,style:a,children:i,...o}=t,{filteredItems:c}=Bw(),u=$v(),d=jbn(),f=c.length===0?i:null;return vr("div",t,{ref:[n,u.state.emptyRef,d],props:[{children:f,role:"status","aria-live":"polite","aria-atomic":!0},o]})}),Dbn=y.forwardRef(function(t,n){const{className:r,render:s,orientation:a="horizontal",style:i,...o}=t;return vr("div",t,{state:{orientation:a},ref:n,props:[{role:"separator","aria-orientation":a},o]})});var E2e=1,Lbn=.9,zbn=.8,Fbn=.17,NQ=.1,AQ=.999,Bbn=.9999,Ubn=.99,qbn=/[\\\/_+.#"@\[\(\{&]/,Vbn=/[\\\/_+.#"@\[\(\{&]/g,Hbn=/[\s-]/,Kct=/[\s-]/g;function Rue(e,t,n,r,s,a,i){if(a===t.length)return s===e.length?E2e:Ubn;var o=`${s},${a}`;if(i[o]!==void 0)return i[o];for(var c=r.charAt(a),u=n.indexOf(c,s),d=0,f,p,h,m;u>=0;)f=Rue(e,t,n,r,u+1,a+1,i),f>d&&(u===s?f*=E2e:qbn.test(e.charAt(u-1))?(f*=zbn,h=e.slice(s,u-1).match(Vbn),h&&s>0&&(f*=Math.pow(AQ,h.length))):Hbn.test(e.charAt(u-1))?(f*=Lbn,m=e.slice(s,u-1).match(Kct),m&&s>0&&(f*=Math.pow(AQ,m.length))):(f*=Fbn,s>0&&(f*=Math.pow(AQ,u-s))),e.charAt(u)!==t.charAt(a)&&(f*=Bbn)),(f<NQ&&n.charAt(u-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(u-1)!==r.charAt(a))&&(p=Rue(e,t,n,r,u+1,a+2,i),p*NQ>f&&(f=p*NQ)),f>d&&(d=f),u=n.indexOf(c,u+1);return i[o]=d,d}function C2e(e){return e.toLowerCase().replace(Kct," ")}function Zbn(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Rue(e,t,C2e(e),C2e(t),0,0,{})}var RQ="focusScope.autoFocusOnMount",PQ="focusScope.autoFocusOnUnmount",T2e={bubbles:!1,cancelable:!0},Wbn="FocusScope",Sye=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...i}=e,[o,c]=y.useState(null),u=qd(s),d=qd(a),f=y.useRef(null),p=Ts(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 O=w.target;o.contains(O)?f.current=O:Qx(f.current,{select:!0})},v=function(w){if(h.paused||!o)return;const O=w.relatedTarget;O!==null&&(o.contains(O)||Qx(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const E of w)E.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){I2e.add(h);const g=document.activeElement;if(!o.contains(g)){const b=new CustomEvent(RQ,T2e);o.addEventListener(RQ,u),o.dispatchEvent(b),b.defaultPrevented||(Gbn(Jbn(Jct(o)),{select:!0}),document.activeElement===g&&Qx(o))}return()=>{o.removeEventListener(RQ,u),setTimeout(()=>{const b=new CustomEvent(PQ,T2e);o.addEventListener(PQ,d),o.dispatchEvent(b),b.defaultPrevented||Qx(g??document.body,{select:!0}),o.removeEventListener(PQ,d),I2e.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,O]=Qbn(S);w&&O?!g.shiftKey&&b===O?(g.preventDefault(),n&&Qx(w,{select:!0})):g.shiftKey&&b===w&&(g.preventDefault(),n&&Qx(O,{select:!0})):b===S&&g.preventDefault()}},[n,r,h.paused]);return l.jsx(us.div,{tabIndex:-1,...i,ref:p,onKeyDown:m})});Sye.displayName=Wbn;function Gbn(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Qx(r,{select:t}),document.activeElement!==n)return}function Qbn(e){const t=Jct(e),n=j2e(t,e),r=j2e(t.reverse(),e);return[n,r]}function Jct(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 j2e(e,t){for(const n of e)if(!Ybn(n,{upTo:t}))return n}function Ybn(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 Xbn(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&&Xbn(e)&&t&&e.select()}}var I2e=Kbn();function Kbn(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=N2e(e,t),e.unshift(t)},remove(t){e=N2e(e,t),e[0]?.resume()}}}function N2e(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Jbn(e){return e.filter(t=>t.tagName!=="A")}var MQ=0;function eut(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??A2e()),document.body.insertAdjacentElement("beforeend",e[1]??A2e()),MQ++,()=>{MQ===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),MQ--}},[])}function A2e(){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 Pg=function(){return Pg=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},Pg.apply(this,arguments)};function tut(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 exn(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 T6="right-scroll-bar-position",j6="width-before-scroll-bar",txn="with-scroll-bars-hidden",nxn="--removed-body-scroll-bar-size";function $Q(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function rxn(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 sxn=typeof window<"u"?y.useLayoutEffect:y.useEffect,R2e=new WeakMap;function axn(e,t){var n=rxn(null,function(r){return e.forEach(function(s){return $Q(s,r)})});return sxn(function(){var r=R2e.get(n);if(r){var s=new Set(r),a=new Set(e),i=n.current;s.forEach(function(o){a.has(o)||$Q(o,null)}),a.forEach(function(o){s.has(o)||$Q(o,i)})}R2e.set(n,e)},[e]),n}function ixn(e){return e}function oxn(e,t){t===void 0&&(t=ixn);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 lxn(e){e===void 0&&(e={});var t=oxn(null);return t.options=Pg({async:!0,ssr:!1},e),t}var nut=function(e){var t=e.sideCar,n=tut(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,Pg({},n))};nut.isSideCarExport=!0;function cxn(e,t){return e.useMedium(t),nut}var rut=lxn(),DQ=function(){},UB=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:DQ,onWheelCapture:DQ,onTouchMoveCapture:DQ}),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,O=tut(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,_=axn([n,t]),C=Pg(Pg({},O),s);return y.createElement(y.Fragment,null,d&&y.createElement(E,{sideCar:rut,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),Pg(Pg({},C),{ref:_})):y.createElement(S,Pg({},C,{className:c,ref:_}),o))});UB.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};UB.classNames={fullWidth:j6,zeroRight:T6};var uxn=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function dxn(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=uxn();return t&&e.setAttribute("nonce",t),e}function fxn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function pxn(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var hxn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=dxn())&&(fxn(t,n),pxn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mxn=function(){var e=hxn();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},sut=function(){var e=mxn(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},gxn={left:0,top:0,right:0,gap:0},LQ=function(e){return parseInt(e||"",10)||0},vxn=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[LQ(n),LQ(r),LQ(s)]},yxn=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return gxn;var t=vxn(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])}},bxn=sut(),vC="data-scroll-locked",xxn=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(txn,` {
|
|
121
121
|
overflow: hidden `).concat(r,`;
|
|
@@ -279,7 +279,7 @@ ${K.current.stack}
|
|
|
279
279
|
`).concat(O.x,",").concat(O.y),_=nc(e.id)?n2("recharts-radial-line-"):e.id;return y.createElement("text",Ly({},r,{dominantBaseline:"central",className:Ua("recharts-radial-bar-label",i)}),y.createElement("defs",null,y.createElement("path",{id:_,d:E})),y.createElement("textPath",{xlinkHref:"#".concat(_)},n))},sUn=(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}=Ec(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}=Ec(r,s,p,u);return{x:h,y:m,textAnchor:"middle",verticalAnchor:"middle"}},z6=e=>e!=null&&"cx"in e&&nr(e.cx),aUn={angle:0,offset:5,zIndex:Qu.label,position:"middle",textBreakAll:!1};function iUn(e){if(!z6(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 r0(e){var t=ef(e,aUn),{viewBox:n,parentViewBox:r,position:s,value:a,children:i,content:o,className:c="",textBreakAll:u,labelRef:d}=t,f=eUn(),p=Mbt(),h=s==="center"?p:f??p,m,g,v;n==null?m=h:z6(n)?m=n:m=gxe(n);var b=iUn(m);if(!m||nc(a)&&nc(i)&&!y.isValidElement(o)&&typeof o!="function")return null;var S=FA(FA({},t),{},{viewBox:m});if(y.isValidElement(o)){var{labelRef:w}=S,O=ILe(S,ZBn);return y.cloneElement(o,O)}if(typeof o=="function"){var{content:E}=S,_=ILe(S,WBn);if(g=y.createElement(o,_),y.isValidElement(g))return g}else g=tUn(t);var C=sd(t);if(z6(m)){if(s==="insideStart"||s==="insideEnd"||s==="end")return rUn(t,s,g,C,m);v=sUn(m,t.offset,t.position)}else{if(!b)return null;var j=HBn({viewBox:b,position:s,offset:t.offset,parentViewBox:z6(r)?void 0:r});v=FA(FA({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(Gb,{zIndex:t.zIndex},y.createElement(b0e,Ly({ref:d,className:Ua("recharts-label",c)},C,v,{textAnchor:Ibt(C.textAnchor)?C.textAnchor:v.textAnchor,breakAll:u}),g))}r0.displayName="Label";var oUn=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?y.createElement(r0,Ly({key:"label-implicit"},r)):vv(e)?y.createElement(r0,Ly({key:"label-implicit",value:e},r)):y.isValidElement(e)?e.type===r0?y.cloneElement(e,FA({key:"label-implicit"},r)):y.createElement(r0,Ly({key:"label-implicit",content:e},r)):x0e(e)?y.createElement(r0,Ly({key:"label-implicit",content:e},r)):e&&typeof e=="object"?y.createElement(r0,Ly({},e,{key:"label-implicit"},r)):null};function lUn(e){var{label:t,labelRef:n}=e,r=Mbt();return oUn(t,r,n)||null}var cUn=["valueAccessor"],uUn=["dataKey","clockWise","id","textBreakAll","zIndex"];function P8(){return P8=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},P8.apply(null,arguments)}function ALe(e,t){if(e==null)return{};var n,r,s=dUn(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 dUn(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 fUn=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(DBn(t))return t},$bt=y.createContext(void 0),pUn=$bt.Provider,Dbt=y.createContext(void 0);Dbt.Provider;function hUn(){return y.useContext($bt)}function mUn(){return y.useContext(Dbt)}function F6(e){var{valueAccessor:t=fUn}=e,n=ALe(e,cUn),{dataKey:r,clockWise:s,id:a,textBreakAll:i,zIndex:o}=n,c=ALe(n,uUn),u=hUn(),d=mUn(),f=u||d;return!f||!f.length?null:y.createElement(Gb,{zIndex:o??Qu.label},y.createElement(mb,{className:"recharts-label-list"},f.map((p,h)=>{var m,g=nc(r)?t(p,h):ec(p.payload,r),v=nc(a)?{}:{id:"".concat(a,"-").concat(h)};return y.createElement(r0,P8({key:"label-".concat(h)},sd(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}))})))}F6.displayName="LabelList";function gUn(e){var{label:t}=e;return t?t===!0?y.createElement(F6,{key:"labelList-implicit"}):y.isValidElement(t)||x0e(t)?y.createElement(F6,{key:"labelList-implicit",content:t}):typeof t=="object"?y.createElement(F6,P8({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}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)}var Lbt=e=>{var{cx:t,cy:n,r,className:s}=e,a=Ua("recharts-dot",s);return nr(t)&&nr(n)&&nr(r)?y.createElement("circle",Kde({},gv(e),oxe(e),{className:a,cx:t,cy:n,r})):null},vUn={radiusAxis:{},angleAxis:{}},zbt=_u({name:"polarAxis",initialState:vUn,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:vas,removeRadiusAxis:yas,addAngleAxis:bas,removeAngleAxis:xas}=zbt.actions,yUn=zbt.reducer;function bUn(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var UX={exports:{}},Sa={};var RLe;function xUn(){if(RLe)return Sa;RLe=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 Sa.ContextConsumer=i,Sa.ContextProvider=a,Sa.Element=e,Sa.ForwardRef=c,Sa.Fragment=n,Sa.Lazy=p,Sa.Memo=f,Sa.Portal=t,Sa.Profiler=s,Sa.StrictMode=r,Sa.Suspense=u,Sa.SuspenseList=d,Sa.isAsyncMode=function(){return!1},Sa.isConcurrentMode=function(){return!1},Sa.isContextConsumer=function(v){return g(v)===i},Sa.isContextProvider=function(v){return g(v)===a},Sa.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},Sa.isForwardRef=function(v){return g(v)===c},Sa.isFragment=function(v){return g(v)===n},Sa.isLazy=function(v){return g(v)===p},Sa.isMemo=function(v){return g(v)===f},Sa.isPortal=function(v){return g(v)===t},Sa.isProfiler=function(v){return g(v)===s},Sa.isStrictMode=function(v){return g(v)===r},Sa.isSuspense=function(v){return g(v)===u},Sa.isSuspenseList=function(v){return g(v)===d},Sa.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)},Sa.typeOf=g,Sa}var PLe;function wUn(){return PLe||(PLe=1,UX.exports=xUn()),UX.exports}wUn();var Fbt=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,qX={},MLe;function SUn(){return MLe||(MLe=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})(qX)),qX}var VX,$Le;function kUn(){return $Le||($Le=1,VX=SUn().isPlainObject),VX}var OUn=kUn();const _Un=el(OUn);var DLe,LLe,zLe,FLe,BLe;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 qLe(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){EUn(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 EUn(e,t,n){return(t=CUn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CUn(e){var t=TUn(e,"string");return typeof t=="symbol"?t:t+""}function TUn(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 M8(){return M8=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},M8.apply(null,arguments)}function QN(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var VLe=(e,t,n,r,s)=>{var a=n-r,i;return i=jo(DLe||(DLe=QN(["M ",",",""])),e,t),i+=jo(LLe||(LLe=QN(["L ",",",""])),e+n,t),i+=jo(zLe||(zLe=QN(["L ",",",""])),e+n-a/2,t+s),i+=jo(FLe||(FLe=QN(["L ",",",""])),e+n-a/2-r,t+s),i+=jo(BLe||(BLe=QN(["L ",","," Z"])),e,t),i},jUn={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},IUn=e=>{var t=ef(e,jUn),{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),O=xxe(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 E=Ua("recharts-trapezoid",o);if(!f)return y.createElement("g",null,y.createElement("path",M8({},sd(t),{className:E,d:VLe(n,r,s,a,i)})));var _=g.current,C=v.current,j=b.current,I=S.current,N=w.current,R="0px ".concat(h===-1?1:h,"px"),P="".concat(h,"px ").concat(h,"px"),B=Kgt(["strokeDasharray"],u,c);return y.createElement(bxe,{animationId:O,key:O,canBegin:h>0,duration:u,easing:c,isActive:f,begin:d},M=>{var L=Td(_,s,M),F=Td(C,a,M),z=Td(j,i,M),U=Td(I,n,M),H=Td(N,r,M);p.current&&(g.current=L,v.current=F,b.current=z,S.current=U,w.current=H);var D=M>0?{transition:B,strokeDasharray:P}:{strokeDasharray:R};return y.createElement("path",M8({},sd(t),{className:E,d:VLe(U,H,L,F,z),ref:p,style:qLe(qLe({},D),t.style)}))})},NUn=["option","shapeType","activeClassName","inActiveClassName"];function AUn(e,t){if(e==null)return{};var n,r,s=RUn(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 RUn(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 HLe(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 $8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HLe(Object(n),!0).forEach(function(r){PUn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PUn(e,t,n){return(t=MUn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MUn(e){var t=$Un(e,"string");return typeof t=="symbol"?t:t+""}function $Un(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 DUn(e,t){return $8($8({},t),e)}function LUn(e,t){return e==="symbols"}function ZLe(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return y.createElement(nvt,n);case"trapezoid":return y.createElement(IUn,n);case"sector":return y.createElement(avt,n);case"symbols":if(LUn(t))return y.createElement(Umt,n);break;case"curve":return y.createElement(Xgt,n);default:return null}}function zUn(e){return y.isValidElement(e)?e.props:e}function FUn(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:s="recharts-shape"}=e,a=AUn(e,NUn),i;if(y.isValidElement(t))i=y.cloneElement(t,$8($8({},a),zUn(t)));else if(typeof t=="function")i=t(a,a.index);else if(_Un(t)&&typeof t!="boolean"){var o=DUn(t,a);i=y.createElement(ZLe,{shapeType:n,elementProps:o})}else{var c=a;i=y.createElement(ZLe,{shapeType:n,elementProps:c})}return a.isActive?y.createElement(mb,{className:r},i):y.createElement(mb,{className:s},i)}function BUn(e){var{tooltipEntrySettings:t}=e,n=yl(),r=tf(),s=y.useRef(null);return y.useLayoutEffect(()=>{r||(s.current===null?n(Y8n(t)):s.current!==t&&n(X8n({prev:s.current,next:t})),s.current=t)},[t,n,r]),y.useLayoutEffect(()=>()=>{s.current&&(n(K8n(s.current)),s.current=null)},[n]),null}function UUn(e){var{legendPayload:t}=e,n=yl(),r=tf(),s=y.useRef(null);return y.useLayoutEffect(()=>{r||(s.current===null?n(cLn(t)):s.current!==t&&n(uLn({prev:s.current,next:t})),s.current=t)},[n,r,t]),y.useLayoutEffect(()=>()=>{s.current&&(n(dLn(s.current)),s.current=null)},[n]),null}var HX,qUn=()=>{var[e]=y.useState(()=>n2("uid-"));return e},VUn=(HX=dj.useId)!==null&&HX!==void 0?HX:qUn;function HUn(e,t){var n=VUn();return t||(e?"".concat(e,"-").concat(n):n)}var ZUn=y.createContext(void 0),WUn=e=>{var{id:t,type:n,children:r}=e,s=HUn("recharts-".concat(n),t);return y.createElement(ZUn.Provider,{value:s},r(s))},GUn={cartesianItems:[],polarItems:[]},Bbt=_u({name:"graphicalItems",initialState:GUn,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Ri()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,s=ah(e).cartesianItems.indexOf(n);s>-1&&(e.cartesianItems[s]=r)},prepare:Ri()},removeCartesianGraphicalItem:{reducer(e,t){var n=ah(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Ri()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Ri()},removePolarGraphicalItem:{reducer(e,t){var n=ah(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Ri()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,s=ah(e).polarItems.indexOf(n);s>-1&&(e.polarItems[s]=r)},prepare:Ri()}}}),{addCartesianGraphicalItem:QUn,replaceCartesianGraphicalItem:YUn,removeCartesianGraphicalItem:XUn,addPolarGraphicalItem:was,removePolarGraphicalItem:Sas,replacePolarGraphicalItem:kas}=Bbt.actions,KUn=Bbt.reducer,JUn=e=>{var t=yl(),n=y.useRef(null);return y.useLayoutEffect(()=>{n.current===null?t(QUn(e)):n.current!==e&&t(YUn({prev:n.current,next:e})),n.current=e},[t,e]),y.useLayoutEffect(()=>()=>{n.current&&(t(XUn(n.current)),n.current=null)},[t]),null},eqn=y.memo(JUn),tqn=["points"];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 ZX(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){nqn(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 nqn(e,t,n){return(t=rqn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rqn(e){var t=sqn(e,"string");return typeof t=="symbol"?t:t+""}function sqn(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 D8(){return D8=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},D8.apply(null,arguments)}function aqn(e,t){if(e==null)return{};var n,r,s=iqn(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 iqn(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 oqn(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=Ua(r,typeof t!="boolean"?t.className:""),a=n??{},{points:i}=a,o=aqn(a,tqn);return y.createElement(Lbt,D8({},o,{className:s}))}function lqn(e,t){return e==null?!1:t?!0:e.length===1}function cqn(e){var{points:t,dot:n,className:r,dotClassName:s,dataKey:a,baseProps:i,needClip:o,clipPathId:c,zIndex:u=Qu.scatter}=e;if(!lqn(t,n))return null;var d=Fbt(n),f=y$n(n),p=t.map((m,g)=>{var v,b,S=ZX(ZX(ZX({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(oqn,{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(Gb,{zIndex:u},y.createElement(mb,D8({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 QLe(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){uqn(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 uqn(e,t,n){return(t=dqn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dqn(e){var t=fqn(e,"string");return typeof t=="symbol"?t:t+""}function fqn(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 pqn={xAxis:{},yAxis:{},zAxis:{}},Ubt=_u({name:"cartesianAxis",initialState:pqn,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Ri()},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:Ri()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Ri()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Ri()},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:Ri()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Ri()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Ri()},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:Ri()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Ri()},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]=QLe(QLe({},s),{},{width:r,widthHistory:o})}}}}),{addXAxis:hqn,replaceXAxis:mqn,removeXAxis:gqn,addYAxis:vqn,replaceYAxis:yqn,removeYAxis:bqn,addZAxis:Oas,replaceZAxis:_as,removeZAxis:Eas,updateYAxisWidth:xqn}=Ubt.actions,wqn=Ubt.reducer,Sqn=tt([Mc],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),kqn=tt([Sqn,Ub,qb],(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)}}),w0e=()=>fr(kqn),Oqn=()=>fr(Y9n);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 WX(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){_qn(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 _qn(e,t,n){return(t=Eqn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eqn(e){var t=Cqn(e,"string");return typeof t=="symbol"?t:t+""}function Cqn(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 Tqn=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=WX(WX(WX({},o),xU(s)),oxe(s)),u;return y.isValidElement(s)?u=y.cloneElement(s,c):typeof s=="function"?u=s(c):u=y.createElement(Lbt,c),y.createElement(mb,{className:"recharts-active-dot",clipPath:i},u)};function jqn(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:s,clipPath:a,zIndex:i=Qu.activeDot}=e,o=fr(h2),c=Oqn();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return nc(u)?null:y.createElement(Gb,{zIndex:i},y.createElement(Tqn,{point:u,childIndex:Number(o),mainColor:n,dataKey:s,activeDot:r,clipPath:a}))}var Iqn=e=>{var{chartData:t}=e,n=yl(),r=tf();return y.useEffect(()=>r?()=>{}:(n(hLe(t)),()=>{n(hLe(void 0))}),[t,n,r]),null},XLe={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},qbt=_u({name:"brush",initialState:XLe,reducers:{setBrushSettings(e,t){return t.payload==null?XLe:t.payload}}}),{setBrushSettings:Cas}=qbt.actions,Nqn=qbt.reducer;function Aqn(e){return(e%180+180)%180}var Rqn=function(t){var{width:n,height:r}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Aqn(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)},Pqn={dots:[],areas:[],lines:[]},Vbt=_u({name:"referenceElements",initialState:Pqn,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=ah(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=ah(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=ah(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:Tas,removeDot:jas,addArea:Ias,removeArea:Nas,addLine:Aas,removeLine:Ras}=Vbt.actions,Mqn=Vbt.reducer,$qn=y.createContext(void 0),Dqn=e=>{var{children:t}=e,[n]=y.useState("".concat(n2("recharts"),"-clip")),r=w0e();if(r==null)return null;var{x:s,y:a,width:i,height:o}=r;return y.createElement($qn.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 Hbt(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 Lqn(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Rqn(r,n)}function zqn(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 g2(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 Fqn(e,t){return Hbt(e,t+1)}function Bqn(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:Hbt(r,u)};var g=c,v,b=()=>(v===void 0&&(v=n(m,g)),v),S=m.coordinate,w=c===0||g2(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 Uqn(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 O=r[g];if(O==null)return 0;var E=g,_,C=()=>(_===void 0&&(_=n(O,E)),_),j=O.coordinate,I=g===d||g2(e,j,C,f,c);if(!I)return p=!1,1;I&&(f=j+e*(C()/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 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 Vc(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){qqn(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 qqn(e,t,n){return(t=Vqn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vqn(e){var t=Hqn(e,"string");return typeof t=="symbol"?t:t+""}function Hqn(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 Zqn(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=g2(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 Wqn(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=g2(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 O=w,E,_=()=>(E===void 0&&(E=n(w,S)),E);if(S===0){var C=e*(O.coordinate-e*_()/2-c);i[S]=O=Vc(Vc({},O),{},{tickCoord:C<0?O.coordinate-C*e:O.coordinate})}else i[S]=O=Vc(Vc({},O),{},{tickCoord:O.coordinate});if(O.tickCoord!=null){var j=g2(e,O.tickCoord,_,c,u);j&&(c=O.tickCoord+e*(_()/2+s),i[S]=Vc(Vc({},O),{},{isShow:!0}))}},v=0;v<m;v++)g(v);return i}function S0e(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(nr(c)||$$.isSsr){var p;return(p=Fqn(s,nr(c)?c:0))!==null&&p!==void 0?p:[]}var h=[],m=o==="top"||o==="bottom"?"width":"height",g=d&&m==="width"?ER(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},v=(E,_)=>{var C=typeof u=="function"?u(E.value,_):E.value;return m==="width"?Lqn(ER(C,{fontSize:t,letterSpacing:n}),g,f):ER(C,{fontSize:t,letterSpacing:n})[m]},b=s[0],S=s[1],w=s.length>=2&&b!=null&&S!=null?sh(S.coordinate-b.coordinate):1,O=zqn(a,w,m);return c==="equidistantPreserveStart"?Bqn(w,O,v,s,i):c==="equidistantPreserveEnd"?Uqn(w,O,v,s,i):(c==="preserveStart"||c==="preserveStartEnd"?h=Wqn(w,O,v,s,i,c==="preserveStartEnd"):h=Zqn(w,O,v,s,i),h.filter(E=>E.isShow))}var Gqn=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},Qqn={xAxis:{},yAxis:{}},Zbt=_u({name:"renderedTicks",initialState:Qqn,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:Yqn,removeRenderedTicks:Xqn}=Zbt.actions,Kqn=Zbt.reducer,Jqn=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function eVn(e,t){if(e==null)return{};var n,r,s=tVn(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 tVn(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 Dk(){return Dk=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},Dk.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 To(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){nVn(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 nVn(e,t,n){return(t=rVn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rVn(e){var t=sVn(e,"string");return typeof t=="symbol"?t:t+""}function sVn(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 rb={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:Qu.axis};function aVn(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=To(To(To({},c),gv(o)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!i||a==="bottom"&&i);u=To(To({},u),{},{x1:t,y1:n+d*s,x2:t+r,y2:n+d*s})}else{var f=+(a==="left"&&!i||a==="right"&&i);u=To(To({},u),{},{x1:t+f*r,y1:n,x2:t+f*r,y2:n+s})}return y.createElement("line",Dk({},u,{className:Ua("recharts-cartesian-axis-line",OU(o,"className"))}))}function iVn(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=nr(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 oVn(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function lVn(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function cVn(e){var{option:t,tickProps:n,value:r}=e,s,a=Ua(n.className,"recharts-cartesian-axis-tick-value");if(y.isValidElement(t))s=y.cloneElement(t,To(To({},n),{},{className:a}));else if(typeof t=="function")s=t(To(To({},n),{},{className:a}));else{var i="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(i=Ua(i,bUn(t))),s=y.createElement(b0e,Dk({},n,{className:i}),r)}return s}function uVn(e){var{ticks:t,axisType:n,axisId:r}=e,s=yl();return y.useEffect(()=>{if(r==null||n==null)return Bj;var a=t.map(i=>({value:i.value,coordinate:i.coordinate,offset:i.offset,index:i.index}));return s(Yqn({ticks:a,axisId:r,axisType:n})),()=>{s(Xqn({axisId:r,axisType:n}))}},[s,t,r,n]),null}var dVn=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:O,events:E,axisType:_,axisId:C}=e,j=S0e(To(To({},O),{},{ticks:n}),S,w),I=gv(O),N=xU(r),R=Ibt(I.textAnchor)?I.textAnchor:oVn(d,f),P=lVn(d,f),B={};typeof s=="object"&&(B=s);var M=To(To({},I),{},{fill:"none"},B),L=j.map(U=>To({entry:U},iVn(U,p,h,m,g,d,v,f,b))),F=L.map(U=>{var{entry:H,line:D}=U;return y.createElement(mb,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(H.value,"-").concat(H.coordinate,"-").concat(H.tickCoord)},s&&y.createElement("line",Dk({},M,D,{className:Ua("recharts-cartesian-axis-tick-line",OU(s,"className"))})))}),z=L.map((U,H)=>{var D,Y,{entry:V,tick:$}=U,Z=To(To(To(To({verticalAnchor:P},I),{},{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:I.angle)!==null&&D!==void 0?D:0}),G=To(To({},Z),N);return y.createElement(mb,Dk({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},SDn(E,V,H)),r&&y.createElement(cVn,{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(_,"-ticks")},y.createElement(uVn,{ticks:j,axisId:C,axisType:_}),z.length>0&&y.createElement(Gb,{zIndex:Qu.label},y.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(_,"-tick-labels"),ref:t},z)),F.length>0&&y.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(_,"-tick-lines")},F))}),fVn=y.forwardRef((e,t)=>{var{axisLine:n,width:r,height:s,className:a,hide:i,ticks:o,axisType:c,axisId:u}=e,d=eVn(e,Jqn),[f,p]=y.useState(""),[h,m]=y.useState(""),g=y.useRef(null);y.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var b;return Gqn({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 O=window.getComputedStyle(w),E=O.fontSize,_=O.letterSpacing;(E!==f||_!==h)&&(p(E),m(_))}}},[f,h]);return i||r!=null&&r<=0||s!=null&&s<=0?null:y.createElement(Gb,{zIndex:e.zIndex},y.createElement(mb,{className:Ua("recharts-cartesian-axis",a)},y.createElement(aVn,{x:e.x,y:e.y,width:r,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:gv(e)}),y.createElement(dVn,{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(KBn,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},y.createElement(lUn,{label:e.label,labelRef:e.labelRef}),e.children)))}),k0e=y.forwardRef((e,t)=>{var n=ef(e,rb);return y.createElement(fVn,Dk({},n,{ref:t}))});k0e.displayName="CartesianAxis";var pVn=["x1","y1","x2","y2","key"],hVn=["offset"],mVn=["xAxisId","yAxisId"],gVn=["xAxisId","yAxisId"];function e5e(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 eu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e5e(Object(n),!0).forEach(function(r){vVn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vVn(e,t,n){return(t=yVn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yVn(e){var t=bVn(e,"string");return typeof t=="symbol"?t:t+""}function bVn(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 IS(){return IS=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},IS.apply(null,arguments)}function L8(e,t){if(e==null)return{};var n,r,s=xVn(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 xVn(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 wVn=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 Wbt(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=L8(n,pVn),f=(s=gv(d))!==null&&s!==void 0?s:{},{offset:p}=f,h=L8(f,hVn);r=y.createElement("line",IS({},h,{x1:a,y1:i,x2:o,y2:c,fill:"none",key:u}))}return r}function SVn(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=L8(e,mVn),c=s.map((u,d)=>{var f=eu(eu({},o),{},{x1:t,y1:u,x2:t+n,y2:u,key:"line-".concat(d),index:d});return y.createElement(Wbt,{key:"line-".concat(d),option:r,lineItemProps:f})});return y.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function kVn(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=L8(e,gVn),c=s.map((u,d)=>{var f=eu(eu({},o),{},{x1:u,y1:t,x2:u,y2:t+n,key:"line-".concat(d),index:d});return y.createElement(Wbt,{option:r,lineItemProps:f,key:"line-".concat(d)})});return y.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function OVn(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 _Vn(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 EVn=(e,t)=>{var{xAxis:n,width:r,height:s,offset:a}=e;return jgt(S0e(eu(eu(eu({},rb),n),{},{ticks:Igt(n),viewBox:{x:0,y:0,width:r,height:s}})),a.left,a.left+a.width,t)},CVn=(e,t)=>{var{yAxis:n,width:r,height:s,offset:a}=e;return jgt(S0e(eu(eu(eu({},rb),n),{},{ticks:Igt(n),viewBox:{x:0,y:0,width:r,height:s}})),a.top,a.top+a.height,t)},TVn={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Qu.grid};function Gbt(e){var t=Lgt(),n=zgt(),r=Dgt(),s=eu(eu({},ef(e,TVn)),{},{x:nr(e.x)?e.x:r.left,y:nr(e.y)?e.y:r.top,width:nr(e.width)?e.width:r.width,height:nr(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=tf(),g=fr(I=>tLe(I,"xAxis",a,m)),v=fr(I=>tLe(I,"yAxis",i,m));if(!yv(u)||!yv(d)||!nr(o)||!nr(c))return null;var b=s.verticalCoordinatesGenerator||EVn,S=s.horizontalCoordinatesGenerator||CVn,{horizontalPoints:w,verticalPoints:O}=s;if((!w||!w.length)&&typeof S=="function"){var E=p&&p.length,_=S({yAxis:v?eu(eu({},v),{},{ticks:E?p:v.ticks}):void 0,width:t??u,height:n??d,offset:r},E?!0:f);c8(Array.isArray(_),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof _,"]")),Array.isArray(_)&&(w=_)}if((!O||!O.length)&&typeof b=="function"){var C=h&&h.length,j=b({xAxis:g?eu(eu({},g),{},{ticks:C?h:g.ticks}):void 0,width:t??u,height:n??d,offset:r},C?!0:f);c8(Array.isArray(j),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(O=j)}return y.createElement(Gb,{zIndex:s.zIndex},y.createElement("g",{className:"recharts-cartesian-grid"},y.createElement(wVn,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),y.createElement(OVn,IS({},s,{horizontalPoints:w})),y.createElement(_Vn,IS({},s,{verticalPoints:O})),y.createElement(SVn,IS({},s,{offset:r,horizontalPoints:w,xAxis:g,yAxis:v})),y.createElement(kVn,IS({},s,{offset:r,verticalPoints:O,xAxis:g,yAxis:v}))))}Gbt.displayName="CartesianGrid";var jVn={},Qbt=_u({name:"errorBars",initialState:jVn,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:Pas,replaceErrorBar:Mas,removeErrorBar:$as}=Qbt.actions,IVn=Qbt.reducer,NVn=["children"];function AVn(e,t){if(e==null)return{};var n,r,s=RVn(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 RVn(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 PVn={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},MVn=y.createContext(PVn);function $Vn(e){var{children:t}=e,n=AVn(e,NVn);return y.createElement(MVn.Provider,{value:n},t)}function Ybt(e,t){var n,r,s=fr(u=>Hb(u,e)),a=fr(u=>Zb(u,t)),i=(n=s?.allowDataOverflow)!==null&&n!==void 0?n:jl.allowDataOverflow,o=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Il.allowDataOverflow,c=i||o;return{needClip:c,needClipX:i,needClipY:o}}function DVn(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,s=w0e(),{needClipX:a,needClipY:i,needClip:o}=Ybt(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 Xbt=(e,t,n,r)=>Qyt(e,"xAxis",t,r),Kbt=(e,t,n,r)=>Gyt(e,"xAxis",t,r),Jbt=(e,t,n,r)=>Qyt(e,"yAxis",n,r),ext=(e,t,n,r)=>Gyt(e,"yAxis",n,r),LVn=tt([wo,Xbt,Jbt,Kbt,ext],(e,t,n,r,s)=>Bb(e,"xAxis")?l8(t,r,!1):l8(n,s,!1)),zVn=(e,t,n,r,s)=>s;function FVn(e){return e.type==="line"}var BVn=tt([vyt,zVn],(e,t)=>e.filter(FVn).find(n=>n.id===t)),UVn=tt([wo,Xbt,Jbt,Kbt,ext,BVn,LVn,D$],(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 cHn({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:s,dataKey:f,bandSize:i,displayedData:h})}});function qVn(e){var t=xU(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 VVn=["id"],HVn=["type","layout","connectNulls","needClip","shape"],ZVn=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function v2(){return v2=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},v2.apply(null,arguments)}function t5e(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 Tg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?t5e(Object(n),!0).forEach(function(r){WVn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WVn(e,t,n){return(t=GVn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GVn(e){var t=QVn(e,"string");return typeof t=="symbol"?t:t+""}function QVn(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 O0e(e,t){if(e==null)return{};var n,r,s=YVn(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 YVn(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 XVn=e=>{var{dataKey:t,name:n,stroke:r,legendType:s,hide:a}=e;return[{inactive:a,dataKey:t,type:s,color:r,value:Ngt(n,t),payload:e}]},KVn=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:Bj,settings:{stroke:r,strokeWidth:s,fill:a,dataKey:t,nameKey:void 0,name:Ngt(i,t),hide:o,type:u,color:r,unit:c,graphicalItemId:d}};return y.createElement(BUn,{tooltipEntrySettings:f})}),txt=(e,t)=>"".concat(t,"px ").concat(e,"px");function JVn(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],s=0;s<t;++s)r.push(...n);return r}var eHn=(e,t,n)=>{var r=n.reduce((p,h)=>p+h,0);if(!r)return txt(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[...JVn(n,s),...i,...f].map(p=>"".concat(p,"px")).join(", ")};function tHn(e){var{clipPathId:t,points:n,props:r}=e,{dot:s,dataKey:a,needClip:i}=r,{id:o}=r,c=O0e(r,VVn),u=gv(c);return y.createElement(cqn,{points:n,dot:s,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:i,clipPathId:t})}function nHn(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 Tg(Tg({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return y.createElement(pUn,{value:t?s:void 0},n)}function n5e(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=O0e(a,HVn),p=Tg(Tg({},sd(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(FUn,v2({shapeType:"curve",option:d},p,{pathRef:n})),y.createElement(tHn,{points:r,clipPathId:t,props:a}))}function rHn(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function sHn(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=xxe(i,"recharts-line-"),w=y.useRef(S),[O,E]=y.useState(!1),_=!O,C=y.useCallback(()=>{typeof g=="function"&&g(),E(!1)},[g]),j=y.useCallback(()=>{typeof v=="function"&&v(),E(!0)},[v]),I=rHn(r.current),N=y.useRef(0);w.current!==S&&(N.current=a.current,w.current=S);var R=N.current;return y.createElement(nHn,{points:i,showLabels:_},n.children,y.createElement(bxe,{animationId:S,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:C,onAnimationStart:j,key:S},P=>{var B=Td(R,I+R,P),M=Math.min(B,I),L;if(c)if(o){var F="".concat(o).split(/[,\s]+/gim).map(H=>parseFloat(H));L=eHn(M,I,F)}else L=txt(I,M);else L=o==null?void 0:String(o);if(P>0&&I>0&&(s.current=i,a.current=Math.max(a.current,M)),b){var z=b.length/i.length,U=P===1?i:i.map((H,D)=>{var Y=Math.floor(D*z);if(b[Y]){var V=b[Y];return Tg(Tg({},H),{},{x:Td(V.x,H.x,P),y:Td(V.y,H.y,P)})}return p?Tg(Tg({},H),{},{x:Td(h*2,H.x,P),y:Td(m/2,H.y,P)}):Tg(Tg({},H),{},{x:H.x,y:H.y})});return s.current=U,y.createElement(n5e,{props:n,points:U,clipPathId:t,pathRef:r,strokeDasharray:L})}return y.createElement(n5e,{props:n,points:i,clipPathId:t,pathRef:r,strokeDasharray:L})}),y.createElement(gUn,{label:n.label}))}function aHn(e){var{clipPathId:t,props:n}=e,r=y.useRef(null),s=y.useRef(0),a=y.useRef(null);return y.createElement(sHn,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:s,pathRef:a})}var iHn=(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:ec(e.payload,t)}};class oHn 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=Ua("recharts-line",s),g=f,{r:v,strokeWidth:b}=qVn(n),S=Fbt(n),w=v*2+b,O=p?"url(#clipPath-".concat(S?"":"dots-").concat(g,")"):void 0;return y.createElement(Gb,{zIndex:h},y.createElement(mb,{className:m},p&&y.createElement("defs",null,y.createElement(DVn,{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($Vn,{xAxisId:a,yAxisId:i,data:r,dataPointFormatter:iHn,errorBarOffset:0},y.createElement(aHn,{props:this.props,clipPathId:g}))),y.createElement(jqn,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:O}))}}var nxt={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:Qu.line,type:"linear"};function lHn(e){var t=ef(e,nxt),{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=O0e(t,ZVn),{needClip:b}=Ybt(h,m),S=w0e(),w=Uj(),O=tf(),E=fr(N=>UVn(N,h,m,O,g));if(w!=="horizontal"&&w!=="vertical"||E==null||S==null)return null;var{height:_,width:C,x:j,y:I}=S;return y.createElement(oHn,v2({},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:E,layout:w,height:_,width:C,left:j,top:I,needClip:b}))}function cHn(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=ec(u,i);if(t==="horizontal"){var p=e4e({axis:n,ticks:s,bandSize:o,entry:u,index:d}),h=nc(f)?null:r.scale.map(f);return{x:p,y:h??null,value:f,payload:u}}var m=nc(f)?null:n.scale.map(f),g=e4e({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 uHn(e){var t=ef(e,nxt),n=tf();return y.createElement(WUn,{id:t.id,type:"line"},r=>y.createElement(y.Fragment,null,y.createElement(UUn,{legendPayload:XVn(t)}),y.createElement(KVn,{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(eqn,{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(lHn,v2({},t,{id:r}))))}var rxt=y.memo(uHn,qU);rxt.displayName="Line";var dHn=["domain","range"],fHn=["domain","range"];function r5e(e,t){if(e==null)return{};var n,r,s=pHn(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 pHn(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 s5e(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 sxt(e,t){if(e===t)return!0;var{domain:n,range:r}=e,s=r5e(e,dHn),{domain:a,range:i}=t,o=r5e(t,fHn);return!s5e(n,a)||!s5e(r,i)?!1:qU(s,o)}var hHn=["type"],mHn=["dangerouslySetInnerHTML","ticks","scale"],gHn=["id","scale"];function Jde(){return Jde=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},Jde.apply(null,arguments)}function a5e(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 i5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?a5e(Object(n),!0).forEach(function(r){vHn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vHn(e,t,n){return(t=yHn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yHn(e){var t=bHn(e,"string");return typeof t=="symbol"?t:t+""}function bHn(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 efe(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 wHn(e){var t=yl(),n=y.useRef(null),r=Fgt(),{type:s}=e,a=efe(e,hHn),i=ZU(r,"xAxis",s),o=y.useMemo(()=>{if(i!=null)return i5e(i5e({},a),{},{type:i})},[a,i]);return y.useLayoutEffect(()=>{o!=null&&(n.current===null?t(hqn(o)):n.current!==o&&t(mqn({prev:n.current,next:o})),n.current=o)},[o,t]),y.useLayoutEffect(()=>()=>{n.current&&(t(gqn(n.current)),n.current=null)},[t]),null}var SHn=e=>{var{xAxisId:t,className:n}=e,r=fr(Rgt),s=tf(),a="xAxis",i=fr(b=>Wyt(b,a,t,s)),o=fr(b=>N8n(b,t)),c=fr(b=>D8n(b,t)),u=fr(b=>pyt(b,t));if(o==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:p}=e,h=efe(e,mHn),{id:m,scale:g}=u,v=efe(u,gHn);return y.createElement(k0e,Jde({},h,v,{x:c.x,y:c.y,width:o.width,height:o.height,className:Ua("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:i,axisType:a,axisId:t}))},kHn={allowDataOverflow:jl.allowDataOverflow,allowDecimals:jl.allowDecimals,allowDuplicatedCategory:jl.allowDuplicatedCategory,angle:jl.angle,axisLine:rb.axisLine,height:jl.height,hide:!1,includeHidden:jl.includeHidden,interval:jl.interval,label:!1,minTickGap:jl.minTickGap,mirror:jl.mirror,orientation:jl.orientation,padding:jl.padding,reversed:jl.reversed,scale:jl.scale,tick:jl.tick,tickCount:jl.tickCount,tickLine:rb.tickLine,tickSize:rb.tickSize,type:jl.type,niceTicks:jl.niceTicks,xAxisId:0},OHn=e=>{var t=ef(e,kHn);return y.createElement(y.Fragment,null,y.createElement(wHn,{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(SHn,t))},axt=y.memo(OHn,sxt);axt.displayName="XAxis";var _Hn=["type"],EHn=["dangerouslySetInnerHTML","ticks","scale"],CHn=["id","scale"];function tfe(){return tfe=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},tfe.apply(null,arguments)}function o5e(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 l5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o5e(Object(n),!0).forEach(function(r){THn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function THn(e,t,n){return(t=jHn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jHn(e){var t=IHn(e,"string");return typeof t=="symbol"?t:t+""}function IHn(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 nfe(e,t){if(e==null)return{};var n,r,s=NHn(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 NHn(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 AHn(e){var t=yl(),n=y.useRef(null),r=Fgt(),{type:s}=e,a=nfe(e,_Hn),i=ZU(r,"yAxis",s),o=y.useMemo(()=>{if(i!=null)return l5e(l5e({},a),{},{type:i})},[i,a]);return y.useLayoutEffect(()=>{o!=null&&(n.current===null?t(vqn(o)):n.current!==o&&t(yqn({prev:n.current,next:o})),n.current=o)},[o,t]),y.useLayoutEffect(()=>()=>{n.current&&(t(bqn(n.current)),n.current=null)},[t]),null}function RHn(e){var{yAxisId:t,className:n,width:r,label:s}=e,a=y.useRef(null),i=y.useRef(null),o=fr(Rgt),c=tf(),u=yl(),d="yAxis",f=fr(_=>F8n(_,t)),p=fr(_=>z8n(_,t)),h=fr(_=>Wyt(_,d,t,c)),m=fr(_=>hyt(_,t));if(y.useLayoutEffect(()=>{if(!(r!=="auto"||!f||x0e(s)||y.isValidElement(s)||m==null)){var _=a.current;if(_){var C=_.getCalculatedWidth();Math.round(f.width)!==Math.round(C)&&u(xqn({id:t,width:C}))}}},[h,f,u,s,t,r,m]),f==null||p==null||m==null)return null;var{dangerouslySetInnerHTML:g,ticks:v,scale:b}=e,S=nfe(e,EHn),{id:w,scale:O}=m,E=nfe(m,CHn);return y.createElement(k0e,tfe({},S,E,{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:Ua("recharts-".concat(d," ").concat(d),n),viewBox:o,ticks:h,axisType:d,axisId:t}))}var PHn={allowDataOverflow:Il.allowDataOverflow,allowDecimals:Il.allowDecimals,allowDuplicatedCategory:Il.allowDuplicatedCategory,angle:Il.angle,axisLine:rb.axisLine,hide:!1,includeHidden:Il.includeHidden,interval:Il.interval,label:!1,minTickGap:Il.minTickGap,mirror:Il.mirror,orientation:Il.orientation,padding:Il.padding,reversed:Il.reversed,scale:Il.scale,tick:Il.tick,tickCount:Il.tickCount,tickLine:rb.tickLine,tickSize:rb.tickSize,type:Il.type,niceTicks:Il.niceTicks,width:Il.width,yAxisId:0},MHn=e=>{var t=ef(e,PHn);return y.createElement(y.Fragment,null,y.createElement(AHn,{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(RHn,t))},ixt=y.memo(MHn,sxt);ixt.displayName="YAxis";var $Hn=(e,t)=>t,_0e=tt([$Hn,wo,_vt,ic,fbt,Wb,c7n,Mc],g7n);function DHn(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function E0e(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(DHn(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 oxt=ip("mouseClick"),lxt=A$();lxt.startListening({actionCreator:oxt,effect:(e,t)=>{var n=e.payload,r=_0e(t.getState(),E0e(n));r?.activeIndex!=null&&t.dispatch(t9n({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var rfe=ip("mouseMove"),cxt=A$(),U_=null,R1=null,GX=null;cxt.startListening({actionCreator:rfe,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:s,throttledEvents:a}=r.eventSettings,i=a==="all"||a?.includes("mousemove");U_!==null&&(cancelAnimationFrame(U_),U_=null),R1!==null&&(typeof s!="number"||!i)&&(clearTimeout(R1),R1=null),GX=E0e(n);var o=()=>{var c=t.getState(),u=H$(c,c.tooltip.settings.shared);if(!GX){U_=null,R1=null;return}if(u==="axis"){var d=_0e(c,GX);d?.activeIndex!=null?t.dispatch(nbt({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(tbt())}U_=null,R1=null};if(!i){o();return}s==="raf"?U_=requestAnimationFrame(o):typeof s=="number"&&R1===null&&(R1=setTimeout(o,s))}});function LHn(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 c5e={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},uxt=_u({name:"rootProps",initialState:c5e,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:c5e.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}}}),zHn=uxt.reducer,{updateOptions:FHn}=uxt.actions,BHn=null,UHn={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)},dxt=_u({name:"polarOptions",initialState:BHn,reducers:UHn}),{updatePolarOptions:Das}=dxt.actions,qHn=dxt.reducer,fxt=ip("keyDown"),pxt=ip("focus"),hxt=ip("blur"),iq=A$(),q_=null,P1=null,WL=null;iq.startListening({actionCreator:fxt,effect:(e,t)=>{WL=e.payload,q_!==null&&(cancelAnimationFrame(q_),q_=null);var n=t.getState(),{throttleDelay:r,throttledEvents:s}=n.eventSettings,a=s==="all"||s.includes("keydown");P1!==null&&(typeof r!="number"||!a)&&(clearTimeout(P1),P1=null);var i=()=>{try{var o=t.getState(),c=o.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=o.tooltip,d=WL;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=_R(u,$k(o),ST(o),kT(o)),p=f==null?-1:Number(f),h=!Number.isFinite(p)||p<0,m=Wb(o),g=$k(o),v=H$(o,o.tooltip.settings.shared);if(d==="Enter"){if(h)return;var b=R8(o,v,"hover",String(u.index));t.dispatch(A8({active:!u.active,activeIndex:u.index,activeCoordinate:b}));return}var S=H8n(o),w=S==="left-to-right"?1:-1,O=d==="ArrowRight"?1:-1,E;if(h){var _=ST(o),C=kT(o),j=O*w,I=M=>({active:!1,index:String(M),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(E=-1,j>0){for(var N=0;N<g.length;N++)if(_R(I(N),g,_,C)!=null){E=N;break}}else for(var R=g.length-1;R>=0;R--)if(_R(I(R),g,_,C)!=null){E=R;break}if(E<0)return}else{E=p+O*w;var P=m?.length||g.length;if(P===0||E>=P||E<0)return}var B=R8(o,v,"hover",String(E));t.dispatch(A8({active:!0,activeIndex:E.toString(),activeCoordinate:B}))}finally{q_=null,P1=null}};if(!a){i();return}r==="raf"?q_=requestAnimationFrame(i):typeof r=="number"&&P1===null&&(i(),WL=null,P1=setTimeout(()=>{WL?i():(P1=null,q_=null)},r))}});iq.startListening({actionCreator:pxt,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=H$(n,n.tooltip.settings.shared),o=R8(n,i,"hover",String(a));t.dispatch(A8({active:!0,activeIndex:a,activeCoordinate:o}))}}}});iq.startListening({actionCreator:hxt,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:s}=n.tooltip;s.active&&t.dispatch(A8({active:!1,activeIndex:s.index,activeCoordinate:s.coordinate}))}}});function mxt(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 qp=ip("externalEvent"),gxt=A$(),GL=new Map,YN=new Map,QX=new Map;gxt.startListening({actionCreator:qp,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var s=r.type,a=mxt(r);QX.set(s,{handler:n,reactEvent:a});var i=GL.get(s);i!==void 0&&(cancelAnimationFrame(i),GL.delete(s));var o=t.getState(),{throttleDelay:c,throttledEvents:u}=o.eventSettings,d=u,f=d==="all"||d?.includes(s),p=YN.get(s);p!==void 0&&(typeof c!="number"||!f)&&(clearTimeout(p),YN.delete(s));var h=()=>{var v=QX.get(s);try{if(!v)return;var{handler:b,reactEvent:S}=v,w=t.getState(),O={activeCoordinate:W9n(w),activeDataKey:V9n(w),activeIndex:h2(w),activeLabel:mbt(w),activeTooltipIndex:h2(w),isTooltipActive:G9n(w)};b&&b(O,S)}finally{GL.delete(s),YN.delete(s),QX.delete(s)}};if(!f){h();return}if(c==="raf"){var m=requestAnimationFrame(h);GL.set(s,m)}else if(typeof c=="number"){if(!YN.has(s)){h();var g=setTimeout(h,c);YN.set(s,g)}}else h()}}});var VHn=tt([Qj],e=>e.tooltipItemPayloads),HHn=tt([VHn,(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)}}}),vxt=ip("touchMove"),yxt=A$(),M1=null,Px=null,u5e=null,XN=null;yxt.startListening({actionCreator:vxt,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){XN=mxt(n);var r=t.getState(),{throttleDelay:s,throttledEvents:a}=r.eventSettings,i=a==="all"||a.includes("touchmove");M1!==null&&(cancelAnimationFrame(M1),M1=null),Px!==null&&(typeof s!="number"||!i)&&(clearTimeout(Px),Px=null),u5e=Array.from(n.touches).map(c=>E0e({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var o=()=>{if(XN!=null){var c=t.getState(),u=H$(c,c.tooltip.settings.shared);if(u==="axis"){var d,f=(d=u5e)===null||d===void 0?void 0:d[0];if(f==null){M1=null,Px=null;return}var p=_0e(c,f);p?.activeIndex!=null&&t.dispatch(nbt({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate}))}else if(u==="item"){var h,m=XN.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(b3n),b=(h=g.getAttribute(x3n))!==null&&h!==void 0?h:void 0,S=EO(c).find(E=>E.id===b);if(v==null||S==null||b==null)return;var{dataKey:w}=S,O=HHn(c,v,b);t.dispatch(e9n({activeDataKey:w,activeIndex:v,activeCoordinate:O,activeGraphicalItemId:b}))}M1=null,Px=null}};if(!i){o();return}s==="raf"?M1=requestAnimationFrame(o):typeof s=="number"&&Px===null&&(o(),XN=null,Px=setTimeout(()=>{XN?o():(Px=null,M1=null)},s))}}});var bxt={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},xxt=_u({name:"eventSettings",initialState:bxt,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:ZHn}=xxt.actions,WHn=xxt.reducer,GHn=Zpt({brush:Nqn,cartesianAxis:wqn,chartData:W7n,errorBars:IVn,eventSettings:WHn,graphicalItems:KUn,layout:s3n,legend:fLn,options:U7n,polarAxis:yUn,polarOptions:qHn,referenceElements:Mqn,renderedTicks:Kqn,rootProps:zHn,tooltip:n9n,zIndex:j7n}),QHn=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return j4n({reducer:GHn,preloadedState:t,middleware:r=>{var s;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([lxt.middleware,cxt.middleware,iq.middleware,gxt.middleware,yxt.middleware])},enhancers:r=>{var s=r;return typeof r=="function"&&(s=r()),s.concat(mgt({type:"raf"}))},devTools:{serialize:{replacer:LHn},name:"recharts-".concat(n)}})};function YHn(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,s=tf(),a=y.useRef(null);if(s)return n;a.current==null&&(a.current=QHn(t,r));var i=cxe;return y.createElement(tht,{context:i,store:a.current},n)}function XHn(e){var{layout:t,margin:n}=e,r=yl(),s=tf();return y.useEffect(()=>{s||(r(t3n(t)),r(e3n(n)))},[r,s,t,n]),null}var KHn=y.memo(XHn,qU);function JHn(e){var t=yl();return y.useEffect(()=>{t(FHn(e))},[t,e]),null}var eZn=e=>{var t=yl();return y.useEffect(()=>{t(ZHn(e))},[t,e]),null},tZn=y.memo(eZn,qU);function d5e(e){var{zIndex:t,isPanorama:n}=e,r=y.useRef(null),s=yl();return y.useLayoutEffect(()=>(r.current&&s(C7n({zIndex:t,element:r.current,isPanorama:n})),()=>{s(T7n({zIndex:t,isPanorama:n}))}),[s,t,n]),y.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function f5e(e){var{children:t,isPanorama:n}=e,r=fr(y7n);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(d5e,{key:i,zIndex:i,isPanorama:n})),t,a.map(i=>y.createElement(d5e,{key:i,zIndex:i,isPanorama:n})))}var nZn=["children"];function rZn(e,t){if(e==null)return{};var n,r,s=sZn(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 sZn(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 z8(){return z8=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},z8.apply(null,arguments)}var aZn={width:"100%",height:"100%",display:"block"},iZn=y.forwardRef((e,t)=>{var n=Lgt(),r=zgt(),s=Ygt();if(!yv(n)||!yv(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(wmt,z8({},i,{title:o,desc:c,role:d,tabIndex:u,width:n,height:r,style:aZn,ref:t}),a)}),oZn=e=>{var{children:t}=e,n=fr(LU);if(!n)return null;var{width:r,height:s,y:a,x:i}=n;return y.createElement(wmt,{width:r,height:s,x:i,y:a},t)},p5e=y.forwardRef((e,t)=>{var{children:n}=e,r=rZn(e,nZn),s=tf();return s?y.createElement(oZn,null,y.createElement(f5e,{isPanorama:!0},n)):y.createElement(iZn,z8({ref:t},r),y.createElement(f5e,{isPanorama:!1},n))});function lZn(){var e=yl(),[t,n]=y.useState(null),r=fr(y3n);return y.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),a=s.width/t.offsetWidth;ca(a)&&a!==r&&e(r3n(a))}},[t,e,r]),n}function h5e(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 cZn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h5e(Object(n),!0).forEach(function(r){uZn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uZn(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=fZn(e,"string");return typeof t=="symbol"?t:t+""}function fZn(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 P0(){return P0=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},P0.apply(null,arguments)}var pZn=()=>(nBn(),null);function F8(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var hZn=y.forwardRef((e,t)=>{var n,r,s=y.useRef(null),[a,i]=y.useState({containerWidth:F8((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:F8((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(P$,{width:a.containerWidth,height:a.containerHeight}),y.createElement("div",P0({ref:c},e)))}),mZn=y.forwardRef((e,t)=>{var{width:n,height:r}=e,[s,a]=y.useState({containerWidth:F8(n),containerHeight:F8(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(P$,{width:s.containerWidth,height:s.containerHeight}),y.createElement("div",P0({ref:o},e)))}),gZn=y.forwardRef((e,t)=>{var{width:n,height:r}=e;return y.createElement(y.Fragment,null,y.createElement(P$,{width:n,height:r}),y.createElement("div",P0({ref:t},e)))}),vZn=y.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?y.createElement(mZn,P0({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?y.createElement(gZn,P0({},e,{width:n,height:r,ref:t})):y.createElement(y.Fragment,null,y.createElement(P$,{width:n,height:r}),y.createElement("div",P0({ref:t},e)))});function yZn(e){return e?hZn:vZn}var bZn=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,O=y.useRef(null),E=yl(),[_,C]=y.useState(null),[j,I]=y.useState(null),N=lZn(),R=mxe(),P=R?.width>0?R.width:b,B=R?.height>0?R.height:s,M=y.useCallback(se=>{N(se),typeof t=="function"&&t(se),C(se),I(se),se!=null&&(O.current=se)},[N,t,C,I]),L=y.useCallback(se=>{E(oxt(se)),E(qp({handler:a,reactEvent:se}))},[E,a]),F=y.useCallback(se=>{E(rfe(se)),E(qp({handler:u,reactEvent:se}))},[E,u]),z=y.useCallback(se=>{E(tbt()),E(qp({handler:d,reactEvent:se}))},[E,d]),U=y.useCallback(se=>{E(rfe(se)),E(qp({handler:f,reactEvent:se}))},[E,f]),H=y.useCallback(()=>{E(pxt())},[E]),D=y.useCallback(()=>{E(hxt())},[E]),Y=y.useCallback(se=>{E(fxt(se.key))},[E]),V=y.useCallback(se=>{E(qp({handler:i,reactEvent:se}))},[E,i]),$=y.useCallback(se=>{E(qp({handler:o,reactEvent:se}))},[E,o]),Z=y.useCallback(se=>{E(qp({handler:c,reactEvent:se}))},[E,c]),G=y.useCallback(se=>{E(qp({handler:p,reactEvent:se}))},[E,p]),K=y.useCallback(se=>{E(qp({handler:g,reactEvent:se}))},[E,g]),ne=y.useCallback(se=>{w&&E(vxt(se)),E(qp({handler:m,reactEvent:se}))},[E,w,m]),ee=y.useCallback(se=>{E(qp({handler:h,reactEvent:se}))},[E,h]),J=yZn(S);return y.createElement(Sbt.Provider,{value:_},y.createElement(_$n.Provider,{value:j},y.createElement(J,{width:P??v?.width,height:B??v?.height,className:Ua("recharts-wrapper",r),style:cZn({position:"relative",cursor:"default",width:P,height:B},v),onClick:L,onContextMenu:V,onDoubleClick:$,onFocus:H,onBlur:D,onKeyDown:Y,onMouseDown:Z,onMouseEnter:F,onMouseLeave:z,onMouseMove:U,onMouseUp:G,onTouchEnd:ee,onTouchMove:ne,onTouchStart:K,ref:M},y.createElement(pZn,null),n)))}),xZn=["width","height","responsive","children","className","style","compact","title","desc"];function wZn(e,t){if(e==null)return{};var n,r,s=SZn(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 SZn(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 kZn=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=wZn(e,xZn),p=gv(f);return c?y.createElement(y.Fragment,null,y.createElement(P$,{width:n,height:r}),y.createElement(p5e,{otherAttributes:p,title:u,desc:d},a)):y.createElement(bZn,{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(p5e,{otherAttributes:p,title:u,desc:d,ref:t},y.createElement(Dqn,null,a)))});function sfe(){return sfe=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},sfe.apply(null,arguments)}function m5e(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 OZn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m5e(Object(n),!0).forEach(function(r){_Zn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _Zn(e,t,n){return(t=EZn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EZn(e){var t=CZn(e,"string");return typeof t=="symbol"?t:t+""}function CZn(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 TZn={top:5,right:5,bottom:5,left:5},jZn=OZn({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:TZn,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},bxt),IZn=y.forwardRef(function(t,n){var r,s=ef(t.categoricalChartProps,jZn),{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(YHn,{preloadedState:{options:d},reduxStoreName:(r=u.id)!==null&&r!==void 0?r:a},y.createElement(Iqn,{chartData:u.data}),y.createElement(KHn,{layout:s.layout,margin:s.margin}),y.createElement(tZn,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),y.createElement(JHn,{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(kZn,sfe({},s,{ref:n})))}),NZn=["axis"],AZn=y.forwardRef((e,t)=>y.createElement(IZn,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:NZn,tooltipPayloadSearcher:F7n,categoricalChartProps:e,ref:t}));function RZn(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function PZn(e,t){const n=getComputedStyle(e.ownerDocument.body),r=parseFloat(n.fontSize);return t*r}function MZn(e){return e/100*window.innerHeight}function $Zn(e){return e/100*window.innerWidth}function DZn(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 BA({groupSize:e,panelElement:t,styleProp:n}){let r;const[s,a]=DZn(n);switch(a){case"%":{r=s/100*e;break}case"px":{r=s;break}case"rem":{r=PZn(t,s);break}case"em":{r=RZn(t,s);break}case"vh":{r=MZn(s);break}case"vw":{r=$Zn(s);break}}return r}function Xu(e){return parseFloat(e.toFixed(3))}function OT({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 afe(e){const{panels:t}=e,n=OT({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=BA({groupSize:n,panelElement:s,styleProp:a.collapsedSize});i=Xu(d/n*100)}let o;if(a.defaultSize!==void 0){const d=BA({groupSize:n,panelElement:s,styleProp:a.defaultSize});o=Xu(d/n*100)}let c=0;if(a.minSize!==void 0){const d=BA({groupSize:n,panelElement:s,styleProp:a.minSize});c=Xu(d/n*100)}let u=100;if(a.maxSize!==void 0){const d=BA({groupSize:n,panelElement:s,styleProp:a.maxSize});u=Xu(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 Xa(e,t="Assertion error"){if(!e)throw Error(t)}function ife(e,t){return Array.from(t).sort(e==="horizontal"?LZn:zZn)}function LZn(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function zZn(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function wxt(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Sxt(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 FZn({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}=Sxt(r,i),u=e==="horizontal"?o:c;u<a&&(a=u,s=i)}return Xa(s,"No rect found"),s}let QL;function BZn(){return QL===void 0&&(typeof matchMedia=="function"?QL=!!matchMedia("(pointer:coarse)").matches:QL=!1),QL}function kxt(e){const{element:t,orientation:n,panels:r,separators:s}=e,a=ife(n,Array.from(t.children).filter(wxt).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 O=n==="horizontal"?new DOMRect(b.right,b.top,0,b.height):new DOMRect(b.left,b.bottom,b.width,0),E=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,E];break}case 1:{const _=h[0],C=FZn({orientation:n,rects:[b,S],targetRect:_.element.getBoundingClientRect()});w=[_,C===b?E: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 O of w){let E="width"in O?O:O.element.getBoundingClientRect();const _=BZn()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(E.width<_){const j=_-E.width;E=new DOMRect(E.x-j/2,E.y,E.width+j,E.height)}if(E.height<_){const j=_-E.height;E=new DOMRect(E.x,E.y-j/2,E.width,E.height+j)}const C=m<=u||m>d;!o&&!C&&i.push({group:e,groupSize:OT({group:e}),panels:[p,v],separator:"width"in O?void 0:O,rect:E}),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 Oxt=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 _xt=new Oxt;function UZn(e){Qg=new Map(Qg),Qg.delete(e)}function g5e(e,t){for(const[n]of Qg)if(n.id===e)return n}function M0(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 CO(){return Qg}function C0e(e,t){return _xt.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function wb(e,t){const n=Qg.get(e);Qg=new Map(Qg),Qg.set(e,t),_xt.emit("groupChange",{group:e,prev:n,next:t})}function qZn(e,t,n){let r,s={x:1/0,y:1/0};for(const a of t){const i=Sxt(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 VZn(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function HZn(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:b5e(e),b:b5e(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Xa(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:y5e(v5e(n.a)),b:y5e(v5e(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 ZZn=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function WZn(e){const t=getComputedStyle(Ext(e)??e).display;return t==="flex"||t==="inline-flex"}function GZn(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||WZn(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"||ZZn.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function v5e(e){let t=e.length;for(;t--;){const n=e[t];if(Xa(n,"Missing node"),GZn(n))return n}return null}function y5e(e){return e&&Number(getComputedStyle(e).zIndex)||0}function b5e(e){const t=[];for(;e;)t.push(e),e=Ext(e);return t}function Ext(e){const{parentNode:t}=e;return VZn(t)?t.host:t}function QZn(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 YZn({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!wxt(n)||n.contains(e)||e.contains(n))return!0;if(HZn(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(QZn(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function T0e(e,t){const n=[];return t.forEach((r,s)=>{if(s.disabled)return;const a=kxt(s),i=qZn(s.orientation,a,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&YZn({groupElement:s.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&n.push(i.hitRegion)}),n}function XZn(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(Xu(e)-Xu(t))<=n}function Eg(e,t){return Gc(e,t)?0:e>t?1:-1}function LE({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(Eg(r,c)<0)if(a){const u=(s+c)/2;Eg(r,u)<0?r=s:r=c}else r=c;return r=Math.min(o,r),r=Xu(r),r}function y2({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;Xa(d!=null,"Invalid first pivot index"),Xa(f!=null,"Invalid second pivot index");let p=0;switch(a){case"keyboard":{{const g=e<0?f:d,v=n[g];Xa(v,`Panel constraints not found for index ${g}`);const{collapsedSize:b=0,collapsible:S,minSize:w=0}=v;if(S){const O=o[g];if(Xa(O!=null,`Previous layout not found for panel index ${g}`),Gc(O,b)){const E=w-O;Eg(E,Math.abs(e))>0&&(e=e<0?0-E:E)}}}{const g=e<0?d:f,v=n[g];Xa(v,`No panel constraints found for index ${g}`);const{collapsedSize:b=0,collapsible:S,minSize:w=0}=v;if(S){const O=o[g];if(Xa(O!=null,`Previous layout not found for panel index ${g}`),Gc(O,w)){const E=O-b;Eg(E,Math.abs(e))>0&&(e=e<0?0-E:E)}}}break}default:{const g=e<0?f:d,v=n[g];Xa(v,`Panel constraints not found for index ${g}`);const b=o[g],{collapsible:S,collapsedSize:w,minSize:O}=v;if(S&&Eg(b,O)<0)if(e>0){const E=O-w,_=E/2,C=b+e;Eg(C,O)<0&&(e=Eg(e,_)<=0?0:E)}else{const E=O-w,_=100-E/2,C=b-e;Eg(C,O)<0&&(e=Eg(100+e,_)>0?0:-E)}break}}{const g=e<0?1:-1;let v=e<0?f:d,b=0;for(;;){const w=o[v];Xa(w!=null,`Previous layout not found for panel index ${v}`);const O=LE({overrideDisabledPanels:i,panelConstraints:n[v],prevSize:w,size:100})-w;if(b+=O,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];Xa(b!=null,`Previous layout not found for panel index ${g}`);const S=b-v,w=LE({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(XZn(c,u))return s;{const g=e<0?f:d,v=o[g];Xa(v!=null,`Previous layout not found for panel index ${g}`);const b=v+p,S=LE({overrideDisabledPanels:i,panelConstraints:n[g],prevSize:v,size:b});if(u[g]=S,!Gc(S,b)){let w=b-S,O=e<0?f:d;for(;O>=0&&O<n.length;){const E=u[O];Xa(E!=null,`Previous layout not found for panel index ${O}`);const _=E+w,C=LE({overrideDisabledPanels:i,panelConstraints:n[O],prevSize:E,size:_});if(Gc(E,C)||(w-=C-E,u[O]=C),Gc(w,0))break;e>0?O--:O++}}}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 Lk(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||Eg(e[n],t[n])!==0)return!1;return!0}function zk({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];Xa(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];Xa(c!=null,`No layout data found for index ${o}`);const u=r[o];Xa(u!=null,`No layout data found for index ${o}`);const d=LE({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];Xa(c!=null,`No layout data found for index ${o}`);const u=c+a,d=LE({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 Cxt({groupId:e,panelId:t}){const n=()=>{const c=CO();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]:Xu(100-v)}}return y2({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=zk({layout:v,panelConstraints:f});Lk(m,b)||wb(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=OT({group:u}),p=BA({groupSize:f,panelElement:d,styleProp:c}),h=Xu(p/f*100);o(h)}}}function x5e(e){if(e.defaultPrevented)return;const t=CO();T0e(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=Cxt({groupId:n.group.id,panelId:r.id});a&&s!==void 0&&(a.resize(s),e.preventDefault())}}})}function B6(e){const t=CO();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 Txt({groupId:e}){const t=()=>{const n=CO();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=zk({layout:n,panelConstraints:s});return r?o:(Lk(o,u)||wb(a,{defaultLayoutDeferred:r,derivedPanelConstraints:s,groupSize:i,layout:u,separatorToPanels:c}),u)}}}function $1(e,t){const n=B6(e),r=M0(n.id,!0),s=n.separators.find(d=>d.element===e);Xa(s,"Matching separator not found");const a=r.separatorToPanels.get(s);Xa(a,"Matching panels not found");const i=a.map(d=>n.panels.indexOf(d)),o=Txt({groupId:n.id}).getLayout(),c=y2({delta:t,initialLayout:o,panelConstraints:r.derivedPanelConstraints,pivotIndices:i,prevLayout:o,trigger:"keyboard"}),u=zk({layout:c,panelConstraints:r.derivedPanelConstraints});Lk(o,u)||wb(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:u,separatorToPanels:r.separatorToPanels})}function w5e(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=B6(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&$1(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&$1(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&$1(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&$1(t,-5);break}case"End":{e.preventDefault(),$1(t,100);break}case"Enter":{e.preventDefault();const r=B6(t),s=M0(r.id,!0),{derivedPanelConstraints:a,layout:i,separatorToPanels:o}=s,c=r.separators.find(p=>p.element===t);Xa(c,"Matching separator not found");const u=o.get(c);Xa(u,"Matching panels not found");const d=u[0],f=a.find(p=>p.panelId===d.id);if(Xa(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;$1(t,h-p)}break}case"F6":{e.preventDefault();const r=B6(t).separators.map(i=>i.element),s=Array.from(r).findIndex(i=>i===e.currentTarget);Xa(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(),$1(t,-100);break}}}let kC={cursorFlags:0,state:"inactive"};const j0e=new Oxt;function Fk(){return kC}function KZn(e){return j0e.addListener("change",e)}function JZn(e){const t=kC,n={...kC};n.cursorFlags=e,kC=n,j0e.emit("change",{prev:t,next:n})}function OC(e){const t=kC;kC=e,j0e.emit("change",{prev:t,next:e})}function S5e(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=CO(),n=T0e(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)}),OC({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const eWn=e=>e,YX=()=>{},jxt=1,Ixt=2,Nxt=4,Axt=8,k5e=3,O5e=12;let YL;function _5e(){return YL===void 0&&(YL=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(YL=!0)),YL}function tWn({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&&_5e()){const a=(e&jxt)!==0,i=(e&Ixt)!==0,o=(e&Nxt)!==0,c=(e&Axt)!==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 _5e()?r>0&&s>0?"move":r>0?"ew-resize":"ns-resize":r>0&&s>0?"grab":r>0?"col-resize":"row-resize"}}const E5e=new WeakMap;function I0e(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=E5e.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=Fk();switch(r.state){case"active":case"hover":{const s=tWn({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}}E5e.set(e,{prevStyle:t,styleSheet:n})}function Rxt({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:O,layout:E,separatorToPanels:_}=b;if(w&&E&&_){const C=y2({delta:g,initialLayout:v,panelConstraints:w,pivotIndices:u.panels.map(j=>h.indexOf(j)),prevLayout:E,trigger:"mouse-or-touch"});if(Lk(C,E)){if(g!==0&&!m)switch(p){case"horizontal":{o|=g<0?jxt:Ixt;break}case"vertical":{o|=g<0?Nxt:Axt;break}}}else wb(u.group,{defaultLayoutDeferred:S,derivedPanelConstraints:w,groupSize:O,layout:C,separatorToPanels:_})}});let c=0;t.movementX===0?c|=i&k5e:c|=o&k5e,t.movementY===0?c|=i&O5e:c|=o&O5e,JZn(c),I0e(e)}function C5e(e){const t=CO(),n=Fk();n.state==="active"&&Rxt({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function T5e(e){if(e.defaultPrevented)return;const t=Fk(),n=CO();switch(t.state){case"active":{if(e.buttons===0){OC({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(r=>{const s=M0(r.group.id,!0);wb(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)}Rxt({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const r=T0e(e,n);r.length===0?t.state!=="inactive"&&OC({cursorFlags:0,state:"inactive"}):OC({cursorFlags:0,hitRegions:r,state:"hover"}),I0e(e.currentTarget);break}}}function j5e(e){e.relatedTarget instanceof HTMLIFrameElement&&Fk().state==="hover"&&OC({cursorFlags:0,state:"inactive"})}function I5e(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Fk();t.state==="active"&&(OC({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(I0e(e.currentTarget),t.hitRegions.forEach(n=>{const r=M0(n.group.id,!0);wb(n.group,r)}),e.preventDefault()))}function N5e(e){let t=0,n=0;const r={};for(const a of e)if(a.defaultSize!==void 0){t++;const i=Xu(a.defaultSize);n+=i,r[a.panelId]=i}else r[a.panelId]=void 0;const s=e.length-t;if(s!==0){const a=Xu((100-n)/s);for(const i of e)i.defaultSize===void 0&&(r[i.panelId]=a)}return r}function nWn(e,t,n){if(!n[0])return;const r=e.panels.find(c=>c.element===t);if(!r||!r.onResize)return;const s=OT({group:e}),a=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,i=r.mutableValues.prevSize,o={asPercentage:Xu(a/s*100),inPixels:a};r.mutableValues.prevSize=o,r.onResize(o,r.id,i)}function rWn(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 sWn({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=Xu(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]=Xu(p/a*u)}else{const f=Xu(u/c.length);for(const p of c)d[p]=f}return d}function aWn(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 V_=new Map;function iWn(e){let t=!0;Xa(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=OT({group:e});if(S===0)return;const w=M0(e.id);if(!w)return;const O=afe(e),E=w.defaultLayoutDeferred?N5e(O):w.layout,_=sWn({group:e,nextGroupSize:S,prevGroupSize:w.groupSize,prevLayout:E}),C=zk({layout:_,panelConstraints:O});if(!w.defaultLayoutDeferred&&Lk(w.layout,C)&&rWn(w.derivedPanelConstraints,O)&&w.groupSize===S)return;wb(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:O,groupSize:S,layout:C,separatorToPanels:w.separatorToPanels})}}else nWn(e,b,v)}});a.observe(e.element),e.panels.forEach(m=>{Xa(!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=OT({group:e}),o=afe(e),c=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(aWn(e.panels,u)||(u=void 0));const d=e.mutableState.layouts[c]??u??N5e(o),f=zk({layout:d,panelConstraints:o}),p=e.element.ownerDocument;V_.set(p,(V_.get(p)??0)+1);const h=new Map;return kxt(e).forEach(m=>{m.separator&&h.set(m.separator,m.panels)}),wb(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:o,groupSize:i,layout:f,separatorToPanels:h}),e.separators.forEach(m=>{Xa(!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",w5e)}),V_.get(p)===1&&(p.addEventListener("dblclick",x5e,!0),p.addEventListener("pointerdown",S5e,!0),p.addEventListener("pointerleave",C5e),p.addEventListener("pointermove",T5e),p.addEventListener("pointerout",j5e),p.addEventListener("pointerup",I5e,!0)),function(){t=!1,V_.set(p,Math.max(0,(V_.get(p)??0)-1)),UZn(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",w5e)}),V_.get(p)||(p.removeEventListener("dblclick",x5e,!0),p.removeEventListener("pointerdown",S5e,!0),p.removeEventListener("pointerleave",C5e),p.removeEventListener("pointermove",T5e),p.removeEventListener("pointerout",j5e),p.removeEventListener("pointerup",I5e,!0)),a.disconnect()}}function oWn(){const[e,t]=y.useState({}),n=y.useCallback(()=>t({}),[]);return[e,n]}function N0e(e){const t=y.useId();return`${e??t}`}const TO=typeof window<"u"?y.useLayoutEffect:y.useEffect;function CR(e){const t=y.useRef(e);return TO(()=>{t.current=e},[e]),y.useCallback((...n)=>t.current?.(...n),[t])}function A0e(...e){return CR(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function R0e(e){const t=y.useRef({...e});return TO(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const Pxt=y.createContext(null);function lWn(e,t){const n=y.useRef({getLayout:()=>({}),setLayout:eWn});y.useImperativeHandle(t,()=>n.current,[]),TO(()=>{Object.assign(n.current,Txt({groupId:e}))})}function oq({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=CR(R=>{Lk(m.current.onLayoutChange,R)||(m.current.onLayoutChange=R,c?.(R))}),v=CR(R=>{Lk(m.current.onLayoutChanged,R)||(m.current.onLayoutChanged=R,u?.(R))}),b=N0e(o),S=y.useRef(null),[w,O]=oWn(),E=y.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:f,separators:[]}),_=A0e(S,a);lWn(b,i);const C=CR((R,P)=>{const B=Fk(),M=g5e(R),L=M0(R);if(L){let F=!1;return B.state==="active"&&(F=B.hitRegions.some(z=>z.group===M)),{flexGrow:L.layout[P]??1,pointerEvents:F?"none":void 0}}if(n?.[P])return{flexGrow:n?.[P]}}),j=R0e({defaultLayout:n,disableCursor:r}),I=y.useMemo(()=>({get disableCursor(){return!!j.disableCursor},getPanelStyles:C,id:b,orientation:d,registerPanel:R=>{const P=E.current;return P.panels=ife(d,[...P.panels,R]),O(),()=>{P.panels=P.panels.filter(B=>B!==R),O()}},registerSeparator:R=>{const P=E.current;return P.separators=ife(d,[...P.separators,R]),O(),()=>{P.separators=P.separators.filter(B=>B!==R),O()}},updatePanelProps:(R,{disabled:P})=>{const B=E.current.panels.find(F=>F.id===R);B&&(B.panelConstraints.disabled=P);const M=g5e(b),L=M0(b);M&&L&&wb(M,{...L,derivedPanelConstraints:afe(M)})},updateSeparatorProps:(R,{disabled:P,disableDoubleClick:B})=>{const M=E.current.separators.find(L=>L.id===R);M&&(M.disabled=P,M.disableDoubleClick=B)}}),[C,b,O,d,j]),N=y.useRef(null);return TO(()=>{const R=S.current;if(R===null)return;const P=E.current;let B;if(j.defaultLayout!==void 0&&Object.keys(j.defaultLayout).length===P.panels.length){B={};for(const D of P.panels){const Y=j.defaultLayout[D.id];Y!==void 0&&(B[D.id]=Y)}}const M={disabled:!!s,element:R,id:b,mutableState:{defaultLayout:B,disableCursor:!!j.disableCursor,expandedPanelSizes:E.current.lastExpandedPanelSizes,layouts:E.current.layouts},orientation:d,panels:P.panels,resizeTargetMinimumSize:P.resizeTargetMinimumSize,separators:P.separators};N.current=M;const L=iWn(M),{defaultLayoutDeferred:F,derivedPanelConstraints:z,layout:U}=M0(M.id,!0);!F&&z.length>0&&(g(U),v(U));const H=C0e(b,D=>{const{defaultLayoutDeferred:Y,derivedPanelConstraints:V,layout:$}=D.next;if(Y||V.length===0)return;const Z=M.panels.map(({id:K})=>K).join(",");M.mutableState.layouts[Z]=$,V.forEach(K=>{if(K.collapsible){const{layout:ne}=D.prev??{};if(ne){const ee=Gc(K.collapsedSize,$[K.panelId]),J=Gc(K.collapsedSize,ne[K.panelId]);ee&&!J&&(M.mutableState.expandedPanelSizes[K.panelId]=ne[K.panelId])}}});const G=Fk().state!=="active";g($),G&&v($)});return()=>{N.current=null,L(),H()}},[s,b,v,g,d,w,j]),y.useEffect(()=>{const R=N.current;R&&(R.mutableState.defaultLayout=n,R.mutableState.disableCursor=!!r)}),l.jsx(Pxt.Provider,{value:I,children:l.jsx("div",{...h,className:t,"data-group":!0,"data-testid":b,id:b,ref:_,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})})}oq.displayName="Group";function U6(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function cWn({id:e,panelIds:t,storage:n}){const r=U6(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=U6(a,t??[]),o=y.useSyncExternalStore(uWn,()=>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 cWn({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=U6(a,Object.keys(g)):v=U6(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 uWn(){return function(){}}function M0e(){const e=y.useContext(Pxt);return Xa(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function dWn(e,t){const{id:n}=M0e(),r=y.useRef({collapse:YX,expand:YX,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:YX});y.useImperativeHandle(t,()=>r.current,[]),TO(()=>{Object.assign(r.current,Cxt({groupId:n,panelId:e}))})}function lq({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=N0e(c),b=R0e({disabled:a}),S=y.useRef(null),w=A0e(S,i),{getPanelStyles:O,id:E,orientation:_,registerPanel:C,updatePanelProps:j}=M0e(),I=f!==null,N=CR((M,L,F)=>{f?.(M,c,F)});TO(()=>{const M=S.current;if(M!==null){const L={element:M,id:v,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:I?N:void 0,panelConstraints:{groupResizeBehavior:o,collapsedSize:n,collapsible:r,defaultSize:s,disabled:b.disabled,maxSize:u,minSize:d}};return C(L)}},[o,n,r,s,I,v,g,u,d,N,C,b]),y.useEffect(()=>{j(v,{disabled:a})},[a,v,j]),dWn(v,p);const R=()=>{const M=O(E,v);if(M)return JSON.stringify(M)},P=y.useSyncExternalStore(M=>C0e(E,M),R,R);let B;return P?B=JSON.parse(P):s?B={flexGrow:void 0,flexShrink:void 0,flexBasis:s}:B={flexGrow:1},l.jsx("div",{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":v,id:v,ref:w,style:{...fWn,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...B},children:l.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...h,touchAction:_==="horizontal"?"pan-y":"pan-x"},children:e})})}lq.displayName="Panel";const fWn={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function pWn(){return y.useRef(null)}function hWn({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=zk({layout:y2({delta:u-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[n],s=zk({layout:y2({delta:c-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:s,valueMin:a,valueNow:i}}function Mxt({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:s,id:a,style:i,...o}){const c=N0e(a),u=R0e({disabled:n,disableDoubleClick:r}),[d,f]=y.useState({}),[p,h]=y.useState("inactive"),[m,g]=y.useState(!1),v=y.useRef(null),b=A0e(v,s),{disableCursor:S,id:w,orientation:O,registerSeparator:E,updateSeparatorProps:_}=M0e(),C=O==="horizontal"?"vertical":"horizontal";TO(()=>{const N=v.current;if(N!==null){const R={disabled:u.disabled,disableDoubleClick:u.disableDoubleClick,element:N,id:c},P=E(R),B=KZn(L=>{h(L.next.state!=="inactive"&&L.next.hitRegions.some(F=>F.separator===R)?L.next.state:"inactive")}),M=C0e(w,L=>{const{derivedPanelConstraints:F,layout:z,separatorToPanels:U}=L.next,H=U.get(R);if(H){const D=H[0],Y=H.indexOf(D);f(hWn({layout:z,panelConstraints:F,panelId:D.id,panelIndex:Y}))}});return()=>{B(),M(),P()}}},[w,c,E,u]),y.useEffect(()=>{_(c,{disabled:n,disableDoubleClick:r})},[n,r,c,_]);let j;n&&!S&&(j="not-allowed");let I;return n?I="disabled":p==="active"?I="active":m?I="focus":I=p,l.jsx("div",{...o,"aria-controls":d.valueControls,"aria-disabled":n||void 0,"aria-orientation":C,"aria-valuemax":d.valueMax,"aria-valuemin":d.valueMin,"aria-valuenow":d.valueNow,children:e,className:t,"data-separator":I,"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})}Mxt.displayName="Separator";const A5e=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},mWn=(e=>e?A5e(e):A5e),gWn=e=>e;function vWn(e,t=gWn){const n=Ee.useSyncExternalStore(e.subscribe,Ee.useCallback(()=>t(e.getState()),[e,t]),Ee.useCallback(()=>t(e.getInitialState()),[e,t]));return Ee.useDebugValue(n),n}const R5e=e=>{const t=mWn(e),n=r=>vWn(t,r);return Object.assign(n,t),n},$0e=(e=>e?R5e(e):R5e);function yWn(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 ofe=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return ofe(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return ofe(r)(n)}}}},bWn=(e,t)=>(n,r,s)=>{let a={storage:yWn(()=>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(O=>{var E;return O((E=r())!=null?E:h)});const w=((b=a.onRehydrateStorage)==null?void 0:b.call(a,(v=r())!=null?v:h))||void 0;return ofe(d.getItem.bind(d))(a.name).then(O=>{if(O)if(typeof O.version=="number"&&O.version!==a.version){if(a.migrate){const E=a.migrate(O.state,O.version);return E instanceof Promise?E.then(_=>[!0,_]):[!0,E]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,O.state];return[!1,void 0]}).then(O=>{var E;if(S!==o)return;const[_,C]=O;if(m=a.merge(C,(E=r())!=null?E:h),n(m,!0),_)return f()}).then(()=>{S===o&&(w?.(r(),void 0),m=r(),i=!0,u.forEach(O=>O(m)))}).catch(O=>{S===o&&w?.(void 0,O)})};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},xWn=bWn;var na=(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))(na||{});dO().describe("Database record creation time");var wWn=dO().describe("Database record last update time");wWn.nullable();var cq=Te({page:sP().int().min(0).optional().default(0).describe("Zero-indexed page number"),perPage:sP().int().min(1).max(100).optional().default(10).describe("Number of items per page")}).describe("Pagination options for list queries"),uq=Te({total:jt().describe("Total number of items available"),page:jt().describe("Current page"),perPage:or([jt(),rn(!1)]).describe("Number of items per page, or false if pagination is disabled"),hasMore:Ao().describe("True if more pages are available")}),Gw=ve().min(1).describe("Opaque cursor value for incremental polling"),dq=bo(["page","delta"]).describe("List mode: 'page' | 'delta', defaults to 'page' when omitted."),fq=sP().int().min(1).max(100).optional().describe("Maximum number of updates to return in one delta poll"),SWn={page:0,perPage:10},kWn=10;function pq(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 hq(e,t){return{mode:e.mode==="delta"?"delta":"page",filters:e.filters,pagination:e.pagination??t.pagination??SWn,orderBy:e.orderBy??t.orderBy,after:e.after,limit:e.limit??t.limit??kWn}}var mq=Te({limit:jt().describe("Maximum number of updates requested for this delta poll"),hasMore:Ao().describe("True when more matching updates remain after this response")}).describe("Incremental polling metadata"),OWn=Te({start:_Ie().optional().describe("Start of date range (inclusive by default)"),end:_Ie().optional().describe("End of date range (inclusive by default)"),startExclusive:Ao().optional().describe("When true, excludes the start date from results (uses > instead of >=)"),endExclusive:Ao().optional().describe("When true, excludes the end date from results (uses < instead of <=)")}).describe("Date range filter for timestamps"),W$=bo(["ASC","DESC"]).describe("Sort direction: 'ASC' | 'DESC'"),zv=bo(["sum","avg","min","max","count","count_distinct","last"]).describe("Aggregation function"),jO=bo(["1m","5m","15m","1h","1d"]).describe("Time bucket interval"),D0e=bo(["previous_period","previous_day","previous_week"]).describe("Comparison period for aggregate queries"),IO=Lt(ve()).min(1).describe("Fields to group by"),L0e=Lt(jt().min(0).max(1)).min(1).describe("Percentile values (0-1)"),z0e={value:jt().nullable().describe("Aggregated value"),previousValue:jt().nullable().optional().describe("Value from comparison period"),changePercent:jt().nullable().optional().describe("Percentage change from comparison period")},F0e=ra(ve(),ve().nullable()).describe("Dimension values for this group"),Yj=jt().describe("Aggregated value"),Xj=dO().describe("Bucket timestamp"),B0e=jt().describe("Percentile value"),U0e=jt().describe("Percentile value at this bucket"),Kj=Sme(na).describe("Entity type (e.g., 'agent' | 'processor' | 'tool' | 'workflow')"),_Wn=ve().describe('ID of the entity (e.g., "weatherAgent", "orderWorkflow")'),$xt=ve().describe("Name of the entity"),Dxt=ve().describe("Human end-user who triggered execution"),Lxt=ve().describe("Multi-tenant organization/account"),zxt=ve().describe("Broader resource context (Mastra memory compatibility)"),Fxt=ve().describe("Unique execution run identifier"),Bxt=ve().describe("Session identifier for grouping traces"),Uxt=ve().describe("Conversation thread identifier"),qxt=ve().describe("HTTP request ID for log correlation"),Vxt=ve().describe('Environment (e.g., "production" | "staging" | "development")'),EWn=ve().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),Hxt=ve().describe('Source of execution (e.g., "local" | "cloud" | "ci")'),Zxt=ve().describe("Name of the service"),Wxt=Sme(na).describe("Entity type of the parent entity"),CWn=ve().describe("ID of the parent entity"),Gxt=ve().describe("Name of the parent entity"),Qxt=Sme(na).describe("Entity type of the root entity"),TWn=ve().describe("ID of the root entity"),Yxt=ve().describe("Name of the root entity"),Xxt=ve().describe("Version ID of the entity that produced this signal (e.g., agent version, workflow version)"),Kxt=ve().describe("Version ID of the parent entity that produced this signal"),Jxt=ve().describe("Version ID of the root entity that produced this signal"),gq=ve().describe("Experiment or eval run identifier"),jWn=ra(ve(),ti()).describe('Arbitrary package/app version info (e.g., {"core": "1.0.0", "memory": "1.0.0", "gitSha": "abcd1234"})'),e0t=ra(ve(),ti()).describe("User-defined metadata for custom filtering"),t0t=Lt(ve()).describe("Labels for filtering"),IWn={entityType:Kj.nullish(),entityId:_Wn.nullish(),entityName:$xt.nullish(),parentEntityType:Wxt.nullish(),parentEntityId:CWn.nullish(),parentEntityName:Gxt.nullish(),rootEntityType:Qxt.nullish(),rootEntityId:TWn.nullish(),rootEntityName:Yxt.nullish(),userId:Dxt.nullish(),organizationId:Lxt.nullish(),resourceId:zxt.nullish(),runId:Fxt.nullish(),sessionId:Bxt.nullish(),threadId:Uxt.nullish(),requestId:qxt.nullish(),environment:Vxt.nullish(),serviceName:Zxt.nullish(),scope:jWn.nullish(),entityVersionId:Xxt.nullish(),parentEntityVersionId:Kxt.nullish(),rootEntityVersionId:Jxt.nullish(),experimentId:gq.nullish()},vq={...IWn,executionSource:Hxt.nullish(),tags:t0t.nullish()};EWn.nullish();var yq={timestamp:OWn.optional().describe("Filter by timestamp range"),traceId:ve().optional().describe("Filter by trace ID"),spanId:ve().optional().describe("Filter by span ID"),entityType:Kj.optional(),entityName:$xt.optional(),entityVersionId:Xxt.optional(),parentEntityVersionId:Kxt.optional(),rootEntityVersionId:Jxt.optional(),userId:Dxt.optional(),organizationId:Lxt.optional(),experimentId:gq.optional(),serviceName:Zxt.optional(),environment:Vxt.optional(),parentEntityType:Wxt.optional(),parentEntityName:Gxt.optional(),rootEntityType:Qxt.optional(),rootEntityName:Yxt.optional(),resourceId:zxt.optional(),runId:Fxt.optional(),sessionId:Bxt.optional(),threadId:Uxt.optional(),requestId:qxt.optional(),executionSource:Hxt.optional(),tags:Lt(ve()).optional().describe("Filter by tags (must have all specified tags)")},bq=ve().describe("Unique trace identifier"),xq=ve().describe("Unique span identifier within a trace"),B8=bo(["debug","info","warn","error","fatal"]),n0t=ve().describe("Log message"),r0t=ra(ve(),ti()).describe("Structured data attached to the log"),s0t=Te({logId:ve().nullish().describe("Unique id for this log event"),timestamp:dO().describe("When the log was created"),level:B8.describe("Log severity level"),message:n0t,data:r0t.nullish(),traceId:bq.nullish(),spanId:xq.nullish(),...vq,source:ve().nullish().describe("Execution source"),metadata:e0t.nullish()}).describe("Log record as stored in the database");Te({level:B8,message:n0t,data:r0t.optional(),tags:t0t.optional()}).describe("User-provided log input");var NWn=s0t;Te({logs:Lt(NWn)}).describe("Arguments for batch creating logs");var AWn=Te({...yq,source:ve().optional().describe("Filter by execution source"),level:or([B8,Lt(B8)]).optional().describe("Filter by log level(s)")}).describe("Filters for querying logs"),RWn=bo(["timestamp"]).describe("Field to order by: 'timestamp'"),PWn=Te({field:RWn.default("timestamp").describe("Field to order by"),direction:W$.default("DESC").describe("Sort direction")}).describe("Order by configuration");Te({mode:dq.optional(),filters:AWn.optional().describe("Optional filters to apply"),pagination:cq.optional(),orderBy:PWn.optional(),after:Gw.optional(),limit:fq}).strict().superRefine(pq).transform(e=>hq(e,{orderBy:{field:"timestamp",direction:"DESC"}})).describe("Arguments for listing logs");Te({pagination:uq.optional(),delta:mq.optional(),deltaCursor:Gw.optional(),logs:Lt(s0t)}).describe("Response from listing logs");var Jj=ve().describe("Identifier of the scorer (e.g., relevance, accuracy)"),a0t=ve().describe("Display name of the scorer"),i0t=ve().describe("Version of the scorer"),wv=ve().describe("How the score was produced (e.g., manual, automated, experiment)"),o0t=jt().describe("Score value (range defined by scorer)"),l0t=ve().describe("Explanation for the score"),c0t=Te({scoreId:ve().nullish().describe("Unique id for this score event"),timestamp:dO().describe("When the score was recorded"),traceId:bq.nullish().describe("Trace that anchors the scored target when available"),spanId:xq.nullish().describe("Span ID this score applies to"),scorerId:Jj,scorerName:a0t.nullish(),scorerVersion:i0t.nullish(),scoreSource:wv.nullish(),source:wv.nullish(),score:o0t,reason:l0t.nullish(),...vq,scoreTraceId:ve().nullish().describe("Trace ID of the scoring run for debugging score generation"),metadata:ra(ve(),ti()).nullish().describe("User-defined metadata")}).describe("Score record as stored in the database");Te({scorerId:Jj,scorerName:a0t.optional(),scorerVersion:i0t.optional(),scoreSource:wv.optional(),source:wv.optional(),score:o0t,reason:l0t.optional(),metadata:ra(ve(),ti()).optional().describe("Additional scorer-specific metadata"),experimentId:gq.optional(),scoreTraceId:ve().optional().describe("Trace ID of the scoring run for debugging score generation"),targetEntityType:Kj.optional().describe("Entity type the scorer evaluated when known")}).describe("User-provided score input");var q0e=c0t;Te({score:q0e}).describe("Arguments for creating a score");Te({score:q0e.omit({timestamp:!0})}).describe("Arguments for creating a score");Te({success:Ao()}).describe("Response from creating a score");Te({scores:Lt(q0e)}).describe("Arguments for batch recording scores");var G$=Te({...yq,scorerId:or([ve(),Lt(ve())]).optional().describe("Filter by scorer ID(s)"),scoreSource:wv.optional().describe("Filter by how the score was produced"),source:wv.optional().describe("Filter by how the score was produced")}).describe("Filters for querying scores"),MWn=bo(["timestamp","score"]).describe("Field to order by: 'timestamp' | 'score'"),$Wn=Te({field:MWn.default("timestamp").describe("Field to order by"),direction:W$.default("DESC").describe("Sort direction")}).describe("Order by configuration");Te({mode:dq.optional(),filters:G$.optional(),pagination:cq.optional(),orderBy:$Wn.optional(),after:Gw.optional(),limit:fq}).strict().superRefine(pq).transform(e=>hq(e,{orderBy:{field:"timestamp",direction:"DESC"}})).describe("Arguments for listing scores");Te({pagination:uq.optional(),delta:mq.optional(),deltaCursor:Gw.optional(),scores:Lt(c0t)}).describe("Response from listing scores");Te({scorerId:Jj,scoreSource:wv.optional(),aggregation:zv,filters:G$.optional(),comparePeriod:D0e.optional()}).describe("Arguments for getting a score aggregate");Te(z0e);Te({scorerId:Jj,scoreSource:wv.optional(),groupBy:IO,aggregation:zv,filters:G$.optional()}).describe("Arguments for getting a score breakdown");Te({groups:Lt(Te({dimensions:F0e,value:Yj}))});Te({scorerId:Jj,scoreSource:wv.optional(),interval:jO,aggregation:zv,filters:G$.optional(),groupBy:IO.optional()}).describe("Arguments for getting score time series");Te({series:Lt(Te({name:ve().describe("Series name (scorer ID or group key)"),points:Lt(Te({timestamp:Xj,value:Yj}))}))});Te({scorerId:Jj,scoreSource:wv.optional(),percentiles:L0e,interval:jO,filters:G$.optional()}).describe("Arguments for getting score percentiles");Te({series:Lt(Te({percentile:B0e,points:Lt(Te({timestamp:Xj,value:U0e}))}))});var Sv=ve().describe("Source of feedback (e.g., 'user', 'system', 'manual')"),eI=ve().describe("Type of feedback (e.g., 'thumbs', 'rating', 'correction')"),u0t=or([jt(),ve()]).describe("Feedback value (rating number or correction text)"),d0t=ve().describe("Additional comment or context"),U8=ve().describe("User who provided the feedback");function V0e(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 wq=Te({feedbackId:ve().nullish().describe("Unique id for this feedback event"),timestamp:dO().describe("When the feedback was recorded"),traceId:bq.nullish().describe("Trace that anchors the feedback target when available"),spanId:xq.nullish().describe("Span ID this feedback applies to"),feedbackSource:Sv.nullish(),source:Sv.nullish(),feedbackType:eI,value:u0t,comment:d0t.nullish(),feedbackUserId:U8.nullish(),...vq,sourceId:ve().nullish().describe("ID of the source record this feedback is linked to (e.g. experiment result ID)"),metadata:ra(ve(),ti()).nullish().describe("User-defined metadata")}),DWn=Te(wq.shape).describe("Feedback record as stored in the database"),LWn=Te({feedbackSource:Sv.optional(),source:Sv.optional(),feedbackType:eI,value:u0t,comment:d0t.optional(),feedbackUserId:U8.optional(),userId:U8.optional(),metadata:ra(ve(),ti()).optional().describe("Additional feedback-specific metadata"),experimentId:gq.optional(),sourceId:ve().optional().describe("ID of the source record this feedback is linked to")});Te(LWn.shape).describe("User-provided feedback input");Te({feedback:Eme(V0e,wq)}).describe("Arguments for creating feedback");Te({feedback:wq.omit({timestamp:!0})}).describe("Arguments for creating feedback");Te({success:Ao()}).describe("Response from creating feedback");Te({feedbacks:Lt(Eme(V0e,wq))}).describe("Arguments for batch recording feedback");var f0t=Te({...yq,feedbackType:or([ve(),Lt(ve())]).optional().describe("Filter by feedback type(s)"),feedbackSource:Sv.optional(),source:Sv.optional(),feedbackUserId:U8.optional()}),Sq=Te(f0t.shape).describe("Filters for querying feedback"),zWn=bo(["timestamp"]).describe("Field to order by: 'timestamp'"),FWn=Te({field:zWn.default("timestamp").describe("Field to order by"),direction:W$.default("DESC").describe("Sort direction")}).describe("Order by configuration");Te({mode:dq.optional(),filters:Eme(V0e,f0t).optional(),pagination:cq.optional(),orderBy:FWn.optional(),after:Gw.optional(),limit:fq}).strict().superRefine(pq).transform(e=>hq(e,{orderBy:{field:"timestamp",direction:"DESC"}})).describe("Arguments for listing feedback");Te({pagination:uq.optional(),delta:mq.optional(),deltaCursor:Gw.optional(),feedback:Lt(DWn)}).describe("Response from listing feedback");Te({feedbackType:eI,feedbackSource:Sv.optional(),aggregation:zv,filters:Sq.optional(),comparePeriod:D0e.optional()}).describe("Arguments for getting a feedback aggregate over numeric values");Te(z0e);Te({feedbackType:eI,feedbackSource:Sv.optional(),groupBy:IO,aggregation:zv,filters:Sq.optional()}).describe("Arguments for getting a feedback breakdown over numeric values");Te({groups:Lt(Te({dimensions:F0e,value:Yj}))});Te({feedbackType:eI,feedbackSource:Sv.optional(),interval:jO,aggregation:zv,filters:Sq.optional(),groupBy:IO.optional()}).describe("Arguments for getting feedback time series over numeric values");Te({series:Lt(Te({name:ve().describe("Series name (feedback type or group key)"),points:Lt(Te({timestamp:Xj,value:Yj}))}))});Te({feedbackType:eI,feedbackSource:Sv.optional(),percentiles:L0e,interval:jO,filters:Sq.optional()}).describe("Arguments for getting feedback percentiles over numeric values");Te({series:Lt(Te({percentile:B0e,points:Lt(Te({timestamp:Xj,value:U0e}))}))});bo(["counter","gauge","histogram"]);var p0t=ve().describe("Metric name (e.g., mastra_agent_duration_ms)"),h0t=jt().describe("Metric value"),m0t=ra(ve(),ve()).describe("Metric labels for dimensional filtering"),g0t=ve().describe("Model provider"),v0t=ve().describe("Model"),BWn=jt().describe("Estimated cost"),y0t=ve().describe("Unit for the estimated cost (e.g., usd)"),UWn=ra(ve(),ti()).nullish().describe("Structured costing metadata"),b0t=Te({metricId:ve().nullish().describe("Unique id for this metric event"),timestamp:dO().describe("When the metric was recorded"),name:p0t,value:h0t,traceId:bq.nullish(),spanId:xq.nullish(),...vq,source:ve().nullish().describe("Execution source"),provider:g0t.nullish(),model:v0t.nullish(),estimatedCost:BWn.nullish(),costUnit:y0t.nullish(),costMetadata:UWn.nullish(),labels:m0t.default({}),metadata:e0t.nullish()}).describe("Metric record as stored in the database");Te({name:p0t,value:h0t,labels:m0t.optional()}).describe("User-provided metric input");var qWn=b0t;Te({metrics:Lt(qWn)}).describe("Arguments for batch recording metrics");Te({type:zv,interval:jO.optional(),groupBy:IO.optional()}).describe("Metrics aggregation configuration");var Q$=Te({...yq,name:Lt(ve()).nonempty().optional().describe("Filter by metric name(s)"),source:ve().optional().describe("Filter by execution source"),provider:g0t.optional(),model:v0t.optional(),costUnit:y0t.optional(),labels:ra(ve(),ve()).optional().describe("Exact match on label key-value pairs")}).describe("Filters for querying metrics"),VWn=bo(["timestamp"]).describe("Field to order by: 'timestamp'"),HWn=Te({field:VWn.default("timestamp").describe("Field to order by"),direction:W$.default("DESC").describe("Sort direction")}).describe("Order by configuration");Te({mode:dq.optional(),filters:Q$.optional(),pagination:cq.optional(),orderBy:HWn.optional(),after:Gw.optional(),limit:fq}).strict().superRefine(pq).transform(e=>hq(e,{orderBy:{field:"timestamp",direction:"DESC"}})).describe("Arguments for listing metrics");Te({pagination:uq.optional(),delta:mq.optional(),deltaCursor:Gw.optional(),metrics:Lt(b0t)}).describe("Response from listing metrics");var ZWn=["entityType","entityName","parentEntityType","parentEntityName","rootEntityType","rootEntityName","name","provider","model","environment","executionSource","serviceName","threadId","resourceId"],H0e=bo(ZWn).optional().describe("Column to apply count_distinct over (required when aggregation is 'count_distinct'). Restricted to allowlisted metric dimensions."),_T={check:e=>e.aggregation!=="count_distinct"||e.distinctColumn!==void 0,options:{message:"distinctColumn is required when aggregation is 'count_distinct'",path:["distinctColumn"]}};Te({name:Lt(ve()).nonempty().describe("Metric name(s) to aggregate"),aggregation:zv,distinctColumn:H0e,filters:Q$.optional(),comparePeriod:D0e.optional()}).refine(_T.check,_T.options).describe("Arguments for getting a metric aggregate");Te({...z0e,estimatedCost:jt().nullable().optional().describe("Aggregated estimated cost from the same filtered row set"),costUnit:ve().nullable().optional().describe("Shared cost unit for the aggregated rows, or null when mixed/unknown"),previousEstimatedCost:jt().nullable().optional().describe("Aggregated estimated cost from the comparison period"),costChangePercent:jt().nullable().optional().describe("Percentage change in estimated cost from comparison period")});Te({name:Lt(ve()).nonempty().describe("Metric name(s) to break down"),groupBy:IO,aggregation:zv,distinctColumn:H0e,filters:Q$.optional(),limit:jt().int().positive().max(1e3).optional().describe("Maximum number of groups to return (server-side TopK). Required for high-cardinality groupBy."),orderDirection:W$.optional().describe("Sort direction for the aggregated value (defaults to 'DESC' at the storage layer; pairs with limit for top/bottom-N).")}).refine(_T.check,_T.options).describe("Arguments for getting a metric breakdown");Te({groups:Lt(Te({dimensions:F0e,value:Yj,estimatedCost:jt().nullable().optional().describe("Summed estimated cost for this group"),costUnit:ve().nullable().optional().describe("Shared cost unit for this group, or null when mixed/unknown")}))});Te({name:Lt(ve()).nonempty().describe("Metric name(s)"),interval:jO,aggregation:zv,distinctColumn:H0e,filters:Q$.optional(),groupBy:IO.optional()}).refine(_T.check,_T.options).describe("Arguments for getting metric time series");Te({series:Lt(Te({name:ve().describe("Series name (metric name or group key)"),costUnit:ve().nullable().optional().describe("Shared cost unit for this series, or null when mixed/unknown"),points:Lt(Te({timestamp:Xj,value:Yj,estimatedCost:jt().nullable().optional().describe("Summed estimated cost in this bucket")}))}))});Te({name:ve().describe("Metric name"),percentiles:L0e,interval:jO,filters:Q$.optional()}).describe("Arguments for getting metric percentiles");Te({series:Lt(Te({percentile:B0e,points:Lt(Te({timestamp:Xj,value:U0e}))}))});Te({prefix:ve().optional().describe("Filter metric names by prefix"),limit:sP().int().min(1).optional().describe("Maximum number of names to return")}).describe("Arguments for getting metric names");Te({names:Lt(ve()).describe("Distinct metric names")});Te({metricName:ve().describe("Metric name to get label keys for")}).describe("Arguments for getting metric label keys");Te({keys:Lt(ve()).describe("Distinct label keys for the metric")});Te({metricName:ve().describe("Metric name"),labelKey:ve().describe("Label key to get values for"),prefix:ve().optional().describe("Filter values by prefix"),limit:sP().int().min(1).optional().describe("Maximum number of values to return")}).describe("Arguments for getting label values");Te({values:Lt(ve()).describe("Distinct label values")});Te({}).describe("Arguments for getting entity types");Te({entityTypes:Lt(Kj).describe("Distinct entity types")});Te({entityType:Kj.optional().describe("Optional entity type filter")}).describe("Arguments for getting entity names");Te({names:Lt(ve()).describe("Distinct entity names")});Te({}).describe("Arguments for getting service names");Te({serviceNames:Lt(ve()).describe("Distinct service names")});Te({}).describe("Arguments for getting environments");Te({environments:Lt(ve()).describe("Distinct environments")});Te({entityType:Kj.optional().describe("Optional entity type filter")}).describe("Arguments for getting tags");Te({tags:Lt(ve()).describe("Distinct tags")});var NO=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(){}},WWn={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},GWn=class{#e=WWn;#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)}},NS=new GWn;function QWn(e){setTimeout(e,0)}var Bk=typeof window>"u"||"Deno"in globalThis;function Qc(){}function YWn(e,t){return typeof e=="function"?e(t):e}function lfe(e){return typeof e=="number"&&e>=0&&e!==1/0}function x0t(e,t){return Math.max(e+(t||0)-Date.now(),0)}function $0(e,t){return typeof e=="function"?e(t):e}function Zp(e,t){return typeof e=="function"?e(t):e}function P5e(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:i,stale:o}=e;if(i){if(r){if(t.queryHash!==Z0e(i,t.options))return!1}else if(!b2(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 M5e(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Uk(t.options.mutationKey)!==Uk(a))return!1}else if(!b2(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Z0e(e,t){return(t?.queryKeyHashFn||Uk)(e)}function Uk(e){return JSON.stringify(e,(t,n)=>cfe(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function b2(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>b2(e[n],t[n])):!1}var XWn=Object.prototype.hasOwnProperty;function W0e(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=$5e(e)&&$5e(t);if(!r&&!(cfe(e)&&cfe(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:XWn.call(e,f))&&u++;continue}if(p===null||h===null||typeof p!="object"||typeof h!="object"){c[f]=h;continue}const m=W0e(p,h,n+1);c[f]=m,m===p&&u++}return a===o&&u===a?e:c}function x2(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 $5e(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cfe(e){if(!D5e(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!D5e(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function D5e(e){return Object.prototype.toString.call(e)==="[object Object]"}function KWn(e){return new Promise(t=>{NS.setTimeout(t,e)})}function ufe(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?W0e(e,t):t}function JWn(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function eGn(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var G0e=Symbol();function w0t(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===G0e?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Q0e(e,t){return typeof e=="function"?e(...t):!!e}function tGn(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 nGn=class extends NO{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Bk&&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"}},Y0e=new nGn;function dfe(){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 rGn=QWn;function sGn(){let e=[],t=0,n=o=>{o()},r=o=>{o()},s=rGn;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 No=sGn(),aGn=class extends NO{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Bk&&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}},q8=new aGn;function iGn(e){return Math.min(1e3*2**e,3e4)}function S0t(e){return(e??"online")==="online"?q8.isOnline():!0}var ffe=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function k0t(e){let t=!1,n=0,r;const s=dfe(),a=()=>s.status!=="pending",i=g=>{if(!a()){const v=new ffe(g);p(v),e.onCancel?.(v)}},o=()=>{t=!0},c=()=>{t=!1},u=()=>Y0e.isFocused()&&(e.networkMode==="always"||q8.isOnline())&&e.canRun(),d=()=>S0t(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??(Bk?0:3),w=e.retryDelay??iGn,O=typeof w=="function"?w(n,b):w,E=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,b);if(t||!E){p(b);return}n++,e.onFail?.(n,b),KWn(O).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 O0t=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lfe(this.gcTime)&&(this.#e=NS.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Bk?1/0:300*1e3))}clearGcTimeout(){this.#e&&(NS.clearTimeout(this.#e),this.#e=void 0)}},oGn=class extends O0t{#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=z5e(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=z5e(this.options);t.data!==void 0&&(this.setState(L5e(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=ufe(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=>Zp(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===G0e||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>$0(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:!x0t(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=w0t(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=k0t({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:o=>{o instanceof ffe&&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 ffe){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,..._0t(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...L5e(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),No.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function _0t(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:S0t(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function L5e(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function z5e(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 kq=class extends NO{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#o=dfe(),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),F5e(this.#t,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return pfe(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return pfe(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 Zp(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&&!x2(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&B5e(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Zp(this.options.enabled,this.#t)!==Zp(t.enabled,this.#t)||$0(this.options.staleTime,this.#t)!==$0(t.staleTime,this.#t))&&this.#g();const s=this.#v();r&&(this.#t!==n||Zp(this.options.enabled,this.#t)!==Zp(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 cGn(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=$0(this.options.staleTime,this.#t);if(Bk||this.#s.isStale||!lfe(e))return;const n=x0t(this.#s.dataUpdatedAt,e)+1;this.#c=NS.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,!(Bk||Zp(this.options.enabled,this.#t)===!1||!lfe(this.#l)||this.#l===0)&&(this.#u=NS.setInterval(()=>{(this.options.refetchIntervalInBackground||Y0e.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#c&&(NS.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(NS.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(),I=!j&&F5e(e,t),N=j&&B5e(e,n,t,r);(I||N)&&(d={...d,..._0t(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=ufe(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=ufe(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",O=S&&b,E=p!==void 0,C={status:g,fetchStatus:d.fetchStatus,isPending:S,isSuccess:g==="success",isError:w,isInitialLoading:O,isLoading:O,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&&!E,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:w&&E,isStale:X0e(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Zp(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const j=C.data!==void 0,I=C.status==="error"&&!j,N=B=>{I?B.reject(C.error):j&&B.resolve(C.data)},R=()=>{const B=this.#o=C.promise=dfe();N(B)},P=this.#o;switch(P.status){case"pending":e.queryHash===n.queryHash&&N(P);break;case"fulfilled":(I||C.data!==P.value)&&R();break;case"rejected":(!I||C.error!==P.reason)&&R();break}}return C}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),x2(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){No.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function lGn(e,t){return Zp(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function F5e(e,t){return lGn(e,t)||e.state.data!==void 0&&pfe(e,t,t.refetchOnMount)}function pfe(e,t,n){if(Zp(t.enabled,e)!==!1&&$0(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&X0e(e,t)}return!1}function B5e(e,t,n,r){return(e!==t||Zp(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&X0e(e,n)}function X0e(e,t){return Zp(t.enabled,e)!==!1&&e.isStaleByTime($0(t.staleTime,e))}function cGn(e,t){return!x2(e.getCurrentResult(),t)}function V8(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=>{tGn(m,()=>t.signal,()=>d=!0)},p=w0t(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 _={client:t.client,queryKey:t.queryKey,pageParam:g,direction:v?"backward":"forward",meta:t.options.meta};return f(_),_})(),w=await p(S),{maxPages:O}=t.options,E=v?eGn:JWn;return{pages:E(m.pages,w,O),pageParams:E(m.pageParams,g,O)}};if(s&&a.length){const m=s==="backward",g=m?E0t:hfe,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:hfe(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 hfe(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 E0t(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function uGn(e,t){return t?hfe(e,t)!=null:!1}function dGn(e,t){return!t||!e.getPreviousPageParam?!1:E0t(e,t)!=null}var fGn=class extends kq{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:V8()})}getOptimisticResult(e){return e.behavior=V8(),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:uGn(t,n.data),hasPreviousPage:dGn(t,n.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:p,isRefetchError:o&&!u&&!f,isRefetching:a&&!d&&!p}}},pGn=class extends O0t{#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||C0t(),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=k0t({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),No.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function C0t(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var hGn=class extends NO{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 pGn({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=XL(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=XL(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=XL(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=XL(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){No.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=>M5e(t,n))}findAll(e={}){return this.getAll().filter(t=>M5e(e,t))}notify(e){No.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return No.batch(()=>Promise.all(e.map(t=>t.continue().catch(Qc))))}};function XL(e){return e.options.scope?.id}var mGn=class extends NO{#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),x2(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Uk(n.mutationKey)!==Uk(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??C0t();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){No.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 gGn(e,t,n){const r=e.slice(0);return r[t]=n,r}var vGn=class extends NO{#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,No.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||!x2(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=W0e(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 kq(this.#e,s);n.push({defaultedQueryOptions:s,observer:i})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#t=gGn(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&&No.batch(()=>{this.listeners.forEach(r=>{r(this.#t)})})}}},yGn=class extends NO{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,s=t.queryHash??Z0e(r,t);let a=this.get(s);return a||(a=new oGn({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(){No.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=>P5e(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>P5e(e,n)):t}notify(e){No.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){No.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){No.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},bGn=class{#e;#t;#n;#s;#r;#a;#o;#i;constructor(e={}){this.#e=e.queryCache||new yGn,this.#t=e.mutationCache||new hGn,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Y0e.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=q8.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($0(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=YWn(t,a);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return No.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;No.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return No.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=No.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Qc).catch(Qc)}invalidateQueries(e,t={}){return No.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=No.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($0(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=V8(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Qc).catch(Qc)}ensureInfiniteQueryData(e){return e.behavior=V8(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return q8.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(Uk(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(r=>{b2(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Uk(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{b2(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=Z0e(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===G0e&&(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()}},T0t=y.createContext(void 0),Js=e=>{const t=y.useContext(T0t);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},xGn=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(T0t.Provider,{value:e,children:t})),j0t=y.createContext(!1),I0t=()=>y.useContext(j0t);j0t.Provider;function wGn(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var SGn=y.createContext(wGn()),N0t=()=>y.useContext(SGn),A0t=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?Q0e(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},R0t=e=>{y.useEffect(()=>{e.clearReset()},[e])},P0t=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||Q0e(n,[e.error,r])),M0t=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))}},kGn=(e,t)=>e.isLoading&&e.isFetching&&!t,mfe=(e,t)=>e?.suspense&&t.isPending,gfe=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function OGn({queries:e,...t},n){const r=Js(),s=I0t(),a=N0t(),i=y.useMemo(()=>e.map(g=>{const v=r.defaultQueryOptions(g);return v._optimisticResults=s?"isRestoring":"optimistic",v}),[e,r,s]);i.forEach(g=>{M0t(g);const v=r.getQueryCache().get(g.queryHash);A0t(g,a,v)}),R0t(a);const[o]=y.useState(()=>new vGn(r,i,t)),[c,u,d]=o.getOptimisticResult(i,t.combine),f=!s&&t.subscribed!==!1;y.useSyncExternalStore(y.useCallback(g=>f?o.subscribe(No.batchCalls(g)):Qc,[o,f]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),y.useEffect(()=>{o.setQueries(i,t)},[i,t,o]);const h=c.some((g,v)=>mfe(i[v],g))?c.flatMap((g,v)=>{const b=i[v];if(b&&mfe(b,g)){const S=new kq(r,b);return gfe(b,S,a)}return[]}):[];if(h.length>0)throw Promise.all(h);const m=c.find((g,v)=>{const b=i[v];return b&&P0t({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 $0t(e,t,n){const r=I0t(),s=N0t(),a=Js(),i=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const o=a.getQueryCache().get(i.queryHash);i._optimisticResults=r?"isRestoring":"optimistic",M0t(i),A0t(i,s,o),R0t(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(No.batchCalls(p)):Qc;return u.updateResult(),h},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),y.useEffect(()=>{u.setOptions(i)},[i,u]),mfe(i,d))throw gfe(i,u,s);if(P0t({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&&!Bk&&kGn(d,r)&&(c?gfe(i,u,s):o?.promise)?.catch(Qc).finally(()=>{u.updateResult()}),i.notifyOnChangeProps?d:u.trackResult(d)}function Et(e,t){return $0t(e,kq)}function ar(e,t){const n=Js(),[r]=y.useState(()=>new mGn(n,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);const s=y.useSyncExternalStore(y.useCallback(i=>r.subscribe(No.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=y.useCallback((i,o)=>{r.mutate(i,o).catch(Qc)},[r]);if(s.error&&Q0e(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function Qw(e,t){return $0t(e,fGn)}function H_(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`,`
|
|
280
280
|
font-size: .6rem;
|
|
281
281
|
font-weight: bold;
|
|
282
|
-
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 q5e(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const _Gn=(e,t)=>Math.abs(e-t)<1.01,EGn=(e,t,n)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)}},V5e=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},CGn=e=>e,TGn=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},jGn=(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(V5e(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(V5e(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},H5e={passive:!0},Z5e=typeof window>"u"?!0:"onscrollend"in window,IGn=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let s=0;const a=e.options.useScrollendEvent&&Z5e?()=>{}:EGn(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,H5e);const u=e.options.useScrollendEvent&&Z5e;return u&&n.addEventListener("scrollend",c,H5e),()=>{n.removeEventListener("scroll",o),u&&n.removeEventListener("scrollend",c)}},NGn=(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"]},AGn=(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 RGn{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:CGn,rangeExtractor:TGn,onChange:()=>{},measureElement:NGn,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=H_(()=>(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=H_(()=>[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=H_(()=>[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 _=p[v],C=_!==void 0?f[_]:void 0;b=C?C.end+this.options.gap:r+s}else{const _=this.options.lanes===1?f[h-1]:this.getFurthestMeasurement(f,h);b=_?_.end+this.options.gap:r+s,v=_?_.lane:h%this.options.lanes,this.options.lanes>1&&S&&this.laneAssignments.set(h,v)}const w=u.get(m),O=typeof w=="number"?w:this.options.estimateSize(h),E=b+O;f[h]={index:h,start:b,size:O,end:E,key:m,lane:v},p[v]=h}return this.measurementsCache=f,f},{key:!1,debug:()=>this.options.debug}),this.calculateRange=H_(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,a)=>this.range=n.length>0&&r>0?PGn({measurements:n,outerSize:r,scrollOffset:s,lanes:a}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=H_(()=>{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=H_(()=>[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 q5e(r[D0t(0,r.length-1,s=>q5e(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&&_Gn(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 D0t=(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 PGn({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=D0t(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 W5e=typeof document<"u"?y.useLayoutEffect:y.useEffect;function MGn({useFlushSync:e=!0,...t}){const n=y.useReducer(()=>({}),{})[1],r={...t,onChange:(a,i)=>{var o;e&&i?Lo.flushSync(n):n(),(o=t.onChange)==null||o.call(t,a,i)}},[s]=y.useState(()=>new RGn(r));return s.setOptions(r),W5e(()=>s._didMount(),[]),W5e(()=>s._willUpdate()),s}function L0t(e){return MGn({observeElementRect:jGn,observeElementOffset:IGn,scrollToFn:AGn,...e})}function z0t(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=z0t(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function F0t(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=z0t(e))&&(r&&(r+=" "),r+=t);return r}const $Gn=(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},DGn=(e,t)=>({classGroupId:e,validator:t}),B0t=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),H8="-",G5e=[],LGn="arbitrary..",zGn=e=>{const t=BGn(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return FGn(i);const o=i.split(H8),c=o[0]===""&&o.length>1?1:0;return U0t(o,c,t)},getConflictingClassGroupIds:(i,o)=>{if(o){const c=r[i],u=n[i];return c?u?$Gn(u,c):c:u||G5e}return n[i]||G5e}}},U0t=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const u=U0t(e,t+1,a);if(u)return u}const i=n.validators;if(i===null)return;const o=t===0?e.join(H8):e.slice(t).join(H8),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(o))return d.classGroupId}},FGn=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?LGn+r:void 0})(),BGn=e=>{const{theme:t,classGroups:n}=e;return UGn(n,t)},UGn=(e,t)=>{const n=B0t();for(const r in e){const s=e[r];K0e(s,n,r,t)}return n},K0e=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];qGn(i,t,n,r)}},qGn=(e,t,n,r)=>{if(typeof e=="string"){VGn(e,t,n);return}if(typeof e=="function"){HGn(e,t,n,r);return}ZGn(e,t,n,r)},VGn=(e,t,n)=>{const r=e===""?t:q0t(t,e);r.classGroupId=n},HGn=(e,t,n,r)=>{if(WGn(e)){K0e(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(DGn(n,e))},ZGn=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[o,c]=s[i];K0e(c,q0t(t,o),n,r)}},q0t=(e,t)=>{let n=e;const r=t.split(H8),s=r.length;for(let a=0;a<s;a++){const i=r[a];let o=n.nextPart.get(i);o||(o=B0t(),n.nextPart.set(i,o)),n=o}return n},WGn=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,GGn=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)}}},vfe="!",Q5e=":",QGn=[],Y5e=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),YGn=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===Q5e){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(vfe)?(p=f.slice(0,-1),h=!0):f.startsWith(vfe)&&(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+Q5e,a=r;r=i=>i.startsWith(s)?a(i.slice(s.length)):Y5e(QGn,!1,i,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},XGn=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}},KGn=e=>({cache:GGn(e.cacheSize),parseClassName:YGn(e),sortModifiers:XGn(e),...zGn(e)}),JGn=/\s+/,eQn=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],o=e.trim().split(JGn);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+vfe:S,O=w+b;if(i.indexOf(O)>-1)continue;i.push(O);const E=s(b,v);for(let _=0;_<E.length;++_){const C=E[_];i.push(w+C)}c=d+(c.length>0?" "+c:c)}return c},tQn=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=V0t(n))&&(s&&(s+=" "),s+=r);return s},V0t=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=V0t(e[r]))&&(n&&(n+=" "),n+=t);return n},X5e=(e,...t)=>{let n,r,s,a;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return n=KGn(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=eQn(c,n);return s(c,d),d};return a=i,(...c)=>a(tQn(...c))},nQn=[],_l=e=>{const t=n=>n[e]||nQn;return t.isThemeGetter=!0,t},H0t=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Z0t=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rQn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,sQn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aQn=/\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$/,iQn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,oQn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lQn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mx=e=>rQn.test(e),is=e=>!!e&&!Number.isNaN(Number(e)),$x=e=>!!e&&Number.isInteger(Number(e)),XX=e=>e.endsWith("%")&&is(e.slice(0,-1)),gy=e=>sQn.test(e),W0t=()=>!0,cQn=e=>aQn.test(e)&&!iQn.test(e),J0e=()=>!1,uQn=e=>oQn.test(e),dQn=e=>lQn.test(e),fQn=e=>!Dn(e)&&!Bn(e),pQn=e=>Yw(e,Y0t,J0e),Dn=e=>H0t.test(e),D1=e=>Yw(e,X0t,cQn),K5e=e=>Yw(e,wQn,is),hQn=e=>Yw(e,J0t,W0t),mQn=e=>Yw(e,K0t,J0e),J5e=e=>Yw(e,G0t,J0e),gQn=e=>Yw(e,Q0t,dQn),KL=e=>Yw(e,ewt,uQn),Bn=e=>Z0t.test(e),KN=e=>AO(e,X0t),vQn=e=>AO(e,K0t),e6e=e=>AO(e,G0t),yQn=e=>AO(e,Y0t),bQn=e=>AO(e,Q0t),JL=e=>AO(e,ewt,!0),xQn=e=>AO(e,J0t,!0),Yw=(e,t,n)=>{const r=H0t.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},AO=(e,t,n=!1)=>{const r=Z0t.exec(e);return r?r[1]?t(r[1]):n:!1},G0t=e=>e==="position"||e==="percentage",Q0t=e=>e==="image"||e==="url",Y0t=e=>e==="length"||e==="size"||e==="bg-size",X0t=e=>e==="length",wQn=e=>e==="number",K0t=e=>e==="family-name",J0t=e=>e==="number"||e==="weight",ewt=e=>e==="shadow",t6e=()=>{const e=_l("color"),t=_l("font"),n=_l("text"),r=_l("font-weight"),s=_l("tracking"),a=_l("leading"),i=_l("breakpoint"),o=_l("container"),c=_l("spacing"),u=_l("radius"),d=_l("shadow"),f=_l("inset-shadow"),p=_l("text-shadow"),h=_l("drop-shadow"),m=_l("blur"),g=_l("perspective"),v=_l("aspect"),b=_l("ease"),S=_l("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...O(),Bn,Dn],_=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],j=()=>[Bn,Dn,c],I=()=>[Mx,"full","auto",...j()],N=()=>[$x,"none","subgrid",Bn,Dn],R=()=>["auto",{span:["full",$x,Bn,Dn]},$x,Bn,Dn],P=()=>[$x,"auto",Bn,Dn],B=()=>["auto","min","max","fr",Bn,Dn],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=()=>[Mx,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],U=()=>[Mx,"screen","full","dvw","lvw","svw","min","max","fit",...j()],H=()=>[Mx,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],D=()=>[e,Bn,Dn],Y=()=>[...O(),e6e,J5e,{position:[Bn,Dn]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",yQn,pQn,{size:[Bn,Dn]}],Z=()=>[XX,KN,D1],G=()=>["","none","full",u,Bn,Dn],K=()=>["",is,KN,D1],ne=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[is,XX,e6e,J5e],se=()=>["","none",m,Bn,Dn],ae=()=>["none",is,Bn,Dn],Q=()=>["none",is,Bn,Dn],te=()=>[is,Bn,Dn],le=()=>[Mx,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[gy],breakpoint:[gy],color:[W0t],container:[gy],"drop-shadow":[gy],ease:["in","out","in-out"],font:[fQn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[gy],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[gy],shadow:[gy],spacing:["px",is],text:[gy],"text-shadow":[gy],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Mx,Dn,Bn,v]}],container:["container"],columns:[{columns:[is,Dn,Bn,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:E()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[$x,"auto",Bn,Dn]}],basis:[{basis:[Mx,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[is,Mx,"auto","initial","none",Dn]}],grow:[{grow:["",is,Bn,Dn]}],shrink:[{shrink:["",is,Bn,Dn]}],order:[{order:[$x,"first","last","none",Bn,Dn]}],"grid-cols":[{"grid-cols":N()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":N()}],"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":B()}],"auto-rows":[{"auto-rows":B()}],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",...U()]}],"min-inline-size":[{"min-inline":["auto",...U()]}],"max-inline-size":[{"max-inline":["none",...U()]}],"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,KN,D1]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,xQn,hQn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",XX,Dn]}],"font-family":[{font:[vQn,mQn,t]}],"font-features":[{"font-features":[Dn]}],"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,Bn,Dn]}],"line-clamp":[{"line-clamp":[is,"none",Bn,K5e]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",Bn,Dn]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Bn,Dn]}],"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:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[is,"from-font","auto",Bn,D1]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[is,"auto",Bn,Dn]}],"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",Bn,Dn]}],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",Bn,Dn]}],"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"]},$x,Bn,Dn],radial:["",Bn,Dn],conic:[$x,Bn,Dn]},bQn,gQn]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"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:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"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:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[is,Bn,Dn]}],"outline-w":[{outline:["",is,KN,D1]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",d,JL,KL]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",f,JL,KL]}],"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,D1]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",p,JL,KL]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[is,Bn,Dn]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"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":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"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":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"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":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"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":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"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":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"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":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"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":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Bn,Dn]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"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":O()}],"mask-image-conic-pos":[{"mask-conic":[is]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"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",Bn,Dn]}],filter:[{filter:["","none",Bn,Dn]}],blur:[{blur:se()}],brightness:[{brightness:[is,Bn,Dn]}],contrast:[{contrast:[is,Bn,Dn]}],"drop-shadow":[{"drop-shadow":["","none",h,JL,KL]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",is,Bn,Dn]}],"hue-rotate":[{"hue-rotate":[is,Bn,Dn]}],invert:[{invert:["",is,Bn,Dn]}],saturate:[{saturate:[is,Bn,Dn]}],sepia:[{sepia:["",is,Bn,Dn]}],"backdrop-filter":[{"backdrop-filter":["","none",Bn,Dn]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[is,Bn,Dn]}],"backdrop-contrast":[{"backdrop-contrast":[is,Bn,Dn]}],"backdrop-grayscale":[{"backdrop-grayscale":["",is,Bn,Dn]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[is,Bn,Dn]}],"backdrop-invert":[{"backdrop-invert":["",is,Bn,Dn]}],"backdrop-opacity":[{"backdrop-opacity":[is,Bn,Dn]}],"backdrop-saturate":[{"backdrop-saturate":[is,Bn,Dn]}],"backdrop-sepia":[{"backdrop-sepia":["",is,Bn,Dn]}],"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",Bn,Dn]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[is,"initial",Bn,Dn]}],ease:[{ease:["linear","initial",b,Bn,Dn]}],delay:[{delay:[is,Bn,Dn]}],animate:[{animate:["none",S,Bn,Dn]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,Bn,Dn]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:te()}],"skew-x":[{"skew-x":te()}],"skew-y":[{"skew-y":te()}],transform:[{transform:[Bn,Dn,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent: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",Bn,Dn]}],"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",Bn,Dn]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[is,KN,D1,K5e]}],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"]}},SQn=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:s={},override:a={}})=>(UA(e,"cacheSize",t),UA(e,"prefix",n),UA(e,"experimentalParseClassName",r),e5(e.theme,a.theme),e5(e.classGroups,a.classGroups),e5(e.conflictingClassGroups,a.conflictingClassGroups),e5(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),UA(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),t5(e.theme,s.theme),t5(e.classGroups,s.classGroups),t5(e.conflictingClassGroups,s.conflictingClassGroups),t5(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),twt(e,s,"orderSensitiveModifiers"),e),UA=(e,t,n)=>{n!==void 0&&(e[t]=n)},e5=(e,t)=>{if(t)for(const n in t)UA(e,n,t[n])},t5=(e,t)=>{if(t)for(const n in t)twt(e,t,n)},twt=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},kQn=(e,...t)=>typeof e=="function"?X5e(t6e,e,...t):X5e(()=>SQn(t6e(),e),...t),OQn=Object.keys({...Vy,...pnn}),_Qn=Object.keys(bnn),EQn=Object.keys(hnn),CQn=Object.keys(mnn),TQn=Object.keys(fnn),L1=Object.keys(ynn),jQn=Object.keys(gnn).concat(Object.keys(vnn)),IQn=kQn({extend:{theme:{color:OQn,spacing:_Qn,radius:TQn,leading:CQn,shadow:jQn},classGroups:{"font-size":[{text:EQn}],h:[{h:L1}],w:[{w:L1}],size:[{size:L1}],"min-h":[{"min-h":L1}],"min-w":[{"min-w":L1}],"max-h":[{"max-h":L1}],"max-w":[{"max-w":L1}]}}});function X(...e){return IQn(F0t(e))}const NQn={"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"},AQn={mono:"font-mono"},be=({as:e="p",className:t,variant:n="ui-md",font:r,...s})=>l.jsx(e,{className:X(NQn[n],r&&AQn[r],t),...s}),Rr={colors:"transition-colors duration-normal ease-out-custom",all:"transition-all duration-normal ease-out-custom",opacity:"transition-opacity duration-normal ease-out-custom"},Xw={visible:"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},RQn={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},nwt=({src:e,name:t,size:n="sm",interactive:r=!1})=>l.jsx("div",{className:X(RQn[n],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",Rr.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(be,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),PQn={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"},Ve=({children:e,className:t,size:n="default",...r})=>l.jsx("span",{className:X("block",PQn[n],t),...r,children:e}),MQn={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"},Ct=({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",Rr.colors,e?"pl-2 pr-2.5":"px-2.5",MQn[t],n),...s,children:[e&&l.jsx(Ve,{size:"sm",children:e}),r]}),$Qn=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"})}),DQn=({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})}),LQn=({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",Rr.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(Ve,{className:X("text-neutral2",Rr.colors),children:l.jsx($Qn,{})})})]})},n6e=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,r6e=F0t,Dh=(e,t)=>n=>{var r;if(t?.variants==null)return r6e(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=n6e(d)||n6e(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 r6e(e,i,c,n?.class,n?.className)};function ud({delay:e,delayDuration:t,timeout:n,skipDelayDuration:r,...s}){const a=e??t,i=n??r;return l.jsx(Rsn,{...a!==void 0?{delay:a}:{},...i!==void 0?{timeout:i}:{},...s})}const rr=dsn,Jn=y.forwardRef(({asChild:e,render:t,children:n,...r},s)=>e&&y.isValidElement(n)?l.jsx(_Ae,{ref:s,render:n,...r}):l.jsx(_Ae,{ref:s,render:t,...r,children:n}));Jn.displayName="TooltipTrigger";const er=y.forwardRef(({className:e,side:t="top",sideOffset:n=8,align:r="center",alignOffset:s=0,children:a,...i},o)=>l.jsx(Osn,{children:l.jsx(jsn,{side:t,sideOffset:n,align:r,alignOffset:s,arrowPadding:10,className:"isolate z-[100]",children:l.jsxs(Nsn,{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(Asn,{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(zQn,{})})]})})}));er.displayName="TooltipContent";function zQn(){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 lo={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},ewe="focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",rwt="focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",swt="rounded-md",awt="bg-surface2 border border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",twe="outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",nwe="disabled:opacity-50 disabled:cursor-not-allowed",n5=X("gap-[.75em] rounded-full","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100"),rwe=Dh(X("inline-flex items-center justify-center leading-0 cursor-pointer","transition-all duration-normal ease-out-custom",nwe,twe),{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(`${lo.sm} text-ui-sm px-[.9em]`,n5),md:X(`${lo.md} text-ui-md px-[.9em]`,n5),default:X(`${lo.default} text-ui-md px-[1em]`,n5),lg:X(`${lo.lg} text-ui-lg px-[1.15em]`,n5),"icon-sm":`${lo.sm} w-form-sm rounded-full`,"icon-md":`${lo.md} w-form-md rounded-full`,"icon-lg":`${lo.lg} w-form-lg rounded-full`}},defaultVariants:{variant:"default",size:"default"}}),FQn={"icon-sm":"sm","icon-md":"default","icon-lg":"lg"};function iwt(e){const t=[];return Ee.Children.forEach(e,n=>{Ee.isValidElement(n)&&n.type===Ee.Fragment?t.push(...iwt(n.props.children)):t.push(n)}),t}function BQn(e){const t=iwt(e);return t.length>0&&t.every(n=>Ee.isValidElement(n))}function UQn(e){return typeof e=="string"&&e.startsWith("icon-")}const he=Ee.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=UQn(n),p=n??"default",h=!f&&BQn(a),m=o??((f||h)&&typeof i=="string"?i:void 0),g=f?l.jsx(Ve,{size:FQn[n],children:a}):a,v=l.jsx(d,{ref:u,disabled:s,"aria-label":m,className:X(rwe({variant:r,size:p}),h&&"[&>svg]:opacity-75",e),...c,children:g});return i?l.jsxs(rr,{children:[l.jsx(Jn,{asChild:!0,children:v}),l.jsx(er,{children:i})]}):v});he.displayName="Button";function qQn(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 VQn(e){const t=qQn(e);return wit({override:[HQn(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function HQn(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 ZQn=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,WQn=xn.mark({class:"cm-variable-highlight"}),s6e=new Mat({regexp:ZQn,decoration:()=>WQn}),GQn=Qi.fromClass(class{decorations;constructor(e){this.decorations=s6e.createDeco(e)}update(e){this.decorations=s6e.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),QQn=GQn,owt=({className:e,toastOptions:t,...n})=>l.jsx(cyn,{...n,closeButton:!0,richColors:!0,className:X("mastra-toaster",e),toastOptions:{duration:5e3,...t}}),Oq=(e,t)=>Array.isArray(e)?e.map(t):t(e),Be=(e,t={})=>{if(Array.isArray(e))return e.map(n=>Rm(n,t));if(Ee.isValidElement(e)||typeof e=="string")return Rm(e,t);throw new Error("Invalid message type")};Be.success=(e,t={})=>Oq(e,n=>Rm.success(n,t));Be.error=(e,t={})=>Oq(e,n=>Rm.error(n,t));Be.warning=(e,t={})=>Oq(e,n=>Rm.warning(n,t));Be.info=(e,t={})=>Oq(e,n=>Rm.info(n,t));Be.custom=(e,t={})=>Rm(e,t);Be.dismiss=e=>Rm.dismiss(e);Be.promise=({myPromise:e,loadingMessage:t,successMessage:n,errorMessage:r,onSuccess:s,onError:a,options:i={}})=>Rm.promise(e,{loading:t??"Loading...",success:o=>(s?.(o),n),error:o=>(a?.(o),r||(o instanceof Error?o.message:"Error...")),...i});function Dm({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(()=>{Be.success(t),r(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{r(!1)},2e3)}).catch(()=>{Be.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:n,handleCopy:a}}function ua({content:e,copyMessage:t,tooltip:n="Copy to clipboard",size:r="sm",className:s}){const[a,i]=y.useState(!1),{handleCopy:o}=Dm({text:e,copyMessage:t}),c=()=>{o(),i(!0),setTimeout(()=>i(!1),2e3)};return l.jsxs(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx(he,{onClick:c,type:"button",size:r,className:s,"aria-label":a?"Copied!":n,children:a?l.jsx(Lb,{}):l.jsx(qlt,{})})}),l.jsx(er,{children:a?"Copied!":n})]})}const YQn="mastra-theme",XQn="mastra-playground-store",yfe=e=>e==="dark"||e==="light"||e==="system",KQn=e=>{try{const t=e.getItem(XQn);if(!t)return;const r=JSON.parse(t)?.state?.theme;return yfe(r)?r:void 0}catch{return}},JQn=(e=YQn)=>({get(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(e);if(yfe(t))return t;const n=KQn(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}yfe(r.newValue)&&t(r.newValue)}};return window.addEventListener("storage",n),()=>window.removeEventListener("storage",n)}}),lwt=y.createContext(null),cwt="(prefers-color-scheme: dark)",eYn=typeof window>"u"?y.useEffect:y.useLayoutEffect,uwt=()=>typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia(cwt).matches?"dark":"light",dwt=e=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia(cwt);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},tYn=(e,t)=>{e.classList.remove(t==="dark"?"light":"dark"),e.classList.add(t)},fwt=({children:e,defaultTheme:t="system",storageKey:n,target:r})=>{const s=y.useMemo(()=>JQn(n),[n]),a=y.useRef(null),[i,o]=y.useState(()=>s.get()??t),c=y.useSyncExternalStore(dwt,uwt,()=>"dark");y.useEffect(()=>s.subscribe(f=>o(f??t)),[s,t]);const u=i==="system"?c:i;eYn(()=>{const f=r??(typeof window>"u"?null:window.document.documentElement);a.current&&a.current!==f&&a.current.classList.remove("dark","light"),f&&tYn(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(lwt.Provider,{value:d,children:e})},nYn=()=>{},tI=()=>{const e=y.useContext(lwt),t=y.useSyncExternalStore(dwt,uwt,()=>"dark");return y.useMemo(()=>e??{theme:"system",resolvedTheme:t,systemTheme:t,setTheme:nYn},[e,t])};function rYn(){const e=Tj({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:[oe.className,oe.propertyName],color:"var(--neutral6)"},{tag:oe.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[oe.heading1,oe.heading2,oe.heading3,oe.heading4,oe.heading5,oe.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:oe.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:oe.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:oe.link,color:"var(--accent3)",textDecoration:"underline"},{tag:oe.url,color:"var(--accent3)"},{tag:oe.monospace,color:"var(--neutral6)"},{tag:oe.strikethrough,textDecoration:"line-through"},{tag:oe.quote,fontStyle:"italic",color:"var(--neutral2)"}]}),t=St.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 sYn(){const e=St.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=Wm.define([{tag:[oe.comment,oe.bracket],color:"var(--neutral2)"},{tag:[oe.string,oe.meta,oe.regexp],color:"var(--accent1)"},{tag:[oe.atom,oe.bool,oe.special(oe.variableName)],color:"var(--accent6)"},{tag:[oe.keyword,oe.operator,oe.tagName],color:"var(--accent2)"},{tag:[oe.function(oe.propertyName),oe.propertyName],color:"var(--accent5)"},{tag:[oe.definition(oe.variableName),oe.function(oe.variableName),oe.className,oe.attributeName],color:"var(--accent3)"},{tag:[oe.variableName,oe.number],color:"var(--accent5)"},{tag:[oe.name,oe.quote],color:"var(--accent1)"},{tag:oe.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[oe.heading1,oe.heading2,oe.heading3,oe.heading4,oe.heading5,oe.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:[oe.emphasis],fontStyle:"italic",color:"var(--neutral6)"},{tag:[oe.strong],fontWeight:"bold",color:"var(--neutral6)"},{tag:oe.link,color:"var(--accent3)",textDecoration:"underline"},{tag:oe.url,color:"var(--accent3)"},{tag:oe.monospace,color:"var(--neutral6)"},{tag:oe.strikethrough,textDecoration:"line-through"},{tag:[oe.deleted],color:"var(--accent2)"},{tag:oe.invalid,color:"var(--error)"},{tag:[oe.standard(oe.tagName)],color:"var(--accent1)"}]);return[e,Lw(t)]}const Qb=()=>{const e=tI().resolvedTheme==="dark";return y.useMemo(()=>e?rYn():sYn(),[e])},Rs=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=Qb(),g=e?JSON.stringify(e,null,2):t??"",v=y.useMemo(()=>{const b=[];return a==="json"?b.push(Gf):a==="markdown"&&(b.push(Wve({base:yk,codeLanguages:qot})),b.push(St.lineWrapping)),i&&a==="markdown"&&b.push(QQn),c&&a==="markdown"&&b.push(VQn(c)),f===!1&&b.push(es.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(ua,{content:g,className:"absolute top-2 right-2 z-20"}),l.jsx(gu,{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 pwt(e,t){const{codeToTokens:n,bundledLanguages:r}=await at(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-CF0ott0E.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 di({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 Ll=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"})]}),aYn=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"})]}),swe=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"})]}),awe=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"})]}),iYn=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"})}),hwt=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)"})})})]}),mwt=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)"})})})]}),oYn=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"})]}),lYn=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"})]}),cYn=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"})]}),_q=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"})}),uYn=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"})}),gwt=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"})}),vu=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"})}),nI=e=>l.jsx(Mvn,{...e}),dYn=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"})]}),yu=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"})}),kv=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"})]}),Eq=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 bfe(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 vwt=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)"})})})]}),fYn=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"})}),pYn=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"})})}),ywt=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}})}),hYn=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"})]})]}),mYn=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"})})]}),gYn=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"})}),vYn=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"})]}),yYn=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"})})})]}),a6e=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"})}),bYn=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"})]})}),xYn=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"})}),wYn=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"})}),SYn=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"})]}),kYn=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"})}),bwt=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"})}),OYn=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"})]}),vp=({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}),xwt=({children:e,className:t,style:n})=>l.jsx(Ve,{size:"lg",className:X("text-neutral3 mt-1 shrink-0",t),style:n,children:e}),yp=({children:e,className:t})=>l.jsx(be,{as:"p",variant:"ui-lg",className:X("text-neutral6 font-medium",t),children:e}),bp=({children:e,className:t})=>l.jsx(be,{as:"div",variant:"ui-sm",className:X("text-neutral3",t),children:e}),xp=({children:e,className:t})=>l.jsx("div",{className:X("flex-1 w-full",t),children:e});function sa({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(di,{className:s,iconSlot:l.jsx(Ve,{size:"lg",className:"text-neutral3",children:l.jsx(bvn,{})}),titleSlot:t??a,descriptionSlot:n??i,actionSlot:r})}function fa({title:e,description:t,className:n}){const[r,s]=y.useState(!1),a=We(),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(di,{className:n,iconSlot:l.jsx(Ve,{size:"lg",className:"text-neutral3",children:l.jsx(ivn,{})}),titleSlot:e??"Session Expired",descriptionSlot:t??"Your session has expired. Please log in again to continue.",actionSlot:l.jsx(he,{variant:"default",onClick:i,disabled:r,children:r?"Redirecting...":"Log in"})})}const iwe=({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}),wwt=({children:e})=>l.jsx(be,{as:"h1",variant:"ui-md",className:"text-neutral6 flex items-center gap-2",children:e}),_Yn=({children:e})=>l.jsx("div",{className:"ml-auto flex items-center gap-3",children:e}),sb=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"})}),EYn={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},CYn=({className:e,children:t,size:n="default",style:r})=>l.jsx("table",{className:X("w-full",EYn[n],e),style:r,children:t}),TYn=({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})}),jYn=({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}),IYn=({className:e,children:t,...n})=>l.jsx("tbody",{className:X("",e),...n,children:t}),NYn=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})}),AYn=({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})}),RYn=Dh(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(awt,twe,nwe),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"}}),cu=y.forwardRef(({className:e,size:t,testId:n,variant:r,error:s,...a},i)=>l.jsx("textarea",{className:X(RYn({variant:r,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":n,ref:i,"aria-invalid":s,...a}));cu.displayName="Textarea";const PYn=xyn;function en({open:e,onOpenChange:t,children:n}){return l.jsx(PYn,{open:e,onOpenChange:t,children:n})}const Swt=y.forwardRef(({asChild:e,children:t,...n},r)=>{const s=e&&y.isValidElement(t)?{render:t}:{};return l.jsx(Dyn,{ref:r,...s,...n,children:e?void 0:t})});Swt.displayName="AlertDialogTrigger";const kwt=oct,owe=y.forwardRef(({className:e,...t},n)=>l.jsx(Xlt,{ref:n,className:X("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));owe.displayName="AlertDialogOverlay";const Owt=y.forwardRef(({className:e,...t},n)=>l.jsxs(kwt,{children:[l.jsx(owe,{}),l.jsx(ict,{ref:n,"data-slot":"alert-dialog-content",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})]}));Owt.displayName="AlertDialogContent";const _wt=({className:e,...t})=>l.jsx("div",{className:X("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});_wt.displayName="AlertDialogHeader";const Ewt=({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});Ewt.displayName="AlertDialogFooter";const Cwt=({className:e,...t})=>l.jsx("div",{className:X("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});Cwt.displayName="AlertDialogBody";const Twt=y.forwardRef(({className:e,...t},n)=>l.jsx(lct,{ref:n,className:X("text-ui-md font-medium",e),...t}));Twt.displayName="AlertDialogTitle";const jwt=y.forwardRef(({className:e,...t},n)=>l.jsx(Jlt,{ref:n,className:X("text-ui-sm text-neutral3",e),...t}));jwt.displayName="AlertDialogDescription";const Iwt=y.forwardRef(({className:e,...t},n)=>l.jsx($B,{ref:n,className:X(rwe({variant:"primary",size:"default"}),e),...t}));Iwt.displayName="AlertDialogAction";const Nwt=y.forwardRef(({className:e,...t},n)=>l.jsx($B,{ref:n,className:X(rwe({variant:"default",size:"default"}),e),...t}));Nwt.displayName="AlertDialogCancel";en.Trigger=Swt;en.Portal=kwt;en.Overlay=owe;en.Content=Owt;en.Header=_wt;en.Footer=Ewt;en.Body=Cwt;en.Title=Twt;en.Description=jwt;en.Action=Iwt;en.Cancel=Nwt;const go=y.forwardRef(({className:e,...t},n)=>l.jsx(mye,{ref:n,className:X("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",Rr.all,"hover:border-neutral5 hover:shadow-md",ewe,"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(hct,{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(Lb,{className:"h-3.5 w-3.5 stroke-3"})})}));go.displayName=mye.displayName;const Lm=Gyn,Sh=Ee.forwardRef(({className:e,asChild:t,children:n,...r},s)=>{const a=t&&Ee.isValidElement(n)?{render:n}:{};return l.jsx(Yyn,{ref:s,"data-slot":"collapsible-trigger",className:X("-outline-offset-2",Rr.colors,Xw.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-panel-open]>svg]:rotate-90",e),...a,...r,children:t?void 0:n})});Sh.displayName="CollapsibleTrigger";const kh=Ee.forwardRef(({className:e,children:t,...n},r)=>l.jsx(ebn,{ref:r,"data-slot":"collapsible-content",className:X("overflow-hidden","h-[var(--collapsible-panel-height)] transition-[height] duration-normal ease-out-custom","data-[starting-style]:h-0 data-[ending-style]:h-0"),...n,children:l.jsx("div",{className:e,children:t})}));kh.displayName="CollapsibleContent";const Er={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",Rr.colors),searchIcon:X("mr-2 h-3.5 w-3.5 shrink-0 text-neutral3",Rr.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",Rr.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",Rr.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",Rr.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"},MYn={default:Er.triggerDefault,ghost:Er.triggerGhost,link:Er.triggerLink};function Nc({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:Er.root,children:[l.jsxs(Pct,{items:e,value:m,onValueChange:g,disabled:o,open:d,onOpenChange:f,children:[l.jsxs(Fct,{className:X(Er.trigger,MYn[c],lo[u],h&&Er.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(gbn,{placeholder:r})})]}),l.jsx(f$,{className:Er.chevron})]}),l.jsx(Vct,{container:p,children:l.jsx(Hct,{align:"start",sideOffset:4,className:Er.positioner,children:l.jsxs(Zct,{className:Er.popup,children:[l.jsxs("div",{className:Er.searchContainer,children:[l.jsx(lT,{className:Er.searchIcon}),l.jsx(Lct,{className:Er.searchInput,placeholder:s})]}),l.jsx(Xct,{className:Er.empty,children:a}),l.jsx(Uct,{className:Er.list,children:v=>l.jsxs(Yct,{value:v,className:Er.item,children:[v.start,l.jsxs("span",{className:Er.optionText,children:[l.jsx("span",{className:Er.optionLabel,children:v.label}),v.description&&l.jsx("span",{className:Er.optionDescription,children:v.description})]}),l.jsxs("span",{className:Er.itemRightSlot,children:[v.end?l.jsx("div",{className:Er.optionEnd,children:v.end}):null,l.jsx("span",{className:Er.checkContainer,children:l.jsx(Mbn,{children:l.jsx(Lb,{className:Er.checkIcon})})})]})]},v.value)})]})})})]}),h&&l.jsx("span",{className:Er.error,children:h})]})}function Awt({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:Er.root,children:[l.jsxs(Pct,{multiple:!0,items:e,value:h,onValueChange:m,disabled:o,open:u,onOpenChange:d,children:[l.jsxs(Fct,{className:X(Er.trigger,lo[c],p&&Er.triggerError,i),children:[l.jsx("span",{className:X("truncate",h.length===0&&Er.placeholder),children:g}),l.jsx(f$,{className:Er.chevron})]}),l.jsx(Vct,{container:f,children:l.jsx(Hct,{align:"start",sideOffset:4,className:Er.positioner,children:l.jsxs(Zct,{className:Er.popup,children:[l.jsxs("div",{className:Er.searchContainer,children:[l.jsx(lT,{className:Er.searchIcon}),l.jsx(Lct,{className:Er.searchInput,placeholder:s})]}),l.jsx(Xct,{className:Er.empty,children:a}),l.jsx(Uct,{className:Er.list,children:v=>{const b=t.includes(v.value);return l.jsxs(Yct,{value:v,className:Er.itemMulti,children:[l.jsx("span",{className:X(Er.checkbox,b?Er.checkboxSelected:Er.checkboxUnselected),children:b&&l.jsx(Lb,{className:Er.checkboxIcon})}),l.jsxs("span",{className:Er.optionContent,children:[v.start,l.jsxs("span",{className:Er.optionText,children:[l.jsx("span",{className:Er.optionLabel,children:v.label}),v.description&&l.jsx("span",{className:Er.optionDescription,children:v.description})]}),v.end?l.jsx("div",{className:Er.optionEnd,children:v.end}):null]})]},v.value)}})]})})})]}),p&&l.jsx("span",{className:Er.error,children:p})]})}const Dr=x0n,lwe=y.forwardRef(({asChild:e,children:t,...n},r)=>{const s=e&&y.isValidElement(t)?{render:t}:{};return l.jsx(uct,{ref:r,...s,...n,children:e?void 0:t})});lwe.displayName="DialogTrigger";const $Yn=oct,Rwt=y.forwardRef(({asChild:e,children:t,...n},r)=>{const s=e&&y.isValidElement(t)?{render:t}:{};return l.jsx($B,{ref:r,...s,...n,children:e?void 0:t})});Rwt.displayName="DialogClose";const Pwt=y.forwardRef(({className:e,...t},n)=>l.jsx(Xlt,{ref:n,className:X("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));Pwt.displayName="DialogOverlay";const Nr=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs($Yn,{children:[l.jsx(Pwt,{}),l.jsxs(ict,{ref:r,"data-slot":"dialog-content",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","focus-visible:outline-hidden",e),...n,children:[t,l.jsx($B,{render:l.jsx(he,{variant:"ghost",size:"sm",className:"absolute top-3 right-3","aria-label":"Close",children:l.jsx(Hd,{})})})]})]}));Nr.displayName="DialogContent";const Lr=({className:e,...t})=>l.jsx("div",{className:X("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});Lr.displayName="DialogHeader";const lp=({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});lp.displayName="DialogFooter";const ts=({className:e,...t})=>l.jsx("div",{className:X("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});ts.displayName="DialogBody";const Ar=y.forwardRef(({className:e,...t},n)=>l.jsx(lct,{ref:n,className:X("text-ui-md font-medium",e),...t}));Ar.displayName="DialogTitle";const ga=y.forwardRef(({className:e,...t},n)=>l.jsx(Jlt,{ref:n,className:X("sr-only",e),...t}));ga.displayName="DialogDescription";const Mwt=y.forwardRef(({className:e,...t},n)=>l.jsx(Jd,{ref:n,className:X("flex h-full w-full flex-col overflow-hidden rounded-xl bg-surface3 text-neutral4",e),...t}));Mwt.displayName=Jd.displayName;const DYn=({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(Dr,{...r,children:l.jsxs(Nr,{className:"overflow-hidden p-0",children:[l.jsx(Ar,{className:"sr-only",children:t}),l.jsx(ga,{className:"sr-only",children:n}),l.jsx(Mwt,{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})]})})},$wt=y.forwardRef(({className:e,...t},n)=>l.jsxs("div",{className:X("flex items-center border-b border-border1 px-3",Rr.colors),"cmdk-input-wrapper":"",children:[l.jsx(lT,{className:X("mr-2 h-4 w-4 shrink-0 text-neutral3",Rr.colors)}),l.jsx(Jd.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",Rr.colors,e),...t})]}));$wt.displayName=Jd.Input.displayName;const Dwt=y.forwardRef(({className:e,...t},n)=>l.jsx(Jd.List,{ref:n,className:X("max-h-dropdown-max-height overflow-y-auto overflow-x-hidden",e),...t}));Dwt.displayName=Jd.List.displayName;const Lwt=y.forwardRef((e,t)=>l.jsx(Jd.Empty,{ref:t,className:"py-6 text-center text-ui-smd text-neutral3",...e}));Lwt.displayName=Jd.Empty.displayName;const Yx=y.forwardRef(({className:e,...t},n)=>l.jsx(Jd.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}));Yx.displayName=Jd.Group.displayName;const rS=y.forwardRef(({className:e,...t},n)=>l.jsx(Jd.Separator,{ref:n,className:X("-mx-1 h-px bg-border1",e),...t}));rS.displayName=Jd.Separator.displayName;const Tl=y.forwardRef(({className:e,...t},n)=>l.jsx(Jd.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",Rr.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}));Tl.displayName=Jd.Item.displayName;const zwt=({className:e,...t})=>l.jsx("span",{className:X("ml-auto text-ui-xs tabular-nums tracking-wider text-neutral3",e),...t});zwt.displayName="CommandShortcut";const fi=W0n,pi=G0n,Ka=y.forwardRef(({className:e,children:t,size:n="default",...r},s)=>l.jsxs(odt,{ref:s,className:X("inline-flex w-full cursor-pointer select-none items-center justify-between gap-1.5 whitespace-nowrap",lo[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(Q0n,{asChild:!0,children:l.jsx(nye,{className:X("h-4 w-4 shrink-0 text-neutral3 opacity-70",Rr.colors)})})]}));Ka.displayName=odt.displayName;const Ja=y.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>l.jsx(Y0n,{children:l.jsx(ldt,{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(X0n,{className:X("p-1",n==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t})})}));Ja.displayName=ldt.displayName;const os=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(cdt,{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",Rr.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(J0n,{children:l.jsx(Lb,{className:"h-4 w-4 text-neutral6"})})}),l.jsx(K0n,{children:t})]}));os.displayName=cdt.displayName;const Eu=({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}),LYn=Dh("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"}}),Cu=({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(ywn,{"data-variant":s,className:X("group/tabs-list",LYn({variant:s}),t),children:[e,s==="line"&&l.jsx(B2e,{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(B2e,{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",Rr.colors,Xw.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",Rr.colors,"hover:text-neutral5"),"aria-label":"Close tab",children:l.jsx(Hd,{className:"w-3 h-3"})})]}),Os=({children:e,value:t,className:n})=>l.jsx(fwn,{value:t,className:X("grid py-3 overflow-y-auto ring-offset-background",Xw.visible,n),children:e});function zYn({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(Eu,{defaultTab:t[0].value,value:h,onValueChange:r??(()=>{}),children:l.jsx(Cu,{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(fi,{value:h,onValueChange:r,children:[l.jsx(Ka,{size:"sm",variant:"ghost",children:l.jsx(pi,{})}),l.jsx(Ja,{children:t.map(m=>l.jsx(os,{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(FYn,{code:e,lang:i}),l.jsx(ua,{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",Rr.opacity)})]})]})}function FYn({code:e,lang:t}){const[n,r]=y.useState(null);y.useEffect(()=>{if(!t){r(null);return}r(null);let a=!1;return pwt(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&&`
|
|
282
|
+
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 q5e(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const _Gn=(e,t)=>Math.abs(e-t)<1.01,EGn=(e,t,n)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)}},V5e=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},CGn=e=>e,TGn=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},jGn=(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(V5e(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(V5e(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},H5e={passive:!0},Z5e=typeof window>"u"?!0:"onscrollend"in window,IGn=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let s=0;const a=e.options.useScrollendEvent&&Z5e?()=>{}:EGn(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,H5e);const u=e.options.useScrollendEvent&&Z5e;return u&&n.addEventListener("scrollend",c,H5e),()=>{n.removeEventListener("scroll",o),u&&n.removeEventListener("scrollend",c)}},NGn=(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"]},AGn=(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 RGn{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:CGn,rangeExtractor:TGn,onChange:()=>{},measureElement:NGn,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=H_(()=>(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=H_(()=>[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=H_(()=>[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 _=p[v],C=_!==void 0?f[_]:void 0;b=C?C.end+this.options.gap:r+s}else{const _=this.options.lanes===1?f[h-1]:this.getFurthestMeasurement(f,h);b=_?_.end+this.options.gap:r+s,v=_?_.lane:h%this.options.lanes,this.options.lanes>1&&S&&this.laneAssignments.set(h,v)}const w=u.get(m),O=typeof w=="number"?w:this.options.estimateSize(h),E=b+O;f[h]={index:h,start:b,size:O,end:E,key:m,lane:v},p[v]=h}return this.measurementsCache=f,f},{key:!1,debug:()=>this.options.debug}),this.calculateRange=H_(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,a)=>this.range=n.length>0&&r>0?PGn({measurements:n,outerSize:r,scrollOffset:s,lanes:a}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=H_(()=>{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=H_(()=>[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 q5e(r[D0t(0,r.length-1,s=>q5e(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&&_Gn(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 D0t=(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 PGn({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=D0t(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 W5e=typeof document<"u"?y.useLayoutEffect:y.useEffect;function MGn({useFlushSync:e=!0,...t}){const n=y.useReducer(()=>({}),{})[1],r={...t,onChange:(a,i)=>{var o;e&&i?Lo.flushSync(n):n(),(o=t.onChange)==null||o.call(t,a,i)}},[s]=y.useState(()=>new RGn(r));return s.setOptions(r),W5e(()=>s._didMount(),[]),W5e(()=>s._willUpdate()),s}function L0t(e){return MGn({observeElementRect:jGn,observeElementOffset:IGn,scrollToFn:AGn,...e})}function z0t(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=z0t(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function F0t(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=z0t(e))&&(r&&(r+=" "),r+=t);return r}const $Gn=(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},DGn=(e,t)=>({classGroupId:e,validator:t}),B0t=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),H8="-",G5e=[],LGn="arbitrary..",zGn=e=>{const t=BGn(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return FGn(i);const o=i.split(H8),c=o[0]===""&&o.length>1?1:0;return U0t(o,c,t)},getConflictingClassGroupIds:(i,o)=>{if(o){const c=r[i],u=n[i];return c?u?$Gn(u,c):c:u||G5e}return n[i]||G5e}}},U0t=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const u=U0t(e,t+1,a);if(u)return u}const i=n.validators;if(i===null)return;const o=t===0?e.join(H8):e.slice(t).join(H8),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(o))return d.classGroupId}},FGn=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?LGn+r:void 0})(),BGn=e=>{const{theme:t,classGroups:n}=e;return UGn(n,t)},UGn=(e,t)=>{const n=B0t();for(const r in e){const s=e[r];K0e(s,n,r,t)}return n},K0e=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];qGn(i,t,n,r)}},qGn=(e,t,n,r)=>{if(typeof e=="string"){VGn(e,t,n);return}if(typeof e=="function"){HGn(e,t,n,r);return}ZGn(e,t,n,r)},VGn=(e,t,n)=>{const r=e===""?t:q0t(t,e);r.classGroupId=n},HGn=(e,t,n,r)=>{if(WGn(e)){K0e(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(DGn(n,e))},ZGn=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[o,c]=s[i];K0e(c,q0t(t,o),n,r)}},q0t=(e,t)=>{let n=e;const r=t.split(H8),s=r.length;for(let a=0;a<s;a++){const i=r[a];let o=n.nextPart.get(i);o||(o=B0t(),n.nextPart.set(i,o)),n=o}return n},WGn=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,GGn=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)}}},vfe="!",Q5e=":",QGn=[],Y5e=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),YGn=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===Q5e){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(vfe)?(p=f.slice(0,-1),h=!0):f.startsWith(vfe)&&(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+Q5e,a=r;r=i=>i.startsWith(s)?a(i.slice(s.length)):Y5e(QGn,!1,i,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},XGn=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}},KGn=e=>({cache:GGn(e.cacheSize),parseClassName:YGn(e),sortModifiers:XGn(e),...zGn(e)}),JGn=/\s+/,eQn=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],o=e.trim().split(JGn);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+vfe:S,O=w+b;if(i.indexOf(O)>-1)continue;i.push(O);const E=s(b,v);for(let _=0;_<E.length;++_){const C=E[_];i.push(w+C)}c=d+(c.length>0?" "+c:c)}return c},tQn=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=V0t(n))&&(s&&(s+=" "),s+=r);return s},V0t=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=V0t(e[r]))&&(n&&(n+=" "),n+=t);return n},X5e=(e,...t)=>{let n,r,s,a;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return n=KGn(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=eQn(c,n);return s(c,d),d};return a=i,(...c)=>a(tQn(...c))},nQn=[],_l=e=>{const t=n=>n[e]||nQn;return t.isThemeGetter=!0,t},H0t=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Z0t=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rQn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,sQn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aQn=/\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$/,iQn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,oQn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lQn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mx=e=>rQn.test(e),is=e=>!!e&&!Number.isNaN(Number(e)),$x=e=>!!e&&Number.isInteger(Number(e)),XX=e=>e.endsWith("%")&&is(e.slice(0,-1)),gy=e=>sQn.test(e),W0t=()=>!0,cQn=e=>aQn.test(e)&&!iQn.test(e),J0e=()=>!1,uQn=e=>oQn.test(e),dQn=e=>lQn.test(e),fQn=e=>!Dn(e)&&!Bn(e),pQn=e=>Yw(e,Y0t,J0e),Dn=e=>H0t.test(e),D1=e=>Yw(e,X0t,cQn),K5e=e=>Yw(e,wQn,is),hQn=e=>Yw(e,J0t,W0t),mQn=e=>Yw(e,K0t,J0e),J5e=e=>Yw(e,G0t,J0e),gQn=e=>Yw(e,Q0t,dQn),KL=e=>Yw(e,ewt,uQn),Bn=e=>Z0t.test(e),KN=e=>AO(e,X0t),vQn=e=>AO(e,K0t),e6e=e=>AO(e,G0t),yQn=e=>AO(e,Y0t),bQn=e=>AO(e,Q0t),JL=e=>AO(e,ewt,!0),xQn=e=>AO(e,J0t,!0),Yw=(e,t,n)=>{const r=H0t.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},AO=(e,t,n=!1)=>{const r=Z0t.exec(e);return r?r[1]?t(r[1]):n:!1},G0t=e=>e==="position"||e==="percentage",Q0t=e=>e==="image"||e==="url",Y0t=e=>e==="length"||e==="size"||e==="bg-size",X0t=e=>e==="length",wQn=e=>e==="number",K0t=e=>e==="family-name",J0t=e=>e==="number"||e==="weight",ewt=e=>e==="shadow",t6e=()=>{const e=_l("color"),t=_l("font"),n=_l("text"),r=_l("font-weight"),s=_l("tracking"),a=_l("leading"),i=_l("breakpoint"),o=_l("container"),c=_l("spacing"),u=_l("radius"),d=_l("shadow"),f=_l("inset-shadow"),p=_l("text-shadow"),h=_l("drop-shadow"),m=_l("blur"),g=_l("perspective"),v=_l("aspect"),b=_l("ease"),S=_l("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...O(),Bn,Dn],_=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],j=()=>[Bn,Dn,c],I=()=>[Mx,"full","auto",...j()],N=()=>[$x,"none","subgrid",Bn,Dn],R=()=>["auto",{span:["full",$x,Bn,Dn]},$x,Bn,Dn],P=()=>[$x,"auto",Bn,Dn],B=()=>["auto","min","max","fr",Bn,Dn],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=()=>[Mx,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],U=()=>[Mx,"screen","full","dvw","lvw","svw","min","max","fit",...j()],H=()=>[Mx,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],D=()=>[e,Bn,Dn],Y=()=>[...O(),e6e,J5e,{position:[Bn,Dn]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",yQn,pQn,{size:[Bn,Dn]}],Z=()=>[XX,KN,D1],G=()=>["","none","full",u,Bn,Dn],K=()=>["",is,KN,D1],ne=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[is,XX,e6e,J5e],se=()=>["","none",m,Bn,Dn],ae=()=>["none",is,Bn,Dn],Q=()=>["none",is,Bn,Dn],te=()=>[is,Bn,Dn],le=()=>[Mx,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[gy],breakpoint:[gy],color:[W0t],container:[gy],"drop-shadow":[gy],ease:["in","out","in-out"],font:[fQn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[gy],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[gy],shadow:[gy],spacing:["px",is],text:[gy],"text-shadow":[gy],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Mx,Dn,Bn,v]}],container:["container"],columns:[{columns:[is,Dn,Bn,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:E()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[$x,"auto",Bn,Dn]}],basis:[{basis:[Mx,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[is,Mx,"auto","initial","none",Dn]}],grow:[{grow:["",is,Bn,Dn]}],shrink:[{shrink:["",is,Bn,Dn]}],order:[{order:[$x,"first","last","none",Bn,Dn]}],"grid-cols":[{"grid-cols":N()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":N()}],"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":B()}],"auto-rows":[{"auto-rows":B()}],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",...U()]}],"min-inline-size":[{"min-inline":["auto",...U()]}],"max-inline-size":[{"max-inline":["none",...U()]}],"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,KN,D1]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,xQn,hQn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",XX,Dn]}],"font-family":[{font:[vQn,mQn,t]}],"font-features":[{"font-features":[Dn]}],"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,Bn,Dn]}],"line-clamp":[{"line-clamp":[is,"none",Bn,K5e]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",Bn,Dn]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Bn,Dn]}],"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:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[is,"from-font","auto",Bn,D1]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[is,"auto",Bn,Dn]}],"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",Bn,Dn]}],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",Bn,Dn]}],"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"]},$x,Bn,Dn],radial:["",Bn,Dn],conic:[$x,Bn,Dn]},bQn,gQn]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"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:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"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:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[is,Bn,Dn]}],"outline-w":[{outline:["",is,KN,D1]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",d,JL,KL]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",f,JL,KL]}],"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,D1]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",p,JL,KL]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[is,Bn,Dn]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"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":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"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":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"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":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"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":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"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":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"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":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"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":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Bn,Dn]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"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":O()}],"mask-image-conic-pos":[{"mask-conic":[is]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"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",Bn,Dn]}],filter:[{filter:["","none",Bn,Dn]}],blur:[{blur:se()}],brightness:[{brightness:[is,Bn,Dn]}],contrast:[{contrast:[is,Bn,Dn]}],"drop-shadow":[{"drop-shadow":["","none",h,JL,KL]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",is,Bn,Dn]}],"hue-rotate":[{"hue-rotate":[is,Bn,Dn]}],invert:[{invert:["",is,Bn,Dn]}],saturate:[{saturate:[is,Bn,Dn]}],sepia:[{sepia:["",is,Bn,Dn]}],"backdrop-filter":[{"backdrop-filter":["","none",Bn,Dn]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[is,Bn,Dn]}],"backdrop-contrast":[{"backdrop-contrast":[is,Bn,Dn]}],"backdrop-grayscale":[{"backdrop-grayscale":["",is,Bn,Dn]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[is,Bn,Dn]}],"backdrop-invert":[{"backdrop-invert":["",is,Bn,Dn]}],"backdrop-opacity":[{"backdrop-opacity":[is,Bn,Dn]}],"backdrop-saturate":[{"backdrop-saturate":[is,Bn,Dn]}],"backdrop-sepia":[{"backdrop-sepia":["",is,Bn,Dn]}],"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",Bn,Dn]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[is,"initial",Bn,Dn]}],ease:[{ease:["linear","initial",b,Bn,Dn]}],delay:[{delay:[is,Bn,Dn]}],animate:[{animate:["none",S,Bn,Dn]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,Bn,Dn]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:te()}],"skew-x":[{"skew-x":te()}],"skew-y":[{"skew-y":te()}],transform:[{transform:[Bn,Dn,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent: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",Bn,Dn]}],"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",Bn,Dn]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[is,KN,D1,K5e]}],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"]}},SQn=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:s={},override:a={}})=>(UA(e,"cacheSize",t),UA(e,"prefix",n),UA(e,"experimentalParseClassName",r),e5(e.theme,a.theme),e5(e.classGroups,a.classGroups),e5(e.conflictingClassGroups,a.conflictingClassGroups),e5(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),UA(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),t5(e.theme,s.theme),t5(e.classGroups,s.classGroups),t5(e.conflictingClassGroups,s.conflictingClassGroups),t5(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),twt(e,s,"orderSensitiveModifiers"),e),UA=(e,t,n)=>{n!==void 0&&(e[t]=n)},e5=(e,t)=>{if(t)for(const n in t)UA(e,n,t[n])},t5=(e,t)=>{if(t)for(const n in t)twt(e,t,n)},twt=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},kQn=(e,...t)=>typeof e=="function"?X5e(t6e,e,...t):X5e(()=>SQn(t6e(),e),...t),OQn=Object.keys({...Vy,...pnn}),_Qn=Object.keys(bnn),EQn=Object.keys(hnn),CQn=Object.keys(mnn),TQn=Object.keys(fnn),L1=Object.keys(ynn),jQn=Object.keys(gnn).concat(Object.keys(vnn)),IQn=kQn({extend:{theme:{color:OQn,spacing:_Qn,radius:TQn,leading:CQn,shadow:jQn},classGroups:{"font-size":[{text:EQn}],h:[{h:L1}],w:[{w:L1}],size:[{size:L1}],"min-h":[{"min-h":L1}],"min-w":[{"min-w":L1}],"max-h":[{"max-h":L1}],"max-w":[{"max-w":L1}]}}});function X(...e){return IQn(F0t(e))}const NQn={"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"},AQn={mono:"font-mono"},be=({as:e="p",className:t,variant:n="ui-md",font:r,...s})=>l.jsx(e,{className:X(NQn[n],r&&AQn[r],t),...s}),Rr={colors:"transition-colors duration-normal ease-out-custom",all:"transition-all duration-normal ease-out-custom",opacity:"transition-opacity duration-normal ease-out-custom"},Xw={visible:"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},RQn={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},nwt=({src:e,name:t,size:n="sm",interactive:r=!1})=>l.jsx("div",{className:X(RQn[n],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",Rr.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(be,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),PQn={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"},Ve=({children:e,className:t,size:n="default",...r})=>l.jsx("span",{className:X("block",PQn[n],t),...r,children:e}),MQn={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"},Ct=({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",Rr.colors,e?"pl-2 pr-2.5":"px-2.5",MQn[t],n),...s,children:[e&&l.jsx(Ve,{size:"sm",children:e}),r]}),$Qn=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"})}),DQn=({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})}),LQn=({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",Rr.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(Ve,{className:X("text-neutral2",Rr.colors),children:l.jsx($Qn,{})})})]})},n6e=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,r6e=F0t,Dh=(e,t)=>n=>{var r;if(t?.variants==null)return r6e(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=n6e(d)||n6e(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 r6e(e,i,c,n?.class,n?.className)};function ud({delay:e,delayDuration:t,timeout:n,skipDelayDuration:r,...s}){const a=e??t,i=n??r;return l.jsx(Rsn,{...a!==void 0?{delay:a}:{},...i!==void 0?{timeout:i}:{},...s})}const rr=dsn,Jn=y.forwardRef(({asChild:e,render:t,children:n,...r},s)=>e&&y.isValidElement(n)?l.jsx(_Ae,{ref:s,render:n,...r}):l.jsx(_Ae,{ref:s,render:t,...r,children:n}));Jn.displayName="TooltipTrigger";const er=y.forwardRef(({className:e,side:t="top",sideOffset:n=8,align:r="center",alignOffset:s=0,children:a,...i},o)=>l.jsx(Osn,{children:l.jsx(jsn,{side:t,sideOffset:n,align:r,alignOffset:s,arrowPadding:10,className:"isolate z-[100]",children:l.jsxs(Nsn,{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(Asn,{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(zQn,{})})]})})}));er.displayName="TooltipContent";function zQn(){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 lo={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},ewe="focus:outline-hidden focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",rwt="focus-within:outline-hidden focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",swt="rounded-md",awt="bg-surface2 border border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",twe="outline-hidden focus-visible:outline-hidden focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",nwe="disabled:opacity-50 disabled:cursor-not-allowed",n5=X("gap-[.75em] rounded-full","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100"),rwe=Dh(X("inline-flex items-center justify-center leading-0 cursor-pointer","transition-all duration-normal ease-out-custom",nwe,twe),{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(`${lo.sm} text-ui-sm px-[.9em]`,n5),md:X(`${lo.md} text-ui-md px-[.9em]`,n5),default:X(`${lo.default} text-ui-md px-[1em]`,n5),lg:X(`${lo.lg} text-ui-lg px-[1.15em]`,n5),"icon-sm":`${lo.sm} w-form-sm rounded-full`,"icon-md":`${lo.md} w-form-md rounded-full`,"icon-lg":`${lo.lg} w-form-lg rounded-full`}},defaultVariants:{variant:"default",size:"default"}}),FQn={"icon-sm":"sm","icon-md":"default","icon-lg":"lg"};function iwt(e){const t=[];return Ee.Children.forEach(e,n=>{Ee.isValidElement(n)&&n.type===Ee.Fragment?t.push(...iwt(n.props.children)):t.push(n)}),t}function BQn(e){const t=iwt(e);return t.length>0&&t.every(n=>Ee.isValidElement(n))}function UQn(e){return typeof e=="string"&&e.startsWith("icon-")}const he=Ee.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=UQn(n),p=n??"default",h=!f&&BQn(a),m=o??((f||h)&&typeof i=="string"?i:void 0),g=f?l.jsx(Ve,{size:FQn[n],children:a}):a,v=l.jsx(d,{ref:u,disabled:s,"aria-label":m,className:X(rwe({variant:r,size:p}),h&&"[&>svg]:opacity-75",e),...c,children:g});return i?l.jsxs(rr,{children:[l.jsx(Jn,{asChild:!0,children:v}),l.jsx(er,{children:i})]}):v});he.displayName="Button";function qQn(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 VQn(e){const t=qQn(e);return wit({override:[HQn(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function HQn(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 ZQn=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,WQn=xn.mark({class:"cm-variable-highlight"}),s6e=new Mat({regexp:ZQn,decoration:()=>WQn}),GQn=Qi.fromClass(class{decorations;constructor(e){this.decorations=s6e.createDeco(e)}update(e){this.decorations=s6e.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),QQn=GQn,owt=({className:e,toastOptions:t,...n})=>l.jsx(cyn,{...n,closeButton:!0,richColors:!0,className:X("mastra-toaster",e),toastOptions:{duration:5e3,...t}}),Oq=(e,t)=>Array.isArray(e)?e.map(t):t(e),Be=(e,t={})=>{if(Array.isArray(e))return e.map(n=>Rm(n,t));if(Ee.isValidElement(e)||typeof e=="string")return Rm(e,t);throw new Error("Invalid message type")};Be.success=(e,t={})=>Oq(e,n=>Rm.success(n,t));Be.error=(e,t={})=>Oq(e,n=>Rm.error(n,t));Be.warning=(e,t={})=>Oq(e,n=>Rm.warning(n,t));Be.info=(e,t={})=>Oq(e,n=>Rm.info(n,t));Be.custom=(e,t={})=>Rm(e,t);Be.dismiss=e=>Rm.dismiss(e);Be.promise=({myPromise:e,loadingMessage:t,successMessage:n,errorMessage:r,onSuccess:s,onError:a,options:i={}})=>Rm.promise(e,{loading:t??"Loading...",success:o=>(s?.(o),n),error:o=>(a?.(o),r||(o instanceof Error?o.message:"Error...")),...i});function Dm({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(()=>{Be.success(t),r(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{r(!1)},2e3)}).catch(()=>{Be.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:n,handleCopy:a}}function ua({content:e,copyMessage:t,tooltip:n="Copy to clipboard",size:r="sm",className:s}){const[a,i]=y.useState(!1),{handleCopy:o}=Dm({text:e,copyMessage:t}),c=()=>{o(),i(!0),setTimeout(()=>i(!1),2e3)};return l.jsxs(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx(he,{onClick:c,type:"button",size:r,className:s,"aria-label":a?"Copied!":n,children:a?l.jsx(Lb,{}):l.jsx(qlt,{})})}),l.jsx(er,{children:a?"Copied!":n})]})}const YQn="mastra-theme",XQn="mastra-playground-store",yfe=e=>e==="dark"||e==="light"||e==="system",KQn=e=>{try{const t=e.getItem(XQn);if(!t)return;const r=JSON.parse(t)?.state?.theme;return yfe(r)?r:void 0}catch{return}},JQn=(e=YQn)=>({get(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(e);if(yfe(t))return t;const n=KQn(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}yfe(r.newValue)&&t(r.newValue)}};return window.addEventListener("storage",n),()=>window.removeEventListener("storage",n)}}),lwt=y.createContext(null),cwt="(prefers-color-scheme: dark)",eYn=typeof window>"u"?y.useEffect:y.useLayoutEffect,uwt=()=>typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia(cwt).matches?"dark":"light",dwt=e=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia(cwt);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},tYn=(e,t)=>{e.classList.remove(t==="dark"?"light":"dark"),e.classList.add(t)},fwt=({children:e,defaultTheme:t="system",storageKey:n,target:r})=>{const s=y.useMemo(()=>JQn(n),[n]),a=y.useRef(null),[i,o]=y.useState(()=>s.get()??t),c=y.useSyncExternalStore(dwt,uwt,()=>"dark");y.useEffect(()=>s.subscribe(f=>o(f??t)),[s,t]);const u=i==="system"?c:i;eYn(()=>{const f=r??(typeof window>"u"?null:window.document.documentElement);a.current&&a.current!==f&&a.current.classList.remove("dark","light"),f&&tYn(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(lwt.Provider,{value:d,children:e})},nYn=()=>{},tI=()=>{const e=y.useContext(lwt),t=y.useSyncExternalStore(dwt,uwt,()=>"dark");return y.useMemo(()=>e??{theme:"system",resolvedTheme:t,systemTheme:t,setTheme:nYn},[e,t])};function rYn(){const e=Tj({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:[oe.className,oe.propertyName],color:"var(--neutral6)"},{tag:oe.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[oe.heading1,oe.heading2,oe.heading3,oe.heading4,oe.heading5,oe.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:oe.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:oe.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:oe.link,color:"var(--accent3)",textDecoration:"underline"},{tag:oe.url,color:"var(--accent3)"},{tag:oe.monospace,color:"var(--neutral6)"},{tag:oe.strikethrough,textDecoration:"line-through"},{tag:oe.quote,fontStyle:"italic",color:"var(--neutral2)"}]}),t=St.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 sYn(){const e=St.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=Wm.define([{tag:[oe.comment,oe.bracket],color:"var(--neutral2)"},{tag:[oe.string,oe.meta,oe.regexp],color:"var(--accent1)"},{tag:[oe.atom,oe.bool,oe.special(oe.variableName)],color:"var(--accent6)"},{tag:[oe.keyword,oe.operator,oe.tagName],color:"var(--accent2)"},{tag:[oe.function(oe.propertyName),oe.propertyName],color:"var(--accent5)"},{tag:[oe.definition(oe.variableName),oe.function(oe.variableName),oe.className,oe.attributeName],color:"var(--accent3)"},{tag:[oe.variableName,oe.number],color:"var(--accent5)"},{tag:[oe.name,oe.quote],color:"var(--accent1)"},{tag:oe.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[oe.heading1,oe.heading2,oe.heading3,oe.heading4,oe.heading5,oe.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:[oe.emphasis],fontStyle:"italic",color:"var(--neutral6)"},{tag:[oe.strong],fontWeight:"bold",color:"var(--neutral6)"},{tag:oe.link,color:"var(--accent3)",textDecoration:"underline"},{tag:oe.url,color:"var(--accent3)"},{tag:oe.monospace,color:"var(--neutral6)"},{tag:oe.strikethrough,textDecoration:"line-through"},{tag:[oe.deleted],color:"var(--accent2)"},{tag:oe.invalid,color:"var(--error)"},{tag:[oe.standard(oe.tagName)],color:"var(--accent1)"}]);return[e,Lw(t)]}const Qb=()=>{const e=tI().resolvedTheme==="dark";return y.useMemo(()=>e?rYn():sYn(),[e])},Rs=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=Qb(),g=e?JSON.stringify(e,null,2):t??"",v=y.useMemo(()=>{const b=[];return a==="json"?b.push(Gf):a==="markdown"&&(b.push(Wve({base:yk,codeLanguages:qot})),b.push(St.lineWrapping)),i&&a==="markdown"&&b.push(QQn),c&&a==="markdown"&&b.push(VQn(c)),f===!1&&b.push(es.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(ua,{content:g,className:"absolute top-2 right-2 z-20"}),l.jsx(gu,{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 pwt(e,t){const{codeToTokens:n,bundledLanguages:r}=await at(async()=>{const{codeToTokens:a,bundledLanguages:i}=await import("./index-DcjJamdO.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 di({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 Ll=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"})]}),aYn=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"})]}),swe=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"})]}),awe=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"})]}),iYn=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"})}),hwt=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)"})})})]}),mwt=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)"})})})]}),oYn=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"})]}),lYn=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"})]}),cYn=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"})]}),_q=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"})}),uYn=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"})}),gwt=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"})}),vu=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"})}),nI=e=>l.jsx(Mvn,{...e}),dYn=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"})]}),yu=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"})}),kv=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"})]}),Eq=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 bfe(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 vwt=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)"})})})]}),fYn=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"})}),pYn=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"})})}),ywt=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}})}),hYn=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"})]})]}),mYn=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"})})]}),gYn=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"})}),vYn=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"})]}),yYn=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"})})})]}),a6e=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"})}),bYn=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"})]})}),xYn=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"})}),wYn=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"})}),SYn=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"})]}),kYn=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"})}),bwt=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"})}),OYn=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"})]}),vp=({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}),xwt=({children:e,className:t,style:n})=>l.jsx(Ve,{size:"lg",className:X("text-neutral3 mt-1 shrink-0",t),style:n,children:e}),yp=({children:e,className:t})=>l.jsx(be,{as:"p",variant:"ui-lg",className:X("text-neutral6 font-medium",t),children:e}),bp=({children:e,className:t})=>l.jsx(be,{as:"div",variant:"ui-sm",className:X("text-neutral3",t),children:e}),xp=({children:e,className:t})=>l.jsx("div",{className:X("flex-1 w-full",t),children:e});function sa({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(di,{className:s,iconSlot:l.jsx(Ve,{size:"lg",className:"text-neutral3",children:l.jsx(bvn,{})}),titleSlot:t??a,descriptionSlot:n??i,actionSlot:r})}function fa({title:e,description:t,className:n}){const[r,s]=y.useState(!1),a=We(),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(di,{className:n,iconSlot:l.jsx(Ve,{size:"lg",className:"text-neutral3",children:l.jsx(ivn,{})}),titleSlot:e??"Session Expired",descriptionSlot:t??"Your session has expired. Please log in again to continue.",actionSlot:l.jsx(he,{variant:"default",onClick:i,disabled:r,children:r?"Redirecting...":"Log in"})})}const iwe=({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}),wwt=({children:e})=>l.jsx(be,{as:"h1",variant:"ui-md",className:"text-neutral6 flex items-center gap-2",children:e}),_Yn=({children:e})=>l.jsx("div",{className:"ml-auto flex items-center gap-3",children:e}),sb=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"})}),EYn={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},CYn=({className:e,children:t,size:n="default",style:r})=>l.jsx("table",{className:X("w-full",EYn[n],e),style:r,children:t}),TYn=({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})}),jYn=({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}),IYn=({className:e,children:t,...n})=>l.jsx("tbody",{className:X("",e),...n,children:t}),NYn=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})}),AYn=({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})}),RYn=Dh(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(awt,twe,nwe),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"}}),cu=y.forwardRef(({className:e,size:t,testId:n,variant:r,error:s,...a},i)=>l.jsx("textarea",{className:X(RYn({variant:r,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":n,ref:i,"aria-invalid":s,...a}));cu.displayName="Textarea";const PYn=xyn;function en({open:e,onOpenChange:t,children:n}){return l.jsx(PYn,{open:e,onOpenChange:t,children:n})}const Swt=y.forwardRef(({asChild:e,children:t,...n},r)=>{const s=e&&y.isValidElement(t)?{render:t}:{};return l.jsx(Dyn,{ref:r,...s,...n,children:e?void 0:t})});Swt.displayName="AlertDialogTrigger";const kwt=oct,owe=y.forwardRef(({className:e,...t},n)=>l.jsx(Xlt,{ref:n,className:X("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));owe.displayName="AlertDialogOverlay";const Owt=y.forwardRef(({className:e,...t},n)=>l.jsxs(kwt,{children:[l.jsx(owe,{}),l.jsx(ict,{ref:n,"data-slot":"alert-dialog-content",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})]}));Owt.displayName="AlertDialogContent";const _wt=({className:e,...t})=>l.jsx("div",{className:X("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});_wt.displayName="AlertDialogHeader";const Ewt=({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});Ewt.displayName="AlertDialogFooter";const Cwt=({className:e,...t})=>l.jsx("div",{className:X("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});Cwt.displayName="AlertDialogBody";const Twt=y.forwardRef(({className:e,...t},n)=>l.jsx(lct,{ref:n,className:X("text-ui-md font-medium",e),...t}));Twt.displayName="AlertDialogTitle";const jwt=y.forwardRef(({className:e,...t},n)=>l.jsx(Jlt,{ref:n,className:X("text-ui-sm text-neutral3",e),...t}));jwt.displayName="AlertDialogDescription";const Iwt=y.forwardRef(({className:e,...t},n)=>l.jsx($B,{ref:n,className:X(rwe({variant:"primary",size:"default"}),e),...t}));Iwt.displayName="AlertDialogAction";const Nwt=y.forwardRef(({className:e,...t},n)=>l.jsx($B,{ref:n,className:X(rwe({variant:"default",size:"default"}),e),...t}));Nwt.displayName="AlertDialogCancel";en.Trigger=Swt;en.Portal=kwt;en.Overlay=owe;en.Content=Owt;en.Header=_wt;en.Footer=Ewt;en.Body=Cwt;en.Title=Twt;en.Description=jwt;en.Action=Iwt;en.Cancel=Nwt;const go=y.forwardRef(({className:e,...t},n)=>l.jsx(mye,{ref:n,className:X("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",Rr.all,"hover:border-neutral5 hover:shadow-md",ewe,"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(hct,{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(Lb,{className:"h-3.5 w-3.5 stroke-3"})})}));go.displayName=mye.displayName;const Lm=Gyn,Sh=Ee.forwardRef(({className:e,asChild:t,children:n,...r},s)=>{const a=t&&Ee.isValidElement(n)?{render:n}:{};return l.jsx(Yyn,{ref:s,"data-slot":"collapsible-trigger",className:X("-outline-offset-2",Rr.colors,Xw.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-panel-open]>svg]:rotate-90",e),...a,...r,children:t?void 0:n})});Sh.displayName="CollapsibleTrigger";const kh=Ee.forwardRef(({className:e,children:t,...n},r)=>l.jsx(ebn,{ref:r,"data-slot":"collapsible-content",className:X("overflow-hidden","h-[var(--collapsible-panel-height)] transition-[height] duration-normal ease-out-custom","data-[starting-style]:h-0 data-[ending-style]:h-0"),...n,children:l.jsx("div",{className:e,children:t})}));kh.displayName="CollapsibleContent";const Er={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",Rr.colors),searchIcon:X("mr-2 h-3.5 w-3.5 shrink-0 text-neutral3",Rr.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",Rr.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",Rr.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",Rr.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"},MYn={default:Er.triggerDefault,ghost:Er.triggerGhost,link:Er.triggerLink};function Nc({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:Er.root,children:[l.jsxs(Pct,{items:e,value:m,onValueChange:g,disabled:o,open:d,onOpenChange:f,children:[l.jsxs(Fct,{className:X(Er.trigger,MYn[c],lo[u],h&&Er.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(gbn,{placeholder:r})})]}),l.jsx(f$,{className:Er.chevron})]}),l.jsx(Vct,{container:p,children:l.jsx(Hct,{align:"start",sideOffset:4,className:Er.positioner,children:l.jsxs(Zct,{className:Er.popup,children:[l.jsxs("div",{className:Er.searchContainer,children:[l.jsx(lT,{className:Er.searchIcon}),l.jsx(Lct,{className:Er.searchInput,placeholder:s})]}),l.jsx(Xct,{className:Er.empty,children:a}),l.jsx(Uct,{className:Er.list,children:v=>l.jsxs(Yct,{value:v,className:Er.item,children:[v.start,l.jsxs("span",{className:Er.optionText,children:[l.jsx("span",{className:Er.optionLabel,children:v.label}),v.description&&l.jsx("span",{className:Er.optionDescription,children:v.description})]}),l.jsxs("span",{className:Er.itemRightSlot,children:[v.end?l.jsx("div",{className:Er.optionEnd,children:v.end}):null,l.jsx("span",{className:Er.checkContainer,children:l.jsx(Mbn,{children:l.jsx(Lb,{className:Er.checkIcon})})})]})]},v.value)})]})})})]}),h&&l.jsx("span",{className:Er.error,children:h})]})}function Awt({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:Er.root,children:[l.jsxs(Pct,{multiple:!0,items:e,value:h,onValueChange:m,disabled:o,open:u,onOpenChange:d,children:[l.jsxs(Fct,{className:X(Er.trigger,lo[c],p&&Er.triggerError,i),children:[l.jsx("span",{className:X("truncate",h.length===0&&Er.placeholder),children:g}),l.jsx(f$,{className:Er.chevron})]}),l.jsx(Vct,{container:f,children:l.jsx(Hct,{align:"start",sideOffset:4,className:Er.positioner,children:l.jsxs(Zct,{className:Er.popup,children:[l.jsxs("div",{className:Er.searchContainer,children:[l.jsx(lT,{className:Er.searchIcon}),l.jsx(Lct,{className:Er.searchInput,placeholder:s})]}),l.jsx(Xct,{className:Er.empty,children:a}),l.jsx(Uct,{className:Er.list,children:v=>{const b=t.includes(v.value);return l.jsxs(Yct,{value:v,className:Er.itemMulti,children:[l.jsx("span",{className:X(Er.checkbox,b?Er.checkboxSelected:Er.checkboxUnselected),children:b&&l.jsx(Lb,{className:Er.checkboxIcon})}),l.jsxs("span",{className:Er.optionContent,children:[v.start,l.jsxs("span",{className:Er.optionText,children:[l.jsx("span",{className:Er.optionLabel,children:v.label}),v.description&&l.jsx("span",{className:Er.optionDescription,children:v.description})]}),v.end?l.jsx("div",{className:Er.optionEnd,children:v.end}):null]})]},v.value)}})]})})})]}),p&&l.jsx("span",{className:Er.error,children:p})]})}const Dr=x0n,lwe=y.forwardRef(({asChild:e,children:t,...n},r)=>{const s=e&&y.isValidElement(t)?{render:t}:{};return l.jsx(uct,{ref:r,...s,...n,children:e?void 0:t})});lwe.displayName="DialogTrigger";const $Yn=oct,Rwt=y.forwardRef(({asChild:e,children:t,...n},r)=>{const s=e&&y.isValidElement(t)?{render:t}:{};return l.jsx($B,{ref:r,...s,...n,children:e?void 0:t})});Rwt.displayName="DialogClose";const Pwt=y.forwardRef(({className:e,...t},n)=>l.jsx(Xlt,{ref:n,className:X("dialog-overlay-anim fixed inset-0 z-50 bg-overlay backdrop-blur-xs",e),...t}));Pwt.displayName="DialogOverlay";const Nr=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs($Yn,{children:[l.jsx(Pwt,{}),l.jsxs(ict,{ref:r,"data-slot":"dialog-content",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","focus-visible:outline-hidden",e),...n,children:[t,l.jsx($B,{render:l.jsx(he,{variant:"ghost",size:"sm",className:"absolute top-3 right-3","aria-label":"Close",children:l.jsx(Hd,{})})})]})]}));Nr.displayName="DialogContent";const Lr=({className:e,...t})=>l.jsx("div",{className:X("flex flex-col gap-0.5 px-4 py-3 text-left",e),...t});Lr.displayName="DialogHeader";const lp=({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});lp.displayName="DialogFooter";const ts=({className:e,...t})=>l.jsx("div",{className:X("overflow-y-auto px-4 py-3.5 max-h-[50vh]",e),...t});ts.displayName="DialogBody";const Ar=y.forwardRef(({className:e,...t},n)=>l.jsx(lct,{ref:n,className:X("text-ui-md font-medium",e),...t}));Ar.displayName="DialogTitle";const ga=y.forwardRef(({className:e,...t},n)=>l.jsx(Jlt,{ref:n,className:X("sr-only",e),...t}));ga.displayName="DialogDescription";const Mwt=y.forwardRef(({className:e,...t},n)=>l.jsx(Jd,{ref:n,className:X("flex h-full w-full flex-col overflow-hidden rounded-xl bg-surface3 text-neutral4",e),...t}));Mwt.displayName=Jd.displayName;const DYn=({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(Dr,{...r,children:l.jsxs(Nr,{className:"overflow-hidden p-0",children:[l.jsx(Ar,{className:"sr-only",children:t}),l.jsx(ga,{className:"sr-only",children:n}),l.jsx(Mwt,{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})]})})},$wt=y.forwardRef(({className:e,...t},n)=>l.jsxs("div",{className:X("flex items-center border-b border-border1 px-3",Rr.colors),"cmdk-input-wrapper":"",children:[l.jsx(lT,{className:X("mr-2 h-4 w-4 shrink-0 text-neutral3",Rr.colors)}),l.jsx(Jd.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",Rr.colors,e),...t})]}));$wt.displayName=Jd.Input.displayName;const Dwt=y.forwardRef(({className:e,...t},n)=>l.jsx(Jd.List,{ref:n,className:X("max-h-dropdown-max-height overflow-y-auto overflow-x-hidden",e),...t}));Dwt.displayName=Jd.List.displayName;const Lwt=y.forwardRef((e,t)=>l.jsx(Jd.Empty,{ref:t,className:"py-6 text-center text-ui-smd text-neutral3",...e}));Lwt.displayName=Jd.Empty.displayName;const Yx=y.forwardRef(({className:e,...t},n)=>l.jsx(Jd.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}));Yx.displayName=Jd.Group.displayName;const rS=y.forwardRef(({className:e,...t},n)=>l.jsx(Jd.Separator,{ref:n,className:X("-mx-1 h-px bg-border1",e),...t}));rS.displayName=Jd.Separator.displayName;const Tl=y.forwardRef(({className:e,...t},n)=>l.jsx(Jd.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",Rr.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}));Tl.displayName=Jd.Item.displayName;const zwt=({className:e,...t})=>l.jsx("span",{className:X("ml-auto text-ui-xs tabular-nums tracking-wider text-neutral3",e),...t});zwt.displayName="CommandShortcut";const fi=W0n,pi=G0n,Ka=y.forwardRef(({className:e,children:t,size:n="default",...r},s)=>l.jsxs(odt,{ref:s,className:X("inline-flex w-full cursor-pointer select-none items-center justify-between gap-1.5 whitespace-nowrap",lo[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(Q0n,{asChild:!0,children:l.jsx(nye,{className:X("h-4 w-4 shrink-0 text-neutral3 opacity-70",Rr.colors)})})]}));Ka.displayName=odt.displayName;const Ja=y.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>l.jsx(Y0n,{children:l.jsx(ldt,{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(X0n,{className:X("p-1",n==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t})})}));Ja.displayName=ldt.displayName;const os=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(cdt,{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",Rr.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(J0n,{children:l.jsx(Lb,{className:"h-4 w-4 text-neutral6"})})}),l.jsx(K0n,{children:t})]}));os.displayName=cdt.displayName;const Eu=({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}),LYn=Dh("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"}}),Cu=({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(ywn,{"data-variant":s,className:X("group/tabs-list",LYn({variant:s}),t),children:[e,s==="line"&&l.jsx(B2e,{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(B2e,{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",Rr.colors,Xw.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",Rr.colors,"hover:text-neutral5"),"aria-label":"Close tab",children:l.jsx(Hd,{className:"w-3 h-3"})})]}),Os=({children:e,value:t,className:n})=>l.jsx(fwn,{value:t,className:X("grid py-3 overflow-y-auto ring-offset-background",Xw.visible,n),children:e});function zYn({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(Eu,{defaultTab:t[0].value,value:h,onValueChange:r??(()=>{}),children:l.jsx(Cu,{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(fi,{value:h,onValueChange:r,children:[l.jsx(Ka,{size:"sm",variant:"ghost",children:l.jsx(pi,{})}),l.jsx(Ja,{children:t.map(m=>l.jsx(os,{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(FYn,{code:e,lang:i}),l.jsx(ua,{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",Rr.opacity)})]})]})}function FYn({code:e,lang:t}){const[n,r]=y.useState(null);y.useEffect(()=>{if(!t){r(null);return}r(null);let a=!1;return pwt(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&&`
|
|
283
283
|
`]},i))})})}function Fwt({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 BYn=Tdt,UYn=Own,qYn=Dye,VYn=Dwn,HYn=Iwn,cwe=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:cursor-not-allowed data-disabled:opacity-50 data-disabled:hover:bg-transparent data-disabled:hover:text-neutral4 data-disabled:focus:bg-transparent data-disabled:focus:text-neutral4 data-disabled:data-[highlighted]:bg-transparent data-disabled:data-[highlighted]:text-neutral4 [&>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"),Bwt=X("bg-surface3 text-neutral4 z-50 min-w-44 max-h-[min(20rem,var(--available-height))] overflow-x-hidden overflow-y-auto rounded-xl border border-border1 p-1 shadow-dialog origin-[var(--transform-origin)] outline-none","data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[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"),Uwt=y.forwardRef(({className:e,asChild:t,children:n,...r},s)=>{const a=t&&y.isValidElement(n)?{render:n}:{};return l.jsx(Fwn,{ref:s,className:X("cursor-pointer outline-none",e),...a,...r,children:t?void 0:n})});Uwt.displayName="DropdownMenuTrigger";const qwt=y.forwardRef(({className:e,inset:t,children:n,...r},s)=>l.jsxs(qwn,{ref:s,className:X(cwe,"data-[popup-open]:bg-surface4 data-[popup-open]:text-neutral6",t&&"pl-8",e),...r,children:[n,l.jsx("span",{className:"ml-auto pl-2",children:l.jsx(nye,{className:"-rotate-90 opacity-50"})})]}));qwt.displayName="DropdownMenuSubTrigger";const Vwt=y.forwardRef(({className:e,align:t="start",alignOffset:n=-4,side:r="right",sideOffset:s=0,...a},i)=>l.jsx(Dye,{children:l.jsx(Sdt,{align:t,alignOffset:n,side:r,sideOffset:s,className:"z-50 outline-none",children:l.jsx(xdt,{ref:i,"data-slot":"dropdown-menu-sub-content",className:X(Bwt,e),...a})})}));Vwt.displayName="DropdownMenuSubContent";const Hwt=y.forwardRef(({className:e,container:t,align:n="start",alignOffset:r=0,side:s="bottom",sideOffset:a=8,...i},o)=>l.jsx(Dye,{container:t,children:l.jsx(Sdt,{align:n,alignOffset:r,side:s,sideOffset:a,className:"z-50 outline-none",children:l.jsx(xdt,{ref:o,"data-slot":"dropdown-menu-content",className:X(Bwt,e),...i})})}));Hwt.displayName="DropdownMenuContent";const Zwt=y.forwardRef(({className:e,inset:t,variant:n="default",onSelect:r,onClick:s,...a},i)=>l.jsx(_wn,{ref:i,"data-inset":t?"":void 0,"data-variant":n,onClick:o=>{s?.(o),r?.(o)},className:X(cwe,t&&"pl-8","data-[variant=destructive]:text-accent2 data-[variant=destructive]:hover:bg-accent2/10 data-[variant=destructive]:hover:text-accent2 data-[variant=destructive]:data-[highlighted]:bg-accent2/10 data-[variant=destructive]:data-[highlighted]:text-accent2",e),...a}));Zwt.displayName="DropdownMenuItem";const Wwt=y.forwardRef(({className:e,children:t,checked:n,...r},s)=>l.jsxs(Swn,{ref:s,className:X(cwe,"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:l.jsx(kwn,{children:l.jsx(Lb,{})})}),t]}));Wwt.displayName="DropdownMenuCheckboxItem";const Gwt=y.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Awn,{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:cursor-not-allowed data-disabled:opacity-50 data-disabled:hover:bg-transparent data-disabled:hover:text-neutral4 data-disabled:focus:bg-transparent data-disabled:focus:text-neutral4 data-disabled:data-[highlighted]:bg-transparent data-disabled:data-[highlighted]:text-neutral4 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(Rwn,{children:l.jsx(Ult,{className:"h-2 w-2 fill-current"})})}),t]}));Gwt.displayName="DropdownMenuRadioItem";const Qwt=y.forwardRef(({className:e,inset:t,...n},r)=>l.jsx("div",{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}));Qwt.displayName="DropdownMenuLabel";const Ywt=y.forwardRef(({className:e,...t},n)=>l.jsx(Dbn,{ref:n,className:X("bg-border1 -mx-1 my-1 h-px",e),...t}));Ywt.displayName="DropdownMenuSeparator";const Xwt=({className:e,...t})=>l.jsx("span",{className:X("ml-auto text-xs tracking-widest opacity-60",e),...t});Xwt.displayName="DropdownMenuShortcut";function Ot({open:e,defaultOpen:t,onOpenChange:n,children:r,modal:s}){return l.jsx(BYn,{modal:s,open:e,defaultOpen:t,onOpenChange:n,children:r})}Ot.Trigger=Uwt;Ot.Content=Hwt;Ot.Group=UYn;Ot.Portal=qYn;Ot.Item=Zwt;Ot.CheckboxItem=Wwt;Ot.RadioItem=Gwt;Ot.Label=Qwt;Ot.Separator=Ywt;Ot.Shortcut=Xwt;Ot.Sub=VYn;Ot.SubContent=Vwt;Ot.SubTrigger=qwt;Ot.RadioGroup=HYn;const r5=({label:e,children:t})=>l.jsxs("div",{className:"space-y-2",children:[l.jsx(be,{as:"p",variant:"ui-md",className:"text-neutral3",children:e}),t]});function ns({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 Kwt=({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(Ve,{size:"lg",children:e})}),n?l.jsx(ns,{className:"h-3 w-32"}):l.jsx(be,{variant:"header-md",as:"h2",className:"truncate font-medium",children:t})]}),r]})});function ZYn({children:e,className:t}){return l.jsx("div",{className:X("grid gap-2 text-neutral4",t),children:e})}function WYn({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(p$,{})," ",e]})}function GYn({children:e}){return l.jsx("p",{className:"text-neutral3 text-ui-sm",children:e})}function QYn({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 YYn({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:YYn,Column:ZYn,Label:QYn,HelpText:GYn,ErrorMsg:WYn});function XYn({children:e,className:t}){return l.jsx("div",{className:X("grid gap-6 content-start",t),children:e})}function KYn({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(KYn,{Column:XYn});const JYn=Dh(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(awt,twe,nwe),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${lo.sm} text-ui-sm px-[.75em]`,md:`${lo.md} text-ui-md px-[.75em]`,default:`${lo.default} text-ui-md px-[.85em]`,lg:`${lo.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),On=y.forwardRef(({className:e,size:t,testId:n,variant:r,type:s,error:a,...i},o)=>l.jsx("input",{type:s,className:X(JYn({variant:r,size:t}),a&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":n,ref:o,"aria-invalid":a,...i}));On.displayName="Input";function qk({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(sp,{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(On,{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 fw({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(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx(he,{size:h||"sm","aria-label":i||"Search",disabled:s,onClick:()=>g?.(!1),children:l.jsx(lT,{})})}),l.jsx(er,{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(sp,{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(On,{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(lT,{"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(he,{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(Hd,{})})]}),t&&l.jsx(Qo.HelpText,{children:t}),n&&l.jsx(Qo.ErrorMsg,{children:n})]})]})}function Ic({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(sp,{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(fi,{"aria-label":c?o:void 0,name:e,value:i,onValueChange:h,disabled:s,children:[l.jsx(Ka,{size:a,children:l.jsx(pi,{placeholder:p})}),l.jsx(Ja,{children:f.map(g=>l.jsx(os,{value:g.value,children:g.label},g.value))})]}),t&&l.jsx(Qo.HelpText,{children:t}),n&&l.jsx(Qo.ErrorMsg,{children:n})]})]})}const uwe=y.createContext("md"),eXn=X("group/input-group relative flex w-full min-w-0 items-stretch","bg-surface2 border border-border1 text-neutral6","hover:border-border2",swt,rwt,Rr.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"),tXn=y.forwardRef(({className:e,size:t="md",...n},r)=>l.jsx(uwe.Provider,{value:t,children:l.jsx("div",{ref:r,role:"group","data-slot":"input-group",className:X(eXn,e),...n})}));tXn.displayName="InputGroup";const nXn=Dh(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"}}),rXn=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(nXn({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}));rXn.displayName="InputGroupAddon";const Jwt={sm:"text-ui-sm",md:"text-ui-md",default:"text-ui-md",lg:"text-ui-lg"},sXn=y.forwardRef(({className:e,testId:t,error:n,type:r="text",...s},a)=>{const i=y.useContext(uwe);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",lo[i],Jwt[i],"placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70","disabled:cursor-not-allowed",e),...s})});sXn.displayName="InputGroupInput";const aXn=y.forwardRef(({className:e,testId:t,error:n,...r},s)=>{const a=y.useContext(uwe);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",Jwt[a],"placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70","disabled:cursor-not-allowed",e),...r})});aXn.displayName="InputGroupTextarea";const iXn=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}));iXn.displayName="InputGroupText";const oXn=y.forwardRef(({size:e="icon-sm",variant:t="ghost",type:n="button",...r},s)=>l.jsx(he,{ref:s,type:n,size:e,variant:t,...r}));oXn.displayName="InputGroupButton";const lXn=Dh("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),It=y.forwardRef(({className:e,...t},n)=>l.jsx(Adt,{ref:n,className:X(lXn(),e),...t}));It.displayName=Adt.displayName;function ET({children:e}){const t=e.replace(/\\n/g,`
|
|
284
284
|
`);return l.jsx(sft,{remarkPlugins:[Tft],components:uXn,className:"space-y-3",children:t})}const e1t=Ee.memo(({children:e,language:t,...n})=>{const[r,s]=y.useState([]);return y.useEffect(()=>{pwt(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&&`
|
|
285
285
|
`]}))})}):l.jsx("pre",{...n,children:e})});e1t.displayName="HighlightedCode";const cXn=({children:e,className:t,language:n,...r})=>{const s=typeof e=="string"?e:xfe(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(e1t,{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(ua,{content:s,copyMessage:"Copied code to clipboard"})})]})};function xfe(e){if(typeof e=="string")return e;if(e?.props?.children){let t=e.props.children;return Array.isArray(t)?t.map(n=>xfe(n)).join(""):xfe(t)}return""}const uXn={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(cXn,{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 dXn({children:e,className:t}){return l.jsx("div",{className:X("flex items-center gap-1 shrink-0",t),children:e})}function fXn({children:e,className:t}){return l.jsx("div",{className:X("overflow-x-auto ",t),children:e})}function t1t({children:e,className:t}){return l.jsx("p",{className:X("text-ui-md text-neutral2 leading-tight mt-0.5",t),children:e})}function pXn({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 hXn={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};function tn({color:e,className:t,size:n="md"}){return l.jsx("svg",{className:X("animate-spin",hXn[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 mXn({className:e}){return l.jsx("div",{className:X("flex items-center justify-center",e),children:l.jsx(tn,{size:"md",color:Vy.neutral1})})}function gXn({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 i6e({children:e,className:t}){return l.jsx(Fwt,{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 vXn({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 n1t({children:e,className:t,as:n="h2"}){return l.jsx(n,{className:X("text-ui-md font-normal text-neutral4",t),children:e})}function yXn(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(n1t,{as:r,children:t}),n&&l.jsx(t1t,{children:n})]})}function bXn({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 xXn({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(jvn,{}):l.jsx(Cvn,{})}),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 wXn({message:e="Failed to load data",className:t}){return l.jsx("span",{className:X("text-ui-sm text-accent2",t),children:e})}function SXn({children:e,className:t}){return l.jsx("span",{className:X("text-ui-md text-neutral3 leading-relaxed",t),children:e})}function kXn({className:e}){return l.jsx("span",{className:X("text-sm",e),children:l.jsx(tn,{size:"md",color:Vy.neutral1})})}function OXn({message:e="No previous value to compare",className:t}){return l.jsx("span",{className:X("text-sm text-neutral1",t),children:e})}function _Xn({message:e="No data yet",className:t}){return l.jsx("span",{className:X("text-sm text-neutral1",t),children:e})}function EXn({children:e,className:t}){return l.jsx(Fwt,{className:X("flex-1 min-w-72",t),children:l.jsx("div",{className:"grid gap-1",children:e})})}function CXn({children:e,className:t}){return l.jsx("strong",{className:X("text-header-lg text-neutral4 font-semibold",t),children:e})}const Ur=Object.assign(EXn,{Label:SXn,Value:CXn,Change:xXn,NoChange:OXn,NoData:_Xn,Error:wXn,Loading:kXn}),Xt=Object.assign(i6e,{Root:i6e,Kpi:Ur,TopBar:bXn,Actions:dXn,TitleAndDescription:yXn,Title:n1t,Description:t1t,Summary:vXn,Loading:mXn,Error:pXn,Content:fXn,NoData:gXn});function wfe({children:e,className:t}){return l.jsx("div",{className:X("flex flex-wrap gap-8",t),children:e})}const Lh=EEn,nf=y.forwardRef(({asChild:e,children:t,...n},r)=>{const s=e&&y.isValidElement(t)?{render:t}:{};return l.jsx(jEn,{ref:r,...s,...n,children:e?void 0:t})});nf.displayName="PopoverTrigger";const rf=y.forwardRef(({className:e,align:t="center",alignOffset:n=0,side:r="bottom",sideOffset:s=4,...a},i)=>{const o=typeof e=="string"?e:void 0;return l.jsx(NEn,{children:l.jsx(REn,{align:t,alignOffset:n,side:r,sideOffset:s,className:"z-50 outline-none",children:l.jsx(LEn,{ref:i,"data-slot":"popover-content",className:X("z-50 w-72 rounded-xl border border-border1 bg-surface3 text-neutral5 shadow-dialog focus-visible:outline-hidden origin-[var(--transform-origin)]","data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[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",o&&/\bp[trblxy]?-\S+/.test(o)?!1:"py-3.5 px-3",e),...a})})})});rf.displayName="PopoverContent";function r1t({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(Lh,{open:n,onOpenChange:r,...t,children:l.jsx("span",{onMouseEnter:a,onMouseLeave:i,onFocusCapture:a,onBlurCapture:i,style:{display:"contents"},children:e})})}function dwe({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(he,{disabled:e,size:"md",onClick:()=>t(),children:[l.jsx(Hd,{}),"Clear"]}),a&&l.jsxs(Ot,{children:[l.jsx(Ot.Trigger,{asChild:!0,children:l.jsx(he,{disabled:e,size:"md","aria-label":"More filter actions",children:l.jsx(bgn,{})})}),l.jsxs(Ot.Content,{align:"end",children:[n&&l.jsxs(Ot.Item,{onSelect:()=>n(),children:[l.jsx(Hd,{}),"Remove all filters"]}),n&&(r||s)&&l.jsx(Ot.Separator,{}),r&&l.jsxs(Ot.Item,{onSelect:()=>r(),children:[l.jsx(Hlt,{}),"Save filters for next time"]}),s&&l.jsxs(Ot.Item,{onSelect:()=>s(),children:[l.jsx(Zlt,{}),"Remove saved filters"]})]})]})]})}const s1t=y.createContext("horizontal"),TXn=Dh(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"}}),jr=y.forwardRef(({children:e,className:t,orientation:n="horizontal",spacing:r="default",...s},a)=>l.jsx(s1t.Provider,{value:n,children:l.jsx("div",{ref:a,role:"group","data-slot":"buttons-group","data-orientation":n,className:X(TXn({orientation:n,spacing:r}),t),...s,children:e})}));jr.displayName="ButtonsGroup";const jXn=y.forwardRef(({className:e,orientation:t,...n},r)=>{const s=y.useContext(s1t),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})});jXn.displayName="ButtonsGroupSeparator";const IXn=Dh(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:`${lo.sm} text-ui-sm`,md:`${lo.md} text-ui-md`,default:`${lo.default} text-ui-md`,lg:`${lo.lg} text-ui-lg`}},defaultVariants:{size:"default"}}),oh=y.forwardRef(({className:e,size:t="default",...n},r)=>l.jsx("div",{ref:r,"data-slot":"buttons-group-text",className:X(IXn({size:t}),e),...n}));oh.displayName="ButtonsGroupText";const rI=y.forwardRef(({className:e,...t},n)=>l.jsx(Yft,{className:X("grid gap-2",e),...t,ref:n}));rI.displayName=Yft.displayName;const Ku=y.forwardRef(({className:e,...t},n)=>l.jsx(Xft,{ref:n,className:X("aspect-square h-4 w-4 rounded-full border border-neutral3 text-neutral6","shadow-sm",Rr.all,"hover:border-neutral5 hover:shadow-md",ewe,"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(iCn,{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(Ult,{className:"h-2 w-2 fill-accent1 text-accent1"})})}));Ku.displayName=Xft.displayName;function a1t({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(On,{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(tn,{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(go,{"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(rI,{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(Ku,{"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(Ku,{"data-pick-multi-item":"",value:"Any",className:"shrink-0"}),l.jsx("span",{className:"truncate min-w-0 flex-1",children:"Any"})]})]})]})}function fwe(e){return Array.isArray(e)?e.length===0?"Any":e.join(", "):e}const NXn="This filter is set by the current context and cannot be removed here.";function AXn(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:fwe(t)}function RXn({field:e,value:t,tooltipContent:n}){const r=AXn(e,t),s=`${e.label} filter is locked by context`;return l.jsx(ud,{delayDuration:150,children:l.jsxs(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsxs(jr,{spacing:"close","data-locked-field-id":e.id,"data-property-filter-pill":"locked",tabIndex:0,"aria-label":s,children:[l.jsx(oh,{size:"md",children:e.label}),l.jsx(oh,{size:"md",children:"is"}),l.jsx(oh,{size:"md",children:r}),l.jsx(oh,{size:"md",children:l.jsx(svn,{})})]})}),l.jsx(er,{children:n})]})})}function PXn({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(jr,{spacing:"close",children:[l.jsx(oh,{size:"md",children:e.label}),l.jsx(oh,{size:"md",children:"is"}),l.jsx(On,{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(he,{type:"button",disabled:s,"aria-label":`Remove ${e.label} filter`,size:"md",onMouseDown:u=>u.preventDefault(),onClick:r,children:l.jsx(Hd,{})})]})}function MXn({field:e,token:t,tokens:n,onChange:r,onRemove:s,disabled:a}){const[i,o]=y.useState(!1);return l.jsxs(jr,{spacing:"close",children:[l.jsx(oh,{size:"md",children:e.label}),l.jsx(oh,{size:"md",children:"is"}),l.jsxs(Lh,{open:i,onOpenChange:o,children:[l.jsx(nf,{asChild:!0,children:l.jsx(he,{type:"button",disabled:a,size:"md",children:fwe(t.value)})}),l.jsx(rf,{align:"start",sideOffset:8,className:"w-64 p-2","data-pick-multi-panel":!0,children:l.jsx(a1t,{field:e,tokens:n,onChange:r})})]}),l.jsx(he,{type:"button",disabled:a,"aria-label":`Remove ${e.label} filter`,size:"md",onClick:s,children:l.jsx(Hd,{})})]})}function pwe({fields:e,tokens:t,onTokensChange:n,disabled:r,autoFocusFieldId:s,lockedFieldIds:a,lockedTooltipContent:i=NXn}){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(RXn,{field:p,value:d.value,tooltipContent:i},`${d.fieldId}-${f}`):p.kind==="text"&&typeof d.value=="string"?l.jsx(PXn,{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(MXn,{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(jr,{spacing:"close",children:[l.jsx(oh,{size:"md",children:p.label}),l.jsx(oh,{size:"md",children:"is"}),l.jsx(oh,{size:"md",children:fwe(d.value)}),l.jsx(he,{type:"button",disabled:r,size:"md","aria-label":`Remove ${p.label} filter`,onClick:()=>u(f),children:l.jsx(Hd,{})})]},`${d.fieldId}-${f}`):null})})}function hwe({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,O]=y.useState(),E=y.useRef(null),_=y.useRef(!1),C=y.useCallback(M=>{O(L=>L===M?void 0:M)},[]),j=y.useCallback(()=>O(void 0),[]);y.useEffect(()=>{u||O(void 0)},[u]);const I=y.useMemo(()=>c.find(M=>M.id===f),[c,f]),N=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&&I?.kind==="text"&&E.current?.focus()},[u,I]);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 U=[...t];U[F]={fieldId:M,value:L},n(U)},[n,t]),B=y.useCallback(()=>{if(!I){S("Choose a property first.");return}if(N.has(I.id)){S(`Remove the existing ${I.label} filter before adding another.`);return}if(I.kind==="text"&&!h.trim()){S(`Enter a value for ${I.label}.`);return}if(I.kind==="multi-select"&&g.length===0){S(`Choose at least one ${I.label.toLowerCase()} value.`);return}const M=I.kind==="multi-select"?{fieldId:I.id,value:g}:{fieldId:I.id,value:h.trim()};n([...t,M]),d(!1)},[g,n,I,N,h,t]);return l.jsxs(Lh,{open:u,onOpenChange:d,children:[l.jsx(nf,{asChild:!0,children:l.jsxs(he,{variant:"outline",size:a,disabled:s,children:[l.jsx(Xgn,{}),r]})}),l.jsx(rf,{align:"end",className:"p-3 w-64",initialFocus:!1,finalFocus:()=>_.current?(_.current=!1,!1):!0,children:l.jsxs("div",{className:"grid gap-3",children:[I&&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(Nj,{className:"h-4 w-4"})}),l.jsx($gn,{className:"h-4 w-4 shrink-0 text-neutral3"}),l.jsx("span",{className:"text-ui-sm text-neutral3",children:`${I.label} · is`})]}),!I&&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 U;M.key==="Home"?U=0:M.key==="End"?U=L.length-1:M.key==="ArrowDown"?U=z<0?0:(z+1)%L.length:U=z<=0?L.length-1:z-1,L[U]?.focus()},children:c.length>0?c.map(M=>{const L=N.has(M.id);return M.kind==="pick-multi"?l.jsx($Xn,{field:M,tokens:t,onChange:P,open:w===M.id,onToggle:C,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),_.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(lye,{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."})}),I&&I.kind==="text"&&l.jsx(On,{ref:E,size:"md",value:h,onChange:M=>{m(M.target.value),S(void 0)},placeholder:I.placeholder??`Enter ${I.label}`,onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),B())}}),I&&I.kind==="multi-select"&&l.jsx(Awt,{options:I.options??[],value:g,onValueChange:M=>{v(M),S(void 0)},placeholder:I.placeholder??`Choose ${I.label}`,searchPlaceholder:`Search ${I.label.toLowerCase()}...`,emptyText:I.emptyText??"No option found.",size:"md"}),b&&l.jsx("div",{className:"text-ui-sm text-red-500",children:b}),I&&I.kind!=="pick-multi"&&l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(he,{variant:"ghost",size:"md",onClick:()=>d(!1),children:"Cancel"}),l.jsx(he,{variant:"outline",size:"md",onClick:B,children:"Add filter"})]})]})})]})}function $Xn({field:e,tokens:t,onChange:n,open:r,onToggle:s,onClose:a}){const i=y.useRef(null);return l.jsxs(Lh,{open:r,onOpenChange:o=>{o?s(e.id):a()},children:[l.jsx(nf,{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(xk,{className:"h-4 w-4 text-neutral3 shrink-0"}),l.jsx("span",{className:"truncate",children:e.label}),!r&&l.jsx(xk,{className:"h-4 w-4 ml-auto text-neutral3 shrink-0"})]})}),l.jsx(rf,{ref:i,side:"right",align:"start",sideOffset:8,className:"w-64 p-2",initialFocus:!1,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(a1t,{field:e,tokens:t,onChange:n})})]})}const DXn=8,i1t=(e,{enabled:t=!0})=>{const n=y.useRef(t),r=y.useRef(null),s=y.useRef(!1),a=y.useRef(null);Ee.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-DXn){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 LXn(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 zXn(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 $s=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);i1t(d,{enabled:s});const p=LXn(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(dCn,{ref:u,className:X("relative overflow-hidden",e),...c,children:[l.jsx(mCn,{ref:d,className:X("h-full w-full rounded-[inherit]",zXn(p),n),style:h,children:l.jsx(xCn,{style:m,children:t})}),(a==="vertical"||a==="both")&&l.jsx(Sfe,{orientation:"vertical"}),(a==="horizontal"||a==="both")&&l.jsx(Sfe,{orientation:"horizontal"}),a==="both"&&l.jsx(SCn,{})]})});$s.displayName="ScrollArea";const Sfe=y.forwardRef(({className:e,orientation:t="vertical",...n},r)=>l.jsx(bCn,{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(wCn,{className:"relative flex-1 rounded-full bg-neutral4/30 hover:bg-neutral4/60 transition-colors duration-normal"})}));Sfe.displayName="ScrollBar";const o6e={sm:lo.sm,md:lo.md,lg:lo.lg,default:lo.default},Lg=({onSearch:e,label:t,placeholder:n,debounceMs:r=300,size:s="md"})=>{const a=y.useId(),i=y.useRef(null),o=$j(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",swt,rwt,Rr.all,"hover:border-neutral2",o6e[s]),children:[l.jsx(lT,{className:X("text-neutral3 h-4 w-4",Rr.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",o6e[s]),name:a,ref:i,onChange:c})]})]})},FXn=({children:e})=>l.jsx("div",{className:"px-3 py-2.5 border-b border-border1",children:e});function l6e(e){return typeof e=="number"?[e]:[...e]}const kfe=({className:e,defaultValue:t,value:n,min:r=0,max:s=100,onValueChange:a,onValueCommitted:i,...o})=>{const c=Array.isArray(n)?n:Array.isArray(t)?t:[r];return l.jsx(TCn,{className:X("w-full",e),defaultValue:t,value:n,min:r,max:s,thumbAlignment:"edge",onValueChange:a?(u,d)=>a(l6e(u),d):void 0,onValueCommitted:i?(u,d)=>i(l6e(u),d):void 0,...o,children:l.jsxs(RCn,{className:X("relative flex w-full touch-none items-center select-none group cursor-pointer","data-[orientation=horizontal]:py-3","data-[orientation=vertical]:px-3 data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col","data-[disabled]:opacity-50 data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed"),children:[l.jsx(PCn,{className:X("relative grow overflow-hidden rounded-full bg-neutral6/20 select-none","data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full","data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:l.jsx(UCn,{className:X("bg-neutral6 select-none","data-[orientation=horizontal]:h-full","data-[orientation=vertical]:w-full")})}),c.map((u,d)=>l.jsx(zCn,{index:d,className:X("relative block w-2.5 h-5 shrink-0 rounded-full bg-neutral2 border-2 border-neutral6 outline-hidden select-none",'after:absolute after:-inset-2 after:content-[""]',"transition-shadow duration-normal","hover:ring-2 hover:ring-neutral6/30","has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-neutral6/60","data-[orientation=vertical]:w-5 data-[orientation=vertical]:h-2.5","data-[disabled]:pointer-events-none")},d))]})})},Ac=y.forwardRef(({className:e,...t},n)=>l.jsx(mpt,{className:X("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent",Rr.all,ewe,"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(WCn,{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")})}));Ac.displayName=mpt.displayName;function o1t({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(be,{as:i,className:a,...o,children:c});const f=l.jsxs(be,{as:"span",className:"cursor-default",variant:o.variant,font:o.font,children:[u,"..."]});return l.jsxs(be,{as:i,className:X("group inline-flex items-center gap-1",a),...o,children:[s?l.jsxs(rr,{children:[l.jsx(Jn,{asChild:!0,children:f}),l.jsx(er,{children:c})]}):f,r&&l.jsx(ua,{content:c,className:"opacity-0 group-hover:opacity-100 transition-opacity"})]})}const l1t=y.createContext(void 0);function mwe(){return y.useContext(l1t)}function pr({children:e,className:t,style:n}){const r=c1t("MainContentLayout"),s=mwe();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 Oh({children:e,className:t,isCentered:n=!1,isDivided:r=!1,hasLeftServiceColumn:s=!1,style:a}){const i=c1t("MainContentContent"),o=gwe({isCentered:n,isDivided:r,hasLeftServiceColumn:s,className:t});return l.jsx("div",{className:o,style:{...a,...i?{border:"3px dotted orange"}:{}},children:e})}const gwe=({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 c1t(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 BXn({children:e,className:t}){return l.jsx("div",{className:X("grid content-start",t),children:e})}function UXn({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 qXn({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 VXn({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 Xn=Object.assign(qXn,{Title:VXn,Description:UXn,Column:BXn});function pw({children:e,className:t}){return l.jsx("div",{className:X("grid gap-12",t),children:e})}function Ofe({className:e,classNames:t,showOutsideDays:n=!0,...r}){return l.jsx(TNn,{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 KX=["12","1","2","3","4","5","6","7","8","9","10","11"],s5=["00","15","30","45","59"],a5=["AM","PM"];function c6e({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(`${KX[+p]}:${a} ${o}`.trim())},d=p=>{i(s5[+p]),t(`${r}:${s5[+p]} ${o}`.trim())},f=p=>{c(a5[+p]),t(`${r}:${a} ${a5[+p]}`.trim())};return l.jsxs("div",{className:X("flex gap-2 items-center",n),children:[l.jsxs(fi,{name:"hour",value:KX.indexOf(r).toString(),onValueChange:u,children:[l.jsx(Ka,{size:"sm",children:l.jsx(pi,{placeholder:"Select..."})}),l.jsx(Ja,{children:KX.map((p,h)=>l.jsx(os,{value:`${h}`,children:p},p))})]}),":",l.jsxs(fi,{name:"minute",value:s5.indexOf(a).toString(),onValueChange:d,children:[l.jsx(Ka,{size:"sm",children:l.jsx(pi,{placeholder:"Select..."})}),l.jsx(Ja,{children:s5.map((p,h)=>l.jsx(os,{value:`${h}`,children:p},p))})]}),l.jsxs(fi,{name:"period",value:a5.indexOf(o).toString(),onValueChange:f,children:[l.jsx(Ka,{size:"sm",children:l.jsx(pi,{placeholder:"Select..."})}),l.jsx(Ja,{children:a5.map((p,h)=>l.jsx(os,{value:`${h}`,children:p},p))})]})]})}y.forwardRef(({value:e,placeholder:t,className:n,...r},s)=>l.jsxs(he,{ref:s,className:X("justify-start",n),...r,children:[l.jsx(Cue,{className:"h-4 w-4"}),e?l.jsx("span",{className:"text-white",children:En(e,"PP p")}):l.jsx("span",{className:"text-gray",children:t??"Pick a date"})]}));function u1t({children:e}){return l.jsx("ul",{className:"grid bg-surface3 overflow-y-auto",children:e})}function d1t(e){return!e||e.length===0?"":e?.map(t=>t.size).join(" ")}function f1t({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",Rr.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",Rr.colors,Xw.visible,{"hover:bg-surface4":e&&!t}),style:{gridTemplateColumns:d1t(s)},disabled:!e,children:r})})}function HXn({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 ZXn({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(sp,{children:["Status: ",e||"not provided"]})]})}function p1t({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:d1t(e)},children:e?.map(t=>l.jsx("span",{children:t.label||t.name},t.name))})})}function WXn({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(p$,{}):l.jsx(iye,{})," ",t]}):e})}function GXn({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 QXn({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(Nj,{}),"Previous"]}),t&&l.jsxs("button",{onClick:n,children:["Next",l.jsx(bk,{})]})]})]})}function YXn({children:e}){return l.jsx("div",{className:"grid",children:e})}function h1t({children:e}){return l.jsx("div",{className:X("rounded-lg border border-border1 overflow-clip"),children:e})}const Ma=Object.assign(YXn,{Header:p1t,Trim:h1t,Entries:u1t,Entry:f1t,Message:WXn,NextPageLoading:GXn,Pagination:QXn,EntryText:HXn,EntryStatus:ZXn}),u6e=["75%","50%","65%","90%","60%","80%"];function XXn({columns:e,numberOfRows:t=3}){const n=(r,s)=>{const a=(r+s+(e?.length||0)+(t||0))%u6e.length;return u6e[a]};return l.jsx(u1t,{children:Array.from({length:t}).map((r,s)=>l.jsx(f1t,{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 m1t({columns:e,numberOfRows:t}){return l.jsx(Ma,{children:l.jsxs(h1t,{children:[l.jsx(p1t,{columns:e}),l.jsx(XXn,{columns:e,numberOfRows:t})]})})}function KXn({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 JXn({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 g1t=y.createContext(null);function eKn({children:e,value:t}){return l.jsx(g1t.Provider,{value:t,children:e})}function Cq(){const e=y.useContext(g1t);if(!e)throw new Error("useJSONSchemaForm must be used within a JSONSchemaForm.Root");return e}let tKn=0;function Tq(e={}){return{id:`field-${Date.now()}-${tKn++}`,name:"",type:"string",nullable:!1,optional:!1,...e}}function nKn(e){return e==="text"?"string":e}function v1t(e){const t=nKn(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}=y1t(e.properties);r.properties=s,a.length>0&&(r.required=a)}return e.type==="array"&&e.items&&(r.items=v1t(e.items)),r}function y1t(e){const t={},n=[];for(const r of e)r.name.trim()&&(t[r.name]=v1t(r),r.optional||n.push(r.name));return{properties:t,required:n}}function rKn(e){const{properties:t,required:n}=y1t(e),r={type:"object",properties:t};return n.length>0&&(r.required=n),r}function b1t(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 x1t(e){return["string","number","boolean","object","array"].includes(e)?e:"string"}function w1t(e){const{type:t,nullable:n}=b1t(e.type);return Tq({name:"",type:x1t(t),description:e.description,nullable:n,optional:!1,properties:e.properties?jq({properties:e.properties,required:e.required}):void 0,items:e.items?w1t(e.items):void 0})}function jq(e){if(!e?.properties)return[];const t=new Set(e.required||[]);return Object.entries(e.properties).map(([n,r])=>{const{type:s,nullable:a}=b1t(r.type);return Tq({name:n,type:x1t(s),description:r.description,nullable:a,optional:!t.has(n),properties:r.properties?jq({properties:r.properties,required:r.required}):void 0,items:r.items?w1t(r.items):void 0})})}function _fe(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:_fe(i.properties||[],a,n,r)}:i.type==="array"&&i.items?{...i,items:{...i.items,properties:_fe(i.items.properties||[],a,n,r)}}:i)}function Efe(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:Efe(a.properties||[],s,n)}:a.type==="array"&&a.items?{...a,items:{...a.items,properties:Efe(a.items.properties||[],s,n)}}:a)}function Cfe(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:Cfe(a.properties||[],s,n)}:a.type==="array"&&a.items?{...a,items:{...a.items,properties:Cfe(a.items.properties||[],s,n)}}:a)}function sKn({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=rKn(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=Tq();o(g=>Efe(g,h,m))},[]),d=y.useCallback((h,m)=>{o(g=>Cfe(g,h,m))},[]),f=y.useCallback((h,m,g)=>{o(v=>_fe(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(eKn,{value:p,children:l.jsx("div",{className:X(s),children:a})})}const S1t=y.createContext(null);function aKn({children:e,value:t}){return l.jsx(S1t.Provider,{value:t,children:e})}function sI(){const e=y.useContext(S1t);if(!e)throw new Error("useJSONSchemaFormField must be used within a JSONSchemaForm.Field");return e}function iKn({field:e,parentPath:t=[],depth:n=0,className:r,children:s}){const{updateField:a,removeField:i}=Cq(),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(aKn,{value:u,children:l.jsx("div",{className:X(r),children:s})})}const k1t=y.createContext(null);function oKn({children:e,value:t}){return l.jsx(k1t.Provider,{value:t,children:e})}function O1t(){return y.useContext(k1t)}function lKn({className:e,children:t}){const{fields:n}=Cq(),r=O1t(),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 cKn(e){const{field:t,update:n}=sI(),r=y.useCallback(s=>{n({name:s.target.value})},[n]);return l.jsx(qk,{...e,size:"md",labelIsHidden:!0,name:`field-name-${t.id}`,value:t.name,onChange:r})}const uKn=[{value:"string",label:"String",icon:l.jsx(Ve,{size:"sm",children:l.jsx(uye,{})})},{value:"number",label:"Number",icon:l.jsx(Ve,{size:"sm",children:l.jsx(aye,{})})},{value:"boolean",label:"Boolean",icon:l.jsx(Ve,{size:"sm",children:l.jsx(cye,{})})},{value:"text",label:"Text",icon:l.jsx(Ve,{size:"sm",children:l.jsx(qP,{})})},{value:"object",label:"Object",icon:l.jsx(Ve,{size:"sm",children:l.jsx(g0,{})})},{value:"array",label:"Array",icon:l.jsx(Ve,{size:"sm",children:l.jsx(oye,{})})}];function dKn({className:e,...t}){const{field:n,update:r}=sI(),s=y.useCallback(a=>{r({type:a})},[r]);return l.jsx(Ic,{className:X("w-28 shrink-0",e),name:`field-type-${n.id}`,label:"Select type",labelIsHidden:!0,value:n.type,onValueChange:s,options:uKn,size:"md",...t})}function fKn({label:e="Optional",labelClassName:t,className:n,...r}){const{field:s,update:a}=sI(),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(go,{...r,className:n,checked:s.optional,onCheckedChange:i}),e]})}function pKn({label:e="Nullable",labelClassName:t,className:n,...r}){const{field:s,update:a}=sI(),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(go,{...r,className:n,checked:s.nullable,onCheckedChange:i}),e]})}function hKn({children:e,tooltip:t="Remove field",...n}){const{remove:r}=sI();return l.jsx(he,{...n,tooltip:t,onClick:r,size:"icon-md",children:e||l.jsx(Zlt,{})})}function mKn({className:e,children:t}){const{maxDepth:n,updateField:r}=Cq(),{field:s,parentPath:a,depth:i}=sI(),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:Tq({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(oKn,{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 gKn({children:e,...t}){const{addField:n}=Cq(),r=O1t(),s=r?r.parentPath:[],a=y.useCallback(()=>{n(s)},[n,s]);return l.jsx(he,{type:"button",...t,onClick:a,children:e||"Add field"})}const Hi={Root:sKn,Field:iKn,FieldList:lKn,FieldName:cKn,FieldType:dKn,FieldOptional:fKn,FieldNullable:pKn,FieldRemove:hKn,NestedFields:mKn,AddField:gKn};function RO({data:e,className:t,labelsAreHidden:n,isLoading:r,LinkComponent:s}){const a=({children:i})=>n?l.jsx(sp,{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(Ee.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(d6e,{description:p.description,children:l.jsxs(s,{href:p.path,children:[p?.name," ",l.jsx(xk,{})]})},p.id):p.path?l.jsx(d6e,{description:p.description,children:l.jsxs("a",{href:p.path,children:[p?.name," ",l.jsx(xk,{})]})},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 d6e({description:e,children:t}){return e?l.jsxs(bbe,{openDelay:250,children:[l.jsx(xbe,{asChild:!0,children:t}),l.jsx(wbe,{children:l.jsxs(Sbe,{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(kbe,{className:"fill-surface5"})]})})]}):t}function vKn({className:e,children:t,...n}){return l.jsx("div",{className:X("mt-auto",e),...n,children:t})}const f6e="sidebar:state",p6e="sidebar:width",h6e="--sidebar-width",vwe=Ee.createContext(null),ywe=Ee.createContext(null);function Iq(){const e=Ee.useContext(vwe),t=Ee.useContext(ywe);if(!e||!t)throw new Error("useMainSidebar must be used within a MainSidebarProvider.");return{...e,...t}}function Nq(){const e=Ee.useContext(vwe),t=Ee.useContext(ywe);return!e||!t?null:{...e,...t}}const JX=(e,t,n)=>Math.min(n,Math.max(t,e)),yKn=typeof window<"u"?Ee.useLayoutEffect:Ee.useEffect;function bKn({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=JX(n,p,h),v=a??p,b=c?`${c}:${f6e}`:f6e,S=c?`${c}:${p6e}`:p6e,w=()=>{if(typeof window>"u")return{state:t,width:g};try{let J=t,se=g;const ae=window.localStorage.getItem(b);(ae==="collapsed"||ae==="default")&&(J=ae);const Q=window.localStorage.getItem(S);if(Q!==null){const te=Number(Q);Number.isFinite(te)&&(se=JX(te,p,h))}return{state:J,width:se}}catch{return{state:t,width:g}}},O=Ee.useRef(null);O.current===null&&(O.current=w());const E=O.current,[_,C]=Ee.useState(E.state),[j,I]=Ee.useState(E.width),[N,R]=Ee.useState(!1),[P,B]=Ee.useState(!1),M=Ee.useRef(E.width),L=Ee.useRef(E.state);L.current=_;const F=Ee.useRef(null);Ee.useEffect(()=>{if(typeof window>"u")return;const J=window.matchMedia(`(max-width: ${u-1}px)`),se=()=>R(J.matches);return se(),J.addEventListener("change",se),()=>J.removeEventListener("change",se)},[u]),Ee.useEffect(()=>{!N&&P&&B(!1)},[N,P]);const z=Ee.useCallback(J=>{const se=F.current;se&&se.style.setProperty(h6e,`${J}px`)},[]);yKn(()=>{z(_==="collapsed"?m:M.current)},[_,m,z]);const U=Ee.useCallback(J=>{try{window.localStorage.setItem(b,J)}catch{}},[b]),H=Ee.useCallback(()=>{if(N){B(J=>!J);return}C(J=>{const se=J==="default"?"collapsed":"default";return L.current=se,U(se),se})},[N,U]),D=Ee.useCallback(J=>{const se=JX(J,p,h);M.current=se,z(se)},[p,h,z]),Y=Ee.useCallback(()=>{L.current="collapsed",U("collapsed"),C("collapsed")},[U]),V=Ee.useCallback(()=>{L.current="default",U("default"),C("default")},[U]),$=Ee.useCallback(()=>{I(M.current);try{window.localStorage.setItem(b,L.current),window.localStorage.setItem(S,String(M.current))}catch{}},[b,S]),Z=Ee.useCallback(J=>{const se=F.current;se&&(J?se.setAttribute("data-sidebar-gesture","active"):se.removeAttribute("data-sidebar-gesture"))},[]);Ee.useEffect(()=>{if(o)return;const J=se=>{if(se.code!=="KeyB"||!(se.metaKey||se.ctrlKey)||se.altKey||se.shiftKey)return;const ae=se.target;if(ae){const Q=ae.tagName;if(Q==="INPUT"||Q==="TEXTAREA"||Q==="SELECT"||ae.isContentEditable)return}se.preventDefault(),H()};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[o,H]);const G=N?"default":_,K=Ee.useMemo(()=>({state:G,desktopState:_,width:j,minWidth:p,maxWidth:h,collapseBelow:v,collapsedWidth:m,isMobile:N,toggleSidebar:H,setWidth:D,collapse:Y,expand:V,commit:$,setGestureActive:Z,LinkComponent:f}),[G,_,j,p,h,v,m,N,H,D,Y,V,$,Z,f]),ne=Ee.useMemo(()=>({openMobile:P,setOpenMobile:B}),[P]),ee={[h6e]:`${E.state==="collapsed"?m:E.width}px`,"--sidebar-width-mobile":`${d}px`,display:"contents"};return l.jsx("div",{ref:F,"data-sidebar-scope":!0,"data-sidebar-state":_,"data-sidebar-mobile":N?"true":"false",style:ee,suppressHydrationWarning:!0,children:l.jsx(vwe.Provider,{value:K,children:l.jsx(ywe.Provider,{value:ne,children:e})})})}function xKn({className:e,icon:t,"aria-label":n="Open navigation menu",onClick:r,...s}){const{isMobile:a,setOpenMobile:i}=Iq();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(uvn,{className:"size-5"})})}function wKn({"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($s,{className:"flex-1 min-h-0",viewPortClassName:"px-0.5",children:t})})}function _1t({children:e,className:t,state:n,href:r,isActive:s,LinkComponent:a,...i}){const o=Nq(),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(sp,{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 E1t({children:e,className:t,state:n,...r}){const s=Nq();return(n??s?.state??"default")==="collapsed"?l.jsx(sp,{children:e}):l.jsx("span",{...r,className:X("min-w-0 flex-1 truncate text-left",t),children:e})}const SKn=({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 C1t({link:e,state:t,children:n,isActive:r,className:s,LinkComponent:a,asChild:i=!1,...o}){const c=Nq(),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=SKn({isActive:r,isCollapsed:f,isFeatured:p});let b=null;return i?b=l.jsx(Kxn,{className:v,children:n}):e&&(b=l.jsxs(d,{href:e.url,...m,className:v,children:[e.icon,l.jsx(E1t,{state:u,children:e.name}),n]})),l.jsx("li",{...o,className:X("flex relative min-w-0",s),children:e&&g&&Ee.isValidElement(b)?l.jsxs(rr,{children:[l.jsx(Jn,{render:b}),l.jsx(er,{side:"right",align:"center",sideOffset:16,children:e.tooltipMsg?f?`${e.name} | ${e.tooltipMsg}`:e.tooltipMsg:e.name})]}):b??n})}function T1t({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 j1t({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 I1t({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 m6e=10,kKn=5;function OKn({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}=Iq(),b=n==="collapsed",S=b&&o===0,w=y.useRef(!1),O=y.useRef(null);y.useEffect(()=>()=>{O.current?.(),O.current=null},[]);const E=y.useCallback(N=>{if(N.button!==0)return;N.preventDefault(),w.current=!1;const R=N.clientX,P=N.currentTarget,B=N.pointerId,M=P.parentElement,L=M?M.getBoundingClientRect().left:0,F=document.body.style.cursor,z=document.body.style.userSelect,U=D=>{if(D.pointerId!==B)return;const Y=D.clientX-R;if(!w.current){if(Math.abs(Y)<=kKn)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!==B||(window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",H),window.removeEventListener("pointercancel",H),document.body.style.cursor=F,document.body.style.userSelect=z,v(!1),m(),O.current=null)};O.current=()=>H(),window.addEventListener("pointermove",U),window.addEventListener("pointerup",H),window.addEventListener("pointercancel",H)},[i,f,h,p,m,v]),_=y.useCallback(()=>{if(w.current){w.current=!1;return}g()},[g]),C=y.useCallback(N=>{switch(N.key){case"Enter":case" ":{N.preventDefault(),g();return}case"ArrowLeft":{if(N.preventDefault(),b)return;f(r-m6e),m();return}case"ArrowRight":{if(N.preventDefault(),b){h(),m();return}f(r+m6e),m();return}case"Home":{N.preventDefault(),h(),f(s),m();return}case"End":{N.preventDefault(),h(),f(a),m();return}}},[b,r,s,a,f,h,m,g]),j=y.useCallback(N=>{const R=N.target.closest("a");!R||!R.hasAttribute("href")||N.button!==0||N.metaKey||N.ctrlKey||N.shiftKey||N.altKey||R.target==="_blank"||R.hasAttribute("download")||d(!1)},[d]);if(c)return l.jsx(Cye,{open:u,onOpenChange:d,children:l.jsxs(Tye,{children:[l.jsx(jye,{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(Iye,{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(sp,{asChild:!0,children:l.jsx(_ut,{children:"Navigation"})}),l.jsx(sp,{asChild:!0,children:l.jsx(Eut,{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 I=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:I,"aria-valuemin":b?void 0:s,"aria-valuemax":b?void 0:a,"aria-valuetext":b?"collapsed":`${I} pixels`,"aria-label":`Resize sidebar. Arrow keys to resize, Enter to ${b?"expand":"collapse"}.`,tabIndex:0,onPointerDown:E,onClick:_,onKeyDown:C,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 _Kn({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(j1t,{className:n,"aria-labelledby":i,"aria-label":i?void 0:s.key,children:[a?l.jsx(I1t,{}):null,s.title?l.jsx(_1t,{id:i,href:s.href,isActive:s.isHeaderActive,children:s.title}):null,l.jsx(T1t,{children:s.links.map(o=>l.jsx(C1t,{link:o,isActive:t?.(o,s.links)??o.isActive},o.name))})]},s.key)})})}function EKn({className:e,onClick:t,...n}){const{desktopState:r,toggleSidebar:s}=Iq(),a=r==="collapsed";return l.jsxs(rr,{children:[l.jsx(Jn,{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(hvn,{className:X({"rotate-180":a})})})}),l.jsxs(er,{children:["Toggle Sidebar",l.jsxs("div",{className:"flex items-center gap-1 [&>svg]:w-[1em] [&>svg]:h-[1em]",children:[l.jsx(Zgn,{})," Ctrl+B"]})]})]})}const Of=Object.assign(OKn,{Bottom:vKn,Nav:wKn,NavSection:j1t,NavLink:C1t,NavLabel:E1t,NavHeader:_1t,NavList:T1t,NavSeparator:I1t,Sections:_Kn,Trigger:EKn,MobileTrigger:xKn});function N1t({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 A1t({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 CKn({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(A1t,{isLoading:a,children:[s," ",n]}),r!==void 0&&l.jsx(N1t,{isLoading:a,children:r})]}):e})}Object.assign(CKn,{Title:A1t,Description:N1t});function TKn({children:e,className:t}){return l.jsx("header",{className:X("grid items-center grid-cols-[1fr_auto]",t),children:e})}function jKn({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 R1t({children:e,className:t}){return l.jsx("section",{className:X("grid gap-4",t),children:e})}function PO({children:e,className:t}){return l.jsx("section",{className:X("grid gap-2",t),children:e})}const Gl=Object.assign(R1t,{Header:TKn,Heading:jKn});function IKn({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 g6e({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(IKn,{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 NKn({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(It,{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 AKn(){return Tj({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8125rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"#939393",background:"transparent"},styles:[{tag:[oe.className,oe.propertyName]}]})}function RKn(){const e=St.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=Wm.define([{tag:[oe.comment,oe.bracket],color:"var(--neutral2)"},{tag:[oe.string,oe.meta,oe.regexp],color:"var(--accent1)"},{tag:[oe.atom,oe.bool,oe.special(oe.variableName)],color:"var(--accent6)"},{tag:[oe.keyword,oe.operator,oe.tagName],color:"var(--accent2)"},{tag:[oe.function(oe.propertyName),oe.propertyName],color:"var(--accent5)"},{tag:[oe.definition(oe.variableName),oe.function(oe.variableName),oe.className,oe.attributeName],color:"var(--accent3)"},{tag:[oe.variableName,oe.number],color:"var(--accent5)"},{tag:[oe.name,oe.quote],color:"var(--accent1)"}]);return[e,Lw(t)]}const PKn=()=>{const e=tI().resolvedTheme==="dark";return y.useMemo(()=>e?AKn():RKn(),[e])};function MKn({codeStr:e="",title:t,icon:n,simplified:r=!1}){const s=PKn(),[a,i]=y.useState(!1),o=y.useMemo(()=>{try{const u=JSON.parse(e);return Tfe(u||"")}catch{return!1}},[e]),c=a?e?.replace(/\\n/g,`
|
|
@@ -437,7 +437,7 @@ Provide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.
|
|
|
437
437
|
Option 2 - OIDC token:
|
|
438
438
|
Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.`,new WCt({message:i,statusCode:s,cause:a})}},GCt="GatewayInvalidRequestError",m0r=`vercel.ai.gateway.error.${GCt}`,M9e=Symbol.for(m0r),$9e,D9e,g0r=class extends(D9e=od,$9e=M9e,D9e){constructor({message:t="Invalid request",statusCode:n=400,cause:r}={}){super({message:t,statusCode:n,cause:r}),this[$9e]=!0,this.name=GCt,this.type="invalid_request_error"}static isInstance(t){return od.hasMarker(t)&&M9e in t}},QCt="GatewayRateLimitError",v0r=`vercel.ai.gateway.error.${QCt}`,L9e=Symbol.for(v0r),z9e,F9e,y0r=class extends(F9e=od,z9e=L9e,F9e){constructor({message:t="Rate limit exceeded",statusCode:n=429,cause:r}={}){super({message:t,statusCode:n,cause:r}),this[z9e]=!0,this.name=QCt,this.type="rate_limit_exceeded"}static isInstance(t){return od.hasMarker(t)&&L9e in t}},YCt="GatewayModelNotFoundError",b0r=`vercel.ai.gateway.error.${YCt}`,B9e=Symbol.for(b0r),x0r=cI(()=>wp(Te({modelId:ve()}))),U9e,q9e,w0r=class extends(q9e=od,U9e=B9e,q9e){constructor({message:t="Model not found",statusCode:n=404,modelId:r,cause:s}={}){super({message:t,statusCode:n,cause:s}),this[U9e]=!0,this.name=YCt,this.type="model_not_found",this.modelId=r}static isInstance(t){return od.hasMarker(t)&&B9e in t}},XCt="GatewayInternalServerError",S0r=`vercel.ai.gateway.error.${XCt}`,V9e=Symbol.for(S0r),H9e,Z9e,W9e=class extends(Z9e=od,H9e=V9e,Z9e){constructor({message:t="Internal server error",statusCode:n=500,cause:r}={}){super({message:t,statusCode:n,cause:r}),this[H9e]=!0,this.name=XCt,this.type="internal_server_error"}static isInstance(t){return od.hasMarker(t)&&V9e in t}},KCt="GatewayResponseError",k0r=`vercel.ai.gateway.error.${KCt}`,G9e=Symbol.for(k0r),Q9e,Y9e,O0r=class extends(Y9e=od,Q9e=G9e,Y9e){constructor({message:t="Invalid response from Gateway",statusCode:n=502,response:r,validationError:s,cause:a}={}){super({message:t,statusCode:n,cause:a}),this[Q9e]=!0,this.name=KCt,this.type="response_error",this.response=r,this.validationError=s}static isInstance(t){return od.hasMarker(t)&&G9e in t}};async function X9e({response:e,statusCode:t,defaultMessage:n="Gateway request failed",cause:r,authMethod:s}){const a=await QT({value:e,schema:_0r});if(!a.success)return new O0r({message:`Invalid error response format: ${n}`,statusCode:t,response:e,validationError:a.error,cause:r});const i=a.value,o=i.error.type,c=i.error.message;switch(o){case"authentication_error":return ZCt.createContextualError({apiKeyProvided:s==="api-key",oidcTokenProvided:s==="oidc",statusCode:t,cause:r});case"invalid_request_error":return new g0r({message:c,statusCode:t,cause:r});case"rate_limit_exceeded":return new y0r({message:c,statusCode:t,cause:r});case"model_not_found":{const u=await QT({value:i.error.param,schema:x0r});return new w0r({message:c,statusCode:t,modelId:u.success?u.value.modelId:void 0,cause:r})}case"internal_server_error":return new W9e({message:c,statusCode:t,cause:r});default:return new W9e({message:c,statusCode:t,cause:r})}}var _0r=cI(()=>wp(Te({error:Te({message:ve(),type:ve().nullish(),param:ti().nullish(),code:or([ve(),jt()]).nullish()})})));function E0r(e){if(e.data!==void 0)return e.data;if(e.responseBody!=null)try{return JSON.parse(e.responseBody)}catch{return e.responseBody}return{}}var JCt="GatewayTimeoutError",C0r=`vercel.ai.gateway.error.${JCt}`,K9e=Symbol.for(C0r),J9e,e7e,t7e=class eTt extends(e7e=od,J9e=K9e,e7e){constructor({message:t="Request timed out",statusCode:n=408,cause:r}={}){super({message:t,statusCode:n,cause:r}),this[J9e]=!0,this.name=JCt,this.type="timeout_error"}static isInstance(t){return od.hasMarker(t)&&K9e in t}static createTimeoutError({originalMessage:t,statusCode:n=408,cause:r}){const s=`Gateway request timed out: ${t}
|
|
439
439
|
|
|
440
|
-
This is a client-side timeout. To resolve this, increase your timeout configuration: https://vercel.com/docs/ai-gateway/capabilities/video-generation#extending-timeouts-for-node.js`;return new eTt({message:s,statusCode:n,cause:r})}};function n7e(e){if(!(e instanceof Error))return!1;const t=e.code;return typeof t=="string"?["UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","UND_ERR_CONNECT_TIMEOUT"].includes(t):!1}async function ch(e,t){var n;return od.isInstance(e)?e:n7e(e)?t7e.createTimeoutError({originalMessage:e instanceof Error?e.message:"Unknown error",cause:e}):$d.isInstance(e)?e.cause&&n7e(e.cause)?t7e.createTimeoutError({originalMessage:e.message,cause:e}):await X9e({response:E0r(e),statusCode:(n=e.statusCode)!=null?n:500,defaultMessage:"Gateway request failed",cause:e,authMethod:t}):await X9e({response:{},statusCode:500,defaultMessage:e instanceof Error?`Gateway request failed: ${e.message}`:"Unknown Gateway error",cause:e,authMethod:t})}var tTt="ai-gateway-auth-method";async function k0(e){const t=await QT({value:e[tTt],schema:T0r});return t.success?t.value:void 0}var T0r=cI(()=>wp(or([rn("api-key"),rn("oidc")]))),j0r=["embedding","image","language"],r7e=class{constructor(t){this.config=t}async getAvailableModels(){try{const{value:t}=await L9({url:`${this.config.baseURL}/config`,headers:await lh(this.config.headers()),successfulResponseHandler:nO(I0r),failedResponseHandler:vw({errorSchema:Ro(),errorToMessage:n=>n}),fetch:this.config.fetch});return t}catch(t){throw await ch(t)}}async getCredits(){try{const t=new URL(this.config.baseURL),{value:n}=await L9({url:`${t.origin}/v1/credits`,headers:await lh(this.config.headers()),successfulResponseHandler:nO(N0r),failedResponseHandler:vw({errorSchema:Ro(),errorToMessage:r=>r}),fetch:this.config.fetch});return n}catch(t){throw await ch(t)}}},I0r=cI(()=>wp(Te({models:Lt(Te({id:ve(),name:ve(),description:ve().nullish(),pricing:Te({input:ve(),output:ve(),input_cache_read:ve().nullish(),input_cache_write:ve().nullish()}).transform(({input:e,output:t,input_cache_read:n,input_cache_write:r})=>({input:e,output:t,...n?{cachedInputTokens:n}:{},...r?{cacheCreationInputTokens:r}:{}})).nullish(),specification:Te({specificationVersion:rn("v2"),provider:ve(),modelId:ve()}),modelType:ve().nullish()})).transform(e=>e.filter(t=>t.modelType==null||j0r.includes(t.modelType)))}))),N0r=cI(()=>wp(Te({balance:ve(),total_used:ve()}).transform(({balance:e,total_used:t})=>({balance:e,totalUsed:t})))),A0r=class{constructor(t){this.config=t}async getSpendReport(t){try{const n=new URL(this.config.baseURL),r=new URLSearchParams;r.set("start_date",t.startDate),r.set("end_date",t.endDate),t.groupBy&&r.set("group_by",t.groupBy),t.datePart&&r.set("date_part",t.datePart),t.userId&&r.set("user_id",t.userId),t.model&&r.set("model",t.model),t.provider&&r.set("provider",t.provider),t.credentialType&&r.set("credential_type",t.credentialType),t.tags&&t.tags.length>0&&r.set("tags",t.tags.join(","));const{value:s}=await L9({url:`${n.origin}/v1/report?${r.toString()}`,headers:await lh(this.config.headers()),successfulResponseHandler:nO(R0r),failedResponseHandler:vw({errorSchema:Ro(),errorToMessage:a=>a}),fetch:this.config.fetch});return s}catch(n){throw await ch(n)}}},R0r=uI(()=>wp(Te({results:Lt(Te({day:ve().optional(),hour:ve().optional(),user:ve().optional(),model:ve().optional(),tag:ve().optional(),provider:ve().optional(),credential_type:bo(["byok","system"]).optional(),total_cost:jt(),market_cost:jt().optional(),input_tokens:jt().optional(),output_tokens:jt().optional(),cached_input_tokens:jt().optional(),cache_creation_input_tokens:jt().optional(),reasoning_tokens:jt().optional(),request_count:jt().optional()}).transform(({credential_type:e,total_cost:t,market_cost:n,input_tokens:r,output_tokens:s,cached_input_tokens:a,cache_creation_input_tokens:i,reasoning_tokens:o,request_count:c,...u})=>({...u,...e!==void 0?{credentialType:e}:{},totalCost:t,...n!==void 0?{marketCost:n}:{},...r!==void 0?{inputTokens:r}:{},...s!==void 0?{outputTokens:s}:{},...a!==void 0?{cachedInputTokens:a}:{},...i!==void 0?{cacheCreationInputTokens:i}:{},...o!==void 0?{reasoningTokens:o}:{},...c!==void 0?{requestCount:c}:{}})))}))),P0r=class{constructor(t){this.config=t}async getGenerationInfo(t){try{const n=new URL(this.config.baseURL),{value:r}=await L9({url:`${n.origin}/v1/generation?id=${encodeURIComponent(t.id)}`,headers:await lh(this.config.headers()),successfulResponseHandler:nO(M0r),failedResponseHandler:vw({errorSchema:Ro(),errorToMessage:s=>s}),fetch:this.config.fetch});return r}catch(n){throw await ch(n)}}},M0r=uI(()=>wp(Te({data:Te({id:ve(),total_cost:jt(),upstream_inference_cost:jt(),usage:jt(),created_at:ve(),model:ve(),is_byok:Ao(),provider_name:ve(),streamed:Ao(),finish_reason:ve(),latency:jt(),generation_time:jt(),native_tokens_prompt:jt(),native_tokens_completion:jt(),native_tokens_reasoning:jt(),native_tokens_cached:jt(),native_tokens_cache_creation:jt(),billable_web_search_calls:jt()}).transform(({total_cost:e,upstream_inference_cost:t,created_at:n,is_byok:r,provider_name:s,finish_reason:a,generation_time:i,native_tokens_prompt:o,native_tokens_completion:c,native_tokens_reasoning:u,native_tokens_cached:d,native_tokens_cache_creation:f,billable_web_search_calls:p,...h})=>({...h,totalCost:e,upstreamInferenceCost:t,createdAt:n,isByok:r,providerName:s,finishReason:a,generationTime:i,promptTokens:o,completionTokens:c,reasoningTokens:u,cachedTokens:d,cacheCreationTokens:f,billableWebSearchCalls:p}))}).transform(({data:e})=>e))),$0r=class{constructor(t,n){this.modelId=t,this.config=n,this.specificationVersion="v2",this.supportedUrls={"*/*":[/.*/]}}get provider(){return this.config.provider}async getArgs(t){const{abortSignal:n,...r}=t;return{args:this.maybeEncodeFileParts(r),warnings:[]}}async doGenerate(t){const{args:n,warnings:r}=await this.getArgs(t),{abortSignal:s}=t,a=await lh(this.config.headers());try{const{responseHeaders:i,value:o,rawValue:c}=await F9({url:this.getUrl(),headers:D9(a,t.headers,this.getModelConfigHeaders(this.modelId,!1),await lh(this.config.o11yHeaders)),body:n,successfulResponseHandler:nO(Ro()),failedResponseHandler:vw({errorSchema:Ro(),errorToMessage:u=>u}),...s&&{abortSignal:s},fetch:this.config.fetch});return{...o,request:{body:n},response:{headers:i,body:c},warnings:r}}catch(i){throw await ch(i,await k0(a))}}async doStream(t){const{args:n,warnings:r}=await this.getArgs(t),{abortSignal:s}=t,a=await lh(this.config.headers());try{const{value:i,responseHeaders:o}=await F9({url:this.getUrl(),headers:D9(a,t.headers,this.getModelConfigHeaders(this.modelId,!0),await lh(this.config.o11yHeaders)),body:n,successfulResponseHandler:vxr(Ro()),failedResponseHandler:vw({errorSchema:Ro(),errorToMessage:c=>c}),...s&&{abortSignal:s},fetch:this.config.fetch});return{stream:i.pipeThrough(new TransformStream({start(c){r.length>0&&c.enqueue({type:"stream-start",warnings:r})},transform(c,u){if(c.success){const d=c.value;if(d.type==="raw"&&!t.includeRawChunks)return;d.type==="response-metadata"&&d.timestamp&&typeof d.timestamp=="string"&&(d.timestamp=new Date(d.timestamp)),u.enqueue(d)}else u.error(c.error)}})),request:{body:n},response:{headers:o}}}catch(i){throw await ch(i,await k0(a))}}isFilePart(t){return t&&typeof t=="object"&&"type"in t&&t.type==="file"}maybeEncodeFileParts(t){for(const n of t.prompt)for(const r of n.content)if(this.isFilePart(r)){const s=r;if(s.data instanceof Uint8Array){const a=Uint8Array.from(s.data),i=Buffer.from(a).toString("base64");s.data=new URL(`data:${s.mediaType||"application/octet-stream"};base64,${i}`)}}return t}getUrl(){return`${this.config.baseURL}/language-model`}getModelConfigHeaders(t,n){return{"ai-language-model-specification-version":"2","ai-language-model-id":t,"ai-language-model-streaming":String(n)}}},D0r=class{constructor(t,n){this.modelId=t,this.config=n,this.specificationVersion="v2",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0}get provider(){return this.config.provider}async doEmbed({values:t,headers:n,abortSignal:r,providerOptions:s}){var a;const i=await lh(this.config.headers());try{const{responseHeaders:o,value:c,rawValue:u}=await F9({url:this.getUrl(),headers:D9(i,n??{},this.getModelConfigHeaders(),await lh(this.config.o11yHeaders)),body:{input:t.length===1?t[0]:t,...s?{providerOptions:s}:{}},successfulResponseHandler:nO(L0r),failedResponseHandler:vw({errorSchema:Ro(),errorToMessage:d=>d}),...r&&{abortSignal:r},fetch:this.config.fetch});return{embeddings:c.embeddings,usage:(a=c.usage)!=null?a:void 0,providerMetadata:c.providerMetadata,response:{headers:o,body:u}}}catch(o){throw await ch(o,await k0(i))}}getUrl(){return`${this.config.baseURL}/embedding-model`}getModelConfigHeaders(){return{"ai-embedding-model-specification-version":"2","ai-model-id":this.modelId}}},L0r=cI(()=>wp(Te({embeddings:Lt(Lt(jt())),usage:Te({tokens:jt()}).nullish(),providerMetadata:ra(ve(),ra(ve(),ti())).optional()}))),z0r=class{constructor(t,n){this.modelId=t,this.config=n,this.specificationVersion="v2",this.maxImagesPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:t,n,size:r,aspectRatio:s,seed:a,providerOptions:i,headers:o,abortSignal:c}){var u,d,f,p;const h=await lh(this.config.headers());try{const{responseHeaders:m,value:g}=await F9({url:this.getUrl(),headers:D9(h,o??{},this.getModelConfigHeaders(),await lh(this.config.o11yHeaders)),body:{prompt:t,n,...r&&{size:r},...s&&{aspectRatio:s},...a&&{seed:a},...i&&{providerOptions:i}},successfulResponseHandler:nO(U0r),failedResponseHandler:vw({errorSchema:Ro(),errorToMessage:v=>v}),...c&&{abortSignal:c},fetch:this.config.fetch});return{images:g.images,warnings:(u=g.warnings)!=null?u:[],providerMetadata:g.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:m},...g.usage!=null&&{usage:{inputTokens:(d=g.usage.inputTokens)!=null?d:void 0,outputTokens:(f=g.usage.outputTokens)!=null?f:void 0,totalTokens:(p=g.usage.totalTokens)!=null?p:void 0}}}}catch(m){throw await ch(m,await k0(h))}}getUrl(){return`${this.config.baseURL}/image-model`}getModelConfigHeaders(){return{"ai-image-model-specification-version":"2","ai-model-id":this.modelId}}},F0r=Te({images:Lt(ti()).optional()}).catchall(ti()),B0r=Te({inputTokens:jt().nullish(),outputTokens:jt().nullish(),totalTokens:jt().nullish()}),U0r=Te({images:Lt(ve()),warnings:Lt(Te({type:rn("other"),message:ve()})).optional(),providerMetadata:ra(ve(),F0r).optional(),usage:B0r.optional()}),q0r=uI(()=>wp(Te({objective:ve().describe("Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."),search_queries:Lt(ve()).optional().describe("Optional search queries to supplement the objective. Maximum 200 characters per query."),mode:bo(["one-shot","agentic"]).optional().describe('Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'),max_results:jt().optional().describe("Maximum number of results to return (1-20). Defaults to 10 if not specified."),source_policy:Te({include_domains:Lt(ve()).optional().describe("List of domains to include in search results."),exclude_domains:Lt(ve()).optional().describe("List of domains to exclude from search results."),after_date:ve().optional().describe("Only include results published after this date (ISO 8601 format).")}).optional().describe("Source policy for controlling which domains to include/exclude and freshness."),excerpts:Te({max_chars_per_result:jt().optional().describe("Maximum characters per result."),max_chars_total:jt().optional().describe("Maximum total characters across all results.")}).optional().describe("Excerpt configuration for controlling result length."),fetch_policy:Te({max_age_seconds:jt().optional().describe("Maximum age in seconds for cached content. Set to 0 to always fetch fresh content.")}).optional().describe("Fetch policy for controlling content freshness.")}))),V0r=uI(()=>wp(or([Te({searchId:ve(),results:Lt(Te({url:ve(),title:ve(),excerpt:ve(),publishDate:ve().nullable().optional(),relevanceScore:jt().optional()}))}),Te({error:bo(["api_error","rate_limit","timeout","invalid_input","configuration_error","unknown"]),statusCode:jt().optional(),message:ve()})]))),H0r=zCt({id:"gateway.parallel_search",name:"parallel_search",inputSchema:q0r,outputSchema:V0r}),Z0r=(e={})=>H0r(e),W0r=uI(()=>wp(Te({query:or([ve(),Lt(ve())]).describe("Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."),max_results:jt().optional().describe("Maximum number of search results to return (1-20, default: 10)"),max_tokens_per_page:jt().optional().describe("Maximum number of tokens to extract per search result page (256-2048, default: 2048)"),max_tokens:jt().optional().describe("Maximum total tokens across all search results (default: 25000, max: 1000000)"),country:ve().optional().describe("Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"),search_domain_filter:Lt(ve()).optional().describe("List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"),search_language_filter:Lt(ve()).optional().describe("List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"),search_after_date:ve().optional().describe("Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),search_before_date:ve().optional().describe("Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),last_updated_after_filter:ve().optional().describe("Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),last_updated_before_filter:ve().optional().describe("Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),search_recency_filter:bo(["day","week","month","year"]).optional().describe("Filter results by relative time period. Cannot be used with search_after_date or search_before_date.")}))),G0r=uI(()=>wp(or([Te({results:Lt(Te({title:ve(),url:ve(),snippet:ve(),date:ve().optional(),lastUpdated:ve().optional()})),id:ve()}),Te({error:bo(["api_error","rate_limit","timeout","invalid_input","unknown"]),statusCode:jt().optional(),message:ve()})]))),Q0r=zCt({id:"gateway.perplexity_search",name:"perplexity_search",inputSchema:W0r,outputSchema:G0r}),Y0r=(e={})=>Q0r(e),X0r={parallelSearch:Z0r,perplexitySearch:Y0r};async function K0r(){var e;return(e=d0r().headers)==null?void 0:e["x-vercel-id"]}var J0r="2.0.88",ewr="0.0.1";function twr(e={}){var t,n;let r=null,s=null;const a=(t=e.metadataCacheRefreshMillis)!=null?t:1e3*60*5;let i=0;const o=(n=u0r(e.baseURL))!=null?n:"https://ai-gateway.vercel.sh/v1/ai",c=async()=>{const v=await nwr(e);if(v)return q1e({Authorization:`Bearer ${v.token}`,"ai-gateway-protocol-version":ewr,[tTt]:v.authMethod,...e.headers},`ai-sdk/gateway/${J0r}`);throw ZCt.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401})},u=()=>{const v=tR({settingValue:void 0,environmentVariableName:"VERCEL_DEPLOYMENT_ID"}),b=tR({settingValue:void 0,environmentVariableName:"VERCEL_ENV"}),S=tR({settingValue:void 0,environmentVariableName:"VERCEL_REGION"}),w=tR({settingValue:void 0,environmentVariableName:"VERCEL_PROJECT_ID"});return async()=>{const O=await K0r();return{...v&&{"ai-o11y-deployment-id":v},...b&&{"ai-o11y-environment":b},...S&&{"ai-o11y-region":S},...O&&{"ai-o11y-request-id":O},...w&&{"ai-o11y-project-id":w}}}},d=v=>new $0r(v,{provider:"gateway",baseURL:o,headers:c,fetch:e.fetch,o11yHeaders:u()}),f=async()=>{var v,b,S;const w=(S=(b=(v=e._internal)==null?void 0:v.currentDate)==null?void 0:b.call(v).getTime())!=null?S:Date.now();return(!r||w-i>a)&&(i=w,r=new r7e({baseURL:o,headers:c,fetch:e.fetch}).getAvailableModels().then(O=>(s=O,O)).catch(async O=>{throw await ch(O,await k0(await c()))})),s?Promise.resolve(s):r},p=async()=>new r7e({baseURL:o,headers:c,fetch:e.fetch}).getCredits().catch(async v=>{throw await ch(v,await k0(await c()))}),h=async v=>new A0r({baseURL:o,headers:c,fetch:e.fetch}).getSpendReport(v).catch(async b=>{throw await ch(b,await k0(await c()))}),m=async v=>new P0r({baseURL:o,headers:c,fetch:e.fetch}).getGenerationInfo(v).catch(async b=>{throw await ch(b,await k0(await c()))}),g=function(v){if(new.target)throw new Error("The Gateway Provider model function cannot be called with the new keyword.");return d(v)};return g.getAvailableModels=f,g.getCredits=p,g.getSpendReport=h,g.getGenerationInfo=m,g.imageModel=v=>new z0r(v,{provider:"gateway",baseURL:o,headers:c,fetch:e.fetch,o11yHeaders:u()}),g.languageModel=d,g.textEmbeddingModel=v=>new D0r(v,{provider:"gateway",baseURL:o,headers:c,fetch:e.fetch,o11yHeaders:u()}),g.tools=X0r,g}twr();async function nwr(e){const t=tR({settingValue:e.apiKey,environmentVariableName:"AI_GATEWAY_API_KEY"});if(t)return{token:t,authMethod:"api-key"};try{return{token:await f0r(),authMethod:"oidc"}}catch{return null}}var rwr=typeof globalThis=="object"?globalThis:global,RS="1.9.0",s7e=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function swr(e){var t=new Set([e]),n=new Set,r=e.match(s7e);if(!r)return function(){return!1};var s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(s.prerelease!=null)return function(c){return c===e};function a(o){return n.add(o),!1}function i(o){return t.add(o),!0}return function(c){if(t.has(c))return!0;if(n.has(c))return!1;var u=c.match(s7e);if(!u)return a(c);var d={major:+u[1],minor:+u[2],patch:+u[3],prerelease:u[4]};return d.prerelease!=null||s.major!==d.major?a(c):s.major===0?s.minor===d.minor&&s.patch<=d.patch?i(c):a(c):s.minor<=d.minor?i(c):a(c)}}var awr=swr(RS),iwr=RS.split(".")[0],oM=Symbol.for("opentelemetry.js.api."+iwr),lM=rwr;function H1e(e,t,n,r){var s;r===void 0&&(r=!1);var a=lM[oM]=(s=lM[oM])!==null&&s!==void 0?s:{version:RS};if(!r&&a[e]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(i.stack||i.message),!1}if(a.version!==RS){var i=new Error("@opentelemetry/api: Registration of version v"+a.version+" for "+e+" does not match previously registered API v"+RS);return n.error(i.stack||i.message),!1}return a[e]=t,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+RS+"."),!0}function cM(e){var t,n,r=(t=lM[oM])===null||t===void 0?void 0:t.version;if(!(!r||!awr(r)))return(n=lM[oM])===null||n===void 0?void 0:n[e]}function Z1e(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+RS+".");var n=lM[oM];n&&delete n[e]}var owr=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,a=[],i;try{for(;!(s=r.next()).done;)a.push(s.value)}catch(o){i={error:o}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},lwr=function(e,t,n){if(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))},cwr=(function(){function e(t){this._namespace=t.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return mA("debug",this._namespace,t)},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return mA("error",this._namespace,t)},e.prototype.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return mA("info",this._namespace,t)},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return mA("warn",this._namespace,t)},e.prototype.verbose=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return mA("verbose",this._namespace,t)},e})();function mA(e,t,n){var r=cM("diag");if(r)return n.unshift(t),r[e].apply(r,lwr([],owr(n),!1))}var Tf;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(Tf||(Tf={}));function uwr(e,t){e<Tf.NONE?e=Tf.NONE:e>Tf.ALL&&(e=Tf.ALL),t=t||{};function n(r,s){var a=t[r];return typeof a=="function"&&e>=s?a.bind(t):function(){}}return{error:n("error",Tf.ERROR),warn:n("warn",Tf.WARN),info:n("info",Tf.INFO),debug:n("debug",Tf.DEBUG),verbose:n("verbose",Tf.VERBOSE)}}var dwr=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,a=[],i;try{for(;!(s=r.next()).done;)a.push(s.value)}catch(o){i={error:o}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},fwr=function(e,t,n){if(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))},pwr="diag",B9=(function(){function e(){function t(s){return function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var o=cM("diag");if(o)return o[s].apply(o,fwr([],dwr(a),!1))}}var n=this,r=function(s,a){var i,o,c;if(a===void 0&&(a={logLevel:Tf.INFO}),s===n){var u=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((i=u.stack)!==null&&i!==void 0?i:u.message),!1}typeof a=="number"&&(a={logLevel:a});var d=cM("diag"),f=uwr((o=a.logLevel)!==null&&o!==void 0?o:Tf.INFO,s);if(d&&!a.suppressOverrideMessage){var p=(c=new Error().stack)!==null&&c!==void 0?c:"<failed to generate stacktrace>";d.warn("Current logger will be overwritten from "+p),f.warn("Current logger will overwrite one already registered from "+p)}return H1e("diag",f,n,!0)};n.setLogger=r,n.disable=function(){Z1e(pwr,n)},n.createComponentLogger=function(s){return new cwr(s)},n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e})();function hwr(e){return Symbol.for(e)}var mwr=(function(){function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(r){return n._currentContext.get(r)},n.setValue=function(r,s){var a=new e(n._currentContext);return a._currentContext.set(r,s),a},n.deleteValue=function(r){var s=new e(n._currentContext);return s._currentContext.delete(r),s}}return e})(),gwr=new mwr,vwr=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,a=[],i;try{for(;!(s=r.next()).done;)a.push(s.value)}catch(o){i={error:o}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},ywr=function(e,t,n){if(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))},bwr=(function(){function e(){}return e.prototype.active=function(){return gwr},e.prototype.with=function(t,n,r){for(var s=[],a=3;a<arguments.length;a++)s[a-3]=arguments[a];return n.call.apply(n,ywr([r],vwr(s),!1))},e.prototype.bind=function(t,n){return n},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e})(),xwr=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,a=[],i;try{for(;!(s=r.next()).done;)a.push(s.value)}catch(o){i={error:o}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},wwr=function(e,t,n){if(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))},ree="context",Swr=new bwr,nTt=(function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(t){return H1e(ree,t,B9.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(t,n,r){for(var s,a=[],i=3;i<arguments.length;i++)a[i-3]=arguments[i];return(s=this._getContextManager()).with.apply(s,wwr([t,n,r],xwr(a),!1))},e.prototype.bind=function(t,n){return this._getContextManager().bind(t,n)},e.prototype._getContextManager=function(){return cM(ree)||Swr},e.prototype.disable=function(){this._getContextManager().disable(),Z1e(ree,B9.instance())},e})(),fhe;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(fhe||(fhe={}));var rTt="0000000000000000",sTt="00000000000000000000000000000000",kwr={traceId:sTt,spanId:rTt,traceFlags:fhe.NONE},$R=(function(){function e(t){t===void 0&&(t=kwr),this._spanContext=t}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(t,n){return this},e.prototype.setAttributes=function(t){return this},e.prototype.addEvent=function(t,n){return this},e.prototype.addLink=function(t){return this},e.prototype.addLinks=function(t){return this},e.prototype.setStatus=function(t){return this},e.prototype.updateName=function(t){return this},e.prototype.end=function(t){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(t,n){},e})(),W1e=hwr("OpenTelemetry Context Key SPAN");function G1e(e){return e.getValue(W1e)||void 0}function Owr(){return G1e(nTt.getInstance().active())}function Q1e(e,t){return e.setValue(W1e,t)}function _wr(e){return e.deleteValue(W1e)}function Ewr(e,t){return Q1e(e,new $R(t))}function aTt(e){var t;return(t=G1e(e))===null||t===void 0?void 0:t.spanContext()}var Cwr=/^([0-9a-f]{32})$/i,Twr=/^[0-9a-f]{16}$/i;function jwr(e){return Cwr.test(e)&&e!==sTt}function Iwr(e){return Twr.test(e)&&e!==rTt}function iTt(e){return jwr(e.traceId)&&Iwr(e.spanId)}function Nwr(e){return new $R(e)}var see=nTt.getInstance(),oTt=(function(){function e(){}return e.prototype.startSpan=function(t,n,r){r===void 0&&(r=see.active());var s=!!n?.root;if(s)return new $R;var a=r&&aTt(r);return Awr(a)&&iTt(a)?new $R(a):new $R},e.prototype.startActiveSpan=function(t,n,r,s){var a,i,o;if(!(arguments.length<2)){arguments.length===2?o=n:arguments.length===3?(a=n,o=r):(a=n,i=r,o=s);var c=i??see.active(),u=this.startSpan(t,a,c),d=Q1e(c,u);return see.with(d,o,void 0,u)}},e})();function Awr(e){return typeof e=="object"&&typeof e.spanId=="string"&&typeof e.traceId=="string"&&typeof e.traceFlags=="number"}var Rwr=new oTt,Pwr=(function(){function e(t,n,r,s){this._provider=t,this.name=n,this.version=r,this.options=s}return e.prototype.startSpan=function(t,n,r){return this._getTracer().startSpan(t,n,r)},e.prototype.startActiveSpan=function(t,n,r,s){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Rwr},e})(),Mwr=(function(){function e(){}return e.prototype.getTracer=function(t,n,r){return new oTt},e})(),$wr=new Mwr,a7e=(function(){function e(){}return e.prototype.getTracer=function(t,n,r){var s;return(s=this.getDelegateTracer(t,n,r))!==null&&s!==void 0?s:new Pwr(this,t,n,r)},e.prototype.getDelegate=function(){var t;return(t=this._delegate)!==null&&t!==void 0?t:$wr},e.prototype.setDelegate=function(t){this._delegate=t},e.prototype.getDelegateTracer=function(t,n,r){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getTracer(t,n,r)},e})(),i7e;(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(i7e||(i7e={}));var aee="trace",Dwr=(function(){function e(){this._proxyTracerProvider=new a7e,this.wrapSpanContext=Nwr,this.isSpanContextValid=iTt,this.deleteSpan=_wr,this.getSpan=G1e,this.getActiveSpan=Owr,this.getSpanContext=aTt,this.setSpan=Q1e,this.setSpanContext=Ewr}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(t){var n=H1e(aee,this._proxyTracerProvider,B9.instance());return n&&this._proxyTracerProvider.setDelegate(t),n},e.prototype.getTracerProvider=function(){return cM(aee)||this._proxyTracerProvider},e.prototype.getTracer=function(t,n){return this.getTracerProvider().getTracer(t,n)},e.prototype.disable=function(){Z1e(aee,B9.instance()),this._proxyTracerProvider=new a7e},e})();Dwr.getInstance();var Lwr=Object.defineProperty,zwr=(e,t)=>{for(var n in t)Lwr(e,n,{get:t[n],enumerable:!0})},lTt="AI_NoObjectGeneratedError",cTt=`vercel.ai.error.${lTt}`,Fwr=Symbol.for(cTt),uTt,o7e=class extends Wd{constructor({message:t="No object generated.",cause:n,text:r,response:s,usage:a,finishReason:i}){super({name:lTt,message:t,cause:n}),this[uTt]=!0,this.text=r,this.response=s,this.usage=a,this.finishReason=i}static isInstance(t){return Wd.hasMarker(t,cTt)}};uTt=Fwr;var dTt="AI_MessageConversionError",fTt=`vercel.ai.error.${dTt}`,Bwr=Symbol.for(fTt),pTt,Uwr=class extends Wd{constructor({originalMessage:t,message:n}){super({name:dTt,message:n}),this[pTt]=!0,this.originalMessage=t}static isInstance(t){return Wd.hasMarker(t,fTt)}};pTt=Bwr;var hTt=or([ve(),vh(Uint8Array),vh(ArrayBuffer),_me(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?n:!1},{message:"Must be a Buffer"})]),uM=kme(()=>or([wme(),ve(),jt(),Ao(),ra(ve(),uM),Lt(uM)])),Wv=ra(ve(),ra(ve(),uM)),mTt=Te({type:rn("text"),text:ve(),providerOptions:Wv.optional()}),qwr=Te({type:rn("image"),image:or([hTt,vh(URL)]),mediaType:ve().optional(),providerOptions:Wv.optional()}),gTt=Te({type:rn("file"),data:or([hTt,vh(URL)]),filename:ve().optional(),mediaType:ve(),providerOptions:Wv.optional()}),Vwr=Te({type:rn("reasoning"),text:ve(),providerOptions:Wv.optional()}),Hwr=Te({type:rn("tool-call"),toolCallId:ve(),toolName:ve(),input:ti(),providerOptions:Wv.optional(),providerExecuted:Ao().optional()}),Zwr=DM("type",[Te({type:rn("text"),value:ve()}),Te({type:rn("json"),value:uM}),Te({type:rn("error-text"),value:ve()}),Te({type:rn("error-json"),value:uM}),Te({type:rn("content"),value:Lt(or([Te({type:rn("text"),text:ve()}),Te({type:rn("media"),data:ve(),mediaType:ve()})]))})]),vTt=Te({type:rn("tool-result"),toolCallId:ve(),toolName:ve(),output:Zwr,providerOptions:Wv.optional()}),Wwr=Te({role:rn("system"),content:ve(),providerOptions:Wv.optional()}),Gwr=Te({role:rn("user"),content:or([ve(),Lt(or([mTt,qwr,gTt]))]),providerOptions:Wv.optional()}),Qwr=Te({role:rn("assistant"),content:or([ve(),Lt(or([mTt,gTt,Vwr,Hwr,vTt]))]),providerOptions:Wv.optional()}),Ywr=Te({role:rn("tool"),content:Lt(vTt),providerOptions:Wv.optional()});or([Wwr,Gwr,Qwr,Ywr]);function l7e({output:e,tool:t,errorMode:n}){return n==="text"?{type:"error-text",value:U1e(e)}:n==="json"?{type:"error-json",value:c7e(e)}:t?.toModelOutput?t.toModelOutput(e):typeof e=="string"?{type:"text",value:e}:{type:"json",value:c7e(e)}}function c7e(e){return e===void 0?null:e}xD({prefix:"aitxt",size:24});function Xwr(e){const t=["ROOT"];let n=-1,r=null;function s(c,u,d){switch(c){case'"':{n=u,t.pop(),t.push(d),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=u,r=u,t.pop(),t.push(d),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=u,t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"{":{n=u,t.pop(),t.push(d),t.push("INSIDE_OBJECT_START");break}case"[":{n=u,t.pop(),t.push(d),t.push("INSIDE_ARRAY_START");break}}}function a(c,u){switch(c){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=u,t.pop();break}}}function i(c,u){switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=u,t.pop();break}}}for(let c=0;c<e.length;c++){const u=e[c];switch(t[t.length-1]){case"ROOT":s(u,c,"FINISH");break;case"INSIDE_OBJECT_START":{switch(u){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=c,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{u===":"&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{s(u,c,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{a(u,c);break}case"INSIDE_STRING":{switch(u){case'"':{t.pop(),n=c;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=c}break}case"INSIDE_ARRAY_START":{u==="]"?(n=c,t.pop()):(n=c,s(u,c,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}default:{n=c;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{s(u,c,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=c;break}case"INSIDE_NUMBER":{switch(u){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,c),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(u,c);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(u,c);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,c);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const f=e.substring(r,c+1);!"false".startsWith(f)&&!"true".startsWith(f)&&!"null".startsWith(f)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?a(u,c):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,c)):n=c;break}}}let o=e.slice(0,n+1);for(let c=t.length-1;c>=0;c--)switch(t[c]){case"INSIDE_STRING":{o+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{o+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{o+="]";break}case"INSIDE_LITERAL":{const d=e.substring(r,e.length);"true".startsWith(d)?o+="true".slice(d.length):"false".startsWith(d)?o+="false".slice(d.length):"null".startsWith(d)&&(o+="null".slice(d.length))}}return o}async function Kwr(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await iM({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await iM({text:Xwr(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}function iee(e){return e.type.startsWith("data-")}function oee(e){return e.type==="text"}function lee(e){return e.type==="file"}function u7e(e){return e.type==="reasoning"}function np(e){return e.type.startsWith("tool-")}function Y1e(e){return e.type==="dynamic-tool"}function Jwr(e){return np(e)||Y1e(e)}function yTt(e){return e.type.split("-").slice(1).join("-")}function e1r(e){return Y1e(e)?e.toolName:yTt(e)}xD({prefix:"aitxt",size:24});function bTt(e,t){const n=[];for(const r of e)switch(r.role){case"system":{const s=r.parts.filter(i=>i.type==="text"),a=s.reduce((i,o)=>o.providerMetadata!=null?{...i,...o.providerMetadata}:i,{});n.push({role:"system",content:s.map(i=>i.text).join(""),...Object.keys(a).length>0?{providerOptions:a}:{}});break}case"user":{n.push({role:"user",content:r.parts.map(s=>{var a;if(oee(s))return{type:"text",text:s.text,...s.providerMetadata!=null?{providerOptions:s.providerMetadata}:{}};if(lee(s))return{type:"file",mediaType:s.mediaType,filename:s.filename,data:s.url,...s.providerMetadata!=null?{providerOptions:s.providerMetadata}:{}};if(iee(s))return(a=void 0)==null?void 0:a.call(t,s)}).filter(s=>s!=null)});break}case"assistant":{if(r.parts!=null){let s=function(){var i,o,c;if(a.length===0)return;const u=[];for(const f of a)if(oee(f))u.push({type:"text",text:f.text,...f.providerMetadata!=null?{providerOptions:f.providerMetadata}:{}});else if(lee(f))u.push({type:"file",mediaType:f.mediaType,filename:f.filename,data:f.url});else if(u7e(f))u.push({type:"reasoning",text:f.text,providerOptions:f.providerMetadata});else if(Y1e(f)){const p=f.toolName;f.state!=="input-streaming"&&u.push({type:"tool-call",toolCallId:f.toolCallId,toolName:p,input:f.input,...f.callProviderMetadata!=null?{providerOptions:f.callProviderMetadata}:{}})}else if(np(f)){const p=yTt(f);f.state!=="input-streaming"&&(u.push({type:"tool-call",toolCallId:f.toolCallId,toolName:p,input:f.state==="output-error"?(i=f.input)!=null?i:f.rawInput:f.input,providerExecuted:f.providerExecuted,...f.callProviderMetadata!=null?{providerOptions:f.callProviderMetadata}:{}}),f.providerExecuted===!0&&(f.state==="output-available"||f.state==="output-error")&&u.push({type:"tool-result",toolCallId:f.toolCallId,toolName:p,output:l7e({output:f.state==="output-error"?f.errorText:f.output,tool:(o=void 0)==null?void 0:o[p],errorMode:f.state==="output-error"?"json":"none"}),...f.callProviderMetadata!=null?{providerOptions:f.callProviderMetadata}:{}}))}else if(iee(f)){const p=(c=void 0)==null?void 0:c.call(t,f);p!=null&&u.push(p)}else{const p=f;throw new Error(`Unsupported part: ${p}`)}n.push({role:"assistant",content:u});const d=a.filter(f=>np(f)&&f.providerExecuted!==!0||f.type==="dynamic-tool");d.length>0&&n.push({role:"tool",content:d.map(f=>{var p;switch(f.state){case"output-error":case"output-available":{const h=e1r(f);return{type:"tool-result",toolCallId:f.toolCallId,toolName:h,output:l7e({output:f.state==="output-error"?f.errorText:f.output,tool:(p=void 0)==null?void 0:p[h],errorMode:f.state==="output-error"?"text":"none"}),...f.callProviderMetadata!=null?{providerOptions:f.callProviderMetadata}:{}}}default:return null}}).filter(f=>f!=null)}),a=[]},a=[];for(const i of r.parts)oee(i)||u7e(i)||lee(i)||Jwr(i)||iee(i)?a.push(i):i.type==="step-start"&&s();s();break}break}default:{const s=r.role;throw new Uwr({originalMessage:r,message:`Unsupported role: ${s}`})}}return n}xD({prefix:"aiobj",size:24});xD({prefix:"aiobj",size:24});var t1r={};zwr(t1r,{object:()=>r1r,text:()=>n1r});var n1r=()=>({type:"text",responseFormat:{type:"text"},async parsePartial({text:e}){return{partial:e}},async parseOutput({text:e}){return e}}),r1r=({schema:e})=>{const t=c0r(e);return{type:"object",responseFormat:{type:"json",schema:t.jsonSchema},async parsePartial({text:n}){const r=await Kwr(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:r.value};default:{const s=r.state;throw new Error(`Unsupported parse state: ${s}`)}}},async parseOutput({text:n},r){const s=await iM({text:n});if(!s.success)throw new o7e({message:"No object generated: could not parse the response.",cause:s.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});const a=await QT({value:s.value,schema:t});if(!a.success)throw new o7e({message:"No object generated: response did not match schema.",cause:a.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return a.value}}};function hm(e,t,n){const r=e?.mastra,s=r?.toolPayloadTransform?.[t]?.[n]??r?.toolPayloadProjection?.[t]?.[n];if(s&&Object.prototype.hasOwnProperty.call(s,"projected")&&!Object.prototype.hasOwnProperty.call(s,"transformed")){const{projected:a,...i}=s;return{...i,transformed:a}}return s}function Yc(e){return!!(e&&Object.prototype.hasOwnProperty.call(e,"transformed"))}var s1r={},phe={},xTt="vercel.ai.error",a1r=Symbol.for(xTt),d7e,f7e,Th=class wTt extends(f7e=Error,d7e=a1r,f7e){constructor({name:t,message:n,cause:r}){super(n),this[d7e]=!0,this.name=t,this.cause=r}static isInstance(t){return wTt.hasMarker(t,xTt)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}},STt="AI_APICallError",kTt=`vercel.ai.error.${STt}`,i1r=Symbol.for(kTt),p7e,h7e,Ml=class extends(h7e=Th,p7e=i1r,h7e){constructor({message:e,url:t,requestBodyValues:n,statusCode:r,responseHeaders:s,responseBody:a,cause:i,isRetryable:o=r!=null&&(r===408||r===409||r===429||r>=500),data:c}){super({name:STt,message:e,cause:i}),this[p7e]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=r,this.responseHeaders=s,this.responseBody=a,this.isRetryable=o,this.data=c}static isInstance(e){return Th.hasMarker(e,kTt)}},OTt="AI_EmptyResponseBodyError",_Tt=`vercel.ai.error.${OTt}`,o1r=Symbol.for(_Tt),m7e,g7e,l1r=class extends(g7e=Th,m7e=o1r,g7e){constructor({message:e="Empty response body"}={}){super({name:OTt,message:e}),this[m7e]=!0}static isInstance(e){return Th.hasMarker(e,_Tt)}};function ETt(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var CTt="AI_InvalidArgumentError",TTt=`vercel.ai.error.${CTt}`,c1r=Symbol.for(TTt),v7e,y7e,u1r=class extends(y7e=Th,v7e=c1r,y7e){constructor({message:t,cause:n,argument:r}){super({name:CTt,message:t,cause:n}),this[v7e]=!0,this.argument=r}static isInstance(t){return Th.hasMarker(t,TTt)}},jTt="AI_JSONParseError",ITt=`vercel.ai.error.${jTt}`,d1r=Symbol.for(ITt),b7e,x7e,U9=class extends(x7e=Th,b7e=d1r,x7e){constructor({text:t,cause:n}){super({name:jTt,message:`JSON parsing failed: Text: ${t}.
|
|
440
|
+
This is a client-side timeout. To resolve this, increase your timeout configuration: https://vercel.com/docs/ai-gateway/capabilities/video-generation#extending-timeouts-for-node.js`;return new eTt({message:s,statusCode:n,cause:r})}};function n7e(e){if(!(e instanceof Error))return!1;const t=e.code;return typeof t=="string"?["UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","UND_ERR_CONNECT_TIMEOUT"].includes(t):!1}async function ch(e,t){var n;return od.isInstance(e)?e:n7e(e)?t7e.createTimeoutError({originalMessage:e instanceof Error?e.message:"Unknown error",cause:e}):$d.isInstance(e)?e.cause&&n7e(e.cause)?t7e.createTimeoutError({originalMessage:e.message,cause:e}):await X9e({response:E0r(e),statusCode:(n=e.statusCode)!=null?n:500,defaultMessage:"Gateway request failed",cause:e,authMethod:t}):await X9e({response:{},statusCode:500,defaultMessage:e instanceof Error?`Gateway request failed: ${e.message}`:"Unknown Gateway error",cause:e,authMethod:t})}var tTt="ai-gateway-auth-method";async function k0(e){const t=await QT({value:e[tTt],schema:T0r});return t.success?t.value:void 0}var T0r=cI(()=>wp(or([rn("api-key"),rn("oidc")]))),j0r=["embedding","image","language"],r7e=class{constructor(t){this.config=t}async getAvailableModels(){try{const{value:t}=await L9({url:`${this.config.baseURL}/config`,headers:await lh(this.config.headers()),successfulResponseHandler:nO(I0r),failedResponseHandler:vw({errorSchema:Ro(),errorToMessage:n=>n}),fetch:this.config.fetch});return t}catch(t){throw await ch(t)}}async getCredits(){try{const t=new URL(this.config.baseURL),{value:n}=await L9({url:`${t.origin}/v1/credits`,headers:await lh(this.config.headers()),successfulResponseHandler:nO(N0r),failedResponseHandler:vw({errorSchema:Ro(),errorToMessage:r=>r}),fetch:this.config.fetch});return n}catch(t){throw await ch(t)}}},I0r=cI(()=>wp(Te({models:Lt(Te({id:ve(),name:ve(),description:ve().nullish(),pricing:Te({input:ve(),output:ve(),input_cache_read:ve().nullish(),input_cache_write:ve().nullish()}).transform(({input:e,output:t,input_cache_read:n,input_cache_write:r})=>({input:e,output:t,...n?{cachedInputTokens:n}:{},...r?{cacheCreationInputTokens:r}:{}})).nullish(),specification:Te({specificationVersion:rn("v2"),provider:ve(),modelId:ve()}),modelType:ve().nullish()})).transform(e=>e.filter(t=>t.modelType==null||j0r.includes(t.modelType)))}))),N0r=cI(()=>wp(Te({balance:ve(),total_used:ve()}).transform(({balance:e,total_used:t})=>({balance:e,totalUsed:t})))),A0r=class{constructor(t){this.config=t}async getSpendReport(t){try{const n=new URL(this.config.baseURL),r=new URLSearchParams;r.set("start_date",t.startDate),r.set("end_date",t.endDate),t.groupBy&&r.set("group_by",t.groupBy),t.datePart&&r.set("date_part",t.datePart),t.userId&&r.set("user_id",t.userId),t.model&&r.set("model",t.model),t.provider&&r.set("provider",t.provider),t.credentialType&&r.set("credential_type",t.credentialType),t.tags&&t.tags.length>0&&r.set("tags",t.tags.join(","));const{value:s}=await L9({url:`${n.origin}/v1/report?${r.toString()}`,headers:await lh(this.config.headers()),successfulResponseHandler:nO(R0r),failedResponseHandler:vw({errorSchema:Ro(),errorToMessage:a=>a}),fetch:this.config.fetch});return s}catch(n){throw await ch(n)}}},R0r=uI(()=>wp(Te({results:Lt(Te({day:ve().optional(),hour:ve().optional(),user:ve().optional(),model:ve().optional(),tag:ve().optional(),provider:ve().optional(),credential_type:bo(["byok","system"]).optional(),total_cost:jt(),market_cost:jt().optional(),input_tokens:jt().optional(),output_tokens:jt().optional(),cached_input_tokens:jt().optional(),cache_creation_input_tokens:jt().optional(),reasoning_tokens:jt().optional(),request_count:jt().optional()}).transform(({credential_type:e,total_cost:t,market_cost:n,input_tokens:r,output_tokens:s,cached_input_tokens:a,cache_creation_input_tokens:i,reasoning_tokens:o,request_count:c,...u})=>({...u,...e!==void 0?{credentialType:e}:{},totalCost:t,...n!==void 0?{marketCost:n}:{},...r!==void 0?{inputTokens:r}:{},...s!==void 0?{outputTokens:s}:{},...a!==void 0?{cachedInputTokens:a}:{},...i!==void 0?{cacheCreationInputTokens:i}:{},...o!==void 0?{reasoningTokens:o}:{},...c!==void 0?{requestCount:c}:{}})))}))),P0r=class{constructor(t){this.config=t}async getGenerationInfo(t){try{const n=new URL(this.config.baseURL),{value:r}=await L9({url:`${n.origin}/v1/generation?id=${encodeURIComponent(t.id)}`,headers:await lh(this.config.headers()),successfulResponseHandler:nO(M0r),failedResponseHandler:vw({errorSchema:Ro(),errorToMessage:s=>s}),fetch:this.config.fetch});return r}catch(n){throw await ch(n)}}},M0r=uI(()=>wp(Te({data:Te({id:ve(),total_cost:jt(),upstream_inference_cost:jt(),usage:jt(),created_at:ve(),model:ve(),is_byok:Ao(),provider_name:ve(),streamed:Ao(),finish_reason:ve(),latency:jt(),generation_time:jt(),native_tokens_prompt:jt(),native_tokens_completion:jt(),native_tokens_reasoning:jt(),native_tokens_cached:jt(),native_tokens_cache_creation:jt(),billable_web_search_calls:jt()}).transform(({total_cost:e,upstream_inference_cost:t,created_at:n,is_byok:r,provider_name:s,finish_reason:a,generation_time:i,native_tokens_prompt:o,native_tokens_completion:c,native_tokens_reasoning:u,native_tokens_cached:d,native_tokens_cache_creation:f,billable_web_search_calls:p,...h})=>({...h,totalCost:e,upstreamInferenceCost:t,createdAt:n,isByok:r,providerName:s,finishReason:a,generationTime:i,promptTokens:o,completionTokens:c,reasoningTokens:u,cachedTokens:d,cacheCreationTokens:f,billableWebSearchCalls:p}))}).transform(({data:e})=>e))),$0r=class{constructor(t,n){this.modelId=t,this.config=n,this.specificationVersion="v2",this.supportedUrls={"*/*":[/.*/]}}get provider(){return this.config.provider}async getArgs(t){const{abortSignal:n,...r}=t;return{args:this.maybeEncodeFileParts(r),warnings:[]}}async doGenerate(t){const{args:n,warnings:r}=await this.getArgs(t),{abortSignal:s}=t,a=await lh(this.config.headers());try{const{responseHeaders:i,value:o,rawValue:c}=await F9({url:this.getUrl(),headers:D9(a,t.headers,this.getModelConfigHeaders(this.modelId,!1),await lh(this.config.o11yHeaders)),body:n,successfulResponseHandler:nO(Ro()),failedResponseHandler:vw({errorSchema:Ro(),errorToMessage:u=>u}),...s&&{abortSignal:s},fetch:this.config.fetch});return{...o,request:{body:n},response:{headers:i,body:c},warnings:r}}catch(i){throw await ch(i,await k0(a))}}async doStream(t){const{args:n,warnings:r}=await this.getArgs(t),{abortSignal:s}=t,a=await lh(this.config.headers());try{const{value:i,responseHeaders:o}=await F9({url:this.getUrl(),headers:D9(a,t.headers,this.getModelConfigHeaders(this.modelId,!0),await lh(this.config.o11yHeaders)),body:n,successfulResponseHandler:vxr(Ro()),failedResponseHandler:vw({errorSchema:Ro(),errorToMessage:c=>c}),...s&&{abortSignal:s},fetch:this.config.fetch});return{stream:i.pipeThrough(new TransformStream({start(c){r.length>0&&c.enqueue({type:"stream-start",warnings:r})},transform(c,u){if(c.success){const d=c.value;if(d.type==="raw"&&!t.includeRawChunks)return;d.type==="response-metadata"&&d.timestamp&&typeof d.timestamp=="string"&&(d.timestamp=new Date(d.timestamp)),u.enqueue(d)}else u.error(c.error)}})),request:{body:n},response:{headers:o}}}catch(i){throw await ch(i,await k0(a))}}isFilePart(t){return t&&typeof t=="object"&&"type"in t&&t.type==="file"}maybeEncodeFileParts(t){for(const n of t.prompt)for(const r of n.content)if(this.isFilePart(r)){const s=r;if(s.data instanceof Uint8Array){const a=Uint8Array.from(s.data),i=Buffer.from(a).toString("base64");s.data=new URL(`data:${s.mediaType||"application/octet-stream"};base64,${i}`)}}return t}getUrl(){return`${this.config.baseURL}/language-model`}getModelConfigHeaders(t,n){return{"ai-language-model-specification-version":"2","ai-language-model-id":t,"ai-language-model-streaming":String(n)}}},D0r=class{constructor(t,n){this.modelId=t,this.config=n,this.specificationVersion="v2",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0}get provider(){return this.config.provider}async doEmbed({values:t,headers:n,abortSignal:r,providerOptions:s}){var a;const i=await lh(this.config.headers());try{const{responseHeaders:o,value:c,rawValue:u}=await F9({url:this.getUrl(),headers:D9(i,n??{},this.getModelConfigHeaders(),await lh(this.config.o11yHeaders)),body:{input:t.length===1?t[0]:t,...s?{providerOptions:s}:{}},successfulResponseHandler:nO(L0r),failedResponseHandler:vw({errorSchema:Ro(),errorToMessage:d=>d}),...r&&{abortSignal:r},fetch:this.config.fetch});return{embeddings:c.embeddings,usage:(a=c.usage)!=null?a:void 0,providerMetadata:c.providerMetadata,response:{headers:o,body:u}}}catch(o){throw await ch(o,await k0(i))}}getUrl(){return`${this.config.baseURL}/embedding-model`}getModelConfigHeaders(){return{"ai-embedding-model-specification-version":"2","ai-model-id":this.modelId}}},L0r=cI(()=>wp(Te({embeddings:Lt(Lt(jt())),usage:Te({tokens:jt()}).nullish(),providerMetadata:ra(ve(),ra(ve(),ti())).optional()}))),z0r=class{constructor(t,n){this.modelId=t,this.config=n,this.specificationVersion="v2",this.maxImagesPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:t,n,size:r,aspectRatio:s,seed:a,providerOptions:i,headers:o,abortSignal:c}){var u,d,f,p;const h=await lh(this.config.headers());try{const{responseHeaders:m,value:g}=await F9({url:this.getUrl(),headers:D9(h,o??{},this.getModelConfigHeaders(),await lh(this.config.o11yHeaders)),body:{prompt:t,n,...r&&{size:r},...s&&{aspectRatio:s},...a&&{seed:a},...i&&{providerOptions:i}},successfulResponseHandler:nO(U0r),failedResponseHandler:vw({errorSchema:Ro(),errorToMessage:v=>v}),...c&&{abortSignal:c},fetch:this.config.fetch});return{images:g.images,warnings:(u=g.warnings)!=null?u:[],providerMetadata:g.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:m},...g.usage!=null&&{usage:{inputTokens:(d=g.usage.inputTokens)!=null?d:void 0,outputTokens:(f=g.usage.outputTokens)!=null?f:void 0,totalTokens:(p=g.usage.totalTokens)!=null?p:void 0}}}}catch(m){throw await ch(m,await k0(h))}}getUrl(){return`${this.config.baseURL}/image-model`}getModelConfigHeaders(){return{"ai-image-model-specification-version":"2","ai-model-id":this.modelId}}},F0r=Te({images:Lt(ti()).optional()}).catchall(ti()),B0r=Te({inputTokens:jt().nullish(),outputTokens:jt().nullish(),totalTokens:jt().nullish()}),U0r=Te({images:Lt(ve()),warnings:Lt(Te({type:rn("other"),message:ve()})).optional(),providerMetadata:ra(ve(),F0r).optional(),usage:B0r.optional()}),q0r=uI(()=>wp(Te({objective:ve().describe("Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."),search_queries:Lt(ve()).optional().describe("Optional search queries to supplement the objective. Maximum 200 characters per query."),mode:bo(["one-shot","agentic"]).optional().describe('Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'),max_results:jt().optional().describe("Maximum number of results to return (1-20). Defaults to 10 if not specified."),source_policy:Te({include_domains:Lt(ve()).optional().describe("List of domains to include in search results."),exclude_domains:Lt(ve()).optional().describe("List of domains to exclude from search results."),after_date:ve().optional().describe("Only include results published after this date (ISO 8601 format).")}).optional().describe("Source policy for controlling which domains to include/exclude and freshness."),excerpts:Te({max_chars_per_result:jt().optional().describe("Maximum characters per result."),max_chars_total:jt().optional().describe("Maximum total characters across all results.")}).optional().describe("Excerpt configuration for controlling result length."),fetch_policy:Te({max_age_seconds:jt().optional().describe("Maximum age in seconds for cached content. Set to 0 to always fetch fresh content.")}).optional().describe("Fetch policy for controlling content freshness.")}))),V0r=uI(()=>wp(or([Te({searchId:ve(),results:Lt(Te({url:ve(),title:ve(),excerpt:ve(),publishDate:ve().nullable().optional(),relevanceScore:jt().optional()}))}),Te({error:bo(["api_error","rate_limit","timeout","invalid_input","configuration_error","unknown"]),statusCode:jt().optional(),message:ve()})]))),H0r=zCt({id:"gateway.parallel_search",name:"parallel_search",inputSchema:q0r,outputSchema:V0r}),Z0r=(e={})=>H0r(e),W0r=uI(()=>wp(Te({query:or([ve(),Lt(ve())]).describe("Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."),max_results:jt().optional().describe("Maximum number of search results to return (1-20, default: 10)"),max_tokens_per_page:jt().optional().describe("Maximum number of tokens to extract per search result page (256-2048, default: 2048)"),max_tokens:jt().optional().describe("Maximum total tokens across all search results (default: 25000, max: 1000000)"),country:ve().optional().describe("Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"),search_domain_filter:Lt(ve()).optional().describe("List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"),search_language_filter:Lt(ve()).optional().describe("List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"),search_after_date:ve().optional().describe("Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),search_before_date:ve().optional().describe("Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),last_updated_after_filter:ve().optional().describe("Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),last_updated_before_filter:ve().optional().describe("Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),search_recency_filter:bo(["day","week","month","year"]).optional().describe("Filter results by relative time period. Cannot be used with search_after_date or search_before_date.")}))),G0r=uI(()=>wp(or([Te({results:Lt(Te({title:ve(),url:ve(),snippet:ve(),date:ve().optional(),lastUpdated:ve().optional()})),id:ve()}),Te({error:bo(["api_error","rate_limit","timeout","invalid_input","unknown"]),statusCode:jt().optional(),message:ve()})]))),Q0r=zCt({id:"gateway.perplexity_search",name:"perplexity_search",inputSchema:W0r,outputSchema:G0r}),Y0r=(e={})=>Q0r(e),X0r={parallelSearch:Z0r,perplexitySearch:Y0r};async function K0r(){var e;return(e=d0r().headers)==null?void 0:e["x-vercel-id"]}var J0r="2.0.88",ewr="0.0.1";function twr(e={}){var t,n;let r=null,s=null;const a=(t=e.metadataCacheRefreshMillis)!=null?t:1e3*60*5;let i=0;const o=(n=u0r(e.baseURL))!=null?n:"https://ai-gateway.vercel.sh/v1/ai",c=async()=>{const v=await nwr(e);if(v)return q1e({Authorization:`Bearer ${v.token}`,"ai-gateway-protocol-version":ewr,[tTt]:v.authMethod,...e.headers},`ai-sdk/gateway/${J0r}`);throw ZCt.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401})},u=()=>{const v=tR({settingValue:void 0,environmentVariableName:"VERCEL_DEPLOYMENT_ID"}),b=tR({settingValue:void 0,environmentVariableName:"VERCEL_ENV"}),S=tR({settingValue:void 0,environmentVariableName:"VERCEL_REGION"}),w=tR({settingValue:void 0,environmentVariableName:"VERCEL_PROJECT_ID"});return async()=>{const O=await K0r();return{...v&&{"ai-o11y-deployment-id":v},...b&&{"ai-o11y-environment":b},...S&&{"ai-o11y-region":S},...O&&{"ai-o11y-request-id":O},...w&&{"ai-o11y-project-id":w}}}},d=v=>new $0r(v,{provider:"gateway",baseURL:o,headers:c,fetch:e.fetch,o11yHeaders:u()}),f=async()=>{var v,b,S;const w=(S=(b=(v=e._internal)==null?void 0:v.currentDate)==null?void 0:b.call(v).getTime())!=null?S:Date.now();return(!r||w-i>a)&&(i=w,r=new r7e({baseURL:o,headers:c,fetch:e.fetch}).getAvailableModels().then(O=>(s=O,O)).catch(async O=>{throw await ch(O,await k0(await c()))})),s?Promise.resolve(s):r},p=async()=>new r7e({baseURL:o,headers:c,fetch:e.fetch}).getCredits().catch(async v=>{throw await ch(v,await k0(await c()))}),h=async v=>new A0r({baseURL:o,headers:c,fetch:e.fetch}).getSpendReport(v).catch(async b=>{throw await ch(b,await k0(await c()))}),m=async v=>new P0r({baseURL:o,headers:c,fetch:e.fetch}).getGenerationInfo(v).catch(async b=>{throw await ch(b,await k0(await c()))}),g=function(v){if(new.target)throw new Error("The Gateway Provider model function cannot be called with the new keyword.");return d(v)};return g.getAvailableModels=f,g.getCredits=p,g.getSpendReport=h,g.getGenerationInfo=m,g.imageModel=v=>new z0r(v,{provider:"gateway",baseURL:o,headers:c,fetch:e.fetch,o11yHeaders:u()}),g.languageModel=d,g.textEmbeddingModel=v=>new D0r(v,{provider:"gateway",baseURL:o,headers:c,fetch:e.fetch,o11yHeaders:u()}),g.tools=X0r,g}twr();async function nwr(e){const t=tR({settingValue:e.apiKey,environmentVariableName:"AI_GATEWAY_API_KEY"});if(t)return{token:t,authMethod:"api-key"};try{return{token:await f0r(),authMethod:"oidc"}}catch{return null}}var rwr=typeof globalThis=="object"?globalThis:global,RS="1.9.0",s7e=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function swr(e){var t=new Set([e]),n=new Set,r=e.match(s7e);if(!r)return function(){return!1};var s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(s.prerelease!=null)return function(c){return c===e};function a(o){return n.add(o),!1}function i(o){return t.add(o),!0}return function(c){if(t.has(c))return!0;if(n.has(c))return!1;var u=c.match(s7e);if(!u)return a(c);var d={major:+u[1],minor:+u[2],patch:+u[3],prerelease:u[4]};return d.prerelease!=null||s.major!==d.major?a(c):s.major===0?s.minor===d.minor&&s.patch<=d.patch?i(c):a(c):s.minor<=d.minor?i(c):a(c)}}var awr=swr(RS),iwr=RS.split(".")[0],oM=Symbol.for("opentelemetry.js.api."+iwr),lM=rwr;function H1e(e,t,n,r){var s;r===void 0&&(r=!1);var a=lM[oM]=(s=lM[oM])!==null&&s!==void 0?s:{version:RS};if(!r&&a[e]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(i.stack||i.message),!1}if(a.version!==RS){var i=new Error("@opentelemetry/api: Registration of version v"+a.version+" for "+e+" does not match previously registered API v"+RS);return n.error(i.stack||i.message),!1}return a[e]=t,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+RS+"."),!0}function cM(e){var t,n,r=(t=lM[oM])===null||t===void 0?void 0:t.version;if(!(!r||!awr(r)))return(n=lM[oM])===null||n===void 0?void 0:n[e]}function Z1e(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+RS+".");var n=lM[oM];n&&delete n[e]}var owr=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,a=[],i;try{for(;!(s=r.next()).done;)a.push(s.value)}catch(o){i={error:o}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},lwr=function(e,t,n){if(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))},cwr=(function(){function e(t){this._namespace=t.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return mA("debug",this._namespace,t)},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return mA("error",this._namespace,t)},e.prototype.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return mA("info",this._namespace,t)},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return mA("warn",this._namespace,t)},e.prototype.verbose=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return mA("verbose",this._namespace,t)},e})();function mA(e,t,n){var r=cM("diag");if(r)return n.unshift(t),r[e].apply(r,lwr([],owr(n),!1))}var Tf;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(Tf||(Tf={}));function uwr(e,t){e<Tf.NONE?e=Tf.NONE:e>Tf.ALL&&(e=Tf.ALL),t=t||{};function n(r,s){var a=t[r];return typeof a=="function"&&e>=s?a.bind(t):function(){}}return{error:n("error",Tf.ERROR),warn:n("warn",Tf.WARN),info:n("info",Tf.INFO),debug:n("debug",Tf.DEBUG),verbose:n("verbose",Tf.VERBOSE)}}var dwr=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,a=[],i;try{for(;!(s=r.next()).done;)a.push(s.value)}catch(o){i={error:o}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},fwr=function(e,t,n){if(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))},pwr="diag",B9=(function(){function e(){function t(s){return function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var o=cM("diag");if(o)return o[s].apply(o,fwr([],dwr(a),!1))}}var n=this,r=function(s,a){var i,o,c;if(a===void 0&&(a={logLevel:Tf.INFO}),s===n){var u=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((i=u.stack)!==null&&i!==void 0?i:u.message),!1}typeof a=="number"&&(a={logLevel:a});var d=cM("diag"),f=uwr((o=a.logLevel)!==null&&o!==void 0?o:Tf.INFO,s);if(d&&!a.suppressOverrideMessage){var p=(c=new Error().stack)!==null&&c!==void 0?c:"<failed to generate stacktrace>";d.warn("Current logger will be overwritten from "+p),f.warn("Current logger will overwrite one already registered from "+p)}return H1e("diag",f,n,!0)};n.setLogger=r,n.disable=function(){Z1e(pwr,n)},n.createComponentLogger=function(s){return new cwr(s)},n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e})();function hwr(e){return Symbol.for(e)}var mwr=(function(){function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(r){return n._currentContext.get(r)},n.setValue=function(r,s){var a=new e(n._currentContext);return a._currentContext.set(r,s),a},n.deleteValue=function(r){var s=new e(n._currentContext);return s._currentContext.delete(r),s}}return e})(),gwr=new mwr,vwr=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,a=[],i;try{for(;!(s=r.next()).done;)a.push(s.value)}catch(o){i={error:o}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},ywr=function(e,t,n){if(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))},bwr=(function(){function e(){}return e.prototype.active=function(){return gwr},e.prototype.with=function(t,n,r){for(var s=[],a=3;a<arguments.length;a++)s[a-3]=arguments[a];return n.call.apply(n,ywr([r],vwr(s),!1))},e.prototype.bind=function(t,n){return n},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e})(),xwr=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,a=[],i;try{for(;!(s=r.next()).done;)a.push(s.value)}catch(o){i={error:o}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},wwr=function(e,t,n){if(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))},ree="context",Swr=new bwr,nTt=(function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(t){return H1e(ree,t,B9.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(t,n,r){for(var s,a=[],i=3;i<arguments.length;i++)a[i-3]=arguments[i];return(s=this._getContextManager()).with.apply(s,wwr([t,n,r],xwr(a),!1))},e.prototype.bind=function(t,n){return this._getContextManager().bind(t,n)},e.prototype._getContextManager=function(){return cM(ree)||Swr},e.prototype.disable=function(){this._getContextManager().disable(),Z1e(ree,B9.instance())},e})(),fhe;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(fhe||(fhe={}));var rTt="0000000000000000",sTt="00000000000000000000000000000000",kwr={traceId:sTt,spanId:rTt,traceFlags:fhe.NONE},$R=(function(){function e(t){t===void 0&&(t=kwr),this._spanContext=t}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(t,n){return this},e.prototype.setAttributes=function(t){return this},e.prototype.addEvent=function(t,n){return this},e.prototype.addLink=function(t){return this},e.prototype.addLinks=function(t){return this},e.prototype.setStatus=function(t){return this},e.prototype.updateName=function(t){return this},e.prototype.end=function(t){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(t,n){},e})(),W1e=hwr("OpenTelemetry Context Key SPAN");function G1e(e){return e.getValue(W1e)||void 0}function Owr(){return G1e(nTt.getInstance().active())}function Q1e(e,t){return e.setValue(W1e,t)}function _wr(e){return e.deleteValue(W1e)}function Ewr(e,t){return Q1e(e,new $R(t))}function aTt(e){var t;return(t=G1e(e))===null||t===void 0?void 0:t.spanContext()}var Cwr=/^([0-9a-f]{32})$/i,Twr=/^[0-9a-f]{16}$/i;function jwr(e){return Cwr.test(e)&&e!==sTt}function Iwr(e){return Twr.test(e)&&e!==rTt}function iTt(e){return jwr(e.traceId)&&Iwr(e.spanId)}function Nwr(e){return new $R(e)}var see=nTt.getInstance(),oTt=(function(){function e(){}return e.prototype.startSpan=function(t,n,r){r===void 0&&(r=see.active());var s=!!n?.root;if(s)return new $R;var a=r&&aTt(r);return Awr(a)&&iTt(a)?new $R(a):new $R},e.prototype.startActiveSpan=function(t,n,r,s){var a,i,o;if(!(arguments.length<2)){arguments.length===2?o=n:arguments.length===3?(a=n,o=r):(a=n,i=r,o=s);var c=i??see.active(),u=this.startSpan(t,a,c),d=Q1e(c,u);return see.with(d,o,void 0,u)}},e})();function Awr(e){return typeof e=="object"&&typeof e.spanId=="string"&&typeof e.traceId=="string"&&typeof e.traceFlags=="number"}var Rwr=new oTt,Pwr=(function(){function e(t,n,r,s){this._provider=t,this.name=n,this.version=r,this.options=s}return e.prototype.startSpan=function(t,n,r){return this._getTracer().startSpan(t,n,r)},e.prototype.startActiveSpan=function(t,n,r,s){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Rwr},e})(),Mwr=(function(){function e(){}return e.prototype.getTracer=function(t,n,r){return new oTt},e})(),$wr=new Mwr,a7e=(function(){function e(){}return e.prototype.getTracer=function(t,n,r){var s;return(s=this.getDelegateTracer(t,n,r))!==null&&s!==void 0?s:new Pwr(this,t,n,r)},e.prototype.getDelegate=function(){var t;return(t=this._delegate)!==null&&t!==void 0?t:$wr},e.prototype.setDelegate=function(t){this._delegate=t},e.prototype.getDelegateTracer=function(t,n,r){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getTracer(t,n,r)},e})(),i7e;(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(i7e||(i7e={}));var aee="trace",Dwr=(function(){function e(){this._proxyTracerProvider=new a7e,this.wrapSpanContext=Nwr,this.isSpanContextValid=iTt,this.deleteSpan=_wr,this.getSpan=G1e,this.getActiveSpan=Owr,this.getSpanContext=aTt,this.setSpan=Q1e,this.setSpanContext=Ewr}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(t){var n=H1e(aee,this._proxyTracerProvider,B9.instance());return n&&this._proxyTracerProvider.setDelegate(t),n},e.prototype.getTracerProvider=function(){return cM(aee)||this._proxyTracerProvider},e.prototype.getTracer=function(t,n){return this.getTracerProvider().getTracer(t,n)},e.prototype.disable=function(){Z1e(aee,B9.instance()),this._proxyTracerProvider=new a7e},e})();Dwr.getInstance();var Lwr=Object.defineProperty,zwr=(e,t)=>{for(var n in t)Lwr(e,n,{get:t[n],enumerable:!0})},lTt="AI_NoObjectGeneratedError",cTt=`vercel.ai.error.${lTt}`,Fwr=Symbol.for(cTt),uTt,o7e=class extends Wd{constructor({message:t="No object generated.",cause:n,text:r,response:s,usage:a,finishReason:i}){super({name:lTt,message:t,cause:n}),this[uTt]=!0,this.text=r,this.response=s,this.usage=a,this.finishReason=i}static isInstance(t){return Wd.hasMarker(t,cTt)}};uTt=Fwr;var dTt="AI_MessageConversionError",fTt=`vercel.ai.error.${dTt}`,Bwr=Symbol.for(fTt),pTt,Uwr=class extends Wd{constructor({originalMessage:t,message:n}){super({name:dTt,message:n}),this[pTt]=!0,this.originalMessage=t}static isInstance(t){return Wd.hasMarker(t,fTt)}};pTt=Bwr;var hTt=or([ve(),vh(Uint8Array),vh(ArrayBuffer),_me(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?n:!1},{message:"Must be a Buffer"})]),uM=kme(()=>or([wme(),ve(),jt(),Ao(),ra(ve(),uM),Lt(uM)])),Wv=ra(ve(),ra(ve(),uM)),mTt=Te({type:rn("text"),text:ve(),providerOptions:Wv.optional()}),qwr=Te({type:rn("image"),image:or([hTt,vh(URL)]),mediaType:ve().optional(),providerOptions:Wv.optional()}),gTt=Te({type:rn("file"),data:or([hTt,vh(URL)]),filename:ve().optional(),mediaType:ve(),providerOptions:Wv.optional()}),Vwr=Te({type:rn("reasoning"),text:ve(),providerOptions:Wv.optional()}),Hwr=Te({type:rn("tool-call"),toolCallId:ve(),toolName:ve(),input:ti(),providerOptions:Wv.optional(),providerExecuted:Ao().optional()}),Zwr=DM("type",[Te({type:rn("text"),value:ve()}),Te({type:rn("json"),value:uM}),Te({type:rn("error-text"),value:ve()}),Te({type:rn("error-json"),value:uM}),Te({type:rn("content"),value:Lt(or([Te({type:rn("text"),text:ve()}),Te({type:rn("media"),data:ve(),mediaType:ve()})]))})]),vTt=Te({type:rn("tool-result"),toolCallId:ve(),toolName:ve(),output:Zwr,providerOptions:Wv.optional()}),Wwr=Te({role:rn("system"),content:ve(),providerOptions:Wv.optional()}),Gwr=Te({role:rn("user"),content:or([ve(),Lt(or([mTt,qwr,gTt]))]),providerOptions:Wv.optional()}),Qwr=Te({role:rn("assistant"),content:or([ve(),Lt(or([mTt,gTt,Vwr,Hwr,vTt]))]),providerOptions:Wv.optional()}),Ywr=Te({role:rn("tool"),content:Lt(vTt),providerOptions:Wv.optional()});or([Wwr,Gwr,Qwr,Ywr]);function l7e({output:e,tool:t,errorMode:n}){return n==="text"?{type:"error-text",value:U1e(e)}:n==="json"?{type:"error-json",value:c7e(e)}:t?.toModelOutput?t.toModelOutput(e):typeof e=="string"?{type:"text",value:e}:{type:"json",value:c7e(e)}}function c7e(e){return e===void 0?null:e}xD({prefix:"aitxt",size:24});function Xwr(e){const t=["ROOT"];let n=-1,r=null;function s(c,u,d){switch(c){case'"':{n=u,t.pop(),t.push(d),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=u,r=u,t.pop(),t.push(d),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=u,t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"{":{n=u,t.pop(),t.push(d),t.push("INSIDE_OBJECT_START");break}case"[":{n=u,t.pop(),t.push(d),t.push("INSIDE_ARRAY_START");break}}}function a(c,u){switch(c){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=u,t.pop();break}}}function i(c,u){switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=u,t.pop();break}}}for(let c=0;c<e.length;c++){const u=e[c];switch(t[t.length-1]){case"ROOT":s(u,c,"FINISH");break;case"INSIDE_OBJECT_START":{switch(u){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=c,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{u===":"&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{s(u,c,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{a(u,c);break}case"INSIDE_STRING":{switch(u){case'"':{t.pop(),n=c;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=c}break}case"INSIDE_ARRAY_START":{u==="]"?(n=c,t.pop()):(n=c,s(u,c,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}default:{n=c;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{s(u,c,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=c;break}case"INSIDE_NUMBER":{switch(u){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,c),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(u,c);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(u,c);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,c);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const f=e.substring(r,c+1);!"false".startsWith(f)&&!"true".startsWith(f)&&!"null".startsWith(f)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?a(u,c):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,c)):n=c;break}}}let o=e.slice(0,n+1);for(let c=t.length-1;c>=0;c--)switch(t[c]){case"INSIDE_STRING":{o+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{o+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{o+="]";break}case"INSIDE_LITERAL":{const d=e.substring(r,e.length);"true".startsWith(d)?o+="true".slice(d.length):"false".startsWith(d)?o+="false".slice(d.length):"null".startsWith(d)&&(o+="null".slice(d.length))}}return o}async function Kwr(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await iM({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await iM({text:Xwr(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}function iee(e){return e.type.startsWith("data-")}function oee(e){return e.type==="text"}function lee(e){return e.type==="file"}function u7e(e){return e.type==="reasoning"}function np(e){return e.type.startsWith("tool-")}function Y1e(e){return e.type==="dynamic-tool"}function Jwr(e){return np(e)||Y1e(e)}function yTt(e){return e.type.split("-").slice(1).join("-")}function e1r(e){return Y1e(e)?e.toolName:yTt(e)}xD({prefix:"aitxt",size:24});function bTt(e,t){const n=[];for(const r of e)switch(r.role){case"system":{const s=r.parts.filter(i=>i.type==="text"),a=s.reduce((i,o)=>o.providerMetadata!=null?{...i,...o.providerMetadata}:i,{});n.push({role:"system",content:s.map(i=>i.text).join(""),...Object.keys(a).length>0?{providerOptions:a}:{}});break}case"user":{n.push({role:"user",content:r.parts.map(s=>{var a;if(oee(s))return{type:"text",text:s.text,...s.providerMetadata!=null?{providerOptions:s.providerMetadata}:{}};if(lee(s))return{type:"file",mediaType:s.mediaType,filename:s.filename,data:s.url,...s.providerMetadata!=null?{providerOptions:s.providerMetadata}:{}};if(iee(s))return(a=void 0)==null?void 0:a.call(t,s)}).filter(s=>s!=null)});break}case"assistant":{if(r.parts!=null){let s=function(){var i,o,c;if(a.length===0)return;const u=[];for(const f of a)if(oee(f))u.push({type:"text",text:f.text,...f.providerMetadata!=null?{providerOptions:f.providerMetadata}:{}});else if(lee(f))u.push({type:"file",mediaType:f.mediaType,filename:f.filename,data:f.url});else if(u7e(f))u.push({type:"reasoning",text:f.text,providerOptions:f.providerMetadata});else if(Y1e(f)){const p=f.toolName;f.state!=="input-streaming"&&u.push({type:"tool-call",toolCallId:f.toolCallId,toolName:p,input:f.input,...f.callProviderMetadata!=null?{providerOptions:f.callProviderMetadata}:{}})}else if(np(f)){const p=yTt(f);f.state!=="input-streaming"&&(u.push({type:"tool-call",toolCallId:f.toolCallId,toolName:p,input:f.state==="output-error"?(i=f.input)!=null?i:f.rawInput:f.input,providerExecuted:f.providerExecuted,...f.callProviderMetadata!=null?{providerOptions:f.callProviderMetadata}:{}}),f.providerExecuted===!0&&(f.state==="output-available"||f.state==="output-error")&&u.push({type:"tool-result",toolCallId:f.toolCallId,toolName:p,output:l7e({output:f.state==="output-error"?f.errorText:f.output,tool:(o=void 0)==null?void 0:o[p],errorMode:f.state==="output-error"?"json":"none"}),...f.callProviderMetadata!=null?{providerOptions:f.callProviderMetadata}:{}}))}else if(iee(f)){const p=(c=void 0)==null?void 0:c.call(t,f);p!=null&&u.push(p)}else{const p=f;throw new Error(`Unsupported part: ${p}`)}n.push({role:"assistant",content:u});const d=a.filter(f=>np(f)&&f.providerExecuted!==!0||f.type==="dynamic-tool");d.length>0&&n.push({role:"tool",content:d.map(f=>{var p;switch(f.state){case"output-error":case"output-available":{const h=e1r(f);return{type:"tool-result",toolCallId:f.toolCallId,toolName:h,output:l7e({output:f.state==="output-error"?f.errorText:f.output,tool:(p=void 0)==null?void 0:p[h],errorMode:f.state==="output-error"?"text":"none"}),...f.callProviderMetadata!=null?{providerOptions:f.callProviderMetadata}:{}}}default:return null}}).filter(f=>f!=null)}),a=[]},a=[];for(const i of r.parts)oee(i)||u7e(i)||lee(i)||Jwr(i)||iee(i)?a.push(i):i.type==="step-start"&&s();s();break}break}default:{const s=r.role;throw new Uwr({originalMessage:r,message:`Unsupported role: ${s}`})}}return n}xD({prefix:"aiobj",size:24});xD({prefix:"aiobj",size:24});var t1r={};zwr(t1r,{object:()=>r1r,text:()=>n1r});var n1r=()=>({type:"text",responseFormat:{type:"text"},async parsePartial({text:e}){return{partial:e}},async parseOutput({text:e}){return e}}),r1r=({schema:e})=>{const t=c0r(e);return{type:"object",responseFormat:{type:"json",schema:t.jsonSchema},async parsePartial({text:n}){const r=await Kwr(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:r.value};default:{const s=r.state;throw new Error(`Unsupported parse state: ${s}`)}}},async parseOutput({text:n},r){const s=await iM({text:n});if(!s.success)throw new o7e({message:"No object generated: could not parse the response.",cause:s.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});const a=await QT({value:s.value,schema:t});if(!a.success)throw new o7e({message:"No object generated: response did not match schema.",cause:a.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return a.value}}},s1r={},phe={},xTt="vercel.ai.error",a1r=Symbol.for(xTt),d7e,f7e,Th=class wTt extends(f7e=Error,d7e=a1r,f7e){constructor({name:t,message:n,cause:r}){super(n),this[d7e]=!0,this.name=t,this.cause=r}static isInstance(t){return wTt.hasMarker(t,xTt)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}},STt="AI_APICallError",kTt=`vercel.ai.error.${STt}`,i1r=Symbol.for(kTt),p7e,h7e,Ml=class extends(h7e=Th,p7e=i1r,h7e){constructor({message:e,url:t,requestBodyValues:n,statusCode:r,responseHeaders:s,responseBody:a,cause:i,isRetryable:o=r!=null&&(r===408||r===409||r===429||r>=500),data:c}){super({name:STt,message:e,cause:i}),this[p7e]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=r,this.responseHeaders=s,this.responseBody=a,this.isRetryable=o,this.data=c}static isInstance(e){return Th.hasMarker(e,kTt)}},OTt="AI_EmptyResponseBodyError",_Tt=`vercel.ai.error.${OTt}`,o1r=Symbol.for(_Tt),m7e,g7e,l1r=class extends(g7e=Th,m7e=o1r,g7e){constructor({message:e="Empty response body"}={}){super({name:OTt,message:e}),this[m7e]=!0}static isInstance(e){return Th.hasMarker(e,_Tt)}};function ETt(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var CTt="AI_InvalidArgumentError",TTt=`vercel.ai.error.${CTt}`,c1r=Symbol.for(TTt),v7e,y7e,u1r=class extends(y7e=Th,v7e=c1r,y7e){constructor({message:t,cause:n,argument:r}){super({name:CTt,message:t,cause:n}),this[v7e]=!0,this.argument=r}static isInstance(t){return Th.hasMarker(t,TTt)}},jTt="AI_JSONParseError",ITt=`vercel.ai.error.${jTt}`,d1r=Symbol.for(ITt),b7e,x7e,U9=class extends(x7e=Th,b7e=d1r,x7e){constructor({text:t,cause:n}){super({name:jTt,message:`JSON parsing failed: Text: ${t}.
|
|
441
441
|
Error message: ${ETt(n)}`,cause:n}),this[b7e]=!0,this.text=t}static isInstance(t){return Th.hasMarker(t,ITt)}},NTt="AI_TypeValidationError",ATt=`vercel.ai.error.${NTt}`,f1r=Symbol.for(ATt),w7e,S7e,rO=class hhe extends(S7e=Th,w7e=f1r,S7e){constructor({value:t,cause:n,context:r}){let s="Type validation failed";if(r?.field&&(s+=` for ${r.field}`),r?.entityName||r?.entityId){s+=" (";const a=[];r.entityName&&a.push(r.entityName),r.entityId&&a.push(`id: "${r.entityId}"`),s+=a.join(", "),s+=")"}super({name:NTt,message:`${s}: Value: ${JSON.stringify(t)}.
|
|
442
442
|
Error message: ${ETt(n)}`,cause:n}),this[w7e]=!0,this.value=t,this.context=r}static isInstance(t){return Th.hasMarker(t,ATt)}static wrap({value:t,cause:n,context:r}){var s,a,i;return hhe.isInstance(n)&&n.value===t&&((s=n.context)==null?void 0:s.field)===r?.field&&((a=n.context)==null?void 0:a.entityName)===r?.entityName&&((i=n.context)==null?void 0:i.entityId)===r?.entityId?n:new hhe({value:t,cause:n,context:r})}},k7e=class extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},O7e=10,p1r=13,q1=32;function cee(e){}function h1r(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=cee,onError:n=cee,onRetry:r=cee,onComment:s}=e,a=[];let i=!0,o,c="",u=0,d;function f(b){if(i&&(i=!1,b.charCodeAt(0)===239&&b.charCodeAt(1)===187&&b.charCodeAt(2)===191&&(b=b.slice(3))),a.length===0){const O=p(b);O!==""&&a.push(O);return}if(b.indexOf(`
|
|
443
443
|
`)===-1&&b.indexOf("\r")===-1){a.push(b);return}a.push(b);const S=a.join("");a.length=0;const w=p(S);w!==""&&a.push(w)}function p(b){let S=0;if(b.indexOf("\r")===-1){let w=b.indexOf(`
|
|
@@ -481,7 +481,7 @@ Error message: ${bjt(n)}`,cause:n}),this[Tjt]=!0,this.value=t}static isInstance(
|
|
|
481
481
|
`:`[${r[c]}\r
|
|
482
482
|
]`;continue}s+=r[c],r[c]==="\\"?a=!0:i&&r[c]==="]"?i=!1:!i&&r[c]==="["&&(i=!0)}return s}function Mjt(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===Me.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((r,s)=>({...r,[s]:ba(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",s]})??Gd(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};const n={type:"object",additionalProperties:ba(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return n;if(e.keyType?._def.typeName===Me.ZodString&&e.keyType._def.checks?.length){const{type:r,...s}=Pjt(e.keyType._def,t);return{...n,propertyNames:s}}else{if(e.keyType?._def.typeName===Me.ZodEnum)return{...n,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===Me.ZodBranded&&e.keyType._def.type._def.typeName===Me.ZodString&&e.keyType._def.type._def.checks?.length){const{type:r,...s}=Ajt(e.keyType._def,t);return{...n,propertyNames:s}}}return n}function f_r(e,t){if(t.mapStrategy==="record")return Mjt(e,t);const n=ba(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Gd(t),r=ba(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Gd(t);return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function p_r(e){const t=e.values,r=Object.keys(e.values).filter(a=>typeof t[t[a]]!="number").map(a=>t[a]),s=Array.from(new Set(r.map(a=>typeof a)));return{type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:r}}function h_r(e){return e.target==="openAi"?void 0:{not:Gd({...e,currentPath:[...e.currentPath,"not"]})}}function m_r(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Z9={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function g_r(e,t){if(t.target==="openApi3")return pBe(e,t);const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in Z9&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((s,a)=>{const i=Z9[a._def.typeName];return i&&!s.includes(i)?[...s,i]:s},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((s,a)=>{const i=typeof a._def.value;switch(i){case"string":case"number":case"boolean":return[...s,i];case"bigint":return[...s,"integer"];case"object":if(a._def.value===null)return[...s,"null"];default:return s}},[]);if(r.length===n.length){const s=r.filter((a,i,o)=>o.indexOf(a)===i);return{type:s.length>1?s:s[0],enum:n.reduce((a,i)=>a.includes(i._def.value)?a:[...a,i._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,s)=>[...r,...s._def.values.filter(a=>!r.includes(a))],[])};return pBe(e,t)}var pBe=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,s)=>ba(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${s}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function v_r(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:Z9[e.innerType._def.typeName],nullable:!0}:{type:[Z9[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){const r=ba(e.innerType._def,{...t,currentPath:[...t.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:!0}:r&&{...r,nullable:!0}}const n=ba(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function y_r(e,t){const n={type:"number"};if(!e.checks)return n;for(const r of e.checks)switch(r.kind){case"int":n.type="integer",Ijt(n,"type",r.message,t);break;case"min":t.target==="jsonSchema7"?r.inclusive?Da(n,"minimum",r.value,r.message,t):Da(n,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),Da(n,"minimum",r.value,r.message,t));break;case"max":t.target==="jsonSchema7"?r.inclusive?Da(n,"maximum",r.value,r.message,t):Da(n,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),Da(n,"maximum",r.value,r.message,t));break;case"multipleOf":Da(n,"multipleOf",r.value,r.message,t);break}return n}function b_r(e,t){const n=t.target==="openAi",r={type:"object",properties:{}},s=[],a=e.shape();for(const o in a){let c=a[o];if(c===void 0||c._def===void 0)continue;let u=w_r(c);u&&n&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),u=!1);const d=ba(c._def,{...t,currentPath:[...t.currentPath,"properties",o],propertyPath:[...t.currentPath,"properties",o]});d!==void 0&&(r.properties[o]=d,u||s.push(o))}s.length&&(r.required=s);const i=x_r(e,t);return i!==void 0&&(r.additionalProperties=i),r}function x_r(e,t){if(e.catchall._def.typeName!=="ZodNever")return ba(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function w_r(e){try{return e.isOptional()}catch{return!0}}var S_r=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return ba(e.innerType._def,t);const n=ba(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Gd(t)},n]}:Gd(t)},k_r=(e,t)=>{if(t.pipeStrategy==="input")return ba(e.in._def,t);if(t.pipeStrategy==="output")return ba(e.out._def,t);const n=ba(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=ba(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(s=>s!==void 0)}};function O_r(e,t){return ba(e.type._def,t)}function __r(e,t){const r={type:"array",uniqueItems:!0,items:ba(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&Da(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&Da(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}function E_r(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>ba(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:ba(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>ba(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function C_r(e){return{not:Gd(e)}}function T_r(e){return Gd(e)}var j_r=(e,t)=>ba(e.innerType._def,t),I_r=(e,t,n)=>{switch(t){case Me.ZodString:return Pjt(e,n);case Me.ZodNumber:return y_r(e,n);case Me.ZodObject:return b_r(e,n);case Me.ZodBigInt:return e_r(e,n);case Me.ZodBoolean:return t_r();case Me.ZodDate:return Rjt(e,n);case Me.ZodUndefined:return C_r(n);case Me.ZodNull:return m_r(n);case Me.ZodArray:return JOr(e,n);case Me.ZodUnion:case Me.ZodDiscriminatedUnion:return g_r(e,n);case Me.ZodIntersection:return l_r(e,n);case Me.ZodTuple:return E_r(e,n);case Me.ZodRecord:return Mjt(e,n);case Me.ZodLiteral:return c_r(e,n);case Me.ZodEnum:return i_r(e);case Me.ZodNativeEnum:return p_r(e);case Me.ZodNullable:return v_r(e,n);case Me.ZodOptional:return S_r(e,n);case Me.ZodMap:return f_r(e,n);case Me.ZodSet:return __r(e,n);case Me.ZodLazy:return()=>e.getter()._def;case Me.ZodPromise:return O_r(e,n);case Me.ZodNaN:case Me.ZodNever:return h_r(n);case Me.ZodEffects:return a_r(e,n);case Me.ZodAny:return Gd(n);case Me.ZodUnknown:return T_r(n);case Me.ZodDefault:return s_r(e,n);case Me.ZodBranded:return Ajt(e,n);case Me.ZodReadonly:return j_r(e,n);case Me.ZodCatch:return n_r(e,n);case Me.ZodPipeline:return k_r(e,n);case Me.ZodFunction:case Me.ZodVoid:case Me.ZodSymbol:return;default:return(r=>{})()}};function ba(e,t,n=!1){const r=t.seen.get(e);if(t.override){const o=t.override?.(e,t,r,n);if(o!==YOr)return o}if(r&&!n){const o=N_r(r,t);if(o!==void 0)return o}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const a=I_r(e,e.typeName,t),i=typeof a=="function"?ba(a(),t):a;if(i&&A_r(e,t,i),t.postProcess){const o=t.postProcess(i,e,t);return s.jsonSchema=i,o}return s.jsonSchema=i,i}var N_r=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Njt(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Gd(t)):t.$refStrategy==="seen"?Gd(t):void 0}},A_r=(e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n),R_r=(e,t)=>{const n=KOr(t);let r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[u,d])=>({...c,[u]:ba(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,u]},!0)??Gd(n)}),{}):void 0;const s=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,a=ba(e._def,s===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,s]},!1)??Gd(n),i=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;i!==void 0&&(a.title=i),n.flags.hasReferencedOpenAiAnyType&&(r||(r={}),r[n.openAiAnyTypeName]||(r[n.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:n.$refStrategy==="relative"?"1":[...n.basePath,n.definitionPath,n.openAiAnyTypeName].join("/")}}));const o=s===void 0?r?{...a,[n.definitionPath]:r}:a:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,s].join("/"),[n.definitionPath]:{...r,[s]:a}};return n.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in o||"oneOf"in o||"allOf"in o||"type"in o&&Array.isArray(o.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),o},P_r=R_r;function M_r(e){const t=["ROOT"];let n=-1,r=null;function s(c,u,d){switch(c){case'"':{n=u,t.pop(),t.push(d),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=u,r=u,t.pop(),t.push(d),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=u,t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"{":{n=u,t.pop(),t.push(d),t.push("INSIDE_OBJECT_START");break}case"[":{n=u,t.pop(),t.push(d),t.push("INSIDE_ARRAY_START");break}}}function a(c,u){switch(c){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=u,t.pop();break}}}function i(c,u){switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=u,t.pop();break}}}for(let c=0;c<e.length;c++){const u=e[c];switch(t[t.length-1]){case"ROOT":s(u,c,"FINISH");break;case"INSIDE_OBJECT_START":{switch(u){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=c,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{u==='"'&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{u===":"&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{s(u,c,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{a(u,c);break}case"INSIDE_STRING":{switch(u){case'"':{t.pop(),n=c;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=c}break}case"INSIDE_ARRAY_START":{u==="]"?(n=c,t.pop()):(n=c,s(u,c,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}default:{n=c;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{s(u,c,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=c;break}case"INSIDE_NUMBER":{switch(u){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,c),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(u,c);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(u,c);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,c);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const f=e.substring(r,c+1);!"false".startsWith(f)&&!"true".startsWith(f)&&!"null".startsWith(f)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?a(u,c):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(u,c)):n=c;break}}}let o=e.slice(0,n+1);for(let c=t.length-1;c>=0;c--)switch(t[c]){case"INSIDE_STRING":{o+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{o+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{o+="]";break}case"INSIDE_LITERAL":{const d=e.substring(r,e.length);"true".startsWith(d)?o+="true".slice(d.length):"false".startsWith(d)?o+="false".slice(d.length):"null".startsWith(d)&&(o+="null".slice(d.length))}}return o}function $_r(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=bhe({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=bhe({text:M_r(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var D_r={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},L_r={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},z_r={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},F_r={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},B_r={code:"9",name:"tool_call",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string"||!("args"in e)||typeof e.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},U_r={code:"a",name:"tool_result",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},q_r={code:"b",name:"tool_call_streaming_start",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},V_r={code:"c",name:"tool_call_delta",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("argsTextDelta"in e)||typeof e.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},H_r={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_message" parts expect an object with a "finishReason" property.');const t={finishReason:e.finishReason};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),{type:"finish_message",value:t}}},Z_r={code:"e",name:"finish_step",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_step" parts expect an object with a "finishReason" property.');const t={finishReason:e.finishReason,isContinued:!1};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),"isContinued"in e&&typeof e.isContinued=="boolean"&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},W_r={code:"f",name:"start_step",parse:e=>{if(e==null||typeof e!="object"||!("messageId"in e)||typeof e.messageId!="string")throw new Error('"start_step" parts expect an object with an "id" property.');return{type:"start_step",value:{messageId:e.messageId}}}},G_r={code:"g",name:"reasoning",parse:e=>{if(typeof e!="string")throw new Error('"reasoning" parts expect a string value.');return{type:"reasoning",value:e}}},Q_r={code:"h",name:"source",parse:e=>{if(e==null||typeof e!="object")throw new Error('"source" parts expect a Source object.');return{type:"source",value:e}}},Y_r={code:"i",name:"redacted_reasoning",parse:e=>{if(e==null||typeof e!="object"||!("data"in e)||typeof e.data!="string")throw new Error('"redacted_reasoning" parts expect an object with a "data" property.');return{type:"redacted_reasoning",value:{data:e.data}}}},X_r={code:"j",name:"reasoning_signature",parse:e=>{if(e==null||typeof e!="object"||!("signature"in e)||typeof e.signature!="string")throw new Error('"reasoning_signature" parts expect an object with a "signature" property.');return{type:"reasoning_signature",value:{signature:e.signature}}}},K_r={code:"k",name:"file",parse:e=>{if(e==null||typeof e!="object"||!("data"in e)||typeof e.data!="string"||!("mimeType"in e)||typeof e.mimeType!="string")throw new Error('"file" parts expect an object with a "data" and "mimeType" property.');return{type:"file",value:e}}},iSe=[D_r,L_r,z_r,F_r,B_r,U_r,q_r,V_r,H_r,Z_r,W_r,G_r,Q_r,Y_r,X_r,K_r];Object.fromEntries(iSe.map(e=>[e.code,e]));Object.fromEntries(iSe.map(e=>[e.name,e.code]));function $jt(e,t){const n=iSe.find(r=>r.name===e);if(!n)throw new Error(`Invalid stream part type: ${e}`);return`${n.code}:${JSON.stringify(t)}
|
|
483
483
|
`}function J_r(e,t){var n;const r=(n=void 0)!=null?n:!1;return eEr(P_r(e,{$refStrategy:r?"root":"none",target:"jsonSchema7"}),{validate:s=>{const a=e.safeParse(s);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}var xhe=Symbol.for("vercel.ai.schema");function eEr(e,{validate:t}={}){return{[xhe]:!0,_type:void 0,[H9]:!0,jsonSchema:e,validate:t}}function tEr(e){return typeof e=="object"&&e!==null&&xhe in e&&e[xhe]===!0&&"jsonSchema"in e&&"validate"in e}function nEr(e){return tEr(e)?e:J_r(e)}var rEr=typeof globalThis=="object"?globalThis:global,MS="1.9.0",hBe=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function sEr(e){var t=new Set([e]),n=new Set,r=e.match(hBe);if(!r)return function(){return!1};var s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(s.prerelease!=null)return function(c){return c===e};function a(o){return n.add(o),!1}function i(o){return t.add(o),!0}return function(c){if(t.has(c))return!0;if(n.has(c))return!1;var u=c.match(hBe);if(!u)return a(c);var d={major:+u[1],minor:+u[2],patch:+u[3],prerelease:u[4]};return d.prerelease!=null||s.major!==d.major?a(c):s.major===0?s.minor===d.minor&&s.patch<=d.patch?i(c):a(c):s.minor<=d.minor?i(c):a(c)}}var aEr=sEr(MS),iEr=MS.split(".")[0],mM=Symbol.for("opentelemetry.js.api."+iEr),gM=rEr;function oSe(e,t,n,r){var s;r===void 0&&(r=!1);var a=gM[mM]=(s=gM[mM])!==null&&s!==void 0?s:{version:MS};if(!r&&a[e]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(i.stack||i.message),!1}if(a.version!==MS){var i=new Error("@opentelemetry/api: Registration of version v"+a.version+" for "+e+" does not match previously registered API v"+MS);return n.error(i.stack||i.message),!1}return a[e]=t,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+MS+"."),!0}function vM(e){var t,n,r=(t=gM[mM])===null||t===void 0?void 0:t.version;if(!(!r||!aEr(r)))return(n=gM[mM])===null||n===void 0?void 0:n[e]}function lSe(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+MS+".");var n=gM[mM];n&&delete n[e]}var oEr=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,a=[],i;try{for(;!(s=r.next()).done;)a.push(s.value)}catch(o){i={error:o}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},lEr=function(e,t,n){if(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))},cEr=(function(){function e(t){this._namespace=t.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return vA("debug",this._namespace,t)},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return vA("error",this._namespace,t)},e.prototype.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return vA("info",this._namespace,t)},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return vA("warn",this._namespace,t)},e.prototype.verbose=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return vA("verbose",this._namespace,t)},e})();function vA(e,t,n){var r=vM("diag");if(r)return n.unshift(t),r[e].apply(r,lEr([],oEr(n),!1))}var If;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(If||(If={}));function uEr(e,t){e<If.NONE?e=If.NONE:e>If.ALL&&(e=If.ALL),t=t||{};function n(r,s){var a=t[r];return typeof a=="function"&&e>=s?a.bind(t):function(){}}return{error:n("error",If.ERROR),warn:n("warn",If.WARN),info:n("info",If.INFO),debug:n("debug",If.DEBUG),verbose:n("verbose",If.VERBOSE)}}var dEr=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,a=[],i;try{for(;!(s=r.next()).done;)a.push(s.value)}catch(o){i={error:o}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},fEr=function(e,t,n){if(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))},pEr="diag",W9=(function(){function e(){function t(s){return function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var o=vM("diag");if(o)return o[s].apply(o,fEr([],dEr(a),!1))}}var n=this,r=function(s,a){var i,o,c;if(a===void 0&&(a={logLevel:If.INFO}),s===n){var u=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((i=u.stack)!==null&&i!==void 0?i:u.message),!1}typeof a=="number"&&(a={logLevel:a});var d=vM("diag"),f=uEr((o=a.logLevel)!==null&&o!==void 0?o:If.INFO,s);if(d&&!a.suppressOverrideMessage){var p=(c=new Error().stack)!==null&&c!==void 0?c:"<failed to generate stacktrace>";d.warn("Current logger will be overwritten from "+p),f.warn("Current logger will overwrite one already registered from "+p)}return oSe("diag",f,n,!0)};n.setLogger=r,n.disable=function(){lSe(pEr,n)},n.createComponentLogger=function(s){return new cEr(s)},n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e})();function hEr(e){return Symbol.for(e)}var mEr=(function(){function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(r){return n._currentContext.get(r)},n.setValue=function(r,s){var a=new e(n._currentContext);return a._currentContext.set(r,s),a},n.deleteValue=function(r){var s=new e(n._currentContext);return s._currentContext.delete(r),s}}return e})(),gEr=new mEr,vEr=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,a=[],i;try{for(;!(s=r.next()).done;)a.push(s.value)}catch(o){i={error:o}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},yEr=function(e,t,n){if(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))},bEr=(function(){function e(){}return e.prototype.active=function(){return gEr},e.prototype.with=function(t,n,r){for(var s=[],a=3;a<arguments.length;a++)s[a-3]=arguments[a];return n.call.apply(n,yEr([r],vEr(s),!1))},e.prototype.bind=function(t,n){return n},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e})(),xEr=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,a=[],i;try{for(;!(s=r.next()).done;)a.push(s.value)}catch(o){i={error:o}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},wEr=function(e,t,n){if(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))},yee="context",SEr=new bEr,Djt=(function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(t){return oSe(yee,t,W9.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(t,n,r){for(var s,a=[],i=3;i<arguments.length;i++)a[i-3]=arguments[i];return(s=this._getContextManager()).with.apply(s,wEr([t,n,r],xEr(a),!1))},e.prototype.bind=function(t,n){return this._getContextManager().bind(t,n)},e.prototype._getContextManager=function(){return vM(yee)||SEr},e.prototype.disable=function(){this._getContextManager().disable(),lSe(yee,W9.instance())},e})(),whe;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(whe||(whe={}));var Ljt="0000000000000000",zjt="00000000000000000000000000000000",kEr={traceId:zjt,spanId:Ljt,traceFlags:whe.NONE},LR=(function(){function e(t){t===void 0&&(t=kEr),this._spanContext=t}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(t,n){return this},e.prototype.setAttributes=function(t){return this},e.prototype.addEvent=function(t,n){return this},e.prototype.addLink=function(t){return this},e.prototype.addLinks=function(t){return this},e.prototype.setStatus=function(t){return this},e.prototype.updateName=function(t){return this},e.prototype.end=function(t){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(t,n){},e})(),cSe=hEr("OpenTelemetry Context Key SPAN");function uSe(e){return e.getValue(cSe)||void 0}function OEr(){return uSe(Djt.getInstance().active())}function dSe(e,t){return e.setValue(cSe,t)}function _Er(e){return e.deleteValue(cSe)}function EEr(e,t){return dSe(e,new LR(t))}function Fjt(e){var t;return(t=uSe(e))===null||t===void 0?void 0:t.spanContext()}var CEr=/^([0-9a-f]{32})$/i,TEr=/^[0-9a-f]{16}$/i;function jEr(e){return CEr.test(e)&&e!==zjt}function IEr(e){return TEr.test(e)&&e!==Ljt}function Bjt(e){return jEr(e.traceId)&&IEr(e.spanId)}function NEr(e){return new LR(e)}var bee=Djt.getInstance(),Ujt=(function(){function e(){}return e.prototype.startSpan=function(t,n,r){r===void 0&&(r=bee.active());var s=!!n?.root;if(s)return new LR;var a=r&&Fjt(r);return AEr(a)&&Bjt(a)?new LR(a):new LR},e.prototype.startActiveSpan=function(t,n,r,s){var a,i,o;if(!(arguments.length<2)){arguments.length===2?o=n:arguments.length===3?(a=n,o=r):(a=n,i=r,o=s);var c=i??bee.active(),u=this.startSpan(t,a,c),d=dSe(c,u);return bee.with(d,o,void 0,u)}},e})();function AEr(e){return typeof e=="object"&&typeof e.spanId=="string"&&typeof e.traceId=="string"&&typeof e.traceFlags=="number"}var REr=new Ujt,PEr=(function(){function e(t,n,r,s){this._provider=t,this.name=n,this.version=r,this.options=s}return e.prototype.startSpan=function(t,n,r){return this._getTracer().startSpan(t,n,r)},e.prototype.startActiveSpan=function(t,n,r,s){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):REr},e})(),MEr=(function(){function e(){}return e.prototype.getTracer=function(t,n,r){return new Ujt},e})(),$Er=new MEr,mBe=(function(){function e(){}return e.prototype.getTracer=function(t,n,r){var s;return(s=this.getDelegateTracer(t,n,r))!==null&&s!==void 0?s:new PEr(this,t,n,r)},e.prototype.getDelegate=function(){var t;return(t=this._delegate)!==null&&t!==void 0?t:$Er},e.prototype.setDelegate=function(t){this._delegate=t},e.prototype.getDelegateTracer=function(t,n,r){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getTracer(t,n,r)},e})(),gBe;(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(gBe||(gBe={}));var xee="trace",DEr=(function(){function e(){this._proxyTracerProvider=new mBe,this.wrapSpanContext=NEr,this.isSpanContextValid=Bjt,this.deleteSpan=_Er,this.getSpan=uSe,this.getActiveSpan=OEr,this.getSpanContext=Fjt,this.setSpan=dSe,this.setSpanContext=EEr}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(t){var n=oSe(xee,this._proxyTracerProvider,W9.instance());return n&&this._proxyTracerProvider.setDelegate(t),n},e.prototype.getTracerProvider=function(){return vM(xee)||this._proxyTracerProvider},e.prototype.getTracer=function(t,n){return this.getTracerProvider().getTracer(t,n)},e.prototype.disable=function(){lSe(xee,W9.instance()),this._proxyTracerProvider=new mBe},e})();DEr.getInstance();var LEr=Object.defineProperty,fSe=(e,t)=>{for(var n in t)LEr(e,n,{get:t[n],enumerable:!0})};function qjt(e,{contentType:t,dataStreamVersion:n}){const r=new Headers(e??{});return r.has("Content-Type")||r.set("Content-Type",t),r.set("X-Vercel-AI-Data-Stream",n),r}var Vjt="AI_NoObjectGeneratedError",Hjt=`vercel.ai.error.${Vjt}`,zEr=Symbol.for(Hjt),Zjt,vBe=class extends jh{constructor({message:e="No object generated.",cause:t,text:n,response:r,usage:s,finishReason:a}){super({name:Vjt,message:e,cause:t}),this[Zjt]=!0,this.text=n,this.response=r,this.usage=s,this.finishReason=a}static isInstance(e){return jh.hasMarker(e,Hjt)}};Zjt=zEr;var Wjt="AI_InvalidDataContentError",Gjt=`vercel.ai.error.${Wjt}`,FEr=Symbol.for(Gjt),Qjt,yBe=class extends jh{constructor({content:e,cause:t,message:n=`Invalid data content. Expected a base64 string, Uint8Array, ArrayBuffer, or Buffer, but got ${typeof e}.`}){super({name:Wjt,message:n,cause:t}),this[Qjt]=!0,this.content=e}static isInstance(e){return jh.hasMarker(e,Gjt)}};Qjt=FEr;var Yjt=or([ve(),vh(Uint8Array),vh(ArrayBuffer),_me(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?n:!1},{message:"Must be a Buffer"})]);function bBe(e){if(e instanceof Uint8Array)return e;if(typeof e=="string")try{return QOr(e)}catch(t){throw new yBe({message:"Invalid data content. Content string is not a base64-encoded media.",content:e,cause:t})}if(e instanceof ArrayBuffer)return new Uint8Array(e);throw new yBe({content:e})}function BEr(e){try{return new TextDecoder().decode(e)}catch{throw new Error("Error decoding Uint8Array to text")}}function xBe(e){var t,n,r;const s=[];for(const a of e){let i;try{i=new URL(a.url)}catch{throw new Error(`Invalid URL: ${a.url}`)}switch(i.protocol){case"http:":case"https:":{if((t=a.contentType)!=null&&t.startsWith("image/"))s.push({type:"image",image:i});else{if(!a.contentType)throw new Error("If the attachment is not an image, it must specify a content type");s.push({type:"file",data:i,mimeType:a.contentType})}break}case"data:":{let o,c,u;try{[o,c]=a.url.split(","),u=o.split(";")[0].split(":")[1]}catch{throw new Error(`Error processing data URL: ${a.url}`)}if(u==null||c==null)throw new Error(`Invalid data URL format: ${a.url}`);if((n=a.contentType)!=null&&n.startsWith("image/"))s.push({type:"image",image:bBe(c)});else if((r=a.contentType)!=null&&r.startsWith("text/"))s.push({type:"text",text:BEr(bBe(c))});else{if(!a.contentType)throw new Error("If the attachment is not an image or text, it must specify a content type");s.push({type:"file",data:c,mimeType:a.contentType})}break}default:throw new Error(`Unsupported URL protocol: ${i.protocol}`)}}return s}var Xjt="AI_MessageConversionError",Kjt=`vercel.ai.error.${Xjt}`,UEr=Symbol.for(Kjt),Jjt,wee=class extends jh{constructor({originalMessage:e,message:t}){super({name:Xjt,message:t}),this[Jjt]=!0,this.originalMessage=e}static isInstance(e){return jh.hasMarker(e,Kjt)}};Jjt=UEr;function qEr(e,t){var n,r;const s=(n=void 0)!=null?n:{},a=[];for(let i=0;i<e.length;i++){const o=e[i],c=i===e.length-1,{role:u,content:d,experimental_attachments:f}=o;switch(u){case"system":{a.push({role:"system",content:d});break}case"user":{if(o.parts==null)a.push({role:"user",content:f?[{type:"text",text:d},...xBe(f)]:d});else{const p=o.parts.filter(h=>h.type==="text").map(h=>({type:"text",text:h.text}));a.push({role:"user",content:f?[...p,...xBe(f)]:p})}break}case"assistant":{if(o.parts!=null){let m=function(){const S=[];for(const O of b)switch(O.type){case"file":case"text":{S.push(O);break}case"reasoning":{for(const E of O.details)switch(E.type){case"text":S.push({type:"reasoning",text:E.text,signature:E.signature});break;case"redacted":S.push({type:"redacted-reasoning",data:E.data});break}break}case"tool-invocation":S.push({type:"tool-call",toolCallId:O.toolInvocation.toolCallId,toolName:O.toolInvocation.toolName,args:O.toolInvocation.args});break;default:{const E=O;throw new Error(`Unsupported part: ${E}`)}}a.push({role:"assistant",content:S});const w=b.filter(O=>O.type==="tool-invocation").map(O=>O.toolInvocation);w.length>0&&a.push({role:"tool",content:w.map(O=>{if(!("result"in O))throw new wee({originalMessage:o,message:"ToolInvocation must have a result: "+JSON.stringify(O)});const{toolCallId:E,toolName:_,result:C}=O,j=s[_];return j?.experimental_toToolResultContent!=null?{type:"tool-result",toolCallId:E,toolName:_,result:j.experimental_toToolResultContent(C),experimental_content:j.experimental_toToolResultContent(C)}:{type:"tool-result",toolCallId:E,toolName:_,result:C}})}),b=[],v=!1,g++},g=0,v=!1,b=[];for(const S of o.parts)switch(S.type){case"text":{v&&m(),b.push(S);break}case"file":case"reasoning":{b.push(S);break}case"tool-invocation":{((r=S.toolInvocation.step)!=null?r:0)!==g&&m(),b.push(S),v=!0;break}}m();break}const p=o.toolInvocations;if(p==null||p.length===0){a.push({role:"assistant",content:d});break}const h=p.reduce((m,g)=>{var v;return Math.max(m,(v=g.step)!=null?v:0)},0);for(let m=0;m<=h;m++){const g=p.filter(v=>{var b;return((b=v.step)!=null?b:0)===m});g.length!==0&&(a.push({role:"assistant",content:[...c&&d&&m===0?[{type:"text",text:d}]:[],...g.map(({toolCallId:v,toolName:b,args:S})=>({type:"tool-call",toolCallId:v,toolName:b,args:S}))]}),a.push({role:"tool",content:g.map(v=>{if(!("result"in v))throw new wee({originalMessage:o,message:"ToolInvocation must have a result: "+JSON.stringify(v)});const{toolCallId:b,toolName:S,result:w}=v,O=s[S];return O?.experimental_toToolResultContent!=null?{type:"tool-result",toolCallId:b,toolName:S,result:O.experimental_toToolResultContent(w),experimental_content:O.experimental_toToolResultContent(w)}:{type:"tool-result",toolCallId:b,toolName:S,result:w}})}))}d&&!c&&a.push({role:"assistant",content:d});break}case"data":break;default:{const p=u;throw new wee({originalMessage:o,message:`Unsupported role: ${p}`})}}}return a}var She=kme(()=>or([wme(),ve(),jt(),Ao(),ra(ve(),She),Lt(She)])),Fo=ra(ve(),ra(ve(),She)),VEr=Lt(or([Te({type:rn("text"),text:ve()}),Te({type:rn("image"),data:ve(),mimeType:ve().optional()})])),eIt=Te({type:rn("text"),text:ve(),providerOptions:Fo.optional(),experimental_providerMetadata:Fo.optional()}),HEr=Te({type:rn("image"),image:or([Yjt,vh(URL)]),mimeType:ve().optional(),providerOptions:Fo.optional(),experimental_providerMetadata:Fo.optional()}),tIt=Te({type:rn("file"),data:or([Yjt,vh(URL)]),filename:ve().optional(),mimeType:ve(),providerOptions:Fo.optional(),experimental_providerMetadata:Fo.optional()}),ZEr=Te({type:rn("reasoning"),text:ve(),providerOptions:Fo.optional(),experimental_providerMetadata:Fo.optional()}),WEr=Te({type:rn("redacted-reasoning"),data:ve(),providerOptions:Fo.optional(),experimental_providerMetadata:Fo.optional()}),GEr=Te({type:rn("tool-call"),toolCallId:ve(),toolName:ve(),args:ti(),providerOptions:Fo.optional(),experimental_providerMetadata:Fo.optional()}),QEr=Te({type:rn("tool-result"),toolCallId:ve(),toolName:ve(),result:ti(),content:VEr.optional(),isError:Ao().optional(),providerOptions:Fo.optional(),experimental_providerMetadata:Fo.optional()}),YEr=Te({role:rn("system"),content:ve(),providerOptions:Fo.optional(),experimental_providerMetadata:Fo.optional()}),XEr=Te({role:rn("user"),content:or([ve(),Lt(or([eIt,HEr,tIt]))]),providerOptions:Fo.optional(),experimental_providerMetadata:Fo.optional()}),KEr=Te({role:rn("assistant"),content:or([ve(),Lt(or([eIt,tIt,ZEr,WEr,GEr]))]),providerOptions:Fo.optional(),experimental_providerMetadata:Fo.optional()}),JEr=Te({role:rn("tool"),content:Lt(QEr),providerOptions:Fo.optional(),experimental_providerMetadata:Fo.optional()});or([YEr,XEr,KEr,JEr]);var eCr="JSON schema:",tCr="You MUST answer with a JSON object that matches the JSON schema above.",nCr="You MUST answer with JSON.";function rCr({prompt:e,schema:t,schemaPrefix:n=t!=null?eCr:void 0,schemaSuffix:r=t!=null?tCr:nCr}){return[e!=null&&e.length>0?e:void 0,e!=null&&e.length>0?"":void 0,n,t!=null?JSON.stringify(t):void 0,r].filter(s=>s!=null).join(`
|
|
484
|
-
`)}$O({prefix:"aiobj",size:24});$O({prefix:"aiobj",size:24});$O({prefix:"aitxt",size:24});$O({prefix:"msg",size:24});var sCr={};fSe(sCr,{object:()=>iCr,text:()=>aCr});var aCr=()=>({type:"text",responseFormat:()=>({type:"text"}),injectIntoSystemPrompt({system:e}){return e},parsePartial({text:e}){return{partial:e}},parseOutput({text:e}){return e}}),iCr=({schema:e})=>{const t=nEr(e);return{type:"object",responseFormat:({model:n})=>({type:"json",schema:n.supportsStructuredOutputs?t.jsonSchema:void 0}),injectIntoSystemPrompt({system:n,model:r}){return r.supportsStructuredOutputs?n:rCr({prompt:n,schema:t.jsonSchema})},parsePartial({text:n}){const r=$_r(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:r.value};default:{const s=r.state;throw new Error(`Unsupported parse state: ${s}`)}}},parseOutput({text:n},r){const s=bhe({text:n});if(!s.success)throw new vBe({message:"No object generated: could not parse the response.",cause:s.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});const a=jjt({value:s.value,schema:t});if(!a.success)throw new vBe({message:"No object generated: response did not match schema.",cause:a.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return a.value}}};function nIt(e,t){const n=e.getReader(),r=t.getReader();let s,a,i=!1,o=!1;async function c(d){try{s==null&&(s=n.read());const f=await s;s=void 0,f.done?d.close():d.enqueue(f.value)}catch(f){d.error(f)}}async function u(d){try{a==null&&(a=r.read());const f=await a;a=void 0,f.done?d.close():d.enqueue(f.value)}catch(f){d.error(f)}}return new ReadableStream({async pull(d){try{if(i){await u(d);return}if(o){await c(d);return}s==null&&(s=n.read()),a==null&&(a=r.read());const{result:f,reader:p}=await Promise.race([s.then(h=>({result:h,reader:n})),a.then(h=>({result:h,reader:r}))]);f.done||d.enqueue(f.value),p===n?(s=void 0,f.done&&(await u(d),i=!0)):(a=void 0,f.done&&(o=!0,await c(d)))}catch(f){d.error(f)}},cancel(){n.cancel(),r.cancel()}})}$O({prefix:"aitxt",size:24});$O({prefix:"msg",size:24});var oCr=Te({name:ve(),version:ve()}).passthrough(),pSe=Te({_meta:dl(Te({}).passthrough())}).passthrough(),yM=pSe,lCr=Te({method:ve(),params:dl(pSe)}),cCr=Te({experimental:dl(Te({}).passthrough()),logging:dl(Te({}).passthrough()),prompts:dl(Te({listChanged:dl(Ao())}).passthrough()),resources:dl(Te({subscribe:dl(Ao()),listChanged:dl(Ao())}).passthrough()),tools:dl(Te({listChanged:dl(Ao())}).passthrough())}).passthrough();yM.extend({protocolVersion:ve(),capabilities:cCr,serverInfo:oCr,instructions:dl(ve())});var uCr=yM.extend({nextCursor:dl(ve())}),dCr=Te({name:ve(),description:dl(ve()),inputSchema:Te({type:rn("object"),properties:dl(Te({}).passthrough())}).passthrough()}).passthrough();uCr.extend({tools:Lt(dCr)});var fCr=Te({type:rn("text"),text:ve()}).passthrough(),pCr=Te({type:rn("image"),data:ve().base64(),mimeType:ve()}).passthrough(),rIt=Te({uri:ve(),mimeType:dl(ve())}).passthrough(),hCr=rIt.extend({text:ve()}),mCr=rIt.extend({blob:ve().base64()}),gCr=Te({type:rn("resource"),resource:or([hCr,mCr])}).passthrough();yM.extend({content:Lt(or([fCr,pCr,gCr])),isError:Ao().default(!1).optional()}).or(yM.extend({toolResult:ti()}));var vV="2.0",vCr=Te({jsonrpc:rn(vV),id:or([ve(),jt().int()])}).merge(lCr).strict(),yCr=Te({jsonrpc:rn(vV),id:or([ve(),jt().int()]),result:yM}).strict(),bCr=Te({jsonrpc:rn(vV),id:or([ve(),jt().int()]),error:Te({code:jt().int(),message:ve(),data:dl(ti())})}).strict(),xCr=Te({jsonrpc:rn(vV)}).merge(Te({method:ve(),params:dl(pSe)})).strict();or([vCr,xCr,yCr,bCr]);var wCr={};fSe(wCr,{mergeIntoDataStream:()=>OCr,toDataStream:()=>SCr,toDataStreamResponse:()=>kCr});function sIt(e={}){const t=new TextEncoder;let n="";return new TransformStream({async start(){e.onStart&&await e.onStart()},async transform(r,s){s.enqueue(t.encode(r)),n+=r,e.onToken&&await e.onToken(r),e.onText&&typeof r=="string"&&await e.onText(r)},async flush(){e.onCompletion&&await e.onCompletion(n),e.onFinal&&await e.onFinal(n)}})}function hSe(e,t){return e.pipeThrough(new TransformStream({transform:async(n,r)=>{var s;if(typeof n=="string"){r.enqueue(n);return}if("event"in n){n.event==="on_chat_model_stream"&&wBe((s=n.data)==null?void 0:s.chunk,r);return}wBe(n,r)}})).pipeThrough(sIt(t)).pipeThrough(new TextDecoderStream).pipeThrough(new TransformStream({transform:async(n,r)=>{r.enqueue($jt("text",n))}}))}function SCr(e,t){return hSe(e,t).pipeThrough(new TextEncoderStream)}function kCr(e,t){var n;const r=hSe(e,t?.callbacks).pipeThrough(new TextEncoderStream),s=t?.data,a=t?.init,i=s?nIt(s.stream,r):r;return new Response(i,{status:(n=a?.status)!=null?n:200,statusText:a?.statusText,headers:qjt(a?.headers,{contentType:"text/plain; charset=utf-8",dataStreamVersion:"v1"})})}function OCr(e,t){t.dataStream.merge(hSe(e,t.callbacks))}function wBe(e,t){if(typeof e.content=="string")t.enqueue(e.content);else{const n=e.content;for(const r of n)r.type==="text"&&t.enqueue(r.text)}}var _Cr={};fSe(_Cr,{mergeIntoDataStream:()=>TCr,toDataStream:()=>ECr,toDataStreamResponse:()=>CCr});function mSe(e,t){const n=jCr();return qOr(e[Symbol.asyncIterator]()).pipeThrough(new TransformStream({async transform(r,s){s.enqueue(n(r.delta))}})).pipeThrough(sIt(t)).pipeThrough(new TextDecoderStream).pipeThrough(new TransformStream({transform:async(r,s)=>{s.enqueue($jt("text",r))}}))}function ECr(e,t){return mSe(e,t).pipeThrough(new TextEncoderStream)}function CCr(e,t={}){var n;const{init:r,data:s,callbacks:a}=t,i=mSe(e,a).pipeThrough(new TextEncoderStream),o=s?nIt(s.stream,i):i;return new Response(o,{status:(n=r?.status)!=null?n:200,statusText:r?.statusText,headers:qjt(r?.headers,{contentType:"text/plain; charset=utf-8",dataStreamVersion:"v1"})})}function TCr(e,t){t.dataStream.merge(mSe(e,t.callbacks))}function jCr(){let e=!0;return t=>(e&&(t=t.trimStart(),t&&(e=!1)),t)}var ICr=()=>!0;async function NCr(e,t={},n=3,r={}){let s=0,a=null;const i=r.shouldRetryResponse??ICr;for(;s<n;){let o;try{o=await fetch(e,t)}catch(u){a=u instanceof Error?u:new Error(String(u))}if(o){if(o.ok)return o;if(a=new Error(`Request failed with status: ${o.status} ${o.statusText}`),!i(o))throw a}if(s++,s>=n)break;const c=Math.min(1e3*Math.pow(2,s),1e4);await new Promise(u=>setTimeout(u,c))}throw a||new Error("Request failed after multiple retry attempts")}var aIt="vercel.ai.error",ACr=Symbol.for(aIt),SBe,kBe,OBe=class iIt extends(kBe=Error,SBe=ACr,kBe){constructor({name:t,message:n,cause:r}){super(n),this[SBe]=!0,this.name=t,this.cause=r}static isInstance(t){return iIt.hasMarker(t,aIt)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}},oIt="AI_InvalidArgumentError",lIt=`vercel.ai.error.${oIt}`,RCr=Symbol.for(lIt),_Be,EBe,PCr=class extends(EBe=OBe,_Be=RCr,EBe){constructor({message:e,cause:t,argument:n}){super({name:oIt,message:e,cause:t}),this[_Be]=!0,this.argument=n}static isInstance(e){return OBe.hasMarker(e,lIt)}},MCr=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const a=n.length,i=new Array(t);for(let o=0;o<t;o++)i[o]=n[Math.random()*a|0];return i.join("")};if(e==null)return s;if(n.includes(r))throw new PCr({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${s()}`};MCr();function $Cr({mediaType:e,url:t,supportedUrls:n}){return t=t.toLowerCase(),e=e.toLowerCase(),Object.entries(n).map(([r,s])=>{const a=r.toLowerCase();return a==="*"||a==="*/*"?{mediaTypePrefix:"",regexes:s}:{mediaTypePrefix:a.replace(/\*/,""),regexes:s}}).filter(({mediaTypePrefix:r})=>e.startsWith(r)).flatMap(({regexes:r})=>r).some(r=>r.test(t))}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var{btoa:DCr,atob:LCr}=globalThis;function cIt(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=LCr(t);return Uint8Array.from(n,r=>r.codePointAt(0))}function khe(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCodePoint(e[n]);return DCr(t)}function aO(e){return typeof e=="string"?e:e instanceof ArrayBuffer?khe(new Uint8Array(e)):khe(e)}function zCr(e){return{...e,id:e.id??crypto.randomUUID(),createdAt:e.createdAt instanceof Date?e.createdAt:e.createdAt?new Date(e.createdAt):new Date,acceptedAt:e.acceptedAt instanceof Date?e.acceptedAt:e.acceptedAt?new Date(e.acceptedAt):void 0}}function uIt(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function FCr(e){return uIt(e).replaceAll('"',""")}var BCr=/^[A-Za-z_][A-Za-z0-9_.-]*$/;function dIt(e,t){if(!BCr.test(e))throw new Error(`Invalid signal XML ${t}: ${e}`)}function UCr(e){if(!e)return"";const t=Object.entries(e).filter(n=>n[1]!==null&&n[1]!==void 0).map(([n,r])=>(dIt(n,"attribute name"),`${n}="${FCr(String(r))}"`)).join(" ");return t?` ${t}`:""}function Ohe(e){dIt(e.type,"tag name");const t=UCr(e.attributes);return e.contents?`<${e.type}${t}>${uIt(e.contents)}</${e.type}>`:`<${e.type}${t} />`}function qCr(e){if(typeof e=="string")return e;if(Array.isArray(e)){const n=[];for(const r of e){if(typeof r=="string"){n.push({type:"text",text:r});continue}const s=CBe(r);if(!s)return;n.push(...s)}return jBe(n)}const t=CBe(e);return t?jBe(t):void 0}function CBe(e){if(!e||typeof e!="object")return;const t=e;if(t.role==="user"&&"content"in t){const r=t.content;if(typeof r=="string")return[{type:"text",text:r}];if(Array.isArray(r)){const s=[];for(const a of r){const i=TBe(a);if(!i)return;s.push(i)}return s}return}const n=TBe(t);return n?[n]:void 0}function TBe(e){if(!e||typeof e!="object")return;const t=e,n=t.providerOptions&&typeof t.providerOptions=="object"&&!Array.isArray(t.providerOptions)?t.providerOptions:void 0;if(t.type==="text"&&typeof t.text=="string")return{type:"text",text:t.text,...n?{providerOptions:n}:{}};if(t.type==="file"||t.type==="image"){const r=t.type==="image"?t.image??t.data:t.data;if(typeof r!="string")return;const s=typeof t.mediaType=="string"?t.mediaType:typeof t.mimeType=="string"?t.mimeType:t.type==="image"?"image/png":"";return s?{type:"file",data:r,mediaType:s,...typeof t.filename=="string"?{filename:t.filename}:{},...n?{providerOptions:n}:{}}:void 0}}function jBe(e){if(e.length===0)return;const t=e[0];return e.length===1&&t?.type==="text"?t.text:e}function VCr(e){return typeof e=="string"?[{type:"text",text:e}]:e.map(t=>t.type==="file"?{type:"file",data:t.data instanceof URL?t.data.toString():aO(t.data),mediaType:t.mediaType,...t.filename?{filename:t.filename}:{},...t.providerOptions?{providerOptions:t.providerOptions}:{}}:{type:"text",text:t.text,...t.providerOptions?{providerOptions:t.providerOptions}:{}})}function HCr(e){const t=[];for(const n of e){const r=n.providerMetadata;if(n.type==="text")t.push({type:"text",text:n.text,...r?{providerOptions:r}:{}});else if(n.type==="file"&&typeof n.data=="string"){const s=n;t.push({type:"file",data:s.data,mediaType:typeof s.mimeType=="string"?s.mimeType:"",...typeof s.filename=="string"?{filename:s.filename}:{},...r?{providerOptions:r}:{}})}}return t}function fIt(e){return e.length===1&&e[0]?.type==="text"&&!e[0].providerOptions?e[0].text:e.map(t=>t.type==="file"?{type:"file",data:t.data,mediaType:t.mediaType,...t.filename?{filename:t.filename}:{},...t.providerOptions?{providerOptions:t.providerOptions}:{}}:{type:"text",text:t.text,...t.providerOptions?{providerOptions:t.providerOptions}:{}})}function ZCr(e){return e?Object.keys(e).some(t=>{const n=e[t];return n!=null}):!1}function WCr(e,t){let n=!1;const r=[];for(const s of t)!n&&s.type==="text"?(n=!0,r.push({...s,text:Ohe({...e,contents:s.text})})):r.push(s);if(!n){const s=Ohe({type:e.type,attributes:e.attributes});r.unshift({type:"text",text:s})}return r}function GCr(e,t){const n=e.type==="user-message",r=ZCr(e.attributes),s=t.some(i=>i.providerOptions);let a;return n&&!r?a=t.length===1&&t[0]?.type==="text"&&!t[0].providerOptions?t[0].text:t:t.every(i=>i.type==="text")&&!s?a=Ohe({...e,contents:t.map(i=>i.text).join(`
|
|
484
|
+
`)}$O({prefix:"aiobj",size:24});$O({prefix:"aiobj",size:24});$O({prefix:"aitxt",size:24});$O({prefix:"msg",size:24});var sCr={};fSe(sCr,{object:()=>iCr,text:()=>aCr});var aCr=()=>({type:"text",responseFormat:()=>({type:"text"}),injectIntoSystemPrompt({system:e}){return e},parsePartial({text:e}){return{partial:e}},parseOutput({text:e}){return e}}),iCr=({schema:e})=>{const t=nEr(e);return{type:"object",responseFormat:({model:n})=>({type:"json",schema:n.supportsStructuredOutputs?t.jsonSchema:void 0}),injectIntoSystemPrompt({system:n,model:r}){return r.supportsStructuredOutputs?n:rCr({prompt:n,schema:t.jsonSchema})},parsePartial({text:n}){const r=$_r(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:r.value};default:{const s=r.state;throw new Error(`Unsupported parse state: ${s}`)}}},parseOutput({text:n},r){const s=bhe({text:n});if(!s.success)throw new vBe({message:"No object generated: could not parse the response.",cause:s.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});const a=jjt({value:s.value,schema:t});if(!a.success)throw new vBe({message:"No object generated: response did not match schema.",cause:a.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return a.value}}};function nIt(e,t){const n=e.getReader(),r=t.getReader();let s,a,i=!1,o=!1;async function c(d){try{s==null&&(s=n.read());const f=await s;s=void 0,f.done?d.close():d.enqueue(f.value)}catch(f){d.error(f)}}async function u(d){try{a==null&&(a=r.read());const f=await a;a=void 0,f.done?d.close():d.enqueue(f.value)}catch(f){d.error(f)}}return new ReadableStream({async pull(d){try{if(i){await u(d);return}if(o){await c(d);return}s==null&&(s=n.read()),a==null&&(a=r.read());const{result:f,reader:p}=await Promise.race([s.then(h=>({result:h,reader:n})),a.then(h=>({result:h,reader:r}))]);f.done||d.enqueue(f.value),p===n?(s=void 0,f.done&&(await u(d),i=!0)):(a=void 0,f.done&&(o=!0,await c(d)))}catch(f){d.error(f)}},cancel(){n.cancel(),r.cancel()}})}$O({prefix:"aitxt",size:24});$O({prefix:"msg",size:24});var oCr=Te({name:ve(),version:ve()}).passthrough(),pSe=Te({_meta:dl(Te({}).passthrough())}).passthrough(),yM=pSe,lCr=Te({method:ve(),params:dl(pSe)}),cCr=Te({experimental:dl(Te({}).passthrough()),logging:dl(Te({}).passthrough()),prompts:dl(Te({listChanged:dl(Ao())}).passthrough()),resources:dl(Te({subscribe:dl(Ao()),listChanged:dl(Ao())}).passthrough()),tools:dl(Te({listChanged:dl(Ao())}).passthrough())}).passthrough();yM.extend({protocolVersion:ve(),capabilities:cCr,serverInfo:oCr,instructions:dl(ve())});var uCr=yM.extend({nextCursor:dl(ve())}),dCr=Te({name:ve(),description:dl(ve()),inputSchema:Te({type:rn("object"),properties:dl(Te({}).passthrough())}).passthrough()}).passthrough();uCr.extend({tools:Lt(dCr)});var fCr=Te({type:rn("text"),text:ve()}).passthrough(),pCr=Te({type:rn("image"),data:ve().base64(),mimeType:ve()}).passthrough(),rIt=Te({uri:ve(),mimeType:dl(ve())}).passthrough(),hCr=rIt.extend({text:ve()}),mCr=rIt.extend({blob:ve().base64()}),gCr=Te({type:rn("resource"),resource:or([hCr,mCr])}).passthrough();yM.extend({content:Lt(or([fCr,pCr,gCr])),isError:Ao().default(!1).optional()}).or(yM.extend({toolResult:ti()}));var vV="2.0",vCr=Te({jsonrpc:rn(vV),id:or([ve(),jt().int()])}).merge(lCr).strict(),yCr=Te({jsonrpc:rn(vV),id:or([ve(),jt().int()]),result:yM}).strict(),bCr=Te({jsonrpc:rn(vV),id:or([ve(),jt().int()]),error:Te({code:jt().int(),message:ve(),data:dl(ti())})}).strict(),xCr=Te({jsonrpc:rn(vV)}).merge(Te({method:ve(),params:dl(pSe)})).strict();or([vCr,xCr,yCr,bCr]);var wCr={};fSe(wCr,{mergeIntoDataStream:()=>OCr,toDataStream:()=>SCr,toDataStreamResponse:()=>kCr});function sIt(e={}){const t=new TextEncoder;let n="";return new TransformStream({async start(){e.onStart&&await e.onStart()},async transform(r,s){s.enqueue(t.encode(r)),n+=r,e.onToken&&await e.onToken(r),e.onText&&typeof r=="string"&&await e.onText(r)},async flush(){e.onCompletion&&await e.onCompletion(n),e.onFinal&&await e.onFinal(n)}})}function hSe(e,t){return e.pipeThrough(new TransformStream({transform:async(n,r)=>{var s;if(typeof n=="string"){r.enqueue(n);return}if("event"in n){n.event==="on_chat_model_stream"&&wBe((s=n.data)==null?void 0:s.chunk,r);return}wBe(n,r)}})).pipeThrough(sIt(t)).pipeThrough(new TextDecoderStream).pipeThrough(new TransformStream({transform:async(n,r)=>{r.enqueue($jt("text",n))}}))}function SCr(e,t){return hSe(e,t).pipeThrough(new TextEncoderStream)}function kCr(e,t){var n;const r=hSe(e,t?.callbacks).pipeThrough(new TextEncoderStream),s=t?.data,a=t?.init,i=s?nIt(s.stream,r):r;return new Response(i,{status:(n=a?.status)!=null?n:200,statusText:a?.statusText,headers:qjt(a?.headers,{contentType:"text/plain; charset=utf-8",dataStreamVersion:"v1"})})}function OCr(e,t){t.dataStream.merge(hSe(e,t.callbacks))}function wBe(e,t){if(typeof e.content=="string")t.enqueue(e.content);else{const n=e.content;for(const r of n)r.type==="text"&&t.enqueue(r.text)}}var _Cr={};fSe(_Cr,{mergeIntoDataStream:()=>TCr,toDataStream:()=>ECr,toDataStreamResponse:()=>CCr});function mSe(e,t){const n=jCr();return qOr(e[Symbol.asyncIterator]()).pipeThrough(new TransformStream({async transform(r,s){s.enqueue(n(r.delta))}})).pipeThrough(sIt(t)).pipeThrough(new TextDecoderStream).pipeThrough(new TransformStream({transform:async(r,s)=>{s.enqueue($jt("text",r))}}))}function ECr(e,t){return mSe(e,t).pipeThrough(new TextEncoderStream)}function CCr(e,t={}){var n;const{init:r,data:s,callbacks:a}=t,i=mSe(e,a).pipeThrough(new TextEncoderStream),o=s?nIt(s.stream,i):i;return new Response(o,{status:(n=r?.status)!=null?n:200,statusText:r?.statusText,headers:qjt(r?.headers,{contentType:"text/plain; charset=utf-8",dataStreamVersion:"v1"})})}function TCr(e,t){t.dataStream.merge(mSe(e,t.callbacks))}function jCr(){let e=!0;return t=>(e&&(t=t.trimStart(),t&&(e=!1)),t)}function hm(e,t,n){const r=e?.mastra,s=r?.toolPayloadTransform?.[t]?.[n]??r?.toolPayloadProjection?.[t]?.[n];if(s&&Object.prototype.hasOwnProperty.call(s,"projected")&&!Object.prototype.hasOwnProperty.call(s,"transformed")){const{projected:a,...i}=s;return{...i,transformed:a}}return s}function Yc(e){return!!(e&&Object.prototype.hasOwnProperty.call(e,"transformed"))}var ICr=()=>!0;async function NCr(e,t={},n=3,r={}){let s=0,a=null;const i=r.shouldRetryResponse??ICr;for(;s<n;){let o;try{o=await fetch(e,t)}catch(u){a=u instanceof Error?u:new Error(String(u))}if(o){if(o.ok)return o;if(a=new Error(`Request failed with status: ${o.status} ${o.statusText}`),!i(o))throw a}if(s++,s>=n)break;const c=Math.min(1e3*Math.pow(2,s),1e4);await new Promise(u=>setTimeout(u,c))}throw a||new Error("Request failed after multiple retry attempts")}var aIt="vercel.ai.error",ACr=Symbol.for(aIt),SBe,kBe,OBe=class iIt extends(kBe=Error,SBe=ACr,kBe){constructor({name:t,message:n,cause:r}){super(n),this[SBe]=!0,this.name=t,this.cause=r}static isInstance(t){return iIt.hasMarker(t,aIt)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}},oIt="AI_InvalidArgumentError",lIt=`vercel.ai.error.${oIt}`,RCr=Symbol.for(lIt),_Be,EBe,PCr=class extends(EBe=OBe,_Be=RCr,EBe){constructor({message:e,cause:t,argument:n}){super({name:oIt,message:e,cause:t}),this[_Be]=!0,this.argument=n}static isInstance(e){return OBe.hasMarker(e,lIt)}},MCr=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const a=n.length,i=new Array(t);for(let o=0;o<t;o++)i[o]=n[Math.random()*a|0];return i.join("")};if(e==null)return s;if(n.includes(r))throw new PCr({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${s()}`};MCr();function $Cr({mediaType:e,url:t,supportedUrls:n}){return t=t.toLowerCase(),e=e.toLowerCase(),Object.entries(n).map(([r,s])=>{const a=r.toLowerCase();return a==="*"||a==="*/*"?{mediaTypePrefix:"",regexes:s}:{mediaTypePrefix:a.replace(/\*/,""),regexes:s}}).filter(({mediaTypePrefix:r})=>e.startsWith(r)).flatMap(({regexes:r})=>r).some(r=>r.test(t))}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var{btoa:DCr,atob:LCr}=globalThis;function cIt(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=LCr(t);return Uint8Array.from(n,r=>r.codePointAt(0))}function khe(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCodePoint(e[n]);return DCr(t)}function aO(e){return typeof e=="string"?e:e instanceof ArrayBuffer?khe(new Uint8Array(e)):khe(e)}function zCr(e){return{...e,id:e.id??crypto.randomUUID(),createdAt:e.createdAt instanceof Date?e.createdAt:e.createdAt?new Date(e.createdAt):new Date,acceptedAt:e.acceptedAt instanceof Date?e.acceptedAt:e.acceptedAt?new Date(e.acceptedAt):void 0}}function uIt(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function FCr(e){return uIt(e).replaceAll('"',""")}var BCr=/^[A-Za-z_][A-Za-z0-9_.-]*$/;function dIt(e,t){if(!BCr.test(e))throw new Error(`Invalid signal XML ${t}: ${e}`)}function UCr(e){if(!e)return"";const t=Object.entries(e).filter(n=>n[1]!==null&&n[1]!==void 0).map(([n,r])=>(dIt(n,"attribute name"),`${n}="${FCr(String(r))}"`)).join(" ");return t?` ${t}`:""}function Ohe(e){dIt(e.type,"tag name");const t=UCr(e.attributes);return e.contents?`<${e.type}${t}>${uIt(e.contents)}</${e.type}>`:`<${e.type}${t} />`}function qCr(e){if(typeof e=="string")return e;if(Array.isArray(e)){const n=[];for(const r of e){if(typeof r=="string"){n.push({type:"text",text:r});continue}const s=CBe(r);if(!s)return;n.push(...s)}return jBe(n)}const t=CBe(e);return t?jBe(t):void 0}function CBe(e){if(!e||typeof e!="object")return;const t=e;if(t.role==="user"&&"content"in t){const r=t.content;if(typeof r=="string")return[{type:"text",text:r}];if(Array.isArray(r)){const s=[];for(const a of r){const i=TBe(a);if(!i)return;s.push(i)}return s}return}const n=TBe(t);return n?[n]:void 0}function TBe(e){if(!e||typeof e!="object")return;const t=e,n=t.providerOptions&&typeof t.providerOptions=="object"&&!Array.isArray(t.providerOptions)?t.providerOptions:void 0;if(t.type==="text"&&typeof t.text=="string")return{type:"text",text:t.text,...n?{providerOptions:n}:{}};if(t.type==="file"||t.type==="image"){const r=t.type==="image"?t.image??t.data:t.data;if(typeof r!="string")return;const s=typeof t.mediaType=="string"?t.mediaType:typeof t.mimeType=="string"?t.mimeType:t.type==="image"?"image/png":"";return s?{type:"file",data:r,mediaType:s,...typeof t.filename=="string"?{filename:t.filename}:{},...n?{providerOptions:n}:{}}:void 0}}function jBe(e){if(e.length===0)return;const t=e[0];return e.length===1&&t?.type==="text"?t.text:e}function VCr(e){return typeof e=="string"?[{type:"text",text:e}]:e.map(t=>t.type==="file"?{type:"file",data:t.data instanceof URL?t.data.toString():aO(t.data),mediaType:t.mediaType,...t.filename?{filename:t.filename}:{},...t.providerOptions?{providerOptions:t.providerOptions}:{}}:{type:"text",text:t.text,...t.providerOptions?{providerOptions:t.providerOptions}:{}})}function HCr(e){const t=[];for(const n of e){const r=n.providerMetadata;if(n.type==="text")t.push({type:"text",text:n.text,...r?{providerOptions:r}:{}});else if(n.type==="file"&&typeof n.data=="string"){const s=n;t.push({type:"file",data:s.data,mediaType:typeof s.mimeType=="string"?s.mimeType:"",...typeof s.filename=="string"?{filename:s.filename}:{},...r?{providerOptions:r}:{}})}}return t}function fIt(e){return e.length===1&&e[0]?.type==="text"&&!e[0].providerOptions?e[0].text:e.map(t=>t.type==="file"?{type:"file",data:t.data,mediaType:t.mediaType,...t.filename?{filename:t.filename}:{},...t.providerOptions?{providerOptions:t.providerOptions}:{}}:{type:"text",text:t.text,...t.providerOptions?{providerOptions:t.providerOptions}:{}})}function ZCr(e){return e?Object.keys(e).some(t=>{const n=e[t];return n!=null}):!1}function WCr(e,t){let n=!1;const r=[];for(const s of t)!n&&s.type==="text"?(n=!0,r.push({...s,text:Ohe({...e,contents:s.text})})):r.push(s);if(!n){const s=Ohe({type:e.type,attributes:e.attributes});r.unshift({type:"text",text:s})}return r}function GCr(e,t){const n=e.type==="user-message",r=ZCr(e.attributes),s=t.some(i=>i.providerOptions);let a;return n&&!r?a=t.length===1&&t[0]?.type==="text"&&!t[0].providerOptions?t[0].text:t:t.every(i=>i.type==="text")&&!s?a=Ohe({...e,contents:t.map(i=>i.text).join(`
|
|
485
485
|
`)}):a=WCr(e,t),{role:"user",content:a,...e.providerOptions?{providerOptions:e.providerOptions}:{}}}function QCr(e,t){return{type:`data-${e.type}`,data:{id:e.id,type:e.type,contents:fIt(t),createdAt:e.createdAt.toISOString(),...e.acceptedAt?{acceptedAt:e.acceptedAt.toISOString()}:{},...e.attributes?{attributes:e.attributes}:{},...e.metadata?{metadata:e.metadata}:{}}}}function YCr(e,t,n){const r=t.length>0?t.map(s=>s.type==="file"?{type:"file",data:s.data,mimeType:s.mediaType,...s.filename?{filename:s.filename}:{},...s.providerOptions?{providerMetadata:s.providerOptions}:{}}:{type:"text",text:s.text,...s.providerOptions?{providerMetadata:s.providerOptions}:{}}):[{type:"text",text:""}];return{id:e.id,role:"signal",createdAt:e.createdAt,threadId:n?.threadId,resourceId:n?.resourceId,type:e.type,content:{format:2,parts:r,...e.providerOptions?{providerMetadata:e.providerOptions}:{},metadata:{signal:{id:e.id,type:e.type,createdAt:e.createdAt.toISOString(),...e.acceptedAt?{acceptedAt:e.acceptedAt.toISOString()}:{},...e.attributes?{attributes:e.attributes}:{},...e.metadata?{metadata:e.metadata}:{}}}}}}function IBe(e){return!e||typeof e!="object"||Array.isArray(e)?!1:e.__isCreatedSignal===!0}function pIt(e){const t=zCr(e),n=VCr(t.contents);return{...t,__isCreatedSignal:!0,toDBMessage:r=>YCr(t,n,r),toLLMMessage:()=>GCr(t,n),toDataPart:()=>QCr(t,n)}}function XCr(e){const t=e.content.metadata?.signal,n=t&&typeof t=="object"&&!Array.isArray(t)?t:void 0,r=typeof n?.type=="string"?n.type:e.type??"user-message",s=n&&"contents"in n?n.contents:void 0,a=qCr(s),i=fIt(HCr(e.content.parts)),o=a??i,c=e.content.providerMetadata,u={id:typeof n?.id=="string"?n.id:e.id,createdAt:typeof n?.createdAt=="string"?n.createdAt:e.createdAt,acceptedAt:typeof n?.acceptedAt=="string"?n.acceptedAt:void 0,attributes:n?.attributes&&typeof n.attributes=="object"&&!Array.isArray(n.attributes)?n.attributes:void 0,metadata:n?.metadata&&typeof n.metadata=="object"&&!Array.isArray(n.metadata)?n.metadata:void 0,providerOptions:c&&typeof c=="object"&&!Array.isArray(c)?c:void 0};return pIt({...u,type:r,contents:o})}var Ra=class Ho{static isMastraDBMessage(t){return!!("content"in t&&t.content&&!Array.isArray(t.content)&&typeof t.content!="string"&&"format"in t.content&&t.content.format===2)}static isMastraMessageV1(t){return!Ho.isMastraDBMessage(t)&&("threadId"in t||"resourceId"in t)}static isMastraMessage(t){return Ho.isMastraDBMessage(t)||Ho.isMastraMessageV1(t)}static isAIV4UIMessage(t){return!Ho.isMastraMessage(t)&&!Ho.isAIV4CoreMessage(t)&&"parts"in t&&!Ho.hasAIV5UIMessageCharacteristics(t)}static isAIV6UIMessage(t){return!Ho.isMastraMessage(t)&&!Ho.isAIV4CoreMessage(t)&&"parts"in t&&Ho.hasAIV6UIMessageCharacteristics(t)}static isAIV5UIMessage(t){return!Ho.isMastraMessage(t)&&!Ho.isAIV6UIMessage(t)&&!Ho.isAIV5CoreMessage(t)&&"parts"in t&&Ho.hasAIV5UIMessageCharacteristics(t)}static isAIV4CoreMessage(t){return!Ho.isMastraMessage(t)&&!("parts"in t)&&"content"in t&&!Ho.hasAIV5CoreMessageCharacteristics(t)}static isAIV6CoreMessage(t){return!Ho.isMastraMessage(t)&&!("parts"in t)&&"content"in t&&Ho.hasAIV6CoreMessageCharacteristics(t)}static isAIV5CoreMessage(t){return!Ho.isMastraMessage(t)&&!Ho.isAIV6CoreMessage(t)&&!("parts"in t)&&"content"in t&&Ho.hasAIV5CoreMessageCharacteristics(t)}static hasAIV6UIMessageCharacteristics(t){if(!("parts"in t)||!t.parts)return!1;for(const n of t.parts)if(n.type==="source-document"||n.type==="dynamic-tool"||"toolCallId"in n&&"state"in n&&(n.state==="approval-requested"||n.state==="approval-responded"||n.state==="output-denied"))return!0;return!1}static hasAIV5UIMessageCharacteristics(t){if("toolInvocations"in t||"reasoning"in t||"experimental_attachments"in t||"data"in t||"annotations"in t||!t.parts)return!1;for(const n of t.parts){if("metadata"in n)return!0;if("toolInvocation"in n)return!1;if("toolCallId"in n)return!0;if(n.type==="source")return!1;if(n.type==="source-url")return!0;if(n.type==="reasoning"){if("state"in n||"text"in n)return!0;if("reasoning"in n||"details"in n)return!1}if(n.type==="file"&&"mediaType"in n)return!0}return!1}static hasAIV6CoreMessageCharacteristics(t){return"parts"in t||typeof t.content=="string"?!1:t.content.some(n=>n.type==="tool-approval-request"||n.type==="tool-approval-response")}static hasAIV5CoreMessageCharacteristics(t){if("experimental_providerMetadata"in t)return!1;if(typeof t.content=="string")return!0;for(const n of t.content){if(n.type==="tool-result"&&"output"in n||n.type==="tool-call"&&"input"in n)return!0;if(n.type==="tool-result"&&"result"in n||n.type==="tool-call"&&"args"in n)return!1;if("mediaType"in n)return!0;if("mimeType"in n||"experimental_providerMetadata"in n||n.type==="reasoning"&&"signature"in n||n.type==="redacted-reasoning")return!1}return!0}static getRole(t){if(t.role==="assistant"||t.role==="tool")return"assistant";if(t.role==="user")return"user";if(t.role==="system")return"system";throw new Error(`BUG: add handling for message role ${t.role} in message ${JSON.stringify(t,null,2)}`)}};function G9(e){if(!e.startsWith("data:"))return{isDataUri:!1,base64Content:e};const t=e.indexOf(",");if(t===-1)return{isDataUri:!0,base64Content:e};const n=e.substring(5,t),r=e.substring(t+1),s=n.indexOf(";");return{isDataUri:!0,mimeType:(s!==-1?n.substring(0,s):n)||void 0,base64Content:r}}function yV(e,t="application/octet-stream"){return e.startsWith("data:")?e:`data:${t};base64,${e}`}function KCr(e,t){return typeof e=="string"?e:e instanceof URL?e.toString():e instanceof Uint8Array||e instanceof ArrayBuffer||globalThis.Buffer&&Buffer.isBuffer(e)?aO(e):String(e)}function NBe(e){return e instanceof URL?e.toString():typeof e=="string"?e.length:e instanceof Uint8Array||e instanceof ArrayBuffer?e.byteLength:e}function JCr(e){try{return new URL(e),!0}catch{if(e.startsWith("//"))try{return new URL(`https:${e}`),!0}catch{return!1}return!1}}function bM(e,t){const n=G9(e),r=n.isDataUri&&n.mimeType?n.mimeType:t;return n.isDataUri?{type:"dataUri",mimeType:r,data:e}:JCr(e)?{type:"url",mimeType:r,data:e}:{type:"raw",mimeType:r,data:e}}var eTr=["openai","azure"];function hIt(e,t){return`${e}:${t}`}function tTr(e){return mIt(e)[0]}function ABe(e){const t=tTr(e);return t?hIt(t.provider,t.itemId):void 0}function mIt(e){if(!e)return[];const n=e.azure?.itemId,s=e.openai?.itemId;return typeof n=="string"&&n===s?[{provider:"azure",itemId:n}]:eTr.flatMap(a=>{const o=e[a]?.itemId;return typeof o=="string"?[{provider:a,itemId:o}]:[]})}function nTr(e){return mIt(e).map(({provider:t,itemId:n})=>hIt(t,n))}function C5(e,t){const n=[...e],r=n.findIndex(s=>s.role!=="system");return r===-1?n.length>0&&t?.warn("No user or assistant messages in the request. Some providers (e.g. Gemini) require at least one user message to generate a response."):n[r]?.role==="assistant"&&n.splice(r,0,{role:"user",content:"."}),n}function rTr(e,t){return e.map(n=>aTr(n,t))}function sTr(e){const t=e.map(r=>Array.isArray(r.content)?[...r.content]:null);for(let r=0;r<e.length;r++){const s=e[r];if(s.role==="assistant"&&Array.isArray(s.content)){const a=new Set,i=new Set;for(const d of s.content)d.type==="tool-call"?a.add(d.toolCallId):d.type==="tool-result"&&i.add(d.toolCallId);const o=e[r+1],c=new Set;if(o&&o.role==="tool"&&Array.isArray(o.content))for(const d of o.content)d.type==="tool-result"&&c.add(d.toolCallId);const u=new Set([...a].filter(d=>i.has(d)||c.has(d)));t[r]=t[r].filter(d=>{if(d.type!=="tool-call")return!0;const f=d;return f.providerExecuted===!0||u.has(f.toolCallId)}),o&&o.role==="tool"&&Array.isArray(o.content)&&(t[r+1]=t[r+1].filter(d=>d.type!=="tool-result"||u.has(d.toolCallId)))}else if(s.role==="tool"&&Array.isArray(s.content)){const a=e[r-1];(!a||a.role!=="assistant"||!Array.isArray(a.content))&&(t[r]=t[r].filter(i=>i.type!=="tool-result"))}}const n=[];for(let r=0;r<e.length;r++){const s=e[r],a=t[r];if(a==null){n.push(s);continue}if(a.length!==0){if(Array.isArray(s.content)&&a.length===s.content.length){n.push(s);continue}n.push({...s,content:a})}}return n}function aTr(e,t){return e.role!=="tool"||!Array.isArray(e.content)?e:{...e,content:e.content.map(n=>n.type==="tool-result"?{...n,input:gSe(t,n.toolCallId)}:n)}}function gSe(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(!(!r||r.role!=="assistant")){if(r.content.parts){const s=r.content.parts.find(a=>a.type==="tool-invocation"&&a.toolInvocation.toolCallId===t);if(s&&s.type==="tool-invocation"){const a=s.toolInvocation.args||{};if(typeof a=="object"&&Object.keys(a).length>0)return a}}if(r.content.toolInvocations){const s=r.content.toolInvocations.find(a=>a.toolCallId===t);if(s){const a=s.args||{};if(typeof a=="object"&&Object.keys(a).length>0)return a}}}}return{}}function NC(e,t,n,r=!0){if(!r)return n;const s=hm(e,"display",t);return Yc(s)?s.transformed:n}function iTr(e,t,n){return{...e,args:NC(t,"input-available",e.args,n),...e.state==="result"?{result:NC(t,"output-available",NC(t,"error",e.result,n),n)}:{}}}function RBe(e){return e.some(n=>!(n.type==="text"&&n.text===""))?e.filter(n=>n.type==="text"?n.text!=="":!0):e}function _he(e){const t=e.content.metadata?.signal;if(t&&typeof t=="object"&&!Array.isArray(t)){const n=t.type;return typeof n=="string"?n:e.type}return e.type}function oTr(e,t){const n=e.content.metadata?.signal&&typeof e.content.metadata.signal=="object"?e.content.metadata.signal:{},r=n.metadata&&typeof n.metadata=="object"&&!Array.isArray(n.metadata)?n.metadata:{};return{type:`data-${_he(e)??"signal"}`,data:{id:typeof n.id=="string"?n.id:e.id,type:_he(e)??"signal",contents:"contents"in n?n.contents:t,createdAt:typeof n.createdAt=="string"?n.createdAt:e.createdAt.toISOString(),...Object.keys(r).length?{metadata:r}:{}}}}var F0=class{static toUIMessage(e,t){const n=t?.transformToolPayloads??!0,r=e.content.experimental_attachments?[...e.content.experimental_attachments]:[],s=typeof e.content.content=="string"&&e.content.content!==""?e.content.content:(e.content.parts??[]).reduce((f,p)=>p.type==="text"?p.text:f,""),a=[],i=e.content.parts??[];if(i.length)for(const f of i)if(f.type==="file"){let p;typeof f.data=="string"&&bM(f.data,f.mimeType).type==="raw"?p=yV(f.data,f.mimeType||"application/octet-stream"):p=f.data,r.push({contentType:f.mimeType,url:p})}else{if(f.type==="tool-invocation"&&(f.toolInvocation.state==="call"||f.toolInvocation.state==="partial-call"))continue;if(f.type==="tool-invocation"){const p={...f.toolInvocation,args:NC(f.providerMetadata,"input-available",f.toolInvocation.args,n),...f.toolInvocation.state==="result"?{result:NC(f.providerMetadata,"output-available",NC(f.providerMetadata,"error",f.toolInvocation.result,n),n)}:{}};let h=-1,m=-1;for(const g of i)if(g.type==="step-start"&&h++,g.type==="tool-invocation"&&g.toolInvocation.toolCallId===f.toolInvocation.toolCallId){m=h;break}if(m>=0){const g={step:m,...p};a.push({type:"tool-invocation",toolInvocation:g})}else a.push({type:"tool-invocation",toolInvocation:p})}else a.push(f)}a.length===0&&r.length>0&&a.push({type:"text",text:""});const c=(e.role==="signal"?_he(e):void 0)==="user-message",u=e.role==="signal"&&!c?[oTr(e,e.content.content||s)]:a;if(e.role==="user"){const f={id:e.id,role:e.role,content:e.content.content||s,createdAt:e.createdAt,parts:u,experimental_attachments:r};return e.content.metadata&&(f.metadata=e.content.metadata),f}else if(e.role==="assistant"){const f=Array.isArray(e.content.content)&&e.content.content.length===1&&e.content.content[0].type==="text",p={id:e.id,role:e.role,content:f?s:e.content.content||s,createdAt:e.createdAt,parts:u,reasoning:void 0,toolInvocations:"toolInvocations"in e.content?e.content.toolInvocations?.filter(h=>h.state==="result").map(h=>{const m=e.content.parts?.find(g=>g.type==="tool-invocation"&&g.toolInvocation.toolCallId===h.toolCallId)?.providerMetadata;return iTr(h,m,n)}):void 0};return e.content.metadata&&(p.metadata=e.content.metadata),p}const d={id:e.id,role:e.role==="signal"?c?"user":"system":e.role,content:e.role==="signal"&&!c?"":e.content.content||s,createdAt:e.createdAt,parts:u,experimental_attachments:r};return e.content.metadata&&(d.metadata=e.content.metadata),d}static systemToV4Core(e){if(e.role!=="system"||!e.content.content)throw new rk({id:"INVALID_SYSTEM_MESSAGE_FORMAT",domain:"AGENT",category:"USER",text:"Invalid system message format. System messages must include 'role' and 'content' properties. The content should be a string.",details:{receivedMessage:JSON.stringify(e,null,2)}});const t={role:"system",content:e.content.content};return e.content.providerMetadata&&(t.experimental_providerMetadata=e.content.providerMetadata),t}static fromUIMessage(e,t,n){const s={format:2,parts:e.parts?RBe(e.parts):[]};return e.toolInvocations&&(s.toolInvocations=e.toolInvocations),e.reasoning&&(s.reasoning=e.reasoning),e.annotations&&(s.annotations=e.annotations),e.experimental_attachments&&(s.experimental_attachments=e.experimental_attachments),"metadata"in e&&e.metadata!==null&&e.metadata!==void 0&&(s.metadata=e.metadata),{id:e.id||t.newMessageId(),role:Ra.getRole(e),createdAt:t.generateCreatedAt(n,e.createdAt),threadId:t.memoryInfo?.threadId,resourceId:t.memoryInfo?.resourceId,content:s}}static fromCoreMessage(e,t,n){const r="id"in e?e.id:t.newMessageId(),s=[],a=[],i=[],o=n==="response"&&Array.isArray(e.content)&&e.content.length===1&&e.content[0]&&e.content[0].type==="text"&&"text"in e.content[0]&&e.content[0].text;if(o&&n==="response"&&(e.content=o),typeof e.content=="string")s.push({type:"text",text:e.content});else if(Array.isArray(e.content))for(const f of e.content)switch(f.type){case"text":{const p=s.at(-1);e.role==="assistant"&&p&&p.type==="tool-invocation"&&s.push({type:"step-start"});const h={type:"text",text:f.text};f.providerOptions&&(h.providerMetadata=f.providerOptions),s.push(h);break}case"tool-call":{const p={type:"tool-invocation",toolInvocation:{state:"call",toolCallId:f.toolCallId,toolName:f.toolName,args:f.args}};f.providerOptions&&(p.providerMetadata=f.providerOptions),s.push(p);break}case"tool-result":{let p={};const h=e.content.find(v=>v.type==="tool-call"&&v.toolCallId===f.toolCallId);h&&h.type==="tool-call"&&(p=h.args),Object.keys(p).length===0&&t.dbMessages&&(p=gSe(t.dbMessages,f.toolCallId));const m={state:"result",toolCallId:f.toolCallId,toolName:f.toolName,result:f.result??"",args:p},g={type:"tool-invocation",toolInvocation:m};f.providerOptions&&(g.providerMetadata=f.providerOptions),s.push(g),i.push(m)}break;case"reasoning":{const p={type:"reasoning",reasoning:"",details:[{type:"text",text:f.text,signature:f.signature}]};f.providerOptions&&(p.providerMetadata=f.providerOptions),s.push(p)}break;case"redacted-reasoning":{const p={type:"reasoning",reasoning:"",details:[{type:"redacted",data:f.data}]};f.providerOptions&&(p.providerMetadata=f.providerOptions),s.push(p)}break;case"image":{const p={type:"file",data:KCr(f.image),mimeType:f.mimeType};f.providerOptions&&(p.providerMetadata=f.providerOptions),s.push(p);break}case"file":{if(f.data instanceof URL){const p={type:"file",data:f.data.toString(),mimeType:f.mimeType};f.providerOptions&&(p.providerMetadata=f.providerOptions),f.filename&&(p.filename=f.filename),s.push(p)}else if(typeof f.data=="string"){const p=bM(f.data,f.mimeType);if(p.type==="url"||p.type==="dataUri"){const h={type:"file",data:f.data,mimeType:p.mimeType||"image/png"};f.providerOptions&&(h.providerMetadata=f.providerOptions),f.filename&&(h.filename=f.filename),s.push(h)}else try{const h={type:"file",mimeType:p.mimeType||"image/png",data:aO(f.data)};f.providerOptions&&(h.providerMetadata=f.providerOptions),f.filename&&(h.filename=f.filename),s.push(h)}catch(h){console.error(`Failed to convert binary data to base64 in CoreMessage file part: ${h}`,h)}}else try{const p={type:"file",mimeType:f.mimeType,data:aO(f.data)};f.providerOptions&&(p.providerMetadata=f.providerOptions),f.filename&&(p.filename=f.filename),s.push(p)}catch(p){console.error(`Failed to convert binary data to base64 in CoreMessage file part: ${p}`,p)}break}}const u={format:2,parts:RBe(s)};i.length&&(u.toolInvocations=i),typeof e.content=="string"&&(u.content=e.content),a.length&&(u.experimental_attachments=a),e.providerOptions?u.providerMetadata=e.providerOptions:"experimental_providerMetadata"in e&&e.experimental_providerMetadata&&(u.providerMetadata=e.experimental_providerMetadata),"metadata"in e&&e.metadata!==null&&e.metadata!==void 0&&(u.metadata=e.metadata);const d="metadata"in e&&e.metadata&&typeof e.metadata=="object"&&"createdAt"in e.metadata?e.metadata.createdAt:void 0;return{id:r,role:Ra.getRole(e),createdAt:t.generateCreatedAt(n,d),threadId:t.memoryInfo?.threadId,resourceId:t.memoryInfo?.resourceId,content:u}}},lTr=/^[a-zA-Z0-9_-]+$/,PBe="unknown_tool";function Cc(e){return typeof e!="string"?PBe:lTr.test(e)?e:PBe}function MBe(e){return e.some(n=>!(n.type==="text"&&n.text===""))?e.filter(n=>n.type==="text"?n.text!=="":!0):e}function gIt(e){const t=e.content.metadata?.signal;if(t&&typeof t=="object"&&!Array.isArray(t)){const n=t.type;return typeof n=="string"?n:e.type}return e.type}function cTr(e){return typeof e.content.content=="string"?e.content.content:e.content.parts.find(t=>t.type==="text")?.text??""}function uTr(e){const t=e.content.metadata?.signal&&typeof e.content.metadata.signal=="object"?e.content.metadata.signal:{},n=t.metadata&&typeof t.metadata=="object"&&!Array.isArray(t.metadata)?t.metadata:{},r=gIt(e)??"signal";return{type:`data-${r}`,data:{id:typeof t.id=="string"?t.id:e.id,type:r,contents:"contents"in t?t.contents:cTr(e),createdAt:typeof t.createdAt=="string"?t.createdAt:e.createdAt.toISOString(),...Object.keys(n).length?{metadata:n}:{}}}}function $Be(e){return typeof e=="object"&&e&&"type"in e&&(e=e.type),typeof e!="string"?Cc(e):e==="dynamic-tool"?"dynamic-tool":e.startsWith("tool-")?Cc(e.slice(5)):Cc(e)}function Vx(e,t){return t==null?e:{...e||{},mastra:{...(e||{}).mastra||{},createdAt:t}}}function wf(e){const t=e?.mastra;if(!t||typeof t!="object")return;const n=t.createdAt;return typeof n=="number"?n:void 0}function eE(e,t,n,r=!0){if(!r)return n;const s=hm(e,"display",t);return Yc(s)?s.transformed:n}function See(e,t,n=!0){if(!n||!e||typeof e!="object")return e;const r=e,s=r.metadata??r.providerMetadata,a=hm(s,"display",t),i=hm(s,"display","input-available"),o=t==="approval"?Yc(a)?a.transformed:Yc(i)?i.transformed:void 0:Yc(i)?i.transformed:Yc(a)?a.transformed:void 0,c=t==="suspend"&&Yc(a)?a.transformed:void 0;return{...r,...o!==void 0?{args:o}:{},...c!==void 0?{suspendPayload:c}:{}}}var Qy=class{static toUIMessage(e,t){const r=(e.role==="signal"?gIt(e):void 0)==="user-message",s=t?.transformToolPayloads??!0,a=[],i={...e.content.metadata||{}};if(e.role==="signal"&&!r&&a.push(uTr(e)),e.createdAt&&(i.createdAt=e.createdAt),e.threadId&&(i.threadId=e.threadId),e.resourceId&&(i.resourceId=e.resourceId),e.content.providerMetadata&&(i.providerMetadata=e.content.providerMetadata),e.role==="signal"&&!r)return{id:e.id,role:"system",metadata:i,parts:a};const o=e.content.parts?.some(v=>v.type==="tool-invocation");if(e.content.toolInvocations&&!o)for(const v of e.content.toolInvocations)v.state==="result"?a.push({type:`tool-${v.toolName}`,toolCallId:v.toolCallId,state:"output-available",input:v.args,output:v.result}):a.push({type:`tool-${v.toolName}`,toolCallId:v.toolCallId,state:v.state==="call"?"input-available":"input-streaming",input:v.args});const c=e.content.parts?.some(v=>v.type==="reasoning"),u=e.content.parts?.some(v=>v.type==="file");e.content.reasoning&&!c&&a.push({type:"reasoning",text:e.content.reasoning});const d=new Set;if(e.content.experimental_attachments&&!u)for(const v of e.content.experimental_attachments)d.add(v.url),a.push({type:"file",url:v.url,mediaType:v.contentType||"unknown"});let f=!1;if(e.content.parts)for(const v of e.content.parts){if(v.type==="tool-invocation"&&v.toolInvocation){const b=v.toolInvocation;b.state==="result"?a.push({type:`tool-${b.toolName}`,toolCallId:b.toolCallId,input:eE(v.providerMetadata,"input-available",b.args,s),output:eE(v.providerMetadata,"output-available",eE(v.providerMetadata,"error",b.result,s),s),state:"output-available",callProviderMetadata:Vx(v.providerMetadata,v.createdAt),providerExecuted:v.providerExecuted}):b.state==="output-error"?a.push({type:`tool-${b.toolName}`,toolCallId:b.toolCallId,input:eE(v.providerMetadata,"input-available",b.args,s),errorText:eE(v.providerMetadata,"error",b.errorText||"",s),state:"output-error",callProviderMetadata:Vx(v.providerMetadata,v.createdAt),providerExecuted:v.providerExecuted}):a.push({type:`tool-${b.toolName}`,toolCallId:b.toolCallId,input:eE(v.providerMetadata,"input-available",b.args,s),state:"input-available",callProviderMetadata:Vx(v.providerMetadata,v.createdAt),providerExecuted:v.providerExecuted});continue}if(v.type==="reasoning"){const b=v.reasoning||(v.details?.reduce((S,w)=>w.type==="text"&&w.text?S+w.text:S,"")??"");if(b||v.details?.length){const S={type:"reasoning",text:b||"",state:"done"};S.providerMetadata=Vx(v.providerMetadata,v.createdAt),a.push(S)}continue}if(!(v.type==="tool-invocation"||v.type.startsWith("tool-")))if(v.type==="file"){if(typeof v.data=="string"&&d.has(v.data))continue;const b=typeof v.data=="string"?bM(v.data,v.mimeType):{type:"raw",mimeType:v.mimeType};if(b.type==="url"&&typeof v.data=="string"){const S={type:"file",url:v.data,mediaType:b.mimeType||"image/png"};S.providerMetadata=Vx(v.providerMetadata,v.createdAt),a.push(S)}else{let S,w=v.mimeType;if(typeof v.data=="string"){const C=G9(v.data);C.isDataUri?(S=C.base64Content,C.mimeType&&(w=w||C.mimeType)):S=v.data}else S=v.data;const O=w||"image/png";let E;typeof S=="string"&&S.startsWith("data:")?E=S:E=yV(S,O);const _={type:"file",url:E,mediaType:O};_.providerMetadata=Vx(v.providerMetadata,v.createdAt),a.push(_)}}else if(v.type==="source"){const b={type:"source-url",url:v.source.url,sourceId:v.source.id,title:v.source.title};b.providerMetadata=Vx(v.providerMetadata,v.createdAt),a.push(b)}else{if(v.type==="source-document")continue;if(v.type==="text"){const b={type:"text",text:v.text};b.providerMetadata=Vx(v.providerMetadata,v.createdAt),a.push(b),f=!0}else v.type==="data-tool-call-suspended"||v.type==="data-tool-call-approval"?a.push({...v,data:See(v.data,v.type==="data-tool-call-suspended"?"suspend":"approval",s)}):(a.push(v),f=!0)}}e.content.content&&!f&&a.push({type:"text",text:e.content.content});const p=new Set(a.filter(v=>v.type==="data-tool-call-suspended"||v.type==="data-tool-call-approval").map(v=>{const b=v.data;return typeof b?.toolCallId=="string"?b.toolCallId:void 0}).filter(v=>typeof v=="string")),h=(v,b)=>{const S=a.findIndex(w=>w.type.startsWith("tool-")&&w.toolCallId===v);if(S===-1){a.push(b);return}a.splice(S+1,0,b)},m=i.suspendedTools;if(m&&typeof m=="object")for(const v of Object.values(m)){if(!v||typeof v!="object")continue;const b="toolCallId"in v?v.toolCallId:void 0;typeof b!="string"||p.has(b)||(h(b,{type:"data-tool-call-suspended",data:See(v,"suspend",s)}),p.add(b))}const g=i.pendingToolApprovals;if(g&&typeof g=="object")for(const v of Object.values(g)){if(!v||typeof v!="object")continue;const b="toolCallId"in v?v.toolCallId:void 0;typeof b!="string"||p.has(b)||(h(b,{type:"data-tool-call-approval",data:See(v,"approval",s)}),p.add(b))}return{id:e.id,role:e.role==="signal"?r?"user":"system":e.role,metadata:i,parts:a}}static fromUIMessage(e){const{parts:t,metadata:n}=e,r=n||{},s=r.createdAt,a=s?typeof s=="string"?new Date(s):s instanceof Date?s:new Date:new Date,i=r.threadId,o=r.resourceId,c={...r};delete c.createdAt,delete c.threadId,delete c.resourceId;const u=t.filter(w=>np(w)),d=t.filter(w=>w.type==="reasoning"),f=t.filter(w=>w.type==="file"),p=t.filter(w=>w.type==="text");let h;u.length>0&&(h=u.map(w=>{const O=$Be(w);return w.state==="output-available"?{args:w.input,result:typeof w.output=="object"&&w.output&&"value"in w.output?w.output.value:w.output,toolCallId:w.toolCallId,toolName:O,state:"result"}:{args:w.input,toolCallId:w.toolCallId,toolName:O,state:"call"}}));let m;d.length>0&&(m=d.map(w=>w.text).join(`
|
|
486
486
|
`));let g;f.length>0&&(g=f.map(w=>({url:w.url||"",contentType:w.mediaType})));let v;p.length>0&&(v=p.map(w=>w.text).join(""));const b=t.map(w=>{if(np(w)){const O=$Be(w),E="callProviderMetadata"in w?w.callProviderMetadata:void 0;return w.state==="output-available"?{type:"tool-invocation",toolInvocation:{toolCallId:w.toolCallId,toolName:O,args:w.input,result:typeof w.output=="object"&&w.output&&"value"in w.output?w.output.value:w.output,state:"result"},providerMetadata:E,createdAt:wf(E)}:{type:"tool-invocation",toolInvocation:{toolCallId:w.toolCallId,toolName:O,args:w.input,state:"call"},providerMetadata:E,createdAt:wf(E)}}return w.type==="reasoning"?{type:"reasoning",reasoning:"",details:[{type:"text",text:w.text}],providerMetadata:w.providerMetadata,createdAt:wf(w.providerMetadata)}:w.type==="file"?{type:"file",mimeType:w.mediaType,data:w.url||"",providerMetadata:w.providerMetadata,createdAt:wf(w.providerMetadata),...w.filename?{filename:w.filename}:{}}:w.type==="source-url"?{type:"source",source:{url:w.url,sourceType:"url",id:w.url,providerMetadata:w.providerMetadata},providerMetadata:w.providerMetadata,createdAt:wf(w.providerMetadata)}:w.type==="text"?{type:"text",text:w.text,providerMetadata:w.providerMetadata,createdAt:wf(w.providerMetadata)}:w.type==="step-start"?w:typeof w.type=="string"&&w.type.startsWith("data-")?{type:w.type,data:"data"in w?w.data:void 0}:null}).filter(w=>w!==null),S=MBe(b);return{id:e.id,role:e.role,createdAt:a,threadId:i,resourceId:o,content:{format:2,parts:S,toolInvocations:h,reasoning:m,experimental_attachments:g,content:v,metadata:Object.keys(c).length>0?c:void 0}}}static getDataStringFromAIV5DataPart(e){let t,n;if("data"in e)t=e.mediaType||"application/octet-stream",n=e.data;else if("image"in e)t=e.mediaType||"image/jpeg",n=e.image;else{if("url"in e&&typeof e.url=="string")return e.url;throw new rk({id:"MASTRA_AIV5_DATA_PART_INVALID",domain:"AGENT",category:"USER",text:"Invalid AIV5 data part in getDataStringFromAIV5DataPart",details:{part:e}})}if(n instanceof URL)return n.toString();if(n instanceof Buffer){const r=n.toString("base64");return`data:${t};base64,${r}`}else{if(typeof n=="string")return n.startsWith("data:")||n.startsWith("http")?n:`data:${t};base64,${n}`;if(n instanceof Uint8Array){const r=Buffer.from(n).toString("base64");return`data:${t};base64,${r}`}else if(n instanceof ArrayBuffer){const r=Buffer.from(n).toString("base64");return`data:${t};base64,${r}`}else return""}}static fromModelMessage(e,t){const n=Array.isArray(e.content)?e.content:[{type:"text",text:e.content}],r=[],s=[],a=[],i=[];for(const p of n)if(p.type==="text"){const h={type:"text",text:p.text};p.providerOptions&&(h.providerMetadata=p.providerOptions,h.createdAt=wf(p.providerOptions)),r.push(h)}else if(p.type==="tool-call"){const h=p,m={type:"tool-invocation",toolInvocation:{toolCallId:h.toolCallId,toolName:Cc(h.toolName),args:h.input,state:"call"}};p.providerOptions&&(m.providerMetadata=p.providerOptions,m.createdAt=wf(p.providerOptions)),r.push(m),s.push({toolCallId:h.toolCallId,toolName:Cc(h.toolName),args:h.input,state:"call"})}else if(p.type==="tool-result"){const h=p,m=s.find(b=>b.toolCallId===h.toolCallId),g=r.find(b=>b.type==="tool-invocation"&&"toolInvocation"in b&&b.toolInvocation.toolCallId===h.toolCallId),v=(b,S)=>{S.state="result",S.result=typeof b.output=="object"&&b.output&&"value"in b.output?b.output.value:b.output};if(m)v(h,m);else{const b={state:"call",toolCallId:h.toolCallId,toolName:Cc(h.toolName),args:{}};v(h,b),s.push(b)}if(g&&g.type==="tool-invocation")v(h,g.toolInvocation),h.providerOptions&&(g.providerMetadata=h.providerOptions,g.createdAt=wf(h.providerOptions)??g.createdAt);else{const b={type:"tool-invocation",toolInvocation:{toolCallId:h.toolCallId,toolName:Cc(h.toolName),args:{},state:"call"}};v(h,b.toolInvocation),h.providerOptions&&(b.providerMetadata=h.providerOptions,b.createdAt=wf(h.providerOptions)),r.push(b)}}else if(p.type==="reasoning"){const h={type:"reasoning",reasoning:"",details:[{type:"text",text:p.text}]};p.providerOptions&&(h.providerMetadata=p.providerOptions,h.createdAt=wf(p.providerOptions)),r.push(h),a.push(p.text)}else if(p.type==="image"){const h=p,m=h.mediaType||"image/jpeg",g=this.getDataStringFromAIV5DataPart(h),v={type:"file",data:g,mimeType:m};p.providerOptions&&(v.providerMetadata=p.providerOptions,v.createdAt=wf(p.providerOptions)),r.push(v),i.push({url:g,contentType:m})}else if(p.type==="file"){const h=p,m=h.mediaType||"application/octet-stream",g=this.getDataStringFromAIV5DataPart(h),v={type:"file",data:g,mimeType:m};p.providerOptions&&(v.providerMetadata=p.providerOptions,v.createdAt=wf(p.providerOptions)),h.filename&&(v.filename=h.filename),r.push(v),i.push({url:g,contentType:m})}const o=MBe(r),c=o.filter(p=>p.type==="text").map(p=>p.text).join(`
|
|
487
487
|
`),u="metadata"in e&&e.metadata!==null&&e.metadata!==void 0?e.metadata:{},f={id:"id"in e&&typeof e.id=="string"?e.id:`msg-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,role:e.role==="tool"?"assistant":e.role,createdAt:new Date,content:{format:2,parts:o,toolInvocations:s.length>0?s:void 0,reasoning:a.length>0?a.join(`
|
|
@@ -656,7 +656,7 @@ Token usage: ${n} input + ${r} output = ${s} total`:`The model stopped generatin
|
|
|
656
656
|
"groundTruth": "Expected result (optional)",
|
|
657
657
|
"metadata": { "key": "value" } // optional
|
|
658
658
|
}
|
|
659
|
-
]`})]})]})}function ses({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(Ve,{children:l.jsx(Xy,{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 aes({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}=dJr(),{batchInsertItems:b}=Ui(),S=y.useCallback(async N=>{try{const R=await m(N);o(R),a("preview")}catch{}},[m]),w=y.useCallback(async()=>{if(!i||i.items.length===0)return;a("importing"),h(!0);const{items:N}=i;u({current:0,total:N.length});try{await b.mutateAsync({datasetId:e,items:N.map(R=>({input:R.input,groundTruth:R.groundTruth,metadata:R.metadata}))}),f({success:N.length,errors:0})}catch{f({success:0,errors:N.length})}u({current:N.length,total:N.length}),h(!1),a("complete")},[i,b,e]),O=y.useCallback(()=>{n(!1),r?.(),d&&d.success>0&&Be.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]),E=y.useCallback(()=>{p||(n(!1),setTimeout(()=>{a("upload"),o(null),u({current:0,total:0}),f(null)},150))},[p,n]),_=i&&i.items.length>0&&i.errors.length===0,C=()=>{switch(s){case"upload":return l.jsx(res,{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(ses,{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(nes,{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(tn,{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(he,{onClick:E,children:"Cancel"});case"preview":return l.jsxs(l.Fragment,{children:[l.jsx(he,{onClick:()=>a("upload"),children:"Back"}),l.jsxs(he,{variant:"primary",onClick:w,disabled:!_,children:["Import ",i?.items.length??0," Item",i?.items.length!==1?"s":""]})]});case"importing":return null;case"complete":return l.jsx(he,{variant:"primary",onClick:O,children:"Done"})}},I={upload:"Import JSON",preview:"Preview Data",importing:"Importing",complete:"Import Complete"};return l.jsx(Dr,{open:t,onOpenChange:E,children:l.jsxs(Nr,{className:"max-w-2xl max-h-[90vh]",children:[l.jsxs(Lr,{children:[l.jsx(Ar,{children:I[s]}),l.jsx(ga,{children:"Import dataset items from a JSON file."})]}),l.jsx(ts,{className:"min-h-[200px] max-h-[50vh] overflow-y-auto",children:C()}),l.jsx(lp,{className:"px-6 pt-4 flex justify-end gap-2",children:j()})]})})}function ies({dataset:e,isLoading:t=!1,onEditClick:n,onDuplicateClick:r,onDeleteClick:s,experimentTriggerSlot:a,disableExperimentTrigger:i=!1,onExperimentClick:o,className:c}){return l.jsxs(Xn,{className:c,children:[l.jsxs(Xn.Column,{children:[l.jsxs(Xn.Title,{isLoading:t,children:[l.jsx(G0,{})," ",e?.name]}),l.jsx(Xn.Description,{isLoading:t,children:e?.description}),l.jsxs(Xn.Description,{isLoading:t,children:[l.jsxs(ps,{children:[l.jsx(UC,{})," Created at ",e?.createdAt?En(new Date(e.createdAt),"MMM d, yyyy"):""]}),l.jsxs(ps,{children:[l.jsx(Aw,{})," Latest version v",e?.version??""]})]})]}),l.jsx(Xn.Column,{children:l.jsxs(jr,{children:[a?i?l.jsxs(rr,{children:[l.jsx(Jn,{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(er,{children:"Add items to the dataset before running an experiment"})]}):a:o?i?l.jsxs(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx("span",{className:"cursor-not-allowed",children:l.jsxs(he,{disabled:!0,tabIndex:-1,children:[l.jsx(cb,{}),"Run Experiment"]})})}),l.jsx(er,{children:"Add items to the dataset before running an experiment"})]}):l.jsxs(he,{onClick:o,children:[l.jsx(cb,{}),"Run Experiment"]}):null,l.jsxs(Ot,{children:[l.jsx(Ot.Trigger,{asChild:!0,children:l.jsx(he,{size:"default","aria-label":"Dataset actions menu",children:l.jsx(zet,{})})}),l.jsxs(Ot.Content,{align:"end",className:"w-48",children:[l.jsxs(Ot.Item,{onSelect:n,children:[l.jsx(Rb,{})," Edit Dataset"]}),l.jsxs(Ot.Item,{onSelect:r,children:[l.jsx(rp,{})," Duplicate Dataset"]}),l.jsxs(Ot.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[l.jsx(Xd,{})," Delete Dataset"]})]})]})]})})]})}const iLt=e=>{const t=We(),{data:n}=PM(e),r=n?.experiments;return Et({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})},oes=e=>{const t=We(),{data:n}=PM(e),r=n?.experiments;return Et({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 les(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)}}function ces({datasetId:e}){const t=We(),{data:n}=Yb(e),{data:r,isLoading:s}=iLt(e),{data:a,isLoading:i}=oes(e),{updateExperimentResult:o}=Ui(),[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,E]=y.useState(""),[_,C]=y.useState(""),[j,I]=y.useState(""),[N,R]=y.useState([]),[P,B]=y.useState(!1),[M,L]=y.useState(null),F=y.useMemo(()=>M??r??[],[M,r]);y.useEffect(()=>{r&&M===null&&L(r)},[r,M]);const z=y.useMemo(()=>{const ue=new Set;if(n?.tags)for(const xe of n.tags)ue.add(xe);for(const xe of F)for(const Se of xe.tags)ue.add(Se);return[...ue].sort()},[n,F]),U=y.useCallback(ue=>{!n||!e||(n.tags??[]).includes(ue)},[n,e]),H=y.useMemo(()=>d?d==="__untagged__"?F.filter(ue=>ue.tags.length===0):F.filter(ue=>ue.tags.includes(d)):F,[F,d]),D=y.useMemo(()=>{const ue=new Map;for(const xe of F)for(const Se of xe.tags)ue.set(Se,(ue.get(Se)??0)+1);return[...ue.entries()].sort((xe,Se)=>Se[1]-xe[1])},[F]),Y=y.useMemo(()=>F.filter(ue=>ue.tags.length===0).length,[F]),V=y.useMemo(()=>{let ue=0;return d&&ue++,m&&ue++,ue},[d,m]),$=y.useCallback((ue,xe)=>{L(Fe=>(Fe??[]).map(ze=>ze.id===ue?{...ze,tags:xe}:ze));const Se=F.find(Fe=>Fe.id===ue);Se?.experimentId&&Se?.datasetId&&o.mutate({datasetId:Se.datasetId,experimentId:Se.experimentId,resultId:Se.id,tags:xe})},[F,o]),Z=y.useCallback((ue,xe)=>{const Se=F.find(Fe=>Fe.id===ue);Se?.traceId&&xe!==void 0&&t.createFeedback({feedback:{traceId:Se.traceId,source:"studio",feedbackSource:"studio",feedbackType:"rating",value:xe==="positive"?1:-1,experimentId:Se.experimentId??void 0,sourceId:Se.id}}).catch(()=>{}),L(Fe=>(Fe??[]).map(ze=>ze.id===ue?{...ze,rating:xe}:ze))},[F,t]),G=y.useCallback((ue,xe)=>{const Se=F.find(Fe=>Fe.id===ue);Se?.traceId&&t.createFeedback({feedback:{traceId:Se.traceId,source:"studio",feedbackSource:"studio",feedbackType:"comment",value:xe,comment:xe,experimentId:Se.experimentId??void 0,sourceId:Se.id}}).catch(()=>{}),L(Fe=>(Fe??[]).map(ze=>ze.id===ue?{...ze,comment:xe}:ze))},[F,t]),K=y.useCallback(ue=>{const xe=F.find(Se=>Se.id===ue);L(Se=>(Se??[]).filter(Fe=>Fe.id!==ue)),h(Se=>{const Fe=new Set(Se);return Fe.delete(ue),Fe}),c===ue&&u(null),xe?.experimentId&&xe?.datasetId&&o.mutate({datasetId:xe.datasetId,experimentId:xe.experimentId,resultId:xe.id,status:null})},[F,o,c]),ne=y.useCallback(ue=>{const xe=F.find(Se=>Se.id===ue);L(Se=>(Se??[]).filter(Fe=>Fe.id!==ue)),h(Se=>{const Fe=new Set(Se);return Fe.delete(ue),Fe}),c===ue&&u(null),xe?.experimentId&&xe?.datasetId&&o.mutate({datasetId:xe.datasetId,experimentId:xe.experimentId,resultId:xe.id,status:"complete"})},[F,o,c]),ee=y.useMemo(()=>{const ue=m?a??[]:H;return!m||!d?ue:d==="__untagged__"?ue.filter(xe=>xe.tags.length===0):ue.filter(xe=>xe.tags.includes(d))},[m,a,H,d]),J=m?i:!1,se=y.useMemo(()=>new Set(ee.map(ue=>ue.id)),[ee]),ae=y.useMemo(()=>[...p].filter(ue=>se.has(ue)).length,[p,se]),Q=ee.length>0&&ae===ee.length,te=ae>0&&!Q,le=y.useCallback(ue=>{h(xe=>{const Se=new Set(xe);return Se.has(ue)?Se.delete(ue):Se.add(ue),Se})},[]),fe=y.useCallback(()=>{h(Q?new Set:new Set(ee.map(ue=>ue.id)))},[Q,ee]),ce=y.useCallback(ue=>{for(const xe of p){const Se=F.find(Fe=>Fe.id===xe);Se&&!Se.tags.includes(ue)&&$(xe,[...Se.tags,ue])}},[F,p,$]),ye=y.useCallback(ue=>{for(const xe of p){const Se=F.find(Fe=>Fe.id===xe);Se&&Se.tags.includes(ue)&&$(xe,Se.tags.filter(Fe=>Fe!==ue))}},[F,p,$]),we=y.useCallback(()=>{for(const ue of p)ne(ue);h(new Set)},[p,ne]),ke=y.useCallback(()=>{for(const ue of p)K(ue);h(new Set)},[p,K]),Re=y.useCallback(()=>{E(""),w(!0)},[]),De=y.useCallback(async()=>{if(!(!_||!j)){b(!0),w(!1);try{const ue=F.filter(Se=>p.has(Se.id));if(ue.length===0){b(!1);return}const xe=await t.clusterFailures({modelId:`${_}/${j}`,items:ue.map(Se=>({id:Se.id,input:Se.input,output:Se.output??void 0,error:typeof Se.error=="string"?Se.error:Se.error?String(Se.error):void 0,scores:Se.scores,existingTags:Se.tags.length>0?Se.tags:void 0})),availableTags:z.length>0?z:void 0,prompt:O||void 0});xe.proposedTags&&xe.proposedTags.length>0&&(R(xe.proposedTags.map(Se=>({...Se,accepted:!0}))),B(!0))}catch(ue){console.error("Analysis failed:",ue)}finally{b(!1)}}},[_,j,F,p,t,z,O]),Ue=y.useCallback(()=>{for(const ue of N){if(!ue.accepted)continue;const xe=F.find(Se=>Se.id===ue.itemId);if(xe){const Se=[...new Set([...xe.tags,...ue.tags])];$(xe.id,Se)}}B(!1)},[N,F,$]),ot=y.useCallback(ue=>{u(xe=>xe===ue?null:ue)},[]),pe=y.useMemo(()=>c?ee.find(ue=>ue.id===c)??null:null,[c,ee]),de=y.useCallback(()=>{if(!c||ee.length===0)return;const ue=ee.findIndex(xe=>xe.id===c);ue<ee.length-1&&u(ee[ue+1].id)},[c,ee]),ie=y.useCallback(()=>{if(!c||ee.length===0)return;const ue=ee.findIndex(xe=>xe.id===c);ue>0&&u(ee[ue-1].id)},[c,ee]),ge=pe?"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(tn,{className:"w-6 h-6"})}):l.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[l.jsx(Dr,{open:S,onOpenChange:w,children:l.jsxs(Nr,{children:[l.jsxs(Lr,{children:[l.jsx(Ar,{children:"Analyze Items"}),l.jsx(ga,{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(It,{className:"text-xs mb-1 block",children:"Provider"}),l.jsx(Gv,{value:_,onValueChange:C})]}),l.jsxs("div",{children:[l.jsx(It,{className:"text-xs mb-1 block",children:"Model"}),l.jsx(Qv,{llmId:_,value:j,onValueChange:I})]})]}),l.jsxs(be,{variant:"ui-xs",className:"text-neutral3",children:[p.size," item",p.size!==1?"s":""," will be analyzed"]}),l.jsxs("div",{children:[l.jsx(It,{className:"text-xs",children:"Instructions (optional)"}),l.jsx(cu,{value:O,onChange:ue=>E(ue.target.value),placeholder:"E.g., Focus on safety issues and factual errors...",rows:3,className:"text-xs mt-1"})]})]}),l.jsxs(lp,{children:[l.jsx(he,{variant:"outline",onClick:()=>w(!1),children:"Cancel"}),l.jsxs(he,{onClick:De,disabled:!_||!j||v,children:[v?l.jsx(tn,{className:"w-4 h-4 mr-1"}):null,"Analyze"]})]})]})}),l.jsx(Dr,{open:P,onOpenChange:B,children:l.jsxs(Nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[l.jsxs(Lr,{children:[l.jsx(Ar,{children:"Review Proposed Tags"}),l.jsxs(ga,{children:[N.filter(ue=>ue.accepted).length," of ",N.length," proposals selected"]})]}),l.jsx("div",{className:"space-y-3 py-2",children:N.map((ue,xe)=>{const Se=F.find(Fe=>Fe.id===ue.itemId);return l.jsx("div",{className:X("p-3 border rounded-lg",!ue.accepted&&"opacity-50"),children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(go,{checked:ue.accepted,onCheckedChange:Fe=>R(ze=>ze.map((Ke,Ne)=>Ne===xe?{...Ke,accepted:!!Fe}:Ke))}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx(be,{variant:"ui-xs",className:"text-neutral4 truncate block",children:Se?typeof Se.input=="string"?Se.input.slice(0,100):JSON.stringify(Se.input).slice(0,100):ue.itemId}),l.jsx("div",{className:"flex gap-1 flex-wrap mt-1.5",children:ue.tags.map((Fe,ze)=>l.jsx(Y3t,{tag:Fe,onRename:Ke=>R(Ne=>Ne.map((qe,Ie)=>Ie===xe?{...qe,tags:qe.tags.map((Ge,Le)=>Le===ze?Ke:Ge)}:qe)),onRemove:()=>R(Ke=>Ke.map((Ne,qe)=>qe===xe?{...Ne,tags:Ne.tags.filter((Ie,Ge)=>Ge!==ze)}:Ne))},`${Fe}-${ze}`))}),ue.reason&&l.jsx(be,{variant:"ui-xs",className:"text-neutral3 mt-1 block italic",children:ue.reason})]})]})},ue.itemId)})}),l.jsxs(lp,{children:[l.jsx(he,{variant:"outline",onClick:()=>B(!1),children:"Cancel"}),l.jsxs(he,{onClick:Ue,disabled:N.filter(ue=>ue.accepted).length===0,children:["Accept ",N.filter(ue=>ue.accepted).length," proposals"]})]})]})}),l.jsxs(ep,{className:pe?"grid-cols-[1fr_1fr]":"",children:[l.jsxs(Pn,{children:[l.jsxs(Pn.Toolbar,{children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(Ot,{children:[l.jsx(Ot.Trigger,{asChild:!0,children:l.jsxs(he,{variant:"outline",size:"md",children:[l.jsx(Bet,{}),"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(Ot.Content,{align:"start",className:X("min-w-48"),children:[l.jsxs(Ot.Sub,{children:[l.jsxs(Ot.SubTrigger,{children:["Status",m&&l.jsx("span",{className:X("ml-auto text-ui-sm text-accent1"),children:"1"})]}),l.jsxs(Ot.SubContent,{children:[l.jsx(Ot.CheckboxItem,{checked:!m,onCheckedChange:()=>{g(!1),u(null)},onSelect:ue=>ue.preventDefault(),children:"Review Queue"}),l.jsx(Ot.CheckboxItem,{checked:m,onCheckedChange:()=>{g(!0),u(null)},onSelect:ue=>ue.preventDefault(),children:"Completed"})]})]}),l.jsxs(Ot.Sub,{children:[l.jsxs(Ot.SubTrigger,{children:["Tags",d&&l.jsx("span",{className:X("ml-auto text-ui-sm text-accent1"),children:"1"})]}),l.jsxs(Ot.SubContent,{children:[l.jsx(Ot.CheckboxItem,{checked:!d,onCheckedChange:()=>f(null),onSelect:ue=>ue.preventDefault(),children:"All"}),Y>0&&l.jsx(Ot.CheckboxItem,{checked:d==="__untagged__",onCheckedChange:()=>f(d==="__untagged__"?null:"__untagged__"),onSelect:ue=>ue.preventDefault(),children:"Untagged"}),D.length>0&&l.jsx(Ot.Separator,{}),D.map(([ue])=>l.jsx(Ot.CheckboxItem,{checked:d===ue,onCheckedChange:()=>f(d===ue?null:ue),onSelect:xe=>xe.preventDefault(),children:ue},ue))]})]}),V>0&&l.jsxs(l.Fragment,{children:[l.jsx(Ot.Separator,{}),l.jsxs(Ot.Item,{onSelect:()=>{f(null),g(!1),u(null)},children:[l.jsx(Pr,{}),"Clear all filters"]})]})]})]}),V>0&&l.jsxs(he,{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(Q3t,{selectedCount:p.size,vocabulary:z,onApplyTag:ce,onRemoveTag:ye,onNewTag:ue=>ce(ue)}),l.jsxs(Ot,{children:[l.jsx(Ot.Trigger,{asChild:!0,children:l.jsxs(he,{disabled:v,children:[v?l.jsx(tn,{className:"w-4 h-4"}):l.jsx(Ve,{size:"sm",children:l.jsx(bs,{})}),"Actions"]})}),l.jsxs(Ot.Content,{align:"end",children:[l.jsxs(Ot.Item,{onSelect:we,children:[l.jsx(Ve,{size:"sm",children:l.jsx(ak,{})}),"Complete"]}),l.jsxs(Ot.Item,{onSelect:ke,children:[l.jsx(Ve,{size:"sm",children:l.jsx(Xd,{})}),"Remove"]}),l.jsx(Ot.Separator,{}),l.jsxs(Ot.Item,{onSelect:Re,children:[l.jsx(Ve,{size:"sm",children:l.jsx(VC,{})}),"Analyze"]})]})]})]})]}),J?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx(tn,{className:"w-6 h-6"})}):ee.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(be,{variant:"ui-sm",className:"text-neutral3 block",children:m?"No completed reviews yet":"No items to review"}),l.jsx(be,{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(Oe,{columns:ge,children:[l.jsxs(Oe.Top,{children:[!m&&l.jsx(Oe.TopCell,{children:l.jsx(go,{checked:Q?!0:te?"indeterminate":!1,onCheckedChange:()=>fe(),"aria-label":"Select all"})}),m&&l.jsx(Oe.TopCell,{children:" "}),l.jsx(Oe.TopCell,{children:"Input"}),l.jsx(Oe.TopCell,{children:"Comment"}),l.jsx(Oe.TopCell,{children:"Tags"}),!pe&&l.jsx(Oe.TopCell,{children:"Rating"}),!pe&&l.jsx(Oe.TopCell,{children:"Scores"})]}),l.jsx(Oe.Rows,{children:ee.map(ue=>{const xe=ue.scores?Object.entries(ue.scores):[];return l.jsxs(Oe.Row,{onClick:()=>ot(ue.id),selected:c===ue.id,children:[l.jsx(Oe.Cell,{children:m?ue.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(go,{checked:p.has(ue.id),onCheckedChange:()=>le(ue.id),onClick:Se=>Se.stopPropagation(),"aria-label":`Select item ${ue.id}`})}),l.jsx(Oe.NameCell,{children:les(ue.input,80)}),l.jsx(Oe.Cell,{children:ue.comment?l.jsx(be,{variant:"ui-xs",className:"text-neutral3 truncate",children:ue.comment}):l.jsx(be,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),l.jsx(Oe.Cell,{children:ue.tags.length>0?l.jsx(be,{variant:"ui-xs",className:"text-neutral4 truncate",children:ue.tags.join(", ")}):l.jsx(be,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),!pe&&l.jsxs(Oe.Cell,{children:[ue.rating==="positive"&&l.jsx(Ve,{size:"sm",className:"text-positive1",children:l.jsx(Dme,{})}),ue.rating==="negative"&&l.jsx(Ve,{size:"sm",className:"text-negative1",children:l.jsx($me,{})}),!ue.rating&&l.jsx(be,{variant:"ui-xs",className:"text-neutral2",children:"—"})]}),!pe&&l.jsx(Oe.Cell,{children:xe.length>0?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Ve,{size:"sm",className:"text-neutral3",children:l.jsx(du,{})}),l.jsx(be,{variant:"ui-xs",className:"text-neutral4 font-mono",children:xe[0][1].toFixed(2)}),xe.length>1&&l.jsxs(Ct,{variant:"default",children:["+",xe.length-1]})]}):l.jsx(be,{variant:"ui-xs",className:"text-neutral2",children:"—"})})]},ue.id)})})]})]}),pe&&l.jsx(G3t,{item:pe,isCompleted:m,tagVocabulary:z,onRate:ue=>Z(pe.id,ue),onSetTags:ue=>{$(pe.id,ue);for(const xe of ue)z.includes(xe)||U(xe)},onComment:ue=>G(pe.id,ue),onRemove:()=>K(pe.id),onComplete:m?void 0:()=>ne(pe.id),onPrevious:ie,onNext:de,onClose:()=>u(null)})]})]})}function ues({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}=dn(),[p,h]=y.useState(u??"items"),m=Nt=>{h(Nt),d?.(Nt)},[g,v]=y.useState(!1),[b,S]=y.useState(!1),[w,O]=y.useState(!1),[E,_]=y.useState([]),[C,j]=y.useState(!1),[I,N]=y.useState([]),[R,P]=y.useState(!1),[B,M]=y.useState([]),[L,F]=y.useState(!1),[z,U]=y.useState(0),[H,D]=y.useState(null),[Y,V]=y.useState(""),[$]=OCn(Y,300),[Z,G]=y.useState(null),ne=o!==void 0?o:Z,{data:ee,isLoading:J}=Yb(e),{data:se=[],total:ae,isLoading:Q,setEndOfListElement:te,isFetchingNextPage:le,hasNextPage:fe}=cj(e,$||void 0,ne),{data:ce=[],total:ye,isLoading:we}=cj(e,void 0,ne),[ke,Re]=y.useState({}),{data:De,isLoading:Ue}=PM(e,void 0,ke),{data:ot}=PM(e),{deleteItems:pe}=Ui(),de=De?.experiments??[],ie=ot?.experiments??[],ge=TJr({hasSearchQuery:!!$,filteredItemsLength:se.length,unfilteredItemsTotal:ye,itemsTotal:ae}),{data:ue}=iLt(e),xe=ue?.length??0,Se=Nt=>{D(Nt)},Fe=()=>{D(null)},ze=Nt=>{const Mn=Nt.isCurrent?null:Nt;c?c(Mn):G(Nt.isCurrent?null:Nt.version)},Ke=Nt=>{_(Nt),O(!0)},Ne=Nt=>{N(Nt),j(!0)},qe=Nt=>{j(Nt),Nt||(N([]),U(Mn=>Mn+1))},Ie=Nt=>{f(`/datasets/${e}/items?items=${Nt.join(",")}`)},Ge=Nt=>{f(`/datasets/${e}/versions?ids=${Nt.join(",")}`)},Le=Nt=>{M(Nt),P(!0)},Je=async()=>{await pe.mutateAsync({datasetId:e,itemIds:B}),Be.success(`Deleted ${B.length} items`),P(!1),M([]),U(Nt=>Nt+1)},st=Nt=>{O(!1),_([]),U(Mn=>Mn+1),i?.(Nt)},fn=Nt=>{O(Nt),Nt||(_([]),U(Mn=>Mn+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(ies,{dataset:ee,isLoading:J,onEditClick:n,onDuplicateClick:()=>F(!0),onDeleteClick:r,experimentTriggerSlot:a,disableExperimentTrigger:!we&&ce.length===0,onExperimentClick:t}),l.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:l.jsxs(Eu,{defaultTab:"items",value:p,onValueChange:m,className:"grid grid-rows-[auto_1fr] h-full",children:[l.jsxs(Cu,{children:[l.jsxs(Hr,{value:"items",children:["Items ",l.jsx(ci,{color:"gray",children:ge})]}),l.jsxs(Hr,{value:"experiments",children:["Experiments",l.jsx(ci,{color:"gray",children:de.length})]}),l.jsxs(Hr,{value:"review",children:["Review",xe>0&&l.jsx(ci,{color:"orange",children:xe})]})]}),l.jsx(Os,{value:"items",className:"grid overflow-auto mt-5",children:l.jsx(tes,{datasetId:e,items:se,isLoading:Q,featuredItemId:H,onItemSelect:Se,onItemClose:Fe,onAddClick:s??(()=>{}),onImportClick:()=>v(!0),onImportJsonClick:()=>S(!0),onBulkDeleteClick:Le,onCreateDatasetClick:Ke,onAddToDatasetClick:Ne,onCompareItemsClick:Ie,datasetName:ee?.name,clearSelectionTrigger:z,setEndOfListElement:te,isFetchingNextPage:le,hasNextPage:fe,searchQuery:Y,onSearchChange:V,activeDatasetVersion:ne,currentDatasetVersion:ee?.version,onVersionSelect:ze,onCompareVersionsClick:Ge})}),l.jsx(Os,{value:"experiments",className:"grid overflow-auto mt-5",children:l.jsx(VJr,{experiments:de,allExperiments:ie,isLoading:Ue,datasetId:e,filters:ke,onFiltersChange:Re})}),l.jsx(Os,{value:"review",className:"overflow-auto mt-0",children:l.jsx(ces,{datasetId:e})})]})})]}),l.jsx($Jr,{datasetId:e,open:g,onOpenChange:v}),l.jsx(aes,{datasetId:e,open:b,onOpenChange:S}),l.jsx(kJr,{open:w,onOpenChange:fn,items:E,onSuccess:st}),l.jsx(OJr,{open:C,onOpenChange:qe,items:I,currentDatasetId:e}),l.jsx(_Jr,{open:L,onOpenChange:F,sourceDatasetId:e,sourceDatasetName:ee?.name||"",sourceDatasetDescription:ee?.description,onSuccess:i}),l.jsx(en,{open:R,onOpenChange:P,children:l.jsxs(en.Content,{children:[l.jsxs(en.Header,{children:[l.jsx(en.Title,{children:"Delete Items"}),l.jsxs(en.Description,{children:["Are you sure you want to delete ",B.length," item",B.length!==1?"s":"","? This action cannot be undone."]})]}),l.jsxs(en.Footer,{children:[l.jsx(en.Cancel,{children:"Cancel"}),l.jsx(en.Action,{onClick:Je,children:pe.isPending?"Deleting...":"Delete"})]})]})})]})}function des(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 UXe({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 fes({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}=Ui(),h=async b=>{b.preventDefault();let S;try{S=JSON.parse(s)}catch{Be.error("Input must be valid JSON");return}let w;if(i.trim())try{w=JSON.parse(i)}catch{Be.error("Ground Truth must be valid JSON");return}let O;if(c.trim())try{O=JSON.parse(c)}catch{Be.error("Expected Trajectory must be valid JSON");return}try{await p.mutateAsync({datasetId:e,input:S,groundTruth:w,expectedTrajectory:O}),Be.success("Item added successfully"),f(null),a("{}"),o(""),u(""),n(!1),r?.()}catch(E){const _=des(E);_?f(_):Be.error(`Failed to add item: ${E instanceof Error?E.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(Dr,{open:t,onOpenChange:n,children:l.jsxs(Nr,{className:"max-w-lg",children:[l.jsx(Lr,{children:l.jsx(Ar,{children:"Add Item"})}),l.jsx(ts,{children:l.jsxs("form",{onSubmit:h,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(It,{htmlFor:"item-input",children:"Input (JSON) *"}),l.jsx(Rs,{value:s,onChange:m,showCopyButton:!1,className:"min-h-[120px]"}),d?.field==="input"&&l.jsx(UXe,{field:"input",errors:d.errors})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(It,{htmlFor:"item-ground-truth",children:"Ground Truth (JSON, optional)"}),l.jsx(Rs,{value:i,onChange:g,showCopyButton:!1,className:"min-h-[80px]"}),d?.field==="groundTruth"&&l.jsx(UXe,{field:"groundTruth",errors:d.errors})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(It,{htmlFor:"item-trajectory",children:"Expected Trajectory (JSON, optional)"}),l.jsx(Rs,{value:c,onChange:u,showCopyButton:!1,className:"min-h-[80px]"})]}),l.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[l.jsx(he,{type:"button",onClick:v,children:"Cancel"}),l.jsx(he,{type:"submit",variant:"primary",disabled:p.isPending,children:p.isPending?"Adding...":"Add Item"})]})]})})]})})}function pes({selectedScorers:e,setSelectedScorers:t,disabled:n=!1,container:r}){const{data:s,isLoading:a}=Cp(),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(It,{children:"Scorers (Optional)"}),l.jsx(Awt,{options:i,value:e,onValueChange:t,placeholder:"Select scorers...",searchPlaceholder:"Search scorers...",emptyText:"No scorers available",disabled:n||a,container:r})]})}const hes=[{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"}];function mes({targetType:e,setTargetType:t,targetId:n,setTargetId:r,container:s}){const{data:a,isLoading:i}=Zv(),{data:o,isLoading:c}=Kw(),{data:u,isLoading:d}=Cp(),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(It,{children:"Target Type"}),l.jsx(Nc,{options:hes,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(It,{children:m}),l.jsx(Nc,{options:f,value:n,onValueChange:r,placeholder:`Select ${e}`,searchPlaceholder:"Search...",emptyText:"No targets available",disabled:p,container:s})]})]})}function ges({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}=Ui(),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});Rm.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";Rm.error(S)}},v=()=>{m||(r(!1),o(""),u(""),f([]))};return l.jsx(Dr,{open:n,onOpenChange:v,children:l.jsxs(Nr,{ref:a,children:[l.jsxs(Lr,{children:[l.jsx(Ar,{children:"Run Experiment"}),l.jsx(ga,{children:t?`Execute items from ${En(new Date(t),"MMM d, yyyy")} version against a target.`:"Execute all items in this dataset against a target."})]}),l.jsxs(ts,{className:"grid gap-6",children:[l.jsx(mes,{targetType:i,setTargetType:o,targetId:c,setTargetId:u,container:a}),i&&i!=="scorer"&&l.jsx(pes,{selectedScorers:d,setSelectedScorers:f,disabled:m,container:a})]}),l.jsxs(lp,{className:"px-6 pt-4",children:[l.jsx(he,{onClick:v,disabled:m,children:"Cancel"}),l.jsx(he,{variant:"primary",onClick:g,disabled:!h||m,children:m?l.jsxs(l.Fragment,{children:[l.jsx(tn,{className:"w-4 h-4"}),"Running..."]}):"Run"})]})]})})}const oLt=e=>{const t=We();return Et({queryKey:["experiment-trace-light",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return t.getTraceLight(e)},enabled:!!e})},qXe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"score",label:"Score",size:"1fr"}];function ves({result:e,scores:t,onPrevious:n,onNext:r,onClose:s,onShowTrace:a,onScoreClick:i,featuredScoreId:o}){const c=!!e?.error,u=cle(e?.input),d=cle(e?.output);return l.jsxs(l.Fragment,{children:[l.jsxs(Pn.Toolbar,{children:[l.jsx(iI,{onPrevious:n,onNext:r,previousAriaLabel:"View previous result details",nextAriaLabel:"View next result details"}),l.jsxs(jr,{children:[l.jsxs(he,{onClick:a,disabled:!e.traceId,children:[l.jsx(Pme,{}),"Show Trace"]}),l.jsx(he,{onClick:s,"aria-label":"Close result details panel",children:l.jsx(Pr,{})})]})]}),l.jsxs(Pn.Content,{children:[l.jsx(Xn,{withMargins:!1,children:l.jsxs(Xn.Column,{children:[l.jsxs(Xn.Title,{size:"smaller",children:[l.jsx(cb,{})," ",e.id]}),l.jsx(Xn.Description,{children:l.jsxs(ps,{children:[l.jsx(Q0,{})," ",e.itemId]})})]})}),c&&l.jsx(Qn,{variant:"destructive",title:"Error",children:l.jsx(Qn.Message,{children:cle(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:qXe,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:qXe,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(gj,{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(ln.CodeSection,{title:"Input",icon:l.jsx(Q0,{}),codeStr:u}),l.jsx(ln.CodeSection,{title:"Output",icon:l.jsx(Zf,{}),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(UC,{className:"w-4 h-4"})," Created"]}),l.jsx("p",{className:"text-sm text-neutral4",children:En(new Date(e.createdAt),"MMM d, yyyy 'at' h:mm a")})]})]})]})}function cle(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function yes({span:e}){return e?l.jsxs(l.Fragment,{children:[l.jsx(ln.CodeSection,{title:"Input",icon:l.jsx(Y0,{}),codeStr:JSON.stringify(e.input||null,null,2)}),l.jsx(ln.CodeSection,{title:"Output",icon:l.jsx(Zf,{}),codeStr:JSON.stringify(e.output||null,null,2)}),l.jsx(ln.CodeSection,{title:"Metadata",icon:l.jsx(yh,{}),codeStr:JSON.stringify(e.metadata||null,null,2)}),l.jsx(ln.CodeSection,{title:"Attributes",icon:l.jsx(yh,{}),codeStr:JSON.stringify(e.attributes||null,null,2)})]}):null}function bes({traceId:e,spanId:t,onNext:n,onPrevious:r,onClose:s}){const{data:a}=Hk(e,t),i=a?.span;return l.jsxs(l.Fragment,{children:[l.jsxs(Pn.Toolbar,{children:[l.jsx(iI,{onPrevious:r,onNext:n,previousAriaLabel:"View previous span details",nextAriaLabel:"View next span details"}),l.jsx(he,{onClick:s,"aria-label":"Close span details",children:l.jsx(Pr,{})})]}),l.jsxs(Pn.Content,{children:[l.jsx(Xn,{withMargins:!1,children:l.jsx(Xn.Column,{children:l.jsxs(Xn.Title,{size:"smaller",children:[l.jsx(yh,{})," Span ",Jf(t)]})})}),l.jsx(yes,{span:i})]})]})}const xes=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 lLt(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(n=>{t.push(n.id),t.push(...lLt(n))}),t}const VXe=["agent","workflow","model","mcp","tool","workspace","other"];function cLt(e){const t=e?.toLowerCase().split("_")[0],n={agent:{icon:l.jsx(Ll,{}),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(yu,{}),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(Fg,{}),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(kv,{}),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(vu,{}),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(Eq,{}),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 wes({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(Iet,{}):l.jsx(Nw,{}):l.jsx(bs,{})]}),a>(o??0)&&!i&&l.jsxs(HXe,{onClick:()=>s?.(),children:[a," ",l.jsx(jet,{})]})]}):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 Ses({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(Ret,{}):l.jsx(Aet,{})})})}function kes({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(Ses,{isLastChild:i,hasChildren:!!o,expanded:u})}),l.jsx("button",{className:"truncate",onClick:()=>s?.(e.id),children:e.name})]})}function uLt({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=lLt(e),v=g.length,b=t===0,S=cLt(e?.type),w=f?f.includes(e.id):!1,O=d&&d.length>0?!d.includes(e.id):!1,_=(c&&c.length>0?c.includes(S?.typePrefix||""):!1)||O;y.useEffect(()=>{b&&p?.([e.id])},[b,e.id,p]),y.useEffect(()=>{if(!d||!e.spans||e.spans.length===0)return;const N=e.spans.some(R=>d.includes(R.id));!w&&N&&C()},[d,e.spans,e.id,w,p,f]);const C=()=>{if(!(!p||!f))if(w){const N=[e.id,...g];p(f.filter(R=>!N.includes(R)))}else p([...f,e.id])},j=()=>{!p||!f||p([...f,e.id,...g])},I=g.every(N=>f?.includes(N));return l.jsxs(l.Fragment,{children:[l.jsx(kes,{span:e,spanUI:S,isFaded:_,depth:t,onSpanClick:n,selectedSpanId:r,isLastChild:s,hasChildren:h,isRootSpan:b,isExpanded:w,toggleChildren:C}),l.jsx(wes,{isSelected:r===e.id,isFaded:_,isExpanded:w,toggleChildren:C,expandAllDescendants:j,totalDescendants:v,allDescendantsExpanded:I,numOfChildren:m}),h&&w&&e.spans?.map((N,R,P)=>{const B=R===P.length-1;return l.jsx(uLt,{span:N,depth:t+1,onSpanClick:n,selectedSpanId:r,isLastChild:B,overallLatency:a,overallStartTime:i,fadedTypes:c,searchPhrase:u,expandedSpanIds:f,setExpandedSpanIds:p,featuredSpanIds:d},N.id)})]})}function Oes({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(tn,{})," Loading Trace Timeline ..."]}):l.jsx("div",{className:"grid grid-cols-[1fr_auto]",children:e?.map(f=>l.jsx(uLt,{span:f,onSpanClick:t,selectedSpanId:n,overallLatency:c,overallStartTime:u,overallEndTime:d,fadedTypes:s,featuredSpanIds:o,expandedSpanIds:a,setExpandedSpanIds:i},f.id))})})}function _es({spans:e=[],fadedTypes:t,onLegendClick:n,onLegendReset:r,onSearchPhraseChange:s,traceId:a}){const[i,o]=y.useState("");y.useEffect(()=>{o("")},[a]);const c=VXe.filter(p=>e.some(h=>h?.spanType?.startsWith(p)))||[],u=e.some(p=>!VXe.some(m=>p?.spanType?.startsWith(m))),d=p=>{n?.(p)};y.useEffect(()=>{f(i)},[i,s]);const f=npt(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(fw,{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(jr,{spacing:"close",children:[c.map(p=>{const h=cLt(p),m=t?.includes(p);return l.jsx(y.Fragment,{children:l.jsxs(he,{onClick:()=>d(p),className:m?"opacity-40":"",style:{color:m?void 0:h?.color,backgroundColor:h?.bgColor},children:[h?.icon&&l.jsx(Ve,{children:h.icon}),h?.label]})},p)}),u&&l.jsxs(he,{onClick:()=>d("other"),className:t?.includes("other")?"opacity-40":"",children:[l.jsx(Ve,{children:l.jsx(A7,{})}),"Other"]}),l.jsx(he,{onClick:r,disabled:t?.length===0,children:l.jsx(Ve,{children:l.jsx(Pr,{})})})]})]})}function Ees({traceId:e,selectedSpanId:t,onSpanSelect:n,onClose:r}){const{data:s,isLoading:a}=oLt(e),i=s?.spans??[],[o,c]=y.useState(""),[u,d]=y.useState([]),[f,p]=y.useState([]),[h,m]=y.useState([]),g=y.useMemo(()=>xes(i),[i]);y.useEffect(()=>{if(o.trim()===""){p([]);return}const w=o.toLowerCase(),O=i.filter(E=>E.name.toLowerCase().includes(w)).map(E=>E.spanId);p(O)},[o,i]),y.useEffect(()=>{c(""),d([]),p([]),m([])},[e]);const v=w=>{n?.(t===w?void 0:w)},b=w=>{d(O=>O.includes(w)?O.filter(E=>E!==w):[...O,w])},S=()=>{d([])};return l.jsxs(l.Fragment,{children:[l.jsx(Pn.Toolbar,{children:l.jsx(he,{onClick:r,"aria-label":"Close trace panel",children:l.jsx(Pr,{})})}),l.jsxs(Pn.Content,{children:[l.jsx(Xn,{withMargins:!1,children:l.jsx(Xn.Column,{children:l.jsxs(Xn.Title,{size:"smaller",children:[l.jsx(iu,{})," Trace ",Jf(e)]})})}),l.jsx(_es,{spans:i,fadedTypes:u,onLegendClick:b,onLegendReset:S,searchPhrase:o,onSearchPhraseChange:c,traceId:e}),l.jsx(Oes,{hierarchicalSpans:g,onSpanClick:v,selectedSpanId:t,isLoading:a,fadedTypes:u,expandedSpanIds:h,setExpandedSpanIds:m,featuredSpanIds:f})]})]})}function Ces({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(Oe,{columns:d,children:[l.jsx(Oe.Top,{children:s.map(f=>l.jsx(Oe.TopCell,{children:f.label},f.name))}),l.jsx("div",{className:"flex items-center justify-center py-20 col-span-full",children:l.jsx(tn,{})})]}):e.length===0?l.jsxs(Oe,{columns:d,children:[l.jsx(Oe.Top,{children:s.map(f=>l.jsx(Oe.TopCell,{children:f.label},f.name))}),l.jsx(Oe.NoMatch,{message:"No results yet"})]}):l.jsxs(Oe,{columns:d,children:[l.jsx(Oe.Top,{children:s.map(f=>l.jsx(Oe.TopCell,{children:f.label},f.name))}),l.jsxs(Oe.Rows,{children:[e.map(f=>{const p=!!f.error,h=f.id===n;return l.jsxs(Oe.Row,{onClick:()=>r(f.id),selected:h,children:[l.jsx(Oe.TextCell,{children:l.jsx("span",{className:"truncate block font-mono",children:f.itemId})}),l.jsx(Oe.Cell,{children:l.jsxs(rr,{children:[l.jsx(Jn,{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(er,{children:p?"Error":"Success"})]})}),s.some(m=>m.name==="input")&&l.jsx(Oe.TextCell,{children:l.jsx("span",{className:"truncate block font-mono",children:jes(Tes(f.input),200)})}),i?.map(m=>{const v=a?.[f.itemId]?.find(b=>b.scorerId===m);return l.jsx(Oe.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(tn,{})}),!u&&e.length>0&&l.jsx(be,{variant:"ui-xs",className:"text-icon3 text-center py-4 block",children:"All results loaded"})]})]})]})}function Tes(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function jes(e,t){return e.length<=t?e:e.slice(0,t-1)+"..."}function Ies(e){const t=e.scorer;return t?.hasJudge===!1?!0:t?.hasJudge===!0?!1:!e.preprocessPrompt&&!e.analyzePrompt&&!e.generateScorePrompt&&!e.generateReasonPrompt}function Nes({score:e,onNext:t,onPrevious:n,onClose:r}){const s=Ies(e),a=s?"N/A — code-based scorer":"N/A — step not configured";return l.jsxs(l.Fragment,{children:[l.jsxs(Pn.Toolbar,{children:[l.jsx(iI,{onPrevious:n,onNext:t,previousAriaLabel:"View previous score details",nextAriaLabel:"View next score details"}),l.jsx(he,{onClick:r,"aria-label":"Close score details",children:l.jsx(Pr,{})})]}),l.jsxs(Pn.Content,{children:[l.jsx(Xn,{withMargins:!1,children:l.jsx(Xn.Column,{children:l.jsxs(Xn.Title,{size:"smaller",children:[l.jsx(du,{})," ",e.scorerId]})})}),l.jsxs(pw,{children:[l.jsx(ln.CodeSection,{title:`Score: ${e.score}`,icon:l.jsx(du,{}),codeStr:e.reason||a,simplified:!0}),l.jsx(ln.CodeSection,{title:"Input",icon:l.jsx(Q0,{}),codeStr:JSON.stringify(e.input??null,null,2)}),l.jsx(ln.CodeSection,{title:"Output",icon:l.jsx(Zf,{}),codeStr:JSON.stringify(e.output??null,null,2)}),!s&&l.jsxs(l.Fragment,{children:[l.jsx(ln.CodeSection,{title:"Preprocess Prompt",icon:l.jsx(Zc,{}),codeStr:e.preprocessPrompt||a,simplified:!0}),l.jsx(ln.CodeSection,{title:"Analyze Prompt",icon:l.jsx(Zc,{}),codeStr:e.analyzePrompt||a,simplified:!0}),l.jsx(ln.CodeSection,{title:"Generate Score Prompt",icon:l.jsx(Zc,{}),codeStr:e.generateScorePrompt||a,simplified:!0}),l.jsx(ln.CodeSection,{title:"Generate Reason Prompt",icon:l.jsx(Zc,{}),codeStr:e.generateReasonPrompt||a,simplified:!0})]})]})]})]})}const ZXe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"avg",label:"Avg Score",size:"1fr"},{name:"count",label:"Items Scored",size:"1fr"}];function Aes({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(di,{iconSlot:l.jsx(du,{className:"w-8 h-8 text-neutral3"}),titleSlot:a,descriptionSlot:i})})}return l.jsxs(Qt,{children:[l.jsxs(Qt.Header,{columns:ZXe,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:ZXe,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 dLt({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}=F3t(e,t),b=y.useMemo(()=>{if(!v)return[];const z=new Set;for(const U of Object.values(v))for(const H of U)z.add(H.scorerId);return[...z].sort()},[v]),{data:S}=oLt(u),w=S?.spans??[],O=()=>{if(!f)return;const z=w.findIndex(U=>U.spanId===f);if(z>=0&&z<w.length-1)return()=>p(w[z+1].spanId)},E=()=>{if(!f)return;const z=w.findIndex(U=>U.spanId===f);if(z>0)return()=>p(w[z-1].spanId)},_=z=>{c(z),d(null),p(void 0),m(null)},C=z=>{_(z===o?null:z)},j=()=>{_(null)},I=()=>{if(!g)return;const z=n.findIndex(U=>U.id===g.id);if(z>=0&&z<n.length-1)return()=>_(n[z+1].id)},N=()=>{if(!g)return;const z=n.findIndex(U=>U.id===g.id);if(z>0)return()=>_(n[z-1].id)},R=g?v?.[g.itemId]:void 0,P=R?.find(z=>z.id===h)??null,B=z=>{m(z===h?null:z),d(null),p(void 0)},M=()=>{if(!h||!R)return;const z=R.findIndex(U=>U.id===h);if(z>=0&&z<R.length-1)return()=>m(R[z+1].id)},L=()=>{if(!h||!R)return;const z=R.findIndex(U=>U.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(Eu,{defaultTab:"summary",className:"grid grid-rows-[auto_1fr] h-full overflow-hidden",children:[l.jsxs(Cu,{children:[l.jsx(Hr,{value:"summary",children:"Summary"}),l.jsx(Hr,{value:"results",children:"Results"})]}),l.jsx(Os,{value:"summary",className:"overflow-y-auto mt-5",children:l.jsx(Aes,{scoresByItemId:v,experimentStatus:t})}),l.jsx(Os,{value:"results",className:"grid overflow-hidden mt-5",children:l.jsxs(ep,{className:g?"grid-cols-[1fr_2fr]":void 0,children:[l.jsx(Pn,{children:l.jsx(Ces,{results:n,isLoading:r,featuredResultId:o,onResultClick:C,columns:F,scoresByItemId:v,scorerIds:o?void 0:b,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i})}),g&&l.jsxs(XKn,{numOfColumns:1+(!u&&h?1:0)+(u?1:0)+(f?1:0),minColumnWidth:"35rem",children:[g&&l.jsx(Pn,{withLeftSeparator:!0,children:l.jsx(ves,{result:g,scores:R,onPrevious:N(),onNext:I(),onClose:j,onScoreClick:B,featuredScoreId:h,onShowTrace:()=>{d(g.traceId??null),p(void 0),m(null)}})}),g&&!u&&P&&l.jsx(Pn,{withLeftSeparator:!0,children:l.jsx(Nes,{score:P,onNext:M(),onPrevious:L(),onClose:()=>m(null)})}),g&&u&&l.jsx(Pn,{withLeftSeparator:!0,children:l.jsx(Ees,{traceId:u,selectedSpanId:f,onSpanSelect:p,onClose:()=>{d(null),p(void 0)}})}),g&&u&&f&&l.jsx(Pn,{withLeftSeparator:!0,children:l.jsx(bes,{traceId:u,spanId:f,onNext:O(),onPrevious:E(),onClose:()=>p(void 0)})})]})]})})]})}const Res={pending:l.jsx(fO,{}),running:l.jsx(Iz,{}),completed:l.jsx(ni,{}),failed:l.jsx(Pr,{})};function Pes({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:Res[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 fLt({experimentId:e,experiment:t}){const{Link:n,paths:r}=dn(),{data:s}=Zv(),{data:a}=Kw(),{data:i}=Cp(),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(Xn,{children:[l.jsxs(Xn.Column,{children:[l.jsxs(Xn.Title,{children:[l.jsx(Pet,{}),e," ",e&&l.jsx(ua,{content:e})]}),l.jsxs(Xn.Description,{children:[l.jsxs(ps,{children:[l.jsx(UC,{})," Created at ",En(new Date(t.createdAt),"MMM d, yyyy 'at' h:mm a")]}),t.completedAt&&l.jsxs(ps,{children:[l.jsx(UC,{})," Completed at ",En(new Date(t.completedAt),"MMM d, yyyy 'at' h:mm a")]})]}),l.jsxs(Xn.Description,{children:[l.jsxs(ps,{children:[l.jsx(SWt,{})," Target",l.jsx(n,{href:o(),children:c()})]}),t.agentVersion&&l.jsxs(ps,{children:[l.jsx(P7,{})," 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(ua,{content:t.agentVersion})]})]})]}),l.jsx(Xn.Column,{children:l.jsx(Pes,{experiment:t})})]})}function tEe({delta:e}){const t=e>0?l.jsx(ci,{size:"small",color:"green",intensity:"muted",children:l.jsx(Qle,{})}):e<0?l.jsx(ci,{size:"small",color:"red",intensity:"muted",children:l.jsx(tZt,{})}):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 Y5(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function Mes({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(Pn,{withLeftSeparator:!0,children:[l.jsxs(Pn.Toolbar,{children:[l.jsx(iI,{onPrevious:a,onNext:i,previousAriaLabel:"Previous comparison item",nextAriaLabel:"Next comparison item"}),l.jsx(jr,{children:l.jsx(he,{onClick:o,"aria-label":"Close comparison detail panel",children:l.jsx(Pr,{})})})]}),l.jsxs(Pn.Content,{className:"pb-6",children:[l.jsx(Xn,{withMargins:!1,children:l.jsx(Xn.Column,{children:l.jsxs(Xn.Title,{size:"smaller",children:[l.jsx(Q0,{})," ",e.itemId]})})}),d?l.jsx(l.Fragment,{children:l.jsxs(pw,{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(tEe,{delta:v})]})]},h)})})]}),l.jsx(ln.CodeSection,{title:l.jsxs(l.Fragment,{children:[l.jsx(ci,{color:"purple",children:"Baseline "})," Experiment Output"]}),icon:l.jsx(Zf,{}),codeStr:Y5(c?.output)}),l.jsx(ln.CodeSection,{title:l.jsxs(l.Fragment,{children:[l.jsx(ci,{color:"cyan",children:"Contender "})," Experiment Output"]}),icon:l.jsx(Zf,{}),codeStr:Y5(u?.output)}),l.jsx(ln.CodeSection,{title:"Item Input",icon:l.jsx(Y0,{}),codeStr:Y5(e.input)}),l.jsx(ln.CodeSection,{title:"Item Ground Truth",icon:l.jsx(Xet,{}),codeStr:Y5(e.groundTruth)})]})}):l.jsx(Qn,{variant:"warning",title:"Comparison not available",children:l.jsx(Qn.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 $es({items:e,baselineId:t,contenderId:n,scorerIds:r,featuredItemId:s,columns:a,onItemClick:i}){return l.jsx(Pn,{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(tEe,{delta:m})]}):l.jsx("span",{className:"text-neutral1",children:"-"})},f)})})]})},o.itemId)})})})]})})}const Des={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 WXe({datasetId:e,experiment:t,type:n}){const{Link:r}=dn(),{label:s,color:a,customStyle:i}=Des[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(ci,{size:"small",color:a,children:[s,l.jsx(FS,{})]}),l.jsx(he,{as:r,href:`/datasets/${e}/experiments/${t.id}`,children:l.jsx("span",{className:"truncate min-w-0",children:t.id})}),n==="baseline"&&l.jsxs(ci,{size:"small",color:a,children:[l.jsx(Ab,{})," ",s]})]}),l.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-ui-sm text-neutral3",children:[l.jsxs(ps,{children:[l.jsx(Xet,{})," ",t.targetType," / ",t.targetId]}),l.jsxs(ps,{children:[l.jsx(Uet,{})," v",t.datasetVersion??"—"]}),o&&l.jsxs(ps,{children:[l.jsx(Tet,{})," ",En(o,"MMM d, yyyy HH:mm")]})]})]})}function Les({datasetId:e,experimentIdA:t,experimentIdB:n,onSwap:r}){const[s,a]=y.useState(null),{data:i,isLoading:o,error:c}=tJr(e,t,n),{data:u}=y7(e,t),{data:d}=y7(e,n),f=u&&d&&u.datasetVersion!==d.datasetVersion,p=y.useMemo(()=>{if(!i)return[];const C=new Set;for(const j of i.items)for(const I of Object.values(j.results))if(I)for(const N of Object.keys(I.scores))C.add(N);return[...C].sort()},[i]),h=y.useMemo(()=>{if(!i||p.length===0)return[];const C=i.baselineId,j=t===C?n:t;return p.map(I=>{let N=0,R=0,P=0,B=0;for(const z of i.items){const U=z.results[C]?.scores[I],H=z.results[j]?.scores[I];U!=null&&(N+=U,P++),H!=null&&(R+=H,B++)}const M=P>0?N/P:null,L=B>0?R/B:null,F=M!=null&&L!=null?L-M:null;return{scorerId:I,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(C=>({name:C,label:C,size:"1fr"}))],[p,s]),v=i?.items.find(C=>C.itemId===s)??null,b=C=>{a(C===s?null:C)},S=()=>{a(null)},w=()=>{if(!i||!s)return;const C=i.items.findIndex(j=>j.itemId===s);if(C>=0&&C<i.items.length-1)return()=>a(i.items[C+1].itemId)},O=()=>{if(!i||!s)return;const C=i.items.findIndex(j=>j.itemId===s);if(C>0)return()=>a(i.items[C-1].itemId)};if(o)return l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx(tn,{})});if(c)return l.jsx(Qn,{variant:"warning",title:"Error loading comparison",children:l.jsx(Qn.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 E=i.baselineId,_=t===E?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(WXe,{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(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx(he,{onClick:r,children:"VS"})}),l.jsx(er,{children:"Switch the order"})]})})}),l.jsx(WXe,{datasetId:e,experiment:d,type:"contender"})]}),f&&l.jsx(Qn,{variant:"warning",title:"Version mismatch",children:l.jsxs(Qn.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(b6e,{children:[l.jsx(ci,{color:"purple",size:"small",intensity:"muted",children:"Baseline"}),l.jsx(ci,{color:"purple",size:"small",children:"Avg"})]})}),l.jsx(Qt.HeaderCol,{className:"flex justify-center",children:l.jsxs(b6e,{children:[l.jsx(ci,{color:"cyan",size:"small",intensity:"muted",children:"Contender"}),l.jsx(ci,{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:C,avgA:j,avgB:I,delta:N})=>l.jsxs(Qt.Row,{columns:m,children:[l.jsx(Qt.TextCell,{children:C}),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:I!=null?I.toFixed(3):"-"}),l.jsx(Qt.TextCell,{className:"flex justify-center",children:N!=null?l.jsx(tEe,{delta:N}):"-"})]},C))})})]}),l.jsxs(ep,{className:X({"grid-cols-[1fr_2fr]":!!v}),children:[l.jsx($es,{items:i.items,baselineId:E,contenderId:_,scorerIds:p,featuredItemId:s,columns:g,onItemClick:b}),!!v&&l.jsx(Mes,{item:v,baselineId:E,contenderId:_,baselineVersion:u?.datasetVersion,contenderVersion:d?.datasetVersion,onPrevious:O(),onNext:w(),onClose:S})]})]})}function zes({datasetId:e,itemId:t,onVersionSelect:n,onCompareVersionsClick:r,activeVersion:s}){const{data:a,isLoading:i}=eEe(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[O]=Array.from(w);return new Set([O,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(Pn,{className:"min-w-56",children:[o?l.jsx(Pn.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:l.jsxs(jr,{children:[l.jsx(he,{onClick:m,children:"Cancel"}),l.jsx(he,{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(Pn.Toolbar,{children:l.jsxs(he,{onClick:g,className:"w-full",children:[l.jsx(X0,{})," Compare Ver."]})})}),i?l.jsx(Fes,{}):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(go,{checked:u.has(S),disabled:b.isDeleted,onCheckedChange:()=>{},onClick:O=>{O.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 Fes(){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 Bes(e,t){if(t){const n=typeof t=="string"?new Date(t):t;return`v${e} ${En(n,"MMM dd 'at' H:mm:ss a")}`}return`v${e}`}function Ues({datasetId:e,versionA:t,versionB:n,onVersionChange:r}){const{data:s}=K_e(e),a=(s??[]).map(i=>({value:String(i.version),label:`${Bes(i.version,i.createdAt)}${i.isCurrent?" (current)":""}`}));return l.jsxs(Pn.Toolbar,{className:"grid grid-cols-[1fr_1fr_1fr_10rem] gap-4 w-full",children:[l.jsx("div",{}),l.jsx(Ic,{label:"Version A",labelIsHidden:!0,name:"version-a",placeholder:"Select version",options:a,value:t??"",onValueChange:i=>r?.(i,n??"")}),l.jsx(Ic,{label:"Version B",labelIsHidden:!0,name:"version-b",options:a,value:n??"",onValueChange:i=>r?.(t??"",i)}),l.jsx("div",{})]})}const qes=[{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"}],Ves={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(Qet,{}),tooltip:"Changed in this version"},same:{color:"green",borderColor:"border-green-900",icon:l.jsx(RWt,{}),tooltip:"Same in both versions"}};function ule({red:e=!1,tooltip:t}){return l.jsxs(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx(dZt,{className:X("text-neutral3/40 w-5 h-5 ",{"text-red-900":e})})}),t&&l.jsx(er,{children:t})]})}function Q1({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}=Ves[e];return l.jsxs(rr,{children:[l.jsx(Jn,{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(ci,{color:n,size:"small",children:r})]})}),l.jsx(er,{children:s})]})}function Hes(e,t){return e&&t&&e.datasetVersion===t.datasetVersion?"same":e&&t&&e.datasetVersion!==t.datasetVersion?"changed":e?"added":"removed"}function Zes({datasetId:e,versionA:t,versionB:n,allItems:r,itemsAMap:s,itemsBMap:a}){const{Link:i}=dn(),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=Hes(u,d);return l.jsxs(Qt.Row,{columns:qes,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(Q1,{variant:"added",version:u.datasetVersion}):f==="changed"&&o?l.jsx(Q1,{variant:"changed",version:u.datasetVersion}):l.jsx(Q1,{version:u.datasetVersion})}):l.jsx(Qt.Cell,{className:"justify-center flex items-center",children:l.jsx(ule,{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(Q1,{variant:"added",version:d.datasetVersion}):f==="changed"&&!o?l.jsx(Q1,{variant:"changed",version:d.datasetVersion}):l.jsx(Q1,{version:d.datasetVersion})}):l.jsx(Qt.Cell,{className:"justify-center flex items-center",children:l.jsx(ule,{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(Q1,{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(ule,{tooltip:l.jsxs(l.Fragment,{children:["Comparing is available",l.jsx("br",{})," only for changed items"]})})})]},c)})})})})}const GXe={needsReview:"#facc15",complete:"#22c55e"},Wes=[{label:"Needs Review",color:GXe.needsReview},{label:"Reviewed",color:GXe.complete}];function Ges({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(Xt,{children:[l.jsxs(Xt.TopBar,{children:[l.jsx(Xt.TitleAndDescription,{title:"Review Pipeline",description:"Items in review across experiments."}),c&&l.jsx(Xt.Summary,{value:String(o),label:"Items in pipeline"})]}),r?l.jsx(Xt.Loading,{}):s?l.jsx(Xt.Error,{message:"Failed to load review data"}):l.jsx(Xt.Content,{children:c?l.jsx(CT,{data:a,segments:Wes,maxVal:i,fmt:u=>String(u)}):l.jsx(Xt.NoData,{message:"No items have been sent to review yet"})})]})}function nEe(){const e=We();return Et({queryKey:["experiment-review-summary"],queryFn:()=>e.getExperimentReviewSummary()})}function pLt(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 Qes(e,t){const n=new Map,r=pLt(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 Yes(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 Xes=10;function Kes(){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}=Bv({page:d,perPage:Xes}),{data:g,isLoading:v,error:b}=BH(),{data:S}=nEe(),w=y.useMemo(()=>p?.datasets??[],[p?.datasets]),O=p?.pagination?.hasMore??!1,E=y.useMemo(()=>g?.experiments??[],[g?.experiments]),_=y.useMemo(()=>bJr(w),[w]),C=y.useMemo(()=>Qes(S,E),[S,E]),j=h||v,I=m||b,N=()=>t(!0),R=y.useCallback(()=>f(H=>H+1),[]),P=y.useCallback(()=>f(H=>Math.max(0,H-1)),[]),B=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(I&&Bs(I))return l.jsx(cr,{children:l.jsx(fa,{})});if(I&&qs(I))return l.jsx(cr,{children:l.jsx(sa,{resource:"datasets"})});if(I)return l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load datasets",message:I.message})});if(w.length===0&&!j&&d===0)return l.jsxs(l.Fragment,{children:[l.jsx(cr,{children:l.jsx(xJr,{onCreateClick:N})}),l.jsx(nme,{open:e,onOpenChange:t})]});const z=s!=="all"||i!=="all"||c!=="all"||n!=="",U=()=>{r(""),a("all"),o("all"),u("all"),f(0)};return l.jsxs(Tn,{children:[l.jsx(Tn.TopArea,{children:l.jsx(SJr,{search:n,onSearchChange:B,targetFilter:s,onTargetFilterChange:M,experimentFilter:i,onExperimentFilterChange:L,tagFilter:c,onTagFilterChange:F,tagOptions:_,onReset:U,hasActiveFilters:z,onCreateClick:N})}),l.jsx(gJr,{datasets:w,experiments:E,reviewByDataset:C,isLoading:j,search:n,targetFilter:s,experimentFilter:i,tagFilter:c,currentPage:d,hasMore:O,onNextPage:R,onPrevPage:P}),l.jsx(nme,{open:e,onOpenChange:t})]})}const Jes=new Set(["items","experiments","review"]);function ets(){const{datasetId:e}=Mr(),t=ku(),[n,r]=xo(),s=n.get("tab"),a=s&&Jes.has(s)?s:"items",i=_=>{r(_==="items"?{}:{tab:_},{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}=Yb(e??"");if(!e)return l.jsx(pr,{children:l.jsx(Oh,{children:l.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(S&&Bs(S))return l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})});if(S&&qs(S))return l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"datasets"})})});const w=_=>{t(`/datasets/${e}/experiments/${_}`)},O=()=>{t("/datasets")},E=_=>{v(_?.version??null)};return l.jsx(pr,{children:l.jsxs(Oh,{className:"content-stretch",children:[l.jsx(ues,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>p(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:E,initialTab:a,onTabChange:i,experimentTriggerSlot:l.jsxs(he,{variant:"primary",onClick:()=>c(!0),children:[l.jsx(cb,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),l.jsx(ges,{datasetId:e,version:g??void 0,open:o,onOpenChange:c,onSuccess:w}),l.jsx(fes,{datasetId:e,open:u,onOpenChange:d}),b&&l.jsx(EJr,{open:f,onOpenChange:p,dataset:{id:b.id,name:b.name,description:b?.description||"",inputSchema:b.inputSchema,groundTruthSchema:b.groundTruthSchema}}),b&&l.jsx(CJr,{open:h,onOpenChange:m,datasetId:b.id,datasetName:b.name,onSuccess:O})]})})}function tts(){const{datasetId:e,experimentId:t}=Mr(),{data:n,isLoading:r,error:s}=y7(e,t),{data:a,isLoading:i,setEndOfListElement:o,isFetchingNextPage:c,hasNextPage:u}=FH({datasetId:e,experimentId:t,experimentStatus:n?.status});return!e||!t?null:r?l.jsx(pr,{children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(tn,{})})}):s&&Bs(s)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})}):s&&qs(s)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"datasets"})})}):s||!n?l.jsx(pr,{children:l.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",s instanceof Error?s.message:"Unknown error"]})}):l.jsx(pr,{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(fLt,{experimentId:t,experiment:n}),l.jsx(dLt,{experimentId:t,experimentStatus:n?.status,results:a??[],isLoading:i,setEndOfListElement:o,isFetchingNextPage:c,hasNextPage:u})]})})})}function nts(){const{datasetId:e}=Mr(),[t,n]=xo(),{error:r}=Yb(e??""),s=t.get("baseline")??"",a=t.get("contender")??"";return r&&Bs(r)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})}):r&&qs(r)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"datasets"})})}):!e||!s||!a?l.jsx(pr,{children:l.jsx(Oh,{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(pr,{children:l.jsx(Oh,{children:l.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[l.jsxs(Xn,{children:[l.jsxs(Xn.Column,{children:[l.jsxs(Xn.Title,{children:[l.jsx(X0,{})," Dataset Experiments Comparison"]}),l.jsxs(Xn.Description,{children:["Comparing"," ",l.jsx($o,{to:`/datasets/${e}/experiments/${s}`,children:s.slice(0,8)})," vs"," ",l.jsx($o,{to:`/datasets/${e}/experiments/${a}`,children:a.slice(0,8)})]})]}),l.jsx(Xn.Column,{children:l.jsxs(he,{as:$o,to:`/datasets/${e}`,children:[l.jsx(Ab,{}),"Back to Dataset"]})})]}),l.jsx(Les,{datasetId:e,experimentIdA:s,experimentIdB:a,onSwap:()=>{n({baseline:a,contender:s})}})]})})})}function rts(){const{datasetId:e,itemId:t}=Mr(),{Link:n}=dn(),r=ku(),{data:s,isLoading:a,error:i}=eEe(e??"",t??""),{updateItem:o,deleteItem:c}=Ui(),{data:u}=Yb(e??""),d=s?.[0]??null,f=d?.isDeleted??!1,[p,h]=y.useState(null),m=y.useMemo(()=>!d||f?{input:"",groundTruth:"",metadata:"",trajectory:""}:{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):"",trajectory:d.expectedTrajectory!=null?JSON.stringify(d.expectedTrajectory,null,2):""},[d,f]),g=d?.datasetVersion??0,[v,b]=y.useState(!1),[S,w]=y.useState(m.input),[O,E]=y.useState(m.groundTruth),[_,C]=y.useState(m.metadata),[j,I]=y.useState(m.trajectory),[N,R]=y.useState(g);g!==N&&(R(g),w(m.input),E(m.groundTruth),C(m.metadata),I(m.trajectory));const[P,B]=y.useState(!1),M=Z=>{h(f?Z:Z.isLatest?null:Z)},L=()=>{h(null)},F=!f&&p!=null,z=()=>{F||b(!0)},U=()=>{F||B(!0)},H=async()=>{if(!e||!t)return;let Z;try{Z=JSON.parse(S)}catch{Be.error("Input must be valid JSON");return}let G;if(O.trim())try{G=JSON.parse(O)}catch{Be.error("Ground Truth must be valid JSON");return}let K;if(_.trim())try{K=JSON.parse(_)}catch{Be.error("Metadata must be valid JSON");return}let ne;const ee=j!==m.trajectory;if(ee&&j.trim())try{ne=JSON.parse(j)}catch{Be.error("Expected Trajectory must be valid JSON");return}try{await o.mutateAsync({datasetId:e,itemId:t,input:Z,groundTruth:G,metadata:K,...ee?{expectedTrajectory:ne??null}:{}}),Be.success("Item updated successfully"),b(!1)}catch(J){Be.error(`Failed to update item: ${J instanceof Error?J.message:"Unknown error"}`)}},D=()=>{d&&(w(JSON.stringify(d.input,null,2)),E(d.groundTruth?JSON.stringify(d.groundTruth,null,2):""),C(d.metadata?JSON.stringify(d.metadata,null,2):""),I(d.expectedTrajectory!=null?JSON.stringify(d.expectedTrajectory,null,2):"")),b(!1)},Y=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),Be.success("Item deleted successfully"),B(!1),r(`/datasets/${e}`)}catch(Z){Be.error(`Failed to delete item: ${Z instanceof Error?Z.message:"Unknown error"}`)}},V=p??d,$=V?{id:t??"",datasetId:e??"",datasetVersion:V.datasetVersion,input:V.input,groundTruth:V.groundTruth,expectedTrajectory:V.expectedTrajectory,metadata:V.metadata,createdAt:V.createdAt,updatedAt:V.updatedAt}:null;return i&&Bs(i)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})}):i&&qs(i)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"datasets"})})}):a?null:!e||!t||!s||s.length===0?l.jsx(pr,{children:l.jsx(Oh,{children:l.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):l.jsxs(l.Fragment,{children:[l.jsx(pr,{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(Xn,{children:[l.jsxs(Xn.Column,{children:[l.jsxs(Xn.Title,{children:[l.jsx(Q0,{}),t," ",l.jsx(ua,{content:t})]}),l.jsx(Xn.Description,{children:l.jsxs(ps,{children:["Item of ",l.jsx(G0,{})," ",u?.name]})}),l.jsxs(Xn.Description,{children:[l.jsxs(ps,{children:[l.jsx(UC,{})," Created at"," ",d?.createdAt?En(new Date(d.createdAt),"MMM d, yyyy"):""]}),l.jsxs(ps,{children:[l.jsx(Aw,{})," Latest version v",d?.datasetVersion??""]})]})]}),l.jsx(Xn.Column,{children:!v&&!f&&l.jsxs(jr,{children:[l.jsxs(he,{onClick:z,disabled:F,title:F?"Return to latest version to edit":void 0,children:[l.jsx(Qet,{})," Edit"]}),l.jsxs(he,{onClick:U,disabled:F,title:F?"Return to latest version to delete":void 0,children:[l.jsx(Xd,{})," Delete"]})]})})]}),l.jsxs(ep,{className:v?"grid-cols-1":"grid-cols-[1fr_auto]",children:[l.jsxs(Pn,{withRightSeparator:!v,children:[f&&d&&l.jsx(Qn,{variant:"destructive",title:"Item deleted",children:l.jsxs(Qn.Message,{children:["This item was deleted at version v",d.datasetVersion]})}),!f&&F&&p&&l.jsx(Qn,{variant:"warning",title:"Previous version",action:l.jsxs(Qn.Button,{onClick:L,children:[l.jsx(dS,{})," Return to the latest version"]}),children:l.jsxs(Qn.Message,{children:["Viewing version v",p.datasetVersion]})}),v?l.jsx(sLt,{inputValue:S,setInputValue:w,groundTruthValue:O,setGroundTruthValue:E,metadataValue:_,setMetadataValue:C,trajectoryValue:j,setTrajectoryValue:I,validationErrors:null,onSave:H,onCancel:D,isSaving:o.isPending}):$?l.jsx(UH,{item:$,Link:n}):l.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!v&&l.jsx(Pn,{children:l.jsx(zes,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:M,onCompareVersionsClick:Z=>{r(`/datasets/${e}/items/${t}/versions?ids=${Z.join(",")}`)},activeVersion:p?.datasetVersion??null})})]})]})})}),l.jsx(en,{open:P,onOpenChange:B,children:l.jsxs(en.Content,{children:[l.jsxs(en.Header,{children:[l.jsx(en.Title,{children:"Delete Item"}),l.jsx(en.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),l.jsxs(en.Footer,{children:[l.jsx(en.Cancel,{children:"Cancel"}),l.jsx(en.Action,{onClick:Y,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function QXe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function sts(){const{datasetId:e}=Mr(),[t,n]=xo(),r=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=Yb(e??""),{Link:i}=dn(),[o,c]=y.useState(!1),{data:u}=Jhe(e??"",r[0]??""),{data:d}=Jhe(e??"",r[1]??"");return a&&Bs(a)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})}):a&&qs(a)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"datasets"})})}):!e||r.length<2?l.jsx(pr,{children:l.jsx(Oh,{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(pr,{children:[l.jsx(Uv,{owner:"dataset-items-compare",children:l.jsxs(he,{as:$o,to:`/datasets/${e}`,variant:"outline",children:[l.jsx(Ab,{}),"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(Xn,{children:[l.jsxs(Xn.Column,{children:[l.jsxs(Xn.Title,{children:[l.jsx(X0,{}),"Compare Dataset Items"]}),l.jsx(Xn.Description,{children:l.jsxs(ps,{children:["Comparing ",r.length," items of"," ",l.jsx($o,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:s?.name||e?.slice(0,8)})]})})]}),l.jsx(Xn.Column,{children:l.jsx(jr,{children:l.jsx(he,{variant:"primary",onClick:()=>c(f=>!f),children:o?l.jsxs(l.Fragment,{children:[l.jsx(Let,{})," Default View"]}):l.jsxs(l.Fragment,{children:[l.jsx(_Wt,{})," Diff View"]})})})})]}),l.jsx(ep,{className:"grid-cols-[1fr_3vw_1fr]",children:r.map((f,p)=>l.jsxs(y.Fragment,{children:[l.jsx(ats,{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(M1t,{codeA:QXe(u),codeB:QXe(d)})]})})]})}function ats({datasetId:e,itemId:t,Link:n,idx:r,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:o,isLoading:c}=Jhe(e,t),{data:u}=cj(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(Pn,{children:[l.jsxs(Pn.Toolbar,{className:"flex gap-4",children:[l.jsxs(fi,{name:`compare-item-${r}`,value:t,onValueChange:a,children:[l.jsx(Ka,{"aria-label":"Item",children:l.jsx(pi,{placeholder:"Select item"})}),l.jsx(Ja,{children:f.map(p=>l.jsx(os,{value:p.value,disabled:p.disabled,children:p.label},p.value))})]}),l.jsxs(he,{as:n,to:`/datasets/${e}/items/${t}`,children:[l.jsx(Aw,{}),"Versions"]})]}),i&&l.jsx(Pn.Content,{children:c?l.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):o?l.jsxs(l.Fragment,{children:[l.jsx(aLt,{item:o}),l.jsx(UH,{item:o,Link:n})]}):l.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function YXe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function its(){const{datasetId:e,itemId:t}=Mr(),[n,r]=xo(),[s,a]=y.useState(!1),i=n.get("ids")?.split(",").map(Number).filter(h=>!isNaN(h)&&h>0)??[],{data:o,error:c}=Yb(e??""),{Link:u}=dn(),{data:d}=eEe(e??"",t??""),{data:f}=ame(e??"",t??"",i[0]??0,o?.version),{data:p}=ame(e??"",t??"",i[1]??0,o?.version);return c&&Bs(c)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})}):c&&qs(c)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"datasets"})})}):!e||!t||i.length<2?l.jsx(pr,{children:l.jsx(Oh,{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(pr,{children:[l.jsx(Uv,{owner:"dataset-item-versions-compare",children:l.jsxs(he,{as:$o,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[l.jsx(Ab,{}),"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(Xn,{children:[l.jsxs(Xn.Column,{children:[l.jsxs(Xn.Title,{children:[l.jsx(X0,{}),"Compare Dataset Item Versions"]}),l.jsx(Xn.Description,{children:l.jsxs(ps,{children:["Comparing ",i.length," versions of"," ",l.jsx($o,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),l.jsx(Xn.Column,{children:l.jsx(jr,{children:l.jsx(he,{variant:"primary",onClick:()=>a(h=>!h),children:s?l.jsxs(l.Fragment,{children:[l.jsx(Let,{})," Default View"]}):l.jsxs(l.Fragment,{children:[l.jsx(lGt,{})," Diff View"]})})})})]}),l.jsx(ep,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((h,m)=>l.jsxs(y.Fragment,{children:[l.jsx(ots,{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(M1t,{codeA:YXe(f),codeB:YXe(p)})]})})]})}function ots({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}=ame(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]})," - ",En(v,"MMM d, yyyy h:mm a"),g.isLatest?l.jsx(ci,{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(Pn,{children:[l.jsxs(Pn.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[l.jsx(Aw,{className:"w-6 h-6 opacity-50"}),l.jsxs(fi,{name:`compare-version-${o}`,value:String(n),onValueChange:g=>u(Number(g)),children:[l.jsx(Ka,{"aria-label":"Version",className:"w-full",children:l.jsx(pi,{placeholder:"Select version"})}),l.jsx(Ja,{children:h.map(g=>l.jsx(os,{value:g.value,disabled:g.disabled,children:g.label},g.value))})]})]}),c&&l.jsx(Pn.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(UH,{item:m,Link:i})})]})}function lts(){const{datasetId:e}=Mr(),[t]=xo(),n=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],r=ku(),{data:s,error:a}=Yb(e??""),i=cj(e??"",void 0,n[0]??null),o=cj(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&&Bs(a))return l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})});if(a&&qs(a))return l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"datasets"})})});if(!e||n.length<2)return l.jsx(pr,{children:l.jsx(Oh,{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(pr,{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(Xn,{children:[l.jsxs(Xn.Column,{children:[l.jsxs(Xn.Title,{children:[l.jsx(EQt,{})," Compare Dataset Versions"]}),l.jsx(Xn.Description,{children:l.jsxs(ps,{children:[l.jsx(Aw,{})," Comparing ",n.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),l.jsx(Xn.Column,{children:l.jsxs(he,{as:$o,to:`/datasets/${e}`,children:[l.jsx(Ab,{}),"Back to Dataset"]})})]}),l.jsx(ep,{children:l.jsxs(Pn,{children:[l.jsx(Ues,{datasetId:e,versionA:String(n[0]),versionB:String(n[1]),onVersionChange:m}),l.jsx(Zes,{datasetId:e,versionA:n[0],versionB:n[1],allItems:d,itemsAMap:f,itemsBMap:p,onItemClick:h})]})})]})})})}function cts(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 uts({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=cts(n);return l.jsxs(l.Fragment,{children:[l.jsxs(Ur,{children:[l.jsx(Ur.Label,{children:"Total Scorers"}),i?l.jsx(Ur.Loading,{}):f!=null?l.jsxs(l.Fragment,{children:[l.jsx(Ur.Value,{children:String(f)}),l.jsx(Ur.NoChange,{message:"Static count"})]}):l.jsx(Ur.NoData,{})]}),l.jsxs(Ur,{children:[l.jsx(Ur.Label,{children:"Total Datasets"}),o?l.jsx(Ur.Loading,{}):p!=null?l.jsxs(l.Fragment,{children:[l.jsx(Ur.Value,{children:String(p)}),l.jsx(Ur.NoChange,{message:"Static count"})]}):l.jsx(Ur.NoData,{})]}),l.jsxs(Ur,{children:[l.jsx(Ur.Label,{children:"Avg Score"}),u?l.jsx(Ur.Loading,{}):r!=null?l.jsxs(l.Fragment,{children:[l.jsx(Ur.Value,{children:String(r)}),m?l.jsx(Ur.Change,{changePct:m.changePct,prevValue:m.prevValue}):l.jsx(Ur.NoChange,{})]}):l.jsx(Ur.NoData,{})]}),l.jsxs(Ur,{children:[l.jsx(Ur.Label,{children:"Total Experiments"}),c?l.jsx(Ur.Loading,{}):h!=null?l.jsxs(l.Fragment,{children:[l.jsx(Ur.Value,{children:String(h)}),g?l.jsx(Ur.Change,{changePct:g.changePct,prevValue:g.prevValue}):l.jsx(Ur.NoChange,{})]}):l.jsx(Ur.NoData,{})]}),l.jsxs(Ur,{children:[l.jsx(Ur.Label,{children:"Needs Review"}),d?l.jsx(Ur.Loading,{}):a!=null?l.jsxs(l.Fragment,{children:[l.jsx(Ur.Value,{children:String(a)}),a>0?l.jsx(Ur.NoChange,{message:"items pending review"}):l.jsx(Ur.NoChange,{message:"All caught up"})]}):l.jsx(Ur.NoData,{})]})]})}const dts=[{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 fts(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const pts={completed:"success",running:"warning",failed:"error",pending:"neutral"};function hts({experiments:e,datasets:t,reviewByExperiment:n,isLoading:r,search:s="",statusFilter:a="all",datasetFilter:i="all"}){const{paths:o,Link:c}=dn(),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(Bd,{columns:XXe}):l.jsxs(Oe,{columns:XXe,children:[l.jsxs(Oe.Top,{children:[l.jsx(Oe.TopCell,{children:"Experiment"}),l.jsx(Oe.TopCell,{children:"Dataset"}),l.jsx(Oe.TopCell,{children:"Target"}),l.jsx(Oe.TopCell,{children:"Status"}),l.jsx(Oe.TopCell,{className:"text-center",children:"Items"}),l.jsx(Oe.TopCell,{className:"text-center",children:"Succeeded"}),l.jsx(Oe.TopCell,{className:"text-center",children:"Failed"}),l.jsx(Oe.TopCell,{className:"text-center",children:"Review"}),l.jsx(Oe.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(Oe.RowLink,{to:o.experimentLink(p.id),LinkComponent:c,children:[l.jsx(Oe.NameCell,{className:"font-mono",children:p.id.slice(0,8)}),l.jsx(Oe.TextCell,{children:h}),l.jsx(Oe.Cell,{children:l.jsxs("span",{className:"truncate",children:[p.targetType," ",p.targetId]})}),l.jsx(Oe.Cell,{children:l.jsx(Vk,{variant:pts[m]??"neutral",withDot:!0,children:m})}),l.jsx(Oe.TextCell,{className:"text-center",children:b}),l.jsx(Oe.TextCell,{className:"text-center",children:l.jsxs("span",{className:g>0?"text-accent1":"",children:[g," (",S,"%)"]})}),l.jsx(Oe.TextCell,{className:"text-center",children:l.jsx("span",{className:v>0?"text-accent2":"",children:v})}),l.jsx(Oe.Cell,{className:"text-center",children:(()=>{const w=n?.get(p.id);if(!w)return l.jsx("span",{className:"text-neutral2",children:"—"});const O=w.needsReview+w.complete;return O===0?l.jsx("span",{className:"text-neutral2",children:"—"}):w.needsReview>0?l.jsxs(Ct,{variant:"warning",children:[w.needsReview," pending"]}):l.jsxs(Ct,{variant:"success",children:[w.complete,"/",O," reviewed"]})})()}),l.jsx(Oe.TextCell,{children:fts(p.createdAt)})]},p.id)})]})}function mts(e){return[{value:"all",label:"All datasets"},...(e??[]).map(t=>({value:t.id,label:t.name}))]}const X5={completed:"#22c55e",running:"#facc15",pending:"#fb923c",failed:"#f87171"},gts=[{label:"Completed",color:X5.completed},{label:"Running",color:X5.running},{label:"Pending",color:X5.pending},{label:"Failed",color:X5.failed}];function vts({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(Xt,{children:[l.jsxs(Xt.TopBar,{children:[l.jsx(Xt.TitleAndDescription,{title:"Experiments by Dataset",description:"Experiment status breakdown per dataset."}),i&&l.jsx(Xt.Summary,{value:String(e?.length??0),label:"Total experiments"})]}),n?l.jsx(Xt.Loading,{}):r?l.jsx(Xt.Error,{message:"Failed to load experiments data"}):l.jsx(Xt.Content,{children:i?l.jsx(CT,{data:s,segments:gts,maxVal:a,fmt:o=>String(o)}):l.jsx(Xt.NoData,{message:"No experiments have been run yet"})})]})}const yts=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(di,{iconSlot:l.jsx(Yd,{}),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(he,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",children:["Experiments Documentation ",l.jsx(Ba,{})]})})})});function bts({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(Fv,{label:"Search experiments",placeholder:"Filter by experiment, dataset, or target",value:e,onSearch:t}),l.jsxs(jr,{children:[l.jsx(Ic,{label:"Status",labelIsHidden:!0,name:"filter-status",options:[...dts],value:n,onValueChange:r,className:"whitespace-nowrap"}),l.jsx(Ic,{label:"Dataset",labelIsHidden:!0,name:"filter-dataset",options:i,value:s,onValueChange:a,className:"whitespace-nowrap"}),o&&c&&l.jsxs(he,{onClick:o,size:"sm",variant:"default",children:[l.jsx(Pr,{className:"size-3"})," Reset"]})]})]})}function xts(){const{data:e,isLoading:t,error:n}=Cp(),{data:r,isLoading:s,error:a}=Bv(),{data:i,isLoading:o,error:c}=BH(),{data:u,isLoading:d,isError:f,error:p}=vWr(),{data:h,isLoading:m,isError:g,error:v}=nEe(),b=r?.datasets,S=i?.experiments,w=y.useMemo(()=>Yes(h),[h]),O=n||a||c||p||v;return O&&Bs(O)?l.jsx(cr,{children:l.jsx(fa,{})}):O&&qs(O)?l.jsx(cr,{children:l.jsx(sa,{resource:"evaluation"})}):O?l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load evaluation data",message:O.message})}):l.jsx(Tn,{width:"wide",height:"full",children:l.jsxs("div",{className:"flex flex-col gap-6",children:[l.jsx(wfe,{children:l.jsx(uts,{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(oWr,{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(wJr,{experiments:S,isLoading:o,isError:!!c}),l.jsx(vts,{experiments:S,datasets:b,isLoading:o,isError:!!c})]}),l.jsx(Ges,{reviewSummary:h,experiments:S,datasets:b,isLoading:m,isError:!!g})]})})}function wts(){const[e,t]=y.useState(""),[n,r]=y.useState("all"),[s,a]=y.useState("all"),{data:i,isLoading:o,error:c}=Bv(),{data:u,isLoading:d,error:f}=BH(),{data:p}=nEe(),h=y.useMemo(()=>i?.datasets??[],[i?.datasets]),m=y.useMemo(()=>u?.experiments??[],[u?.experiments]),g=y.useMemo(()=>mts(h),[h]),v=y.useMemo(()=>pLt(p),[p]),b=o||d,S=f||c;if(S&&Bs(S))return l.jsx(cr,{children:l.jsx(fa,{})});if(f&&qs(f))return l.jsx(cr,{children:l.jsx(sa,{resource:"experiments"})});if(c&&qs(c))return l.jsx(cr,{children:l.jsx(sa,{resource:"datasets"})});if(S)return l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load experiments",message:S.message})});if(m.length===0&&!b)return l.jsx(cr,{children:l.jsx(yts,{})});const w=n!=="all"||s!=="all"||e!=="",O=()=>{t(""),r("all"),a("all")};return l.jsxs(Tn,{children:[l.jsx(Tn.TopArea,{children:l.jsx(bts,{search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:g,onReset:O,hasActiveFilters:w})}),l.jsx(hts,{experiments:m,datasets:h,reviewByExperiment:v,isLoading:b,search:e,statusFilter:n,datasetFilter:s})]})}function Sts(){const{experimentId:e}=Mr(),{data:t,isLoading:n}=BH(),s=t?.experiments?.find(h=>h.id===e)?.datasetId??"",{data:a,isLoading:i,error:o}=y7(s,e??""),{data:c,isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:p}=FH({datasetId:s,experimentId:e??"",experimentStatus:a?.status});return e?n||i||!s?l.jsx(pr,{children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(tn,{})})}):o&&Bs(o)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})}):o&&qs(o)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"datasets"})})}):o||!a?l.jsx(pr,{children:l.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",o instanceof Error?o.message:"Unknown error"]})}):l.jsx(pr,{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(fLt,{experimentId:e,experiment:a}),l.jsx(dLt,{experimentId:e,experimentStatus:a?.status,results:c??[],isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:p})]})})}):null}function hLt({redirectUri:e,onSuccess:t,initialMode:n="signin",errorMessage:r}){const{data:s,isLoading:a}=oI(),{mutate:i,isPending:o,error:c}=_Kr(),{mutate:u,isPending:d,error:f}=CKr(),{mutate:p,isPending:h}=X3t(),[m,g]=y.useState(n),[v,b]=y.useState(""),[S,w]=y.useState(""),[O,E]=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:_}=s,C=_.type==="sso"||_.type==="both",j=_.type==="credentials"||_.type==="both",I=_.sso,N=_.signUpEnabled!==!1,R=m==="signin"||!N,P=R?o:d,B=R?c:f,M=()=>{t?t():e?window.location.href=e:window.location.href="/"},L=U=>{U.preventDefault(),R?i({email:S,password:O},{onSuccess:M}):u({email:S,password:O,name:v||void 0},{onSuccess:M})},F=()=>{p({redirectUri:e},{onSuccess:U=>{window.location.href=U.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(sb,{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"})]}),_.description&&l.jsxs("div",{className:"flex items-start gap-2.5 rounded-md border border-border1 bg-surface1 p-3",children:[l.jsx(qet,{className:"mt-0.5 h-4 w-4 shrink-0 text-neutral4"}),l.jsx("p",{className:"text-sm text-neutral3",children:_.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(On,{id:"name",type:"text",value:v,onChange:U=>b(U.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(On,{id:"email",type:"email",value:S,onChange:U=>w(U.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(On,{id:"password",type:"password",value:O,onChange:U=>E(U.target.value),placeholder:R?"Enter your password":"Create a password",required:!0,variant:"default",size:"lg"})]}),B&&l.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:B.message}),l.jsx(he,{type:"submit",disabled:P,className:"w-full",size:"lg",children:P?R?"Signing in...":"Creating account...":R?"Sign in":"Create account"}),N&&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"})]})]}),C&&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"})})]}),C&&I&&l.jsxs(he,{onClick:F,disabled:h,className:"w-full",size:"lg",variant:"outline",children:[I.icon&&l.jsx("span",{className:"mr-2",children:I.icon}),h?"Redirecting...":I.text||"Sign in"]})]})})}function kts(){const[e]=xo(),t=ku(),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(hLt,{redirectUri:n,onSuccess:i,initialMode:s,errorMessage:a})}function Ots(){const[e,t]=xo(),n=msr(e,t),r=ysr(e,t),[s,a]=y.useState(),[i,o]=y.useState(!1),{data:c=[],isPending:u}=Mwe(),{data:d=[],isPending:f}=$we({entityType:n.selectedEntityOption?.entityType,rootOnly:!0}),{data:p=[],isPending:h}=Dwe(),{data:m=[],isPending:g}=Lwe(),v=y.useMemo(()=>znr({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(()=>qnr({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:O,isFetchingNextPage:E,hasNextPage:_,setEndOfListElement:C}=psr({filters:b}),{logIdMap:j,featuredLog:I,handleLogClick:N,handlePreviousLog:R,handleNextLog:P}=wsr(S,n.featuredLogId,n.handleFeaturedChange,n.featuredTraceId),{data:B,isLoading:M}=Pwe(n.featuredTraceId??null),{data:L,isLoading:F}=Hk(n.featuredTraceId??"",n.featuredSpanId??""),z=y.useCallback(()=>n.applyFilterTokens(Vnr(v,n.filterTokens)),[v,n]),U=y.useCallback(()=>n.handleFeaturedChange({logId:null}),[n]),H=y.useCallback(K=>n.handleFeaturedChange({traceId:K,spanId:null}),[n]),D=y.useCallback((K,ne)=>n.handleFeaturedChange({traceId:K,spanId:ne}),[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]),Z=l.jsxs(Tn.TopArea,{children:[l.jsx(Tn.Row,{children:l.jsxs(Tn.Column,{className:"flex flex-wrap items-start justify-start gap-2",children:[l.jsx(_we,{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(hwe,{fields:v,tokens:n.filterTokens,onTokensChange:n.handleFilterTokensChange,disabled:w,onStartTextFilter:a})]})}),l.jsx(asr,{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(O)return l.jsxs(Tn,{width:"wide",height:"full",children:[Z,l.jsx(Tn.MainArea,{isCentered:!0,children:l.jsx(esr,{error:O,resource:"logs",errorTitle:"Failed to load logs"})})]});const G=!!n.selectedEntityOption||n.filterTokens.length>0;return S.length===0&&!w&&!G?l.jsxs(Tn,{width:"wide",height:"full",children:[Z,l.jsx(Tn.MainArea,{isCentered:!0,children:l.jsx(csr,{datePreset:n.datePreset,dateFrom:n.selectedDateFrom,dateTo:n.selectedDateTo})})]}):l.jsxs(Tn,{width:"wide",height:"full",children:[Z,l.jsx(tsr,{logCollapsed:i,listSlot:l.jsx(ssr,{logs:S,isLoading:w,isFetchingNextPage:E,hasNextPage:_,setEndOfListElement:C,logIdMap:j,featuredLogId:n.featuredLogId,onLogClick:N}),logPanelSlot:I?l.jsx(Jrr,{log:I,onClose:U,onTraceClick:H,onSpanClick:D,onPrevious:R,onNext:P,collapsed:i,onCollapsedChange:o}):null,tracePanelSlot:n.featuredTraceId?l.jsx(_rr,{traceId:n.featuredTraceId,spans:B?.spans,isLoading:M,onClose:Y,onSpanSelect:$,selectedSpanId:n.featuredSpanId}):null,spanPanelSlot:n.featuredTraceId&&n.featuredSpanId?l.jsx(Orr,{spanId:n.featuredSpanId,span:L?.span,isLoading:F,onClose:V}):null})]})}function _ts({server:e}){const{paths:t,Link:n}=dn(),s=We().options.baseUrl,a=s?`${s}/api/mcp/${e.id}/sse`:"",{data:i}=YDt(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(Oe.RowLink,{to:t.mcpServerLink(e.id),LinkComponent:n,children:[l.jsx(Oe.NameCell,{children:f}),l.jsx(Oe.DescriptionCell,{children:a}),l.jsx(Oe.TextCell,{className:"text-center",children:u||""}),l.jsx(Oe.TextCell,{className:"text-center",children:c||""}),l.jsx(Oe.TextCell,{className:"text-center",children:d||""})]})}function Ets({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(Bd,{columns:"auto 1fr auto auto auto"}):l.jsxs(Oe,{columns:"auto 1fr auto auto auto",children:[l.jsxs(Oe.Top,{children:[l.jsx(Oe.TopCell,{children:"Name"}),l.jsx(Oe.TopCell,{children:"URL"}),l.jsx(Oe.TopCellSmart,{long:"Agents",short:l.jsx(Ll,{}),tooltip:"Agent Tools",className:"text-center"}),l.jsx(Oe.TopCellSmart,{long:"Tools",short:l.jsx(vu,{}),tooltip:"Tools",className:"text-center"}),l.jsx(Oe.TopCellSmart,{long:"Workflows",short:l.jsx(yu,{}),tooltip:"Workflow Tools",className:"text-center"})]}),r.length===0&&n?l.jsx(Oe.NoMatch,{message:"No MCP Servers match your search"}):null,r.map(s=>l.jsx(_ts,{server:s},s.id))]})}const Cts=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(di,{iconSlot:l.jsx(Yd,{}),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(he,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",children:["MCP Documentation ",l.jsx(Ba,{})]})})}),Tts=()=>{const{data:e=[],isLoading:t,error:n}=OH(),[r,s]=y.useState("");return n&&Bs(n)?l.jsx(cr,{children:l.jsx(fa,{})}):n&&qs(n)?l.jsx(cr,{children:l.jsx(sa,{resource:"MCP servers"})}):n?l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load MCP servers",message:n.message})}):e.length===0&&!t?l.jsx(cr,{children:l.jsx(Cts,{})}):l.jsxs(Tn,{children:[l.jsx(Tn.TopArea,{children:l.jsx("div",{className:"max-w-120",children:l.jsx(Fv,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})}),l.jsx(Ets,{mcpServers:e,isLoading:t,search:r})]})},jts=(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 Its({tools:e,agents:t,isLoading:n,search:r=""}){const{paths:s,Link:a}=dn(),i=y.useMemo(()=>jts(e,t),[e,t]),o=y.useMemo(()=>i.filter(c=>c.id.toLowerCase().includes(r.toLowerCase())),[i,r]);return n?l.jsx(Bd,{columns:"auto 1fr auto"}):l.jsxs(Oe,{columns:"auto 1fr auto",children:[l.jsxs(Oe.Top,{children:[l.jsx(Oe.TopCell,{children:"Name"}),l.jsx(Oe.TopCell,{children:"Description"}),l.jsx(Oe.TopCellSmart,{long:"Agents",short:l.jsx(Ll,{}),tooltip:"Attached Agents",className:"text-center"})]}),o.length===0&&r?l.jsx(Oe.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(Oe.RowLink,{to:s.toolLink(c.id),LinkComponent:a,children:[l.jsx(Oe.NameCell,{children:u}),l.jsx(Oe.DescriptionCell,{children:d}),l.jsx(Oe.TextCell,{className:"text-center",children:f||""})]},c.id)})]})}const Nts=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(di,{iconSlot:l.jsx(Yd,{}),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(he,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",children:["Tools Documentation ",l.jsx(Ba,{})]})})}),Ats=()=>{const e=We();return ar({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 Be.error("Error executing dev tool"),console.error("Error executing dev tool:",a),a}}})},Rts=({toolId:e})=>{const{canExecute:t}=Xb(),n=t("tools"),{data:r={}}=Zv(),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}=JGr(e,{enabled:!s}),c=s||a,{mutateAsync:u,isPending:d,data:f}=Ats(),{requestContext:p}=Vs();y.useEffect(()=>{if(o){const g=o instanceof Error?o.message:"Failed to load tool";Be.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?Cv(Ov(_b(c?.inputSchema))):fs({});return i?l.jsxs("div",{className:"p-6",children:[l.jsx(ns,{className:"h-8 w-48 mb-4"}),l.jsx(ns,{className:"h-32 w-full"})]}):o?null:c?n?l.jsx(U_e,{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(be,{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(be,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})})};function Pts({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}=LH(),{data:p={},isLoading:h,isError:m,error:g}=Zv(),{navigate:v,paths:b}=dn();y.useEffect(()=>{if(d){const E=f instanceof Error?f.message:"Failed to load tools";Be.error(`Error loading tools: ${E}`)}},[d,f]),y.useEffect(()=>{if(m){const E=g instanceof Error?g.message:"Failed to load agents";Be.error(`Error loading agents: ${E}`)}},[m,g]);const S=new Map;Object.values(p).forEach(E=>{E.tools&&Object.values(E.tools).forEach(_=>{S.has(_.id)||S.set(_.id,_)})}),Object.values(c).forEach(E=>{S.has(E.id)||S.set(E.id,E)});const w=Array.from(S.values()).map(E=>({label:E.id,value:E.id})),O=E=>{t?t(E):E&&E!==e&&v(b.toolLink(E))};return l.jsx(Nc,{options:w,value:e,onValueChange:O,placeholder:u||h?"Loading tools...":n,searchPlaceholder:r,emptyText:s,className:a,disabled:i||u||h||d||m,variant:o})}const Mts=({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(Oh,{children:l.jsx(be,{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(Oh,{isDivided:!0,children:[l.jsxs("div",{className:"px-8 py-12 mx-auto max-w-2xl w-full",children:[l.jsx(be,{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(Ct,{icon:l.jsx(Eq,{className:"text-neutral6"}),className:"rounded-r-sm text-neutral4!",children:"Version"}),l.jsx(Ct,{className:"rounded-l-sm text-neutral4!",children:t.version_detail.version})]}),l.jsx(be,{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(Ct,{icon:l.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"HTTP"}),children:"Regular HTTP Endpoint"}),l.jsx(be,{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(be,{className:"px-2 py-1 bg-surface4 rounded-lg",children:r}),l.jsx("div",{className:"pt-1",children:l.jsx(ua,{tooltip:"Copy HTTP Stream URL",content:r})})]})]}),l.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[l.jsx(Ct,{icon:l.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"SSE"}),children:"Server-Sent Events"}),l.jsx(be,{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(be,{className:"px-2 py-1 bg-surface4 rounded-lg",children:n}),l.jsx("div",{className:"pt-1",children:l.jsx(ua,{tooltip:"Copy SSE URL",content:n})})]})]}),l.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[l.jsx(Ct,{icon:l.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"CLI"}),children:"Command Line"}),l.jsx(be,{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(be,{className:"px-2 py-1 bg-surface4 rounded-lg",children:a}),l.jsx("div",{className:"pt-1",children:l.jsx(ua,{tooltip:"Copy Command Line Config",content:a})})]})]})]})]}),l.jsx("div",{className:"h-full overflow-y-scroll border-l border-border1",children:l.jsx($ts,{server:t})})]})},$ts=({server:e})=>{const{data:t={},isLoading:n}=YDt(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(Ve,{size:"lg",className:"bg-surface4 rounded-md p-1",children:l.jsx(kv,{})}),l.jsx(be,{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(Lts,{tool:a,serverId:e.id},s)})})]})};function Dts(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 Lts=({tool:e,serverId:t})=>{const n=y.useRef(null),{Link:r,paths:s}=dn(),a=n3t[e.toolType||"tool"],i=Dts(e._meta);return l.jsxs(vp,{onClick:()=>n.current?.click(),children:[l.jsx(xwt,{children:l.jsx(a,{className:"group-hover/entity:text-accent6"})}),l.jsxs(xp,{children:[l.jsx(yp,{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(Ct,{className:"text-[10px] py-0",children:"App"})]})}),l.jsx(bp,{children:e.description})]})]})},zts=()=>{const{serverId:e}=Mr(),{data:t=[],isLoading:n}=OH(),r=t.find(s=>s.id===e);return l.jsx("div",{className:"h-full w-full overflow-hidden",children:l.jsx(Mts,{isLoading:n,server:r})})};function Fts(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 Bts=({toolId:e,serverId:t})=>{const{canExecute:n}=Xb(),r=n("tools"),s=We(),{data:a,isLoading:i,error:o}=u_e(t,e),{mutateAsync:c,isPending:u,data:d}=nzr(t,e),f=a?Fts(a._meta):void 0,{data:p}=Et({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";Be.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(ns,{className:"h-8 w-48 mb-4"}),l.jsx(ns,{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(be,{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(be,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})});let g;try{g=Cv(Ov(a.inputSchema))}catch(v){console.error("Error processing input schema:",v),Be.error("Failed to process tool input schema."),g=fs({})}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(QDt,{html:p,toolName:a.name??a.id,onToolCall:h})}),l.jsx(U_e,{executionResult:d,isExecutingTool:u,zodInputSchema:g,handleExecuteTool:m,toolDescription:a.description||"",toolId:a.id})]})},Uts=()=>{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(Bts,{toolId:t,serverId:e})})},KXe={agents:na.AGENT,workflows:na.WORKFLOW_RUN,tools:na.TOOL};function qts(){const{data:e,isLoading:t,isError:n}=Cnr(),{getTracesHref:r,getBucketTracesHref:s}=nD(),{Link:a}=dn(),i=ku();return l.jsx(gnr,{data:e,isLoading:t,isError:n,onPointClick:(o,c)=>{const u=new Date(String(c.rawTimestamp)).getTime();Number.isFinite(u)&&i(s({rootEntityType:KXe[o]},u,"1h"))},actions:o=>l.jsx(Fq,{href:r({rootEntityType:KXe[o]}),LinkComponent:a})})}function Vts(){const e=Anr(),t=Rnr(),{getTracesHref:n}=nD(),{Link:r}=dn();return l.jsx(ynr,{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 Hts(){const{data:e,isLoading:t,isError:n}=gSt();return l.jsx(J$,{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 Zts(){const{data:e,isLoading:t,isError:n}=Onr();return l.jsx(J$,{label:"Total Model Cost",value:e?.cost!=null?ab(e.cost,e.costUnit):null,prevValue:e?.previousCost!=null?ab(e.previousCost,e.costUnit):void 0,changePct:e?.costChangePercent??null,isLoading:t,isError:n})}function Wts(){const{data:e,isLoading:t,isError:n}=_nr();return l.jsx(J$,{label:"Total Tokens",value:e?.value!=null?au(e.value):null,prevValue:e?.previousValue!=null?au(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:n})}function Gts(){const{data:e,isLoading:t,isError:n}=Inr();return l.jsx(J$,{label:"Total Threads",value:e?.value!=null?au(e.value):null,prevValue:e?.previousValue!=null?au(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:n})}function Qts(){const{data:e,isLoading:t,isError:n}=Nnr();return l.jsx(J$,{label:"Total Resources",value:e?.value!=null?au(e.value):null,prevValue:e?.previousValue!=null?au(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:n})}function Yts({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=>Xts(f,a));return l.jsxs("div",{className:X("grid grid-cols-[1fr_auto] gap-3 items-start"),children:[l.jsx(pwe,{fields:a,tokens:i,onTokensChange:o,disabled:s,autoFocusFieldId:c}),u&&l.jsx(dwe,{disabled:s,onClear:d?e:void 0,onRemoveAll:t,onSave:n,onRemoveSaved:r})]})}function Xts(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 Kts(){const{data:e,isLoading:t,isError:n}=Enr(),{getTracesHref:r}=nD(),{Link:s}=dn();return l.jsx(bnr,{rows:e,isLoading:t,isError:n,LinkComponent:s,getRowHref:()=>r({rootEntityType:na.AGENT}),actions:l.jsx(Fq,{href:r({rootEntityType:na.AGENT}),LinkComponent:s})})}function Jts(){const{data:e,isLoading:t,isError:n}=jnr(),{getTracesHref:r}=nD(),{Link:s}=dn();return l.jsx(wnr,{data:e,isLoading:t,isError:n,LinkComponent:s,getRowHref:a=>r({rootEntityType:na.AGENT,entityName:a.name}),actions:l.jsx(Fq,{href:r({rootEntityType:na.AGENT}),LinkComponent:s})})}const K5={agents:na.AGENT,workflows:na.WORKFLOW_RUN,tools:na.TOOL};function ens(){const{data:e,isLoading:t,isError:n}=Tnr(),{getTracesHref:r,getLogsHref:s}=nD(),{Link:a}=dn();return l.jsx(Snr,{data:e,isLoading:t,isError:n,LinkComponent:a,getRowHref:(i,o)=>r({rootEntityType:K5[i],entityName:o.name}),getErrorSegmentHref:(i,o)=>o.errors>0?s({rootEntityType:K5[i],entityName:o.name,status:"error"}):void 0,actions:i=>l.jsxs(l.Fragment,{children:[l.jsx(Fq,{href:r({rootEntityType:K5[i]}),LinkComponent:a}),l.jsx(hnr,{href:s({rootEntityType:K5[i],status:"error"}),LinkComponent:a})]})})}const tns=new Set(["ObservabilityStorageClickhouseVNext","ObservabilityStorageDuckDB","ObservabilityInMemory"]),dle="period",J5="dateFrom",e6="dateTo";function nns(){const[e,t]=xo(),n=e.get(dle),r=onr(n)?n:"24h",s=y.useMemo(()=>{if(r!=="custom")return;const d=h=>{if(!h)return;const m=new Date(h);return Number.isNaN(m.getTime())?void 0:m},f=d(e.get(J5)),p=d(e.get(e6));if(!(!f&&!p))return{from:f,to:p}},[r,e.toString()]),a=y.useMemo(()=>enr(e),[e.toString()]),i=y.useCallback(d=>{t(f=>{const p=new URLSearchParams(f);return d==="24h"?p.delete(dle):p.set(dle,d),d!=="custom"&&(p.delete(J5),p.delete(e6)),p},{replace:!0})},[t]),o=y.useCallback(d=>{t(f=>{const p=new URLSearchParams(f);return d?.from?p.set(J5,d.from.toISOString()):p.delete(J5),d?.to?p.set(e6,d.to.toISOString()):p.delete(e6),p},{replace:!0})},[t]),c=y.useCallback(d=>{t(f=>{const p=new URLSearchParams(f);return nnr(p,d),p},{replace:!0})},[t]),u=y.useRef(!1);return y.useEffect(()=>{if(u.current||(u.current=!0,Ktr(e)))return;const d=pSt();d&&t(f=>{const p=new URLSearchParams(f);for(const[h,m]of d)p.append(h,m);return p},{replace:!0})},[]),l.jsx(cnr,{preset:r,filterTokens:a,onPresetChange:i,onFilterTokensChange:c,customRange:s,onCustomRangeChange:o,children:l.jsx(rns,{})})}function rns(){const[e]=xo(),{error:t,isLoading:n}=gSt(),{filterTokens:r,setFilterTokens:s}=zq(),[a,i]=y.useState(),{data:o,isLoading:c}=NH(),u=o?.observabilityStorageType,d=u?tns.has(u):!1,f=u==="ObservabilityInMemory",{data:p,isLoading:h}=Mwe(),{data:m,isLoading:g}=$we(),{data:v,isLoading:b}=Lwe(),{data:S,isLoading:w}=Dwe(),O=y.useMemo(()=>Jtr({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]),[E,_]=y.useState(()=>pSt()!==null),C=y.useCallback(()=>{Ytr(e),_(!0),Be.success("Filters setting for Metrics saved")},[e]),j=y.useCallback(()=>{Xtr(),_(!1),Be.success("Filters setting for Metrics cleared up")},[]),I=y.useCallback(()=>{s([])},[s]),N=y.useCallback(()=>{const R=r.map(P=>{const B=O.find(M=>M.id===P.fieldId);return B?B.kind==="text"?{fieldId:P.fieldId,value:""}:B.kind==="pick-multi"?B.multi?{fieldId:P.fieldId,value:[]}:{fieldId:P.fieldId,value:"Any"}:B.kind==="multi-select"?{fieldId:P.fieldId,value:[]}:P:P});s(R)},[O,r,s]);return t&&Bs(t)?l.jsx(cr,{children:l.jsx(fa,{})}):t&&qs(t)?l.jsx(cr,{children:l.jsx(sa,{resource:"metrics"})}):t?l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load metrics",message:t.message})}):l.jsxs(Tn,{width:"wide",height:"full",children:[l.jsxs(Tn.TopArea,{children:[l.jsx(Tn.Row,{children:l.jsxs(Tn.Column,{className:"flex flex-wrap items-start justify-start gap-2",children:[l.jsx(pnr,{}),l.jsx(hwe,{fields:O,tokens:r,onTokensChange:s,disabled:n,onStartTextFilter:i})]})}),l.jsx(Yts,{isLoading:n,filterFields:O,filterTokens:r,onFilterTokensChange:s,onClear:N,onRemoveAll:I,onSave:C,onRemoveSaved:E?j:void 0,autoFocusFilterFieldId:a})]}),c?null:d?l.jsxs("div",{className:"grid gap-8 content-start pb-10",children:[f&&l.jsx(Qn,{variant:"info",title:"Metrics are not persisted",children:l.jsx(Qn.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(wfe,{children:[l.jsx(Hts,{}),l.jsx(Zts,{}),l.jsx(Wts,{}),l.jsx(Gts,{}),l.jsx(Qts,{})]}),l.jsxs(wfe,{children:[l.jsx(Kts,{}),l.jsx(Jts,{}),l.jsx(Vts,{}),l.jsx(ens,{}),l.jsx(qts,{})]})]}):l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(di,{iconSlot:l.jsx(Yd,{}),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(he,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/observability/metrics/overview",target:"_blank",rel:"noopener noreferrer",children:["Metrics Documentation ",l.jsx(Ba,{})]})})})]})}function sns(){const{paths:e}=dn(),{data:t,isLoading:n,error:r}=c3t(),{isCmsAvailable:s}=o4(),[a,i]=y.useState(""),o=t?.promptBlocks??[];return r&&Bs(r)?l.jsx(cr,{children:l.jsx(fa,{})}):r&&qs(r)?l.jsx(cr,{children:l.jsx(sa,{resource:"prompt blocks"})}):r?l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load prompt blocks",message:r.message})}):o.length===0&&!n?l.jsx(cr,{children:l.jsx(qGr,{})}):l.jsxs(Tn,{children:[l.jsx(Tn.TopArea,{children:l.jsxs(Tn.Row,{align:"center",stack:"responsive",children:[l.jsx("div",{className:"max-w-120 flex-1",children:l.jsx(Fv,{onSearch:i,label:"Filter prompts",placeholder:"Filter by name or description"})}),s&&l.jsxs(he,{as:$o,to:e.cmsPromptBlockCreateLink(),variant:"primary",className:"shrink-0",children:[l.jsx(Cs,{}),"Create Prompt"]})]})}),l.jsx(UGr,{promptBlocks:o,isLoading:n,search:a})]})}function ans(){return l.jsx(Tn,{width:"narrow",children:l.jsx(Tn.MainArea,{children:l.jsx(ZHr,{children:l.jsx(z4t,{})})})})}const ins=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:IWt,href:"/swagger-ui",external:!1},{title:"Documentation",description:"Read the official Mastra documentation for guides, references, and tutorials.",icon:Cet,href:"https://mastra.ai/en/docs",external:!0},{title:"Github",description:"Browse the source code, report issues, and contribute to the Mastra project.",icon:Ba,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:uP,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:Det,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:kZt,href:"https://mastra.ai/contact?ref=studio",external:!0}];function ons(){return l.jsx(Tn,{width:"narrow",children:l.jsx(Tn.MainArea,{children:l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:ins.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(Ba,{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 lns(){const{data:e={},isLoading:t,error:n}=Cp(),[r,s]=y.useState(""),[a,i]=y.useState("all");if(n&&Bs(n))return l.jsx(cr,{children:l.jsx(fa,{})});if(n&&qs(n))return l.jsx(cr,{children:l.jsx(sa,{resource:"scorers"})});if(n)return l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load scorers",message:n.message})});if(Object.keys(e).length===0&&!t)return l.jsx(cr,{children:l.jsx(cWr,{})});const o=a!=="all"||r!=="",c=()=>{s(""),i("all")};return l.jsxs(Tn,{children:[l.jsx(Tn.TopArea,{children:l.jsx(dWr,{search:r,onSearchChange:s,sourceFilter:a,onSourceFilterChange:i,onReset:c,hasActiveFilters:o})}),l.jsx(lWr,{scorers:e,isLoading:t,search:r,sourceFilter:a})]})}function cns(){const{scorerId:e}=Mr(),[t,n]=xo(),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}=aWr(e),{data:d={},isLoading:f,error:p}=Zv(),{isLoading:h,error:m}=Kw(),{data:g=[],isLoading:v,error:b,isFetchingNextPage:S,hasNextPage:w,setEndOfListElement:O}=sWr({scorerId:e,entityId:i?.value==="all"?void 0:i?.value,entityType:i?.type==="ALL"?void 0:i?.type}),E=y.useMemo(()=>c?.agentIds?.filter(H=>d[H]).map(H=>({value:H,label:d[H].name,type:"AGENT"}))||[],[c?.agentIds,d]),_=y.useMemo(()=>c?.workflowIds?.map(H=>({value:H,label:H,type:"WORKFLOW"}))||[],[c?.workflowIds]),C=y.useMemo(()=>[{value:"all",label:"All Entities",type:"ALL"},...E,..._],[E,_]),j=t.get("entity")??"all",I=C.find(H=>H.value===j);I&&I.value!==i?.value&&o(I),y.useEffect(()=>{if(u){const H=u instanceof Error?u.message:"Failed to load scorer";Be.error(`Error loading scorer: ${H}`)}},[u]),y.useEffect(()=>{if(p){const H=p instanceof Error?p.message:"Failed to load agents";Be.error(`Error loading agents: ${H}`)}},[p]),y.useEffect(()=>{if(m){const H=m instanceof Error?m.message:"Failed to load workflows";Be.error(`Error loading workflows: ${H}`)}},[m]);const N=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=Bs(u)||Bs(p)||Bs(m),B=u&&qs(u),M=!P&&!B&&(u||p||m),L=!v&&g.length===0,F=i?.value!=="all",z=c?.scorer?.source==="stored"?l.jsx(Uv,{owner:"scorer-detail",children:l.jsxs(he,{variant:"default",as:$o,to:`/cms/scorers/${e}/edit`,size:"sm",children:[l.jsx(Rb,{})," Edit"]})}):null;if(P||B||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(Tn,{width:"wide",height:"full",children:[z,l.jsx(Tn.MainArea,{isCentered:!0,children:P?l.jsx(fa,{}):B?l.jsx(sa,{resource:"scorers"}):M?l.jsx(rc,{title:"Failed to load scorer",message:H}):l.jsx(XZr,{})})]})}return l.jsxs(Tn,{width:"wide",children:[z,l.jsx(Tn.TopArea,{children:l.jsx(eWr,{selectedEntity:i,entityOptions:C,onEntityChange:N,onReset:()=>{n(H=>{const D=new URLSearchParams(H);return D.set("entity","all"),D})},isLoading:v||f||h})}),l.jsx(YZr,{scores:g,isLoading:v,selectedScoreId:s,isFetchingNextPage:S,hasNextPage:w,setEndOfListElement:O,onScoreClick:R,errorMsg:b?.message})]})}const mLt=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],uns=e=>mLt.some(t=>t.value===e),dns=()=>{const{baseUrl:e,headers:t,apiPrefix:n}=N_e(),{theme:r,setTheme:s}=tI();return l.jsx(Tn,{width:"narrow",children:l.jsxs(Tn.MainArea,{className:"flex flex-col gap-5 mt-6",children:[l.jsx(g6e,{title:"Theme",description:"Customize the appearance of the studio.",children:l.jsx(NKn,{label:"Theme mode",htmlFor:"theme",children:l.jsxs(fi,{value:r,onValueChange:a=>{uns(a)&&s(a)},children:[l.jsx(Ka,{id:"theme",className:"w-full sm:w-48",children:l.jsx(pi,{})}),l.jsx(Ja,{children:mLt.map(a=>l.jsx(os,{value:a.value,children:a.label},a.value))})]})})}),l.jsx(g6e,{title:"Mastra Connection",description:"Configure the Mastra instance URL, API prefix, and request headers used by the studio.",children:l.jsx(U4t,{initialConfig:{baseUrl:e,headers:t,apiPrefix:n}})})]})})};function fns(){const[e]=xo(),t=ku(),n=e.get("redirect")||"/",r=()=>{n.startsWith("http")?window.location.href=n:t(n,{replace:!0})};return l.jsx(hLt,{redirectUri:n,onSuccess:r,initialMode:"signup"})}function pns(e){return e.replace(/\/$/,"").split("/").pop()}function qH({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 hns({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(Ll,{})," ",a.agents.length]}),a?.tools&&a.tools.length>0&&l.jsxs("li",{children:[l.jsx(vu,{})," ",a.tools.length]}),a?.networks&&a.networks.length>0&&l.jsxs("li",{children:[l.jsx(Zet,{})," ",a.networks.length]}),a?.workflows&&a.workflows.length>0&&l.jsxs("li",{children:[l.jsx(D7,{})," ",a.workflows.length]}),a?.mcp&&a.mcp.length>0&&l.jsxs("li",{children:[l.jsx(kv,{})," ",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(hwt,{})," ",pns(a.githubUrl)]})})]},a.slug)})})}function mns({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(fw,{name:"search-templates",label:"Search templates",labelIsHidden:!0,value:i,onChange:f=>o?.(f.target.value),placeholder:"Search Template"}),l.jsx(Ic,{label:"Filter by tag",labelIsHidden:!0,name:"filter-tag",value:t,onValueChange:s,options:e}),l.jsx(Ic,{label:"Filter by provider",labelIsHidden:!0,name:"filter-provider",value:r,onValueChange:a,options:n}),c&&l.jsxs(he,{onClick:c,children:["Reset ",l.jsx(Pr,{})]})]})}function gns(){const{data:e,isLoading:t}=Dsr(),{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(pr,{children:[l.jsx(iwe,{children:l.jsxs(wwt,{children:[l.jsx(Ve,{children:l.jsx(BS,{})}),"Templates"]})}),l.jsxs("div",{className:X("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[l.jsx(mns,{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(hns,{templates:v,linkComponent:$o,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const vns="1.36.0";function yns({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(Xy,{className:"text-yellow-500"}),title:"Template Installed with Warnings"}:{icon:l.jsx(rGt,{}),title:"Template Installation Failed"},{icon:o,title:c}=i();return l.jsxs(qH,{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 bns({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(qH,{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(Wet,{})]}),l.jsx(Ic,{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(tn,{})," Loading variables..."]}):Object.entries(r).map(([p,h])=>l.jsxs(y.Fragment,{children:[l.jsx(qk,{name:`env-${p}`,labelIsHidden:!0,label:"Key",value:p,disabled:!0,className:"w-full"}),l.jsx(qk,{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(F4t,{defaultProvider:u||"",defaultModel:d||"",updateModel:f||(()=>Promise.resolve({message:"Updated"})),closeEditor:()=>{},autoSave:!0,selectProviderPlaceholder:"Provider"})]})]}),t&&!o&&l.jsx(he,{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(tn,{className:"w-4 h-4"})," Installing..."]}):l.jsxs(l.Fragment,{children:["Install ",l.jsx(FS,{})]})})]})})}function xns({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(BS,{}),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(Rw,{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(P7,{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(hwt,{}),n?.split("/")?.pop()]})]}),s&&l.jsx(RO,{data:s,labelsAreHidden:!0,isLoading:r})]})]})}function wns({name:e,streamResult:t,runId:n,workflowInfo:r}){const s=t?.phase||"initializing",a=t?.payload?.workflowState,i=t?.payload?.currentStep,o=t?.error,c=a?.steps||{},u=Object.keys(c).length>0,d=g=>g==="input"||g.endsWith(".input")||g.startsWith("Mapping_")&&/[0-9a-f]{8}/.test(g)||/[0-9a-f]{8,}/.test(g)?!1:r?.allSteps?g in r.allSteps:!0,f=Object.entries(c).filter(([g,v])=>d(g)),p=f.length,h=()=>{switch(s){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..."}},m=f.map(([g,v])=>({id:g,status:v?.status,description:v?.description,title:g.charAt(0).toUpperCase()+g.slice(1).replace(/-/g," "),isActive:i?.id===g}));return l.jsxs(qH,{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:h()}),(t?.runId||n)&&l.jsxs("div",{className:"mt-2 text-ui-sm text-neutral3",children:["Run ID: ",t?.runId??n]})]}),u&&p>0&&!["error"].includes(s)&&l.jsx("div",{className:"max-w-[30rem] w-full mx-auto px-6",children:l.jsx(HKn,{steps:m})}),o&&s==="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(WGt,{}),o||"Something went wrong"]}),u&&l.jsx(VKn,{steps:m,currentStep:i,className:"pb-4"}),!u&&s==="initializing"&&l.jsxs("div",{className:"text-center text-sm text-neutral3 grid gap-4 justify-items-center",children:[l.jsx(tn,{}),l.jsx("p",{children:"This may take some time..."})]})]})}function Sns({name:e,installedEntities:t}){return l.jsxs(qH,{className:X("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[l.jsx(Wet,{}),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(RO,{data:t})]})}function kns(){const{templateSlug:e}=Mr(),[t,n]=xo(),[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,O]=y.useState(!1),[E,_]=y.useState(!1),[C,j]=y.useState([]),{data:I,isLoading:N}=Lsr({repoOrSlug:e,owner:"mastra-ai"}),P=vns?.includes("beta")??!1?"beta":"main",{data:B,isLoading:M}=zsr({repo:I?.githubUrl?new URL(I.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:P}),{data:L,isLoading:F}=Fsr(),{mutateAsync:z,isPending:U}=Bsr(),{mutateAsync:H}=Usr(),{streamInstall:D,streamResult:Y,isStreaming:V}=Vsr(L),{observeInstall:$,streamResult:Z,isStreaming:G}=Hsr(L);y.useEffect(()=>{const te=t.get("runId");te&&!g&&!h&&!V&&!G&&(console.info("🔄 Checking completed run after hot reload:",{runId:te}),S(te),H({runId:te}).then(le=>{const fe=le.snapshot;if(fe?.status==="success"&&fe?.result?.success)v(!0);else if(fe?.result?.success===!1)if(fe?.result?.validationResults&&!fe?.result?.validationResults?.valid&&fe?.result?.validationResults?.remainingErrors>0){const{remainingErrors:ye,errors:we}=fe.result.validationResults,ke=`Template installation completed but ${ye} validation issue${ye>1?"s":""} remain unresolved.`;m(ke),j(we||[])}else{const ye=fe?.result?.message||fe?.result?.error||"Template installation failed";m(typeof ye=="string"?ye:String(ye))}}).catch(le=>{console.error("❌ Failed to fetch run details:",le),m("Failed to retrieve installation status after reload")}))},[t,g,h,V,G,H]),y.useEffect(()=>{const te=t.get("runId"),le=t.get("resume"),fe=t.get("provider");if(te&&le==="true"&&fe&&!V&&!G&&!w&&!E&&L){S(te),O(!0);try{H({runId:te}).then(ce=>{if(ce.snapshot?.status==="running")return $.mutateAsync({runId:te})}).then(()=>{n(ce=>{const ye=new URLSearchParams(ce);return ye.delete("resume"),ye})}).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,E,L,H,$,n]);const K=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],ne=[{key:"tools",label:"Tools",value:I?.tools?.length?I.tools.map(te=>te).join(", "):"n/a",icon:l.jsx(vu,{})},{key:"agents",label:"Agents",value:I?.agents?.length?I.agents.map(te=>te).join(", "):"n/a",icon:l.jsx(Ll,{})},{key:"workflows",label:"Workflows",value:I?.workflows?.length?I.workflows.map(te=>te).join(", "):"n/a",icon:l.jsx(D7,{})},{key:"providers",label:"Providers",value:I?.supportedProviders?.length?I.supportedProviders.join(", "):"n/a",icon:l.jsx(Fg,{})},{key:"tags",label:"Tags",value:I?.tags?.length?I.tags.join(", "):"n/a",icon:l.jsx(gj,{})}],ee=[{...ne[0]},{...ne[1]},{...ne[2]}].filter(te=>te.value!=="n/a");y.useEffect(()=>{B&&d(B)},[B]),y.useEffect(()=>{const te=Y||Z;te?.phase==="error"&&te?.error&&m(typeof te.error=="string"?te.error:String(te.error))},[Y?.phase,Y?.error,Z?.phase,Z?.error]);const J=te=>{s(te)},se=async te=>(i(te.provider),c(te.modelId),{message:"Model updated successfully"}),ae=async()=>{const te=Object.entries(u).reduce((le,[fe,ce])=>(ce===""&&le.push(fe),le),[]);if(te.length>0){p(te);return}if(I){m(null),v(!1),S(""),_(!0);try{const fe={repo:I.githubUrl||`https://github.com/mastra-ai/template-${I.slug}`,ref:P,slug:I.slug,variables:u},{runId:ce}=await z({});S(ce),n(ye=>{const we=new URLSearchParams(ye);return we.set("runId",ce),we.set("resume","true"),we.set("provider",r||"openai"),we}),await D.mutateAsync({inputData:fe,selectedModel:{provider:a,modelId:o},runId:ce})}catch(le){_(!1),m(le?.message||"Template installation failed"),console.error("Template installation failed",le)}}},Q=te=>{const{name:le,value:fe}=te.target;fe.trim()===""?p(ce=>[...ce,le]):p(ce=>ce.filter(ye=>ye!==le)),d(ce=>({...ce,[le]:fe}))};return l.jsx(pr,{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(xns,{isLoading:N,title:I?.title,description:I?.longDescription,imageURL:I?.imageURL,githubUrl:I?.githubUrl,infoData:ne,templateSlug:e}),I&&l.jsxs(l.Fragment,{children:[(V||G)&&l.jsx(wns,{name:I.title,streamResult:G?Z:Y,runId:b,workflowInfo:L}),g&&l.jsx(Sns,{name:I.title,installedEntities:ee,linkComponent:$o}),h&&l.jsx(yns,{errorMsg:h,validationErrors:C.length>0?C:Y?.validationResults?.errors||Z?.validationResults?.errors}),!V&&!G&&!g&&!h&&l.jsx(bns,{providerOptions:K,selectedProvider:r,onProviderChange:J,variables:u,setVariables:d,errors:f,setErrors:p,handleInstallTemplate:ae,handleVariableChange:Q,isLoadingEnvVars:M||F,isInstalling:U,defaultModelProvider:a,defaultModelId:o,onModelUpdate:se})]})]})})})}const Ons=()=>{const{toolId:e,agentId:t}=Mr();return l.jsx("div",{className:"h-full w-full overflow-y-auto",children:l.jsx(LWr,{toolId:e,agentId:t})})},_ns=()=>{const{toolId:e}=Mr();return l.jsx("div",{className:"h-full w-full overflow-y-hidden",children:l.jsx(Rts,{toolId:e})})};function Ens(){const{traceId:e}=Mr(),[t,n]=xo(),r=ku(),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:O}=Pwe(e),E=y.useMemo(()=>S?.spans??[],[S?.spans]),_=y.useMemo(()=>E.find(se=>se.parentSpanId==null),[E]),{data:C,isLoading:j}=Hk(e,c??"");y.useEffect(()=>g(0),[e,c]);const{data:I,isLoading:N}=Cp(),{data:R,isLoading:P}=F_e({traceId:e,spanId:c??void 0,page:m}),[B,M]=y.useState(0);y.useEffect(()=>M(0),[e,c]);const{data:L,isLoading:F}=tLt({traceId:e,page:B});y.useEffect(()=>{if(o&&R?.scores&&!d){const se=R.scores.find(ae=>ae.id===o);se&&f(se)}},[o,R?.scores,d]);const z=y.useCallback(se=>{const ae=new URLSearchParams(t);for(const[Q,te]of Object.entries(se))te===null||te===""?ae.delete(Q):ae.set(Q,te);n(ae,{replace:!0})},[t,n]),U=y.useCallback(se=>{const ae=se??null,Q=ae===c;u(ae),Q||(f(void 0),h("details"),z({spanId:ae,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}=TSt(E,c,D),$=y.useCallback(se=>{const ae=se;h(ae),f(void 0),z({tab:ae==="details"?null:ae,scoreId:null})},[z]),Z=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]),ne=y.useCallback(()=>{h("scoring"),_&&c!==_.spanId?(u(_.spanId),f(void 0),z({spanId:_.spanId,tab:"scoring",scoreId:null})):z({tab:"scoring"})},[_,c,z]),ee=_?l.jsx(Uv,{owner:"trace-detail",children:l.jsxs(jr,{children:[l.jsxs(he,{tooltip:"Evaluate Trace","aria-label":"Evaluate Trace",onClick:ne,children:[l.jsx(jz,{}),"Evaluate"]}),l.jsxs(he,{tooltip:"Save as Dataset Item","aria-label":"Save as Dataset Item",onClick:()=>b(!0),children:[l.jsx(fu,{}),"Save"]})]})}):null,J=_?l.jsx(Tn.Row,{children:l.jsx(Tn.Column,{children:l.jsx(SSt,{rootSpan:_,numOfCol:3})})}):null;return O?l.jsxs(Tn,{height:"full",children:[ee,J&&l.jsx(Tn.TopArea,{children:J}),l.jsx(Tn.MainArea,{isCentered:!0,children:l.jsx(CSt,{error:O,resource:"traces",errorTitle:"Failed to load trace"})})]}):l.jsxs(Tn,{children:[ee,J&&l.jsx(Tn.TopArea,{children:J}),l.jsx(Y_e,{rootSpanId:_?.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(_St,{traceId:e,spans:E,isLoading:w,onClose:K,onSpanSelect:U,onEvaluateTrace:ne,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(ESt,{traceId:e,spanId:c,span:C?.span,isLoading:j,onClose:H,onPrevious:Y,onNext:V,activeTab:p,onTabChange:$,feedbackTabBadge:L?.pagination?.total??void 0,feedbackTabSlot:()=>l.jsx(J3t,{feedbackData:L,onPageChange:M,isLoadingFeedbackData:F}),scoringTabBadge:R?.pagination?.total??void 0,scoringTabSlot:({span:se,traceId:ae,spanId:Q})=>l.jsxs("div",{className:"grid gap-6",children:[l.jsx(Q_e,{traceId:ae,isTopLevelSpan:!se.parentSpanId,spanId:Q,entityType:se.attributes?.agentId||se.entityType===na.AGENT?"Agent":se.attributes?.workflowId||se.entityType===na.WORKFLOW_RUN?"Workflow":void 0,scorers:I,isLoadingScorers:N}),l.jsx(eLt,{scoresData:R,onPageChange:g,isLoadingScoresData:P,onScoreSelect:Z})]})}),d&&l.jsx(L_e,{score:d,onClose:G})]})]})]})}function Cns(){const{data:e,isLoading:t,error:n}=Kw(),[r,s]=y.useState("");return n&&Bs(n)?l.jsx(cr,{children:l.jsx(fa,{})}):n&&qs(n)?l.jsx(cr,{children:l.jsx(sa,{resource:"workflows"})}):n?l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load workflows",message:n.message})}):Object.keys(e||{}).length===0&&!t?l.jsx(cr,{children:l.jsx(ePr,{})}):l.jsxs(Tn,{children:[l.jsx(Tn.TopArea,{children:l.jsxs(Tn.Row,{align:"center",stack:"responsive",children:[l.jsx("div",{className:"max-w-120 flex-1",children:l.jsx(Fv,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})}),l.jsxs(he,{as:$o,to:"/workflows/schedules",variant:"primary",className:"shrink-0",children:[l.jsx(zM,{}),"Schedules"]})]})}),l.jsx(JRr,{workflows:e||{},isLoading:t,search:r})]})}const Tns={active:"bg-accent1",paused:"bg-accent3"},jns={active:"text-accent1",paused:"text-accent3"},gLt=({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 ${Tns[e]}`,"aria-hidden":!0}),l.jsx("span",{className:`text-ui-sm ${jns[e]}`,children:e})]}),MC=e=>!e||e<=0?"—":new Date(e).toLocaleString(),ZR=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 vLt({status:e}){const{icon:t,color:n}=Ins(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 Ins(e){switch(e){case"success":return{icon:l.jsx(ni,{size:14}),color:"text-accent1"};case"failed":return{icon:l.jsx(Pr,{size:14}),color:"text-accent2"};case"running":return{icon:l.jsx(tn,{}),color:"text-neutral3"};case"suspended":return{icon:l.jsx(Tme,{size:14}),color:"text-accent3"};case"canceled":return{icon:l.jsx(Yd,{size:14}),color:"text-neutral3"};case"pending":case"waiting":return{icon:l.jsx(fO,{size:14}),color:"text-neutral3"};default:return{icon:null,color:"text-neutral3"}}}const JXe="auto auto auto auto 1fr";function Nns(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 Ans(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 Rns=3e4,Pns=5*6e4;function Mns({triggers:e,isLoading:t,workflowId:n,hasNextPage:r,isFetchingNextPage:s,setEndOfListElement:a}){const{Link:i,paths:o}=dn();return t?l.jsx(Bd,{columns:JXe}):e.length===0?l.jsx(be,{variant:"ui-md",className:"text-neutral4 p-4",children:"No trigger history yet."}):l.jsxs(Oe,{columns:JXe,children:[l.jsxs(Oe.Top,{children:[l.jsx(Oe.TopCell,{children:"Run"}),l.jsx(Oe.TopCell,{children:"Status"}),l.jsx(Oe.TopCell,{children:"Started"}),l.jsx(Oe.TopCell,{children:"Duration"}),l.jsx(Oe.TopCell,{children:" "})]}),e.map(c=>{const u=c.actualFireAt-c.scheduledFireAt,d=Ans(u),f=`Scheduled ${MC(c.scheduledFireAt)} — published ${MC(c.actualFireAt)} (drift ${d})`,p=c.outcome==="failed",h=p?c.error:c.run?.error,m=Math.abs(u),g=!p&&m>Rns&&m<=Pns,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(Oe.NameCell,{children:b}),l.jsx(Oe.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(Xy,{size:14}),"publish failed"]}):c.run?l.jsx(vLt,{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(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx("span",{className:"text-accent2 inline-flex",children:l.jsx(Xy,{size:14})})}),l.jsx(er,{children:h})]}):null]})}),l.jsx(Oe.TextCell,{children:l.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[l.jsx("span",{title:f,children:ZR(c.actualFireAt)}),g?l.jsxs(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx("span",{className:"text-accent3 inline-flex",children:l.jsx(Xy,{size:14})})}),l.jsxs(er,{children:["Published ",d," after the scheduled fire time"]})]}):null]})}),l.jsx(Oe.TextCell,{children:c.run?l.jsx("span",{children:Nns(c.run.durationMs)}):l.jsx("span",{className:"text-neutral4",children:"—"})}),l.jsx(Oe.TextCell,{children:" "})]});return n&&c.run&&c.runId&&!p?l.jsx(Oe.RowLink,{to:o.workflowRunLink(n,c.runId),LinkComponent:i,children:S},v):l.jsx(Oe.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(tn,{})}):null,!r&&e.length>0?l.jsx(be,{variant:"ui-xs",className:"text-neutral4 text-center py-4 block",children:"All triggers loaded"}):null]}):null]})}const $ns=e=>{const t=We();return Et({queryKey:["schedule",e],enabled:!!e,queryFn:async()=>{if(!e)throw new Error("scheduleId is required");return t.getSchedule(e)}})},eKe=25,Dns=e=>{const t=We(),{inView:n,setRef:r}=MO(),s=Qw({queryKey:["schedule-triggers",e],enabled:!!e,initialPageParam:void 0,queryFn:async({pageParam:u})=>e?t.listScheduleTriggers(e,{limit:eKe,toActualFireAt:u}):{triggers:[]},getNextPageParam:u=>{if(!(!u?.triggers?.length||u.triggers.length<eKe))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}},Lns=e=>{const t=We(),n=Js();return ar({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"]}),Be.success(s==="pause"?"Schedule paused":"Schedule resumed")},onError:r=>{Be.error(r.message)}})};function t6({label:e,children:t}){return l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx(be,{variant:"ui-xs",className:"text-neutral4 uppercase tracking-wide",children:e}),l.jsx("div",{className:"text-ui-md",children:t})]})}function zns(){const{scheduleId:e}=Mr(),{paths:t}=dn(),{data:n,error:r}=$ns(e),{data:s,isLoading:a,error:i,hasNextPage:o,isFetchingNextPage:c,setEndOfListElement:u}=Dns(e),d=Lns(e);if(r&&Bs(r))return l.jsx(cr,{children:l.jsx(fa,{})});if(r&&qs(r))return l.jsx(cr,{children:l.jsx(sa,{resource:"schedules"})});if(r)return l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load schedule",message:r.message})});const f=n?.target.type==="workflow"?n.target.workflowId:void 0;return l.jsxs(Tn,{children:[l.jsx(Tn.TopArea,{children:l.jsx(Tn.Row,{className:"justify-end",children:l.jsxs(Tn.Column,{className:"flex justify-end gap-2",children:[l.jsxs(he,{as:$o,to:t.schedulesLink(),variant:"ghost",children:[l.jsx(Ab,{}),"Back to schedules"]}),f?l.jsx(he,{as:$o,to:t.workflowLink(f),variant:"ghost",children:"Open workflow"}):null,n?l.jsx(he,{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(Mme,{}),"Pause"]}):l.jsxs(l.Fragment,{children:[l.jsx(cb,{}),"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(t6,{label:"Workflow",children:f?l.jsx($o,{to:t.workflowLink(f),className:"text-accent1 hover:underline",children:f}):"—"}),l.jsxs(t6,{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(t6,{label:"Status",children:l.jsx(gLt,{status:n.status})}),l.jsx(t6,{label:"Next fire",children:l.jsx("span",{title:MC(n.nextFireAt),children:ZR(n.nextFireAt)})})]}),l.jsxs("div",{className:"overflow-y-auto","data-testid":"schedule-triggers-panel",children:[l.jsx(be,{variant:"ui-md",className:"mb-3",children:"Trigger history"}),i?l.jsx(rc,{title:"Failed to load trigger history",message:i.message}):l.jsx(Mns,{triggers:s??[],isLoading:a,workflowId:f,hasNextPage:o,isFetchingNextPage:c,setEndOfListElement:u})]})]}):null]})}const tKe="minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto auto auto";function Fns({schedules:e,isLoading:t,search:n=""}){const{paths:r,Link:s}=dn(),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(Bd,{columns:tKe}):l.jsxs(Oe,{columns:tKe,children:[l.jsxs(Oe.Top,{children:[l.jsx(Oe.TopCell,{children:"Workflow"}),l.jsx(Oe.TopCell,{children:"Schedule ID"}),l.jsx(Oe.TopCell,{children:"Cron"}),l.jsx(Oe.TopCell,{children:"Status"}),l.jsx(Oe.TopCell,{children:"Next fire"}),l.jsx(Oe.TopCell,{children:"Last run"})]}),a.length===0&&n?l.jsx(Oe.NoMatch,{message:"No schedules match your search"}):null,a.length===0&&!n?l.jsx(Oe.NoMatch,{message:"No schedules configured"}):null,a.map(i=>l.jsxs(Oe.RowLink,{to:r.scheduleLink(i.id),LinkComponent:s,children:[l.jsx(Oe.NameCell,{children:l.jsx("span",{className:"truncate",children:i.target.workflowId})}),l.jsx(Oe.TextCell,{children:l.jsx("span",{className:"truncate font-mono text-ui-sm",title:i.id,children:i.id})}),l.jsx(Oe.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(Oe.TextCell,{children:l.jsx(gLt,{status:i.status})}),l.jsx(Oe.TextCell,{children:l.jsx("span",{className:"whitespace-nowrap",title:MC(i.nextFireAt),children:ZR(i.nextFireAt)})}),l.jsx(Oe.TextCell,{children:i.lastRun?l.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[l.jsx(vLt,{status:i.lastRun.status}),l.jsx("span",{className:"text-neutral4 text-ui-sm",title:MC(i.lastFireAt),children:i.lastFireAt?ZR(i.lastFireAt):""})]}):i.lastFireAt?l.jsx("span",{className:"whitespace-nowrap",title:MC(i.lastFireAt),children:ZR(i.lastFireAt)}):l.jsx("span",{className:"text-neutral4",children:"Never"})})]},i.id))]})}function Bns({workflowId:e}={}){const{data:t,isLoading:n,error:r}=zwe(e?{workflowId:e}:{}),[s,a]=y.useState("");return r?l.jsx(rc,{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(Fv,{onSearch:a,label:"Filter schedules",placeholder:"Filter by id or workflow"})}),l.jsx("div",{className:"overflow-y-auto",children:l.jsx(Fns,{schedules:t??[],isLoading:n,search:s})})]})}function Uns(){const[e]=xo(),t=e.get("workflowId")??void 0,{error:n}=zwe(t?{workflowId:t}:{});return n&&Bs(n)?l.jsx(cr,{children:l.jsx(fa,{})}):n&&qs(n)?l.jsx(cr,{children:l.jsx(sa,{resource:"schedules"})}):l.jsx(Tn,{children:l.jsx("div",{className:"h-full",children:l.jsx(Bns,{workflowId:t})})})}const nKe=()=>{const{workflowId:e}=Mr(),{data:t,isLoading:n,error:r}=sD(e);return r&&Bs(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})}):r&&qs(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"workflows"})}):l.jsx(XNt,{workflowId:e,workflow:t??void 0,isLoading:n})};function qns(e){if(!e)return null;switch(e.icon||e.provider){case"aws-s3":case"s3":return l.jsx(vwt,{className:"h-4 w-4 text-[#FF9900]"});case"google-cloud":case"google-cloud-storage":case"gcs":return l.jsx(mwt,{className:"h-4 w-4"});case"azure-blob":case"azure":return l.jsx(ywt,{className:"h-4 w-4 text-[#0078D4]"});case"cloudflare":case"cloudflare-r2":case"r2":return l.jsx(oG,{className:"h-4 w-4 text-[#F38020]"});case"minio":return l.jsx(Xle,{className:"h-4 w-4 text-red-400"});case"database":return l.jsx(G0,{className:"h-4 w-4 text-emerald-400"});case"local":case"folder":return l.jsx(BM,{className:"h-4 w-4 text-amber-400"});case"hard-drive":return l.jsx(Xle,{className:"h-4 w-4 text-slate-400"});case"cloud":return l.jsx(oG,{className:"h-4 w-4 text-sky-400"});default:return l.jsx(oG,{className:"h-4 w-4 text-neutral4"})}}function yLt(e,t=!1){const{name:n,type:r,mount:s}=e;if(r==="directory")return s?qns(s):t?l.jsx(pj,{className:"h-4 w-4 text-amber-400"}):l.jsx(BM,{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(FM,{className:"h-4 w-4 text-yellow-400"});case"md":case"mdx":return l.jsx(td,{className:"h-4 w-4 text-neutral4"});case"png":case"jpg":case"jpeg":case"gif":case"svg":case"webp":return l.jsx(Ame,{className:"h-4 w-4 text-purple-400"});default:return l.jsx(jme,{className:"h-4 w-4 text-neutral4"})}}function bLt(e){if(e==null||Number.isNaN(e))return"";if(e<0)return"-"+bLt(-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 Vns(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 xLt(e){return e==="."||e===""}function Hns({path:e,onNavigate:t}){const r=xLt(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(pj,{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(ka,{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 Zns({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=xLt(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(Hns,{path:t,onNavigate:s}),l.jsxs("div",{className:"flex items-center gap-1",children:[i&&l.jsx(he,{variant:"ghost",size:"md",onClick:i,disabled:n,"aria-label":"Refresh files",children:l.jsx(hj,{className:`h-4 w-4 ${n?"animate-spin":""}`})}),c&&l.jsx(he,{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(Ci,{className:"h-4 w-4 animate-spin"}):l.jsx(R7,{className:"h-4 w-4"})}),o&&l.jsx(he,{variant:"ghost",size:"md",onClick:o,"aria-label":"Upload files",children:l.jsx($7,{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(Ci,{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(oP,{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:Vns(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(ud,{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(pj,{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,O=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:[yLt(S),l.jsx("span",{className:"text-sm text-neutral6 flex-1 truncate",children:S.name}),S.mount&&O&&l.jsxs(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx("span",{tabIndex:0,className:"flex items-center",children:l.jsx(oP,{className:"h-4 w-4 text-red-400"})})}),l.jsxs(er,{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(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx("span",{tabIndex:0,className:`text-xs px-1.5 py-0.5 rounded ${O?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:w})}),l.jsx(er,{children:S.mount.description})]}):l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${O?"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:bLt(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(Xd,{className:"h-3.5 w-3.5"})})]})},S.name)})]})})}),l.jsx(en,{open:!!p,onOpenChange:S=>!f&&!S&&h(null),children:l.jsxs(en.Content,{children:[l.jsxs(en.Header,{children:[l.jsx(en.Title,{children:"Delete Item"}),l.jsxs(en.Description,{children:['Are you sure you want to delete "',p,'"? This action cannot be undone.']})]}),l.jsxs(en.Footer,{children:[l.jsx(en.Cancel,{disabled:f,children:"Cancel"}),l.jsxs(en.Action,{disabled:f,onClick:async()=>{try{p&&u&&await u(p)}finally{h(null)}},children:[f?l.jsx(Ci,{className:"h-4 w-4 animate-spin mr-2"}):null,"Delete"]})]})]})})]})}function Wns(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 Gns({content:e,language:t}){return l.jsx(__e,{language:t,style:E_e.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},codeTagProps:{style:{fontFamily:"var(--geist-mono), ui-monospace, monospace"}},children:e})}function Qns({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=Wns(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:[yLt({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(ua,{content:t,copyMessage:"Copied file content"}),s&&l.jsx(he,{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(Ci,{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(Gns,{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 Yns=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(di,{iconSlot:l.jsx(Yd,{}),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(he,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",l.jsx(Ba,{})]})})}),Xns=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(di,{iconSlot:l.jsx(pWt,{}),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(he,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",l.jsx(Ba,{})]})})}),Kns=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(di,{iconSlot:l.jsx(oP,{}),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(he,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",l.jsx(Ba,{})]})})}),fle={bm25:{label:"Keyword",icon:l.jsx(td,{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(VC,{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(YQt,{className:"h-3.5 w-3.5"}),color:"bg-amber-500/10 text-amber-400 border-amber-500/30"}};function wLt(e){return e.id.replace(/#chunk-\d+$/,"")}function Jns({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(mj,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),l.jsx(On,{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(On,{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(he,{type:"submit",disabled:t||!i.trim(),size:"lg",className:"h-10 px-4",children:t?l.jsx(Ci,{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=fle[g],b=f===g;return l.jsxs("button",{type:"button",onClick:()=>p(g),className:`
|
|
659
|
+
]`})]})]})}function ses({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(Ve,{children:l.jsx(Xy,{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 aes({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}=dJr(),{batchInsertItems:b}=Ui(),S=y.useCallback(async N=>{try{const R=await m(N);o(R),a("preview")}catch{}},[m]),w=y.useCallback(async()=>{if(!i||i.items.length===0)return;a("importing"),h(!0);const{items:N}=i;u({current:0,total:N.length});try{await b.mutateAsync({datasetId:e,items:N.map(R=>({input:R.input,groundTruth:R.groundTruth,metadata:R.metadata}))}),f({success:N.length,errors:0})}catch{f({success:0,errors:N.length})}u({current:N.length,total:N.length}),h(!1),a("complete")},[i,b,e]),O=y.useCallback(()=>{n(!1),r?.(),d&&d.success>0&&Be.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]),E=y.useCallback(()=>{p||(n(!1),setTimeout(()=>{a("upload"),o(null),u({current:0,total:0}),f(null)},150))},[p,n]),_=i&&i.items.length>0&&i.errors.length===0,C=()=>{switch(s){case"upload":return l.jsx(res,{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(ses,{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(nes,{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(tn,{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(he,{onClick:E,children:"Cancel"});case"preview":return l.jsxs(l.Fragment,{children:[l.jsx(he,{onClick:()=>a("upload"),children:"Back"}),l.jsxs(he,{variant:"primary",onClick:w,disabled:!_,children:["Import ",i?.items.length??0," Item",i?.items.length!==1?"s":""]})]});case"importing":return null;case"complete":return l.jsx(he,{variant:"primary",onClick:O,children:"Done"})}},I={upload:"Import JSON",preview:"Preview Data",importing:"Importing",complete:"Import Complete"};return l.jsx(Dr,{open:t,onOpenChange:E,children:l.jsxs(Nr,{className:"max-w-2xl max-h-[90vh]",children:[l.jsxs(Lr,{children:[l.jsx(Ar,{children:I[s]}),l.jsx(ga,{children:"Import dataset items from a JSON file."})]}),l.jsx(ts,{className:"min-h-[200px] max-h-[50vh] overflow-y-auto",children:C()}),l.jsx(lp,{className:"px-6 pt-4 flex justify-end gap-2",children:j()})]})})}function ies({dataset:e,isLoading:t=!1,onEditClick:n,onDuplicateClick:r,onDeleteClick:s,experimentTriggerSlot:a,disableExperimentTrigger:i=!1,onExperimentClick:o,className:c}){return l.jsxs(Xn,{className:c,children:[l.jsxs(Xn.Column,{children:[l.jsxs(Xn.Title,{isLoading:t,children:[l.jsx(G0,{})," ",e?.name]}),l.jsx(Xn.Description,{isLoading:t,children:e?.description}),l.jsxs(Xn.Description,{isLoading:t,children:[l.jsxs(ps,{children:[l.jsx(UC,{})," Created at ",e?.createdAt?En(new Date(e.createdAt),"MMM d, yyyy"):""]}),l.jsxs(ps,{children:[l.jsx(Aw,{})," Latest version v",e?.version??""]})]})]}),l.jsx(Xn.Column,{children:l.jsxs(jr,{children:[a?i?l.jsxs(rr,{children:[l.jsx(Jn,{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(er,{children:"Add items to the dataset before running an experiment"})]}):a:o?i?l.jsxs(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx("span",{className:"cursor-not-allowed",children:l.jsxs(he,{disabled:!0,tabIndex:-1,children:[l.jsx(cb,{}),"Run Experiment"]})})}),l.jsx(er,{children:"Add items to the dataset before running an experiment"})]}):l.jsxs(he,{onClick:o,children:[l.jsx(cb,{}),"Run Experiment"]}):null,l.jsxs(Ot,{children:[l.jsx(Ot.Trigger,{asChild:!0,children:l.jsx(he,{size:"default","aria-label":"Dataset actions menu",children:l.jsx(zet,{})})}),l.jsxs(Ot.Content,{align:"end",className:"w-48",children:[l.jsxs(Ot.Item,{onSelect:n,children:[l.jsx(Rb,{})," Edit Dataset"]}),l.jsxs(Ot.Item,{onSelect:r,children:[l.jsx(rp,{})," Duplicate Dataset"]}),l.jsxs(Ot.Item,{onSelect:s,className:"text-red-500 focus:text-red-400",children:[l.jsx(Xd,{})," Delete Dataset"]})]})]})]})})]})}const iLt=e=>{const t=We(),{data:n}=PM(e),r=n?.experiments;return Et({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})},oes=e=>{const t=We(),{data:n}=PM(e),r=n?.experiments;return Et({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 les(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)}}function ces({datasetId:e}){const t=We(),{data:n}=Yb(e),{data:r,isLoading:s}=iLt(e),{data:a,isLoading:i}=oes(e),{updateExperimentResult:o}=Ui(),[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,E]=y.useState(""),[_,C]=y.useState(""),[j,I]=y.useState(""),[N,R]=y.useState([]),[P,B]=y.useState(!1),[M,L]=y.useState(null),F=y.useMemo(()=>M??r??[],[M,r]);y.useEffect(()=>{r&&M===null&&L(r)},[r,M]);const z=y.useMemo(()=>{const ue=new Set;if(n?.tags)for(const xe of n.tags)ue.add(xe);for(const xe of F)for(const Se of xe.tags)ue.add(Se);return[...ue].sort()},[n,F]),U=y.useCallback(ue=>{!n||!e||(n.tags??[]).includes(ue)},[n,e]),H=y.useMemo(()=>d?d==="__untagged__"?F.filter(ue=>ue.tags.length===0):F.filter(ue=>ue.tags.includes(d)):F,[F,d]),D=y.useMemo(()=>{const ue=new Map;for(const xe of F)for(const Se of xe.tags)ue.set(Se,(ue.get(Se)??0)+1);return[...ue.entries()].sort((xe,Se)=>Se[1]-xe[1])},[F]),Y=y.useMemo(()=>F.filter(ue=>ue.tags.length===0).length,[F]),V=y.useMemo(()=>{let ue=0;return d&&ue++,m&&ue++,ue},[d,m]),$=y.useCallback((ue,xe)=>{L(Fe=>(Fe??[]).map(ze=>ze.id===ue?{...ze,tags:xe}:ze));const Se=F.find(Fe=>Fe.id===ue);Se?.experimentId&&Se?.datasetId&&o.mutate({datasetId:Se.datasetId,experimentId:Se.experimentId,resultId:Se.id,tags:xe})},[F,o]),Z=y.useCallback((ue,xe)=>{const Se=F.find(Fe=>Fe.id===ue);Se?.traceId&&xe!==void 0&&t.createFeedback({feedback:{traceId:Se.traceId,source:"studio",feedbackSource:"studio",feedbackType:"rating",value:xe==="positive"?1:-1,experimentId:Se.experimentId??void 0,sourceId:Se.id}}).catch(()=>{}),L(Fe=>(Fe??[]).map(ze=>ze.id===ue?{...ze,rating:xe}:ze))},[F,t]),G=y.useCallback((ue,xe)=>{const Se=F.find(Fe=>Fe.id===ue);Se?.traceId&&t.createFeedback({feedback:{traceId:Se.traceId,source:"studio",feedbackSource:"studio",feedbackType:"comment",value:xe,comment:xe,experimentId:Se.experimentId??void 0,sourceId:Se.id}}).catch(()=>{}),L(Fe=>(Fe??[]).map(ze=>ze.id===ue?{...ze,comment:xe}:ze))},[F,t]),K=y.useCallback(ue=>{const xe=F.find(Se=>Se.id===ue);L(Se=>(Se??[]).filter(Fe=>Fe.id!==ue)),h(Se=>{const Fe=new Set(Se);return Fe.delete(ue),Fe}),c===ue&&u(null),xe?.experimentId&&xe?.datasetId&&o.mutate({datasetId:xe.datasetId,experimentId:xe.experimentId,resultId:xe.id,status:null})},[F,o,c]),ne=y.useCallback(ue=>{const xe=F.find(Se=>Se.id===ue);L(Se=>(Se??[]).filter(Fe=>Fe.id!==ue)),h(Se=>{const Fe=new Set(Se);return Fe.delete(ue),Fe}),c===ue&&u(null),xe?.experimentId&&xe?.datasetId&&o.mutate({datasetId:xe.datasetId,experimentId:xe.experimentId,resultId:xe.id,status:"complete"})},[F,o,c]),ee=y.useMemo(()=>{const ue=m?a??[]:H;return!m||!d?ue:d==="__untagged__"?ue.filter(xe=>xe.tags.length===0):ue.filter(xe=>xe.tags.includes(d))},[m,a,H,d]),J=m?i:!1,se=y.useMemo(()=>new Set(ee.map(ue=>ue.id)),[ee]),ae=y.useMemo(()=>[...p].filter(ue=>se.has(ue)).length,[p,se]),Q=ee.length>0&&ae===ee.length,te=ae>0&&!Q,le=y.useCallback(ue=>{h(xe=>{const Se=new Set(xe);return Se.has(ue)?Se.delete(ue):Se.add(ue),Se})},[]),fe=y.useCallback(()=>{h(Q?new Set:new Set(ee.map(ue=>ue.id)))},[Q,ee]),ce=y.useCallback(ue=>{for(const xe of p){const Se=F.find(Fe=>Fe.id===xe);Se&&!Se.tags.includes(ue)&&$(xe,[...Se.tags,ue])}},[F,p,$]),ye=y.useCallback(ue=>{for(const xe of p){const Se=F.find(Fe=>Fe.id===xe);Se&&Se.tags.includes(ue)&&$(xe,Se.tags.filter(Fe=>Fe!==ue))}},[F,p,$]),we=y.useCallback(()=>{for(const ue of p)ne(ue);h(new Set)},[p,ne]),ke=y.useCallback(()=>{for(const ue of p)K(ue);h(new Set)},[p,K]),Re=y.useCallback(()=>{E(""),w(!0)},[]),De=y.useCallback(async()=>{if(!(!_||!j)){b(!0),w(!1);try{const ue=F.filter(Se=>p.has(Se.id));if(ue.length===0){b(!1);return}const xe=await t.clusterFailures({modelId:`${_}/${j}`,items:ue.map(Se=>({id:Se.id,input:Se.input,output:Se.output??void 0,error:typeof Se.error=="string"?Se.error:Se.error?String(Se.error):void 0,scores:Se.scores,existingTags:Se.tags.length>0?Se.tags:void 0})),availableTags:z.length>0?z:void 0,prompt:O||void 0});xe.proposedTags&&xe.proposedTags.length>0&&(R(xe.proposedTags.map(Se=>({...Se,accepted:!0}))),B(!0))}catch(ue){console.error("Analysis failed:",ue)}finally{b(!1)}}},[_,j,F,p,t,z,O]),Ue=y.useCallback(()=>{for(const ue of N){if(!ue.accepted)continue;const xe=F.find(Se=>Se.id===ue.itemId);if(xe){const Se=[...new Set([...xe.tags,...ue.tags])];$(xe.id,Se)}}B(!1)},[N,F,$]),ot=y.useCallback(ue=>{u(xe=>xe===ue?null:ue)},[]),pe=y.useMemo(()=>c?ee.find(ue=>ue.id===c)??null:null,[c,ee]),de=y.useCallback(()=>{if(!c||ee.length===0)return;const ue=ee.findIndex(xe=>xe.id===c);ue<ee.length-1&&u(ee[ue+1].id)},[c,ee]),ie=y.useCallback(()=>{if(!c||ee.length===0)return;const ue=ee.findIndex(xe=>xe.id===c);ue>0&&u(ee[ue-1].id)},[c,ee]),ge=pe?"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(tn,{className:"w-6 h-6"})}):l.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[l.jsx(Dr,{open:S,onOpenChange:w,children:l.jsxs(Nr,{children:[l.jsxs(Lr,{children:[l.jsx(Ar,{children:"Analyze Items"}),l.jsx(ga,{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(It,{className:"text-xs mb-1 block",children:"Provider"}),l.jsx(Gv,{value:_,onValueChange:C})]}),l.jsxs("div",{children:[l.jsx(It,{className:"text-xs mb-1 block",children:"Model"}),l.jsx(Qv,{llmId:_,value:j,onValueChange:I})]})]}),l.jsxs(be,{variant:"ui-xs",className:"text-neutral3",children:[p.size," item",p.size!==1?"s":""," will be analyzed"]}),l.jsxs("div",{children:[l.jsx(It,{className:"text-xs",children:"Instructions (optional)"}),l.jsx(cu,{value:O,onChange:ue=>E(ue.target.value),placeholder:"E.g., Focus on safety issues and factual errors...",rows:3,className:"text-xs mt-1"})]})]}),l.jsxs(lp,{children:[l.jsx(he,{variant:"outline",onClick:()=>w(!1),children:"Cancel"}),l.jsxs(he,{onClick:De,disabled:!_||!j||v,children:[v?l.jsx(tn,{className:"w-4 h-4 mr-1"}):null,"Analyze"]})]})]})}),l.jsx(Dr,{open:P,onOpenChange:B,children:l.jsxs(Nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[l.jsxs(Lr,{children:[l.jsx(Ar,{children:"Review Proposed Tags"}),l.jsxs(ga,{children:[N.filter(ue=>ue.accepted).length," of ",N.length," proposals selected"]})]}),l.jsx("div",{className:"space-y-3 py-2",children:N.map((ue,xe)=>{const Se=F.find(Fe=>Fe.id===ue.itemId);return l.jsx("div",{className:X("p-3 border rounded-lg",!ue.accepted&&"opacity-50"),children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(go,{checked:ue.accepted,onCheckedChange:Fe=>R(ze=>ze.map((Ke,Ne)=>Ne===xe?{...Ke,accepted:!!Fe}:Ke))}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx(be,{variant:"ui-xs",className:"text-neutral4 truncate block",children:Se?typeof Se.input=="string"?Se.input.slice(0,100):JSON.stringify(Se.input).slice(0,100):ue.itemId}),l.jsx("div",{className:"flex gap-1 flex-wrap mt-1.5",children:ue.tags.map((Fe,ze)=>l.jsx(Y3t,{tag:Fe,onRename:Ke=>R(Ne=>Ne.map((qe,Ie)=>Ie===xe?{...qe,tags:qe.tags.map((Ge,Le)=>Le===ze?Ke:Ge)}:qe)),onRemove:()=>R(Ke=>Ke.map((Ne,qe)=>qe===xe?{...Ne,tags:Ne.tags.filter((Ie,Ge)=>Ge!==ze)}:Ne))},`${Fe}-${ze}`))}),ue.reason&&l.jsx(be,{variant:"ui-xs",className:"text-neutral3 mt-1 block italic",children:ue.reason})]})]})},ue.itemId)})}),l.jsxs(lp,{children:[l.jsx(he,{variant:"outline",onClick:()=>B(!1),children:"Cancel"}),l.jsxs(he,{onClick:Ue,disabled:N.filter(ue=>ue.accepted).length===0,children:["Accept ",N.filter(ue=>ue.accepted).length," proposals"]})]})]})}),l.jsxs(ep,{className:pe?"grid-cols-[1fr_1fr]":"",children:[l.jsxs(Pn,{children:[l.jsxs(Pn.Toolbar,{children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(Ot,{children:[l.jsx(Ot.Trigger,{asChild:!0,children:l.jsxs(he,{variant:"outline",size:"md",children:[l.jsx(Bet,{}),"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(Ot.Content,{align:"start",className:X("min-w-48"),children:[l.jsxs(Ot.Sub,{children:[l.jsxs(Ot.SubTrigger,{children:["Status",m&&l.jsx("span",{className:X("ml-auto text-ui-sm text-accent1"),children:"1"})]}),l.jsxs(Ot.SubContent,{children:[l.jsx(Ot.CheckboxItem,{checked:!m,onCheckedChange:()=>{g(!1),u(null)},onSelect:ue=>ue.preventDefault(),children:"Review Queue"}),l.jsx(Ot.CheckboxItem,{checked:m,onCheckedChange:()=>{g(!0),u(null)},onSelect:ue=>ue.preventDefault(),children:"Completed"})]})]}),l.jsxs(Ot.Sub,{children:[l.jsxs(Ot.SubTrigger,{children:["Tags",d&&l.jsx("span",{className:X("ml-auto text-ui-sm text-accent1"),children:"1"})]}),l.jsxs(Ot.SubContent,{children:[l.jsx(Ot.CheckboxItem,{checked:!d,onCheckedChange:()=>f(null),onSelect:ue=>ue.preventDefault(),children:"All"}),Y>0&&l.jsx(Ot.CheckboxItem,{checked:d==="__untagged__",onCheckedChange:()=>f(d==="__untagged__"?null:"__untagged__"),onSelect:ue=>ue.preventDefault(),children:"Untagged"}),D.length>0&&l.jsx(Ot.Separator,{}),D.map(([ue])=>l.jsx(Ot.CheckboxItem,{checked:d===ue,onCheckedChange:()=>f(d===ue?null:ue),onSelect:xe=>xe.preventDefault(),children:ue},ue))]})]}),V>0&&l.jsxs(l.Fragment,{children:[l.jsx(Ot.Separator,{}),l.jsxs(Ot.Item,{onSelect:()=>{f(null),g(!1),u(null)},children:[l.jsx(Pr,{}),"Clear all filters"]})]})]})]}),V>0&&l.jsxs(he,{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(Q3t,{selectedCount:p.size,vocabulary:z,onApplyTag:ce,onRemoveTag:ye,onNewTag:ue=>ce(ue)}),l.jsxs(Ot,{children:[l.jsx(Ot.Trigger,{asChild:!0,children:l.jsxs(he,{disabled:v,children:[v?l.jsx(tn,{className:"w-4 h-4"}):l.jsx(Ve,{size:"sm",children:l.jsx(bs,{})}),"Actions"]})}),l.jsxs(Ot.Content,{align:"end",children:[l.jsxs(Ot.Item,{onSelect:we,children:[l.jsx(Ve,{size:"sm",children:l.jsx(ak,{})}),"Complete"]}),l.jsxs(Ot.Item,{onSelect:ke,children:[l.jsx(Ve,{size:"sm",children:l.jsx(Xd,{})}),"Remove"]}),l.jsx(Ot.Separator,{}),l.jsxs(Ot.Item,{onSelect:Re,children:[l.jsx(Ve,{size:"sm",children:l.jsx(VC,{})}),"Analyze"]})]})]})]})]}),J?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx(tn,{className:"w-6 h-6"})}):ee.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(be,{variant:"ui-sm",className:"text-neutral3 block",children:m?"No completed reviews yet":"No items to review"}),l.jsx(be,{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(Oe,{columns:ge,children:[l.jsxs(Oe.Top,{children:[!m&&l.jsx(Oe.TopCell,{children:l.jsx(go,{checked:Q?!0:te?"indeterminate":!1,onCheckedChange:()=>fe(),"aria-label":"Select all"})}),m&&l.jsx(Oe.TopCell,{children:" "}),l.jsx(Oe.TopCell,{children:"Input"}),l.jsx(Oe.TopCell,{children:"Comment"}),l.jsx(Oe.TopCell,{children:"Tags"}),!pe&&l.jsx(Oe.TopCell,{children:"Rating"}),!pe&&l.jsx(Oe.TopCell,{children:"Scores"})]}),l.jsx(Oe.Rows,{children:ee.map(ue=>{const xe=ue.scores?Object.entries(ue.scores):[];return l.jsxs(Oe.Row,{onClick:()=>ot(ue.id),selected:c===ue.id,children:[l.jsx(Oe.Cell,{children:m?ue.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(go,{checked:p.has(ue.id),onCheckedChange:()=>le(ue.id),onClick:Se=>Se.stopPropagation(),"aria-label":`Select item ${ue.id}`})}),l.jsx(Oe.NameCell,{children:les(ue.input,80)}),l.jsx(Oe.Cell,{children:ue.comment?l.jsx(be,{variant:"ui-xs",className:"text-neutral3 truncate",children:ue.comment}):l.jsx(be,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),l.jsx(Oe.Cell,{children:ue.tags.length>0?l.jsx(be,{variant:"ui-xs",className:"text-neutral4 truncate",children:ue.tags.join(", ")}):l.jsx(be,{variant:"ui-xs",className:"text-neutral2",children:"—"})}),!pe&&l.jsxs(Oe.Cell,{children:[ue.rating==="positive"&&l.jsx(Ve,{size:"sm",className:"text-positive1",children:l.jsx(Dme,{})}),ue.rating==="negative"&&l.jsx(Ve,{size:"sm",className:"text-negative1",children:l.jsx($me,{})}),!ue.rating&&l.jsx(be,{variant:"ui-xs",className:"text-neutral2",children:"—"})]}),!pe&&l.jsx(Oe.Cell,{children:xe.length>0?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Ve,{size:"sm",className:"text-neutral3",children:l.jsx(du,{})}),l.jsx(be,{variant:"ui-xs",className:"text-neutral4 font-mono",children:xe[0][1].toFixed(2)}),xe.length>1&&l.jsxs(Ct,{variant:"default",children:["+",xe.length-1]})]}):l.jsx(be,{variant:"ui-xs",className:"text-neutral2",children:"—"})})]},ue.id)})})]})]}),pe&&l.jsx(G3t,{item:pe,isCompleted:m,tagVocabulary:z,onRate:ue=>Z(pe.id,ue),onSetTags:ue=>{$(pe.id,ue);for(const xe of ue)z.includes(xe)||U(xe)},onComment:ue=>G(pe.id,ue),onRemove:()=>K(pe.id),onComplete:m?void 0:()=>ne(pe.id),onPrevious:ie,onNext:de,onClose:()=>u(null)})]})]})}function ues({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}=dn(),[p,h]=y.useState(u??"items"),m=Nt=>{h(Nt),d?.(Nt)},[g,v]=y.useState(!1),[b,S]=y.useState(!1),[w,O]=y.useState(!1),[E,_]=y.useState([]),[C,j]=y.useState(!1),[I,N]=y.useState([]),[R,P]=y.useState(!1),[B,M]=y.useState([]),[L,F]=y.useState(!1),[z,U]=y.useState(0),[H,D]=y.useState(null),[Y,V]=y.useState(""),[$]=OCn(Y,300),[Z,G]=y.useState(null),ne=o!==void 0?o:Z,{data:ee,isLoading:J}=Yb(e),{data:se=[],total:ae,isLoading:Q,setEndOfListElement:te,isFetchingNextPage:le,hasNextPage:fe}=cj(e,$||void 0,ne),{data:ce=[],total:ye,isLoading:we}=cj(e,void 0,ne),[ke,Re]=y.useState({}),{data:De,isLoading:Ue}=PM(e,void 0,ke),{data:ot}=PM(e),{deleteItems:pe}=Ui(),de=De?.experiments??[],ie=ot?.experiments??[],ge=TJr({hasSearchQuery:!!$,filteredItemsLength:se.length,unfilteredItemsTotal:ye,itemsTotal:ae}),{data:ue}=iLt(e),xe=ue?.length??0,Se=Nt=>{D(Nt)},Fe=()=>{D(null)},ze=Nt=>{const Mn=Nt.isCurrent?null:Nt;c?c(Mn):G(Nt.isCurrent?null:Nt.version)},Ke=Nt=>{_(Nt),O(!0)},Ne=Nt=>{N(Nt),j(!0)},qe=Nt=>{j(Nt),Nt||(N([]),U(Mn=>Mn+1))},Ie=Nt=>{f(`/datasets/${e}/items?items=${Nt.join(",")}`)},Ge=Nt=>{f(`/datasets/${e}/versions?ids=${Nt.join(",")}`)},Le=Nt=>{M(Nt),P(!0)},Je=async()=>{await pe.mutateAsync({datasetId:e,itemIds:B}),Be.success(`Deleted ${B.length} items`),P(!1),M([]),U(Nt=>Nt+1)},st=Nt=>{O(!1),_([]),U(Mn=>Mn+1),i?.(Nt)},fn=Nt=>{O(Nt),Nt||(_([]),U(Mn=>Mn+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(ies,{dataset:ee,isLoading:J,onEditClick:n,onDuplicateClick:()=>F(!0),onDeleteClick:r,experimentTriggerSlot:a,disableExperimentTrigger:!we&&ce.length===0,onExperimentClick:t}),l.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:l.jsxs(Eu,{defaultTab:"items",value:p,onValueChange:m,className:"grid grid-rows-[auto_1fr] h-full",children:[l.jsxs(Cu,{children:[l.jsxs(Hr,{value:"items",children:["Items ",l.jsx(ci,{color:"gray",children:ge})]}),l.jsxs(Hr,{value:"experiments",children:["Experiments",l.jsx(ci,{color:"gray",children:de.length})]}),l.jsxs(Hr,{value:"review",children:["Review",xe>0&&l.jsx(ci,{color:"orange",children:xe})]})]}),l.jsx(Os,{value:"items",className:"grid overflow-auto mt-5",children:l.jsx(tes,{datasetId:e,items:se,isLoading:Q,featuredItemId:H,onItemSelect:Se,onItemClose:Fe,onAddClick:s??(()=>{}),onImportClick:()=>v(!0),onImportJsonClick:()=>S(!0),onBulkDeleteClick:Le,onCreateDatasetClick:Ke,onAddToDatasetClick:Ne,onCompareItemsClick:Ie,datasetName:ee?.name,clearSelectionTrigger:z,setEndOfListElement:te,isFetchingNextPage:le,hasNextPage:fe,searchQuery:Y,onSearchChange:V,activeDatasetVersion:ne,currentDatasetVersion:ee?.version,onVersionSelect:ze,onCompareVersionsClick:Ge})}),l.jsx(Os,{value:"experiments",className:"grid overflow-auto mt-5",children:l.jsx(VJr,{experiments:de,allExperiments:ie,isLoading:Ue,datasetId:e,filters:ke,onFiltersChange:Re})}),l.jsx(Os,{value:"review",className:"overflow-auto mt-0",children:l.jsx(ces,{datasetId:e})})]})})]}),l.jsx($Jr,{datasetId:e,open:g,onOpenChange:v}),l.jsx(aes,{datasetId:e,open:b,onOpenChange:S}),l.jsx(kJr,{open:w,onOpenChange:fn,items:E,onSuccess:st}),l.jsx(OJr,{open:C,onOpenChange:qe,items:I,currentDatasetId:e}),l.jsx(_Jr,{open:L,onOpenChange:F,sourceDatasetId:e,sourceDatasetName:ee?.name||"",sourceDatasetDescription:ee?.description,onSuccess:i}),l.jsx(en,{open:R,onOpenChange:P,children:l.jsxs(en.Content,{children:[l.jsxs(en.Header,{children:[l.jsx(en.Title,{children:"Delete Items"}),l.jsxs(en.Description,{children:["Are you sure you want to delete ",B.length," item",B.length!==1?"s":"","? This action cannot be undone."]})]}),l.jsxs(en.Footer,{children:[l.jsx(en.Cancel,{children:"Cancel"}),l.jsx(en.Action,{onClick:Je,children:pe.isPending?"Deleting...":"Delete"})]})]})})]})}function des(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 UXe({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 fes({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}=Ui(),h=async b=>{b.preventDefault();let S;try{S=JSON.parse(s)}catch{Be.error("Input must be valid JSON");return}let w;if(i.trim())try{w=JSON.parse(i)}catch{Be.error("Ground Truth must be valid JSON");return}let O;if(c.trim())try{O=JSON.parse(c)}catch{Be.error("Expected Trajectory must be valid JSON");return}try{await p.mutateAsync({datasetId:e,input:S,groundTruth:w,expectedTrajectory:O}),Be.success("Item added successfully"),f(null),a("{}"),o(""),u(""),n(!1),r?.()}catch(E){const _=des(E);_?f(_):Be.error(`Failed to add item: ${E instanceof Error?E.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(Dr,{open:t,onOpenChange:n,children:l.jsxs(Nr,{className:"max-w-lg",children:[l.jsx(Lr,{children:l.jsx(Ar,{children:"Add Item"})}),l.jsx(ts,{children:l.jsxs("form",{onSubmit:h,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(It,{htmlFor:"item-input",children:"Input (JSON) *"}),l.jsx(Rs,{value:s,onChange:m,showCopyButton:!1,className:"min-h-[120px]"}),d?.field==="input"&&l.jsx(UXe,{field:"input",errors:d.errors})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(It,{htmlFor:"item-ground-truth",children:"Ground Truth (JSON, optional)"}),l.jsx(Rs,{value:i,onChange:g,showCopyButton:!1,className:"min-h-[80px]"}),d?.field==="groundTruth"&&l.jsx(UXe,{field:"groundTruth",errors:d.errors})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(It,{htmlFor:"item-trajectory",children:"Expected Trajectory (JSON, optional)"}),l.jsx(Rs,{value:c,onChange:u,showCopyButton:!1,className:"min-h-[80px]"})]}),l.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[l.jsx(he,{type:"button",onClick:v,children:"Cancel"}),l.jsx(he,{type:"submit",variant:"primary",disabled:p.isPending,children:p.isPending?"Adding...":"Add Item"})]})]})})]})})}function pes({selectedScorers:e,setSelectedScorers:t,disabled:n=!1,container:r}){const{data:s,isLoading:a}=Cp(),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(It,{children:"Scorers (Optional)"}),l.jsx(Awt,{options:i,value:e,onValueChange:t,placeholder:"Select scorers...",searchPlaceholder:"Search scorers...",emptyText:"No scorers available",disabled:n||a,container:r})]})}const hes=[{value:"agent",label:"Agent"},{value:"workflow",label:"Workflow"},{value:"scorer",label:"Scorer"}];function mes({targetType:e,setTargetType:t,targetId:n,setTargetId:r,container:s}){const{data:a,isLoading:i}=Zv(),{data:o,isLoading:c}=Kw(),{data:u,isLoading:d}=Cp(),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(It,{children:"Target Type"}),l.jsx(Nc,{options:hes,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(It,{children:m}),l.jsx(Nc,{options:f,value:n,onValueChange:r,placeholder:`Select ${e}`,searchPlaceholder:"Search...",emptyText:"No targets available",disabled:p,container:s})]})]})}function ges({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}=Ui(),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});Rm.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";Rm.error(S)}},v=()=>{m||(r(!1),o(""),u(""),f([]))};return l.jsx(Dr,{open:n,onOpenChange:v,children:l.jsxs(Nr,{ref:a,children:[l.jsxs(Lr,{children:[l.jsx(Ar,{children:"Run Experiment"}),l.jsx(ga,{children:t?`Execute items from ${En(new Date(t),"MMM d, yyyy")} version against a target.`:"Execute all items in this dataset against a target."})]}),l.jsxs(ts,{className:"grid gap-6",children:[l.jsx(mes,{targetType:i,setTargetType:o,targetId:c,setTargetId:u,container:a}),i&&i!=="scorer"&&l.jsx(pes,{selectedScorers:d,setSelectedScorers:f,disabled:m,container:a})]}),l.jsxs(lp,{className:"px-6 pt-4",children:[l.jsx(he,{onClick:v,disabled:m,children:"Cancel"}),l.jsx(he,{variant:"primary",onClick:g,disabled:!h||m,children:m?l.jsxs(l.Fragment,{children:[l.jsx(tn,{className:"w-4 h-4"}),"Running..."]}):"Run"})]})]})})}const oLt=e=>{const t=We();return Et({queryKey:["experiment-trace-light",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return t.getTraceLight(e)},enabled:!!e})},qXe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"score",label:"Score",size:"1fr"}];function ves({result:e,scores:t,onPrevious:n,onNext:r,onClose:s,onShowTrace:a,onScoreClick:i,featuredScoreId:o}){const c=!!e?.error,u=cle(e?.input),d=cle(e?.output);return l.jsxs(l.Fragment,{children:[l.jsxs(Pn.Toolbar,{children:[l.jsx(iI,{onPrevious:n,onNext:r,previousAriaLabel:"View previous result details",nextAriaLabel:"View next result details"}),l.jsxs(jr,{children:[l.jsxs(he,{onClick:a,disabled:!e.traceId,children:[l.jsx(Pme,{}),"Show Trace"]}),l.jsx(he,{onClick:s,"aria-label":"Close result details panel",children:l.jsx(Pr,{})})]})]}),l.jsxs(Pn.Content,{children:[l.jsx(Xn,{withMargins:!1,children:l.jsxs(Xn.Column,{children:[l.jsxs(Xn.Title,{size:"smaller",children:[l.jsx(cb,{})," ",e.id]}),l.jsx(Xn.Description,{children:l.jsxs(ps,{children:[l.jsx(Q0,{})," ",e.itemId]})})]})}),c&&l.jsx(Qn,{variant:"destructive",title:"Error",children:l.jsx(Qn.Message,{children:cle(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:qXe,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:qXe,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(gj,{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(ln.CodeSection,{title:"Input",icon:l.jsx(Q0,{}),codeStr:u}),l.jsx(ln.CodeSection,{title:"Output",icon:l.jsx(Zf,{}),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(UC,{className:"w-4 h-4"})," Created"]}),l.jsx("p",{className:"text-sm text-neutral4",children:En(new Date(e.createdAt),"MMM d, yyyy 'at' h:mm a")})]})]})]})}function cle(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function yes({span:e}){return e?l.jsxs(l.Fragment,{children:[l.jsx(ln.CodeSection,{title:"Input",icon:l.jsx(Y0,{}),codeStr:JSON.stringify(e.input||null,null,2)}),l.jsx(ln.CodeSection,{title:"Output",icon:l.jsx(Zf,{}),codeStr:JSON.stringify(e.output||null,null,2)}),l.jsx(ln.CodeSection,{title:"Metadata",icon:l.jsx(yh,{}),codeStr:JSON.stringify(e.metadata||null,null,2)}),l.jsx(ln.CodeSection,{title:"Attributes",icon:l.jsx(yh,{}),codeStr:JSON.stringify(e.attributes||null,null,2)})]}):null}function bes({traceId:e,spanId:t,onNext:n,onPrevious:r,onClose:s}){const{data:a}=Hk(e,t),i=a?.span;return l.jsxs(l.Fragment,{children:[l.jsxs(Pn.Toolbar,{children:[l.jsx(iI,{onPrevious:r,onNext:n,previousAriaLabel:"View previous span details",nextAriaLabel:"View next span details"}),l.jsx(he,{onClick:s,"aria-label":"Close span details",children:l.jsx(Pr,{})})]}),l.jsxs(Pn.Content,{children:[l.jsx(Xn,{withMargins:!1,children:l.jsx(Xn.Column,{children:l.jsxs(Xn.Title,{size:"smaller",children:[l.jsx(yh,{})," Span ",Jf(t)]})})}),l.jsx(yes,{span:i})]})]})}const xes=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 lLt(e){if(!e.spans||e.spans.length===0)return[];const t=[];return e.spans.forEach(n=>{t.push(n.id),t.push(...lLt(n))}),t}const VXe=["agent","workflow","model","mcp","tool","workspace","other"];function cLt(e){const t=e?.toLowerCase().split("_")[0],n={agent:{icon:l.jsx(Ll,{}),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(yu,{}),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(Fg,{}),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(kv,{}),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(vu,{}),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(Eq,{}),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 wes({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(Iet,{}):l.jsx(Nw,{}):l.jsx(bs,{})]}),a>(o??0)&&!i&&l.jsxs(HXe,{onClick:()=>s?.(),children:[a," ",l.jsx(jet,{})]})]}):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 Ses({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(Ret,{}):l.jsx(Aet,{})})})}function kes({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(Ses,{isLastChild:i,hasChildren:!!o,expanded:u})}),l.jsx("button",{className:"truncate",onClick:()=>s?.(e.id),children:e.name})]})}function uLt({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=lLt(e),v=g.length,b=t===0,S=cLt(e?.type),w=f?f.includes(e.id):!1,O=d&&d.length>0?!d.includes(e.id):!1,_=(c&&c.length>0?c.includes(S?.typePrefix||""):!1)||O;y.useEffect(()=>{b&&p?.([e.id])},[b,e.id,p]),y.useEffect(()=>{if(!d||!e.spans||e.spans.length===0)return;const N=e.spans.some(R=>d.includes(R.id));!w&&N&&C()},[d,e.spans,e.id,w,p,f]);const C=()=>{if(!(!p||!f))if(w){const N=[e.id,...g];p(f.filter(R=>!N.includes(R)))}else p([...f,e.id])},j=()=>{!p||!f||p([...f,e.id,...g])},I=g.every(N=>f?.includes(N));return l.jsxs(l.Fragment,{children:[l.jsx(kes,{span:e,spanUI:S,isFaded:_,depth:t,onSpanClick:n,selectedSpanId:r,isLastChild:s,hasChildren:h,isRootSpan:b,isExpanded:w,toggleChildren:C}),l.jsx(wes,{isSelected:r===e.id,isFaded:_,isExpanded:w,toggleChildren:C,expandAllDescendants:j,totalDescendants:v,allDescendantsExpanded:I,numOfChildren:m}),h&&w&&e.spans?.map((N,R,P)=>{const B=R===P.length-1;return l.jsx(uLt,{span:N,depth:t+1,onSpanClick:n,selectedSpanId:r,isLastChild:B,overallLatency:a,overallStartTime:i,fadedTypes:c,searchPhrase:u,expandedSpanIds:f,setExpandedSpanIds:p,featuredSpanIds:d},N.id)})]})}function Oes({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(tn,{})," Loading Trace Timeline ..."]}):l.jsx("div",{className:"grid grid-cols-[1fr_auto]",children:e?.map(f=>l.jsx(uLt,{span:f,onSpanClick:t,selectedSpanId:n,overallLatency:c,overallStartTime:u,overallEndTime:d,fadedTypes:s,featuredSpanIds:o,expandedSpanIds:a,setExpandedSpanIds:i},f.id))})})}function _es({spans:e=[],fadedTypes:t,onLegendClick:n,onLegendReset:r,onSearchPhraseChange:s,traceId:a}){const[i,o]=y.useState("");y.useEffect(()=>{o("")},[a]);const c=VXe.filter(p=>e.some(h=>h?.spanType?.startsWith(p)))||[],u=e.some(p=>!VXe.some(m=>p?.spanType?.startsWith(m))),d=p=>{n?.(p)};y.useEffect(()=>{f(i)},[i,s]);const f=npt(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(fw,{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(jr,{spacing:"close",children:[c.map(p=>{const h=cLt(p),m=t?.includes(p);return l.jsx(y.Fragment,{children:l.jsxs(he,{onClick:()=>d(p),className:m?"opacity-40":"",style:{color:m?void 0:h?.color,backgroundColor:h?.bgColor},children:[h?.icon&&l.jsx(Ve,{children:h.icon}),h?.label]})},p)}),u&&l.jsxs(he,{onClick:()=>d("other"),className:t?.includes("other")?"opacity-40":"",children:[l.jsx(Ve,{children:l.jsx(A7,{})}),"Other"]}),l.jsx(he,{onClick:r,disabled:t?.length===0,children:l.jsx(Ve,{children:l.jsx(Pr,{})})})]})]})}function Ees({traceId:e,selectedSpanId:t,onSpanSelect:n,onClose:r}){const{data:s,isLoading:a}=oLt(e),i=s?.spans??[],[o,c]=y.useState(""),[u,d]=y.useState([]),[f,p]=y.useState([]),[h,m]=y.useState([]),g=y.useMemo(()=>xes(i),[i]);y.useEffect(()=>{if(o.trim()===""){p([]);return}const w=o.toLowerCase(),O=i.filter(E=>E.name.toLowerCase().includes(w)).map(E=>E.spanId);p(O)},[o,i]),y.useEffect(()=>{c(""),d([]),p([]),m([])},[e]);const v=w=>{n?.(t===w?void 0:w)},b=w=>{d(O=>O.includes(w)?O.filter(E=>E!==w):[...O,w])},S=()=>{d([])};return l.jsxs(l.Fragment,{children:[l.jsx(Pn.Toolbar,{children:l.jsx(he,{onClick:r,"aria-label":"Close trace panel",children:l.jsx(Pr,{})})}),l.jsxs(Pn.Content,{children:[l.jsx(Xn,{withMargins:!1,children:l.jsx(Xn.Column,{children:l.jsxs(Xn.Title,{size:"smaller",children:[l.jsx(iu,{})," Trace ",Jf(e)]})})}),l.jsx(_es,{spans:i,fadedTypes:u,onLegendClick:b,onLegendReset:S,searchPhrase:o,onSearchPhraseChange:c,traceId:e}),l.jsx(Oes,{hierarchicalSpans:g,onSpanClick:v,selectedSpanId:t,isLoading:a,fadedTypes:u,expandedSpanIds:h,setExpandedSpanIds:m,featuredSpanIds:f})]})]})}function Ces({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(Oe,{columns:d,children:[l.jsx(Oe.Top,{children:s.map(f=>l.jsx(Oe.TopCell,{children:f.label},f.name))}),l.jsx("div",{className:"flex items-center justify-center py-20 col-span-full",children:l.jsx(tn,{})})]}):e.length===0?l.jsxs(Oe,{columns:d,children:[l.jsx(Oe.Top,{children:s.map(f=>l.jsx(Oe.TopCell,{children:f.label},f.name))}),l.jsx(Oe.NoMatch,{message:"No results yet"})]}):l.jsxs(Oe,{columns:d,children:[l.jsx(Oe.Top,{children:s.map(f=>l.jsx(Oe.TopCell,{children:f.label},f.name))}),l.jsxs(Oe.Rows,{children:[e.map(f=>{const p=!!f.error,h=f.id===n;return l.jsxs(Oe.Row,{onClick:()=>r(f.id),selected:h,children:[l.jsx(Oe.TextCell,{children:l.jsx("span",{className:"truncate block font-mono",children:f.itemId})}),l.jsx(Oe.Cell,{children:l.jsxs(rr,{children:[l.jsx(Jn,{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(er,{children:p?"Error":"Success"})]})}),s.some(m=>m.name==="input")&&l.jsx(Oe.TextCell,{children:l.jsx("span",{className:"truncate block font-mono",children:jes(Tes(f.input),200)})}),i?.map(m=>{const v=a?.[f.itemId]?.find(b=>b.scorerId===m);return l.jsx(Oe.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(tn,{})}),!u&&e.length>0&&l.jsx(be,{variant:"ui-xs",className:"text-icon3 text-center py-4 block",children:"All results loaded"})]})]})]})}function Tes(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function jes(e,t){return e.length<=t?e:e.slice(0,t-1)+"..."}function Ies(e){const t=e.scorer;return t?.hasJudge===!1?!0:t?.hasJudge===!0?!1:!e.preprocessPrompt&&!e.analyzePrompt&&!e.generateScorePrompt&&!e.generateReasonPrompt}function Nes({score:e,onNext:t,onPrevious:n,onClose:r}){const s=Ies(e),a=s?"N/A — code-based scorer":"N/A — step not configured";return l.jsxs(l.Fragment,{children:[l.jsxs(Pn.Toolbar,{children:[l.jsx(iI,{onPrevious:n,onNext:t,previousAriaLabel:"View previous score details",nextAriaLabel:"View next score details"}),l.jsx(he,{onClick:r,"aria-label":"Close score details",children:l.jsx(Pr,{})})]}),l.jsxs(Pn.Content,{children:[l.jsx(Xn,{withMargins:!1,children:l.jsx(Xn.Column,{children:l.jsxs(Xn.Title,{size:"smaller",children:[l.jsx(du,{})," ",e.scorerId]})})}),l.jsxs(pw,{children:[l.jsx(ln.CodeSection,{title:`Score: ${e.score}`,icon:l.jsx(du,{}),codeStr:e.reason||a,simplified:!0}),l.jsx(ln.CodeSection,{title:"Input",icon:l.jsx(Q0,{}),codeStr:JSON.stringify(e.input??null,null,2)}),l.jsx(ln.CodeSection,{title:"Output",icon:l.jsx(Zf,{}),codeStr:JSON.stringify(e.output??null,null,2)}),!s&&l.jsxs(l.Fragment,{children:[l.jsx(ln.CodeSection,{title:"Preprocess Prompt",icon:l.jsx(Zc,{}),codeStr:e.preprocessPrompt||a,simplified:!0}),l.jsx(ln.CodeSection,{title:"Analyze Prompt",icon:l.jsx(Zc,{}),codeStr:e.analyzePrompt||a,simplified:!0}),l.jsx(ln.CodeSection,{title:"Generate Score Prompt",icon:l.jsx(Zc,{}),codeStr:e.generateScorePrompt||a,simplified:!0}),l.jsx(ln.CodeSection,{title:"Generate Reason Prompt",icon:l.jsx(Zc,{}),codeStr:e.generateReasonPrompt||a,simplified:!0})]})]})]})]})}const ZXe=[{name:"scorer",label:"Scorer",size:"1fr"},{name:"avg",label:"Avg Score",size:"1fr"},{name:"count",label:"Items Scored",size:"1fr"}];function Aes({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(di,{iconSlot:l.jsx(du,{className:"w-8 h-8 text-neutral3"}),titleSlot:a,descriptionSlot:i})})}return l.jsxs(Qt,{children:[l.jsxs(Qt.Header,{columns:ZXe,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:ZXe,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 dLt({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}=F3t(e,t),b=y.useMemo(()=>{if(!v)return[];const z=new Set;for(const U of Object.values(v))for(const H of U)z.add(H.scorerId);return[...z].sort()},[v]),{data:S}=oLt(u),w=S?.spans??[],O=()=>{if(!f)return;const z=w.findIndex(U=>U.spanId===f);if(z>=0&&z<w.length-1)return()=>p(w[z+1].spanId)},E=()=>{if(!f)return;const z=w.findIndex(U=>U.spanId===f);if(z>0)return()=>p(w[z-1].spanId)},_=z=>{c(z),d(null),p(void 0),m(null)},C=z=>{_(z===o?null:z)},j=()=>{_(null)},I=()=>{if(!g)return;const z=n.findIndex(U=>U.id===g.id);if(z>=0&&z<n.length-1)return()=>_(n[z+1].id)},N=()=>{if(!g)return;const z=n.findIndex(U=>U.id===g.id);if(z>0)return()=>_(n[z-1].id)},R=g?v?.[g.itemId]:void 0,P=R?.find(z=>z.id===h)??null,B=z=>{m(z===h?null:z),d(null),p(void 0)},M=()=>{if(!h||!R)return;const z=R.findIndex(U=>U.id===h);if(z>=0&&z<R.length-1)return()=>m(R[z+1].id)},L=()=>{if(!h||!R)return;const z=R.findIndex(U=>U.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(Eu,{defaultTab:"summary",className:"grid grid-rows-[auto_1fr] h-full overflow-hidden",children:[l.jsxs(Cu,{children:[l.jsx(Hr,{value:"summary",children:"Summary"}),l.jsx(Hr,{value:"results",children:"Results"})]}),l.jsx(Os,{value:"summary",className:"overflow-y-auto mt-5",children:l.jsx(Aes,{scoresByItemId:v,experimentStatus:t})}),l.jsx(Os,{value:"results",className:"grid overflow-hidden mt-5",children:l.jsxs(ep,{className:g?"grid-cols-[1fr_2fr]":void 0,children:[l.jsx(Pn,{children:l.jsx(Ces,{results:n,isLoading:r,featuredResultId:o,onResultClick:C,columns:F,scoresByItemId:v,scorerIds:o?void 0:b,setEndOfListElement:s,isFetchingNextPage:a,hasNextPage:i})}),g&&l.jsxs(XKn,{numOfColumns:1+(!u&&h?1:0)+(u?1:0)+(f?1:0),minColumnWidth:"35rem",children:[g&&l.jsx(Pn,{withLeftSeparator:!0,children:l.jsx(ves,{result:g,scores:R,onPrevious:N(),onNext:I(),onClose:j,onScoreClick:B,featuredScoreId:h,onShowTrace:()=>{d(g.traceId??null),p(void 0),m(null)}})}),g&&!u&&P&&l.jsx(Pn,{withLeftSeparator:!0,children:l.jsx(Nes,{score:P,onNext:M(),onPrevious:L(),onClose:()=>m(null)})}),g&&u&&l.jsx(Pn,{withLeftSeparator:!0,children:l.jsx(Ees,{traceId:u,selectedSpanId:f,onSpanSelect:p,onClose:()=>{d(null),p(void 0)}})}),g&&u&&f&&l.jsx(Pn,{withLeftSeparator:!0,children:l.jsx(bes,{traceId:u,spanId:f,onNext:O(),onPrevious:E(),onClose:()=>p(void 0)})})]})]})})]})}const Res={pending:l.jsx(fO,{}),running:l.jsx(Iz,{}),completed:l.jsx(ni,{}),failed:l.jsx(Pr,{})};function Pes({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:Res[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 fLt({experimentId:e,experiment:t}){const{Link:n,paths:r}=dn(),{data:s}=Zv(),{data:a}=Kw(),{data:i}=Cp(),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(Xn,{children:[l.jsxs(Xn.Column,{children:[l.jsxs(Xn.Title,{children:[l.jsx(Pet,{}),e," ",e&&l.jsx(ua,{content:e})]}),l.jsxs(Xn.Description,{children:[l.jsxs(ps,{children:[l.jsx(UC,{})," Created at ",En(new Date(t.createdAt),"MMM d, yyyy 'at' h:mm a")]}),t.completedAt&&l.jsxs(ps,{children:[l.jsx(UC,{})," Completed at ",En(new Date(t.completedAt),"MMM d, yyyy 'at' h:mm a")]})]}),l.jsxs(Xn.Description,{children:[l.jsxs(ps,{children:[l.jsx(SWt,{})," Target",l.jsx(n,{href:o(),children:c()})]}),t.agentVersion&&l.jsxs(ps,{children:[l.jsx(P7,{})," 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(ua,{content:t.agentVersion})]})]})]}),l.jsx(Xn.Column,{children:l.jsx(Pes,{experiment:t})})]})}function tEe({delta:e}){const t=e>0?l.jsx(ci,{size:"small",color:"green",intensity:"muted",children:l.jsx(Qle,{})}):e<0?l.jsx(ci,{size:"small",color:"red",intensity:"muted",children:l.jsx(tZt,{})}):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 Y5(e){return e==null?"-":typeof e=="string"?e:JSON.stringify(e,null,2)}function Mes({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(Pn,{withLeftSeparator:!0,children:[l.jsxs(Pn.Toolbar,{children:[l.jsx(iI,{onPrevious:a,onNext:i,previousAriaLabel:"Previous comparison item",nextAriaLabel:"Next comparison item"}),l.jsx(jr,{children:l.jsx(he,{onClick:o,"aria-label":"Close comparison detail panel",children:l.jsx(Pr,{})})})]}),l.jsxs(Pn.Content,{className:"pb-6",children:[l.jsx(Xn,{withMargins:!1,children:l.jsx(Xn.Column,{children:l.jsxs(Xn.Title,{size:"smaller",children:[l.jsx(Q0,{})," ",e.itemId]})})}),d?l.jsx(l.Fragment,{children:l.jsxs(pw,{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(tEe,{delta:v})]})]},h)})})]}),l.jsx(ln.CodeSection,{title:l.jsxs(l.Fragment,{children:[l.jsx(ci,{color:"purple",children:"Baseline "})," Experiment Output"]}),icon:l.jsx(Zf,{}),codeStr:Y5(c?.output)}),l.jsx(ln.CodeSection,{title:l.jsxs(l.Fragment,{children:[l.jsx(ci,{color:"cyan",children:"Contender "})," Experiment Output"]}),icon:l.jsx(Zf,{}),codeStr:Y5(u?.output)}),l.jsx(ln.CodeSection,{title:"Item Input",icon:l.jsx(Y0,{}),codeStr:Y5(e.input)}),l.jsx(ln.CodeSection,{title:"Item Ground Truth",icon:l.jsx(Xet,{}),codeStr:Y5(e.groundTruth)})]})}):l.jsx(Qn,{variant:"warning",title:"Comparison not available",children:l.jsx(Qn.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 $es({items:e,baselineId:t,contenderId:n,scorerIds:r,featuredItemId:s,columns:a,onItemClick:i}){return l.jsx(Pn,{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(tEe,{delta:m})]}):l.jsx("span",{className:"text-neutral1",children:"-"})},f)})})]})},o.itemId)})})})]})})}const Des={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 WXe({datasetId:e,experiment:t,type:n}){const{Link:r}=dn(),{label:s,color:a,customStyle:i}=Des[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(ci,{size:"small",color:a,children:[s,l.jsx(FS,{})]}),l.jsx(he,{as:r,href:`/datasets/${e}/experiments/${t.id}`,children:l.jsx("span",{className:"truncate min-w-0",children:t.id})}),n==="baseline"&&l.jsxs(ci,{size:"small",color:a,children:[l.jsx(Ab,{})," ",s]})]}),l.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-ui-sm text-neutral3",children:[l.jsxs(ps,{children:[l.jsx(Xet,{})," ",t.targetType," / ",t.targetId]}),l.jsxs(ps,{children:[l.jsx(Uet,{})," v",t.datasetVersion??"—"]}),o&&l.jsxs(ps,{children:[l.jsx(Tet,{})," ",En(o,"MMM d, yyyy HH:mm")]})]})]})}function Les({datasetId:e,experimentIdA:t,experimentIdB:n,onSwap:r}){const[s,a]=y.useState(null),{data:i,isLoading:o,error:c}=tJr(e,t,n),{data:u}=y7(e,t),{data:d}=y7(e,n),f=u&&d&&u.datasetVersion!==d.datasetVersion,p=y.useMemo(()=>{if(!i)return[];const C=new Set;for(const j of i.items)for(const I of Object.values(j.results))if(I)for(const N of Object.keys(I.scores))C.add(N);return[...C].sort()},[i]),h=y.useMemo(()=>{if(!i||p.length===0)return[];const C=i.baselineId,j=t===C?n:t;return p.map(I=>{let N=0,R=0,P=0,B=0;for(const z of i.items){const U=z.results[C]?.scores[I],H=z.results[j]?.scores[I];U!=null&&(N+=U,P++),H!=null&&(R+=H,B++)}const M=P>0?N/P:null,L=B>0?R/B:null,F=M!=null&&L!=null?L-M:null;return{scorerId:I,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(C=>({name:C,label:C,size:"1fr"}))],[p,s]),v=i?.items.find(C=>C.itemId===s)??null,b=C=>{a(C===s?null:C)},S=()=>{a(null)},w=()=>{if(!i||!s)return;const C=i.items.findIndex(j=>j.itemId===s);if(C>=0&&C<i.items.length-1)return()=>a(i.items[C+1].itemId)},O=()=>{if(!i||!s)return;const C=i.items.findIndex(j=>j.itemId===s);if(C>0)return()=>a(i.items[C-1].itemId)};if(o)return l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx(tn,{})});if(c)return l.jsx(Qn,{variant:"warning",title:"Error loading comparison",children:l.jsx(Qn.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 E=i.baselineId,_=t===E?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(WXe,{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(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx(he,{onClick:r,children:"VS"})}),l.jsx(er,{children:"Switch the order"})]})})}),l.jsx(WXe,{datasetId:e,experiment:d,type:"contender"})]}),f&&l.jsx(Qn,{variant:"warning",title:"Version mismatch",children:l.jsxs(Qn.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(b6e,{children:[l.jsx(ci,{color:"purple",size:"small",intensity:"muted",children:"Baseline"}),l.jsx(ci,{color:"purple",size:"small",children:"Avg"})]})}),l.jsx(Qt.HeaderCol,{className:"flex justify-center",children:l.jsxs(b6e,{children:[l.jsx(ci,{color:"cyan",size:"small",intensity:"muted",children:"Contender"}),l.jsx(ci,{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:C,avgA:j,avgB:I,delta:N})=>l.jsxs(Qt.Row,{columns:m,children:[l.jsx(Qt.TextCell,{children:C}),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:I!=null?I.toFixed(3):"-"}),l.jsx(Qt.TextCell,{className:"flex justify-center",children:N!=null?l.jsx(tEe,{delta:N}):"-"})]},C))})})]}),l.jsxs(ep,{className:X({"grid-cols-[1fr_2fr]":!!v}),children:[l.jsx($es,{items:i.items,baselineId:E,contenderId:_,scorerIds:p,featuredItemId:s,columns:g,onItemClick:b}),!!v&&l.jsx(Mes,{item:v,baselineId:E,contenderId:_,baselineVersion:u?.datasetVersion,contenderVersion:d?.datasetVersion,onPrevious:O(),onNext:w(),onClose:S})]})]})}function zes({datasetId:e,itemId:t,onVersionSelect:n,onCompareVersionsClick:r,activeVersion:s}){const{data:a,isLoading:i}=eEe(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[O]=Array.from(w);return new Set([O,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(Pn,{className:"min-w-56",children:[o?l.jsx(Pn.Toolbar,{className:"grid justify-stretch gap-3 w-full",children:l.jsxs(jr,{children:[l.jsx(he,{onClick:m,children:"Cancel"}),l.jsx(he,{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(Pn.Toolbar,{children:l.jsxs(he,{onClick:g,className:"w-full",children:[l.jsx(X0,{})," Compare Ver."]})})}),i?l.jsx(Fes,{}):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(go,{checked:u.has(S),disabled:b.isDeleted,onCheckedChange:()=>{},onClick:O=>{O.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 Fes(){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 Bes(e,t){if(t){const n=typeof t=="string"?new Date(t):t;return`v${e} ${En(n,"MMM dd 'at' H:mm:ss a")}`}return`v${e}`}function Ues({datasetId:e,versionA:t,versionB:n,onVersionChange:r}){const{data:s}=K_e(e),a=(s??[]).map(i=>({value:String(i.version),label:`${Bes(i.version,i.createdAt)}${i.isCurrent?" (current)":""}`}));return l.jsxs(Pn.Toolbar,{className:"grid grid-cols-[1fr_1fr_1fr_10rem] gap-4 w-full",children:[l.jsx("div",{}),l.jsx(Ic,{label:"Version A",labelIsHidden:!0,name:"version-a",placeholder:"Select version",options:a,value:t??"",onValueChange:i=>r?.(i,n??"")}),l.jsx(Ic,{label:"Version B",labelIsHidden:!0,name:"version-b",options:a,value:n??"",onValueChange:i=>r?.(t??"",i)}),l.jsx("div",{})]})}const qes=[{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"}],Ves={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(Qet,{}),tooltip:"Changed in this version"},same:{color:"green",borderColor:"border-green-900",icon:l.jsx(RWt,{}),tooltip:"Same in both versions"}};function ule({red:e=!1,tooltip:t}){return l.jsxs(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx(dZt,{className:X("text-neutral3/40 w-5 h-5 ",{"text-red-900":e})})}),t&&l.jsx(er,{children:t})]})}function Q1({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}=Ves[e];return l.jsxs(rr,{children:[l.jsx(Jn,{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(ci,{color:n,size:"small",children:r})]})}),l.jsx(er,{children:s})]})}function Hes(e,t){return e&&t&&e.datasetVersion===t.datasetVersion?"same":e&&t&&e.datasetVersion!==t.datasetVersion?"changed":e?"added":"removed"}function Zes({datasetId:e,versionA:t,versionB:n,allItems:r,itemsAMap:s,itemsBMap:a}){const{Link:i}=dn(),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=Hes(u,d);return l.jsxs(Qt.Row,{columns:qes,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(Q1,{variant:"added",version:u.datasetVersion}):f==="changed"&&o?l.jsx(Q1,{variant:"changed",version:u.datasetVersion}):l.jsx(Q1,{version:u.datasetVersion})}):l.jsx(Qt.Cell,{className:"justify-center flex items-center",children:l.jsx(ule,{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(Q1,{variant:"added",version:d.datasetVersion}):f==="changed"&&!o?l.jsx(Q1,{variant:"changed",version:d.datasetVersion}):l.jsx(Q1,{version:d.datasetVersion})}):l.jsx(Qt.Cell,{className:"justify-center flex items-center",children:l.jsx(ule,{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(Q1,{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(ule,{tooltip:l.jsxs(l.Fragment,{children:["Comparing is available",l.jsx("br",{})," only for changed items"]})})})]},c)})})})})}const GXe={needsReview:"#facc15",complete:"#22c55e"},Wes=[{label:"Needs Review",color:GXe.needsReview},{label:"Reviewed",color:GXe.complete}];function Ges({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(Xt,{children:[l.jsxs(Xt.TopBar,{children:[l.jsx(Xt.TitleAndDescription,{title:"Review Pipeline",description:"Items in review across experiments."}),c&&l.jsx(Xt.Summary,{value:String(o),label:"Items in pipeline"})]}),r?l.jsx(Xt.Loading,{}):s?l.jsx(Xt.Error,{message:"Failed to load review data"}):l.jsx(Xt.Content,{children:c?l.jsx(CT,{data:a,segments:Wes,maxVal:i,fmt:u=>String(u)}):l.jsx(Xt.NoData,{message:"No items have been sent to review yet"})})]})}function nEe(){const e=We();return Et({queryKey:["experiment-review-summary"],queryFn:()=>e.getExperimentReviewSummary()})}function pLt(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 Qes(e,t){const n=new Map,r=pLt(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 Yes(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 Xes=10;function Kes(){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}=Bv({page:d,perPage:Xes}),{data:g,isLoading:v,error:b}=BH(),{data:S}=nEe(),w=y.useMemo(()=>p?.datasets??[],[p?.datasets]),O=p?.pagination?.hasMore??!1,E=y.useMemo(()=>g?.experiments??[],[g?.experiments]),_=y.useMemo(()=>bJr(w),[w]),C=y.useMemo(()=>Qes(S,E),[S,E]),j=h||v,I=m||b,N=()=>t(!0),R=y.useCallback(()=>f(H=>H+1),[]),P=y.useCallback(()=>f(H=>Math.max(0,H-1)),[]),B=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(I&&Bs(I))return l.jsx(cr,{children:l.jsx(fa,{})});if(I&&qs(I))return l.jsx(cr,{children:l.jsx(sa,{resource:"datasets"})});if(I)return l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load datasets",message:I.message})});if(w.length===0&&!j&&d===0)return l.jsxs(l.Fragment,{children:[l.jsx(cr,{children:l.jsx(xJr,{onCreateClick:N})}),l.jsx(nme,{open:e,onOpenChange:t})]});const z=s!=="all"||i!=="all"||c!=="all"||n!=="",U=()=>{r(""),a("all"),o("all"),u("all"),f(0)};return l.jsxs(Tn,{children:[l.jsx(Tn.TopArea,{children:l.jsx(SJr,{search:n,onSearchChange:B,targetFilter:s,onTargetFilterChange:M,experimentFilter:i,onExperimentFilterChange:L,tagFilter:c,onTagFilterChange:F,tagOptions:_,onReset:U,hasActiveFilters:z,onCreateClick:N})}),l.jsx(gJr,{datasets:w,experiments:E,reviewByDataset:C,isLoading:j,search:n,targetFilter:s,experimentFilter:i,tagFilter:c,currentPage:d,hasMore:O,onNextPage:R,onPrevPage:P}),l.jsx(nme,{open:e,onOpenChange:t})]})}const Jes=new Set(["items","experiments","review"]);function ets(){const{datasetId:e}=Mr(),t=ku(),[n,r]=xo(),s=n.get("tab"),a=s&&Jes.has(s)?s:"items",i=_=>{r(_==="items"?{}:{tab:_},{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}=Yb(e??"");if(!e)return l.jsx(pr,{children:l.jsx(Oh,{children:l.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(S&&Bs(S))return l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})});if(S&&qs(S))return l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"datasets"})})});const w=_=>{t(`/datasets/${e}/experiments/${_}`)},O=()=>{t("/datasets")},E=_=>{v(_?.version??null)};return l.jsx(pr,{children:l.jsxs(Oh,{className:"content-stretch",children:[l.jsx(ues,{datasetId:e,onAddItemClick:()=>d(!0),onEditClick:()=>p(!0),onDeleteClick:()=>m(!0),activeDatasetVersion:g,onVersionSelect:E,initialTab:a,onTabChange:i,experimentTriggerSlot:l.jsxs(he,{variant:"primary",onClick:()=>c(!0),children:[l.jsx(cb,{}),g!=null?`Run on v${g}`:"Run Experiment"]})}),l.jsx(ges,{datasetId:e,version:g??void 0,open:o,onOpenChange:c,onSuccess:w}),l.jsx(fes,{datasetId:e,open:u,onOpenChange:d}),b&&l.jsx(EJr,{open:f,onOpenChange:p,dataset:{id:b.id,name:b.name,description:b?.description||"",inputSchema:b.inputSchema,groundTruthSchema:b.groundTruthSchema}}),b&&l.jsx(CJr,{open:h,onOpenChange:m,datasetId:b.id,datasetName:b.name,onSuccess:O})]})})}function tts(){const{datasetId:e,experimentId:t}=Mr(),{data:n,isLoading:r,error:s}=y7(e,t),{data:a,isLoading:i,setEndOfListElement:o,isFetchingNextPage:c,hasNextPage:u}=FH({datasetId:e,experimentId:t,experimentStatus:n?.status});return!e||!t?null:r?l.jsx(pr,{children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(tn,{})})}):s&&Bs(s)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})}):s&&qs(s)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"datasets"})})}):s||!n?l.jsx(pr,{children:l.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",s instanceof Error?s.message:"Unknown error"]})}):l.jsx(pr,{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(fLt,{experimentId:t,experiment:n}),l.jsx(dLt,{experimentId:t,experimentStatus:n?.status,results:a??[],isLoading:i,setEndOfListElement:o,isFetchingNextPage:c,hasNextPage:u})]})})})}function nts(){const{datasetId:e}=Mr(),[t,n]=xo(),{error:r}=Yb(e??""),s=t.get("baseline")??"",a=t.get("contender")??"";return r&&Bs(r)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})}):r&&qs(r)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"datasets"})})}):!e||!s||!a?l.jsx(pr,{children:l.jsx(Oh,{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(pr,{children:l.jsx(Oh,{children:l.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[l.jsxs(Xn,{children:[l.jsxs(Xn.Column,{children:[l.jsxs(Xn.Title,{children:[l.jsx(X0,{})," Dataset Experiments Comparison"]}),l.jsxs(Xn.Description,{children:["Comparing"," ",l.jsx($o,{to:`/datasets/${e}/experiments/${s}`,children:s.slice(0,8)})," vs"," ",l.jsx($o,{to:`/datasets/${e}/experiments/${a}`,children:a.slice(0,8)})]})]}),l.jsx(Xn.Column,{children:l.jsxs(he,{as:$o,to:`/datasets/${e}`,children:[l.jsx(Ab,{}),"Back to Dataset"]})})]}),l.jsx(Les,{datasetId:e,experimentIdA:s,experimentIdB:a,onSwap:()=>{n({baseline:a,contender:s})}})]})})})}function rts(){const{datasetId:e,itemId:t}=Mr(),{Link:n}=dn(),r=ku(),{data:s,isLoading:a,error:i}=eEe(e??"",t??""),{updateItem:o,deleteItem:c}=Ui(),{data:u}=Yb(e??""),d=s?.[0]??null,f=d?.isDeleted??!1,[p,h]=y.useState(null),m=y.useMemo(()=>!d||f?{input:"",groundTruth:"",metadata:"",trajectory:""}:{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):"",trajectory:d.expectedTrajectory!=null?JSON.stringify(d.expectedTrajectory,null,2):""},[d,f]),g=d?.datasetVersion??0,[v,b]=y.useState(!1),[S,w]=y.useState(m.input),[O,E]=y.useState(m.groundTruth),[_,C]=y.useState(m.metadata),[j,I]=y.useState(m.trajectory),[N,R]=y.useState(g);g!==N&&(R(g),w(m.input),E(m.groundTruth),C(m.metadata),I(m.trajectory));const[P,B]=y.useState(!1),M=Z=>{h(f?Z:Z.isLatest?null:Z)},L=()=>{h(null)},F=!f&&p!=null,z=()=>{F||b(!0)},U=()=>{F||B(!0)},H=async()=>{if(!e||!t)return;let Z;try{Z=JSON.parse(S)}catch{Be.error("Input must be valid JSON");return}let G;if(O.trim())try{G=JSON.parse(O)}catch{Be.error("Ground Truth must be valid JSON");return}let K;if(_.trim())try{K=JSON.parse(_)}catch{Be.error("Metadata must be valid JSON");return}let ne;const ee=j!==m.trajectory;if(ee&&j.trim())try{ne=JSON.parse(j)}catch{Be.error("Expected Trajectory must be valid JSON");return}try{await o.mutateAsync({datasetId:e,itemId:t,input:Z,groundTruth:G,metadata:K,...ee?{expectedTrajectory:ne??null}:{}}),Be.success("Item updated successfully"),b(!1)}catch(J){Be.error(`Failed to update item: ${J instanceof Error?J.message:"Unknown error"}`)}},D=()=>{d&&(w(JSON.stringify(d.input,null,2)),E(d.groundTruth?JSON.stringify(d.groundTruth,null,2):""),C(d.metadata?JSON.stringify(d.metadata,null,2):""),I(d.expectedTrajectory!=null?JSON.stringify(d.expectedTrajectory,null,2):"")),b(!1)},Y=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),Be.success("Item deleted successfully"),B(!1),r(`/datasets/${e}`)}catch(Z){Be.error(`Failed to delete item: ${Z instanceof Error?Z.message:"Unknown error"}`)}},V=p??d,$=V?{id:t??"",datasetId:e??"",datasetVersion:V.datasetVersion,input:V.input,groundTruth:V.groundTruth,expectedTrajectory:V.expectedTrajectory,metadata:V.metadata,createdAt:V.createdAt,updatedAt:V.updatedAt}:null;return i&&Bs(i)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})}):i&&qs(i)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"datasets"})})}):a?null:!e||!t||!s||s.length===0?l.jsx(pr,{children:l.jsx(Oh,{children:l.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):l.jsxs(l.Fragment,{children:[l.jsx(pr,{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(Xn,{children:[l.jsxs(Xn.Column,{children:[l.jsxs(Xn.Title,{children:[l.jsx(Q0,{}),t," ",l.jsx(ua,{content:t})]}),l.jsx(Xn.Description,{children:l.jsxs(ps,{children:["Item of ",l.jsx(G0,{})," ",u?.name]})}),l.jsxs(Xn.Description,{children:[l.jsxs(ps,{children:[l.jsx(UC,{})," Created at"," ",d?.createdAt?En(new Date(d.createdAt),"MMM d, yyyy"):""]}),l.jsxs(ps,{children:[l.jsx(Aw,{})," Latest version v",d?.datasetVersion??""]})]})]}),l.jsx(Xn.Column,{children:!v&&!f&&l.jsxs(jr,{children:[l.jsxs(he,{onClick:z,disabled:F,title:F?"Return to latest version to edit":void 0,children:[l.jsx(Qet,{})," Edit"]}),l.jsxs(he,{onClick:U,disabled:F,title:F?"Return to latest version to delete":void 0,children:[l.jsx(Xd,{})," Delete"]})]})})]}),l.jsxs(ep,{className:v?"grid-cols-1":"grid-cols-[1fr_auto]",children:[l.jsxs(Pn,{withRightSeparator:!v,children:[f&&d&&l.jsx(Qn,{variant:"destructive",title:"Item deleted",children:l.jsxs(Qn.Message,{children:["This item was deleted at version v",d.datasetVersion]})}),!f&&F&&p&&l.jsx(Qn,{variant:"warning",title:"Previous version",action:l.jsxs(Qn.Button,{onClick:L,children:[l.jsx(dS,{})," Return to the latest version"]}),children:l.jsxs(Qn.Message,{children:["Viewing version v",p.datasetVersion]})}),v?l.jsx(sLt,{inputValue:S,setInputValue:w,groundTruthValue:O,setGroundTruthValue:E,metadataValue:_,setMetadataValue:C,trajectoryValue:j,setTrajectoryValue:I,validationErrors:null,onSave:H,onCancel:D,isSaving:o.isPending}):$?l.jsx(UH,{item:$,Link:n}):l.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!v&&l.jsx(Pn,{children:l.jsx(zes,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:M,onCompareVersionsClick:Z=>{r(`/datasets/${e}/items/${t}/versions?ids=${Z.join(",")}`)},activeVersion:p?.datasetVersion??null})})]})]})})}),l.jsx(en,{open:P,onOpenChange:B,children:l.jsxs(en.Content,{children:[l.jsxs(en.Header,{children:[l.jsx(en.Title,{children:"Delete Item"}),l.jsx(en.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),l.jsxs(en.Footer,{children:[l.jsx(en.Cancel,{children:"Cancel"}),l.jsx(en.Action,{onClick:Y,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function QXe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function sts(){const{datasetId:e}=Mr(),[t,n]=xo(),r=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=Yb(e??""),{Link:i}=dn(),[o,c]=y.useState(!1),{data:u}=Jhe(e??"",r[0]??""),{data:d}=Jhe(e??"",r[1]??"");return a&&Bs(a)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})}):a&&qs(a)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"datasets"})})}):!e||r.length<2?l.jsx(pr,{children:l.jsx(Oh,{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(pr,{children:[l.jsx(Uv,{owner:"dataset-items-compare",children:l.jsxs(he,{as:$o,to:`/datasets/${e}`,variant:"outline",children:[l.jsx(Ab,{}),"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(Xn,{children:[l.jsxs(Xn.Column,{children:[l.jsxs(Xn.Title,{children:[l.jsx(X0,{}),"Compare Dataset Items"]}),l.jsx(Xn.Description,{children:l.jsxs(ps,{children:["Comparing ",r.length," items of"," ",l.jsx($o,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:s?.name||e?.slice(0,8)})]})})]}),l.jsx(Xn.Column,{children:l.jsx(jr,{children:l.jsx(he,{variant:"primary",onClick:()=>c(f=>!f),children:o?l.jsxs(l.Fragment,{children:[l.jsx(Let,{})," Default View"]}):l.jsxs(l.Fragment,{children:[l.jsx(_Wt,{})," Diff View"]})})})})]}),l.jsx(ep,{className:"grid-cols-[1fr_3vw_1fr]",children:r.map((f,p)=>l.jsxs(y.Fragment,{children:[l.jsx(ats,{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(M1t,{codeA:QXe(u),codeB:QXe(d)})]})})]})}function ats({datasetId:e,itemId:t,Link:n,idx:r,itemIds:s,onItemChange:a,showContent:i=!0}){const{data:o,isLoading:c}=Jhe(e,t),{data:u}=cj(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(Pn,{children:[l.jsxs(Pn.Toolbar,{className:"flex gap-4",children:[l.jsxs(fi,{name:`compare-item-${r}`,value:t,onValueChange:a,children:[l.jsx(Ka,{"aria-label":"Item",children:l.jsx(pi,{placeholder:"Select item"})}),l.jsx(Ja,{children:f.map(p=>l.jsx(os,{value:p.value,disabled:p.disabled,children:p.label},p.value))})]}),l.jsxs(he,{as:n,to:`/datasets/${e}/items/${t}`,children:[l.jsx(Aw,{}),"Versions"]})]}),i&&l.jsx(Pn.Content,{children:c?l.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):o?l.jsxs(l.Fragment,{children:[l.jsx(aLt,{item:o}),l.jsx(UH,{item:o,Link:n})]}):l.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function YXe(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function its(){const{datasetId:e,itemId:t}=Mr(),[n,r]=xo(),[s,a]=y.useState(!1),i=n.get("ids")?.split(",").map(Number).filter(h=>!isNaN(h)&&h>0)??[],{data:o,error:c}=Yb(e??""),{Link:u}=dn(),{data:d}=eEe(e??"",t??""),{data:f}=ame(e??"",t??"",i[0]??0,o?.version),{data:p}=ame(e??"",t??"",i[1]??0,o?.version);return c&&Bs(c)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})}):c&&qs(c)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"datasets"})})}):!e||!t||i.length<2?l.jsx(pr,{children:l.jsx(Oh,{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(pr,{children:[l.jsx(Uv,{owner:"dataset-item-versions-compare",children:l.jsxs(he,{as:$o,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[l.jsx(Ab,{}),"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(Xn,{children:[l.jsxs(Xn.Column,{children:[l.jsxs(Xn.Title,{children:[l.jsx(X0,{}),"Compare Dataset Item Versions"]}),l.jsx(Xn.Description,{children:l.jsxs(ps,{children:["Comparing ",i.length," versions of"," ",l.jsx($o,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),l.jsx(Xn.Column,{children:l.jsx(jr,{children:l.jsx(he,{variant:"primary",onClick:()=>a(h=>!h),children:s?l.jsxs(l.Fragment,{children:[l.jsx(Let,{})," Default View"]}):l.jsxs(l.Fragment,{children:[l.jsx(lGt,{})," Diff View"]})})})})]}),l.jsx(ep,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((h,m)=>l.jsxs(y.Fragment,{children:[l.jsx(ots,{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(M1t,{codeA:YXe(f),codeB:YXe(p)})]})})]})}function ots({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}=ame(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]})," - ",En(v,"MMM d, yyyy h:mm a"),g.isLatest?l.jsx(ci,{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(Pn,{children:[l.jsxs(Pn.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[l.jsx(Aw,{className:"w-6 h-6 opacity-50"}),l.jsxs(fi,{name:`compare-version-${o}`,value:String(n),onValueChange:g=>u(Number(g)),children:[l.jsx(Ka,{"aria-label":"Version",className:"w-full",children:l.jsx(pi,{placeholder:"Select version"})}),l.jsx(Ja,{children:h.map(g=>l.jsx(os,{value:g.value,disabled:g.disabled,children:g.label},g.value))})]})]}),c&&l.jsx(Pn.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(UH,{item:m,Link:i})})]})}function lts(){const{datasetId:e}=Mr(),[t]=xo(),n=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],r=ku(),{data:s,error:a}=Yb(e??""),i=cj(e??"",void 0,n[0]??null),o=cj(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&&Bs(a))return l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})});if(a&&qs(a))return l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"datasets"})})});if(!e||n.length<2)return l.jsx(pr,{children:l.jsx(Oh,{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(pr,{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(Xn,{children:[l.jsxs(Xn.Column,{children:[l.jsxs(Xn.Title,{children:[l.jsx(EQt,{})," Compare Dataset Versions"]}),l.jsx(Xn.Description,{children:l.jsxs(ps,{children:[l.jsx(Aw,{})," Comparing ",n.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),l.jsx(Xn.Column,{children:l.jsxs(he,{as:$o,to:`/datasets/${e}`,children:[l.jsx(Ab,{}),"Back to Dataset"]})})]}),l.jsx(ep,{children:l.jsxs(Pn,{children:[l.jsx(Ues,{datasetId:e,versionA:String(n[0]),versionB:String(n[1]),onVersionChange:m}),l.jsx(Zes,{datasetId:e,versionA:n[0],versionB:n[1],allItems:d,itemsAMap:f,itemsBMap:p,onItemClick:h})]})})]})})})}function cts(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 uts({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=cts(n);return l.jsxs(l.Fragment,{children:[l.jsxs(Ur,{children:[l.jsx(Ur.Label,{children:"Total Scorers"}),i?l.jsx(Ur.Loading,{}):f!=null?l.jsxs(l.Fragment,{children:[l.jsx(Ur.Value,{children:String(f)}),l.jsx(Ur.NoChange,{message:"Static count"})]}):l.jsx(Ur.NoData,{})]}),l.jsxs(Ur,{children:[l.jsx(Ur.Label,{children:"Total Datasets"}),o?l.jsx(Ur.Loading,{}):p!=null?l.jsxs(l.Fragment,{children:[l.jsx(Ur.Value,{children:String(p)}),l.jsx(Ur.NoChange,{message:"Static count"})]}):l.jsx(Ur.NoData,{})]}),l.jsxs(Ur,{children:[l.jsx(Ur.Label,{children:"Avg Score"}),u?l.jsx(Ur.Loading,{}):r!=null?l.jsxs(l.Fragment,{children:[l.jsx(Ur.Value,{children:String(r)}),m?l.jsx(Ur.Change,{changePct:m.changePct,prevValue:m.prevValue}):l.jsx(Ur.NoChange,{})]}):l.jsx(Ur.NoData,{})]}),l.jsxs(Ur,{children:[l.jsx(Ur.Label,{children:"Total Experiments"}),c?l.jsx(Ur.Loading,{}):h!=null?l.jsxs(l.Fragment,{children:[l.jsx(Ur.Value,{children:String(h)}),g?l.jsx(Ur.Change,{changePct:g.changePct,prevValue:g.prevValue}):l.jsx(Ur.NoChange,{})]}):l.jsx(Ur.NoData,{})]}),l.jsxs(Ur,{children:[l.jsx(Ur.Label,{children:"Needs Review"}),d?l.jsx(Ur.Loading,{}):a!=null?l.jsxs(l.Fragment,{children:[l.jsx(Ur.Value,{children:String(a)}),a>0?l.jsx(Ur.NoChange,{message:"items pending review"}):l.jsx(Ur.NoChange,{message:"All caught up"})]}):l.jsx(Ur.NoData,{})]})]})}const dts=[{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 fts(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const pts={completed:"success",running:"warning",failed:"error",pending:"neutral"};function hts({experiments:e,datasets:t,reviewByExperiment:n,isLoading:r,search:s="",statusFilter:a="all",datasetFilter:i="all"}){const{paths:o,Link:c}=dn(),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(Bd,{columns:XXe}):l.jsxs(Oe,{columns:XXe,children:[l.jsxs(Oe.Top,{children:[l.jsx(Oe.TopCell,{children:"Experiment"}),l.jsx(Oe.TopCell,{children:"Dataset"}),l.jsx(Oe.TopCell,{children:"Target"}),l.jsx(Oe.TopCell,{children:"Status"}),l.jsx(Oe.TopCell,{className:"text-center",children:"Items"}),l.jsx(Oe.TopCell,{className:"text-center",children:"Succeeded"}),l.jsx(Oe.TopCell,{className:"text-center",children:"Failed"}),l.jsx(Oe.TopCell,{className:"text-center",children:"Review"}),l.jsx(Oe.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(Oe.RowLink,{to:o.experimentLink(p.id),LinkComponent:c,children:[l.jsx(Oe.NameCell,{className:"font-mono",children:p.id.slice(0,8)}),l.jsx(Oe.TextCell,{children:h}),l.jsx(Oe.Cell,{children:l.jsxs("span",{className:"truncate",children:[p.targetType," ",p.targetId]})}),l.jsx(Oe.Cell,{children:l.jsx(Vk,{variant:pts[m]??"neutral",withDot:!0,children:m})}),l.jsx(Oe.TextCell,{className:"text-center",children:b}),l.jsx(Oe.TextCell,{className:"text-center",children:l.jsxs("span",{className:g>0?"text-accent1":"",children:[g," (",S,"%)"]})}),l.jsx(Oe.TextCell,{className:"text-center",children:l.jsx("span",{className:v>0?"text-accent2":"",children:v})}),l.jsx(Oe.Cell,{className:"text-center",children:(()=>{const w=n?.get(p.id);if(!w)return l.jsx("span",{className:"text-neutral2",children:"—"});const O=w.needsReview+w.complete;return O===0?l.jsx("span",{className:"text-neutral2",children:"—"}):w.needsReview>0?l.jsxs(Ct,{variant:"warning",children:[w.needsReview," pending"]}):l.jsxs(Ct,{variant:"success",children:[w.complete,"/",O," reviewed"]})})()}),l.jsx(Oe.TextCell,{children:fts(p.createdAt)})]},p.id)})]})}function mts(e){return[{value:"all",label:"All datasets"},...(e??[]).map(t=>({value:t.id,label:t.name}))]}const X5={completed:"#22c55e",running:"#facc15",pending:"#fb923c",failed:"#f87171"},gts=[{label:"Completed",color:X5.completed},{label:"Running",color:X5.running},{label:"Pending",color:X5.pending},{label:"Failed",color:X5.failed}];function vts({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(Xt,{children:[l.jsxs(Xt.TopBar,{children:[l.jsx(Xt.TitleAndDescription,{title:"Experiments by Dataset",description:"Experiment status breakdown per dataset."}),i&&l.jsx(Xt.Summary,{value:String(e?.length??0),label:"Total experiments"})]}),n?l.jsx(Xt.Loading,{}):r?l.jsx(Xt.Error,{message:"Failed to load experiments data"}):l.jsx(Xt.Content,{children:i?l.jsx(CT,{data:s,segments:gts,maxVal:a,fmt:o=>String(o)}):l.jsx(Xt.NoData,{message:"No experiments have been run yet"})})]})}const yts=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(di,{iconSlot:l.jsx(Yd,{}),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(he,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/evals/datasets/running-experiments",target:"_blank",rel:"noopener noreferrer",children:["Experiments Documentation ",l.jsx(Ba,{})]})})})});function bts({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(Fv,{label:"Search experiments",placeholder:"Filter by experiment, dataset, or target",value:e,onSearch:t}),l.jsxs(jr,{children:[l.jsx(Ic,{label:"Status",labelIsHidden:!0,name:"filter-status",options:[...dts],value:n,onValueChange:r,className:"whitespace-nowrap"}),l.jsx(Ic,{label:"Dataset",labelIsHidden:!0,name:"filter-dataset",options:i,value:s,onValueChange:a,className:"whitespace-nowrap"}),o&&c&&l.jsxs(he,{onClick:o,size:"sm",variant:"default",children:[l.jsx(Pr,{className:"size-3"})," Reset"]})]})]})}function xts(){const{data:e,isLoading:t,error:n}=Cp(),{data:r,isLoading:s,error:a}=Bv(),{data:i,isLoading:o,error:c}=BH(),{data:u,isLoading:d,isError:f,error:p}=vWr(),{data:h,isLoading:m,isError:g,error:v}=nEe(),b=r?.datasets,S=i?.experiments,w=y.useMemo(()=>Yes(h),[h]),O=n||a||c||p||v;return O&&Bs(O)?l.jsx(cr,{children:l.jsx(fa,{})}):O&&qs(O)?l.jsx(cr,{children:l.jsx(sa,{resource:"evaluation"})}):O?l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load evaluation data",message:O.message})}):l.jsx(Tn,{width:"wide",height:"full",children:l.jsxs("div",{className:"flex flex-col gap-6",children:[l.jsx(wfe,{children:l.jsx(uts,{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(oWr,{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(wJr,{experiments:S,isLoading:o,isError:!!c}),l.jsx(vts,{experiments:S,datasets:b,isLoading:o,isError:!!c})]}),l.jsx(Ges,{reviewSummary:h,experiments:S,datasets:b,isLoading:m,isError:!!g})]})})}function wts(){const[e,t]=y.useState(""),[n,r]=y.useState("all"),[s,a]=y.useState("all"),{data:i,isLoading:o,error:c}=Bv(),{data:u,isLoading:d,error:f}=BH(),{data:p}=nEe(),h=y.useMemo(()=>i?.datasets??[],[i?.datasets]),m=y.useMemo(()=>u?.experiments??[],[u?.experiments]),g=y.useMemo(()=>mts(h),[h]),v=y.useMemo(()=>pLt(p),[p]),b=o||d,S=f||c;if(S&&Bs(S))return l.jsx(cr,{children:l.jsx(fa,{})});if(f&&qs(f))return l.jsx(cr,{children:l.jsx(sa,{resource:"experiments"})});if(c&&qs(c))return l.jsx(cr,{children:l.jsx(sa,{resource:"datasets"})});if(S)return l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load experiments",message:S.message})});if(m.length===0&&!b)return l.jsx(cr,{children:l.jsx(yts,{})});const w=n!=="all"||s!=="all"||e!=="",O=()=>{t(""),r("all"),a("all")};return l.jsxs(Tn,{children:[l.jsx(Tn.TopArea,{children:l.jsx(bts,{search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r,datasetFilter:s,onDatasetFilterChange:a,datasetOptions:g,onReset:O,hasActiveFilters:w})}),l.jsx(hts,{experiments:m,datasets:h,reviewByExperiment:v,isLoading:b,search:e,statusFilter:n,datasetFilter:s})]})}function Sts(){const{experimentId:e}=Mr(),{data:t,isLoading:n}=BH(),s=t?.experiments?.find(h=>h.id===e)?.datasetId??"",{data:a,isLoading:i,error:o}=y7(s,e??""),{data:c,isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:p}=FH({datasetId:s,experimentId:e??"",experimentStatus:a?.status});return e?n||i||!s?l.jsx(pr,{children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(tn,{})})}):o&&Bs(o)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})}):o&&qs(o)?l.jsx(pr,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"datasets"})})}):o||!a?l.jsx(pr,{children:l.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",o instanceof Error?o.message:"Unknown error"]})}):l.jsx(pr,{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(fLt,{experimentId:e,experiment:a}),l.jsx(dLt,{experimentId:e,experimentStatus:a?.status,results:c??[],isLoading:u,setEndOfListElement:d,isFetchingNextPage:f,hasNextPage:p})]})})}):null}function hLt({redirectUri:e,onSuccess:t,initialMode:n="signin",errorMessage:r}){const{data:s,isLoading:a}=oI(),{mutate:i,isPending:o,error:c}=_Kr(),{mutate:u,isPending:d,error:f}=CKr(),{mutate:p,isPending:h}=X3t(),[m,g]=y.useState(n),[v,b]=y.useState(""),[S,w]=y.useState(""),[O,E]=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:_}=s,C=_.type==="sso"||_.type==="both",j=_.type==="credentials"||_.type==="both",I=_.sso,N=_.signUpEnabled!==!1,R=m==="signin"||!N,P=R?o:d,B=R?c:f,M=()=>{t?t():e?window.location.href=e:window.location.href="/"},L=U=>{U.preventDefault(),R?i({email:S,password:O},{onSuccess:M}):u({email:S,password:O,name:v||void 0},{onSuccess:M})},F=()=>{p({redirectUri:e},{onSuccess:U=>{window.location.href=U.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(sb,{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"})]}),_.description&&l.jsxs("div",{className:"flex items-start gap-2.5 rounded-md border border-border1 bg-surface1 p-3",children:[l.jsx(qet,{className:"mt-0.5 h-4 w-4 shrink-0 text-neutral4"}),l.jsx("p",{className:"text-sm text-neutral3",children:_.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(On,{id:"name",type:"text",value:v,onChange:U=>b(U.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(On,{id:"email",type:"email",value:S,onChange:U=>w(U.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(On,{id:"password",type:"password",value:O,onChange:U=>E(U.target.value),placeholder:R?"Enter your password":"Create a password",required:!0,variant:"default",size:"lg"})]}),B&&l.jsx("div",{className:"rounded-md bg-red-500/10 p-3 text-sm text-red-400",children:B.message}),l.jsx(he,{type:"submit",disabled:P,className:"w-full",size:"lg",children:P?R?"Signing in...":"Creating account...":R?"Sign in":"Create account"}),N&&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"})]})]}),C&&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"})})]}),C&&I&&l.jsxs(he,{onClick:F,disabled:h,className:"w-full",size:"lg",variant:"outline",children:[I.icon&&l.jsx("span",{className:"mr-2",children:I.icon}),h?"Redirecting...":I.text||"Sign in"]})]})})}function kts(){const[e]=xo(),t=ku(),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(hLt,{redirectUri:n,onSuccess:i,initialMode:s,errorMessage:a})}function Ots(){const[e,t]=xo(),n=msr(e,t),r=ysr(e,t),[s,a]=y.useState(),[i,o]=y.useState(!1),{data:c=[],isPending:u}=Mwe(),{data:d=[],isPending:f}=$we({entityType:n.selectedEntityOption?.entityType,rootOnly:!0}),{data:p=[],isPending:h}=Dwe(),{data:m=[],isPending:g}=Lwe(),v=y.useMemo(()=>znr({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(()=>qnr({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:O,isFetchingNextPage:E,hasNextPage:_,setEndOfListElement:C}=psr({filters:b}),{logIdMap:j,featuredLog:I,handleLogClick:N,handlePreviousLog:R,handleNextLog:P}=wsr(S,n.featuredLogId,n.handleFeaturedChange,n.featuredTraceId),{data:B,isLoading:M}=Pwe(n.featuredTraceId??null),{data:L,isLoading:F}=Hk(n.featuredTraceId??"",n.featuredSpanId??""),z=y.useCallback(()=>n.applyFilterTokens(Vnr(v,n.filterTokens)),[v,n]),U=y.useCallback(()=>n.handleFeaturedChange({logId:null}),[n]),H=y.useCallback(K=>n.handleFeaturedChange({traceId:K,spanId:null}),[n]),D=y.useCallback((K,ne)=>n.handleFeaturedChange({traceId:K,spanId:ne}),[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]),Z=l.jsxs(Tn.TopArea,{children:[l.jsx(Tn.Row,{children:l.jsxs(Tn.Column,{className:"flex flex-wrap items-start justify-start gap-2",children:[l.jsx(_we,{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(hwe,{fields:v,tokens:n.filterTokens,onTokensChange:n.handleFilterTokensChange,disabled:w,onStartTextFilter:a})]})}),l.jsx(asr,{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(O)return l.jsxs(Tn,{width:"wide",height:"full",children:[Z,l.jsx(Tn.MainArea,{isCentered:!0,children:l.jsx(esr,{error:O,resource:"logs",errorTitle:"Failed to load logs"})})]});const G=!!n.selectedEntityOption||n.filterTokens.length>0;return S.length===0&&!w&&!G?l.jsxs(Tn,{width:"wide",height:"full",children:[Z,l.jsx(Tn.MainArea,{isCentered:!0,children:l.jsx(csr,{datePreset:n.datePreset,dateFrom:n.selectedDateFrom,dateTo:n.selectedDateTo})})]}):l.jsxs(Tn,{width:"wide",height:"full",children:[Z,l.jsx(tsr,{logCollapsed:i,listSlot:l.jsx(ssr,{logs:S,isLoading:w,isFetchingNextPage:E,hasNextPage:_,setEndOfListElement:C,logIdMap:j,featuredLogId:n.featuredLogId,onLogClick:N}),logPanelSlot:I?l.jsx(Jrr,{log:I,onClose:U,onTraceClick:H,onSpanClick:D,onPrevious:R,onNext:P,collapsed:i,onCollapsedChange:o}):null,tracePanelSlot:n.featuredTraceId?l.jsx(_rr,{traceId:n.featuredTraceId,spans:B?.spans,isLoading:M,onClose:Y,onSpanSelect:$,selectedSpanId:n.featuredSpanId}):null,spanPanelSlot:n.featuredTraceId&&n.featuredSpanId?l.jsx(Orr,{spanId:n.featuredSpanId,span:L?.span,isLoading:F,onClose:V}):null})]})}function _ts({server:e}){const{paths:t,Link:n}=dn(),s=We().options.baseUrl,a=s?`${s}/api/mcp/${e.id}/sse`:"",{data:i}=YDt(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(Oe.RowLink,{to:t.mcpServerLink(e.id),LinkComponent:n,children:[l.jsx(Oe.NameCell,{children:f}),l.jsx(Oe.DescriptionCell,{children:a}),l.jsx(Oe.TextCell,{className:"text-center",children:u||""}),l.jsx(Oe.TextCell,{className:"text-center",children:c||""}),l.jsx(Oe.TextCell,{className:"text-center",children:d||""})]})}function Ets({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(Bd,{columns:"auto 1fr auto auto auto"}):l.jsxs(Oe,{columns:"auto 1fr auto auto auto",children:[l.jsxs(Oe.Top,{children:[l.jsx(Oe.TopCell,{children:"Name"}),l.jsx(Oe.TopCell,{children:"URL"}),l.jsx(Oe.TopCellSmart,{long:"Agents",short:l.jsx(Ll,{}),tooltip:"Agent Tools",className:"text-center"}),l.jsx(Oe.TopCellSmart,{long:"Tools",short:l.jsx(vu,{}),tooltip:"Tools",className:"text-center"}),l.jsx(Oe.TopCellSmart,{long:"Workflows",short:l.jsx(yu,{}),tooltip:"Workflow Tools",className:"text-center"})]}),r.length===0&&n?l.jsx(Oe.NoMatch,{message:"No MCP Servers match your search"}):null,r.map(s=>l.jsx(_ts,{server:s},s.id))]})}const Cts=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(di,{iconSlot:l.jsx(Yd,{}),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(he,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",children:["MCP Documentation ",l.jsx(Ba,{})]})})}),Tts=()=>{const{data:e=[],isLoading:t,error:n}=OH(),[r,s]=y.useState("");return n&&Bs(n)?l.jsx(cr,{children:l.jsx(fa,{})}):n&&qs(n)?l.jsx(cr,{children:l.jsx(sa,{resource:"MCP servers"})}):n?l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load MCP servers",message:n.message})}):e.length===0&&!t?l.jsx(cr,{children:l.jsx(Cts,{})}):l.jsxs(Tn,{children:[l.jsx(Tn.TopArea,{children:l.jsx("div",{className:"max-w-120",children:l.jsx(Fv,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})}),l.jsx(Ets,{mcpServers:e,isLoading:t,search:r})]})},jts=(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 Its({tools:e,agents:t,isLoading:n,search:r=""}){const{paths:s,Link:a}=dn(),i=y.useMemo(()=>jts(e,t),[e,t]),o=y.useMemo(()=>i.filter(c=>c.id.toLowerCase().includes(r.toLowerCase())),[i,r]);return n?l.jsx(Bd,{columns:"auto 1fr auto"}):l.jsxs(Oe,{columns:"auto 1fr auto",children:[l.jsxs(Oe.Top,{children:[l.jsx(Oe.TopCell,{children:"Name"}),l.jsx(Oe.TopCell,{children:"Description"}),l.jsx(Oe.TopCellSmart,{long:"Agents",short:l.jsx(Ll,{}),tooltip:"Attached Agents",className:"text-center"})]}),o.length===0&&r?l.jsx(Oe.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(Oe.RowLink,{to:s.toolLink(c.id),LinkComponent:a,children:[l.jsx(Oe.NameCell,{children:u}),l.jsx(Oe.DescriptionCell,{children:d}),l.jsx(Oe.TextCell,{className:"text-center",children:f||""})]},c.id)})]})}const Nts=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(di,{iconSlot:l.jsx(Yd,{}),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(he,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",children:["Tools Documentation ",l.jsx(Ba,{})]})})}),Ats=()=>{const e=We();return ar({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 Be.error("Error executing dev tool"),console.error("Error executing dev tool:",a),a}}})},Rts=({toolId:e})=>{const{canExecute:t}=Xb(),n=t("tools"),{data:r={}}=Zv(),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}=JGr(e,{enabled:!s}),c=s||a,{mutateAsync:u,isPending:d,data:f}=Ats(),{requestContext:p}=Vs();y.useEffect(()=>{if(o){const g=o instanceof Error?o.message:"Failed to load tool";Be.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?Cv(Ov(_b(c?.inputSchema))):fs({});return i?l.jsxs("div",{className:"p-6",children:[l.jsx(ns,{className:"h-8 w-48 mb-4"}),l.jsx(ns,{className:"h-32 w-full"})]}):o?null:c?n?l.jsx(U_e,{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(be,{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(be,{variant:"header-md",className:"text-neutral3",children:"Tool not found"})})};function Pts({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}=LH(),{data:p={},isLoading:h,isError:m,error:g}=Zv(),{navigate:v,paths:b}=dn();y.useEffect(()=>{if(d){const E=f instanceof Error?f.message:"Failed to load tools";Be.error(`Error loading tools: ${E}`)}},[d,f]),y.useEffect(()=>{if(m){const E=g instanceof Error?g.message:"Failed to load agents";Be.error(`Error loading agents: ${E}`)}},[m,g]);const S=new Map;Object.values(p).forEach(E=>{E.tools&&Object.values(E.tools).forEach(_=>{S.has(_.id)||S.set(_.id,_)})}),Object.values(c).forEach(E=>{S.has(E.id)||S.set(E.id,E)});const w=Array.from(S.values()).map(E=>({label:E.id,value:E.id})),O=E=>{t?t(E):E&&E!==e&&v(b.toolLink(E))};return l.jsx(Nc,{options:w,value:e,onValueChange:O,placeholder:u||h?"Loading tools...":n,searchPlaceholder:r,emptyText:s,className:a,disabled:i||u||h||d||m,variant:o})}const Mts=({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(Oh,{children:l.jsx(be,{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(Oh,{isDivided:!0,children:[l.jsxs("div",{className:"px-8 py-12 mx-auto max-w-2xl w-full",children:[l.jsx(be,{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(Ct,{icon:l.jsx(Eq,{className:"text-neutral6"}),className:"rounded-r-sm text-neutral4!",children:"Version"}),l.jsx(Ct,{className:"rounded-l-sm text-neutral4!",children:t.version_detail.version})]}),l.jsx(be,{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(Ct,{icon:l.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"HTTP"}),children:"Regular HTTP Endpoint"}),l.jsx(be,{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(be,{className:"px-2 py-1 bg-surface4 rounded-lg",children:r}),l.jsx("div",{className:"pt-1",children:l.jsx(ua,{tooltip:"Copy HTTP Stream URL",content:r})})]})]}),l.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[l.jsx(Ct,{icon:l.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"SSE"}),children:"Server-Sent Events"}),l.jsx(be,{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(be,{className:"px-2 py-1 bg-surface4 rounded-lg",children:n}),l.jsx("div",{className:"pt-1",children:l.jsx(ua,{tooltip:"Copy SSE URL",content:n})})]})]}),l.jsxs("div",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:[l.jsx(Ct,{icon:l.jsx("span",{className:"font-mono w-6 text-accent1 font-medium mr-1",children:"CLI"}),children:"Command Line"}),l.jsx(be,{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(be,{className:"px-2 py-1 bg-surface4 rounded-lg",children:a}),l.jsx("div",{className:"pt-1",children:l.jsx(ua,{tooltip:"Copy Command Line Config",content:a})})]})]})]})]}),l.jsx("div",{className:"h-full overflow-y-scroll border-l border-border1",children:l.jsx($ts,{server:t})})]})},$ts=({server:e})=>{const{data:t={},isLoading:n}=YDt(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(Ve,{size:"lg",className:"bg-surface4 rounded-md p-1",children:l.jsx(kv,{})}),l.jsx(be,{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(Lts,{tool:a,serverId:e.id},s)})})]})};function Dts(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 Lts=({tool:e,serverId:t})=>{const n=y.useRef(null),{Link:r,paths:s}=dn(),a=n3t[e.toolType||"tool"],i=Dts(e._meta);return l.jsxs(vp,{onClick:()=>n.current?.click(),children:[l.jsx(xwt,{children:l.jsx(a,{className:"group-hover/entity:text-accent6"})}),l.jsxs(xp,{children:[l.jsx(yp,{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(Ct,{className:"text-[10px] py-0",children:"App"})]})}),l.jsx(bp,{children:e.description})]})]})},zts=()=>{const{serverId:e}=Mr(),{data:t=[],isLoading:n}=OH(),r=t.find(s=>s.id===e);return l.jsx("div",{className:"h-full w-full overflow-hidden",children:l.jsx(Mts,{isLoading:n,server:r})})};function Fts(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 Bts=({toolId:e,serverId:t})=>{const{canExecute:n}=Xb(),r=n("tools"),s=We(),{data:a,isLoading:i,error:o}=u_e(t,e),{mutateAsync:c,isPending:u,data:d}=nzr(t,e),f=a?Fts(a._meta):void 0,{data:p}=Et({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";Be.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(ns,{className:"h-8 w-48 mb-4"}),l.jsx(ns,{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(be,{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(be,{variant:"ui-sm",className:"text-neutral3",children:"You don't have permission to execute tools."})});let g;try{g=Cv(Ov(a.inputSchema))}catch(v){console.error("Error processing input schema:",v),Be.error("Failed to process tool input schema."),g=fs({})}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(QDt,{html:p,toolName:a.name??a.id,onToolCall:h})}),l.jsx(U_e,{executionResult:d,isExecutingTool:u,zodInputSchema:g,handleExecuteTool:m,toolDescription:a.description||"",toolId:a.id})]})},Uts=()=>{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(Bts,{toolId:t,serverId:e})})},KXe={agents:na.AGENT,workflows:na.WORKFLOW_RUN,tools:na.TOOL};function qts(){const{data:e,isLoading:t,isError:n}=Cnr(),{getTracesHref:r,getBucketTracesHref:s}=nD(),{Link:a}=dn(),i=ku();return l.jsx(gnr,{data:e,isLoading:t,isError:n,onPointClick:(o,c)=>{const u=new Date(String(c.rawTimestamp)).getTime();Number.isFinite(u)&&i(s({rootEntityType:KXe[o]},u,"1h"))},actions:o=>l.jsx(Fq,{href:r({rootEntityType:KXe[o]}),LinkComponent:a})})}function Vts(){const e=Anr(),t=Rnr(),{getTracesHref:n}=nD(),{Link:r}=dn();return l.jsx(ynr,{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 Hts(){const{data:e,isLoading:t,isError:n}=gSt();return l.jsx(J$,{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 Zts(){const{data:e,isLoading:t,isError:n}=Onr();return l.jsx(J$,{label:"Total Model Cost",value:e?.cost!=null?ab(e.cost,e.costUnit):null,prevValue:e?.previousCost!=null?ab(e.previousCost,e.costUnit):void 0,changePct:e?.costChangePercent??null,isLoading:t,isError:n})}function Wts(){const{data:e,isLoading:t,isError:n}=_nr();return l.jsx(J$,{label:"Total Tokens",value:e?.value!=null?au(e.value):null,prevValue:e?.previousValue!=null?au(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:n})}function Gts(){const{data:e,isLoading:t,isError:n}=Inr();return l.jsx(J$,{label:"Total Threads",value:e?.value!=null?au(e.value):null,prevValue:e?.previousValue!=null?au(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:n})}function Qts(){const{data:e,isLoading:t,isError:n}=Nnr();return l.jsx(J$,{label:"Total Resources",value:e?.value!=null?au(e.value):null,prevValue:e?.previousValue!=null?au(e.previousValue):void 0,changePct:e?.changePercent??null,isLoading:t,isError:n})}function Yts({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=>Xts(f,a));return l.jsxs("div",{className:X("grid grid-cols-[1fr_auto] gap-3 items-start"),children:[l.jsx(pwe,{fields:a,tokens:i,onTokensChange:o,disabled:s,autoFocusFieldId:c}),u&&l.jsx(dwe,{disabled:s,onClear:d?e:void 0,onRemoveAll:t,onSave:n,onRemoveSaved:r})]})}function Xts(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 Kts(){const{data:e,isLoading:t,isError:n}=Enr(),{getTracesHref:r}=nD(),{Link:s}=dn();return l.jsx(bnr,{rows:e,isLoading:t,isError:n,LinkComponent:s,getRowHref:()=>r({rootEntityType:na.AGENT}),actions:l.jsx(Fq,{href:r({rootEntityType:na.AGENT}),LinkComponent:s})})}function Jts(){const{data:e,isLoading:t,isError:n}=jnr(),{getTracesHref:r}=nD(),{Link:s}=dn();return l.jsx(wnr,{data:e,isLoading:t,isError:n,LinkComponent:s,getRowHref:a=>r({rootEntityType:na.AGENT,entityName:a.name}),actions:l.jsx(Fq,{href:r({rootEntityType:na.AGENT}),LinkComponent:s})})}const K5={agents:na.AGENT,workflows:na.WORKFLOW_RUN,tools:na.TOOL};function ens(){const{data:e,isLoading:t,isError:n}=Tnr(),{getTracesHref:r,getLogsHref:s}=nD(),{Link:a}=dn();return l.jsx(Snr,{data:e,isLoading:t,isError:n,LinkComponent:a,getRowHref:(i,o)=>r({rootEntityType:K5[i],entityName:o.name}),getErrorSegmentHref:(i,o)=>o.errors>0?s({rootEntityType:K5[i],entityName:o.name,status:"error"}):void 0,actions:i=>l.jsxs(l.Fragment,{children:[l.jsx(Fq,{href:r({rootEntityType:K5[i]}),LinkComponent:a}),l.jsx(hnr,{href:s({rootEntityType:K5[i],status:"error"}),LinkComponent:a})]})})}const tns=new Set(["ObservabilityStorageClickhouseVNext","ObservabilityStorageDuckDB","ObservabilityInMemory"]),dle="period",J5="dateFrom",e6="dateTo";function nns(){const[e,t]=xo(),n=e.get(dle),r=onr(n)?n:"24h",s=y.useMemo(()=>{if(r!=="custom")return;const d=h=>{if(!h)return;const m=new Date(h);return Number.isNaN(m.getTime())?void 0:m},f=d(e.get(J5)),p=d(e.get(e6));if(!(!f&&!p))return{from:f,to:p}},[r,e.toString()]),a=y.useMemo(()=>enr(e),[e.toString()]),i=y.useCallback(d=>{t(f=>{const p=new URLSearchParams(f);return d==="24h"?p.delete(dle):p.set(dle,d),d!=="custom"&&(p.delete(J5),p.delete(e6)),p},{replace:!0})},[t]),o=y.useCallback(d=>{t(f=>{const p=new URLSearchParams(f);return d?.from?p.set(J5,d.from.toISOString()):p.delete(J5),d?.to?p.set(e6,d.to.toISOString()):p.delete(e6),p},{replace:!0})},[t]),c=y.useCallback(d=>{t(f=>{const p=new URLSearchParams(f);return nnr(p,d),p},{replace:!0})},[t]),u=y.useRef(!1);return y.useEffect(()=>{if(u.current||(u.current=!0,Ktr(e)))return;const d=pSt();d&&t(f=>{const p=new URLSearchParams(f);for(const[h,m]of d)p.append(h,m);return p},{replace:!0})},[]),l.jsx(cnr,{preset:r,filterTokens:a,onPresetChange:i,onFilterTokensChange:c,customRange:s,onCustomRangeChange:o,children:l.jsx(rns,{})})}function rns(){const[e]=xo(),{error:t,isLoading:n}=gSt(),{filterTokens:r,setFilterTokens:s}=zq(),[a,i]=y.useState(),{data:o,isLoading:c}=NH(),u=o?.observabilityStorageType,d=u?tns.has(u):!1,f=u==="ObservabilityInMemory",{data:p,isLoading:h}=Mwe(),{data:m,isLoading:g}=$we(),{data:v,isLoading:b}=Lwe(),{data:S,isLoading:w}=Dwe(),O=y.useMemo(()=>Jtr({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]),[E,_]=y.useState(()=>pSt()!==null),C=y.useCallback(()=>{Ytr(e),_(!0),Be.success("Filters setting for Metrics saved")},[e]),j=y.useCallback(()=>{Xtr(),_(!1),Be.success("Filters setting for Metrics cleared up")},[]),I=y.useCallback(()=>{s([])},[s]),N=y.useCallback(()=>{const R=r.map(P=>{const B=O.find(M=>M.id===P.fieldId);return B?B.kind==="text"?{fieldId:P.fieldId,value:""}:B.kind==="pick-multi"?B.multi?{fieldId:P.fieldId,value:[]}:{fieldId:P.fieldId,value:"Any"}:B.kind==="multi-select"?{fieldId:P.fieldId,value:[]}:P:P});s(R)},[O,r,s]);return t&&Bs(t)?l.jsx(cr,{children:l.jsx(fa,{})}):t&&qs(t)?l.jsx(cr,{children:l.jsx(sa,{resource:"metrics"})}):t?l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load metrics",message:t.message})}):l.jsxs(Tn,{width:"wide",height:"full",children:[l.jsxs(Tn.TopArea,{children:[l.jsx(Tn.Row,{children:l.jsxs(Tn.Column,{className:"flex flex-wrap items-start justify-start gap-2",children:[l.jsx(pnr,{}),l.jsx(hwe,{fields:O,tokens:r,onTokensChange:s,disabled:n,onStartTextFilter:i})]})}),l.jsx(Yts,{isLoading:n,filterFields:O,filterTokens:r,onFilterTokensChange:s,onClear:N,onRemoveAll:I,onSave:C,onRemoveSaved:E?j:void 0,autoFocusFilterFieldId:a})]}),c?null:d?l.jsxs("div",{className:"grid gap-8 content-start pb-10",children:[f&&l.jsx(Qn,{variant:"info",title:"Metrics are not persisted",children:l.jsx(Qn.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(wfe,{children:[l.jsx(Hts,{}),l.jsx(Zts,{}),l.jsx(Wts,{}),l.jsx(Gts,{}),l.jsx(Qts,{})]}),l.jsxs(wfe,{children:[l.jsx(Kts,{}),l.jsx(Jts,{}),l.jsx(Vts,{}),l.jsx(ens,{}),l.jsx(qts,{})]})]}):l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(di,{iconSlot:l.jsx(Yd,{}),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(he,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/observability/metrics/overview",target:"_blank",rel:"noopener noreferrer",children:["Metrics Documentation ",l.jsx(Ba,{})]})})})]})}function sns(){const{paths:e}=dn(),{data:t,isLoading:n,error:r}=c3t(),{isCmsAvailable:s}=o4(),[a,i]=y.useState(""),o=t?.promptBlocks??[];return r&&Bs(r)?l.jsx(cr,{children:l.jsx(fa,{})}):r&&qs(r)?l.jsx(cr,{children:l.jsx(sa,{resource:"prompt blocks"})}):r?l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load prompt blocks",message:r.message})}):o.length===0&&!n?l.jsx(cr,{children:l.jsx(qGr,{})}):l.jsxs(Tn,{children:[l.jsx(Tn.TopArea,{children:l.jsxs(Tn.Row,{align:"center",stack:"responsive",children:[l.jsx("div",{className:"max-w-120 flex-1",children:l.jsx(Fv,{onSearch:i,label:"Filter prompts",placeholder:"Filter by name or description"})}),s&&l.jsxs(he,{as:$o,to:e.cmsPromptBlockCreateLink(),variant:"primary",className:"shrink-0",children:[l.jsx(Cs,{}),"Create Prompt"]})]})}),l.jsx(UGr,{promptBlocks:o,isLoading:n,search:a})]})}function ans(){return l.jsx(Tn,{width:"narrow",children:l.jsx(Tn.MainArea,{children:l.jsx(ZHr,{children:l.jsx(z4t,{})})})})}const ins=[{title:"Mastra APIs",description:"Explore and test the available REST API endpoints with the interactive Swagger UI.",icon:IWt,href:"/swagger-ui",external:!1},{title:"Documentation",description:"Read the official Mastra documentation for guides, references, and tutorials.",icon:Cet,href:"https://mastra.ai/en/docs",external:!0},{title:"Github",description:"Browse the source code, report issues, and contribute to the Mastra project.",icon:Ba,href:"https://github.com/mastra-ai/mastra",external:!0},{title:"Community",description:"Join the Mastra Discord community for help, discussion, and collaboration.",icon:uP,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:Det,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:kZt,href:"https://mastra.ai/contact?ref=studio",external:!0}];function ons(){return l.jsx(Tn,{width:"narrow",children:l.jsx(Tn.MainArea,{children:l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-3xl",children:ins.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(Ba,{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 lns(){const{data:e={},isLoading:t,error:n}=Cp(),[r,s]=y.useState(""),[a,i]=y.useState("all");if(n&&Bs(n))return l.jsx(cr,{children:l.jsx(fa,{})});if(n&&qs(n))return l.jsx(cr,{children:l.jsx(sa,{resource:"scorers"})});if(n)return l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load scorers",message:n.message})});if(Object.keys(e).length===0&&!t)return l.jsx(cr,{children:l.jsx(cWr,{})});const o=a!=="all"||r!=="",c=()=>{s(""),i("all")};return l.jsxs(Tn,{children:[l.jsx(Tn.TopArea,{children:l.jsx(dWr,{search:r,onSearchChange:s,sourceFilter:a,onSourceFilterChange:i,onReset:c,hasActiveFilters:o})}),l.jsx(lWr,{scorers:e,isLoading:t,search:r,sourceFilter:a})]})}function cns(){const{scorerId:e}=Mr(),[t,n]=xo(),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}=aWr(e),{data:d={},isLoading:f,error:p}=Zv(),{isLoading:h,error:m}=Kw(),{data:g=[],isLoading:v,error:b,isFetchingNextPage:S,hasNextPage:w,setEndOfListElement:O}=sWr({scorerId:e,entityId:i?.value==="all"?void 0:i?.value,entityType:i?.type==="ALL"?void 0:i?.type}),E=y.useMemo(()=>c?.agentIds?.filter(H=>d[H]).map(H=>({value:H,label:d[H].name,type:"AGENT"}))||[],[c?.agentIds,d]),_=y.useMemo(()=>c?.workflowIds?.map(H=>({value:H,label:H,type:"WORKFLOW"}))||[],[c?.workflowIds]),C=y.useMemo(()=>[{value:"all",label:"All Entities",type:"ALL"},...E,..._],[E,_]),j=t.get("entity")??"all",I=C.find(H=>H.value===j);I&&I.value!==i?.value&&o(I),y.useEffect(()=>{if(u){const H=u instanceof Error?u.message:"Failed to load scorer";Be.error(`Error loading scorer: ${H}`)}},[u]),y.useEffect(()=>{if(p){const H=p instanceof Error?p.message:"Failed to load agents";Be.error(`Error loading agents: ${H}`)}},[p]),y.useEffect(()=>{if(m){const H=m instanceof Error?m.message:"Failed to load workflows";Be.error(`Error loading workflows: ${H}`)}},[m]);const N=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=Bs(u)||Bs(p)||Bs(m),B=u&&qs(u),M=!P&&!B&&(u||p||m),L=!v&&g.length===0,F=i?.value!=="all",z=c?.scorer?.source==="stored"?l.jsx(Uv,{owner:"scorer-detail",children:l.jsxs(he,{variant:"default",as:$o,to:`/cms/scorers/${e}/edit`,size:"sm",children:[l.jsx(Rb,{})," Edit"]})}):null;if(P||B||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(Tn,{width:"wide",height:"full",children:[z,l.jsx(Tn.MainArea,{isCentered:!0,children:P?l.jsx(fa,{}):B?l.jsx(sa,{resource:"scorers"}):M?l.jsx(rc,{title:"Failed to load scorer",message:H}):l.jsx(XZr,{})})]})}return l.jsxs(Tn,{width:"wide",children:[z,l.jsx(Tn.TopArea,{children:l.jsx(eWr,{selectedEntity:i,entityOptions:C,onEntityChange:N,onReset:()=>{n(H=>{const D=new URLSearchParams(H);return D.set("entity","all"),D})},isLoading:v||f||h})}),l.jsx(YZr,{scores:g,isLoading:v,selectedScoreId:s,isFetchingNextPage:S,hasNextPage:w,setEndOfListElement:O,onScoreClick:R,errorMsg:b?.message})]})}const mLt=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],uns=e=>mLt.some(t=>t.value===e),dns=()=>{const{baseUrl:e,headers:t,apiPrefix:n}=N_e(),{theme:r,setTheme:s}=tI();return l.jsx(Tn,{width:"narrow",children:l.jsxs(Tn.MainArea,{className:"flex flex-col gap-5 mt-6",children:[l.jsx(g6e,{title:"Theme",description:"Customize the appearance of the studio.",children:l.jsx(NKn,{label:"Theme mode",htmlFor:"theme",children:l.jsxs(fi,{value:r,onValueChange:a=>{uns(a)&&s(a)},children:[l.jsx(Ka,{id:"theme",className:"w-full sm:w-48",children:l.jsx(pi,{})}),l.jsx(Ja,{children:mLt.map(a=>l.jsx(os,{value:a.value,children:a.label},a.value))})]})})}),l.jsx(g6e,{title:"Mastra Connection",description:"Configure the Mastra instance URL, API prefix, and request headers used by the studio.",children:l.jsx(U4t,{initialConfig:{baseUrl:e,headers:t,apiPrefix:n}})})]})})};function fns(){const[e]=xo(),t=ku(),n=e.get("redirect")||"/",r=()=>{n.startsWith("http")?window.location.href=n:t(n,{replace:!0})};return l.jsx(hLt,{redirectUri:n,onSuccess:r,initialMode:"signup"})}function pns(e){return e.replace(/\/$/,"").split("/").pop()}function qH({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 hns({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(Ll,{})," ",a.agents.length]}),a?.tools&&a.tools.length>0&&l.jsxs("li",{children:[l.jsx(vu,{})," ",a.tools.length]}),a?.networks&&a.networks.length>0&&l.jsxs("li",{children:[l.jsx(Zet,{})," ",a.networks.length]}),a?.workflows&&a.workflows.length>0&&l.jsxs("li",{children:[l.jsx(D7,{})," ",a.workflows.length]}),a?.mcp&&a.mcp.length>0&&l.jsxs("li",{children:[l.jsx(kv,{})," ",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(hwt,{})," ",pns(a.githubUrl)]})})]},a.slug)})})}function mns({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(fw,{name:"search-templates",label:"Search templates",labelIsHidden:!0,value:i,onChange:f=>o?.(f.target.value),placeholder:"Search Template"}),l.jsx(Ic,{label:"Filter by tag",labelIsHidden:!0,name:"filter-tag",value:t,onValueChange:s,options:e}),l.jsx(Ic,{label:"Filter by provider",labelIsHidden:!0,name:"filter-provider",value:r,onValueChange:a,options:n}),c&&l.jsxs(he,{onClick:c,children:["Reset ",l.jsx(Pr,{})]})]})}function gns(){const{data:e,isLoading:t}=Dsr(),{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(pr,{children:[l.jsx(iwe,{children:l.jsxs(wwt,{children:[l.jsx(Ve,{children:l.jsx(BS,{})}),"Templates"]})}),l.jsxs("div",{className:X("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[l.jsx(mns,{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(hns,{templates:v,linkComponent:$o,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const vns="1.36.1-alpha.0";function yns({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(Xy,{className:"text-yellow-500"}),title:"Template Installed with Warnings"}:{icon:l.jsx(rGt,{}),title:"Template Installation Failed"},{icon:o,title:c}=i();return l.jsxs(qH,{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 bns({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(qH,{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(Wet,{})]}),l.jsx(Ic,{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(tn,{})," Loading variables..."]}):Object.entries(r).map(([p,h])=>l.jsxs(y.Fragment,{children:[l.jsx(qk,{name:`env-${p}`,labelIsHidden:!0,label:"Key",value:p,disabled:!0,className:"w-full"}),l.jsx(qk,{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(F4t,{defaultProvider:u||"",defaultModel:d||"",updateModel:f||(()=>Promise.resolve({message:"Updated"})),closeEditor:()=>{},autoSave:!0,selectProviderPlaceholder:"Provider"})]})]}),t&&!o&&l.jsx(he,{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(tn,{className:"w-4 h-4"})," Installing..."]}):l.jsxs(l.Fragment,{children:["Install ",l.jsx(FS,{})]})})]})})}function xns({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(BS,{}),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(Rw,{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(P7,{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(hwt,{}),n?.split("/")?.pop()]})]}),s&&l.jsx(RO,{data:s,labelsAreHidden:!0,isLoading:r})]})]})}function wns({name:e,streamResult:t,runId:n,workflowInfo:r}){const s=t?.phase||"initializing",a=t?.payload?.workflowState,i=t?.payload?.currentStep,o=t?.error,c=a?.steps||{},u=Object.keys(c).length>0,d=g=>g==="input"||g.endsWith(".input")||g.startsWith("Mapping_")&&/[0-9a-f]{8}/.test(g)||/[0-9a-f]{8,}/.test(g)?!1:r?.allSteps?g in r.allSteps:!0,f=Object.entries(c).filter(([g,v])=>d(g)),p=f.length,h=()=>{switch(s){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..."}},m=f.map(([g,v])=>({id:g,status:v?.status,description:v?.description,title:g.charAt(0).toUpperCase()+g.slice(1).replace(/-/g," "),isActive:i?.id===g}));return l.jsxs(qH,{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:h()}),(t?.runId||n)&&l.jsxs("div",{className:"mt-2 text-ui-sm text-neutral3",children:["Run ID: ",t?.runId??n]})]}),u&&p>0&&!["error"].includes(s)&&l.jsx("div",{className:"max-w-[30rem] w-full mx-auto px-6",children:l.jsx(HKn,{steps:m})}),o&&s==="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(WGt,{}),o||"Something went wrong"]}),u&&l.jsx(VKn,{steps:m,currentStep:i,className:"pb-4"}),!u&&s==="initializing"&&l.jsxs("div",{className:"text-center text-sm text-neutral3 grid gap-4 justify-items-center",children:[l.jsx(tn,{}),l.jsx("p",{children:"This may take some time..."})]})]})}function Sns({name:e,installedEntities:t}){return l.jsxs(qH,{className:X("grid items-center justify-items-center gap-4 content-center","[&>svg]:w-8 [&>svg]:h-8"),children:[l.jsx(Wet,{}),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(RO,{data:t})]})}function kns(){const{templateSlug:e}=Mr(),[t,n]=xo(),[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,O]=y.useState(!1),[E,_]=y.useState(!1),[C,j]=y.useState([]),{data:I,isLoading:N}=Lsr({repoOrSlug:e,owner:"mastra-ai"}),P=vns?.includes("beta")??!1?"beta":"main",{data:B,isLoading:M}=zsr({repo:I?.githubUrl?new URL(I.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:P}),{data:L,isLoading:F}=Fsr(),{mutateAsync:z,isPending:U}=Bsr(),{mutateAsync:H}=Usr(),{streamInstall:D,streamResult:Y,isStreaming:V}=Vsr(L),{observeInstall:$,streamResult:Z,isStreaming:G}=Hsr(L);y.useEffect(()=>{const te=t.get("runId");te&&!g&&!h&&!V&&!G&&(console.info("🔄 Checking completed run after hot reload:",{runId:te}),S(te),H({runId:te}).then(le=>{const fe=le.snapshot;if(fe?.status==="success"&&fe?.result?.success)v(!0);else if(fe?.result?.success===!1)if(fe?.result?.validationResults&&!fe?.result?.validationResults?.valid&&fe?.result?.validationResults?.remainingErrors>0){const{remainingErrors:ye,errors:we}=fe.result.validationResults,ke=`Template installation completed but ${ye} validation issue${ye>1?"s":""} remain unresolved.`;m(ke),j(we||[])}else{const ye=fe?.result?.message||fe?.result?.error||"Template installation failed";m(typeof ye=="string"?ye:String(ye))}}).catch(le=>{console.error("❌ Failed to fetch run details:",le),m("Failed to retrieve installation status after reload")}))},[t,g,h,V,G,H]),y.useEffect(()=>{const te=t.get("runId"),le=t.get("resume"),fe=t.get("provider");if(te&&le==="true"&&fe&&!V&&!G&&!w&&!E&&L){S(te),O(!0);try{H({runId:te}).then(ce=>{if(ce.snapshot?.status==="running")return $.mutateAsync({runId:te})}).then(()=>{n(ce=>{const ye=new URLSearchParams(ce);return ye.delete("resume"),ye})}).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,E,L,H,$,n]);const K=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],ne=[{key:"tools",label:"Tools",value:I?.tools?.length?I.tools.map(te=>te).join(", "):"n/a",icon:l.jsx(vu,{})},{key:"agents",label:"Agents",value:I?.agents?.length?I.agents.map(te=>te).join(", "):"n/a",icon:l.jsx(Ll,{})},{key:"workflows",label:"Workflows",value:I?.workflows?.length?I.workflows.map(te=>te).join(", "):"n/a",icon:l.jsx(D7,{})},{key:"providers",label:"Providers",value:I?.supportedProviders?.length?I.supportedProviders.join(", "):"n/a",icon:l.jsx(Fg,{})},{key:"tags",label:"Tags",value:I?.tags?.length?I.tags.join(", "):"n/a",icon:l.jsx(gj,{})}],ee=[{...ne[0]},{...ne[1]},{...ne[2]}].filter(te=>te.value!=="n/a");y.useEffect(()=>{B&&d(B)},[B]),y.useEffect(()=>{const te=Y||Z;te?.phase==="error"&&te?.error&&m(typeof te.error=="string"?te.error:String(te.error))},[Y?.phase,Y?.error,Z?.phase,Z?.error]);const J=te=>{s(te)},se=async te=>(i(te.provider),c(te.modelId),{message:"Model updated successfully"}),ae=async()=>{const te=Object.entries(u).reduce((le,[fe,ce])=>(ce===""&&le.push(fe),le),[]);if(te.length>0){p(te);return}if(I){m(null),v(!1),S(""),_(!0);try{const fe={repo:I.githubUrl||`https://github.com/mastra-ai/template-${I.slug}`,ref:P,slug:I.slug,variables:u},{runId:ce}=await z({});S(ce),n(ye=>{const we=new URLSearchParams(ye);return we.set("runId",ce),we.set("resume","true"),we.set("provider",r||"openai"),we}),await D.mutateAsync({inputData:fe,selectedModel:{provider:a,modelId:o},runId:ce})}catch(le){_(!1),m(le?.message||"Template installation failed"),console.error("Template installation failed",le)}}},Q=te=>{const{name:le,value:fe}=te.target;fe.trim()===""?p(ce=>[...ce,le]):p(ce=>ce.filter(ye=>ye!==le)),d(ce=>({...ce,[le]:fe}))};return l.jsx(pr,{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(xns,{isLoading:N,title:I?.title,description:I?.longDescription,imageURL:I?.imageURL,githubUrl:I?.githubUrl,infoData:ne,templateSlug:e}),I&&l.jsxs(l.Fragment,{children:[(V||G)&&l.jsx(wns,{name:I.title,streamResult:G?Z:Y,runId:b,workflowInfo:L}),g&&l.jsx(Sns,{name:I.title,installedEntities:ee,linkComponent:$o}),h&&l.jsx(yns,{errorMsg:h,validationErrors:C.length>0?C:Y?.validationResults?.errors||Z?.validationResults?.errors}),!V&&!G&&!g&&!h&&l.jsx(bns,{providerOptions:K,selectedProvider:r,onProviderChange:J,variables:u,setVariables:d,errors:f,setErrors:p,handleInstallTemplate:ae,handleVariableChange:Q,isLoadingEnvVars:M||F,isInstalling:U,defaultModelProvider:a,defaultModelId:o,onModelUpdate:se})]})]})})})}const Ons=()=>{const{toolId:e,agentId:t}=Mr();return l.jsx("div",{className:"h-full w-full overflow-y-auto",children:l.jsx(LWr,{toolId:e,agentId:t})})},_ns=()=>{const{toolId:e}=Mr();return l.jsx("div",{className:"h-full w-full overflow-y-hidden",children:l.jsx(Rts,{toolId:e})})};function Ens(){const{traceId:e}=Mr(),[t,n]=xo(),r=ku(),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:O}=Pwe(e),E=y.useMemo(()=>S?.spans??[],[S?.spans]),_=y.useMemo(()=>E.find(se=>se.parentSpanId==null),[E]),{data:C,isLoading:j}=Hk(e,c??"");y.useEffect(()=>g(0),[e,c]);const{data:I,isLoading:N}=Cp(),{data:R,isLoading:P}=F_e({traceId:e,spanId:c??void 0,page:m}),[B,M]=y.useState(0);y.useEffect(()=>M(0),[e,c]);const{data:L,isLoading:F}=tLt({traceId:e,page:B});y.useEffect(()=>{if(o&&R?.scores&&!d){const se=R.scores.find(ae=>ae.id===o);se&&f(se)}},[o,R?.scores,d]);const z=y.useCallback(se=>{const ae=new URLSearchParams(t);for(const[Q,te]of Object.entries(se))te===null||te===""?ae.delete(Q):ae.set(Q,te);n(ae,{replace:!0})},[t,n]),U=y.useCallback(se=>{const ae=se??null,Q=ae===c;u(ae),Q||(f(void 0),h("details"),z({spanId:ae,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}=TSt(E,c,D),$=y.useCallback(se=>{const ae=se;h(ae),f(void 0),z({tab:ae==="details"?null:ae,scoreId:null})},[z]),Z=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]),ne=y.useCallback(()=>{h("scoring"),_&&c!==_.spanId?(u(_.spanId),f(void 0),z({spanId:_.spanId,tab:"scoring",scoreId:null})):z({tab:"scoring"})},[_,c,z]),ee=_?l.jsx(Uv,{owner:"trace-detail",children:l.jsxs(jr,{children:[l.jsxs(he,{tooltip:"Evaluate Trace","aria-label":"Evaluate Trace",onClick:ne,children:[l.jsx(jz,{}),"Evaluate"]}),l.jsxs(he,{tooltip:"Save as Dataset Item","aria-label":"Save as Dataset Item",onClick:()=>b(!0),children:[l.jsx(fu,{}),"Save"]})]})}):null,J=_?l.jsx(Tn.Row,{children:l.jsx(Tn.Column,{children:l.jsx(SSt,{rootSpan:_,numOfCol:3})})}):null;return O?l.jsxs(Tn,{height:"full",children:[ee,J&&l.jsx(Tn.TopArea,{children:J}),l.jsx(Tn.MainArea,{isCentered:!0,children:l.jsx(CSt,{error:O,resource:"traces",errorTitle:"Failed to load trace"})})]}):l.jsxs(Tn,{children:[ee,J&&l.jsx(Tn.TopArea,{children:J}),l.jsx(Y_e,{rootSpanId:_?.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(_St,{traceId:e,spans:E,isLoading:w,onClose:K,onSpanSelect:U,onEvaluateTrace:ne,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(ESt,{traceId:e,spanId:c,span:C?.span,isLoading:j,onClose:H,onPrevious:Y,onNext:V,activeTab:p,onTabChange:$,feedbackTabBadge:L?.pagination?.total??void 0,feedbackTabSlot:()=>l.jsx(J3t,{feedbackData:L,onPageChange:M,isLoadingFeedbackData:F}),scoringTabBadge:R?.pagination?.total??void 0,scoringTabSlot:({span:se,traceId:ae,spanId:Q})=>l.jsxs("div",{className:"grid gap-6",children:[l.jsx(Q_e,{traceId:ae,isTopLevelSpan:!se.parentSpanId,spanId:Q,entityType:se.attributes?.agentId||se.entityType===na.AGENT?"Agent":se.attributes?.workflowId||se.entityType===na.WORKFLOW_RUN?"Workflow":void 0,scorers:I,isLoadingScorers:N}),l.jsx(eLt,{scoresData:R,onPageChange:g,isLoadingScoresData:P,onScoreSelect:Z})]})}),d&&l.jsx(L_e,{score:d,onClose:G})]})]})]})}function Cns(){const{data:e,isLoading:t,error:n}=Kw(),[r,s]=y.useState("");return n&&Bs(n)?l.jsx(cr,{children:l.jsx(fa,{})}):n&&qs(n)?l.jsx(cr,{children:l.jsx(sa,{resource:"workflows"})}):n?l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load workflows",message:n.message})}):Object.keys(e||{}).length===0&&!t?l.jsx(cr,{children:l.jsx(ePr,{})}):l.jsxs(Tn,{children:[l.jsx(Tn.TopArea,{children:l.jsxs(Tn.Row,{align:"center",stack:"responsive",children:[l.jsx("div",{className:"max-w-120 flex-1",children:l.jsx(Fv,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})}),l.jsxs(he,{as:$o,to:"/workflows/schedules",variant:"primary",className:"shrink-0",children:[l.jsx(zM,{}),"Schedules"]})]})}),l.jsx(JRr,{workflows:e||{},isLoading:t,search:r})]})}const Tns={active:"bg-accent1",paused:"bg-accent3"},jns={active:"text-accent1",paused:"text-accent3"},gLt=({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 ${Tns[e]}`,"aria-hidden":!0}),l.jsx("span",{className:`text-ui-sm ${jns[e]}`,children:e})]}),MC=e=>!e||e<=0?"—":new Date(e).toLocaleString(),ZR=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 vLt({status:e}){const{icon:t,color:n}=Ins(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 Ins(e){switch(e){case"success":return{icon:l.jsx(ni,{size:14}),color:"text-accent1"};case"failed":return{icon:l.jsx(Pr,{size:14}),color:"text-accent2"};case"running":return{icon:l.jsx(tn,{}),color:"text-neutral3"};case"suspended":return{icon:l.jsx(Tme,{size:14}),color:"text-accent3"};case"canceled":return{icon:l.jsx(Yd,{size:14}),color:"text-neutral3"};case"pending":case"waiting":return{icon:l.jsx(fO,{size:14}),color:"text-neutral3"};default:return{icon:null,color:"text-neutral3"}}}const JXe="auto auto auto auto 1fr";function Nns(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 Ans(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 Rns=3e4,Pns=5*6e4;function Mns({triggers:e,isLoading:t,workflowId:n,hasNextPage:r,isFetchingNextPage:s,setEndOfListElement:a}){const{Link:i,paths:o}=dn();return t?l.jsx(Bd,{columns:JXe}):e.length===0?l.jsx(be,{variant:"ui-md",className:"text-neutral4 p-4",children:"No trigger history yet."}):l.jsxs(Oe,{columns:JXe,children:[l.jsxs(Oe.Top,{children:[l.jsx(Oe.TopCell,{children:"Run"}),l.jsx(Oe.TopCell,{children:"Status"}),l.jsx(Oe.TopCell,{children:"Started"}),l.jsx(Oe.TopCell,{children:"Duration"}),l.jsx(Oe.TopCell,{children:" "})]}),e.map(c=>{const u=c.actualFireAt-c.scheduledFireAt,d=Ans(u),f=`Scheduled ${MC(c.scheduledFireAt)} — published ${MC(c.actualFireAt)} (drift ${d})`,p=c.outcome==="failed",h=p?c.error:c.run?.error,m=Math.abs(u),g=!p&&m>Rns&&m<=Pns,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(Oe.NameCell,{children:b}),l.jsx(Oe.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(Xy,{size:14}),"publish failed"]}):c.run?l.jsx(vLt,{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(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx("span",{className:"text-accent2 inline-flex",children:l.jsx(Xy,{size:14})})}),l.jsx(er,{children:h})]}):null]})}),l.jsx(Oe.TextCell,{children:l.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[l.jsx("span",{title:f,children:ZR(c.actualFireAt)}),g?l.jsxs(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx("span",{className:"text-accent3 inline-flex",children:l.jsx(Xy,{size:14})})}),l.jsxs(er,{children:["Published ",d," after the scheduled fire time"]})]}):null]})}),l.jsx(Oe.TextCell,{children:c.run?l.jsx("span",{children:Nns(c.run.durationMs)}):l.jsx("span",{className:"text-neutral4",children:"—"})}),l.jsx(Oe.TextCell,{children:" "})]});return n&&c.run&&c.runId&&!p?l.jsx(Oe.RowLink,{to:o.workflowRunLink(n,c.runId),LinkComponent:i,children:S},v):l.jsx(Oe.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(tn,{})}):null,!r&&e.length>0?l.jsx(be,{variant:"ui-xs",className:"text-neutral4 text-center py-4 block",children:"All triggers loaded"}):null]}):null]})}const $ns=e=>{const t=We();return Et({queryKey:["schedule",e],enabled:!!e,queryFn:async()=>{if(!e)throw new Error("scheduleId is required");return t.getSchedule(e)}})},eKe=25,Dns=e=>{const t=We(),{inView:n,setRef:r}=MO(),s=Qw({queryKey:["schedule-triggers",e],enabled:!!e,initialPageParam:void 0,queryFn:async({pageParam:u})=>e?t.listScheduleTriggers(e,{limit:eKe,toActualFireAt:u}):{triggers:[]},getNextPageParam:u=>{if(!(!u?.triggers?.length||u.triggers.length<eKe))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}},Lns=e=>{const t=We(),n=Js();return ar({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"]}),Be.success(s==="pause"?"Schedule paused":"Schedule resumed")},onError:r=>{Be.error(r.message)}})};function t6({label:e,children:t}){return l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx(be,{variant:"ui-xs",className:"text-neutral4 uppercase tracking-wide",children:e}),l.jsx("div",{className:"text-ui-md",children:t})]})}function zns(){const{scheduleId:e}=Mr(),{paths:t}=dn(),{data:n,error:r}=$ns(e),{data:s,isLoading:a,error:i,hasNextPage:o,isFetchingNextPage:c,setEndOfListElement:u}=Dns(e),d=Lns(e);if(r&&Bs(r))return l.jsx(cr,{children:l.jsx(fa,{})});if(r&&qs(r))return l.jsx(cr,{children:l.jsx(sa,{resource:"schedules"})});if(r)return l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load schedule",message:r.message})});const f=n?.target.type==="workflow"?n.target.workflowId:void 0;return l.jsxs(Tn,{children:[l.jsx(Tn.TopArea,{children:l.jsx(Tn.Row,{className:"justify-end",children:l.jsxs(Tn.Column,{className:"flex justify-end gap-2",children:[l.jsxs(he,{as:$o,to:t.schedulesLink(),variant:"ghost",children:[l.jsx(Ab,{}),"Back to schedules"]}),f?l.jsx(he,{as:$o,to:t.workflowLink(f),variant:"ghost",children:"Open workflow"}):null,n?l.jsx(he,{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(Mme,{}),"Pause"]}):l.jsxs(l.Fragment,{children:[l.jsx(cb,{}),"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(t6,{label:"Workflow",children:f?l.jsx($o,{to:t.workflowLink(f),className:"text-accent1 hover:underline",children:f}):"—"}),l.jsxs(t6,{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(t6,{label:"Status",children:l.jsx(gLt,{status:n.status})}),l.jsx(t6,{label:"Next fire",children:l.jsx("span",{title:MC(n.nextFireAt),children:ZR(n.nextFireAt)})})]}),l.jsxs("div",{className:"overflow-y-auto","data-testid":"schedule-triggers-panel",children:[l.jsx(be,{variant:"ui-md",className:"mb-3",children:"Trigger history"}),i?l.jsx(rc,{title:"Failed to load trigger history",message:i.message}):l.jsx(Mns,{triggers:s??[],isLoading:a,workflowId:f,hasNextPage:o,isFetchingNextPage:c,setEndOfListElement:u})]})]}):null]})}const tKe="minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto auto auto";function Fns({schedules:e,isLoading:t,search:n=""}){const{paths:r,Link:s}=dn(),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(Bd,{columns:tKe}):l.jsxs(Oe,{columns:tKe,children:[l.jsxs(Oe.Top,{children:[l.jsx(Oe.TopCell,{children:"Workflow"}),l.jsx(Oe.TopCell,{children:"Schedule ID"}),l.jsx(Oe.TopCell,{children:"Cron"}),l.jsx(Oe.TopCell,{children:"Status"}),l.jsx(Oe.TopCell,{children:"Next fire"}),l.jsx(Oe.TopCell,{children:"Last run"})]}),a.length===0&&n?l.jsx(Oe.NoMatch,{message:"No schedules match your search"}):null,a.length===0&&!n?l.jsx(Oe.NoMatch,{message:"No schedules configured"}):null,a.map(i=>l.jsxs(Oe.RowLink,{to:r.scheduleLink(i.id),LinkComponent:s,children:[l.jsx(Oe.NameCell,{children:l.jsx("span",{className:"truncate",children:i.target.workflowId})}),l.jsx(Oe.TextCell,{children:l.jsx("span",{className:"truncate font-mono text-ui-sm",title:i.id,children:i.id})}),l.jsx(Oe.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(Oe.TextCell,{children:l.jsx(gLt,{status:i.status})}),l.jsx(Oe.TextCell,{children:l.jsx("span",{className:"whitespace-nowrap",title:MC(i.nextFireAt),children:ZR(i.nextFireAt)})}),l.jsx(Oe.TextCell,{children:i.lastRun?l.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[l.jsx(vLt,{status:i.lastRun.status}),l.jsx("span",{className:"text-neutral4 text-ui-sm",title:MC(i.lastFireAt),children:i.lastFireAt?ZR(i.lastFireAt):""})]}):i.lastFireAt?l.jsx("span",{className:"whitespace-nowrap",title:MC(i.lastFireAt),children:ZR(i.lastFireAt)}):l.jsx("span",{className:"text-neutral4",children:"Never"})})]},i.id))]})}function Bns({workflowId:e}={}){const{data:t,isLoading:n,error:r}=zwe(e?{workflowId:e}:{}),[s,a]=y.useState("");return r?l.jsx(rc,{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(Fv,{onSearch:a,label:"Filter schedules",placeholder:"Filter by id or workflow"})}),l.jsx("div",{className:"overflow-y-auto",children:l.jsx(Fns,{schedules:t??[],isLoading:n,search:s})})]})}function Uns(){const[e]=xo(),t=e.get("workflowId")??void 0,{error:n}=zwe(t?{workflowId:t}:{});return n&&Bs(n)?l.jsx(cr,{children:l.jsx(fa,{})}):n&&qs(n)?l.jsx(cr,{children:l.jsx(sa,{resource:"schedules"})}):l.jsx(Tn,{children:l.jsx("div",{className:"h-full",children:l.jsx(Bns,{workflowId:t})})})}const nKe=()=>{const{workflowId:e}=Mr(),{data:t,isLoading:n,error:r}=sD(e);return r&&Bs(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})}):r&&qs(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"workflows"})}):l.jsx(XNt,{workflowId:e,workflow:t??void 0,isLoading:n})};function qns(e){if(!e)return null;switch(e.icon||e.provider){case"aws-s3":case"s3":return l.jsx(vwt,{className:"h-4 w-4 text-[#FF9900]"});case"google-cloud":case"google-cloud-storage":case"gcs":return l.jsx(mwt,{className:"h-4 w-4"});case"azure-blob":case"azure":return l.jsx(ywt,{className:"h-4 w-4 text-[#0078D4]"});case"cloudflare":case"cloudflare-r2":case"r2":return l.jsx(oG,{className:"h-4 w-4 text-[#F38020]"});case"minio":return l.jsx(Xle,{className:"h-4 w-4 text-red-400"});case"database":return l.jsx(G0,{className:"h-4 w-4 text-emerald-400"});case"local":case"folder":return l.jsx(BM,{className:"h-4 w-4 text-amber-400"});case"hard-drive":return l.jsx(Xle,{className:"h-4 w-4 text-slate-400"});case"cloud":return l.jsx(oG,{className:"h-4 w-4 text-sky-400"});default:return l.jsx(oG,{className:"h-4 w-4 text-neutral4"})}}function yLt(e,t=!1){const{name:n,type:r,mount:s}=e;if(r==="directory")return s?qns(s):t?l.jsx(pj,{className:"h-4 w-4 text-amber-400"}):l.jsx(BM,{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(FM,{className:"h-4 w-4 text-yellow-400"});case"md":case"mdx":return l.jsx(td,{className:"h-4 w-4 text-neutral4"});case"png":case"jpg":case"jpeg":case"gif":case"svg":case"webp":return l.jsx(Ame,{className:"h-4 w-4 text-purple-400"});default:return l.jsx(jme,{className:"h-4 w-4 text-neutral4"})}}function bLt(e){if(e==null||Number.isNaN(e))return"";if(e<0)return"-"+bLt(-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 Vns(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 xLt(e){return e==="."||e===""}function Hns({path:e,onNavigate:t}){const r=xLt(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(pj,{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(ka,{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 Zns({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=xLt(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(Hns,{path:t,onNavigate:s}),l.jsxs("div",{className:"flex items-center gap-1",children:[i&&l.jsx(he,{variant:"ghost",size:"md",onClick:i,disabled:n,"aria-label":"Refresh files",children:l.jsx(hj,{className:`h-4 w-4 ${n?"animate-spin":""}`})}),c&&l.jsx(he,{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(Ci,{className:"h-4 w-4 animate-spin"}):l.jsx(R7,{className:"h-4 w-4"})}),o&&l.jsx(he,{variant:"ghost",size:"md",onClick:o,"aria-label":"Upload files",children:l.jsx($7,{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(Ci,{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(oP,{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:Vns(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(ud,{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(pj,{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,O=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:[yLt(S),l.jsx("span",{className:"text-sm text-neutral6 flex-1 truncate",children:S.name}),S.mount&&O&&l.jsxs(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx("span",{tabIndex:0,className:"flex items-center",children:l.jsx(oP,{className:"h-4 w-4 text-red-400"})})}),l.jsxs(er,{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(rr,{children:[l.jsx(Jn,{asChild:!0,children:l.jsx("span",{tabIndex:0,className:`text-xs px-1.5 py-0.5 rounded ${O?"text-red-400 bg-red-400/10":"text-neutral3 bg-surface4"}`,children:w})}),l.jsx(er,{children:S.mount.description})]}):l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${O?"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:bLt(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(Xd,{className:"h-3.5 w-3.5"})})]})},S.name)})]})})}),l.jsx(en,{open:!!p,onOpenChange:S=>!f&&!S&&h(null),children:l.jsxs(en.Content,{children:[l.jsxs(en.Header,{children:[l.jsx(en.Title,{children:"Delete Item"}),l.jsxs(en.Description,{children:['Are you sure you want to delete "',p,'"? This action cannot be undone.']})]}),l.jsxs(en.Footer,{children:[l.jsx(en.Cancel,{disabled:f,children:"Cancel"}),l.jsxs(en.Action,{disabled:f,onClick:async()=>{try{p&&u&&await u(p)}finally{h(null)}},children:[f?l.jsx(Ci,{className:"h-4 w-4 animate-spin mr-2"}):null,"Delete"]})]})]})})]})}function Wns(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 Gns({content:e,language:t}){return l.jsx(__e,{language:t,style:E_e.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},codeTagProps:{style:{fontFamily:"var(--geist-mono), ui-monospace, monospace"}},children:e})}function Qns({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=Wns(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:[yLt({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(ua,{content:t,copyMessage:"Copied file content"}),s&&l.jsx(he,{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(Ci,{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(Gns,{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 Yns=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(di,{iconSlot:l.jsx(Yd,{}),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(he,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",l.jsx(Ba,{})]})})}),Xns=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(di,{iconSlot:l.jsx(pWt,{}),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(he,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",l.jsx(Ba,{})]})})}),Kns=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(di,{iconSlot:l.jsx(oP,{}),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(he,{variant:"ghost",as:"a",href:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",rel:"noopener noreferrer",children:["Workspaces Documentation ",l.jsx(Ba,{})]})})}),fle={bm25:{label:"Keyword",icon:l.jsx(td,{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(VC,{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(YQt,{className:"h-3.5 w-3.5"}),color:"bg-amber-500/10 text-amber-400 border-amber-500/30"}};function wLt(e){return e.id.replace(/#chunk-\d+$/,"")}function Jns({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(mj,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral3"}),l.jsx(On,{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(On,{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(he,{type:"submit",disabled:t||!i.trim(),size:"lg",className:"h-10 px-4",children:t?l.jsx(Ci,{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=fle[g],b=f===g;return l.jsxs("button",{type:"button",onClick:()=>p(g),className:`
|
|
660
660
|
inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-xs font-medium border transition-colors
|
|
661
661
|
${b?v.color:"bg-surface2 text-neutral4 border-transparent hover:bg-surface3"}
|
|
662
662
|
`,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 ${fle[n.mode].color}`,children:fle[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(ers,{result:g,rank:v+1,onClick:()=>a?.(wLt(g))},`${g.id}-${v}`))})]})]})}function ers({result:e,rank:t,onClick:n}){const r=Math.min(100,Math.max(0,e.score*100)),s=wLt(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(pj,{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 trs({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(mj,{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(he,{type:"submit",disabled:!s.trim()||n,children:n?l.jsx(Ci,{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(nrs,{result:f,onClick:()=>r?.(f)},`${f.skillName}-${f.source}-${p}`))})]})]})}function nrs({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(td,{className:"h-3.5 w-3.5 text-neutral4"}):l.jsx(nI,{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 rrs({skillName:e,onUpdate:t,isUpdating:n}){return l.jsx(he,{variant:"default",size:"icon-sm",disabled:n,tooltip:`Update ${e}`,onClick:t,children:n?l.jsx(Ci,{className:"h-4 w-4 animate-spin"}):l.jsx(eC,{className:"h-4 w-4"})})}function srs({skillName:e,onRemove:t,isRemoving:n}){return l.jsxs(en,{children:[l.jsx(en.Trigger,{asChild:!0,children:l.jsx(he,{variant:"default",size:"icon-sm",disabled:n,tooltip:`Remove ${e}`,children:n?l.jsx(Ci,{className:"h-4 w-4 animate-spin"}):l.jsx(Xd,{className:"h-4 w-4"})})}),l.jsxs(en.Content,{children:[l.jsxs(en.Header,{children:[l.jsx(en.Title,{children:"Remove Skill"}),l.jsxs(en.Description,{children:['Are you sure you want to remove the skill "',e,'"? This action cannot be undone.']})]}),l.jsxs(en.Footer,{children:[l.jsx(en.Cancel,{children:"Cancel"}),l.jsx(en.Action,{onClick:t,children:"Remove"})]})]})]})}const ars=".agents/skills/",rEe=[{name:"name",label:"Skill",size:"1fr"},{name:"description",label:"Description",size:"2fr"}],SLt=[...rEe,{name:"actions",label:"",size:"48px"}];function irs(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 ors({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}=dn(),p=d&&d.length>0,h=S=>S.path?.includes(ars)??!1,m=e.some(h),g=!!o||!!i,v=g&&m,b=v?SLt:rEe;return!n&&!t?l.jsx(crs,{onAddSkill:a}):t?l.jsx(lrs,{hasRowActions:g}):l.jsxs("div",{className:"space-y-4",children:[a&&l.jsx("div",{className:"flex items-center gap-4",children:l.jsxs(he,{variant:"default",size:"sm",onClick:a,children:[l.jsx(Ve,{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(Xy,{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(Ma,{children:l.jsxs(Ma.Trim,{children:[l.jsx(Ma.Header,{columns:b}),e.length>0?l.jsx(Ma.Entries,{children:e.map(S=>{const w={id:S.path,name:S.name,description:S.description||"—"},O=p?irs(S.path,d):null;return l.jsxs(Ma.Entry,{entry:w,columns:b,onClick:()=>{const E=`${s}/${encodeURIComponent(S.name)}?path=${encodeURIComponent(S.path)}`;f(E)},children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"p-1.5 rounded bg-surface5",children:l.jsx(nI,{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:[O&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral3 shrink-0",children:O}),l.jsx("span",{className:"text-[11px] text-neutral3 truncate",title:S.path,children:S.path})]})]})]}),l.jsx(Ma.EntryText,{children:S.description||"—"}),v&&l.jsx("div",{className:"flex justify-end gap-1",onClick:E=>E.stopPropagation(),children:h(S)&&l.jsxs(l.Fragment,{children:[i&&l.jsx(rrs,{skillName:S.name,onUpdate:()=>i(S.name),isUpdating:c===S.name}),o&&l.jsx(srs,{skillName:S.name,onRemove:()=>o(S.name),isRemoving:u===S.name})]})})]},S.path)})}):l.jsx(Ma.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 lrs({hasRowActions:e}){const t=e?SLt:rEe;return l.jsx(Ma,{children:l.jsxs(Ma.Trim,{children:[l.jsx(Ma.Header,{columns:t}),l.jsx(Ma.Entries,{children:Array.from({length:3}).map((n,r)=>l.jsxs(Ma.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 crs({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(nI,{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(he,{size:"lg",variant:"default",onClick:e,children:[l.jsx(Ve,{children:l.jsx(Cs,{className:"h-4 w-4"})}),"Add Skill from skills.sh"]}),l.jsxs(he,{size:"lg",variant:"default",as:"a",href:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[l.jsx(Ve,{children:l.jsx(pZt,{className:"h-4 w-4"})}),"Learn about Skills"]})]})]})})}function urs(e){switch(e.type){case"external":return{icon:l.jsx(BS,{className:"h-3.5 w-3.5"}),label:"External Package",path:e.packagePath};case"local":return{icon:l.jsx(bGt,{className:"h-3.5 w-3.5"}),label:"Local Project",path:e.projectPath};case"managed":return{icon:l.jsx(c6,{className:"h-3.5 w-3.5"}),label:"Managed",path:e.mastraPath}}}function drs({skill:e,rawSkillMd:t,onReferenceClick:n}){const[r,s]=y.useState(new Set(["instructions"])),[a,i]=y.useState(!1),o=urs(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(nI,{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(kA,{label:"Source",value:o.label,icon:o.icon}),l.jsx(kA,{label:"Path",value:e.path,icon:l.jsx(pj,{className:"h-3.5 w-3.5"})}),e.license&&l.jsx(kA,{label:"License",value:e.license}),e.compatibility!=null&&l.jsx(kA,{label:"Compatibility",value:e.compatibility}),l.jsx(kA,{label:"References",value:`${e.references.length} files`,icon:l.jsx(td,{className:"h-3.5 w-3.5"})})]}),l.jsx(n6,{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(iu,{className:"h-3.5 w-3.5"}):l.jsx(zWt,{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(__e,{language:"markdown",style:E_e.coldarkDark,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent",fontSize:"0.875rem"},children:t??e.instructions})}):l.jsx(ET,{children:e.instructions})}),e.references.length>0&&l.jsx(n6,{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(td,{className:"h-4 w-4 text-neutral3"}),l.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),e.scripts.length>0&&l.jsx(n6,{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(dWt,{className:"h-4 w-4 text-neutral3"}),l.jsx("span",{className:"text-sm text-neutral5",children:u})]},u))})}),e.assets.length>0&&l.jsx(n6,{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(Ame,{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 kLt(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}: ${kLt(r)}`}return`{${t.join(", ")}}`}return String(e)}function kA({label:e,value:t,icon:n}){const r=kLt(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 n6({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(bs,{className:"h-4 w-4 text-neutral3"}):l.jsx(ka,{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 frs({open:e,onOpenChange:t,skillName:n,referencePath:r,content:s,isLoading:a,error:i}){const{isCopied:o,copyToClipboard:c}=_V({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(td,{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(he,{size:"md",variant:"default",onClick:u,disabled:!s||a,children:[l.jsx(Ve,{children:o?l.jsx(ni,{className:"h-3.5 w-3.5 text-green-400"}):l.jsx(rp,{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 rKe(e){return`${e.topSource}/${e.name}`}function sKe(e){const t=N3t(e.topSource,e.name);return t?`${t.owner}/${t.repo}/${e.name}`:null}function prs({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}=aYr(n),b=sYr(n),S=y.useMemo(()=>f?.topSource?N3t(f.topSource,f.name):null,[f]),w=y.useMemo(()=>!S||!f?null:`https://skills.sh/${S.owner}/${S.repo}/${f.name}`,[S,f]),{data:O,isLoading:E}=iYr(n,S?.owner,S?.repo,f?.name,{enabled:!!S&&!!f}),_=$j(M=>{M.trim().length>=2&&b.mutate(M)},300),C=y.useCallback(M=>{d(M),_(M)},[_]),j=y.useMemo(()=>u.trim().length>=2?b.data?.skills??[]:g?.skills??[],[u,b.data,g]),I=b.isPending,N=u.trim().length>=2,R=y.useMemo(()=>{if(!f)return!1;const M=sKe(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]),B=y.useCallback(M=>{M||(d(""),p(null),m(o?.[0]?.path)),t(M)},[t,o]);return l.jsx(Dr,{open:e,onOpenChange:B,children:l.jsxs(Nr,{className:"max-w-4xl h-[80vh] flex flex-col",children:[l.jsxs(Lr,{children:[l.jsx(Ar,{children:"Add Skill"}),l.jsx(ga,{children:"Search and install skills from the community registry"})]}),l.jsxs(ts,{className:"flex-1 flex flex-col gap-4 overflow-hidden max-h-none",children:[l.jsxs("div",{className:"relative",children:[l.jsx(mj,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral3"}),l.jsx(On,{placeholder:"Search skills...",value:u,onChange:M=>C(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:N?"Search Results":"Popular Skills"}),l.jsx($s,{className:"flex-1 border border-border1 rounded-lg",children:v||I?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx(Ci,{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(BS,{className:"h-8 w-8 mb-2"}),l.jsx("p",{className:"text-sm",children:N?"No skills found":"No skills available"})]}):l.jsx("div",{className:"p-2 space-y-1",children:j.map(M=>{const L=rKe(M),F=sKe(M),z=F&&a.includes(F)||i.includes(M.name),U=f?rKe(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",U===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(ni,{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(eC,{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(nI,{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(dGt,{className:"h-3 w-3"}),f.topSource]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(eC,{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(Ba,{className:"h-4 w-4"})})]})}),E?l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx(Ci,{className:"h-6 w-6 animate-spin text-neutral3"})}):O?l.jsx($s,{className:"flex-1",children:l.jsx("div",{className:"p-4",children:l.jsx(ET,{children:O})})}):l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-neutral4",children:[l.jsx(BS,{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(Ba,{className:"h-3 w-3"})]})]})]}):l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-neutral4",children:[l.jsx(BS,{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(BM,{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(he,{variant:"default",onClick:()=>B(!1),children:"Cancel"}),l.jsx(he,{variant:"primary",onClick:P,disabled:!S||s||R,"data-testid":"install-skill-button",children:s?l.jsxs(l.Fragment,{children:[l.jsx(Ci,{className:"h-4 w-4 mr-2 animate-spin"}),"Installing..."]}):R?l.jsxs(l.Fragment,{children:[l.jsx(ni,{className:"h-4 w-4 mr-2"}),"Already Installed"]}):l.jsxs(l.Fragment,{children:[l.jsx(eC,{className:"h-4 w-4 mr-2"}),"Install"]})})]})]})]})]})})}function aKe(){const{workspaceId:e}=Mr(),[t,n]=xo(),r=ku(),[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:O}=j3t(),E=S?.workspaces??[],_=e??E[0]?.id,{data:C,isLoading:j,error:I}=GQr(_),N=Bs(w)||Bs(I),R=qs(w)||qs(I),P=t.get("path")||".",B=Qhe(w)||Qhe(I),M=_?E.find(Le=>Le.id===_):void 0,L=Le=>{const Je=new URLSearchParams(t);for(const[st,fn]of Object.entries(Le))fn===null?Je.delete(st):Je.set(st,fn);n(Je)},F=Le=>{g(!1),a(!1),r(`/workspaces/${Le}`)},z=Le=>{L({path:Le==="."||Le===""?null:Le,file:null})},U=Le=>{L({file:Le})},H=Le=>{L({tab:Le})},D=P,Y=v,{data:V,isLoading:$,error:Z,refetch:G}=QQr(D,{enabled:C?.isWorkspaceConfigured&&C?.capabilities?.hasFilesystem,workspaceId:_}),K=XQr(),ne=KQr(),{data:ee,isLoading:J}=I3t(Y??"",{enabled:!!Y,workspaceId:_}),{data:se,isLoading:ae,refetch:Q}=eYr({workspaceId:_}),te=oYr(),le=lYr(),fe=cYr(),ce=C?.isWorkspaceConfigured??!1,ye=C?.capabilities?.hasFilesystem??!1,we=C?.capabilities?.hasSkills??!1,ke=C?.capabilities?.canBM25??!1,Re=C?.capabilities?.canVector??!1,De=M?.safety?.readOnly??!1,Ue=ye&&!De,ot=C?.mounts,pe=ot?.filter(Le=>!Le.readOnly).map(Le=>({path:Le.path,displayName:Le.displayName,icon:Le.icon,provider:Le.provider,name:Le.name})),de=ot&&ot.length>1?ot.map(Le=>Le.path):void 0,ie=y.useCallback(Le=>{_&&te.mutate({...Le,workspaceId:_},{onSuccess:async Je=>{if(Je.success){u(!1);const{data:st,error:fn}=await Q();if(fn||!st){Be.success(`Skill "${Je.skillName}" installed successfully (${Je.filesWritten} files)`);return}st.skills.some(Mn=>Mn.name===Je.skillName)?Be.success(`Skill "${Je.skillName}" installed successfully (${Je.filesWritten} files)`):(g(!0),Be.warning(`Skill "${Je.skillName}" installed to .agents/skills but not discovered. Add .agents/skills to your workspace skills paths.`))}else Be.error("Failed to install skill")},onError:Je=>{Be.error(`Failed to install skill: ${Je instanceof Error?Je.message:"Unknown error"}`)}})},[_,te,Q]),ge=y.useCallback(Le=>{_&&(h(Le),le.mutate({workspaceId:_,skillName:Le},{onSuccess:Je=>{if(h(null),Je.updated.length>0){const st=Je.updated[0];st.success?(Be.success(`Skill "${Le}" updated successfully (${st.filesWritten} files)`),Q()):Be.error(`Failed to update skill: ${st.error??"Unknown error"}`)}else Be.error("Failed to update skill: No update result returned")},onError:Je=>{h(null),Be.error(`Failed to update skill: ${Je instanceof Error?Je.message:"Unknown error"}`)}}))},[_,le,Q]),ue=y.useCallback(Le=>{_&&(f(Le),fe.mutate({workspaceId:_,skillName:Le},{onSuccess:Je=>{f(null),Je.success?(Be.success(`Skill "${Je.skillName}" removed successfully`),Q()):Be.error(`Failed to remove skill "${Je.skillName}"`)},onError:Je=>{f(null),Be.error(`Failed to remove skill: ${Je instanceof Error?Je.message:"Unknown error"}`)}}))},[_,fe,Q]),Se=b==="files"&&ye?"files":b==="skills"&&we?"skills":ye?"files":we?"skills":"files",Fe=se?.skills??[],ze=se?.isSkillsConfigured??!1,Ke=V?.entries??[],Ne=ye&&(ke||Re),qe=we&&ze&&Fe.length>0,Ie=Ne||qe;if(O)return l.jsx(cr,{children:l.jsx(tn,{})});if(N)return l.jsx(cr,{children:l.jsx(fa,{})});if(R)return l.jsx(cr,{children:l.jsx(sa,{resource:"workspaces"})});if(B)return l.jsx(cr,{children:l.jsx(Kns,{})});const Ge=w||I;return Ge?l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load workspace",message:Ge.message})}):!O&&E.length===0?l.jsx(cr,{children:l.jsx(Yns,{})}):!j&&!O&&!ce?l.jsx(cr,{children:l.jsx(Xns,{})}):l.jsxs(Tn,{children:[Ie&&l.jsx(Tn.TopArea,{children:l.jsx(Tn.Row,{className:"justify-end",children:l.jsx(he,{onClick:()=>a(!s),tooltip:"Search workspace","aria-label":"Search workspace",children:l.jsx(mj,{})})})}),l.jsxs(Tn.MainArea,{className:"grid content-start gap-6",children:[E.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(iG,{className:"h-4 w-4 text-accent1"}):l.jsx(c6,{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(bs,{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:E.map(Le=>l.jsxs("button",{onClick:()=>{F(Le.id),o(!1)},className:`flex items-center gap-3 px-3 py-2 w-full text-left hover:bg-surface3 transition-colors ${M?.id===Le.id?"bg-surface3":""}`,children:[Le.source==="agent"?l.jsx(iG,{className:"h-4 w-4 text-accent1 shrink-0"}):l.jsx(c6,{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:Le.name}),l.jsx("div",{className:"text-xs text-neutral4 truncate",children:Le.source==="agent"?`Agent: ${Le.agentName}`:"Global workspace"})]}),l.jsxs("div",{className:"flex gap-1 shrink-0",children:[Le.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"}),Le.capabilities.hasFilesystem&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"FS"}),Le.capabilities.hasSandbox&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Sandbox"}),Le.capabilities.hasSkills&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Skills"})]})]},Le.id))})]}),E.length===1&&M&&l.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral4",children:[M.source==="agent"?l.jsx(iG,{className:"h-4 w-4 text-accent1"}):l.jsx(c6,{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,")"]}),De&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"})]}),s&&Ie&&_&&l.jsx(hrs,{workspaceId:_,canSearchFiles:Ne,canSearchSkills:qe,canBM25:ke,canVector:Re,showInitWarning:!j&&C?.status!=="ready",onViewFileResult:Le=>{L({file:Le,tab:"files"})},onViewSkillResult:(Le,Je)=>{_&&r(`/workspaces/${_}/skills/${encodeURIComponent(Le)}?path=${encodeURIComponent(Je)}`)}},_),(ye||we)&&l.jsxs(Eu,{value:Se,onValueChange:H,defaultTab:Se,children:[l.jsxs(Cu,{children:[ye&&l.jsxs(Hr,{value:"files",children:[l.jsx(td,{className:"h-4 w-4"}),"Files"]}),we&&l.jsxs(Hr,{value:"skills",children:[l.jsx(Ket,{className:"h-4 w-4"}),"Skills",ze&&Fe.length>0&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:Fe.length})]})]}),ye&&l.jsx(Os,{value:"files",className:"pb-8",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[l.jsx(Zns,{entries:Ke,currentPath:D,isLoading:$,error:Z instanceof Error?Z:null,onNavigate:z,onFileSelect:U,onRefresh:()=>G(),onCreateDirectory:De?void 0:Le=>ne.mutate({path:Le,workspaceId:_}),onDelete:De?void 0:Le=>K.mutate({path:Le,recursive:!0,force:!0,workspaceId:_})}),Y&&l.jsx(Qns,{path:Y,content:ee?.content??"",isLoading:J,mimeType:ee?.mimeType,onClose:()=>U(null)})]})}),we&&l.jsx(Os,{value:"skills",className:"pb-8",children:l.jsx(ors,{skills:Fe,isLoading:ae,isSkillsConfigured:ze,hasUndiscoveredAgentSkills:m,basePath:_?`/workspaces/${_}/skills`:"/workspaces",onAddSkill:Ue?()=>u(!0):void 0,onUpdateSkill:Ue?ge:void 0,onRemoveSkill:Ue?ue:void 0,updatingSkillName:p??void 0,removingSkillName:d??void 0,mountPaths:de})})]}),!ye&&!we&&!j&&l.jsx("div",{className:"py-12 text-center text-neutral4",children:l.jsx("p",{children:"No workspace capabilities are configured."})})]}),_&&Ue&&l.jsx(prs,{open:c,onOpenChange:u,workspaceId:_,onInstall:ie,isInstalling:te.isPending,installedSkillIds:Fe.filter(Le=>Le.skillsShSource).map(Le=>`${Le.skillsShSource.owner}/${Le.skillsShSource.repo}/${Le.name}`),installedSkillNames:Fe.filter(Le=>!Le.skillsShSource).map(Le=>Le.name),writableMounts:pe,installedSkillPaths:Object.fromEntries(Fe.filter(Le=>Le.path).map(Le=>[Le.name,Le.path]))})]})}function hrs({workspaceId:e,canSearchFiles:t,canSearchSkills:n,canBM25:r,canVector:s,showInitWarning:a,onViewFileResult:i,onViewSkillResult:o}){const c=JQr(),u=rYr();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(td,{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(Jns,{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(Ket,{className:"h-4 w-4"}),"Search Skills"]}),l.jsx(trs,{onSearch:d=>u.mutate({...d,workspaceId:e}),results:u.data?.results??[],isSearching:u.isPending,onResultClick:d=>o(d.skillName,d.skillPath)})]})]})}function mrs(e,t){return e==null||t==null?null:e in t?e:null}const OLt=[{key:"primitives",title:"Primitives",items:[{name:"Agents",url:"/agents",Icon:Ll,docs:{href:"https://mastra.ai/en/docs/agents/overview",label:"Agents documentation"},isOnMastraPlatform:!0,requiredPermission:"agents:read"},{name:"Prompts",url:"/prompts",Icon:uYn,docs:{href:"https://mastra.ai/en/docs/agents/agent-instructions#prompt-blocks",label:"Prompts documentation"},isOnMastraPlatform:!0},{name:"Workflows",url:"/workflows",Icon:yu,docs:{href:"https://mastra.ai/en/docs/workflows/overview",label:"Workflows documentation"},isOnMastraPlatform:!0,requiredPermission:"workflows:read"},{name:"Processors",url:"/processors",Icon:bfe,docs:{href:"https://mastra.ai/en/docs/agents/processors",label:"Processors documentation"},isOnMastraPlatform:!1,requiredPermission:"processors:read"},{name:"MCP Servers",url:"/mcps",Icon:kv,docs:{href:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",label:"MCP documentation"},isOnMastraPlatform:!0,requiredPermission:"mcps:read"},{name:"Tools",url:"/tools",Icon:vu,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:xYn,docs:{href:"https://mastra.ai/en/docs/workspace/overview",label:"Workspaces documentation"},isOnMastraPlatform:!0,requiredPermission:"workspaces:read"},{name:"Request Context",url:"/request-context",Icon:wYn,isOnMastraPlatform:!0}]},{key:"evaluation",title:"Evaluation",items:[{name:"Overview",url:"/evaluation",Icon:oYn,isOnMastraPlatform:!0},{name:"Scorers",url:"/scorers",Icon:SYn,docs:{href:"https://mastra.ai/en/docs/evals/overview",label:"Scorers documentation"},isOnMastraPlatform:!0,requiredPermission:"scorers:read"},{name:"Datasets",url:"/datasets",Icon:kYn,docs:{href:"https://mastra.ai/en/docs/evals/datasets/overview",label:"Datasets documentation"},isOnMastraPlatform:!0,requiredAnyPermission:["datasets:read"]},{name:"Experiments",url:"/experiments",Icon:bwt,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:OYn,docs:{href:"https://mastra.ai/en/docs/observability/overview",label:"Metrics documentation"},isOnMastraPlatform:!0,requiredPermission:"observability:read"},{name:"Traces",url:"/observability",activePaths:["/traces"],Icon:dYn,docs:{href:"https://mastra.ai/en/docs/observability/tracing/overview",label:"Traces documentation"},isOnMastraPlatform:!0,requiredPermission:"observability:read"},{name:"Logs",url:"/logs",Icon:cYn,docs:{href:"https://mastra.ai/en/docs/observability/logging",label:"Logs documentation"},isOnMastraPlatform:!0,requiredPermission:"observability:read"}]}],_Lt=[{name:"Settings",url:"/settings",Icon:gwt,isOnMastraPlatform:!1},{name:"Resources",url:"/resources",Icon:Cet,isOnMastraPlatform:!0}],grs=[{name:"Evaluation",url:"/evaluation",Icon:bwt,docs:{href:"https://mastra.ai/en/docs/evals/overview",label:"Evaluation documentation"}}],vrs=[...grs,...OLt.flatMap(e=>e.items),..._Lt];function sEe(e){return vrs.find(t=>t.url===e)}function om(e,t){const n=sEe(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 Vl(e){const t=sEe(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=sEe(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 yrs(){const{skillName:e,workspaceId:t}=Mr(),[n]=xo(),r=Js(),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=mrs(c,d),p=y.useMemo(()=>f?[om("/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}=tYr(s,{workspaceId:t,path:i}),{data:S}=I3t(g?.path?`${g.path}/SKILL.md`:"",{enabled:!!g?.path,workspaceId:t}),{data:w,isLoading:O}=nYr(s,h??"",{enabled:!!h,workspaceId:t,path:i});return v?l.jsxs(pr,{children:[p&&l.jsx(nA,{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&&Bs(b)?l.jsxs(pr,{children:[p&&l.jsx(nA,{crumbs:p}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})})]}):b&&qs(b)?l.jsxs(pr,{children:[p&&l.jsx(nA,{crumbs:p}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"workspaces"})})]}):b||!g?l.jsxs(pr,{children:[p&&l.jsx(nA,{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 instanceof Error?b.message:"Skill not found"})]})})]}):l.jsxs(pr,{children:[p&&l.jsx(nA,{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(drs,{skill:g,rawSkillMd:S?.content,onReferenceClick:m})})}),l.jsx(frs,{open:!!h,onOpenChange:E=>!E&&m(null),skillName:g.name,referencePath:h??"",content:w?.content,isLoading:O})]})}const ELt=()=>{const e=window.MASTRA_CLOUD_API_ENDPOINT;return{isMastraPlatform:!!e,mastraPlatformEndpoint:e}};function iKe(e){const{Icon:t}=e;return{name:e.name,url:e.url,icon:l.jsx(t,{})}}function ple(e,t){const n=r=>t===r||t.startsWith(r+"/");return n(e.url)?!0:e.activePaths?.some(n)??!1}function brs(){const{Link:e}=dn(),{state:t,isMobile:n}=Iq(),s=Pc().pathname,{isMastraPlatform:a}=ELt(),{data:i}=oI(),{isCmsAvailable:o,isLoading:c}=o4(),{hasPermission:u,hasAnyPermission:d,rbacEnabled:f,isAuthenticated:p,isLoading:h}=Xb(),m=i&&uD(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=_Lt.filter(v);return l.jsxs(Of,{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(sb,{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(Of.Trigger,{})})]}),m&&l.jsx(sme,{})]}):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(sb,{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(Of.Trigger,{})]}),l.jsx(sme,{})]}):l.jsxs("span",{className:"flex items-center gap-2 pl-3 pr-2",children:[l.jsx(sb,{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(Of.Trigger,{})]})}),l.jsx(Of.Nav,{children:OLt.map(S=>{const w=S.items.filter(v),O=w.some(_=>ple(_,s)),E=!!(S.href&&s===S.href&&!O);return l.jsxs(Of.NavSection,{children:[S.title?l.jsx(Of.NavHeader,{LinkComponent:e,state:t,href:S.href,isActive:E,children:S.title}):null,l.jsx(Of.NavList,{children:w.map(_=>l.jsx(Of.NavLink,{LinkComponent:e,state:t,link:iKe(_),isActive:ple(_,s)},_.name))})]},S.key)})}),l.jsxs(Of.Bottom,{className:"pb-3",children:[b.length>0&&l.jsx(Of.NavList,{children:b.map(S=>l.jsx(Of.NavLink,{LinkComponent:e,state:t,link:iKe(S),isActive:ple(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(BZr,{collapsed:!1})]})]})]})}function CLt({children:e,loginUrl:t="/login",signupUrl:n="/signup"}){const{data:r,isLoading:s}=oI();if(s)return l.jsx(l.Fragment,{children:e});if(!r?.enabled)return l.jsx(l.Fragment,{children:e});if(uD(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(sb,{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(sb,{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(qet,{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(K3t,{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 TLt="experimental-ui:",jLt="current",xrs=Ee.createContext(null);function wrs(e,t){const n=window.localStorage.getItem(TLt+e);return n&&t.has(n)?n:jLt}function Srs({experiments:e,children:t}){const n=Ee.useMemo(()=>new Map(e.map(c=>[c.key,new Set(c.variants.map(u=>u.value))])),[e]),[r,s]=Ee.useState({});Ee.useLayoutEffect(()=>{const c={};for(const u of e){const d=n.get(u.key);c[u.key]=wrs(u.key,d)}s(c)},[e,n]);const a=Ee.useCallback(c=>r[c]??jLt,[r]),i=Ee.useCallback((c,u)=>{window.localStorage.setItem(TLt+c,u),s(d=>({...d,[c]:u}))},[]),o=Ee.useMemo(()=>({experiments:e,getVariant:a,setVariant:i}),[e,a,i]);return l.jsx(xrs.Provider,{value:o,children:t})}const krs=[{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"}]}],Ors=()=>({experimentalUIEnabled:typeof window<"u"&&window.MASTRA_EXPERIMENTAL_UI==="true"}),_rs=()=>{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}},aEe=()=>{const{requestContext:e}=Vs(),t=We();return Et({queryKey:["processors"],queryFn:()=>t.listProcessors(e)})},ILt=(e,t)=>{const n=We(),{requestContext:r}=Vs();return Et({queryKey:["processor",e],queryFn:()=>n.getProcessor(e).details(r),enabled:!!e})},Ers=()=>{const e=We(),{requestContext:t}=Vs();return ar({mutationFn:async({processorId:n,phase:r,messages:s,agentId:a})=>e.getProcessor(n).execute({phase:r,messages:s,agentId:a,requestContext:t})})},Crs=()=>{const{open:e,setOpen:t}=_rs(),{navigate:n,paths:r}=dn(),{isMastraPlatform:s}=ELt(),a=Nq(),{data:i={}}=Zv(),{data:o={}}=Kw(),{data:c={}}=LH(),{data:u={}}=aEe(),{data:d=[]}=OH(),{data:f={}}=Cp(),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(DYn,{open:e,onOpenChange:t,title:"Navigation",description:"Search and navigate to any entity",children:[l.jsx($wt,{placeholder:"Search or navigate..."}),l.jsxs(Dwt,{children:[l.jsx(Lwt,{children:"No results found."}),l.jsxs(Yx,{heading:"Navigation",children:[a&&l.jsxs(Tl,{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(zwt,{children:"Ctrl+B"})]}),l.jsxs(Tl,{value:"all agents",onSelect:()=>p("/agents"),children:[l.jsx(Ll,{className:"text-neutral3"}),l.jsx("span",{children:"All Agents"})]}),l.jsxs(Tl,{value:"all workflows",onSelect:()=>p("/workflows"),children:[l.jsx(yu,{className:"text-neutral3"}),l.jsx("span",{children:"All Workflows"})]}),l.jsxs(Tl,{value:"all tools",onSelect:()=>p("/tools"),children:[l.jsx(vu,{className:"text-neutral3"}),l.jsx("span",{children:"All Tools"})]}),l.jsxs(Tl,{value:"all scorers",onSelect:()=>p("/scorers"),children:[l.jsx(du,{className:"text-neutral3"}),l.jsx("span",{children:"All Scorers"})]}),l.jsxs(Tl,{value:"all processors",onSelect:()=>p("/processors"),children:[l.jsx(cP,{className:"text-neutral3"}),l.jsx("span",{children:"All Processors"})]}),l.jsxs(Tl,{value:"all mcp servers",onSelect:()=>p("/mcps"),children:[l.jsx(kv,{className:"text-neutral3"}),l.jsx("span",{children:"All MCP Servers"})]}),l.jsxs(Tl,{value:"observability traces",onSelect:()=>p("/observability"),children:[l.jsx(iu,{className:"text-neutral3"}),l.jsx("span",{children:"Observability"})]}),!s&&l.jsxs(l.Fragment,{children:[l.jsxs(Tl,{value:"settings",onSelect:()=>p("/settings"),children:[l.jsx(gwt,{className:"text-neutral3"}),l.jsx("span",{children:"Settings"})]}),l.jsxs(Tl,{value:"templates",onSelect:()=>p("/templates"),children:[l.jsx(BS,{className:"text-neutral3"}),l.jsx("span",{children:"Templates"})]})]})]}),h.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(rS,{}),l.jsx(Yx,{heading:"Agents",children:h.map(([S,w])=>l.jsxs(Ee.Fragment,{children:[l.jsxs(Tl,{value:`${w.name} chat agent`,onSelect:()=>p(r.agentLink(S)),children:[l.jsx(Ll,{className:"text-neutral3"}),l.jsxs("span",{children:[w.name,": Chat"]})]}),l.jsxs(Tl,{value:`${w.name} traces agent observability`,onSelect:()=>p(`/observability?entity=${S}`),children:[l.jsx(iu,{className:"text-neutral3"}),l.jsxs("span",{children:[w.name,": Traces"]})]})]},S))})]}),m.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(rS,{}),l.jsx(Yx,{heading:"Workflows",children:m.map(([S,w])=>l.jsxs(Ee.Fragment,{children:[l.jsxs(Tl,{value:`${w.name} graph workflow view`,onSelect:()=>p(r.workflowLink(S)),children:[l.jsx(yu,{className:"text-neutral3"}),l.jsxs("span",{children:[w.name,": Graph"]})]}),l.jsxs(Tl,{value:`${w.name} traces workflow observability`,onSelect:()=>p(`/observability?entity=${w.name}`),children:[l.jsx(iu,{className:"text-neutral3"}),l.jsxs("span",{children:[w.name,": Traces"]})]})]},S))})]}),g.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(rS,{}),l.jsx(Yx,{heading:"Tools",children:g.map(([S,w])=>l.jsxs(Tl,{value:`tool ${w.id}`,onSelect:()=>p(r.toolLink(S)),children:[l.jsx(vu,{className:"text-neutral3"}),l.jsx("span",{children:w.id})]},S))})]}),b.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(rS,{}),l.jsx(Yx,{heading:"Scorers",children:b.map(([S,w])=>{const O=w.scorer?.config?.name||w.scorer?.config?.id||S;return l.jsxs(Tl,{value:`scorer ${O}`,onSelect:()=>p(r.scorerLink(S)),children:[l.jsx(du,{className:"text-neutral3"}),l.jsx("span",{children:O})]},S)})})]}),v.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(rS,{}),l.jsx(Yx,{heading:"Processors",children:v.map(S=>{const w=S.name||S.id,O=S.isWorkflow?r.workflowLink(S.id)+"/graph":r.processorLink(S.id);return l.jsxs(Tl,{value:`processor ${w}`,onSelect:()=>p(O),children:[l.jsx(cP,{className:"text-neutral3"}),l.jsx("span",{children:w})]},S.id)})})]}),d.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(rS,{}),l.jsx(Yx,{heading:"MCP Servers",children:d.map(S=>l.jsxs(Tl,{value:`mcp server ${S.name}`,onSelect:()=>p(r.mcpServerLink(S.id)),children:[l.jsx(kv,{className:"text-neutral3"}),l.jsx("span",{children:S.name})]},S.id))})]})]})]})};function Trs(){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(Of.MobileTrigger,{}),l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(sb,{className:"size-[1.5rem] shrink-0"}),l.jsx("span",{className:"font-serif text-sm whitespace-nowrap",children:"Mastra Studio"})]})]})}function jrs({children:e}){const{data:t,isFetched:n}=oI(),{pathname:r}=Pc(),{crumbs:s}=NSt(),a=ASt(),i=Isr(a??s),c=!(n&&t?.enabled&&!uD(t));return l.jsxs(l.Fragment,{children:[l.jsx(Crs,{}),l.jsxs("div",{className:X("h-full",c&&"lg:grid lg:grid-cols-[auto_1fr] lg:grid-rows-[1fr]"),children:[c&&l.jsx(brs,{}),l.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[c&&l.jsx(Trs,{}),c&&l.jsx("div",{className:"mx-1.5 mt-1 shrink-0 lg:mx-2 lg:mt-1.5",children:l.jsx(Csr,{})}),l.jsx(l1t.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(CLt,{children:l.jsx(ker,{resetKeys:[r],children:e})})})})]})]})]})}const Irs=({children:e})=>{const{experimentalUIEnabled:t}=Ors();return l.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[l.jsx(owt,{position:"bottom-right"}),l.jsx(fwt,{defaultTheme:"dark",children:l.jsx(ud,{delayDuration:0,children:l.jsx(Srs,{experiments:t?krs:[],children:l.jsx(bKn,{children:l.jsx(ksr,{children:l.jsx(Tsr,{children:l.jsx(jrs,{children:e})})})})})})})]})},Nrs=({children:e})=>l.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[l.jsx(owt,{position:"bottom-right"}),l.jsx(fwt,{defaultTheme:"dark",children:l.jsx(ud,{delayDuration:0,children:l.jsx("div",{className:"h-full overflow-y-auto",children:l.jsx(CLt,{children:e})})})})]});function hle(){const{agentId:e}=Mr();return e?l.jsx(NWr,{value:e,variant:"ghost",size:"sm"}):null}function Ars(){const{toolId:e}=Mr();return e??null}const Rrs=({children:e})=>{const{agentId:t}=Mr(),n=Pc(),{isCmsAvailable:r}=o4(),{hasObservability:s}=HZr(),a=ime.has("datasets"),i=r&&a,o=s&&a,{data:c}=dd(t),u=uu(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(pr,{children:[l.jsx(qXr,{agentId:t,activeTab:p,showPlayground:i,showObservability:o,rightSlot:h?l.jsx(VXr,{requestContextSchema:f}):void 0}),e]});return l.jsx(rD,{children:l.jsx(zHr,{defaultProvider:u,defaultModel:d,children:l.jsx(NXr,{children:l.jsx(FHr,{children:m})})})})};function oKe(){const{serverId:e}=Mr();return e?l.jsx(b3t,{value:e,variant:"ghost"}):null}function Prs(){const{serverId:e,toolId:t}=Mr(),{data:n}=u_e(e??"",t??"",{enabled:!!e&&!!t});return n?.name??t??null}function Mrs({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}=aEe(),{navigate:p,paths:h}=dn();y.useEffect(()=>{if(d){const v=f instanceof Error?f.message:"Failed to load processors";Be.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(Nc,{options:m,value:e,onValueChange:g,placeholder:u?"Loading processors...":n,searchPlaceholder:r,emptyText:s,className:a,disabled:i||u||d,variant:o})}function $rs(){const{processorId:e}=Mr();return e?l.jsx(Mrs,{value:e,variant:"ghost"}):null}function Drs(){const{promptBlockId:e}=Mr(),{data:t,isLoading:n}=l4(e,{status:"draft"});return e?n?l.jsx(ns,{className:"h-5 w-36"}):t?.name??"Prompt block not found":null}function Lrs(){const{scorerId:e}=Mr();return e?l.jsx(iWr,{value:e,variant:"ghost"}):null}function zrs(){const{scorerId:e}=Mr(),{data:t,isLoading:n}=K4t(e,{status:"draft"});return e?n?l.jsx(ns,{className:"h-5 w-36"}):t?.name??"Scorer not found":null}function Frs(){const{toolId:e}=Mr();return e?l.jsx(Pts,{value:e,variant:"ghost"}):null}function Brs(){const{traceId:e}=Mr();return e?l.jsx(o1t,{untilChar:"-",copy:!0,children:e}):null}function Urs(){const{workflowId:e}=Mr();return e?l.jsx(tPr,{value:e,variant:"ghost"}):null}function qrs(){const{runId:e}=Mr();return e?l.jsx(o1t,{untilChar:"-",copy:!0,children:e}):null}const Vrs=({children:e,options:t})=>{const n=new bGn({...t,defaultOptions:{...t?.defaultOptions,queries:{retry:Ctr,...t?.defaultOptions?.queries}}});return l.jsx(xGn,{client:n,children:e})},Hrs=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(di,{iconSlot:l.jsx(Yd,{}),titleSlot:"No Processors yet",descriptionSlot:"Configure processors. Add input or output processors to your agents to transform messages.",actionSlot:l.jsxs(he,{variant:"ghost",as:"a",href:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",children:["Processors Documentation ",l.jsx(Ba,{})]})})}),Zrs=["input","inputStep","outputStep","outputStream","outputResult"];function Wrs({processors:e,isLoading:t,search:n=""}){const{paths:r,Link:s}=dn(),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(Bd,{columns:"auto 1fr auto auto auto auto auto auto"}):l.jsxs(Oe,{columns:"auto 1fr auto auto auto auto auto auto",children:[l.jsxs(Oe.Top,{children:[l.jsx(Oe.TopCell,{children:"Name"}),l.jsx(Oe.TopCell,{children:"Description"}),l.jsx(Oe.TopCellSmart,{long:"Input",short:"Input",tooltip:"Contains Input phase",className:"text-center"}),l.jsx(Oe.TopCellSmart,{long:"Input Step",short:l.jsxs(l.Fragment,{children:[l.jsx(Y0,{})," Step"]}),tooltip:"Contains Input Step phase",className:"text-center"}),l.jsx(Oe.TopCellSmart,{long:"Output Step",short:l.jsxs(l.Fragment,{children:[l.jsx(Zf,{})," Step"]}),tooltip:"Contains Output Step phase",className:"text-center"}),l.jsx(Oe.TopCellSmart,{long:"Output Stream",short:l.jsxs(l.Fragment,{children:[l.jsx(Zf,{})," Stream"]}),tooltip:"Contains Output Stream phase",className:"text-center"}),l.jsx(Oe.TopCellSmart,{long:"Output Result",short:l.jsxs(l.Fragment,{children:[l.jsx(Zf,{})," Result"]}),tooltip:"Contains Output Result phase",className:"text-center"}),l.jsx(Oe.TopCellSmart,{short:"Used by",long:"Used by Agents",className:"text-center"})]}),i.length===0&&n?l.jsx(Oe.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(Oe.RowLink,{to:p,LinkComponent:s,children:[l.jsx(Oe.NameCell,{children:c}),l.jsx(Oe.DescriptionCell,{children:u}),Zrs.map(h=>l.jsx(Oe.TextCell,{className:"text-center",children:f.has(h)&&l.jsx(ni,{className:"size-4 mx-auto"})},h)),l.jsx(Oe.TextCell,{className:"text-center",children:d||""})]},o.id)})]})}function Grs(){const{data:e={},isLoading:t,error:n}=aEe(),[r,s]=y.useState("");return n&&Bs(n)?l.jsx(cr,{children:l.jsx(fa,{})}):n&&qs(n)?l.jsx(cr,{children:l.jsx(sa,{resource:"processors"})}):n?l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load processors",message:n.message})}):Object.keys(e).length===0&&!t?l.jsx(cr,{children:l.jsx(Hrs,{})}):l.jsxs(Tn,{children:[l.jsx(Tn.TopArea,{children:l.jsx("div",{className:"max-w-120",children:l.jsx(Fv,{onSearch:s,label:"Filter processors",placeholder:"Filter by name"})})}),l.jsx(Wrs,{processors:e,isLoading:t,search:r})]})}const Qrs={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 Yrs({processorId:e}){const{data:t,isLoading:n,error:r}=ILt(e);return y.useEffect(()=>{if(r){const s=r instanceof Error?r.message:"Failed to load processor";Be.error(`Error loading processor: ${s}`)}},[r]),n?l.jsxs("div",{className:"p-6",children:[l.jsx(ns,{className:"h-8 w-48 mb-4"}),l.jsx(ns,{className:"h-32 w-full"})]}):r?null:t?l.jsx(Xrs,{processor:t}):l.jsx("div",{className:"py-12 text-center px-6",children:l.jsx(be,{variant:"header-md",className:"text-neutral3",children:"Processor not found"})})}function Xrs({processor:e}){const t=Qb(),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=Ers(),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(Oh,{hasLeftServiceColumn:!0,className:"relative",children:[l.jsxs("div",{className:"bg-surface2 border-r border-border1 w-[22rem] overflow-y-auto",children:[l.jsx(Krs,{processor:e}),l.jsxs("div",{className:"p-5 space-y-5",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(be,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Phase"}),l.jsxs(fi,{value:r,onValueChange:v=>s(v),children:[l.jsx(Ka,{className:"w-full",children:l.jsx(pi,{placeholder:"Select phase"})}),l.jsx(Ja,{children:e.phases.map(v=>l.jsx(os,{value:v,children:v},v))})]}),l.jsx(be,{variant:"ui-xs",className:"text-neutral4",children:Qrs[r]})]}),e.configurations.length>1&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(be,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Agent Configuration"}),l.jsxs(fi,{value:a,onValueChange:i,children:[l.jsx(Ka,{className:"w-full",children:l.jsx(pi,{placeholder:"Select agent"})}),l.jsx(Ja,{children:e.configurations.map(v=>l.jsxs(os,{value:v.agentId,children:[v.agentName," (",v.type,")"]},v.agentId))})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(be,{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(he,{onClick:m,disabled:h.isPending||r==="outputStream",className:"w-full",children:h.isPending?"Running...":"Run Processor"}),r==="outputStream"&&l.jsx(be,{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(be,{variant:"ui-sm",className:"text-neutral3",children:"Status"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ct,{variant:u.success?"success":"error",children:u.success?"Success":"Failed"}),u.tripwire?.triggered&&l.jsx(Ct,{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(be,{variant:"ui-sm",className:"text-accent6 font-medium",children:"Tripwire Reason"}),l.jsx(be,{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(ua,{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(gu,{value:f||g,editable:!0,theme:t,extensions:[Gf]})})]})}function Krs({processor:e}){return l.jsxs("div",{className:"px-5 pt-5 pb-4 border-b border-border1",children:[l.jsx(be,{variant:"header-md",className:"text-neutral1 mb-2",children:e.name||e.id}),e.name&&e.name!==e.id&&l.jsx(be,{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(Ct,{variant:"default",children:t},t))}),l.jsx("div",{className:"mt-3",children:l.jsxs(be,{variant:"ui-xs",className:"text-neutral4",children:["Attached to ",e.configurations.length," agent",e.configurations.length!==1?"s":""]})})]})}function Jrs(){const{processorId:e}=Mr(),{data:t,isLoading:n,error:r}=ILt(e);return r&&Bs(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(fa,{})}):r&&qs(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(sa,{resource:"processors"})}):!n&&t?.isWorkflow?l.jsx(Ttn,{to:`/workflows/${e}/graph`,replace:!0}):n?l.jsxs("div",{className:"p-6",children:[l.jsx(ns,{className:"h-8 w-48 mb-4"}),l.jsx(ns,{className:"h-32 w-full"})]}):l.jsx("div",{className:"h-full w-full overflow-y-hidden",children:l.jsx(Yrs,{processorId:e})})}function ess(){const{data:e={},isLoading:t,error:n}=Zv(),{data:r={},isLoading:s,error:a}=LH(),[i,o]=y.useState(""),c=t||s,u=a||n;return u&&Bs(u)?l.jsx(cr,{children:l.jsx(fa,{})}):u&&qs(u)?l.jsx(cr,{children:l.jsx(sa,{resource:"tools"})}):u?l.jsx(cr,{children:l.jsx(rc,{title:"Failed to load tools",message:u.message})}):Object.keys(r).length===0&&!c?l.jsx(cr,{children:l.jsx(Nts,{})}):l.jsxs(Tn,{children:[l.jsx(Tn.TopArea,{children:l.jsx("div",{className:"max-w-120",children:l.jsx(Fv,{onSearch:o,label:"Filter tools",placeholder:"Filter by name"})})}),l.jsx(Its,{tools:r,agents:e,isLoading:c,search:i})]})}const NLt={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/${po()}`,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}`},tss=()=>{const e=ku(),t=n=>e(n,{viewTransition:!0});return l.jsx(ISt,{Link:hV,navigate:t,paths:NLt,children:l.jsx(Irs,{children:l.jsx(QC,{})})})},nss=()=>{const e=ku(),t=n=>e(n,{viewTransition:!0});return l.jsx(ISt,{Link:hV,navigate:t,paths:NLt,children:l.jsx(Nrs,{children:l.jsx(QC,{})})})},rss=!!window.MASTRA_CLOUD_API_ENDPOINT,lKe=ime.has("datasets"),cKe=[{index:!0,element:l.jsx(BKr,{})},{path:"instruction-blocks",element:l.jsx(UKr,{})},{path:"tools",element:l.jsx(ZKr,{})},{path:"agents",element:l.jsx(LKr,{})},{path:"scorers",element:l.jsx(VKr,{})},{path:"workflows",element:l.jsx(GKr,{})},{path:"skills",element:l.jsx(HKr,{})},{path:"memory",element:l.jsx(qKr,{})},{path:"variables",element:l.jsx(WKr,{})}],uKe={id:"workflow-schedules",label:"Schedules",icon:zM,to:"/workflows/schedules"},Zx=e=>{if(!e)return"";try{return decodeURIComponent(e)}catch{return e}},sss=[{path:"/login",element:l.jsx(kts,{})},{path:"/signup",element:l.jsx(fns,{})},{element:l.jsx(nss,{}),children:[{path:"/agents/:agentId/session",element:l.jsx(CXe,{})},{path:"/agents/:agentId/session/:threadId",element:l.jsx(CXe,{})}]},{element:l.jsx(tss,{}),children:[...rss?[]:[{path:"/settings",element:l.jsx(dns,{}),handle:Vl("/settings")},{path:"/templates",element:l.jsx(gns,{}),handle:{crumbs:[{id:"templates",label:"Templates"}]}},{path:"/templates/:templateSlug",element:l.jsx(kns,{}),handle:{crumbs:({params:e})=>[{id:"templates",label:"Templates",to:"/templates"},{id:"template",label:Zx(e.templateSlug)}]}}],{path:"/logs",element:l.jsx(Ots,{}),handle:Vl("/logs")},{path:"/evaluation",element:l.jsx(xts,{}),handle:Vl("/evaluation")},{path:"/scorers",element:l.jsx(lns,{}),handle:Vl("/scorers")},{path:"/scorers/:scorerId",element:l.jsx(cns,{}),handle:Bc("/scorers",[{id:"scorer",Component:Lrs,heading:"Scorer"}])},{path:"/metrics",element:l.jsx(nns,{}),handle:Vl("/metrics")},{path:"/observability",element:l.jsx(nLt,{}),handle:Vl("/observability")},{path:"/traces/:traceId",element:l.jsx(Ens,{}),handle:Bc("/observability",[{id:"trace",Component:Brs,heading:"Trace"}])},{path:"/resources",element:l.jsx(ons,{}),handle:Vl("/resources")},{path:"/agents",element:l.jsx(Ibr,{}),handle:Vl("/agents")},{path:"/cms/agents/create",element:l.jsx(zKr,{}),handle:Bc("/agents",[{id:"create-agent",label:"Create agent"}]),children:cKe},{path:"/cms/agents/:agentId/edit",element:l.jsx(FKr,{}),handle:Bc("/agents",[{id:"agent",Component:hle,heading:"Agent"}]),children:cKe},{path:"/cms/scorers/create",element:l.jsx(KKr,{}),handle:Bc("/scorers",[{id:"create-scorer",label:"Create scorer"}])},{path:"/cms/scorers/:scorerId/edit",element:l.jsx(eJr,{}),handle:Bc("/scorers",[{id:"scorer",Component:zrs,heading:"Scorer"}])},{path:"/prompts",element:l.jsx(sns,{}),handle:Vl("/prompts")},{path:"/cms/prompts/create",element:l.jsx(QKr,{}),handle:Bc("/prompts",[{id:"create-prompt-block",label:"Create prompt block"}])},{path:"/cms/prompts/:promptBlockId/edit",element:l.jsx(XKr,{}),handle:Bc("/prompts",[{id:"prompt-block",Component:Drs,heading:"Prompt block"}])},{path:"/agents/:agentId/tools/:toolId",element:l.jsx(Ons,{}),handle:Bc("/agents",[{id:"agent",Component:hle,heading:"Agent"},{id:"agent-tool",Component:Ars,heading:"Agent tool"}])},{path:"/agents/:agentId",element:l.jsx(Rrs,{children:l.jsx(QC,{})}),handle:Bc("/agents",[{id:"agent",Component:hle,heading:"Agent"}]),children:[{index:!0,loader:({params:e})=>bG(`/agents/${e.agentId}/chat`)},{path:"chat",element:l.jsx(_Xe,{})},{path:"chat/:threadId",element:l.jsx(_Xe,{})},...lKe?[{path:"editor",element:l.jsx(NKr,{})},{path:"evaluate",element:l.jsx(IKr,{})},{path:"review",element:l.jsx(AKr,{})}]:[],{path:"traces",element:l.jsx(DKr,{})}]},{path:"/tools",element:l.jsx(ess,{}),handle:Vl("/tools")},{path:"/tools/:toolId",element:l.jsx(_ns,{}),handle:Bc("/tools",[{id:"tool",Component:Frs,heading:"Tool"}])},{path:"/processors",element:l.jsx(Grs,{}),handle:Vl("/processors")},{path:"/processors/:processorId",element:l.jsx(Jrs,{}),handle:Bc("/processors",[{id:"processor",Component:$rs,heading:"Processor"}])},{path:"/mcps",element:l.jsx(Tts,{}),handle:Vl("/mcps")},{path:"/mcps/:serverId",element:l.jsx(zts,{}),handle:Bc("/mcps",[{id:"mcp-server",Component:oKe,heading:"MCP server"}])},{path:"/mcps/:serverId/tools/:toolId",element:l.jsx(Uts,{}),handle:Bc("/mcps",[{id:"mcp-server",Component:oKe,heading:"MCP server"},{id:"mcp-server-tool",Component:Prs,heading:"MCP server tool"}])},{path:"/workspaces",element:l.jsx(aKe,{}),handle:Vl("/workspaces")},{path:"/workspaces/:workspaceId",element:l.jsx(aKe,{}),handle:Vl("/workspaces")},{path:"/workspaces/:workspaceId/skills/:skillName",element:l.jsx(yrs,{}),handle:{crumbs:({params:e})=>[om("/workspaces"),{id:"workspace",label:Zx(e.workspaceId),to:e.workspaceId?`/workspaces/${encodeURIComponent(e.workspaceId)}`:void 0},{id:"skill",label:Zx(e.skillName)}]}},{path:"/workflows",element:l.jsx(Cns,{}),handle:Vl("/workflows")},{path:"/workflows/schedules",element:l.jsx(Uns,{}),handle:Bc("/workflows",[uKe])},{path:"/workflows/schedules/:scheduleId",element:l.jsx(zns,{}),handle:{crumbs:({params:e})=>[om("/workflows"),uKe,{id:"schedule",label:Zx(e.scheduleId),icon:zM}]}},{path:"/workflows/:workflowId",element:l.jsx(lvr,{children:l.jsx(QC,{})}),handle:Bc("/workflows",[{id:"workflow",Component:Urs,heading:"Workflow"}]),children:[{index:!0,loader:({params:e})=>bG(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:l.jsx(nKe,{})},{path:"graph/:runId",element:l.jsx(nKe,{}),handle:{crumbs:[{id:"workflow-run",Component:qrs,heading:"Workflow run"}]}}]},...lKe?[{path:"/datasets",element:l.jsx(Kes,{}),handle:Vl("/datasets")},{path:"/datasets/:datasetId",element:l.jsx(ets,{}),handle:{crumbs:()=>[om("/datasets"),{id:"dataset",Component:z1,heading:"Dataset"}]}},{path:"/datasets/:datasetId/items/:itemId",element:l.jsx(rts,{}),handle:{crumbs:({params:e})=>[om("/datasets"),{id:"dataset",Component:z1,heading:"Dataset"},{id:"dataset-item",label:Zx(e.itemId)}]}},{path:"/datasets/:datasetId/items/:itemId/versions",element:l.jsx(its,{}),handle:{crumbs:({params:e})=>[om("/datasets"),{id:"dataset",Component:z1,heading:"Dataset"},{id:"dataset-item",label:Zx(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(tts,{}),handle:{crumbs:({params:e})=>[om("/datasets"),{id:"dataset",Component:z1,heading:"Dataset"},{id:"dataset-experiment",label:Zx(e.experimentId)}]}},{path:"/experiments",element:l.jsx(wts,{}),handle:Vl("/experiments")},{path:"/experiments/:experimentId",element:l.jsx(Sts,{}),handle:{crumbs:({params:e})=>[om("/experiments"),{id:"experiment",label:Zx(e.experimentId)}]}},{path:"/datasets/:datasetId/experiments",element:l.jsx(nts,{}),handle:{crumbs:()=>[om("/datasets"),{id:"dataset",Component:z1,heading:"Dataset"},{id:"dataset-experiments",label:"Experiments"}]}},{path:"/datasets/:datasetId/items",element:l.jsx(sts,{}),handle:{crumbs:()=>[om("/datasets"),{id:"dataset",Component:z1,heading:"Dataset"},{id:"dataset-items",label:"Items"}]}},{path:"/datasets/:datasetId/versions",element:l.jsx(lts,{}),handle:{crumbs:()=>[om("/datasets"),{id:"dataset",Component:z1,heading:"Dataset"},{id:"dataset-versions",label:"Versions"}]}}]:[],{index:!0,loader:()=>bG("/agents")},{path:"/request-context",element:l.jsx(ans,{}),handle:Vl("/request-context")}]}];function ass(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:n,apiPrefix:r,isLoading:s}=N_e(),a=y.useMemo(()=>t?xKr(t,r):void 0,[t,r]),i=y.useMemo(()=>({...n,"x-mastra-client-type":"studio"}),[n]),o=y.useMemo(()=>enn(sss,{basename:e}),[e]);return s?null:t?l.jsx(CJt,{baseUrl:t,headers:i,apiPrefix:r,customFetch:a,children:l.jsx(wbr,{children:l.jsx(_tn,{router:o})})}):l.jsx(VZr,{})}function iss(){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(Vrs,{children:l.jsx(aZr,{endpoint:i,defaultApiPrefix:r,children:l.jsx(ass,{})})})}U6t.createRoot(document.getElementById("root")).render(l.jsx(y.StrictMode,{children:l.jsx(iss,{})}));const Jis=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{fst as A,iot as B,hst as C,ait as D,mp as E,fh as F,Jis as G,Oa as I,pk as L,dst as N,RKt as a,QKt as b,Kis as c,bNe as d,mk as e,HKt as f,fC as g,GKt as h,wO as i,SO as j,xO as k,vcn as l,fit as m,ck as n,ri as o,Aln as p,Nln as q,bve as r,nge as s,oe as t,Kz as u,wd as v,LKt as w,St as x,ft as y,jot as z};
|