1import{j as e}from"./app-C1iegf7Q.js";import{b as m,u as j,H as N,L as v}from"./inertia-BpyZy4w-.js";import{s as _,S as w}from"./slot-booker-DjL2eZ8X.js";import{u as C}from"./use-slot-availability-D2zme9JR.js";import{B as y}from"./button-BE4q1_FS.js";import{A as S}from"./app-layout-N5SYko6V.js";import{A}from"./arrow-left-DCX0fhKH.js";import{C as B}from"./check-0O-UND6N.js";import{L}from"./loader-circle-C_KBZAGS.js";/* empty css */import"./calendar-days-CT1ztEQ-.js";import"./createLucideIcon-wqc1LSWg.js";import"./chevron-left-BC-feIS7.js";import"./chevron-right-ymZwGCJO.js";import"./clock-BtI_SZvJ.js";import"./index-CGXdj8xB.js";import"./utils-BiuKVCuu.js";import"./case-shell-EPUgGCr1.js";import"./mobile-chrome-C0ug21w9.js";import"./shield-alert-CGX6PHoz.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"./circle-check-BMWvzPMx.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";import"./guest-nav-Dk8jWUwY.js";import"./chevron-down-B1YaU0K5.js";function pe({for:o,providerName:u,callTypes:i,noAvailabilityMessage:x,backHref:d,backLabel:p,isGuest:h}){const[r,b]=m.useState(i.length===1?i[0]:null),s=j({for:o,scheduled_at:"",notes:"",guest_name:"",guest_email:""}),n=m.useMemo(()=>r&&o.startsWith("team")?`team:${r.uuid}`:o,[o,r]),l=C(m.useMemo(()=>({datesUrl:`/bookings/dates?for=${encodeURIComponent(n)}`,slotsUrl:t=>`/bookings/slots?for=${encodeURIComponent(n)}&date=${encodeURIComponent(t)}`}),[n]),{enabled:r!==null,messages:{noAvailability:x}}),f=t=>{l.selectSlot(t),s.setData(a=>({...a,scheduled_at:t,for:n}))},g=t=>{t.preventDefault(),s.post("/bookings",{preserveScroll:!0})},c=_(l),k=(r?.price_gbp??0)>0;return e.jsxs(S,{children:[e.jsx(N,{title:"Book a call"}),e.jsxs("div",{className:"mx-auto max-w-2xl px-4 py-8 sm:px-6",children:[d&&e.jsxs(v,{href:d,className:"mb-6 inline-flex items-center gap-2 text-sm text-ink-3 transition-colors hover:text-ink",children:[e.jsx(A,{className:"h-4 w-4"}),p??"Back"]}),e.jsx("h1",{className:"text-xl font-semibold text-ink",children:"Book a call"}),e.jsxs("p",{className:"mt-1 text-sm text-ink-2",children:["With ",u]}),e.jsxs("form",{onSubmit:g,className:"mt-6 space-y-5",children:[i.length>1&&e.jsxs("div",{className:"rounded-card border border-line bg-surface p-5",children:[e.jsx("h2",{className:"mb-3 text-sm font-semibold text-ink",children:"What do you want to talk about?"}),e.jsx("div",{className:"space-y-2",children:i.map(t=>{const a=r?.uuid===t.uuid;return e.jsxs("button",{type:"button",onClick:()=>b(t),className:["flex w-full items-center gap-3 rounded-card border p-3 text-left transition-colors",a?"border-ink bg-bg-2":"border-line bg-surface hover:border-line-strong"].join(" "),children:[e.jsx("span",{className:["flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2",a?"border-ink bg-ink":"border-line"].join(" "),children:a&&e.jsx(B,{className:"h-3 w-3 text-surface",strokeWidth:3})}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-sm font-medium text-ink",children:t.title}),e.jsx("span",{className:"block text-xs text-ink-3",children:t.formatted_duration})]}),e.jsx("span",{className:"shrink-0 text-sm font-semibold text-ink",children:t.price_gbp>0?`£${t.price_gbp}`:"Free"})]},t.uuid)})})]}),r&&e.jsx("div",{className:"rounded-card border border-line bg-surface p-5",children:e.jsx(w,{availability:{...l,selectSlot:f}})}),l.selectedSlot&&e.jsxs("div",{className:"rounded-card border border-line bg-surface p-5 space-y-4",children:[h&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"guest_name",className:"mb-1.5 block text-sm font-medium text-ink",children:"Your name"}),e.jsx("input",{id:"guest_name",value:s.data.guest_name,onChange:t=>s.setData("guest_name",t.target.value),className:"w-full rounded-lg border border-line bg-surface px-3 py-2 text-sm text-ink placeholder:text-ink-3 focus:border-ink focus:outline-none",placeholder:"Ada Okafor"}),s.errors.guest_name&&e.jsx("p",{className:"mt-1 text-sm text-red",children:s.errors.guest_name})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"guest_email",className:"mb-1.5 block text-sm font-medium text-ink",children:"Email"}),e.jsx("input",{id:"guest_email",type:"email",value:s.data.guest_email,onChange:t=>s.setData("guest_email",t.target.value),className:"w-full rounded-lg border border-line bg-surface px-3 py-2 text-sm text-ink placeholder:text-ink-3 focus:border-ink focus:outline-none",placeholder:"[email protected]"}),e.jsx("p",{className:"mt-1 text-xs text-ink-3",children:"We send your joining link and calendar invite here."}),s.errors.guest_email&&e.jsx("p",{className:"mt-1 text-sm text-red",children:s.errors.guest_email})]})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"notes",className:"mb-1.5 block text-sm font-medium text-ink",children:["Anything to cover?"," ",e.jsx("span",{className:"font-normal text-ink-3",children:"(optional)"})]}),e.jsx("textarea",{id:"notes",rows:3,value:s.data.notes,onChange:t=>s.setData("notes",t.target.value),placeholder:"What would you like to get out of the call?",className:"w-full resize-none rounded-lg border border-line bg-surface px-3 py-2 text-sm text-ink placeholder:text-ink-3 focus:border-ink focus:outline-none"})]}),s.errors.scheduled_at&&e.jsx("p",{className:"text-sm text-red",children:s.errors.scheduled_at}),c&&e.jsx("p",{className:"text-sm text-ink-2",children:c}),e.jsxs(y,{type:"submit",disabled:s.processing,className:"w-full",children:[s.processing&&e.jsx(L,{className:"mr-2 h-4 w-4 animate-spin"}),k?"Continue to payment":"Confirm booking"]})]})]})]})]})}export{pe 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.