module.exports=[9737,a=>{a.v("/_next/static/media/worker.e575ad4f.js")},14151,a=>{"use strict";var b=a.i(73482);let c=(0,a.i(22427).default)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);var d=a.i(30519);function e({href:a,label:e="Back"}){return(0,b.jsxs)(d.default,{href:a,className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors mb-2",children:[(0,b.jsx)(c,{className:"h-4 w-4"}),e]})}a.s(["BackLink",()=>e],14151)},3797,a=>{"use strict";var b=a.i(73482),c=a.i(54662),d=a.i(68760),e=a.i(43747);a.i(80551);var f=a.i(21578),g=a.i(70458),h=a.i(8624),i=a.i(14151);function j({env:a,streamId:e}){let j=(0,c.useParams)().runId,[k,l]=(0,d.useState)([]),[m,n]=(0,d.useState)(!0),[o,p]=(0,d.useState)(null),q=(0,d.useRef)(null),r=(0,d.useRef)(null),s=(0,d.useRef)(0);(0,d.useEffect)(()=>{q.current&&(q.current.scrollTop=q.current.scrollHeight)},[k.length]),(0,d.useEffect)(()=>{let b=!0;r.current=new AbortController;let c=()=>{b&&n(!1)},d=a=>{if(b&&a){let b=s.current++;l(c=>[...c,{id:b,text:a}])}},g=async(a,b)=>{for(;!r.current?.signal.aborted;){let{value:e,done:f}=await a.read();if(f){c();break}e&&e.byteLength>0&&d(b.decode(e,{stream:!0}))}};return(async()=>{try{let b=(await (0,f.readStream)(a,e)).getReader(),c=new TextDecoder;await g(b,c)}catch(a){b&&(p(a instanceof Error?a.message:String(a)),n(!1))}})(),()=>{b=!1,r.current&&r.current.abort()}},[a,e]);let t=j?(0,h.buildUrlWithConfig)(`/run/${j}`,a):(0,h.buildUrlWithConfig)("/",a);return(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(i.BackLink,{href:t}),(0,b.jsxs)(g.Card,{children:[(0,b.jsx)(g.CardHeader,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)(g.CardTitle,{className:"font-mono text-sm",children:e}),(0,b.jsx)("div",{className:"flex items-center gap-2",children:(0,b.jsx)("span",{className:`text-sm ${m?"text-green-600 dark:text-green-400":"text-gray-600 dark:text-gray-400"}`,children:m?"● Live":"● Closed"})})]})}),(0,b.jsx)(g.CardContent,{children:(0,b.jsx)("div",{ref:q,className:"bg-black text-green-400 font-mono text-sm p-4 rounded-md h-[600px] overflow-auto whitespace-pre-wrap break-words",children:o?(0,b.jsxs)("div",{className:"text-red-400",children:[(0,b.jsx)("div",{children:"Error reading stream:"}),(0,b.jsx)("div",{children:o})]}):0===k.length?(0,b.jsx)("div",{className:"text-gray-500",children:m?"Waiting for stream data...":"Stream is empty"}):(0,b.jsx)(b.Fragment,{children:k.map(a=>(0,b.jsx)("span",{children:a.text},`${e}-chunk-${a.id}`))})})})]})]})}function k(){let a=(0,c.useParams)(),f=(0,h.useQueryParamConfig)(),g=(0,d.useMemo)(()=>(0,h.worldConfigToEnvMap)(f),[f]),i=a.streamId;return(0,b.jsx)(e.ErrorBoundary,{title:"Stream Error",description:"Failed to load stream data. Please try navigating back and selecting the stream again.",children:(0,b.jsx)(j,{env:g,streamId:i})})}a.s(["default",()=>k],3797)}];

//# sourceMappingURL=packages_906ab70b._.js.map