@riverbankcms/sdk 0.96.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 (208) hide show
  1. package/README.md +20 -1
  2. package/dist/{PreviewEditorSidebar-46VT4QVU.mjs → PreviewEditorSidebar-TPOKCCKY.mjs} +3 -3
  3. package/dist/{PreviewEditorUI-JD75GE5F.mjs → PreviewEditorUI-Y347GLC2.mjs} +3 -3
  4. package/dist/SdkPreviewModeRuntime-OGTXRQ4M.mjs +8 -0
  5. package/dist/_dts/ai/src/contracts/proposals.d.ts +36 -36
  6. package/dist/_dts/api/src/billing.d.ts +2 -0
  7. package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +35 -1
  8. package/dist/_dts/api/src/bookingOperations.d.ts +246 -0
  9. package/dist/_dts/api/src/commercePortalEndpoints.d.ts +5 -1
  10. package/dist/_dts/api/src/contentRuntime.d.ts +109 -40
  11. package/dist/_dts/api/src/endpoints.d.ts +88 -0
  12. package/dist/_dts/api/src/index.d.ts +3 -2
  13. package/dist/_dts/api/src/public/endpoints.d.ts +1 -1
  14. package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +10 -0
  15. package/dist/_dts/api/src/sdkContracts.d.ts +2 -0
  16. package/dist/_dts/api/src/siteManagementEndpoints.d.ts +2 -1
  17. package/dist/_dts/api/src/siteOperations.d.ts +65 -1
  18. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +7 -1
  19. package/dist/_dts/billing/src/site-arrangements.d.ts +151 -0
  20. package/dist/_dts/billing/src/subscriptions/store.d.ts +2 -0
  21. package/dist/_dts/block-form/src/widgets/RepeaterField/utils/resolveThumbnail.d.ts +2 -1
  22. package/dist/_dts/blocks/src/PageRenderer.d.ts +8 -1
  23. package/dist/_dts/blocks/src/bindings/types.d.ts +0 -4
  24. package/dist/_dts/blocks/src/client/site-chrome.d.ts +7 -0
  25. package/dist/_dts/blocks/src/contracts/index.d.ts +1 -0
  26. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +12 -12
  27. package/dist/_dts/blocks/src/primitives/content/primitives.d.ts +4 -0
  28. package/dist/_dts/blocks/src/system/blocks/events/shared/index.d.ts +1 -0
  29. package/dist/_dts/blocks/src/system/blocks/events/shared/layout.d.ts +2 -0
  30. package/dist/_dts/blocks/src/system/blocks/index.d.ts +1 -0
  31. package/dist/_dts/blocks/src/system/blocks/weekly-slot-availability.d.ts +34 -0
  32. package/dist/_dts/blocks/src/system/componentFactory.d.ts +1 -0
  33. package/dist/_dts/blocks/src/system/constants/blockKinds.d.ts +1 -1
  34. package/dist/_dts/blocks/src/system/customize/facets.d.ts +2 -2
  35. package/dist/_dts/blocks/src/system/data/loaderEndpoints.d.ts +1 -1
  36. package/dist/_dts/blocks/src/system/data/prefetchBlockData.d.ts +4 -1
  37. package/dist/_dts/blocks/src/system/node/builder.d.ts +2 -0
  38. package/dist/_dts/blocks/src/system/node/schema.d.ts +13 -0
  39. package/dist/_dts/blocks/src/system/node/validation-constants.d.ts +1 -1
  40. package/dist/_dts/blocks/src/system/registry.d.ts +1 -0
  41. package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +2 -1
  42. package/dist/_dts/blocks/src/system/runtime/api/endpoints.d.ts +8 -0
  43. package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +24 -0
  44. package/dist/_dts/blocks/src/system/runtime/components/booking/DatePicker.d.ts +6 -2
  45. package/dist/_dts/blocks/src/system/runtime/components/booking/SuccessMessage.d.ts +3 -1
  46. package/dist/_dts/blocks/src/system/runtime/components/booking/TimeSlotSelector.d.ts +10 -4
  47. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +6 -0
  48. package/dist/_dts/blocks/src/system/runtime/hooks/useAppointmentCheckoutVerification.d.ts +7 -0
  49. package/dist/_dts/blocks/src/system/runtime/hooks/useAvailableSlots.d.ts +2 -2
  50. package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.state.d.ts +2 -2
  51. package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessEventRegistrationFlow.d.ts +4 -0
  52. package/dist/_dts/blocks/src/system/runtime/hooks/usePaymentVerification.d.ts +5 -0
  53. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +11 -0
  54. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/StepIndicator.d.ts +3 -1
  55. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/hooks.d.ts +14 -0
  56. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +8 -2
  57. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +133 -2
  58. package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.client.controller.d.ts +3 -0
  59. package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.client.d.ts +9 -0
  60. package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.client.state.d.ts +14 -0
  61. package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.server.d.ts +10 -0
  62. package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.view.d.ts +11 -0
  63. package/dist/_dts/blocks/src/system/runtime/resolver.d.ts +31 -1
  64. package/dist/_dts/blocks/src/system/runtime/shared/components/FeedbackMessage.d.ts +2 -1
  65. package/dist/_dts/blocks/src/system/runtime/{nodes/event-registration → shared/components}/SelectableOptionCard.d.ts +11 -2
  66. package/dist/_dts/blocks/src/system/runtime/shared/components/StepIndicator.d.ts +16 -5
  67. package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +2 -0
  68. package/dist/_dts/blocks/src/system/runtime/shared/index.d.ts +2 -2
  69. package/dist/_dts/blocks/src/system/runtime/shared/useWaitlistClaim.d.ts +5 -0
  70. package/dist/_dts/blocks/src/utils/date-formatting.d.ts +18 -2
  71. package/dist/_dts/content-editor/src/primitives/PreviewInlineTextEditor.d.ts +1 -1
  72. package/dist/_dts/content-editor/src/primitives/PreviewRichTextEditor.d.ts +1 -1
  73. package/dist/_dts/content-model/src/templates/defaults.d.ts +5 -5
  74. package/dist/_dts/content-model/src/templates/types.d.ts +2 -6
  75. package/dist/_dts/core/src/branded.d.ts +8 -0
  76. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +767 -20
  77. package/dist/_dts/field-primitives/src/bindings/index.d.ts +8 -0
  78. package/dist/_dts/sdk/src/__mocks__/next-cache.d.ts +1 -1
  79. package/dist/_dts/sdk/src/cli/commands/push/publishGuidance.d.ts +15 -0
  80. package/dist/_dts/sdk/src/cli/commands/push/scopes/commandBackedDatedOfferingScope.d.ts +2 -1
  81. package/dist/_dts/sdk/src/cli/commands/push/scopes/types.d.ts +3 -1
  82. package/dist/_dts/sdk/src/cli/commands/push/stale-resolution.d.ts +9 -3
  83. package/dist/_dts/sdk/src/cli/commands/push/workflowPlan.d.ts +34 -0
  84. package/dist/_dts/sdk/src/cli/commands/push.d.ts +13 -0
  85. package/dist/_dts/sdk/src/cli/commands/setup.d.ts +2 -0
  86. package/dist/_dts/sdk/src/cli/config-loader.d.ts +2 -0
  87. package/dist/_dts/sdk/src/cli/content/metadataStore.d.ts +29 -0
  88. package/dist/_dts/sdk/src/cli/content/reader.d.ts +16 -14
  89. package/dist/_dts/sdk/src/cli/content/writer.d.ts +6 -4
  90. package/dist/_dts/sdk/src/cli/env-scope.d.ts +2 -0
  91. package/dist/_dts/sdk/src/cli/helpers.d.ts +6 -7
  92. package/dist/_dts/sdk/src/cli/merge-remote/entryMergePush.d.ts +2 -0
  93. package/dist/_dts/sdk/src/cli/merge-remote/entryMergeReport.d.ts +6 -18
  94. package/dist/_dts/sdk/src/cli/merge-remote/entrySnapshots.d.ts +2 -4
  95. package/dist/_dts/sdk/src/cli/merge-remote/pageMergePush.d.ts +2 -0
  96. package/dist/_dts/sdk/src/cli/merge-remote/pageMergeReport.d.ts +6 -18
  97. package/dist/_dts/sdk/src/cli/merge-remote/pageSnapshots.d.ts +2 -4
  98. package/dist/_dts/sdk/src/cli/merge-remote/sharedBaseSnapshots.d.ts +32 -0
  99. package/dist/_dts/sdk/src/cli/merge-remote/sharedMergePlan.d.ts +27 -0
  100. package/dist/_dts/sdk/src/cli/merge-remote/sharedMergeReport.d.ts +63 -0
  101. package/dist/_dts/sdk/src/cli/push-config.d.ts +13 -2
  102. package/dist/_dts/sdk/src/cli/setup/setupPlan.d.ts +51 -0
  103. package/dist/_dts/sdk/src/cli/site-commands/commandRuntime.d.ts +21 -0
  104. package/dist/_dts/sdk/src/client/index.d.ts +6 -0
  105. package/dist/_dts/sdk/src/client/runtimeCachePolicy.d.ts +1 -1
  106. package/dist/_dts/sdk/src/client/types.d.ts +18 -2
  107. package/dist/_dts/sdk/src/config/types.d.ts +1 -1
  108. package/dist/_dts/sdk/src/config/validation.d.ts +3 -0
  109. package/dist/_dts/sdk/src/contracts/bindings.d.ts +3 -7
  110. package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +13 -0
  111. package/dist/_dts/sdk/src/data/prefetchBlockData.d.ts +6 -1
  112. package/dist/_dts/sdk/src/next/route-outcome-proxy.d.ts +3 -3
  113. package/dist/_dts/sdk/src/next/types.d.ts +19 -0
  114. package/dist/_dts/sdk/src/prebuild/loader.d.ts +8 -1
  115. package/dist/_dts/sdk/src/public-api/contracts.d.ts +174 -78
  116. package/dist/_dts/sdk/src/public-api/runtime.d.ts +1 -1
  117. package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +2 -0
  118. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +4 -0
  119. package/dist/_dts/sdk/src/rendering/helpers/bindings.d.ts +4 -4
  120. package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +58 -1
  121. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +8 -0
  122. package/dist/_dts/sdk/src/rendering/hooks/usePage.d.ts +2 -2
  123. package/dist/_dts/sdk/src/rendering/index.d.ts +7 -7
  124. package/dist/_dts/sdk/src/rendering/islands/types.d.ts +18 -66
  125. package/dist/_dts/sdk/src/rendering/overrides.d.ts +2 -0
  126. package/dist/_dts/sdk/src/routing/resolveRoute.d.ts +18 -0
  127. package/dist/_dts/sdk/src/test/apiClient.d.ts +17 -0
  128. package/dist/_dts/sdk/src/test/bunDom.setup.d.ts +1 -0
  129. package/dist/_dts/sdk/src/test/env.d.ts +4 -0
  130. package/dist/_dts/sdk/src/types/block-kinds.d.ts +1 -1
  131. package/dist/_dts/sdk/src/version.d.ts +1 -1
  132. package/dist/_dts/site-commands/src/commands.d.ts +3 -3
  133. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  134. package/dist/_dts/theme-core/src/interactive/generateBaseCSS.d.ts +6 -0
  135. package/dist/_dts/theme-core/src/status/contextualColors.d.ts +6 -0
  136. package/dist/_dts/theme-core/src/status/index.d.ts +1 -0
  137. package/dist/{chunk-VHIMXQ7Z.mjs → chunk-4HXF2QLH.mjs} +2 -2
  138. package/dist/{chunk-VTPPVAOL.mjs → chunk-EMJIT3ZJ.mjs} +1 -1
  139. package/dist/{chunk-4TLTV7OB.mjs → chunk-PM7HGDHM.mjs} +2 -2
  140. package/dist/{chunk-XMATDBXO.mjs → chunk-XO34WBBP.mjs} +2139 -1348
  141. package/dist/{chunk-EL55VV6Q.mjs → chunk-YGTTEVUM.mjs} +31 -10
  142. package/dist/{chunk-7ED5UNHL.mjs → chunk-YWTCCOSF.mjs} +117 -0
  143. package/dist/cli/index.mjs +2690 -1503
  144. package/dist/cli/init-docs/content/cli-reference.md +29 -1
  145. package/dist/cli/init-docs/content/getting-started.md +8 -0
  146. package/dist/cli/init-docs/content/workflow-agent-safe-sync.md +3 -1
  147. package/dist/cli/init-docs/content/workflow-preview-mode.md +6 -0
  148. package/dist/cli/init-docs/content/workflow-remote-setup.md +51 -0
  149. package/dist/client/{accordion-GUNXIIZR.mjs → accordion-QSUEYL4L.mjs} +2 -2
  150. package/dist/client/{bookingForm-AOU4VHP5.mjs → bookingForm-QYGAHPDP.mjs} +376 -302
  151. package/dist/client/bookings.mjs +795 -429
  152. package/dist/client/{carousel-4QSX2JPC.mjs → carousel-SM2LEWAU.mjs} +3 -3
  153. package/dist/client/{cart-JKN6C4ZB.mjs → cart-3N3SFKNQ.mjs} +7 -7
  154. package/dist/client/{checkout-YY6YMITW.mjs → checkout-YFAYPKPZ.mjs} +7 -7
  155. package/dist/client/{chunk-SY543WZ3.mjs → chunk-5DLGREUB.mjs} +1 -1
  156. package/dist/client/{chunk-A3YN7M3G.mjs → chunk-CLZ7NBSP.mjs} +147 -75
  157. package/dist/client/{chunk-GWCRCJLB.mjs → chunk-CYJ3MUFP.mjs} +18 -6
  158. package/dist/client/{chunk-JNE6UI6U.mjs → chunk-H3H3ODO7.mjs} +1 -1
  159. package/dist/client/{chunk-CPKMJVBD.mjs → chunk-HPEQ4YWW.mjs} +83 -109
  160. package/dist/client/{chunk-PCHACQEB.mjs → chunk-IIUIKJ4K.mjs} +15 -7
  161. package/dist/client/{chunk-TNGL2WJF.mjs → chunk-IOAHWAQG.mjs} +18 -0
  162. package/dist/client/{chunk-6H27K6AA.mjs → chunk-JTKBF3W2.mjs} +10 -4
  163. package/dist/client/{chunk-OLAOAZEO.mjs → chunk-K7KTSACR.mjs} +1 -1
  164. package/dist/client/{chunk-BFCJZODD.mjs → chunk-R32M5HFS.mjs} +6 -6
  165. package/dist/client/{chunk-VJROUYOQ.mjs → chunk-WEVT46PX.mjs} +3 -3
  166. package/dist/client/{chunk-H7A6PUGM.mjs → chunk-ZU65LTI3.mjs} +1 -1
  167. package/dist/client/client.mjs +5052 -4083
  168. package/dist/client/{courseRegistration-UU2KMPSQ.mjs → courseRegistration-LYBE7VVK.mjs} +7 -7
  169. package/dist/client/{eventCalendar-WIVNS2TM.mjs → eventCalendar-FMTB75X6.mjs} +9 -9
  170. package/dist/client/{eventCombined-P3G5MW4J.mjs → eventCombined-E4LUCJXT.mjs} +9 -9
  171. package/dist/client/{eventDetails-2VHJ2RDG.mjs → eventDetails-GELSRR4Z.mjs} +9 -9
  172. package/dist/client/{eventListing-TGO6JI3R.mjs → eventListing-TB623B6R.mjs} +9 -9
  173. package/dist/client/{eventRegistration-B46HEJES.mjs → eventRegistration-NRIKHXTI.mjs} +9 -9
  174. package/dist/client/{form-VKRTFUNQ.mjs → form-Y4U4IAXE.mjs} +3 -3
  175. package/dist/client/{headerSection-XUX4ZJLO.mjs → headerSection-QSOVV5P7.mjs} +3 -3
  176. package/dist/client/hooks.mjs +1776 -1355
  177. package/dist/client/{locationMap-NQFI5MJO.mjs → locationMap-QYCAHH7H.mjs} +3 -3
  178. package/dist/client/{newsletterForm-P2GETCQK.mjs → newsletterForm-NWHY5TBY.mjs} +3 -3
  179. package/dist/client/{productDetail-7NQ7O5IF.mjs → productDetail-FYDMU2CE.mjs} +7 -7
  180. package/dist/client/{productList-RX6ZJ7BL.mjs → productList-D76CGACQ.mjs} +7 -7
  181. package/dist/client/rendering/client.mjs +2990 -2470
  182. package/dist/client/rendering/islands.mjs +19 -19
  183. package/dist/client/rendering.mjs +3236 -2236
  184. package/dist/client/{shop-BHN5AKY6.mjs → shop-SOUACT5N.mjs} +7 -7
  185. package/dist/preview-next/before-render.mjs +117 -0
  186. package/dist/preview-next/client/runtime.mjs +5 -5
  187. package/dist/preview-next/middleware.mjs +117 -0
  188. package/dist/{sdk-runtime-X2LXQ5IC.mjs → sdk-runtime-XPVE3LBA.mjs} +6 -6
  189. package/dist/server/components.mjs +3115 -2484
  190. package/dist/server/config-template-validation.mjs +6 -2
  191. package/dist/server/config-validation.mjs +1961 -1580
  192. package/dist/server/config.mjs +1961 -1580
  193. package/dist/server/data.mjs +1762 -1352
  194. package/dist/server/index.mjs +266 -33
  195. package/dist/server/next/middleware.mjs +2 -2
  196. package/dist/server/next.mjs +3399 -2504
  197. package/dist/server/page-converter.mjs +1553 -1295
  198. package/dist/server/prebuild-loader.mjs +42 -23
  199. package/dist/server/prebuild.mjs +1 -1
  200. package/dist/server/rendering/server.mjs +3151 -2489
  201. package/dist/server/rendering.mjs +3363 -2555
  202. package/dist/server/routing.mjs +1877 -1388
  203. package/dist/server/server.mjs +2057 -1402
  204. package/dist/server/theme-bridge.mjs +597 -505
  205. package/dist/server/theme.mjs +5 -4
  206. package/dist/styles/index.css +499 -490
  207. package/package.json +6 -4
  208. package/dist/SdkPreviewModeRuntime-MJUSYUFB.mjs +0 -8
