@riverbankcms/sdk 0.178.0 → 0.180.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 (221) hide show
  1. package/README.md +15 -8
  2. package/dist/_dts/{BlocksIslandsHydrator-CrKsXtpD.d.ts → BlocksIslandsHydrator-DC_AvZwy.d.ts} +1 -1
  3. package/dist/_dts/{Page-C9i27wZA.d.ts → Page-DQOxVtp3.d.ts} +7 -7
  4. package/dist/_dts/{SdkPreviewMode-DzGSR3jh.d.ts → SdkPreviewMode-DrLgY9_f.d.ts} +3 -2
  5. package/dist/_dts/{client-BnYN6XsH.d.ts → client-BP7VBRvs.d.ts} +281 -72
  6. package/dist/_dts/{content-types-CXj6lp3d.d.ts → content-types-1-K2qi__.d.ts} +2 -2
  7. package/dist/_dts/{contracts-BZLwkTwL.d.ts → contracts-Dfqz0Tcu.d.ts} +6 -116
  8. package/dist/_dts/{generatePageMetadata-ByEWwe9j.d.ts → generatePageMetadata-CSfAqmry.d.ts} +2 -2
  9. package/dist/_dts/{index-BE9dWIsr.d.ts → index-B0_2-65A.d.ts} +3 -3
  10. package/dist/_dts/{index-0HFgCnGz.d.ts → index-BeM5Ylwf.d.ts} +5 -3
  11. package/dist/_dts/{index-D9-N1d9v.d.ts → index-Blrw2oVk.d.ts} +1 -1
  12. package/dist/_dts/{index-cTpvQg_Q.d.ts → index-CB5Csefo.d.ts} +2 -2
  13. package/dist/_dts/{index-nnEdgc3Z.d.ts → index-DCcxLa8p.d.ts} +4 -2
  14. package/dist/_dts/{index-DCa-8TEY.d.ts → index-DQBGwBPx.d.ts} +1 -1
  15. package/dist/_dts/{index-CKDRr54L.d.ts → index-DQr358-m.d.ts} +4 -4
  16. package/dist/_dts/{loadContent-DYkVV6w4.d.ts → loadContent-BG2tLGXj.d.ts} +15 -13
  17. package/dist/_dts/{request-B20VRWHH.d.ts → request-P08l6mkr.d.ts} +3641 -994
  18. package/dist/_dts/{resolveBlockData-C_aK5GIS.d.ts → resolveBlockData-BDHc8lFs.d.ts} +8 -5
  19. package/dist/_dts/resolvePageContent-Y3IZBbtL.d.ts +61 -0
  20. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  21. package/dist/_dts/sdk/src/client/types.d.ts +3 -3
  22. package/dist/_dts/sdk/src/client.d.ts +7 -7
  23. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  24. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  25. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  26. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  27. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  28. package/dist/_dts/sdk/src/data/types.d.ts +7 -2
  29. package/dist/_dts/sdk/src/gifting/client.d.ts +1 -1
  30. package/dist/_dts/sdk/src/index.d.ts +8 -8
  31. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  32. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  33. package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
  34. package/dist/_dts/sdk/src/next/index.d.ts +16 -8
  35. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  36. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  37. package/dist/_dts/sdk/src/portal/client.d.ts +3 -3
  38. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  39. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  40. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  41. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  42. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  43. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  44. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  45. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
  46. package/dist/_dts/sdk/src/rendering/index.d.ts +7 -7
  47. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  48. package/dist/_dts/sdk/src/rendering/server.d.ts +3 -3
  49. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  50. package/dist/_dts/sdk/src/routing/index.d.ts +19 -6
  51. package/dist/_dts/sdk/src/server.d.ts +5 -5
  52. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  53. package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
  54. package/dist/_dts/serviceBookingOutline-BvtNagjw.d.ts +583 -0
  55. package/dist/_dts/{types-CYcd15BQ.d.ts → types-BrK6SS5c.d.ts} +9 -7
  56. package/dist/_dts/{types-CMZ5mkpv.d.ts → types-DpEAnP4F.d.ts} +10 -39
  57. package/dist/_dts/{types-rm2M4LGx.d.ts → types-HAy1-Jjo.d.ts} +3 -3
  58. package/dist/_dts/{validation-BSxnRhyy.d.ts → validation-D6q3tOBA.d.ts} +4 -4
  59. package/dist/client/{BlocksIslandsHydrator-D1n09bu-.mjs → BlocksIslandsHydrator-DJSmdNUJ.mjs} +17 -18
  60. package/dist/client/{BookingMailingListNote-DSD4gS96.mjs → BookingMailingListNote-CGxg37zx.mjs} +92 -60
  61. package/dist/client/{BookingQuestionFields-B57oGPcj.mjs → BookingQuestionFields-DXegGSnS.mjs} +26 -5
  62. package/dist/client/{CalendarNavigationChevron-qXvsFYOg.mjs → CalendarNavigationChevron-VfP50sYm.mjs} +42 -9
  63. package/dist/client/{CheckboxChoice-b-PJLEXe.mjs → CheckboxChoice-BZPLCgTU.mjs} +1 -1
  64. package/dist/client/{DemoBookingPortalAccess-Olvrwi3Z.mjs → DemoBookingPortalAccess-0Ua44F1j.mjs} +13 -8
  65. package/dist/client/{EventCalendar.client-DwFNFb-0.mjs → EventCalendar.client-CrpiyDSP.mjs} +10 -10
  66. package/dist/client/{EventCombined.client-Ffu-aVOb.mjs → EventCombined.client-D0me9wnz.mjs} +10 -10
  67. package/dist/client/{EventEmbeddedCheckoutStep-B18VbNS_.mjs → EventEmbeddedCheckoutStep-BDnicDM6.mjs} +1 -1
  68. package/dist/client/{EventItem-b8tVkNHA.mjs → EventItem-CJITrGkF.mjs} +249 -8
  69. package/dist/client/{EventListWeekNavigation-BxnJW_Gf.mjs → EventListWeekNavigation-BlEm_xjq.mjs} +1 -1
  70. package/dist/client/{EventListing.client-ViCnrNg4.mjs → EventListing.client-BNM_HuS0.mjs} +3 -3
  71. package/dist/client/{EventListing.view-CdjiepMf.mjs → EventListing.view-CXfb7RRy.mjs} +7 -16
  72. package/dist/client/{EventRegistrationPayment-BVd70XkH.mjs → EventRegistrationPayment-DiD9uYs6.mjs} +1439 -293
  73. package/dist/client/{Page-DqETUt-U.mjs → Page-bX7iy_MK.mjs} +24299 -20103
  74. package/dist/client/{ProtectedSubmitButton-C-ql101B.mjs → ProtectedSubmitButton-De6AzhE6.mjs} +1 -1
  75. package/dist/client/{SiteTermsAgreementField-DkFnbzf_.mjs → SiteTermsAgreementField-BAdW5DvE.mjs} +23 -16
  76. package/dist/client/{BookingPanelArrangement--EkA1ZQd.mjs → StepIndicator-DCfdcb7s.mjs} +12 -12
  77. package/dist/client/{StepIndicator-JO2PS03n.mjs → StepIndicator-DCqorVne.mjs} +7 -7
  78. package/dist/client/{TabBarFragment-BqfRLojo.mjs → TabBarFragment-DlKQRhP4.mjs} +1 -1
  79. package/dist/client/{ThemedButton-DuaYtnvG.mjs → ThemedButton-CnSa7o-I.mjs} +66 -66
  80. package/dist/client/{accessibleSurfaces-DN8it_Cx.mjs → accessibleSurfaces-Wl8-_OVJ.mjs} +1 -1
  81. package/dist/client/{accordion-XgNxl0Wg.mjs → accordion-wofJY8xY.mjs} +1 -1
  82. package/dist/client/{booking-form.client-ljJoDwuI.mjs → booking-form.client-CYl9NrqS.mjs} +412 -79
  83. package/dist/client/{bookingForm-DtEHwY4W.mjs → bookingForm-kgVWtuMe.mjs} +4 -4
  84. package/dist/client/bookings.mjs +40 -10
  85. package/dist/client/{boxStyleClassNames-BHoMAcun.mjs → boxStyleClassNames-CQHWz5gJ.mjs} +19 -19
  86. package/dist/client/{carousel-B3UhbFu7.mjs → carousel-BE1dEFsD.mjs} +2 -2
  87. package/dist/client/{carousel.client-h65clfUO.mjs → carousel.client-DMtGYTTM.mjs} +1 -1
  88. package/dist/client/{cart-DzOJfYOR.mjs → cart-BsjsdGZE.mjs} +3 -3
  89. package/dist/client/{cart.client-DBG77v-5.mjs → cart.client-DylGUWXY.mjs} +1 -1
  90. package/dist/client/{checkout-LmePoEgM.mjs → checkout-B5KxEUDr.mjs} +3 -3
  91. package/dist/client/{checkout.client-DmgZuLBT.mjs → checkout.client-C98fhch3.mjs} +1 -1
  92. package/dist/client/{checkoutUrls-CMZI8o_V.mjs → checkoutUrls-BMLYTf38.mjs} +1 -1
  93. package/dist/client/client.mjs +502 -341
  94. package/dist/client/constants-PfYJsEZF.mjs +101 -0
  95. package/dist/client/{context-CJIz4FdL.mjs → context-DtKdUdkO.mjs} +200 -27
  96. package/dist/client/{dateFormatting-UoXqBh10.mjs → dateFormatting-BaGPvQS3.mjs} +1 -1
  97. package/dist/client/{demoPortalMagicLink-6CgFZNvu.mjs → demoPortalMagicLink-B8eDjhuG.mjs} +1 -1
  98. package/dist/client/{enhanceHeaderSection-DaMo6len.mjs → enhanceHeaderSection-DvhD-8eE.mjs} +4 -4
  99. package/dist/client/{event-registration.client-b6APrFQe.mjs → event-registration.client-Du9a_xAN.mjs} +1982 -1519
  100. package/dist/client/{eventCalendar-DJYz7yZf.mjs → eventCalendar-Di9wDfzl.mjs} +4 -4
  101. package/dist/client/{eventCombined-j9VCVgMW.mjs → eventCombined-CNW6nBsB.mjs} +4 -4
  102. package/dist/client/{eventListing-DWgpGuFM.mjs → eventListing-CQMxQ8By.mjs} +4 -4
  103. package/dist/client/{eventRegistration-DCinRot3.mjs → eventRegistration-CprS9k1D.mjs} +4 -4
  104. package/dist/client/events-9LPvwbWp.mjs +28 -0
  105. package/dist/client/{form-BBBtRwvy.mjs → form-Zl1_8RJ6.mjs} +3 -3
  106. package/dist/client/{form.client-CZeRQLGF.mjs → form.client-TaMUys6I.mjs} +5 -5
  107. package/dist/client/{form.parts-DhGGv4_L.mjs → form.parts-CpNPbPPM.mjs} +3 -3
  108. package/dist/client/{formatDate-DVFVDcDW.mjs → formatDate-hhI1-tzt.mjs} +1 -1
  109. package/dist/client/gifting/client.mjs +6 -6
  110. package/dist/client/{gifting-Di9-SpwW.mjs → gifting-DNVa7-Wj.mjs} +4 -4
  111. package/dist/client/{gifting.client-CjT5PrAZ.mjs → gifting.client-CFUq3GVx.mjs} +5 -5
  112. package/dist/client/{gifting.parts-ffP6mjMd.mjs → gifting.parts-CDQvxA4A.mjs} +2 -2
  113. package/dist/client/{headerSection-jjAvtSZk.mjs → headerSection-Cg6083rn.mjs} +2 -2
  114. package/dist/client/{lookSurfaces-C2VzJfyG.mjs → lookSurfaces-gJ3OqPf9.mjs} +258 -86
  115. package/dist/client/{newsletter-form.client-D45frHoa.mjs → newsletter-form.client-VuL9I96G.mjs} +6 -6
  116. package/dist/client/{shop.interactive-D7wky1GL.mjs → newsletter-form.interactive-7Of3eYn0.mjs} +4023 -4029
  117. package/dist/client/{newsletter-form.parts-CHdg82ct.mjs → newsletter-form.parts-OBqsfT24.mjs} +2 -2
  118. package/dist/client/{newsletterForm-tS465_vl.mjs → newsletterForm-BkJe_RTv.mjs} +3 -3
  119. package/dist/client/portal/client.mjs +301 -117
  120. package/dist/client/{product-detail.client-DIWSeW7P.mjs → product-detail.client-B2hdxqJN.mjs} +1 -1
  121. package/dist/client/{product-list.client-BRf14h_e.mjs → product-list.client-CCEgu9rx.mjs} +1 -1
  122. package/dist/client/{productDetail-gxF5whea.mjs → productDetail-CRX_ZRfS.mjs} +3 -3
  123. package/dist/client/{productList-B9t0XJrN.mjs → productList-BAdJ6z5S.mjs} +3 -3
  124. package/dist/client/{propsDecoder-Db8wAmgr.mjs → propsDecoder-BLKAmX0S.mjs} +2 -48
  125. package/dist/client/{registry.server-Bn0gE0uP.mjs → registry.server-Bj9cmHHF.mjs} +10464 -9113
  126. package/dist/client/rendering/client.mjs +41 -27
  127. package/dist/client/rendering/islands.mjs +1 -1
  128. package/dist/client/rendering.mjs +23 -2836
  129. package/dist/client/{richText-coerce-COnKrLO7.mjs → richText-coerce-Z45OLLEX.mjs} +1 -1
  130. package/dist/client/{routeIslandApiConfig-Bok1Oy50.mjs → routeIslandApiConfig-DHpTTK77.mjs} +1 -1
  131. package/dist/client/runtimeResponse-D2j2-mOk.mjs +3 -0
  132. package/dist/client/{runtimeResponse-9v8q2NBc.mjs → runtimeResponse-DtWSfWSZ.mjs} +1 -1
  133. package/dist/client/{shop-D1oTPDxm.mjs → shop-BKsgxm_-.mjs} +3 -3
  134. package/dist/client/{shop-commerce-DyMZLC0a.mjs → shop-commerce-Cbtk_kUW.mjs} +14 -14
  135. package/dist/client/{shop-commerce-store-FODNS63D.mjs → shop-commerce-store-B-rv2p5h.mjs} +1 -1
  136. package/dist/client/{shop-discount-apply.state-C4xcmFzZ.mjs → shop-discount-apply.state-CiCDLNh7.mjs} +2 -2
  137. package/dist/client/{shop.client-CRgRulfI.mjs → shop.client-Rnqa74Tk.mjs} +14 -14
  138. package/dist/client/{shopShared-Bd_hy9ZO.mjs → shopShared-BaBfhjCq.mjs} +2 -2
  139. package/dist/client/spam-protection.mjs +1 -1
  140. package/dist/client/{noop-D11X-B6n.mjs → src-o7WEvbK1.mjs} +398 -308
  141. package/dist/client/{timetableModel-UlWfP1gh.mjs → timetableModel-BOff1Kk5.mjs} +259 -11
  142. package/dist/client/{types-DjWUR_O6.mjs → types-BEaKfam_.mjs} +65 -65
  143. package/dist/client/{useAvailableSlots-D-qoooLy.mjs → useAvailableSlots-DQJNh10g.mjs} +3 -23
  144. package/dist/client/useDiscountCodeUi-BcFQRI_7.mjs +196 -0
  145. package/dist/client/{useEventPagination-CQH2e9sQ.mjs → useEventPagination-BvdcexDC.mjs} +8 -8
  146. package/dist/client/{view-bGU1ws-m.mjs → view-CTBwSpKv.mjs} +4 -4
  147. package/dist/client/{display-D1oVR5Eh.mjs → wizardSteps-CWIQyRIw.mjs} +10263 -9078
  148. package/dist/preview-next/before-render.mjs +5 -3
  149. package/dist/preview-next/client/{LocationPickerEnvironment-BHAT81Wx.mjs → LocationPickerEnvironment-BW3dRFIv.mjs} +1 -1
  150. package/dist/preview-next/client/{MapLibreEditMap-B52hkdIZ.mjs → MapLibreEditMap-Db9BHyXh.mjs} +2 -2
  151. package/dist/preview-next/client/{PageSectionToolbar-D-Le7O3o.mjs → PageSectionToolbar-CG6KwITA.mjs} +4 -4
  152. package/dist/preview-next/client/{PreviewEditorSidebar-DNy5j_ce.mjs → PreviewEditorSidebar-BGBqrC9m.mjs} +8 -7
  153. package/dist/preview-next/client/{PreviewEditorUI-CzJvgbqt.mjs → PreviewEditorUI-Bwkyx28x.mjs} +5 -5
  154. package/dist/preview-next/client/{PreviewShell-xhJ6ca1i.mjs → PreviewShell-DB1l6JNU.mjs} +7 -7
  155. package/dist/preview-next/client/{SdkPreviewModeRuntime-BmYO1TdT.mjs → SdkPreviewModeRuntime-Bs6Cwzr3.mjs} +15 -7
  156. package/dist/preview-next/client/{lucide-react-McYZeSMb.mjs → lucide-react-00FF_oar.mjs} +13 -1
  157. package/dist/preview-next/client/{previewAssistantSlot-BN93X9o1.mjs → previewAssistantSlot-T-oDD_Dd.mjs} +6252 -2461
  158. package/dist/preview-next/client/{previewChromeRoot-C51RQseo.mjs → previewChromeRoot-BeukcDRy.mjs} +1 -1
  159. package/dist/preview-next/client/runtime.mjs +3 -3
  160. package/dist/preview-next/client/{sdk-runtime-oeGquJM-.mjs → sdk-runtime-ceDW_9q2.mjs} +2 -2
  161. package/dist/preview-next/client/{siteStyleAccess-BGTAcPud.mjs → siteStyleAccess-CCB9bScO.mjs} +35 -23
  162. package/dist/preview-next/client/{useAutosaveStatus-BMGXjGZq.mjs → useAutosaveStatus-D4o0CKq7.mjs} +1 -1
  163. package/dist/preview-next/client/{useOpenBlockForSetup-CTDoR_gQ.mjs → useOpenBlockForSetup-Seccrvwu.mjs} +2 -2
  164. package/dist/preview-next/container-responsive.css +103 -10
  165. package/dist/preview-next/keepAlive.mjs +1 -1
  166. package/dist/preview-next/middleware.mjs +1 -1
  167. package/dist/preview-next/{route-contract-BtdzkSUg.mjs → route-contract-FwFj8zGL.mjs} +71 -10
  168. package/dist/server/{Block.shared-Bp3OlOjj.mjs → Block.shared-D6WrRCxX.mjs} +4 -4
  169. package/dist/server/{ThemeScopeCore-DFEM1a85.mjs → ThemeScopeCore-BQzjDQ2q.mjs} +8 -1
  170. package/dist/server/{bindings-DrbJuftt.mjs → bindings-CS6ih1Yc.mjs} +37 -6
  171. package/dist/server/{client-Bf06n9oj.mjs → client-m0ylCj_f.mjs} +436 -526
  172. package/dist/server/config-validation.mjs +1 -1
  173. package/dist/server/config.mjs +2 -2
  174. package/dist/server/contentTypeResolver-B9vy8BrF.mjs +19 -0
  175. package/dist/server/data/dataLoaderContext.mjs +1 -1
  176. package/dist/server/data/resolveBlockData.mjs +1 -1
  177. package/dist/server/{dataLoaderContext-B3fXA54R.mjs → dataLoaderContext-lMRTfG5Z.mjs} +1 -0
  178. package/dist/server/error-f4g44bKx.mjs +387 -0
  179. package/dist/server/index.mjs +3 -2
  180. package/dist/server/loadContent-vgWMz1uD.mjs +694 -0
  181. package/dist/server/{loadPage-5iZefzDd.mjs → loadPage-CIOL3-9t.mjs} +22 -4
  182. package/dist/server/{lookMediaFrame-CaH018pK.mjs → lookMediaFrame-m-91jGGn.mjs} +36 -0
  183. package/dist/server/next.mjs +67 -94
  184. package/dist/server/{overrideResolution-CUHtm7tW.mjs → overrideResolution-BiHmsvTZ.mjs} +1 -1
  185. package/dist/server/page-converter.mjs +1 -1
  186. package/dist/server/{pageRenderPlan-GmPXForc.mjs → pageRenderPlan-DJo_obpi.mjs} +15 -8
  187. package/dist/server/{pageRuntimeSupport-Dd8LFzfa.mjs → pageRuntimeSupport-BnSuoHON.mjs} +54 -2
  188. package/dist/server/{pageShared-tz-GVWft.mjs → pageShared-BJuOzxzn.mjs} +554 -304
  189. package/dist/server/{prebuild-JmsuYCIH.mjs → prebuild-Cr8p8T7V.mjs} +5 -4
  190. package/dist/server/prebuild.mjs +1 -1
  191. package/dist/server/{prefetchBlockData-Ce9DDwON.mjs → prefetchBlockData-BZh57-ua.mjs} +5 -3
  192. package/dist/server/{registry-D12XF_h1.mjs → registry-CvhFwbXJ.mjs} +358 -95
  193. package/dist/server/rendering/components/pageShared.mjs +1 -1
  194. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  195. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  196. package/dist/server/rendering/server.mjs +5 -4
  197. package/dist/server/rendering.mjs +9 -8
  198. package/dist/server/{resolveBlockData-D9yZIN3V.mjs → resolveBlockData-Cv_W1LVB.mjs} +61 -34
  199. package/dist/server/resolvePageContent-BWKUZUIn.mjs +89 -0
  200. package/dist/server/{responseMedia-F-ElH2Rd.mjs → responseMedia-KRKguBC5.mjs} +56 -1
  201. package/dist/server/routing.mjs +271 -57
  202. package/dist/server/server.mjs +3 -3
  203. package/dist/server/{loadContent-eaTY7RPg.mjs → servicePageContent-CRKbTm_7.mjs} +719 -459
  204. package/dist/server/theme-bridge.mjs +1 -1
  205. package/dist/server/{validation-CLq5cw6M.mjs → validation-DCl-FCk_.mjs} +4 -4
  206. package/dist/server/{version-oPbhAx8E.mjs → version-DT_R5JAR.mjs} +1 -1
  207. package/dist/styles/index.css +504 -27
  208. package/package.json +1 -1
  209. package/dist/_dts/footerPageOutline-D_XbQW_o.d.ts +0 -256
  210. package/dist/_dts/resolvePageContent-YT6ndha1.d.ts +0 -162
  211. package/dist/client/LocationMapActions-CiMtl1Ha.mjs +0 -62
  212. package/dist/client/MapDrawingSvg-BCZa3dpf.mjs +0 -200
  213. package/dist/client/constants-4o4_hl34.mjs +0 -6
  214. package/dist/client/course-DBEU9IA9.mjs +0 -244
  215. package/dist/client/duration-Q6_QNgiv.mjs +0 -37
  216. package/dist/client/event-details.client-BwASwKIq.mjs +0 -53
  217. package/dist/client/eventDetails-BzGOVDI-.mjs +0 -13
  218. package/dist/client/runtimeResponse-CVkM0dHy.mjs +0 -3
  219. package/dist/client/useDiscountCodeUi-B9DODAkj.mjs +0 -237
  220. package/dist/client/view-DNX59QwM.mjs +0 -1372
  221. package/dist/server/resolvePageContent-CAELMBEJ.mjs +0 -438
