(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,12559,e=>{"use strict";var t=e.i(43476),r=e.i(71645);function s({id:e}){let[s,a]=(0,r.useState)(null),[n,i]=(0,r.useState)(!0),[d,c]=(0,r.useState)("");if((0,r.useEffect)(()=>{let t=localStorage.getItem("admin_token");if(!t){c("Not authenticated"),i(!1);return}fetch(`/api/admin/chat/${e}`,{headers:{Authorization:`Bearer ${t}`}}).then(e=>{if(!e.ok)throw Error("Failed to load chat session");return e.json()}).then(e=>a(e)).catch(e=>c(e.message)).finally(()=>i(!1))},[e]),n)return(0,t.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,t.jsx)("div",{className:"w-6 h-6 border-2 border-red-accent border-t-transparent rounded-full animate-spin"})});if(d||!s)return(0,t.jsx)("div",{className:"max-w-2xl mx-auto py-12 text-center",children:(0,t.jsx)("p",{className:"text-foreground/50",children:d||"Session not found"})});let l=s.intake_data||{},o=l.name||"Unknown",m=l.email||"",u=s.service_type||l.serviceType||"Not specified";return(0,t.jsxs)("div",{className:"max-w-3xl mx-auto",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:"Chat Transcript"}),(0,t.jsxs)("p",{className:"text-sm text-foreground/50 mt-1",children:[o," ",m&&`(${m})`," · ",u," ·"," ",new Date(s.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})]})]}),(0,t.jsx)("div",{className:"space-y-3",children:s.messages.filter(e=>"system"!==e.role).map((e,r)=>(0,t.jsx)("div",{className:`flex ${"user"===e.role?"justify-end":"justify-start"}`,children:(0,t.jsxs)("div",{className:`max-w-[80%] px-4 py-3 rounded-2xl text-sm leading-relaxed ${"user"===e.role?"bg-red-accent text-white rounded-br-md":"bg-subtle-bg border border-card-border text-foreground rounded-bl-md"}`,children:[(0,t.jsx)("div",{className:"whitespace-pre-wrap",children:e.content}),(0,t.jsx)("div",{className:`text-[10px] mt-1.5 ${"user"===e.role?"text-white/50":"text-foreground/30"}`,children:new Date(e.timestamp).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"})})]})},e.id||r))}),(0,t.jsxs)("div",{className:"mt-8 pt-4 border-t border-card-border text-xs text-foreground/40 flex items-center justify-between",children:[(0,t.jsxs)("span",{children:["Status: ",s.intake_state]}),(0,t.jsxs)("span",{children:[s.messages.length," messages"]})]})]})}e.s(["default",()=>s])}]);