@@ -1,15 +1,15 @@
1
1
  "use client";
2
- import { buildBookingPaymentSelectionViewModel, usePolling } from './chunk-VJROUYOQ.mjs';
3
- import { SpinnerNode } from './chunk-OLAOAZEO.mjs';
2
+ import { buildBookingPaymentSelectionViewModel, usePolling } from './chunk-WEVT46PX.mjs';
3
+ import { SpinnerNode } from './chunk-K7KTSACR.mjs';
4
4
  import { buildRouteIslandApiConfig } from './chunk-L4J5Y62O.mjs';
5
- import { scrollToBlock, useDiscountCodeUi, buildCheckoutReturnUrls, DiscountCodeDisclosure } from './chunk-A3YN7M3G.mjs';
5
+ import { scrollToBlock, useDiscountCodeUi, TerminalPanel, StateIcon, CheckIcon, StepIndicator, buildCheckoutReturnUrls, DiscountCodeDisclosure } from './chunk-CLZ7NBSP.mjs';
6
6
  import { FieldValidationMessage, getFieldValidationControlProps } from './chunk-3DCJ45Z2.mjs';
7
7
  import './chunk-WBQG7VJA.mjs';
8
8
  import { isSpamProtectionEnabled, getChallengeUrl, AltchaWidget } from './chunk-LJCX6V7Q.mjs';