@@ -1,25 +1,25 @@
1
1
  "use client";
2
- import { $i as appointmentQuestionsRefusal, Ai as getBookingSuccessCopy, Ba as resolveDateRuntimeContext, Bi as resolveBookingPaymentStep, Ca as toBookingPurchasablePackages, Di as deriveBookingFormViewState, Ei as readOverrideServiceCategories, Fi as normalizeBookingFormConfig, Gi as snapshotBookingShownTerms, Hi as resolveBookingSiteId, Ii as normalizeBookingServices, Ka as leavePage, Ki as toSelectedCollectionOptionKind, Li as parseBookingCurrencyInputToCents, Ni as isBookingServiceSlidingAmountInRange, Oi as formatBookingSubmissionPreparationError, Pi as isSameOpenCheckout, Qi as applyAppointmentBookingQuestionsEvent, Ri as prepareBookingSubmission, Sa as resolveBookingPurchasablePackages, Ti as buildBookingFormInteractiveIslandProps, Ui as resolveDefaultBookingServiceId, Uo as repriceBookingCollectionOptions, Vi as resolveBookingSelectedService, Wi as selectedBookingCollectionOptionKind, Xi as resolveSelectedAppointmentConsent, Xo as resolveBookingSignupOffer, Yi as projectSelectedAppointmentConsentIntoForm, Zi as EMPTY_APPOINTMENT_BOOKING_QUESTIONS, _a as resolveBookingPackagePaymentSelection, at as buildBookingPaymentSelectionViewModel, ba as resolveBookingPaymentChoice, br as bookingPresentation, c as formatCommercePrice, ca as toBookingQuestionsAnswerDraft, ct as paymentChoicePrice, ea as deriveAppointmentBookingQuestions, fa as applyBookingPaymentAdmission, ga as reconcileBookingPackagePurchase, gs as unsafeAsSiteId, ha as bookingRequiresResourceSelection, ia as decideBookingQuestionsRestoration, ki as getBookingRedirectStateFromLocation, ma as bookingPackageRequestKey, mr as createSignInReturnDraftStore, na as needsAppointmentQuestionsRefresh, ot as buildReviewedBookingPaymentViewModel, pa as bookingHasPackagePaymentChoices, qi as formatCentsAsCurrencyInput, ra as bookingQuestionsAnswerDraftSchema, sa as restoreBookingQuestionsAnswers, st as paymentChoiceDetails, ta as isAppointmentBookingQuestionsEvent, u as formatValidity, ua as BOOKING_FORM_DATA_RESERVED_KEYS, va as resolveBookingPackageSources, wa as getBookingServiceSlidingScale, xa as resolveBookingPaymentMode, ya as resolveBookingPaymentAvailability, za as readRuntimeNow, zi as resolveAppointmentCheckoutVerificationState } from "./display-D1oVR5Eh.mjs";
3
- import { Jt as formatDate, Q as isBookingRequirementConsentFieldId, Sn as formatCurrencyAmount, Zt as formatDateTimeRange, _n as resolveBookingTimeZoneId, a as okWith, c as reportWorkflowSuccess, en as formatTime, gn as resolveBookingBusinessTimeZone, hn as toUtcIsoDateTimeString, in as resolveBookingDisplayContext, mn as parseUtcIsoDateTimeString, n as assertNever, nn as formatTimeZoneCityLabel, o as clearWorkflowFeedback, r as err, s as reportWorkflowError, t as logger } from "./noop-D11X-B6n.mjs";
4
- import { D as unsafeAsAppointmentResourceId, O as unsafeAsAppointmentServiceId, g as formatCreditProductUnits, h as formatCreditProductPayment, m as formatCreditProductBalance, o as checkBookingQuestionsAnswered } from "./creditProducts-BQ1t1erI.mjs";
5
- import { i as useSiteTermsAgreement, n as SiteTermsChangedNotice, t as SiteTermsAgreementField } from "./SiteTermsAgreementField-DkFnbzf_.mjs";
2
+ import { $i as resolveBookingPaymentChoice, Ai as appointmentQuestionsRefusal, Bn as isEmailAddress, Ci as selectedBookingCollectionOptionKind, Cr as formatCommercePrice, Da as leavePage, Di as resolveSelectedAppointmentConsent, Ei as projectSelectedAppointmentConsentIntoForm, Fi as decideBookingQuestionsRestoration, Gi as applyBookingPaymentAdmission, H as buildReviewedBookingPaymentViewModel, Is as unsafeAsSiteId, Ji as bookingRequiresResourceSelection, Jo as resolveDateRuntimeContext, Ki as bookingHasPackagePaymentChoices, Mi as isAppointmentBookingQuestionsEvent, Ni as needsAppointmentQuestionsRefresh, Oi as EMPTY_APPOINTMENT_BOOKING_QUESTIONS, Pi as bookingQuestionsAnswerDraftSchema, Qi as resolveBookingPaymentAvailability, Ri as restoreBookingQuestionsAnswers, Si as resolveLowestBookingPaymentStep, Ti as toSelectedCollectionOptionKind, Tr as formatValidity, U as paymentChoiceDetails, Ui as BOOKING_FORM_DATA_RESERVED_KEYS, V as buildBookingPaymentSelectionViewModel, Vi as formatCentsAsCurrencyInput, W as paymentChoicePrice, Xi as resolveBookingPackagePaymentSelection, Yi as reconcileBookingPackagePurchase, Zi as resolveBookingPackageSources, _i as resolveAppointmentCheckoutVerificationState, ai as deriveBookingFormViewState, bi as resolveBookingSiteId, ci as getBookingSuccessCopy, di as isBookingServiceSlidingAmountInRange, ea as resolveBookingPaymentMode, fi as isSameOpenCheckout, gi as prepareBookingSubmission, gs as resolveBookingSignupOffer, hi as parseBookingCurrencyInputToCents, ii as readOverrideServiceCategories, ja as bookingPresentation, ji as deriveAppointmentBookingQuestions, ki as applyAppointmentBookingQuestionsEvent, mi as normalizeBookingServices, na as toBookingPurchasablePackages, oi as formatBookingSubmissionPreparationError, or as createSignInReturnDraftStore, pi as normalizeBookingFormConfig, qi as bookingPackageRequestKey, qo as readRuntimeNow, ra as getBookingServiceSlidingScale, ri as buildBookingFormInteractiveIslandProps, si as getBookingRedirectStateFromLocation, ss as repriceBookingCollectionOptions, ta as resolveBookingPurchasablePackages, vi as resolveBookingPaymentStep, wi as snapshotBookingShownTerms, xi as resolveDefaultBookingServiceId, yi as resolveBookingSelectedService, z as onlineBookingUnavailableMessage, zi as toBookingQuestionsAnswerDraft } from "./wizardSteps-CWIQyRIw.mjs";
3
+ import { Kt as hasText, Tn as formatCurrencyAmount, Zt as formatDate, _n as parseUtcIsoDateTimeString, a as clearWorkflowFeedback, an as formatTimeZoneCityLabel, bn as resolveBookingTimeZoneId, en as formatDateTimeRange, i as okWith, k as isBookingRequirementConsentFieldId, n as err, o as reportWorkflowError, on as inferSiteDateLocale, rn as formatTime, s as reportWorkflowSuccess, sn as resolveBookingDisplayContext, t as assertNever, u as logger, vn as toUtcIsoDateTimeString, yn as resolveBookingBusinessTimeZone } from "./src-o7WEvbK1.mjs";
4
+ import { D as unsafeAsAppointmentResourceId, O as unsafeAsAppointmentServiceId, T as assertNever$1, g as formatCreditProductUnits, h as formatCreditProductPayment, m as formatCreditProductBalance, o as checkBookingQuestionsAnswered } from "./creditProducts-BQ1t1erI.mjs";
5
+ import { i as useSiteTermsAgreement, n as SiteTermsChangedNotice, t as SiteTermsAgreementField } from "./SiteTermsAgreementField-BAdW5DvE.mjs";
6
6
  import { t as layoutServicesByCategory } from "./appointment-service-categories-Cl2pqw-z.mjs";
