(()=>{if(typeof window>"u"||typeof window.React!="object"||typeof window.ReactDOM!="object")return;const t=window.React,f=window.ReactDOM;function p({name:n,size:a}){return typeof window.MIcon=="function"?t.createElement(window.MIcon,{name:n,size:a}):t.createElement("span",{className:"micon material-symbols-outlined",style:a?{fontSize:`${a}px`}:null},n)}const l=[{id:"today",label:"Today",icon:"today",stream:"personal",sub:"home"},{id:"runs",label:"Runs",icon:"alt_route",stream:"personal",sub:"runs"},{id:"compose",label:"",ariaLabel:"Start something \u2014 pick an agent",icon:"add",stream:"personal",sub:"agents",center:!0},{id:"library",label:"Library",icon:"search",stream:"personal",sub:"projects"},{id:"account",label:"Account",icon:"person",stream:"personal",sub:"account"}],o=typeof window.matchMedia=="function"?window.matchMedia("(max-width: 960px)"):null;function u(){const n=(window.location.hash||"").replace(/^#/,""),[a,r]=n.split("/"),c=l.find(s=>s.stream===a&&s.sub===r);return c?c.id:null}const h=6;function d(){return typeof window.__onboardingStep=="number"&&window.__onboardingStep<h}function v(){const[n,a]=t.useState(o?o.matches:window.innerWidth<=960),[r,c]=t.useState(u),[s,b]=t.useState(d);return t.useEffect(()=>{if(!o)return;const e=i=>a(i.matches);return typeof o.addEventListener=="function"?(o.addEventListener("change",e),()=>o.removeEventListener("change",e)):(o.addListener(e),()=>o.removeListener(e))},[]),t.useEffect(()=>{const e=()=>{c(u()),b(d())};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]),t.useEffect(()=>{if(!n)return;const e=window.setInterval(()=>{const i=d();b(w=>w===i?w:i)},350);return()=>window.clearInterval(e)},[n]),!n||s?null:t.createElement("nav",{className:"canvas-tabbar","aria-label":"Mobile navigation"},l.map(e=>t.createElement("button",{key:e.id,type:"button",className:`canvas-tab ${e.center?"canvas-tab-center":""} ${r===e.id?"on":""}`,"aria-label":e.ariaLabel||e.label||e.id,"aria-current":r===e.id?"page":void 0,onClick:i=>{i.preventDefault(),window.NAV&&typeof window.NAV.go=="function"&&window.NAV.go(e.stream,e.sub)}},t.createElement(p,{name:e.icon,size:20}),e.label?t.createElement("span",{className:"canvas-tab-label"},e.label):null)))}function m(){let n=document.getElementById("canvas-mobile-nav-root");if(!n){n=document.createElement("div"),n.id="canvas-mobile-nav-root";const a=document.getElementById("root");a?.parentNode?a.parentNode.insertBefore(n,a.nextSibling):(document.body||document.documentElement).appendChild(n)}f.createRoot(n).render(t.createElement(v))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",m,{once:!0}):m()})();
