1import{j as s}from"./app-C1iegf7Q.js";import{H as f,f as d}from"./inertia-BpyZy4w-.js";import{B as a}from"./button-BE4q1_FS.js";import{C as t,c as i,d as l,a as n}from"./card-B-nADP2d.js";import{C as N}from"./case-shell-EPUgGCr1.js";import{a as g}from"./utils-BiuKVCuu.js";import{C as r}from"./circle-check-BMWvzPMx.js";import{S as _}from"./shield-check-CdWPLoDE.js";import{D as k}from"./download-CXbkSkxk.js";/* empty css */import"./index-CGXdj8xB.js";import"./mobile-chrome-C0ug21w9.js";import"./shield-alert-CGX6PHoz.js";import"./createLucideIcon-wqc1LSWg.js";import"./menu-BR3Nc3Gr.js";import"./x-DQSeRCcH.js";import"./message-circle-c43k_fjC.js";import"./app-logo-Dz0wogSq.js";import"./logo-light-DU4bWymm.js";import"./flash-toast-C6O0iVL1.js";import"./info-D2ZN_yLm.js";import"./triangle-alert-C7AVwNi-.js";import"./circle-x-Bp6Mbpgt.js";import"./site-announcement-fVSM8f3a.js";import"./use-funnel-tracking-DZvQDmiU.js";import"./journey-labels-D75PCX0v.js";import"./bell-BvDZckLh.js";import"./plus-BJl-aJiX.js";const y={draft:{label:"Draft",style:"bg-bg-2 text-ink-3"},sent:{label:"Awaiting your agreement",style:"bg-blue-50 text-blue-700"},agreed:{label:"Agreed â awaiting deposit",style:"bg-green/10 text-green-ink"},active:{label:"Active engagement",style:"bg-green/10 text-green-ink"},completed:{label:"Completed",style:"bg-blue-50 text-blue-700"},cancelled:{label:"Cancelled",style:"bg-red/10 text-red"}};function X({agreement:e,canAgree:o,canPay:x=!1,payBlockedReason:m=null,isAuthenticated:p}){const c=y[e.status]??{label:e.status,style:""},h=()=>{confirm("By clicking confirm, you agree to all the terms set out in this engagement agreement.")&&d.post(`/agreements/${e.uuid}/agree`)},j=()=>d.post(`/agreements/${e.uuid}/pay`);return s.jsxs(N,{children:[s.jsx(f,{title:`Engagement Agreement â ${e.agreed_service_name}`}),s.jsxs("div",{className:"mx-auto w-full max-w-2xl px-4 pb-20 pt-8 sm:px-6 lg:px-8",children:[s.jsxs("div",{className:"mb-8 text-center",children:[s.jsx("div",{className:g("mb-3 inline-block rounded-full px-3 py-1 text-xs font-medium",c.style),children:c.label}),s.jsx("h1",{className:"font-serif text-3xl font-normal leading-tight tracking-display text-ink",children:e.agreed_service_name}),s.jsxs("p",{className:"mt-2 text-sm text-ink-2",children:[e.journey_label," · Prepared by ",e.provider.name," via Borderless"]}),e.client_name&&s.jsxs("p",{className:"mt-1 text-sm font-medium text-ink",children:["For ",e.client_name]})]}),s.jsxs("div",{className:"space-y-5",children:[s.jsxs(t,{children:[s.jsx(i,{children:s.jsx(l,{className:"text-sm font-semibold",children:"Engagement summary"})}),s.jsxs(n,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-2xs font-medium uppercase tracking-eyebrow text-ink-3",children:"Investment"}),s.jsxs("p",{className:"mt-0.5 text-2xl font-bold text-ink",children:["£",Number(e.agreed_price_gbp).toLocaleString()]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xs font-medium uppercase tracking-eyebrow text-ink-3",children:"Duration"}),s.jsx("p",{className:"mt-0.5 font-semibold text-ink",children:e.duration_label})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xs font-medium uppercase tracking-eyebrow text-ink-3",children:"Sessions"}),s.jsxs("p",{className:"mt-0.5 font-semibold text-ink",children:[e.agreed_sessions_count," x ",e.agreed_session_duration_minutes,"min"]})]})]}),e.availability_text&&s.jsxs("p",{className:"mt-3 text-xs text-ink-2",children:["Specialist availability: ",e.availability_text]})]})]}),e.agreed_description&&s.jsxs(t,{children:[s.jsx(i,{children:s.jsx(l,{className:"text-sm font-semibold",children:"About this programme"})}),s.jsx(n,{children:s.jsx("p",{className:"text-sm text-ink-2",children:e.agreed_description})})]}),e.agreed_deliverables.length>0&&s.jsxs(t,{children:[s.jsx(i,{children:s.jsx(l,{className:"text-sm font-semibold",children:"What's included"})}),s.jsx(n,{children:s.jsx("ul",{className:"space-y-2",children:e.agreed_deliverables.map((u,b)=>s.jsxs("li",{className:"flex items-start gap-2 text-sm text-ink-2",children:[s.jsx(r,{className:"mt-0.5 h-4 w-4 shrink-0 text-green"}),u]},b))})})]}),e.custom_notes&&s.jsxs(t,{children:[s.jsx(i,{children:s.jsx(l,{className:"text-sm font-semibold",children:"Notes from your specialist"})}),s.jsx(n,{children:s.jsx("p",{className:"text-sm text-ink-2",children:e.custom_notes})})]}),s.jsxs(t,{children:[s.jsx(i,{children:s.jsx(l,{className:"text-sm font-semibold",children:"Payment"})}),s.jsxs(n,{className:"space-y-4",children:[s.jsxs("div",{className:"rounded-card border border-line bg-bg-2 p-4",children:[s.jsxs("div",{className:"mb-2 flex justify-between text-sm",children:[s.jsx("span",{className:"text-ink-2",children:"Total fee"}),s.jsxs("span",{className:"font-semibold text-ink",children:["£",Number(e.agreed_price_gbp).toLocaleStr
1ing()]})]}),s.jsxs("div",{className:"mb-1 flex justify-between border-t border-line pt-2 font-bold text-ink",children:[s.jsxs("span",{children:["Deposit due now (",e.agreed_deposit_percent,"%)"]}),s.jsxs("span",{children:["£",Number(e.deposit_amount_gbp).toLocaleString()]})]}),s.jsxs("div",{className:"flex justify-between text-sm text-ink-2",children:[s.jsx("span",{children:"Remaining balance"}),s.jsxs("span",{children:["£",Number(e.remaining_amount_gbp).toLocaleString()]})]})]}),(e.status==="agreed"||e.status==="active")&&s.jsxs("div",{className:"rounded-card bg-bg-2 p-4 text-sm",children:[s.jsx("p",{className:"mb-2 font-medium text-ink",children:"Bank transfer details"}),s.jsxs("div",{className:"space-y-1 text-ink-2",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Account name"}),s.jsx("span",{className:"font-medium text-ink",children:e.sla.payment_bank.account_name})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Account number"}),s.jsx("span",{className:"font-medium text-ink",children:e.sla.payment_bank.account_number})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Sort code"}),s.jsx("span",{className:"font-medium text-ink",children:e.sla.payment_bank.sort_code})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Reference"}),s.jsx("span",{className:"font-mono font-bold text-ink",children:e.payment_reference})]})]})]}),e.is_deposit_paid&&s.jsxs("div",{className:"flex items-center gap-2 rounded-card bg-green/10 px-4 py-3 text-sm text-green-ink",children:[s.jsx(r,{className:"h-4 w-4"}),"Deposit confirmed. Your engagement is active."]})]})]}),e.agreed_refund_policy&&s.jsxs(t,{children:[s.jsx(i,{children:s.jsx(l,{className:"text-sm font-semibold",children:"Refund policy"})}),s.jsx(n,{children:s.jsx("p",{className:"text-sm text-ink-2",children:e.agreed_refund_policy})})]}),s.jsxs(t,{children:[s.jsx(i,{children:s.jsxs(l,{className:"flex items-center gap-2 text-sm font-semibold",children:[s.jsx(_,{className:"h-4 w-4 text-ink-2"}),"Borderless platform terms",s.jsxs("span",{className:"text-xs font-normal text-ink-3",children:["v",e.platform_terms_version]})]})}),s.jsxs(n,{className:"space-y-3 text-xs text-ink-2",children:[s.jsxs("p",{children:[s.jsx("strong",{className:"text-ink",children:"Outcome:"})," ",e.sla.outcome_disclaimer]}),s.jsxs("p",{children:[s.jsx("strong",{className:"text-ink",children:"Refund protection:"})," ",e.sla.refund_floor]}),s.jsxs("p",{children:[s.jsx("strong",{className:"text-ink",children:"Disputes:"})," ",e.sla.dispute_process]}),s.jsxs("p",{children:[s.jsx("strong",{className:"text-ink",children:"Data handling:"})," ",e.sla.data_handling]}),s.jsxs("p",{children:[s.jsx("strong",{className:"text-ink",children:"Scope:"})," ",e.sla.scope_limit]}),s.jsxs("p",{children:[s.jsx("strong",{className:"text-ink",children:"Governing law:"})," ",e.sla.governing_law]})]})]}),s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx(a,{variant:"outline",asChild:!0,children:s.jsxs("a",{href:`/agreements/${e.uuid}/pdf`,target:"_blank",children:[s.jsx(k,{className:"mr-1.5 h-4 w-4"}),"Download PDF"]})}),o&&s.jsx(a,{size:"lg",onClick:h,className:"sm:min-w-48",children:"I agree to these terms"}),x&&s.jsxs(a,{size:"lg",onClick:j,className:"sm:min-w-48",children:["Pay £",Number(e.deposit_amount_gbp).toLocaleString()," deposit"]}),m==="not_taking_card_payments"&&s.jsxs("p",{className:"text-sm text-ink-2",children:["Your specialist is not set up to take card payments here yet. They will be in touch about how to pay the £",Number(e.deposit_amount_gbp).toLocaleString()," deposit."]}),e.status==="sent"&&!p&&s.jsxs("p",{className:"text-sm text-ink-2",children:[s.jsx("a",{href:"/login",className:"font-medium text-ink underline",children:"Sign in"})," to agree to this engagement."]}),e.agreed_at&&s.jsxs("p",{className:"text-sm text-green-ink",children:[s.jsx(r,{className:"mr-1 inline h-4 w-4"}),"Agreed on ",e.agreed_at]})]})]})]})]})}export{X 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.