(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,191871,e=>{"use strict";var t=e.i(738776),s=e.i(797373),l=e.i(482560),a=e.i(749943),o=e.i(361031),i=e.i(233297);let r=(0,s.default)(()=>e.A(638150).then(e=>e.MobileTabBar),{loadableGenerated:{modules:[404069]},ssr:!1,loading:()=>null}),n=(0,s.default)(()=>e.A(255299).then(e=>e.WorkspaceShell),{loadableGenerated:{modules:[817465]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:"Loading..."})});e.s(["WorkspaceClient",0,function(){let e=function(){let e=(0,a.useSearchParams)().get("workspaceId")||"",[t,s]=(0,l.useState)("");return(0,l.useEffect)(()=>{let e=window.location.pathname.match(/\/workspace\/([^/]+)/);s(e?.[1]||"")},[]),(0,l.useMemo)(()=>e||t,[t,e])}(),s=(0,a.useRouter)(),[c,u]=(0,l.useState)(null),[d,h]=(0,l.useState)(null),m=(0,o.useWorkspaceStore)(e=>e.upsertWorkspace);return((0,l.useEffect)(()=>{e&&fetch(`/api/workspaces/${e}`).then(e=>{if(!e.ok)throw Error("Not found");return e.json()}).then(t=>{u(t),m(t),localStorage.setItem("lastWorkspaceId",e)}).catch(e=>h(e.message))},[e,m]),d)?(0,t.jsxs)("div",{className:"h-full flex flex-col items-center justify-center gap-4",children:[(0,t.jsx)("p",{className:"text-destructive",children:d}),(0,t.jsx)("button",{type:"button",onClick:()=>(0,i.tauriNavigate)(s,"/"),className:"text-sm underline",children:"Back to home"})]}):c?(0,t.jsxs)("div",{className:"h-full min-h-0 flex flex-col overflow-hidden",children:[(0,t.jsx)(r,{}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:(0,t.jsx)(n,{workspaceId:c.id,boundDirs:c.boundDirs})})]}):(0,t.jsx)("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:"Loading..."})}])},638150,e=>{e.v(t=>Promise.all(["static/chunks/189bhe4osd~.l.js"].map(t=>e.l(t))).then(()=>t(404069)))},255299,e=>{e.v(t=>Promise.all(["static/chunks/0i9-upmxqpdvi.js","static/chunks/13.1udi8oca2a.js"].map(t=>e.l(t))).then(()=>t(817465)))}]);