7
- import { a as formatTime$1, i as formatDatePillParts, n as useAvailableDates, o as getRuntimeTimeZone, r as formatDate$1, s as clientPersonPhrases, t as useAvailableSlots } from "./useAvailableSlots-D-qoooLy.mjs";
8
- import { i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "./context-CJIz4FdL.mjs";
9
- import { l as SpinnerNode, r as ThemedButton } from "./ThemedButton-DuaYtnvG.mjs";
10
- import { f as NavigationHandOffPanel, p as DiscountCodeDisclosure, r as DISCOUNT_APPLY_MESSAGES, t as BookingConfirmation } from "./DemoBookingPortalAccess-Olvrwi3Z.mjs";
11
- import { t as buildCheckoutReturnUrls } from "./checkoutUrls-CMZI8o_V.mjs";
7
+ import { i as useBookingNowIso, n as OptionalMark, o as clientPersonPhrases, r as parseBookingSubmissionFailure } from "./BookingQuestionFields-DXegGSnS.mjs";
8
+ import { i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "./context-DtKdUdkO.mjs";
9
+ import { r as ThemedButton, x as SpinnerNode } from "./ThemedButton-CnSa7o-I.mjs";
10
+ import { n as BookingPanelArrangement, t as StepIndicator } from "./StepIndicator-DCfdcb7s.mjs";
11
+ import { i as discountEmailProblem, m as DiscountCodeDisclosure, p as NavigationHandOffPanel, r as DISCOUNT_APPLY_MESSAGES, t as BookingConfirmation } from "./DemoBookingPortalAccess-0Ua44F1j.mjs";
12
+ import { t as buildCheckoutReturnUrls } from "./checkoutUrls-BMLYTf38.mjs";
12
13
  import { t as scrollToBlock } from "./scrollToBlock-DrgKE0qZ.mjs";
13
- import { t as CheckboxChoice } from "./CheckboxChoice-b-PJLEXe.mjs";
14
+ import { t as CheckboxChoice } from "./CheckboxChoice-BZPLCgTU.mjs";
14
15
  import { t as CheckIcon } from "./CheckIcon-CVcKteXH.mjs";
15
16
  import { n as getFieldValidationControlProps, t as FieldValidationMessage } from "./FieldValidationMessage-CsqxShw4.mjs";
16
17
  import { t as FeedbackMessage } from "./FeedbackMessage-CSJrAuXH.mjs";
17
- import { i as useBookingNowIso, n as OptionalMark, r as parseBookingSubmissionFailure } from "./BookingQuestionFields-B57oGPcj.mjs";
18
- import { n as TerminalPanel, r as StateIcon, t as useDiscountCodeUi } from "./useDiscountCodeUi-B9DODAkj.mjs";
19
- import { a as usePolling, c as useBookingQuestionsRefresh, i as BookingConsentAgreement, l as PaymentChoiceRows, n as BookingQuestionSections, o as portalSessionIdentity, s as useSignInReturn, t as BookingMailingListNote } from "./BookingMailingListNote-DSD4gS96.mjs";
20
- import { n as StepIndicator, t as BookingPanelArrangement } from "./BookingPanelArrangement--EkA1ZQd.mjs";
21
- import { c as storeDemoBookingPassIfAvailable } from "./demoPortalMagicLink-6CgFZNvu.mjs";
22
- import { i as getDiscountApplyFeedback } from "./shop-discount-apply.state-C4xcmFzZ.mjs";
18
+ import { n as TerminalPanel, r as StateIcon, t as useDiscountCodeUi } from "./useDiscountCodeUi-BcFQRI_7.mjs";
19
+ import { c as portalSessionIdentity, d as PaymentChoiceRows, i as SignInNotice, l as useSignInReturn, n as OrganiserContactLine, o as BookingConsentAgreement, r as BookingQuestionSections, s as usePolling, t as BookingMailingListNote, u as useBookingQuestionsRefresh } from "./BookingMailingListNote-CGxg37zx.mjs";
20
+ import { a as formatTime$1, i as formatDatePillParts, n as useAvailableDates, o as getRuntimeTimeZone, r as formatDate$1, t as useAvailableSlots } from "./useAvailableSlots-DQJNh10g.mjs";
21
+ import { c as storeDemoBookingPassIfAvailable } from "./demoPortalMagicLink-B8eDjhuG.mjs";
22
+ import { i as getDiscountApplyFeedback } from "./shop-discount-apply.state-CiCDLNh7.mjs";
23
23
  import React, { useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
24
24
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
25
25
  import { z } from "zod";
@@ -30,6 +30,111 @@ const unsafeAsCustomerPassId = (id) => id;
30
30
  //#region ../core/src/branded/communications.ts
31
31
  const unsafeAsFormId = (id) => id;
32
32
  //#endregion
33
+ //#region ../core/src/booking-payment-copy.ts
34
+ function siteDay(dueAt, context) {
35
+ const parsed = parseUtcIsoDateTimeString(dueAt);
36
+ return parsed.ok ? formatDate({
37
+ kind: "instant",
38
+ value: parsed.value
39
+ }, {
40
+ timeZone: context.siteTimezone,
41
+ locale: context.locale
42
+ }) : null;
43
+ }
44
+ /** Balance deadlines name their payable instant's site-local calendar day. */
45
+ function formatManagedBalanceDueText(dueAt, context) {
46
+ const date = dueAt === null ? null : siteDay(dueAt, context);
47
+ return date === null ? "Remaining balance due before the due date" : `Remaining balance due by ${date}`;
48
+ }
49
+ /** "£20.00 paid, £80.00 due by 5 Dec 2026", for a balance the client pays on the site later. */
50
+ function managedBalanceText(summary, context) {
51
+ const outstanding = formatCurrencyAmount(summary.amountOutstandingCents, summary.currency);
52
+ const date = summary.dueAt === null ? null : siteDay(summary.dueAt, context);
53
+ const due = date === null ? `${outstanding} still to pay` : `${outstanding} due by ${date}`;
54
+ return summary.amountPaidCents > 0 ? `${formatCurrencyAmount(summary.amountPaidCents, summary.currency)} paid, ${due}` : due;
55
+ }
56
+ /** Zero and unavailable counts do not describe credits consumed. */
57
+ function hasUsedPassCredits(credits) {
58
+ return credits !== void 0 && credits !== 0 && !Number.isNaN(credits);
59
+ }
60
+ /** Older stored emails have no balance; zero is a known balance, not missing data. */
61
+ function remainingPassCredits(summary) {
62
+ return summary.passCreditsRemaining === void 0 ? "" : ` (${summary.passCreditsRemaining} left)`;
63
+ }
64
+ function withDiscount(payment, text) {
65
+ if (payment?.discount === void 0) return text;
66
+ const discount = `Discount code ${payment.discount.code}: ${formatCurrencyAmount(payment.discount.savingCents, payment.discount.currency)} off`;
67
+ return text !== null && text.length > 0 ? `${text}. ${discount}` : discount;
68
+ }
69
+ function baseConfirmationEmailPaymentInfo(summary, context) {
70
+ if (summary === void 0) return null;
71
+ switch (summary.kind) {
72
+ case "free":
73
+ case "waived": return null;
74
+ case "manual_due": return `${formatCurrencyAmount(summary.amountDueCents, summary.currency)} to be paid directly`;
75
+ case "managed_balance_due": return managedBalanceText(summary, context);
76
+ case "pass":
77
+ if (!hasText(summary.passName)) return null;
78
+ return (hasUsedPassCredits(summary.passCreditsUsed) ? `${summary.passName} (${summary.passCreditsUsed} credit${summary.passCreditsUsed === 1 ? "" : "s"} used)` : summary.passName) + remainingPassCredits(summary);
79
+ case "membership": return `${summary.membershipName ?? "Membership"} membership`;
80
+ case "monetary":
81
+ if (summary.amountOutstandingCents == null || summary.amountOutstandingCents === 0) return formatCurrencyAmount(summary.amountPaidCents, summary.currency);
82
+ return `${formatCurrencyAmount(summary.amountPaidCents, summary.currency)} paid. ${formatCurrencyAmount(summary.amountOutstandingCents, summary.currency)} remaining${hasText(summary.dueAt) ? ` — ${formatManagedBalanceDueText(summary.dueAt, context)}` : ""}`;
83
+ }
84
+ return assertNever$1(summary);
85
+ }
86
+ /** How a paid booking was paid, as the customer shell's Payment row says it. */
87
+ function paidWith(method) {
88
+ switch (method) {
89
+ case "stripe": return "by card";
90
+ case "store_credit": return "with your account credit";
91
+ case "mixed": return "by card and account credit";
92
+ case "manual": return "";
93
+ }
94
+ }
95
+ /** What's owed outside the site, and what was paid already: nothing either way says arrival. */
96
+ function directBalance(summary) {
97
+ if (summary?.kind === "manual_due") return {
98
+ paidCents: 0,
99
+ owedCents: summary.amountDueCents,
100
+ currency: summary.currency
101
+ };
102
+ if (summary?.kind !== "monetary" || summary.paymentMethod !== "manual" || (summary.amountOutstandingCents ?? 0) === 0) return null;
103
+ return {
104
+ paidCents: summary.amountPaidCents,
105
+ owedCents: summary.amountOutstandingCents ?? 0,
106
+ currency: summary.currency
107
+ };
108
+ }
109
+ /** A balance agreed outside the system has no link or portal payment, so say who it goes to. */
110
+ function directBalanceSentence(summary, context) {
111
+ const balance = directBalance(summary);
112
+ if (balance === null) return null;
113
+ const owed = formatCurrencyAmount(balance.owedCents, balance.currency);
114
+ return `${balance.paidCents > 0 ? `${formatCurrencyAmount(balance.paidCents, balance.currency)} paid. ` : ""}${owed} to pay directly to ${hasText(context.siteTitle) ? context.siteTitle : "the business"}.${context.surface === "email" ? " If you have any questions, just reply to this email." : ""}`;
115
+ }
116
+ /** Customer payment copy shared by built-in confirmations, editable wording and the success page. */
117
+ function formatBookingPaymentSentence(summary, context) {
118
+ return withDiscount(summary, baseBookingPaymentSentence(summary, context));
119
+ }
120
+ function baseBookingPaymentSentence(summary, context) {
121
+ if (summary === void 0) return null;
122
+ const direct = directBalanceSentence(summary, context);
123
+ if (direct !== null) return direct;
124
+ switch (summary.kind) {
125
+ case "free": return "Free";
126
+ case "waived": return "Nothing to pay";
127
+ case "pass":
128
+ if (!hasText(summary.passName)) return null;
129
+ return `Paid with your ${summary.passName}${context.passNoun ? ` ${context.passNoun}` : ""}${remainingPassCredits(summary)}`;
130
+ case "membership": return hasText(summary.membershipName) ? `Included in your ${summary.membershipName} membership` : "Included in your membership";
131
+ case "monetary": return summary.amountOutstandingCents == null || summary.amountOutstandingCents === 0 ? `Paid ${formatCurrencyAmount(summary.amountPaidCents, summary.currency, { decimals: "auto" })}${paidWith(summary.paymentMethod) ? ` ${paidWith(summary.paymentMethod)}` : ""}` : baseConfirmationEmailPaymentInfo(summary, context);
132
+ case "manual_due": return null;
133
+ case "managed_balance_due": return managedBalanceText(summary, context);
134
+ }
135
+ return assertNever$1(summary);
136
+ }
137
+ //#endregion
33
138
  //#region ../blocks/src/system/runtime/nodes/booking-form.checkout-return-session.ts
34
139
  /** Each cancellation URL names its own browser-held session, even with several checkouts open. */
35
140
  function appointmentCheckoutCancelUrl(cancelUrl, returnKey) {
@@ -225,16 +330,98 @@ function resolveBookingFormDateDisplay(input) {
225
330
  };
226
331
  }
227
332
  //#endregion
333
+ //#region ../blocks/src/system/runtime/nodes/booking-form.admission.ts
334
+ const BOOKABLE = { kind: "bookable" };
335
+ const CHECKING = { kind: "checking" };
336
+ /**
337
+ * The one decision on whether a site without card payments can take this
338
+ * booking, from every way the client could pay: a request for approval pays
339
+ * nothing now; a per-session choice the site can take without a card (free,
340
+ * the free end of a sliding scale, or paid to the business directly); or a
341
+ * package the client already holds, including one held with a single team
342
+ * member. Nothing can be bought without cards, so a package purchase never
343
+ * counts.
344
+ *
345
+ * `payment` is the collection decision at the lowest price the client can
346
+ * choose (`resolveLowestBookingPaymentStep`), so what they've typed into a
347
+ * sliding scale doesn't change the answer.
348
+ */
349
+ function decideBookingAdmission(input) {
350
+ const { payment } = input;
351
+ const service = payment.service;
352
+ if (!service || service.requiresApproval || !needsCardTheSiteCantTake(service, payment)) return BOOKABLE;
353
+ const contact = (service.onlinePayments?.kind === "unavailable" ? service.onlinePayments.organiserContact : void 0) ?? null;
354
+ const refused = (message, recovery) => ({
355
+ kind: "refused",
356
+ message,
357
+ contact,
358
+ recovery
359
+ });
360
+ switch (input.heldPackages) {
361
+ case "some": return BOOKABLE;
362
+ case "checking": return CHECKING;
363
+ case "none": return refused(onlineBookingUnavailableMessage(input.businessName), "none");
364
+ case "signedOut": return refused(onlineBookingUnavailableMessage(input.businessName), "signIn");
365
+ case "unreadable": return refused(packagesUnreadableMessage(input.businessName), "retry");
366
+ }
367
+ }
368
+ function packagesUnreadableMessage(businessName) {
369
+ return `We couldn’t check your packages just now. Please try again, or contact ${businessName?.trim() || "the organiser"} to book.`;
370
+ }
371
+ /**
372
+ * Without a package of their own, the client would have to pay by card and the
373
+ * site can't take cards. A package-only service has nothing else to pay with;
374
+ * otherwise the collection decision says whether even its cheapest choice
375
+ * needs a card.
376
+ */
377
+ function needsCardTheSiteCantTake(service, payment) {
378
+ if (service.onlinePaymentChoices?.perSession === false) return service.onlinePayments?.kind === "unavailable";
379
+ return payment.kind === "unavailable" && payment.reason === "cardPaymentsUnavailable";
380
+ }
381
+ /**
382
+ * The client's own packages, from the eligibility read: those that pay for
383
+ * this booking as it stands, and, booking with anyone, the team members they
384
+ * hold packages with.
385
+ */
386
+ function summariseBookingHeldPackages(source, packages, heldWithTeamMembers) {
387
+ switch (source) {
388
+ case "disabled":
389
+ case "missing-priced-service": return "none";
390
+ case "missing-portal-auth": return "signedOut";
391
+ case "enabled": break;
392
+ }
393
+ switch (packages.tag) {
394
+ case "idle":
395
+ case "loading": return "checking";
396
+ case "loaded": return packages.value.length > 0 || heldWithTeamMembers.length > 0 ? "some" : "none";
397
+ case "error": return "unreadable";
398
+ }
399
+ }
400
+ //#endregion
228
401
  //#region ../blocks/src/system/runtime/nodes/booking-form.payment-confirmation.ts
229
402
  function resolveBookingPaymentConfirmationSummary(input) {
230
403
  const service = input.service;
231
- if (!service || input.hasSelectedAppointmentPackage || !Number.isFinite(input.priceAmount) || input.priceAmount <= 0 || !service.durationMinutes || !bookingPaymentNeedsCardConfirmation(input.paymentResolution)) return null;
232
- return {
404
+ if (!service || !service.durationMinutes || !Number.isFinite(input.priceAmount) || input.priceAmount <= 0) return null;
405
+ const base = {
233
406
  serviceTitle: service.title,
234
407
  durationMinutes: service.durationMinutes,
235
- priceAmount: input.priceAmount,
236
- priceCurrency: service.priceCurrency ?? service.pricing?.currency ?? "USD"
408
+ priceAmount: input.priceAmount
237
409
  };
410
+ switch (input.choice.kind) {
411
+ case "buy_package": return {
412
+ ...base,
413
+ kind: "buy_package",
414
+ packageName: input.choice.package.name,
415
+ priceCurrency: input.choice.package.currency
416
+ };
417
+ case "held_package": return null;
418
+ case "per_session":
419
+ case "unselected": return bookingPaymentNeedsCardConfirmation(input.paymentResolution) ? {
420
+ ...base,
421
+ kind: "per_session",
422
+ priceCurrency: service.priceCurrency ?? service.pricing?.currency ?? "USD"
423
+ } : null;
424
+ }
238
425
  }
239
426
  function bookingPaymentNeedsCardConfirmation(payment) {
240
427
  return payment.kind === "ready" && payment.choice.kind === "selected" && payment.choice.option.kind !== "deferred_manual";
@@ -633,7 +820,10 @@ function executeBookingSubmission$1(api, data, resumeSessionId) {
633
820
  bookingQuestions: data.bookingQuestions,
634
821
  mailingListOptIn: data.mailingListOptIn,
635
822
  timezone: data.timezone,
636
- ...data.kind === "package_purchase" ? { purchasePassId: data.purchasePassId } : {},
823
+ ...data.kind === "package_purchase" ? { purchase: {
824
+ kind: "pass",
825
+ productId: data.passProductId
826
+ } } : {},
637
827
  shownTerms: data.shownTerms,
638
828
  discountCode: data.discountCode,
639
829
  selectedSlidingAmount: data.selectedSlidingAmount,
@@ -1004,16 +1194,19 @@ function toBookingFormData(state) {
1004
1194
  }
1005
1195
  function buildBookingStepResolution(input) {
1006
1196
  const defaultServiceId = input.defaultServiceId ?? resolveDefaultBookingServiceId(input.form, input.services);
1007
- const paymentResolution = resolveBookingPaymentStep({
1197
+ const paymentInput = {
1008
1198
  data: input.data,
1009
1199
  nowIso: input.nowIso,
1010
1200
  timeZone: input.timeZone,
1011
1201
  services: input.services,
1012
1202
  defaultServiceId
1013
- });
1203
+ };
1204
+ const paymentResolution = resolveBookingPaymentStep(paymentInput);
1205
+ const lowestPaymentResolution = resolveLowestBookingPaymentStep(paymentInput);
1014
1206
  if (!input.form) return {
1015
1207
  steps: [],
1016
- paymentResolution
1208
+ paymentResolution,
1209
+ lowestPaymentResolution
1017
1210
  };
1018
1211
  const { needsServiceSelection, needsPayment, hasFields } = resolveBookingStepVisibility(input, defaultServiceId, paymentResolution);
1019
1212
  return {
@@ -1039,7 +1232,8 @@ function buildBookingStepResolution(input) {
1039
1232
  visible: hasFields
1040
1233
  }
1041
1234
  ],
1042
- paymentResolution
1235
+ paymentResolution,
1236
+ lowestPaymentResolution
1043
1237
  };
1044
1238
  }
1045
1239
  function resolveBookingStepVisibility(input, defaultServiceId, payment) {
@@ -1076,7 +1270,7 @@ function serviceSelectionMessage(input) {
1076
1270
  return input.data.serviceId ? null : "Please select a service";
1077
1271
  }
1078
1272
  function validateBookingStep(input) {
1079
- const refusal = input.questionsRefusal ?? null;
1273
+ const refusal = bookingRefusal(input);
1080
1274
  switch (input.stepId) {
1081
1275
  case "service-selection": return bookingStepValidationFromMessage(refusal ?? serviceSelectionMessage(input));
1082
1276
  case "datetime-selection": return bookingStepValidationFromMessage(refusal ?? (input.data.selectedSlot ? null : "Please select a date and time"));
@@ -1094,6 +1288,10 @@ function validateBookingStep(input) {
1094
1288
  default: return assertNever(input.stepId);
1095
1289
  }
1096
1290
  }
1291
+ /** Why the selected service can't be booked at all, if it can't. */
1292
+ function bookingRefusal(input) {
1293
+ return input.questionsRefusal ?? (input.admission?.kind === "refused" ? input.admission.message : null);
1294
+ }
1097
1295
  function bookingStepValidationFromMessage(message) {
1098
1296
  return message ? {
1099
1297
  ok: false,
@@ -1106,7 +1304,7 @@ function validateBookingPaymentStep(input) {
1106
1304
  const resolution = input.paymentResolution ?? resolveBookingPaymentStep(input);
1107
1305
  const slidingScale = getBookingServiceSlidingScale(resolution.service);
1108
1306
  if (slidingScale && !isBookingServiceSlidingAmountInRange(slidingScale, parseBookingCurrencyInputToCents(input.data.selectedSlidingAmountInput))) return bookingStepValidationFromMessage("Please choose an amount within the sliding scale");
1109
- if (resolution.kind === "unavailable") return bookingStepValidationFromMessage(resolution.errorMessage ?? "This service cannot be booked right now.");
1307
+ if (resolution.kind === "unavailable") return bookingStepValidationFromMessage(resolution.reason === "cardPaymentsUnavailable" ? "Please choose a payment option" : resolution.errorMessage);
1110
1308
  switch (resolution.kind) {
1111
1309
  case "not_required": return { ok: true };
1112
1310
  case "ready": return bookingStepValidationFromMessage(resolution.choice.kind === "selected" ? null : "Please choose a payment option");
@@ -1125,7 +1323,7 @@ function validateBookingField(field, value) {
1125
1323
  if (requiredError) return requiredError;
1126
1324
  if (isBlankFieldValue(value)) return null;
1127
1325
  const strValue = typeof value === "string" ? value : String(value);
1128
- if (field.type === "email") return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(strValue) ? null : "Please enter a valid email address";
1326
+ if (field.type === "email") return isEmailAddress(strValue) ? null : "Please enter a valid email address";
1129
1327
  if (field.type === "url") try {
1130
1328
  new URL(strValue);
1131
1329
  return null;
@@ -1157,12 +1355,18 @@ function validateRequiredBookingField(field, value) {
1157
1355
  }
1158
1356
  function deriveBookingFlowSteps(input) {
1159
1357
  const stepResolution = buildBookingStepResolution(input);
1358
+ const admission = decideBookingAdmission({
1359
+ payment: stepResolution.lowestPaymentResolution,
1360
+ heldPackages: input.heldPackages ?? "none",
1361
+ businessName: input.businessName
1362
+ });
1160
1363
  const stepPlan = stepResolution.steps.filter((step) => step.visible);
1161
1364
  const currentStepIndex = Math.max(0, stepPlan.findIndex((step) => step.id === input.currentStepId));
1162
1365
  const validations = new Map(stepPlan.map((step) => [step.id, validateBookingStep({
1163
1366
  ...input,
1164
1367
  stepId: step.id,
1165
- paymentResolution: stepResolution.paymentResolution
1368
+ paymentResolution: stepResolution.paymentResolution,
1369
+ admission
1166
1370
  })]));
1167
1371
  const attemptedStepIds = input.attemptedStepIds ?? {};
1168
1372
  const steps = stepPlan.map((step, index) => {
@@ -1185,6 +1389,7 @@ function deriveBookingFlowSteps(input) {
1185
1389
  currentStep: steps[currentStepIndex] ?? null,
1186
1390
  stepIds: steps.map((step) => step.id),
1187
1391
  paymentResolution: stepResolution.paymentResolution,
1392
+ admission,
1188
1393
  validations
1189
1394
  };
1190
1395
  }
@@ -1680,7 +1885,14 @@ function planBookingResourceAcceptance(input) {
1680
1885
  }] : [];
1681
1886
  }
1682
1887
  function planBookingPackageAcceptance(input) {
1683
- return input.state.selectedAppointmentPackageId && !input.packages.some((item) => item.customerPassId === input.state.selectedAppointmentPackageId) ? [{
1888
+ const { state, packages } = input;
1889
+ if (state.phase !== "editing" || state.packagePurchase.kind === "selected" || state.selectedCollectionOptionKind) return [];
1890
+ if (packages.some((item) => item.customerPassId === state.selectedAppointmentPackageId)) return [];
1891
+ const [first] = packages;
1892
+ return first ? [{
1893
+ type: "appointment-package-selected",
1894
+ packageId: unsafeAsCustomerPassId(first.customerPassId)
1895
+ }] : state.selectedAppointmentPackageId ? [{
1684
1896
  type: "appointment-package-selected",
1685
1897
  packageId: null
1686
1898
  }] : [];
@@ -1788,7 +2000,7 @@ function useBookingChoices(input) {
1788
2000
  });
1789
2001
  }, []);
1790
2002
  const resources = useBookingChoicesRequest(input.serviceId ?? null, loadResources, acceptResources, "Failed to load booking resources.");
1791
- const packagesResponse = useBookingPackageEligibility(input);
2003
+ const { state: packagesResponse, retry: retryPackages } = useBookingPackageEligibility(input);
1792
2004
  const purchasablePackages = useBookingChoicesRequest(bookingPackageRequestKey(input.canLoadPurchasablePackages, input.serviceId, input.selectedResourceId), loadPurchasablePackages, acceptPurchasablePackages, "Failed to load packages.");
1793
2005
  useEffect(() => {
1794
2006
  if (!input.canLoadPurchasablePackages) acceptPurchasablePackages([]);
@@ -1799,6 +2011,7 @@ function useBookingChoices(input) {
1799
2011
  tag: "loaded",
1800
2012
  value: packagesResponse.value.packages
1801
2013
  } : packagesResponse, [packagesResponse]),
2014
+ retryPackages,
1802
2015
  purchasablePackages,
1803
2016
  heldPackageTeamMembers: packagesResponse.tag === "loaded" && !input.selectedResourceId ? packagesResponse.value.heldPackageTeamMembers ?? [] : [],
1804
2017
  resourceFacts: input.serviceId && resources.tag === "loaded" ? {
@@ -1809,6 +2022,8 @@ function useBookingChoices(input) {
1809
2022
  }
1810
2023
  /** Unscoped eligibility resolves practitioner admission independently of the selected practitioner. */
1811
2024
  function useBookingPackageEligibility(input) {
2025
+ const [attempt, setAttempt] = useState(0);
2026
+ const retry = useCallback(() => setAttempt((previous) => previous + 1), []);
1812
2027
  const latest = useRef(input);
1813
2028
  useLayoutEffect(() => {
1814
2029
  latest.current = input;
@@ -1836,8 +2051,8 @@ function useBookingPackageEligibility(input) {
1836
2051
  });
1837
2052
  if (!current.selectedResourceId) accept(response);
1838
2053
  }, [accept]);
1839
- const any = useBookingChoicesRequest(bookingPackageRequestKey(input.canLoadPackages, input.serviceId, null), loadAny, acceptAny, "Could not check package credits.");
1840
- const scoped = useBookingChoicesRequest(bookingPackageRequestKey(input.canLoadPackages && !!input.selectedResourceId, input.serviceId, input.selectedResourceId), loadScoped, accept, "Could not check package credits.");
2054
+ const any = useBookingChoicesRequest(bookingPackageRequestKey(input.canLoadPackages, input.serviceId, null), loadAny, acceptAny, "Could not check package credits.", attempt);
2055
+ const scoped = useBookingChoicesRequest(bookingPackageRequestKey(input.canLoadPackages && !!input.selectedResourceId, input.serviceId, input.selectedResourceId), loadScoped, accept, "Could not check package credits.", attempt);
1841
2056
  useEffect(() => {
1842
2057
  if (!input.canLoadPackages) {
1843
2058
  accept(NO_PACKAGES);
@@ -1855,9 +2070,13 @@ function useBookingPackageEligibility(input) {
1855
2070
  any,
1856
2071
  accept
1857
2072
  ]);
1858
- return input.selectedResourceId ? scoped : any;
2073
+ return {
2074
+ state: input.selectedResourceId ? scoped : any,
2075
+ retry
2076
+ };
1859
2077
  }
1860
- function useBookingChoicesRequest(key, load, accept, errorMessage) {
2078
+ /** `attempt` asks again for the same key: a retry after a failed read. */
2079
+ function useBookingChoicesRequest(key, load, accept, errorMessage, attempt = 0) {
1861
2080
  const [receipt, setReceipt] = useState({
1862
2081
  key: null,
1863
2082
  state: { tag: "idle" }
@@ -1897,7 +2116,8 @@ function useBookingChoicesRequest(key, load, accept, errorMessage) {
1897
2116
  key,
1898
2117
  load,
1899
2118
  accept,
1900
- errorMessage
2119
+ errorMessage,
2120
+ attempt
1901
2121
  ]);
1902
2122
  return receipt.key === key ? receipt.state : key ? { tag: "loading" } : { tag: "idle" };
1903
2123
  }
@@ -2029,6 +2249,7 @@ function useBookingFlowController(input) {
2029
2249
  package: product
2030
2250
  });
2031
2251
  },
2252
+ retryPackages: () => latestRef.current.retryPackages(),
2032
2253
  next: async () => navigate("next"),
2033
2254
  back: () => {
2034
2255
  navigate("back");
@@ -2216,7 +2437,8 @@ function useManualDiscountPreview(input) {
2216
2437
  const apply = async () => {
2217
2438
  if (status.type === "applying") return;
2218
2439
  if (!input.code.trim()) return refuse(DISCOUNT_APPLY_MESSAGES.emptyCode);
2219
- if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(input.email.trim())) return refuse(DISCOUNT_APPLY_MESSAGES.emailRequired);
2440
+ const emailProblem = discountEmailProblem(input.email);
2441
+ if (emailProblem) return refuse(emailProblem);
2220
2442
  if (!input.lines.length) return refuse(DISCOUNT_APPLY_MESSAGES.unavailable);
2221
2443
  const pending = {
2222
2444
  key,
@@ -2379,6 +2601,17 @@ function useHeadlessBookingFlow(options) {
2379
2601
  state.selectedDate,
2380
2602
  availabilityTimeZone
2381
2603
  ]);
2604
+ const choices = useBookingChoices({
2605
+ api,
2606
+ serviceId: selectedServiceId,
2607
+ selectedResourceId: selectedResourceId ?? null,
2608
+ defaultResourceId,
2609
+ canLoadPackages: canLoadAppointmentPackages,
2610
+ canLoadPurchasablePackages,
2611
+ autoSelectSingleResource: options.shouldAutoSelectSingleResource !== false,
2612
+ dispatch
2613
+ });
2614
+ const heldPackages = summariseBookingHeldPackages(packageSources.held, choices.packages, choices.heldPackageTeamMembers);
2382
2615
  const stepState = useMemo(() => deriveBookingFlowSteps({
2383
2616
  form: runtimeForm,
2384
2617
  nowIso: bookingNowIso,
@@ -2393,9 +2626,13 @@ function useHeadlessBookingFlow(options) {
2393
2626
  requiresResourceSelection,
2394
2627
  enableAppointmentPackages: options.enableAppointmentPackages,
2395
2628
  attemptedStepIds: state.attemptedStepIds,
2396
- questionsRefusal
2629
+ questionsRefusal,
2630
+ businessName: options.siteName,
2631
+ heldPackages
2397
2632
  }), [
2398
2633
  questionsRefusal,
2634
+ options.siteName,
2635
+ heldPackages,
2399
2636
  options.dateContext.timeZone,
2400
2637
  data,
2401
2638
  bookingNowIso,
@@ -2469,16 +2706,6 @@ function useHeadlessBookingFlow(options) {
2469
2706
  state.touchedFields,
2470
2707
  state.validationErrors.fieldErrors
2471
2708
  ]);
2472
- const choices = useBookingChoices({
2473
- api,
2474
- serviceId: selectedServiceId,
2475
- selectedResourceId: selectedResourceId ?? null,
2476
- defaultResourceId,
2477
- canLoadPackages: canLoadAppointmentPackages,
2478
- canLoadPurchasablePackages,
2479
- autoSelectSingleResource: options.shouldAutoSelectSingleResource !== false,
2480
- dispatch
2481
- });
2482
2709
  const resourcesState = choices.resources;
2483
2710
  const appointmentPackages = choices.packages;
2484
2711
  const resources = resourcesState.tag === "loaded" ? resourcesState.value : [];
@@ -2570,6 +2797,7 @@ function useHeadlessBookingFlow(options) {
2570
2797
  mailingListEligible,
2571
2798
  bookingQuestions: questions,
2572
2799
  endSignInReturn: questions.endSignInReturn,
2800
+ retryPackages: choices.retryPackages,
2573
2801
  dispatch
2574
2802
  });
2575
2803
  const paymentResolution = stepState.paymentResolution;
@@ -2589,10 +2817,11 @@ function useHeadlessBookingFlow(options) {
2589
2817
  selectedService,
2590
2818
  state.selectedSlot?.startAt
2591
2819
  ]);
2820
+ const paymentChoice = resolveBookingPaymentChoice(state.packagePurchase, state.selectedAppointmentPackageId, packageOnly ? void 0 : selectedCollectionOptionKind);
2592
2821
  const paymentConfirmationSummary = resolveBookingPaymentConfirmationSummary({
2593
2822
  service: selectedService,
2594
- priceAmount: discountedPriceAmount(manualDiscount.discount, selectedAppointmentPriceAmount),
2595
- hasSelectedAppointmentPackage: Boolean(state.selectedAppointmentPackageId) || purchase.kind === "selected",
2823
+ priceAmount: discountedPriceAmount(manualDiscount.discount, paymentPriceAmount),
2824
+ choice: paymentChoice,
2596
2825
  paymentResolution
2597
2826
  });
2598
2827
  const availabilityDisplay = resolveBookingFormDateDisplay({
@@ -2621,7 +2850,7 @@ function useHeadlessBookingFlow(options) {
2621
2850
  });
2622
2851
  const purchasablePackages = resolveBookingPurchasablePackages(canLoadPurchasablePackages, choices.purchasablePackages);
2623
2852
  const packagePaymentModel = {
2624
- choice: resolveBookingPaymentChoice(state.packagePurchase, state.selectedAppointmentPackageId, packageOnly ? void 0 : selectedCollectionOptionKind),
2853
+ choice: paymentChoice,
2625
2854
  purchasablePackages,
2626
2855
  availability: resolveBookingPaymentAvailability(!packageOnly && paymentResolution.kind !== "unavailable", appointmentPackagesModel, purchasablePackages)
2627
2856
  };
@@ -2653,6 +2882,7 @@ function useHeadlessBookingFlow(options) {
2653
2882
  };
2654
2883
  return {
2655
2884
  review: state.review,
2885
+ admission: stepState.admission,
2656
2886
  dateContext: options.dateContext,
2657
2887
  paymentAnchorAt: bookingNowIso,
2658
2888
  siteTerms,
@@ -3149,16 +3379,35 @@ function formatBookingConfirmationDateTime(booking, includeSelection = false) {
3149
3379
  function BookingPaymentConfirmationText({ booking, summary }) {
3150
3380
  if (!summary) return null;
3151
3381
  const dateTime = formatBookingConfirmationDateTime(booking);
3382
+ const price = formatCurrencyAmount(summary.priceAmount, summary.priceCurrency, { decimals: "auto" });
3383
+ const when = dateTime ? ` · ${dateTime}` : "";
3384
+ if (summary.kind === "buy_package") return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("p", {
3385
+ className: "ab-text rb-on-surface--muted",
3386
+ children: [
3387
+ summary.serviceTitle,
3388
+ " · ",
3389
+ summary.durationMinutes,
3390
+ " min",
3391
+ when
3392
+ ]
3393
+ }), /* @__PURE__ */ jsxs("p", {
3394
+ className: "ab-text rb-on-surface--muted",
3395
+ children: [
3396
+ "Buying ",
3397
+ summary.packageName,
3398
+ " · ",
3399
+ price
3400
+ ]
3401
+ })] });
3152
3402
  return /* @__PURE__ */ jsxs("p", {
3153
3403
  className: "ab-text rb-on-surface--muted",
3154
3404
  children: [
3155
3405
  summary.serviceTitle,
3156
3406
  " · ",
3157
3407
  summary.durationMinutes,
3158
- " min ·",
3159
- " ",
3160
- formatCurrencyAmount(summary.priceAmount, summary.priceCurrency, { decimals: "auto" }),
3161
- dateTime ? ` · ${dateTime}` : ""
3408
+ " min · ",
3409
+ price,
3410
+ when
3162
3411
  ]
3163
3412
  });
3164
3413
  }
@@ -3171,11 +3420,12 @@ function BookingFormSubmitActions({ booking, onSubmit }) {
3171
3420
  const handlePrimaryAction = async () => {
3172
3421
  if ((await booking.actions.next()).ok && isLastStep) await onSubmit();
3173
3422
  };
3423
+ const refused = booking.admission.kind === "refused";
3174
3424
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BookingSubmissionSummary, {
3175
3425
  booking,
3176
3426
  isLastStep,
3177
3427
  summary: paymentSummary
3178
- }), /* @__PURE__ */ jsxs("div", {
3428
+ }), !isFirstStep || !refused ? /* @__PURE__ */ jsxs("div", {
3179
3429
  className: "rb-wizard-actions",
3180
3430
  children: [!isFirstStep ? /* @__PURE__ */ jsx(ThemedButton, {
3181
3431
  type: "button",
@@ -3183,7 +3433,7 @@ function BookingFormSubmitActions({ booking, onSubmit }) {
3183
3433
  variant: "outline",
3184
3434
  size: "md",
3185
3435
  label: "Back"
3186
- }) : null, /* @__PURE__ */ jsx(ThemedButton, {
3436
+ }) : null, refused ? null : /* @__PURE__ */ jsx(ThemedButton, {
3187
3437
  type: "button",
3188
3438
  onClick: () => {
3189
3439
  handlePrimaryAction();
@@ -3197,7 +3447,7 @@ function BookingFormSubmitActions({ booking, onSubmit }) {
3197
3447
  srLabel: "Submitting"
3198
3448
  } : void 0
3199
3449
  })]
3200
- })] });
3450
+ }) : null] });
3201
3451
  }
3202
3452
  function reviewedActionLabel(review) {
3203
3453
  if (review.terms.dueNowCents > 0) return "Continue to payment";
@@ -3240,11 +3490,15 @@ function BookingOfferReview({ review, booking }) {
3240
3490
  });
3241
3491
  }
3242
3492
  function bookingPrimaryActionLabel(booking, isLastStep, summary) {
3243
- if (isLastStep && booking.services.selected?.requiresApproval) return "Send request";
3244
- if (isLastStep && booking.review) return reviewedActionLabel(booking.review);
3493
+ return isLastStep ? lastStepActionLabel(booking, summary) : resolvePrimaryActionLabel(false, Boolean(summary));
3494
+ }
3495
+ function lastStepActionLabel(booking, summary) {
3496
+ if (booking.services.selected?.requiresApproval) return "Send request";
3497
+ if (booking.review) return reviewedActionLabel(booking.review);
3498
+ if (summary?.kind === "buy_package") return resolvePrimaryActionLabel(true, true);
3245
3499
  const discount = booking.discount.preview?.discount;
3246
- if (isLastStep && discount) return discountedActionLabel(booking, discount);
3247
- return resolvePrimaryActionLabel(isLastStep, Boolean(summary));
3500
+ if (discount) return discountedActionLabel(booking, discount);
3501
+ return resolvePrimaryActionLabel(true, Boolean(summary));
3248
3502
  }
3249
3503
  function discountedActionLabel(booking, discount) {
3250
3504
  if (discount.totalAfterDiscountCents === 0) return "Confirm booking";
@@ -3783,6 +4037,7 @@ function HeadlessBookingDefaultForm({ booking, onSubmit, pageKind }) {
3783
4037
  labelAs: presentation.stepLabelAs
3784
4038
  }) : null,
3785
4039
  /* @__PURE__ */ jsx(DefaultQuestionsRefusal, { booking }),
4040
+ /* @__PURE__ */ jsx(DefaultAdmissionRefusal, { booking }),
3786
4041
  /* @__PURE__ */ jsx("div", {
3787
4042
  className: "step-content",
3788
4043
  children: /* @__PURE__ */ jsx(DefaultBookingStepContent, {
@@ -3791,7 +4046,7 @@ function HeadlessBookingDefaultForm({ booking, onSubmit, pageKind }) {
3791
4046
  presentation
3792
4047
  })
3793
4048
  }),
3794
- /* @__PURE__ */ jsx(DefaultBookingErrorSummary, {
4049
+ admissionRefused(booking) ? null : /* @__PURE__ */ jsx(DefaultBookingErrorSummary, {
3795
4050
  errors: currentStep.errors,
3796
4051
  id: errorSummaryId
3797
4052
  }),
@@ -3813,12 +4068,57 @@ function DefaultQuestionsRefusal({ booking }) {
3813
4068
  const presentation = booking.questions.presentation;
3814
4069
  if (presentation.kind !== "unavailable" || booking.currentStep?.id === "custom-fields") return null;
3815
4070
  return /* @__PURE__ */ jsx(FeedbackMessage, {
3816
- tone: "error",
3817
- className: "alert alert-error",
3818
- role: "alert",
4071
+ tone: "info",
4072
+ className: "alert alert-info rb-mb-4",
4073
+ role: "status",
3819
4074
  children: presentation.message
3820
4075
  });
3821
4076
  }
4077
+ /**
4078
+ * A booking the admission decision turns away: it needs a card payment the
4079
+ * site can't take, and the client has no package we know of to pay with. Say
4080
+ * so once, as soon as the service is chosen, with how to reach the business
4081
+ * and, while we don't know what packages they hold, a way to find out. On the
4082
+ * payment step the notice stands in place of the ways to pay instead.
4083
+ */
4084
+ function DefaultAdmissionRefusal({ booking }) {
4085
+ if (booking.currentStep?.id === "payment-selection") return null;
4086
+ return /* @__PURE__ */ jsx(AdmissionRefusalNotice, { booking });
4087
+ }
4088
+ function AdmissionRefusalNotice({ booking }) {
4089
+ const admission = booking.admission;
4090
+ if (admission.kind !== "refused") return null;
4091
+ const email = booking.fields.values.email;
4092
+ return /* @__PURE__ */ jsx(FeedbackMessage, {
4093
+ tone: "info",
4094
+ className: "alert alert-info rb-mb-4",
4095
+ role: "status",
4096
+ children: /* @__PURE__ */ jsxs("div", {
4097
+ className: "rb-space-y-2",
4098
+ children: [
4099
+ /* @__PURE__ */ jsx("p", { children: admission.message }),
4100
+ admission.contact ? /* @__PURE__ */ jsx(OrganiserContactLine, { contact: admission.contact }) : null,
4101
+ admission.recovery === "signIn" ? /* @__PURE__ */ jsx(SignInNotice, {
4102
+ lead: "Already have a package?",
4103
+ after: "to use it.",
4104
+ email: typeof email === "string" && email.trim() ? email.trim() : void 0,
4105
+ returnPath: booking.questions.signInReturnPath
4106
+ }) : null,
4107
+ admission.recovery === "retry" ? /* @__PURE__ */ jsx(ThemedButton, {
4108
+ type: "button",
4109
+ variant: "secondary",
4110
+ size: "sm",
4111
+ label: "Try again",
4112
+ onClick: booking.actions.retryPackages
4113
+ }) : null
4114
+ ]
4115
+ })
4116
+ });
4117
+ }
4118
+ /** Refused, nothing on the form leads anywhere but the notice and choosing another service. */
4119
+ function admissionRefused(booking) {
4120
+ return booking.admission.kind === "refused";
4121
+ }
3822
4122
  function DefaultBookingStepContent({ booking, errorSummaryId, presentation }) {
3823
4123
  const stepId = booking.currentStep?.id;
3824
4124
  if (!stepId) return null;
@@ -3840,12 +4140,19 @@ function DefaultBookingStepContent({ booking, errorSummaryId, presentation }) {
3840
4140
  default: return assertNever(stepId);
3841
4141
  }
3842
4142
  }
4143
+ /**
4144
+ * Ask who to see when there's a choice to make, refused or not: a package held
4145
+ * with one team member can reopen a refused booking once they're chosen.
4146
+ */
4147
+ function shouldChooseResource(booking) {
4148
+ return booking.resources.requiresSelection || booking.resources.items.length > 1;
4149
+ }
3843
4150
  function DefaultServiceSelectionStep({ booking, presentation }) {
3844
4151
  const services = booking.services.items;
3845
4152
  const resources = booking.resources.items;
3846
4153
  const selectedResourceId = booking.resources.selectedResourceId;
3847
4154
  const showServiceSelect = booking.services.requiresSelection || services.length > 1;
3848
- const showResourceSelect = booking.resources.requiresSelection || resources.length > 1;
4155
+ const showResourceSelect = shouldChooseResource(booking);
3849
4156
  const allowAnyResource = !booking.resources.requiresSelection;
3850
4157
  return /* @__PURE__ */ jsxs("div", {
3851
4158
  className: "rb-reg-stack",
@@ -4042,6 +4349,7 @@ function HeadlessBookingPaymentSelectionStep({ booking, presentation = bookingPr
4042
4349
  const service = booking.services.selected;
4043
4350
  const { perSessionOffered, perSessionOptions, otherRows, onlyOneWayToPay } = planPaymentStepChoices(booking);
4044
4351
  const unavailableMessage = paymentStepUnavailableMessage(booking);
4352
+ if (admissionRefused(booking)) return /* @__PURE__ */ jsx(AdmissionRefusalNotice, { booking });
4045
4353
  if (unavailableMessage !== null || !service) return /* @__PURE__ */ jsx(FeedbackMessage, {
4046
4354
  tone: "error",
4047
4355
  className: "alert alert-error",
@@ -4136,6 +4444,10 @@ function HeldPackageStatus({ booking }) {
4136
4444
  function SlidingScaleField({ booking }) {
4137
4445
  const slidingScale = booking.payment.slidingScale;
4138
4446
  if (!slidingScale) return null;
4447
+ if (slidingScale.minAmount === slidingScale.maxAmount) return /* @__PURE__ */ jsx("p", {
4448
+ className: "ab-text",
4449
+ children: slidingScale.maxAmount === 0 ? "You can book this for free online." : `The price is ${formatBookingAmount(slidingScale.maxAmount, slidingScale.currency)}.`
4450
+ });
4139
4451
  return /* @__PURE__ */ jsxs("div", {
4140
4452
  className: "rb-space-y-2",
4141
4453
  children: [
@@ -4311,21 +4623,42 @@ function AppointmentDetails({ appointment, dateContext, resourceName, person })
4311
4623
  }),
4312
4624
  appointment.resourceName ? /* @__PURE__ */ jsx("p", { children: person.withName(appointment.resourceName) }) : null,
4313
4625
  appointment.location ? /* @__PURE__ */ jsx("p", { children: appointment.location }) : null,
4314
- appointment.paymentSummary?.discount ? /* @__PURE__ */ jsxs("p", { children: [
4315
- "Discount code ",
4316
- appointment.paymentSummary.discount.code,
4317
- ": ",
4318
- formatCommercePrice(appointment.paymentSummary.discount.savingCents, appointment.paymentSummary.discount.currency),
4319
- " off"
4320
- ] }) : null,
4321
- appointment.paymentSummary?.kind === "pass" ? /* @__PURE__ */ jsx("p", { children: formatCreditProductPayment({
4322
- name: appointment.paymentSummary.passName ?? "package",
4323
- creditsUsed: appointment.paymentSummary.passCreditsUsed,
4324
- creditsRemaining: appointment.paymentSummary.passCreditsRemaining
4325
- }) }) : null
4626
+ appointmentPaymentLines(appointment, dateContext).map((line) => /* @__PURE__ */ jsx("p", { children: line }, line))
4326
4627
  ]
4327
4628
  });
4328
4629
  }
4630
+ function discountLine(payment) {
4631
+ return payment.discount ? [`Discount code ${payment.discount.code}: ${formatCommercePrice(payment.discount.savingCents, payment.discount.currency)} off`] : [];
4632
+ }
4633
+ /**
4634
+ * What was paid, in the confirmation email's words ("Paid £40 by card"). Package and
4635
+ * free bookings keep their own lines: the credits used, and any discount code.
4636
+ */
4637
+ function appointmentPaymentLines(appointment, dateContext) {
4638
+ const payment = appointment.paymentSummary;
4639
+ if (!payment) return [];
4640
+ switch (payment.kind) {
4641
+ case "free": return discountLine(payment);
4642
+ case "pass": return [...discountLine(payment), formatCreditProductPayment({
4643
+ name: payment.passName ?? "package",
4644
+ creditsUsed: payment.passCreditsUsed,
4645
+ creditsRemaining: payment.passCreditsRemaining
4646
+ })];
4647
+ case "waived":
4648
+ case "membership":
4649
+ case "monetary":
4650
+ case "manual_due":
4651
+ case "managed_balance_due": {
4652
+ const sentence = formatBookingPaymentSentence(payment, {
4653
+ siteTimezone: dateContext?.timeZone ?? resolveBookingTimeZoneId(appointment.timezone),
4654
+ locale: dateContext?.locale ?? inferSiteDateLocale(appointment.timezone),
4655
+ siteTitle: null,
4656
+ surface: "page"
4657
+ });
4658
+ return sentence === null ? [] : [sentence];
4659
+ }
4660
+ }
4661
+ }
4329
4662
  function AppointmentDateTime({ appointment, dateContext }) {
4330
4663
  if (!dateContext) return null;
4331
4664
  const start = parseUtcIsoDateTimeString(appointment.startAt);