PageSourceSearch

https://people.october.health/build/assets/show-C4sg6sWE.js

js october.health collected 2026-10-01 16:38:47 UTC 23,746 bytes, 1 lines download raw bytes

1import{a as ae}from"./rolldown-runtime-DS2seoW7.js";import{O as le}from"./charts-DKxDZnH3.js";import{_ as ne,a as re,c as w,i as ie,s as O}from"./vendor-05Yv21q1.js";import{t as de}from"./utils-B-HWOJQP.js";import{t as ce}from"./arrow-left-CjPguPXM.js";import{t as q}from"./calendar-clock-z2QXJEH4.js";import{n as o,t as oe}from"./admin-layout-DWG7RwRP.js";import{t as me}from"./check-DBT4qAGg.js";import{t as ue}from"./chevron-down-DAua8On8.js";import{t as B}from"./circle-check-Cwib9sBp.js";import{t as he}from"./circle-dashed-D5dkak2L.js";import{t as Y}from"./pencil-BW8DiKKZ.js";import{t as H}from"./plus-Pfnpbwz0.js";import{t as xe}from"./sparkles-DYEOgaN5.js";import{t as pe}from"./trash-2-BRkPtj37.js";import{t as ge}from"./users-CRjhABce.js";import{t as je}from"./video-CpD5tw4d.js";import{t as fe}from"./x-BuH6yV6F.js";import{ct as m,h as W}from"./app-DpnV7LBm.js";import{t as V}from"./badge-D3kp24xm.js";import{a as ve,n as L,o as be,r as Ne,t as $}from"./card-DQ8kPFJB.js";import{c as F,i as b,n as U,s as M,t as E}from"./select-D2ThFgXz.js";import{i as I,n as R,r as _e,t as ye}from"./tabs-DUA1G4Aa.js";import{a as J,i as Q,n as X,o as G,t as K}from"./dialog-D0EcvP6D.js";import{n as ke,r as Se,t as we}from"./collapsible-DXK_bQiA.js";import{t as f}from"./input-BsFpzQ64.js";import{t as p}from"./label-ylFiUAk-.js";import{t as Z}from"./textarea-CP3SwdGR.js";import{t as Ce}from"./progress-CPd4C_Hr.js";import{i as De,n as Te,r as Oe,t as ze}from"./task-detail-sheet-DBSt3SCW.js";import{t as Ae}from"./checkbox-D0ZHJJ8Q.js";var j=ae(le(),1),e=ne();function Le(){const s=new Date,n=String(s.getMonth()+1).padStart(2,"0"),l=String(s.getDate()).padStart(2,"0");return`${s.getFullYear()}-${n}-${l}`}function $e(s){if(!s)return"";const n=new Date(s);if(Number.isNaN(n.getTime()))return"";const l=a=>String(a).padStart(2,"0");return`${n.getFullYear()}-${l(n.getMonth()+1)}-${l(n.getDate())}T${l(n.getHours())}:${l(n.getMinutes())}`}function ee(s){if(!s)return null;const n=new Date(s);return Number.isNaN(n.getTime())?null:n.toISOString()}function vs({project:s,tasks:n,trainings:l,allowances:a,serviceRequests:i,teamMembers:t,specialists:g,tracks:_}){const y=[...g.map(r=>({id:r.id,name:`${r.name} (October)`})),...t],[d,N]=(0,j.useState)(null),[v,C]=(0,j.useState)(null),[k,D]=(0,j.useState)(n),[z,c]=(0,j.useState)(n);n!==z&&(c(n),D(n));const h=k.find(r=>r.id===d)??null,u=(r,T)=>{const se=k;D(te=>te.map(A=>A.id===r?{...A,status:T,is_overdue:T!=="completed"&&!!A.due_date&&A.due_date<Le()}:A));let P=!1;O.patch(o.clientOnboarding.tasks.update(r),{status:T},{preserveScroll:!0,preserveState:!0,onSuccess:()=>{P=!0},onFinish:()=>{P||D(se)}})},x=k.map(r=>({id:r.id,title:r.title,type:r.type,status:r.status,is_overdue:r.is_overdue,due_date:r.due_date,order:r.order,assigneeName:r.assignee,attachmentCount:r.attachments.length,commentCount:r.comments.length,canDrag:!0})),S=()=>{O.post(o.clientOnboarding.complete(s.id),{},{preserveScroll:!0})};return(0,e.jsxs)(oe,{children:[(0,e.jsx)(ie,{title:`Onboarding · ${s.organisation??s.name}`}),(0,e.jsxs)("div",{className:"p-4 sm:p-6",children:[(0,e.jsx)(m,{asChild:!0,variant:"ghost",size:"sm",className:"mb-4",children:(0,e.jsxs)(re,{href:o.clientOnboarding.index(),children:[(0,e.jsx)(ce,{className:"mr-2 h-4 w-4"}),"All onboardings"]})}),(0,e.jsxs)("div",{className:"mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"text-2xl font-bold",children:s.organisation??s.name}),(0,e.jsx)(Fe,{project:s})]}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsxs)("div",{className:"w-40",children:[(0,e.jsx)(Ce,{value:s.progress_percentage}),(0,e.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[s.progress_percentage,"% complete"]})]}),(0,e.jsx)(m,{onClick:S,disabled:!s.is_fully_delivered||s.status==="completed",children:s.status==="completed"?"Completed":"Mark onboarding complete"})]})]}),(0,e.jsxs)(ye,{defaultValue:"tasks",children:[(0,e.jsxs)(_e,{children:[(0,e.jsxs)(I,{value:"tasks",children:["Tasks (",n.length,")"]}),(0,e.jsxs)(I,{value:"training",children:["Training (",l.length,")"]}),(0,e.jsx)(I,{value:"allowances",children:"Allowances"}),(0,e.jsxs)(I,{value:"services",children:["Service requests (",i.length,")"]})]}),(0,e.jsxs)(R,{value:"tasks",className:"mt-4 space-y-4",children:[(0,e.jsx)("div",{className:"flex justify-end",children:(0,e.jsx)(Me,{projectId:s.id})}),(0,e.jsx)(Ue,{projectId:s.id,assigneeOptions:y}),(0,e.jsx)($,{children:(0,e.jsx)(L,{className:"pt-6",children:k.length===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No tasks yet."}):(0,e.jsx)(Oe,{tasks:x,onOpenTask:N,onMove:u})})})]}),(0,e.jsxs)(R,{value:"training",className:"mt-4 space-y-4",children:[(0,e.jsx)(Ee,{projectId:s.id,tracks:_,specialists:g}),(0,e.jsxs)("div",{className:"space-y-3",children:[l.map(r=>(0,e.jsx)(Ie,{training:r,onSchedule:()=>C(r)},r.id)),l.length===0&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No training sessions yet."})]})]}),(0,e.jsx)(R,{value:"allowances",className:"mt-4",children:(0,e.jsxs)($,{children:[(0,e.jsxs)(ve,{children:[(0,e.jsx)(be,{children:"Training allowances"}),(0,e.jsx)(Ne,{children:"Included quantity per track (from contract or add-ons). Used counts derive from scheduled and completed sessions."})]}),(0,e.jsx)(L,{className:"space-y-3",children:_.map(r=>(0,e.jsx)(Re,{projectId:s.id,track:r,current:a.find(T=>T.track===r.value&&T.source==="contract")},r.value))})]})}),(0,e.jsxs)(R,{value:"services",className:"mt-4 space-y-3",children:[i.map(r=>(0,e.jsx)(Ve,{request:r},r.id)),i.length===0&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No service requests."})]})]})]}),(0,e.jsx)(ze,{task:h,open:h!=null,onOpenChange:r=>{r||N(null)},mode:"admin",assigneeName:h?.assignee??null,assignedTo:h?.assigned_to??null,assigneeOptions:y,commentStoreUrl:o.clientOnboarding.tasks.comments.store(d??0),commentDestroyUrl:r=>o.clientOnboarding.tasks.comments.destroy(r),attachmentStoreUrl:o.clientOnboarding.tasks.attachments.store(d??0),attachmentDestroyUrl:r=>o.clientOnboarding.tasks.attachments.destroy(r),allowLink:!0,canManageAll:!0,onStatusChange:r=>h!=null&&u(h.id,r),onUpdate:r=>h!=null&&O.patch(o.clientOnboarding.tasks.update(h.id),r,{preserveScroll:!0}),onDelete:()=>{h!=null&&O.delete(o.clientOnboarding.tasks.destroy(h.id),{preserveScroll:!0,onSuccess:()=>N(null)})}}),v&&(0,e.jsx)(Te,{title:v.title,specialist:v.specialist,slotsUrl:o.clientOnboarding.trainings.slots(v.id),scheduleUrl:o.clientOnboarding.trainings.schedule(v.id),teamMembers:t,onClose:()=>C(null)})]})}function Fe({project:s}
1){const[n,l]=(0,j.useState)(!1),a=w({name:s.name}),i=t=>{t.preventDefault(),a.patch(o.clientOnboarding.update(s.id),{preserveScroll:!0,onSuccess:()=>l(!1)})};return n?(0,e.jsxs)("form",{onSubmit:i,className:"flex items-center gap-2",children:[(0,e.jsx)(f,{autoFocus:!0,value:a.data.name,onChange:t=>a.setData("name",t.target.value),className:"h-8 w-64"}),(0,e.jsx)(m,{type:"submit",size:"icon",variant:"ghost",className:"h-8 w-8",disabled:a.processing||!a.data.name,children:(0,e.jsx)(me,{className:"h-4 w-4"})}),(0,e.jsx)(m,{type:"button",size:"icon",variant:"ghost",className:"h-8 w-8",onClick:()=>{a.reset(),a.clearErrors(),l(!1)},children:(0,e.jsx)(fe,{className:"h-4 w-4"})})]}):(0,e.jsxs)("button",{type:"button",onClick:()=>{a.setData("name",s.name),l(!0)},className:"group flex items-center gap-1.5 text-muted-foreground hover:text-foreground",children:[(0,e.jsx)("span",{children:s.name}),(0,e.jsx)(Y,{className:"h-3.5 w-3.5 opacity-0 transition-opacity group-hover:opacity-100"})]})}function Ue({projectId:s,assigneeOptions:n}){const l=w({title:"",type:"action_item",assigned_to:"none",due_date:""}),a=i=>{i.preventDefault(),l.transform(t=>({...t,assigned_to:t.assigned_to==="none"?null:Number(t.assigned_to)})),l.post(o.clientOnboarding.tasks.store(s),{preserveScroll:!0,onSuccess:()=>l.reset("title","due_date")})};return(0,e.jsx)($,{children:(0,e.jsx)(L,{className:"pt-6",children:(0,e.jsxs)("form",{onSubmit:a,className:"flex flex-wrap items-end gap-2",children:[(0,e.jsxs)("div",{className:"min-w-48 flex-1",children:[(0,e.jsx)(p,{children:"New task"}),(0,e.jsx)(f,{value:l.data.title,onChange:i=>l.setData("title",i.target.value),placeholder:"Task title"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(p,{children:"Type"}),(0,e.jsxs)(E,{value:l.data.type,onValueChange:i=>l.setData("type",i),children:[(0,e.jsx)(M,{className:"w-36",children:(0,e.jsx)(F,{})}),(0,e.jsxs)(U,{children:[(0,e.jsx)(b,{value:"meeting",children:"Meeting"}),(0,e.jsx)(b,{value:"action_item",children:"Action item"}),(0,e.jsx)(b,{value:"deliverable",children:"Deliverable"})]})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(p,{children:"Owner"}),(0,e.jsxs)(E,{value:l.data.assigned_to,onValueChange:i=>l.setData("assigned_to",i),children:[(0,e.jsx)(M,{className:"w-44",children:(0,e.jsx)(F,{placeholder:"Unassigned"})}),(0,e.jsxs)(U,{children:[(0,e.jsx)(b,{value:"none",children:"Unassigned"}),n.map(i=>(0,e.jsx)(b,{value:String(i.id),children:i.name},i.id))]})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(p,{children:"Due"}),(0,e.jsx)(f,{type:"date",value:l.data.due_date,onChange:i=>l.setData("due_date",i.target.value)})]}),(0,e.jsxs)(m,{type:"submit",disabled:l.processing||!l.data.title,children:[(0,e.jsx)(H,{className:"mr-1 h-4 w-4"}),"Add"]})]})})})}function Me({projectId:s}
1){const[n,l]=(0,j.useState)(!1),[a,i]=(0,j.useState)(!1),[t,g]=(0,j.useState)(!0),[_,y]=(0,j.useState)([]),[d,N]=(0,j.useState)(new Set),[v,C]=(0,j.useState)(!1),k=()=>{i(!0),fetch(o.clientOnboarding.tasks.suggestions(s),{headers:{Accept:"application/json"}}).then(u=>u.json()).then(u=>{g(u.has_contract),y(u.suggestions),N(new Set(u.suggestions.map(x=>x.key)))}).finally(()=>i(!1))},D=()=>{l(!0),k()},z=u=>{N(x=>{const S=new Set(x);return S.has(u)?S.delete(u):S.add(u),S})},c=()=>{C(!0),O.post(o.clientOnboarding.tasks.applySuggestions(s),{keys:Array.from(d)},{preserveScroll:!0,onSuccess:()=>l(!1),onFinish:()=>C(!1)})},h=[];for(const u of _){let x=h.find(S=>S.label===u.module_label);x||(x={label:u.module_label,items:[]},h.push(x)),x.items.push(u)}return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(m,{variant:"outline",onClick:D,children:[(0,e.jsx)(xe,{className:"mr-1 h-4 w-4"}),"Suggest tasks"]}),(0,e.jsx)(K,{open:n,onOpenChange:l,children:(0,e.jsxs)(X,{className:"max-h-[85vh] overflow-y-auto sm:max-w-lg",children:[(0,e.jsx)(J,{children:(0,e.jsx)(G,{children:"Suggested setup tasks"})}),a?(0,e.jsxs)("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted-foreground",children:[(0,e.jsx)(W,{className:"h-4 w-4 animate-spin"}),"Working out what this client needs…"]}):t?_.length===0?(0,e.jsx)("p",{className:"py-4 text-sm text-muted-foreground",children:"Every suggested setup task has already been added — nothing new to propose right now."}):(0,e.jsx)("div",{className:"space-y-5 py-2",children:h.map(u=>(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("p",{className:"text-xs font-semibold tracking-wide text-muted-foreground uppercase",children:u.label}),u.items.map(x=>(0,e.jsxs)("div",{className:"flex items-start gap-3 rounded-lg border p-3 hover:bg-muted/40",children:[(0,e.jsx)(Ae,{id:`suggest-${x.key}`,checked:d.has(x.key),onCheckedChange:()=>z(x.key),className:"mt-0.5"}),(0,e.jsxs)("label",{htmlFor:`suggest-${x.key}`,className:"min-w-0 cursor-pointer",children:[(0,e.jsx)("p",{className:"text-sm font-medium",children:x.title}),(0,e.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x.description})]})]},x.key))]},u.label))}):(0,e.jsx)("p",{className:"py-4 text-sm text-muted-foreground",children:"This client doesn't have an active contract yet, so there are no setup tasks to suggest. Once a contract is in place, we'll recommend tasks based on the modules they've bought."}),(0,e.jsxs)(Q,{children:[(0,e.jsx)(m,{variant:"ghost",onClick:()=>l(!1),children:"Cancel"}),(0,e.jsxs)(m,{onClick:c,disabled:v||!t||d.size===0,children:[v?(0,e.jsx)(W,{className:"mr-1 h-4 w-4 animate-spin"}):(0,e.jsx)(H,{className:"mr-1 h-4 w-4"}),"Add ",d.size," selected"]})]})]})})]})}function Ee({projectId:s,tracks:n,specialists:l}){const a=w({track:"user",title:"",description:"",duration_minutes:"60",specialist_id:"none",scheduled_at:""}),i=t=>{t.preventDefault(),a.transform(g=>({...g,description:g.description.trim()||null,duration_minutes:Number(g.duration_minutes),specialist_id:g.specialist_id==="none"?null:Number(g.specialist_id),scheduled_at:ee(g.scheduled_at)})),a.post(o.clientOnboarding.trainings.store(s),{preserveScroll:!0,onSuccess:()=>a.reset("title","description","scheduled_at")})};return(0,e.jsx)($,{children:(0,e.jsx)(L,{className:"pt-6",children:(0,e.jsxs)("form",{onSubmit:i,className:"flex flex-wrap items-end gap-2",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(p,{children:"Track"}),(0,e.jsxs)(E,{value:a.data.track,onValueChange:t=>a.setData("track",t),children:[(0,e.jsx)(M,{className:"w-44",children:(0,e.jsx)(F,{})}),(0,e.jsx)(U,{children:n.map(t=>(0,e.jsx)(b,{value:t.value,children:t.label},t.value))})]})]}),(0,e.jsxs)("div",{className:"min-w-48 flex-1",children:[(0,e.jsx)(p,{children:"Session title"}),(0,e.jsx)(f,{value:a.data.title,onChange:t=>a.setData("title",t.target.value),placeholder:"e.g. Platform walkthrough"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(p,{children:"Minutes"}),(0,e.jsx)(f,{type:"number",className:"w-24",value:a.data.duration_minutes,onChange:t=>a.setData("duration_minutes",t.target.value)})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(p,{children:"Specialist"}),(0,e.jsxs)(E,{value:a.data.specialist_id,onValueChange:t=>a.setData("specialist_id",t),children:[(0,e.jsx)(M,{className:"w-44",children:(0,e.jsx)(F,{placeholder:"Lead"})}),(0,e.jsxs)(U,{children:[(0,e.jsx)(b,{value:"none",children:"Project lead"}),l.map(t=>(0,e.jsx)(b,{value:String(t.id),children:t.name},t.id))]})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(p,{children:"Date (for past sessions)"}),(0,e.jsx)(f,{type:"datetime-local",className:"w-52",value:a.data.scheduled_at,onChange:t=>a.setData("scheduled_at",t.target.value)})]}),(0,e.jsxs)("div",{className:"w-full",children:[(0,e.jsx)(p,{children:"Description"}),(0,e.jsx)(Z,{value:a.data.description,onChange:t=>a.setData("description",t.target.value),placeholder:"What this session covers (optional)",rows:2})]}),(0,e.jsxs)(m,{type:"submit",disabled:a.processing||!a.data.title,children:[(0,e.jsx)(H,{className:"mr-1 h-4 w-4"}),"Add"]})]})})})}function Ie({training:s,onSchedule:n}){const l=w({recording_url:s.recording_url??""}
1),[a,i]=(0,j.useState)(!1),t=w({title:s.title,description:s.description??"",scheduled_at:$e(s.scheduled_at)}),[g,_]=(0,j.useState)("link"),y=(0,j.useRef)(null),d=w({type:"recording",title:"",url:"",file:null}),N=s.status==="completed",v=s.status==="scheduled",C=N?B:v?q:he,k=N?"text-emerald-600 dark:text-emerald-400":v?"text-sky-600 dark:text-sky-400":"text-muted-foreground",D=c=>{c.preventDefault(),t.transform(h=>({...h,description:h.description.trim()||null,scheduled_at:ee(h.scheduled_at)})),t.patch(o.clientOnboarding.trainings.update(s.id),{preserveScroll:!0,onSuccess:()=>i(!1)})},z=()=>{confirm("Delete this training session? This cannot be undone.")&&O.delete(o.clientOnboarding.trainings.destroy(s.id),{preserveScroll:!0})};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(we,{className:"rounded-lg border bg-card",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2 p-3",children:[(0,e.jsxs)(Se,{className:"group flex min-w-0 flex-1 items-center gap-2 text-left",children:[(0,e.jsx)(C,{className:de("h-5 w-5 shrink-0",k)}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("span",{className:"font-medium",children:s.title}),(0,e.jsx)(V,{variant:"outline",children:s.track_label}),(0,e.jsx)(V,{variant:"secondary",className:"capitalize",children:s.status})]}),(0,e.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[s.specialist?`Host: ${s.specialist} · `:"",s.scheduled_at?new Date(s.scheduled_at).toLocaleString():"Not scheduled",s.attendees.length>0?` · ${s.attendees.length} attendee(s)`:""]})]}),(0,e.jsx)(ue,{className:"ml-1 h-4 w-4 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),(0,e.jsx)(m,{size:"sm",variant:"ghost",onClick:()=>i(!0),"aria-label":"Edit training",children:(0,e.jsx)(Y,{className:"h-4 w-4"})}),!N&&(0,e.jsxs)(m,{size:"sm",variant:"outline",onClick:n,children:[(0,e.jsx)(q,{className:"mr-1 h-4 w-4"}),v?"Reschedule":"Schedule"]})]}),(0,e.jsxs)(ke,{className:"space-y-4 border-t p-3",children:[s.description&&(0,e.jsx)("p",{className:"text-sm whitespace-pre-line text-muted-foreground",children:s.description}),v&&s.meeting_url&&(0,e.jsx)(m,{asChild:!0,size:"sm",children:(0,e.jsxs)("a",{href:s.meeting_url,target:"_blank",rel:"noreferrer",children:[(0,e.jsx)(je,{className:"mr-1.5 h-4 w-4"}),"Join meeting"]})}),s.attendees.length>0&&(0,e.jsxs)("div",{className:"flex items-start gap-2 text-sm text-muted-foreground",children:[(0,e.jsx)(ge,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,e.jsx)("span",{children:s.attendees.join(", ")})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"mb-2 text-sm font-medium",children:"Deliverables & resources"}),(0,e.jsx)(De,{deliverables:s.deliverables})]}),!N&&(0,e.jsxs)("div",{className:"flex flex-wrap items-end gap-2 rounded-lg border bg-muted/30 p-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(p,{className:"text-xs",children:"Recording URL (optional)"}),(0,e.jsx)(f,{className:"w-56",value:l.data.recording_url,onChange:c=>l.setData("recording_url",c.target.value),placeholder:"https://…"})]}),(0,e.jsxs)(m,{size:"sm",onClick:()=>l.post(o.clientOnboarding.trainings.complete(s.id),{preserveScroll:!0}),children:[(0,e.jsx)(B,{className:"mr-1 h-4 w-4"}),"Mark complete"]})]}),(0,e.jsxs)("form",{onSubmit:c=>{c.preventDefault(),d.post(o.clientOnboarding.trainings.deliverables(s.id),{forceFormData:!0,preserveScroll:!0,onSuccess:()=>{d.reset("title","url","file"),y.current&&(y.current.value="")}})},className:"flex flex-wrap items-end gap-2",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(p,{className:"text-xs",children:"Deliverable"}),(0,e.jsxs)(E,{value:d.data.type,onValueChange:c=>d.setData("type",c),children:[(0,e.jsx)(M,{className:"w-36",children:(0,e.jsx)(F,{})}),(0,e.jsxs)(U,{children:[(0,e.jsx)(b,{value:"recording",children:"Recording"}),(0,e.jsx)(b,{value:"user_guide",children:"User guide"}),(0,e.jsx)(b,{value:"link",children:"Link"}),(0,e.jsx)(b,{value:"document",children:"Document"})]})]})]}),(0,e.jsx)(f,{className:"w-40",placeholder:"Title",value:d.data.title,onChange:c=>d.setData("title",c.target.value)}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"mb-1 flex gap-1",children:[(0,e.jsx)(m,{type:"button",size:"sm",variant:g==="link"?"secondary":"ghost",className:"h-6 px-2 text-xs",onClick:()=>{_("link"),d.setData("file",null)},children:"Link"}),(0,e.jsx)(m,{type:"button",size:"sm",variant:g==="upload"?"secondary":"ghost",className:"h-6 px-2 text-xs",onClick:()=>{_("upload"),d.setData("url","")},children:"Upload"})]}),g==="link"?(0,e.jsx)(f,{className:"w-56",placeholder:"https://…",value:d.data.url,onChange:c=>d.setData("url",c.target.value)}):(0,e.jsx)("input",{ref:y,type:"file",onChange:c=>
1d.setData("file",c.target.files?.[0]??null),className:"block w-56 text-sm text-muted-foreground file:mr-3 file:rounded-md file:border file:border-input file:bg-transparent file:px-3 file:py-1 file:text-sm file:font-medium hover:file:bg-muted"})]}),(0,e.jsx)(m,{type:"submit",variant:"outline",size:"sm",disabled:d.processing||!d.data.title||(g==="link"?!d.data.url:!d.data.file),children:"Add deliverable"})]}),(d.errors.url||d.errors.file)&&(0,e.jsx)("p",{className:"text-xs text-destructive",children:d.errors.url??d.errors.file})]})]}),(0,e.jsx)(K,{open:a,onOpenChange:i,children:(0,e.jsxs)(X,{children:[(0,e.jsx)(J,{children:(0,e.jsx)(G,{children:"Edit training session"})}),(0,e.jsxs)("form",{onSubmit:D,className:"space-y-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(p,{children:"Title"}),(0,e.jsx)(f,{value:t.data.title,onChange:c=>t.setData("title",c.target.value)}),t.errors.title&&(0,e.jsx)("p",{className:"mt-1 text-xs text-destructive",children:t.errors.title})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(p,{children:"Description"}),(0,e.jsx)(Z,{value:t.data.description,onChange:c=>t.setData("description",c.target.value),placeholder:"What this session covers (optional)",rows:3})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(p,{children:"Date (for past sessions)"}),(0,e.jsx)(f,{type:"datetime-local",value:t.data.scheduled_at,onChange:c=>t.setData("scheduled_at",c.target.value)}),(0,e.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Records when a past training or meeting took place. Leave blank to clear."})]}),(0,e.jsxs)(Q,{className:"sm:justify-between",children:[(0,e.jsxs)(m,{type:"button",variant:"ghost",className:"text-destructive hover:text-destructive",onClick:z,children:[(0,e.jsx)(pe,{className:"mr-1 h-4 w-4"}),"Delete"]}),(0,e.jsx)(m,{type:"submit",disabled:t.processing||!t.data.title.trim(),children:"Save changes"})]})]})]})})]})}function Re({projectId:s,track:n,current:l}){const a=w({track:n.value,included_quantity:String(l?.included_quantity??0),source:"contract"});return(0,e.jsxs)("form",{onSubmit:i=>{i.preventDefault(),a.transform(t=>({...t,included_quantity:Number(t.included_quantity)})),a.post(o.clientOnboarding.allowances(s),{preserveScroll:!0})},className:"flex items-end gap-2",children:[(0,e.jsx)("div",{className:"flex-1",children:(0,e.jsx)(p,{children:n.label})}),(0,e.jsx)(f,{type:"number",min:0,className:"w-24",value:a.data.included_quantity,onChange:i=>a.setData("included_quantity",i.target.value)}),(0,e.jsx)(m,{type:"submit",variant:"outline",size:"sm",disabled:a.processing,children:"Save"})]})}function Ve({request:s}){const n=w({action:"quote",estimated_cost:s.estimated_cost??"",estimated_hours:s.estimated_hours??""}),l=i=>{n.transform(t=>({...t,action:i,estimated_cost:t.estimated_cost?Number(t.estimated_cost):null,estimated_hours:t.estimated_hours?Number(t.estimated_hours):null})),n.patch(o.clientOnboarding.reviewServiceRequest(s.id),{preserveScroll:!0})},a=s.status==="approved"||s.status==="scheduled";return(0,e.jsx)($,{children:(0,e.jsxs)(L,{className:"flex flex-wrap items-end justify-between gap-3 pt-6",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"font-medium capitalize",children:s.request_type.replace(/_/g," ")}),(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[s.module_key?`Module: ${s.module_key} · `:"",s.requested_by?`by ${s.requested_by} · `:"",s.description??""]}),(0,e.jsx)(V,{variant:"secondary",className:"mt-1 capitalize",children:s.status})]}),(0,e.jsxs)("div",{className:"flex items-end gap-2",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(p,{className:"text-xs",children:"Est. cost"}),(0,e.jsx)(f,{className:"w-24",value:n.data.estimated_cost,onChange:i=>n.setData("estimated_cost",i.target.value)})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(p,{className:"text-xs",children:"Est. hours"}),(0,e.jsx)(f,{className:"w-24",value:n.data.estimated_hours,onChange:i=>n.setData("estimated_hours",i.target.value)})]}),(0,e.jsx)(m,{size:"sm",variant:"outline",onClick:()=>l("quote"),disabled:n.processing||a,children:"Quote"}),(0,e.jsx)(m,{size:"sm",onClick:()=>l("approve"),disabled:n.processing||a,children:a?"Approved":"Approve"}),(0,e.jsx)(m,{size:"sm",variant:"ghost",onClick:()=>l("decline"),disabled:n.processing,children:"Decline"})]})]})})}export{vs 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.