1import{a as M,g as S,f as I,r as n,h as B,j as e,L as d,d as w,k as A,F as E,S as C,e as _,l as L}from"./index-DV0RBs0h.js";import{M as D}from"./MessageList-BvJJBMfX.js";import{b as F}from"./errorMessage-CssdBl-Q.js";import{a as O}from"./dateFormat-BLYd64ta.js";import"./ShortcutTooltip-6rmRM5ji.js";import"./EmptyState-Cs_HcCEk.js";import"./Tag-D_uddM4Q.js";import"./chatScrollMemory-CUbkwtMy.js";import"./search-qLweXy2S.js";import"./agentModelConfig-hn6DLnMF.js";import"./framework-catalog-DLM_TG2x.js";import"./pencil-DhGWqjXr.js";import"./file-plus-BWPOGxCj.js";import"./file-text-CG_d6VRx.js";import"./MarkdownText-CRcil8Bp.js";import"./usageFormat-CG4su8mN.js";import"./copy-BKARCHnR.js";import"./code-C0Azh8rZ.js";import"./shield-alert-uSadCN4R.js";import"./PermissionConsent-4t04sBDo.js";import"./Loading-DuSVse3R.js";import"./external-link-DVpo316M.js";import"./shield-check-B-S74lAw.js";import"./downloadFile-DWgf0sba.js";import"./download-DglRb4Mi.js";import"./folder-B2WCeQfo.js";!(function(){try{var s="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};var a=new s.Error().stack;a&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[a]="41a9085d-fcd3-492c-9fc3-896cfd4ecf8e",s._sentryDebugIdIdentifier="sentry-dbid-41a9085d-fcd3-492c-9fc3-896cfd4ecf8e")}catch(o){}})();const k=50;const j=s=>({id:s.id,sessionId:"",role:s.role,contentBlocks:s.contentBlocks,createdAt:s.createdAt,model:s.model,usage:null,error:null});const de=()=>{const{t:s}=M();const{shareId:a}=S();const o=I();const[l,c]=n.useState({kind:"checking"});const[y,u]=n.useState([]);const[m,p]=n.useState(false);const[h,g]=n.useState(null);const[f,b]=n.useState(false);n.useEffect(()=>{const t=document.createElement("meta");t.name="robots";t.content="noindex";document.head.appendChild(t);return()=>{t.remove()}},[]);n.useEffect(()=>{let t=false;if(!a){c({kind:"not_found"});return}Promise.all([o.chat.resolveShared(a),o.chat.listSharedMessages(a,{limit:k})]).then(([i,x])=>{if(t)return;u(x.messages.map(j));p(x.hasMore);g(x.nextBefore);c({kind:"ok",preview:i})}).catch(i=>{if(t)return;if(i instanceof B&&i.status===404){c({kind:"not_found"});return}c({kind:"error",message:F(i)})});return()=>{t=true}},[a,o]);const N=n.useCallback(async()=>{if(!a||!m||!h||f)return;b(true);try{const t=await o.chat.listSharedMessages(a,{limit:k,before:h});u(i=>[...t.messages.map(j),...i]);p(t.hasMore);g(t.nextBefore)}finally{b(false)}},[a,m,h,f,o]);if(l.kind!=="ok"){return e.jsx("div",{className:"bg-main min-h-dvh",children:e.jsxs("div",{className:"mx-auto w-full max-w-3xl px-5 py-10",children:[e.jsxs(d,{to:"/","aria-label":"Manyfold",className:"text-fg mb-8 inline-flex items-center gap-2 font-medium",children:[e.jsx(w,{className:"h-6 w-6"}),e.jsx("span",{children:"Manyfold"})]}),l.kind==="checking"&&e.jsx("div",{className:"workbench-note",children:s("common.loading")}),l.kind==="not_found"&&e.jsxs("div",{className:"workbench-panel px-6 py-8",children:[e.jsx("h1",{className:"text-h1 text-fg",children:s("web.chat.shared.notFoundTitle")}),e.jsx("p",{className:"text-ui text-muted mt-2",children:s("web.chat.shared.notFoundBody")}),e.jsx(d,{to:"/",className:"workbench-button-secondary mt-5 inline-flex",children:s("web.chat.shared.backHome")})]}),l.kind==="error"&&e.jsx("div",{className:"workbench-alert-error",children:l.message})]})})}const{preview:r}=l;const v=A(r.agent.framework);return e.jsxs("div",{className:"bg-main flex h-dvh flex-col",children:[e.jsxs("header",{className:"border-divider/60 flex shrink-0 items-center justify-between gap-3 border-b px-4 py-3 md:px-6",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx(d,{to:"/","aria-label":"Manyfold",className:"text-fg inline-flex shrink-0 items-center gap-2 font-medium",children:e.jsx(w,{className:"h-6 w-6"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(E,{framework:r.agent.framework,size:16,className:"shrink-0"}),e.jsx("h1",{className:"text-ui text-fg truncate font-medium",children:r.session.title??s("web.chat.shared.untitled")})]}),e.jsxs("p",{className:"text-caption text-muted mt-0.5 truncate",children:[r.agent.name," · ",r.sharedBy?s("web.chat.shared.sharedBy",{name:r.sharedBy}):s("web.chat.shared.sharedAnon")," · ",O(r.sharedAt)]})]})]}),e.jsxs("div",{className:"shrink-0",children:[e.jsx(C,{children:e.jsx(d,{to:"/workspace",className:"workbench-button-primary inline-flex",children:s("web.chat.shared.openApp")})}),e.jsx(_,{children:e.jsx(d,{to:L(`/chat/shared/${a??""}`),className:"workbench-button-primary inline-flex",children:s("web.chat.shared.signInCta")})})]})]}),e.jsx("div",{className:"mx-auto flex min-h-0 w-full max-w-3xl flex-1 flex-col",children:e.jsx(D,{capabilities:v,messages:y,hasMore:m,loadingOlder:f,onLoadOlder:N,streamingAssistantId:null,streamingBlocks:[],streamStatus:"idle",streamStartedAt:null,streamErrors:[],framework:r.agent.framework,editingDisabled:true,disableGrantCards:true})})]})};export{de as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.