@riverbankcms/sdk 0.98.0 → 0.99.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/{PreviewEditorSidebar-CG3SSJND.mjs → PreviewEditorSidebar-TPOKCCKY.mjs} +3 -3
  2. package/dist/{PreviewEditorUI-RHNGKAAU.mjs → PreviewEditorUI-Y347GLC2.mjs} +3 -3
  3. package/dist/SdkPreviewModeRuntime-OGTXRQ4M.mjs +8 -0
  4. package/dist/_dts/ai/src/contracts/proposals.d.ts +36 -36
  5. package/dist/_dts/api/src/billing.d.ts +2 -0
  6. package/dist/_dts/api/src/commercePortalEndpoints.d.ts +5 -1
  7. package/dist/_dts/api/src/endpoints.d.ts +8 -0
  8. package/dist/_dts/api/src/index.d.ts +1 -1
  9. package/dist/_dts/api/src/siteOperations.d.ts +65 -1
  10. package/dist/_dts/billing/src/site-arrangements.d.ts +151 -0
  11. package/dist/_dts/billing/src/subscriptions/store.d.ts +2 -0
  12. package/dist/_dts/block-form/src/widgets/RepeaterField/utils/resolveThumbnail.d.ts +2 -1
  13. package/dist/_dts/blocks/src/PageRenderer.d.ts +6 -0
  14. package/dist/_dts/blocks/src/system/runtime/components/booking/DatePicker.d.ts +6 -2
  15. package/dist/_dts/blocks/src/system/runtime/components/booking/SuccessMessage.d.ts +3 -1
  16. package/dist/_dts/blocks/src/system/runtime/components/booking/TimeSlotSelector.d.ts +10 -4
  17. package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.state.d.ts +2 -2
  18. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +11 -0
  19. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/StepIndicator.d.ts +3 -1
  20. package/dist/_dts/blocks/src/system/runtime/shared/components/FeedbackMessage.d.ts +2 -1
  21. package/dist/_dts/blocks/src/system/runtime/{nodes/event-registration → shared/components}/SelectableOptionCard.d.ts +11 -2
  22. package/dist/_dts/blocks/src/system/runtime/shared/components/StepIndicator.d.ts +16 -5
  23. package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +2 -0
  24. package/dist/_dts/blocks/src/system/runtime/shared/index.d.ts +2 -2
  25. package/dist/_dts/blocks/src/utils/date-formatting.d.ts +17 -1
  26. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +274 -30
  27. package/dist/_dts/sdk/src/__mocks__/next-cache.d.ts +1 -1
  28. package/dist/_dts/sdk/src/cli/commands/push.d.ts +13 -0
  29. package/dist/_dts/sdk/src/cli/merge-remote/entryMergeReport.d.ts +6 -18
  30. package/dist/_dts/sdk/src/cli/merge-remote/entrySnapshots.d.ts +2 -4
  31. package/dist/_dts/sdk/src/cli/merge-remote/pageMergeReport.d.ts +6 -18
  32. package/dist/_dts/sdk/src/cli/merge-remote/pageSnapshots.d.ts +2 -4
  33. package/dist/_dts/sdk/src/cli/merge-remote/sharedBaseSnapshots.d.ts +32 -0
  34. package/dist/_dts/sdk/src/cli/merge-remote/sharedMergePlan.d.ts +27 -0
  35. package/dist/_dts/sdk/src/cli/merge-remote/sharedMergeReport.d.ts +63 -0
  36. package/dist/_dts/sdk/src/client/index.d.ts +6 -0
  37. package/dist/_dts/sdk/src/data/prefetchBlockData.d.ts +6 -1
  38. package/dist/_dts/sdk/src/next/types.d.ts +19 -0
  39. package/dist/_dts/sdk/src/prebuild/loader.d.ts +8 -1
  40. package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +2 -0
  41. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +4 -0
  42. package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +6 -0
  43. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +8 -0
  44. package/dist/_dts/sdk/src/rendering/index.d.ts +7 -7
  45. package/dist/_dts/sdk/src/rendering/overrides.d.ts +2 -0
  46. package/dist/_dts/sdk/src/routing/resolveRoute.d.ts +18 -0
  47. package/dist/_dts/sdk/src/test/apiClient.d.ts +17 -0
  48. package/dist/_dts/sdk/src/test/bunDom.setup.d.ts +1 -0
  49. package/dist/_dts/sdk/src/test/env.d.ts +4 -0
  50. package/dist/_dts/sdk/src/version.d.ts +1 -1
  51. package/dist/_dts/site-commands/src/commands.d.ts +3 -3
  52. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  53. package/dist/_dts/theme-core/src/interactive/generateBaseCSS.d.ts +6 -0
  54. package/dist/_dts/theme-core/src/status/contextualColors.d.ts +6 -0
  55. package/dist/_dts/theme-core/src/status/index.d.ts +1 -0
  56. package/dist/{chunk-H24OU7WG.mjs → chunk-4HXF2QLH.mjs} +2 -2
  57. package/dist/{chunk-QPXE2OUZ.mjs → chunk-EMJIT3ZJ.mjs} +1 -1
  58. package/dist/{chunk-PKDPQHB5.mjs → chunk-PM7HGDHM.mjs} +2 -2
  59. package/dist/{chunk-DBRI3PQF.mjs → chunk-XO34WBBP.mjs} +1383 -1143
  60. package/dist/{chunk-6WDBXCPX.mjs → chunk-YGTTEVUM.mjs} +7 -7
  61. package/dist/{chunk-V2BYFSPW.mjs → chunk-YWTCCOSF.mjs} +8 -0
  62. package/dist/cli/index.mjs +1010 -921
  63. package/dist/client/{accordion-Q2BDNL53.mjs → accordion-QSUEYL4L.mjs} +2 -2
  64. package/dist/client/{bookingForm-ZMP4P7EK.mjs → bookingForm-QYGAHPDP.mjs} +364 -300
  65. package/dist/client/bookings.mjs +697 -411
  66. package/dist/client/{carousel-LW3UXPWO.mjs → carousel-SM2LEWAU.mjs} +3 -3
  67. package/dist/client/{cart-Z6D3KS6K.mjs → cart-3N3SFKNQ.mjs} +7 -7
  68. package/dist/client/{checkout-YMT2QJQM.mjs → checkout-YFAYPKPZ.mjs} +7 -7
  69. package/dist/client/{chunk-XNTHVZ25.mjs → chunk-5DLGREUB.mjs} +1 -1
  70. package/dist/client/{chunk-SK2BMD22.mjs → chunk-CLZ7NBSP.mjs} +147 -75
  71. package/dist/client/{chunk-R4XK3CKR.mjs → chunk-CYJ3MUFP.mjs} +6 -5
  72. package/dist/client/{chunk-JNE6UI6U.mjs → chunk-H3H3ODO7.mjs} +1 -1
  73. package/dist/client/{chunk-IEOECM7U.mjs → chunk-HPEQ4YWW.mjs} +28 -73
  74. package/dist/client/{chunk-PCHACQEB.mjs → chunk-IIUIKJ4K.mjs} +15 -7
  75. package/dist/client/{chunk-KDP7ZRZV.mjs → chunk-IOAHWAQG.mjs} +2 -0
  76. package/dist/client/{chunk-26ZBRXFR.mjs → chunk-JTKBF3W2.mjs} +3 -3
  77. package/dist/client/{chunk-OLAOAZEO.mjs → chunk-K7KTSACR.mjs} +1 -1
  78. package/dist/client/{chunk-ET2MDQQT.mjs → chunk-R32M5HFS.mjs} +6 -6
  79. package/dist/client/{chunk-DRRQ7QSL.mjs → chunk-WEVT46PX.mjs} +3 -3
  80. package/dist/client/{chunk-HBQEAOG4.mjs → chunk-ZU65LTI3.mjs} +1 -1
  81. package/dist/client/client.mjs +1875 -1581
  82. package/dist/client/{courseRegistration-DGKCMC77.mjs → courseRegistration-LYBE7VVK.mjs} +7 -7
  83. package/dist/client/{eventCalendar-74Z2NNFM.mjs → eventCalendar-FMTB75X6.mjs} +9 -9
  84. package/dist/client/{eventCombined-GK2ODOX2.mjs → eventCombined-E4LUCJXT.mjs} +9 -9
  85. package/dist/client/{eventDetails-MONAGT3N.mjs → eventDetails-GELSRR4Z.mjs} +9 -9
  86. package/dist/client/{eventListing-SKGAO6PS.mjs → eventListing-TB623B6R.mjs} +9 -9
  87. package/dist/client/{eventRegistration-6KISGXRD.mjs → eventRegistration-NRIKHXTI.mjs} +9 -9
  88. package/dist/client/{form-FXPRTXHI.mjs → form-Y4U4IAXE.mjs} +3 -3
  89. package/dist/client/{headerSection-7NAN5WNB.mjs → headerSection-QSOVV5P7.mjs} +3 -3
  90. package/dist/client/hooks.mjs +115 -21
  91. package/dist/client/{locationMap-UERN74U4.mjs → locationMap-QYCAHH7H.mjs} +3 -3
  92. package/dist/client/{newsletterForm-SGWXMJ7U.mjs → newsletterForm-NWHY5TBY.mjs} +3 -3
  93. package/dist/client/{productDetail-HN3HWZQZ.mjs → productDetail-FYDMU2CE.mjs} +7 -7
  94. package/dist/client/{productList-YT22Z5UR.mjs → productList-D76CGACQ.mjs} +7 -7
  95. package/dist/client/rendering/client.mjs +1209 -975
  96. package/dist/client/rendering/islands.mjs +19 -19
  97. package/dist/client/rendering.mjs +1952 -1638
  98. package/dist/client/{shop-TKEDNWUS.mjs → shop-SOUACT5N.mjs} +7 -7
  99. package/dist/preview-next/before-render.mjs +8 -0
  100. package/dist/preview-next/client/runtime.mjs +5 -5
  101. package/dist/preview-next/middleware.mjs +8 -0
  102. package/dist/{sdk-runtime-LWNYCQF2.mjs → sdk-runtime-XPVE3LBA.mjs} +6 -6
  103. package/dist/server/components.mjs +917 -765
  104. package/dist/server/config-validation.mjs +100 -19
  105. package/dist/server/config.mjs +100 -19
  106. package/dist/server/data.mjs +115 -21
  107. package/dist/server/index.mjs +59 -25
  108. package/dist/server/next.mjs +1017 -816
  109. package/dist/server/page-converter.mjs +92 -19
  110. package/dist/server/prebuild-loader.mjs +42 -23
  111. package/dist/server/prebuild.mjs +1 -1
  112. package/dist/server/rendering/server.mjs +932 -767
  113. package/dist/server/rendering.mjs +968 -776
  114. package/dist/server/routing.mjs +162 -36
  115. package/dist/server/server.mjs +156 -32
  116. package/dist/server/theme-bridge.mjs +597 -505
  117. package/dist/server/theme.mjs +5 -4
  118. package/dist/styles/index.css +499 -490
  119. package/package.json +6 -4
  120. package/dist/SdkPreviewModeRuntime-OV5PNJBB.mjs +0 -8
@@ -2765,7 +2765,7 @@ var init_altcha = __esm({
2765
2765
  });
2766
2766
 
2767
2767
  // src/bookings/index.ts
2768
- import * as React5 from "react";
2768
+ import * as React8 from "react";
2769
2769
 
2770
2770
  // ../blocks/src/system/runtime/api/deduplication.ts