9
- import { BlockApiProvider, useBlockApi, FeedbackMessage } from './chunk-TNGL2WJF.mjs';
9
+ import { BlockApiProvider, useBlockApi, FeedbackMessage } from './chunk-IOAHWAQG.mjs';
10
10
  import { mountReactIsland } from './chunk-N7PBWBWQ.mjs';
11
- import { defineIslandPropsDecoder, resolveBookingSiteId, resolveDefaultBookingServiceId, getBookingRedirectStateFromLocation, deriveBookingFormViewState, logger, getBookingSuccessMessage, getBookingServiceSlidingScale, formatBookingCentsAsCurrencyInput, parseBookingCurrencyInputToCents, resolveAppointmentCheckoutVerificationState, themeButtonClassName, toSelectedCollectionOptionKind, assertNever, prepareBookingSubmission, formatBookingSubmissionPreparationError, resolveBookingPaymentStep, BOOKING_FORM_DATA_RESERVED_KEYS, isBookingServiceSlidingAmountInRange, clearWorkflowFeedback, reportWorkflowError, reportWorkflowSuccess, okWith, err } from './chunk-GWCRCJLB.mjs';
12
- import { resolveBookingTimeZoneId, DEFAULT_BOOKING_TIME_ZONE, unsafeAsFormId, unsafeAsAppointmentResourceId, unsafeAsCustomerPassId, unsafeAsAppointmentServiceId, formatLocalScheduleDate, addLocalScheduleDays, parseBookingLocalDate, unsafeAsPassId, formatCurrencyAmount, formatBookingInstant } from './chunk-PCHACQEB.mjs';
11
+ import { defineIslandPropsDecoder, resolveBookingSiteId, resolveDefaultBookingServiceId, getBookingRedirectStateFromLocation, deriveBookingFormViewState, logger, getBookingSuccessMessage, getBookingServiceSlidingScale, formatBookingCentsAsCurrencyInput, parseBookingCurrencyInputToCents, themeButtonClassName, toSelectedCollectionOptionKind, assertNever, prepareBookingSubmission, formatBookingSubmissionPreparationError, resolveBookingPaymentStep, resolveAppointmentCheckoutVerificationState, BOOKING_FORM_DATA_RESERVED_KEYS, isBookingServiceSlidingAmountInRange, clearWorkflowFeedback, reportWorkflowError, reportWorkflowSuccess, okWith, err } from './chunk-CYJ3MUFP.mjs';
12
+ import { resolveBookingTimeZoneId, DEFAULT_BOOKING_TIME_ZONE, unsafeAsFormId, unsafeAsAppointmentResourceId, unsafeAsCustomerPassId, unsafeAsAppointmentServiceId, formatLocalScheduleDate, addLocalScheduleDays, parseBookingLocalDate, unsafeAsPassId, formatCurrencyAmount, formatBookingInstant } from './chunk-IIUIKJ4K.mjs';
13
13
  import React2, { useRef, useState, useMemo, useReducer, useEffect, useCallback, useLayoutEffect } from 'react';
14
14
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
15
15
 
@@ -19,19 +19,20 @@ var SuccessMessage = ({
19
19
  className
20
20
  }) => {
21
21
  return /* @__PURE__ */ jsx(
22
- FeedbackMessage,
22
+ TerminalPanel,
23
23
  {
24
24
  tone: "success",
25
- className: `ab-alert ab-alert--success ${className ?? ""}`,
25
+ title: "Booking confirmed",
26
+ icon: /* @__PURE__ */ jsx(StateIcon, { variant: "success", children: /* @__PURE__ */ jsx(CheckIcon, { strokeWidth: 3 }) }),
27
+ body: /* @__PURE__ */ jsx("p", { className: "ab-text", children: message }),
28
+ secondaryBody: resourceName ? /* @__PURE__ */ jsxs("p", { className: "ab-text rb-on-surface--muted", children: [
29
+ "Practitioner: ",
30
+ resourceName
31
+ ] }) : null,
32
+ className: ["ab-center", className ?? ""].join(" ").trim(),
33
+ titleClassName: "ab-terminal-title",
26
34
  role: "alert",
27
- live: "polite",
28
- children: /* @__PURE__ */ jsxs(Fragment, { children: [
29
- /* @__PURE__ */ jsx("p", { className: "ab-text", children: message }),
30
- resourceName ? /* @__PURE__ */ jsxs("p", { className: "ab-text ab-text--muted", children: [
31
- "Practitioner: ",
32
- resourceName
33
- ] }) : null
34
- ] })
35
+ live: "polite"
35
36
  }
36
37
  );
37
38
  };
@@ -72,9 +73,30 @@ function formatDate(dateStr) {
72
73
  }
73
74
  });
74
75
  }
