mastra 0.2.0-alpha.151 → 0.2.0-alpha.152
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.
|
@@ -194,7 +194,7 @@ Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}
|
|
|
194
194
|
* This source code is licensed under the ISC license.
|
|
195
195
|
* See the LICENSE file in the root directory of this source tree.
|
|
196
196
|
*/const _a=Ut("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function wR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=wR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function lm(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=wR(e))&&(r&&(r+=" "),r+=t);return r}var su=eR();const bR=nu(su);var dV=e=>{switch(e){case"success":return pV;case"info":return gV;case"warning":return mV;case"error":return yV;default:return null}},fV=Array(12).fill(0),hV=({visible:e,className:t})=>ne.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ne.createElement("div",{className:"sonner-spinner"},fV.map((n,r)=>ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),pV=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),mV=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ne.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"})),gV=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),yV=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),xV=ne.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"},ne.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ne.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),vV=()=>{let[e,t]=ne.useState(document.hidden);return ne.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},jw=1,wV=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:jw++,o=this.toasts.find(a=>a.id===i),s=e.dismissible===void 0?!0:e.dismissible;return o?this.toasts=this.toasts.map(a=>a.id===i?(this.publish({...a,...e,id:i,title:n}),{...a,...e,id:i,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),i=n!==void 0,o,s=r.then(async u=>{if(o=["resolve",u],ne.isValidElement(u))i=!1,this.create({id:n,type:"default",message:u});else if(kV(u)&&!u.ok){i=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,f=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description;this.create({id:n,type:"error",message:c,description:f})}else if(t.success!==void 0){i=!1;let c=typeof t.success=="function"?await t.success(u):t.success,f=typeof t.description=="function"?await t.description(u):t.description;this.create({id:n,type:"success",message:c,description:f})}}).catch(async u=>{if(o=["reject",u],t.error!==void 0){i=!1;let c=typeof t.error=="function"?await t.error(u):t.error,f=typeof t.description=="function"?await t.description(u):t.description;this.create({id:n,type:"error",message:c,description:f})}}).finally(()=>{var u;i&&(this.dismiss(n),n=void 0),(u=t.finally)==null||u.call(t)}),a=()=>new Promise((u,c)=>s.then(()=>o[0]==="reject"?c(o[1]):u(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||jw++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},Nr=new wV,bV=(e,t)=>{let n=(t==null?void 0:t.id)||jw++;return Nr.addToast({title:e,...t,id:n}),n},kV=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",SV=bV,EV=()=>Nr.toasts,nn=Object.assign(SV,{success:Nr.success,info:Nr.info,warning:Nr.warning,error:Nr.error,custom:Nr.custom,message:Nr.message,promise:Nr.promise,dismiss:Nr.dismiss,loading:Nr.loading},{getHistory:EV});function CV(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}CV(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
197
|
-
`);function kh(e){return e.label!==void 0}var _V=3,NV="32px",TV="16px",SC=4e3,AV=356,PV=14,RV=20,MV=200;function di(...e){return e.filter(Boolean).join(" ")}function DV(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var jV=e=>{var t,n,r,i,o,s,a,u,c,f,h;let{invert:p,toast:m,unstyled:x,interacting:v,setHeights:k,visibleToasts:b,heights:E,index:C,toasts:N,expanded:P,removeToast:T,defaultRichColors:D,closeButton:R,style:I,cancelButtonStyle:M,actionButtonStyle:z,className:F="",descriptionClassName:Y="",duration:O,position:q,gap:W,loadingIcon:Z,expandByDefault:U,classNames:B,icons:L,closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:V}=e,[j,G]=ne.useState(null),[K,J]=ne.useState(null),[ee,ie]=ne.useState(!1),[ce,he]=ne.useState(!1),[Ee,fe]=ne.useState(!1),[xe,Me]=ne.useState(!1),[Ve,ot]=ne.useState(!1),[_t,Q]=ne.useState(0),[oe,ue]=ne.useState(0),Se=ne.useRef(m.duration||O||SC),we=ne.useRef(null),ge=ne.useRef(null),Ae=C===0,Fe=C+1<=b,se=m.type,pe=m.dismissible!==!1,Oe=m.className||"",et=m.descriptionClassName||"",rt=ne.useMemo(()=>E.findIndex(Ye=>Ye.toastId===m.id)||0,[E,m.id]),Rt=ne.useMemo(()=>{var Ye;return(Ye=m.closeButton)!=null?Ye:R},[m.closeButton,R]),Ke=ne.useMemo(()=>m.duration||O||SC,[m.duration,O]),st=ne.useRef(0),it=ne.useRef(0),Ht=ne.useRef(0),pt=ne.useRef(null),[gn,yt]=q.split("-"),yn=ne.useMemo(()=>E.reduce((Ye,wt,Nt)=>Nt>=rt?Ye:Ye+wt.height,0),[E,rt]),dt=vV(),Fr=m.invert||p,ar=se==="loading";it.current=ne.useMemo(()=>rt*W+yn,[rt,yn]),ne.useEffect(()=>{Se.current=Ke},[Ke]),ne.useEffect(()=>{ie(!0)},[]),ne.useEffect(()=>{let Ye=ge.current;if(Ye){let wt=Ye.getBoundingClientRect().height;return ue(wt),k(Nt=>[{toastId:m.id,height:wt,position:m.position},...Nt]),()=>k(Nt=>Nt.filter(Dn=>Dn.toastId!==m.id))}},[k,m.id]),ne.useLayoutEffect(()=>{if(!ee)return;let Ye=ge.current,wt=Ye.style.height;Ye.style.height="auto";let Nt=Ye.getBoundingClientRect().height;Ye.style.height=wt,ue(Nt),k(Dn=>Dn.find(Fn=>Fn.toastId===m.id)?Dn.map(Fn=>Fn.toastId===m.id?{...Fn,height:Nt}:Fn):[{toastId:m.id,height:Nt,position:m.position},...Dn])},[ee,m.title,m.description,k,m.id]);let Xn=ne.useCallback(()=>{he(!0),Q(it.current),k(Ye=>Ye.filter(wt=>wt.toastId!==m.id)),setTimeout(()=>{T(m)},MV)},[m,T,k,it]);ne.useEffect(()=>{if(m.promise&&se==="loading"||m.duration===1/0||m.type==="loading")return;let Ye;return P||v||V&&dt?(()=>{if(Ht.current<st.current){let wt=new Date().getTime()-st.current;Se.current=Se.current-wt}Ht.current=new Date().getTime()})():Se.current!==1/0&&(st.current=new Date().getTime(),Ye=setTimeout(()=>{var wt;(wt=m.onAutoClose)==null||wt.call(m,m),Xn()},Se.current)),()=>clearTimeout(Ye)},[P,v,m,se,V,dt,Xn]),ne.useEffect(()=>{m.delete&&Xn()},[Xn,m.delete]);function ii(){var Ye,wt,Nt;return L!=null&&L.loading?ne.createElement("div",{className:di(B==null?void 0:B.loader,(Ye=m==null?void 0:m.classNames)==null?void 0:Ye.loader,"sonner-loader"),"data-visible":se==="loading"},L.loading):Z?ne.createElement("div",{className:di(B==null?void 0:B.loader,(wt=m==null?void 0:m.classNames)==null?void 0:wt.loader,"sonner-loader"),"data-visible":se==="loading"},Z):ne.createElement(hV,{className:di(B==null?void 0:B.loader,(Nt=m==null?void 0:m.classNames)==null?void 0:Nt.loader),visible:se==="loading"})}return ne.createElement("li",{tabIndex:0,ref:ge,className:di(F,Oe,B==null?void 0:B.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,B==null?void 0:B.default,B==null?void 0:B[se],(n=m==null?void 0:m.classNames)==null?void 0:n[se]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:D,"data-styled":!(m.jsx||m.unstyled||x),"data-mounted":ee,"data-promise":!!m.promise,"data-swiped":Ve,"data-removed":ce,"data-visible":Fe,"data-y-position":gn,"data-x-position":yt,"data-index":C,"data-front":Ae,"data-swiping":Ee,"data-dismissible":pe,"data-type":se,"data-invert":Fr,"data-swipe-out":xe,"data-swipe-direction":K,"data-expanded":!!(P||U&&ee),style:{"--index":C,"--toasts-before":C,"--z-index":N.length-C,"--offset":`${ce?_t:it.current}px`,"--initial-height":U?"auto":`${oe}px`,...I,...m.style},onPointerDown:Ye=>{ar||!pe||(we.current=new Date,Q(it.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(fe(!0),pt.current={x:Ye.clientX,y:Ye.clientY}))},onPointerUp:()=>{var Ye,wt,Nt,Dn;if(xe||!pe)return;pt.current=null;let Fn=Number(((Ye=ge.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$n=Number(((wt=ge.current)==null?void 0:wt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),vr=new Date().getTime()-((Nt=we.current)==null?void 0:Nt.getTime()),xn=j==="x"?Fn:$n,$r=Math.abs(xn)/vr;if(Math.abs(xn)>=RV||$r>.11){Q(it.current),(Dn=m.onDismiss)==null||Dn.call(m,m),J(j==="x"?Fn>0?"right":"left":$n>0?"down":"up"),Xn(),Me(!0),ot(!1);return}fe(!1),G(null)},onPointerMove:Ye=>{var wt,Nt,Dn,Fn;if(!pt.current||!pe||((wt=window.getSelection())==null?void 0:wt.toString().length)>0)return;let $n=Ye.clientY-pt.current.y,vr=Ye.clientX-pt.current.x,xn=(Nt=e.swipeDirections)!=null?Nt:DV(q);!j&&(Math.abs(vr)>1||Math.abs($n)>1)&&G(Math.abs(vr)>Math.abs($n)?"x":"y");let $r={x:0,y:0};j==="y"?(xn.includes("top")||xn.includes("bottom"))&&(xn.includes("top")&&$n<0||xn.includes("bottom")&&$n>0)&&($r.y=$n):j==="x"&&(xn.includes("left")||xn.includes("right"))&&(xn.includes("left")&&vr<0||xn.includes("right")&&vr>0)&&($r.x=vr),(Math.abs($r.x)>0||Math.abs($r.y)>0)&&ot(!0),(Dn=ge.current)==null||Dn.style.setProperty("--swipe-amount-x",`${$r.x}px`),(Fn=ge.current)==null||Fn.style.setProperty("--swipe-amount-y",`${$r.y}px`)}},Rt&&!m.jsx?ne.createElement("button",{"aria-label":H,"data-disabled":ar,"data-close-button":!0,onClick:ar||!pe?()=>{}:()=>{var Ye;Xn(),(Ye=m.onDismiss)==null||Ye.call(m,m)},className:di(B==null?void 0:B.closeButton,(i=m==null?void 0:m.classNames)==null?void 0:i.closeButton)},(o=L==null?void 0:L.close)!=null?o:xV):null,m.jsx||S.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:ne.createElement(ne.Fragment,null,se||m.icon||m.promise?ne.createElement("div",{"data-icon":"",className:di(B==null?void 0:B.icon,(s=m==null?void 0:m.classNames)==null?void 0:s.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||ii():null,m.type!=="loading"?m.icon||(L==null?void 0:L[se])||dV(se):null):null,ne.createElement("div",{"data-content":"",className:di(B==null?void 0:B.content,(a=m==null?void 0:m.classNames)==null?void 0:a.content)},ne.createElement("div",{"data-title":"",className:di(B==null?void 0:B.title,(u=m==null?void 0:m.classNames)==null?void 0:u.title)},typeof m.title=="function"?m.title():m.title),m.description?ne.createElement("div",{"data-description":"",className:di(Y,et,B==null?void 0:B.description,(c=m==null?void 0:m.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),S.isValidElement(m.cancel)?m.cancel:m.cancel&&kh(m.cancel)?ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||M,onClick:Ye=>{var wt,Nt;kh(m.cancel)&&pe&&((Nt=(wt=m.cancel).onClick)==null||Nt.call(wt,Ye),Xn())},className:di(B==null?void 0:B.cancelButton,(f=m==null?void 0:m.classNames)==null?void 0:f.cancelButton)},m.cancel.label):null,S.isValidElement(m.action)?m.action:m.action&&kh(m.action)?ne.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||z,onClick:Ye=>{var wt,Nt;kh(m.action)&&((Nt=(wt=m.action).onClick)==null||Nt.call(wt,Ye),!Ye.defaultPrevented&&Xn())},className:di(B==null?void 0:B.actionButton,(h=m==null?void 0:m.classNames)==null?void 0:h.actionButton)},m.action.label):null))};function EC(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function OV(e,t){let n={};return[e,t].forEach((r,i)=>{let o=i===1,s=o?"--mobile-offset":"--offset",a=o?TV:NV;function u(c){["top","right","bottom","left"].forEach(f=>{n[`${s}-${f}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${s}-${c}`]=a:n[`${s}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):u(a)}),n}var IV=S.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:s,className:a,offset:u,mobileOffset:c,theme:f="light",richColors:h,duration:p,style:m,visibleToasts:x=_V,toastOptions:v,dir:k=EC(),gap:b=PV,loadingIcon:E,icons:C,containerAriaLabel:N="Notifications",pauseWhenPageIsHidden:P}=e,[T,D]=ne.useState([]),R=ne.useMemo(()=>Array.from(new Set([r].concat(T.filter(V=>V.position).map(V=>V.position)))),[T,r]),[I,M]=ne.useState([]),[z,F]=ne.useState(!1),[Y,O]=ne.useState(!1),[q,W]=ne.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=ne.useRef(null),U=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=ne.useRef(null),L=ne.useRef(!1),H=ne.useCallback(V=>{D(j=>{var G;return(G=j.find(K=>K.id===V.id))!=null&&G.delete||Nr.dismiss(V.id),j.filter(({id:K})=>K!==V.id)})},[]);return ne.useEffect(()=>Nr.subscribe(V=>{if(V.dismiss){D(j=>j.map(G=>G.id===V.id?{...G,delete:!0}:G));return}setTimeout(()=>{bR.flushSync(()=>{D(j=>{let G=j.findIndex(K=>K.id===V.id);return G!==-1?[...j.slice(0,G),{...j[G],...V},...j.slice(G+1)]:[V,...j]})})})}),[]),ne.useEffect(()=>{if(f!=="system"){W(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;let V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:j})=>{W(j?"dark":"light")})}catch{V.addListener(({matches:G})=>{try{W(G?"dark":"light")}catch(K){console.error(K)}})}},[f]),ne.useEffect(()=>{T.length<=1&&F(!1)},[T]),ne.useEffect(()=>{let V=j=>{var G,K;i.every(J=>j[J]||j.code===J)&&(F(!0),(G=Z.current)==null||G.focus()),j.code==="Escape"&&(document.activeElement===Z.current||(K=Z.current)!=null&&K.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[i]),ne.useEffect(()=>{if(Z.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,L.current=!1)}},[Z.current]),ne.createElement("section",{ref:t,"aria-label":`${N} ${U}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((V,j)=>{var G;let[K,J]=V.split("-");return T.length?ne.createElement("ol",{key:V,dir:k==="auto"?EC():k,tabIndex:-1,ref:Z,className:a,"data-sonner-toaster":!0,"data-theme":q,"data-y-position":K,"data-lifted":z&&T.length>1&&!o,"data-x-position":J,style:{"--front-toast-height":`${((G=I[0])==null?void 0:G.height)||0}px`,"--width":`${AV}px`,"--gap":`${b}px`,...m,...OV(u,c)},onBlur:ee=>{L.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(L.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||L.current||(L.current=!0,B.current=ee.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{Y||F(!1)},onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||O(!0)},onPointerUp:()=>O(!1)},T.filter(ee=>!ee.position&&j===0||ee.position===V).map((ee,ie)=>{var ce,he;return ne.createElement(jV,{key:ee.id,icons:C,index:ie,toast:ee,defaultRichColors:h,duration:(ce=v==null?void 0:v.duration)!=null?ce:p,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:x,closeButton:(he=v==null?void 0:v.closeButton)!=null?he:s,interacting:Y,position:V,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:H,toasts:T.filter(Ee=>Ee.position==ee.position),heights:I.filter(Ee=>Ee.position==ee.position),setHeights:M,expandByDefault:o,gap:b,loadingIcon:E,expanded:z,pauseWhenPageIsHidden:P,swipeDirections:e.swipeDirections})})):null}))});const xb="-",LV=e=>{const t=$V(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(xb);return a[0]===""&&a.length!==1&&a.shift(),kR(a,t)||FV(s)},getConflictingClassGroupIds:(s,a)=>{const u=n[s]||[];return a&&r[s]?[...u,...r[s]]:u}}},kR=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?kR(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(xb);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},CC=/^\[(.+)\]$/,FV=e=>{if(CC.test(e)){const t=CC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},$V=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return BV(Object.entries(e.classGroups),n).forEach(([o,s])=>{Ow(s,r,o,t)}),r},Ow=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:_C(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(zV(i)){Ow(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{Ow(s,_C(t,o),n,r)})})},_C=(e,t)=>{let n=e;return t.split(xb).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},zV=e=>e.isThemeGetter,BV=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[t+s,a])):o);return[n,i]}):e,VV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},SR="!",WV=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,s=a=>{const u=[];let c=0,f=0,h;for(let k=0;k<a.length;k++){let b=a[k];if(c===0){if(b===i&&(r||a.slice(k,k+o)===t)){u.push(a.slice(f,k)),f=k+o;continue}if(b==="/"){h=k;continue}}b==="["?c++:b==="]"&&c--}const p=u.length===0?a:a.substring(f),m=p.startsWith(SR),x=m?p.substring(1):p,v=h&&h>f?h-f:void 0;return{modifiers:u,hasImportantModifier:m,baseClassName:x,maybePostfixModifierPosition:v}};return n?a=>n({className:a,parseClassName:s}):s},UV=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},HV=e=>({cache:VV(e.cacheSize),parseClassName:WV(e),...LV(e)}),YV=/\s+/,qV=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],s=e.trim().split(YV);let a="";for(let u=s.length-1;u>=0;u-=1){const c=s[u],{modifiers:f,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=n(c);let x=!!m,v=r(x?p.substring(0,m):p);if(!v){if(!x){a=c+(a.length>0?" "+a:a);continue}if(v=r(p),!v){a=c+(a.length>0?" "+a:a);continue}x=!1}const k=UV(f).join(":"),b=h?k+SR:k,E=b+v;if(o.includes(E))continue;o.push(E);const C=i(v,x);for(let N=0;N<C.length;++N){const P=C[N];o.push(b+P)}a=c+(a.length>0?" "+a:a)}return a};function GV(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ER(t))&&(r&&(r+=" "),r+=n);return r}const ER=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ER(e[r]))&&(n&&(n+=" "),n+=t);return n};function ZV(e,...t){let n,r,i,o=s;function s(u){const c=t.reduce((f,h)=>h(f),e());return n=HV(c),r=n.cache.get,i=n.cache.set,o=a,a(u)}function a(u){const c=r(u);if(c)return c;const f=qV(u,n);return i(u,f),f}return function(){return o(GV.apply(null,arguments))}}const zt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},CR=/^\[(?:([a-z-]+):)?(.+)\]$/i,KV=/^\d+\/\d+$/,XV=new Set(["px","full","screen"]),QV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,JV=/\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$/,e6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,t6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,n6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ho=e=>El(e)||XV.has(e)||KV.test(e),us=e=>au(e,"length",c6),El=e=>!!e&&!Number.isNaN(Number(e)),dx=e=>au(e,"number",El),rc=e=>!!e&&Number.isInteger(Number(e)),r6=e=>e.endsWith("%")&&El(e.slice(0,-1)),ut=e=>CR.test(e),cs=e=>QV.test(e),i6=new Set(["length","size","percentage"]),o6=e=>au(e,i6,_R),s6=e=>au(e,"position",_R),a6=new Set(["image","url"]),l6=e=>au(e,a6,f6),u6=e=>au(e,"",d6),ic=()=>!0,au=(e,t,n)=>{const r=CR.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},c6=e=>JV.test(e)&&!e6.test(e),_R=()=>!1,d6=e=>t6.test(e),f6=e=>n6.test(e),h6=()=>{const e=zt("colors"),t=zt("spacing"),n=zt("blur"),r=zt("brightness"),i=zt("borderColor"),o=zt("borderRadius"),s=zt("borderSpacing"),a=zt("borderWidth"),u=zt("contrast"),c=zt("grayscale"),f=zt("hueRotate"),h=zt("invert"),p=zt("gap"),m=zt("gradientColorStops"),x=zt("gradientColorStopPositions"),v=zt("inset"),k=zt("margin"),b=zt("opacity"),E=zt("padding"),C=zt("saturate"),N=zt("scale"),P=zt("sepia"),T=zt("skew"),D=zt("space"),R=zt("translate"),I=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",ut,t],F=()=>[ut,t],Y=()=>["",ho,us],O=()=>["auto",El,ut],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",ut],L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[El,ut];return{cacheSize:500,separator:":",theme:{colors:[ic],spacing:[ho,us],blur:["none","",cs,ut],brightness:H(),borderColor:[e],borderRadius:["none","","full",cs,ut],borderSpacing:F(),borderWidth:Y(),contrast:H(),grayscale:B(),hueRotate:H(),invert:B(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[r6,us],inset:z(),margin:z(),opacity:H(),padding:F(),saturate:H(),scale:H(),sepia:B(),skew:H(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",ut]}],container:["container"],columns:[{columns:[cs]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...q(),ut]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",rc,ut]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ut]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",rc,ut]}],"grid-cols":[{"grid-cols":[ic]}],"col-start-end":[{col:["auto",{span:["full",rc,ut]},ut]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[ic]}],"row-start-end":[{row:["auto",{span:[rc,ut]},ut]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ut]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ut]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[k]}],mx:[{mx:[k]}],my:[{my:[k]}],ms:[{ms:[k]}],me:[{me:[k]}],mt:[{mt:[k]}],mr:[{mr:[k]}],mb:[{mb:[k]}],ml:[{ml:[k]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ut,t]}],"min-w":[{"min-w":[ut,t,"min","max","fit"]}],"max-w":[{"max-w":[ut,t,"none","full","min","max","fit","prose",{screen:[cs]},cs]}],h:[{h:[ut,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ut,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ut,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ut,t,"auto","min","max","fit"]}],"font-size":[{text:["base",cs,us]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",dx]}],"font-family":[{font:[ic]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ut]}],"line-clamp":[{"line-clamp":["none",El,dx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ho,ut]}],"list-image":[{"list-image":["none",ut]}],"list-style-type":[{list:["none","disc","decimal",ut]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ho,us]}],"underline-offset":[{"underline-offset":["auto",ho,ut]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ut]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ut]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),s6]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",o6]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},l6]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:W()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[ho,ut]}],"outline-w":[{outline:[ho,us]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[ho,us]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",cs,u6]}],"shadow-color":[{shadow:[ic]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",cs,ut]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[h]}],saturate:[{saturate:[C]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ut]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",ut]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",ut]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[rc,ut]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ut]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ut]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ut]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ho,us,dx]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},p6=ZV(h6);function Te(...e){return p6(lm(e))}const vb=async(e,t)=>{var r;const n=await fetch(e);if(!n.ok){const i=new Error("An error occurred while fetching the data.");throw i.info=await n.json(),i.status=n.status,t||nn.error(((r=i==null?void 0:i.info)==null?void 0:r.error)||(i==null?void 0:i.message)),i}return n.json()},m6=()=>y.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",children:[y.jsx("circle",{cx:"18.0002",cy:"18.0002",r:"15.2365",stroke:"currentColor",strokeWidth:"1.25409"}),y.jsx("ellipse",{cx:"18.0008",cy:"18",rx:"15.2365",ry:"10.2193",transform:"rotate(45 18.0008 18)",stroke:"currentColor",strokeWidth:"1.25409"}),y.jsx("path",{d:"M11.7793 18.0547H24.3007",stroke:"currentColor",strokeWidth:"1.25409"}),y.jsx("path",{d:"M14.8574 21.2354L21.2192 14.8736",stroke:"currentColor",strokeWidth:"1.25409"}),y.jsx("path",{d:"M21.2207 21.2354L14.8589 14.8736",stroke:"currentColor",strokeWidth:"1.25409"}),y.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.57571 11.2943C4.93105 13.0681 3.39081 15.4508 3.39081 17.9997C3.39081 20.5486 4.93105 22.9313 7.57571 24.7051C10.2163 26.4762 13.9001 27.592 18.0003 27.592C22.1004 27.592 25.7842 26.4762 28.4248 24.7051C31.0695 22.9313 32.6097 20.5486 32.6097 17.9997C32.6097 15.4508 31.0695 13.0681 28.4248 11.2943C25.7842 9.5232 22.1004 8.40741 18.0003 8.40741C13.9001 8.40741 10.2163 9.5232 7.57571 11.2943ZM6.87715 10.2528C9.75106 8.32521 13.6855 7.15332 18.0003 7.15332C22.315 7.15332 26.2495 8.32521 29.1234 10.2528C31.9932 12.1776 33.8638 14.9046 33.8638 17.9997C33.8638 21.0948 31.9932 23.8218 29.1234 25.7466C26.2495 27.6742 22.315 28.8461 18.0003 28.8461C13.6855 28.8461 9.75106 27.6742 6.87715 25.7466C4.00728 23.8218 2.13672 21.0948 2.13672 17.9997C2.13672 14.9046 4.00728 12.1776 6.87715 10.2528Z",fill:"currentColor"})]}),g6=[{name:"Agents",url:"/agents",icon:gR},{name:"Tools",url:"/tools",icon:rV},{name:"Workflows",url:"/workflows",icon:Dw}],y6=()=>{const{pathname:e}=Qi();return y.jsx("div",{className:"relative z-20 h-full text-mastra-el-6",children:y.jsxs("div",{className:"bg-mastra-bg-1 h-full w-full p-4 flex gap-6 flex-col",children:[y.jsx("div",{className:"flex items-center justify-between",children:y.jsxs("div",{className:"flex gap-2 px-2 items-center",children:[y.jsx(m6,{}),y.jsx("p",{className:"text-medium text-sm gradient py-[0.38rem] font-tasa",children:"Mastra Playground"})]})}),y.jsx("div",{children:y.jsx("div",{className:"flex flex-col gap-0.5",children:g6.map(t=>{const[n,r]=e.split("/"),i=t.name.toLowerCase(),o=t.url===e||t.name===e||r===i;return y.jsxs(Dd,{to:t.url,className:Te("flex cursor-pointer w-full px-2 items-center focus-visible:outline-none transition-colors focus-visible:ring-1 focus-visible:ring-mastra-border-4 gap-3 rounded-xs group text-small hover:bg-mastra-el-6/5",o?"bg-mastra-el-6/5":""),children:[y.jsx(t.icon,{className:Te("w-[0.875rem] h-[0.875rem] text-mastra-el-3 group-hover:text-mastra-el-6",o?"text-mastra-el-6":"")}),y.jsx("p",{className:Te("py-[0.38rem] text-mastra-el-6/60 group-hover:text-mastra-el-6 transition-all capitalize ",o?"text-mastra-el-6":""),children:t.name})]})})})}),y.jsxs("div",{className:"flex mt-auto gap-2 items-center justify-center",children:[y.jsx("a",{href:"https://mastra.ai",target:"_blank",rel:"noopener",className:"text-sm text-gray-300/60 hover:text-gray-100",children:"Mastra.AI"}),y.jsx("div",{className:"w-1 h-1 bg-gray-300/60 rounded-full"}),y.jsx("a",{href:"https://mastra.ai/docs/guide",target:"_blank",rel:"noopener",className:"text-sm text-gray-300/60 hover:text-gray-100",children:"Docs"}),y.jsx("div",{className:"w-1 h-1 bg-gray-300/60 rounded-full"}),y.jsx("a",{href:"https://github.com/mastra-ai/mastra",target:"_blank",rel:"noopener",className:"text-sm text-gray-300/60 hover:text-gray-100",children:"GitHub"})]})]})})};var x6=(e,t,n,r,i,o,s,a)=>{let u=document.documentElement,c=["light","dark"];function f(m){(Array.isArray(e)?e:[e]).forEach(x=>{let v=x==="class",k=v&&o?i.map(b=>o[b]||b):i;v?(u.classList.remove(...k),u.classList.add(m)):u.setAttribute(x,m)}),h(m)}function h(m){a&&c.includes(m)&&(u.style.colorScheme=m)}function p(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)f(r);else try{let m=localStorage.getItem(t)||n,x=s&&m==="system"?p():m;f(x)}catch{}},v6=S.createContext(void 0),w6={setTheme:e=>{},themes:[]},b6=()=>{var e;return(e=S.useContext(v6))!=null?e:w6};S.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:o,value:s,themes:a,nonce:u,scriptProps:c})=>{let f=JSON.stringify([n,t,o,e,a,s,r,i]).slice(1,-1);return S.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?u:"",dangerouslySetInnerHTML:{__html:`(${x6.toString()})(${f})`}})});const k6=({...e})=>{const{theme:t="system"}=b6();return y.jsx(IV,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},S6=S.createContext({theme:"system",setTheme:()=>null});function E6({children:e,defaultTheme:t="system"}){const[n,r]=S.useState(t);return S.useEffect(()=>{const i=window.document.documentElement;if(i.classList.remove("light","dark"),n==="system"){const o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";i.classList.add(o);return}i.classList.add(n)},[n]),y.jsx(S6.Provider,{value:{theme:n,setTheme:r},children:e})}const C6=({children:e})=>y.jsxs(E6,{defaultTheme:"dark",attribute:"class",children:[y.jsx(k6,{position:"bottom-right"}),y.jsxs("main",{className:"bg-mastra-bg-1 grid h-full w-full grid-cols-[15rem_minmax(0,_1fr)] overflow-clip",children:[y.jsx("div",{className:"z-20 h-full",children:y.jsx("div",{className:"h-full",children:y.jsx(y6,{})})}),y.jsx("div",{className:"bg-mastra-bg-2 grid h-[calc(100vh-1rem)] relative border-mastra-border-1 rounded-xs border-thin m-2 overflow-hidden border-solid",children:e})]})]}),Pr=({title:e,rightElement:t})=>y.jsx("header",{className:"sticky top-0 z-50",children:y.jsx("div",{className:"flex h-[var(--top-bar-height)] w-full content-center items-center justify-between border-b-[0.1px] border-mastra-border-1 px-[1.31rem]",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("h1",{className:"font-medium text-sm font-mono",children:e}),y.jsx("div",{className:"ml-auto",children:t})]})})});function Ue({className:e,...t}){return y.jsx("div",{className:Te("animate-pulse rounded-md bg-muted",e),...t})}const NR=()=>{const[e,t]=S.useState({}),[n,r]=S.useState(!0);return S.useEffect(()=>{(async()=>{r(!0);try{const o=await fetch("/api/agents");if(!o.ok){const a=await o.json();t({}),console.error("Error fetching agents",a),nn.error((a==null?void 0:a.error)||"Error fetching agents");return}const s=await o.json();t(s)}catch(o){t({}),console.error("Error fetching agents",o),nn.error("Error fetching agents")}finally{r(!1)}})()},[]),{agents:e,isLoading:n}},um=e=>{const[t,n]=S.useState(null),[r,i]=S.useState(!0);return S.useEffect(()=>{(async()=>{i(!0);try{if(!e){n(null),i(!1);return}const s=await fetch(`/api/agents/${e}`);if(!s.ok){const u=await s.json();n(null),console.error("Error fetching agent",u),nn.error((u==null?void 0:u.error)||"Error fetching agent");return}const a=await s.json();n(a)}catch(s){n(null),console.error("Error fetching agent",s),nn.error("Error fetching agent")}finally{i(!1)}})()},[e]),{agent:t,isLoading:r}},_6=()=>{const[e,t]=S.useState({}),[n,r]=S.useState(!0);return S.useEffect(()=>{(async()=>{r(!0);try{const o=await fetch("/api/tools");if(!o.ok){const a=await o.json();t({}),console.error("Error fetching tools",a),nn.error((a==null?void 0:a.error)||"Error fetching tools");return}const s=await o.json();t(s)}catch(o){t({}),console.error("Error fetching tools",o),nn.error("Error fetching tools")}finally{r(!1)}})()},[]),{tools:e,isLoading:n}},N6=e=>{const[t,n]=S.useState(null),[r,i]=S.useState(!0);return S.useEffect(()=>{(async()=>{i(!0);try{if(!e){n(null),i(!1);return}const s=await fetch(`/api/tools/${e}`);if(!s.ok){const u=await s.json();n(null),console.error("Error fetching tool",u),nn.error((u==null?void 0:u.error)||"Error fetching tool");return}const a=await s.json();n(a)}catch(s){n(null),console.error("Error fetching tool",s),nn.error("Error fetching tool")}finally{i(!1)}})()},[e]),{tool:t,isLoading:r}},T6=()=>{const{agents:e,isLoading:t}=NR(),{tools:n,isLoading:r}=_6(),[i,o]=S.useState(null),[s,a]=S.useState(!0),{agent:u,isLoading:c}=um(i),f=Lo();if(t)return y.jsxs("div",{className:"flex flex-col h-full w-full",children:[y.jsx(Pr,{title:"Tools"}),y.jsxs("div",{className:"w-full h-full grid grid-cols-[300px_1fr] py-6 px-4",children:[y.jsx("div",{className:"flex flex-col gap-4",children:y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx("div",{className:"px-2 py-2 rounded-md bg-mastra-bg-13 mb-2",children:y.jsxs("div",{className:"flex gap-2 items-center",children:[y.jsx(Ue,{className:"h-3 w-3"}),y.jsx(Ue,{className:"h-4 w-20"})]})}),y.jsx("div",{className:"flex flex-col gap-2",children:[1,2,3].map(m=>y.jsxs("div",{className:"flex gap-2 items-center px-2 py-2 rounded-md bg-mastra-bg-13",children:[y.jsx(Ue,{className:"h-3 w-3"}),y.jsx(Ue,{className:"h-4 w-24"})]},m))})]})}),y.jsx("div",{className:"border-l border-mastra-border-1 pl-4",children:y.jsx(Ue,{className:"h-full w-full rounded-md"})})]})]});const h=m=>{o(m),a(!1)},p=()=>{a(!0),o(null)};return r||c?y.jsxs("div",{className:"flex flex-col h-full w-full ",children:[y.jsx(Pr,{title:"Tools"}),y.jsx("div",{className:"w-full h-full grid grid-cols-[300px_1fr] ",children:y.jsx("div",{className:"w-full h-full border-r-[0.5px] border-mastra-border-1 py-6 px-4",children:y.jsx(Ue,{className:"h-full w-full rounded-md"})})})]}):y.jsxs("div",{className:"flex flex-col h-full w-full ",children:[y.jsx(Pr,{title:"Tools"}),y.jsxs("div",{className:"w-full h-full grid grid-cols-[300px_1fr] ",children:[y.jsx("div",{className:"w-full h-full border-r-[0.5px] border-mastra-border-1 py-6 px-4",children:y.jsxs("ul",{className:" flex flex-col gap-4",children:[Object.keys(n).length>0&&y.jsx("li",{className:Te("px-2 py-2 rounded-md hover:bg-mastra-bg-4/80 transition-colors cursor-pointer",s&&"bg-mastra-bg-4/80"),onClick:p,children:y.jsxs("div",{className:"flex gap-2 items-center",children:[y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-3",children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"})}),y.jsx("p",{className:"text-sm text-mastra-el-6",children:"All Tools"})]})}),Object.entries(e).map(([m,x])=>y.jsx("li",{className:Te("px-2 py-2 rounded-md hover:bg-mastra-bg-4/80 transition-colors cursor-pointer",i===m&&"bg-mastra-bg-4/80"),onClick:()=>h(m),children:y.jsxs("div",{className:"flex gap-2 items-center",children:[y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-3",children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"})}),y.jsxs("p",{className:"text-sm text-mastra-el-6",children:[x.name," Tools"]})]})},m))]})}),y.jsx("div",{className:"flex flex-col gap-4 py-6 px-4",children:y.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2",children:c?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] border-[0.5px] border-mastra-border-1",children:[y.jsx(Ue,{className:"h-4 w-24"}),y.jsx(Ue,{className:"h-4 w-full"})]}),y.jsxs("div",{className:"flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] border-[0.5px] border-mastra-border-1",children:[y.jsx(Ue,{className:"h-4 w-24"}),y.jsx(Ue,{className:"h-4 w-full"})]}),y.jsxs("div",{className:"flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] border-[0.5px] border-mastra-border-1",children:[y.jsx(Ue,{className:"h-4 w-24"}),y.jsx(Ue,{className:"h-4 w-full"})]}),y.jsxs("div",{className:"flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] border-[0.5px] border-mastra-border-1",children:[y.jsx(Ue,{className:"h-4 w-24"}),y.jsx(Ue,{className:"h-4 w-full"})]})]}):s?Object.entries(n).map(([m,x],v)=>y.jsxs("div",{onClick:()=>{f(`/tools/all/${x.id}`)},className:" hover:bg-mastra-bg-4/80 transition-colors flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] cursor-pointer border-[0.5px] border-mastra-border-1",children:[y.jsx("h3",{className:"text-small text-mastra-el-6",children:m}),y.jsx("p",{className:"text-small text-mastra-el-2",children:x.description})]},v)):Object.entries((u==null?void 0:u.tools)??{}).map(([m,x],v)=>y.jsxs("div",{onClick:()=>{f(`/tools/${i}/${x.id}`)},className:" hover:bg-mastra-bg-4/80 transition-colors flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] cursor-pointer border-[0.5px] border-mastra-border-1",children:[y.jsx("h3",{className:"text-small text-mastra-el-6",children:m}),y.jsx("p",{className:"text-small text-mastra-el-2",children:x.description})]},v))})})]})]})};function NC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function cm(...e){return t=>{let n=!1;const r=e.map(i=>{const o=NC(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():NC(e[i],null)}}}}function ht(...e){return S.useCallback(cm(...e),e)}var qi=S.forwardRef((e,t)=>{const{children:n,...r}=e,i=S.Children.toArray(n),o=i.find(A6);if(o){const s=o.props.children,a=i.map(u=>u===o?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:u);return y.jsx(Iw,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return y.jsx(Iw,{...r,ref:t,children:n})});qi.displayName="Slot";var Iw=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const i=R6(n);return S.cloneElement(n,{...P6(r,n.props),ref:t?cm(t,i):i})}return S.Children.count(n)>1?S.Children.only(null):null});Iw.displayName="SlotClone";var TR=({children:e})=>y.jsx(y.Fragment,{children:e});function A6(e){return S.isValidElement(e)&&e.type===TR}function P6(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function R6(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const TC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,AC=lm,lu=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return AC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(c=>{const f=n==null?void 0:n[c],h=o==null?void 0:o[c];if(f===null)return null;const p=TC(f)||TC(h);return i[c][p]}),a=n&&Object.entries(n).reduce((c,f)=>{let[h,p]=f;return p===void 0||(c[h]=p),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:h,className:p,...m}=f;return Object.entries(m).every(x=>{let[v,k]=x;return Array.isArray(k)?k.includes({...o,...a}[v]):{...o,...a}[v]===k})?[...c,h,p]:c},[]);return AC(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},Cl=lu("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-mastra-bg-7 border-[0.5px] border-mastra-border-4 text-white hover:bg-mastra-bg-7/70",primary:"border-[0.5px] border-mastra-border-1 bg-mastra-bg-4 hover:bg-mastra-bg-2/80 text-kp-el-6",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Mt=S.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?qi:"button";return y.jsx(s,{className:Te(Cl({variant:t,size:n,className:e})),ref:o,...i})});Mt.displayName="Button";var M6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],He=M6.reduce((e,t)=>{const n=S.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?qi:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(a,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function AR(e,t){e&&su.flushSync(()=>e.dispatchEvent(t))}var qn=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{};function D6(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var sr=e=>{const{present:t,children:n}=e,r=j6(t),i=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),o=ht(r.ref,O6(i));return typeof n=="function"||r.isPresent?S.cloneElement(i,{ref:o}):null};sr.displayName="Presence";function j6(e){const[t,n]=S.useState(),r=S.useRef({}),i=S.useRef(e),o=S.useRef("none"),s=e?"mounted":"unmounted",[a,u]=D6(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=Sh(r.current);o.current=a==="mounted"?c:"none"},[a]),qn(()=>{const c=r.current,f=i.current;if(f!==e){const p=o.current,m=Sh(c);e?u("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),qn(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,h=m=>{const v=Sh(r.current).includes(m.animationName);if(m.target===t&&v&&(u("ANIMATION_END"),!i.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},p=m=>{m.target===t&&(o.current=Sh(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:S.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Sh(e){return(e==null?void 0:e.animationName)||"none"}function O6(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function I6(e,t){const n=S.createContext(t),r=o=>{const{children:s,...a}=o,u=S.useMemo(()=>a,Object.values(a));return y.jsx(n.Provider,{value:u,children:s})};r.displayName=e+"Provider";function i(o){const s=S.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function ti(e,t=[]){let n=[];function r(o,s){const a=S.createContext(s),u=n.length;n=[...n,s];const c=h=>{var b;const{scope:p,children:m,...x}=h,v=((b=p==null?void 0:p[e])==null?void 0:b[u])||a,k=S.useMemo(()=>x,Object.values(x));return y.jsx(v.Provider,{value:k,children:m})};c.displayName=o+"Provider";function f(h,p){var v;const m=((v=p==null?void 0:p[e])==null?void 0:v[u])||a,x=S.useContext(m);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[c,f]}const i=()=>{const o=n.map(s=>S.createContext(s));return function(a){const u=(a==null?void 0:a[e])||o;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return i.scopeName=e,[r,L6(i,...t)]}function L6(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:u,scopeName:c})=>{const h=u(o)[`__scope${c}`];return{...a,...h}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function hn(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var F6=S.createContext(void 0);function jd(e){const t=S.useContext(F6);return e||t||"ltr"}function Lw(e,[t,n]){return Math.min(n,Math.max(t,e))}function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function $6(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var wb="ScrollArea",[PR,zxe]=ti(wb),[z6,ni]=PR(wb),RR=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[a,u]=S.useState(null),[c,f]=S.useState(null),[h,p]=S.useState(null),[m,x]=S.useState(null),[v,k]=S.useState(null),[b,E]=S.useState(0),[C,N]=S.useState(0),[P,T]=S.useState(!1),[D,R]=S.useState(!1),I=ht(t,z=>u(z)),M=jd(i);return y.jsx(z6,{scope:n,type:r,dir:M,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:f,content:h,onContentChange:p,scrollbarX:m,onScrollbarXChange:x,scrollbarXEnabled:P,onScrollbarXEnabledChange:T,scrollbarY:v,onScrollbarYChange:k,scrollbarYEnabled:D,onScrollbarYEnabledChange:R,onCornerWidthChange:E,onCornerHeightChange:N,children:y.jsx(He.div,{dir:M,...s,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})})});RR.displayName=wb;var MR="ScrollAreaViewport",DR=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=ni(MR,n),a=S.useRef(null),u=ht(t,a,s.onViewportChange);return y.jsxs(y.Fragment,{children:[y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),y.jsx(He.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:y.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});DR.displayName=MR;var Ji="ScrollAreaScrollbar",bb=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ni(Ji,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,a=e.orientation==="horizontal";return S.useEffect(()=>(a?o(!0):s(!0),()=>{a?o(!1):s(!1)}),[a,o,s]),i.type==="hover"?y.jsx(B6,{...r,ref:t,forceMount:n}):i.type==="scroll"?y.jsx(V6,{...r,ref:t,forceMount:n}):i.type==="auto"?y.jsx(jR,{...r,ref:t,forceMount:n}):i.type==="always"?y.jsx(kb,{...r,ref:t}):null});bb.displayName=Ji;var B6=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ni(Ji,e.__scopeScrollArea),[o,s]=S.useState(!1);return S.useEffect(()=>{const a=i.scrollArea;let u=0;if(a){const c=()=>{window.clearTimeout(u),s(!0)},f=()=>{u=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",f),()=>{window.clearTimeout(u),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",f)}}},[i.scrollArea,i.scrollHideDelay]),y.jsx(sr,{present:n||o,children:y.jsx(jR,{"data-state":o?"visible":"hidden",...r,ref:t})})}),V6=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ni(Ji,e.__scopeScrollArea),o=e.orientation==="horizontal",s=fm(()=>u("SCROLL_END"),100),[a,u]=$6("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return S.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,i.scrollHideDelay,u]),S.useEffect(()=>{const c=i.viewport,f=o?"scrollLeft":"scrollTop";if(c){let h=c[f];const p=()=>{const m=c[f];h!==m&&(u("SCROLL"),s()),h=m};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[i.viewport,o,u,s]),y.jsx(sr,{present:n||a!=="hidden",children:y.jsx(kb,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Re(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Re(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),jR=S.forwardRef((e,t)=>{const n=ni(Ji,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=S.useState(!1),a=e.orientation==="horizontal",u=fm(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,f=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:f)}},10);return Ol(n.viewport,u),Ol(n.content,u),y.jsx(sr,{present:r||o,children:y.jsx(kb,{"data-state":o?"visible":"hidden",...i,ref:t})})}),kb=S.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=ni(Ji,e.__scopeScrollArea),o=S.useRef(null),s=S.useRef(0),[a,u]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=$R(a.viewport,a.content),f={...r,sizes:a,onSizesChange:u,hasThumb:c>0&&c<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function h(p,m){return G6(p,s.current,a,m)}return n==="horizontal"?y.jsx(W6,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollLeft,m=PC(p,a,i.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=h(p,i.dir))}}):n==="vertical"?y.jsx(U6,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollTop,m=PC(p,a);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=h(p))}}):null}),W6=S.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=ni(Ji,e.__scopeScrollArea),[s,a]=S.useState(),u=S.useRef(null),c=ht(t,u,o.onScrollbarXChange);return S.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),y.jsx(IR,{"data-orientation":"horizontal",...i,ref:c,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":dm(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(o.viewport){const p=o.viewport.scrollLeft+f.deltaX;e.onWheelScroll(p),BR(p,h)&&f.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:fp(s.paddingLeft),paddingEnd:fp(s.paddingRight)}})}})}),U6=S.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=ni(Ji,e.__scopeScrollArea),[s,a]=S.useState(),u=S.useRef(null),c=ht(t,u,o.onScrollbarYChange);return S.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),y.jsx(IR,{"data-orientation":"vertical",...i,ref:c,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":dm(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(o.viewport){const p=o.viewport.scrollTop+f.deltaY;e.onWheelScroll(p),BR(p,h)&&f.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:fp(s.paddingTop),paddingEnd:fp(s.paddingBottom)}})}})}),[H6,OR]=PR(Ji),IR=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:u,onDragScroll:c,onWheelScroll:f,onResize:h,...p}=e,m=ni(Ji,n),[x,v]=S.useState(null),k=ht(t,I=>v(I)),b=S.useRef(null),E=S.useRef(""),C=m.viewport,N=r.content-r.viewport,P=hn(f),T=hn(u),D=fm(h,10);function R(I){if(b.current){const M=I.clientX-b.current.left,z=I.clientY-b.current.top;c({x:M,y:z})}}return S.useEffect(()=>{const I=M=>{const z=M.target;(x==null?void 0:x.contains(z))&&P(M,N)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[C,x,N,P]),S.useEffect(T,[r,T]),Ol(x,D),Ol(m.content,D),y.jsx(H6,{scope:n,scrollbar:x,hasThumb:i,onThumbChange:hn(o),onThumbPointerUp:hn(s),onThumbPositionChange:T,onThumbPointerDown:hn(a),children:y.jsx(He.div,{...p,ref:k,style:{position:"absolute",...p.style},onPointerDown:Re(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),b.current=x.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),R(I))}),onPointerMove:Re(e.onPointerMove,R),onPointerUp:Re(e.onPointerUp,I=>{const M=I.target;M.hasPointerCapture(I.pointerId)&&M.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=E.current,m.viewport&&(m.viewport.style.scrollBehavior=""),b.current=null})})})}),dp="ScrollAreaThumb",LR=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=OR(dp,e.__scopeScrollArea);return y.jsx(sr,{present:n||i.hasThumb,children:y.jsx(Y6,{ref:t,...r})})}),Y6=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=ni(dp,n),s=OR(dp,n),{onThumbPositionChange:a}=s,u=ht(t,h=>s.onThumbChange(h)),c=S.useRef(void 0),f=fm(()=>{c.current&&(c.current(),c.current=void 0)},100);return S.useEffect(()=>{const h=o.viewport;if(h){const p=()=>{if(f(),!c.current){const m=Z6(h,a);c.current=m,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[o.viewport,f,a]),y.jsx(He.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Re(e.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),x=h.clientX-m.left,v=h.clientY-m.top;s.onThumbPointerDown({x,y:v})}),onPointerUp:Re(e.onPointerUp,s.onThumbPointerUp)})});LR.displayName=dp;var Sb="ScrollAreaCorner",FR=S.forwardRef((e,t)=>{const n=ni(Sb,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?y.jsx(q6,{...e,ref:t}):null});FR.displayName=Sb;var q6=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=ni(Sb,n),[o,s]=S.useState(0),[a,u]=S.useState(0),c=!!(o&&a);return Ol(i.scrollbarX,()=>{var h;const f=((h=i.scrollbarX)==null?void 0:h.offsetHeight)||0;i.onCornerHeightChange(f),u(f)}),Ol(i.scrollbarY,()=>{var h;const f=((h=i.scrollbarY)==null?void 0:h.offsetWidth)||0;i.onCornerWidthChange(f),s(f)}),c?y.jsx(He.div,{...r,ref:t,style:{width:o,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function fp(e){return e?parseInt(e,10):0}function $R(e,t){const n=e/t;return isNaN(n)?0:n}function dm(e){const t=$R(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function G6(e,t,n,r="ltr"){const i=dm(n),o=i/2,s=t||o,a=i-s,u=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,f=n.content-n.viewport,h=r==="ltr"?[0,f]:[f*-1,0];return zR([u,c],h)(e)}function PC(e,t,n="ltr"){const r=dm(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,a=o-r,u=n==="ltr"?[0,s]:[s*-1,0],c=Lw(e,u);return zR([0,s],[0,a])(c)}function zR(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function BR(e,t){return e>0&&e<t}var Z6=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,a=n.top!==o.top;(s||a)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function fm(e,t){const n=hn(e),r=S.useRef(0);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),S.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ol(e,t){const n=hn(t);qn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var VR=RR,K6=DR,X6=FR;const Rn=S.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(VR,{ref:r,className:Te("relative overflow-hidden",e),...n,children:[y.jsx(K6,{className:"h-full w-full rounded-[inherit]",children:t}),y.jsx(WR,{}),y.jsx(X6,{})]}));Rn.displayName=VR.displayName;const WR=S.forwardRef(({className:e,orientation:t="vertical",...n},r)=>y.jsx(bb,{ref:r,orientation:t,className:Te("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:y.jsx(LR,{className:"relative flex-1 rounded-full bg-border"})}));WR.displayName=bb.displayName;const hm=S.forwardRef(({className:e,...t},n)=>y.jsx("table",{ref:n,className:Te("w-full caption-bottom text-sm border-spacing-0",e),...t}));hm.displayName="Table";const pm=S.forwardRef(({className:e,...t},n)=>y.jsx("thead",{ref:n,className:Te("[&_tr]:border-b",e),...t}));pm.displayName="TableHeader";const mm=S.forwardRef(({className:e,...t},n)=>y.jsx("tbody",{ref:n,className:Te("[&_tr:last-child]:border-0",e),...t}));mm.displayName="TableBody";const Q6=S.forwardRef(({className:e,...t},n)=>y.jsx("tfoot",{ref:n,className:Te("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Q6.displayName="TableFooter";const Xr=S.forwardRef(({className:e,...t},n)=>y.jsx("tr",{ref:n,className:Te("border-b-[0.5px] border-mastra-border-1 transition-colors hover:bg-muted/50 data-[state=selected]:bg-mastra-bg-4/70",e),...t}));Xr.displayName="TableRow";const mr=S.forwardRef(({className:e,...t},n)=>y.jsx("th",{ref:n,className:Te("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));mr.displayName="TableHead";const gt=S.forwardRef(({className:e,...t},n)=>y.jsx("td",{ref:n,className:Te("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));gt.displayName="TableCell";const J6=S.forwardRef(({className:e,...t},n)=>y.jsx("caption",{ref:n,className:Te("mt-4 text-sm text-muted-foreground",e),...t}));J6.displayName="TableCaption";function e8(){const{agents:e,isLoading:t}=NR(),n=Lo();return y.jsxs("div",{className:"flex flex-col h-full relative overflow-hidden",children:[y.jsx(Pr,{title:"Agents"}),y.jsx("main",{className:"flex-1 relative overflow-hidden",children:y.jsx(Rn,{className:"rounded-lg h-full",children:y.jsxs(hm,{children:[y.jsx(pm,{className:"bg-[#171717] sticky top-0 z-10",children:y.jsxs(Xr,{className:"border-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[y.jsx(mr,{className:"w-[50px]"}),y.jsx(mr,{className:"text-mastra-el-3",children:"Name"}),y.jsx(mr,{className:"text-mastra-el-3 w-1/2",children:"Instruction"}),y.jsx(mr,{className:"text-mastra-el-3",children:"Model"}),y.jsx(mr,{className:"text-mastra-el-3",children:"Action"})]})}),y.jsx(mm,{className:"border-b border-gray-6",children:t?y.jsxs(Xr,{className:"border-b-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[y.jsx(gt,{children:y.jsx(Ue,{className:"h-8 w-8"})}),y.jsx(gt,{children:y.jsx(Ue,{className:"h-8 w-full"})}),y.jsx(gt,{children:y.jsx(Ue,{className:"h-8 w-full"})}),y.jsx(gt,{children:y.jsx(Ue,{className:"h-8 w-full"})})]}):Object.entries(e).map(([r,i])=>{var o;return y.jsxs(Xr,{className:"border-b-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[y.jsx(gt,{children:y.jsx("div",{className:"h-8 w-full flex items-center justify-center",children:y.jsx(gR,{className:"h-4 w-4 text-mastra-el-5"})})}),y.jsx(gt,{className:"font-medium text-mastra-el-5",children:i.name}),y.jsx(gt,{className:"truncate w-1/2 max-w-[500px] text-mastra-el-5",children:i.instructions}),y.jsx(gt,{className:"text-mastra-el-5 text-sm",children:(o=i==null?void 0:i.model)==null?void 0:o.provider}),y.jsx(gt,{className:"text-mastra-el-5 text-sm",children:y.jsx("span",{onClick:()=>{n(`/agents/${r}`)},className:"hover:no-underline",children:y.jsxs(Mt,{size:"sm",variant:"outline",children:[y.jsx(JB,{className:"h-4 w-4 text-inherit"}),"Chat with agent"]})})})]},r)})})]})})})]})}var fx={exports:{}},hx={};/**
|
|
197
|
+
`);function kh(e){return e.label!==void 0}var _V=3,NV="32px",TV="16px",SC=4e3,AV=356,PV=14,RV=20,MV=200;function di(...e){return e.filter(Boolean).join(" ")}function DV(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var jV=e=>{var t,n,r,i,o,s,a,u,c,f,h;let{invert:p,toast:m,unstyled:x,interacting:v,setHeights:k,visibleToasts:b,heights:E,index:C,toasts:N,expanded:P,removeToast:T,defaultRichColors:D,closeButton:R,style:I,cancelButtonStyle:M,actionButtonStyle:z,className:F="",descriptionClassName:Y="",duration:O,position:q,gap:W,loadingIcon:Z,expandByDefault:U,classNames:B,icons:L,closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:V}=e,[j,G]=ne.useState(null),[K,J]=ne.useState(null),[ee,ie]=ne.useState(!1),[ce,he]=ne.useState(!1),[Ee,fe]=ne.useState(!1),[xe,Me]=ne.useState(!1),[Ve,ot]=ne.useState(!1),[_t,Q]=ne.useState(0),[oe,ue]=ne.useState(0),Se=ne.useRef(m.duration||O||SC),we=ne.useRef(null),ge=ne.useRef(null),Ae=C===0,Fe=C+1<=b,se=m.type,pe=m.dismissible!==!1,Oe=m.className||"",et=m.descriptionClassName||"",rt=ne.useMemo(()=>E.findIndex(Ye=>Ye.toastId===m.id)||0,[E,m.id]),Rt=ne.useMemo(()=>{var Ye;return(Ye=m.closeButton)!=null?Ye:R},[m.closeButton,R]),Ke=ne.useMemo(()=>m.duration||O||SC,[m.duration,O]),st=ne.useRef(0),it=ne.useRef(0),Ht=ne.useRef(0),pt=ne.useRef(null),[gn,yt]=q.split("-"),yn=ne.useMemo(()=>E.reduce((Ye,wt,Nt)=>Nt>=rt?Ye:Ye+wt.height,0),[E,rt]),dt=vV(),Fr=m.invert||p,ar=se==="loading";it.current=ne.useMemo(()=>rt*W+yn,[rt,yn]),ne.useEffect(()=>{Se.current=Ke},[Ke]),ne.useEffect(()=>{ie(!0)},[]),ne.useEffect(()=>{let Ye=ge.current;if(Ye){let wt=Ye.getBoundingClientRect().height;return ue(wt),k(Nt=>[{toastId:m.id,height:wt,position:m.position},...Nt]),()=>k(Nt=>Nt.filter(Dn=>Dn.toastId!==m.id))}},[k,m.id]),ne.useLayoutEffect(()=>{if(!ee)return;let Ye=ge.current,wt=Ye.style.height;Ye.style.height="auto";let Nt=Ye.getBoundingClientRect().height;Ye.style.height=wt,ue(Nt),k(Dn=>Dn.find(Fn=>Fn.toastId===m.id)?Dn.map(Fn=>Fn.toastId===m.id?{...Fn,height:Nt}:Fn):[{toastId:m.id,height:Nt,position:m.position},...Dn])},[ee,m.title,m.description,k,m.id]);let Xn=ne.useCallback(()=>{he(!0),Q(it.current),k(Ye=>Ye.filter(wt=>wt.toastId!==m.id)),setTimeout(()=>{T(m)},MV)},[m,T,k,it]);ne.useEffect(()=>{if(m.promise&&se==="loading"||m.duration===1/0||m.type==="loading")return;let Ye;return P||v||V&&dt?(()=>{if(Ht.current<st.current){let wt=new Date().getTime()-st.current;Se.current=Se.current-wt}Ht.current=new Date().getTime()})():Se.current!==1/0&&(st.current=new Date().getTime(),Ye=setTimeout(()=>{var wt;(wt=m.onAutoClose)==null||wt.call(m,m),Xn()},Se.current)),()=>clearTimeout(Ye)},[P,v,m,se,V,dt,Xn]),ne.useEffect(()=>{m.delete&&Xn()},[Xn,m.delete]);function ii(){var Ye,wt,Nt;return L!=null&&L.loading?ne.createElement("div",{className:di(B==null?void 0:B.loader,(Ye=m==null?void 0:m.classNames)==null?void 0:Ye.loader,"sonner-loader"),"data-visible":se==="loading"},L.loading):Z?ne.createElement("div",{className:di(B==null?void 0:B.loader,(wt=m==null?void 0:m.classNames)==null?void 0:wt.loader,"sonner-loader"),"data-visible":se==="loading"},Z):ne.createElement(hV,{className:di(B==null?void 0:B.loader,(Nt=m==null?void 0:m.classNames)==null?void 0:Nt.loader),visible:se==="loading"})}return ne.createElement("li",{tabIndex:0,ref:ge,className:di(F,Oe,B==null?void 0:B.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,B==null?void 0:B.default,B==null?void 0:B[se],(n=m==null?void 0:m.classNames)==null?void 0:n[se]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:D,"data-styled":!(m.jsx||m.unstyled||x),"data-mounted":ee,"data-promise":!!m.promise,"data-swiped":Ve,"data-removed":ce,"data-visible":Fe,"data-y-position":gn,"data-x-position":yt,"data-index":C,"data-front":Ae,"data-swiping":Ee,"data-dismissible":pe,"data-type":se,"data-invert":Fr,"data-swipe-out":xe,"data-swipe-direction":K,"data-expanded":!!(P||U&&ee),style:{"--index":C,"--toasts-before":C,"--z-index":N.length-C,"--offset":`${ce?_t:it.current}px`,"--initial-height":U?"auto":`${oe}px`,...I,...m.style},onPointerDown:Ye=>{ar||!pe||(we.current=new Date,Q(it.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(fe(!0),pt.current={x:Ye.clientX,y:Ye.clientY}))},onPointerUp:()=>{var Ye,wt,Nt,Dn;if(xe||!pe)return;pt.current=null;let Fn=Number(((Ye=ge.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$n=Number(((wt=ge.current)==null?void 0:wt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),vr=new Date().getTime()-((Nt=we.current)==null?void 0:Nt.getTime()),xn=j==="x"?Fn:$n,$r=Math.abs(xn)/vr;if(Math.abs(xn)>=RV||$r>.11){Q(it.current),(Dn=m.onDismiss)==null||Dn.call(m,m),J(j==="x"?Fn>0?"right":"left":$n>0?"down":"up"),Xn(),Me(!0),ot(!1);return}fe(!1),G(null)},onPointerMove:Ye=>{var wt,Nt,Dn,Fn;if(!pt.current||!pe||((wt=window.getSelection())==null?void 0:wt.toString().length)>0)return;let $n=Ye.clientY-pt.current.y,vr=Ye.clientX-pt.current.x,xn=(Nt=e.swipeDirections)!=null?Nt:DV(q);!j&&(Math.abs(vr)>1||Math.abs($n)>1)&&G(Math.abs(vr)>Math.abs($n)?"x":"y");let $r={x:0,y:0};j==="y"?(xn.includes("top")||xn.includes("bottom"))&&(xn.includes("top")&&$n<0||xn.includes("bottom")&&$n>0)&&($r.y=$n):j==="x"&&(xn.includes("left")||xn.includes("right"))&&(xn.includes("left")&&vr<0||xn.includes("right")&&vr>0)&&($r.x=vr),(Math.abs($r.x)>0||Math.abs($r.y)>0)&&ot(!0),(Dn=ge.current)==null||Dn.style.setProperty("--swipe-amount-x",`${$r.x}px`),(Fn=ge.current)==null||Fn.style.setProperty("--swipe-amount-y",`${$r.y}px`)}},Rt&&!m.jsx?ne.createElement("button",{"aria-label":H,"data-disabled":ar,"data-close-button":!0,onClick:ar||!pe?()=>{}:()=>{var Ye;Xn(),(Ye=m.onDismiss)==null||Ye.call(m,m)},className:di(B==null?void 0:B.closeButton,(i=m==null?void 0:m.classNames)==null?void 0:i.closeButton)},(o=L==null?void 0:L.close)!=null?o:xV):null,m.jsx||S.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:ne.createElement(ne.Fragment,null,se||m.icon||m.promise?ne.createElement("div",{"data-icon":"",className:di(B==null?void 0:B.icon,(s=m==null?void 0:m.classNames)==null?void 0:s.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||ii():null,m.type!=="loading"?m.icon||(L==null?void 0:L[se])||dV(se):null):null,ne.createElement("div",{"data-content":"",className:di(B==null?void 0:B.content,(a=m==null?void 0:m.classNames)==null?void 0:a.content)},ne.createElement("div",{"data-title":"",className:di(B==null?void 0:B.title,(u=m==null?void 0:m.classNames)==null?void 0:u.title)},typeof m.title=="function"?m.title():m.title),m.description?ne.createElement("div",{"data-description":"",className:di(Y,et,B==null?void 0:B.description,(c=m==null?void 0:m.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),S.isValidElement(m.cancel)?m.cancel:m.cancel&&kh(m.cancel)?ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||M,onClick:Ye=>{var wt,Nt;kh(m.cancel)&&pe&&((Nt=(wt=m.cancel).onClick)==null||Nt.call(wt,Ye),Xn())},className:di(B==null?void 0:B.cancelButton,(f=m==null?void 0:m.classNames)==null?void 0:f.cancelButton)},m.cancel.label):null,S.isValidElement(m.action)?m.action:m.action&&kh(m.action)?ne.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||z,onClick:Ye=>{var wt,Nt;kh(m.action)&&((Nt=(wt=m.action).onClick)==null||Nt.call(wt,Ye),!Ye.defaultPrevented&&Xn())},className:di(B==null?void 0:B.actionButton,(h=m==null?void 0:m.classNames)==null?void 0:h.actionButton)},m.action.label):null))};function EC(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function OV(e,t){let n={};return[e,t].forEach((r,i)=>{let o=i===1,s=o?"--mobile-offset":"--offset",a=o?TV:NV;function u(c){["top","right","bottom","left"].forEach(f=>{n[`${s}-${f}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${s}-${c}`]=a:n[`${s}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):u(a)}),n}var IV=S.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:s,className:a,offset:u,mobileOffset:c,theme:f="light",richColors:h,duration:p,style:m,visibleToasts:x=_V,toastOptions:v,dir:k=EC(),gap:b=PV,loadingIcon:E,icons:C,containerAriaLabel:N="Notifications",pauseWhenPageIsHidden:P}=e,[T,D]=ne.useState([]),R=ne.useMemo(()=>Array.from(new Set([r].concat(T.filter(V=>V.position).map(V=>V.position)))),[T,r]),[I,M]=ne.useState([]),[z,F]=ne.useState(!1),[Y,O]=ne.useState(!1),[q,W]=ne.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=ne.useRef(null),U=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=ne.useRef(null),L=ne.useRef(!1),H=ne.useCallback(V=>{D(j=>{var G;return(G=j.find(K=>K.id===V.id))!=null&&G.delete||Nr.dismiss(V.id),j.filter(({id:K})=>K!==V.id)})},[]);return ne.useEffect(()=>Nr.subscribe(V=>{if(V.dismiss){D(j=>j.map(G=>G.id===V.id?{...G,delete:!0}:G));return}setTimeout(()=>{bR.flushSync(()=>{D(j=>{let G=j.findIndex(K=>K.id===V.id);return G!==-1?[...j.slice(0,G),{...j[G],...V},...j.slice(G+1)]:[V,...j]})})})}),[]),ne.useEffect(()=>{if(f!=="system"){W(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;let V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:j})=>{W(j?"dark":"light")})}catch{V.addListener(({matches:G})=>{try{W(G?"dark":"light")}catch(K){console.error(K)}})}},[f]),ne.useEffect(()=>{T.length<=1&&F(!1)},[T]),ne.useEffect(()=>{let V=j=>{var G,K;i.every(J=>j[J]||j.code===J)&&(F(!0),(G=Z.current)==null||G.focus()),j.code==="Escape"&&(document.activeElement===Z.current||(K=Z.current)!=null&&K.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[i]),ne.useEffect(()=>{if(Z.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,L.current=!1)}},[Z.current]),ne.createElement("section",{ref:t,"aria-label":`${N} ${U}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((V,j)=>{var G;let[K,J]=V.split("-");return T.length?ne.createElement("ol",{key:V,dir:k==="auto"?EC():k,tabIndex:-1,ref:Z,className:a,"data-sonner-toaster":!0,"data-theme":q,"data-y-position":K,"data-lifted":z&&T.length>1&&!o,"data-x-position":J,style:{"--front-toast-height":`${((G=I[0])==null?void 0:G.height)||0}px`,"--width":`${AV}px`,"--gap":`${b}px`,...m,...OV(u,c)},onBlur:ee=>{L.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(L.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||L.current||(L.current=!0,B.current=ee.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{Y||F(!1)},onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||O(!0)},onPointerUp:()=>O(!1)},T.filter(ee=>!ee.position&&j===0||ee.position===V).map((ee,ie)=>{var ce,he;return ne.createElement(jV,{key:ee.id,icons:C,index:ie,toast:ee,defaultRichColors:h,duration:(ce=v==null?void 0:v.duration)!=null?ce:p,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:x,closeButton:(he=v==null?void 0:v.closeButton)!=null?he:s,interacting:Y,position:V,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:H,toasts:T.filter(Ee=>Ee.position==ee.position),heights:I.filter(Ee=>Ee.position==ee.position),setHeights:M,expandByDefault:o,gap:b,loadingIcon:E,expanded:z,pauseWhenPageIsHidden:P,swipeDirections:e.swipeDirections})})):null}))});const xb="-",LV=e=>{const t=$V(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(xb);return a[0]===""&&a.length!==1&&a.shift(),kR(a,t)||FV(s)},getConflictingClassGroupIds:(s,a)=>{const u=n[s]||[];return a&&r[s]?[...u,...r[s]]:u}}},kR=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?kR(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(xb);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},CC=/^\[(.+)\]$/,FV=e=>{if(CC.test(e)){const t=CC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},$V=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return BV(Object.entries(e.classGroups),n).forEach(([o,s])=>{Ow(s,r,o,t)}),r},Ow=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:_C(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(zV(i)){Ow(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{Ow(s,_C(t,o),n,r)})})},_C=(e,t)=>{let n=e;return t.split(xb).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},zV=e=>e.isThemeGetter,BV=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[t+s,a])):o);return[n,i]}):e,VV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},SR="!",WV=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,s=a=>{const u=[];let c=0,f=0,h;for(let k=0;k<a.length;k++){let b=a[k];if(c===0){if(b===i&&(r||a.slice(k,k+o)===t)){u.push(a.slice(f,k)),f=k+o;continue}if(b==="/"){h=k;continue}}b==="["?c++:b==="]"&&c--}const p=u.length===0?a:a.substring(f),m=p.startsWith(SR),x=m?p.substring(1):p,v=h&&h>f?h-f:void 0;return{modifiers:u,hasImportantModifier:m,baseClassName:x,maybePostfixModifierPosition:v}};return n?a=>n({className:a,parseClassName:s}):s},UV=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},HV=e=>({cache:VV(e.cacheSize),parseClassName:WV(e),...LV(e)}),YV=/\s+/,qV=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],s=e.trim().split(YV);let a="";for(let u=s.length-1;u>=0;u-=1){const c=s[u],{modifiers:f,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=n(c);let x=!!m,v=r(x?p.substring(0,m):p);if(!v){if(!x){a=c+(a.length>0?" "+a:a);continue}if(v=r(p),!v){a=c+(a.length>0?" "+a:a);continue}x=!1}const k=UV(f).join(":"),b=h?k+SR:k,E=b+v;if(o.includes(E))continue;o.push(E);const C=i(v,x);for(let N=0;N<C.length;++N){const P=C[N];o.push(b+P)}a=c+(a.length>0?" "+a:a)}return a};function GV(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ER(t))&&(r&&(r+=" "),r+=n);return r}const ER=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ER(e[r]))&&(n&&(n+=" "),n+=t);return n};function ZV(e,...t){let n,r,i,o=s;function s(u){const c=t.reduce((f,h)=>h(f),e());return n=HV(c),r=n.cache.get,i=n.cache.set,o=a,a(u)}function a(u){const c=r(u);if(c)return c;const f=qV(u,n);return i(u,f),f}return function(){return o(GV.apply(null,arguments))}}const zt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},CR=/^\[(?:([a-z-]+):)?(.+)\]$/i,KV=/^\d+\/\d+$/,XV=new Set(["px","full","screen"]),QV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,JV=/\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$/,e6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,t6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,n6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ho=e=>El(e)||XV.has(e)||KV.test(e),us=e=>au(e,"length",c6),El=e=>!!e&&!Number.isNaN(Number(e)),dx=e=>au(e,"number",El),rc=e=>!!e&&Number.isInteger(Number(e)),r6=e=>e.endsWith("%")&&El(e.slice(0,-1)),ut=e=>CR.test(e),cs=e=>QV.test(e),i6=new Set(["length","size","percentage"]),o6=e=>au(e,i6,_R),s6=e=>au(e,"position",_R),a6=new Set(["image","url"]),l6=e=>au(e,a6,f6),u6=e=>au(e,"",d6),ic=()=>!0,au=(e,t,n)=>{const r=CR.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},c6=e=>JV.test(e)&&!e6.test(e),_R=()=>!1,d6=e=>t6.test(e),f6=e=>n6.test(e),h6=()=>{const e=zt("colors"),t=zt("spacing"),n=zt("blur"),r=zt("brightness"),i=zt("borderColor"),o=zt("borderRadius"),s=zt("borderSpacing"),a=zt("borderWidth"),u=zt("contrast"),c=zt("grayscale"),f=zt("hueRotate"),h=zt("invert"),p=zt("gap"),m=zt("gradientColorStops"),x=zt("gradientColorStopPositions"),v=zt("inset"),k=zt("margin"),b=zt("opacity"),E=zt("padding"),C=zt("saturate"),N=zt("scale"),P=zt("sepia"),T=zt("skew"),D=zt("space"),R=zt("translate"),I=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",ut,t],F=()=>[ut,t],Y=()=>["",ho,us],O=()=>["auto",El,ut],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",ut],L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[El,ut];return{cacheSize:500,separator:":",theme:{colors:[ic],spacing:[ho,us],blur:["none","",cs,ut],brightness:H(),borderColor:[e],borderRadius:["none","","full",cs,ut],borderSpacing:F(),borderWidth:Y(),contrast:H(),grayscale:B(),hueRotate:H(),invert:B(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[r6,us],inset:z(),margin:z(),opacity:H(),padding:F(),saturate:H(),scale:H(),sepia:B(),skew:H(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",ut]}],container:["container"],columns:[{columns:[cs]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...q(),ut]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",rc,ut]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ut]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",rc,ut]}],"grid-cols":[{"grid-cols":[ic]}],"col-start-end":[{col:["auto",{span:["full",rc,ut]},ut]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[ic]}],"row-start-end":[{row:["auto",{span:[rc,ut]},ut]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ut]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ut]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[k]}],mx:[{mx:[k]}],my:[{my:[k]}],ms:[{ms:[k]}],me:[{me:[k]}],mt:[{mt:[k]}],mr:[{mr:[k]}],mb:[{mb:[k]}],ml:[{ml:[k]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ut,t]}],"min-w":[{"min-w":[ut,t,"min","max","fit"]}],"max-w":[{"max-w":[ut,t,"none","full","min","max","fit","prose",{screen:[cs]},cs]}],h:[{h:[ut,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ut,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ut,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ut,t,"auto","min","max","fit"]}],"font-size":[{text:["base",cs,us]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",dx]}],"font-family":[{font:[ic]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ut]}],"line-clamp":[{"line-clamp":["none",El,dx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ho,ut]}],"list-image":[{"list-image":["none",ut]}],"list-style-type":[{list:["none","disc","decimal",ut]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ho,us]}],"underline-offset":[{"underline-offset":["auto",ho,ut]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ut]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ut]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),s6]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",o6]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},l6]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:W()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[ho,ut]}],"outline-w":[{outline:[ho,us]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[ho,us]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",cs,u6]}],"shadow-color":[{shadow:[ic]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",cs,ut]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[h]}],saturate:[{saturate:[C]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ut]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",ut]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",ut]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[rc,ut]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ut]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ut]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ut]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ho,us,dx]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},p6=ZV(h6);function Te(...e){return p6(lm(e))}const vb=async(e,t)=>{var r;const n=await fetch(e);if(!n.ok){const i=new Error("An error occurred while fetching the data.");throw i.info=await n.json(),i.status=n.status,t||nn.error(((r=i==null?void 0:i.info)==null?void 0:r.error)||(i==null?void 0:i.message)),i}return n.json()},m6=()=>y.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",children:[y.jsx("circle",{cx:"18.0002",cy:"18.0002",r:"15.2365",stroke:"currentColor",strokeWidth:"1.25409"}),y.jsx("ellipse",{cx:"18.0008",cy:"18",rx:"15.2365",ry:"10.2193",transform:"rotate(45 18.0008 18)",stroke:"currentColor",strokeWidth:"1.25409"}),y.jsx("path",{d:"M11.7793 18.0547H24.3007",stroke:"currentColor",strokeWidth:"1.25409"}),y.jsx("path",{d:"M14.8574 21.2354L21.2192 14.8736",stroke:"currentColor",strokeWidth:"1.25409"}),y.jsx("path",{d:"M21.2207 21.2354L14.8589 14.8736",stroke:"currentColor",strokeWidth:"1.25409"}),y.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.57571 11.2943C4.93105 13.0681 3.39081 15.4508 3.39081 17.9997C3.39081 20.5486 4.93105 22.9313 7.57571 24.7051C10.2163 26.4762 13.9001 27.592 18.0003 27.592C22.1004 27.592 25.7842 26.4762 28.4248 24.7051C31.0695 22.9313 32.6097 20.5486 32.6097 17.9997C32.6097 15.4508 31.0695 13.0681 28.4248 11.2943C25.7842 9.5232 22.1004 8.40741 18.0003 8.40741C13.9001 8.40741 10.2163 9.5232 7.57571 11.2943ZM6.87715 10.2528C9.75106 8.32521 13.6855 7.15332 18.0003 7.15332C22.315 7.15332 26.2495 8.32521 29.1234 10.2528C31.9932 12.1776 33.8638 14.9046 33.8638 17.9997C33.8638 21.0948 31.9932 23.8218 29.1234 25.7466C26.2495 27.6742 22.315 28.8461 18.0003 28.8461C13.6855 28.8461 9.75106 27.6742 6.87715 25.7466C4.00728 23.8218 2.13672 21.0948 2.13672 17.9997C2.13672 14.9046 4.00728 12.1776 6.87715 10.2528Z",fill:"currentColor"})]}),g6=[{name:"Agents",url:"/agents",icon:gR},{name:"Tools",url:"/tools",icon:rV},{name:"Workflows",url:"/workflows",icon:Dw}],y6=()=>{const{pathname:e}=Qi();return y.jsx("div",{className:"relative z-20 h-full text-mastra-el-6",children:y.jsxs("div",{className:"bg-mastra-bg-1 h-full w-full p-4 flex gap-6 flex-col",children:[y.jsx("div",{className:"flex items-center justify-between",children:y.jsxs("div",{className:"flex gap-2 px-2 items-center",children:[y.jsx(m6,{}),y.jsx("p",{className:"text-medium text-sm gradient py-[0.38rem] font-tasa",children:"Mastra Playground"})]})}),y.jsx("div",{children:y.jsx("div",{className:"flex flex-col gap-0.5",children:g6.map(t=>{const[n,r]=e.split("/"),i=t.name.toLowerCase(),o=t.url===e||t.name===e||r===i;return y.jsxs(Dd,{to:t.url,className:Te("flex cursor-pointer w-full px-2 items-center focus-visible:outline-none transition-colors focus-visible:ring-1 focus-visible:ring-mastra-border-4 gap-3 rounded-xs group text-small hover:bg-mastra-el-6/5",o?"bg-mastra-el-6/5":""),children:[y.jsx(t.icon,{className:Te("w-[0.875rem] h-[0.875rem] text-mastra-el-3 group-hover:text-mastra-el-6",o?"text-mastra-el-6":"")}),y.jsx("p",{className:Te("py-[0.38rem] text-mastra-el-6/60 group-hover:text-mastra-el-6 transition-all capitalize ",o?"text-mastra-el-6":""),children:t.name})]})})})}),y.jsxs("div",{className:"flex mt-auto gap-2 items-center justify-center",children:[y.jsx("a",{href:"https://mastra.ai",target:"_blank",rel:"noopener",className:"text-sm text-gray-300/60 hover:text-gray-100",children:"Mastra.AI"}),y.jsx("div",{className:"w-1 h-1 bg-gray-300/60 rounded-full"}),y.jsx("a",{href:"https://mastra.ai/docs/guide",target:"_blank",rel:"noopener",className:"text-sm text-gray-300/60 hover:text-gray-100",children:"Docs"}),y.jsx("div",{className:"w-1 h-1 bg-gray-300/60 rounded-full"}),y.jsx("a",{href:"https://github.com/mastra-ai/mastra",target:"_blank",rel:"noopener",className:"text-sm text-gray-300/60 hover:text-gray-100",children:"GitHub"})]})]})})};var x6=(e,t,n,r,i,o,s,a)=>{let u=document.documentElement,c=["light","dark"];function f(m){(Array.isArray(e)?e:[e]).forEach(x=>{let v=x==="class",k=v&&o?i.map(b=>o[b]||b):i;v?(u.classList.remove(...k),u.classList.add(m)):u.setAttribute(x,m)}),h(m)}function h(m){a&&c.includes(m)&&(u.style.colorScheme=m)}function p(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)f(r);else try{let m=localStorage.getItem(t)||n,x=s&&m==="system"?p():m;f(x)}catch{}},v6=S.createContext(void 0),w6={setTheme:e=>{},themes:[]},b6=()=>{var e;return(e=S.useContext(v6))!=null?e:w6};S.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:o,value:s,themes:a,nonce:u,scriptProps:c})=>{let f=JSON.stringify([n,t,o,e,a,s,r,i]).slice(1,-1);return S.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?u:"",dangerouslySetInnerHTML:{__html:`(${x6.toString()})(${f})`}})});const k6=({...e})=>{const{theme:t="system"}=b6();return y.jsx(IV,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},S6=S.createContext({theme:"system",setTheme:()=>null});function E6({children:e,defaultTheme:t="system"}){const[n,r]=S.useState(t);return S.useEffect(()=>{const i=window.document.documentElement;if(i.classList.remove("light","dark"),n==="system"){const o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";i.classList.add(o);return}i.classList.add(n)},[n]),y.jsx(S6.Provider,{value:{theme:n,setTheme:r},children:e})}const C6=({children:e})=>y.jsxs(E6,{defaultTheme:"dark",attribute:"class",children:[y.jsx(k6,{position:"bottom-right"}),y.jsxs("main",{className:"bg-mastra-bg-1 grid h-full w-full grid-cols-[15rem_minmax(0,_1fr)] overflow-clip",children:[y.jsx("div",{className:"z-20 h-full",children:y.jsx("div",{className:"h-full",children:y.jsx(y6,{})})}),y.jsx("div",{className:"bg-mastra-bg-2 grid h-[calc(100vh-1rem)] relative border-mastra-border-1 rounded-xs border-thin m-2 overflow-hidden border-solid",children:e})]})]}),Pr=({title:e,rightElement:t})=>y.jsx("header",{className:"sticky top-0 z-50",children:y.jsx("div",{className:"flex h-[var(--top-bar-height)] w-full content-center items-center justify-between border-b-[0.1px] border-mastra-border-1 px-[1.31rem]",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("h1",{className:"font-medium text-sm font-mono",children:e}),y.jsx("div",{className:"ml-auto",children:t})]})})});function Ue({className:e,...t}){return y.jsx("div",{className:Te("animate-pulse rounded-md bg-muted",e),...t})}const NR=()=>{const[e,t]=S.useState({}),[n,r]=S.useState(!0);return S.useEffect(()=>{(async()=>{r(!0);try{const o=await fetch("/api/agents");if(!o.ok){const a=await o.json();t({}),console.error("Error fetching agents",a),nn.error((a==null?void 0:a.error)||"Error fetching agents");return}const s=await o.json();t(s)}catch(o){t({}),console.error("Error fetching agents",o),nn.error("Error fetching agents")}finally{r(!1)}})()},[]),{agents:e,isLoading:n}},um=e=>{const[t,n]=S.useState(null),[r,i]=S.useState(!0);return S.useEffect(()=>{(async()=>{i(!0);try{if(!e){n(null),i(!1);return}const s=await fetch(`/api/agents/${e}`);if(!s.ok){const u=await s.json();n(null),console.error("Error fetching agent",u),nn.error((u==null?void 0:u.error)||"Error fetching agent");return}const a=await s.json();n(a)}catch(s){n(null),console.error("Error fetching agent",s),nn.error("Error fetching agent")}finally{i(!1)}})()},[e]),{agent:t,isLoading:r}},_6=()=>{const[e,t]=S.useState({}),[n,r]=S.useState(!0);return S.useEffect(()=>{(async()=>{r(!0);try{const o=await fetch("/api/tools");if(!o.ok){const a=await o.json();t({}),console.error("Error fetching tools",a),nn.error((a==null?void 0:a.error)||"Error fetching tools");return}const s=await o.json();t(s)}catch(o){t({}),console.error("Error fetching tools",o),nn.error("Error fetching tools")}finally{r(!1)}})()},[]),{tools:e,isLoading:n}},N6=e=>{const[t,n]=S.useState(null),[r,i]=S.useState(!0);return S.useEffect(()=>{(async()=>{i(!0);try{if(!e){n(null),i(!1);return}const s=await fetch(`/api/tools/${e}`);if(!s.ok){const u=await s.json();n(null),console.error("Error fetching tool",u),nn.error((u==null?void 0:u.error)||"Error fetching tool");return}const a=await s.json();n(a)}catch(s){n(null),console.error("Error fetching tool",s),nn.error("Error fetching tool")}finally{i(!1)}})()},[e]),{tool:t,isLoading:r}},T6=()=>{const{agents:e,isLoading:t}=NR(),{tools:n,isLoading:r}=_6(),[i,o]=S.useState(null),[s,a]=S.useState(!0),{agent:u,isLoading:c}=um(i),f=Lo();if(t)return y.jsxs("div",{className:"flex flex-col h-full w-full",children:[y.jsx(Pr,{title:"Tools"}),y.jsxs("div",{className:"w-full h-full grid grid-cols-[300px_1fr] py-6 px-4",children:[y.jsx("div",{className:"flex flex-col gap-4",children:y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx("div",{className:"px-2 py-2 rounded-md bg-mastra-bg-13 mb-2",children:y.jsxs("div",{className:"flex gap-2 items-center",children:[y.jsx(Ue,{className:"h-3 w-3"}),y.jsx(Ue,{className:"h-4 w-20"})]})}),y.jsx("div",{className:"flex flex-col gap-2",children:[1,2,3].map(m=>y.jsxs("div",{className:"flex gap-2 items-center px-2 py-2 rounded-md bg-mastra-bg-13",children:[y.jsx(Ue,{className:"h-3 w-3"}),y.jsx(Ue,{className:"h-4 w-24"})]},m))})]})}),y.jsx("div",{className:"border-l border-mastra-border-1 pl-4",children:y.jsx(Ue,{className:"h-full w-full rounded-md"})})]})]});const h=m=>{o(m),a(!1)},p=()=>{a(!0),o(null)};return r||c?y.jsxs("div",{className:"flex flex-col h-full w-full ",children:[y.jsx(Pr,{title:"Tools"}),y.jsx("div",{className:"w-full h-full grid grid-cols-[300px_1fr] ",children:y.jsx("div",{className:"w-full h-full border-r-[0.5px] border-mastra-border-1 py-6 px-4",children:y.jsx(Ue,{className:"h-full w-full rounded-md"})})})]}):y.jsxs("div",{className:"flex flex-col h-full w-full ",children:[y.jsx(Pr,{title:"Tools"}),y.jsxs("div",{className:"w-full h-full grid grid-cols-[300px_1fr] ",children:[y.jsx("div",{className:"w-full h-full border-r-[0.5px] border-mastra-border-1 py-6 px-4",children:y.jsxs("ul",{className:" flex flex-col gap-4",children:[Object.keys(n).length>0&&y.jsx("li",{className:Te("px-2 py-2 rounded-md hover:bg-mastra-bg-4/80 transition-colors cursor-pointer",s&&"bg-mastra-bg-4/80"),onClick:p,children:y.jsxs("div",{className:"flex gap-2 items-center",children:[y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-3",children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"})}),y.jsx("p",{className:"text-sm text-mastra-el-6",children:"All Tools"})]})}),Object.entries(e).map(([m,x])=>y.jsx("li",{className:Te("px-2 py-2 rounded-md hover:bg-mastra-bg-4/80 transition-colors cursor-pointer",i===m&&"bg-mastra-bg-4/80"),onClick:()=>h(m),children:y.jsxs("div",{className:"flex gap-2 items-center",children:[y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-3",children:y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"})}),y.jsxs("p",{className:"text-sm text-mastra-el-6",children:[x.name," Tools"]})]})},m))]})}),y.jsx("div",{className:"flex flex-col gap-4 py-6 px-4",children:y.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2",children:c?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] border-[0.5px] border-mastra-border-1",children:[y.jsx(Ue,{className:"h-4 w-24"}),y.jsx(Ue,{className:"h-4 w-full"})]}),y.jsxs("div",{className:"flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] border-[0.5px] border-mastra-border-1",children:[y.jsx(Ue,{className:"h-4 w-24"}),y.jsx(Ue,{className:"h-4 w-full"})]}),y.jsxs("div",{className:"flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] border-[0.5px] border-mastra-border-1",children:[y.jsx(Ue,{className:"h-4 w-24"}),y.jsx(Ue,{className:"h-4 w-full"})]}),y.jsxs("div",{className:"flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] border-[0.5px] border-mastra-border-1",children:[y.jsx(Ue,{className:"h-4 w-24"}),y.jsx(Ue,{className:"h-4 w-full"})]})]}):s?Object.entries(n).map(([m,x],v)=>y.jsxs("div",{onClick:()=>{f(`/tools/all/${x.id}`)},className:" hover:bg-mastra-bg-4/80 transition-colors flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] cursor-pointer border-[0.5px] border-mastra-border-1",children:[y.jsx("h3",{className:"text-small text-mastra-el-6",children:m}),y.jsx("p",{className:"text-small text-mastra-el-2",children:x.description})]},v)):Object.entries((u==null?void 0:u.tools)??{}).map(([m,x],v)=>y.jsxs("div",{onClick:()=>{f(`/tools/${i}/${x.id}`)},className:" hover:bg-mastra-bg-4/80 transition-colors flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] cursor-pointer border-[0.5px] border-mastra-border-1",children:[y.jsx("h3",{className:"text-small text-mastra-el-6",children:m}),y.jsx("p",{className:"text-small text-mastra-el-2",children:x.description})]},v))})})]})]})};function NC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function cm(...e){return t=>{let n=!1;const r=e.map(i=>{const o=NC(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():NC(e[i],null)}}}}function ht(...e){return S.useCallback(cm(...e),e)}var qi=S.forwardRef((e,t)=>{const{children:n,...r}=e,i=S.Children.toArray(n),o=i.find(A6);if(o){const s=o.props.children,a=i.map(u=>u===o?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:u);return y.jsx(Iw,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return y.jsx(Iw,{...r,ref:t,children:n})});qi.displayName="Slot";var Iw=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const i=R6(n);return S.cloneElement(n,{...P6(r,n.props),ref:t?cm(t,i):i})}return S.Children.count(n)>1?S.Children.only(null):null});Iw.displayName="SlotClone";var TR=({children:e})=>y.jsx(y.Fragment,{children:e});function A6(e){return S.isValidElement(e)&&e.type===TR}function P6(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function R6(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const TC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,AC=lm,lu=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return AC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(c=>{const f=n==null?void 0:n[c],h=o==null?void 0:o[c];if(f===null)return null;const p=TC(f)||TC(h);return i[c][p]}),a=n&&Object.entries(n).reduce((c,f)=>{let[h,p]=f;return p===void 0||(c[h]=p),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:h,className:p,...m}=f;return Object.entries(m).every(x=>{let[v,k]=x;return Array.isArray(k)?k.includes({...o,...a}[v]):{...o,...a}[v]===k})?[...c,h,p]:c},[]);return AC(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},Cl=lu("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-mastra-bg-7 border-[0.5px] border-mastra-border-4 text-white hover:bg-mastra-bg-7/70",primary:"border-[0.5px] border-mastra-border-1 bg-mastra-bg-4 hover:bg-mastra-bg-2/80 text-kp-el-6",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Mt=S.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?qi:"button";return y.jsx(s,{className:Te(Cl({variant:t,size:n,className:e})),ref:o,...i})});Mt.displayName="Button";var M6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],He=M6.reduce((e,t)=>{const n=S.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?qi:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(a,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function AR(e,t){e&&su.flushSync(()=>e.dispatchEvent(t))}var qn=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{};function D6(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var sr=e=>{const{present:t,children:n}=e,r=j6(t),i=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),o=ht(r.ref,O6(i));return typeof n=="function"||r.isPresent?S.cloneElement(i,{ref:o}):null};sr.displayName="Presence";function j6(e){const[t,n]=S.useState(),r=S.useRef({}),i=S.useRef(e),o=S.useRef("none"),s=e?"mounted":"unmounted",[a,u]=D6(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=Sh(r.current);o.current=a==="mounted"?c:"none"},[a]),qn(()=>{const c=r.current,f=i.current;if(f!==e){const p=o.current,m=Sh(c);e?u("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),qn(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,h=m=>{const v=Sh(r.current).includes(m.animationName);if(m.target===t&&v&&(u("ANIMATION_END"),!i.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},p=m=>{m.target===t&&(o.current=Sh(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:S.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Sh(e){return(e==null?void 0:e.animationName)||"none"}function O6(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function I6(e,t){const n=S.createContext(t),r=o=>{const{children:s,...a}=o,u=S.useMemo(()=>a,Object.values(a));return y.jsx(n.Provider,{value:u,children:s})};r.displayName=e+"Provider";function i(o){const s=S.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function ti(e,t=[]){let n=[];function r(o,s){const a=S.createContext(s),u=n.length;n=[...n,s];const c=h=>{var b;const{scope:p,children:m,...x}=h,v=((b=p==null?void 0:p[e])==null?void 0:b[u])||a,k=S.useMemo(()=>x,Object.values(x));return y.jsx(v.Provider,{value:k,children:m})};c.displayName=o+"Provider";function f(h,p){var v;const m=((v=p==null?void 0:p[e])==null?void 0:v[u])||a,x=S.useContext(m);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[c,f]}const i=()=>{const o=n.map(s=>S.createContext(s));return function(a){const u=(a==null?void 0:a[e])||o;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return i.scopeName=e,[r,L6(i,...t)]}function L6(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:u,scopeName:c})=>{const h=u(o)[`__scope${c}`];return{...a,...h}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function hn(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var F6=S.createContext(void 0);function jd(e){const t=S.useContext(F6);return e||t||"ltr"}function Lw(e,[t,n]){return Math.min(n,Math.max(t,e))}function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function $6(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var wb="ScrollArea",[PR,zxe]=ti(wb),[z6,ni]=PR(wb),RR=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[a,u]=S.useState(null),[c,f]=S.useState(null),[h,p]=S.useState(null),[m,x]=S.useState(null),[v,k]=S.useState(null),[b,E]=S.useState(0),[C,N]=S.useState(0),[P,T]=S.useState(!1),[D,R]=S.useState(!1),I=ht(t,z=>u(z)),M=jd(i);return y.jsx(z6,{scope:n,type:r,dir:M,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:f,content:h,onContentChange:p,scrollbarX:m,onScrollbarXChange:x,scrollbarXEnabled:P,onScrollbarXEnabledChange:T,scrollbarY:v,onScrollbarYChange:k,scrollbarYEnabled:D,onScrollbarYEnabledChange:R,onCornerWidthChange:E,onCornerHeightChange:N,children:y.jsx(He.div,{dir:M,...s,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})})});RR.displayName=wb;var MR="ScrollAreaViewport",DR=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=ni(MR,n),a=S.useRef(null),u=ht(t,a,s.onViewportChange);return y.jsxs(y.Fragment,{children:[y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),y.jsx(He.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:y.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});DR.displayName=MR;var Ji="ScrollAreaScrollbar",bb=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ni(Ji,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,a=e.orientation==="horizontal";return S.useEffect(()=>(a?o(!0):s(!0),()=>{a?o(!1):s(!1)}),[a,o,s]),i.type==="hover"?y.jsx(B6,{...r,ref:t,forceMount:n}):i.type==="scroll"?y.jsx(V6,{...r,ref:t,forceMount:n}):i.type==="auto"?y.jsx(jR,{...r,ref:t,forceMount:n}):i.type==="always"?y.jsx(kb,{...r,ref:t}):null});bb.displayName=Ji;var B6=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ni(Ji,e.__scopeScrollArea),[o,s]=S.useState(!1);return S.useEffect(()=>{const a=i.scrollArea;let u=0;if(a){const c=()=>{window.clearTimeout(u),s(!0)},f=()=>{u=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",f),()=>{window.clearTimeout(u),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",f)}}},[i.scrollArea,i.scrollHideDelay]),y.jsx(sr,{present:n||o,children:y.jsx(jR,{"data-state":o?"visible":"hidden",...r,ref:t})})}),V6=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ni(Ji,e.__scopeScrollArea),o=e.orientation==="horizontal",s=fm(()=>u("SCROLL_END"),100),[a,u]=$6("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return S.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,i.scrollHideDelay,u]),S.useEffect(()=>{const c=i.viewport,f=o?"scrollLeft":"scrollTop";if(c){let h=c[f];const p=()=>{const m=c[f];h!==m&&(u("SCROLL"),s()),h=m};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[i.viewport,o,u,s]),y.jsx(sr,{present:n||a!=="hidden",children:y.jsx(kb,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Re(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Re(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),jR=S.forwardRef((e,t)=>{const n=ni(Ji,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=S.useState(!1),a=e.orientation==="horizontal",u=fm(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,f=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:f)}},10);return Ol(n.viewport,u),Ol(n.content,u),y.jsx(sr,{present:r||o,children:y.jsx(kb,{"data-state":o?"visible":"hidden",...i,ref:t})})}),kb=S.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=ni(Ji,e.__scopeScrollArea),o=S.useRef(null),s=S.useRef(0),[a,u]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=$R(a.viewport,a.content),f={...r,sizes:a,onSizesChange:u,hasThumb:c>0&&c<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function h(p,m){return G6(p,s.current,a,m)}return n==="horizontal"?y.jsx(W6,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollLeft,m=PC(p,a,i.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=h(p,i.dir))}}):n==="vertical"?y.jsx(U6,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollTop,m=PC(p,a);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=h(p))}}):null}),W6=S.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=ni(Ji,e.__scopeScrollArea),[s,a]=S.useState(),u=S.useRef(null),c=ht(t,u,o.onScrollbarXChange);return S.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),y.jsx(IR,{"data-orientation":"horizontal",...i,ref:c,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":dm(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(o.viewport){const p=o.viewport.scrollLeft+f.deltaX;e.onWheelScroll(p),BR(p,h)&&f.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:fp(s.paddingLeft),paddingEnd:fp(s.paddingRight)}})}})}),U6=S.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=ni(Ji,e.__scopeScrollArea),[s,a]=S.useState(),u=S.useRef(null),c=ht(t,u,o.onScrollbarYChange);return S.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),y.jsx(IR,{"data-orientation":"vertical",...i,ref:c,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":dm(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(o.viewport){const p=o.viewport.scrollTop+f.deltaY;e.onWheelScroll(p),BR(p,h)&&f.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:fp(s.paddingTop),paddingEnd:fp(s.paddingBottom)}})}})}),[H6,OR]=PR(Ji),IR=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:u,onDragScroll:c,onWheelScroll:f,onResize:h,...p}=e,m=ni(Ji,n),[x,v]=S.useState(null),k=ht(t,I=>v(I)),b=S.useRef(null),E=S.useRef(""),C=m.viewport,N=r.content-r.viewport,P=hn(f),T=hn(u),D=fm(h,10);function R(I){if(b.current){const M=I.clientX-b.current.left,z=I.clientY-b.current.top;c({x:M,y:z})}}return S.useEffect(()=>{const I=M=>{const z=M.target;(x==null?void 0:x.contains(z))&&P(M,N)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[C,x,N,P]),S.useEffect(T,[r,T]),Ol(x,D),Ol(m.content,D),y.jsx(H6,{scope:n,scrollbar:x,hasThumb:i,onThumbChange:hn(o),onThumbPointerUp:hn(s),onThumbPositionChange:T,onThumbPointerDown:hn(a),children:y.jsx(He.div,{...p,ref:k,style:{position:"absolute",...p.style},onPointerDown:Re(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),b.current=x.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),R(I))}),onPointerMove:Re(e.onPointerMove,R),onPointerUp:Re(e.onPointerUp,I=>{const M=I.target;M.hasPointerCapture(I.pointerId)&&M.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=E.current,m.viewport&&(m.viewport.style.scrollBehavior=""),b.current=null})})})}),dp="ScrollAreaThumb",LR=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=OR(dp,e.__scopeScrollArea);return y.jsx(sr,{present:n||i.hasThumb,children:y.jsx(Y6,{ref:t,...r})})}),Y6=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=ni(dp,n),s=OR(dp,n),{onThumbPositionChange:a}=s,u=ht(t,h=>s.onThumbChange(h)),c=S.useRef(void 0),f=fm(()=>{c.current&&(c.current(),c.current=void 0)},100);return S.useEffect(()=>{const h=o.viewport;if(h){const p=()=>{if(f(),!c.current){const m=Z6(h,a);c.current=m,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[o.viewport,f,a]),y.jsx(He.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Re(e.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),x=h.clientX-m.left,v=h.clientY-m.top;s.onThumbPointerDown({x,y:v})}),onPointerUp:Re(e.onPointerUp,s.onThumbPointerUp)})});LR.displayName=dp;var Sb="ScrollAreaCorner",FR=S.forwardRef((e,t)=>{const n=ni(Sb,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?y.jsx(q6,{...e,ref:t}):null});FR.displayName=Sb;var q6=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=ni(Sb,n),[o,s]=S.useState(0),[a,u]=S.useState(0),c=!!(o&&a);return Ol(i.scrollbarX,()=>{var h;const f=((h=i.scrollbarX)==null?void 0:h.offsetHeight)||0;i.onCornerHeightChange(f),u(f)}),Ol(i.scrollbarY,()=>{var h;const f=((h=i.scrollbarY)==null?void 0:h.offsetWidth)||0;i.onCornerWidthChange(f),s(f)}),c?y.jsx(He.div,{...r,ref:t,style:{width:o,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function fp(e){return e?parseInt(e,10):0}function $R(e,t){const n=e/t;return isNaN(n)?0:n}function dm(e){const t=$R(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function G6(e,t,n,r="ltr"){const i=dm(n),o=i/2,s=t||o,a=i-s,u=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,f=n.content-n.viewport,h=r==="ltr"?[0,f]:[f*-1,0];return zR([u,c],h)(e)}function PC(e,t,n="ltr"){const r=dm(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,a=o-r,u=n==="ltr"?[0,s]:[s*-1,0],c=Lw(e,u);return zR([0,s],[0,a])(c)}function zR(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function BR(e,t){return e>0&&e<t}var Z6=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,a=n.top!==o.top;(s||a)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function fm(e,t){const n=hn(e),r=S.useRef(0);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),S.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ol(e,t){const n=hn(t);qn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var VR=RR,K6=DR,X6=FR;const Rn=S.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(VR,{ref:r,className:Te("relative overflow-hidden",e),...n,children:[y.jsx(K6,{className:"h-full w-full rounded-[inherit]",children:t}),y.jsx(WR,{}),y.jsx(X6,{})]}));Rn.displayName=VR.displayName;const WR=S.forwardRef(({className:e,orientation:t="vertical",...n},r)=>y.jsx(bb,{ref:r,orientation:t,className:Te("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:y.jsx(LR,{className:"relative flex-1 rounded-full bg-border"})}));WR.displayName=bb.displayName;const hm=S.forwardRef(({className:e,...t},n)=>y.jsx("table",{ref:n,className:Te("w-full caption-bottom text-sm border-spacing-0",e),...t}));hm.displayName="Table";const pm=S.forwardRef(({className:e,...t},n)=>y.jsx("thead",{ref:n,className:Te("[&_tr]:border-b",e),...t}));pm.displayName="TableHeader";const mm=S.forwardRef(({className:e,...t},n)=>y.jsx("tbody",{ref:n,className:Te("[&_tr:last-child]:border-0",e),...t}));mm.displayName="TableBody";const Q6=S.forwardRef(({className:e,...t},n)=>y.jsx("tfoot",{ref:n,className:Te("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Q6.displayName="TableFooter";const Xr=S.forwardRef(({className:e,...t},n)=>y.jsx("tr",{ref:n,className:Te("border-b-[0.5px] border-mastra-border-1 transition-colors hover:bg-muted/50 data-[state=selected]:bg-mastra-bg-4/70",e),...t}));Xr.displayName="TableRow";const mr=S.forwardRef(({className:e,...t},n)=>y.jsx("th",{ref:n,className:Te("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));mr.displayName="TableHead";const gt=S.forwardRef(({className:e,...t},n)=>y.jsx("td",{ref:n,className:Te("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));gt.displayName="TableCell";const J6=S.forwardRef(({className:e,...t},n)=>y.jsx("caption",{ref:n,className:Te("mt-4 text-sm text-muted-foreground",e),...t}));J6.displayName="TableCaption";function e8(){const{agents:e,isLoading:t}=NR(),n=Lo();return y.jsxs("div",{className:"flex flex-col h-full relative overflow-hidden",children:[y.jsx(Pr,{title:"Agents"}),y.jsx("main",{className:"flex-1 relative overflow-hidden",children:y.jsx(Rn,{className:"rounded-lg h-full",children:y.jsxs(hm,{children:[y.jsx(pm,{className:"bg-[#171717] sticky top-0 z-10",children:y.jsxs(Xr,{className:"border-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[y.jsx(mr,{className:"w-[50px]"}),y.jsx(mr,{className:"text-mastra-el-3",children:"Name"}),y.jsx(mr,{className:"text-mastra-el-3 w-1/2",children:"Instruction"}),y.jsx(mr,{className:"text-mastra-el-3",children:"Model"}),y.jsx(mr,{className:"text-mastra-el-3",children:"Action"})]})}),y.jsx(mm,{className:"border-b border-gray-6",children:t?y.jsxs(Xr,{className:"border-b-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[y.jsx(gt,{children:y.jsx(Ue,{className:"h-8 w-8"})}),y.jsx(gt,{children:y.jsx(Ue,{className:"h-8 w-full"})}),y.jsx(gt,{children:y.jsx(Ue,{className:"h-8 w-full"})}),y.jsx(gt,{children:y.jsx(Ue,{className:"h-8 w-full"})})]}):Object.entries(e).map(([r,i])=>y.jsxs(Xr,{className:"border-b-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[y.jsx(gt,{children:y.jsx("div",{className:"h-8 w-full flex items-center justify-center",children:y.jsx(gR,{className:"h-4 w-4 text-mastra-el-5"})})}),y.jsx(gt,{className:"font-medium text-mastra-el-5",children:i.name}),y.jsx(gt,{className:"truncate w-1/2 max-w-[500px] text-mastra-el-5",children:i.instructions}),y.jsx(gt,{className:"text-mastra-el-5 text-sm",children:i.provider}),y.jsx(gt,{className:"text-mastra-el-5 text-sm",children:y.jsx("span",{onClick:()=>{n(`/agents/${r}`)},className:"hover:no-underline",children:y.jsxs(Mt,{size:"sm",variant:"outline",children:[y.jsx(JB,{className:"h-4 w-4 text-inherit"}),"Chat with agent"]})})})]},r))})]})})})]})}var fx={exports:{}},hx={};/**
|
|
198
198
|
* @license React
|
|
199
199
|
* use-sync-external-store-shim.production.js
|
|
200
200
|
*
|
|
@@ -237,9 +237,9 @@ Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}
|
|
|
237
237
|
`))+1))}const s="#".repeat(i),a=n.enter("headingAtx"),u=n.enter("phrasing");o.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
|
|
238
238
|
`,...o.current()});return/^[\t ]/.test(c)&&(c=Jc(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),u(),a(),c}xD.peek=wK;function xD(e){return e.value||""}function wK(){return"<"}vD.peek=bK;function vD(e,t,n,r){const i=E1(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const u=n.createTracker(r);let c=u.move("![");return c+=u.move(n.safe(e.alt,{before:c,after:"]",...u.current()})),c+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(a=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),a()),c+=u.move(")"),s(),c}function bK(){return"!"}wD.peek=kK;function wD(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let u=a.move("![");const c=n.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(c+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!c||c!==h?u+=a.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function kK(){return"!"}bD.peek=SK;function bD(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let u;if(s.atBreak)for(;u=a.exec(r);){let c=u.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(u.index+1)}}return i+r+i}function SK(){return"`"}function kD(e,t){const n=m1(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}SD.peek=EK;function SD(e,t,n,r){const i=E1(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,u;if(kD(e,n)){const f=n.stack;n.stack=[],a=n.enter("autolink");let h=s.move("<");return h+=s.move(n.containerPhrasing(e,{before:h,after:">",...s.current()})),h+=s.move(">"),a(),n.stack=f,h}a=n.enter("link"),u=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(u=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=n.enter(`title${o}`),c+=s.move(" "+i),c+=s.move(n.safe(e.title,{before:c,after:i,...s.current()})),c+=s.move(i),u()),c+=s.move(")"),a(),c}function EK(e,t,n){return kD(e,n)?"<":"["}ED.peek=CK;function ED(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let u=a.move("[");const c=n.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(c+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!c||c!==h?u+=a.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function CK(){return"["}function C1(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function _K(e){const t=C1(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function NK(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function CD(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function TK(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?NK(n):C1(n);const a=e.ordered?s==="."?")":".":_K(n);let u=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),CD(n)===s&&f){let h=-1;for(;++h<e.children.length;){const p=e.children[h];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=a),n.bulletCurrent=s;const c=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),c}function AK(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function PK(e,t,n,r){const i=AK(n);let o=n.bulletCurrent||C1(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),f);return u(),c;function f(h,p,m){return p?(m?"":" ".repeat(s))+h:(m?o:o+" ".repeat(s-o.length))+h}}function RK(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const MK=Nm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function DK(e,t,n,r){return(e.children.some(function(s){return MK(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function jK(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}_D.peek=OK;function _D(e,t,n,r){const i=jK(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i);let u=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const c=u.charCodeAt(0),f=Sp(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(u=Jc(c)+u.slice(1));const h=u.charCodeAt(u.length-1),p=Sp(r.after.charCodeAt(0),h,i);p.inside&&(u=u.slice(0,-1)+Jc(h));const m=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+u+m}function OK(e,t,n){return n.options.strong||"*"}function IK(e,t,n,r){return n.safe(e.value,r)}function LK(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function FK(e,t,n){const r=(CD(n)+(n.options.ruleSpaces?" ":"")).repeat(LK(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ND={blockquote:aK,break:zN,code:hK,definition:mK,emphasis:yD,hardBreak:zN,heading:vK,html:xD,image:vD,imageReference:wD,inlineCode:bD,link:SD,linkReference:ED,list:TK,listItem:PK,paragraph:RK,root:DK,strong:_D,text:IK,thematicBreak:FK};function $K(){return{enter:{table:zK,tableData:BN,tableHeader:BN,tableRow:VK},exit:{codeText:WK,table:BK,tableData:Gx,tableHeader:Gx,tableRow:Gx}}}function zK(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function BK(e){this.exit(e),this.data.inTable=void 0}function VK(e){this.enter({type:"tableRow",children:[]},e)}function Gx(e){this.exit(e)}function BN(e){this.enter({type:"tableCell",children:[]},e)}function WK(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,UK));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function UK(e,t){return t==="|"?t:e}function HK(e){const t=e,n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
239
239
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:u,tableRow:a}};function s(m,x,v,k){return c(f(m,v,k),m.align)}function a(m,x,v,k){const b=h(m,v,k),E=c([b]);return E.slice(0,E.indexOf(`
|
|
240
|
-
`))}function u(m,x,v,k){const b=v.enter("tableCell"),E=v.enter("phrasing"),C=v.containerPhrasing(m,{...k,before:o,after:o});return E(),b(),C}function c(m,x){return oK(m,{align:x,alignDelimiters:r,padding:n,stringLength:i})}function f(m,x,v){const k=m.children;let b=-1;const E=[],C=x.enter("table");for(;++b<k.length;)E[b]=h(k[b],x,v);return C(),E}function h(m,x,v){const k=m.children;let b=-1;const E=[],C=x.enter("tableRow");for(;++b<k.length;)E[b]=u(k[b],m,x,v);return C(),E}function p(m,x,v){let k=ND.inlineCode(m,x,v);return v.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function YK(){return{exit:{taskListCheckValueChecked:VN,taskListCheckValueUnchecked:VN,paragraph:GK}}}function qK(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ZK}}}function VN(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function GK(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function ZK(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let u=ND.listItem(e,t,n,{...r,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),u;function c(f){return f+s}}function KK(){return[NZ(),$Z(),JZ(),$K(),YK()]}function XK(e){return{extensions:[TZ(),zZ(),eK(),HK(e),qK()]}}const QK={tokenize:iX,partial:!0},TD={tokenize:oX,partial:!0},AD={tokenize:sX,partial:!0},PD={tokenize:aX,partial:!0},JK={tokenize:lX,partial:!0},RD={name:"wwwAutolink",tokenize:nX,previous:DD},MD={name:"protocolAutolink",tokenize:rX,previous:jD},Fo={name:"emailAutolink",tokenize:tX,previous:OD},eo={};function eX(){return{text:eo}}let ea=48;for(;ea<123;)eo[ea]=Fo,ea++,ea===58?ea=65:ea===91&&(ea=97);eo[43]=Fo;eo[45]=Fo;eo[46]=Fo;eo[95]=Fo;eo[72]=[Fo,MD];eo[104]=[Fo,MD];eo[87]=[Fo,RD];eo[119]=[Fo,RD];function tX(e,t,n){const r=this;let i,o;return s;function s(h){return!x0(h)||!OD.call(r,r.previous)||_1(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(h))}function a(h){return x0(h)?(e.consume(h),a):h===64?(e.consume(h),u):n(h)}function u(h){return h===46?e.check(JK,f,c)(h):h===45||h===95||Yn(h)?(o=!0,e.consume(h),u):f(h)}function c(h){return e.consume(h),i=!0,u}function f(h){return o&&i&&ir(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function nX(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!DD.call(r,r.previous)||_1(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(QK,e.attempt(TD,e.attempt(AD,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function rX(e,t,n){const r=this;let i="",o=!1;return s;function s(h){return(h===72||h===104)&&jD.call(r,r.previous)&&!_1(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),a):n(h)}function a(h){if(ir(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),a;if(h===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(h),u}return n(h)}function u(h){return h===47?(e.consume(h),o?c:(o=!0,u)):n(h)}function c(h){return h===null||wp(h)||Dt(h)||pa(h)||Em(h)?n(h):e.attempt(TD,e.attempt(AD,f),n)(h)}function f(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function iX(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function oX(e,t,n){let r,i,o;return s;function s(c){return c===46||c===95?e.check(PD,u,a)(c):c===null||Dt(c)||pa(c)||c!==45&&Em(c)?u(c):(o=!0,e.consume(c),s)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function u(c){return i||r||!o?n(c):t(c)}}function sX(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(PD,t,o)(s):s===null||Dt(s)||pa(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function aX(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||Dt(a)||pa(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Dt(a)||pa(a)?t(a):r(a)}function o(a){return ir(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):ir(a)?(e.consume(a),s):n(a)}}function lX(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return Yn(o)?n(o):t(o)}}function DD(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Dt(e)}function jD(e){return!ir(e)}function OD(e){return!(e===47||x0(e))}function x0(e){return e===43||e===45||e===46||e===95||Yn(e)}function _1(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const uX={tokenize:yX,partial:!0};function cX(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:pX,continuation:{tokenize:mX},exit:gX}},text:{91:{name:"gfmFootnoteCall",tokenize:hX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:dX,resolveTo:fX}}}}function dX(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!s||!s._balanced)return n(u);const c=wi(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function fX(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function hX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(h){if(o>999||h===93&&!s||h===null||h===91||Dt(h))return n(h);if(h===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(wi(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return Dt(h)||(s=!0),o++,e.consume(h),h===92?f:c}function f(h){return h===91||h===92||h===93?(e.consume(h),o++,c):c(h)}}function pX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return u;function u(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(x)}function f(x){if(s>999||x===93&&!a||x===null||x===91||Dt(x))return n(x);if(x===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return o=wi(r.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Dt(x)||(a=!0),s++,e.consume(x),x===92?h:f}function h(x){return x===91||x===92||x===93?(e.consume(x),s++,f):f(x)}function p(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),i.includes(o)||i.push(o),vt(e,m,"gfmFootnoteDefinitionWhitespace")):n(x)}function m(x){return t(x)}}function mX(e,t,n){return e.check(zd,t,e.attempt(uX,t,n))}function gX(e){e.exit("gfmFootnoteDefinition")}function yX(e,t,n){const r=this;return vt(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function xX(e){let n=e.singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let c=u;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[u][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[u][1].end)},h={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[u][1].start)},p=[["enter",f,a],["enter",s[c][1],a],["exit",s[c][1],a],["enter",h,a]],m=a.parser.constructs.insideSpan.null;m&&Mr(p,p.length,0,Cm(m,s.slice(c+1,u),a)),Mr(p,p.length,0,[["exit",h,a],["enter",s[u][1],a],["exit",s[u][1],a],["exit",f,a]]),Mr(s,c-1,u-c+3,p),u=c+p.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,a,u){const c=this.previous,f=this.events;let h=0;return p;function p(x){return c===126&&f[f.length-1][1].type!=="characterEscape"?u(x):(s.enter("strikethroughSequenceTemporary"),m(x))}function m(x){const v=$l(c);if(x===126)return h>1?u(x):(s.consume(x),h++,m);if(h<2&&!n)return u(x);const k=s.exit("strikethroughSequenceTemporary"),b=$l(x);return k._open=!b||b===2&&!!v,k._close=!v||v===2&&!!b,a(x)}}}class vX{constructor(){this.map=[]}add(t,n,r){wX(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function wX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function bX(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function kX(){return{flow:{null:{name:"table",tokenize:SX,resolveAll:EX}}}}function SX(e,t,n){const r=this;let i=0,o=0,s;return a;function a(M){let z=r.events.length-1;for(;z>-1;){const O=r.events[z][1].type;if(O==="lineEnding"||O==="linePrefix")z--;else break}const F=z>-1?r.events[z][1].type:null,Y=F==="tableHead"||F==="tableRow"?T:u;return Y===T&&r.parser.lazy[r.now().line]?n(M):Y(M)}function u(M){return e.enter("tableHead"),e.enter("tableRow"),c(M)}function c(M){return M===124||(s=!0,o+=1),f(M)}function f(M){return M===null?n(M):Ze(M)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),m):n(M):mt(M)?vt(e,f,"whitespace")(M):(o+=1,s&&(s=!1,i+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),h(M)))}function h(M){return M===null||M===124||Dt(M)?(e.exit("data"),f(M)):(e.consume(M),M===92?p:h)}function p(M){return M===92||M===124?(e.consume(M),h):h(M)}function m(M){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(M):(e.enter("tableDelimiterRow"),s=!1,mt(M)?vt(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):x(M))}function x(M){return M===45||M===58?k(M):M===124?(s=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),v):P(M)}function v(M){return mt(M)?vt(e,k,"whitespace")(M):k(M)}function k(M){return M===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),b):M===45?(o+=1,b(M)):M===null||Ze(M)?N(M):P(M)}function b(M){return M===45?(e.enter("tableDelimiterFiller"),E(M)):P(M)}function E(M){return M===45?(e.consume(M),E):M===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(M))}function C(M){return mt(M)?vt(e,N,"whitespace")(M):N(M)}function N(M){return M===124?x(M):M===null||Ze(M)?!s||i!==o?P(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):P(M)}function P(M){return n(M)}function T(M){return e.enter("tableRow"),D(M)}function D(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),D):M===null||Ze(M)?(e.exit("tableRow"),t(M)):mt(M)?vt(e,D,"whitespace")(M):(e.enter("data"),R(M))}function R(M){return M===null||M===124||Dt(M)?(e.exit("data"),D(M)):(e.consume(M),M===92?I:R)}function I(M){return M===92||M===124?(e.consume(M),R):R(M)}}function EX(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,u=0,c,f,h;const p=new vX;for(;++n<e.length;){const m=e[n],x=m[1];m[0]==="enter"?x.type==="tableHead"?(a=!1,u!==0&&(WN(p,t,u,c,f),f=void 0,u=0),c={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},p.add(n,0,[["enter",c,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,h=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},p.add(n,0,[["enter",f,t]])),i=x.type==="tableDelimiterRow"?2:f?3:1):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],h=Dh(p,t,o,i,void 0,h),o=[0,0,0,0]),s[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],h=Dh(p,t,o,i,void 0,h)),o=s,s=[o[1],n,0,0])):x.type==="tableHead"?(a=!0,u=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(u=n,o[1]!==0?(s[0]=s[1],h=Dh(p,t,o,i,n,h)):s[1]!==0&&(h=Dh(p,t,s,i,n,h)),i=0):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&WN(p,t,u,c,f),p.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=bX(t.events,n))}return e}function Dh(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},fl(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const u=fl(t.events,n[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=fl(t.events,n[2]),f=fl(t.events,n[3]),h={type:a,start:Object.assign({},c),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const p=t.events[n[2]],m=t.events[n[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,v=n[3]-n[2]-1;e.add(x,v,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(o.end=Object.assign({},fl(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function WN(e,t,n,r,i){const o=[],s=fl(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function fl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const CX={name:"tasklistCheck",tokenize:NX};function _X(){return{text:{91:CX}}}function NX(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return Dt(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(u)}function a(u){return Ze(u)?t(u):mt(u)?e.check({tokenize:TX},t,n)(u):n(u)}}function TX(e,t,n){return vt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function AX(e){return q2([eX(),cX(),xX(e),kX(),_X()])}const PX={};function RX(e){const t=this,n=e||PX,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(AX(n)),o.push(KK()),s.push(XK(n))}const MX="modulepreload",DX=function(e){return"/"+e},UN={},jX=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(n.map(u=>{if(u=DX(u),u in UN)return;UN[u]=!0;const c=u.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":MX,c||(h.as="script"),h.crossOrigin="",h.href=u,a&&h.setAttribute("nonce",a),document.head.appendChild(h),c)return new Promise((p,m)=>{h.addEventListener("load",p),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})};async function OX(e,t){const{codeToTokens:n,bundledLanguages:r}=await jX(async()=>{const{codeToTokens:o,bundledLanguages:s}=await import("./index-vzaT05Qh.js");return{codeToTokens:o,bundledLanguages:s}},[]);if(!(t in r))return null;const{tokens:i}=await n(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return i}function IX({children:e}){const t=e.replace(/\\n/g,`
|
|
240
|
+
`))}function u(m,x,v,k){const b=v.enter("tableCell"),E=v.enter("phrasing"),C=v.containerPhrasing(m,{...k,before:o,after:o});return E(),b(),C}function c(m,x){return oK(m,{align:x,alignDelimiters:r,padding:n,stringLength:i})}function f(m,x,v){const k=m.children;let b=-1;const E=[],C=x.enter("table");for(;++b<k.length;)E[b]=h(k[b],x,v);return C(),E}function h(m,x,v){const k=m.children;let b=-1;const E=[],C=x.enter("tableRow");for(;++b<k.length;)E[b]=u(k[b],m,x,v);return C(),E}function p(m,x,v){let k=ND.inlineCode(m,x,v);return v.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function YK(){return{exit:{taskListCheckValueChecked:VN,taskListCheckValueUnchecked:VN,paragraph:GK}}}function qK(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ZK}}}function VN(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function GK(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function ZK(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let u=ND.listItem(e,t,n,{...r,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),u;function c(f){return f+s}}function KK(){return[NZ(),$Z(),JZ(),$K(),YK()]}function XK(e){return{extensions:[TZ(),zZ(),eK(),HK(e),qK()]}}const QK={tokenize:iX,partial:!0},TD={tokenize:oX,partial:!0},AD={tokenize:sX,partial:!0},PD={tokenize:aX,partial:!0},JK={tokenize:lX,partial:!0},RD={name:"wwwAutolink",tokenize:nX,previous:DD},MD={name:"protocolAutolink",tokenize:rX,previous:jD},Fo={name:"emailAutolink",tokenize:tX,previous:OD},eo={};function eX(){return{text:eo}}let ea=48;for(;ea<123;)eo[ea]=Fo,ea++,ea===58?ea=65:ea===91&&(ea=97);eo[43]=Fo;eo[45]=Fo;eo[46]=Fo;eo[95]=Fo;eo[72]=[Fo,MD];eo[104]=[Fo,MD];eo[87]=[Fo,RD];eo[119]=[Fo,RD];function tX(e,t,n){const r=this;let i,o;return s;function s(h){return!x0(h)||!OD.call(r,r.previous)||_1(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(h))}function a(h){return x0(h)?(e.consume(h),a):h===64?(e.consume(h),u):n(h)}function u(h){return h===46?e.check(JK,f,c)(h):h===45||h===95||Yn(h)?(o=!0,e.consume(h),u):f(h)}function c(h){return e.consume(h),i=!0,u}function f(h){return o&&i&&ir(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function nX(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!DD.call(r,r.previous)||_1(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(QK,e.attempt(TD,e.attempt(AD,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function rX(e,t,n){const r=this;let i="",o=!1;return s;function s(h){return(h===72||h===104)&&jD.call(r,r.previous)&&!_1(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),a):n(h)}function a(h){if(ir(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),a;if(h===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(h),u}return n(h)}function u(h){return h===47?(e.consume(h),o?c:(o=!0,u)):n(h)}function c(h){return h===null||wp(h)||Dt(h)||pa(h)||Em(h)?n(h):e.attempt(TD,e.attempt(AD,f),n)(h)}function f(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function iX(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function oX(e,t,n){let r,i,o;return s;function s(c){return c===46||c===95?e.check(PD,u,a)(c):c===null||Dt(c)||pa(c)||c!==45&&Em(c)?u(c):(o=!0,e.consume(c),s)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function u(c){return i||r||!o?n(c):t(c)}}function sX(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(PD,t,o)(s):s===null||Dt(s)||pa(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function aX(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||Dt(a)||pa(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Dt(a)||pa(a)?t(a):r(a)}function o(a){return ir(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):ir(a)?(e.consume(a),s):n(a)}}function lX(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return Yn(o)?n(o):t(o)}}function DD(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Dt(e)}function jD(e){return!ir(e)}function OD(e){return!(e===47||x0(e))}function x0(e){return e===43||e===45||e===46||e===95||Yn(e)}function _1(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const uX={tokenize:yX,partial:!0};function cX(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:pX,continuation:{tokenize:mX},exit:gX}},text:{91:{name:"gfmFootnoteCall",tokenize:hX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:dX,resolveTo:fX}}}}function dX(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!s||!s._balanced)return n(u);const c=wi(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function fX(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function hX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(h){if(o>999||h===93&&!s||h===null||h===91||Dt(h))return n(h);if(h===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(wi(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return Dt(h)||(s=!0),o++,e.consume(h),h===92?f:c}function f(h){return h===91||h===92||h===93?(e.consume(h),o++,c):c(h)}}function pX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return u;function u(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(x)}function f(x){if(s>999||x===93&&!a||x===null||x===91||Dt(x))return n(x);if(x===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return o=wi(r.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Dt(x)||(a=!0),s++,e.consume(x),x===92?h:f}function h(x){return x===91||x===92||x===93?(e.consume(x),s++,f):f(x)}function p(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),i.includes(o)||i.push(o),vt(e,m,"gfmFootnoteDefinitionWhitespace")):n(x)}function m(x){return t(x)}}function mX(e,t,n){return e.check(zd,t,e.attempt(uX,t,n))}function gX(e){e.exit("gfmFootnoteDefinition")}function yX(e,t,n){const r=this;return vt(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function xX(e){let n=e.singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let c=u;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[u][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[u][1].end)},h={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[u][1].start)},p=[["enter",f,a],["enter",s[c][1],a],["exit",s[c][1],a],["enter",h,a]],m=a.parser.constructs.insideSpan.null;m&&Mr(p,p.length,0,Cm(m,s.slice(c+1,u),a)),Mr(p,p.length,0,[["exit",h,a],["enter",s[u][1],a],["exit",s[u][1],a],["exit",f,a]]),Mr(s,c-1,u-c+3,p),u=c+p.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,a,u){const c=this.previous,f=this.events;let h=0;return p;function p(x){return c===126&&f[f.length-1][1].type!=="characterEscape"?u(x):(s.enter("strikethroughSequenceTemporary"),m(x))}function m(x){const v=$l(c);if(x===126)return h>1?u(x):(s.consume(x),h++,m);if(h<2&&!n)return u(x);const k=s.exit("strikethroughSequenceTemporary"),b=$l(x);return k._open=!b||b===2&&!!v,k._close=!v||v===2&&!!b,a(x)}}}class vX{constructor(){this.map=[]}add(t,n,r){wX(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function wX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function bX(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function kX(){return{flow:{null:{name:"table",tokenize:SX,resolveAll:EX}}}}function SX(e,t,n){const r=this;let i=0,o=0,s;return a;function a(M){let z=r.events.length-1;for(;z>-1;){const O=r.events[z][1].type;if(O==="lineEnding"||O==="linePrefix")z--;else break}const F=z>-1?r.events[z][1].type:null,Y=F==="tableHead"||F==="tableRow"?T:u;return Y===T&&r.parser.lazy[r.now().line]?n(M):Y(M)}function u(M){return e.enter("tableHead"),e.enter("tableRow"),c(M)}function c(M){return M===124||(s=!0,o+=1),f(M)}function f(M){return M===null?n(M):Ze(M)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),m):n(M):mt(M)?vt(e,f,"whitespace")(M):(o+=1,s&&(s=!1,i+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),h(M)))}function h(M){return M===null||M===124||Dt(M)?(e.exit("data"),f(M)):(e.consume(M),M===92?p:h)}function p(M){return M===92||M===124?(e.consume(M),h):h(M)}function m(M){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(M):(e.enter("tableDelimiterRow"),s=!1,mt(M)?vt(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):x(M))}function x(M){return M===45||M===58?k(M):M===124?(s=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),v):P(M)}function v(M){return mt(M)?vt(e,k,"whitespace")(M):k(M)}function k(M){return M===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),b):M===45?(o+=1,b(M)):M===null||Ze(M)?N(M):P(M)}function b(M){return M===45?(e.enter("tableDelimiterFiller"),E(M)):P(M)}function E(M){return M===45?(e.consume(M),E):M===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(M))}function C(M){return mt(M)?vt(e,N,"whitespace")(M):N(M)}function N(M){return M===124?x(M):M===null||Ze(M)?!s||i!==o?P(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):P(M)}function P(M){return n(M)}function T(M){return e.enter("tableRow"),D(M)}function D(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),D):M===null||Ze(M)?(e.exit("tableRow"),t(M)):mt(M)?vt(e,D,"whitespace")(M):(e.enter("data"),R(M))}function R(M){return M===null||M===124||Dt(M)?(e.exit("data"),D(M)):(e.consume(M),M===92?I:R)}function I(M){return M===92||M===124?(e.consume(M),R):R(M)}}function EX(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,u=0,c,f,h;const p=new vX;for(;++n<e.length;){const m=e[n],x=m[1];m[0]==="enter"?x.type==="tableHead"?(a=!1,u!==0&&(WN(p,t,u,c,f),f=void 0,u=0),c={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},p.add(n,0,[["enter",c,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,h=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},p.add(n,0,[["enter",f,t]])),i=x.type==="tableDelimiterRow"?2:f?3:1):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],h=Dh(p,t,o,i,void 0,h),o=[0,0,0,0]),s[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],h=Dh(p,t,o,i,void 0,h)),o=s,s=[o[1],n,0,0])):x.type==="tableHead"?(a=!0,u=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(u=n,o[1]!==0?(s[0]=s[1],h=Dh(p,t,o,i,n,h)):s[1]!==0&&(h=Dh(p,t,s,i,n,h)),i=0):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&WN(p,t,u,c,f),p.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=bX(t.events,n))}return e}function Dh(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},fl(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const u=fl(t.events,n[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=fl(t.events,n[2]),f=fl(t.events,n[3]),h={type:a,start:Object.assign({},c),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const p=t.events[n[2]],m=t.events[n[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,v=n[3]-n[2]-1;e.add(x,v,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(o.end=Object.assign({},fl(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function WN(e,t,n,r,i){const o=[],s=fl(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function fl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const CX={name:"tasklistCheck",tokenize:NX};function _X(){return{text:{91:CX}}}function NX(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return Dt(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(u)}function a(u){return Ze(u)?t(u):mt(u)?e.check({tokenize:TX},t,n)(u):n(u)}}function TX(e,t,n){return vt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function AX(e){return q2([eX(),cX(),xX(e),kX(),_X()])}const PX={};function RX(e){const t=this,n=e||PX,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(AX(n)),o.push(KK()),s.push(XK(n))}const MX="modulepreload",DX=function(e){return"/"+e},UN={},jX=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(n.map(u=>{if(u=DX(u),u in UN)return;UN[u]=!0;const c=u.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":MX,c||(h.as="script"),h.crossOrigin="",h.href=u,a&&h.setAttribute("nonce",a),document.head.appendChild(h),c)return new Promise((p,m)=>{h.addEventListener("load",p),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})};async function OX(e,t){const{codeToTokens:n,bundledLanguages:r}=await jX(async()=>{const{codeToTokens:o,bundledLanguages:s}=await import("./index-BOrh4xwp.js");return{codeToTokens:o,bundledLanguages:s}},[]);if(!(t in r))return null;const{tokens:i}=await n(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return i}function IX({children:e}){const t=e.replace(/\\n/g,`
|
|
241
241
|
`);return y.jsx(wZ,{remarkPlugins:[RX],components:FX,className:"space-y-3",children:t})}const ID=ne.memo(({children:e,language:t,...n})=>{const[r,i]=S.useState([]);return S.useEffect(()=>{OX(e,t).then(o=>{o&&i(o)})},[e,t]),r.length?y.jsx("pre",{...n,children:y.jsx("code",{children:r.map((o,s)=>y.jsxs(y.Fragment,{children:[y.jsx("span",{children:o.map((a,u)=>{const c=typeof a.htmlStyle=="string"?void 0:a.htmlStyle;return y.jsx("span",{className:"text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",style:c,children:a.content},u)})},s),s!==r.length-1&&`
|
|
242
|
-
`]}))})}):y.jsx("pre",{...n,children:e})});ID.displayName="HighlightedCode";const LX=({children:e,className:t,language:n,...r})=>{const i=typeof e=="string"?e:v0(e),o=Te("overflow-x-scroll rounded-md border bg-background/50 p-4 font-mono text-sm [scrollbar-width:none]",t);return y.jsxs("div",{className:"group/code relative mb-4",children:[y.jsx(S.Suspense,{fallback:y.jsx("pre",{className:o,...r,children:e}),children:y.jsx(ID,{language:n,className:o,children:i})}),y.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:y.jsx(Yc,{content:i,copyMessage:"Copied code to clipboard"})})]})};function v0(e){var t;if(typeof e=="string")return e;if((t=e==null?void 0:e.props)!=null&&t.children){let n=e.props.children;return Array.isArray(n)?n.map(r=>v0(r)).join(""):v0(n)}return""}const FX={h1:In("h1","text-2xl font-semibold"),h2:In("h2","font-semibold text-xl"),h3:In("h3","font-semibold text-lg"),h4:In("h4","font-semibold text-base"),h5:In("h5","font-medium"),strong:In("strong","font-semibold"),a:In("a","text-primary underline underline-offset-2"),blockquote:In("blockquote","border-l-2 border-primary pl-4"),code:({children:e,className:t,node:n,...r})=>{const i=/language-(\w+)/.exec(t||"");return i?y.jsx(LX,{className:t,language:i[1],...r,children:e}):y.jsx("code",{className:Te("font-mono [:not(pre)>&]:rounded-md [:not(pre)>&]:bg-background/50 [:not(pre)>&]:px-1 [:not(pre)>&]:py-0.5"),...r,children:e})},pre:({children:e})=>e,ol:In("ol","list-decimal space-y-2 pl-6"),ul:In("ul","list-disc space-y-2 pl-6"),li:In("li","my-1.5"),table:In("table","w-full border-collapse overflow-y-auto rounded-md border border-foreground/20"),th:In("th","border border-foreground/20 px-4 py-2 text-left font-bold [&[align=center]]:text-center [&[align=right]]:text-right"),td:In("td","border border-foreground/20 px-4 py-2 text-left [&[align=center]]:text-center [&[align=right]]:text-right"),tr:In("tr","m-0 border-t p-0 even:bg-muted"),p:In("p","whitespace-pre-wrap leading-relaxed"),hr:In("hr","border-foreground/20")};function In(e,t){const n=({node:r,...i})=>y.jsx(e,{className:t,...i});return n.displayName=e,n}const $X=lu("group/message relative break-words rounded-lg p-3 text-sm sm:max-w-[70%]",{variants:{isUser:{true:"bg-primary text-primary-foreground",false:"bg-muted text-foreground"},isError:{true:"bg-red-100 dark:bg-red-900/20",false:""},animation:{none:"",slide:"duration-300 animate-in fade-in-0",scale:"duration-300 animate-in fade-in-0 zoom-in-75",fade:"duration-500 animate-in fade-in-0"}},compoundVariants:[{isUser:!0,animation:"slide",class:"slide-in-from-right"},{isUser:!1,animation:"slide",class:"slide-in-from-left"},{isUser:!0,animation:"scale",class:"origin-bottom-right"},{isUser:!1,animation:"scale",class:"origin-bottom-left"}]}),zX=({role:e,content:t,createdAt:n,showTimeStamp:r=!1,animation:i="scale",actions:o,className:s,experimental_attachments:a,isError:u=!1})=>{const c=e==="user",f=S.useMemo(()=>a==null?void 0:a.map(p=>{const m=BX(p.url);return new File([m],p.name??"Unknown")}),[a]),h=n==null?void 0:n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return y.jsxs("div",{className:Te("flex flex-col",c?"items-end":"items-start"),children:[f?y.jsx("div",{className:"mb-1 flex gap-2 flex-wrap",children:f.map((p,m)=>y.jsx(l1,{file:p},m))}):null,y.jsxs("div",{className:Te($X({isUser:c,isError:u,animation:i}),s),children:[y.jsx("div",{children:y.jsx(IX,{children:t})}),e==="assistant"&&o?y.jsx("div",{className:"absolute -bottom-4 right-2 flex space-x-1 rounded-lg border bg-background p-1 opacity-0 transition-opacity group-hover/message:opacity-100 text-foreground",children:o}):null]}),r&&n?y.jsx("time",{dateTime:n.toISOString(),className:Te("mt-1 block px-1 text-xs opacity-50",i!=="none"&&"duration-500 animate-in fade-in-0"),children:h}):null]})};function BX(e){const t=e.split(",")[1],n=Buffer.from(t??"","base64");return new Uint8Array(n)}function VX(){return y.jsx("div",{className:"justify-left flex space-x-1",children:y.jsx("div",{className:"rounded-lg bg-muted p-3",children:y.jsxs("div",{className:"flex -space-x-2.5",children:[y.jsx(cx,{className:"h-5 w-5 animate-typing-dot-bounce"}),y.jsx(cx,{className:"h-5 w-5 animate-typing-dot-bounce [animation-delay:90ms]"}),y.jsx(cx,{className:"h-5 w-5 animate-typing-dot-bounce [animation-delay:180ms]"})]})})})}function WX({messages:e,showTimeStamps:t=!0,isTyping:n=!1,messageOptions:r}){return y.jsxs("div",{className:"space-y-4 overflow-visible",children:[e.map((i,o)=>{const s=typeof r=="function"?r(i):r;return i.role==="assistant"&&!i.content.trim()?null:y.jsx(zX,{showTimeStamp:t,...i,...s},o)}),n&&y.jsx(VX,{})]})}function UX({label:e,append:t,suggestions:n}){return y.jsxs("div",{className:"space-y-6",children:[y.jsx("h2",{className:"text-center text-2xl font-bold",children:e}),y.jsx("div",{className:"flex flex-col sm:flex-row gap-6 text-sm items-center justify-center",children:n.map(r=>y.jsx("button",{onClick:()=>t({role:"user",content:r}),className:"h-max rounded-xl border bg-transparent p-4 hover:bg-accent",children:y.jsx("p",{children:r})},r))})]})}const HX=50;function YX(e){const t=S.useRef(null),n=S.useRef(null),[r,i]=S.useState(!0),o=()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight)},s=()=>{if(t.current){const{scrollTop:u,scrollHeight:c,clientHeight:f}=t.current;if(n.current?u<n.current:!1)i(!1);else{const p=Math.abs(c-u-f)<HX;i(p)}n.current=u}},a=()=>{i(!1)};return S.useEffect(()=>{t.current&&(n.current=t.current.scrollTop)},[]),S.useEffect(()=>{r&&o()},e),{containerRef:t,scrollToBottom:o,handleScroll:s,shouldAutoScroll:r,handleTouchStart:a}}function qX({messages:e,children:t}){const{containerRef:n,scrollToBottom:r,handleScroll:i,shouldAutoScroll:o,handleTouchStart:s}=YX([e]);return y.jsxs("div",{className:"grid overflow-y-auto pb-4 grid-cols-1",ref:n,onScroll:i,onTouchStart:s,children:[y.jsx("div",{className:"[grid-column:1/1] [grid-row:1/1] max-w-full",children:t}),y.jsx("div",{className:"flex justify-end items-end [grid-column:1/1] [grid-row:1/1] flex-1",children:!o&&y.jsx("div",{className:"sticky bottom-0 left-0 flex w-full justify-end",children:y.jsx(Mt,{onClick:r,className:"h-8 w-8 rounded-full ease-in-out animate-in fade-in-0 slide-in-from-bottom-1",size:"icon",variant:"ghost",children:y.jsx(XB,{className:"h-4 w-4"})})})})]})}const LD=S.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:Te("grid max-h-full w-full grid-rows-[1fr_auto]",e),...t}));LD.displayName="ChatContainer";const FD=S.forwardRef(({children:e,handleSubmit:t,isPending:n,className:r},i)=>{const[o,s]=S.useState(null),a=u=>{if(n){u.preventDefault();return}if(!o){t(u);return}const c=GX(o);t(u,{experimental_attachments:c}),s(null)};return y.jsx("form",{ref:i,onSubmit:a,className:r,children:e({files:o,setFiles:s})})});FD.displayName="ChatForm";function GX(e){const t=new DataTransfer;for(const n of Array.from(e))t.items.add(n);return t.files}function ZX({agentId:e,initialMessages:t=[],agentName:n,threadId:r,memory:i}){const[o,s]=S.useState(t),[a,u]=S.useState(""),[c,f]=S.useState(!1),{mutate:h}=_b();S.useEffect(()=>{t&&s(t)},[t]);const p=S.useCallback(C=>{u(C.target.value)},[]),m=async C=>{var D;if((D=C==null?void 0:C.preventDefault)==null||D.call(C),!a.trim()||c)return;const N=a;u(""),f(!0);const P={id:Date.now().toString(),role:"user",content:N},T={id:(Date.now()+1).toString(),role:"assistant",content:""};s(R=>[...R,P,T]);try{const R=await fetch("/api/agents/"+e+"/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[N],...i?{threadId:r,resourceid:e}:{}})});if(!R.body)throw new Error("No response body");if(R.status!==200){const O=await R.json();throw new Error(O.message)}h(`/api/memory/threads?resourceid=${e}`);const I=R.body.getReader(),M=new TextDecoder;let z="",F="",Y="";try{for(;;){const{done:O,value:q}=await I.read();if(O)break;const W=M.decode(q);z+=W;const Z=z.matchAll(/0:"([^"]*)"/g),U=z.matchAll(/3:"([^"]*)"/g);if(U)for(const B of U){const L=B[1];Y+=L,s(H=>[...H.slice(0,-1),{...H[H.length-1],content:Y,isError:!0}])}for(const B of Z){const L=B[1];F+=L,s(H=>[...H.slice(0,-1),{...H[H.length-1],content:F}])}z=""}}catch(O){throw new Error(O.message)}finally{I.releaseLock()}}catch(R){s(I=>[...I.slice(0,-1),{...I[I.length-1],content:(R==null?void 0:R.message)||"An error occurred while processing your request.",isError:!0}])}finally{f(!1)}},x=o.at(-1),v=o.length===0,k=c&&(x==null?void 0:x.role)==="assistant"&&!(x!=null&&x.content.trim()),b=S.useCallback(C=>{u(C.content),m()},[m]),E=["What capabilities do you have?","How can you help me?","Tell me about yourself"];return y.jsxs(LD,{className:"h-full px-4 pb-3 pt-4 max-w-[1000px] mx-auto",children:[y.jsx("div",{className:"flex flex-col h-full",children:v?y.jsx("div",{className:"mx-auto max-w-2xl",children:y.jsx(UX,{label:`Chat with ${n}`,append:b,suggestions:E})}):y.jsx(Rn,{className:" h-[calc(100vh-15rem)] px-4",children:y.jsx(qX,{messages:o,children:y.jsx(WX,{messages:o,isTyping:k})})})}),y.jsxs("div",{className:"flex flex-col mt-auto gap-2",children:[y.jsx(FD,{isPending:c||k,handleSubmit:m,children:({files:C,setFiles:N})=>y.jsx(R2,{value:a,onChange:p,files:C,setFiles:N,isGenerating:c,placeholder:"Enter your message..."})}),!i&&y.jsxs("div",{className:"flex items-center gap-1 text-sm text-mastra-el-5",children:[y.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-purple-400",children:[y.jsx("circle",{cx:"12",cy:"12",r:"10"}),y.jsx("path",{d:"M12 16v-4"}),y.jsx("path",{d:"M12 8h.01"})]}),y.jsxs("span",{className:"text-xs text-gray-300/60",children:["Agent will not remember previous messages. To enable memory for agent see"," ",y.jsx("a",{href:"https://mastra.ai/docs/agents/01-agent-memory",target:"_blank",rel:"noopener",className:"text-gray-300/60 hover:text-gray-100 underline",children:"docs."})]})]})]})]})}const $D=S.forwardRef(({...e},t)=>y.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));$D.displayName="Breadcrumb";const zD=S.forwardRef(({className:e,...t},n)=>y.jsx("ol",{ref:n,className:Te("text-mastra-el-6 flex items-center gap-2 break-words text-[calc(13_/_16_*_1rem)] font-medium",e),...t}));zD.displayName="BreadcrumbList";const BD=S.forwardRef(({className:e,...t},n)=>y.jsx("li",{ref:n,className:Te("inline-flex items-center gap-1.5",e),...t}));BD.displayName="BreadcrumbItem";const VD=S.forwardRef(({asChild:e,className:t,...n},r)=>{const i=e?qi:"a";return y.jsx(i,{ref:r,className:Te("hover:text-text transition-colors",t),...n})});VD.displayName="BreadcrumbLink";const WD=S.forwardRef(({className:e,...t},n)=>y.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Te("text-mastra-el-5 text-sm font-medium",e),...t}));WD.displayName="BreadcrumbPage";const UD=({children:e,className:t,...n})=>y.jsx("li",{role:"presentation","aria-hidden":"true",className:Te(t),...n,children:e??y.jsx(am,{className:"text-mastra-el-3 !h-[0.625rem] !w-[0.625rem] -rotate-90"})});UD.displayName="BreadcrumbSeparator";function Am({items:e,pageClassName:t,icon:n}){return y.jsxs("div",{className:"flex items-center gap-4",children:[n,y.jsx($D,{children:y.jsx(zD,{children:e.map((r,i)=>y.jsxs("span",{className:"flex flex-nowrap items-center gap-2",children:[y.jsx(BD,{children:r.isCurrent?y.jsx(WD,{className:t,children:r.label}):y.jsx(VD,{asChild:!0,children:y.jsx(Dd,{to:r.href,className:"text-mastra-el-3",children:r.label})})},r.href),i<e.length-1&&y.jsx(UD,{})]},i))})})]})}function N1(e){const t=e+"CollectionProvider",[n,r]=ti(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:x,children:v}=m,k=ne.useRef(null),b=ne.useRef(new Map).current;return y.jsx(i,{scope:x,itemMap:b,collectionRef:k,children:v})};s.displayName=t;const a=e+"CollectionSlot",u=ne.forwardRef((m,x)=>{const{scope:v,children:k}=m,b=o(a,v),E=ht(x,b.collectionRef);return y.jsx(qi,{ref:E,children:k})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",h=ne.forwardRef((m,x)=>{const{scope:v,children:k,...b}=m,E=ne.useRef(null),C=ht(x,E),N=o(c,v);return ne.useEffect(()=>(N.itemMap.set(E,{ref:E,...b}),()=>void N.itemMap.delete(E))),y.jsx(qi,{[f]:"",ref:C,children:k})});h.displayName=c;function p(m){const x=o(e+"CollectionConsumer",m);return ne.useCallback(()=>{const k=x.collectionRef.current;if(!k)return[];const b=Array.from(k.querySelectorAll(`[${f}]`));return Array.from(x.itemMap.values()).sort((N,P)=>b.indexOf(N.ref.current)-b.indexOf(P.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:u,ItemSlot:h},p,r]}var KX=mz.useId||(()=>{}),XX=0;function En(e){const[t,n]=S.useState(KX());return qn(()=>{e||n(r=>r??String(XX++))},[e]),e||(t?`radix-${t}`:"")}function Ro({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=QX({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=hn(n),u=S.useCallback(c=>{if(o){const h=typeof c=="function"?c(e):c;h!==e&&a(h)}else i(c)},[o,e,i,a]);return[s,u]}function QX({defaultProp:e,onChange:t}){const n=S.useState(e),[r]=n,i=S.useRef(r),o=hn(t);return S.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var Zx="rovingFocusGroup.onEntryFocus",JX={bubbles:!1,cancelable:!0},Pm="RovingFocusGroup",[w0,HD,eQ]=N1(Pm),[tQ,Rm]=ti(Pm,[eQ]),[nQ,rQ]=tQ(Pm),YD=S.forwardRef((e,t)=>y.jsx(w0.Provider,{scope:e.__scopeRovingFocusGroup,children:y.jsx(w0.Slot,{scope:e.__scopeRovingFocusGroup,children:y.jsx(iQ,{...e,ref:t})})}));YD.displayName=Pm;var iQ=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...h}=e,p=S.useRef(null),m=ht(t,p),x=jd(o),[v=null,k]=Ro({prop:s,defaultProp:a,onChange:u}),[b,E]=S.useState(!1),C=hn(c),N=HD(n),P=S.useRef(!1),[T,D]=S.useState(0);return S.useEffect(()=>{const R=p.current;if(R)return R.addEventListener(Zx,C),()=>R.removeEventListener(Zx,C)},[C]),y.jsx(nQ,{scope:n,orientation:r,dir:x,loop:i,currentTabStopId:v,onItemFocus:S.useCallback(R=>k(R),[k]),onItemShiftTab:S.useCallback(()=>E(!0),[]),onFocusableItemAdd:S.useCallback(()=>D(R=>R+1),[]),onFocusableItemRemove:S.useCallback(()=>D(R=>R-1),[]),children:y.jsx(He.div,{tabIndex:b||T===0?-1:0,"data-orientation":r,...h,ref:m,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{P.current=!0}),onFocus:Re(e.onFocus,R=>{const I=!P.current;if(R.target===R.currentTarget&&I&&!b){const M=new CustomEvent(Zx,JX);if(R.currentTarget.dispatchEvent(M),!M.defaultPrevented){const z=N().filter(W=>W.focusable),F=z.find(W=>W.active),Y=z.find(W=>W.id===v),q=[F,Y,...z].filter(Boolean).map(W=>W.ref.current);ZD(q,f)}}P.current=!1}),onBlur:Re(e.onBlur,()=>E(!1))})})}),qD="RovingFocusGroupItem",GD=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=En(),u=o||a,c=rQ(qD,n),f=c.currentTabStopId===u,h=HD(n),{onFocusableItemAdd:p,onFocusableItemRemove:m}=c;return S.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),y.jsx(w0.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:y.jsx(He.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:Re(e.onMouseDown,x=>{r?c.onItemFocus(u):x.preventDefault()}),onFocus:Re(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:Re(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){c.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const v=aQ(x,c.orientation,c.dir);if(v!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let b=h().filter(E=>E.focusable).map(E=>E.ref.current);if(v==="last")b.reverse();else if(v==="prev"||v==="next"){v==="prev"&&b.reverse();const E=b.indexOf(x.currentTarget);b=c.loop?lQ(b,E+1):b.slice(E+1)}setTimeout(()=>ZD(b))}})})})});GD.displayName=qD;var oQ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sQ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function aQ(e,t,n){const r=sQ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return oQ[r]}function ZD(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function lQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var KD=YD,XD=GD,T1="Tabs",[uQ,Wxe]=ti(T1,[Rm]),QD=Rm(),[cQ,A1]=uQ(T1),JD=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=jd(a),[h,p]=Ro({prop:r,onChange:i,defaultProp:o});return y.jsx(cQ,{scope:n,baseId:En(),value:h,onValueChange:p,orientation:s,dir:f,activationMode:u,children:y.jsx(He.div,{dir:f,"data-orientation":s,...c,ref:t})})});JD.displayName=T1;var ej="TabsList",tj=S.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=A1(ej,n),s=QD(n);return y.jsx(KD,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:y.jsx(He.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});tj.displayName=ej;var nj="TabsTrigger",rj=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=A1(nj,n),a=QD(n),u=sj(s.baseId,r),c=aj(s.baseId,r),f=r===s.value;return y.jsx(XD,{asChild:!0,...a,focusable:!i,active:f,children:y.jsx(He.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":c,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:Re(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:Re(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:Re(e.onFocus,()=>{const h=s.activationMode!=="manual";!f&&!i&&h&&s.onValueChange(r)})})})});rj.displayName=nj;var ij="TabsContent",oj=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=A1(ij,n),u=sj(a.baseId,r),c=aj(a.baseId,r),f=r===a.value,h=S.useRef(f);return S.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),y.jsx(sr,{present:i||f,children:({present:p})=>y.jsx(He.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:p&&o})})});oj.displayName=ij;function sj(e,t){return`${e}-trigger-${t}`}function aj(e,t){return`${e}-content-${t}`}var dQ=JD,lj=tj,uj=rj,cj=oj;const P1=dQ,Mm=S.forwardRef(({className:e,...t},n)=>y.jsx(lj,{ref:n,className:Te(e),...t}));Mm.displayName=lj.displayName;const _o=S.forwardRef(({className:e,...t},n)=>y.jsx(uj,{ref:n,className:Te(e),...t}));_o.displayName=uj.displayName;const No=S.forwardRef(({className:e,...t},n)=>y.jsx(cj,{ref:n,className:Te("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));No.displayName=cj.displayName;const HN=(e,t)=>{const[n,r]=S.useState([]),[i,o]=S.useState(!0),s=async a=>{o(!0);try{const u=await fetch(`/api/agents/${a??e}/evals/${t}`);if(!u.ok){const f=await u.json();r([]),console.error("Error fetching evals",f),nn.error((f==null?void 0:f.error)||"Error fetching evals");return}const c=await u.json();r(c.evals)}catch(u){r([]),console.error("Error fetching evals",u),nn.error("Error fetching evals")}finally{o(!1)}};return S.useEffect(()=>{s(e)},[e]),{evals:n,isLoading:i,refetchEvals:s}};function fQ({agentId:e}){const[t,n]=S.useState("live"),{evals:r,isLoading:i,refetchEvals:o}=HN(e,"live"),{evals:s,isLoading:a,refetchEvals:u}=HN(e,"ci"),c=()=>{t==="live"?o():u()};return y.jsx("div",{className:"flex-1 relative overflow-hidden",children:y.jsx("div",{className:"flex justify-between sticky top-0 bg-mastra-bg-2 p-4",children:y.jsxs(P1,{value:t,onValueChange:f=>n(f),className:"w-full",children:[y.jsxs(Mm,{children:[y.jsx(_o,{value:"live",className:"mr-4",children:"Live"}),y.jsx(_o,{value:"ci",children:"CI"})]}),y.jsx("div",{className:"flex justify-end my-2",children:y.jsx(Mt,{variant:"outline",onClick:c,disabled:t==="live"?i:a,children:(t==="live"?i:a)?y.jsx(jl,{className:"w-4 h-4 animate-spin"}):y.jsx(jl,{className:"w-4 h-4"})})}),y.jsxs(Rn,{className:"rounded-lg h-[calc(100vh-180px)]",children:[y.jsx(No,{value:"live",className:"mt-0",children:y.jsx(YN,{showTestName:!1,evals:r,isLoading:i})}),y.jsx(No,{value:"ci",className:"mt-0",children:y.jsx(YN,{showTestName:!0,evals:s,isLoading:a})})]})]})})})}function YN({showTestName:e=!1,evals:t,isLoading:n}){const[r,i]=S.useState(new Set),o=a=>{const u=new Set(r);u.has(a)?u.delete(a):u.add(a),i(u)},s=a=>a.reduce((u,c)=>{const f=u.find(h=>h.metricName===c.meta.metricName);return f?(f.evals.push(c),f.averageScore=f.evals.reduce((h,p)=>h+p.result.score,0)/f.evals.length):u.push({metricName:c.meta.metricName,averageScore:c.result.score,evals:[c]}),u},[]);return y.jsxs(hm,{children:[y.jsx(pm,{className:"bg-[#171717] sticky top-0 z-10",children:y.jsxs(Xr,{className:"border-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[y.jsx(mr,{className:"w-[50px]"}),y.jsx(mr,{className:"w-[300px] text-mastra-el-3",children:"Metric"}),y.jsx(mr,{className:"w-[600px] text-mastra-el-3"}),y.jsx(mr,{className:"w-[200px] text-mastra-el-3",children:"Average Score"}),y.jsx(mr,{className:"text-mastra-el-3",children:"Total Evaluations"})]})}),y.jsx(mm,{className:"border-b border-gray-6",children:n?y.jsxs(Xr,{className:"border-b-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[y.jsx(gt,{className:"w-[50px]",children:y.jsx(Ue,{className:"h-8 w-8"})}),y.jsx(gt,{className:"w-[400px]",children:y.jsx(Ue,{className:"h-8 w-full"})}),y.jsx(gt,{className:"w-[400px]",children:y.jsx(Ue,{className:"h-8 w-full"})}),y.jsx(gt,{className:"w-[200px]",children:y.jsx(Ue,{className:"h-8 w-full"})}),y.jsx(gt,{children:y.jsx(Ue,{className:"h-8 w-full"})})]}):s(t).map(a=>y.jsxs(y.Fragment,{children:[y.jsxs(Xr,{className:"border-b-gray-6 border-b-[0.1px] text-[0.8125rem] cursor-pointer hover:bg-mastra-bg-3",onClick:()=>o(a.metricName),children:[y.jsx(gt,{className:"w-[50px]",children:y.jsx("div",{className:"h-8 w-full flex items-center justify-center",children:r.has(a.metricName)?y.jsx(am,{className:"h-4 w-4 text-mastra-el-5"}):y.jsx(eV,{className:"h-4 w-4 text-mastra-el-5"})})}),y.jsx(gt,{className:"w-[300px] font-medium text-mastra-el-5",children:a.metricName}),y.jsx(gt,{className:"w-[600px] text-mastra-el-5"}),y.jsx(gt,{className:"w-[200px] text-mastra-el-5",children:a.averageScore.toFixed(2)}),y.jsx(gt,{className:"text-mastra-el-5",children:a.evals.length})]},a.metricName),r.has(a.metricName)&&y.jsxs(y.Fragment,{children:[y.jsxs(Xr,{className:"bg-mastra-bg-3 text-[0.7rem] text-mastra-el-3",children:[y.jsx(gt,{className:"w-[50px]"}),y.jsx(gt,{className:"w-[300px] pl-8",children:"Timestamp"}),y.jsx(gt,{className:"w-[600px] pl-8",children:"Input"}),y.jsx(gt,{className:"w-[200px]",children:"Score"}),e&&y.jsx(gt,{children:"Test Name"})]}),a.evals.map((u,c)=>y.jsxs(Xr,{className:"bg-mastra-bg-3 text-[0.8125rem]",children:[y.jsx(gt,{className:"w-[50px]"}),y.jsx(gt,{className:"w-[300px] text-mastra-el-4 pl-8",children:new Date(u.meta.timestamp).toLocaleString()}),y.jsx(gt,{className:"w-[600px] text-mastra-el-4",children:u.input}),y.jsx(gt,{className:"w-[200px] text-mastra-el-4",children:u.result.score}),e&&y.jsx(gt,{className:"text-mastra-el-4",children:u.meta.testName})]},`${a.metricName}-${c}`))]})]}))})]})}function hQ({agentId:e}){var i;const{isLoading:t,agent:n}=um(e),r=Lo();return t?y.jsx(Rn,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs",children:y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx(Ue,{className:"h-3"}),y.jsx(Ue,{className:"h-3"})]}),y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx(Ue,{className:"h-3"}),y.jsx(Ue,{className:"h-3"})]}),y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx(Ue,{className:"h-3"}),y.jsx(Ue,{className:"h-3"})]}),y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx(Ue,{className:"h-3"}),y.jsx(Ue,{className:"h-3"})]}),y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx(Ue,{className:"h-3"}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(Ue,{className:"h-3"}),y.jsx(Ue,{className:"h-3"}),y.jsx(Ue,{className:"h-3"})]})]})]})}):y.jsx(Rn,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs",children:y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"Name"}),y.jsx("p",{className:"text-mastra-el-5",children:n==null?void 0:n.name})]}),y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"Instructions"}),y.jsx("p",{className:"text-mastra-el-5 whitespace-pre-wrap",children:n==null?void 0:n.instructions})]}),y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"Model"}),y.jsx("p",{className:"text-mastra-el-5",children:(i=n==null?void 0:n.model)==null?void 0:i.name})]}),y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"Provider"}),y.jsx("p",{className:"text-mastra-el-5",children:n==null?void 0:n.model.provider})]}),y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"Tools"}),y.jsx("div",{className:"flex flex-col gap-2 text-mastra-el-5",children:Object.entries((n==null?void 0:n.tools)??{}).map(([o,s])=>y.jsx("span",{onClick:()=>{r(`/tools/${e}/${s.id}`)},className:"no-underline",children:s.id},o))})]})]})})}function pQ({agentId:e}){return y.jsx(Rn,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs w-[400px]",children:y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"GET"}),y.jsx("p",{className:"text-mastra-el-5",children:"/api/agents"})]}),y.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"GET"}),y.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e]})]}),y.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"POST"}),y.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e,"/generate"]})]}),y.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"POST"}),y.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e,"/stream"]})]}),y.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"POST"}),y.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e,"/text-object"]})]}),y.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"POST"}),y.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e,"/stream-object"]})]})]})})}const dj=e=>{const[t,n]=S.useState([]),[r,i]=S.useState(!0),o=async s=>{i(!0);try{const a=await fetch(`/api/logs/${s??e}`);if(!a.ok){const c=await a.json();n([]),console.error("Error fetching logs",c),nn.error((c==null?void 0:c.error)||"Error fetching logs");return}const u=await a.json();n(u)}catch(a){n([]),console.error("Error fetching logs",a),nn.error("Error fetching logs")}finally{i(!1)}};return S.useEffect(()=>{o(e)},[e]),{logs:t,isLoading:r,refetchLogs:o}};function mQ({agentId:e}){const{logs:t,isLoading:n,refetchLogs:r}=dj(e);return y.jsxs(Rn,{className:"h-[calc(100vh-126px)] px-4 pb-4 text-xs w-[400px]",children:[y.jsx("div",{className:"flex justify-end sticky top-0 bg-mastra-bg-2 py-2",children:y.jsx(Mt,{variant:"outline",onClick:()=>r(),children:n?y.jsx(jl,{className:"w-4 h-4 animate-spin"}):y.jsx(jl,{className:"w-4 h-4"})})}),y.jsx("div",{className:"space-y-4",children:t.length===0?y.jsxs("p",{className:"text-gray-300/60",children:["No log drains. By default, logs are sent to the console. To configure log drains see"," ",y.jsx("a",{href:"https://mastra.ai/docs/reference/observability/create-logger#upstash-logger-remote-log-drain",target:"_blank",rel:"noopener",className:" hover:text-gray-100 underline",children:"docs."})]}):t.map(i=>{const o=JSON.parse(i.message);return y.jsxs("div",{className:"space-y-2",children:[y.jsxs("div",{className:"flex gap-2 items-center",children:[y.jsxs("p",{className:"text-mastra-el-4",children:["[",i.timestamp,"]"]}),y.jsxs("p",{className:"text-mastra-el-5",children:["[",i.level,"]"]})]}),y.jsx("p",{className:"text-mastra-el-5 whitespace-pre-wrap",children:y.jsx("code",{children:JSON.stringify(o,null,2)})})]},i.timestamp)})})]})}function qN({agentId:e}){const t=Lo();return y.jsxs(P1,{defaultValue:"details",children:[y.jsxs(Mm,{className:"flex shrink-0 border-b",children:[y.jsx(_o,{value:"details",className:"group",children:y.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Details"})}),y.jsx(_o,{value:"endpoints",className:"group",children:y.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Endpoints"})}),y.jsx(_o,{value:"logs",className:"group",children:y.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Log Drains"})}),y.jsx("button",{className:"group",onClick:()=>t(`/agents/${e}/evals`),children:y.jsx("p",{className:"text-xs p-3 text-mastra-el-3",children:"Evals"})})]}),y.jsx(No,{value:"details",children:e?y.jsx(hQ,{agentId:e}):null}),y.jsx(No,{value:"endpoints",children:y.jsx(pQ,{agentId:e})}),y.jsx(No,{value:"logs",children:y.jsx(mQ,{agentId:e})})]})}function gQ(e,t=globalThis==null?void 0:globalThis.document){const n=hn(e);S.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var yQ="DismissableLayer",b0="dismissableLayer.update",xQ="dismissableLayer.pointerDownOutside",vQ="dismissableLayer.focusOutside",GN,fj=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vd=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...u}=e,c=S.useContext(fj),[f,h]=S.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=S.useState({}),x=ht(t,D=>h(D)),v=Array.from(c.layers),[k]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(k),E=f?v.indexOf(f):-1,C=c.layersWithOutsidePointerEventsDisabled.size>0,N=E>=b,P=kQ(D=>{const R=D.target,I=[...c.branches].some(M=>M.contains(R));!N||I||(i==null||i(D),s==null||s(D),D.defaultPrevented||a==null||a())},p),T=SQ(D=>{const R=D.target;[...c.branches].some(M=>M.contains(R))||(o==null||o(D),s==null||s(D),D.defaultPrevented||a==null||a())},p);return gQ(D=>{E===c.layers.size-1&&(r==null||r(D),!D.defaultPrevented&&a&&(D.preventDefault(),a()))},p),S.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(GN=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),ZN(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=GN)}},[f,p,n,c]),S.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),ZN())},[f,c]),S.useEffect(()=>{const D=()=>m({});return document.addEventListener(b0,D),()=>document.removeEventListener(b0,D)},[]),y.jsx(He.div,{...u,ref:x,style:{pointerEvents:C?N?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,P.onPointerDownCapture)})});Vd.displayName=yQ;var wQ="DismissableLayerBranch",bQ=S.forwardRef((e,t)=>{const n=S.useContext(fj),r=S.useRef(null),i=ht(t,r);return S.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),y.jsx(He.div,{...e,ref:i})});bQ.displayName=wQ;function kQ(e,t=globalThis==null?void 0:globalThis.document){const n=hn(e),r=S.useRef(!1),i=S.useRef(()=>{});return S.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let u=function(){hj(xQ,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function SQ(e,t=globalThis==null?void 0:globalThis.document){const n=hn(e),r=S.useRef(!1);return S.useEffect(()=>{const i=o=>{o.target&&!r.current&&hj(vQ,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ZN(){const e=new CustomEvent(b0);document.dispatchEvent(e)}function hj(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?AR(i,o):i.dispatchEvent(o)}var Kx="focusScope.autoFocusOnMount",Xx="focusScope.autoFocusOnUnmount",KN={bubbles:!1,cancelable:!0},EQ="FocusScope",Wd=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,u]=S.useState(null),c=hn(i),f=hn(o),h=S.useRef(null),p=ht(t,v=>u(v)),m=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let v=function(C){if(m.paused||!a)return;const N=C.target;a.contains(N)?h.current=N:ys(h.current,{select:!0})},k=function(C){if(m.paused||!a)return;const N=C.relatedTarget;N!==null&&(a.contains(N)||ys(h.current,{select:!0}))},b=function(C){if(document.activeElement===document.body)for(const P of C)P.removedNodes.length>0&&ys(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",k);const E=new MutationObserver(b);return a&&E.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",k),E.disconnect()}}},[r,a,m.paused]),S.useEffect(()=>{if(a){QN.add(m);const v=document.activeElement;if(!a.contains(v)){const b=new CustomEvent(Kx,KN);a.addEventListener(Kx,c),a.dispatchEvent(b),b.defaultPrevented||(CQ(PQ(pj(a)),{select:!0}),document.activeElement===v&&ys(a))}return()=>{a.removeEventListener(Kx,c),setTimeout(()=>{const b=new CustomEvent(Xx,KN);a.addEventListener(Xx,f),a.dispatchEvent(b),b.defaultPrevented||ys(v??document.body,{select:!0}),a.removeEventListener(Xx,f),QN.remove(m)},0)}}},[a,c,f,m]);const x=S.useCallback(v=>{if(!n&&!r||m.paused)return;const k=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,b=document.activeElement;if(k&&b){const E=v.currentTarget,[C,N]=_Q(E);C&&N?!v.shiftKey&&b===N?(v.preventDefault(),n&&ys(C,{select:!0})):v.shiftKey&&b===C&&(v.preventDefault(),n&&ys(N,{select:!0})):b===E&&v.preventDefault()}},[n,r,m.paused]);return y.jsx(He.div,{tabIndex:-1,...s,ref:p,onKeyDown:x})});Wd.displayName=EQ;function CQ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ys(r,{select:t}),document.activeElement!==n)return}function _Q(e){const t=pj(e),n=XN(t,e),r=XN(t.reverse(),e);return[n,r]}function pj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function XN(e,t){for(const n of e)if(!NQ(n,{upTo:t}))return n}function NQ(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 TQ(e){return e instanceof HTMLInputElement&&"select"in e}function ys(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&TQ(e)&&t&&e.select()}}var QN=AQ();function AQ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=JN(e,t),e.unshift(t)},remove(t){var n;e=JN(e,t),(n=e[0])==null||n.resume()}}}function JN(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function PQ(e){return e.filter(t=>t.tagName!=="A")}var RQ="Portal",Ud=S.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[i,o]=S.useState(!1);qn(()=>o(!0),[]);const s=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?bR.createPortal(y.jsx(He.div,{...r,ref:t}),s):null});Ud.displayName=RQ;var Qx=0;function Dm(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??eT()),document.body.insertAdjacentElement("beforeend",e[1]??eT()),Qx++,()=>{Qx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Qx--}},[])}function eT(){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 Li=function(){return Li=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Li.apply(this,arguments)};function mj(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function MQ(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var tp="right-scroll-bar-position",np="width-before-scroll-bar",DQ="with-scroll-bars-hidden",jQ="--removed-body-scroll-bar-size";function Jx(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function OQ(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var IQ=typeof window<"u"?S.useLayoutEffect:S.useEffect,tT=new WeakMap;function LQ(e,t){var n=OQ(null,function(r){return e.forEach(function(i){return Jx(i,r)})});return IQ(function(){var r=tT.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||Jx(a,null)}),o.forEach(function(a){i.has(a)||Jx(a,s)})}tT.set(n,e)},[e]),n}function FQ(e){return e}function $Q(e,t){t===void 0&&(t=FQ);var n=[],r=!1,i={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(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var u=function(){var f=s;s=[],f.forEach(o)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(f){s.push(f),c()},filter:function(f){return s=s.filter(f),n}}}};return i}function zQ(e){e===void 0&&(e={});var t=$Q(null);return t.options=Li({async:!0,ssr:!1},e),t}var gj=function(e){var t=e.sideCar,n=mj(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 S.createElement(r,Li({},n))};gj.isSideCarExport=!0;function BQ(e,t){return e.useMedium(t),gj}var yj=zQ(),ev=function(){},jm=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:ev,onWheelCapture:ev,onTouchMoveCapture:ev}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,u=e.className,c=e.removeScrollBar,f=e.enabled,h=e.shards,p=e.sideCar,m=e.noIsolation,x=e.inert,v=e.allowPinchZoom,k=e.as,b=k===void 0?"div":k,E=e.gapMode,C=mj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=p,P=LQ([n,t]),T=Li(Li({},C),i);return S.createElement(S.Fragment,null,f&&S.createElement(N,{sideCar:yj,removeScrollBar:c,shards:h,noIsolation:m,inert:x,setCallbacks:o,allowPinchZoom:!!v,lockRef:n,gapMode:E}),s?S.cloneElement(S.Children.only(a),Li(Li({},T),{ref:P})):S.createElement(b,Li({},T,{className:u,ref:P}),a))});jm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};jm.classNames={fullWidth:np,zeroRight:tp};var VQ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function WQ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=VQ();return t&&e.setAttribute("nonce",t),e}function UQ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function HQ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var YQ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=WQ())&&(UQ(t,n),HQ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},qQ=function(){var e=YQ();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},xj=function(){var e=qQ(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},GQ={left:0,top:0,right:0,gap:0},tv=function(e){return parseInt(e||"",10)||0},ZQ=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[tv(n),tv(r),tv(i)]},KQ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return GQ;var t=ZQ(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])}},XQ=xj(),Nl="data-scroll-locked",QQ=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
242
|
+
`]}))})}):y.jsx("pre",{...n,children:e})});ID.displayName="HighlightedCode";const LX=({children:e,className:t,language:n,...r})=>{const i=typeof e=="string"?e:v0(e),o=Te("overflow-x-scroll rounded-md border bg-background/50 p-4 font-mono text-sm [scrollbar-width:none]",t);return y.jsxs("div",{className:"group/code relative mb-4",children:[y.jsx(S.Suspense,{fallback:y.jsx("pre",{className:o,...r,children:e}),children:y.jsx(ID,{language:n,className:o,children:i})}),y.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:y.jsx(Yc,{content:i,copyMessage:"Copied code to clipboard"})})]})};function v0(e){var t;if(typeof e=="string")return e;if((t=e==null?void 0:e.props)!=null&&t.children){let n=e.props.children;return Array.isArray(n)?n.map(r=>v0(r)).join(""):v0(n)}return""}const FX={h1:In("h1","text-2xl font-semibold"),h2:In("h2","font-semibold text-xl"),h3:In("h3","font-semibold text-lg"),h4:In("h4","font-semibold text-base"),h5:In("h5","font-medium"),strong:In("strong","font-semibold"),a:In("a","text-primary underline underline-offset-2"),blockquote:In("blockquote","border-l-2 border-primary pl-4"),code:({children:e,className:t,node:n,...r})=>{const i=/language-(\w+)/.exec(t||"");return i?y.jsx(LX,{className:t,language:i[1],...r,children:e}):y.jsx("code",{className:Te("font-mono [:not(pre)>&]:rounded-md [:not(pre)>&]:bg-background/50 [:not(pre)>&]:px-1 [:not(pre)>&]:py-0.5"),...r,children:e})},pre:({children:e})=>e,ol:In("ol","list-decimal space-y-2 pl-6"),ul:In("ul","list-disc space-y-2 pl-6"),li:In("li","my-1.5"),table:In("table","w-full border-collapse overflow-y-auto rounded-md border border-foreground/20"),th:In("th","border border-foreground/20 px-4 py-2 text-left font-bold [&[align=center]]:text-center [&[align=right]]:text-right"),td:In("td","border border-foreground/20 px-4 py-2 text-left [&[align=center]]:text-center [&[align=right]]:text-right"),tr:In("tr","m-0 border-t p-0 even:bg-muted"),p:In("p","whitespace-pre-wrap leading-relaxed"),hr:In("hr","border-foreground/20")};function In(e,t){const n=({node:r,...i})=>y.jsx(e,{className:t,...i});return n.displayName=e,n}const $X=lu("group/message relative break-words rounded-lg p-3 text-sm sm:max-w-[70%]",{variants:{isUser:{true:"bg-primary text-primary-foreground",false:"bg-muted text-foreground"},isError:{true:"bg-red-100 dark:bg-red-900/20",false:""},animation:{none:"",slide:"duration-300 animate-in fade-in-0",scale:"duration-300 animate-in fade-in-0 zoom-in-75",fade:"duration-500 animate-in fade-in-0"}},compoundVariants:[{isUser:!0,animation:"slide",class:"slide-in-from-right"},{isUser:!1,animation:"slide",class:"slide-in-from-left"},{isUser:!0,animation:"scale",class:"origin-bottom-right"},{isUser:!1,animation:"scale",class:"origin-bottom-left"}]}),zX=({role:e,content:t,createdAt:n,showTimeStamp:r=!1,animation:i="scale",actions:o,className:s,experimental_attachments:a,isError:u=!1})=>{const c=e==="user",f=S.useMemo(()=>a==null?void 0:a.map(p=>{const m=BX(p.url);return new File([m],p.name??"Unknown")}),[a]),h=n==null?void 0:n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return y.jsxs("div",{className:Te("flex flex-col",c?"items-end":"items-start"),children:[f?y.jsx("div",{className:"mb-1 flex gap-2 flex-wrap",children:f.map((p,m)=>y.jsx(l1,{file:p},m))}):null,y.jsxs("div",{className:Te($X({isUser:c,isError:u,animation:i}),s),children:[y.jsx("div",{children:y.jsx(IX,{children:t})}),e==="assistant"&&o?y.jsx("div",{className:"absolute -bottom-4 right-2 flex space-x-1 rounded-lg border bg-background p-1 opacity-0 transition-opacity group-hover/message:opacity-100 text-foreground",children:o}):null]}),r&&n?y.jsx("time",{dateTime:n.toISOString(),className:Te("mt-1 block px-1 text-xs opacity-50",i!=="none"&&"duration-500 animate-in fade-in-0"),children:h}):null]})};function BX(e){const t=e.split(",")[1],n=Buffer.from(t??"","base64");return new Uint8Array(n)}function VX(){return y.jsx("div",{className:"justify-left flex space-x-1",children:y.jsx("div",{className:"rounded-lg bg-muted p-3",children:y.jsxs("div",{className:"flex -space-x-2.5",children:[y.jsx(cx,{className:"h-5 w-5 animate-typing-dot-bounce"}),y.jsx(cx,{className:"h-5 w-5 animate-typing-dot-bounce [animation-delay:90ms]"}),y.jsx(cx,{className:"h-5 w-5 animate-typing-dot-bounce [animation-delay:180ms]"})]})})})}function WX({messages:e,showTimeStamps:t=!0,isTyping:n=!1,messageOptions:r}){return y.jsxs("div",{className:"space-y-4 overflow-visible",children:[e.map((i,o)=>{const s=typeof r=="function"?r(i):r;return i.role==="assistant"&&!i.content.trim()?null:y.jsx(zX,{showTimeStamp:t,...i,...s},o)}),n&&y.jsx(VX,{})]})}function UX({label:e,append:t,suggestions:n}){return y.jsxs("div",{className:"space-y-6",children:[y.jsx("h2",{className:"text-center text-2xl font-bold",children:e}),y.jsx("div",{className:"flex flex-col sm:flex-row gap-6 text-sm items-center justify-center",children:n.map(r=>y.jsx("button",{onClick:()=>t({role:"user",content:r}),className:"h-max rounded-xl border bg-transparent p-4 hover:bg-accent",children:y.jsx("p",{children:r})},r))})]})}const HX=50;function YX(e){const t=S.useRef(null),n=S.useRef(null),[r,i]=S.useState(!0),o=()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight)},s=()=>{if(t.current){const{scrollTop:u,scrollHeight:c,clientHeight:f}=t.current;if(n.current?u<n.current:!1)i(!1);else{const p=Math.abs(c-u-f)<HX;i(p)}n.current=u}},a=()=>{i(!1)};return S.useEffect(()=>{t.current&&(n.current=t.current.scrollTop)},[]),S.useEffect(()=>{r&&o()},e),{containerRef:t,scrollToBottom:o,handleScroll:s,shouldAutoScroll:r,handleTouchStart:a}}function qX({messages:e,children:t}){const{containerRef:n,scrollToBottom:r,handleScroll:i,shouldAutoScroll:o,handleTouchStart:s}=YX([e]);return y.jsxs("div",{className:"grid overflow-y-auto pb-4 grid-cols-1",ref:n,onScroll:i,onTouchStart:s,children:[y.jsx("div",{className:"[grid-column:1/1] [grid-row:1/1] max-w-full",children:t}),y.jsx("div",{className:"flex justify-end items-end [grid-column:1/1] [grid-row:1/1] flex-1",children:!o&&y.jsx("div",{className:"sticky bottom-0 left-0 flex w-full justify-end",children:y.jsx(Mt,{onClick:r,className:"h-8 w-8 rounded-full ease-in-out animate-in fade-in-0 slide-in-from-bottom-1",size:"icon",variant:"ghost",children:y.jsx(XB,{className:"h-4 w-4"})})})})]})}const LD=S.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:Te("grid max-h-full w-full grid-rows-[1fr_auto]",e),...t}));LD.displayName="ChatContainer";const FD=S.forwardRef(({children:e,handleSubmit:t,isPending:n,className:r},i)=>{const[o,s]=S.useState(null),a=u=>{if(n){u.preventDefault();return}if(!o){t(u);return}const c=GX(o);t(u,{experimental_attachments:c}),s(null)};return y.jsx("form",{ref:i,onSubmit:a,className:r,children:e({files:o,setFiles:s})})});FD.displayName="ChatForm";function GX(e){const t=new DataTransfer;for(const n of Array.from(e))t.items.add(n);return t.files}function ZX({agentId:e,initialMessages:t=[],agentName:n,threadId:r,memory:i}){const[o,s]=S.useState(t),[a,u]=S.useState(""),[c,f]=S.useState(!1),{mutate:h}=_b();S.useEffect(()=>{t&&s(t)},[t]);const p=S.useCallback(C=>{u(C.target.value)},[]),m=async C=>{var D;if((D=C==null?void 0:C.preventDefault)==null||D.call(C),!a.trim()||c)return;const N=a;u(""),f(!0);const P={id:Date.now().toString(),role:"user",content:N},T={id:(Date.now()+1).toString(),role:"assistant",content:""};s(R=>[...R,P,T]);try{const R=await fetch("/api/agents/"+e+"/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[N],...i?{threadId:r,resourceid:e}:{}})});if(!R.body)throw new Error("No response body");if(R.status!==200){const O=await R.json();throw new Error(O.message)}h(`/api/memory/threads?resourceid=${e}`);const I=R.body.getReader(),M=new TextDecoder;let z="",F="",Y="";try{for(;;){const{done:O,value:q}=await I.read();if(O)break;const W=M.decode(q);z+=W;const Z=z.matchAll(/0:"([^"]*)"/g),U=z.matchAll(/3:"([^"]*)"/g);if(U)for(const B of U){const L=B[1];Y+=L,s(H=>[...H.slice(0,-1),{...H[H.length-1],content:Y,isError:!0}])}for(const B of Z){const L=B[1];F+=L,s(H=>[...H.slice(0,-1),{...H[H.length-1],content:F}])}z=""}}catch(O){throw new Error(O.message)}finally{I.releaseLock()}}catch(R){s(I=>[...I.slice(0,-1),{...I[I.length-1],content:(R==null?void 0:R.message)||"An error occurred while processing your request.",isError:!0}])}finally{f(!1)}},x=o.at(-1),v=o.length===0,k=c&&(x==null?void 0:x.role)==="assistant"&&!(x!=null&&x.content.trim()),b=S.useCallback(C=>{u(C.content),m()},[m]),E=["What capabilities do you have?","How can you help me?","Tell me about yourself"];return y.jsxs(LD,{className:"h-full px-4 pb-3 pt-4 max-w-[1000px] mx-auto",children:[y.jsx("div",{className:"flex flex-col h-full",children:v?y.jsx("div",{className:"mx-auto max-w-2xl",children:y.jsx(UX,{label:`Chat with ${n}`,append:b,suggestions:E})}):y.jsx(Rn,{className:" h-[calc(100vh-15rem)] px-4",children:y.jsx(qX,{messages:o,children:y.jsx(WX,{messages:o,isTyping:k})})})}),y.jsxs("div",{className:"flex flex-col mt-auto gap-2",children:[y.jsx(FD,{isPending:c||k,handleSubmit:m,children:({files:C,setFiles:N})=>y.jsx(R2,{value:a,onChange:p,files:C,setFiles:N,isGenerating:c,placeholder:"Enter your message..."})}),!i&&y.jsxs("div",{className:"flex items-center gap-1 text-sm text-mastra-el-5",children:[y.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-purple-400",children:[y.jsx("circle",{cx:"12",cy:"12",r:"10"}),y.jsx("path",{d:"M12 16v-4"}),y.jsx("path",{d:"M12 8h.01"})]}),y.jsxs("span",{className:"text-xs text-gray-300/60",children:["Agent will not remember previous messages. To enable memory for agent see"," ",y.jsx("a",{href:"https://mastra.ai/docs/agents/01-agent-memory",target:"_blank",rel:"noopener",className:"text-gray-300/60 hover:text-gray-100 underline",children:"docs."})]})]})]})]})}const $D=S.forwardRef(({...e},t)=>y.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));$D.displayName="Breadcrumb";const zD=S.forwardRef(({className:e,...t},n)=>y.jsx("ol",{ref:n,className:Te("text-mastra-el-6 flex items-center gap-2 break-words text-[calc(13_/_16_*_1rem)] font-medium",e),...t}));zD.displayName="BreadcrumbList";const BD=S.forwardRef(({className:e,...t},n)=>y.jsx("li",{ref:n,className:Te("inline-flex items-center gap-1.5",e),...t}));BD.displayName="BreadcrumbItem";const VD=S.forwardRef(({asChild:e,className:t,...n},r)=>{const i=e?qi:"a";return y.jsx(i,{ref:r,className:Te("hover:text-text transition-colors",t),...n})});VD.displayName="BreadcrumbLink";const WD=S.forwardRef(({className:e,...t},n)=>y.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Te("text-mastra-el-5 text-sm font-medium",e),...t}));WD.displayName="BreadcrumbPage";const UD=({children:e,className:t,...n})=>y.jsx("li",{role:"presentation","aria-hidden":"true",className:Te(t),...n,children:e??y.jsx(am,{className:"text-mastra-el-3 !h-[0.625rem] !w-[0.625rem] -rotate-90"})});UD.displayName="BreadcrumbSeparator";function Am({items:e,pageClassName:t,icon:n}){return y.jsxs("div",{className:"flex items-center gap-4",children:[n,y.jsx($D,{children:y.jsx(zD,{children:e.map((r,i)=>y.jsxs("span",{className:"flex flex-nowrap items-center gap-2",children:[y.jsx(BD,{children:r.isCurrent?y.jsx(WD,{className:t,children:r.label}):y.jsx(VD,{asChild:!0,children:y.jsx(Dd,{to:r.href,className:"text-mastra-el-3",children:r.label})})},r.href),i<e.length-1&&y.jsx(UD,{})]},i))})})]})}function N1(e){const t=e+"CollectionProvider",[n,r]=ti(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:x,children:v}=m,k=ne.useRef(null),b=ne.useRef(new Map).current;return y.jsx(i,{scope:x,itemMap:b,collectionRef:k,children:v})};s.displayName=t;const a=e+"CollectionSlot",u=ne.forwardRef((m,x)=>{const{scope:v,children:k}=m,b=o(a,v),E=ht(x,b.collectionRef);return y.jsx(qi,{ref:E,children:k})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",h=ne.forwardRef((m,x)=>{const{scope:v,children:k,...b}=m,E=ne.useRef(null),C=ht(x,E),N=o(c,v);return ne.useEffect(()=>(N.itemMap.set(E,{ref:E,...b}),()=>void N.itemMap.delete(E))),y.jsx(qi,{[f]:"",ref:C,children:k})});h.displayName=c;function p(m){const x=o(e+"CollectionConsumer",m);return ne.useCallback(()=>{const k=x.collectionRef.current;if(!k)return[];const b=Array.from(k.querySelectorAll(`[${f}]`));return Array.from(x.itemMap.values()).sort((N,P)=>b.indexOf(N.ref.current)-b.indexOf(P.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:u,ItemSlot:h},p,r]}var KX=mz.useId||(()=>{}),XX=0;function En(e){const[t,n]=S.useState(KX());return qn(()=>{e||n(r=>r??String(XX++))},[e]),e||(t?`radix-${t}`:"")}function Ro({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=QX({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=hn(n),u=S.useCallback(c=>{if(o){const h=typeof c=="function"?c(e):c;h!==e&&a(h)}else i(c)},[o,e,i,a]);return[s,u]}function QX({defaultProp:e,onChange:t}){const n=S.useState(e),[r]=n,i=S.useRef(r),o=hn(t);return S.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var Zx="rovingFocusGroup.onEntryFocus",JX={bubbles:!1,cancelable:!0},Pm="RovingFocusGroup",[w0,HD,eQ]=N1(Pm),[tQ,Rm]=ti(Pm,[eQ]),[nQ,rQ]=tQ(Pm),YD=S.forwardRef((e,t)=>y.jsx(w0.Provider,{scope:e.__scopeRovingFocusGroup,children:y.jsx(w0.Slot,{scope:e.__scopeRovingFocusGroup,children:y.jsx(iQ,{...e,ref:t})})}));YD.displayName=Pm;var iQ=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...h}=e,p=S.useRef(null),m=ht(t,p),x=jd(o),[v=null,k]=Ro({prop:s,defaultProp:a,onChange:u}),[b,E]=S.useState(!1),C=hn(c),N=HD(n),P=S.useRef(!1),[T,D]=S.useState(0);return S.useEffect(()=>{const R=p.current;if(R)return R.addEventListener(Zx,C),()=>R.removeEventListener(Zx,C)},[C]),y.jsx(nQ,{scope:n,orientation:r,dir:x,loop:i,currentTabStopId:v,onItemFocus:S.useCallback(R=>k(R),[k]),onItemShiftTab:S.useCallback(()=>E(!0),[]),onFocusableItemAdd:S.useCallback(()=>D(R=>R+1),[]),onFocusableItemRemove:S.useCallback(()=>D(R=>R-1),[]),children:y.jsx(He.div,{tabIndex:b||T===0?-1:0,"data-orientation":r,...h,ref:m,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{P.current=!0}),onFocus:Re(e.onFocus,R=>{const I=!P.current;if(R.target===R.currentTarget&&I&&!b){const M=new CustomEvent(Zx,JX);if(R.currentTarget.dispatchEvent(M),!M.defaultPrevented){const z=N().filter(W=>W.focusable),F=z.find(W=>W.active),Y=z.find(W=>W.id===v),q=[F,Y,...z].filter(Boolean).map(W=>W.ref.current);ZD(q,f)}}P.current=!1}),onBlur:Re(e.onBlur,()=>E(!1))})})}),qD="RovingFocusGroupItem",GD=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=En(),u=o||a,c=rQ(qD,n),f=c.currentTabStopId===u,h=HD(n),{onFocusableItemAdd:p,onFocusableItemRemove:m}=c;return S.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),y.jsx(w0.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:y.jsx(He.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:Re(e.onMouseDown,x=>{r?c.onItemFocus(u):x.preventDefault()}),onFocus:Re(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:Re(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){c.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const v=aQ(x,c.orientation,c.dir);if(v!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let b=h().filter(E=>E.focusable).map(E=>E.ref.current);if(v==="last")b.reverse();else if(v==="prev"||v==="next"){v==="prev"&&b.reverse();const E=b.indexOf(x.currentTarget);b=c.loop?lQ(b,E+1):b.slice(E+1)}setTimeout(()=>ZD(b))}})})})});GD.displayName=qD;var oQ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sQ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function aQ(e,t,n){const r=sQ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return oQ[r]}function ZD(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function lQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var KD=YD,XD=GD,T1="Tabs",[uQ,Wxe]=ti(T1,[Rm]),QD=Rm(),[cQ,A1]=uQ(T1),JD=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=jd(a),[h,p]=Ro({prop:r,onChange:i,defaultProp:o});return y.jsx(cQ,{scope:n,baseId:En(),value:h,onValueChange:p,orientation:s,dir:f,activationMode:u,children:y.jsx(He.div,{dir:f,"data-orientation":s,...c,ref:t})})});JD.displayName=T1;var ej="TabsList",tj=S.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=A1(ej,n),s=QD(n);return y.jsx(KD,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:y.jsx(He.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});tj.displayName=ej;var nj="TabsTrigger",rj=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=A1(nj,n),a=QD(n),u=sj(s.baseId,r),c=aj(s.baseId,r),f=r===s.value;return y.jsx(XD,{asChild:!0,...a,focusable:!i,active:f,children:y.jsx(He.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":c,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:Re(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:Re(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:Re(e.onFocus,()=>{const h=s.activationMode!=="manual";!f&&!i&&h&&s.onValueChange(r)})})})});rj.displayName=nj;var ij="TabsContent",oj=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=A1(ij,n),u=sj(a.baseId,r),c=aj(a.baseId,r),f=r===a.value,h=S.useRef(f);return S.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),y.jsx(sr,{present:i||f,children:({present:p})=>y.jsx(He.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:p&&o})})});oj.displayName=ij;function sj(e,t){return`${e}-trigger-${t}`}function aj(e,t){return`${e}-content-${t}`}var dQ=JD,lj=tj,uj=rj,cj=oj;const P1=dQ,Mm=S.forwardRef(({className:e,...t},n)=>y.jsx(lj,{ref:n,className:Te(e),...t}));Mm.displayName=lj.displayName;const _o=S.forwardRef(({className:e,...t},n)=>y.jsx(uj,{ref:n,className:Te(e),...t}));_o.displayName=uj.displayName;const No=S.forwardRef(({className:e,...t},n)=>y.jsx(cj,{ref:n,className:Te("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));No.displayName=cj.displayName;const HN=(e,t)=>{const[n,r]=S.useState([]),[i,o]=S.useState(!0),s=async a=>{o(!0);try{const u=await fetch(`/api/agents/${a??e}/evals/${t}`);if(!u.ok){const f=await u.json();r([]),console.error("Error fetching evals",f),nn.error((f==null?void 0:f.error)||"Error fetching evals");return}const c=await u.json();r(c.evals)}catch(u){r([]),console.error("Error fetching evals",u),nn.error("Error fetching evals")}finally{o(!1)}};return S.useEffect(()=>{s(e)},[e]),{evals:n,isLoading:i,refetchEvals:s}};function fQ({agentId:e}){const[t,n]=S.useState("live"),{evals:r,isLoading:i,refetchEvals:o}=HN(e,"live"),{evals:s,isLoading:a,refetchEvals:u}=HN(e,"ci"),c=()=>{t==="live"?o():u()};return y.jsx("div",{className:"flex-1 relative overflow-hidden",children:y.jsx("div",{className:"flex justify-between sticky top-0 bg-mastra-bg-2 p-4",children:y.jsxs(P1,{value:t,onValueChange:f=>n(f),className:"w-full",children:[y.jsxs(Mm,{children:[y.jsx(_o,{value:"live",className:"mr-4",children:"Live"}),y.jsx(_o,{value:"ci",children:"CI"})]}),y.jsx("div",{className:"flex justify-end my-2",children:y.jsx(Mt,{variant:"outline",onClick:c,disabled:t==="live"?i:a,children:(t==="live"?i:a)?y.jsx(jl,{className:"w-4 h-4 animate-spin"}):y.jsx(jl,{className:"w-4 h-4"})})}),y.jsxs(Rn,{className:"rounded-lg h-[calc(100vh-180px)]",children:[y.jsx(No,{value:"live",className:"mt-0",children:y.jsx(YN,{showTestName:!1,evals:r,isLoading:i})}),y.jsx(No,{value:"ci",className:"mt-0",children:y.jsx(YN,{showTestName:!0,evals:s,isLoading:a})})]})]})})})}function YN({showTestName:e=!1,evals:t,isLoading:n}){const[r,i]=S.useState(new Set),o=a=>{const u=new Set(r);u.has(a)?u.delete(a):u.add(a),i(u)},s=a=>a.reduce((u,c)=>{const f=u.find(h=>h.metricName===c.meta.metricName);return f?(f.evals.push(c),f.averageScore=f.evals.reduce((h,p)=>h+p.result.score,0)/f.evals.length):u.push({metricName:c.meta.metricName,averageScore:c.result.score,evals:[c]}),u},[]);return y.jsxs(hm,{children:[y.jsx(pm,{className:"bg-[#171717] sticky top-0 z-10",children:y.jsxs(Xr,{className:"border-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[y.jsx(mr,{className:"w-[50px]"}),y.jsx(mr,{className:"w-[300px] text-mastra-el-3",children:"Metric"}),y.jsx(mr,{className:"w-[600px] text-mastra-el-3"}),y.jsx(mr,{className:"w-[200px] text-mastra-el-3",children:"Average Score"}),y.jsx(mr,{className:"text-mastra-el-3",children:"Total Evaluations"})]})}),y.jsx(mm,{className:"border-b border-gray-6",children:n?y.jsxs(Xr,{className:"border-b-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[y.jsx(gt,{className:"w-[50px]",children:y.jsx(Ue,{className:"h-8 w-8"})}),y.jsx(gt,{className:"w-[400px]",children:y.jsx(Ue,{className:"h-8 w-full"})}),y.jsx(gt,{className:"w-[400px]",children:y.jsx(Ue,{className:"h-8 w-full"})}),y.jsx(gt,{className:"w-[200px]",children:y.jsx(Ue,{className:"h-8 w-full"})}),y.jsx(gt,{children:y.jsx(Ue,{className:"h-8 w-full"})})]}):s(t).map(a=>y.jsxs(y.Fragment,{children:[y.jsxs(Xr,{className:"border-b-gray-6 border-b-[0.1px] text-[0.8125rem] cursor-pointer hover:bg-mastra-bg-3",onClick:()=>o(a.metricName),children:[y.jsx(gt,{className:"w-[50px]",children:y.jsx("div",{className:"h-8 w-full flex items-center justify-center",children:r.has(a.metricName)?y.jsx(am,{className:"h-4 w-4 text-mastra-el-5"}):y.jsx(eV,{className:"h-4 w-4 text-mastra-el-5"})})}),y.jsx(gt,{className:"w-[300px] font-medium text-mastra-el-5",children:a.metricName}),y.jsx(gt,{className:"w-[600px] text-mastra-el-5"}),y.jsx(gt,{className:"w-[200px] text-mastra-el-5",children:a.averageScore.toFixed(2)}),y.jsx(gt,{className:"text-mastra-el-5",children:a.evals.length})]},a.metricName),r.has(a.metricName)&&y.jsxs(y.Fragment,{children:[y.jsxs(Xr,{className:"bg-mastra-bg-3 text-[0.7rem] text-mastra-el-3",children:[y.jsx(gt,{className:"w-[50px]"}),y.jsx(gt,{className:"w-[300px] pl-8",children:"Timestamp"}),y.jsx(gt,{className:"w-[600px] pl-8",children:"Input"}),y.jsx(gt,{className:"w-[200px]",children:"Score"}),e&&y.jsx(gt,{children:"Test Name"})]}),a.evals.map((u,c)=>y.jsxs(Xr,{className:"bg-mastra-bg-3 text-[0.8125rem]",children:[y.jsx(gt,{className:"w-[50px]"}),y.jsx(gt,{className:"w-[300px] text-mastra-el-4 pl-8",children:new Date(u.meta.timestamp).toLocaleString()}),y.jsx(gt,{className:"w-[600px] text-mastra-el-4",children:u.input}),y.jsx(gt,{className:"w-[200px] text-mastra-el-4",children:u.result.score}),e&&y.jsx(gt,{className:"text-mastra-el-4",children:u.meta.testName})]},`${a.metricName}-${c}`))]})]}))})]})}function hQ({agentId:e}){const{isLoading:t,agent:n}=um(e),r=Lo();return t?y.jsx(Rn,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs",children:y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx(Ue,{className:"h-3"}),y.jsx(Ue,{className:"h-3"})]}),y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx(Ue,{className:"h-3"}),y.jsx(Ue,{className:"h-3"})]}),y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx(Ue,{className:"h-3"}),y.jsx(Ue,{className:"h-3"})]}),y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx(Ue,{className:"h-3"}),y.jsx(Ue,{className:"h-3"})]}),y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx(Ue,{className:"h-3"}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(Ue,{className:"h-3"}),y.jsx(Ue,{className:"h-3"}),y.jsx(Ue,{className:"h-3"})]})]})]})}):y.jsx(Rn,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs",children:y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"Name"}),y.jsx("p",{className:"text-mastra-el-5",children:n==null?void 0:n.name})]}),y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"Instructions"}),y.jsx("p",{className:"text-mastra-el-5 whitespace-pre-wrap",children:n==null?void 0:n.instructions})]}),y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"Model"}),y.jsx("p",{className:"text-mastra-el-5",children:n==null?void 0:n.provider})]}),y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"Provider"}),y.jsx("p",{className:"text-mastra-el-5",children:n==null?void 0:n.provider.split(".")[0].toUpperCase()})]}),y.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"Tools"}),y.jsx("div",{className:"flex flex-col gap-2 text-mastra-el-5",children:Object.entries((n==null?void 0:n.tools)??{}).map(([i,o])=>y.jsx("span",{onClick:()=>{r(`/tools/${e}/${o.id}`)},className:"no-underline",children:o.id},i))})]})]})})}function pQ({agentId:e}){return y.jsx(Rn,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs w-[400px]",children:y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"GET"}),y.jsx("p",{className:"text-mastra-el-5",children:"/api/agents"})]}),y.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"GET"}),y.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e]})]}),y.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"POST"}),y.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e,"/generate"]})]}),y.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"POST"}),y.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e,"/stream"]})]}),y.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"POST"}),y.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e,"/text-object"]})]}),y.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[y.jsx("p",{className:"text-mastra-el-3",children:"POST"}),y.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e,"/stream-object"]})]})]})})}const dj=e=>{const[t,n]=S.useState([]),[r,i]=S.useState(!0),o=async s=>{i(!0);try{const a=await fetch(`/api/logs/${s??e}`);if(!a.ok){const c=await a.json();n([]),console.error("Error fetching logs",c),nn.error((c==null?void 0:c.error)||"Error fetching logs");return}const u=await a.json();n(u)}catch(a){n([]),console.error("Error fetching logs",a),nn.error("Error fetching logs")}finally{i(!1)}};return S.useEffect(()=>{o(e)},[e]),{logs:t,isLoading:r,refetchLogs:o}};function mQ({agentId:e}){const{logs:t,isLoading:n,refetchLogs:r}=dj(e);return y.jsxs(Rn,{className:"h-[calc(100vh-126px)] px-4 pb-4 text-xs w-[400px]",children:[y.jsx("div",{className:"flex justify-end sticky top-0 bg-mastra-bg-2 py-2",children:y.jsx(Mt,{variant:"outline",onClick:()=>r(),children:n?y.jsx(jl,{className:"w-4 h-4 animate-spin"}):y.jsx(jl,{className:"w-4 h-4"})})}),y.jsx("div",{className:"space-y-4",children:t.length===0?y.jsxs("p",{className:"text-gray-300/60",children:["No log drains. By default, logs are sent to the console. To configure log drains see"," ",y.jsx("a",{href:"https://mastra.ai/docs/reference/observability/create-logger#upstash-logger-remote-log-drain",target:"_blank",rel:"noopener",className:" hover:text-gray-100 underline",children:"docs."})]}):t.map(i=>{const o=JSON.parse(i.message);return y.jsxs("div",{className:"space-y-2",children:[y.jsxs("div",{className:"flex gap-2 items-center",children:[y.jsxs("p",{className:"text-mastra-el-4",children:["[",i.timestamp,"]"]}),y.jsxs("p",{className:"text-mastra-el-5",children:["[",i.level,"]"]})]}),y.jsx("p",{className:"text-mastra-el-5 whitespace-pre-wrap",children:y.jsx("code",{children:JSON.stringify(o,null,2)})})]},i.timestamp)})})]})}function qN({agentId:e}){const t=Lo();return y.jsxs(P1,{defaultValue:"details",children:[y.jsxs(Mm,{className:"flex shrink-0 border-b",children:[y.jsx(_o,{value:"details",className:"group",children:y.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Details"})}),y.jsx(_o,{value:"endpoints",className:"group",children:y.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Endpoints"})}),y.jsx(_o,{value:"logs",className:"group",children:y.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Log Drains"})}),y.jsx("button",{className:"group",onClick:()=>t(`/agents/${e}/evals`),children:y.jsx("p",{className:"text-xs p-3 text-mastra-el-3",children:"Evals"})})]}),y.jsx(No,{value:"details",children:e?y.jsx(hQ,{agentId:e}):null}),y.jsx(No,{value:"endpoints",children:y.jsx(pQ,{agentId:e})}),y.jsx(No,{value:"logs",children:y.jsx(mQ,{agentId:e})})]})}function gQ(e,t=globalThis==null?void 0:globalThis.document){const n=hn(e);S.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var yQ="DismissableLayer",b0="dismissableLayer.update",xQ="dismissableLayer.pointerDownOutside",vQ="dismissableLayer.focusOutside",GN,fj=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vd=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...u}=e,c=S.useContext(fj),[f,h]=S.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=S.useState({}),x=ht(t,D=>h(D)),v=Array.from(c.layers),[k]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(k),E=f?v.indexOf(f):-1,C=c.layersWithOutsidePointerEventsDisabled.size>0,N=E>=b,P=kQ(D=>{const R=D.target,I=[...c.branches].some(M=>M.contains(R));!N||I||(i==null||i(D),s==null||s(D),D.defaultPrevented||a==null||a())},p),T=SQ(D=>{const R=D.target;[...c.branches].some(M=>M.contains(R))||(o==null||o(D),s==null||s(D),D.defaultPrevented||a==null||a())},p);return gQ(D=>{E===c.layers.size-1&&(r==null||r(D),!D.defaultPrevented&&a&&(D.preventDefault(),a()))},p),S.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(GN=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),ZN(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=GN)}},[f,p,n,c]),S.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),ZN())},[f,c]),S.useEffect(()=>{const D=()=>m({});return document.addEventListener(b0,D),()=>document.removeEventListener(b0,D)},[]),y.jsx(He.div,{...u,ref:x,style:{pointerEvents:C?N?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,P.onPointerDownCapture)})});Vd.displayName=yQ;var wQ="DismissableLayerBranch",bQ=S.forwardRef((e,t)=>{const n=S.useContext(fj),r=S.useRef(null),i=ht(t,r);return S.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),y.jsx(He.div,{...e,ref:i})});bQ.displayName=wQ;function kQ(e,t=globalThis==null?void 0:globalThis.document){const n=hn(e),r=S.useRef(!1),i=S.useRef(()=>{});return S.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let u=function(){hj(xQ,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function SQ(e,t=globalThis==null?void 0:globalThis.document){const n=hn(e),r=S.useRef(!1);return S.useEffect(()=>{const i=o=>{o.target&&!r.current&&hj(vQ,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ZN(){const e=new CustomEvent(b0);document.dispatchEvent(e)}function hj(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?AR(i,o):i.dispatchEvent(o)}var Kx="focusScope.autoFocusOnMount",Xx="focusScope.autoFocusOnUnmount",KN={bubbles:!1,cancelable:!0},EQ="FocusScope",Wd=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,u]=S.useState(null),c=hn(i),f=hn(o),h=S.useRef(null),p=ht(t,v=>u(v)),m=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let v=function(C){if(m.paused||!a)return;const N=C.target;a.contains(N)?h.current=N:ys(h.current,{select:!0})},k=function(C){if(m.paused||!a)return;const N=C.relatedTarget;N!==null&&(a.contains(N)||ys(h.current,{select:!0}))},b=function(C){if(document.activeElement===document.body)for(const P of C)P.removedNodes.length>0&&ys(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",k);const E=new MutationObserver(b);return a&&E.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",k),E.disconnect()}}},[r,a,m.paused]),S.useEffect(()=>{if(a){QN.add(m);const v=document.activeElement;if(!a.contains(v)){const b=new CustomEvent(Kx,KN);a.addEventListener(Kx,c),a.dispatchEvent(b),b.defaultPrevented||(CQ(PQ(pj(a)),{select:!0}),document.activeElement===v&&ys(a))}return()=>{a.removeEventListener(Kx,c),setTimeout(()=>{const b=new CustomEvent(Xx,KN);a.addEventListener(Xx,f),a.dispatchEvent(b),b.defaultPrevented||ys(v??document.body,{select:!0}),a.removeEventListener(Xx,f),QN.remove(m)},0)}}},[a,c,f,m]);const x=S.useCallback(v=>{if(!n&&!r||m.paused)return;const k=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,b=document.activeElement;if(k&&b){const E=v.currentTarget,[C,N]=_Q(E);C&&N?!v.shiftKey&&b===N?(v.preventDefault(),n&&ys(C,{select:!0})):v.shiftKey&&b===C&&(v.preventDefault(),n&&ys(N,{select:!0})):b===E&&v.preventDefault()}},[n,r,m.paused]);return y.jsx(He.div,{tabIndex:-1,...s,ref:p,onKeyDown:x})});Wd.displayName=EQ;function CQ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ys(r,{select:t}),document.activeElement!==n)return}function _Q(e){const t=pj(e),n=XN(t,e),r=XN(t.reverse(),e);return[n,r]}function pj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function XN(e,t){for(const n of e)if(!NQ(n,{upTo:t}))return n}function NQ(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 TQ(e){return e instanceof HTMLInputElement&&"select"in e}function ys(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&TQ(e)&&t&&e.select()}}var QN=AQ();function AQ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=JN(e,t),e.unshift(t)},remove(t){var n;e=JN(e,t),(n=e[0])==null||n.resume()}}}function JN(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function PQ(e){return e.filter(t=>t.tagName!=="A")}var RQ="Portal",Ud=S.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[i,o]=S.useState(!1);qn(()=>o(!0),[]);const s=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?bR.createPortal(y.jsx(He.div,{...r,ref:t}),s):null});Ud.displayName=RQ;var Qx=0;function Dm(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??eT()),document.body.insertAdjacentElement("beforeend",e[1]??eT()),Qx++,()=>{Qx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Qx--}},[])}function eT(){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 Li=function(){return Li=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Li.apply(this,arguments)};function mj(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function MQ(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var tp="right-scroll-bar-position",np="width-before-scroll-bar",DQ="with-scroll-bars-hidden",jQ="--removed-body-scroll-bar-size";function Jx(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function OQ(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var IQ=typeof window<"u"?S.useLayoutEffect:S.useEffect,tT=new WeakMap;function LQ(e,t){var n=OQ(null,function(r){return e.forEach(function(i){return Jx(i,r)})});return IQ(function(){var r=tT.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||Jx(a,null)}),o.forEach(function(a){i.has(a)||Jx(a,s)})}tT.set(n,e)},[e]),n}function FQ(e){return e}function $Q(e,t){t===void 0&&(t=FQ);var n=[],r=!1,i={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(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var u=function(){var f=s;s=[],f.forEach(o)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(f){s.push(f),c()},filter:function(f){return s=s.filter(f),n}}}};return i}function zQ(e){e===void 0&&(e={});var t=$Q(null);return t.options=Li({async:!0,ssr:!1},e),t}var gj=function(e){var t=e.sideCar,n=mj(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 S.createElement(r,Li({},n))};gj.isSideCarExport=!0;function BQ(e,t){return e.useMedium(t),gj}var yj=zQ(),ev=function(){},jm=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:ev,onWheelCapture:ev,onTouchMoveCapture:ev}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,u=e.className,c=e.removeScrollBar,f=e.enabled,h=e.shards,p=e.sideCar,m=e.noIsolation,x=e.inert,v=e.allowPinchZoom,k=e.as,b=k===void 0?"div":k,E=e.gapMode,C=mj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=p,P=LQ([n,t]),T=Li(Li({},C),i);return S.createElement(S.Fragment,null,f&&S.createElement(N,{sideCar:yj,removeScrollBar:c,shards:h,noIsolation:m,inert:x,setCallbacks:o,allowPinchZoom:!!v,lockRef:n,gapMode:E}),s?S.cloneElement(S.Children.only(a),Li(Li({},T),{ref:P})):S.createElement(b,Li({},T,{className:u,ref:P}),a))});jm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};jm.classNames={fullWidth:np,zeroRight:tp};var VQ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function WQ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=VQ();return t&&e.setAttribute("nonce",t),e}function UQ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function HQ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var YQ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=WQ())&&(UQ(t,n),HQ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},qQ=function(){var e=YQ();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},xj=function(){var e=qQ(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},GQ={left:0,top:0,right:0,gap:0},tv=function(e){return parseInt(e||"",10)||0},ZQ=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[tv(n),tv(r),tv(i)]},KQ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return GQ;var t=ZQ(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])}},XQ=xj(),Nl="data-scroll-locked",QQ=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
243
243
|
.`.concat(DQ,` {
|
|
244
244
|
overflow: hidden `).concat(r,`;
|
|
245
245
|
padding-right: `).concat(a,"px ").concat(r,`;
|