PageSourceSearch

https://colara.co/assets/Scheduling-BOOnYKiN.js

js colara.co collected 2026-10-02 01:21:23 UTC 30,232 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/use-upload-BhuNLqHD.js","assets/vendor-Dz9lJ0A9.js","assets/index-BDOD5E4V.js","assets/index-DOWM1KK1.css"])))=>i.map(i=>d[i]);
2import{Q as le,e as x,f as D,a5 as de,K as L,m as U,u as be,B as f,L as G,X as fe,F as ye,P as ve,_ as je}from"./index-BDOD5E4V.js";import{r as n,j as e}from"./vendor-Dz9lJ0A9.js";import{H as Ne}from"./HelpTooltip-ZxgTx8XV.js";import{I as T}from"./input-uKcRzRZU.js";import{L as m}from"./label-xakz0IwZ.js";import{P as ke}from"./PageHelper-DlLkbNgT.js";import{S as M,a as E,b as I,c as B,d as o}from"./select-BqpPFFZ7.js";import{M as we}from"./mobile-section-select-BLxcSrQK.js";import{E as Ce}from"./empty-state-BuhuU5ze.js";import{A as Se,Z as Pe}from"./AdminAvailability-WonijKJv.js";import{E as Te}from"./ExternalCalendarsPanel-C1JXBEkd.js";import{b as Me}from"./use-visibility-qqsxgHcZ.js";import{n as Ee}from"./meeting-providers-CCt2BsaW.js";import{n as oe,B as Ie}from"./booking-purpose-Cwh-xmLK.js";import{S as Be}from"./shield-x-DlzuqqQA.js";import{S as ce}from"./share-2-DnkxhT4f.js";import{C as Le}from"./copy-dUWtYfC2.js";import{C as Ae}from"./code-5rWSCzcy.js";import{P as Fe}from"./palette-DuyWd523.js";import{U as ie}from"./upload-BLxF6oWs.js";import{T as _e}from"./trash-2-DB6k7OfX.js";import{I as Ge}from"./image-CRRQUQpN.js";import{S as Re}from"./sliders-horizontal-DqNhFS0V.js";import{V as Ue}from"./video-BVe2yUt5.js";import{C as qe}from"./calendar-Djt6tY64.js";import{C as ze}from"./check-DtEZOD33.js";import"./circle-question-mark-Bqs4yPi3.js";import"./use-dismissed-hints-CS8gEuUL.js";import"./framer-motion-B-6Peltb.js";import"./index-DiCFY80r.js";import"./index-DBElOBAj.js";import"./chevron-up-Cxk5DR03.js";import"./date-utils-VPArwFdR.js";import"./badge-DV7OMou0.js";import"./useSendEmail-VzJS3P-p.js";import"./EmailPreviewModal-C1KlrKnj.js";import"./checkbox-CKtbmYQK.js";import"./skeleton-Dp0qviHj.js";import"./EmailTemplatePicker-DQTQrg-h.js";import"./popover-DLgxV-6d.js";import"./search-_0AhvJvF.js";import"./list-BLP47b8F.js";import"./save-C1Cv7VS4.js";import"./braces-3gkFdW37.js";import"./format-TE1zKFYr.js";import"./en-US-B1YEHn5a.js";import"./differenceInCalendarDays-CLfZenBU.js";import"./getTimezoneOffsetInMilliseconds-Dg5lkPpW.js";import"./crm-shortcodes-C9arKWs7.js";import"./client-name-DrkX_Dts.js";import"./currency-D2nl_7x3.js";import"./TimelineRichEditor-CWcsB4h6.js";import"./purify.es-D7kaK67O.js";import"./textarea-B6S3DUiX.js";import"./use-upload-BhuNLqHD.js";import"./timeline-notes-BAXXUWUX.js";import"./list-ordered-q1jHSUws.js";import"./heading-2-CkGv6oen.js";import"./link-qDdbFJaq.js";import"./text-align-start-DRmXArhb.js";import"./link-2-DxAadr_f.js";import"./command-7zEmp0OB.js";import"./paperclip-C2dgC7YH.js";import"./undo-2-DuE24aMz.js";import"./pen-line-BmI8eKDA.js";import"./circle-check-CJ_VUuj_.js";import"./send-D2ID-sFR.js";import"./mouse-pointer-click-DrhaqtWj.js";import"./clock-BGjkcAN7.js";import"./plus-DXEHL3ds.js";import"./chevron-left-DOEyzXQl.js";import"./chevron-right-DSIqreSQ.js";import"./rotate-ccw-DBoJyePA.js";import"./calendar-days-D_Rkge92.js";import"./repeat-BbEAQWt3.js";import"./user-jNm9qoKu.js";import"./lock-keyhole-CSqthi1v.js";import"./square--S4JkUy3.js";import"./square-check-big-BGeSStJh.js";import"./switch-CTKr17l3.js";import"./index-CEY-X8xw.js";import"./unlink-D1h8TwEq.js";import"./routes-CnUv5vQr.js";import"./community-forum-Cz56orCo.js";import"./installment-anchors-CUSqoQz9.js";import"./use-subscription-L5b-ZlfW.js";import"./demo-ids-9GOwPNZM.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"8dd115ac638cf6a2a2cf5668d0686c96509328ed"};var d=new a.Error().stack;d&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[d]="6e28f0c9-23be-4924-a0ea-e7559c51e718",a._sentryDebugIdIdentifier="sentry-dbid-6e28f0c9-23be-4924-a0ea-e7559c51e718")}catch{}})();const re=[0,5,10,15,30,60];function Ke(){const{toast:a}=le(),{data:d,isLoading:c}=x({queryKey:["/api/availability/weekly"]}),[u,p]=n.useState(0),[l,i]=n.useState(!1);n.useEffect(()=>{if(!d)return;const s=d.settings.busyBufferMinutes??0;p(s),i(!re.includes(s))},[d]);const j=D({mutationFn:async s=>(await U("PATCH","/api/availability/blocking-rules",s)).json(),onSuccess:()=>{L.invalidateQueries({queryKey:["/api/availability/weekly"]}),L.invalidateQueries({queryKey:["/api/availability/slots"]}),a({title:"Booking buffer saved"})},onError:s=>{a({title:"Couldn't save blocking rules",description:de(s)||"Please try again.",variant:"destructive"})}}),y=s=>{const g=Math.max(0,Math.min(240,Math.round(s)||0));p(g),g!==(d?.settings.busyBufferMinutes??0)&&j.mutate({busyBufferMinutes:g})};return e.jsx("div",{className:"rounded-lg border border-border/40 bg-card p-5","data-testid":"card-calendar-blocking-rules",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{className:"text-sm font-medium",children:"Time between bookings and calendar events"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(M,{value:l?"custom"
2:String(u),disabled:c,onValueChange:s=>{s==="custom"?i(!0):(i(!1),y(Number(s)))},children:[e.jsx(E,{className:"w-40","data-testid":"select-busy-buffer",children:e.jsx(I,{})}),e.jsxs(B,{children:[e.jsx(o,{value:"0",children:"No buffer"}),re.filter(s=>s>0).map(s=>e.jsxs(o,{value:String(s),children:[s," minutes"]},s)),e.jsx(o,{value:"custom",children:"Custom…"})]})]}),l&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("input",{type:"number",min:0,max:240,value:u,onChange:s=>p(Math.max(0,Math.min(240,Math.round(Number(s.target.value)||0)))),onBlur:s=>y(Number(s.target.value)),onKeyDown:s=>{s.key==="Enter"&&s.target.blur()},className:"h-9 w-20 rounded-md border border-input bg-background px-2 text-sm","data-testid":"input-busy-buffer-custom","aria-label":"Custom buffer minutes"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"min"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground max-w-md",children:"Adds breathing room before and after timed events from calendars set to block bookings. This applies to your consultation and session booking pages."})]})})}const Qe=[{color:"#a8836f",label:"Warm Blush"},{color:"#b8a9c9",label:"Lavender"},{color:"#93abcc",label:"Dusty Blue"},{color:"#a3c4a3",label:"Sage"},{color:"#d4a574",label:"Gold"},{color:"#000000",label:"Black"}],ne=[{id:"calendar",label:"Availability",hint:"Schedule & date changes",testId:"tab-calendar"},{id:"calendars",label:"Calendars",hint:"What blocks clients",testId:"tab-calendars"},{id:"branding",label:"Booking Page",hint:"Preview & share",testId:"tab-branding"}];function R({title:a,description:d,icon:c,testId:u,children:p}){return e.jsxs("section",{className:"rounded-xl border border-border/40 bg-card p-6 space-y-6","data-testid":u,children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center shrink-0",children:e.jsx(c,{className:"w-4 h-4 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-display text-lg font-light text-foreground",children:a}),e.jsx("p",{className:"text-sm text-muted-foreground/70 mt-0.5",children:d})]})]}),p]})}function Ve({hasAvailability:a,hasBookingPage:d,onStepClick:c}){const u=[{label:"Set Availability",icon:qe,complete:a,tab:"calendar",description:"Choose your weekly schedule"},{label:"Share Link",icon:ce,complete:d,tab:"branding",description:"Preview and share your page"}],p=u.filter(l=>l.complete).length;return p===u.length?null:e.jsxs("div",{className:"mb-6 rounded-lg border border-border/30 bg-muted/15 p-4","data-testid":"booking-flow-indicator",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Finish booking setup"}),e.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground",children:[p," of ",u.length," complete"]})]}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:u.map((l,i)=>{const j=l.icon;return e.jsxs("button",{type:"button",onClick:()=>c(l.tab),className:"flex items-start gap-2 rounded-md p-2 text-left transition-colors hover:bg-muted/40","data-testid":`flow-step-${i}`,children:[e.jsx("span",{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full ${l.complete?"bg-emerald-100 text-emerald-600 dark:bg-emerald-900/30 dark:text-emerald-400":"bg-muted text-muted-foreground"}`,children:l.complete?e.jsx(ze,{className:"h-3 w-3"}):e.jsx(j,{className:"h-3 w-3"})}),e.jsxs("span",{children:[e.jsx("span",{className:"block text-xs font-medium text-foreground",children:l.label}),e.jsx("span",{className:"block text-[10px] text-muted-foreground",children:l.description})]})]},l.label)})})]})}function Ca(){const{toast:a}=le(),[,d]=be(),[c,u]=n.useState(()=>{const r=new URLSearchParams(window.location.search).get("tab");return r==="branding"?"branding":r==="calendars"?"calendars":"calendar"}),p=Me("scheduling");n.useEffect(()=>{const t=new URLSearchParams(window.location.search);if(t.get("tab")!=="session-events")return;t.delete("tab");const r=t.toString();d(`/session-events${r?`?${r}`:""}`,{replace:!0})},[d]);const l=t=>{u(t);
2const r=new URL(window.location.href);t==="calendar"?r.searchParams.set("tab","availability"):r.searchParams.set("tab",t),window.history.replaceState({},"",r.toString())},i=x({queryKey:["/api/availability/booking-settings"]}),j=x({queryKey:["/api/availability/booking-link"]}),y=x({queryKey:["/api/crm/proposal-templates"]}),s=x({queryKey:["/api/crm/settings"]}),g=x({queryKey:["/api/google-calendar/status"],retry:!1}),A=x({queryKey:["/api/microsoft-calendar/status"],retry:!1}),me=(x({queryKey:["/api/availability/slots"]}).data?.length??0)>0,ue=!!(i.data?.businessName||i.data?.logoUrl),N=j.data?.url??null,O=N?`<iframe src="${N}?embed=1" width="100%" height="720" frameborder="0" style="border:none;max-width:640px;margin:0 auto;display:block"></iframe>`:"",b=n.useRef(null),[k,H]=n.useState(!1),[F,Y]=n.useState(""),[_,Z]=n.useState(""),[w,q]=n.useState(""),[C,z]=n.useState("#a8836f"),[K,X]=n.useState("Consultation"),[S,Q]=n.useState(null),[h,V]=n.useState("none"),[J,ee]=n.useState(0),[te,ae]=n.useState("off");n.useEffect(()=>{if(i.data){const t=i.data.logoUrl||"",r=s.data?.logoUrl||"";Y(i.data.businessName||""),Z(i.data.tagline||""),q(t||r),z(i.data.accentColor||"#a8836f"),X(i.data.consultationType||"Consultation"),Q(i.data.autoProposalTemplateId||null),V(Ee(i.data.meetingProvider,i.data.zoomEnabled||!1)),ee(i.data.minimumNoticeMinutes??0),ae(oe(i.data.purposeFieldMode))}},[i.data,s.data]),n.useEffect(()=>{const t=new URLSearchParams(window.location.search),r=t.get("gcal");if(r==="connected")V("google_meet"),L.refetchQueries({queryKey:["/api/google-calendar/status"]}),U("POST","/api/availability/booking-settings",{meetingProvider:"google_meet"}).then(()=>L.refetchQueries({queryKey:["/api/availability/booking-settings"]})).then(()=>a({title:"Google Calendar connected",description:"Google Meet is ready for new bookings."})).catch(()=>a({title:"Google Calendar connected",description:"Select Google Meet and save your booking settings to finish setup."}));else if(r==="error")a({title:"Google Calendar connection failed",variant:"destructive"});else return;t.delete("gcal"),t.delete("reason");const v=t.toString();window.history.replaceState({},"",`${window.location.pathname}${v?`?${v}`:""}`)},[a]);const $=D({mutationFn:async()=>(await U("GET","/api/google-calendar/connect")).json(),onSuccess:({url:t})=>{window.location.href=t},onError:()=>a({title:"Failed to start Google Calendar connection",variant:"destructive"})});async function pe(t){const r=t.target.files?.[0];if(r)try{const{uploadImageToServer:v,validateFile:ge}=await je(async()=>{const{uploadImageToServer:he,validateFile:xe}=await import("./use-upload-BhuNLqHD.js");return{uploadImageToServer:he,validateFile:xe}},__vite__mapDeps([0,1,2,3])),se=ge(r,{accept:"image"});if(se){a({title:"Upload Error",description:se,variant:"destructive"}),b.current&&(b.current.value="");return}H(!0);const P=await v(r,"standard");if("error"in P){a({title:"Logo upload failed",description:P.error,variant:"destructive"});return}P.resizedNotice&&a(P.resizedNotice),q(P.objectPath),a({title:"Logo uploaded"})}catch(v){a({title:"Logo upload failed",description:de(v)||"We couldn't upload that logo. Please try again.",variant:"destructive"})}finally{H(!1),b.current&&(b.current.value="")}}const W=D({mutationFn:async t=>(await U("POST","/api/availability/booking-settings",t)).json(),onSuccess:()=>{L.refetchQueries({queryKey:["/api/availability/booking-settings"]}),a({title:"Booking page settings saved"})}});return p?e.jsxs("div",{className:"max-w-5xl mx-auto px-6 sm:px-8 py-16 text-center","data-testid":"scheduling-no-access",children:[e.jsx(Be,{className:"w-12 h-12 text-muted-foreground/40 mx-auto mb-4"}),e.jsx("h1",{className:"font-display text-2xl font-light tracking-tight text-foreground mb-2",children:"Access Restricted"}),e.jsx("p",{className:"text-sm text-muted-foreground/70",children:"You don't have access to the Scheduling page. Contact your administrator if you believe this is an error."})]}):e.jsxs("div",{className:"max-w-5xl mx-auto px-6 sm:px-8 py-8",children:[e.jsx(ke,{title:"What is this?",description:"Set the hours clients can book, decide which calendar events make you busy, and preview the public page before you share it.",guideSlug:"scheduling",storageKey:"scheduling",steps:["Set a weekly schedule once; new dates continue appearing automatically.","Choose whether each calendar blocks no events, timed events, or timed and all-day events.","Preview what clients see, then copy and share your booking link."]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("p",{className:"text-[11px] tracking-[0.3em] uppercase text-muted-foreground
2/70 mb-2",children:"Scheduling"}),e.jsxs("h1",{className:"font-display text-3xl font-light tracking-tight text-foreground flex items-center gap-2","data-testid":"text-scheduling-title",children:["Booking Hub"," ",e.jsx(Ne,{text:"Manage your availability, the calendars that block it, and your public booking page. Mini sessions live on the Session Events page.",pageId:"scheduling"})]}),e.jsx("p",{className:"text-sm text-muted-foreground/80 leading-relaxed mt-2",children:"Set your normal schedule once, decide what should block it, and preview exactly what clients can book."})]}),e.jsx(Ve,{hasAvailability:me,hasBookingPage:ue,onStepClick:l}),e.jsx(we,{sections:ne.map(t=>({value:t.id,label:t.label})),value:c,onValueChange:t=>l(t),ariaLabel:"Scheduling section",testId:"select-scheduling-section",className:"mb-6"}),e.jsx("div",{className:"hidden sm:flex flex-wrap gap-1 mb-6 border-b border-border/40",children:ne.map(t=>e.jsxs("button",{onClick:()=>l(t.id),className:`px-4 py-2.5 transition-colors relative text-left shrink-0 ${c===t.id?"text-foreground":"text-muted-foreground hover:text-foreground/70"}`,"data-testid":t.testId,children:[e.jsx("span",{className:"text-sm",children:t.label}),e.jsx("span",{className:"block text-[11px] text-muted-foreground font-normal leading-tight mt-0.5",children:t.hint}),c===t.id&&e.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-foreground"})]},t.id))}),c==="calendar"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx(Se,{apiPrefix:"/api",zoomPrefix:"/api/availability",hideZoom:!0,defaultView:"weekly"}),e.jsxs("p",{className:"text-xs text-muted-foreground max-w-2xl",children:["Connected calendars and blocking rules live on the"," ",e.jsx("button",{type:"button",onClick:()=>l("calendars"),className:"underline underline-offset-2 hover:text-foreground","data-testid":"link-availability-to-calendars",children:"Calendars"})," ","tab. Video meeting links are set on the Booking Page tab."]})]}),c==="calendars"&&e.jsxs("div",{className:"max-w-2xl space-y-8",children:[e.jsxs("div",{className:"space-y-4","data-testid":"section-scheduling-calendar-sync",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-display text-xl font-light text-foreground mb-1",children:"Calendar setup"}),e.jsx("p",{className:"text-sm text-muted-foreground/70",children:"First choose where new bookings are added. Then choose which calendars are checked before a client can book."})]}),e.jsx(Te,{})]}),e.jsxs("div",{className:"space-y-4","data-testid":"section-scheduling-blocking-rules",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-display text-xl font-light text-foreground mb-1",children:"Booking Buffer"}),e.jsx("p",{className:"text-sm text-muted-foreground/70",children:"Optionally leave extra time before and after timed calendar events. Changes save automatically."})]}),e.jsx(Ke,{})]})]}),c==="branding"&&e.jsxs("div",{className:"max-w-2xl space-y-6",children:[e.jsxs("p",{className:"text-sm text-muted-foreground/70",children:["Everything here shapes the public page clients book from. Changes apply when you press"," ",e.jsx("span",{className:"text-foreground",children:"Save Settings"})," at the bottom."]}),N&&e.jsxs(R,{title:"Share Your Page",description:"Send clients straight to your booking page, or embed it on your own website.",icon:ce,testId:"section-booking-share",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{className:"text-xs tracking-[0.15em] uppercase text-muted-foreground/70",children:"Direct Link"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{readOnly:!0,value:N,onFocus:t=>t.currentTarget.select(),className:"font-mono text-xs","data-testid":"input-booking-link"}),e.jsxs(f,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>{navigator.clipboard.writeText(N),a({title:"Booking link copied"})},"data-testid":"button-copy-booking-link",children:[e.jsx(Le,{className:"w-3.5 h-3.5 mr-1"})," Copy"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{className:"text-xs tracking-[0.15em] uppercase text-muted-foreground/70",children:"Embed on your website"}
2),e.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Works with Squarespace, Wix, WordPress, Showit, and any site that allows HTML embeds. Paste this where you want the scheduler to appear."}),e.jsxs("div",{className:"relative",children:[e.jsx("pre",{className:"bg-muted/40 rounded-lg p-3 pr-20 text-[11px] text-muted-foreground overflow-x-auto whitespace-pre-wrap break-all font-mono leading-relaxed border border-border/10","data-testid":"text-booking-embed",children:O}),e.jsxs(f,{variant:"outline",size:"sm",className:"absolute top-2 right-2",onClick:()=>{navigator.clipboard.writeText(O),a({title:"Embed code copied"})},"data-testid":"button-copy-booking-embed",children:[e.jsx(Ae,{className:"w-3.5 h-3.5 mr-1"})," Copy"]})]})]})]}),e.jsxs(R,{title:"Look & Feel",description:"Your name, logo, and color, the way clients will see them.",icon:Fe,testId:"section-booking-look",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"business-name",className:"text-sm font-medium",children:"Business Name"}),e.jsx(T,{id:"business-name",value:F,onChange:t=>Y(t.target.value),placeholder:"e.g. Sarah Mitchell Photography","data-testid":"input-business-name"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"tagline",className:"text-sm font-medium",children:"Tagline"}),e.jsx(T,{id:"tagline",value:_,onChange:t=>Z(t.target.value),placeholder:"e.g. Timeless moments, beautifully captured","data-testid":"input-tagline"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{className:"text-sm font-medium",children:"Logo"}),e.jsx("input",{ref:b,type:"file",accept:"image/png,image/jpeg,image/svg+xml,image/webp,image/gif",className:"hidden",onChange:pe,"data-testid":"input-logo-file"}),w?e.jsx("div",{className:"p-4 bg-muted/30 rounded-lg border border-border/30",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("img",{src:w,alt:"Logo preview",className:"max-h-16 max-w-[200px] object-contain","data-testid":"img-logo-preview",onError:t=>{t.target.style.display="none"}}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsxs(f,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:()=>b.current?.click(),disabled:k,"data-testid":"button-change-logo",children:[k?e.jsx(G,{className:"w-3 h-3 animate-spin mr-1"}):e.jsx(ie,{className:"w-3 h-3 mr-1"}),"Change"]}),e.jsxs(f,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:()=>q(""),"data-testid":"button-remove-logo",children:[e.jsx(_e,{className:"w-3 h-3 mr-1"}),"Remove"]})]})]})}):e.jsxs("button",{type:"button",onClick:()=>b.current?.click(),disabled:k,className:"w-full rounded-lg border-2 border-dashed border-border/50 hover:border-border/80 transition-colors p-6 text-center cursor-pointer","data-testid":"button-upload-logo",children:[k?e.jsx(G,{className:"w-6 h-6 text-muted-foreground/40 mx-auto mb-2 animate-spin"}):e.jsx(ie,{className:"w-6 h-6 text-muted-foreground/40 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-muted-foreground/70",children:k?"Uploading...":"Upload your logo"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"PNG, SVG, or JPG · Large images are resized automatically"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(m,{className:"text-sm font-medium",children:"Accent Color"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[Qe.map(t=>e.jsx("button",{onClick:()=>z(t.color),className:`w-10 h-10 rounded-full border-2 transition-all ${C===t.color?"border-foreground scale-110":"border-border/40 hover:border-border"}`,style:{backgroundColor:t.color},title:t.label,"data-testid":`button-color-${t.label.toLowerCase().replace(/\s/g,"-")}`},t.color)),e.jsxs("div",{className:"flex items-center gap-2 ml-2",children:[e.jsx(T,{type:"color",value:C,onChange:t=>z(t.target.value),className:"w-10 h-10 p-1 rounded cursor-pointer","data-testid":"input-custom-color"}),e.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:C})]})]})]}),e.jsxs("div",{className:"p-5 bg-muted/20 rounded-lg border border-border/30","data-testid":"booking-page-preview",children:[e.jsx("h3",{className:"text-xs tracking-[0.15em] uppercase text-muted-foreground
2/70 mb-3",children:"Preview"}),e.jsxs("div",{className:"bg-[#faf6f3] rounded-lg p-8 text-center space-y-3",children:[w?e.jsx("img",{src:w,alt:"Logo",className:"h-10 mx-auto object-contain"}):e.jsx("div",{className:"h-10 flex items-center justify-center",children:e.jsx(Ge,{className:"w-8 h-8 text-muted-foreground/50"})}),F&&e.jsx("h4",{className:"font-display text-lg font-light text-foreground",children:F}),_&&e.jsx("p",{className:"text-xs text-muted-foreground",children:_}),e.jsx("div",{className:"pt-2",children:e.jsxs("span",{className:"inline-block px-6 py-2 rounded-full text-white text-sm",style:{backgroundColor:C},children:["Book a ",K||"Consultation"]})})]})]})]}),e.jsxs(R,{title:"Booking Rules",description:"What the page calls the meeting, how soon clients can book, and what you ask them up front.",icon:Re,testId:"section-booking-rules",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"consultation-type",className:"text-sm font-medium",children:"Consultation Type Label"}),e.jsx(T,{id:"consultation-type",value:K,onChange:t=>X(t.target.value),placeholder:"e.g. Consultation, Discovery Call, Meeting","data-testid":"input-consultation-type"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This label appears on your booking page heading."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"minimum-notice",className:"text-sm font-medium",children:"Minimum Booking Notice"}),e.jsxs(M,{value:String(J),onValueChange:t=>ee(Number(t)),children:[e.jsx(E,{id:"minimum-notice","data-testid":"select-minimum-notice",children:e.jsx(I,{})}),e.jsxs(B,{children:[e.jsx(o,{value:"0",children:"No minimum"}),e.jsx(o,{value:"30",children:"30 minutes"}),e.jsx(o,{value:"60",children:"1 hour"}),e.jsx(o,{value:"120",children:"2 hours"}),e.jsx(o,{value:"180",children:"3 hours"}),e.jsx(o,{value:"360",children:"6 hours"}),e.jsx(o,{value:"720",children:"12 hours"}),e.jsx(o,{value:"1440",children:"1 day"}),e.jsx(o,{value:"2880",children:"2 days"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"How far in advance a client must book. Slots starting sooner than this are hidden, so no one can grab a last-minute time."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"purpose-field-mode",className:"text-sm font-medium",children:"Ask What the Call Is About"}),e.jsxs(M,{value:te,onValueChange:t=>ae(oe(t)),children:[e.jsx(E,{id:"purpose-field-mode","data-testid":"select-purpose-field-mode",children:e.jsx(I,{})}),e.jsxs(B,{children:[e.jsx(o,{value:"off",children:"Don't ask"}),e.jsx(o,{value:"optional",children:"Ask, but let them skip it"}),e.jsx(o,{value:"required",children:"Require an answer"})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:['Adds "',Ie,'" to your booking page. Their answer lands in your booking notification, on the calendar event, and on the meeting agenda, so you walk in knowing what they need.']})]})]}),e.jsxs(R,{title:"After Someone Books",description:"What happens automatically the moment a client confirms a time.",icon:Ue,testId:"section-booking-after",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(m,{className:"text-sm font-medium",children:"Video Meeting"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"The video link created automatically for each new booking."})]}),e.jsxs(M,{value:h,onValueChange:t=>V(t),children:[e.jsx(E,{className:"w-full","data-testid":"select-meeting-provider",children:e.jsx(I,{placeholder:"Choose a meeting provider"})}),e.jsxs(B,{children:[e.jsx(o,{value:"google_meet",children:"Google Meet"}),e.jsx(o,{value:"zoom",children:"Zoom"}),e.jsx(o,{value:"teams",children:"Microsoft Teams"}),e.jsx(o,{value:"none",children:"No video meeting"})]})]}),h==="google_meet"&&g.data?.connected&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["New bookings will get a unique Google Meet link through"," ",g.data.googleEmail||"your connected Google account","."]}),h==="google_meet"&&!g.data?.connected&&e.jsxs("div",{className:"rounded-md border border-border/40 bg-muted/20 p-3 space-y-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Connect Google Calendar to create Google Meet links and add bookings to your calendar."}),e.jsxs(f,{type:"button",variant:"outline",size:"sm",onClick:()=>$.mutate(),disabled:$.isPending,"data-testid":"button-connect-google-meet",children:[$.isPending?e.jsx(G,{className:"w-3.5 h-3.5 animate-spin mr-2"}):null,"Connect Google Calendar"]})]}),h==="teams"&&A.data?.connected&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["New bookings will get a Microsoft Teams link through"," ",A.data.accountLabel||"your connected Microsoft 365 account","."]}),h==="teams"&&!A.data?.connected&&e.jsxs("div",{className:"rounded-md border border-border/40 bg-muted/20 p-3 space-y-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Connect Microsoft 365 to create Teams links and add bookings to your Outlook calendar."}),e.jsx(f,{asChild:!0,type:"button",variant:"outline",size:"sm",children:e.jsx("a",{href:"/api/integrations/microsoft/connect","data-testid":"link-connect-microsoft-teams",children:"Connect Microsoft 365"})})]}),h==="zoom"&&e.jsx(Pe,{zoomPrefix:"/api/availability"})]}),e.jsxs("div",{className:"space-y-2 pt-4 border-t border-border/30",children:[e.jsxs("div",{children:[e.jsx(m,{className:"text-sm font-medium",children:"Auto-Send Proposal"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Send a proposal the moment someone books. Ideal for mini sessions and fixed-price offerings."})]}),y.data&&y.data.length>0?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(M,{value:S?String(S):"none",onValueChange:t=>Q(t==="none"?null:parseInt(t)),children:[e.jsx(E,{className:"w-full","data-testid":"select-auto-proposal-template",children:e.jsx(I,{placeholder:"Select a proposal template"})}),e.jsxs(B,{children:[e.jsx(o,{value:"none",children:"No auto-proposal"}),y.data.map(t=>e.jsxs(o,{value:String(t.id),children:[t.name," ",t.totalAmount>0?`· $${(t.totalAmount/100).toFixed(0)}`:""]},t.id))]})]}),S&&e.jsx(f,{variant:"ghost",size:"icon","aria-label":"Clear",className:"shrink-0 h-9 w-9",onClick:()=>Q(null),"data-testid":"button-clear-auto-proposal",children:e.jsx(fe,{className:"w-4 h-4"})})]}):e.jsx(Ce,{variant:"compact",icon:ye,title:"No proposal templates yet",description:"Auto-send needs a saved proposal to send. Build one once and every new booking gets it the moment they confirm.",primaryAction:{label:"Create a proposal template",href:"/proposal-builder/new?mode=template",testId:"link-create-proposal-template"},className:"rounded-lg border border-dashed border-border/50",testId:"empty-state-proposal-templates"}),S&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"When someone books, they'll see this proposal right after confirming. A client contact is auto-created."})]})]}),e.jsxs("div",{className:"sticky bottom-0 -mx-6 sm:-mx-8 px-6 sm:px-8 py-3 bg-background/95 backdrop-blur border-t border-border/30 flex items-center justify-between gap-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:h==="google_meet"&&!g.data?.connected?"Connect Google Calendar above to save with Google Meet selected.":"Saves every section on this tab."}),e.jsxs(ve,{onClick:()=>W.mutate({businessName:F,tagline:_,logoUrl:w,accentColor:C,consultationType:K,autoProposalTemplateId:S,meetingProvider:h,minimumNoticeMinutes:J,purposeFieldMode:te}
2),disabled:W.isPending||h==="google_meet"&&!g.data?.connected||h==="teams"&&!A.data?.connected,className:"bg-primary hover:bg-primary/90","data-testid":"button-save-branding",children:[W.isPending?e.jsx(G,{className:"w-4 h-4 animate-spin mr-2"}):null,"Save Settings"]})]})]})]})}export{Ca 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.