{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "contact-booking-calendar",
  "type": "registry:component",
  "title": "Contact Booking Calendar",
  "description": "A light booking section: host card, a month calendar with open days, time slots that cascade in, then a validated details form with loading and confirmation states.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "contact",
    "contact",
    "booking",
    "calendar",
    "schedule",
    "form",
    "light"
  ],
  "docs": "https://hyperblur.dev/effects/contact-booking-calendar",
  "files": [
    {
      "path": "registry/hyperblur/contact-booking-calendar.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/contact-booking-calendar.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface ContactBookingHost {\n  name: string;\n  role: string;\n  initials: string;\n}\n\nexport interface ContactBookingValues {\n  date: string;\n  time: string;\n  name: string;\n  email: string;\n  notes: string;\n}\n\nexport interface ContactBookingCalendarProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\" | \"onSubmit\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  host?: ContactBookingHost;\n  duration?: string;\n  timezone?: string;\n  year?: number;\n  month?: number;\n  defaultDay?: number;\n  slots?: string[];\n  points?: string[];\n  onSubmit?: (values: ContactBookingValues) => void | Promise<unknown>;\n  accent?: string;\n}\n\nconst monthNames = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\nconst weekNames = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\nconst longWeek = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n\nconst defaultSlots = [\"09:00\", \"09:30\", \"10:30\", \"11:00\", \"13:30\", \"14:00\", \"15:30\", \"16:30\"];\n\nconst css = `\n.hb-yi1 {\n  --hb-yi1-accent: #e2553f;\n  container-type: inline-size;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  overflow: hidden;\n  background: #f7f5ef;\n  color: #1b1a17;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-yi1 *, .hb-yi1 *::before, .hb-yi1 *::after { box-sizing: border-box; }\n.hb-yi1::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  pointer-events: none;\n  background-image: radial-gradient(rgba(27, 26, 23, .07) 1px, transparent 1px);\n  background-size: 22px 22px;\n  mask-image: linear-gradient(180deg, #000, transparent 70%);\n}\n.hb-yi1-inner { position: relative; max-width: 1120px; margin: 0 auto; padding: 72px 20px 80px; }\n.hb-yi1-head { max-width: 620px; }\n.hb-yi1-eyebrow {\n  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px;\n  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--hb-yi1-accent);\n}\n.hb-yi1-eyebrow::before { content: \"\"; width: 18px; height: 1px; background: currentColor; }\n.hb-yi1-title { margin: 0; font-size: clamp(30px, 5.2cqi, 50px); line-height: 1.04; letter-spacing: -.035em; font-weight: 600; }\n.hb-yi1-sub { margin: 16px 0 0; font-size: 16px; line-height: 1.6; color: #6b675e; }\n.hb-yi1-card {\n  display: grid; grid-template-columns: 1fr; margin-top: 40px;\n  background: #fff; border: 1px solid rgba(27, 26, 23, .1); border-radius: 20px;\n  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 30px 60px -30px rgba(27, 26, 23, .25), 0 2px 6px rgba(27, 26, 23, .04);\n  overflow: hidden;\n  animation: hb-yi1-rise .7s cubic-bezier(.2, .8, .2, 1) both;\n}\n.hb-yi1-info { padding: 24px; border-bottom: 1px solid rgba(27, 26, 23, .08); background: linear-gradient(180deg, #fbfaf6, #fff); }\n.hb-yi1-host { display: flex; align-items: center; gap: 12px; }\n.hb-yi1-avatar {\n  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none;\n  color: #fff; font-weight: 600; font-size: 15px;\n  background: linear-gradient(135deg, var(--hb-yi1-accent), color-mix(in srgb, var(--hb-yi1-accent) 55%, #3b1d78));\n  box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(27, 26, 23, .1);\n}\n.hb-yi1-host p { margin: 0; }\n.hb-yi1-host-name { font-weight: 600; font-size: 15px; }\n.hb-yi1-host-role { font-size: 13px; color: #6b675e; margin-top: 2px !important; }\n.hb-yi1-meeting { margin: 22px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }\n.hb-yi1-facts { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }\n.hb-yi1-facts li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #4a473f; }\n.hb-yi1-facts svg { width: 16px; height: 16px; color: #8c877b; flex: none; }\n.hb-yi1-picked {\n  margin-top: 18px; padding: 12px 14px; border-radius: 12px;\n  background: color-mix(in srgb, var(--hb-yi1-accent) 9%, #fff); border: 1px solid color-mix(in srgb, var(--hb-yi1-accent) 25%, transparent);\n  font-size: 13px; color: #3a372f; line-height: 1.45;\n}\n.hb-yi1-picked b { display: block; color: color-mix(in srgb, var(--hb-yi1-accent) 80%, #000); font-size: 14px; }\n.hb-yi1-points { list-style: none; padding: 18px 0 0; margin: 18px 0 0; border-top: 1px dashed rgba(27, 26, 23, .14); display: none; gap: 8px; }\n.hb-yi1-points li { position: relative; padding-left: 20px; font-size: 13px; color: #6b675e; line-height: 1.5; }\n.hb-yi1-points li::before { content: \"\"; position: absolute; left: 2px; top: 7px; width: 7px; height: 7px; border-radius: 2px; background: var(--hb-yi1-accent); transform: rotate(45deg); }\n.hb-yi1-cal { padding: 22px 20px 24px; }\n.hb-yi1-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }\n.hb-yi1-cal-head h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }\n.hb-yi1-nav { display: flex; gap: 6px; }\n.hb-yi1-navbtn {\n  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; border: 1px solid rgba(27, 26, 23, .12);\n  background: #fff; color: #1b1a17; cursor: pointer; transition: background .2s, border-color .2s, opacity .2s;\n}\n.hb-yi1-navbtn:hover:not(:disabled) { background: #f4f2ec; }\n.hb-yi1-navbtn:disabled { opacity: .35; cursor: not-allowed; }\n.hb-yi1-navbtn svg { width: 14px; height: 14px; }\n.hb-yi1-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }\n.hb-yi1-wd { text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #9a9588; padding: 4px 0 8px; }\n.hb-yi1-day {\n  position: relative; aspect-ratio: 1; min-height: 34px; border: 0; border-radius: 10px; padding: 0;\n  font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; color: #b5b0a3; background: transparent; cursor: default;\n  transition: background .2s, color .2s, transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s;\n}\n.hb-yi1-day[data-open=\"true\"] {\n  cursor: pointer; color: color-mix(in srgb, var(--hb-yi1-accent) 85%, #000); font-weight: 600;\n  background: color-mix(in srgb, var(--hb-yi1-accent) 10%, #fff);\n}\n.hb-yi1-day[data-open=\"true\"]:hover { background: color-mix(in srgb, var(--hb-yi1-accent) 18%, #fff); transform: translateY(-1px); }\n.hb-yi1-day[data-on=\"true\"] {\n  color: #fff; background: var(--hb-yi1-accent);\n  box-shadow: 0 8px 18px -8px var(--hb-yi1-accent), 0 1px 0 rgba(255, 255, 255, .35) inset;\n}\n.hb-yi1-day[data-on=\"true\"]:hover { background: var(--hb-yi1-accent); }\n.hb-yi1-day:focus-visible, .hb-yi1-slot:focus-visible, .hb-yi1-navbtn:focus-visible, .hb-yi1-btn:focus-visible, .hb-yi1-back:focus-visible {\n  outline: 2px solid var(--hb-yi1-accent); outline-offset: 2px;\n}\n.hb-yi1-tz { margin: 14px 0 0; font-size: 12px; color: #8c877b; display: flex; align-items: center; gap: 6px; }\n.hb-yi1-tz svg { width: 14px; height: 14px; }\n.hb-yi1-side { padding: 22px 20px 24px; border-top: 1px solid rgba(27, 26, 23, .08); display: flex; flex-direction: column; }\n.hb-yi1-side h4 { margin: 0 0 12px; font-size: 14px; font-weight: 600; }\n.hb-yi1-side h4 span { color: #8c877b; font-weight: 500; }\n.hb-yi1-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }\n.hb-yi1-slot {\n  height: 42px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--hb-yi1-accent) 30%, rgba(27, 26, 23, .12));\n  background: #fff; color: color-mix(in srgb, var(--hb-yi1-accent) 85%, #000); font: inherit; font-size: 14px; font-weight: 600;\n  font-variant-numeric: tabular-nums; cursor: pointer;\n  animation: hb-yi1-slot .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--hb-yi1-i) * 45ms);\n  transition: background .2s, color .2s, border-color .2s, transform .2s;\n}\n.hb-yi1-slot:hover { border-color: var(--hb-yi1-accent); transform: translateY(-1px); }\n.hb-yi1-slot[aria-pressed=\"true\"] { background: #1b1a17; border-color: #1b1a17; color: #fff; }\n.hb-yi1-empty { font-size: 13px; color: #8c877b; padding: 18px 0; }\n.hb-yi1-actions { margin-top: auto; padding-top: 18px; display: flex; gap: 10px; align-items: center; }\n.hb-yi1-btn {\n  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; flex: 1;\n  border: 0; border-radius: 999px; background: #1b1a17; color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;\n  box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 10px 24px -12px rgba(27, 26, 23, .6);\n  transition: transform .2s, background .2s, opacity .2s;\n}\n.hb-yi1-btn:hover:not(:disabled) { transform: translateY(-1px); background: #000; }\n.hb-yi1-btn:disabled { opacity: .4; cursor: not-allowed; }\n.hb-yi1-btn[data-loading=\"true\"] { cursor: progress; }\n.hb-yi1-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: hb-yi1-spin .7s linear infinite; }\n.hb-yi1-back {\n  height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(27, 26, 23, .14); background: #fff; color: #1b1a17;\n  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;\n}\n.hb-yi1-back:hover { background: #f4f2ec; }\n.hb-yi1-form { display: grid; gap: 14px; animation: hb-yi1-slot .45s cubic-bezier(.2, .8, .2, 1) both; }\n.hb-yi1-field { display: grid; gap: 6px; }\n.hb-yi1-field label { font-size: 13px; font-weight: 600; color: #3a372f; }\n.hb-yi1-field input, .hb-yi1-field textarea {\n  width: 100%; border-radius: 10px; border: 1px solid rgba(27, 26, 23, .16); background: #fdfcf9; color: #1b1a17;\n  font: inherit; font-size: 14px; padding: 11px 12px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s;\n}\n.hb-yi1-field textarea { resize: vertical; min-height: 84px; }\n.hb-yi1-field input:focus, .hb-yi1-field textarea:focus {\n  border-color: var(--hb-yi1-accent); background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--hb-yi1-accent) 16%, transparent);\n}\n.hb-yi1-field[data-invalid=\"true\"] input { border-color: #c2412d; }\n.hb-yi1-err { font-size: 12px; color: #c2412d; }\n.hb-yi1-done { display: grid; justify-items: center; text-align: center; padding: 28px 8px; gap: 10px; animation: hb-yi1-slot .5s cubic-bezier(.2, .8, .2, 1) both; }\n.hb-yi1-check { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--hb-yi1-accent) 12%, #fff); color: var(--hb-yi1-accent); }\n.hb-yi1-check svg { width: 30px; height: 30px; }\n.hb-yi1-check path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: hb-yi1-draw .6s .15s ease-out forwards; }\n.hb-yi1-done h4 { margin: 6px 0 0; font-size: 20px; letter-spacing: -.02em; }\n.hb-yi1-done p { margin: 0; font-size: 14px; color: #6b675e; max-width: 300px; line-height: 1.55; }\n@keyframes hb-yi1-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }\n@keyframes hb-yi1-slot { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }\n@keyframes hb-yi1-spin { to { transform: rotate(360deg); } }\n@keyframes hb-yi1-draw { to { stroke-dashoffset: 0; } }\n@container (min-width: 760px) {\n  .hb-yi1-inner { padding: 104px 32px 112px; }\n  .hb-yi1-card { grid-template-columns: 250px minmax(0, 1fr) 230px; }\n  .hb-yi1-info { border-bottom: 0; border-right: 1px solid rgba(27, 26, 23, .08); padding: 28px 26px; }\n  .hb-yi1-cal { padding: 28px 28px 30px; }\n  .hb-yi1-side { border-top: 0; border-left: 1px solid rgba(27, 26, 23, .08); padding: 28px 22px 30px; }\n  .hb-yi1-slots { grid-template-columns: 1fr; }\n  .hb-yi1-points { display: grid; }\n  .hb-yi1-card[data-step=\"details\"], .hb-yi1-card[data-step=\"done\"] { grid-template-columns: 250px minmax(0, 1fr); }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-yi1-card, .hb-yi1-slot, .hb-yi1-form, .hb-yi1-done, .hb-yi1-check path { animation: none; stroke-dashoffset: 0; }\n  .hb-yi1-day, .hb-yi1-slot, .hb-yi1-btn, .hb-yi1-navbtn { transition: none; }\n}\n`;\n\nfunction hash(n: number) {\n  let x = (n + 0x6d2b79f5) | 0;\n  x = Math.imul(x ^ (x >>> 15), x | 1);\n  x ^= x + Math.imul(x ^ (x >>> 7), x | 61);\n  return (x ^ (x >>> 14)) >>> 0;\n}\n\nfunction weekday(y: number, m: number, d: number) {\n  const t = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4];\n  const yy = m < 2 ? y - 1 : y;\n  return (yy + Math.floor(yy / 4) - Math.floor(yy / 100) + Math.floor(yy / 400) + t[m] + d) % 7;\n}\n\nfunction daysIn(y: number, m: number) {\n  const leap = (y % 4 === 0 && y % 100 !== 0) || y % 400 === 0;\n  return [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][m];\n}\n\nfunction isOpen(y: number, m: number, d: number, first: number) {\n  const wd = weekday(y, m, d);\n  if (wd === 0 || wd === 6) return false;\n  if (d < first) return false;\n  return hash(y * 400 + m * 32 + d) % 5 !== 0;\n}\n\nfunction slotsFor(y: number, m: number, d: number, all: string[]) {\n  return all.filter((_, i) => hash(y * 9000 + m * 300 + d * 11 + i) % 3 !== 0);\n}\n\nfunction Icon({ d }: { d: string }) {\n  return (\n    <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n      <path d={d} />\n    </svg>\n  );\n}\n\nconst emailOk = (v: string) => /^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$/.test(v.trim());\n\nexport function ContactBookingCalendar({\n  eyebrow = \"Book a walkthrough\",\n  title = \"Pick a time. We will bring the coffee.\",\n  subtitle = \"A 30 minute call with someone from the product team. Bring your messiest workflow and we will map it live.\",\n  host = { name: \"Marta Okafor\", role: \"Solutions lead, Fieldnote\", initials: \"MO\" },\n  duration = \"30 min\",\n  timezone = \"Lisbon, GMT+0\",\n  year = 2026,\n  month = 10,\n  defaultDay = 12,\n  slots = defaultSlots,\n  points = [\"A tailored tour of your use case\", \"Migration plan from your current tool\", \"Pricing for teams over 50 seats\"],\n  onSubmit,\n  accent = \"#e2553f\",\n  className = \"\",\n  style,\n  ...rest\n}: ContactBookingCalendarProps) {\n  const [view, setView] = React.useState({ y: year, m: month });\n  const [day, setDay] = React.useState<{ y: number; m: number; d: number } | null>(() => {\n    const last = daysIn(year, month);\n    for (let d = defaultDay; d <= last; d++) {\n      if (isOpen(year, month, d, 3)) return { y: year, m: month, d };\n    }\n    return null;\n  });\n  const [time, setTime] = React.useState<string | null>(null);\n  const [step, setStep] = React.useState<\"pick\" | \"details\" | \"done\">(\"pick\");\n  const [values, setValues] = React.useState({ name: \"\", email: \"\", notes: \"\" });\n  const [tried, setTried] = React.useState(false);\n  const [loading, setLoading] = React.useState(false);\n  const dayRefs = React.useRef<Map<number, HTMLButtonElement>>(new Map());\n  const timer = React.useRef<number | undefined>(undefined);\n  const nameId = React.useId();\n\n  React.useEffect(() => () => window.clearTimeout(timer.current), []);\n\n  const firstOpen = view.y === year && view.m === month ? 3 : 1;\n  const total = daysIn(view.y, view.m);\n  const lead = (weekday(view.y, view.m, 1) + 6) % 7;\n  const cells: (number | null)[] = [...Array.from({ length: lead }, () => null), ...Array.from({ length: total }, (_, i) => i + 1)];\n  const canPrev = view.y > year || (view.y === year && view.m > month);\n  const daySlots = day ? slotsFor(day.y, day.m, day.d, slots) : [];\n  const dayLabel = day ? `${longWeek[weekday(day.y, day.m, day.d)]}, ${monthNames[day.m]} ${day.d}` : \"\";\n  const errors = {\n    name: values.name.trim().length < 2 ? \"Tell us your name.\" : \"\",\n    email: emailOk(values.email) ? \"\" : \"Enter a valid work email.\",\n  };\n\n  const shift = (delta: number) => {\n    setView((v) => {\n      const m = v.m + delta;\n      return { y: v.y + Math.floor(m / 12), m: ((m % 12) + 12) % 12 };\n    });\n  };\n\n  const pickDay = (d: number) => {\n    setDay({ y: view.y, m: view.m, d });\n    setTime(null);\n  };\n\n  const onGridKey = (e: React.KeyboardEvent, d: number) => {\n    const moves: Record<string, number> = { ArrowLeft: -1, ArrowRight: 1, ArrowUp: -7, ArrowDown: 7 };\n    const dir = moves[e.key];\n    if (!dir) return;\n    e.preventDefault();\n    let next = d + dir;\n    while (next >= 1 && next <= total) {\n      if (isOpen(view.y, view.m, next, firstOpen)) {\n        dayRefs.current.get(next)?.focus();\n        return;\n      }\n      next += dir > 0 ? 1 : -1;\n    }\n  };\n\n  const submit = async (e: React.FormEvent) => {\n    e.preventDefault();\n    setTried(true);\n    if (errors.name || errors.email || !day || !time || loading) return;\n    setLoading(true);\n    const date = `${day.y}-${String(day.m + 1).padStart(2, \"0\")}-${String(day.d).padStart(2, \"0\")}`;\n    try {\n      await onSubmit?.({ date, time, name: values.name.trim(), email: values.email.trim(), notes: values.notes.trim() });\n    } catch {\n      setLoading(false);\n      return;\n    }\n    timer.current = window.setTimeout(() => {\n      setLoading(false);\n      setStep(\"done\");\n    }, 800);\n  };\n\n  const reset = () => {\n    setStep(\"pick\");\n    setTime(null);\n    setTried(false);\n    setValues({ name: \"\", email: \"\", notes: \"\" });\n  };\n\n  const vars = { \"--hb-yi1-accent\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <section className={`hb-yi1 ${className}`} style={vars} {...rest}>\n      <style href=\"hb-contact-booking-calendar\" precedence=\"default\">{css}</style>\n      <div className=\"hb-yi1-inner\">\n        <div className=\"hb-yi1-head\">\n          {eyebrow ? <p className=\"hb-yi1-eyebrow\">{eyebrow}</p> : null}\n          <h2 className=\"hb-yi1-title\">{title}</h2>\n          {subtitle ? <p className=\"hb-yi1-sub\">{subtitle}</p> : null}\n        </div>\n        <div className=\"hb-yi1-card\" data-step={step}>\n          <aside className=\"hb-yi1-info\">\n            <div className=\"hb-yi1-host\">\n              <span className=\"hb-yi1-avatar\" aria-hidden=\"true\">{host.initials}</span>\n              <div>\n                <p className=\"hb-yi1-host-name\">{host.name}</p>\n                <p className=\"hb-yi1-host-role\">{host.role}</p>\n              </div>\n            </div>\n            <p className=\"hb-yi1-meeting\">Product walkthrough</p>\n            <ul className=\"hb-yi1-facts\">\n              <li><Icon d=\"M12 7v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\" />{duration}</li>\n              <li><Icon d=\"M15 10l4.5-2.5v9L15 14M4 7h11v10H4z\" />Video call, link sent by email</li>\n              <li><Icon d=\"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\" />{timezone}</li>\n            </ul>\n            {day && time ? (\n              <div className=\"hb-yi1-picked\">\n                <b>{time}</b>\n                {dayLabel}\n              </div>\n            ) : null}\n            <ul className=\"hb-yi1-points\">\n              {points.map((p) => (\n                <li key={p}>{p}</li>\n              ))}\n            </ul>\n          </aside>\n\n          {step === \"pick\" ? (\n            <>\n              <div className=\"hb-yi1-cal\">\n                <div className=\"hb-yi1-cal-head\">\n                  <h3 aria-live=\"polite\">{`${monthNames[view.m]} ${view.y}`}</h3>\n                  <div className=\"hb-yi1-nav\">\n                    <button type=\"button\" className=\"hb-yi1-navbtn\" onClick={() => shift(-1)} disabled={!canPrev} aria-label=\"Previous month\">\n                      <Icon d=\"M15 18l-6-6 6-6\" />\n                    </button>\n                    <button type=\"button\" className=\"hb-yi1-navbtn\" onClick={() => shift(1)} aria-label=\"Next month\">\n                      <Icon d=\"M9 18l6-6-6-6\" />\n                    </button>\n                  </div>\n                </div>\n                <div className=\"hb-yi1-grid\" role=\"group\" aria-label={`${monthNames[view.m]} ${view.y}`}>\n                  {weekNames.map((w) => (\n                    <span key={w} className=\"hb-yi1-wd\" aria-hidden=\"true\">{w}</span>\n                  ))}\n                  {cells.map((d, i) => {\n                    if (d === null) return <span key={`e${i}`} aria-hidden=\"true\" />;\n                    const open = isOpen(view.y, view.m, d, firstOpen);\n                    const on = !!day && day.y === view.y && day.m === view.m && day.d === d;\n                    return (\n                      <button\n                        key={d}\n                        ref={(el) => {\n                          if (el) dayRefs.current.set(d, el);\n                          else dayRefs.current.delete(d);\n                        }}\n                        type=\"button\"\n                        className=\"hb-yi1-day\"\n                        data-open={open}\n                        data-on={on}\n                        disabled={!open}\n                        aria-pressed={on}\n                        aria-label={`${longWeek[weekday(view.y, view.m, d)]}, ${monthNames[view.m]} ${d}${open ? \"\" : \", unavailable\"}`}\n                        onClick={() => pickDay(d)}\n                        onKeyDown={(e) => onGridKey(e, d)}\n                      >\n                        {d}\n                      </button>\n                    );\n                  })}\n                </div>\n                <p className=\"hb-yi1-tz\">\n                  <Icon d=\"M12 7v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\" />\n                  Times shown in {timezone}\n                </p>\n              </div>\n              <div className=\"hb-yi1-side\">\n                <h4>\n                  {day ? (\n                    <>\n                      {dayLabel.split(\",\")[0]} <span>{`${monthNames[day.m].slice(0, 3)} ${day.d}`}</span>\n                    </>\n                  ) : (\n                    \"Choose a day\"\n                  )}\n                </h4>\n                {day ? (\n                  daySlots.length ? (\n                    <div className=\"hb-yi1-slots\" key={`${day.m}-${day.d}`} role=\"group\" aria-label={`Times on ${dayLabel}`}>\n                      {daySlots.map((s, i) => (\n                        <button\n                          key={s}\n                          type=\"button\"\n                          className=\"hb-yi1-slot\"\n                          aria-pressed={time === s}\n                          style={{ \"--hb-yi1-i\": i } as React.CSSProperties}\n                          onClick={() => setTime(s)}\n                        >\n                          {s}\n                        </button>\n                      ))}\n                    </div>\n                  ) : (\n                    <p className=\"hb-yi1-empty\">Fully booked. Try another day.</p>\n                  )\n                ) : (\n                  <p className=\"hb-yi1-empty\">Highlighted days have open times.</p>\n                )}\n                <div className=\"hb-yi1-actions\">\n                  <button type=\"button\" className=\"hb-yi1-btn\" disabled={!time} onClick={() => setStep(\"details\")}>\n                    Continue\n                  </button>\n                </div>\n              </div>\n            </>\n          ) : step === \"details\" ? (\n            <div className=\"hb-yi1-cal\">\n              <form className=\"hb-yi1-form\" noValidate onSubmit={submit} aria-busy={loading || undefined}>\n                <div className=\"hb-yi1-cal-head\">\n                  <h3>Your details</h3>\n                </div>\n                <div className=\"hb-yi1-field\" data-invalid={tried && !!errors.name}>\n                  <label htmlFor={`${nameId}-n`}>Full name</label>\n                  <input\n                    id={`${nameId}-n`}\n                    autoComplete=\"name\"\n                    value={values.name}\n                    aria-invalid={tried && !!errors.name}\n                    aria-describedby={tried && errors.name ? `${nameId}-ne` : undefined}\n                    onChange={(e) => setValues((v) => ({ ...v, name: e.target.value }))}\n                    placeholder=\"Jordan Reyes\"\n                  />\n                  {tried && errors.name ? <span id={`${nameId}-ne`} className=\"hb-yi1-err\">{errors.name}</span> : null}\n                </div>\n                <div className=\"hb-yi1-field\" data-invalid={tried && !!errors.email}>\n                  <label htmlFor={`${nameId}-e`}>Work email</label>\n                  <input\n                    id={`${nameId}-e`}\n                    type=\"email\"\n                    autoComplete=\"email\"\n                    value={values.email}\n                    aria-invalid={tried && !!errors.email}\n                    aria-describedby={tried && errors.email ? `${nameId}-ee` : undefined}\n                    onChange={(e) => setValues((v) => ({ ...v, email: e.target.value }))}\n                    placeholder=\"jordan@company.com\"\n                  />\n                  {tried && errors.email ? <span id={`${nameId}-ee`} className=\"hb-yi1-err\">{errors.email}</span> : null}\n                </div>\n                <div className=\"hb-yi1-field\">\n                  <label htmlFor={`${nameId}-t`}>What should we prepare?</label>\n                  <textarea\n                    id={`${nameId}-t`}\n                    value={values.notes}\n                    onChange={(e) => setValues((v) => ({ ...v, notes: e.target.value }))}\n                    placeholder=\"We run 40 field audits a week and lose track of photos.\"\n                  />\n                </div>\n                <div className=\"hb-yi1-actions\">\n                  <button type=\"button\" className=\"hb-yi1-back\" onClick={() => setStep(\"pick\")} disabled={loading}>\n                    Back\n                  </button>\n                  <button type=\"submit\" className=\"hb-yi1-btn\" data-loading={loading}>\n                    {loading ? <span className=\"hb-yi1-spin\" aria-hidden=\"true\" /> : null}\n                    {loading ? \"Booking\" : `Confirm ${time ?? \"\"}`}\n                  </button>\n                </div>\n              </form>\n            </div>\n          ) : (\n            <div className=\"hb-yi1-cal\">\n              <div className=\"hb-yi1-done\" role=\"status\">\n                <span className=\"hb-yi1-check\">\n                  <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                    <path d=\"M5 12.5l4.5 4.5L19 7.5\" />\n                  </svg>\n                </span>\n                <h4>You are booked</h4>\n                <p>{`${dayLabel} at ${time}. An invite is on its way to ${values.email.trim()}.`}</p>\n                <div className=\"hb-yi1-actions\">\n                  <button type=\"button\" className=\"hb-yi1-back\" onClick={reset}>\n                    Book another time\n                  </button>\n                </div>\n              </div>\n            </div>\n          )}\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}