1import{j as e}from"./app-C1iegf7Q.js";import{h as N,H as b,L as x,f as v}from"./inertia-BpyZy4w-.js";import{r as j}from"./attention-queue-TvkG8LXl.js";import{a as k}from"./admin-layout-BhXWbUlP.js";import{j as _}from"./journey-labels-D75PCX0v.js";import{C as w}from"./chevron-left-BC-feIS7.js";import{S as u}from"./star-C_kjJuSS.js";import{E as y}from"./external-link-avvfS30C.js";import{L as $}from"./log-in-Dg2nNREu.js";/* empty css */import"./app-logo-Dz0wogSq.js";import"./logo-light-DU4bWymm.js";import"./flash-toast-C6O0iVL1.js";import"./createLucideIcon-wqc1LSWg.js";import"./info-D2ZN_yLm.js";import"./triangle-alert-C7AVwNi-.js";import"./circle-x-Bp6Mbpgt.js";import"./circle-check-BMWvzPMx.js";import"./x-DQSeRCcH.js";import"./arrow-left-DCX0fhKH.js";import"./menu-BR3Nc3Gr.js";import"./users-BCcupCXV.js";import"./folder-open-I72SPUVk.js";import"./pound-sterling-D16GLaAZ.js";import"./book-open-DVFlG_9t.js";function n(t){return t?t.charAt(0).toUpperCase()+t.slice(1).replace(/_/g," "):"â"}function L(t){return t>=3?"bg-red/10 text-red":t>=2?"bg-amber/12 text-amber-ink":"bg-bg-2 text-ink-2"}function m({label:t,value:i,alert:a=!1}){return e.jsxs("div",{className:"rounded-card border border-line bg-white p-4",children:[e.jsx("div",{className:`text-2xl font-semibold ${a&&i>0?"text-amber-ink":"text-ink"}`,children:i}),e.jsx("div",{className:"mt-0.5 text-xs text-ink-3",children:t})]})}function r({title:t,count:i,children:a}){return e.jsxs("div",{className:"rounded-card border border-line bg-white",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-2.5",children:[e.jsx("h2",{className:"text-sm font-semibold text-ink",children:t}),i!==void 0&&e.jsx("span",{className:"text-xs text-ink-3",children:i})]}),e.jsx("div",{className:"p-4",children:a})]})}function Z(){const{specialist:t,load:i,caseload:a,engagements:c,clients:o,bookings:p,recent_reviews:h}=N().props,f=()=>{t.user&&confirm(`Log in as ${t.name}?`)&&v.post(`/admin/users/${t.user.id}/impersonate`)};return e.jsxs(k,{children:[e.jsx(b,{title:`${t.name} · Specialist`}),e.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-8",children:[e.jsxs(x,{href:"/admin/specialists",className:"mb-6 inline-flex items-center gap-1 text-sm text-ink-3 hover:text-ink",children:[e.jsx(w,{className:"h-4 w-4"}),"All specialists"]}),e.jsx("div",{className:"mb-6 rounded-card border border-line bg-white p-5",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h1",{className:"text-lg font-semibold text-ink",children:t.name}),t.reviews_count>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-ink-2",children:[e.jsx(u,{className:"h-3.5 w-3.5 fill-current text-amber"}),t.rating," (",t.reviews_count,")"]})]}),t.title&&e.jsx("p",{className:"mt-0.5 text-sm text-ink-3",children:t.title}),t.user&&e.jsx("p",{className:"mt-0.5 text-sm text-ink-3",children:t.user.email}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[e.jsx(l,{children:n(t.approval_status)}),e.jsx(l,{children:t.is_active?"Active":"Inactive"}),!t.has_portal&&e.jsx(l,{tone:"red",children:"No portal"}),!t.stripe_ready&&e.jsx(l,{tone:"amber",children:"Stripe incomplete"}),e.jsxs(l,{children:[t.active_services," services"]})]})]}),e.jsxs("div",{className:"flex shrink-0 gap-2",children:[e.jsxs("a",{href:`/admin/providers/${t.slug}/edit`,className:"inline-flex items-center gap-1 rounded-md border border-line px-3 py-1.5 text-sm text-ink-2 hover:bg-bg-2",children:["Edit profile",e.jsx(y,{className:"h-3.5 w-3.5"})]}),t.user&&e.jsxs("button",{type:"button",onClick:f,className:"inline-flex items-center gap-1 rounded-md border border-line px-3 py-1.5 text-sm text-ink-2 hover:bg-bg-2",children:[e.jsx($,{className:"h-3.5 w-3.5"}),"Impersonate"]})]})]})}),e.jsxs("div",{className:"mb-6 grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(m,{label:"Active cases",value:i.active_cases}),e.jsx(m,{label:"Overdue follow-ups",value:i.overdue_followups,alert:!0}),e.jsx(m,{label:"Open engagements",value:i.open_engagements}),e.jsx(m,{label:"Reviews",value:t.reviews_count})]}),e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(r,{title:"Caseload",count:i.total_cases,children:a.length===0?e.jsx("p",{className:"text-sm text-ink-3",children:"No cases assigned."}):e.jsx("div",{className:"flex flex-col gap-2",children:a.map(s=>e.jsxs(x,{href:`/admin/cases/${s.uuid}`,className:"flex flex-wrap items-center justify-between gap-3 rounded-md border border-line p-3 hover:border-line-strong",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-ink",children:s.client.name}),e.jsx("span",{className:"text-xs text-ink-3",children:_(s.journey_type)}),e.jsxs("span",{className:"text-xs text-ink-3",children:["· ",n(s.status)]})]}),s.attention.length>0&&e.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:s.attention.map(d=>e.jsx("span",{className:`rounded-tag px-1.5 py-0.5 text-2xs font-medium ${L(d.severity)}`,children:d.label},d.code))})]}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-ink-3",children:[e.jsxs("span",{children:["Readiness ",s.readiness_score??0,"%"]}),e.jsx("span",{children:s.last_activity_at?j(s.last_activity_at):"â"})]})]},s.uuid))})}),e.jsx(r,{title:"Client follow-ups",count:o.length,children:o.length===0?e.jsx("p",{className:"text-sm text-ink-3",children:"No client records."}):e.jsx("div",{className:"flex flex-col gap-2",children:o.map(s=>e.jsxs("div",{className:`flex flex-wrap items-center justify-between gap-3 rounded-md border p-3 ${s.overdue?"border-red/40 bg-red/5":"border-line"}`,children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[s.user_id?e.jsx(x,{href:`/admin/users/${s.user_id}`,className:"text-sm font-medium text-ink hover:underline",children:s.name}):e.jsx("span",{className:"text-sm font-medium text-ink",children:s.name}),e.jsx("span",{className:"text-xs text-ink-3",children:n(s.stage)})]}),s.next_step&&e.jsxs("p",{className:"mt-0.5 text-xs text-ink-3",children:["Next: ",s.next_step]})]}),s.next_step_due_at&&e.jsxs("span",{className:`shrink-0 text-xs ${s.overdue?"text-red":"text-ink-3"}`,children:[s.overdue?"overdue ":"due ",j(s.next_step_due_at)]})]},s.id))})}),e.jsx(r,{title:"Engagements",count:c.length,children:c.length===0?e.jsx("p",{className:"text-sm text-ink-3",children:"No engagements."}):e.jsx("div",{className:"flex flex-col gap-2",children:c.map(s=>e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-md border border-line p-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-ink",children:s.client??"Unknown"}),e.jsx("span",{className:"text-xs text-ink-3",children:n(s.status)}),s.case_uuid&&e.jsx(x,{href:`/admin/cases/${s.case_uuid}`,className:"text-xs text-teal hover:underline",children:"case"})]}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-ink-3",children:[s.agreed_price_gbp!=null&&e.jsxs("span",{children:["£",s.agreed_price_gbp]}),e.jsx("span",{className:s.is_deposit_paid?"text-green-ink":"text-amber-ink",children:s.is_deposit_paid?"deposit paid":"deposit due"})]})]},s.uuid))})}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsx(r,{title:"Recent bookings",count:p.length,children:p.length===0?e.jsx("p",{className:"text-sm text-ink-3",children:"No bookings."}):e.jsx("div",{className:"flex flex-col gap-2 text-sm",children:p.map(s=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-ink",children:s.client??"Unknown"}),e.jsxs("span",{className:"text-xs text-ink-3",children:[n(s.status)," · ",s.created_at??"â"]})]},s.id))})}),e.jsx(r,{title:"Recent reviews",children:h.length===0?e.jsx("p",{className:"text-sm text-ink-3",children:"No reviews yet."}):e.jsx("div",{className:"flex flex-col gap-3 text-sm",children:h.map(s=>e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center gap-1 text-amber",children:Array.from({length:s.rating}).map((d,g)=>e.jsx(u,{className:"h-3 w-3 fill-current"},g))}),s.title&&e.jsx("p",{className:"mt-0.5 font-medium text-ink",children:s.title}),s.body&&e.jsx("p",{className:"text-xs text-ink-3",children:s.body})]},s.id))})})]})]})]})]})}function l({children:t,tone:i="default"}){const a=i==="red"?"bg-red/10 text-red":i==="amber"?"bg-amber/12 text-amber-ink":"bg-bg-2 text-ink-2";return e.jsx("span",{className:`rounded-tag px-1.5 py-0.5 text-2xs font-medium ${a}`,children:t})}export{Z 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.