2771
2771
  function createDeduplicationCache(options = {}) {
@@ -4813,15 +4813,16 @@ var joyStamp = defineButtonPersonality({
4813
4813
  // 700, matching the mockup's chunky button labels.
4814
4814
  typography: "heading",
4815
4815
  fontWeight: 700,
4816
+ fontSize: "text-lg",
4816
4817
  borderWidth: 2,
4817
4818
  hoverTransform: "none",
4818
4819
  hoverColor: "none"
4819
4820
  },
4820
4821
  sizes: {
4821
- sm: { padding: "0.625rem 1.25rem", fontSize: "text-sm" },
4822
- md: { padding: "0.875rem 1.75rem", fontSize: "text-base" },
4823
- lg: { padding: "1.125rem 2.25rem", fontSize: "text-lg" },
4824
- xl: { padding: "1.25rem 2.75rem", fontSize: "text-xl" }
4822
+ sm: { padding: "0.625rem 1.25rem", fontSize: "text-base" },
4823
+ md: { padding: "0.875rem 1.75rem", fontSize: "text-lg" },
4824
+ lg: { padding: "1.125rem 2.25rem", fontSize: "text-xl" },
4825
+ xl: { padding: "1.25rem 2.75rem", fontSize: "text-2xl" }
4825
4826
  },
4826
4827
  variants: [
4827
4828
  {
@@ -12498,6 +12499,7 @@ function FeedbackMessage({
12498
12499
  tone,
12499
12500
  children,
12500
12501
  className,
12502
+ id,
12501
12503
  title,
12502
12504
  titleClassName,
12503
12505
  bodyClassName,
@@ -12509,6 +12511,7 @@ function FeedbackMessage({
12509
12511
  return /* @__PURE__ */ jsxs2(
12510
12512
  "div",
12511
12513
  {
12514
+ id,
12512
12515
  className,
12513
12516
  "data-feedback-tone": tone,
12514
12517
  role,
@@ -12522,7 +12525,7 @@ function FeedbackMessage({
12522
12525
  }
12523
12526
 
12524
12527
  // ../blocks/src/system/runtime/nodes/booking-form.client.tsx
12525
- import React3, { useRef as useRef8, useState as useState2 } from "react";
12528
+ import React6, { useRef as useRef8, useState as useState2 } from "react";
12526
12529
 
12527
12530
  // ../altcha/src/AltchaWidget.tsx
12528
12531
  import { createElement, useEffect, useRef } from "react";
@@ -12577,27 +12580,98 @@ function isSpamProtectionEnabled() {
12577
12580
  return process.env.NEXT_PUBLIC_SPAM_PROTECTION_ENABLED === "true";
12578
12581
  }
12579
12582
 
12583
+ // ../blocks/src/system/runtime/shared/components/CheckIcon.tsx
12584
+ import { jsx as jsx4 } from "react/jsx-runtime";
12585
+ function CheckIcon({ className, strokeWidth = 2 }) {
12586
+ return /* @__PURE__ */ jsx4(
12587
+ "svg",
12588
+ {
12589
+ fill: "none",
12590
+ strokeLinecap: "round",
12591
+ strokeLinejoin: "round",
12592
+ strokeWidth,
12593
+ viewBox: "0 0 24 24",
12594
+ stroke: "currentColor",
12595
+ className,
12596
+ width: "1em",
12597
+ height: "1em",
12598
+ "aria-hidden": "true",
12599
+ children: /* @__PURE__ */ jsx4("path", { d: "M5 13l4 4L19 7" })
12600
+ }
12601
+ );
12602
+ }
12603
+
12604
+ // ../blocks/src/system/runtime/shared/components/StateIcon.tsx
12605
+ import { jsx as jsx5 } from "react/jsx-runtime";
12606
+ function StateIcon({ variant, children }) {
12607
+ return /* @__PURE__ */ jsx5("div", { className: `rb-state-icon rb-state-icon--${variant}`, "aria-hidden": "true", children });
12608
+ }
12609
+
12610
+ // ../blocks/src/system/runtime/shared/components/TerminalPanel.tsx
12611
+ import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
12612
+ function joinClasses2(...parts) {
12613
+ return parts.filter((part) => typeof part === "string" && part.length > 0).join(" ");
12614
+ }
12615
+ function TerminalPanel({
12616
+ tone,
12617
+ title,
12618
+ titleAs: Title = "h3",
12619
+ body,
12620
+ secondaryBody,
12621
+ icon,
12622
+ actions,
12623
+ className,
12624
+ titleClassName,
12625
+ bodyClassName,
12626
+ secondaryBodyClassName,
12627
+ iconClassName,
12628
+ actionsClassName,
12629
+ role,
12630
+ live
12631
+ }) {
12632
+ const resolvedRole = role ?? (tone === "error" ? "alert" : "status");
12633
+ const resolvedLive = live ?? (resolvedRole === "alert" ? "assertive" : "polite");
12634
+ return /* @__PURE__ */ jsxs3(
12635
+ "div",
12636
+ {
12637
+ className,
12638
+ "data-terminal-panel": true,
12639
+ "data-terminal-tone": tone,
12640
+ role: resolvedRole,
12641
+ "aria-live": resolvedLive === "off" ? void 0 : resolvedLive,
12642
+ children: [
12643
+ icon ? /* @__PURE__ */ jsx6("div", { className: joinClasses2(iconClassName), "data-terminal-icon": true, children: icon }) : null,
12644
+ /* @__PURE__ */ jsx6(Title, { className: joinClasses2(titleClassName), "data-terminal-title": true, children: title }),
12645
+ body ? /* @__PURE__ */ jsx6("div", { className: joinClasses2(bodyClassName), "data-terminal-body": true, children: body }) : null,
12646
+ actions ? /* @__PURE__ */ jsx6("div", { className: joinClasses2(actionsClassName), "data-terminal-actions": true, children: actions }) : null,
12647
+ secondaryBody ? /* @__PURE__ */ jsx6("div", { className: joinClasses2(secondaryBodyClassName), "data-terminal-secondary-body": true, children: secondaryBody }) : null
12648
+ ]
12649
+ }
12650
+ );
12651
+ }
12652
+
12580
12653
  // ../blocks/src/system/runtime/components/booking/SuccessMessage.tsx
12581
- import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
12654
+ import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
12582
12655
  var SuccessMessage = ({
12583
12656
  message,
12584
12657
  resourceName,
12585
12658
  className
12586
12659
  }) => {
12587
- return /* @__PURE__ */ jsx4(
12588
- FeedbackMessage,
12660
+ return /* @__PURE__ */ jsx7(
12661
+ TerminalPanel,
12589
12662
  {
12590
12663
  tone: "success",
12591
- className: `ab-alert ab-alert--success ${className ?? ""}`,
12664
+ title: "Booking confirmed",
12665
+ icon: /* @__PURE__ */ jsx7(StateIcon, { variant: "success", children: /* @__PURE__ */ jsx7(CheckIcon, { strokeWidth: 3 }) }),
12666
+ body: /* @__PURE__ */ jsx7("p", { className: "ab-text", children: message }),
12667
+ secondaryBody: resourceName ? /* @__PURE__ */ jsxs4("p", { className: "ab-text rb-on-surface--muted", children: [
12668
+ "Practitioner: ",
12669
+ resourceName
12670
+ ] }) : null,
12671
+ className: ["ab-center", className ?? ""].join(" ").trim(),
12672
+ titleClassName: "ab-terminal-title",
12592
12673
  role: "alert",
12593
- live: "polite",
12594
- children: /* @__PURE__ */ jsxs3(Fragment, { children: [
12595
- /* @__PURE__ */ jsx4("p", { className: "ab-text", children: message }),
12596
- resourceName ? /* @__PURE__ */ jsxs3("p", { className: "ab-text ab-text--muted", children: [
12597
- "Practitioner: ",
12598
- resourceName
12599
- ] }) : null
12600
- ] })
12674
+ live: "polite"
12601
12675
  }
12602
12676
  );
12603
12677
  };
@@ -12675,9 +12749,30 @@ function formatDate(dateStr) {
12675
12749
  }
12676
12750
  });
12677
12751
  }
12678
- function formatTime(isoString) {
12679
- return formatBookingInstant(isoString, {
12752
+ function formatDatePillParts(dateStr) {
12753
+ const instant = `${dateStr}T00:00:00.000Z`;
12754
+ const partFormat = (format) => formatBookingInstant(instant, {
12680
12755
  timeZone: DEFAULT_BOOKING_TIME_ZONE,
12756
+ format
12757
+ });
12758
+ return {
12759
+ weekday: partFormat({ weekday: "short" }),
12760
+ day: partFormat({ day: "numeric" }),
12761
+ month: partFormat({ month: "short" })
12762
+ };
12763
+ }
12764
+ function formatTimeShort(isoString, timeZone = DEFAULT_BOOKING_TIME_ZONE) {
12765
+ return formatBookingInstant(isoString, {
12766
+ timeZone,
12767
+ format: {
12768
+ hour: "numeric",
12769
+ minute: "2-digit"
12770
+ }
12771
+ });
12772
+ }
12773
+ function formatTime(isoString, timeZone = DEFAULT_BOOKING_TIME_ZONE) {
12774
+ return formatBookingInstant(isoString, {
12775
+ timeZone,
12681
12776
  format: {
12682
12777
  hour: "numeric",
12683
12778
  minute: "2-digit",
@@ -13823,6 +13918,24 @@ function toBookingSlotView(slot) {
13823
13918
  function toBookingSlotViews(slots) {
13824
13919
  return slots.map(toBookingSlotView);
13825
13920
  }
13921
+ function deriveBookingSlotDisplayOptions(input) {
13922
+ const seenStartTimes = /* @__PURE__ */ new Set();
13923
+ const options = [];
13924
+ for (const slot of input.slots) {
13925
+ if (!input.hasSelectedResource) {
13926
+ if (seenStartTimes.has(slot.startAt)) continue;
13927
+ seenStartTimes.add(slot.startAt);
13928
+ }
13929
+ options.push({
13930
+ key: slot.key,
13931
+ startAt: slot.startAt,
13932
+ endAt: slot.endAt,
13933
+ resourceId: slot.resourceId,
13934
+ slot
13935
+ });
13936
+ }
13937
+ return options;
13938
+ }
13826
13939
  function toBookingFormData(state) {
13827
13940
  return {
13828
13941
  ...state.fieldValues,
@@ -15218,113 +15331,250 @@ function useAppointmentCheckoutVerificationWithDeps(config, deps) {
15218
15331
  };
15219
15332
  }
15220
15333
 
15334
+ // ../blocks/src/system/runtime/nodes/booking-form.default-ui.tsx
15335
+ import React5 from "react";
15336
+
15221
15337
  // ../blocks/src/system/runtime/components/booking/DatePicker.tsx
15222
- import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
15338
+ import React3 from "react";
15339
+ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
15340
+ function DateFieldLabel({
15341
+ labelId,
15342
+ required
15343
+ }) {
15344
+ return /* @__PURE__ */ jsxs5("span", { className: "form-label", id: labelId, children: [
15345
+ "Select Date",
15346
+ required && /* @__PURE__ */ jsx8("span", { className: "required-marker", children: "*" })
15347
+ ] });
15348
+ }
15223
15349
  var DatePicker = ({
15224
15350
  value,
15225
15351
  onChange,
15226
15352
  dateOptions,
15227
15353
  required = true,
15354
+ ariaDescribedBy,
15355
+ ariaInvalid,
15228
15356
  isLoading = false,
15229
15357
  isEmpty = false,
15230
15358
  hasMore = false,
15231
15359
  onLoadMore
15232
15360
  }) => {
15361
+ const generatedId = React3.useId();
15362
+ const labelId = `${generatedId}-date-label`;
15363
+ const gridRef = React3.useRef(null);
15364
+ const previousCountRef = React3.useRef(dateOptions.length);
15365
+ React3.useEffect(() => {
15366
+ const previousCount = previousCountRef.current;
15367
+ previousCountRef.current = dateOptions.length;
15368
+ if (previousCount === 0 || dateOptions.length <= previousCount) return;
15369
+ const pills = gridRef.current?.querySelectorAll(
15370
+ "button[aria-pressed]"
15371
+ );
15372
+ pills?.[previousCount]?.focus();
15373
+ }, [dateOptions.length]);
15233
15374
  if (isLoading) {
15234
- return /* @__PURE__ */ jsxs4("div", { className: "ab-stack--sm", children: [
15235
- /* @__PURE__ */ jsxs4("label", { className: "ab-label", children: [
15236
- "Select Date",
15237
- required && /* @__PURE__ */ jsx5("span", { className: "ab-required", children: "*" })
15238
- ] }),
15239
- /* @__PURE__ */ jsx5("div", { className: "ab-skeleton" }),
15240
- /* @__PURE__ */ jsx5("p", { className: "ab-text ab-text--muted ab-text--sm", children: "Loading available dates..." })
15375
+ return /* @__PURE__ */ jsxs5("div", { className: "rb-reg-stack rb-reg-stack--sm", children: [
15376
+ /* @__PURE__ */ jsx8(DateFieldLabel, { labelId, required }),
15377
+ /* @__PURE__ */ jsx8("div", { className: "rb-shell-block" }),
15378
+ /* @__PURE__ */ jsx8("p", { className: "ab-text ab-text--sm rb-on-surface--muted", children: "Loading available dates..." })
15241
15379
  ] });
15242
15380
  }
15243
15381
  if (isEmpty) {
15244
- return /* @__PURE__ */ jsxs4("div", { className: "ab-stack--sm", children: [
15245
- /* @__PURE__ */ jsxs4("label", { className: "ab-label", children: [
15246
- "Select Date",
15247
- required && /* @__PURE__ */ jsx5("span", { className: "ab-required", children: "*" })
15248
- ] }),
15249
- /* @__PURE__ */ jsx5(FeedbackMessage, { tone: "warning", className: "ab-alert ab-alert--warning", role: "status", children: /* @__PURE__ */ jsxs4("p", { className: "ab-text", children: [
15382
+ return /* @__PURE__ */ jsxs5("div", { className: "rb-reg-stack rb-reg-stack--sm", children: [
15383
+ /* @__PURE__ */ jsx8(DateFieldLabel, { labelId, required }),
15384
+ /* @__PURE__ */ jsx8(FeedbackMessage, { tone: "warning", className: "alert alert-warning", role: "status", children: /* @__PURE__ */ jsxs5("p", { className: "ab-text", children: [
15250
15385
  "No available dates in this period.",
15251
- hasMore && onLoadMore && /* @__PURE__ */ jsx5(
15386
+ hasMore && onLoadMore && /* @__PURE__ */ jsx8(
15252
15387
  "button",
15253
15388
  {
15254
15389
  type: "button",
15255
15390
  onClick: onLoadMore,
15256
- className: "ab-link",
15391
+ className: "ab-link rb-ml-2",
15257
15392
  children: "Check later dates"
15258
15393
  }
15259
15394
  )
15260
15395
  ] }) })
15261
15396
  ] });
15262
15397
  }
15263
- return /* @__PURE__ */ jsxs4("div", { className: "ab-stack--sm", children: [
15264
- /* @__PURE__ */ jsxs4("label", { htmlFor: "booking-date", className: "ab-label", children: [
15265
- "Select Date",
15266
- required && /* @__PURE__ */ jsx5("span", { className: "ab-required", children: "*" })
15267
- ] }),
15268
- /* @__PURE__ */ jsxs4(
15269
- "select",
15398
+ return /* @__PURE__ */ jsxs5("div", { className: "rb-reg-stack rb-reg-stack--sm", children: [
15399
+ /* @__PURE__ */ jsx8(DateFieldLabel, { labelId, required }),
15400
+ /* @__PURE__ */ jsx8(
15401
+ "div",
15270
15402
  {
15271
- id: "booking-date",
15272
- value,
15273
- onChange: (e) => onChange(e.target.value),
15274
- required,
15275
- className: "ab-select",
15276
- children: [
15277
- /* @__PURE__ */ jsx5("option", { value: "", children: "Choose a date..." }),
15278
- dateOptions.map((date) => /* @__PURE__ */ jsx5("option", { value: date, children: formatDate(date) }, date))
15279
- ]
15403
+ ref: gridRef,
15404
+ role: "group",
15405
+ "aria-labelledby": labelId,
15406
+ "aria-describedby": ariaDescribedBy,
15407
+ "aria-invalid": ariaInvalid || void 0,
15408
+ "aria-required": required || void 0,
15409
+ className: "ab-pill-grid",
15410
+ children: dateOptions.map((date) => {
15411
+ const isSelected = value === date;
15412
+ const parts = formatDatePillParts(date);
15413
+ return /* @__PURE__ */ jsxs5(
15414
+ "button",
15415
+ {
15416
+ type: "button",
15417
+ onClick: () => onChange(isSelected ? "" : date),
15418
+ "aria-pressed": isSelected,
15419
+ "aria-label": formatDate(date),
15420
+ className: `rb-option-card ab-date-pill${isSelected ? " rb-option-card--selected" : ""}`,
15421
+ children: [
15422
+ /* @__PURE__ */ jsx8("span", { className: "ab-pill-caption", "aria-hidden": "true", children: parts.weekday }),
15423
+ /* @__PURE__ */ jsx8("span", { className: "ab-pill-value", "aria-hidden": "true", children: parts.day }),
15424
+ /* @__PURE__ */ jsx8("span", { className: "ab-pill-caption", "aria-hidden": "true", children: parts.month })
15425
+ ]
15426
+ },
15427
+ date
15428
+ );
15429
+ })
15280
15430
  }
15281
15431
  ),
15282
- hasMore && onLoadMore && /* @__PURE__ */ jsx5(
15432
+ hasMore && onLoadMore && /* @__PURE__ */ jsx8(
15283
15433
  "button",
15284
15434
  {
15285
15435
  type: "button",
15286
15436
  onClick: onLoadMore,
15287
15437
  className: "ab-link",
15288
- children: "Load more dates \u2192"
15438
+ children: "More dates \u2192"
15289
15439
  }
15290
15440
  )
15291
15441
  ] });
15292
15442
  };
15293
15443
 
15294
15444
  // ../blocks/src/system/runtime/components/booking/TimeSlotSelector.tsx
15295
- import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
15445
+ import React4 from "react";
15446
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
15296
15447
  var TimeSlotSelector = ({
15297
15448
  value,
15298
15449
  onChange,
15299
15450
  slots,
15300
15451
  isLoading,
15301
- required = true
15452
+ timezone,
15453
+ required = true,
15454
+ ariaDescribedBy,
15455
+ ariaInvalid
15302
15456
  }) => {
15303
- return /* @__PURE__ */ jsxs5("div", { className: "ab-stack--sm", children: [
15304
- /* @__PURE__ */ jsxs5("label", { htmlFor: "booking-slot", className: "ab-label", children: [
15457
+ const generatedId = React4.useId();
15458
+ const labelId = `${generatedId}-time-label`;
15459
+ const groupRef = React4.useRef(null);
15460
+ const hadSlotsRef = React4.useRef(false);
15461
+ React4.useEffect(() => {
15462
+ const hasSlots = !isLoading && slots.length > 0;
15463
+ if (hasSlots && !hadSlotsRef.current) {
15464
+ groupRef.current?.scrollIntoView({ block: "nearest", behavior: "smooth" });
15465
+ }
15466
+ hadSlotsRef.current = hasSlots;
15467
+ }, [isLoading, slots.length]);
15468
+ return /* @__PURE__ */ jsxs6("div", { className: "rb-reg-stack rb-reg-stack--sm", children: [
15469
+ /* @__PURE__ */ jsxs6("span", { className: "form-label", id: labelId, children: [
15305
15470
  "Select Time",
15306
- required && /* @__PURE__ */ jsx6("span", { className: "ab-required", children: "*" })
15471
+ required && /* @__PURE__ */ jsx9("span", { className: "required-marker", children: "*" })
15307
15472
  ] }),
15308
- isLoading ? /* @__PURE__ */ jsx6(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info ab-center", role: "status", children: "Loading available times..." }) : slots.length === 0 ? /* @__PURE__ */ jsx6(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info ab-center", role: "status", children: "No available times for this date" }) : /* @__PURE__ */ jsxs5(
15309
- "select",
15473
+ isLoading ? /* @__PURE__ */ jsx9("div", { className: "rb-shell-block" }) : slots.length === 0 ? /* @__PURE__ */ jsx9(FeedbackMessage, { tone: "info", className: "alert alert-info", role: "status", children: "No available times for this date" }) : /* @__PURE__ */ jsx9(
15474
+ "div",
15310
15475
  {
15311
- id: "booking-slot",
15312
- value,
15313
- onChange: (e) => onChange(e.target.value),
15314
- required,
15315
- className: "ab-select",
15316
- children: [
15317
- /* @__PURE__ */ jsx6("option", { value: "", children: "Choose a time..." }),
15318
- slots.map((slot) => /* @__PURE__ */ jsx6("option", { value: slot.startAt, children: formatTime(slot.startAt) }, slot.startAt))
15319
- ]
15476
+ ref: groupRef,
15477
+ role: "group",
15478
+ "aria-labelledby": labelId,
15479
+ "aria-describedby": ariaDescribedBy,
15480
+ "aria-invalid": ariaInvalid || void 0,
15481
+ "aria-required": required || void 0,
15482
+ className: "ab-pill-grid",
15483
+ children: slots.map((slot) => {
15484
+ const isSelected = value === slot.key;
15485
+ return /* @__PURE__ */ jsx9(
15486
+ "button",
15487
+ {
15488
+ type: "button",
15489
+ onClick: () => onChange(isSelected ? "" : slot.key),
15490
+ "aria-pressed": isSelected,
15491
+ "aria-label": formatTime(slot.startAt, timezone),
15492
+ className: `rb-option-card ab-time-pill${isSelected ? " rb-option-card--selected" : ""}`,
15493
+ children: formatTimeShort(slot.startAt, timezone)
15494
+ },
15495
+ slot.key
15496
+ );
15497
+ })
15320
15498
  }
15321
15499
  )
15322
15500
  ] });
15323
15501
  };
15324
15502
 
15503
+ // ../blocks/src/system/runtime/shared/components/StepIndicator.tsx
15504
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
15505
+ function buildClassChannels(slot, classPrefix, emitSharedClasses) {
15506
+ const classes = [];
15507
+ if (emitSharedClasses) classes.push(`rb-${slot}`);
15508
+ if (classPrefix) classes.push(`${classPrefix}-${slot}`);
15509
+ return classes;
15510
+ }
15511
+ function StepIndicator({
15512
+ currentStep,
15513
+ totalSteps,
15514
+ stepLabels,
15515
+ classPrefix,
15516
+ emitSharedClasses
15517
+ }) {
15518
+ const slotClass = (slot, modifier) => {
15519
+ const base = buildClassChannels(slot, classPrefix, emitSharedClasses);
15520
+ if (!modifier) return base.join(" ");
15521
+ const modified = buildClassChannels(
15522
+ `${slot}--${modifier}`,
15523
+ classPrefix,
15524
+ emitSharedClasses
15525
+ );
15526
+ return [...base, ...modified].join(" ");
15527
+ };
15528
+ return /* @__PURE__ */ jsx10("nav", { "aria-label": "Registration progress", className: slotClass("steps-nav"), children: /* @__PURE__ */ jsx10("ol", { className: slotClass("steps"), children: Array.from({ length: totalSteps }, (_, i) => {
15529
+ const stepNum = i + 1;
15530
+ const isActive = stepNum === currentStep;
15531
+ const isComplete = stepNum < currentStep;
15532
+ return /* @__PURE__ */ jsxs7(
15533
+ "li",
15534
+ {
15535
+ className: slotClass("step"),
15536
+ "aria-current": isActive ? "step" : void 0,
15537
+ children: [
15538
+ /* @__PURE__ */ jsx10(
15539
+ "div",
15540
+ {
15541
+ className: slotClass(
15542
+ "step-circle",
15543
+ isActive ? "active" : isComplete ? "completed" : void 0
15544
+ ),
15545
+ children: isComplete ? /* @__PURE__ */ jsx10(CheckIcon, { className: slotClass("step-check"), strokeWidth: 3 }) : stepNum
15546
+ }
15547
+ ),
15548
+ stepLabels?.[i] && /* @__PURE__ */ jsx10(
15549
+ "span",
15550
+ {
15551
+ className: slotClass(
15552
+ "step-label",
15553
+ isActive ? "active" : void 0
15554
+ ),
15555
+ children: stepLabels[i]
15556
+ }
15557
+ ),
15558
+ stepNum < totalSteps && /* @__PURE__ */ jsx10(
15559
+ "div",
15560
+ {
15561
+ className: slotClass(
15562
+ "step-connector",
15563
+ isComplete ? "completed" : void 0
15564
+ ),
15565
+ "aria-hidden": "true"
15566
+ }
15567
+ )
15568
+ ]
15569
+ },
15570
+ i
15571
+ );
15572
+ }) }) });
15573
+ }
15574
+
15325
15575
  // ../blocks/src/system/runtime/shared/components/DiscountCodeDisclosure.tsx
15326
15576
  import { useId } from "react";
15327
- import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
15577
+ import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
15328
15578
  var BLOCK_DISCOUNT_CODE_DISCLOSURE_CLASSES = {
15329
15579
  "course-registration": {
15330
15580
  root: "cr-discount",
@@ -15400,10 +15650,10 @@ function DiscountCodeDisclosure({
15400
15650
  onApply();
15401
15651
  };
15402
15652
  const feedbackClassName = feedback ? `${classes.feedback} status-${feedback.tone}` : classes.feedback;
15403
- return /* @__PURE__ */ jsx7("div", { className: classes.root, children: !isOpen ? /* @__PURE__ */ jsx7("button", { type: "button", className: classes.toggle, onClick: onOpen, children: toggleLabel }) : /* @__PURE__ */ jsxs6("div", { className: classes.form, children: [
15404
- /* @__PURE__ */ jsx7("label", { htmlFor: inputId, className: classes.label, children: label }),
15405
- /* @__PURE__ */ jsxs6("div", { className: classes.row, children: [
15406
- /* @__PURE__ */ jsx7(
15653
+ return /* @__PURE__ */ jsx11("div", { className: classes.root, children: !isOpen ? /* @__PURE__ */ jsx11("button", { type: "button", className: classes.toggle, onClick: onOpen, children: toggleLabel }) : /* @__PURE__ */ jsxs8("div", { className: classes.form, children: [
15654
+ /* @__PURE__ */ jsx11("label", { htmlFor: inputId, className: classes.label, children: label }),
15655
+ /* @__PURE__ */ jsxs8("div", { className: classes.row, children: [
15656
+ /* @__PURE__ */ jsx11(
15407
15657
  "input",
15408
15658
  {
15409
15659
  id: inputId,
@@ -15416,7 +15666,7 @@ function DiscountCodeDisclosure({
15416
15666
  disabled: disabled || isApplying
15417
15667
  }
15418
15668
  ),
15419
- onApply ? /* @__PURE__ */ jsx7(
15669
+ onApply ? /* @__PURE__ */ jsx11(
15420
15670
  "button",
15421
15671
  {
15422
15672
  type: "button",
@@ -15426,7 +15676,7 @@ function DiscountCodeDisclosure({
15426
15676
  children: isApplying ? "Applying..." : applyLabel
15427
15677
  }
15428
15678
  ) : null,
15429
- /* @__PURE__ */ jsx7(
15679
+ /* @__PURE__ */ jsx11(
15430
15680
  "button",
15431
15681
  {
15432
15682
  type: "button",
@@ -15437,8 +15687,8 @@ function DiscountCodeDisclosure({
15437
15687
  }
15438
15688
  )
15439
15689
  ] }),
15440
- /* @__PURE__ */ jsx7("p", { className: classes.hint, children: hint }),
15441
- feedback ? /* @__PURE__ */ jsx7(
15690
+ /* @__PURE__ */ jsx11("p", { className: classes.hint, children: hint }),
15691
+ feedback ? /* @__PURE__ */ jsx11(
15442
15692
  "p",
15443
15693
  {
15444
15694
  className: feedbackClassName,
@@ -15450,7 +15700,7 @@ function DiscountCodeDisclosure({
15450
15700
  }
15451
15701
 
15452
15702
  // ../blocks/src/system/runtime/shared/components/FieldValidationMessage.tsx
15453
- import { jsx as jsx8 } from "react/jsx-runtime";
15703
+ import { jsx as jsx12 } from "react/jsx-runtime";
15454
15704
  function getFieldValidationControlProps({
15455
15705
  message,
15456
15706
  messageId,
@@ -15469,7 +15719,7 @@ function FieldValidationMessage({
15469
15719
  className,
15470
15720
  live = "assertive"
15471
15721
  }) {
15472
- return /* @__PURE__ */ jsx8(
15722
+ return /* @__PURE__ */ jsx12(
15473
15723
  "p",
15474
15724
  {
15475
15725
  id,
@@ -15484,18 +15734,10 @@ function FieldValidationMessage({
15484
15734
  }
15485
15735
 
15486
15736
  // ../blocks/src/system/runtime/nodes/booking-form.default-ui.tsx
15487
- import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
15488
- var paymentOptionLayoutStyle = {
15489
- alignItems: "flex-start",
15490
- display: "flex",
15491
- flexDirection: "column",
15492
- gap: "0.25rem",
15493
- justifyContent: "flex-start",
15494
- width: "100%"
15495
- };
15496
- var summaryStackStyle = {
15497
- gap: "0.125rem"
15498
- };
15737
+ import { Fragment, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
15738
+ function optionCardClassName(isSelected) {
15739
+ return `rb-option-card${isSelected ? " rb-option-card--selected" : ""}`;
15740
+ }
15499
15741
  function formatBookingAmount(amount, currency) {
15500
15742
  return formatCurrencyAmount(amount, currency, { decimals: "auto" });
15501
15743
  }
@@ -15504,6 +15746,7 @@ function HeadlessBookingDefaultForm({
15504
15746
  onSubmit
15505
15747
  }) {
15506
15748
  const currentStep = booking.currentStep;
15749
+ const errorSummaryId = React5.useId();
15507
15750
  const currentStepIndex = currentStep?.visibleIndex ?? 0;
15508
15751
  const isFirstStep = currentStepIndex === 0;
15509
15752
  const isLastStep = currentStepIndex === booking.steps.length - 1;
@@ -15516,20 +15759,34 @@ function HeadlessBookingDefaultForm({
15516
15759
  }
15517
15760
  };
15518
15761
  if (!currentStep) {
15519
- return /* @__PURE__ */ jsx9("div", { className: "rb-text-center rb-py-12", children: /* @__PURE__ */ jsx9("p", { className: "status-muted", children: "No steps available" }) });
15762
+ return /* @__PURE__ */ jsx13("div", { className: "rb-text-center rb-py-12", children: /* @__PURE__ */ jsx13("p", { className: "status-muted", children: "No steps available" }) });
15520
15763
  }
15521
- return /* @__PURE__ */ jsxs7("div", { className: "multi-step-form", children: [
15522
- /* @__PURE__ */ jsx9("div", { className: "rb-mb-8", children: /* @__PURE__ */ jsx9(
15523
- DefaultBookingProgress,
15764
+ return /* @__PURE__ */ jsxs9("div", { className: "multi-step-form", children: [
15765
+ booking.steps.length > 1 ? /* @__PURE__ */ jsx13(
15766
+ StepIndicator,
15524
15767
  {
15525
- steps: booking.steps,
15526
- currentIndex: currentStepIndex
15768
+ currentStep: currentStepIndex + 1,
15769
+ totalSteps: booking.steps.length,
15770
+ stepLabels: booking.steps.map((step) => step.label),
15771
+ emitSharedClasses: true
15772
+ }
15773
+ ) : null,
15774
+ /* @__PURE__ */ jsx13("div", { className: "step-content", children: /* @__PURE__ */ jsx13(
15775
+ DefaultBookingStepContent,
15776
+ {
15777
+ booking,
15778
+ errorSummaryId
15527
15779
  }
15528
15780
  ) }),
15529
- /* @__PURE__ */ jsx9("div", { className: "step-content", children: /* @__PURE__ */ jsx9(DefaultBookingStepContent, { booking }) }),
15530
- /* @__PURE__ */ jsx9(DefaultBookingErrorSummary, { errors: currentStep.errors }),
15531
- /* @__PURE__ */ jsxs7("div", { className: "rb-flex rb-gap-3 rb-mt-8", children: [
15532
- !isFirstStep ? /* @__PURE__ */ jsx9(
15781
+ /* @__PURE__ */ jsx13(
15782
+ DefaultBookingErrorSummary,
15783
+ {
15784
+ errors: currentStep.errors,
15785
+ id: errorSummaryId
15786
+ }
15787
+ ),
15788
+ /* @__PURE__ */ jsxs9("div", { className: "rb-wizard-actions", children: [
15789
+ !isFirstStep ? /* @__PURE__ */ jsx13(
15533
15790
  "button",
15534
15791
  {
15535
15792
  type: "button",
@@ -15538,7 +15795,7 @@ function HeadlessBookingDefaultForm({
15538
15795
  children: "Back"
15539
15796
  }
15540
15797
  ) : null,
15541
- /* @__PURE__ */ jsx9(
15798
+ /* @__PURE__ */ jsx13(
15542
15799
  "button",
15543
15800
  {
15544
15801
  type: "button",
@@ -15546,13 +15803,9 @@ function HeadlessBookingDefaultForm({
15546
15803
  void handlePrimaryAction();
15547
15804
  },
15548
15805
  disabled: isSubmitting,
15549
- className: themeButtonClassName({
15550
- variant: "primary",
15551
- size: "md",
15552
- extraClassName: "rb-flex-1"
15553
- }),
15554
- children: isSubmitting ? /* @__PURE__ */ jsxs7(Fragment2, { children: [
15555
- /* @__PURE__ */ jsx9(
15806
+ className: themeButtonClassName({ variant: "primary", size: "md" }),
15807
+ children: isSubmitting ? /* @__PURE__ */ jsxs9(Fragment, { children: [
15808
+ /* @__PURE__ */ jsx13(
15556
15809
  SpinnerNode,
15557
15810
  {
15558
15811
  size: "sm",
@@ -15566,61 +15819,32 @@ function HeadlessBookingDefaultForm({
15566
15819
  }
15567
15820
  )
15568
15821
  ] }),
15569
- /* @__PURE__ */ jsx9(DefaultBookingDiscount, { booking }),
15570
- /* @__PURE__ */ jsx9(DefaultBookingFeedback, { booking }),
15571
- /* @__PURE__ */ jsx9(DefaultBookingAltcha, { booking })
15822
+ /* @__PURE__ */ jsx13(DefaultBookingDiscount, { booking }),
15823
+ /* @__PURE__ */ jsx13(DefaultBookingFeedback, { booking }),
15824
+ /* @__PURE__ */ jsx13(DefaultBookingAltcha, { booking })
15572
15825
  ] });
15573
15826
  }
15574
- function DefaultBookingProgress({
15575
- steps,
15576
- currentIndex
15577
- }) {
15578
- return /* @__PURE__ */ jsx9("div", { className: "rb-flex rb-items-center rb-justify-between", children: steps.map((step, index) => {
15579
- const isActive = index === currentIndex;
15580
- const isCompleted = index < currentIndex;
15581
- const isLast = index === steps.length - 1;
15582
- return /* @__PURE__ */ jsxs7("div", { className: "rb-flex rb-items-center rb-flex-1", children: [
15583
- /* @__PURE__ */ jsxs7("div", { className: "rb-flex rb-items-center rb-gap-2 rb-cursor-default", children: [
15584
- /* @__PURE__ */ jsx9(
15585
- "div",
15586
- {
15587
- className: `
15588
- step-circle transition-theme-standard
15589
- ${isActive ? "step-circle-active" : ""}
15590
- ${isCompleted ? "step-circle-complete" : ""}
15591
- `,
15592
- children: isCompleted ? "\u2713" : index + 1
15593
- }
15594
- ),
15595
- /* @__PURE__ */ jsx9(
15596
- "span",
15597
- {
15598
- className: `
15599
- rb-caption rb-hidden rb-sm-inline
15600
- ${isCompleted || !isActive ? "status-muted" : ""}
15601
- `,
15602
- children: step.label
15603
- }
15604
- )
15605
- ] }),
15606
- !isLast ? /* @__PURE__ */ jsx9("div", { className: "step-connector rb-ml-2 rb-mr-2 rb-hidden rb-sm-block" }) : null
15607
- ] }, step.id);
15608
- }) });
15609
- }
15610
15827
  function DefaultBookingStepContent({
15611
- booking
15828
+ booking,
15829
+ errorSummaryId
15612
15830
  }) {
15613
15831
  const stepId = booking.currentStep?.id;
15614
15832
  if (!stepId) return null;
15615
15833
  switch (stepId) {
15616
15834
  case "service-selection":
15617
- return /* @__PURE__ */ jsx9(DefaultServiceSelectionStep, { booking });
15835
+ return /* @__PURE__ */ jsx13(DefaultServiceSelectionStep, { booking });
15618
15836
  case "datetime-selection":
15619
- return /* @__PURE__ */ jsx9(DefaultDateTimeSelectionStep, { booking });
15837
+ return /* @__PURE__ */ jsx13(
15838
+ DefaultDateTimeSelectionStep,
15839
+ {
15840
+ booking,
15841
+ errorSummaryId
15842
+ }
15843
+ );
15620
15844
  case "payment-selection":
15621
- return /* @__PURE__ */ jsx9(HeadlessBookingPaymentSelectionStep, { booking });
15845
+ return /* @__PURE__ */ jsx13(HeadlessBookingPaymentSelectionStep, { booking });
15622
15846
  case "custom-fields":
15623
- return /* @__PURE__ */ jsx9(DefaultDynamicFields, { fields: booking.fields.items, booking });
15847
+ return /* @__PURE__ */ jsx13(DefaultDynamicFields, { fields: booking.fields.items, booking });
15624
15848
  default:
15625
15849
  return assertNever4(stepId);
15626
15850
  }
@@ -15635,74 +15859,77 @@ function DefaultServiceSelectionStep({
15635
15859
  const showServiceSelect = booking.services.requiresSelection || services.length > 1;
15636
15860
  const showResourceSelect = booking.resources.requiresSelection || resources.length > 1;
15637
15861
  const allowAnyResource = !booking.resources.requiresSelection;
15638
- return /* @__PURE__ */ jsxs7("div", { className: "ab-stack", children: [
15639
- /* @__PURE__ */ jsxs7("div", { children: [
15640
- /* @__PURE__ */ jsx9("h2", { className: "ab-title", children: "Select Service" }),
15641
- /* @__PURE__ */ jsx9("p", { className: "ab-text ab-text--muted", children: "Choose the service you'd like to book" })
15862
+ return /* @__PURE__ */ jsxs9("div", { className: "rb-reg-stack", children: [
15863
+ /* @__PURE__ */ jsxs9("div", { children: [
15864
+ /* @__PURE__ */ jsx13("h2", { className: "ab-title", children: "Select Service" }),
15865
+ /* @__PURE__ */ jsx13("p", { className: "ab-text rb-on-surface--muted", children: "Choose the service you'd like to book" })
15642
15866
  ] }),
15643
- showServiceSelect ? /* @__PURE__ */ jsxs7("div", { className: "ab-stack--sm", children: [
15644
- /* @__PURE__ */ jsx9("label", { className: "ab-subtitle", children: "Service" }),
15645
- /* @__PURE__ */ jsx9("div", { className: "ab-grid", children: services.map((service) => {
15867
+ showServiceSelect ? /* @__PURE__ */ jsxs9("div", { className: "rb-reg-stack rb-reg-stack--sm", children: [
15868
+ /* @__PURE__ */ jsx13("span", { className: "ab-subtitle", children: "Service" }),
15869
+ /* @__PURE__ */ jsx13("div", { className: "rb-reg-grid", children: services.map((service) => {
15646
15870
  const isSelected = selectedServiceId === service.id;
15647
- return /* @__PURE__ */ jsx9(
15871
+ return /* @__PURE__ */ jsxs9(
15648
15872
  "button",
15649
15873
  {
15650
15874
  type: "button",
15651
15875
  onClick: () => booking.actions.selectService(service.id),
15652
- className: `ab-card ${isSelected ? "ab-card--selected" : ""}`,
15653
- children: /* @__PURE__ */ jsxs7("div", { className: "ab-row--between", children: [
15654
- /* @__PURE__ */ jsxs7("div", { children: [
15655
- /* @__PURE__ */ jsx9("div", { className: "ab-subtitle", children: service.title }),
15656
- service.description ? /* @__PURE__ */ jsx9("div", { className: "ab-text ab-text--muted", children: service.description }) : null,
15657
- service.durationMinutes ? /* @__PURE__ */ jsxs7("div", { className: "ab-text ab-text--muted", children: [
15876
+ className: optionCardClassName(isSelected),
15877
+ "aria-pressed": isSelected,
15878
+ children: [
15879
+ /* @__PURE__ */ jsxs9("div", { className: "rb-flex-1", children: [
15880
+ /* @__PURE__ */ jsx13("div", { className: "ab-subtitle", children: service.title }),
15881
+ service.description ? /* @__PURE__ */ jsx13("div", { className: "ab-text rb-on-surface--muted", children: service.description }) : null,
15882
+ service.durationMinutes ? /* @__PURE__ */ jsxs9("div", { className: "ab-text rb-on-surface--muted", children: [
15658
15883
  service.durationMinutes,
15659
15884
  " minutes"
15660
15885
  ] }) : null
15661
15886
  ] }),
15662
- isSelected ? /* @__PURE__ */ jsx9(SelectedCheck, {}) : null
15663
- ] })
15887
+ isSelected ? /* @__PURE__ */ jsx13(SelectedCheck, {}) : null
15888
+ ]
15664
15889
  },
15665
15890
  service.id
15666
15891
  );
15667
15892
  }) })
15668
15893
  ] }) : null,
15669
- booking.resources.state.tag === "loading" ? /* @__PURE__ */ jsxs7("div", { className: "ab-center", children: [
15670
- /* @__PURE__ */ jsx9(SpinnerNode, { size: "md", srLabel: "Loading practitioners" }),
15671
- /* @__PURE__ */ jsx9("p", { className: "ab-text ab-text--muted", children: "Loading practitioners..." })
15894
+ booking.resources.state.tag === "loading" ? /* @__PURE__ */ jsxs9("div", { className: "ab-center", children: [
15895
+ /* @__PURE__ */ jsx13(SpinnerNode, { size: "md", srLabel: "Loading practitioners" }),
15896
+ /* @__PURE__ */ jsx13("p", { className: "ab-text rb-on-surface--muted", children: "Loading practitioners..." })
15672
15897
  ] }) : null,
15673
- booking.resources.state.tag === "error" ? /* @__PURE__ */ jsx9(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: booking.resources.state.message }) : null,
15674
- showResourceSelect && booking.resources.state.tag === "loaded" && resources.length === 0 ? /* @__PURE__ */ jsx9(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: "No practitioners are available for this service right now." }) : null,
15675
- showResourceSelect && booking.resources.state.tag !== "loading" && (allowAnyResource || resources.length > 0) ? /* @__PURE__ */ jsxs7("div", { className: "ab-stack--sm", children: [
15676
- /* @__PURE__ */ jsxs7("label", { className: "ab-subtitle", children: [
15898
+ booking.resources.state.tag === "error" ? /* @__PURE__ */ jsx13(FeedbackMessage, { tone: "error", className: "alert alert-error", role: "alert", children: booking.resources.state.message }) : null,
15899
+ showResourceSelect && booking.resources.state.tag === "loaded" && resources.length === 0 ? /* @__PURE__ */ jsx13(FeedbackMessage, { tone: "error", className: "alert alert-error", role: "alert", children: "No practitioners are available for this service right now." }) : null,
15900
+ showResourceSelect && booking.resources.state.tag !== "loading" && (allowAnyResource || resources.length > 0) ? /* @__PURE__ */ jsxs9("div", { className: "rb-reg-stack rb-reg-stack--sm", children: [
15901
+ /* @__PURE__ */ jsxs9("span", { className: "ab-subtitle", children: [
15677
15902
  "Practitioner",
15678
15903
  booking.resources.requiresSelection ? "" : " (Optional)"
15679
15904
  ] }),
15680
- /* @__PURE__ */ jsx9("p", { className: "ab-text ab-text--muted", children: allowAnyResource ? 'Choose a specific practitioner or select "Any Available"' : "Choose the practitioner you'd like to book" }),
15681
- /* @__PURE__ */ jsxs7("div", { className: "ab-grid", children: [
15682
- allowAnyResource ? /* @__PURE__ */ jsx9(
15905
+ /* @__PURE__ */ jsx13("p", { className: "ab-text rb-on-surface--muted", children: allowAnyResource ? 'Choose a specific practitioner or select "Any Available"' : "Choose the practitioner you'd like to book" }),
15906
+ /* @__PURE__ */ jsxs9("div", { className: "rb-reg-grid", children: [
15907
+ allowAnyResource ? /* @__PURE__ */ jsxs9(
15683
15908
  "button",
15684
15909
  {
15685
15910
  type: "button",
15686
15911
  onClick: () => booking.actions.selectResource(null),
15687
- className: `ab-card ${!selectedResourceId ? "ab-card--selected" : ""}`,
15688
- children: /* @__PURE__ */ jsxs7("div", { className: "ab-row--between", children: [
15689
- /* @__PURE__ */ jsx9("div", { className: "ab-subtitle", children: "Any Available" }),
15690
- !selectedResourceId ? /* @__PURE__ */ jsx9(SelectedCheck, {}) : null
15691
- ] })
15912
+ className: optionCardClassName(!selectedResourceId),
15913
+ "aria-pressed": !selectedResourceId,
15914
+ children: [
15915
+ /* @__PURE__ */ jsx13("div", { className: "rb-flex-1 ab-subtitle", children: "Any Available" }),
15916
+ !selectedResourceId ? /* @__PURE__ */ jsx13(SelectedCheck, {}) : null
15917
+ ]
15692
15918
  }
15693
15919
  ) : null,
15694
15920
  resources.map((resource) => {
15695
15921
  const isSelected = selectedResourceId === resource.id;
15696
- return /* @__PURE__ */ jsx9(
15922
+ return /* @__PURE__ */ jsxs9(
15697
15923
  "button",
15698
15924
  {
15699
15925
  type: "button",
15700
15926
  onClick: () => booking.actions.selectResource(resource.id),
15701
- className: `ab-card ${isSelected ? "ab-card--selected" : ""}`,
15702
- children: /* @__PURE__ */ jsxs7("div", { className: "ab-row--between", children: [
15703
- /* @__PURE__ */ jsx9("div", { className: "ab-subtitle", children: resource.label }),
15704
- isSelected ? /* @__PURE__ */ jsx9(SelectedCheck, {}) : null
15705
- ] })
15927
+ className: optionCardClassName(isSelected),
15928
+ "aria-pressed": isSelected,
15929
+ children: [
15930
+ /* @__PURE__ */ jsx13("div", { className: "rb-flex-1 ab-subtitle", children: resource.label }),
15931
+ isSelected ? /* @__PURE__ */ jsx13(SelectedCheck, {}) : null
15932
+ ]
15706
15933
  },
15707
15934
  resource.id
15708
15935
  );
@@ -15712,28 +15939,31 @@ function DefaultServiceSelectionStep({
15712
15939
  ] });
15713
15940
  }
15714
15941
  function DefaultDateTimeSelectionStep({
15715
- booking
15942
+ booking,
15943
+ errorSummaryId
15716
15944
  }) {
15717
15945
  const selectedDate = booking.availability.selectedDate ?? "";
15718
- const selectedSlotStart = booking.availability.selectedSlot?.startAt ?? "";
15946
+ const selectedSlotKey = booking.availability.selectedSlot?.key ?? "";
15719
15947
  const singleService = booking.services.items.length === 1 ? booking.services.items[0] : void 0;
15720
- const slots = collapseHeadlessSlotsForDisplay({
15948
+ const slots = deriveBookingSlotDisplayOptions({
15721
15949
  slots: booking.availability.slots,
15722
15950
  hasSelectedResource: Boolean(booking.resources.selectedResourceId)
15723
15951
  });
15724
15952
  const error = booking.availability.datesState.tag === "error" ? booking.availability.datesState.message : booking.availability.slotsState.tag === "error" ? booking.availability.slotsState.message : null;
15725
- return /* @__PURE__ */ jsxs7("div", { className: "ab-stack", children: [
15726
- singleService ? /* @__PURE__ */ jsxs7("div", { className: "ab-info-box", children: [
15727
- /* @__PURE__ */ jsx9("h3", { className: "ab-subtitle", children: singleService.title }),
15728
- singleService.description ? /* @__PURE__ */ jsx9("p", { className: "ab-text ab-text--muted", children: singleService.description }) : null,
15729
- singleService.durationMinutes ? /* @__PURE__ */ jsxs7("p", { className: "ab-text ab-text--muted", children: [
15953
+ const hasValidationError = Boolean(booking.currentStep?.errors.formError);
15954
+ const validationDescribedBy = hasValidationError ? errorSummaryId : void 0;
15955
+ return /* @__PURE__ */ jsxs9("div", { className: "rb-reg-stack", children: [
15956
+ singleService ? /* @__PURE__ */ jsxs9("div", { className: "rb-reg-summary", children: [
15957
+ /* @__PURE__ */ jsx13("h3", { className: "ab-subtitle", children: singleService.title }),
15958
+ singleService.description ? /* @__PURE__ */ jsx13("p", { className: "ab-text rb-on-surface--muted", children: singleService.description }) : null,
15959
+ singleService.durationMinutes ? /* @__PURE__ */ jsxs9("p", { className: "ab-text rb-on-surface--muted", children: [
15730
15960
  "Duration: ",
15731
15961
  singleService.durationMinutes,
15732
15962
  " minutes"
15733
15963
  ] }) : null
15734
15964
  ] }) : null,
15735
- error ? /* @__PURE__ */ jsx9(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: error }) : null,
15736
- /* @__PURE__ */ jsx9(
15965
+ error ? /* @__PURE__ */ jsx13(FeedbackMessage, { tone: "error", className: "alert alert-error", role: "alert", children: error }) : null,
15966
+ /* @__PURE__ */ jsx13(
15737
15967
  DatePicker,
15738
15968
  {
15739
15969
  value: selectedDate,
@@ -15741,23 +15971,26 @@ function DefaultDateTimeSelectionStep({
15741
15971
  dateOptions: [...booking.availability.availableDates],
15742
15972
  isLoading: booking.availability.datesState.tag === "loading",
15743
15973
  isEmpty: booking.availability.datesState.tag !== "loading" && booking.availability.availableDates.length === 0,
15974
+ ariaDescribedBy: validationDescribedBy,
15975
+ ariaInvalid: hasValidationError,
15744
15976
  hasMore: booking.availability.hasMoreDates,
15745
15977
  onLoadMore: booking.availability.loadMoreDates
15746
15978
  }
15747
15979
  ),
15748
- selectedDate ? /* @__PURE__ */ jsx9(
15980
+ selectedDate ? /* @__PURE__ */ jsx13(
15749
15981
  TimeSlotSelector,
15750
15982
  {
15751
- value: selectedSlotStart,
15752
- onChange: (slotStartTime) => {
15983
+ value: selectedSlotKey,
15984
+ onChange: (slotKey) => {
15753
15985
  booking.actions.selectSlot(
15754
- booking.availability.slots.find(
15755
- (slot) => slot.startAt === slotStartTime
15756
- ) ?? null
15986
+ slots.find((slot) => slot.key === slotKey)?.slot ?? null
15757
15987
  );
15758
15988
  },
15759
15989
  slots,
15760
- isLoading: booking.availability.slotsState.tag === "loading"
15990
+ isLoading: booking.availability.slotsState.tag === "loading",
15991
+ timezone: booking.availability.timezone,
15992
+ ariaDescribedBy: validationDescribedBy,
15993
+ ariaInvalid: hasValidationError
15761
15994
  }
15762
15995
  ) : null
15763
15996
  ] });
@@ -15768,33 +16001,33 @@ function HeadlessBookingPaymentSelectionStep({
15768
16001
  const service = booking.services.selected;
15769
16002
  const viewModel = booking.payment.selection;
15770
16003
  if (booking.payment.kind === "unsupported") {
15771
- return /* @__PURE__ */ jsx9(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: booking.payment.errorMessage });
16004
+ return /* @__PURE__ */ jsx13(FeedbackMessage, { tone: "error", className: "alert alert-error", role: "alert", children: booking.payment.errorMessage });
15772
16005
  }
15773
16006
  if (!service || !viewModel) {
15774
- return /* @__PURE__ */ jsx9(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: "Payment options are unavailable for this service right now." });
16007
+ return /* @__PURE__ */ jsx13(FeedbackMessage, { tone: "error", className: "alert alert-error", role: "alert", children: "Payment options are unavailable for this service right now." });
15775
16008
  }
15776
16009
  const packageOptions = booking.payment.appointmentPackages.items;
15777
16010
  const hasPackageOptions = packageOptions.length > 0;
15778
16011
  const slidingScale = booking.payment.slidingScale;
15779
- return /* @__PURE__ */ jsxs7("div", { className: "ab-stack", children: [
15780
- /* @__PURE__ */ jsxs7("div", { className: "ab-info-box", children: [
15781
- /* @__PURE__ */ jsx9("h3", { className: "ab-subtitle", children: viewModel.sectionTitle }),
15782
- /* @__PURE__ */ jsx9("p", { className: "ab-text ab-text--muted", children: service.title })
16012
+ return /* @__PURE__ */ jsxs9("div", { className: "rb-reg-stack", children: [
16013
+ /* @__PURE__ */ jsxs9("div", { className: "rb-reg-summary", children: [
16014
+ /* @__PURE__ */ jsx13("h3", { className: "ab-subtitle", children: viewModel.sectionTitle }),
16015
+ /* @__PURE__ */ jsx13("p", { className: "ab-text rb-on-surface--muted", children: service.title })
15783
16016
  ] }),
15784
- booking.payment.appointmentPackages.state.tag === "loading" ? /* @__PURE__ */ jsx9(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info", role: "status", children: "Checking package credits..." }) : null,
15785
- booking.payment.appointmentPackages.state.tag === "error" ? /* @__PURE__ */ jsxs7(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info", role: "status", children: [
16017
+ booking.payment.appointmentPackages.state.tag === "loading" ? /* @__PURE__ */ jsx13(FeedbackMessage, { tone: "info", className: "alert alert-info", role: "status", children: "Checking package credits..." }) : null,
16018
+ booking.payment.appointmentPackages.state.tag === "error" ? /* @__PURE__ */ jsxs9(FeedbackMessage, { tone: "info", className: "alert alert-info", role: "status", children: [
15786
16019
  booking.payment.appointmentPackages.state.message,
15787
16020
  " You can continue with the normal payment option."
15788
16021
  ] }) : null,
15789
- slidingScale ? /* @__PURE__ */ jsxs7("div", { className: "rb-space-y-2", children: [
15790
- /* @__PURE__ */ jsx9("label", { htmlFor: "appointment-sliding-amount", className: "form-label", children: "Choose your price" }),
15791
- /* @__PURE__ */ jsxs7("p", { className: "rb-caption status-muted", children: [
16022
+ slidingScale ? /* @__PURE__ */ jsxs9("div", { className: "rb-space-y-2", children: [
16023
+ /* @__PURE__ */ jsx13("label", { htmlFor: "appointment-sliding-amount", className: "form-label", children: "Choose your price" }),
16024
+ /* @__PURE__ */ jsxs9("p", { className: "rb-caption status-muted", children: [
15792
16025
  formatBookingAmount(slidingScale.minAmount, slidingScale.currency),
15793
16026
  " to ",
15794
16027
  formatBookingAmount(slidingScale.maxAmount, slidingScale.currency),
15795
16028
  slidingScale.suggestedAmount !== null ? `, suggested ${formatBookingAmount(slidingScale.suggestedAmount, slidingScale.currency)}` : ""
15796
16029
  ] }),
15797
- /* @__PURE__ */ jsx9(
16030
+ /* @__PURE__ */ jsx13(
15798
16031
  "input",
15799
16032
  {
15800
16033
  id: "appointment-sliding-amount",
@@ -15808,47 +16041,47 @@ function HeadlessBookingPaymentSelectionStep({
15808
16041
  }
15809
16042
  )
15810
16043
  ] }) : null,
15811
- /* @__PURE__ */ jsxs7("div", { className: "ab-stack", role: "list", "aria-label": "Payment options", children: [
15812
- packageOptions.map((appointmentPackage) => {
15813
- const isSelected = booking.payment.selectedAppointmentPackageId === appointmentPackage.customerPassId;
15814
- return /* @__PURE__ */ jsx9(
15815
- "button",
15816
- {
15817
- type: "button",
15818
- className: themeButtonClassName({
15819
- variant: isSelected ? "primary" : "outline",
15820
- size: "md"
15821
- }),
15822
- style: paymentOptionLayoutStyle,
15823
- onClick: () => booking.actions.selectAppointmentPackage(
15824
- appointmentPackage.customerPassId
15825
- ),
15826
- "aria-pressed": isSelected,
15827
- children: /* @__PURE__ */ jsx9(
15828
- PaymentOptionContent,
16044
+ /* @__PURE__ */ jsxs9(
16045
+ "div",
16046
+ {
16047
+ className: "rb-reg-stack rb-reg-stack--sm",
16048
+ role: "list",
16049
+ "aria-label": "Payment options",
16050
+ children: [
16051
+ packageOptions.map((appointmentPackage) => {
16052
+ const isSelected = booking.payment.selectedAppointmentPackageId === appointmentPackage.customerPassId;
16053
+ return /* @__PURE__ */ jsxs9(
16054
+ "button",
15829
16055
  {
15830
- id: appointmentPackage.customerPassId,
15831
- title: appointmentPackage.passName,
15832
- description: "Use 1 package credit",
15833
- summaryRows: [{
15834
- label: "Balance",
15835
- value: `${appointmentPackage.creditsRemaining} of ${appointmentPackage.creditsTotal} credits remaining`
15836
- }]
15837
- }
15838
- )
15839
- },
15840
- appointmentPackage.customerPassId
15841
- );
15842
- }),
15843
- viewModel.options.map((option) => {
15844
- const isSelected = !booking.payment.selectedAppointmentPackageId && (booking.payment.selectedCollectionOptionKind === option.kind || viewModel.mode === "single_option");
15845
- if (viewModel.mode === "single_option" && !hasPackageOptions) {
15846
- return /* @__PURE__ */ jsx9(
15847
- "div",
15848
- {
15849
- className: "ab-card",
15850
- style: paymentOptionLayoutStyle,
15851
- children: /* @__PURE__ */ jsx9(
16056
+ type: "button",
16057
+ className: optionCardClassName(isSelected),
16058
+ onClick: () => booking.actions.selectAppointmentPackage(
16059
+ appointmentPackage.customerPassId
16060
+ ),
16061
+ "aria-pressed": isSelected,
16062
+ children: [
16063
+ /* @__PURE__ */ jsx13(
16064
+ PaymentOptionContent,
16065
+ {
16066
+ id: appointmentPackage.customerPassId,
16067
+ title: appointmentPackage.passName,
16068
+ description: "Use 1 package credit",
16069
+ summaryRows: [{
16070
+ label: "Balance",
16071
+ value: `${appointmentPackage.creditsRemaining} of ${appointmentPackage.creditsTotal} credits remaining`
16072
+ }]
16073
+ }
16074
+ ),
16075
+ isSelected ? /* @__PURE__ */ jsx13(SelectedCheck, {}) : null
16076
+ ]
16077
+ },
16078
+ appointmentPackage.customerPassId
16079
+ );
16080
+ }),
16081
+ viewModel.options.map((option) => {
16082
+ const isSelected = !booking.payment.selectedAppointmentPackageId && (booking.payment.selectedCollectionOptionKind === option.kind || viewModel.mode === "single_option");
16083
+ if (viewModel.mode === "single_option" && !hasPackageOptions) {
16084
+ return /* @__PURE__ */ jsx13("div", { className: "rb-reg-summary", children: /* @__PURE__ */ jsx13(
15852
16085
  PaymentOptionContent,
15853
16086
  {
15854
16087
  id: option.kind,
@@ -15857,37 +16090,35 @@ function HeadlessBookingPaymentSelectionStep({
15857
16090
  summaryRows: option.summaryRows,
15858
16091
  helperText: option.helperText
15859
16092
  }
15860
- )
15861
- },
15862
- option.kind
15863
- );
15864
- }
15865
- return /* @__PURE__ */ jsx9(
15866
- "button",
15867
- {
15868
- type: "button",
15869
- className: themeButtonClassName({
15870
- variant: isSelected ? "primary" : "outline",
15871
- size: "md"
15872
- }),
15873
- style: paymentOptionLayoutStyle,
15874
- onClick: () => booking.actions.selectPaymentOption(option.kind),
15875
- "aria-pressed": isSelected,
15876
- children: /* @__PURE__ */ jsx9(
15877
- PaymentOptionContent,
16093
+ ) }, option.kind);
16094
+ }
16095
+ return /* @__PURE__ */ jsxs9(
16096
+ "button",
15878
16097
  {
15879
- id: option.kind,
15880
- title: option.title,
15881
- description: option.description,
15882
- summaryRows: option.summaryRows,
15883
- helperText: option.helperText
15884
- }
15885
- )
15886
- },
15887
- option.kind
15888
- );
15889
- })
15890
- ] })
16098
+ type: "button",
16099
+ className: optionCardClassName(isSelected),
16100
+ onClick: () => booking.actions.selectPaymentOption(option.kind),
16101
+ "aria-pressed": isSelected,
16102
+ children: [
16103
+ /* @__PURE__ */ jsx13(
16104
+ PaymentOptionContent,
16105
+ {
16106
+ id: option.kind,
16107
+ title: option.title,
16108
+ description: option.description,
16109
+ summaryRows: option.summaryRows,
16110
+ helperText: option.helperText
16111
+ }
16112
+ ),
16113
+ isSelected ? /* @__PURE__ */ jsx13(SelectedCheck, {}) : null
16114
+ ]
16115
+ },
16116
+ option.kind
16117
+ );
16118
+ })
16119
+ ]
16120
+ }
16121
+ )
15891
16122
  ] });
15892
16123
  }
15893
16124
  function PaymentOptionContent({
@@ -15897,22 +16128,22 @@ function PaymentOptionContent({
15897
16128
  summaryRows,
15898
16129
  title
15899
16130
  }) {
15900
- return /* @__PURE__ */ jsxs7(Fragment2, { children: [
15901
- /* @__PURE__ */ jsx9("span", { children: title }),
15902
- /* @__PURE__ */ jsx9("span", { className: "ab-text ab-text--muted", children: description }),
15903
- /* @__PURE__ */ jsx9("div", { className: "ab-stack", style: summaryStackStyle, children: summaryRows.map((row) => /* @__PURE__ */ jsxs7("span", { className: "ab-text ab-text--muted", children: [
16131
+ return /* @__PURE__ */ jsxs9("div", { className: "rb-flex-1", children: [
16132
+ /* @__PURE__ */ jsx13("div", { className: "ab-subtitle", children: title }),
16133
+ /* @__PURE__ */ jsx13("div", { className: "ab-text rb-on-surface--muted", children: description }),
16134
+ /* @__PURE__ */ jsx13("div", { className: "ab-option-rows", children: summaryRows.map((row) => /* @__PURE__ */ jsxs9("span", { className: "ab-text rb-on-surface--muted", children: [
15904
16135
  row.label,
15905
16136
  ": ",
15906
16137
  row.value
15907
16138
  ] }, `${id}-${row.label}`)) }),
15908
- helperText ? /* @__PURE__ */ jsx9("span", { className: "ab-text ab-text--muted", children: helperText }) : null
16139
+ helperText ? /* @__PURE__ */ jsx13("div", { className: "ab-text rb-on-surface--muted", children: helperText }) : null
15909
16140
  ] });
15910
16141
  }
15911
16142
  function DefaultDynamicFields({
15912
16143
  booking,
15913
16144
  fields
15914
16145
  }) {
15915
- return /* @__PURE__ */ jsx9("div", { className: "rb-space-y-6", children: fields.map((field) => /* @__PURE__ */ jsx9(DefaultDynamicField, { booking, field }, field.id)) });
16146
+ return /* @__PURE__ */ jsx13("div", { className: "rb-space-y-6", children: fields.map((field) => /* @__PURE__ */ jsx13(DefaultDynamicField, { booking, field }, field.id)) });
15916
16147
  }
15917
16148
  function DefaultDynamicField({
15918
16149
  booking,
@@ -15922,13 +16153,13 @@ function DefaultDynamicField({
15922
16153
  const error = field.error;
15923
16154
  const errorId = error ? field.errorId ?? `${field.inputId}-error` : null;
15924
16155
  const describedBy = [field.helpTextId, errorId].filter(Boolean).join(" ") || void 0;
15925
- return /* @__PURE__ */ jsxs7("div", { className: "rb-space-y-2", children: [
15926
- /* @__PURE__ */ jsxs7("label", { id: field.labelId, htmlFor: field.inputId, className: "form-label", children: [
16156
+ return /* @__PURE__ */ jsxs9("div", { className: "rb-space-y-2", children: [
16157
+ /* @__PURE__ */ jsxs9("label", { id: field.labelId, htmlFor: field.inputId, className: "form-label", children: [
15927
16158
  field.label,
15928
- field.required ? /* @__PURE__ */ jsx9("span", { className: "required-marker", children: "*" }) : null
16159
+ field.required ? /* @__PURE__ */ jsx13("span", { className: "required-marker", children: "*" }) : null
15929
16160
  ] }),
15930
- field.helpText ? /* @__PURE__ */ jsx9("p", { id: field.helpTextId ?? void 0, className: "rb-caption status-muted", children: field.helpText }) : null,
15931
- /* @__PURE__ */ jsx9(
16161
+ field.helpText ? /* @__PURE__ */ jsx13("p", { id: field.helpTextId ?? void 0, className: "rb-caption status-muted", children: field.helpText }) : null,
16162
+ /* @__PURE__ */ jsx13(
15932
16163
  DefaultFieldInput,
15933
16164
  {
15934
16165
  field,
@@ -15940,7 +16171,7 @@ function DefaultDynamicField({
15940
16171
  describedBy
15941
16172
  }
15942
16173
  ),
15943
- error ? /* @__PURE__ */ jsx9(
16174
+ error ? /* @__PURE__ */ jsx13(
15944
16175
  FieldValidationMessage,
15945
16176
  {
15946
16177
  id: errorId ?? `${field.inputId}-error`,
@@ -15974,7 +16205,7 @@ function DefaultFieldInput({
15974
16205
  };
15975
16206
  switch (field.type) {
15976
16207
  case "textarea":
15977
- return /* @__PURE__ */ jsx9(
16208
+ return /* @__PURE__ */ jsx13(
15978
16209
  "textarea",
15979
16210
  {
15980
16211
  ...commonProps,
@@ -15989,7 +16220,7 @@ function DefaultFieldInput({
15989
16220
  );
15990
16221
  case "select":
15991
16222
  if (field.field.multiple) {
15992
- return /* @__PURE__ */ jsx9(
16223
+ return /* @__PURE__ */ jsx13(
15993
16224
  "select",
15994
16225
  {
15995
16226
  ...commonProps,
@@ -16002,11 +16233,11 @@ function DefaultFieldInput({
16002
16233
  },
16003
16234
  multiple: true,
16004
16235
  className: "form-select rb-h-32",
16005
- children: field.field.options?.map((option) => /* @__PURE__ */ jsx9("option", { value: option.value, children: option.label }, option.value))
16236
+ children: field.field.options?.map((option) => /* @__PURE__ */ jsx13("option", { value: option.value, children: option.label }, option.value))
16006
16237
  }
16007
16238
  );
16008
16239
  }
16009
- return /* @__PURE__ */ jsxs7(
16240
+ return /* @__PURE__ */ jsxs9(
16010
16241
  "select",
16011
16242
  {
16012
16243
  ...commonProps,
@@ -16014,14 +16245,14 @@ function DefaultFieldInput({
16014
16245
  onChange: (event) => onChange(event.target.value),
16015
16246
  className: "form-select",
16016
16247
  children: [
16017
- /* @__PURE__ */ jsx9("option", { value: "", children: "Select an option..." }),
16018
- field.field.options?.map((option) => /* @__PURE__ */ jsx9("option", { value: option.value, children: option.label }, option.value))
16248
+ /* @__PURE__ */ jsx13("option", { value: "", children: "Select an option..." }),
16249
+ field.field.options?.map((option) => /* @__PURE__ */ jsx13("option", { value: option.value, children: option.label }, option.value))
16019
16250
  ]
16020
16251
  }
16021
16252
  );
16022
16253
  case "radio":
16023
- return /* @__PURE__ */ jsx9("div", { className: "rb-space-y-2", children: field.field.options?.map((option) => /* @__PURE__ */ jsxs7("label", { className: "rb-flex rb-items-center rb-gap-2 rb-cursor-pointer", children: [
16024
- /* @__PURE__ */ jsx9(
16254
+ return /* @__PURE__ */ jsx13("div", { className: "rb-space-y-2", children: field.field.options?.map((option) => /* @__PURE__ */ jsxs9("label", { className: "rb-flex rb-items-center rb-gap-2 rb-cursor-pointer", children: [
16255
+ /* @__PURE__ */ jsx13(
16025
16256
  "input",
16026
16257
  {
16027
16258
  type: "radio",
@@ -16035,13 +16266,13 @@ function DefaultFieldInput({
16035
16266
  className: "form-radio"
16036
16267
  }
16037
16268
  ),
16038
- /* @__PURE__ */ jsx9("span", { className: "rb-caption", children: option.label })
16269
+ /* @__PURE__ */ jsx13("span", { className: "rb-caption", children: option.label })
16039
16270
  ] }, option.value)) });
16040
16271
  case "checkbox":
16041
16272
  if (field.field.options && field.field.options.length > 1) {
16042
16273
  const checkedValues = toStringArray(value);
16043
- return /* @__PURE__ */ jsx9("div", { className: "rb-space-y-2", children: field.field.options.map((option) => /* @__PURE__ */ jsxs7("label", { className: "rb-flex rb-items-center rb-gap-2 rb-cursor-pointer", children: [
16044
- /* @__PURE__ */ jsx9(
16274
+ return /* @__PURE__ */ jsx13("div", { className: "rb-space-y-2", children: field.field.options.map((option) => /* @__PURE__ */ jsxs9("label", { className: "rb-flex rb-items-center rb-gap-2 rb-cursor-pointer", children: [
16275
+ /* @__PURE__ */ jsx13(
16045
16276
  "input",
16046
16277
  {
16047
16278
  type: "checkbox",
@@ -16058,11 +16289,11 @@ function DefaultFieldInput({
16058
16289
  className: "form-checkbox"
16059
16290
  }
16060
16291
  ),
16061
- /* @__PURE__ */ jsx9("span", { className: "rb-caption", children: option.label })
16292
+ /* @__PURE__ */ jsx13("span", { className: "rb-caption", children: option.label })
16062
16293
  ] }, option.value)) });
16063
16294
  }
16064
- return /* @__PURE__ */ jsxs7("label", { className: "rb-flex rb-items-center rb-gap-2 rb-cursor-pointer", children: [
16065
- /* @__PURE__ */ jsx9(
16295
+ return /* @__PURE__ */ jsxs9("label", { className: "rb-flex rb-items-center rb-gap-2 rb-cursor-pointer", children: [
16296
+ /* @__PURE__ */ jsx13(
16066
16297
  "input",
16067
16298
  {
16068
16299
  type: "checkbox",
@@ -16076,11 +16307,11 @@ function DefaultFieldInput({
16076
16307
  className: "form-checkbox"
16077
16308
  }
16078
16309
  ),
16079
- /* @__PURE__ */ jsx9("span", { className: "rb-caption", children: field.field.placeholder || field.label })
16310
+ /* @__PURE__ */ jsx13("span", { className: "rb-caption", children: field.field.placeholder || field.label })
16080
16311
  ] });
16081
16312
  case "booking_requirement_consent":
16082
- return /* @__PURE__ */ jsxs7("label", { className: "rb-flex rb-items-start rb-gap-2 rb-cursor-pointer", children: [
16083
- /* @__PURE__ */ jsx9(
16313
+ return /* @__PURE__ */ jsxs9("label", { className: "rb-flex rb-items-start rb-gap-2 rb-cursor-pointer", children: [
16314
+ /* @__PURE__ */ jsx13(
16084
16315
  "input",
16085
16316
  {
16086
16317
  type: "checkbox",
@@ -16094,10 +16325,10 @@ function DefaultFieldInput({
16094
16325
  className: "form-checkbox rb-mt-0.5"
16095
16326
  }
16096
16327
  ),
16097
- /* @__PURE__ */ jsx9("span", { className: "rb-caption", children: field.field.placeholder || field.label })
16328
+ /* @__PURE__ */ jsx13("span", { className: "rb-caption", children: field.field.placeholder || field.label })
16098
16329
  ] });
16099
16330
  case "number":
16100
- return /* @__PURE__ */ jsx9(
16331
+ return /* @__PURE__ */ jsx13(
16101
16332
  "input",
16102
16333
  {
16103
16334
  ...commonProps,
@@ -16111,7 +16342,7 @@ function DefaultFieldInput({
16111
16342
  }
16112
16343
  );
16113
16344
  case "date":
16114
- return /* @__PURE__ */ jsx9(
16345
+ return /* @__PURE__ */ jsx13(
16115
16346
  "input",
16116
16347
  {
16117
16348
  ...commonProps,
@@ -16124,7 +16355,7 @@ function DefaultFieldInput({
16124
16355
  }
16125
16356
  );
16126
16357
  case "time":
16127
- return /* @__PURE__ */ jsx9(
16358
+ return /* @__PURE__ */ jsx13(
16128
16359
  "input",
16129
16360
  {
16130
16361
  ...commonProps,
@@ -16138,7 +16369,7 @@ function DefaultFieldInput({
16138
16369
  case "email":
16139
16370
  case "tel":
16140
16371
  case "url":
16141
- return /* @__PURE__ */ jsx9(
16372
+ return /* @__PURE__ */ jsx13(
16142
16373
  "input",
16143
16374
  {
16144
16375
  ...commonProps,
@@ -16162,8 +16393,8 @@ function DefaultBookingDiscount({
16162
16393
  }) {
16163
16394
  const shouldShowDiscountSection = !booking.payment.selectedAppointmentPackageId && !booking.discount.loading && (booking.discount.manualCodeEntryAllowed || Boolean(booking.discount.autoAppliedDiscount));
16164
16395
  if (!shouldShowDiscountSection) return null;
16165
- return /* @__PURE__ */ jsxs7("div", { className: "rb-mt-6", children: [
16166
- booking.discount.manualCodeEntryAllowed ? /* @__PURE__ */ jsx9(
16396
+ return /* @__PURE__ */ jsxs9("div", { className: "rb-mt-6", children: [
16397
+ booking.discount.manualCodeEntryAllowed ? /* @__PURE__ */ jsx13(
16167
16398
  DiscountCodeDisclosure,
16168
16399
  {
16169
16400
  surface: "theme-form",
@@ -16177,7 +16408,7 @@ function DefaultBookingDiscount({
16177
16408
  }
16178
16409
  }
16179
16410
  ) : null,
16180
- booking.discount.autoAppliedDiscount && booking.discount.code.trim().length === 0 ? /* @__PURE__ */ jsx9(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info rb-mt-4", role: "status", children: /* @__PURE__ */ jsxs7("p", { className: "ab-text", children: [
16411
+ booking.discount.autoAppliedDiscount && booking.discount.code.trim().length === 0 ? /* @__PURE__ */ jsx13(FeedbackMessage, { tone: "info", className: "alert alert-info rb-mt-4", role: "status", children: /* @__PURE__ */ jsxs9("p", { className: "ab-text", children: [
16181
16412
  "Discount available: ",
16182
16413
  booking.discount.autoAppliedDiscount.publicLabel,
16183
16414
  " ",
@@ -16189,9 +16420,9 @@ function DefaultBookingFeedback({
16189
16420
  booking
16190
16421
  }) {
16191
16422
  if (booking.feedback.kind !== "error") return null;
16192
- return /* @__PURE__ */ jsxs7(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: [
16193
- /* @__PURE__ */ jsx9("p", { className: "ab-text", children: booking.feedback.message }),
16194
- /* @__PURE__ */ jsx9(
16423
+ return /* @__PURE__ */ jsxs9(FeedbackMessage, { tone: "error", className: "alert alert-error rb-mt-4", role: "alert", children: [
16424
+ /* @__PURE__ */ jsx13("p", { className: "ab-text", children: booking.feedback.message }),
16425
+ /* @__PURE__ */ jsx13(
16195
16426
  "button",
16196
16427
  {
16197
16428
  type: "button",
@@ -16206,7 +16437,7 @@ function DefaultBookingAltcha({
16206
16437
  booking
16207
16438
  }) {
16208
16439
  if (!booking.spamProtection.enabled) return null;
16209
- return /* @__PURE__ */ jsx9("div", { className: "ab-altcha", children: /* @__PURE__ */ jsx9(
16440
+ return /* @__PURE__ */ jsx13("div", { className: "ab-altcha", children: /* @__PURE__ */ jsx13(
16210
16441
  AltchaWidget,
16211
16442
  {
16212
16443
  challengeUrl: booking.spamProtection.challenge.url,
@@ -16215,43 +16446,26 @@ function DefaultBookingAltcha({
16215
16446
  ) });
16216
16447
  }
16217
16448
  function DefaultBookingErrorSummary({
16218
- errors
16449
+ errors,
16450
+ id
16219
16451
  }) {
16220
16452
  if (!hasBookingValidationErrors(errors)) return null;
16221
- return /* @__PURE__ */ jsxs7(FeedbackMessage, { tone: "error", className: "rb-mt-6 alert alert-error", role: "alert", children: [
16222
- errors.formError ? /* @__PURE__ */ jsx9("p", { className: "rb-caption", children: /* @__PURE__ */ jsx9("strong", { children: errors.formError }) }) : null,
16223
- Object.entries(errors.fieldErrors).map(([key, message]) => /* @__PURE__ */ jsx9("p", { className: "rb-caption", children: message }, key))
16224
- ] });
16225
- }
16226
- function SelectedCheck() {
16227
- return /* @__PURE__ */ jsx9("div", { className: "ab-check", children: /* @__PURE__ */ jsx9(
16228
- "svg",
16453
+ return /* @__PURE__ */ jsxs9(
16454
+ FeedbackMessage,
16229
16455
  {
16230
- fill: "none",
16231
- strokeLinecap: "round",
16232
- strokeLinejoin: "round",
16233
- strokeWidth: "2",
16234
- viewBox: "0 0 24 24",
16235
- stroke: "currentColor",
16236
- children: /* @__PURE__ */ jsx9("path", { d: "M5 13l4 4L19 7" })
16456
+ tone: "error",
16457
+ className: "rb-mt-6 alert alert-error",
16458
+ id,
16459
+ role: "alert",
16460
+ children: [
16461
+ errors.formError ? /* @__PURE__ */ jsx13("p", { className: "rb-caption", children: /* @__PURE__ */ jsx13("strong", { children: errors.formError }) }) : null,
16462
+ Object.entries(errors.fieldErrors).map(([key, message]) => /* @__PURE__ */ jsx13("p", { className: "rb-caption", children: message }, key))
16463
+ ]
16237
16464
  }
16238
- ) });
16465
+ );
16239
16466
  }
16240
- function collapseHeadlessSlotsForDisplay(input) {
16241
- const seenStartTimes = /* @__PURE__ */ new Set();
16242
- const visibleSlots = [];
16243
- for (const slot of input.slots) {
16244
- if (!input.hasSelectedResource) {
16245
- if (seenStartTimes.has(slot.startAt)) continue;
16246
- seenStartTimes.add(slot.startAt);
16247
- }
16248
- visibleSlots.push({
16249
- startAt: slot.startAt,
16250
- endAt: slot.endAt,
16251
- resourceId: unsafeAsAppointmentResourceId(slot.resourceId)
16252
- });
16253
- }
16254
- return visibleSlots;
16467
+ function SelectedCheck() {
16468
+ return /* @__PURE__ */ jsx13("div", { className: "rb-option-check", children: /* @__PURE__ */ jsx13(CheckIcon, {}) });
16255
16469
  }
16256
16470
 
16257
16471
  // ../blocks/src/system/runtime/shared/utils/checkoutUrls.ts
@@ -16300,7 +16514,7 @@ function consumeSearchParam(paramName) {
16300
16514
  }
16301
16515
 
16302
16516
  // ../blocks/src/system/runtime/nodes/booking-form.client.tsx
16303
- import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
16517
+ import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
16304
16518
  var PORTAL_REBOOK_QUERY_PARAM = "rebook";
16305
16519
  var PORTAL_REBOOK_QUERY_VALUE = "1";
16306
16520
  var REBOOK_COMPLETION_MODE_VERIFIED_CHECKOUT = "verified_checkout";
@@ -16325,6 +16539,14 @@ function appendRebookFlag(url, enabled) {
16325
16539
  );
16326
16540
  return nextUrl.toString();
16327
16541
  }
16542
+ function BookingSurface({
16543
+ id,
16544
+ className,
16545
+ children
16546
+ }) {
16547
+ const classes = ["rb-reg-surface", className ?? ""].join(" ").trim();
16548
+ return /* @__PURE__ */ jsx14("div", { id, className: classes, children });
16549
+ }
16328
16550
  var BookingFormClient = ({
16329
16551
  siteId: siteIdProp,
16330
16552
  render
@@ -16361,7 +16583,7 @@ var BookingFormClient = ({
16361
16583
  successMessage: render.display.successMessage ?? void 0,
16362
16584
  viewerTimeZone
16363
16585
  });
16364
- React3.useEffect(() => {
16586
+ React6.useEffect(() => {
16365
16587
  if (!siteId) {
16366
16588
  console.error("[BookingFormClient] ERROR: siteId is missing!");
16367
16589
  }
@@ -16378,7 +16600,7 @@ var BookingFormClient = ({
16378
16600
  redirectState,
16379
16601
  verificationState: verification.state
16380
16602
  });
16381
- React3.useEffect(() => {
16603
+ React6.useEffect(() => {
16382
16604
  if (viewState.kind === "error") {
16383
16605
  scrollToBlock(bookingAnchorId);
16384
16606
  }
@@ -16387,12 +16609,12 @@ var BookingFormClient = ({
16387
16609
  viewState.kind,
16388
16610
  viewState.kind === "error" ? viewState.message : null
16389
16611
  ]);
16390
- React3.useEffect(() => {
16612
+ React6.useEffect(() => {
16391
16613
  if (viewState.kind === "success" && redirectState.kind === "success") {
16392
16614
  scrollToBlock(bookingAnchorId);
16393
16615
  }
16394
16616
  }, [bookingAnchorId, redirectState.kind, viewState.kind]);
16395
- React3.useEffect(() => {
16617
+ React6.useEffect(() => {
16396
16618
  if (!isPortalRebook || viewState.kind !== "success") {
16397
16619
  return;
16398
16620
  }
@@ -16418,13 +16640,13 @@ var BookingFormClient = ({
16418
16640
  viewState.kind
16419
16641
  ]);
16420
16642
  if (render.display.state === "missing" || !form || !render.hydration.formId) {
16421
- return /* @__PURE__ */ jsx10(
16643
+ return /* @__PURE__ */ jsx14(
16422
16644
  FeedbackMessage,
16423
16645
  {
16424
16646
  tone: "error",
16425
- className: `ab-alert ab-alert--error ${render.display.className ?? ""}`.trim(),
16647
+ className: `alert alert-error ${render.display.className ?? ""}`.trim(),
16426
16648
  role: "alert",
16427
- children: /* @__PURE__ */ jsx10("p", { className: "ab-text", children: render.display.message ?? "Booking form not found. Please check your configuration." })
16649
+ children: /* @__PURE__ */ jsx14("p", { className: "ab-text", children: render.display.message ?? "Booking form not found. Please check your configuration." })
16428
16650
  }
16429
16651
  );
16430
16652
  }
@@ -16444,29 +16666,21 @@ var BookingFormClient = ({
16444
16666
  }
16445
16667
  };
16446
16668
  if (viewState.kind === "success") {
16447
- return /* @__PURE__ */ jsx10(
16669
+ return /* @__PURE__ */ jsx14(BookingSurface, { id: bookingAnchorId, className: render.display.className, children: /* @__PURE__ */ jsx14(
16448
16670
  SuccessMessage,
16449
16671
  {
16450
16672
  message: getBookingSuccessMessage(render.display.successMessage),
16451
- resourceName: viewState.resourceName,
16452
- className: render.display.className ?? void 0
16673
+ resourceName: viewState.resourceName
16453
16674
  }
16454
- );
16675
+ ) });
16455
16676
  }
16456
16677
  if (viewState.kind === "verifying") {
16457
- return /* @__PURE__ */ jsx10(
16458
- "div",
16459
- {
16460
- id: bookingAnchorId,
16461
- className: render.display.className ?? void 0,
16462
- children: /* @__PURE__ */ jsx10(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info", role: "status", children: /* @__PURE__ */ jsx10("p", { className: "ab-text", children: viewState.message }) })
16463
- }
16464
- );
16678
+ return /* @__PURE__ */ jsx14(BookingSurface, { id: bookingAnchorId, className: render.display.className, children: /* @__PURE__ */ jsx14(FeedbackMessage, { tone: "info", className: "alert alert-info", role: "status", children: /* @__PURE__ */ jsx14("p", { className: "ab-text", children: viewState.message }) }) });
16465
16679
  }
16466
- return /* @__PURE__ */ jsxs8("div", { id: bookingAnchorId, className: render.display.className ?? void 0, children: [
16467
- render.hydration.noticeMessage ? /* @__PURE__ */ jsx10(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info rb-mb-4", role: "status", children: /* @__PURE__ */ jsx10("p", { className: "ab-text", children: render.hydration.noticeMessage }) }) : null,
16468
- viewState.kind === "error" ? /* @__PURE__ */ jsx10(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: /* @__PURE__ */ jsx10("p", { className: "ab-text", children: viewState.message }) }) : null,
16469
- /* @__PURE__ */ jsx10(HeadlessBookingDefaultForm, { booking, onSubmit: handleComplete })
16680
+ return /* @__PURE__ */ jsxs10(BookingSurface, { id: bookingAnchorId, className: render.display.className, children: [
16681
+ render.hydration.noticeMessage ? /* @__PURE__ */ jsx14(FeedbackMessage, { tone: "info", className: "alert alert-info rb-mb-4", role: "status", children: /* @__PURE__ */ jsx14("p", { className: "ab-text", children: render.hydration.noticeMessage }) }) : null,
16682
+ viewState.kind === "error" ? /* @__PURE__ */ jsx14(FeedbackMessage, { tone: "error", className: "alert alert-error rb-mb-4", role: "alert", children: /* @__PURE__ */ jsx14("p", { className: "ab-text", children: viewState.message }) }) : null,
16683
+ /* @__PURE__ */ jsx14(HeadlessBookingDefaultForm, { booking, onSubmit: handleComplete })
16470
16684
  ] });
16471
16685
  };
16472
16686
 
@@ -18906,6 +19120,34 @@ ${root} {
18906
19120
  /* Order summary */
18907
19121
  --er-summary-bg: rgba(var(--tb-primary), 0.1);
18908
19122
  --er-summary-border: rgb(var(--tb-border));
19123
+
19124
+ /* Shared registration-surface mappings (issue 1174).
19125
+ Route the shared --rb-reg-* contract through this block's documented
19126
+ Tier 3 vars so existing --er-* overrides keep working unchanged. */
19127
+ --rb-reg-radius: var(--er-radius);
19128
+ --rb-reg-border: var(--er-border);
19129
+ --rb-reg-border-hover: var(--er-border-hover);
19130
+ --rb-reg-border-selected: var(--er-border-selected);
19131
+ --rb-reg-bg-selected: var(--er-payment-bg-selected);
19132
+ --rb-reg-option-bg: var(--er-control-bg);
19133
+ --rb-reg-option-hover-shadow: 0 8px 18px rgba(var(--tb-shadow, 15 23 42), 0.08);
19134
+ --rb-reg-surface-bg: rgb(var(--tb-surface));
19135
+ --rb-reg-on-surface: var(--er-on-surface);
19136
+ --rb-reg-on-surface-muted: var(--er-on-surface-muted);
19137
+ --rb-reg-on-surface-subtle: var(--er-on-surface-subtle);
19138
+ --rb-reg-on-surface-faint: var(--er-on-surface-faint);
19139
+ --rb-reg-check-bg: var(--er-check-bg);
19140
+ --rb-reg-check-text: var(--er-check-text);
19141
+ --rb-reg-step-active: var(--er-step-active);
19142
+ --rb-reg-step-completed: var(--er-step-completed);
19143
+ --rb-reg-step-inactive: var(--er-step-inactive);
19144
+ --rb-reg-step-text: var(--er-step-text);
19145
+ --rb-reg-step-text-active: var(--er-step-text-active);
19146
+ --rb-reg-step-connector: var(--er-step-connector);
19147
+ --rb-reg-summary-bg: var(--er-surface-muted);
19148
+ --rb-reg-summary-border: var(--er-border);
19149
+ --rb-reg-focus-ring: var(--er-focus-ring);
19150
+ --rb-reg-shell-line: var(--er-shell-line);
18909
19151
  }
18910
19152
  `;
18911
19153
  }
@@ -19038,25 +19280,40 @@ ${root} {
19038
19280
  --ab-info-bg: rgba(var(--tb-info), 0.1);
19039
19281
  --ab-info-text: rgb(var(--tb-info));
19040
19282
 
19041
- /* Loading/muted states */
19283
+ /* Muted summary state */
19042
19284
  --ab-muted-bg: rgba(var(--tb-text), 0.05);
19043
- --ab-muted-text: rgba(var(--tb-text), 0.6);
19044
- --ab-spinner-color: rgb(var(--tb-primary));
19045
19285
 
19046
- /* Form elements */
19047
- --ab-input-border: rgb(var(--tb-border));
19286
+ /* Focus ring used by shared registration-surface controls */
19048
19287
  --ab-input-focus-ring: rgba(var(--tb-primary), 0.3);
19049
19288
 
19050
- /* Buttons */
19051
- --ab-btn-primary-bg: rgb(var(--tb-primary));
19052
- --ab-btn-primary-text: rgb(var(--tb-background));
19053
- --ab-btn-primary-hover: rgba(var(--tb-primary), 0.9);
19054
- --ab-btn-secondary-border: rgb(var(--tb-border));
19055
- --ab-btn-secondary-hover: rgba(var(--tb-text), 0.05);
19056
-
19057
- /* Text opacity levels */
19058
- --ab-text-muted-opacity: 0.6;
19059
- --ab-text-faint-opacity: 0.4;
19289
+ /* Shared registration-surface mappings (issue 1174).
19290
+ Route the shared --rb-reg-* contract through this block's Tier 3 vars
19291
+ (palette tokens where no --ab-* var exists) so --ab-* overrides keep
19292
+ working as the block adopts the shared classes. */
19293
+ --rb-reg-radius: var(--ab-card-radius, var(--rb-block-radius));
19294
+ --rb-reg-border: var(--ab-card-border);
19295
+ --rb-reg-border-hover: var(--ab-card-border-hover);
19296
+ --rb-reg-border-selected: var(--ab-card-border-selected);
19297
+ --rb-reg-bg-selected: var(--ab-card-bg-selected);
19298
+ --rb-reg-option-bg: transparent;
19299
+ --rb-reg-option-hover-shadow: 0 8px 18px rgba(var(--tb-shadow, 15 23 42), 0.08);
19300
+ --rb-reg-surface-bg: rgb(var(--tb-surface));
19301
+ --rb-reg-on-surface: rgb(var(--tb-onSurface, var(--tb-text)));
19302
+ --rb-reg-on-surface-muted: rgba(var(--tb-onSurface, var(--tb-text)), 0.7);
19303
+ --rb-reg-on-surface-subtle: rgba(var(--tb-onSurface, var(--tb-text)), 0.6);
19304
+ --rb-reg-on-surface-faint: rgba(var(--tb-onSurface, var(--tb-text)), 0.5);
19305
+ --rb-reg-check-bg: var(--ab-check-bg);
19306
+ --rb-reg-check-text: var(--ab-check-text);
19307
+ --rb-reg-step-active: rgb(var(--tb-primary));
19308
+ --rb-reg-step-completed: rgb(var(--tb-success));
19309
+ --rb-reg-step-inactive: rgb(var(--tb-mutedText));
19310
+ --rb-reg-step-text: rgb(255 255 255);
19311
+ --rb-reg-step-text-active: rgb(var(--tb-primaryText, 255 255 255));
19312
+ --rb-reg-step-connector: rgba(var(--tb-border), 0.5);
19313
+ --rb-reg-summary-bg: var(--ab-muted-bg);
19314
+ --rb-reg-summary-border: var(--ab-card-border);
19315
+ --rb-reg-focus-ring: var(--ab-input-focus-ring);
19316
+ --rb-reg-shell-line: rgba(var(--tb-mutedText, 100 116 139), 0.22);
19060
19317
  }
19061
19318
  `;
19062
19319
  }
@@ -19347,6 +19604,35 @@ ${root} {
19347
19604
  /* Summary */
19348
19605
  --cr-summary-bg: rgba(var(--tb-primary), 0.1);
19349
19606
  --cr-summary-border: rgb(var(--tb-border));
19607
+
19608
+ /* Shared registration-surface mappings (issue 1174).
19609
+ Route the shared --rb-reg-* contract through this block's Tier 3 vars
19610
+ (palette tokens where no --cr-* var exists) so existing --cr-* overrides
19611
+ keep working unchanged. */
19612
+ --rb-reg-radius: var(--rb-block-radius);
19613
+ --rb-reg-border: var(--cr-border);
19614
+ --rb-reg-border-hover: var(--cr-border-hover);
19615
+ --rb-reg-border-selected: var(--cr-border-selected);
19616
+ --rb-reg-bg-selected: var(--cr-payment-bg-selected);
19617
+ --rb-reg-option-bg: rgb(var(--tb-background));
19618
+ --rb-reg-option-hover-shadow: 0 8px 18px rgba(var(--tb-shadow, 15 23 42), 0.08);
19619
+ --rb-reg-surface-bg: rgb(var(--tb-surface));
19620
+ --rb-reg-on-surface: var(--cr-on-surface);
19621
+ --rb-reg-on-surface-muted: rgba(var(--tb-onSurface, var(--tb-text)), 0.7);
19622
+ --rb-reg-on-surface-subtle: rgba(var(--tb-onSurface, var(--tb-text)), 0.6);
19623
+ --rb-reg-on-surface-faint: rgba(var(--tb-onSurface, var(--tb-text)), 0.5);
19624
+ --rb-reg-check-bg: var(--cr-check-bg);
19625
+ --rb-reg-check-text: var(--cr-check-text);
19626
+ --rb-reg-step-active: var(--cr-step-active);
19627
+ --rb-reg-step-completed: var(--cr-step-completed);
19628
+ --rb-reg-step-inactive: var(--cr-step-inactive);
19629
+ --rb-reg-step-text: var(--cr-step-text);
19630
+ --rb-reg-step-text-active: var(--cr-step-text-active);
19631
+ --rb-reg-step-connector: var(--cr-step-connector);
19632
+ --rb-reg-summary-bg: var(--cr-summary-bg);
19633
+ --rb-reg-summary-border: var(--cr-summary-border);
19634
+ --rb-reg-focus-ring: var(--cr-focus-ring);
19635
+ --rb-reg-shell-line: rgba(var(--tb-mutedText, 100 116 139), 0.22);
19350
19636
  }
19351
19637
  `;
19352
19638
  }
@@ -19393,13 +19679,13 @@ function buildResponsiveScopeRulePatternSource() {
19393
19679
  }
19394
19680
 
19395
19681
  // ../theme-core/src/ThemeScopeCore.tsx
19396
- import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
19682
+ import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
19397
19683
 
19398
19684
  // ../theme-core/src/ClientThemeScope.tsx
19399
- import { jsx as jsx12 } from "react/jsx-runtime";
19685
+ import { jsx as jsx16 } from "react/jsx-runtime";
19400
19686
 
19401
19687
  // ../blocks/src/system/runtime/hooks/useHeadlessEventRegistrationFlow.ts
19402
- import React4, { useCallback as useCallback7, useMemo as useMemo8 } from "react";
19688
+ import React7, { useCallback as useCallback7, useMemo as useMemo8 } from "react";
19403
19689
  var eventRegistrationControllerDeps = {
19404
19690
  useEventRegistrationWizard
19405
19691
  };
@@ -19407,7 +19693,7 @@ function HeadlessEventRegistrationProvider({
19407
19693
  config,
19408
19694
  children
19409
19695
  }) {
19410
- return React4.createElement(BlockApiProvider, { config, children });
19696
+ return React7.createElement(BlockApiProvider, { config, children });
19411
19697
  }
19412
19698
  function useHeadlessEventRegistrationFlow(options) {
19413
19699
  return useEventRegistrationController(options).flow;
@@ -19895,19 +20181,19 @@ async function loadBookingFormServices(api, formConfig) {
19895
20181
 
19896
20182
  // src/bookings/index.ts
19897
20183
  var BookingFormClient2 = (props) => {
19898
- return React5.createElement(BookingFormClient, props);
20184
+ return React8.createElement(BookingFormClient, props);
19899
20185
  };
19900
20186
  function useBookingFormConfig2(siteId, formId) {
19901
20187
  return useBookingFormConfig(siteId, formId);
19902
20188
  }
19903
20189
  var HeadlessBookingProvider2 = (props) => {
19904
- return React5.createElement(HeadlessBookingProvider, props);
20190
+ return React8.createElement(HeadlessBookingProvider, props);
19905
20191
  };
19906
20192
  var HeadlessEventRegistrationProvider2 = (props) => {
19907
- return React5.createElement(HeadlessEventRegistrationProvider, props);
20193
+ return React8.createElement(HeadlessEventRegistrationProvider, props);
19908
20194
  };
19909
20195
  var HeadlessBookingPaymentSelectionStep2 = (props) => {
19910
- return React5.createElement(HeadlessBookingPaymentSelectionStep, props);
20196
+ return React8.createElement(HeadlessBookingPaymentSelectionStep, props);
19911
20197
  };
19912
20198
  export {
19913
20199
  BOOKING_FORM_DATA_RESERVED_KEY_VALUES,