75
- function formatTime(isoString) {
76
- return formatBookingInstant(isoString, {
76
+ function formatDatePillParts(dateStr) {
77
+ const instant = `${dateStr}T00:00:00.000Z`;
78
+ const partFormat = (format) => formatBookingInstant(instant, {
77
79
  timeZone: DEFAULT_BOOKING_TIME_ZONE,
80
+ format
81
+ });
82
+ return {
83
+ weekday: partFormat({ weekday: "short" }),
84
+ day: partFormat({ day: "numeric" }),
85
+ month: partFormat({ month: "short" })
86
+ };
87
+ }
88
+ function formatTimeShort(isoString, timeZone = DEFAULT_BOOKING_TIME_ZONE) {
89
+ return formatBookingInstant(isoString, {
90
+ timeZone,
91
+ format: {
92
+ hour: "numeric",
93
+ minute: "2-digit"
94
+ }
95
+ });
96
+ }
97
+ function formatTime(isoString, timeZone = DEFAULT_BOOKING_TIME_ZONE) {
98
+ return formatBookingInstant(isoString, {
99
+ timeZone,
78
100
  format: {
79
101
  hour: "numeric",
80
102
  minute: "2-digit",
@@ -794,6 +816,24 @@ function toBookingSlotView(slot) {
794
816
  function toBookingSlotViews(slots) {
795
817
  return slots.map(toBookingSlotView);
796
818
  }
819
+ function deriveBookingSlotDisplayOptions(input) {
820
+ const seenStartTimes = /* @__PURE__ */ new Set();
821
+ const options = [];
822
+ for (const slot of input.slots) {
823
+ if (!input.hasSelectedResource) {
824
+ if (seenStartTimes.has(slot.startAt)) continue;
825
+ seenStartTimes.add(slot.startAt);
826
+ }
827
+ options.push({
828
+ key: slot.key,
829
+ startAt: slot.startAt,
830
+ endAt: slot.endAt,
831
+ resourceId: slot.resourceId,
832
+ slot
833
+ });
834
+ }
835
+ return options;
836
+ }
797
837
  function toBookingFormData(state) {
798
838
  return {
799
839
  ...state.fieldValues,
@@ -1875,8 +1915,18 @@ function useLatestRef(value) {
1875
1915
  }, [value]);
1876
1916
  return ref;
1877
1917
  }
1918
+ var appointmentCheckoutVerificationDeps = {
1919
+ useBlockApi,
1920
+ usePolling
1921
+ };
1878
1922
  function useAppointmentCheckoutVerification(config) {
1879
- const api = useBlockApi();
1923
+ return useAppointmentCheckoutVerificationWithDeps(
1924
+ config,
1925
+ appointmentCheckoutVerificationDeps
1926
+ );
1927
+ }
1928
+ function useAppointmentCheckoutVerificationWithDeps(config, deps) {
1929
+ const api = deps.useBlockApi();
1880
1930
  const pollingConfig = useMemo(() => {
1881
1931
  if (!config) return null;
1882
1932
  return {
@@ -1887,7 +1937,7 @@ function useAppointmentCheckoutVerification(config) {
1887
1937
  interval: config.pollInterval
1888
1938
  };
1889
1939
  }, [api, config]);
1890
- const polling = usePolling(pollingConfig);
1940
+ const polling = deps.usePolling(pollingConfig);
1891
1941
  const state = resolveAppointmentCheckoutVerificationState({
1892
1942
  config,
1893
1943
  pollingStatus: polling.status,
@@ -1899,63 +1949,96 @@ function useAppointmentCheckoutVerification(config) {
1899
1949
  retry: polling.retry
1900
1950
  };
1901
1951
  }
1952
+ function DateFieldLabel({
1953
+ labelId,
1954
+ required
1955
+ }) {
1956
+ return /* @__PURE__ */ jsxs("span", { className: "form-label", id: labelId, children: [
1957
+ "Select Date",
1958
+ required && /* @__PURE__ */ jsx("span", { className: "required-marker", children: "*" })
1959
+ ] });
1960
+ }
1902
1961
  var DatePicker = ({
1903
1962
  value,
1904
1963
  onChange,
1905
1964
  dateOptions,
1906
1965
  required = true,
1966
+ ariaDescribedBy,
1967
+ ariaInvalid,
1907
1968
  isLoading = false,
1908
1969
  isEmpty = false,
1909
1970
  hasMore = false,
1910
1971
  onLoadMore
1911
1972
  }) => {
1973
+ const generatedId = React2.useId();
1974
+ const labelId = `${generatedId}-date-label`;
1975
+ const gridRef = React2.useRef(null);
1976
+ const previousCountRef = React2.useRef(dateOptions.length);
1977
+ React2.useEffect(() => {
1978
+ const previousCount = previousCountRef.current;
1979
+ previousCountRef.current = dateOptions.length;
1980
+ if (previousCount === 0 || dateOptions.length <= previousCount) return;
1981
+ const pills = gridRef.current?.querySelectorAll(
1982
+ "button[aria-pressed]"
1983
+ );
1984
+ pills?.[previousCount]?.focus();
1985
+ }, [dateOptions.length]);
1912
1986
  if (isLoading) {
1913
- return /* @__PURE__ */ jsxs("div", { className: "ab-stack--sm", children: [
1914
- /* @__PURE__ */ jsxs("label", { className: "ab-label", children: [
1915
- "Select Date",
1916
- required && /* @__PURE__ */ jsx("span", { className: "ab-required", children: "*" })
1917
- ] }),
1918
- /* @__PURE__ */ jsx("div", { className: "ab-skeleton" }),
1919
- /* @__PURE__ */ jsx("p", { className: "ab-text ab-text--muted ab-text--sm", children: "Loading available dates..." })
1987
+ return /* @__PURE__ */ jsxs("div", { className: "rb-reg-stack rb-reg-stack--sm", children: [
1988
+ /* @__PURE__ */ jsx(DateFieldLabel, { labelId, required }),
1989
+ /* @__PURE__ */ jsx("div", { className: "rb-shell-block" }),
1990
+ /* @__PURE__ */ jsx("p", { className: "ab-text ab-text--sm rb-on-surface--muted", children: "Loading available dates..." })
1920
1991
  ] });
1921
1992
  }
1922
1993
  if (isEmpty) {
1923
- return /* @__PURE__ */ jsxs("div", { className: "ab-stack--sm", children: [
1924
- /* @__PURE__ */ jsxs("label", { className: "ab-label", children: [
1925
- "Select Date",
1926
- required && /* @__PURE__ */ jsx("span", { className: "ab-required", children: "*" })
1927
- ] }),
1928
- /* @__PURE__ */ jsx(FeedbackMessage, { tone: "warning", className: "ab-alert ab-alert--warning", role: "status", children: /* @__PURE__ */ jsxs("p", { className: "ab-text", children: [
1994
+ return /* @__PURE__ */ jsxs("div", { className: "rb-reg-stack rb-reg-stack--sm", children: [
1995
+ /* @__PURE__ */ jsx(DateFieldLabel, { labelId, required }),
1996
+ /* @__PURE__ */ jsx(FeedbackMessage, { tone: "warning", className: "alert alert-warning", role: "status", children: /* @__PURE__ */ jsxs("p", { className: "ab-text", children: [
1929
1997
  "No available dates in this period.",
1930
1998
  hasMore && onLoadMore && /* @__PURE__ */ jsx(
1931
1999
  "button",
1932
2000
  {
1933
2001
  type: "button",
1934
2002
  onClick: onLoadMore,
1935
- className: "ab-link",
2003
+ className: "ab-link rb-ml-2",
1936
2004
  children: "Check later dates"
1937
2005
  }
1938
2006
  )
1939
2007
  ] }) })
1940
2008
  ] });
1941
2009
  }
1942
- return /* @__PURE__ */ jsxs("div", { className: "ab-stack--sm", children: [
1943
- /* @__PURE__ */ jsxs("label", { htmlFor: "booking-date", className: "ab-label", children: [
1944
- "Select Date",
1945
- required && /* @__PURE__ */ jsx("span", { className: "ab-required", children: "*" })
1946
- ] }),
1947
- /* @__PURE__ */ jsxs(
1948
- "select",
2010
+ return /* @__PURE__ */ jsxs("div", { className: "rb-reg-stack rb-reg-stack--sm", children: [
2011
+ /* @__PURE__ */ jsx(DateFieldLabel, { labelId, required }),
2012
+ /* @__PURE__ */ jsx(
2013
+ "div",
1949
2014
  {
1950
- id: "booking-date",
1951
- value,
1952
- onChange: (e) => onChange(e.target.value),
1953
- required,
1954
- className: "ab-select",
1955
- children: [
1956
- /* @__PURE__ */ jsx("option", { value: "", children: "Choose a date..." }),
1957
- dateOptions.map((date) => /* @__PURE__ */ jsx("option", { value: date, children: formatDate(date) }, date))
1958
- ]
2015
+ ref: gridRef,
2016
+ role: "group",
2017
+ "aria-labelledby": labelId,
2018
+ "aria-describedby": ariaDescribedBy,
2019
+ "aria-invalid": ariaInvalid || void 0,
2020
+ "aria-required": required || void 0,
2021
+ className: "ab-pill-grid",
2022
+ children: dateOptions.map((date) => {
2023
+ const isSelected = value === date;
2024
+ const parts = formatDatePillParts(date);
2025
+ return /* @__PURE__ */ jsxs(
2026
+ "button",
2027
+ {
2028
+ type: "button",
2029
+ onClick: () => onChange(isSelected ? "" : date),
2030
+ "aria-pressed": isSelected,
2031
+ "aria-label": formatDate(date),
2032
+ className: `rb-option-card ab-date-pill${isSelected ? " rb-option-card--selected" : ""}`,
2033
+ children: [
2034
+ /* @__PURE__ */ jsx("span", { className: "ab-pill-caption", "aria-hidden": "true", children: parts.weekday }),
2035
+ /* @__PURE__ */ jsx("span", { className: "ab-pill-value", "aria-hidden": "true", children: parts.day }),
2036
+ /* @__PURE__ */ jsx("span", { className: "ab-pill-caption", "aria-hidden": "true", children: parts.month })
2037
+ ]
2038
+ },
2039
+ date
2040
+ );
2041
+ })
1959
2042
  }
1960
2043
  ),
1961
2044
  hasMore && onLoadMore && /* @__PURE__ */ jsx(
@@ -1964,7 +2047,7 @@ var DatePicker = ({
1964
2047
  type: "button",
1965
2048
  onClick: onLoadMore,
1966
2049
  className: "ab-link",
1967
- children: "Load more dates \u2192"
2050
+ children: "More dates \u2192"
1968
2051
  }
1969
2052
  )
1970
2053
  ] });
@@ -1974,40 +2057,59 @@ var TimeSlotSelector = ({
1974
2057
  onChange,
1975
2058
  slots,
1976
2059
  isLoading,
1977
- required = true
2060
+ timezone,
2061
+ required = true,
2062
+ ariaDescribedBy,
2063
+ ariaInvalid
1978
2064
  }) => {
1979
- return /* @__PURE__ */ jsxs("div", { className: "ab-stack--sm", children: [
1980
- /* @__PURE__ */ jsxs("label", { htmlFor: "booking-slot", className: "ab-label", children: [
2065
+ const generatedId = React2.useId();
2066
+ const labelId = `${generatedId}-time-label`;
2067
+ const groupRef = React2.useRef(null);
2068
+ const hadSlotsRef = React2.useRef(false);
2069
+ React2.useEffect(() => {
2070
+ const hasSlots = !isLoading && slots.length > 0;
2071
+ if (hasSlots && !hadSlotsRef.current) {
2072
+ groupRef.current?.scrollIntoView({ block: "nearest", behavior: "smooth" });
2073
+ }
2074
+ hadSlotsRef.current = hasSlots;
2075
+ }, [isLoading, slots.length]);
2076
+ return /* @__PURE__ */ jsxs("div", { className: "rb-reg-stack rb-reg-stack--sm", children: [
2077
+ /* @__PURE__ */ jsxs("span", { className: "form-label", id: labelId, children: [
1981
2078
  "Select Time",
1982
- required && /* @__PURE__ */ jsx("span", { className: "ab-required", children: "*" })
2079
+ required && /* @__PURE__ */ jsx("span", { className: "required-marker", children: "*" })
1983
2080
  ] }),
1984
- isLoading ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info ab-center", role: "status", children: "Loading available times..." }) : slots.length === 0 ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info ab-center", role: "status", children: "No available times for this date" }) : /* @__PURE__ */ jsxs(
1985
- "select",
2081
+ isLoading ? /* @__PURE__ */ jsx("div", { className: "rb-shell-block" }) : slots.length === 0 ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "info", className: "alert alert-info", role: "status", children: "No available times for this date" }) : /* @__PURE__ */ jsx(
2082
+ "div",
1986
2083
  {
1987
- id: "booking-slot",
1988
- value,
1989
- onChange: (e) => onChange(e.target.value),
1990
- required,
1991
- className: "ab-select",
1992
- children: [
1993
- /* @__PURE__ */ jsx("option", { value: "", children: "Choose a time..." }),
1994
- slots.map((slot) => /* @__PURE__ */ jsx("option", { value: slot.startAt, children: formatTime(slot.startAt) }, slot.startAt))
1995
- ]
2084
+ ref: groupRef,
2085
+ role: "group",
2086
+ "aria-labelledby": labelId,
2087
+ "aria-describedby": ariaDescribedBy,
2088
+ "aria-invalid": ariaInvalid || void 0,
2089
+ "aria-required": required || void 0,
2090
+ className: "ab-pill-grid",
2091
+ children: slots.map((slot) => {
2092
+ const isSelected = value === slot.key;
2093
+ return /* @__PURE__ */ jsx(
2094
+ "button",
2095
+ {
2096
+ type: "button",
2097
+ onClick: () => onChange(isSelected ? "" : slot.key),
2098
+ "aria-pressed": isSelected,
2099
+ "aria-label": formatTime(slot.startAt, timezone),
2100
+ className: `rb-option-card ab-time-pill${isSelected ? " rb-option-card--selected" : ""}`,
2101
+ children: formatTimeShort(slot.startAt, timezone)
2102
+ },
2103
+ slot.key
2104
+ );
2105
+ })
1996
2106
  }
1997
2107
  )
1998
2108
  ] });
1999
2109
  };
2000
- var paymentOptionLayoutStyle = {
2001
- alignItems: "flex-start",
2002
- display: "flex",
2003
- flexDirection: "column",
2004
- gap: "0.25rem",
2005
- justifyContent: "flex-start",
2006
- width: "100%"
2007
- };
2008
- var summaryStackStyle = {
2009
- gap: "0.125rem"
2010
- };
2110
+ function optionCardClassName(isSelected) {
2111
+ return `rb-option-card${isSelected ? " rb-option-card--selected" : ""}`;
2112
+ }
2011
2113
  function formatBookingAmount(amount, currency) {
2012
2114
  return formatCurrencyAmount(amount, currency, { decimals: "auto" });
2013
2115
  }
@@ -2016,6 +2118,7 @@ function HeadlessBookingDefaultForm({
2016
2118
  onSubmit
2017
2119
  }) {
2018
2120
  const currentStep = booking.currentStep;
2121
+ const errorSummaryId = React2.useId();
2019
2122
  const currentStepIndex = currentStep?.visibleIndex ?? 0;
2020
2123
  const isFirstStep = currentStepIndex === 0;
2021
2124
  const isLastStep = currentStepIndex === booking.steps.length - 1;
@@ -2031,16 +2134,30 @@ function HeadlessBookingDefaultForm({
2031
2134
  return /* @__PURE__ */ jsx("div", { className: "rb-text-center rb-py-12", children: /* @__PURE__ */ jsx("p", { className: "status-muted", children: "No steps available" }) });
2032
2135
  }
2033
2136
  return /* @__PURE__ */ jsxs("div", { className: "multi-step-form", children: [
2034
- /* @__PURE__ */ jsx("div", { className: "rb-mb-8", children: /* @__PURE__ */ jsx(
2035
- DefaultBookingProgress,
2137
+ booking.steps.length > 1 ? /* @__PURE__ */ jsx(
2138
+ StepIndicator,
2036
2139
  {
2037
- steps: booking.steps,
2038
- currentIndex: currentStepIndex
2140
+ currentStep: currentStepIndex + 1,
2141
+ totalSteps: booking.steps.length,
2142
+ stepLabels: booking.steps.map((step) => step.label),
2143
+ emitSharedClasses: true
2144
+ }
2145
+ ) : null,
2146
+ /* @__PURE__ */ jsx("div", { className: "step-content", children: /* @__PURE__ */ jsx(
2147
+ DefaultBookingStepContent,
2148
+ {
2149
+ booking,
2150
+ errorSummaryId
2039
2151
  }
2040
2152
  ) }),
2041
- /* @__PURE__ */ jsx("div", { className: "step-content", children: /* @__PURE__ */ jsx(DefaultBookingStepContent, { booking }) }),
2042
- /* @__PURE__ */ jsx(DefaultBookingErrorSummary, { errors: currentStep.errors }),
2043
- /* @__PURE__ */ jsxs("div", { className: "rb-flex rb-gap-3 rb-mt-8", children: [
2153
+ /* @__PURE__ */ jsx(
2154
+ DefaultBookingErrorSummary,
2155
+ {
2156
+ errors: currentStep.errors,
2157
+ id: errorSummaryId
2158
+ }
2159
+ ),
2160
+ /* @__PURE__ */ jsxs("div", { className: "rb-wizard-actions", children: [
2044
2161
  !isFirstStep ? /* @__PURE__ */ jsx(
2045
2162
  "button",
2046
2163
  {
@@ -2058,11 +2175,7 @@ function HeadlessBookingDefaultForm({
2058
2175
  void handlePrimaryAction();
2059
2176
  },
2060
2177
  disabled: isSubmitting,
2061
- className: themeButtonClassName({
2062
- variant: "primary",
2063
- size: "md",
2064
- extraClassName: "rb-flex-1"
2065
- }),
2178
+ className: themeButtonClassName({ variant: "primary", size: "md" }),
2066
2179
  children: isSubmitting ? /* @__PURE__ */ jsxs(Fragment, { children: [
2067
2180
  /* @__PURE__ */ jsx(
2068
2181
  SpinnerNode,
@@ -2083,44 +2196,9 @@ function HeadlessBookingDefaultForm({
2083
2196
  /* @__PURE__ */ jsx(DefaultBookingAltcha, { booking })
2084
2197
  ] });
2085
2198
  }
2086
- function DefaultBookingProgress({
2087
- steps,
2088
- currentIndex
2089
- }) {
2090
- return /* @__PURE__ */ jsx("div", { className: "rb-flex rb-items-center rb-justify-between", children: steps.map((step, index) => {
2091
- const isActive = index === currentIndex;
2092
- const isCompleted = index < currentIndex;
2093
- const isLast = index === steps.length - 1;
2094
- return /* @__PURE__ */ jsxs("div", { className: "rb-flex rb-items-center rb-flex-1", children: [
2095
- /* @__PURE__ */ jsxs("div", { className: "rb-flex rb-items-center rb-gap-2 rb-cursor-default", children: [
2096
- /* @__PURE__ */ jsx(
2097
- "div",
2098
- {
2099
- className: `
2100
- step-circle transition-theme-standard
2101
- ${isActive ? "step-circle-active" : ""}
2102
- ${isCompleted ? "step-circle-complete" : ""}
2103
- `,
2104
- children: isCompleted ? "\u2713" : index + 1
2105
- }
2106
- ),
2107
- /* @__PURE__ */ jsx(
2108
- "span",
2109
- {
2110
- className: `
2111
- rb-caption rb-hidden rb-sm-inline
2112
- ${isCompleted || !isActive ? "status-muted" : ""}
2113
- `,
2114
- children: step.label
2115
- }
2116
- )
2117
- ] }),
2118
- !isLast ? /* @__PURE__ */ jsx("div", { className: "step-connector rb-ml-2 rb-mr-2 rb-hidden rb-sm-block" }) : null
2119
- ] }, step.id);
2120
- }) });
2121
- }
2122
2199
  function DefaultBookingStepContent({
2123
- booking
2200
+ booking,
2201
+ errorSummaryId
2124
2202
  }) {
2125
2203
  const stepId = booking.currentStep?.id;
2126
2204
  if (!stepId) return null;
@@ -2128,7 +2206,13 @@ function DefaultBookingStepContent({
2128
2206
  case "service-selection":
2129
2207
  return /* @__PURE__ */ jsx(DefaultServiceSelectionStep, { booking });
2130
2208
  case "datetime-selection":
2131
- return /* @__PURE__ */ jsx(DefaultDateTimeSelectionStep, { booking });
2209
+ return /* @__PURE__ */ jsx(
2210
+ DefaultDateTimeSelectionStep,
2211
+ {
2212
+ booking,
2213
+ errorSummaryId
2214
+ }
2215
+ );
2132
2216
  case "payment-selection":
2133
2217
  return /* @__PURE__ */ jsx(HeadlessBookingPaymentSelectionStep, { booking });
2134
2218
  case "custom-fields":
@@ -2147,32 +2231,33 @@ function DefaultServiceSelectionStep({
2147
2231
  const showServiceSelect = booking.services.requiresSelection || services.length > 1;
2148
2232
  const showResourceSelect = booking.resources.requiresSelection || resources.length > 1;
2149
2233
  const allowAnyResource = !booking.resources.requiresSelection;
2150
- return /* @__PURE__ */ jsxs("div", { className: "ab-stack", children: [
2234
+ return /* @__PURE__ */ jsxs("div", { className: "rb-reg-stack", children: [
2151
2235
  /* @__PURE__ */ jsxs("div", { children: [
2152
2236
  /* @__PURE__ */ jsx("h2", { className: "ab-title", children: "Select Service" }),
2153
- /* @__PURE__ */ jsx("p", { className: "ab-text ab-text--muted", children: "Choose the service you'd like to book" })
2237
+ /* @__PURE__ */ jsx("p", { className: "ab-text rb-on-surface--muted", children: "Choose the service you'd like to book" })
2154
2238
  ] }),
2155
- showServiceSelect ? /* @__PURE__ */ jsxs("div", { className: "ab-stack--sm", children: [
2156
- /* @__PURE__ */ jsx("label", { className: "ab-subtitle", children: "Service" }),
2157
- /* @__PURE__ */ jsx("div", { className: "ab-grid", children: services.map((service) => {
2239
+ showServiceSelect ? /* @__PURE__ */ jsxs("div", { className: "rb-reg-stack rb-reg-stack--sm", children: [
2240
+ /* @__PURE__ */ jsx("span", { className: "ab-subtitle", children: "Service" }),
2241
+ /* @__PURE__ */ jsx("div", { className: "rb-reg-grid", children: services.map((service) => {
2158
2242
  const isSelected = selectedServiceId === service.id;
2159
- return /* @__PURE__ */ jsx(
2243
+ return /* @__PURE__ */ jsxs(
2160
2244
  "button",
2161
2245
  {
2162
2246
  type: "button",
2163
2247
  onClick: () => booking.actions.selectService(service.id),
2164
- className: `ab-card ${isSelected ? "ab-card--selected" : ""}`,
2165
- children: /* @__PURE__ */ jsxs("div", { className: "ab-row--between", children: [
2166
- /* @__PURE__ */ jsxs("div", { children: [
2248
+ className: optionCardClassName(isSelected),
2249
+ "aria-pressed": isSelected,
2250
+ children: [
2251
+ /* @__PURE__ */ jsxs("div", { className: "rb-flex-1", children: [
2167
2252
  /* @__PURE__ */ jsx("div", { className: "ab-subtitle", children: service.title }),
2168
- service.description ? /* @__PURE__ */ jsx("div", { className: "ab-text ab-text--muted", children: service.description }) : null,
2169
- service.durationMinutes ? /* @__PURE__ */ jsxs("div", { className: "ab-text ab-text--muted", children: [
2253
+ service.description ? /* @__PURE__ */ jsx("div", { className: "ab-text rb-on-surface--muted", children: service.description }) : null,
2254
+ service.durationMinutes ? /* @__PURE__ */ jsxs("div", { className: "ab-text rb-on-surface--muted", children: [
2170
2255
  service.durationMinutes,
2171
2256
  " minutes"
2172
2257
  ] }) : null
2173
2258
  ] }),
2174
2259
  isSelected ? /* @__PURE__ */ jsx(SelectedCheck, {}) : null
2175
- ] })
2260
+ ]
2176
2261
  },
2177
2262
  service.id
2178
2263
  );
@@ -2180,41 +2265,43 @@ function DefaultServiceSelectionStep({
2180
2265
  ] }) : null,
2181
2266
  booking.resources.state.tag === "loading" ? /* @__PURE__ */ jsxs("div", { className: "ab-center", children: [
2182
2267
  /* @__PURE__ */ jsx(SpinnerNode, { size: "md", srLabel: "Loading practitioners" }),
2183
- /* @__PURE__ */ jsx("p", { className: "ab-text ab-text--muted", children: "Loading practitioners..." })
2268
+ /* @__PURE__ */ jsx("p", { className: "ab-text rb-on-surface--muted", children: "Loading practitioners..." })
2184
2269
  ] }) : null,
2185
- booking.resources.state.tag === "error" ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: booking.resources.state.message }) : null,
2186
- showResourceSelect && booking.resources.state.tag === "loaded" && resources.length === 0 ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: "No practitioners are available for this service right now." }) : null,
2187
- showResourceSelect && booking.resources.state.tag !== "loading" && (allowAnyResource || resources.length > 0) ? /* @__PURE__ */ jsxs("div", { className: "ab-stack--sm", children: [
2188
- /* @__PURE__ */ jsxs("label", { className: "ab-subtitle", children: [
2270
+ booking.resources.state.tag === "error" ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "error", className: "alert alert-error", role: "alert", children: booking.resources.state.message }) : null,
2271
+ showResourceSelect && booking.resources.state.tag === "loaded" && resources.length === 0 ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "error", className: "alert alert-error", role: "alert", children: "No practitioners are available for this service right now." }) : null,
2272
+ showResourceSelect && booking.resources.state.tag !== "loading" && (allowAnyResource || resources.length > 0) ? /* @__PURE__ */ jsxs("div", { className: "rb-reg-stack rb-reg-stack--sm", children: [
2273
+ /* @__PURE__ */ jsxs("span", { className: "ab-subtitle", children: [
2189
2274
  "Practitioner",
2190
2275
  booking.resources.requiresSelection ? "" : " (Optional)"
2191
2276
  ] }),
2192
- /* @__PURE__ */ jsx("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" }),
2193
- /* @__PURE__ */ jsxs("div", { className: "ab-grid", children: [
2194
- allowAnyResource ? /* @__PURE__ */ jsx(
2277
+ /* @__PURE__ */ jsx("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" }),
2278
+ /* @__PURE__ */ jsxs("div", { className: "rb-reg-grid", children: [
2279
+ allowAnyResource ? /* @__PURE__ */ jsxs(
2195
2280
  "button",
2196
2281
  {
2197
2282
  type: "button",
2198
2283
  onClick: () => booking.actions.selectResource(null),
2199
- className: `ab-card ${!selectedResourceId ? "ab-card--selected" : ""}`,
2200
- children: /* @__PURE__ */ jsxs("div", { className: "ab-row--between", children: [
2201
- /* @__PURE__ */ jsx("div", { className: "ab-subtitle", children: "Any Available" }),
2284
+ className: optionCardClassName(!selectedResourceId),
2285
+ "aria-pressed": !selectedResourceId,
2286
+ children: [
2287
+ /* @__PURE__ */ jsx("div", { className: "rb-flex-1 ab-subtitle", children: "Any Available" }),
2202
2288
  !selectedResourceId ? /* @__PURE__ */ jsx(SelectedCheck, {}) : null
2203
- ] })
2289
+ ]
2204
2290
  }
2205
2291
  ) : null,
2206
2292
  resources.map((resource) => {
2207
2293
  const isSelected = selectedResourceId === resource.id;
2208
- return /* @__PURE__ */ jsx(
2294
+ return /* @__PURE__ */ jsxs(
2209
2295
  "button",
2210
2296
  {
2211
2297
  type: "button",
2212
2298
  onClick: () => booking.actions.selectResource(resource.id),
2213
- className: `ab-card ${isSelected ? "ab-card--selected" : ""}`,
2214
- children: /* @__PURE__ */ jsxs("div", { className: "ab-row--between", children: [
2215
- /* @__PURE__ */ jsx("div", { className: "ab-subtitle", children: resource.label }),
2299
+ className: optionCardClassName(isSelected),
2300
+ "aria-pressed": isSelected,
2301
+ children: [
2302
+ /* @__PURE__ */ jsx("div", { className: "rb-flex-1 ab-subtitle", children: resource.label }),
2216
2303
  isSelected ? /* @__PURE__ */ jsx(SelectedCheck, {}) : null
2217
- ] })
2304
+ ]
2218
2305
  },
2219
2306
  resource.id
2220
2307
  );
@@ -2224,27 +2311,30 @@ function DefaultServiceSelectionStep({
2224
2311
  ] });
2225
2312
  }
2226
2313
  function DefaultDateTimeSelectionStep({
2227
- booking
2314
+ booking,
2315
+ errorSummaryId
2228
2316
  }) {
2229
2317
  const selectedDate = booking.availability.selectedDate ?? "";
2230
- const selectedSlotStart = booking.availability.selectedSlot?.startAt ?? "";
2318
+ const selectedSlotKey = booking.availability.selectedSlot?.key ?? "";
2231
2319
  const singleService = booking.services.items.length === 1 ? booking.services.items[0] : void 0;
2232
- const slots = collapseHeadlessSlotsForDisplay({
2320
+ const slots = deriveBookingSlotDisplayOptions({
2233
2321
  slots: booking.availability.slots,
2234
2322
  hasSelectedResource: Boolean(booking.resources.selectedResourceId)
2235
2323
  });
2236
2324
  const error = booking.availability.datesState.tag === "error" ? booking.availability.datesState.message : booking.availability.slotsState.tag === "error" ? booking.availability.slotsState.message : null;
2237
- return /* @__PURE__ */ jsxs("div", { className: "ab-stack", children: [
2238
- singleService ? /* @__PURE__ */ jsxs("div", { className: "ab-info-box", children: [
2325
+ const hasValidationError = Boolean(booking.currentStep?.errors.formError);
2326
+ const validationDescribedBy = hasValidationError ? errorSummaryId : void 0;
2327
+ return /* @__PURE__ */ jsxs("div", { className: "rb-reg-stack", children: [
2328
+ singleService ? /* @__PURE__ */ jsxs("div", { className: "rb-reg-summary", children: [
2239
2329
  /* @__PURE__ */ jsx("h3", { className: "ab-subtitle", children: singleService.title }),
2240
- singleService.description ? /* @__PURE__ */ jsx("p", { className: "ab-text ab-text--muted", children: singleService.description }) : null,
2241
- singleService.durationMinutes ? /* @__PURE__ */ jsxs("p", { className: "ab-text ab-text--muted", children: [
2330
+ singleService.description ? /* @__PURE__ */ jsx("p", { className: "ab-text rb-on-surface--muted", children: singleService.description }) : null,
2331
+ singleService.durationMinutes ? /* @__PURE__ */ jsxs("p", { className: "ab-text rb-on-surface--muted", children: [
2242
2332
  "Duration: ",
2243
2333
  singleService.durationMinutes,
2244
2334
  " minutes"
2245
2335
  ] }) : null
2246
2336
  ] }) : null,
2247
- error ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: error }) : null,
2337
+ error ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "error", className: "alert alert-error", role: "alert", children: error }) : null,
2248
2338
  /* @__PURE__ */ jsx(
2249
2339
  DatePicker,
2250
2340
  {
@@ -2253,6 +2343,8 @@ function DefaultDateTimeSelectionStep({
2253
2343
  dateOptions: [...booking.availability.availableDates],
2254
2344
  isLoading: booking.availability.datesState.tag === "loading",
2255
2345
  isEmpty: booking.availability.datesState.tag !== "loading" && booking.availability.availableDates.length === 0,
2346
+ ariaDescribedBy: validationDescribedBy,
2347
+ ariaInvalid: hasValidationError,
2256
2348
  hasMore: booking.availability.hasMoreDates,
2257
2349
  onLoadMore: booking.availability.loadMoreDates
2258
2350
  }
@@ -2260,16 +2352,17 @@ function DefaultDateTimeSelectionStep({
2260
2352
  selectedDate ? /* @__PURE__ */ jsx(
2261
2353
  TimeSlotSelector,
2262
2354
  {
2263
- value: selectedSlotStart,
2264
- onChange: (slotStartTime) => {
2355
+ value: selectedSlotKey,
2356
+ onChange: (slotKey) => {
2265
2357
  booking.actions.selectSlot(
2266
- booking.availability.slots.find(
2267
- (slot) => slot.startAt === slotStartTime
2268
- ) ?? null
2358
+ slots.find((slot) => slot.key === slotKey)?.slot ?? null
2269
2359
  );
2270
2360
  },
2271
2361
  slots,
2272
- isLoading: booking.availability.slotsState.tag === "loading"
2362
+ isLoading: booking.availability.slotsState.tag === "loading",
2363
+ timezone: booking.availability.timezone,
2364
+ ariaDescribedBy: validationDescribedBy,
2365
+ ariaInvalid: hasValidationError
2273
2366
  }
2274
2367
  ) : null
2275
2368
  ] });
@@ -2280,21 +2373,21 @@ function HeadlessBookingPaymentSelectionStep({
2280
2373
  const service = booking.services.selected;
2281
2374
  const viewModel = booking.payment.selection;
2282
2375
  if (booking.payment.kind === "unsupported") {
2283
- return /* @__PURE__ */ jsx(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: booking.payment.errorMessage });
2376
+ return /* @__PURE__ */ jsx(FeedbackMessage, { tone: "error", className: "alert alert-error", role: "alert", children: booking.payment.errorMessage });
2284
2377
  }
2285
2378
  if (!service || !viewModel) {
2286
- return /* @__PURE__ */ jsx(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: "Payment options are unavailable for this service right now." });
2379
+ return /* @__PURE__ */ jsx(FeedbackMessage, { tone: "error", className: "alert alert-error", role: "alert", children: "Payment options are unavailable for this service right now." });
2287
2380
  }
2288
2381
  const packageOptions = booking.payment.appointmentPackages.items;
2289
2382
  const hasPackageOptions = packageOptions.length > 0;
2290
2383
  const slidingScale = booking.payment.slidingScale;
2291
- return /* @__PURE__ */ jsxs("div", { className: "ab-stack", children: [
2292
- /* @__PURE__ */ jsxs("div", { className: "ab-info-box", children: [
2384
+ return /* @__PURE__ */ jsxs("div", { className: "rb-reg-stack", children: [
2385
+ /* @__PURE__ */ jsxs("div", { className: "rb-reg-summary", children: [
2293
2386
  /* @__PURE__ */ jsx("h3", { className: "ab-subtitle", children: viewModel.sectionTitle }),
2294
- /* @__PURE__ */ jsx("p", { className: "ab-text ab-text--muted", children: service.title })
2387
+ /* @__PURE__ */ jsx("p", { className: "ab-text rb-on-surface--muted", children: service.title })
2295
2388
  ] }),
2296
- booking.payment.appointmentPackages.state.tag === "loading" ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info", role: "status", children: "Checking package credits..." }) : null,
2297
- booking.payment.appointmentPackages.state.tag === "error" ? /* @__PURE__ */ jsxs(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info", role: "status", children: [
2389
+ booking.payment.appointmentPackages.state.tag === "loading" ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "info", className: "alert alert-info", role: "status", children: "Checking package credits..." }) : null,
2390
+ booking.payment.appointmentPackages.state.tag === "error" ? /* @__PURE__ */ jsxs(FeedbackMessage, { tone: "info", className: "alert alert-info", role: "status", children: [
2298
2391
  booking.payment.appointmentPackages.state.message,
2299
2392
  " You can continue with the normal payment option."
2300
2393
  ] }) : null,
@@ -2320,47 +2413,47 @@ function HeadlessBookingPaymentSelectionStep({
2320
2413
  }
2321
2414
  )
2322
2415
  ] }) : null,
2323
- /* @__PURE__ */ jsxs("div", { className: "ab-stack", role: "list", "aria-label": "Payment options", children: [
2324
- packageOptions.map((appointmentPackage) => {
2325
- const isSelected = booking.payment.selectedAppointmentPackageId === appointmentPackage.customerPassId;
2326
- return /* @__PURE__ */ jsx(
2327
- "button",
2328
- {
2329
- type: "button",
2330
- className: themeButtonClassName({
2331
- variant: isSelected ? "primary" : "outline",
2332
- size: "md"
2333
- }),
2334
- style: paymentOptionLayoutStyle,
2335
- onClick: () => booking.actions.selectAppointmentPackage(
2336
- appointmentPackage.customerPassId
2337
- ),
2338
- "aria-pressed": isSelected,
2339
- children: /* @__PURE__ */ jsx(
2340
- PaymentOptionContent,
2416
+ /* @__PURE__ */ jsxs(
2417
+ "div",
2418
+ {
2419
+ className: "rb-reg-stack rb-reg-stack--sm",
2420
+ role: "list",
2421
+ "aria-label": "Payment options",
2422
+ children: [
2423
+ packageOptions.map((appointmentPackage) => {
2424
+ const isSelected = booking.payment.selectedAppointmentPackageId === appointmentPackage.customerPassId;
2425
+ return /* @__PURE__ */ jsxs(
2426
+ "button",
2341
2427
  {
2342
- id: appointmentPackage.customerPassId,
2343
- title: appointmentPackage.passName,
2344
- description: "Use 1 package credit",
2345
- summaryRows: [{
2346
- label: "Balance",
2347
- value: `${appointmentPackage.creditsRemaining} of ${appointmentPackage.creditsTotal} credits remaining`
2348
- }]
2349
- }
2350
- )
2351
- },
2352
- appointmentPackage.customerPassId
2353
- );
2354
- }),
2355
- viewModel.options.map((option) => {
2356
- const isSelected = !booking.payment.selectedAppointmentPackageId && (booking.payment.selectedCollectionOptionKind === option.kind || viewModel.mode === "single_option");
2357
- if (viewModel.mode === "single_option" && !hasPackageOptions) {
2358
- return /* @__PURE__ */ jsx(
2359
- "div",
2360
- {
2361
- className: "ab-card",
2362
- style: paymentOptionLayoutStyle,
2363
- children: /* @__PURE__ */ jsx(
2428
+ type: "button",
2429
+ className: optionCardClassName(isSelected),
2430
+ onClick: () => booking.actions.selectAppointmentPackage(
2431
+ appointmentPackage.customerPassId
2432
+ ),
2433
+ "aria-pressed": isSelected,
2434
+ children: [
2435
+ /* @__PURE__ */ jsx(
2436
+ PaymentOptionContent,
2437
+ {
2438
+ id: appointmentPackage.customerPassId,
2439
+ title: appointmentPackage.passName,
2440
+ description: "Use 1 package credit",
2441
+ summaryRows: [{
2442
+ label: "Balance",
2443
+ value: `${appointmentPackage.creditsRemaining} of ${appointmentPackage.creditsTotal} credits remaining`
2444
+ }]
2445
+ }
2446
+ ),
2447
+ isSelected ? /* @__PURE__ */ jsx(SelectedCheck, {}) : null
2448
+ ]
2449
+ },
2450
+ appointmentPackage.customerPassId
2451
+ );
2452
+ }),
2453
+ viewModel.options.map((option) => {
2454
+ const isSelected = !booking.payment.selectedAppointmentPackageId && (booking.payment.selectedCollectionOptionKind === option.kind || viewModel.mode === "single_option");
2455
+ if (viewModel.mode === "single_option" && !hasPackageOptions) {
2456
+ return /* @__PURE__ */ jsx("div", { className: "rb-reg-summary", children: /* @__PURE__ */ jsx(
2364
2457
  PaymentOptionContent,
2365
2458
  {
2366
2459
  id: option.kind,
@@ -2369,37 +2462,35 @@ function HeadlessBookingPaymentSelectionStep({
2369
2462
  summaryRows: option.summaryRows,
2370
2463
  helperText: option.helperText
2371
2464
  }
2372
- )
2373
- },
2374
- option.kind
2375
- );
2376
- }
2377
- return /* @__PURE__ */ jsx(
2378
- "button",
2379
- {
2380
- type: "button",
2381
- className: themeButtonClassName({
2382
- variant: isSelected ? "primary" : "outline",
2383
- size: "md"
2384
- }),
2385
- style: paymentOptionLayoutStyle,
2386
- onClick: () => booking.actions.selectPaymentOption(option.kind),
2387
- "aria-pressed": isSelected,
2388
- children: /* @__PURE__ */ jsx(
2389
- PaymentOptionContent,
2465
+ ) }, option.kind);
2466
+ }
2467
+ return /* @__PURE__ */ jsxs(
2468
+ "button",
2390
2469
  {
2391
- id: option.kind,
2392
- title: option.title,
2393
- description: option.description,
2394
- summaryRows: option.summaryRows,
2395
- helperText: option.helperText
2396
- }
2397
- )
2398
- },
2399
- option.kind
2400
- );
2401
- })
2402
- ] })
2470
+ type: "button",
2471
+ className: optionCardClassName(isSelected),
2472
+ onClick: () => booking.actions.selectPaymentOption(option.kind),
2473
+ "aria-pressed": isSelected,
2474
+ children: [
2475
+ /* @__PURE__ */ jsx(
2476
+ PaymentOptionContent,
2477
+ {
2478
+ id: option.kind,
2479
+ title: option.title,
2480
+ description: option.description,
2481
+ summaryRows: option.summaryRows,
2482
+ helperText: option.helperText
2483
+ }
2484
+ ),
2485
+ isSelected ? /* @__PURE__ */ jsx(SelectedCheck, {}) : null
2486
+ ]
2487
+ },
2488
+ option.kind
2489
+ );
2490
+ })
2491
+ ]
2492
+ }
2493
+ )
2403
2494
  ] });
2404
2495
  }
2405
2496
  function PaymentOptionContent({
@@ -2409,15 +2500,15 @@ function PaymentOptionContent({
2409
2500
  summaryRows,
2410
2501
  title
2411
2502
  }) {
2412
- return /* @__PURE__ */ jsxs(Fragment, { children: [
2413
- /* @__PURE__ */ jsx("span", { children: title }),
2414
- /* @__PURE__ */ jsx("span", { className: "ab-text ab-text--muted", children: description }),
2415
- /* @__PURE__ */ jsx("div", { className: "ab-stack", style: summaryStackStyle, children: summaryRows.map((row) => /* @__PURE__ */ jsxs("span", { className: "ab-text ab-text--muted", children: [
2503
+ return /* @__PURE__ */ jsxs("div", { className: "rb-flex-1", children: [
2504
+ /* @__PURE__ */ jsx("div", { className: "ab-subtitle", children: title }),
2505
+ /* @__PURE__ */ jsx("div", { className: "ab-text rb-on-surface--muted", children: description }),
2506
+ /* @__PURE__ */ jsx("div", { className: "ab-option-rows", children: summaryRows.map((row) => /* @__PURE__ */ jsxs("span", { className: "ab-text rb-on-surface--muted", children: [
2416
2507
  row.label,
2417
2508
  ": ",
2418
2509
  row.value
2419
2510
  ] }, `${id}-${row.label}`)) }),
2420
- helperText ? /* @__PURE__ */ jsx("span", { className: "ab-text ab-text--muted", children: helperText }) : null
2511
+ helperText ? /* @__PURE__ */ jsx("div", { className: "ab-text rb-on-surface--muted", children: helperText }) : null
2421
2512
  ] });
2422
2513
  }
2423
2514
  function DefaultDynamicFields({
@@ -2689,7 +2780,7 @@ function DefaultBookingDiscount({
2689
2780
  }
2690
2781
  }
2691
2782
  ) : null,
2692
- booking.discount.autoAppliedDiscount && booking.discount.code.trim().length === 0 ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info rb-mt-4", role: "status", children: /* @__PURE__ */ jsxs("p", { className: "ab-text", children: [
2783
+ booking.discount.autoAppliedDiscount && booking.discount.code.trim().length === 0 ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "info", className: "alert alert-info rb-mt-4", role: "status", children: /* @__PURE__ */ jsxs("p", { className: "ab-text", children: [
2693
2784
  "Discount available: ",
2694
2785
  booking.discount.autoAppliedDiscount.publicLabel,
2695
2786
  " ",
@@ -2701,7 +2792,7 @@ function DefaultBookingFeedback({
2701
2792
  booking
2702
2793
  }) {
2703
2794
  if (booking.feedback.kind !== "error") return null;
2704
- return /* @__PURE__ */ jsxs(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: [
2795
+ return /* @__PURE__ */ jsxs(FeedbackMessage, { tone: "error", className: "alert alert-error rb-mt-4", role: "alert", children: [
2705
2796
  /* @__PURE__ */ jsx("p", { className: "ab-text", children: booking.feedback.message }),
2706
2797
  /* @__PURE__ */ jsx(
2707
2798
  "button",
@@ -2727,43 +2818,26 @@ function DefaultBookingAltcha({
2727
2818
  ) });
2728
2819
  }
2729
2820
  function DefaultBookingErrorSummary({
2730
- errors
2821
+ errors,
2822
+ id
2731
2823
  }) {
2732
2824
  if (!hasBookingValidationErrors(errors)) return null;
2733
- return /* @__PURE__ */ jsxs(FeedbackMessage, { tone: "error", className: "rb-mt-6 alert alert-error", role: "alert", children: [
2734
- errors.formError ? /* @__PURE__ */ jsx("p", { className: "rb-caption", children: /* @__PURE__ */ jsx("strong", { children: errors.formError }) }) : null,
2735
- Object.entries(errors.fieldErrors).map(([key, message]) => /* @__PURE__ */ jsx("p", { className: "rb-caption", children: message }, key))
2736
- ] });
2737
- }
2738
- function SelectedCheck() {
2739
- return /* @__PURE__ */ jsx("div", { className: "ab-check", children: /* @__PURE__ */ jsx(
2740
- "svg",
2825
+ return /* @__PURE__ */ jsxs(
2826
+ FeedbackMessage,
2741
2827
  {
2742
- fill: "none",
2743
- strokeLinecap: "round",
2744
- strokeLinejoin: "round",
2745
- strokeWidth: "2",
2746
- viewBox: "0 0 24 24",
2747
- stroke: "currentColor",
2748
- children: /* @__PURE__ */ jsx("path", { d: "M5 13l4 4L19 7" })
2828
+ tone: "error",
2829
+ className: "rb-mt-6 alert alert-error",
2830
+ id,
2831
+ role: "alert",
2832
+ children: [
2833
+ errors.formError ? /* @__PURE__ */ jsx("p", { className: "rb-caption", children: /* @__PURE__ */ jsx("strong", { children: errors.formError }) }) : null,
2834
+ Object.entries(errors.fieldErrors).map(([key, message]) => /* @__PURE__ */ jsx("p", { className: "rb-caption", children: message }, key))
2835
+ ]
2749
2836
  }
2750
- ) });
2837
+ );
2751
2838
  }
2752
- function collapseHeadlessSlotsForDisplay(input) {
2753
- const seenStartTimes = /* @__PURE__ */ new Set();
2754
- const visibleSlots = [];
2755
- for (const slot of input.slots) {
2756
- if (!input.hasSelectedResource) {
2757
- if (seenStartTimes.has(slot.startAt)) continue;
2758
- seenStartTimes.add(slot.startAt);
2759
- }
2760
- visibleSlots.push({
2761
- startAt: slot.startAt,
2762
- endAt: slot.endAt,
2763
- resourceId: unsafeAsAppointmentResourceId(slot.resourceId)
2764
- });
2765
- }
2766
- return visibleSlots;
2839
+ function SelectedCheck() {
2840
+ return /* @__PURE__ */ jsx("div", { className: "rb-option-check", children: /* @__PURE__ */ jsx(CheckIcon, {}) });
2767
2841
  }
2768
2842
  var PORTAL_REBOOK_QUERY_PARAM = "rebook";
2769
2843
  var PORTAL_REBOOK_QUERY_VALUE = "1";
@@ -2789,6 +2863,14 @@ function appendRebookFlag(url, enabled) {
2789
2863
  );
2790
2864
  return nextUrl.toString();
2791
2865
  }
2866
+ function BookingSurface({
2867
+ id,
2868
+ className,
2869
+ children
2870
+ }) {
2871
+ const classes = ["rb-reg-surface", className ?? ""].join(" ").trim();
2872
+ return /* @__PURE__ */ jsx("div", { id, className: classes, children });
2873
+ }
2792
2874
  var BookingFormClient = ({
2793
2875
  siteId: siteIdProp,
2794
2876
  render
@@ -2886,7 +2968,7 @@ var BookingFormClient = ({
2886
2968
  FeedbackMessage,
2887
2969
  {
2888
2970
  tone: "error",
2889
- className: `ab-alert ab-alert--error ${render.display.className ?? ""}`.trim(),
2971
+ className: `alert alert-error ${render.display.className ?? ""}`.trim(),
2890
2972
  role: "alert",
2891
2973
  children: /* @__PURE__ */ jsx("p", { className: "ab-text", children: render.display.message ?? "Booking form not found. Please check your configuration." })
2892
2974
  }
@@ -2908,28 +2990,20 @@ var BookingFormClient = ({
2908
2990
  }
2909
2991
  };
2910
2992
  if (viewState.kind === "success") {
2911
- return /* @__PURE__ */ jsx(
2993
+ return /* @__PURE__ */ jsx(BookingSurface, { id: bookingAnchorId, className: render.display.className, children: /* @__PURE__ */ jsx(
2912
2994
  SuccessMessage,
2913
2995
  {
2914
2996
  message: getBookingSuccessMessage(render.display.successMessage),
2915
- resourceName: viewState.resourceName,
2916
- className: render.display.className ?? void 0
2997
+ resourceName: viewState.resourceName
2917
2998
  }
2918
- );
2999
+ ) });
2919
3000
  }
2920
3001
  if (viewState.kind === "verifying") {
2921
- return /* @__PURE__ */ jsx(
2922
- "div",
2923
- {
2924
- id: bookingAnchorId,
2925
- className: render.display.className ?? void 0,
2926
- children: /* @__PURE__ */ jsx(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info", role: "status", children: /* @__PURE__ */ jsx("p", { className: "ab-text", children: viewState.message }) })
2927
- }
2928
- );
3002
+ return /* @__PURE__ */ jsx(BookingSurface, { id: bookingAnchorId, className: render.display.className, children: /* @__PURE__ */ jsx(FeedbackMessage, { tone: "info", className: "alert alert-info", role: "status", children: /* @__PURE__ */ jsx("p", { className: "ab-text", children: viewState.message }) }) });
2929
3003
  }
2930
- return /* @__PURE__ */ jsxs("div", { id: bookingAnchorId, className: render.display.className ?? void 0, children: [
2931
- render.hydration.noticeMessage ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info rb-mb-4", role: "status", children: /* @__PURE__ */ jsx("p", { className: "ab-text", children: render.hydration.noticeMessage }) }) : null,
2932
- viewState.kind === "error" ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: /* @__PURE__ */ jsx("p", { className: "ab-text", children: viewState.message }) }) : null,
3004
+ return /* @__PURE__ */ jsxs(BookingSurface, { id: bookingAnchorId, className: render.display.className, children: [
3005
+ render.hydration.noticeMessage ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "info", className: "alert alert-info rb-mb-4", role: "status", children: /* @__PURE__ */ jsx("p", { className: "ab-text", children: render.hydration.noticeMessage }) }) : null,
3006
+ viewState.kind === "error" ? /* @__PURE__ */ jsx(FeedbackMessage, { tone: "error", className: "alert alert-error rb-mb-4", role: "alert", children: /* @__PURE__ */ jsx("p", { className: "ab-text", children: viewState.message }) }) : null,
2933
3007
  /* @__PURE__ */ jsx(HeadlessBookingDefaultForm, { booking, onSubmit: handleComplete })
2934
3008
  ] });
2935
3009
  };