1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/export-CroRel32.js","assets/index-DLZpdNrZ.js","assets/vendor-ui-BYb5-bwA.js","assets/vendor-icons-CvYrHytN.js","assets/vendor-query-CEB0do-E.js","assets/vendor-supabase-xo9tg8y-.js","assets/vendor-react-CaOLWOnV.js","assets/vendor-markdown-1X1hA6nX.js","assets/index-DdVDSbH0.css","assets/markdownToHtml-bJdoD_VG.js"])))=>i.map(i=>d[i]); 2import{j as n,aj as r,f as O,c9 as C,R as d,a4 as T,B as E,b as R,_ as L,a5 as A}from"./index-DLZpdNrZ.js";import{j as e,r as j}from"./vendor-ui-BYb5-bwA.js";import{L as h,a as B,u as F}from"./vendor-react-CaOLWOnV.js";import{u as I,a as M}from"./useOnboardingDocs-A6-KsmvM.js";import{u as S}from"./usePageTitle-CnffC3w8.js";import{P as G}from"./PlainMarkdown-CW-qTEZx.js";import{bm as H,U as z,u as K,aJ as U,F as _,a1 as $,ar as N,cz as b,aY as X,bH as q,aN as V,d4 as Y}from"./vendor-icons-CvYrHytN.js";import{C as J}from"./ConfirmDeleteDialog-BerWpBBQ.js";import{P as g}from"./PageShell-DRLRgSlP.js";import{P as v}from"./PageHeaderV2-Bnt5Uyul.js";import"./vendor-query-CEB0do-E.js";import"./vendor-supabase-xo9tg8y-.js";import"./vendor-markdown-1X1hA6nX.js";function Q({content:t}){return t.rendered_body?e.jsx("div",{className:n(r.glassPanel,"prose prose-invert prose-sm max-w-none"),children:e.jsx(G,{content:t.rendered_body})}):e.jsxs("div",{className:"flex flex-col gap-6",children:[t.overview&&e.jsxs("section",{className:r.glassPanel,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(H,{className:"h-5 w-5 text-[rgba(197,160,90,0.8)]"}),e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Welcome Overview"})]}),e.jsx("div",{className:"text-sm text-muted-foreground whitespace-pre-line leading-relaxed",children:t.overview})]}),t.key_people&&t.key_people.length>0&&e.jsxs("section",{className:r.glassPanel,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(z,{className:"h-5 w-5 text-[rgba(197,160,90,0.8)]"}),e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Key People"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:t.key_people.map((a,l)=>e.jsxs("div",{className:n(r.card,"p-3"),children:[e.jsx("h3",{className:"text-sm font-medium text-foreground mb-1",children:a.name}),e.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:a.role_relevance}),a.expertise_areas.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:a.expertise_areas.map((s,c)=>e.jsx(O,{className:"text-[10px] bg-white/5 text-white/60 border-white/10",children:s},c))})]},l))})]}),t.active_topics&&t.active_topics.length>0&&e.jsxs("section",{className:r.glassPanel,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(K,{className:"h-5 w-5 text-[rgba(197,160,90,0.8)]"}),e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Active Topics"})]}),e.jsx("div",{className:"flex flex-col gap-3",children:t.active_topics.map((a,l)=>e.jsxs("div",{className:n(r.card,"p-3"),children:[e.jsx("h3",{className:"text-sm font-medium text-foreground mb-1",children:a.topic}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a.description}),a.key_docs.length>0&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Related docs: ",a.key_docs.join(", ")]})]},l))})]}),t.key_relationships&&t.key_relationships.length>0&&e.jsxs("section",{className:r.glassPanel,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(U,{className:"h-5 w-5 text-[rgba(197,160,90,0.8)]"}),e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Key Relationships"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:t.key_relationships.map((a,l)=>e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"text-foreground font-medium",children:a.from}),e.jsx("span",{className:"text-muted-foreground mx-2",children:a.type}),e.jsx("span",{className:"text-foreground font-medium",children:a.to}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:a.significance})]},l))})]}),t.recommended_reading&&t.recommended_reading.length>0&&e.jsxs("section",{className:r.glassPanel,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(_,{className:"h-5 w-5 text-[rgba(197,160,90,0.8)]"}),e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Recommended Reading"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:t.recommended_reading.map((a,l)=>e.jsxs("div",{className:n(r.card,"p-3"),children:[a.id?e.jsx(h,{to:C(d.LIBRARY_DETAIL,{docId:a.id}),className:"text-sm font-medium text-foreground hover:text-[rgba(197,160,90,0.8)] transition-colors",children:a.title}):e.jsx("h3",{className:"text-sm font-medium text-foreground",children:a.title}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:a.why_read})]},l))})]}),t.knowledge_gaps&&t.knowledge_gaps.length>0&&e.jsxs("section",{className:r.glassPanel,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx($,{className:"h-5 w-5 text-[rgba(197,160,90,0.8)]"}),e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Open Questions"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:t.knowledge_gaps.map((a,l)=>e.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[e.jsx("span",{className:"text-muted-foreground mt-0.5",children:"-"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-foreground",children:a.question}),a.occurrence_count>0&&e.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["(asked ",a.occurrence_count,"x)"]})]})]},l))})]})]})}function me(){const{id:t}=B(),a=F(),{toast:l}=T(),{data:s,isLoading:c,error:w}=I(t??null),m=M(),[y,p]=j.useState(!1),[i,u]=j.useState(!1);S(s!=null&&s.role_title?`Onboarding: ${s.role_title}`:"Onboarding Doc");const D=()=>{s&&m.mutate({docId:s.id,orgId:s.org_id},{onSuccess:()=>{a(d.TEAM_ONBOARDING)}})},o=async f=>{if(s!=null&&s.content){u(!0);try{const{exportDocument:x}=await L(async()=>{const{exportDocument:P}=await import("./export-CroRel32.js");return{exportDocument:P}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),k=s.content.rendered_body??s.content.overview??"";await x(k,f,s.role_title,{includeBranding:!0,orgId:s.org_id}),l({title:"Export complete",description:`Downloaded as ${f.toUpperCase()}.`,variant:"success"})}catch(x){A(l,x,"exporting document")}finally{u(!1)}}};return c?e.jsx(g,{children:e.jsxs("div",{className:"flex items-center justify-center py-12 text-soft-bright",children:[e.jsx(N,{className:"h-6 w-6 animate-spin mr-2"}),e.jsx("span",{children:"Loading onboarding doc..."})]})}):w||!s?e.jsx(g,{children:e.jsx("div",{className:n(r.platformPage,"flex flex-col gap-8"),children:e.jsx(v,{title:"Onboarding Doc Not Found",subtitle:"The requested onboarding doc could not be loaded",leftContent:e.jsxs(h,{to:d.TEAM_ONBOARDING,className:n(r.breadcrumbLink),children:[e.jsx(b,{className:"h-4 w-4"}),"Back to Knowledge Actions"]})})})}):e.jsx(g,{children:e.jsxs("div",{className:n(r.platformPage,"flex flex-col gap-8"),children:[e.jsx(v,{title:s.role_title,subtitle:`Generated ${R(s.created_at,"M/d/yyyy")}`,leftContent:e.jsxs(h,{to:d.TEAM_ONBOARDING,className:n(r.breadcrumbLink),children:[e.jsx(b,{className:"h-4 w-4"}),"Back to Knowledge Actions"]}),rightContent:e.jsxs(e.Fragment,{children:[e.jsxs(E,{variant:"ghost",size:"sm",className:"text-red-400",onClick:()=>p(!0),children:[e.jsx(X,{className:"h-4 w-4 mr-1.5"}),"Delete"]}),e.jsx(J,{open:y,onOpenChange:p,title:"Delete onboarding doc?",description:`This will permanently delete the onboarding doc for "${s.role_title}". This action cannot be undone.`,confirmLabel:m.isPending?"Deleting...":"Delete",isPending:m.isPending,onConfirm:D})]})}),e.jsx("div",{className:"border-t border-[rgba(197,160,90,0.25)]"}),s.status==="completed"&&s.content&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-medium mr-1",style:{color:"var(--platform-text-muted)"},children:"EXPORT"}),e.jsxs("button",{className:"",disabled:i,onClick:()=>void o("pdf"),"aria-label":"Export as PDF",children:[e.jsx(q,{className:"h-3.5 w-3.5 mr-1.5"}),"PDF"]}),e.jsxs("button",{className:"",disabled:i,onClick:()=>void o("docx"),"aria-label":"Export as DOCX",children:[e.jsx(V,{className:"h-3.5 w-3.5 mr-1.5"}),"DOCX"]}),e.jsxs("button",{className:"",disabled:i,onClick:()=>void o("html"),"aria-label":"Export as HTML",children:[e.jsx(Y,{className:"h-3.5 w-3.5 mr-1.5"}),"HTML"]}),e.jsxs("button",{className:"",disabled:i,onClick:()=>void o("md"),"aria-label":"Export as Markdown",children:[e.jsx(_,{className:"h-3.5 w-3.5 mr-1.5"}),"MD"]})]}),e.jsxs("div",{className:r.pageContent,children:[s.status==="generating"&&e.jsxs("div",{className:"flex flex-col items-center gap-3 text-muted-foreground py-12",children:[e.jsx(N,{className:"h-6 w-6 animate-spin"}),e.jsx("p",{className:"text-sm font-medium",children:"Generating your onboarding playbook..."}),e.jsx("p",{className:"text-xs",children:"Searching documents, analyzing entities, and building your personalized guide. This typically takes 15-30 seconds."})]}),s.status==="failed"&&e.jsx("div",{className:"rounded-lg border border-red-400/30 bg-red-400/10 p-4 text-sm text-red-400",children:"Onboarding doc generation failed. Please try again with a different role title."}),s.status==="completed"&&s.content&&e.jsx(Q,{content:s.content}),s.status==="completed"&&(!s.content||!s.content.overview&&!s.content.rendered_body)&&e.jsx("div",{className:"text-center py-8",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"No content was generated for this role. The knowledge base may not have sufficient information."})})]})]})})}export{me 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.