@riverbankcms/sdk 0.179.0 → 0.181.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 (240) hide show
  1. package/README.md +2 -2
  2. package/dist/_dts/{BlocksIslandsHydrator-DKwgs95u.d.ts → BlocksIslandsHydrator-CVCasDPz.d.ts} +1 -1
  3. package/dist/_dts/{Page-lWenra5i.d.ts → Page-Dtj2Ui3S.d.ts} +7 -7
  4. package/dist/_dts/{SdkPreviewMode-BRxhRw4I.d.ts → SdkPreviewMode-D1f_60WW.d.ts} +3 -2
  5. package/dist/_dts/{client-qWn7xAwJ.d.ts → client-Chr9pNVW.d.ts} +288 -121
  6. package/dist/_dts/{content-types-DL6GIvTm.d.ts → content-types-kjccgopX.d.ts} +2 -2
  7. package/dist/_dts/{contracts-CzWyAiJj.d.ts → contracts-BodaiS00.d.ts} +3 -3
  8. package/dist/_dts/{generatePageMetadata-CBKd0cJ4.d.ts → generatePageMetadata-BS6kaJFp.d.ts} +2 -2
  9. package/dist/_dts/{index-DCiSHd-C.d.ts → index-Brl6_I2j.d.ts} +5 -4
  10. package/dist/_dts/{index-CaCum9mM.d.ts → index-CJkefwYh.d.ts} +2 -2
  11. package/dist/_dts/{index-7CDBZGb-.d.ts → index-D1WpKwQe.d.ts} +1 -1
  12. package/dist/_dts/{index-BU9uAkHB.d.ts → index-DG0OvBs0.d.ts} +8 -8
  13. package/dist/_dts/{index-BYnG_vF5.d.ts → index-Diqt0PvG.d.ts} +1 -1
  14. package/dist/_dts/{index-CZgJrhzT.d.ts → index-Dy50xUMK.d.ts} +2 -2
  15. package/dist/_dts/{loadContent-CPKbFQyq.d.ts → loadContent-BgxshKrA.d.ts} +7 -7
  16. package/dist/_dts/{request-BjKBCS7t.d.ts → request-CA0izds5.d.ts} +4561 -1390
  17. package/dist/_dts/{resolveBlockData-DupbMCup.d.ts → resolveBlockData-ChQmwEd3.d.ts} +5 -5
  18. package/dist/_dts/{resolvePageContent-BqNyCHi8.d.ts → resolvePageContent-BvGyvblj.d.ts} +1 -1
  19. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  20. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  21. package/dist/_dts/sdk/src/client.d.ts +7 -7
  22. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  23. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  24. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  25. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  26. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  27. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  28. package/dist/_dts/sdk/src/gifting/client.d.ts +1 -2
  29. package/dist/_dts/sdk/src/index.d.ts +104 -8
  30. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  31. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  32. package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
  33. package/dist/_dts/sdk/src/next/index.d.ts +84 -53
  34. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  35. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  36. package/dist/_dts/sdk/src/portal/client.d.ts +43 -56
  37. package/dist/_dts/sdk/src/portal/index.d.ts +3 -18
  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 +6 -6
  47. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  48. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  49. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  50. package/dist/_dts/sdk/src/routing/index.d.ts +6 -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-YcsIjvn1.d.ts → serviceBookingOutline-BgFbJQhU.d.ts} +8 -7
  55. package/dist/_dts/{types-B7e6Lmo5.d.ts → types-CQrsP1x_.d.ts} +3 -3
  56. package/dist/_dts/{types-CT-KOxl_.d.ts → types-CgS3xLk8.d.ts} +7 -2
  57. package/dist/_dts/{types-BOxSq-Bq.d.ts → types-R65DKjPn.d.ts} +9 -8
  58. package/dist/_dts/{validation-Dz6qccue.d.ts → validation-6LTIbuBA.d.ts} +4 -4
  59. package/dist/client/{BlocksIslandsHydrator-1XifJg6V.mjs → BlocksIslandsHydrator-DqZPz6oW.mjs} +19 -19
  60. package/dist/client/{BookingMailingListNote-BsbEgagJ.mjs → BookingMailingListNote-uWfR2kaG.mjs} +177 -70
  61. package/dist/client/{BookingQuestionFields-C8IbeLHj.mjs → BookingQuestionFields-CyNIKw6k.mjs} +23 -82
  62. package/dist/client/CalendarAction-D_Glwvz2.mjs +105 -0
  63. package/dist/client/{CalendarNavigationChevron-Bbqij1XQ.mjs → CalendarNavigationChevron-BGCX3zwG.mjs} +6 -6
  64. package/dist/client/{CheckboxChoice-BZPLCgTU.mjs → CheckboxChoice-C8i4NraK.mjs} +1 -1
  65. package/dist/client/{DemoBookingPortalAccess-uA9H8LIL.mjs → DemoBookingPortalAccess-DFLPyuqe.mjs} +18 -10
  66. package/dist/client/{EventCalendar.client-yoSI77ov.mjs → EventCalendar.client-zDL4-t-B.mjs} +10 -10
  67. package/dist/client/{EventCombined.client-HeCNlliq.mjs → EventCombined.client-uciDKLID.mjs} +60 -10
  68. package/dist/client/{EventEmbeddedCheckoutStep-BDnicDM6.mjs → EventEmbeddedCheckoutStep-BGkbUhuw.mjs} +1 -1
  69. package/dist/client/{EventItem-Duhk1vnF.mjs → EventItem-CwzrjcRw.mjs} +8 -7
  70. package/dist/client/{EventListWeekNavigation-BiutEqPK.mjs → EventListWeekNavigation-ChvcnPma.mjs} +1 -1
  71. package/dist/client/{EventListing.client-B5ln77jG.mjs → EventListing.client-DA57Qoyx.mjs} +3 -3
  72. package/dist/client/{EventListing.view-hUDhNtMv.mjs → EventListing.view-DZ0qMFF4.mjs} +8 -211
  73. package/dist/client/{EventRegistrationPayment-DqtX1vB2.mjs → EventRegistrationPayment-DSqCJL8E.mjs} +1657 -403
  74. package/dist/client/{Page-ChJ2TGVk.mjs → Page-C7mygH_f.mjs} +536 -287
  75. package/dist/client/{ProtectedSubmitButton-De6AzhE6.mjs → ProtectedSubmitButton-BNnKuir8.mjs} +1 -1
  76. package/dist/client/{SiteTermsAgreementField-CDBU31xW.mjs → SiteTermsAgreementField-B4z-e4Wq.mjs} +27 -24
  77. package/dist/client/{StepIndicator-JQA-VuEH.mjs → StepIndicator-Dn_DY4oY.mjs} +1 -1
  78. package/dist/client/{StepIndicator-2Dl9zon2.mjs → StepIndicator-atfDU82W.mjs} +21 -13
  79. package/dist/client/{ThemedButton-CnSa7o-I.mjs → ThemedButton-PFOhXktM.mjs} +1 -33
  80. package/dist/client/{accessibleSurfaces-Wl8-_OVJ.mjs → accessibleSurfaces-n6kS6Hct.mjs} +77 -1
  81. package/dist/client/{accordion-B6SqU49k.mjs → accordion-CsW8U3ff.mjs} +1 -1
  82. package/dist/client/{booking-form.client-DrEOjQ3N.mjs → booking-form.client-cBWM392H.mjs} +442 -86
  83. package/dist/client/bookingCalendar--aWnqFDn.mjs +180 -0
  84. package/dist/client/{bookingForm-drZBwEZW.mjs → bookingForm-DgySpp6C.mjs} +4 -4
  85. package/dist/client/bookings.mjs +51 -15
  86. package/dist/client/{boxStyleClassNames-DEh45w16.mjs → boxStyleClassNames-BpGVdLFD.mjs} +2 -2
  87. package/dist/client/{carousel-C-YJliD-.mjs → carousel-DJoleFV3.mjs} +2 -2
  88. package/dist/client/{carousel.client-DMtGYTTM.mjs → carousel.client-BtLwHefX.mjs} +1 -1
  89. package/dist/client/{cart-acGFWK9R.mjs → cart-EO5o6uPH.mjs} +3 -3
  90. package/dist/client/{cart.client-BzlOGP2j.mjs → cart.client-D_gPw45z.mjs} +1 -1
  91. package/dist/client/{checkout-SEontwhy.mjs → checkout-NVfZW0kR.mjs} +3 -3
  92. package/dist/client/{checkout.client-C0Qvh-d4.mjs → checkout.client-DD3JuqOy.mjs} +1 -1
  93. package/dist/client/{checkoutUrls-yUKeq1N9.mjs → checkoutUrls-z2gXvlGw.mjs} +1 -1
  94. package/dist/client/client.mjs +306 -196
  95. package/dist/client/constants-CoOkvw__.mjs +100 -0
  96. package/dist/client/{context-DTrwaQtg.mjs → context-CRhn9qzS.mjs} +922 -388
  97. package/dist/client/{dateFormatting-Cg8E1r9l.mjs → dateFormatting-BnWB4L1s.mjs} +15 -25
  98. package/dist/client/{demoPortalMagicLink-D0kOJYOX.mjs → demoPortalMagicLink-CWDGSTBu.mjs} +2 -3
  99. package/dist/client/{enhanceHeaderSection-DyrpZ7ks.mjs → enhanceHeaderSection-tdP_-Z9o.mjs} +4 -5
  100. package/dist/client/{event-registration.client-RLZQWi2V.mjs → event-registration.client-D7YYKySQ.mjs} +2084 -1640
  101. package/dist/client/{eventCalendar-CphYnImh.mjs → eventCalendar-CsAfu5d0.mjs} +4 -4
  102. package/dist/client/{eventCombined-BvqjASB_.mjs → eventCombined-VXJB5CoS.mjs} +4 -4
  103. package/dist/client/{eventListing-BaNAoC_M.mjs → eventListing-B3KIZNfY.mjs} +4 -4
  104. package/dist/client/{eventRegistration-COMHoRl6.mjs → eventRegistration-BP-dEk1c.mjs} +4 -4
  105. package/dist/client/{form-DyH2juYT.mjs → form-DM8Zbxbv.mjs} +3 -3
  106. package/dist/client/{form.client-DBwzkB0M.mjs → form.client-e2z_Tlgk.mjs} +5 -5
  107. package/dist/client/{form.parts-CY4kX3mh.mjs → form.parts-Ctljy1a3.mjs} +3 -3
  108. package/dist/client/gifting/client.mjs +32 -29
  109. package/dist/client/{gifting-CIx4V378.mjs → gifting-DWIsqQru.mjs} +4 -4
  110. package/dist/client/{gifting.client-BEVPpzJM.mjs → gifting.client-QsSWF0uA.mjs} +5 -5
  111. package/dist/client/{gifting.parts-VnORjnZK.mjs → gifting.parts-CedLgwa_.mjs} +2 -2
  112. package/dist/client/{headerSection-DGcJfRS8.mjs → headerSection-DAkRkwb-.mjs} +2 -2
  113. package/dist/client/{mediaAssets-B99AP7ai.mjs → mediaAssets-COfQolI3.mjs} +1 -1
  114. package/dist/client/{mediaContext-Fusweriw.mjs → mediaContext-DzvnjYXm.mjs} +1 -1
  115. package/dist/client/{newsletter-form.client-BvEDkjiD.mjs → newsletter-form.client-WYja9-WN.mjs} +7 -7
  116. package/dist/client/{newsletter-form.interactive-DCO1lErD.mjs → newsletter-form.interactive-RuM86VAv.mjs} +37 -44
  117. package/dist/client/{newsletter-form.parts-BIy4IUT3.mjs → newsletter-form.parts-2petDnWv.mjs} +2 -2
  118. package/dist/client/{newsletterForm-CoTXDNFS.mjs → newsletterForm-BUbXdA_e.mjs} +3 -3
  119. package/dist/client/{lookSurfaces-IqT_SVnX.mjs → noop-Dl4mZ-rr.mjs} +257 -49
  120. package/dist/client/portal/client.mjs +11779 -6745
  121. package/dist/client/portalOrders-COGn4BKG.mjs +596 -0
  122. package/dist/client/portalRoutes-D72yvtDh.mjs +862 -0
  123. package/dist/client/{product-detail.client-YHQ2aKX1.mjs → product-detail.client-pOAryevt.mjs} +1 -1
  124. package/dist/client/{product-list.client-DxoZw1vF.mjs → product-list.client-CcUpUiud.mjs} +1 -1
  125. package/dist/client/{productDetail-DjuFvkey.mjs → productDetail-BZJCfqat.mjs} +3 -3
  126. package/dist/client/{productList-DE9GEFoZ.mjs → productList-CiRs3mNb.mjs} +3 -3
  127. package/dist/client/{propsDecoder-Cyag_HOs.mjs → propsDecoder--uHW4tFM.mjs} +2 -2
  128. package/dist/client/{registry.server-BPwV-0Pp.mjs → registry.server-CDNNd8wC.mjs} +318 -235
  129. package/dist/client/{renderableMediaAssetAdmission-BlfqYLJW.mjs → renderableMediaAssetAdmission-BsOWd9lf.mjs} +1 -1
  130. package/dist/client/rendering/client.mjs +26 -26
  131. package/dist/client/rendering/islands.mjs +1 -1
  132. package/dist/client/rendering.mjs +16 -8
  133. package/dist/client/{richText-coerce-NrRqDeOg.mjs → richText-coerce-CQGE_wHV.mjs} +2 -1
  134. package/dist/client/{routeIslandApiConfig-BWq5gKFK.mjs → routeIslandApiConfig-BtCg87-N.mjs} +1 -1
  135. package/dist/client/{runtimeResponse-D2j2-mOk.mjs → runtimeResponse-DL_ARBpa.mjs} +1 -1
  136. package/dist/client/{runtimeResponse-DtWSfWSZ.mjs → runtimeResponse-Ds9cmBUf.mjs} +1 -1
  137. package/dist/client/{shop-C3wM0Hr4.mjs → shop-Rx_gEMK8.mjs} +3 -3
  138. package/dist/client/{shop-commerce-34YvcpbX.mjs → shop-commerce-D8evQnMT.mjs} +53 -16
  139. package/dist/client/{shop-commerce-store-B7xHksOs.mjs → shop-commerce-store-C9PcsSTj.mjs} +22 -5
  140. package/dist/client/{shop-discount-apply.state-BiBnozfO.mjs → shop-discount-apply.state-D5CtGfJI.mjs} +2 -2
  141. package/dist/client/{shop.client-C0v88nLd.mjs → shop.client-D4lzQ9oY.mjs} +17 -39
  142. package/dist/client/{shopShared-Ct-BRNez.mjs → shopShared-BVbq7Nm-.mjs} +2 -2
  143. package/dist/client/spam-protection.mjs +1 -1
  144. package/dist/client/src-Al4ooTl_.mjs +164 -0
  145. package/dist/client/{src-CCtanNlD.mjs → src-ZSqRK3dD.mjs} +345 -92
  146. package/dist/client/{timetableModel-lhE29TNT.mjs → timetableModel-BQJrSK0K.mjs} +205 -80
  147. package/dist/client/{shop-add-feedback-DvC2kP1K.mjs → urlParams-C2QHo1Pa.mjs} +1 -42
  148. package/dist/client/{useAvailableSlots-BelJviOT.mjs → useAvailableSlots-Dm3lKJKR.mjs} +3 -24
  149. package/dist/client/{useDiscountCodeUi-rQRE1-Ho.mjs → useDiscountCodeUi-klgfGn7f.mjs} +1 -1
  150. package/dist/client/{useEventPagination-C4rS2Xxl.mjs → useEventPagination-Jnjt7_ly.mjs} +8 -8
  151. package/dist/client/{view-LJVHVqsy.mjs → view-CC_yQLSA.mjs} +4 -4
  152. package/dist/client/{wizardSteps-CNDsxeJH.mjs → wizardSteps-BliJOzEX.mjs} +2512 -675
  153. package/dist/preview-next/before-render.mjs +1 -0
  154. package/dist/preview-next/client/{LocationPickerEnvironment-BHAT81Wx.mjs → LocationPickerEnvironment-BW3dRFIv.mjs} +1 -1
  155. package/dist/preview-next/client/{MapLibreEditMap-B52hkdIZ.mjs → MapLibreEditMap-Db9BHyXh.mjs} +2 -2
  156. package/dist/preview-next/client/{PageSectionToolbar-C4TtBPN-.mjs → PageSectionToolbar-BhL0uADo.mjs} +4 -4
  157. package/dist/preview-next/client/{PreviewEditorSidebar-D6fkE59-.mjs → PreviewEditorSidebar-Ct8eIm0i.mjs} +8 -7
  158. package/dist/preview-next/client/{PreviewEditorUI-amcDlj0O.mjs → PreviewEditorUI-BS32G4V9.mjs} +5 -5
  159. package/dist/preview-next/client/{PreviewShell-DeQjx4zk.mjs → PreviewShell-RL0WfZXD.mjs} +7 -7
  160. package/dist/preview-next/client/{SdkPreviewModeRuntime-Cx0SXnoX.mjs → SdkPreviewModeRuntime-MK_gHeGy.mjs} +39 -7
  161. package/dist/preview-next/client/{lucide-react-McYZeSMb.mjs → lucide-react-00FF_oar.mjs} +13 -1
  162. package/dist/preview-next/client/{previewAssistantSlot-aqpU34WI.mjs → previewAssistantSlot-CQyS8pcq.mjs} +10318 -3719
  163. package/dist/preview-next/client/{previewChromeRoot-D3Gy_Rs0.mjs → previewChromeRoot-BSxp3Mfu.mjs} +1 -1
  164. package/dist/preview-next/client/runtime.mjs +3 -3
  165. package/dist/preview-next/client/{sdk-runtime-Dzx_RrN7.mjs → sdk-runtime-DKnTzy74.mjs} +2 -2
  166. package/dist/preview-next/client/{siteStyleAccess-LHedw83e.mjs → siteStyleAccess-BlmbvbLN.mjs} +37 -25
  167. package/dist/preview-next/client/{useAutosaveStatus-DpSd9aVk.mjs → useAutosaveStatus-D-7GwZOQ.mjs} +1 -1
  168. package/dist/preview-next/client/{useOpenBlockForSetup-BGZn5AT1.mjs → useOpenBlockForSetup-BNZtGM5g.mjs} +2 -2
  169. package/dist/preview-next/container-responsive.css +292 -170
  170. package/dist/preview-next/keepAlive.mjs +1 -1
  171. package/dist/preview-next/middleware.mjs +1 -1
  172. package/dist/preview-next/{route-contract-DnL-FgSV.mjs → route-contract-R3PcMmax.mjs} +114 -37
  173. package/dist/server/{Block.shared-BEbq6EwO.mjs → Block.shared-CniF9tSu.mjs} +5 -5
  174. package/dist/server/{ThemeScopeCore-DFEM1a85.mjs → ThemeScopeCore-BQWsnGT6.mjs} +133 -120
  175. package/dist/server/{accessibleSurfaces-CM3QANtw.mjs → accessibleSurfaces-WPzUAHp4.mjs} +33 -2
  176. package/dist/server/accordions-By_0Ykks.mjs +111 -0
  177. package/dist/server/{bindings-Bly0dRs7.mjs → bindings-DxojjtK3.mjs} +7 -7
  178. package/dist/server/{client-CGJ2ztYp.mjs → client-CDndhbYO.mjs} +1412 -1307
  179. package/dist/server/config-validation.mjs +1 -1
  180. package/dist/server/config.mjs +2 -2
  181. package/dist/server/constants-VyF5nEhL.mjs +1474 -0
  182. package/dist/server/{customCss-BZ8YSrQg.mjs → customCss-C9kgPHvr.mjs} +41 -5
  183. package/dist/server/data/resolveBlockData.mjs +1 -1
  184. package/dist/server/index.mjs +3 -3
  185. package/dist/server/{loadContent-BkK1w3QQ.mjs → loadContent-BKstMBmX.mjs} +7 -4
  186. package/dist/server/{loadPage-DTLe0FEs.mjs → loadPage-IgNnZaqr.mjs} +3 -3
  187. package/dist/server/{lookMediaFrame-CaH018pK.mjs → lookMediaFrame-TFjgNG61.mjs} +74 -18
  188. package/dist/server/manifest.mjs +36 -25
  189. package/dist/server/{mapLocation-BM5WX7FY.mjs → mapLocation-MDDSubTp.mjs} +1 -1
  190. package/dist/server/media-BRmYrnzb.mjs +31 -0
  191. package/dist/server/{media-luf7RF22.mjs → media-gvfIw3z8.mjs} +2 -31
  192. package/dist/server/{navigation-BcNfYYuu.mjs → navigation-quBYlSKD.mjs} +2 -2
  193. package/dist/server/navigation.mjs +1 -1
  194. package/dist/server/next.mjs +170 -104
  195. package/dist/server/{overrideResolution-Uy9Zp2Ks.mjs → overrideResolution-CCaAPpIa.mjs} +1 -1
  196. package/dist/server/page-converter.mjs +3 -3
  197. package/dist/server/{pageRenderPlan-JzxBnqfV.mjs → pageRenderPlan-B7iULvKe.mjs} +15 -12
  198. package/dist/server/{pageRuntimeSupport-DyNSd2Yj.mjs → pageRuntimeSupport-BytMroxn.mjs} +9 -5
  199. package/dist/server/{pageShared-DU4ETFPS.mjs → pageShared-Dcs_XTIO.mjs} +836 -624
  200. package/dist/server/{parseThemeForPersistence-DOsfofCy.mjs → parseThemeForPersistence-Bihl4W5K.mjs} +3 -2
  201. package/dist/server/{portal-B4JVkdjc.mjs → portal-CMW_b9mG.mjs} +62 -46
  202. package/dist/server/portal.mjs +3 -3
  203. package/dist/server/portalQuestions-oUyohgL9.mjs +225 -0
  204. package/dist/server/{prebuild-8jNtDXmS.mjs → prebuild-agaH-vZV.mjs} +1 -1
  205. package/dist/server/prebuild.mjs +1 -1
  206. package/dist/server/{prefetchBlockData-xeMG42aw.mjs → prefetchBlockData-DwpRjqw4.mjs} +5 -3
  207. package/dist/server/{registry-DH1VrsCl.mjs → registry-DM9dHfDC.mjs} +582 -526
  208. package/dist/server/rendering/components/pageShared.mjs +1 -1
  209. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  210. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  211. package/dist/server/rendering/server.mjs +4 -4
  212. package/dist/server/rendering.mjs +10 -9
  213. package/dist/server/{resolveBlockData-BN8tweTx.mjs → resolveBlockData-CinHGf8l.mjs} +39 -31
  214. package/dist/server/{resolveButtonColourStates--6yJp9Tq.mjs → resolveButtonColourStates-B0O1IM16.mjs} +2 -1028
  215. package/dist/server/{resolvePageContent-DnM16_f9.mjs → resolvePageContent-BWKUZUIn.mjs} +1 -1
  216. package/dist/server/{responseMedia-F-ElH2Rd.mjs → responseMedia-IfH65QAH.mjs} +57 -2
  217. package/dist/server/routing.mjs +1 -1
  218. package/dist/server/{schema-BpsqaSSU.mjs → schema-CwfxQjc4.mjs} +10 -113
  219. package/dist/server/server.mjs +3 -3
  220. package/dist/server/{servicePageContent-B-FezJmH.mjs → servicePageContent-BBBhOtdE.mjs} +31 -26
  221. package/dist/server/theme-bridge.mjs +3 -2
  222. package/dist/server/theme.mjs +2 -2
  223. package/dist/server/{three-pass-converter-39SXCCnh.mjs → three-pass-converter-DPaUPTfl.mjs} +34 -16
  224. package/dist/server/titleSourceSchema-NhK6azFS.mjs +2018 -0
  225. package/dist/server/typeGuards-CTW_9AXq.mjs +413 -0
  226. package/dist/server/types-BKaBZFjD.mjs +1085 -0
  227. package/dist/server/{validation-3jOzYdPL.mjs → validation-DG5jX3jH.mjs} +70 -17
  228. package/dist/server/{version-8t0o6_jd.mjs → version-CipbxPHL.mjs} +1 -1
  229. package/dist/server/video-Cdr3wh-q.mjs +272 -0
  230. package/dist/styles/index.css +3446 -3796
  231. package/package.json +2 -1
  232. package/dist/_dts/index-DVSipdrT.d.ts +0 -101
  233. package/dist/client/TabBarFragment-DlKQRhP4.mjs +0 -56
  234. package/dist/client/checkoutRoute-DKlZRNZD.mjs +0 -22
  235. package/dist/client/constants-4o4_hl34.mjs +0 -6
  236. package/dist/client/creditProducts-BQ1t1erI.mjs +0 -266
  237. package/dist/client/formatDate-CTEN7gxW.mjs +0 -26
  238. package/dist/server/constants-Cj7hfbrA.mjs +0 -41
  239. package/dist/server/richTextSchema-QLaQrbII.mjs +0 -212
  240. package/dist/server/titleSourceSchema-Cu-3PRvv.mjs +0 -122
@@ -1,24 +1,25 @@
1
1
  "use client";
2
- import { A as bookingPanelHeading, D as bookingCardEntry, E as bookingBarPlacement, M as cancelledDateCopy, N as hasCancelledRegistrationDate, O as bookingEntry, Sn as formatEventPriceDisplay, T as DEFAULT_BOOKING_BUTTON_TEXT, b as displayButtonText, j as courseTitleOf, k as bookingEntryProgress, v as buildEventRegistrationDisplayFromScopedEvents, w as offeringNounForEvent, y as buildEventRegistrationInteractiveIslandProps } from "./newsletter-form.interactive-DCO1lErD.mjs";
3
- import { $n as placesLeftLabel, A as isEventRegistrationAvailable, Aa as getEventAvailability, Ar as resolveEventRegistrationScopedEvents, B as paymentChoiceDetails, Bn as getTicketSelectionTotal, Bt as selectionAtLimit, Cn as getVisibleTicketTypes, D as settledRemainingPlaces, Dt as SELECTION_LIMIT_NOTE, Ea as canJoinEventWaitlistOnAnyMode, En as withOccurrenceTitle, Fa as selectMostOpenCapacitySource, Ht as selectionConsentLabel, It as runChoiceUsable, Jt as selectionPlacesNote, Kt as selectionItemsLabel, Ln as canRequestTicketOption, Lt as runNeedsPricingChoice, Ma as getRemainingPlaces, Na as isEventFull, Ot as SEVERAL_BOOKINGS_ACCOUNT_NOTE, Pa as selectEventCapacitySource, Ro as INCOMPATIBLE_ATTENDANCE_MESSAGE, Rt as runPricingChoice, Sn as getTicketTypeAvailabilityLabel, T as resolveRegistrationAvailabilityBlocker, Ta as canJoinEventWaitlist, Ut as selectionEntitlementNote, V as paymentChoicePrice, Vn as getTicketTypeLineMax, Vt as selectionConfirmationHint, Wn as setTicketLineQuantity, Wt as selectionIncludes, Xr as getRegistrationSuccessCopy, Yt as selectionRowAvailability, Zt as severalConfirmationSentence, _ as shouldPromptForLogin, _a as bookingPresentation, _n as formatPassCreditUsageLabel, b as placeCountCeiling, c as registrationStepLabelContext, dn as ENTITLEMENT_SINGLE_TICKET_TOOLTIP, fi as formatCentsAsCurrencyInput, fn as areEntitlementsDisabledForTicketCount, fs as publicEventPricingStrategy, gn as formatEventDateTime, hn as formatDate, in as combinationOffersOf, j as normalizeEventRegistrationMaxTickets, kt as canToggleSelectionItem, l as areEventRegistrationPaymentSelectionsEqual, mn as formatBookingWhen, n as getEventSelectionMode, nr as shownVenue, ot as confirmationPaymentRows, pi as formatPrice, ps as publicEventPricingType, qt as selectionPlacesLabel, r as panelShouldOpen, rn as combinationOfferLine, rr as appliedDiscountHint, s as registrationStepLabel, sn as selectionItemName, st as resolveFinishedPresentation, us as publicEventPricingCurrency, v as fullyBookedLabel, vn as formatRegistrationSchedule, wn as occurrenceTitleOverride, yn as formatTime, zn as getTicketLineQuantity, zt as runUnitPriceCents } from "./wizardSteps-CNDsxeJH.mjs";
4
- import { bn as formatCurrencyAmount, t as assertNever } from "./src-CCtanNlD.mjs";
5
- import { g as formatCreditProductUnits } from "./creditProducts-BQ1t1erI.mjs";
6
- import { a as eventSiteTermsSurface, n as SiteTermsChangedNotice, t as SiteTermsAgreementField } from "./SiteTermsAgreementField-CDBU31xW.mjs";
7
- import { a as planEventRegistrationSurface, i as useEventRegistrationRecoveryRequest, o as registrationAdmissionSurface, r as useEventRegistrationWizard, s as resolveEventRegistrationClientSurface, t as EventPaymentMount } from "./EventRegistrationPayment-DqtX1vB2.mjs";
8
- import { n as useBlockApi } from "./context-DTrwaQtg.mjs";
9
- import { r as ThemedButton, x as SpinnerNode } from "./ThemedButton-CnSa7o-I.mjs";
10
- import { t as EVENT_REGISTRATION_ANCHOR_ID } from "./constants-4o4_hl34.mjs";
11
- import { f as NavigationHandOffPanel, p as DiscountCodeDisclosure, t as BookingConfirmation } from "./DemoBookingPortalAccess-uA9H8LIL.mjs";
2
+ import { A as bookingPanelHeading, Cn as formatEventPriceDisplay, D as bookingCardEntry, E as bookingBarPlacement, M as cancelledDateCopy, N as hasCancelledRegistrationDate, O as bookingEntry, T as DEFAULT_BOOKING_BUTTON_TEXT, b as displayButtonText, j as courseTitleOf, k as bookingEntryProgress, v as buildEventRegistrationDisplayFromScopedEvents, w as offeringNounForEvent, y as buildEventRegistrationInteractiveIslandProps } from "./newsletter-form.interactive-RuM86VAv.mjs";
3
+ import { An as formatCurrencyAmount, t as assertNever } from "./src-ZSqRK3dD.mjs";
4
+ import { An as selectionConfirmationHint, B as closedAdmissionLabel, Bn as severalConfirmationSentence, Br as placesLeftLabel, Co as selectMostOpenCapacitySource, Dn as runPricingChoice, Dr as getTicketSelectionTotal, En as runNeedsPricingChoice, Er as getTicketLineQuantity, Es as INCOMPATIBLE_ATTENDANCE_MESSAGE, Fn as selectionItemsLabel, In as selectionPlacesLabel, It as ADD_A_PLACE, Jt as confirmationPaymentRows, K as registrationStopsHere, Kn as combinationOfferLine, Li as getRegistrationSuccessCopy, Ln as selectionPlacesNote, Mn as selectionEntitlementNote, Nn as selectionIncludes, On as runUnitPriceCents, Or as getTicketTypeLineMax, Os as setRoomChoicePeople, Rn as selectionRowAvailability, So as selectEventCapacitySource, Tn as runChoiceUsable, U as placeCountCeiling, Ur as shownVenue, V as fullyBookedLabel, Y as resolveRegistrationAvailabilityBlocker, Yt as resolveFinishedPresentation, Z as settledRemainingPlaces, Zn as selectionItemName, _i as resolveEventRegistrationScopedEvents, _n as SEVERAL_BOOKINGS_ACCOUNT_NOTE, ao as bookingPresentation, ar as formatRunScheduleLines, bo as getRemainingPlaces, c as registrationStepLabelContext, dc as publicEventPricingStrategy, dr as occurrenceTitleOverride, dt as paymentChoiceDetails, et as isEventRegistrationAvailable, fc as publicEventPricingType, ft as paymentChoicePrice, ga as formatPrice, gn as SELECTION_LIMIT_NOTE, ha as formatCentsAsCurrencyInput, ir as formatRegistrationSchedule, jn as selectionConsentLabel, jr as setTicketLineQuantity, kn as selectionAtLimit, l as areEventRegistrationPaymentSelectionsEqual, lc as publicEventPricingCurrency, lr as getTicketTypeAvailabilityLabel, mo as canJoinEventWaitlistOnAnyMode, n as getEventSelectionMode, nr as formatDate, or as formatTime, po as canJoinEventWaitlist, pr as withOccurrenceTitle, qn as combinationOffersOf, r as panelShouldOpen, rr as formatEventDateTime, s as registrationStepLabel, tr as formatBookingWhen, tt as normalizeEventRegistrationMaxTickets, ur as getVisibleTicketTypes, vo as getEventAvailability, wr as canRequestTicketOption, xo as isEventFull, yn as canToggleSelectionItem, yt as entryChoosesEvent, z as shouldPromptForLogin } from "./wizardSteps-BliJOzEX.mjs";
5
+ import { i as portalPath } from "./portalRoutes-D72yvtDh.mjs";
6
+ import { n as SiteTermsChangedNotice, t as SiteTermsAgreementField } from "./SiteTermsAgreementField-B4z-e4Wq.mjs";
7
+ import { a as ONE_DATE_FUNDING_LOAD_FAILED, c as planEventRegistrationSurface, i as summaryExplainsMoreThanTheOption, l as registrationAdmissionSurface, o as SELECTION_FUNDING_LOAD_FAILED, r as useEventRegistrationWizard, s as useEventRegistrationRecoveryRequest, t as EventPaymentMount, u as resolveEventRegistrationClientSurface } from "./EventRegistrationPayment-DSqCJL8E.mjs";
8
+ import { n as useBlockApi } from "./context-CRhn9qzS.mjs";
9
+ import { b as SpinnerNode, n as ThemedButton } from "./ThemedButton-PFOhXktM.mjs";
10
+ import { t as EVENT_REGISTRATION_ANCHOR_ID } from "./constants-CoOkvw__.mjs";
11
+ import { m as DiscountCodeDisclosure, p as NavigationHandOffPanel, t as BookingConfirmation } from "./DemoBookingPortalAccess-DFLPyuqe.mjs";
12
12
  import { t as createBodyThemePortalRoot } from "./themePortalRoot-DeP49PT8.mjs";
13
- import { t as CheckboxChoice } from "./CheckboxChoice-BZPLCgTU.mjs";
13
+ import { t as CheckboxChoice } from "./CheckboxChoice-C8i4NraK.mjs";
14
14
  import { t as CrossIcon } from "./CrossIcon-CpG9VRyW.mjs";
15
15
  import { n as getFieldValidationControlProps, t as FieldValidationMessage } from "./FieldValidationMessage-CsqxShw4.mjs";
16
16
  import { t as FeedbackMessage } from "./FeedbackMessage-CSJrAuXH.mjs";
17
- import { n as TerminalPanel, r as StateIcon } from "./useDiscountCodeUi-rQRE1-Ho.mjs";
17
+ import { a as MagicLinkForm, n as OrganiserContactLine, o as BookingConsentAgreement, p as PaymentChoiceRows, r as BookingQuestionSections, t as BookingMailingListNote } from "./BookingMailingListNote-uWfR2kaG.mjs";
18
+ import { n as TerminalPanel, r as StateIcon } from "./useDiscountCodeUi-klgfGn7f.mjs";
18
19
  import { t as ModalShell } from "./ModalShell-B_fHWK71.mjs";
19
- import { i as BookingConsentAgreement, l as PaymentChoiceRows, n as BookingQuestionSections, r as MagicLinkForm, t as BookingMailingListNote } from "./BookingMailingListNote-BsbEgagJ.mjs";
20
- import { a as planEventBookingPanel, c as EventBookingPanelView, i as RegistrationClosedState, n as BookingEntryBar, o as registrationSourceForPanel, r as BookingEntryCard, s as resolveBookingPanelSelection, t as StepIndicator } from "./StepIndicator-2Dl9zon2.mjs";
20
+ import { a as planEventBookingPanel, c as EventBookingPanelView, i as RegistrationClosedState, n as BookingEntryBar, o as registrationSourceForPanel, r as BookingEntryCard, s as resolveBookingPanelSelection, t as StepIndicator } from "./StepIndicator-atfDU82W.mjs";
21
21
  import { t as createLucideIcon } from "./createLucideIcon-BrXgHVKN.mjs";
22
+ import { t as CalendarAction } from "./CalendarAction-D_Glwvz2.mjs";
22
23
  import React, { useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
23
24
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
24
25
  import { createPortal } from "react-dom";
@@ -393,1387 +394,1612 @@ function EventRegistrationBookingLayer(props) {
393
394
  ] });
394
395
  }
395
396
  //#endregion
396
- //#region ../blocks/src/system/runtime/nodes/event-registration/ErrorStep.tsx
397
- /**
398
- * Error Step
399
- *
400
- * Displays an error message with a retry button when registration fails.
401
- */
402
- const labels = {
403
- none: "",
404
- retry: "Try again",
405
- places: "Choose places",
406
- start: "Start again",
407
- details: "Check my details",
408
- "payment-options": "View payment options",
409
- portal: "View my bookings",
410
- event: "View event"
411
- };
412
- const ErrorStep = ({ message, onRetry, action = "retry", canJoinWaitlist = false }) => {
413
- const offerWaitlist = action === "places" && canJoinWaitlist;
414
- return /* @__PURE__ */ jsx(TerminalPanel, {
415
- tone: "error",
416
- className: "er-center",
417
- titleClassName: "er-title--lg er-message",
418
- icon: /* @__PURE__ */ jsx(StateIcon, {
419
- variant: "error",
420
- children: /* @__PURE__ */ jsx(CrossIcon, {})
421
- }),
422
- title: "We couldn’t complete your booking",
423
- body: /* @__PURE__ */ jsx("p", {
424
- className: "er-text--muted er-message",
425
- children: offerWaitlist ? "Sorry, this event is now full. You can join the waiting list, and we’ll email you if a place becomes available." : message
426
- }),
427
- actions: action === "none" ? void 0 : action === "portal" ? /* @__PURE__ */ jsx("a", {
428
- href: "/portal",
429
- className: "er-retry-btn",
430
- children: labels[action]
431
- }) : /* @__PURE__ */ jsx("button", {
432
- type: "button",
433
- onClick: onRetry,
434
- className: "er-retry-btn",
435
- children: offerWaitlist ? "Join the waiting list" : labels[action]
436
- })
437
- });
438
- };
439
- //#endregion
440
- //#region ../blocks/src/system/runtime/nodes/event-registration/CopyParts.tsx
441
- /** Copy with its bold parts in <strong>: offer lines and hints (issue 1725). */
442
- function CopyParts(props) {
443
- return /* @__PURE__ */ jsx(Fragment, { children: props.parts.map((part, index) => part.strong ? /* @__PURE__ */ jsx("strong", { children: part.text }, index) : /* @__PURE__ */ jsx(React.Fragment, { children: part.text }, index)) });
397
+ //#region ../blocks/src/system/runtime/nodes/event-registration/TicketSelectionStep.tsx
398
+ function pluralizeBookingUnit(kind, quantity) {
399
+ return `${kind}${quantity === 1 ? "" : "s"}`;
444
400
  }
445
- //#endregion
446
- //#region ../blocks/src/system/runtime/nodes/event-registration/CombinationSummary.tsx
447
- /** The usual total struck through, then what combination prices bring it to (issue 1725). */
448
- function CombinationPricing(props) {
449
- return /* @__PURE__ */ jsxs("div", {
450
- className: "er-summary-bar-pricing",
451
- children: [/* @__PURE__ */ jsx("span", {
452
- className: "er-summary-bar-price er-summary-bar-price--struck",
453
- children: formatPrice(props.listCents, props.currency)
454
- }), /* @__PURE__ */ jsx("span", {
455
- className: "er-summary-bar-price",
456
- children: formatPrice(props.totalCents, props.currency)
457
- })]
458
- });
401
+ function getEventAttendanceModeLabel(mode) {
402
+ switch (mode) {
403
+ case "in_person": return "In person";
404
+ case "online": return "Online";
405
+ }
459
406
  }
460
- /** "4 dates for £40, plus 1 at £12 · You save £8" under the summary row. */
461
- function CombinationDetail(props) {
462
- if (!props.working) return null;
463
- return /* @__PURE__ */ jsxs("p", {
464
- className: "er-combination-detail",
407
+ function TicketCounter(props) {
408
+ const { ticketsCount, maxAllowed, label, onTicketsChange } = props;
409
+ const minAllowed = props.minAllowed ?? 1;
410
+ return /* @__PURE__ */ jsxs("div", {
411
+ className: "rb-reg-row er-row er-counter",
465
412
  children: [
466
- props.working.working,
467
- " · ",
413
+ /* @__PURE__ */ jsx("button", {
414
+ type: "button",
415
+ "aria-label": `Decrease ${label}`,
416
+ onClick: () => onTicketsChange(stepNumber(ticketsCount, -1, { min: minAllowed })),
417
+ disabled: ticketsCount <= minAllowed,
418
+ className: "er-counter-btn",
419
+ children: "−"
420
+ }),
468
421
  /* @__PURE__ */ jsx("span", {
469
- className: "er-combination-saving",
470
- children: props.working.saving
422
+ className: "er-counter-value",
423
+ children: ticketsCount
424
+ }),
425
+ /* @__PURE__ */ jsx("button", {
426
+ type: "button",
427
+ "aria-label": `Increase ${label}`,
428
+ onClick: () => onTicketsChange(stepNumber(ticketsCount, 1, { max: maxAllowed })),
429
+ disabled: ticketsCount >= maxAllowed,
430
+ className: "er-counter-btn",
431
+ children: "+"
471
432
  })
472
433
  ]
473
434
  });
474
435
  }
475
- /** "Add 1 more date to get 4 dates for £40." under the summary bar. */
476
- function CombinationHint(props) {
477
- if (!props.parts) return null;
478
- return /* @__PURE__ */ jsx("p", {
479
- className: "er-combination-hint",
480
- role: "status",
481
- children: /* @__PURE__ */ jsx(CopyParts, { parts: props.parts })
436
+ function TicketCounterLimit(props) {
437
+ const showBookingLimit = !props.availabilityLabel || props.maxAllowed < (props.availableSpots ?? Infinity);
438
+ return /* @__PURE__ */ jsxs("p", {
439
+ className: "er-ticket-counter-limit",
440
+ children: [props.availabilityLabel ? /* @__PURE__ */ jsx("span", { children: props.availabilityLabel }) : null, showBookingLimit ? /* @__PURE__ */ jsxs(Fragment, { children: [props.availabilityLabel ? /* @__PURE__ */ jsx("br", {}) : null, /* @__PURE__ */ jsxs("span", { children: [
441
+ "Up to ",
442
+ props.maxAllowed,
443
+ " ",
444
+ props.quantityLabel,
445
+ " per booking."
446
+ ] })] }) : null]
482
447
  });
483
448
  }
484
- //#endregion
485
- //#region ../blocks/src/system/runtime/nodes/event-registration/registrationSummary.state.ts
486
- /** Several course runs are one purchase; individual run names belong in the breakdown. */
487
- function registrationSummaryTitle(input) {
488
- if (input.severalItems === "runs") return (input.subject?.kind === "eventOffering" ? input.subject.title?.trim() : null) || "Your booking";
489
- return occurrenceTitleOverride(input.occurrenceContext) ?? input.eventTitle ?? "";
490
- }
491
- //#endregion
492
- //#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationSummaryBar.tsx
493
- function productMethodFor(wizard) {
494
- return isProductMethod(wizard.paymentSelection.method);
495
- }
496
- function isProductMethod(method) {
497
- return method !== null && [
498
- "pass",
499
- "membership",
500
- "pass_bundle",
501
- "membership_bundle"
502
- ].includes(method);
503
- }
504
- function getPaymentSelectionProductName(selection) {
505
- return "productName" in selection ? selection.productName : void 0;
506
- }
507
- /** Credits held on the pass the customer is about to redeem, before this booking. */
508
- function getSelectedPassCreditsRemaining(wizard) {
509
- const selection = wizard.paymentSelection;
510
- if (selection.method !== "pass") return null;
511
- const passId = selection.passId;
512
- return (wizard.eligibility?.eligiblePasses ?? []).find((candidate) => candidate.id === passId)?.creditsRemaining ?? null;
513
- }
514
- /**
515
- * Copy describing how a pass or membership covers the booking.
516
- *
517
- * Pass redemptions spend something, so they say so and name the balance;
518
- * memberships already include the class, so "Included" stays accurate.
519
- */
520
- function resolveEntitlementSummaryCopy(method, passCreditsRemaining) {
521
- switch (method) {
522
- case "pass": return {
523
- productPrice: formatCreditProductUnits("event_pass", 1),
524
- pricingNote: formatPassCreditUsageLabel(passCreditsRemaining)
525
- };
526
- case "pass_bundle": return {
527
- productPrice: null,
528
- pricingNote: formatPassCreditUsageLabel(null)
529
- };
530
- case "membership": return {
531
- productPrice: "Included",
532
- pricingNote: "Included in membership"
533
- };
534
- case "membership_bundle":
535
- case "free":
536
- case "stripe":
537
- case null: return {
538
- productPrice: null,
539
- pricingNote: "Included in membership"
540
- };
541
- }
449
+ function BookingUnitSessionHint(props) {
450
+ const count = props.bookingUnit.includedSessionCount;
451
+ return props.bookingUnit.kind === "place" && count && count > 1 ? /* @__PURE__ */ jsxs("p", {
452
+ className: "er-text er-text--muted",
453
+ children: [
454
+ "Every place includes all ",
455
+ count,
456
+ " sessions."
457
+ ]
458
+ }) : null;
542
459
  }
543
- function getFlexibleBalanceSummary(option) {
544
- return option?.flexibleBalance ? {
545
- total: option.amounts.formattedTotal,
546
- dueToday: option.amounts.formattedDueToday,
547
- ...option.flexibleBalance
548
- } : null;
460
+ function bookingQuantityLabel(unit, waitlist) {
461
+ if (!waitlist) return pluralizeBookingUnit(unit, 2);
462
+ return "waitlist places";
549
463
  }
550
- function getSelectedDirectPaymentOption(wizard) {
551
- if (wizard.paymentSelection.method !== "stripe") return null;
552
- const kind = wizard.paymentSelection.collectionOptionKind;
553
- return wizard.directPaymentOptions.find((option) => option.kind === kind) ?? null;
464
+ function BookingQuantityPrompt(props) {
465
+ return /* @__PURE__ */ jsxs("h3", {
466
+ tabIndex: -1,
467
+ className: "er-title",
468
+ children: [
469
+ "How many ",
470
+ bookingQuantityLabel(props.unit, props.waitlist),
471
+ "?"
472
+ ]
473
+ });
554
474
  }
555
- /** Product row naming the pass or membership that covers this booking. */
556
- function EntitlementSummaryRow(props) {
557
- const { paymentSelection } = props.wizard;
558
- if (!isProductMethod(paymentSelection.method)) return null;
559
- const productName = "productName" in paymentSelection ? paymentSelection.productName : void 0;
560
- const productInterval = "productInterval" in paymentSelection ? paymentSelection.productInterval : void 0;
561
- const productPrice = "productPrice" in paymentSelection ? paymentSelection.productPrice : void 0;
562
- const productCurrency = "productCurrency" in paymentSelection ? paymentSelection.productCurrency : void 0;
475
+ function SlidingScaleAmountField(props) {
476
+ const id = props.id ?? "er-sliding-amount";
477
+ const minLabel = formatPrice(props.slidingScale.minAmount, props.currency);
478
+ const maxLabel = formatPrice(props.slidingScale.maxAmount, props.currency);
479
+ const suggestedLabel = props.slidingScale.suggestedAmount !== null ? formatPrice(props.slidingScale.suggestedAmount, props.currency) : null;
563
480
  return /* @__PURE__ */ jsxs("div", {
564
- className: "er-summary-bar-product",
565
- children: [/* @__PURE__ */ jsxs("div", { children: [
566
- /* @__PURE__ */ jsx("div", {
567
- className: "er-summary-bar-product-name",
568
- children: productName
481
+ className: "er-field",
482
+ children: [
483
+ /* @__PURE__ */ jsx("label", {
484
+ htmlFor: id,
485
+ className: "form-label",
486
+ children: "Amount"
569
487
  }),
570
- props.showPassEscape && /* @__PURE__ */ jsx("button", {
571
- type: "button",
572
- className: "er-summary-bar-pass-escape",
573
- onClick: props.wizard.handleUseCardInsteadOfPass,
574
- children: "Pay by card instead"
488
+ /* @__PURE__ */ jsx("input", {
489
+ id,
490
+ type: "number",
491
+ min: formatCentsAsCurrencyInput(props.slidingScale.minAmount),
492
+ max: formatCentsAsCurrencyInput(props.slidingScale.maxAmount),
493
+ step: "0.01",
494
+ inputMode: "decimal",
495
+ className: "form-input",
496
+ value: props.value,
497
+ onChange: (event) => props.onChange?.(event.target.value)
575
498
  }),
576
- productInterval && /* @__PURE__ */ jsx("div", {
577
- className: "er-summary-bar-product-detail",
578
- children: productInterval
499
+ /* @__PURE__ */ jsxs("p", {
500
+ className: "er-text er-text--muted",
501
+ children: [
502
+ "Choose between ",
503
+ minLabel,
504
+ " and ",
505
+ maxLabel,
506
+ suggestedLabel ? `; suggested ${suggestedLabel}` : "",
507
+ "."
508
+ ]
579
509
  }),
580
- /* @__PURE__ */ jsx(MembershipFirstPayment, {
581
- firstPaymentCents: props.wizard.membershipFirstPaymentCents,
582
- priceCents: productPrice,
583
- currency: productCurrency,
584
- interval: productInterval
585
- })
586
- ] }), /* @__PURE__ */ jsx("div", {
587
- className: "er-summary-bar-product-price",
588
- children: props.copy.productPrice ? /* @__PURE__ */ jsx("span", {
589
- className: "er-summary-bar-included",
590
- children: props.copy.productPrice
591
- }) : productPrice && productCurrency ? /* @__PURE__ */ jsx(ProductPrice, {
592
- cents: productPrice,
593
- afterCodeCents: props.wizard.passPriceAfterCodeCents,
594
- currency: productCurrency
510
+ props.message ? /* @__PURE__ */ jsx("p", {
511
+ className: "er-text er-text--muted",
512
+ children: props.message
595
513
  }) : null
596
- })]
514
+ ]
597
515
  });
598
516
  }
599
- /** A membership's discount comes off once, and it renews at the regular price. */
600
- function MembershipFirstPayment(props) {
601
- const { firstPaymentCents, priceCents, currency, interval } = props;
602
- if (firstPaymentCents === null || !priceCents || !currency || interval !== "month" && interval !== "year") return null;
603
- return /* @__PURE__ */ jsx("div", {
604
- className: "er-summary-bar-product-detail",
605
- children: appliedDiscountHint({
606
- totalAfterDiscountCents: firstPaymentCents,
607
- currency,
608
- membership: {
609
- priceCents,
610
- billingInterval: interval
611
- }
612
- })
517
+ function ticketTypePriceText(ticketType, currency) {
518
+ return ticketType.priceAmount > 0 ? formatPrice(ticketType.priceAmount, currency) : "Free";
519
+ }
520
+ function TicketTypeLineText(props) {
521
+ const { ticketType } = props;
522
+ return /* @__PURE__ */ jsxs("div", {
523
+ className: "er-ticket-line-main",
524
+ children: [
525
+ /* @__PURE__ */ jsxs("div", {
526
+ className: "er-ticket-line-heading",
527
+ children: [/* @__PURE__ */ jsx("span", {
528
+ className: "er-ticket-line-name",
529
+ children: ticketType.name
530
+ }), /* @__PURE__ */ jsx("span", {
531
+ className: "er-ticket-line-price",
532
+ children: ticketTypePriceText(ticketType, props.currency)
533
+ })]
534
+ }),
535
+ ticketType.description ? /* @__PURE__ */ jsx("p", {
536
+ className: "er-ticket-line-detail",
537
+ children: ticketType.description
538
+ }) : null,
539
+ props.detail ? /* @__PURE__ */ jsx("p", {
540
+ className: "er-ticket-line-detail",
541
+ children: props.detail
542
+ }) : null
543
+ ]
613
544
  });
614
545
  }
615
- /** The price, struck through once a code has taken something off a pass. */
616
- function ProductPrice(props) {
617
- const { cents, afterCodeCents, currency } = props;
618
- if (afterCodeCents === null || afterCodeCents >= cents) return /* @__PURE__ */ jsx(Fragment, { children: formatPrice(cents, currency) });
619
- return /* @__PURE__ */ jsxs(Fragment, { children: [
620
- /* @__PURE__ */ jsx("span", {
621
- className: "er-summary-bar-price er-summary-bar-price--struck",
622
- children: formatPrice(cents, currency)
546
+ /** What one ticket type's row says and allows, whichever row draws it. Places without a room draw it in the rooms' own row. */
547
+ function ticketTypeQuantity(props) {
548
+ const { ticketType } = props;
549
+ const quantity = getTicketLineQuantity(props.ticketSelections, ticketType.pricingOptionId);
550
+ return {
551
+ quantity,
552
+ maxAllowed: getTicketTypeLineMax({
553
+ currentQuantity: quantity,
554
+ totalSelectedQuantity: getTicketSelectionTotal(props.ticketSelections),
555
+ maxTickets: props.maxTickets,
556
+ purpose: props.purpose,
557
+ pricingOptionId: ticketType.pricingOptionId,
558
+ availability: ticketType.availability,
559
+ heldPlacesBySelection: props.heldPlacesBySelection,
560
+ overallRemainingPlaces: props.availableSpots ?? null
623
561
  }),
624
- " ",
625
- formatPrice(afterCodeCents, currency)
626
- ] });
627
- }
628
- /** The pass the customer turned down, with the way back to it. */
629
- function DeclinedPassRow(props) {
630
- return /* @__PURE__ */ jsx("div", {
631
- className: "er-summary-bar-product",
632
- children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
633
- className: "er-summary-bar-product-name",
634
- children: props.passName
635
- }), /* @__PURE__ */ jsxs("button", {
636
- type: "button",
637
- className: "er-summary-bar-pass-escape",
638
- onClick: props.onUsePass,
639
- children: [
640
- "Use ",
641
- formatCreditProductUnits("event_pass", 1),
642
- " from your pass instead"
643
- ]
644
- })] })
645
- });
562
+ disabled: !canRequestTicketOption(ticketType.availability, props.purpose),
563
+ detail: getTicketTypeAvailabilityLabel(ticketType) ?? placesLeftLabel({
564
+ kind: "ticketType",
565
+ remaining: ticketType.availability.remainingPlaces,
566
+ dateRemaining: props.availableSpots ?? null
567
+ }, props.display),
568
+ setQuantity: (next) => props.onTicketSelectionsChange?.(setTicketLineQuantity({
569
+ lines: props.ticketSelections,
570
+ pricingOptionId: ticketType.pricingOptionId,
571
+ quantity: next
572
+ }))
573
+ };
646
574
  }
647
- /**
648
- * The pass or membership covering the booking, or the pass the customer
649
- * turned down. Redeeming a pass is easy to miss, so the steps before payment
650
- * offer the way out of it and back again.
651
- */
652
- function PaymentProductRow(props) {
653
- const { wizard } = props;
654
- const canSwitchPass = wizard.step === "enter-details" || wizard.step === "select-tickets";
655
- const declinedPassName = canSwitchPass ? wizard.declinedPass?.productName : void 0;
656
- if (declinedPassName) return /* @__PURE__ */ jsx(DeclinedPassRow, {
657
- passName: declinedPassName,
658
- onUsePass: wizard.handleUsePassInstead
659
- });
660
- if (!getPaymentSelectionProductName(wizard.paymentSelection)) return null;
661
- return /* @__PURE__ */ jsx(EntitlementSummaryRow, {
662
- wizard,
663
- copy: props.copy,
664
- showPassEscape: canSwitchPass && wizard.paymentSelection.method === "pass"
575
+ /** One ticket type with its price, what's left and a counter. */
576
+ function TicketTypeQuantityRow(props) {
577
+ const { ticketType } = props;
578
+ const { quantity, maxAllowed, disabled, detail, setQuantity } = ticketTypeQuantity(props);
579
+ return /* @__PURE__ */ jsxs("div", {
580
+ className: `er-ticket-line${disabled ? " er-ticket-line--disabled" : ""}`,
581
+ role: "listitem",
582
+ children: [/* @__PURE__ */ jsx(TicketTypeLineText, {
583
+ ticketType,
584
+ currency: props.currency,
585
+ detail
586
+ }), /* @__PURE__ */ jsx(TicketCounter, {
587
+ ticketsCount: quantity,
588
+ minAllowed: 0,
589
+ maxAllowed,
590
+ label: ticketType.name,
591
+ onTicketsChange: setQuantity
592
+ })]
665
593
  });
666
594
  }
667
- /** "2 tickets" or "1 place"; booking several, "5 dates × 2 places" or the runs by name. */
668
- function summaryCountLabel(wizard, summaryEvent) {
669
- if (wizard.severalItems !== null) return selectionPlacesLabel(wizard.severalItems, wizard.selection, wizard.ticketsCount);
670
- if (wizard.ticketsCount <= 0) return null;
671
- const tiered = summaryEvent !== null && summaryEvent !== void 0 && publicEventPricingStrategy(summaryEvent.pricing) === "tiered";
672
- if (tiered) {
673
- const byType = ticketTypeCountLabel(wizard.selectedTicketLines, wizard.visibleTicketTypes);
674
- if (byType) return byType;
675
- }
676
- const unit = tiered ? "ticket" : "place";
677
- return `${wizard.ticketsCount} ${unit}${wizard.ticketsCount === 1 ? "" : "s"}`;
595
+ function TicketTypeQuantityRows(props) {
596
+ const totalSelectedQuantity = getTicketSelectionTotal(props.ticketSelections);
597
+ const effectiveMaxTickets = props.maxTickets;
598
+ return /* @__PURE__ */ jsxs("div", {
599
+ className: "er-ticket-lines",
600
+ children: [
601
+ /* @__PURE__ */ jsx("div", {
602
+ className: "er-ticket-line-list",
603
+ role: "list",
604
+ "aria-label": props.bookingUnit === "place" ? "Places" : "Tickets",
605
+ children: props.ticketTypes.map((ticketType) => /* @__PURE__ */ jsx(TicketTypeQuantityRow, {
606
+ display: props.display,
607
+ purpose: props.purpose,
608
+ ticketType,
609
+ ticketSelections: props.ticketSelections,
610
+ maxTickets: props.maxTickets,
611
+ heldPlacesBySelection: props.heldPlacesBySelection,
612
+ availableSpots: props.availableSpots,
613
+ currency: props.currency,
614
+ onTicketSelectionsChange: props.onTicketSelectionsChange
615
+ }, ticketType.pricingOptionId))
616
+ }),
617
+ /* @__PURE__ */ jsx(TicketCounterLimit, {
618
+ maxAllowed: effectiveMaxTickets,
619
+ quantityLabel: pluralizeBookingUnit(props.bookingUnit, effectiveMaxTickets),
620
+ availableSpots: props.availableSpots,
621
+ availabilityLabel: props.availabilityLabel
622
+ }),
623
+ totalSelectedQuantity === 0 && props.hasAvailableTicketTypes ? /* @__PURE__ */ jsxs("p", {
624
+ className: "er-text er-text--muted",
625
+ children: [
626
+ "Choose at least one ",
627
+ props.bookingUnit,
628
+ " to continue."
629
+ ]
630
+ }) : totalSelectedQuantity === 0 ? /* @__PURE__ */ jsxs("p", {
631
+ className: "er-text er-text--muted",
632
+ children: [
633
+ "No ",
634
+ props.bookingUnit === "place" ? "places" : "ticket types",
635
+ " are currently available."
636
+ ]
637
+ }) : null
638
+ ]
639
+ });
678
640
  }
679
- /** "1 Standard, 1 Concession" when tickets of more than one type are chosen; otherwise null. */
680
- function ticketTypeCountLabel(lines, ticketTypes) {
681
- const chosen = lines.filter((line) => line.quantity > 0);
682
- if (chosen.length < 2) return null;
683
- const parts = chosen.map((line) => {
684
- const name = ticketTypes.find((type) => type.pricingOptionId === line.pricingOptionId)?.name;
685
- return name ? `${line.quantity} ${name}` : null;
641
+ function getAttendanceModeDetail(attendanceMode, display) {
642
+ return placesLeftLabel(attendanceMode, display, {
643
+ unlimited: "Unlimited places",
644
+ open: "Places available",
645
+ full: "Currently full",
646
+ waitlist: "Currently full, waitlist available"
686
647
  });
687
- return parts.every((part) => part !== null) ? parts.join(", ") : null;
688
648
  }
689
- /**
690
- * The footer's one line (issue 1581): how many, the discount's name, then
691
- * when. Ticket types are tickets; a single price, or a course, is places.
692
- */
693
- function summaryMetaFacts(input) {
694
- const { wizard, summaryEvent } = input;
695
- const several = wizard.severalItems;
649
+ /** One event's ways of attending, each with its places left. */
650
+ function eventAttendanceModeTiles(attendanceModes, display) {
651
+ return attendanceModes.map((attendanceMode) => ({
652
+ mode: attendanceMode.mode,
653
+ detail: getAttendanceModeDetail(attendanceMode, display)
654
+ }));
655
+ }
656
+ /** The "How will you attend?" choice; several runs share it, so one choice covers them all. */
657
+ function AttendanceModeTiles(props) {
658
+ return /* @__PURE__ */ jsx("div", {
659
+ className: "er-payment-tiles",
660
+ role: "list",
661
+ "aria-label": "Attendance mode",
662
+ children: props.tiles.map((tile) => {
663
+ const isSelected = props.selectedAttendanceMode === tile.mode;
664
+ return /* @__PURE__ */ jsx("div", {
665
+ role: "listitem",
666
+ children: /* @__PURE__ */ jsxs("button", {
667
+ type: "button",
668
+ "aria-pressed": isSelected,
669
+ className: `er-payment-tile${isSelected ? " er-payment-tile--selected" : ""}`,
670
+ onClick: () => props.onAttendanceModeChange?.(tile.mode),
671
+ children: [/* @__PURE__ */ jsx("div", {
672
+ className: "er-payment-tile-label",
673
+ children: getEventAttendanceModeLabel(tile.mode)
674
+ }), /* @__PURE__ */ jsx("div", {
675
+ className: "er-payment-tile-detail",
676
+ children: tile.detail
677
+ })]
678
+ })
679
+ }, tile.mode);
680
+ })
681
+ });
682
+ }
683
+ function resolveTicketSelectionPricing(event) {
696
684
  return {
697
- countLabel: summaryCountLabel(wizard, summaryEvent),
698
- discount: input.discount && !productMethodFor(wizard) ? {
699
- label: input.discount.publicLabel,
700
- description: input.discount.description ?? null
701
- } : null,
702
- schedule: summaryEvent && several === null ? formatRegistrationSchedule(summaryEvent, wizard.occurrenceContext) : null
685
+ mode: event ? publicEventPricingStrategy(event.pricing) : void 0,
686
+ currency: event ? publicEventPricingCurrency(event.pricing) : null
703
687
  };
704
688
  }
705
- /** The panel's header already says when, so the panel hides the schedule. */
706
- function SummaryMeta({ facts }) {
707
- return /* @__PURE__ */ jsxs("span", {
708
- className: "er-summary-bar-meta",
709
- children: [
710
- facts.countLabel ? /* @__PURE__ */ jsx("span", {
711
- className: "er-summary-bar-count",
712
- children: facts.countLabel
713
- }) : null,
714
- facts.discount ? /* @__PURE__ */ jsx("span", {
715
- className: "er-summary-bar-discount",
716
- title: facts.discount.description ?? void 0,
717
- children: facts.discount.label
718
- }) : null,
719
- facts.schedule ? /* @__PURE__ */ jsx("span", {
720
- className: "er-summary-bar-schedule",
721
- children: facts.schedule
722
- }) : null
723
- ]
724
- });
689
+ /** Someone with an invitation is claiming a place, not joining the list. */
690
+ function waitlistIsOpenTo(source, invitation) {
691
+ return source && !invitation ? canJoinEventWaitlist(source) : false;
692
+ }
693
+ function getTicketSelectionCapacity(event, attendanceMode, display, invitation = null) {
694
+ const source = event ? selectEventCapacitySource(event, attendanceMode) : null;
695
+ const availability = source ? getEventAvailability(source) : null;
696
+ const canJoinWaitlist = waitlistIsOpenTo(source, invitation);
697
+ return {
698
+ availableSpots: availability?.available,
699
+ isSoldOut: availability?.isFull ?? false,
700
+ canJoinWaitlist,
701
+ eventAvailabilityLabel: !canJoinWaitlist && source ? placesLeftLabel(source, display) : null
702
+ };
725
703
  }
726
704
  /**
727
- * The date step's footer line (issue 1581): the chosen date and its price,
728
- * before any places are counted. Nothing until a date is chosen.
705
+ * One price: the visitor is choosing places, not ticket types (issue 1581).
706
+ * The ceiling comes from settled availability (`placeCountCeiling`); the
707
+ * page's cached count is only shown, never enforced.
729
708
  */
730
- function DateStepSummary({ event }) {
731
- if (!event) return null;
732
- const price = formatEventPriceDisplay(event.pricing).trim();
733
- return /* @__PURE__ */ jsxs("div", {
734
- className: "er-summary-bar",
735
- "data-step": "select-event",
736
- children: [/* @__PURE__ */ jsx("div", {
737
- className: "er-summary-bar-info",
738
- children: /* @__PURE__ */ jsx("span", {
739
- className: "er-summary-bar-meta",
740
- children: /* @__PURE__ */ jsx("span", {
741
- className: "er-summary-bar-schedule",
742
- children: formatRegistrationSchedule(event)
743
- })
744
- })
745
- }), price ? /* @__PURE__ */ jsx("div", {
746
- className: "er-summary-bar-pricing",
747
- children: /* @__PURE__ */ jsx("span", {
748
- className: "er-summary-bar-price",
749
- children: price
750
- })
751
- }) : null]
752
- });
709
+ function PlaceCounter(props) {
710
+ const spots = props.waitlist ? null : props.availableSpots;
711
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BookingQuantityPrompt, {
712
+ unit: "place",
713
+ waitlist: props.waitlist
714
+ }), /* @__PURE__ */ jsxs("div", {
715
+ className: "er-ticket-counter-group",
716
+ children: [/* @__PURE__ */ jsx(TicketCounter, {
717
+ ticketsCount: props.ticketsCount,
718
+ maxAllowed: props.ceiling,
719
+ label: bookingQuantityLabel("place", props.waitlist),
720
+ onTicketsChange: props.onTicketsChange
721
+ }), /* @__PURE__ */ jsx(TicketCounterLimit, {
722
+ maxAllowed: props.ceiling,
723
+ quantityLabel: props.waitlist ? bookingQuantityLabel("place", true) : pluralizeBookingUnit("place", props.ceiling),
724
+ availableSpots: spots,
725
+ availabilityLabel: props.availabilityLabel
726
+ })]
727
+ })] });
728
+ }
729
+ function SelectionNote({ text }) {
730
+ return text ? /* @__PURE__ */ jsx("p", {
731
+ className: "er-text er-text--muted",
732
+ children: text
733
+ }) : null;
753
734
  }
754
735
  /**
755
- * Booking several (issue 1725): how many are ticked and their total. With
756
- * combination prices the usual total is struck through above the planned
757
- * one, with the working underneath and the next saving under the bar.
736
+ * Ticket Selection Step
737
+ *
738
+ * Allows users to select how many tickets they want for the selected event.
739
+ * Respects both max tickets per registration and available spots.
740
+ *
741
+ * Can use either a full PublicEvent or just occurrence context (when on event page).
758
742
  */
759
- function SeveralStepSummary({ wizard }) {
760
- const several = wizard.severalItems;
761
- const first = wizard.selectedEvent;
762
- const { working, hint } = wizard.selectionCombination;
763
- if (several === null || !first) return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateStepSummary, { event: first }), /* @__PURE__ */ jsx(CombinationHint, { parts: hint })] });
764
- const currency = publicEventPricingCurrency(first.pricing);
765
- const { totalCents: total, listTotalCents: list } = wizard.selectionPrice;
766
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
767
- className: summaryBarClassName(working),
768
- "data-step": "select-event",
743
+ const TicketSelectionStep = ({ purpose, event, display, occurrenceContext: _occurrenceContext, selectedAttendanceMode = null, onAttendanceModeChange, ticketsCount, maxTickets, placesCeiling, visibleTicketTypes: visibleTicketTypesOverride, overallRemainingPlaces, heldPlacesBySelection, ticketSelections = [], onTicketSelectionsChange, slidingScale = null, selectedSlidingAmountInput = "", slidingScaleSelectionMessage = null, onSlidingAmountChange, onTicketsChange, bookingUnit = { kind: "ticket" }, selectionNote, invitation = null }) => {
744
+ const unit = bookingUnit.kind;
745
+ const deliveryMode = event?.deliveryMode ?? "in_person";
746
+ const attendanceModes = event?.attendanceModes ?? [];
747
+ const { availableSpots, isSoldOut, canJoinWaitlist, eventAvailabilityLabel } = getTicketSelectionCapacity(event, selectedAttendanceMode, display, invitation);
748
+ const { mode: eventPricingMode, currency: eventPricingCurrency } = resolveTicketSelectionPricing(event);
749
+ const usesTicketTypes = eventPricingMode === "tiered";
750
+ const visibleTicketTypes = usesTicketTypes ? visibleTicketTypesOverride ?? getVisibleTicketTypes({
751
+ event,
752
+ eligibility: null,
753
+ selectedAttendanceMode,
754
+ ticketSelections
755
+ }) : [];
756
+ const noVisibleTicketTypes = usesTicketTypes && visibleTicketTypes.length === 0;
757
+ const hasAvailableTicketTypes = usesTicketTypes && visibleTicketTypes.some((ticketType) => canRequestTicketOption(ticketType.availability, purpose));
758
+ const maxAllowed = maxTickets;
759
+ if (deliveryMode === "hybrid" && !selectedAttendanceMode) return /* @__PURE__ */ jsxs("div", {
760
+ className: "rb-reg-stack er-stack",
769
761
  children: [
770
- /* @__PURE__ */ jsx("div", {
771
- className: "er-summary-bar-info",
772
- children: /* @__PURE__ */ jsx("span", {
773
- className: "er-summary-bar-meta",
774
- children: /* @__PURE__ */ jsx("span", {
775
- className: "er-summary-bar-count",
776
- children: selectionItemsLabel(several, wizard.selection)
777
- })
778
- })
762
+ /* @__PURE__ */ jsx("h3", {
763
+ tabIndex: -1,
764
+ className: "er-title",
765
+ children: "How will you attend?"
779
766
  }),
780
- currency && total !== null && total > 0 ? working && list !== null ? /* @__PURE__ */ jsx(CombinationPricing, {
781
- listCents: list,
782
- totalCents: total,
783
- currency
784
- }) : /* @__PURE__ */ jsx("div", {
785
- className: "er-summary-bar-pricing",
786
- children: /* @__PURE__ */ jsx("span", {
787
- className: "er-summary-bar-price",
788
- children: formatPrice(total, currency)
767
+ /* @__PURE__ */ jsx(AttendanceModeTiles, {
768
+ tiles: eventAttendanceModeTiles(attendanceModes, display),
769
+ selectedAttendanceMode: null,
770
+ onAttendanceModeChange
771
+ }),
772
+ /* @__PURE__ */ jsx("p", {
773
+ className: "er-text er-text--muted",
774
+ children: "Choose whether you want to attend in person or online."
775
+ })
776
+ ]
777
+ });
778
+ if (!eventPricingCurrency) return /* @__PURE__ */ jsx("div", {
779
+ className: "rb-reg-stack er-stack",
780
+ children: /* @__PURE__ */ jsx("p", {
781
+ className: "er-text er-text--muted",
782
+ children: "Pricing is unavailable for this event right now."
783
+ })
784
+ });
785
+ return /* @__PURE__ */ jsxs("div", {
786
+ className: "rb-reg-stack er-stack",
787
+ children: [
788
+ deliveryMode === "hybrid" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h3", {
789
+ tabIndex: -1,
790
+ className: "er-title",
791
+ children: "How will you attend?"
792
+ }), /* @__PURE__ */ jsx(AttendanceModeTiles, {
793
+ tiles: eventAttendanceModeTiles(attendanceModes, display),
794
+ selectedAttendanceMode,
795
+ onAttendanceModeChange
796
+ })] }) : null,
797
+ usesTicketTypes ? /* @__PURE__ */ jsx(Fragment, { children: noVisibleTicketTypes ? /* @__PURE__ */ jsx("p", {
798
+ className: "er-text er-text--muted",
799
+ children: "No ticket types are currently available."
800
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [
801
+ /* @__PURE__ */ jsxs("h3", {
802
+ tabIndex: -1,
803
+ className: "er-title",
804
+ children: ["Choose ", unit === "place" ? "your places" : "tickets"]
805
+ }),
806
+ /* @__PURE__ */ jsx(BookingUnitSessionHint, { bookingUnit }),
807
+ /* @__PURE__ */ jsx(TicketTypeQuantityRows, {
808
+ purpose,
809
+ display,
810
+ ticketTypes: visibleTicketTypes,
811
+ ticketSelections,
812
+ maxTickets,
813
+ heldPlacesBySelection,
814
+ availableSpots: resolveRemainingPlacesOverride(overallRemainingPlaces, availableSpots),
815
+ availabilityLabel: eventAvailabilityLabel,
816
+ currency: eventPricingCurrency,
817
+ hasAvailableTicketTypes,
818
+ onTicketSelectionsChange,
819
+ bookingUnit: unit
789
820
  })
790
- }) : null,
791
- /* @__PURE__ */ jsx(CombinationDetail, { working })
821
+ ] }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
822
+ slidingScale ? /* @__PURE__ */ jsx(SlidingScaleAmountField, {
823
+ slidingScale,
824
+ currency: eventPricingCurrency,
825
+ value: selectedSlidingAmountInput,
826
+ message: slidingScaleSelectionMessage,
827
+ onChange: onSlidingAmountChange
828
+ }) : null,
829
+ /* @__PURE__ */ jsx(BookingUnitSessionHint, { bookingUnit }),
830
+ /* @__PURE__ */ jsx(PlaceCounter, {
831
+ ticketsCount,
832
+ ceiling: placesCeiling ?? maxAllowed,
833
+ availableSpots,
834
+ availabilityLabel: eventAvailabilityLabel,
835
+ waitlist: canJoinWaitlist,
836
+ onTicketsChange
837
+ })
838
+ ] }),
839
+ /* @__PURE__ */ jsx(SelectionNote, { text: selectionNote }),
840
+ /* @__PURE__ */ jsx(PlacesNote, {
841
+ invitation,
842
+ isSoldOut,
843
+ canJoinWaitlist,
844
+ event,
845
+ someTicketsFull: someTicketsAtOwnLimit(visibleTicketTypes, purpose)
846
+ })
792
847
  ]
793
- }), /* @__PURE__ */ jsx(CombinationHint, { parts: hint })] });
848
+ });
849
+ };
850
+ /** Some ticket types are full by their own limit while another can still be chosen. */
851
+ function someTicketsAtOwnLimit(ticketTypes, purpose) {
852
+ return ticketTypes.some((ticketType) => canRequestTicketOption(ticketType.availability, purpose)) && ticketTypes.some((ticketType) => ticketType.availability.kind === "unavailable" && ticketType.availability.reason === "sold_out");
794
853
  }
795
- /**
796
- * The later steps' price for several items with combination prices: the
797
- * usual total struck through, then what's due. The working shows while the
798
- * planner's total stands; once the server prices a code, its total alone.
799
- */
800
- function combinationSummary(wizard, subtotalCents) {
801
- if (wizard.severalItems === null) return null;
802
- const list = wizard.selectionPrice.listTotalCents;
803
- const working = wizard.selectionCombination.working;
804
- if (list === null || list <= subtotalCents || working === null && wizard.combinationCodeField === null) return null;
805
- return {
806
- list,
807
- working: subtotalCents === wizard.selectionPrice.totalCents ? working : null
808
- };
854
+ function PlacesNote({ invitation, isSoldOut, canJoinWaitlist, event, someTicketsFull }) {
855
+ if (invitation?.kind === "held") return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("p", {
856
+ className: "er-text",
857
+ children: heldPlaceText(invitation.places, invitation.expiresAt, event)
858
+ }), invitation.ticketChoice && someTicketsFull ? /* @__PURE__ */ jsx("p", {
859
+ className: "er-text er-text--muted",
860
+ children: "If the ticket you were waiting for is sold out, you can choose another one for your place."
861
+ }) : null] });
862
+ if (invitation) return null;
863
+ if (canJoinWaitlist) return /* @__PURE__ */ jsx("p", {
864
+ className: "er-text er-text--muted",
865
+ children: "This event is currently full. Continue to join the waitlist if a place opens up."
866
+ });
867
+ return isSoldOut ? /* @__PURE__ */ jsx("p", {
868
+ className: "er-text er-text--muted",
869
+ children: "This event is fully booked."
870
+ }) : null;
809
871
  }
810
- /** A deposit or instalment plan: the total, what's payable now, and what's left. */
811
- function FlexibleBalancePricing(props) {
812
- const { summary } = props;
813
- return /* @__PURE__ */ jsxs(Fragment, { children: [
814
- summary.total ? /* @__PURE__ */ jsxs("div", {
815
- className: "er-summary-bar-product-detail",
816
- children: ["Total: ", summary.total]
817
- }) : null,
818
- /* @__PURE__ */ jsx("div", {
819
- className: "er-summary-bar-price",
820
- children: summary.dueToday ?? props.fallbackDueToday
821
- }),
822
- /* @__PURE__ */ jsx("div", {
823
- className: "er-summary-bar-included",
824
- children: "Payable now"
825
- }),
826
- summary.remainingBalance ? /* @__PURE__ */ jsxs("div", {
827
- className: "er-summary-bar-product-detail",
828
- children: [
829
- "Remaining balance: ",
830
- summary.remainingBalance,
831
- summary.balanceDueBy ? ` due by ${summary.balanceDueBy}` : ""
832
- ]
833
- }) : null,
834
- summary.depositPolicy ? /* @__PURE__ */ jsxs("div", {
835
- className: "er-summary-bar-product-detail",
836
- children: ["Deposit: ", summary.depositPolicy]
837
- }) : null
838
- ] });
872
+ /** How long the invitation holds their place, in the event's own time zone. */
873
+ function heldPlaceText(places, expiresAt, event) {
874
+ const held = places === 1 ? "We’re holding a place for you" : `We’re holding ${places} places for you`;
875
+ return event ? `${held} until ${formatTime(expiresAt, event)} on ${formatDate(expiresAt, event)}. Continue to book before then.` : `${held}. Continue to book.`;
839
876
  }
840
- function summaryBarClassName(working) {
841
- return working ? "er-summary-bar er-summary-bar--combination" : "er-summary-bar";
877
+ function resolveRemainingPlacesOverride(override, cached) {
878
+ return override === void 0 ? cached : override;
842
879
  }
843
- function EventRegistrationSummaryBar(props) {
844
- const { wizard } = props;
845
- if (wizard.step === "select-event") return /* @__PURE__ */ jsx(SeveralStepSummary, { wizard });
846
- const summaryEvent = wizard.selectedEvent ?? wizard.preSelectedEvent;
847
- const summaryTitle = registrationSummaryTitle({
848
- ...wizard,
849
- eventTitle: summaryEvent?.title
850
- });
851
- const summaryCurrency = summaryEvent ? publicEventPricingCurrency(summaryEvent.pricing) : null;
852
- const teamMemberNames = (summaryEvent?.teamMembers ?? []).map((teamMember) => teamMember.name).filter(Boolean);
853
- const subtotalCents = wizard.ticketSelectionSubtotalCents;
854
- if (!summaryTitle || !summaryCurrency || subtotalCents === null) return null;
855
- const autoAppliedDiscount = wizard.autoAppliedDiscount;
856
- const autoAppliedDiscountCents = Math.max(0, autoAppliedDiscount?.computedAmountCents ?? 0);
857
- const discountedTotalCents = Math.max(0, subtotalCents - autoAppliedDiscountCents);
858
- const flexibleBalanceSummary = getFlexibleBalanceSummary(getSelectedDirectPaymentOption(wizard));
859
- const meta = summaryMetaFacts({
860
- wizard,
861
- summaryEvent,
862
- discount: autoAppliedDiscountCents > 0 ? autoAppliedDiscount : null
863
- });
864
- const productMethod = isProductMethod(wizard.paymentSelection.method);
865
- const entitlementCopy = resolveEntitlementSummaryCopy(wizard.paymentSelection.method, getSelectedPassCreditsRemaining(wizard));
866
- const combination = combinationSummary(wizard, subtotalCents);
867
- const working = combination?.working ?? null;
868
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PaymentProductRow, {
869
- wizard,
870
- copy: entitlementCopy
871
- }), /* @__PURE__ */ jsxs("div", {
872
- className: summaryBarClassName(working),
873
- "data-step": wizard.step,
874
- children: [
875
- /* @__PURE__ */ jsxs("div", {
876
- className: "er-summary-bar-info",
877
- children: [
878
- /* @__PURE__ */ jsx("h4", {
879
- className: "er-summary-bar-event",
880
- children: summaryTitle
881
- }),
882
- /* @__PURE__ */ jsx(SummaryMeta, { facts: meta }),
883
- teamMemberNames.length > 0 && /* @__PURE__ */ jsxs("div", {
884
- className: "er-summary-bar-meta",
885
- children: ["With ", teamMemberNames.join(", ")]
886
- })
887
- ]
888
- }),
889
- combination && subtotalCents > 0 ? /* @__PURE__ */ jsx(CombinationPricing, {
890
- listCents: combination.list,
891
- totalCents: subtotalCents,
892
- currency: summaryCurrency
893
- }) : subtotalCents > 0 && /* @__PURE__ */ jsx("div", {
894
- className: "er-summary-bar-pricing",
895
- children: productMethod ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
896
- className: "er-summary-bar-price er-summary-bar-price--struck",
897
- children: formatPrice(subtotalCents, summaryCurrency)
898
- }), /* @__PURE__ */ jsx("div", {
899
- className: "er-summary-bar-included",
900
- children: entitlementCopy.pricingNote
901
- })] }) : flexibleBalanceSummary ? /* @__PURE__ */ jsx(FlexibleBalancePricing, {
902
- summary: flexibleBalanceSummary,
903
- fallbackDueToday: formatPrice(discountedTotalCents, summaryCurrency)
904
- }) : autoAppliedDiscount && autoAppliedDiscountCents > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
905
- /* @__PURE__ */ jsx("span", {
906
- className: "er-summary-bar-price er-summary-bar-price--struck",
907
- children: formatPrice(subtotalCents, summaryCurrency)
908
- }),
909
- /* @__PURE__ */ jsx("span", {
910
- className: "er-summary-bar-price",
911
- children: formatPrice(discountedTotalCents, summaryCurrency)
912
- }),
913
- autoAppliedDiscount.description ? /* @__PURE__ */ jsx("div", {
914
- className: "er-summary-bar-product-detail er-summary-bar-discount-detail",
915
- children: autoAppliedDiscount.description
916
- }) : null
917
- ] }) : /* @__PURE__ */ jsx("span", {
918
- className: "er-summary-bar-price",
919
- children: formatPrice(subtotalCents, summaryCurrency)
880
+ //#endregion
881
+ //#region ../blocks/src/system/runtime/nodes/event-registration/RoomChooser.tsx
882
+ function currencyOf(wizard) {
883
+ return wizard.eligibility?.currency ?? (wizard.selectedEvent && publicEventPricingCurrency(wizard.selectedEvent.pricing)) ?? "GBP";
884
+ }
885
+ function RoomPhotos(props) {
886
+ const { kind } = props;
887
+ const titleId = useId();
888
+ const [index, setIndex] = useState(0);
889
+ const photo = kind.photos[index];
890
+ const several = kind.photos.length > 1;
891
+ return /* @__PURE__ */ jsxs(ModalShell, {
892
+ title: kind.name,
893
+ titleId,
894
+ onClose: props.onClose,
895
+ overlayClassName: "er-room-photos-overlay",
896
+ modalClassName: "er-room-photos",
897
+ headerClassName: "er-room-photos-head",
898
+ titleClassName: "er-title",
899
+ closeButtonClassName: "er-room-photos-close",
900
+ children: [photo ? /* @__PURE__ */ jsx("img", {
901
+ src: photo.src,
902
+ alt: photo.alt,
903
+ className: "er-room-photos-image"
904
+ }) : null, several ? /* @__PURE__ */ jsxs("div", {
905
+ className: "er-room-photos-nav",
906
+ children: [
907
+ /* @__PURE__ */ jsx("button", {
908
+ type: "button",
909
+ className: "er-back-btn",
910
+ disabled: index === 0,
911
+ onClick: () => setIndex(index - 1),
912
+ children: "Previous photo"
913
+ }),
914
+ /* @__PURE__ */ jsxs("span", {
915
+ className: "er-text er-text--muted",
916
+ children: [
917
+ index + 1,
918
+ " of ",
919
+ kind.photos.length
920
+ ]
921
+ }),
922
+ /* @__PURE__ */ jsx("button", {
923
+ type: "button",
924
+ className: "er-back-btn",
925
+ disabled: index === kind.photos.length - 1,
926
+ onClick: () => setIndex(index + 1),
927
+ children: "Next photo"
920
928
  })
929
+ ]
930
+ }) : null]
931
+ });
932
+ }
933
+ function photoLabel(kind) {
934
+ return `${kind.name}, ${kind.photos.length} ${kind.photos.length === 1 ? "photo" : "photos"}. Tap to see them.`;
935
+ }
936
+ /** The one row every place on this step uses: what it is, its price, then how many. */
937
+ function RoomRow(props) {
938
+ return /* @__PURE__ */ jsxs("div", {
939
+ className: [
940
+ "er-room-option",
941
+ props.disabled ? "er-ticket-line--disabled" : null,
942
+ props.gone ? "er-room-option--gone" : null
943
+ ].filter(Boolean).join(" "),
944
+ "data-chosen": props.chosen ? "" : void 0,
945
+ role: "listitem",
946
+ children: [
947
+ /* @__PURE__ */ jsxs("div", {
948
+ className: "er-room-option-text",
949
+ children: [/* @__PURE__ */ jsx("span", {
950
+ className: "er-ticket-line-name",
951
+ children: props.title
952
+ }), props.details.map((detail) => detail ? /* @__PURE__ */ jsx("p", {
953
+ className: "er-ticket-line-detail",
954
+ children: detail
955
+ }, detail) : null)]
921
956
  }),
922
- /* @__PURE__ */ jsx(CombinationDetail, { working })
957
+ /* @__PURE__ */ jsx("span", {
958
+ className: "er-ticket-line-price er-room-option-price",
959
+ children: props.price
960
+ }),
961
+ props.control
923
962
  ]
924
- })] });
925
- }
926
- //#endregion
927
- //#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardActions.tsx
928
- /**
929
- * Label for the button that submits the details step.
930
- *
931
- * When a pass covers the booking there is no payment step to follow, so this
932
- * button is the last thing read before a credit is spent — it names the pass
933
- * rather than leaving that to the summary above it.
934
- */
935
- function resolveDetailsButtonText(input) {
936
- const { wizard } = input;
937
- const admission = wizard.admission;
938
- switch (admission.kind) {
939
- case "checking": return "Checking availability…";
940
- case "closed": return closedLabel(admission.reason);
941
- case "fullyBooked": return fullyBookedLabel(admission);
942
- case "waitlist": return "Join waitlist";
943
- case "open":
944
- case "resume": break;
945
- }
946
- if (wizard.paymentSelection.method === "pass") return "Book using class pass";
947
- if (wizard.paymentSelection.method === "membership") return input.fallbackText;
948
- return wizard.eventRequiresPayment ? "Continue to payment" : input.fallbackText;
963
+ });
949
964
  }
950
- /**
951
- * The date step's footer (issue 1581): Continue moves on once a date is
952
- * chosen. Unrelated events still move on when picked, so there's nothing here.
953
- */
954
- function SelectDateActions(props) {
955
- const { wizard } = props;
956
- const several = wizard.selectionMode.kind === "several";
957
- if (!several && getEventSelectionMode(wizard.scopedEvents) !== "date") return null;
958
- const chosen = wizard.selectedEvent;
959
- return /* @__PURE__ */ jsx("div", {
960
- className: "rb-wizard-actions er-actions",
961
- children: /* @__PURE__ */ jsx(ThemedButton, {
965
+ function RoomOptionRow(props) {
966
+ const { option } = props;
967
+ const price = `${formatPrice(option.priceCents, props.currency)}${option.each ? " each" : ""}`;
968
+ if (option.gone) return /* @__PURE__ */ jsx(RoomRow, {
969
+ gone: true,
970
+ chosen: false,
971
+ title: option.title,
972
+ details: ["Someone else has just booked this."],
973
+ price,
974
+ control: /* @__PURE__ */ jsx("button", {
962
975
  type: "button",
963
- onClick: several ? wizard.handleSelectionContinue : () => {
964
- if (chosen) wizard.handleEventSelect(chosen);
965
- },
966
- disabled: several ? wizard.selection.length === 0 : !chosen,
967
- variant: props.buttonVariant,
968
- size: "md",
969
- label: "Continue"
976
+ className: "er-back-btn er-room-take-off",
977
+ "aria-label": `Take off ${props.kindName}, ${option.title}`,
978
+ onClick: () => props.onChange(0),
979
+ children: "Take off"
980
+ })
981
+ });
982
+ return /* @__PURE__ */ jsx(RoomRow, {
983
+ chosen: option.people > 0,
984
+ title: option.title,
985
+ details: [option.detail, props.display.placesLeft === "shown" ? option.placesLeft : null],
986
+ price,
987
+ control: /* @__PURE__ */ jsx(TicketCounter, {
988
+ ticketsCount: option.people,
989
+ minAllowed: 0,
990
+ maxAllowed: option.maxPeople,
991
+ label: `${props.kindName}, ${option.title}`,
992
+ onTicketsChange: props.onChange
970
993
  })
971
994
  });
972
995
  }
973
- function SelectTicketsActions(props) {
974
- const { wizard } = props;
975
- const { label: continueLabel, pending: registrationOptionsPending } = wizard.ticketContinuation;
976
- const isContinueDisabled = wizard.ticketContinuation.kind === "blocked";
977
- return /* @__PURE__ */ jsxs("div", {
978
- className: "rb-wizard-actions er-actions",
979
- children: [!wizard.hasPreSelectedContext && /* @__PURE__ */ jsx("button", {
980
- type: "button",
981
- onClick: () => wizard.setStep("select-event"),
982
- className: "er-back-btn",
983
- children: "← Back"
984
- }), /* @__PURE__ */ jsx(ThemedButton, {
985
- type: "button",
986
- onClick: wizard.handleTicketsComplete,
987
- disabled: isContinueDisabled,
988
- variant: props.buttonVariant,
989
- size: "md",
990
- label: continueLabel,
991
- pending: registrationOptionsPending ? {
992
- label: continueLabel,
993
- spinnerSize: "xs",
994
- spinnerClassName: "er-button-spinner",
995
- contentClassName: "er-button-with-spinner"
996
- } : void 0
997
- })]
996
+ function RoomKindGroup(props) {
997
+ const { kind, chooser } = props;
998
+ const [viewing, setViewing] = useState(false);
999
+ const firstPhoto = kind.photos[0];
1000
+ return /* @__PURE__ */ jsxs("section", {
1001
+ className: "er-room-kind",
1002
+ "aria-label": kind.name,
1003
+ "data-fully-booked": kind.fullyBooked ? "" : void 0,
1004
+ children: [
1005
+ /* @__PURE__ */ jsxs("div", {
1006
+ className: "er-room-kind-head",
1007
+ children: [firstPhoto ? /* @__PURE__ */ jsx("button", {
1008
+ type: "button",
1009
+ className: "er-room-photo",
1010
+ onClick: () => setViewing(true),
1011
+ children: /* @__PURE__ */ jsx("img", {
1012
+ src: firstPhoto.src,
1013
+ alt: photoLabel(kind)
1014
+ })
1015
+ }) : null, /* @__PURE__ */ jsxs("div", {
1016
+ className: "er-room-kind-text",
1017
+ children: [/* @__PURE__ */ jsxs("div", {
1018
+ className: "er-room-kind-title",
1019
+ children: [/* @__PURE__ */ jsx("h4", {
1020
+ className: "er-room-kind-name",
1021
+ children: kind.name
1022
+ }), kind.fullyBooked ? /* @__PURE__ */ jsx("span", {
1023
+ className: "er-room-kind-full",
1024
+ children: "Fully booked"
1025
+ }) : null]
1026
+ }), kind.description ? /* @__PURE__ */ jsx("p", {
1027
+ className: "er-text er-text--muted",
1028
+ children: kind.description
1029
+ }) : null]
1030
+ })]
1031
+ }),
1032
+ kind.options.length > 0 ? /* @__PURE__ */ jsx("div", {
1033
+ role: "list",
1034
+ children: kind.options.map((option) => /* @__PURE__ */ jsx(RoomOptionRow, {
1035
+ kindName: kind.name,
1036
+ option,
1037
+ currency: props.currency,
1038
+ display: props.display,
1039
+ onChange: (people) => chooser.setRoomChoices(setRoomChoicePeople(chooser.choices, option.choice, people))
1040
+ }, option.key))
1041
+ }) : null,
1042
+ viewing ? /* @__PURE__ */ jsx(RoomPhotos, {
1043
+ kind,
1044
+ onClose: () => setViewing(false)
1045
+ }) : null
1046
+ ]
998
1047
  });
999
1048
  }
1000
- function EnterDetailsActions(props) {
1001
- const { wizard } = props;
1002
- const isContinueDisabled = resolveRegistrationAvailabilityBlocker(wizard.admission) !== null;
1003
- const continueLabel = resolveDetailsButtonText({
1004
- wizard,
1005
- fallbackText: props.buttonText
1049
+ function DayPlaceRow(props) {
1050
+ const { ticketType, wizard } = props;
1051
+ const { quantity, maxAllowed, disabled, detail, setQuantity } = ticketTypeQuantity({
1052
+ display: props.display,
1053
+ purpose: wizard.ticketSelectionPurpose,
1054
+ ticketType,
1055
+ ticketSelections: wizard.selectedTicketLines,
1056
+ maxTickets: wizard.maxTicketsNum,
1057
+ availableSpots: null,
1058
+ currency: props.currency,
1059
+ onTicketSelectionsChange: props.chooser.setDayLines
1060
+ });
1061
+ return /* @__PURE__ */ jsx(RoomRow, {
1062
+ chosen: quantity > 0,
1063
+ disabled,
1064
+ title: ticketType.name,
1065
+ details: [ticketType.description ?? null, detail],
1066
+ price: ticketTypePriceText(ticketType, props.currency),
1067
+ control: /* @__PURE__ */ jsx(TicketCounter, {
1068
+ ticketsCount: quantity,
1069
+ minAllowed: 0,
1070
+ maxAllowed,
1071
+ label: ticketType.name,
1072
+ onTicketsChange: setQuantity
1073
+ })
1006
1074
  });
1007
- return /* @__PURE__ */ jsxs("div", {
1008
- className: "rb-wizard-actions er-actions",
1009
- children: [/* @__PURE__ */ jsx("button", {
1010
- type: "button",
1011
- onClick: () => wizard.setStep("select-tickets"),
1012
- className: "er-back-btn",
1013
- children: "← Back"
1014
- }), /* @__PURE__ */ jsx(ThemedButton, {
1015
- type: "button",
1016
- onClick: wizard.handleDetailsComplete,
1017
- disabled: isContinueDisabled,
1018
- variant: props.buttonVariant,
1019
- size: "md",
1020
- label: continueLabel
1075
+ }
1076
+ function PlacesWithoutARoom(props) {
1077
+ const { chooser } = props;
1078
+ if (chooser.dayOptions.length === 0) return null;
1079
+ return /* @__PURE__ */ jsxs("section", {
1080
+ className: "er-room-kind",
1081
+ "aria-label": "Places without a room",
1082
+ children: [/* @__PURE__ */ jsx("h4", {
1083
+ className: "er-room-kind-name",
1084
+ children: "Places without a room"
1085
+ }), /* @__PURE__ */ jsx("div", {
1086
+ role: "list",
1087
+ children: chooser.dayOptions.map((ticketType) => /* @__PURE__ */ jsx(DayPlaceRow, {
1088
+ ticketType,
1089
+ wizard: props.wizard,
1090
+ chooser,
1091
+ display: props.display,
1092
+ currency: props.currency
1093
+ }, ticketType.pricingOptionId))
1021
1094
  })]
1022
1095
  });
1023
1096
  }
1024
- function SelectPaymentActions(props) {
1025
- const { wizard } = props;
1026
- const { status, canContinue, buttonText } = wizard.paymentStepState;
1027
- return /* @__PURE__ */ jsxs(Fragment, { children: [status === "ready" && wizard.paymentHeldForCode ? /* @__PURE__ */ jsx("p", {
1028
- className: "er-discount__hint",
1029
- children: "Press Apply to use your discount code, or remove it to carry on without it."
1097
+ /** Everywhere to sleep, the places that don't need a room, and how that adds up. */
1098
+ function RoomChooser(props) {
1099
+ const { wizard, chooser, display } = props;
1100
+ const { view } = chooser;
1101
+ const currency = currencyOf(wizard);
1102
+ return /* @__PURE__ */ jsxs("div", {
1103
+ className: "er-room-chooser",
1104
+ children: [
1105
+ /* @__PURE__ */ jsxs("div", {
1106
+ className: "er-room-chooser-intro",
1107
+ children: [/* @__PURE__ */ jsx("h3", {
1108
+ tabIndex: -1,
1109
+ className: "er-title",
1110
+ children: "Where would you like to sleep?"
1111
+ }), /* @__PURE__ */ jsx("p", {
1112
+ className: "er-text er-text--muted",
1113
+ children: view.intro
1114
+ })]
1115
+ }),
1116
+ view.kinds.map((kind) => /* @__PURE__ */ jsx(RoomKindGroup, {
1117
+ kind,
1118
+ currency,
1119
+ display,
1120
+ chooser
1121
+ }, kind.kindId)),
1122
+ /* @__PURE__ */ jsx(PlacesWithoutARoom, {
1123
+ wizard,
1124
+ chooser,
1125
+ display,
1126
+ currency
1127
+ }),
1128
+ /* @__PURE__ */ jsxs("div", {
1129
+ className: "er-room-chooser-stay",
1130
+ "aria-live": "polite",
1131
+ children: [
1132
+ view.stayLines.length > 0 ? /* @__PURE__ */ jsxs("div", {
1133
+ className: "er-ticket-line-summary",
1134
+ children: [/* @__PURE__ */ jsx("p", {
1135
+ className: "er-ticket-line-summary-title",
1136
+ children: "How you'll stay"
1137
+ }), /* @__PURE__ */ jsx("ul", {
1138
+ className: "er-ticket-line-summary-list",
1139
+ children: view.stayLines.map((line) => /* @__PURE__ */ jsxs("li", { children: [line, "."] }, line))
1140
+ })]
1141
+ }) : null,
1142
+ view.priceNote ? /* @__PURE__ */ jsx("p", {
1143
+ className: "er-text er-text--muted er-room-price-note-beside-stay",
1144
+ children: view.priceNote
1145
+ }) : null,
1146
+ view.note ? /* @__PURE__ */ jsx("div", {
1147
+ className: "er-notice er-notice--info",
1148
+ role: "status",
1149
+ children: /* @__PURE__ */ jsx("p", { children: view.note })
1150
+ }) : null
1151
+ ]
1152
+ })
1153
+ ]
1154
+ });
1155
+ }
1156
+ /**
1157
+ * The footer's summary: anything stopping the booking sits directly above the
1158
+ * total, where it stays in view in the sticky bar on a phone.
1159
+ */
1160
+ function RoomChooserSummary(props) {
1161
+ const { view } = props;
1162
+ const { takeOff } = view;
1163
+ return /* @__PURE__ */ jsxs(Fragment, { children: [view.notice ? /* @__PURE__ */ jsxs("div", {
1164
+ className: "er-notice er-notice--info er-room-notice",
1165
+ role: "alert",
1166
+ children: [
1167
+ /* @__PURE__ */ jsx("p", { children: view.notice }),
1168
+ view.noticeStay.length > 0 ? /* @__PURE__ */ jsx("ul", {
1169
+ className: "er-room-notice-stay",
1170
+ children: view.noticeStay.map((line) => /* @__PURE__ */ jsxs("li", { children: [line, "."] }, line))
1171
+ }) : null,
1172
+ takeOff ? /* @__PURE__ */ jsx("button", {
1173
+ type: "button",
1174
+ className: "er-back-btn er-room-take-off",
1175
+ onClick: () => props.wizard.roomChooser?.setRoomChoices(takeOff.choices),
1176
+ children: takeOff.label
1177
+ }) : null
1178
+ ]
1030
1179
  }) : null, /* @__PURE__ */ jsxs("div", {
1031
- className: "rb-wizard-actions er-actions",
1032
- children: [/* @__PURE__ */ jsx("button", {
1033
- type: "button",
1034
- onClick: () => wizard.setStep("enter-details"),
1035
- className: "er-back-btn",
1036
- children: "← Back"
1037
- }), status === "ready" && /* @__PURE__ */ jsx(ThemedButton, {
1038
- type: "button",
1039
- onClick: () => void wizard.handlePaymentSelect(),
1040
- disabled: !canContinue,
1041
- variant: props.buttonVariant,
1042
- size: "md",
1043
- label: buttonText
1180
+ className: "er-summary-bar er-room-summary",
1181
+ children: [/* @__PURE__ */ jsx("div", {
1182
+ className: "er-summary-bar-info",
1183
+ children: view.people === 0 ? /* @__PURE__ */ jsx("span", {
1184
+ className: "er-summary-bar-meta",
1185
+ children: ADD_A_PLACE
1186
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1187
+ /* @__PURE__ */ jsxs("span", {
1188
+ className: "er-summary-bar-meta",
1189
+ children: [
1190
+ view.people,
1191
+ " ",
1192
+ view.people === 1 ? "person" : "people"
1193
+ ]
1194
+ }),
1195
+ view.splitWarning ? /* @__PURE__ */ jsx("span", {
1196
+ className: "er-room-split-warning",
1197
+ children: view.splitWarning
1198
+ }) : null,
1199
+ view.totalNote ? /* @__PURE__ */ jsx("span", {
1200
+ className: "er-text er-text--muted",
1201
+ children: view.totalNote
1202
+ }) : null,
1203
+ view.priceNote ? /* @__PURE__ */ jsx("span", {
1204
+ className: "er-text er-text--muted er-room-price-note-in-bar",
1205
+ children: view.priceNote
1206
+ }) : null
1207
+ ] })
1208
+ }), view.totalCents === null ? null : /* @__PURE__ */ jsx("span", {
1209
+ className: "er-summary-bar-price",
1210
+ children: formatPrice(view.totalCents, currencyOf(props.wizard))
1044
1211
  })]
1045
1212
  })] });
1046
1213
  }
1047
- /** Stripe owns the Pay button, so the payment footer offers only the way back. */
1048
- function PaymentActions(props) {
1049
- return /* @__PURE__ */ jsx("div", {
1050
- className: "rb-wizard-actions rb-wizard-actions--back-only er-actions",
1051
- children: /* @__PURE__ */ jsx("button", {
1214
+ //#endregion
1215
+ //#region ../blocks/src/system/runtime/nodes/event-registration/ErrorStep.tsx
1216
+ /**
1217
+ * Error Step
1218
+ *
1219
+ * Displays an error message with a retry button when registration fails.
1220
+ */
1221
+ const labels = {
1222
+ none: "",
1223
+ retry: "Try again",
1224
+ places: "Choose places",
1225
+ start: "Start again",
1226
+ details: "Check my details",
1227
+ "payment-options": "View payment options",
1228
+ portal: "View my bookings",
1229
+ event: "View event"
1230
+ };
1231
+ const ErrorStep = ({ message, onRetry, action = "retry", canJoinWaitlist = false }) => {
1232
+ const offerWaitlist = action === "places" && canJoinWaitlist;
1233
+ return /* @__PURE__ */ jsx(TerminalPanel, {
1234
+ tone: "error",
1235
+ className: "er-center",
1236
+ titleClassName: "er-title--lg er-message",
1237
+ icon: /* @__PURE__ */ jsx(StateIcon, {
1238
+ variant: "error",
1239
+ children: /* @__PURE__ */ jsx(CrossIcon, {})
1240
+ }),
1241
+ title: "We couldn’t complete your booking",
1242
+ body: /* @__PURE__ */ jsx("p", {
1243
+ className: "er-text--muted er-message",
1244
+ children: offerWaitlist ? "Sorry, this event is now full. You can join the waiting list, and we’ll email you if a place becomes available." : message
1245
+ }),
1246
+ actions: action === "none" ? void 0 : action === "portal" ? /* @__PURE__ */ jsx("a", {
1247
+ href: portalPath({ page: "bookings" }),
1248
+ className: "er-retry-btn",
1249
+ children: labels[action]
1250
+ }) : /* @__PURE__ */ jsx("button", {
1052
1251
  type: "button",
1053
- onClick: props.wizard.paymentController.check,
1054
- className: "er-back-btn",
1055
- children: "← Back"
1252
+ onClick: onRetry,
1253
+ className: "er-retry-btn",
1254
+ children: offerWaitlist ? "Join the waiting list" : labels[action]
1056
1255
  })
1057
1256
  });
1257
+ };
1258
+ //#endregion
1259
+ //#region ../blocks/src/system/runtime/nodes/event-registration/CopyParts.tsx
1260
+ /** Copy with its bold parts in <strong>: offer lines and hints (issue 1725). */
1261
+ function CopyParts(props) {
1262
+ return /* @__PURE__ */ jsx(Fragment, { children: props.parts.map((part, index) => part.strong ? /* @__PURE__ */ jsx("strong", { children: part.text }, index) : /* @__PURE__ */ jsx(React.Fragment, { children: part.text }, index)) });
1058
1263
  }
1059
- function closedLabel(reason) {
1060
- switch (reason) {
1061
- case "alreadyWaitlisted": return "Already on waitlist";
1062
- case "optionsUnavailable": return "Availability unavailable";
1063
- case "unavailable": return "Registration unavailable";
1064
- }
1065
- }
1066
- function EventRegistrationWizardActions(props) {
1067
- const { wizard } = props;
1068
- switch (wizard.step) {
1069
- case "error":
1070
- case "success":
1071
- case "submitting":
1072
- case "verifying-payment":
1073
- case "verifying-timeout":
1074
- case "payment-status":
1075
- case "payment-failed": return null;
1076
- case "select-event": return /* @__PURE__ */ jsx(SelectDateActions, { ...props });
1077
- case "select-tickets": return /* @__PURE__ */ jsx(SelectTicketsActions, { ...props });
1078
- case "enter-details": return /* @__PURE__ */ jsx(EnterDetailsActions, { ...props });
1079
- case "select-payment": return /* @__PURE__ */ jsx(SelectPaymentActions, { ...props });
1080
- case "payment": return /* @__PURE__ */ jsx(PaymentActions, { ...props });
1081
- default: return null;
1082
- }
1264
+ //#endregion
1265
+ //#region ../blocks/src/system/runtime/nodes/event-registration/CombinationSummary.tsx
1266
+ /** The usual total struck through, then what combination prices bring it to (issue 1725). */
1267
+ function CombinationPricing(props) {
1268
+ return /* @__PURE__ */ jsxs("div", {
1269
+ className: "er-summary-bar-pricing",
1270
+ children: [/* @__PURE__ */ jsx("span", {
1271
+ className: "er-summary-bar-price er-summary-bar-price--struck",
1272
+ children: formatPrice(props.listCents, props.currency)
1273
+ }), /* @__PURE__ */ jsx("span", {
1274
+ className: "er-summary-bar-price",
1275
+ children: formatPrice(props.totalCents, props.currency)
1276
+ })]
1277
+ });
1083
1278
  }
1084
- //#endregion
1085
- //#region ../blocks/src/system/runtime/nodes/event-registration/SingleTicketEntitlementNote.tsx
1086
- /**
1087
- * Passes and memberships cover one person, so with more than one place they
1088
- * are greyed out; this says why, in the open rather than in a hover tooltip.
1089
- */
1090
- function SingleTicketEntitlementNote(props) {
1091
- const { eligibility } = props;
1092
- if (!eligibility || !areEntitlementsDisabledForTicketCount(props.ticketsCount)) return null;
1093
- const hasPasses = eligibility.eligiblePasses.length + eligibility.availablePasses.length > 0;
1094
- const hasMemberships = eligibility.eligibleMemberships.length + eligibility.availableMemberships.length > 0;
1095
- if (!hasPasses && !hasMemberships) return null;
1279
+ /** "4 dates for £40, plus 1 at £12 · You save £8" under the summary row. */
1280
+ function CombinationDetail(props) {
1281
+ if (!props.working) return null;
1096
1282
  return /* @__PURE__ */ jsxs("p", {
1097
- className: "er-entitlement-note",
1283
+ className: "er-combination-detail",
1098
1284
  children: [
1099
- hasPasses ? "Passes are" : "Memberships are",
1100
- " for one person.",
1101
- " ",
1102
- /* @__PURE__ */ jsx("button", {
1103
- type: "button",
1104
- className: "er-entitlement-note__action",
1105
- onClick: props.onBookOnePlace,
1106
- children: "Book 1 place"
1107
- }),
1108
- " ",
1109
- "to use ",
1110
- hasPasses ? "a pass" : "a membership",
1111
- "."
1285
+ props.working.working,
1286
+ " · ",
1287
+ /* @__PURE__ */ jsx("span", {
1288
+ className: "er-combination-saving",
1289
+ children: props.working.saving
1290
+ })
1112
1291
  ]
1113
1292
  });
1114
1293
  }
1115
- //#endregion
1116
- //#region ../blocks/src/system/runtime/nodes/event-registration/PaymentBlockingPanel.tsx
1117
- function MissingEligibilityPanel() {
1118
- return /* @__PURE__ */ jsx("div", {
1119
- className: "rb-reg-stack er-stack",
1120
- children: /* @__PURE__ */ jsx("div", {
1121
- className: "er-center",
1122
- children: /* @__PURE__ */ jsx("p", {
1123
- className: "er-text er-error",
1124
- children: "We couldn’t load the booking options for this event. Please refresh this page and try again. If this keeps happening, contact the organiser for help."
1125
- })
1126
- })
1294
+ /** "Add 1 more date to get 4 dates for £40." under the summary bar. */
1295
+ function CombinationHint(props) {
1296
+ if (!props.parts) return null;
1297
+ return /* @__PURE__ */ jsx("p", {
1298
+ className: "er-combination-hint",
1299
+ role: "status",
1300
+ children: /* @__PURE__ */ jsx(CopyParts, { parts: props.parts })
1127
1301
  });
1128
1302
  }
1129
- function UnavailableEntitlementMessage(props) {
1130
- return /* @__PURE__ */ jsxs(Fragment, { children: [
1131
- /* @__PURE__ */ jsx("p", {
1132
- className: "er-text er-error",
1133
- children: "This event requires a valid pass or membership to register."
1134
- }),
1135
- props.eligibility.eventAcceptsPasses && !props.eligibility.eventAcceptsMemberships && /* @__PURE__ */ jsx("p", {
1136
- className: "er-text er-text--muted",
1137
- children: "You need a pass with credits for this event category."
1138
- }),
1139
- props.eligibility.eventAcceptsMemberships && !props.eligibility.eventAcceptsPasses && /* @__PURE__ */ jsx("p", {
1140
- className: "er-text er-text--muted",
1141
- children: "You need an active membership for this event category."
1142
- })
1143
- ] });
1303
+ //#endregion
1304
+ //#region ../blocks/src/system/runtime/nodes/event-registration/registrationSummary.state.ts
1305
+ /** Several course runs are one purchase; individual run names belong in the breakdown. */
1306
+ function registrationSummaryTitle(input) {
1307
+ if (input.severalItems === "runs") return (input.subject?.kind === "eventOffering" ? input.subject.title?.trim() : null) || "Your booking";
1308
+ return occurrenceTitleOverride(input.occurrenceContext) ?? input.eventTitle ?? "";
1144
1309
  }
1145
- /** Places remain, just fewer than this booking asks for (issue 1581). */
1146
- function FewerPlacesPaymentPanel(props) {
1147
- return /* @__PURE__ */ jsxs("div", {
1148
- className: "rb-reg-stack er-stack",
1149
- children: [/* @__PURE__ */ jsx("h3", {
1150
- className: "er-title",
1151
- children: props.heading
1152
- }), /* @__PURE__ */ jsx("div", {
1153
- className: "er-center",
1154
- children: /* @__PURE__ */ jsx("p", {
1155
- className: "er-text er-text--muted",
1156
- children: props.message
1157
- })
1158
- })]
1159
- });
1310
+ //#endregion
1311
+ //#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationSummaryBar.tsx
1312
+ /** A run booked with the visitor's membership, which the bar names in place of a price. */
1313
+ function membershipFor(wizard) {
1314
+ const selection = wizard.paymentSelection;
1315
+ return selection.method === "membership" ? selection.productName?.trim() || "Membership" : null;
1160
1316
  }
1161
- function SoldOutPaymentPanel() {
1317
+ /** The membership covering a run, above the bar; nothing without one. */
1318
+ function MembershipRow(props) {
1319
+ if (props.name === null) return null;
1162
1320
  return /* @__PURE__ */ jsxs("div", {
1163
- className: "rb-reg-stack er-stack",
1164
- children: [/* @__PURE__ */ jsx("h3", {
1165
- className: "er-title",
1166
- children: "Sold out"
1167
- }), /* @__PURE__ */ jsx("div", {
1168
- className: "er-center",
1169
- children: /* @__PURE__ */ jsx("p", {
1170
- className: "er-text er-text--muted",
1171
- children: "This event is fully booked and there is no waitlist available for this booking."
1321
+ className: "er-summary-bar-product",
1322
+ children: [/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("div", {
1323
+ className: "er-summary-bar-product-name",
1324
+ children: props.name
1325
+ }) }), /* @__PURE__ */ jsx("div", {
1326
+ className: "er-summary-bar-product-price",
1327
+ children: /* @__PURE__ */ jsx("span", {
1328
+ className: "er-summary-bar-included",
1329
+ children: "Included"
1172
1330
  })
1173
1331
  })]
1174
1332
  });
1175
1333
  }
1176
- function IneligiblePaymentPanel(props) {
1177
- const promptLogin = shouldPromptForLogin("not-eligible", props.isAuthenticated, props.eligibility);
1178
- return /* @__PURE__ */ jsxs("div", {
1179
- className: "rb-reg-stack er-stack",
1180
- children: [/* @__PURE__ */ jsx("h3", {
1181
- className: "er-title",
1182
- children: promptLogin ? "Log in required" : "Payment required"
1183
- }), /* @__PURE__ */ jsx("div", {
1184
- className: "er-center",
1185
- children: promptLogin ? /* @__PURE__ */ jsxs(Fragment, { children: [
1186
- /* @__PURE__ */ jsx("p", {
1187
- className: "er-text er-text--muted",
1188
- children: "Have a pass or membership? Log in to use it."
1189
- }),
1190
- /* @__PURE__ */ jsx(ThemedButton, {
1191
- type: "button",
1192
- variant: "primary",
1193
- size: "md",
1194
- label: "Email me a login link",
1195
- disabled: !props.email.trim(),
1196
- onClick: props.onRequestLogin
1197
- }),
1198
- !props.email.trim() && /* @__PURE__ */ jsx("p", {
1199
- className: "er-text er-text--muted",
1200
- children: "Enter your email to request a login link."
1201
- })
1202
- ] }) : /* @__PURE__ */ jsx(UnavailableEntitlementMessage, { eligibility: props.eligibility })
1203
- })]
1204
- });
1334
+ function getFlexibleBalanceSummary(option) {
1335
+ return option?.flexibleBalance ? {
1336
+ total: option.amounts.formattedTotal,
1337
+ dueToday: option.amounts.formattedDueToday,
1338
+ ...option.flexibleBalance
1339
+ } : null;
1205
1340
  }
1206
- function renderRegistrationAvailabilityBlocker(admission) {
1207
- const blocker = resolveRegistrationAvailabilityBlocker(admission);
1208
- if (blocker?.kind !== "unavailable") return null;
1209
- switch (blocker.reason) {
1210
- case "alreadyWaitlisted": return /* @__PURE__ */ jsx(AlreadyWaitlistedPaymentPanel, {});
1211
- case "soldOut": return /* @__PURE__ */ jsx(SoldOutPaymentPanel, {});
1212
- case "fewerPlacesLeft": return /* @__PURE__ */ jsx(FewerPlacesPaymentPanel, {
1213
- heading: blocker.heading,
1214
- message: blocker.message
1215
- });
1216
- case "closed": return /* @__PURE__ */ jsx(ClosedPaymentPanel, { message: blocker.message });
1341
+ function getSelectedDirectPaymentOption(wizard) {
1342
+ if (wizard.paymentSelection.method !== "stripe") return null;
1343
+ const kind = wizard.paymentSelection.collectionOptionKind;
1344
+ return wizard.directPaymentOptions.find((option) => option.kind === kind) ?? null;
1345
+ }
1346
+ /** "2 tickets" or "1 place"; booking several, "5 dates × 2 places" or the runs by name. */
1347
+ function summaryCountLabel(wizard, summaryEvent) {
1348
+ if (wizard.severalItems !== null) return selectionPlacesLabel(wizard.severalItems, wizard.selection, wizard.ticketsCount);
1349
+ if (wizard.ticketsCount <= 0) return null;
1350
+ const tiered = summaryEvent !== null && summaryEvent !== void 0 && publicEventPricingStrategy(summaryEvent.pricing) === "tiered";
1351
+ if (tiered) {
1352
+ const byType = ticketTypeCountLabel(wizard.selectedTicketLines, wizard.visibleTicketTypes);
1353
+ if (byType) return byType;
1217
1354
  }
1355
+ const unit = tiered ? "ticket" : "place";
1356
+ return `${wizard.ticketsCount} ${unit}${wizard.ticketsCount === 1 ? "" : "s"}`;
1218
1357
  }
1219
- function PaymentBlockingPanel(props) {
1220
- if (props.eligibilityLoading) return /* @__PURE__ */ jsx("div", {
1221
- className: "rb-reg-stack er-stack",
1222
- children: /* @__PURE__ */ jsxs("div", {
1223
- className: "er-center",
1224
- children: [/* @__PURE__ */ jsx(SpinnerNode, {
1225
- size: "lg",
1226
- srLabel: "Checking payment options"
1227
- }), /* @__PURE__ */ jsx("p", {
1228
- className: "er-text--muted",
1229
- children: "Checking payment options…"
1230
- })]
1231
- })
1232
- });
1233
- if (props.eligibilityError) return /* @__PURE__ */ jsx("div", {
1234
- className: "rb-reg-stack er-stack",
1235
- children: /* @__PURE__ */ jsx("div", {
1236
- className: "er-center",
1237
- children: /* @__PURE__ */ jsx("p", {
1238
- className: "er-text er-error",
1239
- children: props.eligibilityError
1240
- })
1241
- })
1242
- });
1243
- if (!props.eligibility) return /* @__PURE__ */ jsx(MissingEligibilityPanel, {});
1244
- const availabilityPanel = renderRegistrationAvailabilityBlocker(props.admission);
1245
- if (availabilityPanel) return availabilityPanel;
1246
- if (props.paysNothing) return /* @__PURE__ */ jsx(FreePaymentSummary, { ticketsCount: props.ticketsCount });
1247
- return props.eligibility.paymentOptions.length > 0 ? null : /* @__PURE__ */ jsx(IneligiblePaymentPanel, {
1248
- eligibility: props.eligibility,
1249
- email: props.email,
1250
- isAuthenticated: props.isAuthenticated,
1251
- onRequestLogin: props.onRequestLogin
1358
+ /** "1 Standard, 1 Concession" when tickets of more than one type are chosen; otherwise null. */
1359
+ function ticketTypeCountLabel(lines, ticketTypes) {
1360
+ const chosen = lines.filter((line) => line.quantity > 0);
1361
+ if (chosen.length < 2) return null;
1362
+ const parts = chosen.map((line) => {
1363
+ const name = ticketTypes.find((type) => type.pricingOptionId === line.pricingOptionId)?.name;
1364
+ return name ? `${line.quantity} ${name}` : null;
1252
1365
  });
1366
+ return parts.every((part) => part !== null) ? parts.join(", ") : null;
1253
1367
  }
1254
- function AlreadyWaitlistedPaymentPanel() {
1255
- return /* @__PURE__ */ jsxs("div", {
1256
- className: "rb-reg-stack er-stack",
1257
- children: [/* @__PURE__ */ jsx("h3", {
1258
- className: "er-title",
1259
- children: "Already on the waitlist"
1260
- }), /* @__PURE__ */ jsxs("div", {
1261
- className: "er-center",
1262
- children: [/* @__PURE__ */ jsx("p", {
1263
- className: "er-text er-text--muted",
1264
- children: "You're already on the waitlist for this event."
1265
- }), /* @__PURE__ */ jsx("a", {
1266
- href: "/portal",
1267
- className: "er-retry-btn",
1268
- children: "View my bookings"
1269
- })]
1270
- })]
1271
- });
1368
+ /**
1369
+ * The footer's one line (issue 1581): how many, the discount's name, then
1370
+ * when. Ticket types are tickets; a single price, or a course, is places.
1371
+ */
1372
+ function summaryMetaFacts(input) {
1373
+ const { wizard, summaryEvent } = input;
1374
+ const several = wizard.severalItems;
1375
+ return {
1376
+ countLabel: summaryCountLabel(wizard, summaryEvent),
1377
+ discount: input.discount && membershipFor(wizard) === null ? {
1378
+ label: input.discount.publicLabel,
1379
+ description: input.discount.description ?? null
1380
+ } : null,
1381
+ schedule: summaryEvent && several === null ? formatRegistrationSchedule(summaryEvent, wizard.occurrenceContext) : null
1382
+ };
1272
1383
  }
1273
- function FreePaymentSummary({ ticketsCount }) {
1274
- return /* @__PURE__ */ jsxs("div", {
1275
- className: "rb-reg-stack er-stack",
1276
- children: [/* @__PURE__ */ jsx("h3", {
1277
- className: "er-title",
1278
- children: "Payment"
1279
- }), /* @__PURE__ */ jsxs("div", {
1280
- className: "er-payment-summary",
1281
- children: [/* @__PURE__ */ jsx("p", {
1282
- className: "er-text",
1283
- children: "This event is free!"
1284
- }), /* @__PURE__ */ jsxs("p", {
1285
- className: "er-text er-text--muted",
1286
- children: [
1287
- ticketsCount,
1288
- " ticket",
1289
- ticketsCount > 1 ? "s" : ""
1290
- ]
1291
- })]
1292
- })]
1384
+ /** The panel's header already says when, so the panel hides the schedule. */
1385
+ function SummaryMeta({ facts }) {
1386
+ return /* @__PURE__ */ jsxs("span", {
1387
+ className: "er-summary-bar-meta",
1388
+ children: [
1389
+ facts.countLabel ? /* @__PURE__ */ jsx("span", {
1390
+ className: "er-summary-bar-count",
1391
+ children: facts.countLabel
1392
+ }) : null,
1393
+ facts.discount ? /* @__PURE__ */ jsx("span", {
1394
+ className: "er-summary-bar-discount",
1395
+ title: facts.discount.description ?? void 0,
1396
+ children: facts.discount.label
1397
+ }) : null,
1398
+ facts.schedule ? /* @__PURE__ */ jsx("span", {
1399
+ className: "er-summary-bar-schedule",
1400
+ children: facts.schedule
1401
+ }) : null
1402
+ ]
1293
1403
  });
1294
1404
  }
1295
- function ClosedPaymentPanel({ message }) {
1296
- return /* @__PURE__ */ jsx("div", {
1297
- className: "rb-reg-stack er-stack",
1298
- children: /* @__PURE__ */ jsx("div", {
1299
- className: "er-center",
1300
- children: /* @__PURE__ */ jsx("p", {
1301
- className: "er-text er-error",
1302
- children: message
1405
+ /**
1406
+ * The date step's footer line (issue 1581): the chosen date and its price,
1407
+ * before any places are counted. Nothing until a date is chosen.
1408
+ */
1409
+ function DateStepSummary({ event }) {
1410
+ if (!event) return null;
1411
+ const price = formatEventPriceDisplay(event.pricing).trim();
1412
+ return /* @__PURE__ */ jsxs("div", {
1413
+ className: "er-summary-bar",
1414
+ "data-step": "select-event",
1415
+ children: [/* @__PURE__ */ jsx("div", {
1416
+ className: "er-summary-bar-info",
1417
+ children: /* @__PURE__ */ jsx("span", {
1418
+ className: "er-summary-bar-meta",
1419
+ children: /* @__PURE__ */ jsx("span", {
1420
+ className: "er-summary-bar-schedule",
1421
+ children: formatRegistrationSchedule(event)
1422
+ })
1303
1423
  })
1304
- })
1424
+ }), price ? /* @__PURE__ */ jsx("div", {
1425
+ className: "er-summary-bar-pricing",
1426
+ children: /* @__PURE__ */ jsx("span", {
1427
+ className: "er-summary-bar-price",
1428
+ children: price
1429
+ })
1430
+ }) : null]
1305
1431
  });
1306
1432
  }
1307
- //#endregion
1308
- //#region ../blocks/src/system/runtime/nodes/event-registration/existingBookingsSummary.ts
1309
- function places(count) {
1310
- return count === 1 ? "1 place" : `${count} places`;
1433
+ /**
1434
+ * Booking several (issue 1725): how many are ticked and their total. With
1435
+ * combination prices the usual total is struck through above the planned
1436
+ * one, with the working underneath and the next saving under the bar.
1437
+ */
1438
+ function SeveralStepSummary({ wizard }) {
1439
+ const several = wizard.severalItems;
1440
+ const first = wizard.selectedEvent;
1441
+ const { working, hint } = wizard.selectionCombination;
1442
+ if (several === null || !first) return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateStepSummary, { event: first }), /* @__PURE__ */ jsx(CombinationHint, { parts: hint })] });
1443
+ const currency = publicEventPricingCurrency(first.pricing);
1444
+ const { totalCents: total, listTotalCents: list } = wizard.selectionPrice;
1445
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
1446
+ className: summaryBarClassName(working),
1447
+ "data-step": "select-event",
1448
+ children: [
1449
+ /* @__PURE__ */ jsx("div", {
1450
+ className: "er-summary-bar-info",
1451
+ children: /* @__PURE__ */ jsx("span", {
1452
+ className: "er-summary-bar-meta",
1453
+ children: /* @__PURE__ */ jsx("span", {
1454
+ className: "er-summary-bar-count",
1455
+ children: selectionItemsLabel(several, wizard.selection)
1456
+ })
1457
+ })
1458
+ }),
1459
+ currency && total !== null && total > 0 ? working && list !== null ? /* @__PURE__ */ jsx(CombinationPricing, {
1460
+ listCents: list,
1461
+ totalCents: total,
1462
+ currency
1463
+ }) : /* @__PURE__ */ jsx("div", {
1464
+ className: "er-summary-bar-pricing",
1465
+ children: /* @__PURE__ */ jsx("span", {
1466
+ className: "er-summary-bar-price",
1467
+ children: formatPrice(total, currency)
1468
+ })
1469
+ }) : null,
1470
+ /* @__PURE__ */ jsx(CombinationDetail, { working })
1471
+ ]
1472
+ }), /* @__PURE__ */ jsx(CombinationHint, { parts: hint })] });
1311
1473
  }
1312
- /** Waitlist entries have their own notice, so only confirmed bookings count here. */
1313
- function summariseExistingBookings(registrations) {
1314
- const confirmed = registrations.filter((registration) => registration.status === "confirmed");
1315
- const [only] = confirmed;
1316
- if (!only) return { kind: "none" };
1317
- if (confirmed.length === 1) return {
1318
- kind: "booked",
1319
- detail: only.ticketBreakdown ?? places(only.ticketsCount)
1474
+ /**
1475
+ * Dates with a pass or membership: the bar shows what the card is charged,
1476
+ * not the dates' price.
1477
+ */
1478
+ function barPrice(wizard) {
1479
+ const fundedCardCents = wizard.selectionFunding?.view?.cardCents ?? null;
1480
+ return fundedCardCents === null ? {
1481
+ subtotalCents: wizard.ticketSelectionSubtotalCents,
1482
+ funded: false
1483
+ } : {
1484
+ subtotalCents: fundedCardCents,
1485
+ funded: true
1320
1486
  };
1321
- const placeCount = confirmed.reduce((total, registration) => total + registration.ticketsCount, 0);
1487
+ }
1488
+ /**
1489
+ * The later steps' price for several items with combination prices: the
1490
+ * usual total struck through, then what's due. The working shows while the
1491
+ * planner's total stands; once the server prices a code, its total alone.
1492
+ */
1493
+ function combinationSummary(wizard, price) {
1494
+ if (wizard.severalItems === null || price.funded) return null;
1495
+ const subtotalCents = price.subtotalCents;
1496
+ const list = wizard.selectionPrice.listTotalCents;
1497
+ const working = wizard.selectionCombination.working;
1498
+ if (list === null || list <= subtotalCents || working === null && wizard.combinationCodeField === null) return null;
1322
1499
  return {
1323
- kind: "booked",
1324
- detail: `${confirmed.length} bookings · ${places(placeCount)}`
1500
+ list,
1501
+ working: subtotalCents === wizard.selectionPrice.totalCents ? working : null
1325
1502
  };
1326
1503
  }
1327
- //#endregion
1328
- //#region ../blocks/src/system/runtime/nodes/event-registration/TicketSelectionStep.tsx
1329
- function pluralizeBookingUnit(kind, quantity) {
1330
- return `${kind}${quantity === 1 ? "" : "s"}`;
1504
+ /** A deposit or instalment plan: the total, what's payable now, and what's left. */
1505
+ function FlexibleBalancePricing(props) {
1506
+ const { summary } = props;
1507
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1508
+ summary.total ? /* @__PURE__ */ jsxs("div", {
1509
+ className: "er-summary-bar-product-detail",
1510
+ children: ["Total: ", summary.total]
1511
+ }) : null,
1512
+ /* @__PURE__ */ jsx("div", {
1513
+ className: "er-summary-bar-price",
1514
+ children: summary.dueToday ?? props.fallbackDueToday
1515
+ }),
1516
+ /* @__PURE__ */ jsx("div", {
1517
+ className: "er-summary-bar-included",
1518
+ children: "Payable now"
1519
+ }),
1520
+ summary.remainingBalance ? /* @__PURE__ */ jsxs("div", {
1521
+ className: "er-summary-bar-product-detail",
1522
+ children: [
1523
+ "Remaining balance: ",
1524
+ summary.remainingBalance,
1525
+ summary.balanceDueBy ? ` due by ${summary.balanceDueBy}` : ""
1526
+ ]
1527
+ }) : null,
1528
+ summary.depositPolicy ? /* @__PURE__ */ jsxs("div", {
1529
+ className: "er-summary-bar-product-detail",
1530
+ children: ["Deposit: ", summary.depositPolicy]
1531
+ }) : null
1532
+ ] });
1331
1533
  }
1332
- function getEventAttendanceModeLabel(mode) {
1333
- switch (mode) {
1334
- case "in_person": return "In person";
1335
- case "online": return "Online";
1336
- }
1534
+ function summaryBarClassName(working) {
1535
+ return working ? "er-summary-bar er-summary-bar--combination" : "er-summary-bar";
1337
1536
  }
1338
- function TicketCounter(props) {
1339
- const { ticketsCount, maxAllowed, label, onTicketsChange } = props;
1340
- const minAllowed = props.minAllowed ?? 1;
1341
- return /* @__PURE__ */ jsxs("div", {
1342
- className: "rb-reg-row er-row er-counter",
1343
- children: [
1344
- /* @__PURE__ */ jsx("button", {
1345
- type: "button",
1346
- "aria-label": `Decrease ${label}`,
1347
- onClick: () => onTicketsChange(stepNumber(ticketsCount, -1, { min: minAllowed })),
1348
- disabled: ticketsCount <= minAllowed,
1349
- className: "er-counter-btn",
1350
- children: "−"
1351
- }),
1352
- /* @__PURE__ */ jsx("span", {
1353
- className: "er-counter-value",
1354
- children: ticketsCount
1355
- }),
1356
- /* @__PURE__ */ jsx("button", {
1357
- type: "button",
1358
- "aria-label": `Increase ${label}`,
1359
- onClick: () => onTicketsChange(stepNumber(ticketsCount, 1, { max: maxAllowed })),
1360
- disabled: ticketsCount >= maxAllowed,
1361
- className: "er-counter-btn",
1362
- children: "+"
1363
- })
1364
- ]
1537
+ function EventRegistrationSummaryBar(props) {
1538
+ const { wizard } = props;
1539
+ if (wizard.step === "select-event") return /* @__PURE__ */ jsx(SeveralStepSummary, { wizard });
1540
+ const summaryEvent = wizard.selectedEvent ?? wizard.preSelectedEvent;
1541
+ const summaryTitle = registrationSummaryTitle({
1542
+ ...wizard,
1543
+ eventTitle: summaryEvent?.title
1365
1544
  });
1366
- }
1367
- function TicketCounterLimit(props) {
1368
- const showBookingLimit = !props.availabilityLabel || props.maxAllowed < (props.availableSpots ?? Infinity);
1369
- return /* @__PURE__ */ jsxs("p", {
1370
- className: "er-ticket-counter-limit",
1371
- children: [props.availabilityLabel ? /* @__PURE__ */ jsx("span", { children: props.availabilityLabel }) : null, showBookingLimit ? /* @__PURE__ */ jsxs(Fragment, { children: [props.availabilityLabel ? /* @__PURE__ */ jsx("br", {}) : null, /* @__PURE__ */ jsxs("span", { children: [
1372
- "Up to ",
1373
- props.maxAllowed,
1374
- " ",
1375
- props.quantityLabel,
1376
- " per booking."
1377
- ] })] }) : null]
1545
+ const summaryCurrency = summaryEvent ? publicEventPricingCurrency(summaryEvent.pricing) : null;
1546
+ const teamMemberNames = (summaryEvent?.teamMembers ?? []).map((teamMember) => teamMember.name).filter(Boolean);
1547
+ const price = barPrice(wizard);
1548
+ const subtotalCents = price.subtotalCents;
1549
+ if (!summaryTitle || !summaryCurrency || subtotalCents === null) return null;
1550
+ const autoAppliedDiscount = wizard.autoAppliedDiscount;
1551
+ const autoAppliedDiscountCents = Math.max(0, autoAppliedDiscount?.computedAmountCents ?? 0);
1552
+ const discountedTotalCents = Math.max(0, subtotalCents - autoAppliedDiscountCents);
1553
+ const flexibleBalanceSummary = getFlexibleBalanceSummary(getSelectedDirectPaymentOption(wizard));
1554
+ const meta = summaryMetaFacts({
1555
+ wizard,
1556
+ summaryEvent,
1557
+ discount: autoAppliedDiscountCents > 0 ? autoAppliedDiscount : null
1378
1558
  });
1379
- }
1380
- function BookingUnitSessionHint(props) {
1381
- const count = props.bookingUnit.includedSessionCount;
1382
- return props.bookingUnit.kind === "place" && count && count > 1 ? /* @__PURE__ */ jsxs("p", {
1383
- className: "er-text er-text--muted",
1559
+ const membership = membershipFor(wizard);
1560
+ const combination = combinationSummary(wizard, {
1561
+ subtotalCents,
1562
+ funded: price.funded
1563
+ });
1564
+ const working = combination?.working ?? null;
1565
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MembershipRow, { name: membership }), /* @__PURE__ */ jsxs("div", {
1566
+ className: summaryBarClassName(working),
1567
+ "data-step": wizard.step,
1384
1568
  children: [
1385
- "Every place includes all ",
1386
- count,
1387
- " sessions."
1569
+ /* @__PURE__ */ jsxs("div", {
1570
+ className: "er-summary-bar-info",
1571
+ children: [
1572
+ /* @__PURE__ */ jsx("h4", {
1573
+ className: "er-summary-bar-event",
1574
+ children: summaryTitle
1575
+ }),
1576
+ /* @__PURE__ */ jsx(SummaryMeta, { facts: meta }),
1577
+ teamMemberNames.length > 0 && /* @__PURE__ */ jsxs("div", {
1578
+ className: "er-summary-bar-meta",
1579
+ children: ["With ", teamMemberNames.join(", ")]
1580
+ })
1581
+ ]
1582
+ }),
1583
+ combination && subtotalCents > 0 ? /* @__PURE__ */ jsx(CombinationPricing, {
1584
+ listCents: combination.list,
1585
+ totalCents: subtotalCents,
1586
+ currency: summaryCurrency
1587
+ }) : subtotalCents > 0 && /* @__PURE__ */ jsx("div", {
1588
+ className: "er-summary-bar-pricing",
1589
+ children: membership ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
1590
+ className: "er-summary-bar-price er-summary-bar-price--struck",
1591
+ children: formatPrice(subtotalCents, summaryCurrency)
1592
+ }), /* @__PURE__ */ jsx("div", {
1593
+ className: "er-summary-bar-included",
1594
+ children: "Included in membership"
1595
+ })] }) : flexibleBalanceSummary ? /* @__PURE__ */ jsx(FlexibleBalancePricing, {
1596
+ summary: flexibleBalanceSummary,
1597
+ fallbackDueToday: formatPrice(discountedTotalCents, summaryCurrency)
1598
+ }) : autoAppliedDiscount && autoAppliedDiscountCents > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
1599
+ /* @__PURE__ */ jsx("span", {
1600
+ className: "er-summary-bar-price er-summary-bar-price--struck",
1601
+ children: formatPrice(subtotalCents, summaryCurrency)
1602
+ }),
1603
+ /* @__PURE__ */ jsx("span", {
1604
+ className: "er-summary-bar-price",
1605
+ children: formatPrice(discountedTotalCents, summaryCurrency)
1606
+ }),
1607
+ autoAppliedDiscount.description ? /* @__PURE__ */ jsx("div", {
1608
+ className: "er-summary-bar-product-detail er-summary-bar-discount-detail",
1609
+ children: autoAppliedDiscount.description
1610
+ }) : null
1611
+ ] }) : /* @__PURE__ */ jsx("span", {
1612
+ className: "er-summary-bar-price",
1613
+ children: formatPrice(subtotalCents, summaryCurrency)
1614
+ })
1615
+ }),
1616
+ /* @__PURE__ */ jsx(CombinationDetail, { working })
1388
1617
  ]
1389
- }) : null;
1618
+ })] });
1390
1619
  }
1391
- function bookingQuantityLabel(unit, waitlist) {
1392
- if (!waitlist) return pluralizeBookingUnit(unit, 2);
1393
- return "waitlist places";
1620
+ //#endregion
1621
+ //#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardActions.tsx
1622
+ /**
1623
+ * Label for the button that submits the details step.
1624
+ *
1625
+ * When a pass covers the booking there is no payment step to follow, so this
1626
+ * button is the last thing read before a credit is spent — it names the pass
1627
+ * rather than leaving that to the summary above it.
1628
+ */
1629
+ function resolveDetailsButtonText(input) {
1630
+ const { wizard } = input;
1631
+ const admission = wizard.admission;
1632
+ switch (admission.kind) {
1633
+ case "checking": return "Checking availability…";
1634
+ case "closed": return closedAdmissionLabel(admission.reason);
1635
+ case "fullyBooked": return fullyBookedLabel(admission);
1636
+ case "waitlist": return "Join waitlist";
1637
+ case "open":
1638
+ case "resume": break;
1639
+ }
1640
+ if (wizard.paymentSelection.method === "membership") return input.fallbackText;
1641
+ return wizard.eventRequiresPayment ? "Continue to payment" : input.fallbackText;
1394
1642
  }
1395
- function BookingQuantityPrompt(props) {
1396
- return /* @__PURE__ */ jsxs("h3", {
1397
- tabIndex: -1,
1398
- className: "er-title",
1399
- children: [
1400
- "How many ",
1401
- bookingQuantityLabel(props.unit, props.waitlist),
1402
- "?"
1403
- ]
1643
+ /** When the booking options failed to load, the visitor can ask for them again. */
1644
+ function ReloadOptionsButton(props) {
1645
+ const { admission } = props.wizard;
1646
+ if (admission.kind !== "closed" || admission.reason !== "optionsUnavailable") return null;
1647
+ return /* @__PURE__ */ jsx("button", {
1648
+ type: "button",
1649
+ onClick: props.wizard.reloadOptions,
1650
+ className: "er-back-btn",
1651
+ children: "Try again"
1404
1652
  });
1405
1653
  }
1406
- function SlidingScaleAmountField(props) {
1407
- const id = props.id ?? "er-sliding-amount";
1408
- const minLabel = formatPrice(props.slidingScale.minAmount, props.currency);
1409
- const maxLabel = formatPrice(props.slidingScale.maxAmount, props.currency);
1410
- const suggestedLabel = props.slidingScale.suggestedAmount !== null ? formatPrice(props.slidingScale.suggestedAmount, props.currency) : null;
1654
+ /**
1655
+ * The date step's footer (issue 1581): Continue moves on once a date is
1656
+ * chosen. Unrelated events still move on when picked, so there's nothing here.
1657
+ */
1658
+ function SelectDateActions(props) {
1659
+ const { wizard } = props;
1660
+ const several = wizard.selectionMode.kind === "several";
1661
+ if (!several && getEventSelectionMode(wizard.scopedEvents) !== "date") return null;
1662
+ const chosen = wizard.selectedEvent;
1663
+ return /* @__PURE__ */ jsx("div", {
1664
+ className: "rb-wizard-actions er-actions",
1665
+ children: /* @__PURE__ */ jsx(ThemedButton, {
1666
+ type: "button",
1667
+ onClick: several ? wizard.handleSelectionContinue : () => {
1668
+ if (chosen) wizard.handleEventSelect(chosen);
1669
+ },
1670
+ disabled: several ? wizard.selection.length === 0 : !chosen,
1671
+ variant: props.buttonVariant,
1672
+ size: "md",
1673
+ label: "Continue"
1674
+ })
1675
+ });
1676
+ }
1677
+ function SelectTicketsActions(props) {
1678
+ const { wizard } = props;
1679
+ const { label: continueLabel, pending: registrationOptionsPending } = wizard.ticketContinuation;
1680
+ const isContinueDisabled = wizard.ticketContinuation.kind === "blocked";
1411
1681
  return /* @__PURE__ */ jsxs("div", {
1412
- className: "er-field",
1682
+ className: "rb-wizard-actions er-actions",
1413
1683
  children: [
1414
- /* @__PURE__ */ jsx("label", {
1415
- htmlFor: id,
1416
- className: "form-label",
1417
- children: "Amount"
1418
- }),
1419
- /* @__PURE__ */ jsx("input", {
1420
- id,
1421
- type: "number",
1422
- min: formatCentsAsCurrencyInput(props.slidingScale.minAmount),
1423
- max: formatCentsAsCurrencyInput(props.slidingScale.maxAmount),
1424
- step: "0.01",
1425
- inputMode: "decimal",
1426
- className: "form-input",
1427
- value: props.value,
1428
- onChange: (event) => props.onChange?.(event.target.value)
1684
+ entryChoosesEvent(wizard.entry) && /* @__PURE__ */ jsx("button", {
1685
+ type: "button",
1686
+ onClick: () => wizard.setStep("select-event"),
1687
+ className: "er-back-btn",
1688
+ children: "← Back"
1429
1689
  }),
1430
- /* @__PURE__ */ jsxs("p", {
1431
- className: "er-text er-text--muted",
1432
- children: [
1433
- "Choose between ",
1434
- minLabel,
1435
- " and ",
1436
- maxLabel,
1437
- suggestedLabel ? `; suggested ${suggestedLabel}` : "",
1438
- "."
1439
- ]
1690
+ registrationStopsHere(wizard.admission) ? null : /* @__PURE__ */ jsx(ThemedButton, {
1691
+ type: "button",
1692
+ onClick: wizard.handleTicketsComplete,
1693
+ disabled: isContinueDisabled,
1694
+ variant: props.buttonVariant,
1695
+ size: "md",
1696
+ label: continueLabel,
1697
+ pending: registrationOptionsPending ? {
1698
+ label: continueLabel,
1699
+ spinnerSize: "xs",
1700
+ spinnerClassName: "er-button-spinner",
1701
+ contentClassName: "er-button-with-spinner"
1702
+ } : void 0
1440
1703
  }),
1441
- props.message ? /* @__PURE__ */ jsx("p", {
1442
- className: "er-text er-text--muted",
1443
- children: props.message
1444
- }) : null
1704
+ /* @__PURE__ */ jsx(ReloadOptionsButton, { wizard })
1445
1705
  ]
1446
1706
  });
1447
1707
  }
1448
- function TicketTypeQuantityRows(props) {
1449
- const totalSelectedQuantity = getTicketSelectionTotal(props.ticketSelections);
1450
- const effectiveMaxTickets = props.maxTickets;
1708
+ function EnterDetailsActions(props) {
1709
+ const { wizard } = props;
1710
+ const isContinueDisabled = resolveRegistrationAvailabilityBlocker(wizard.admission) !== null;
1711
+ const continueLabel = resolveDetailsButtonText({
1712
+ wizard,
1713
+ fallbackText: props.buttonText
1714
+ });
1451
1715
  return /* @__PURE__ */ jsxs("div", {
1452
- className: "er-ticket-lines",
1716
+ className: "rb-wizard-actions er-actions",
1453
1717
  children: [
1454
- /* @__PURE__ */ jsx("div", {
1455
- className: "er-ticket-line-list",
1456
- role: "list",
1457
- "aria-label": props.bookingUnit === "place" ? "Places" : "Tickets",
1458
- children: props.ticketTypes.map((ticketType) => {
1459
- const quantity = getTicketLineQuantity(props.ticketSelections, ticketType.pricingOptionId);
1460
- const disabled = !canRequestTicketOption(ticketType.availability, props.purpose);
1461
- const availabilityLabel = getTicketTypeAvailabilityLabel(ticketType);
1462
- const ticketTypeRemainingLabel = placesLeftLabel({
1463
- kind: "ticketType",
1464
- remaining: ticketType.availability.remainingPlaces,
1465
- dateRemaining: props.availableSpots ?? null
1466
- }, props.display);
1467
- const priceLabel = ticketType.priceAmount > 0 ? formatPrice(ticketType.priceAmount, props.currency) : "Free";
1468
- const maxAllowed = getTicketTypeLineMax({
1469
- currentQuantity: quantity,
1470
- totalSelectedQuantity,
1471
- maxTickets: props.maxTickets,
1472
- purpose: props.purpose,
1473
- pricingOptionId: ticketType.pricingOptionId,
1474
- availability: ticketType.availability,
1475
- heldPlacesBySelection: props.heldPlacesBySelection,
1476
- overallRemainingPlaces: props.availableSpots ?? null
1477
- });
1478
- return /* @__PURE__ */ jsxs("div", {
1479
- className: `er-ticket-line${disabled ? " er-ticket-line--disabled" : ""}`,
1480
- role: "listitem",
1481
- children: [/* @__PURE__ */ jsxs("div", {
1482
- className: "er-ticket-line-main",
1483
- children: [
1484
- /* @__PURE__ */ jsxs("div", {
1485
- className: "er-ticket-line-heading",
1486
- children: [/* @__PURE__ */ jsx("span", {
1487
- className: "er-ticket-line-name",
1488
- children: ticketType.name
1489
- }), /* @__PURE__ */ jsx("span", {
1490
- className: "er-ticket-line-price",
1491
- children: priceLabel
1492
- })]
1493
- }),
1494
- ticketType.description ? /* @__PURE__ */ jsx("p", {
1495
- className: "er-ticket-line-detail",
1496
- children: ticketType.description
1497
- }) : null,
1498
- availabilityLabel ? /* @__PURE__ */ jsx("p", {
1499
- className: "er-ticket-line-detail",
1500
- children: availabilityLabel
1501
- }) : ticketTypeRemainingLabel ? /* @__PURE__ */ jsx("p", {
1502
- className: "er-ticket-line-detail",
1503
- children: ticketTypeRemainingLabel
1504
- }) : null
1505
- ]
1506
- }), /* @__PURE__ */ jsx(TicketCounter, {
1507
- ticketsCount: quantity,
1508
- minAllowed: 0,
1509
- maxAllowed,
1510
- label: ticketType.name,
1511
- onTicketsChange: (nextQuantity) => {
1512
- props.onTicketSelectionsChange?.(setTicketLineQuantity({
1513
- lines: props.ticketSelections,
1514
- pricingOptionId: ticketType.pricingOptionId,
1515
- quantity: nextQuantity
1516
- }));
1517
- }
1518
- })]
1519
- }, ticketType.pricingOptionId);
1520
- })
1718
+ /* @__PURE__ */ jsx("button", {
1719
+ type: "button",
1720
+ onClick: () => wizard.setStep("select-tickets"),
1721
+ className: "er-back-btn",
1722
+ children: "← Back"
1521
1723
  }),
1522
- /* @__PURE__ */ jsx(TicketCounterLimit, {
1523
- maxAllowed: effectiveMaxTickets,
1524
- quantityLabel: pluralizeBookingUnit(props.bookingUnit, effectiveMaxTickets),
1525
- availableSpots: props.availableSpots,
1526
- availabilityLabel: props.availabilityLabel
1724
+ registrationStopsHere(wizard.admission) ? null : /* @__PURE__ */ jsx(ThemedButton, {
1725
+ type: "button",
1726
+ onClick: wizard.handleDetailsComplete,
1727
+ disabled: isContinueDisabled,
1728
+ variant: props.buttonVariant,
1729
+ size: "md",
1730
+ label: continueLabel
1527
1731
  }),
1528
- totalSelectedQuantity === 0 && props.hasAvailableTicketTypes ? /* @__PURE__ */ jsxs("p", {
1529
- className: "er-text er-text--muted",
1530
- children: [
1531
- "Choose at least one ",
1532
- props.bookingUnit,
1533
- " to continue."
1534
- ]
1535
- }) : totalSelectedQuantity === 0 ? /* @__PURE__ */ jsxs("p", {
1536
- className: "er-text er-text--muted",
1537
- children: [
1538
- "No ",
1539
- props.bookingUnit === "place" ? "places" : "ticket types",
1540
- " are currently available."
1541
- ]
1542
- }) : null
1732
+ /* @__PURE__ */ jsx(ReloadOptionsButton, { wizard })
1543
1733
  ]
1544
1734
  });
1545
1735
  }
1546
- function getAttendanceModeDetail(attendanceMode, display) {
1547
- return placesLeftLabel(attendanceMode, display, {
1548
- unlimited: "Unlimited places",
1549
- open: "Places available",
1550
- full: "Currently full",
1551
- waitlist: "Currently full, waitlist available"
1552
- });
1553
- }
1554
- /** One event's ways of attending, each with its places left. */
1555
- function eventAttendanceModeTiles(attendanceModes, display) {
1556
- return attendanceModes.map((attendanceMode) => ({
1557
- mode: attendanceMode.mode,
1558
- detail: getAttendanceModeDetail(attendanceMode, display)
1559
- }));
1560
- }
1561
- /** The "How will you attend?" choice; several runs share it, so one choice covers them all. */
1562
- function AttendanceModeTiles(props) {
1563
- return /* @__PURE__ */ jsx("div", {
1564
- className: "er-payment-tiles",
1565
- role: "list",
1566
- "aria-label": "Attendance mode",
1567
- children: props.tiles.map((tile) => {
1568
- const isSelected = props.selectedAttendanceMode === tile.mode;
1569
- return /* @__PURE__ */ jsx("div", {
1570
- role: "listitem",
1571
- children: /* @__PURE__ */ jsxs("button", {
1572
- type: "button",
1573
- "aria-pressed": isSelected,
1574
- className: `er-payment-tile${isSelected ? " er-payment-tile--selected" : ""}`,
1575
- onClick: () => props.onAttendanceModeChange?.(tile.mode),
1576
- children: [/* @__PURE__ */ jsx("div", {
1577
- className: "er-payment-tile-label",
1578
- children: getEventAttendanceModeLabel(tile.mode)
1579
- }), /* @__PURE__ */ jsx("div", {
1580
- className: "er-payment-tile-detail",
1581
- children: tile.detail
1582
- })]
1583
- })
1584
- }, tile.mode);
1585
- })
1586
- });
1587
- }
1588
- function resolveTicketSelectionPricing(event) {
1589
- return {
1590
- mode: event ? publicEventPricingStrategy(event.pricing) : void 0,
1591
- currency: event ? publicEventPricingCurrency(event.pricing) : null
1592
- };
1593
- }
1594
- /** Someone with an invitation is claiming a place, not joining the list. */
1595
- function waitlistIsOpenTo(source, invitation) {
1596
- return source && !invitation ? canJoinEventWaitlist(source) : false;
1597
- }
1598
- function getTicketSelectionCapacity(event, attendanceMode, display, invitation = null) {
1599
- const source = event ? selectEventCapacitySource(event, attendanceMode) : null;
1600
- const availability = source ? getEventAvailability(source) : null;
1601
- const canJoinWaitlist = waitlistIsOpenTo(source, invitation);
1602
- return {
1603
- availableSpots: availability?.available,
1604
- isSoldOut: availability?.isFull ?? false,
1605
- canJoinWaitlist,
1606
- eventAvailabilityLabel: !canJoinWaitlist && source ? placesLeftLabel(source, display) : null
1607
- };
1608
- }
1609
- /**
1610
- * One price: the visitor is choosing places, not ticket types (issue 1581).
1611
- * The ceiling comes from settled availability (`placeCountCeiling`); the
1612
- * page's cached count is only shown, never enforced.
1613
- */
1614
- function PlaceCounter(props) {
1615
- const spots = props.waitlist ? null : props.availableSpots;
1616
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BookingQuantityPrompt, {
1617
- unit: "place",
1618
- waitlist: props.waitlist
1619
- }), /* @__PURE__ */ jsxs("div", {
1620
- className: "er-ticket-counter-group",
1621
- children: [/* @__PURE__ */ jsx(TicketCounter, {
1622
- ticketsCount: props.ticketsCount,
1623
- maxAllowed: props.ceiling,
1624
- label: bookingQuantityLabel("place", props.waitlist),
1625
- onTicketsChange: props.onTicketsChange
1626
- }), /* @__PURE__ */ jsx(TicketCounterLimit, {
1627
- maxAllowed: props.ceiling,
1628
- quantityLabel: props.waitlist ? bookingQuantityLabel("place", true) : pluralizeBookingUnit("place", props.ceiling),
1629
- availableSpots: spots,
1630
- availabilityLabel: props.availabilityLabel
1736
+ function SelectPaymentActions(props) {
1737
+ const { wizard } = props;
1738
+ const { status, canContinue, buttonText } = wizard.paymentStepState;
1739
+ return /* @__PURE__ */ jsxs(Fragment, { children: [status === "ready" && wizard.paymentHeldForCode ? /* @__PURE__ */ jsx("p", {
1740
+ className: "er-discount__hint",
1741
+ children: "Press Apply to use your discount code, or remove it to carry on without it."
1742
+ }) : null, /* @__PURE__ */ jsxs("div", {
1743
+ className: "rb-wizard-actions er-actions",
1744
+ children: [/* @__PURE__ */ jsx("button", {
1745
+ type: "button",
1746
+ onClick: () => wizard.setStep("enter-details"),
1747
+ className: "er-back-btn",
1748
+ children: "← Back"
1749
+ }), status === "ready" && /* @__PURE__ */ jsx(ThemedButton, {
1750
+ type: "button",
1751
+ onClick: () => void wizard.handlePaymentSelect(),
1752
+ disabled: !canContinue,
1753
+ variant: props.buttonVariant,
1754
+ size: "md",
1755
+ label: buttonText
1631
1756
  })]
1632
1757
  })] });
1633
1758
  }
1634
- function SelectionNote({ text }) {
1635
- return text ? /* @__PURE__ */ jsx("p", {
1636
- className: "er-text er-text--muted",
1637
- children: text
1638
- }) : null;
1759
+ /** Stripe owns the Pay button, so the payment footer offers only the way back. */
1760
+ function PaymentActions(props) {
1761
+ return /* @__PURE__ */ jsx("div", {
1762
+ className: "rb-wizard-actions rb-wizard-actions--back-only er-actions",
1763
+ children: /* @__PURE__ */ jsx("button", {
1764
+ type: "button",
1765
+ onClick: props.wizard.paymentController.check,
1766
+ className: "er-back-btn",
1767
+ children: "← Back"
1768
+ })
1769
+ });
1639
1770
  }
1640
- /**
1641
- * Ticket Selection Step
1642
- *
1643
- * Allows users to select how many tickets they want for the selected event.
1644
- * Respects both max tickets per registration and available spots.
1645
- *
1646
- * Can use either a full PublicEvent or just occurrence context (when on event page).
1647
- */
1648
- const TicketSelectionStep = ({ purpose, event, display, occurrenceContext: _occurrenceContext, selectedAttendanceMode = null, onAttendanceModeChange, ticketsCount, maxTickets, placesCeiling, visibleTicketTypes: visibleTicketTypesOverride, overallRemainingPlaces, heldPlacesBySelection, ticketSelections = [], onTicketSelectionsChange, slidingScale = null, selectedSlidingAmountInput = "", slidingScaleSelectionMessage = null, onSlidingAmountChange, onTicketsChange, bookingUnit = { kind: "ticket" }, selectionNote, invitation = null }) => {
1649
- const unit = bookingUnit.kind;
1650
- const deliveryMode = event?.deliveryMode ?? "in_person";
1651
- const attendanceModes = event?.attendanceModes ?? [];
1652
- const { availableSpots, isSoldOut, canJoinWaitlist, eventAvailabilityLabel } = getTicketSelectionCapacity(event, selectedAttendanceMode, display, invitation);
1653
- const { mode: eventPricingMode, currency: eventPricingCurrency } = resolveTicketSelectionPricing(event);
1654
- const usesTicketTypes = eventPricingMode === "tiered";
1655
- const visibleTicketTypes = usesTicketTypes ? visibleTicketTypesOverride ?? getVisibleTicketTypes({
1656
- event,
1657
- eligibility: null,
1658
- selectedAttendanceMode,
1659
- ticketSelections
1660
- }) : [];
1661
- const noVisibleTicketTypes = usesTicketTypes && visibleTicketTypes.length === 0;
1662
- const hasAvailableTicketTypes = usesTicketTypes && visibleTicketTypes.some((ticketType) => canRequestTicketOption(ticketType.availability, purpose));
1663
- const maxAllowed = maxTickets;
1664
- if (deliveryMode === "hybrid" && !selectedAttendanceMode) return /* @__PURE__ */ jsxs("div", {
1771
+ function EventRegistrationWizardActions(props) {
1772
+ const { wizard } = props;
1773
+ switch (wizard.step) {
1774
+ case "error":
1775
+ case "success":
1776
+ case "submitting":
1777
+ case "verifying-payment":
1778
+ case "verifying-timeout":
1779
+ case "payment-status":
1780
+ case "payment-failed": return null;
1781
+ case "select-event": return /* @__PURE__ */ jsx(SelectDateActions, { ...props });
1782
+ case "select-tickets": return /* @__PURE__ */ jsx(SelectTicketsActions, { ...props });
1783
+ case "enter-details": return /* @__PURE__ */ jsx(EnterDetailsActions, { ...props });
1784
+ case "select-payment": return /* @__PURE__ */ jsx(SelectPaymentActions, { ...props });
1785
+ case "payment": return /* @__PURE__ */ jsx(PaymentActions, { ...props });
1786
+ default: return null;
1787
+ }
1788
+ }
1789
+ //#endregion
1790
+ //#region ../blocks/src/system/runtime/nodes/event-registration/PaymentBlockingPanel.tsx
1791
+ function MissingEligibilityPanel() {
1792
+ return /* @__PURE__ */ jsx("div", {
1665
1793
  className: "rb-reg-stack er-stack",
1666
- children: [
1667
- /* @__PURE__ */ jsx("h3", {
1668
- tabIndex: -1,
1669
- className: "er-title",
1670
- children: "How will you attend?"
1671
- }),
1672
- /* @__PURE__ */ jsx(AttendanceModeTiles, {
1673
- tiles: eventAttendanceModeTiles(attendanceModes, display),
1674
- selectedAttendanceMode: null,
1675
- onAttendanceModeChange
1676
- }),
1677
- /* @__PURE__ */ jsx("p", {
1678
- className: "er-text er-text--muted",
1679
- children: "Choose whether you want to attend in person or online."
1794
+ children: /* @__PURE__ */ jsx("div", {
1795
+ className: "er-center",
1796
+ children: /* @__PURE__ */ jsx("p", {
1797
+ className: "er-text er-error",
1798
+ children: "We couldn’t load the booking options for this event. Please refresh this page and try again. If this keeps happening, contact the organiser for help."
1680
1799
  })
1681
- ]
1800
+ })
1682
1801
  });
1683
- if (!eventPricingCurrency) return /* @__PURE__ */ jsx("div", {
1684
- className: "rb-reg-stack er-stack",
1685
- children: /* @__PURE__ */ jsx("p", {
1802
+ }
1803
+ function UnavailableEntitlementMessage(props) {
1804
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1805
+ /* @__PURE__ */ jsx("p", {
1806
+ className: "er-text er-error",
1807
+ children: "This event requires a valid pass or membership to register."
1808
+ }),
1809
+ props.eligibility.eventAcceptsPasses && !props.eligibility.eventAcceptsMemberships && /* @__PURE__ */ jsx("p", {
1686
1810
  className: "er-text er-text--muted",
1687
- children: "Pricing is unavailable for this event right now."
1811
+ children: "You need a pass with credits for this event category."
1812
+ }),
1813
+ props.eligibility.eventAcceptsMemberships && !props.eligibility.eventAcceptsPasses && /* @__PURE__ */ jsx("p", {
1814
+ className: "er-text er-text--muted",
1815
+ children: "You need an active membership for this event category."
1688
1816
  })
1817
+ ] });
1818
+ }
1819
+ /** Places remain, just fewer than this booking asks for (issue 1581). */
1820
+ function FewerPlacesPaymentPanel(props) {
1821
+ return /* @__PURE__ */ jsxs("div", {
1822
+ className: "rb-reg-stack er-stack",
1823
+ children: [/* @__PURE__ */ jsx("h3", {
1824
+ className: "er-title",
1825
+ children: props.heading
1826
+ }), /* @__PURE__ */ jsx("div", {
1827
+ className: "er-center",
1828
+ children: /* @__PURE__ */ jsx("p", {
1829
+ className: "er-text er-text--muted",
1830
+ children: props.message
1831
+ })
1832
+ })]
1689
1833
  });
1834
+ }
1835
+ function SoldOutPaymentPanel() {
1690
1836
  return /* @__PURE__ */ jsxs("div", {
1691
1837
  className: "rb-reg-stack er-stack",
1692
- children: [
1693
- deliveryMode === "hybrid" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h3", {
1694
- tabIndex: -1,
1695
- className: "er-title",
1696
- children: "How will you attend?"
1697
- }), /* @__PURE__ */ jsx(AttendanceModeTiles, {
1698
- tiles: eventAttendanceModeTiles(attendanceModes, display),
1699
- selectedAttendanceMode,
1700
- onAttendanceModeChange
1701
- })] }) : null,
1702
- usesTicketTypes ? /* @__PURE__ */ jsx(Fragment, { children: noVisibleTicketTypes ? /* @__PURE__ */ jsx("p", {
1838
+ children: [/* @__PURE__ */ jsx("h3", {
1839
+ className: "er-title",
1840
+ children: "Sold out"
1841
+ }), /* @__PURE__ */ jsx("div", {
1842
+ className: "er-center",
1843
+ children: /* @__PURE__ */ jsx("p", {
1703
1844
  className: "er-text er-text--muted",
1704
- children: "No ticket types are currently available."
1705
- }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1706
- /* @__PURE__ */ jsxs("h3", {
1707
- tabIndex: -1,
1708
- className: "er-title",
1709
- children: ["Choose ", unit === "place" ? "your places" : "tickets"]
1845
+ children: "This event is fully booked and there is no waitlist available for this booking."
1846
+ })
1847
+ })]
1848
+ });
1849
+ }
1850
+ function IneligiblePaymentPanel(props) {
1851
+ const promptLogin = shouldPromptForLogin("not-eligible", props.isAuthenticated, props.eligibility);
1852
+ return /* @__PURE__ */ jsxs("div", {
1853
+ className: "rb-reg-stack er-stack",
1854
+ children: [/* @__PURE__ */ jsx("h3", {
1855
+ className: "er-title",
1856
+ children: promptLogin ? "Log in required" : "Payment required"
1857
+ }), /* @__PURE__ */ jsx("div", {
1858
+ className: "er-center",
1859
+ children: promptLogin ? /* @__PURE__ */ jsxs(Fragment, { children: [
1860
+ /* @__PURE__ */ jsx("p", {
1861
+ className: "er-text er-text--muted",
1862
+ children: "Have a pass or membership? Log in to use it."
1710
1863
  }),
1711
- /* @__PURE__ */ jsx(BookingUnitSessionHint, { bookingUnit }),
1712
- /* @__PURE__ */ jsx(TicketTypeQuantityRows, {
1713
- purpose,
1714
- display,
1715
- ticketTypes: visibleTicketTypes,
1716
- ticketSelections,
1717
- maxTickets,
1718
- heldPlacesBySelection,
1719
- availableSpots: resolveRemainingPlacesOverride(overallRemainingPlaces, availableSpots),
1720
- availabilityLabel: eventAvailabilityLabel,
1721
- currency: eventPricingCurrency,
1722
- hasAvailableTicketTypes,
1723
- onTicketSelectionsChange,
1724
- bookingUnit: unit
1725
- })
1726
- ] }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1727
- slidingScale ? /* @__PURE__ */ jsx(SlidingScaleAmountField, {
1728
- slidingScale,
1729
- currency: eventPricingCurrency,
1730
- value: selectedSlidingAmountInput,
1731
- message: slidingScaleSelectionMessage,
1732
- onChange: onSlidingAmountChange
1733
- }) : null,
1734
- /* @__PURE__ */ jsx(BookingUnitSessionHint, { bookingUnit }),
1735
- /* @__PURE__ */ jsx(PlaceCounter, {
1736
- ticketsCount,
1737
- ceiling: placesCeiling ?? maxAllowed,
1738
- availableSpots,
1739
- availabilityLabel: eventAvailabilityLabel,
1740
- waitlist: canJoinWaitlist,
1741
- onTicketsChange
1864
+ /* @__PURE__ */ jsx(ThemedButton, {
1865
+ type: "button",
1866
+ variant: "primary",
1867
+ size: "md",
1868
+ label: "Email me a login link",
1869
+ disabled: !props.email.trim(),
1870
+ onClick: props.onRequestLogin
1871
+ }),
1872
+ !props.email.trim() && /* @__PURE__ */ jsx("p", {
1873
+ className: "er-text er-text--muted",
1874
+ children: "Enter your email to request a login link."
1742
1875
  })
1743
- ] }),
1744
- /* @__PURE__ */ jsx(SelectionNote, { text: selectionNote }),
1745
- /* @__PURE__ */ jsx(PlacesNote, {
1746
- invitation,
1747
- isSoldOut,
1748
- canJoinWaitlist,
1749
- ticketsCount,
1750
- event
1876
+ ] }) : /* @__PURE__ */ jsx(UnavailableEntitlementMessage, { eligibility: props.eligibility })
1877
+ })]
1878
+ });
1879
+ }
1880
+ function renderRegistrationAvailabilityBlocker(admission) {
1881
+ const blocker = resolveRegistrationAvailabilityBlocker(admission);
1882
+ if (blocker?.kind !== "unavailable") return null;
1883
+ switch (blocker.reason) {
1884
+ case "alreadyWaitlisted": return /* @__PURE__ */ jsx(AlreadyWaitlistedPaymentPanel, {});
1885
+ case "soldOut": return /* @__PURE__ */ jsx(SoldOutPaymentPanel, {});
1886
+ case "fewerPlacesLeft": return /* @__PURE__ */ jsx(FewerPlacesPaymentPanel, {
1887
+ heading: blocker.heading,
1888
+ message: blocker.message
1889
+ });
1890
+ case "closed": return /* @__PURE__ */ jsx(ClosedPaymentPanel, {
1891
+ message: blocker.message,
1892
+ contact: admission.kind === "closed" ? admission.contact : void 0
1893
+ });
1894
+ }
1895
+ }
1896
+ function PaymentBlockingPanel(props) {
1897
+ if (props.eligibilityLoading) return /* @__PURE__ */ jsx("div", {
1898
+ className: "rb-reg-stack er-stack",
1899
+ children: /* @__PURE__ */ jsxs("div", {
1900
+ className: "er-center",
1901
+ children: [/* @__PURE__ */ jsx(SpinnerNode, {
1902
+ size: "lg",
1903
+ srLabel: "Checking payment options"
1904
+ }), /* @__PURE__ */ jsx("p", {
1905
+ className: "er-text--muted",
1906
+ children: "Checking payment options…"
1907
+ })]
1908
+ })
1909
+ });
1910
+ if (props.eligibilityError) return /* @__PURE__ */ jsx("div", {
1911
+ className: "rb-reg-stack er-stack",
1912
+ children: /* @__PURE__ */ jsx("div", {
1913
+ className: "er-center",
1914
+ children: /* @__PURE__ */ jsx("p", {
1915
+ className: "er-text er-error",
1916
+ children: props.eligibilityError
1751
1917
  })
1752
- ]
1918
+ })
1753
1919
  });
1754
- };
1755
- function PlacesNote({ invitation, isSoldOut, canJoinWaitlist, ticketsCount, event }) {
1756
- if (invitation?.kind === "held") return /* @__PURE__ */ jsx("p", {
1757
- className: "er-text",
1758
- children: heldPlaceText(ticketsCount, invitation.expiresAt, event)
1920
+ if (!props.eligibility) return /* @__PURE__ */ jsx(MissingEligibilityPanel, {});
1921
+ const availabilityPanel = renderRegistrationAvailabilityBlocker(props.admission);
1922
+ if (availabilityPanel) return availabilityPanel;
1923
+ if (props.paysNothing) return /* @__PURE__ */ jsx(FreePaymentSummary, { ticketsCount: props.ticketsCount });
1924
+ return props.eligibility.paymentOptions.length > 0 ? null : /* @__PURE__ */ jsx(IneligiblePaymentPanel, {
1925
+ eligibility: props.eligibility,
1926
+ email: props.email,
1927
+ isAuthenticated: props.isAuthenticated,
1928
+ onRequestLogin: props.onRequestLogin
1759
1929
  });
1760
- if (invitation) return null;
1761
- if (canJoinWaitlist) return /* @__PURE__ */ jsx("p", {
1762
- className: "er-text er-text--muted",
1763
- children: "This event is currently full. Continue to join the waitlist if a place opens up."
1930
+ }
1931
+ function AlreadyWaitlistedPaymentPanel() {
1932
+ return /* @__PURE__ */ jsxs("div", {
1933
+ className: "rb-reg-stack er-stack",
1934
+ children: [/* @__PURE__ */ jsx("h3", {
1935
+ className: "er-title",
1936
+ children: "Already on the waitlist"
1937
+ }), /* @__PURE__ */ jsxs("div", {
1938
+ className: "er-center",
1939
+ children: [/* @__PURE__ */ jsx("p", {
1940
+ className: "er-text er-text--muted",
1941
+ children: "You're already on the waitlist for this event."
1942
+ }), /* @__PURE__ */ jsx("a", {
1943
+ href: portalPath({ page: "bookings" }),
1944
+ className: "er-retry-btn",
1945
+ children: "View my bookings"
1946
+ })]
1947
+ })]
1764
1948
  });
1765
- return isSoldOut ? /* @__PURE__ */ jsx("p", {
1766
- className: "er-text er-text--muted",
1767
- children: "This event is fully booked."
1768
- }) : null;
1769
1949
  }
1770
- /** How long the invitation holds their place, in the event's own time zone. */
1771
- function heldPlaceText(places, expiresAt, event) {
1772
- const held = places === 1 ? "We’re holding a place for you" : `We’re holding ${places} places for you`;
1773
- return event ? `${held} until ${formatTime(expiresAt, event)} on ${formatDate(expiresAt, event)}. Continue to book before then.` : `${held}. Continue to book.`;
1950
+ function FreePaymentSummary({ ticketsCount }) {
1951
+ return /* @__PURE__ */ jsxs("div", {
1952
+ className: "rb-reg-stack er-stack",
1953
+ children: [/* @__PURE__ */ jsx("h3", {
1954
+ className: "er-title",
1955
+ children: "Payment"
1956
+ }), /* @__PURE__ */ jsxs("div", {
1957
+ className: "er-payment-summary",
1958
+ children: [/* @__PURE__ */ jsx("p", {
1959
+ className: "er-text",
1960
+ children: "This event is free!"
1961
+ }), /* @__PURE__ */ jsxs("p", {
1962
+ className: "er-text er-text--muted",
1963
+ children: [
1964
+ ticketsCount,
1965
+ " ticket",
1966
+ ticketsCount > 1 ? "s" : ""
1967
+ ]
1968
+ })]
1969
+ })]
1970
+ });
1774
1971
  }
1775
- function resolveRemainingPlacesOverride(override, cached) {
1776
- return override === void 0 ? cached : override;
1972
+ /** Why this can't be paid for here, and who to contact when the business can take the booking directly. */
1973
+ function ClosedPaymentPanel({ message, contact }) {
1974
+ return /* @__PURE__ */ jsx("div", {
1975
+ className: "rb-reg-stack er-stack",
1976
+ children: /* @__PURE__ */ jsxs("div", {
1977
+ className: "er-center",
1978
+ children: [/* @__PURE__ */ jsx("p", {
1979
+ className: "er-text er-error",
1980
+ children: message
1981
+ }), contact ? /* @__PURE__ */ jsx(OrganiserContactLine, { contact }) : null]
1982
+ })
1983
+ });
1984
+ }
1985
+ //#endregion
1986
+ //#region ../blocks/src/system/runtime/nodes/event-registration/existingBookingsSummary.ts
1987
+ function places(count) {
1988
+ return count === 1 ? "1 place" : `${count} places`;
1989
+ }
1990
+ /** Only confirmed bookings come back for a date; waitlist places have their own notice. */
1991
+ function summariseExistingBookings(registrations) {
1992
+ const [only] = registrations;
1993
+ if (!only) return { kind: "none" };
1994
+ if (registrations.length === 1) return {
1995
+ kind: "booked",
1996
+ detail: only.ticketBreakdown ?? places(only.ticketsCount)
1997
+ };
1998
+ const placeCount = registrations.reduce((total, registration) => total + registration.ticketsCount, 0);
1999
+ return {
2000
+ kind: "booked",
2001
+ detail: `${registrations.length} bookings · ${places(placeCount)}`
2002
+ };
1777
2003
  }
1778
2004
  //#endregion
1779
2005
  //#region ../blocks/src/system/runtime/nodes/event-registration/SeveralRunsTicketStep.tsx
@@ -1969,13 +2195,6 @@ function Totals(props) {
1969
2195
  })]
1970
2196
  });
1971
2197
  }
1972
- /**
1973
- * What several items cost, above the payment choice (issue 1725): the items
1974
- * and places as a caption, each item at what all its places cost, then the
1975
- * total (after a subtotal and any code when something comes off). With
1976
- * combination prices the items are grouped by combination, with the note
1977
- * and saving under the list.
1978
- */
1979
2198
  function SelectionPaymentSummary(props) {
1980
2199
  const { summary, currency } = props;
1981
2200
  const money = (cents) => formatCurrencyAmount(cents, currency);
@@ -1987,11 +2206,7 @@ function SelectionPaymentSummary(props) {
1987
2206
  return /* @__PURE__ */ jsxs("div", {
1988
2207
  className: "rb-reg-stack er-stack er-selection-payment-summary",
1989
2208
  children: [
1990
- /* @__PURE__ */ jsx("h3", {
1991
- tabIndex: -1,
1992
- className: "er-title",
1993
- children: "Your booking"
1994
- }),
2209
+ /* @__PURE__ */ jsx(SummaryHeading, { changeDates: props.changeDates }),
1995
2210
  /* @__PURE__ */ jsxs("div", {
1996
2211
  className: "er-confirmation-summary er-selection-payment",
1997
2212
  children: [
@@ -2026,6 +2241,293 @@ function SelectionPaymentSummary(props) {
2026
2241
  ]
2027
2242
  });
2028
2243
  }
2244
+ /** "Your booking", with "Change dates" beside it when the dates can be changed from here. */
2245
+ function SummaryHeading(props) {
2246
+ return /* @__PURE__ */ jsx(StepHeading, {
2247
+ title: "Your booking",
2248
+ changeDates: props.changeDates
2249
+ });
2250
+ }
2251
+ /** A payment step heading, with "Change date(s)" beside it when the dates can be changed from here. */
2252
+ function StepHeading(props) {
2253
+ const heading = /* @__PURE__ */ jsx("h3", {
2254
+ tabIndex: -1,
2255
+ className: "er-title",
2256
+ children: props.title
2257
+ });
2258
+ if (!props.changeDates) return heading;
2259
+ return /* @__PURE__ */ jsxs("div", {
2260
+ className: "er-confirmation-summary__row",
2261
+ children: [heading, /* @__PURE__ */ jsx("button", {
2262
+ type: "button",
2263
+ className: "er-portal-auth-link",
2264
+ onClick: props.changeDates.onChange,
2265
+ children: props.changeDates.label
2266
+ })]
2267
+ });
2268
+ }
2269
+ /**
2270
+ * Dates paid with a pass or membership (issue 1767, sets 6 and 7): each date with
2271
+ * "1 credit", "Included" or its price, a bought pass on its own line, then
2272
+ * what comes from the pass and what's left to pay.
2273
+ */
2274
+ function FundedPaymentSummary(props) {
2275
+ const { summary } = props;
2276
+ return /* @__PURE__ */ jsxs("div", {
2277
+ className: "rb-reg-stack er-stack er-selection-payment-summary",
2278
+ children: [/* @__PURE__ */ jsx(SummaryHeading, { changeDates: props.changeDates }), /* @__PURE__ */ jsxs("div", {
2279
+ className: "er-confirmation-summary er-selection-payment",
2280
+ children: [
2281
+ /* @__PURE__ */ jsx("p", {
2282
+ className: "er-selection-payment__caption",
2283
+ children: summary.caption
2284
+ }),
2285
+ /* @__PURE__ */ jsx("dl", {
2286
+ className: "er-selection-payment__lines",
2287
+ children: summary.lines.map((line) => /* @__PURE__ */ jsxs("div", {
2288
+ className: "er-confirmation-summary__row",
2289
+ children: [/* @__PURE__ */ jsxs("dt", { children: [line.label, line.note ? /* @__PURE__ */ jsx("span", {
2290
+ className: "er-selection-payment__multiplier",
2291
+ children: line.note
2292
+ }) : null] }), /* @__PURE__ */ jsx("dd", { children: line.value })]
2293
+ }, line.key))
2294
+ }),
2295
+ summary.totals.length > 0 ? /* @__PURE__ */ jsx("dl", {
2296
+ className: "er-selection-payment__lines er-selection-payment__totals",
2297
+ children: summary.totals.map((row) => /* @__PURE__ */ jsxs("div", {
2298
+ className: row.total ? "er-confirmation-summary__row er-selection-payment__total" : "er-confirmation-summary__row",
2299
+ children: [/* @__PURE__ */ jsx("dt", { children: row.label }), /* @__PURE__ */ jsx("dd", { children: row.value })]
2300
+ }, row.key))
2301
+ }) : null
2302
+ ]
2303
+ })]
2304
+ });
2305
+ }
2306
+ //#endregion
2307
+ //#region ../blocks/src/system/runtime/nodes/event-registration/SiteCreditPreviewPanel.tsx
2308
+ function SiteCreditPreviewPanel(props) {
2309
+ const { preview } = props;
2310
+ if (preview.kind === "not_authenticated" || preview.kind === "not_applicable" || preview.kind === "no_credit") return null;
2311
+ if (preview.kind === "loading") return /* @__PURE__ */ jsx("div", {
2312
+ className: "er-payment-summary",
2313
+ "aria-live": "polite",
2314
+ children: /* @__PURE__ */ jsx("p", {
2315
+ className: "er-text er-text--muted",
2316
+ children: "Checking your site credit…"
2317
+ })
2318
+ });
2319
+ if (preview.kind === "unavailable") return /* @__PURE__ */ jsx("div", {
2320
+ className: "er-payment-summary",
2321
+ role: "status",
2322
+ children: /* @__PURE__ */ jsx("p", {
2323
+ className: "er-text er-text--muted",
2324
+ children: "We couldn't check your site credit just now. We'll check again before payment."
2325
+ })
2326
+ });
2327
+ if (preview.kind === "currency_mismatch") return /* @__PURE__ */ jsxs("div", {
2328
+ className: "er-payment-summary",
2329
+ role: "status",
2330
+ children: [/* @__PURE__ */ jsx("h4", {
2331
+ className: "er-title",
2332
+ children: "Your site credit"
2333
+ }), /* @__PURE__ */ jsxs("p", {
2334
+ className: "er-text er-text--muted",
2335
+ children: [
2336
+ "You have",
2337
+ " ",
2338
+ formatPrice(preview.availableCreditCents, preview.creditCurrency),
2339
+ " ",
2340
+ "in site credit, but it can't be used for this",
2341
+ " ",
2342
+ props.currency.toUpperCase(),
2343
+ " booking."
2344
+ ]
2345
+ })]
2346
+ });
2347
+ return /* @__PURE__ */ jsxs("div", {
2348
+ className: "er-payment-summary",
2349
+ "aria-live": "polite",
2350
+ children: [
2351
+ /* @__PURE__ */ jsx("h4", {
2352
+ className: "er-title",
2353
+ children: "Your site credit"
2354
+ }),
2355
+ /* @__PURE__ */ jsxs("p", {
2356
+ className: "er-text",
2357
+ children: ["Available: ", formatPrice(preview.availableCreditCents, props.currency)]
2358
+ }),
2359
+ /* @__PURE__ */ jsx("p", {
2360
+ className: "er-text",
2361
+ children: preview.outcome === "credit_only" ? `Your credit covers this registration. ${formatPrice(preview.appliedCreditCents, props.currency)} will be used and no card payment is needed.` : preview.cardDueNowCents === 0 ? `${formatPrice(preview.appliedCreditCents, props.currency)} will be applied automatically. No card payment is needed today.` : `${formatPrice(preview.appliedCreditCents, props.currency)} will be applied automatically. ${formatPrice(preview.cardDueNowCents, props.currency)} is due by card today.`
2362
+ }),
2363
+ preview.laterBalanceCents > 0 && /* @__PURE__ */ jsxs("p", {
2364
+ className: "er-text er-text--muted",
2365
+ children: [
2366
+ "Remaining balance after today:",
2367
+ " ",
2368
+ formatPrice(preview.laterBalanceCents, props.currency)
2369
+ ]
2370
+ }),
2371
+ preview.remainingCreditCents > 0 && /* @__PURE__ */ jsxs("p", {
2372
+ className: "er-text er-text--muted",
2373
+ children: [
2374
+ "Credit left afterwards:",
2375
+ " ",
2376
+ formatPrice(preview.remainingCreditCents, props.currency)
2377
+ ]
2378
+ }),
2379
+ preview.manualDiscountPending && /* @__PURE__ */ jsx("p", {
2380
+ className: "er-text er-text--muted",
2381
+ children: "We'll recalculate these amounts after your discount code is checked."
2382
+ })
2383
+ ]
2384
+ });
2385
+ }
2386
+ //#endregion
2387
+ //#region ../blocks/src/system/runtime/nodes/event-registration/SelectionFundingStep.tsx
2388
+ const PAY_HEADING = "How would you like to pay?";
2389
+ /**
2390
+ * The payment step for dates, one or several (issue 1767, sets 6 and 7): the
2391
+ * server's ways to pay in its order, then "Your booking", which breaks the choice
2392
+ * down. The breakdown follows the choice because it's the choice's result. One
2393
+ * date drops it when the chosen option and the button already say it all.
2394
+ */
2395
+ function SelectionFundingStep(props) {
2396
+ const { model } = props;
2397
+ const oneDate = model.dateCount === 1;
2398
+ if (model.status === "failed") return /* @__PURE__ */ jsx(FundingLoadFailed, {
2399
+ oneDate,
2400
+ retry: model.retry
2401
+ });
2402
+ const view = model.view;
2403
+ if (model.status === "loading" || !view) return /* @__PURE__ */ jsx(FundingLoading, {});
2404
+ const changeDates = props.onChangeDates ? {
2405
+ label: oneDate ? "Change date" : "Change dates",
2406
+ onChange: props.onChangeDates
2407
+ } : void 0;
2408
+ return /* @__PURE__ */ jsx(LoadedFundingStep, {
2409
+ ...props,
2410
+ view,
2411
+ oneDate,
2412
+ changeDates
2413
+ });
2414
+ }
2415
+ function LoadedFundingStep(props) {
2416
+ const { model, view, changeDates } = props;
2417
+ const layout = fundingStepLayout(view, props.oneDate, props.cardSummary !== null);
2418
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2419
+ model.notice ? /* @__PURE__ */ jsx("p", {
2420
+ role: "alert",
2421
+ className: "er-error er-funding-notice",
2422
+ children: model.notice
2423
+ }) : null,
2424
+ props.signInPrompt,
2425
+ layout.options ? /* @__PURE__ */ jsxs("div", {
2426
+ className: "rb-reg-stack er-stack er-funding-options",
2427
+ children: [/* @__PURE__ */ jsx(StepHeading, { title: PAY_HEADING }), /* @__PURE__ */ jsx(PaymentChoiceRows, {
2428
+ label: PAY_HEADING,
2429
+ rows: view.rows.map((row) => ({
2430
+ id: row.key,
2431
+ label: row.label,
2432
+ details: row.details,
2433
+ price: row.price,
2434
+ selected: row.selected,
2435
+ onSelect: () => model.choose(row)
2436
+ }))
2437
+ })]
2438
+ }) : null,
2439
+ view.option.kind === "money" ? /* @__PURE__ */ jsx(SiteCreditPreviewPanel, {
2440
+ preview: props.creditPreview,
2441
+ currency: props.currency
2442
+ }) : null,
2443
+ view.note ? /* @__PURE__ */ jsx("p", {
2444
+ className: "er-entitlement-note",
2445
+ children: view.note
2446
+ }) : null,
2447
+ props.afterOptions,
2448
+ layout.breakdown ? /* @__PURE__ */ jsx("div", {
2449
+ className: "er-funding-breakdown",
2450
+ children: /* @__PURE__ */ jsx(FundingSummary, {
2451
+ summary: view.summary,
2452
+ cardSummary: props.cardSummary,
2453
+ currency: props.currency,
2454
+ changeDates: layout.changeDatesOn === "breakdown" ? changeDates : void 0
2455
+ })
2456
+ }) : null,
2457
+ layout.changeDatesOn === "alone" && changeDates ? /* @__PURE__ */ jsx("p", {
2458
+ className: "er-text er-funding-change-dates",
2459
+ children: /* @__PURE__ */ jsx("button", {
2460
+ type: "button",
2461
+ className: "er-portal-auth-link",
2462
+ onClick: changeDates.onChange,
2463
+ children: changeDates.label
2464
+ })
2465
+ }) : null
2466
+ ] });
2467
+ }
2468
+ /**
2469
+ * Which parts the step shows. The breakdown always shows for several dates, and
2470
+ * when nothing else describes the payment. One date with ways to pay shows it
2471
+ * only when it explains a reduction the option's row doesn't.
2472
+ */
2473
+ function fundingStepLayout(view, oneDate, hasCardSummary) {
2474
+ const options = showsPaymentOptions(view);
2475
+ const explains = view.summary !== null && summaryExplainsMoreThanTheOption(view.summary);
2476
+ const breakdown = (!oneDate || !options || explains) && (view.summary !== null || hasCardSummary);
2477
+ return {
2478
+ options,
2479
+ breakdown,
2480
+ changeDatesOn: breakdown ? "breakdown" : "alone"
2481
+ };
2482
+ }
2483
+ function showsPaymentOptions(view) {
2484
+ return view.rows.length > 1 || view.option.kind === "money" && view.takesPayment;
2485
+ }
2486
+ function FundingLoadFailed(props) {
2487
+ return /* @__PURE__ */ jsxs("div", {
2488
+ className: "rb-reg-stack er-stack",
2489
+ role: "alert",
2490
+ children: [/* @__PURE__ */ jsx("p", {
2491
+ className: "er-text er-error",
2492
+ children: props.oneDate ? ONE_DATE_FUNDING_LOAD_FAILED : SELECTION_FUNDING_LOAD_FAILED
2493
+ }), /* @__PURE__ */ jsx("p", {
2494
+ className: "er-text",
2495
+ children: /* @__PURE__ */ jsx("button", {
2496
+ type: "button",
2497
+ className: "er-portal-auth-link",
2498
+ onClick: props.retry,
2499
+ children: "Try again"
2500
+ })
2501
+ })]
2502
+ });
2503
+ }
2504
+ function FundingLoading() {
2505
+ return /* @__PURE__ */ jsx("div", {
2506
+ className: "rb-reg-stack er-stack",
2507
+ children: /* @__PURE__ */ jsxs("div", {
2508
+ className: "er-center",
2509
+ children: [/* @__PURE__ */ jsx(SpinnerNode, {
2510
+ size: "lg",
2511
+ srLabel: "Checking payment options"
2512
+ }), /* @__PURE__ */ jsx("p", {
2513
+ className: "er-text--muted",
2514
+ children: "Checking payment options…"
2515
+ })]
2516
+ })
2517
+ });
2518
+ }
2519
+ /** A pass or membership's own summary, or the card step's for the money option. */
2520
+ function FundingSummary(props) {
2521
+ if (props.summary) return /* @__PURE__ */ jsx(FundedPaymentSummary, {
2522
+ summary: props.summary,
2523
+ changeDates: props.changeDates
2524
+ });
2525
+ return props.cardSummary ? /* @__PURE__ */ jsx(SelectionPaymentSummary, {
2526
+ summary: props.cardSummary,
2527
+ currency: props.currency,
2528
+ changeDates: props.changeDates
2529
+ }) : null;
2530
+ }
2029
2531
  //#endregion
2030
2532
  //#region ../blocks/src/system/runtime/nodes/event-registration/EventSelectionStep.tsx
2031
2533
  /** Dates in order, grouped by the month and year they fall in, both in the date's own zone. */
@@ -2117,14 +2619,23 @@ function DateSelectionList(props) {
2117
2619
  */
2118
2620
  const EventSelectionStep = (props) => {
2119
2621
  const { events, selectedEvent, onSelect, onChoose, display } = props;
2120
- if ("selection" in props) return /* @__PURE__ */ jsx(SeveralSelection, {
2121
- items: props.mode.items,
2122
- events,
2123
- selection: props.selection,
2124
- display,
2125
- onToggle: props.onToggle,
2126
- onJoinWaitlist: props.onJoinWaitlist
2127
- });
2622
+ if ("selection" in props) {
2623
+ const rows = {
2624
+ selection: props.selection,
2625
+ display,
2626
+ onToggle: props.onToggle,
2627
+ onJoinWaitlist: props.onJoinWaitlist
2628
+ };
2629
+ return props.pageDate ? /* @__PURE__ */ jsx(PageDateFirstSelection, {
2630
+ pageDate: props.pageDate,
2631
+ events,
2632
+ rows
2633
+ }) : /* @__PURE__ */ jsx(SeveralSelection, {
2634
+ items: props.mode.items,
2635
+ events,
2636
+ rows
2637
+ });
2638
+ }
2128
2639
  if (getEventSelectionMode(events) === "date") return /* @__PURE__ */ jsxs("div", {
2129
2640
  className: "rb-reg-stack er-stack",
2130
2641
  children: [
@@ -2236,19 +2747,51 @@ const SEVERAL_HEADINGS = {
2236
2747
  label: "What to book"
2237
2748
  }
2238
2749
  };
2239
- /**
2240
- * Booking several (issue 1725): one checkbox row per date or run. A full row
2241
- * can't be ticked; when it has a waitlist, its link books that one item.
2242
- */
2243
- function SeveralSelection(props) {
2244
- const heading = SEVERAL_HEADINGS[props.items];
2245
- const sorted = [...props.events].sort((left, right) => Date.parse(left.startsAt) - Date.parse(right.startsAt));
2750
+ function byStart(left, right) {
2751
+ return Date.parse(left.startsAt) - Date.parse(right.startsAt);
2752
+ }
2753
+ /** One checkbox row per item, under month labels when dates span more than one month. */
2754
+ function SeveralOptionList(props) {
2755
+ const sorted = [...props.events].sort(byStart);
2246
2756
  const groups = props.items === "dates" ? groupByMonth(sorted) : [{
2247
2757
  key: "runs",
2248
2758
  label: "",
2249
2759
  events: sorted
2250
2760
  }];
2251
2761
  const showMonths = groups.length > 1;
2762
+ const { rows } = props;
2763
+ return /* @__PURE__ */ jsx("div", {
2764
+ className: "er-date-list",
2765
+ role: "group",
2766
+ "aria-label": props.label,
2767
+ children: groups.map((group) => /* @__PURE__ */ jsxs(React.Fragment, { children: [showMonths ? /* @__PURE__ */ jsx("p", {
2768
+ className: "er-date-list__month",
2769
+ "aria-hidden": "true",
2770
+ children: group.label
2771
+ }) : null, group.events.map((event) => /* @__PURE__ */ jsx(SeveralOption, {
2772
+ items: props.items,
2773
+ event,
2774
+ checked: selectionIncludes(rows.selection, event),
2775
+ canToggle: canToggleSelectionItem(rows.selection, event),
2776
+ display: rows.display,
2777
+ onToggle: rows.onToggle,
2778
+ onJoinWaitlist: rows.onJoinWaitlist
2779
+ }, event.selectionId))] }, group.key))
2780
+ });
2781
+ }
2782
+ function SelectionLimitNote({ selection }) {
2783
+ return selectionAtLimit(selection) ? /* @__PURE__ */ jsx("p", {
2784
+ className: "er-text er-text--muted",
2785
+ role: "status",
2786
+ children: SELECTION_LIMIT_NOTE
2787
+ }) : null;
2788
+ }
2789
+ /**
2790
+ * Booking several (issue 1725): one checkbox row per date or run. A full row
2791
+ * can't be ticked; when it has a waitlist, its link books that one item.
2792
+ */
2793
+ function SeveralSelection(props) {
2794
+ const heading = SEVERAL_HEADINGS[props.items];
2252
2795
  return /* @__PURE__ */ jsxs("div", {
2253
2796
  className: "rb-reg-stack er-stack",
2254
2797
  children: [
@@ -2263,29 +2806,53 @@ function SeveralSelection(props) {
2263
2806
  }),
2264
2807
  /* @__PURE__ */ jsx(BookingCloseLine, { events: props.events }),
2265
2808
  /* @__PURE__ */ jsx(CombinationOfferLine, { parts: combinationOfferLine(combinationOffersOf(props.events)) }),
2266
- /* @__PURE__ */ jsx("div", {
2267
- className: "er-date-list",
2268
- role: "group",
2269
- "aria-label": heading.label,
2270
- children: groups.map((group) => /* @__PURE__ */ jsxs(React.Fragment, { children: [showMonths ? /* @__PURE__ */ jsx("p", {
2271
- className: "er-date-list__month",
2272
- "aria-hidden": "true",
2273
- children: group.label
2274
- }) : null, group.events.map((event) => /* @__PURE__ */ jsx(SeveralOption, {
2275
- items: props.items,
2276
- event,
2277
- checked: selectionIncludes(props.selection, event),
2278
- canToggle: canToggleSelectionItem(props.selection, event),
2279
- display: props.display,
2280
- onToggle: props.onToggle,
2281
- onJoinWaitlist: props.onJoinWaitlist
2282
- }, event.selectionId))] }, group.key))
2809
+ /* @__PURE__ */ jsx(SeveralOptionList, {
2810
+ items: props.items,
2811
+ events: props.events,
2812
+ label: heading.label,
2813
+ rows: props.rows
2283
2814
  }),
2284
- selectionAtLimit(props.selection) ? /* @__PURE__ */ jsx("p", {
2285
- className: "er-text er-text--muted",
2286
- role: "status",
2287
- children: SELECTION_LIMIT_NOTE
2288
- }) : null
2815
+ /* @__PURE__ */ jsx(SelectionLimitNote, { selection: props.rows.selection })
2816
+ ]
2817
+ });
2818
+ }
2819
+ /**
2820
+ * A date's own page: its date comes first, ticked to start with, and the
2821
+ * class's other dates follow as the class's own page lists them.
2822
+ */
2823
+ function PageDateFirstSelection(props) {
2824
+ const others = props.events.filter((event) => event.selectionId !== props.pageDate.selectionId);
2825
+ return /* @__PURE__ */ jsxs("div", {
2826
+ className: "rb-reg-stack er-stack",
2827
+ children: [
2828
+ /* @__PURE__ */ jsx("h3", {
2829
+ tabIndex: -1,
2830
+ className: "er-title",
2831
+ children: "Your date"
2832
+ }),
2833
+ /* @__PURE__ */ jsx(SeveralOptionList, {
2834
+ items: "dates",
2835
+ events: [props.pageDate],
2836
+ label: "Your date",
2837
+ rows: props.rows
2838
+ }),
2839
+ /* @__PURE__ */ jsx("h3", {
2840
+ className: "er-title er-title--sub",
2841
+ children: "Add more dates"
2842
+ }),
2843
+ /* @__PURE__ */ jsx("p", {
2844
+ className: "er-text er-text--muted er-selection-lede",
2845
+ children: "Tick any others you’d like to book at the same time."
2846
+ }),
2847
+ /* @__PURE__ */ jsx(BookingCloseLine, { events: props.events }),
2848
+ /* @__PURE__ */ jsx(CombinationOfferLine, { parts: combinationOfferLine(combinationOffersOf(props.events)) }),
2849
+ /* @__PURE__ */ jsx(SeveralOptionList, {
2850
+ items: "dates",
2851
+ events: others,
2852
+ label: "More dates",
2853
+ rows: props.rows
2854
+ }),
2855
+ /* @__PURE__ */ jsx(SelectionLimitNote, { selection: props.rows.selection })
2289
2856
  ]
2290
2857
  });
2291
2858
  }
@@ -2300,17 +2867,17 @@ function CombinationOfferLine(props) {
2300
2867
  function runPriceLabel(event) {
2301
2868
  return publicEventPricingCurrency(event.pricing) === null ? null : formatEventPriceDisplay(event.pricing).trim() || null;
2302
2869
  }
2303
- /** The words on a row: a date and time for dates, a title, schedule and price for runs. */
2870
+ /** The words on a row: a date and its time for dates; a title, schedule lines, venue and price for runs. */
2304
2871
  function severalOptionText(items, event, display) {
2305
2872
  if (items === "dates") return {
2306
2873
  title: formatBookingWhen(event, "dayLong"),
2307
- detail: formatBookingWhen(event, "timeRange"),
2874
+ lines: [formatBookingWhen(event, "timeRange")],
2308
2875
  price: null
2309
2876
  };
2310
- const detail = [formatRegistrationSchedule(event), shownVenue(event, display)].filter(Boolean).join(" · ");
2877
+ const venue = shownVenue(event, display);
2311
2878
  return {
2312
2879
  title: event.title,
2313
- detail,
2880
+ lines: [...formatRunScheduleLines(event), ...venue ? [venue] : []],
2314
2881
  price: runPriceLabel(event)
2315
2882
  };
2316
2883
  }
@@ -2343,6 +2910,10 @@ function SeveralOptionStatus(props) {
2343
2910
  }
2344
2911
  }
2345
2912
  }
2913
+ /**
2914
+ * One row in the list: the checkbox level with the title, the details under
2915
+ * it, and places or price to the side (under the details on a phone).
2916
+ */
2346
2917
  function SeveralOption(props) {
2347
2918
  const { event } = props;
2348
2919
  const availability = selectionRowAvailability(event);
@@ -2350,10 +2921,13 @@ function SeveralOption(props) {
2350
2921
  const className = [
2351
2922
  "er-event-card",
2352
2923
  "er-date-option",
2924
+ "er-date-option--grid",
2925
+ props.items === "dates" && "er-date-option--dates",
2926
+ props.items === "runs" && "er-date-option--run",
2353
2927
  props.checked && "er-event-card--selected",
2354
2928
  !open && "er-date-option--full"
2355
2929
  ].filter(Boolean).join(" ");
2356
- const { title, detail, price } = severalOptionText(props.items, event, props.display);
2930
+ const { title, lines, price } = severalOptionText(props.items, event, props.display);
2357
2931
  const Row = availability === "waitlist" ? "div" : "label";
2358
2932
  return /* @__PURE__ */ jsxs(Row, {
2359
2933
  className,
@@ -2364,27 +2938,30 @@ function SeveralOption(props) {
2364
2938
  value: event.selectionId,
2365
2939
  checked: props.checked,
2366
2940
  disabled: !props.canToggle,
2367
- "aria-label": Row === "div" ? [title, detail].filter(Boolean).join(", ") : void 0,
2941
+ "aria-label": Row === "div" ? [title, ...lines].join(", ") : void 0,
2368
2942
  onChange: () => props.onToggle(event)
2369
2943
  }),
2944
+ /* @__PURE__ */ jsx("span", {
2945
+ className: "er-date-option__date",
2946
+ children: title
2947
+ }),
2370
2948
  /* @__PURE__ */ jsxs("span", {
2371
- className: "er-date-option__main",
2372
- children: [/* @__PURE__ */ jsx("span", {
2373
- className: "er-date-option__date",
2374
- children: title
2375
- }), detail ? /* @__PURE__ */ jsx("span", {
2376
- className: "er-date-option__time",
2377
- children: detail
2949
+ className: "er-date-option__aside",
2950
+ children: [/* @__PURE__ */ jsx(SeveralOptionStatus, {
2951
+ event,
2952
+ display: props.display,
2953
+ onJoinWaitlist: props.onJoinWaitlist
2954
+ }), price && open ? /* @__PURE__ */ jsx("span", {
2955
+ className: "er-date-option__price",
2956
+ children: price
2378
2957
  }) : null]
2379
2958
  }),
2380
- /* @__PURE__ */ jsx(SeveralOptionStatus, {
2381
- event,
2382
- display: props.display,
2383
- onJoinWaitlist: props.onJoinWaitlist
2384
- }),
2385
- price && open ? /* @__PURE__ */ jsx("span", {
2386
- className: "er-date-option__price",
2387
- children: price
2959
+ lines.length > 0 ? /* @__PURE__ */ jsx("span", {
2960
+ className: "er-date-option__body",
2961
+ children: lines.map((line) => /* @__PURE__ */ jsx("span", {
2962
+ className: "er-date-option__time",
2963
+ children: line
2964
+ }, line))
2388
2965
  }) : null
2389
2966
  ]
2390
2967
  });
@@ -2901,86 +3478,6 @@ const MembershipHero = ({ membershipName }) => {
2901
3478
  });
2902
3479
  };
2903
3480
  //#endregion
2904
- //#region ../blocks/src/system/runtime/nodes/event-registration/SiteCreditPreviewPanel.tsx
2905
- function SiteCreditPreviewPanel(props) {
2906
- const { preview } = props;
2907
- if (preview.kind === "not_authenticated" || preview.kind === "not_applicable" || preview.kind === "no_credit") return null;
2908
- if (preview.kind === "loading") return /* @__PURE__ */ jsx("div", {
2909
- className: "er-payment-summary",
2910
- "aria-live": "polite",
2911
- children: /* @__PURE__ */ jsx("p", {
2912
- className: "er-text er-text--muted",
2913
- children: "Checking your site credit…"
2914
- })
2915
- });
2916
- if (preview.kind === "unavailable") return /* @__PURE__ */ jsx("div", {
2917
- className: "er-payment-summary",
2918
- role: "status",
2919
- children: /* @__PURE__ */ jsx("p", {
2920
- className: "er-text er-text--muted",
2921
- children: "We couldn't check your site credit just now. We'll check again before payment."
2922
- })
2923
- });
2924
- if (preview.kind === "currency_mismatch") return /* @__PURE__ */ jsxs("div", {
2925
- className: "er-payment-summary",
2926
- role: "status",
2927
- children: [/* @__PURE__ */ jsx("h4", {
2928
- className: "er-title",
2929
- children: "Your site credit"
2930
- }), /* @__PURE__ */ jsxs("p", {
2931
- className: "er-text er-text--muted",
2932
- children: [
2933
- "You have",
2934
- " ",
2935
- formatPrice(preview.availableCreditCents, preview.creditCurrency),
2936
- " ",
2937
- "in site credit, but it can't be used for this",
2938
- " ",
2939
- props.currency.toUpperCase(),
2940
- " booking."
2941
- ]
2942
- })]
2943
- });
2944
- return /* @__PURE__ */ jsxs("div", {
2945
- className: "er-payment-summary",
2946
- "aria-live": "polite",
2947
- children: [
2948
- /* @__PURE__ */ jsx("h4", {
2949
- className: "er-title",
2950
- children: "Your site credit"
2951
- }),
2952
- /* @__PURE__ */ jsxs("p", {
2953
- className: "er-text",
2954
- children: ["Available: ", formatPrice(preview.availableCreditCents, props.currency)]
2955
- }),
2956
- /* @__PURE__ */ jsx("p", {
2957
- className: "er-text",
2958
- children: preview.outcome === "credit_only" ? `Your credit covers this registration. ${formatPrice(preview.appliedCreditCents, props.currency)} will be used and no card payment is needed.` : preview.cardDueNowCents === 0 ? `${formatPrice(preview.appliedCreditCents, props.currency)} will be applied automatically. No card payment is needed today.` : `${formatPrice(preview.appliedCreditCents, props.currency)} will be applied automatically. ${formatPrice(preview.cardDueNowCents, props.currency)} is due by card today.`
2959
- }),
2960
- preview.laterBalanceCents > 0 && /* @__PURE__ */ jsxs("p", {
2961
- className: "er-text er-text--muted",
2962
- children: [
2963
- "Remaining balance after today:",
2964
- " ",
2965
- formatPrice(preview.laterBalanceCents, props.currency)
2966
- ]
2967
- }),
2968
- preview.remainingCreditCents > 0 && /* @__PURE__ */ jsxs("p", {
2969
- className: "er-text er-text--muted",
2970
- children: [
2971
- "Credit left afterwards:",
2972
- " ",
2973
- formatPrice(preview.remainingCreditCents, props.currency)
2974
- ]
2975
- }),
2976
- preview.manualDiscountPending && /* @__PURE__ */ jsx("p", {
2977
- className: "er-text er-text--muted",
2978
- children: "We'll recalculate these amounts after your discount code is checked."
2979
- })
2980
- ]
2981
- });
2982
- }
2983
- //#endregion
2984
3481
  //#region ../blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.tsx
2985
3482
  function isDirectPaymentOptionSelected(option, selectionState) {
2986
3483
  return selectionState.kind === "valid" && selectionState.selection.collectionOptionKind === option.kind;
@@ -3027,8 +3524,9 @@ const PaymentSelectionStep = (props) => {
3027
3524
  selectionState: view.directPaymentSelectionState,
3028
3525
  preview: view.preview,
3029
3526
  onSelectionChange: props.onSelectionChange
3030
- }) : [], ...entitlementRows({
3527
+ }) : [], ...runMembershipRows({
3031
3528
  offered: view.offersEntitlements,
3529
+ event: props.event,
3032
3530
  eligibility,
3033
3531
  isAuthenticated: props.isAuthenticated ?? false,
3034
3532
  ticketsCount: props.ticketsCount,
@@ -3036,6 +3534,7 @@ const PaymentSelectionStep = (props) => {
3036
3534
  onSelectionChange: props.onSelectionChange
3037
3535
  })]
3038
3536
  }),
3537
+ /* @__PURE__ */ jsx(UnavailableEntitlementNotes, { eligibility }),
3039
3538
  /* @__PURE__ */ jsx(SiteCreditPreviewPanel, {
3040
3539
  preview: view.preview,
3041
3540
  currency: eligibility.currency
@@ -3043,182 +3542,31 @@ const PaymentSelectionStep = (props) => {
3043
3542
  ]
3044
3543
  });
3045
3544
  };
3046
- function ownedPassChoices(eligibility) {
3047
- return eligibility.eligiblePasses.map((pass) => ({
3048
- id: `owned-pass-${pass.id}`,
3049
- selection: {
3050
- method: "pass",
3051
- passId: pass.id,
3052
- productName: pass.passName
3053
- },
3054
- label: pass.passName,
3055
- details: [`${formatCreditProductUnits("event_pass", pass.creditsRemaining)} left`],
3056
- price: formatCreditProductUnits("event_pass", 1)
3057
- }));
3058
- }
3059
- function ownedMembershipChoices(eligibility) {
3060
- return eligibility.eligibleMemberships.map((membership) => ({
3061
- id: `owned-membership-${membership.id}`,
3062
- selection: {
3545
+ /** A run's own membership; dates offer theirs through the server's funding options (issue 1767). */
3546
+ function runMembershipRows(props) {
3547
+ if (!props.offered || !props.isAuthenticated || props.ticketsCount !== 1 || props.event?.registrationSubject.kind !== "wholeSeries") return [];
3548
+ return props.eligibility.eligibleMemberships.map((membership) => {
3549
+ const selection = {
3063
3550
  method: "membership",
3064
3551
  membershipId: membership.id,
3065
3552
  productName: membership.membershipName
3066
- },
3067
- label: membership.membershipName,
3068
- details: ["Active"],
3069
- price: "Included"
3070
- }));
3071
- }
3072
- function purchasablePassChoices(eligibility) {
3073
- return eligibility.availablePasses.map((pass) => ({
3074
- id: `buy-pass-${pass.id}`,
3075
- selection: {
3076
- method: "pass_bundle",
3077
- bundlePassId: pass.id,
3078
- productName: pass.name,
3079
- productPrice: pass.price,
3080
- productCurrency: pass.currency
3081
- },
3082
- label: pass.name,
3083
- details: [formatCreditProductUnits("event_pass", pass.creditsTotal), ...pass.description ? [pass.description] : []],
3084
- price: formatPrice(pass.price, pass.currency)
3085
- }));
3086
- }
3087
- function purchasableMembershipChoices(eligibility) {
3088
- return eligibility.availableMemberships.map((membership) => ({
3089
- id: `buy-membership-${membership.id}`,
3090
- selection: {
3091
- method: "membership_bundle",
3092
- bundleMembershipId: membership.id,
3093
- productName: membership.name,
3094
- productPrice: membership.price,
3095
- productCurrency: membership.currency,
3096
- productInterval: membership.interval
3097
- },
3098
- label: membership.name,
3099
- details: membership.description ? [membership.description] : [],
3100
- price: `${formatPrice(membership.price, membership.currency)}/${membership.interval}`
3101
- }));
3102
- }
3103
- /** Passes and memberships, when the selection can use them (one item, issue 1725). */
3104
- function entitlementRows(props) {
3105
- if (!props.offered) return [];
3106
- const disabled = areEntitlementsDisabledForTicketCount(props.ticketsCount);
3107
- return [
3108
- ...props.isAuthenticated ? [...ownedPassChoices(props.eligibility), ...ownedMembershipChoices(props.eligibility)] : [],
3109
- ...purchasablePassChoices(props.eligibility),
3110
- ...purchasableMembershipChoices(props.eligibility)
3111
- ].map((choice) => ({
3112
- id: choice.id,
3113
- label: choice.label,
3114
- details: choice.details,
3115
- price: choice.price,
3116
- disabled,
3117
- disabledReason: disabled ? ENTITLEMENT_SINGLE_TICKET_TOOLTIP : void 0,
3118
- selected: areEventRegistrationPaymentSelectionsEqual(props.selection, choice.selection),
3119
- onSelect: () => props.onSelectionChange(choice.selection)
3120
- }));
3121
- }
3122
- //#endregion
3123
- //#region ../blocks/src/system/runtime/nodes/event-registration/CalendarAction.tsx
3124
- /** Download effects happen only after a click, including in editor preview. */
3125
- async function downloadCalendar(calendar) {
3126
- const { renderCalendarFeedIcs } = await import("./src-DqMbCjI1.mjs");
3127
- const url = URL.createObjectURL(new Blob([renderCalendarFeedIcs(calendar.feed)], { type: "text/calendar;charset=utf-8" }));
3128
- const link = document.createElement("a");
3129
- link.href = url;
3130
- link.download = calendar.fileName;
3131
- document.body.append(link);
3132
- link.click();
3133
- link.remove();
3134
- setTimeout(() => URL.revokeObjectURL(url), 0);
3135
- }
3136
- function CalendarAction({ calendar }) {
3137
- const [open, setOpen] = useState(false);
3138
- const [downloadFailed, setDownloadFailed] = useState(false);
3139
- const id = useId();
3140
- const choicesRef = useRef(null);
3141
- useEffect(() => {
3142
- if (open) choicesRef.current?.scrollIntoView({ block: "nearest" });
3143
- }, [open]);
3144
- const close = () => setOpen(false);
3145
- const download = async (value) => {
3146
- setDownloadFailed(false);
3147
- try {
3148
- await downloadCalendar(value);
3149
- close();
3150
- } catch {
3151
- setDownloadFailed(true);
3152
- }
3153
- };
3154
- if (!calendar) return null;
3155
- return /* @__PURE__ */ jsxs("div", {
3156
- className: "er-calendar-action",
3157
- onBlur: (event) => {
3158
- if (!event.currentTarget.contains(event.relatedTarget)) close();
3159
- },
3160
- onKeyDown: (event) => {
3161
- if (event.key === "Escape" && open) {
3162
- event.stopPropagation();
3163
- close();
3164
- event.currentTarget.querySelector("button")?.focus();
3165
- }
3166
- },
3167
- children: [calendar.kind === "sessions" ? /* @__PURE__ */ jsx(ThemedButton, {
3168
- type: "button",
3169
- variant: "outline",
3170
- size: "md",
3171
- extraClassName: "er-calendar-action__trigger",
3172
- label: calendar.sessionCount === 2 ? "Add both sessions to your calendar" : `Add all ${calendar.sessionCount} sessions to your calendar`,
3173
- onClick: () => {
3174
- download(calendar);
3175
- }
3176
- }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ThemedButton, {
3177
- type: "button",
3178
- variant: "outline",
3179
- size: "md",
3180
- extraClassName: "er-calendar-action__trigger er-calendar-action__trigger--disclosure",
3181
- label: "Add to calendar",
3182
- "aria-expanded": open,
3183
- "aria-controls": id,
3184
- onClick: () => setOpen(!open)
3185
- }), open ? /* @__PURE__ */ jsxs("div", {
3186
- id,
3187
- ref: choicesRef,
3188
- className: "er-calendar-action__choices",
3189
- children: [
3190
- /* @__PURE__ */ jsx("a", {
3191
- className: "er-calendar-action__choice",
3192
- href: calendar.googleUrl,
3193
- target: "_blank",
3194
- rel: "noopener noreferrer",
3195
- onClick: close,
3196
- children: "Google Calendar"
3197
- }),
3198
- /* @__PURE__ */ jsx("a", {
3199
- className: "er-calendar-action__choice",
3200
- href: calendar.outlookUrl,
3201
- target: "_blank",
3202
- rel: "noopener noreferrer",
3203
- onClick: close,
3204
- children: "Outlook.com"
3205
- }),
3206
- /* @__PURE__ */ jsx("button", {
3207
- type: "button",
3208
- className: "er-calendar-action__choice",
3209
- onClick: () => {
3210
- download(calendar);
3211
- },
3212
- children: "Apple Calendar or other (.ics file)"
3213
- })
3214
- ]
3215
- }) : null] }), downloadFailed ? /* @__PURE__ */ jsx("p", {
3216
- role: "alert",
3217
- className: "er-calendar-action__error",
3218
- children: "We couldn't create the calendar file. Please try again."
3219
- }) : null]
3553
+ };
3554
+ return {
3555
+ id: `owned-membership-${membership.id}`,
3556
+ label: membership.membershipName,
3557
+ details: ["Active"],
3558
+ price: "Included",
3559
+ selected: areEventRegistrationPaymentSelectionsEqual(props.selection, selection),
3560
+ onSelect: () => props.onSelectionChange(selection)
3561
+ };
3220
3562
  });
3221
3563
  }
3564
+ function UnavailableEntitlementNotes({ eligibility }) {
3565
+ return /* @__PURE__ */ jsx(Fragment, { children: eligibility.unavailableEntitlements?.map((note) => /* @__PURE__ */ jsx("p", {
3566
+ className: "er-entitlement-note",
3567
+ children: note
3568
+ }, note)) });
3569
+ }
3222
3570
  //#endregion
3223
3571
  //#region ../blocks/src/system/runtime/nodes/event-registration/SuccessStep.tsx
3224
3572
  function ConfirmationSummary({ rows }) {
@@ -3457,7 +3805,7 @@ function ExistingRegistrationNotice(props) {
3457
3805
  body: isBooked ? props.detail : "Sign out to book for someone else.",
3458
3806
  secondaryBody: isBooked ? "Need more tickets? You can book them below. They'll come as a new booking with its own confirmation email, and your first booking won't change." : void 0,
3459
3807
  actions: isBooked ? /* @__PURE__ */ jsx("a", {
3460
- href: "/portal",
3808
+ href: portalPath({ page: "bookings" }),
3461
3809
  className: "er-existing-registration-link",
3462
3810
  children: "View my bookings"
3463
3811
  }) : /* @__PURE__ */ jsx("button", {
@@ -3468,9 +3816,12 @@ function ExistingRegistrationNotice(props) {
3468
3816
  })
3469
3817
  });
3470
3818
  }
3471
- /** A membership covers one place on one item, so the hero shows only then. */
3819
+ /**
3820
+ * A membership covers one place on one run, so the hero shows only then. Dates
3821
+ * show a membership with their other ways to pay (issue 1767).
3822
+ */
3472
3823
  function heroMembership(wizard) {
3473
- return wizard.portalAuthState === "authenticated" && wizard.ticketsCount === 1 && wizard.severalItems === null ? wizard.eligibility?.eligibleMemberships[0] : void 0;
3824
+ return wizard.portalAuthState === "authenticated" && wizard.ticketsCount === 1 && wizard.severalItems === null && wizard.selectedEvent?.registrationSubject.kind === "wholeSeries" ? wizard.eligibility?.eligibleMemberships[0] : void 0;
3474
3825
  }
3475
3826
  /** The event's consent, with its checkbox worded for every item being booked. */
3476
3827
  function selectionConsent(wizard) {
@@ -3539,6 +3890,7 @@ function AttendeeDetailsContent(props) {
3539
3890
  }
3540
3891
  function EventDiscountCodeDisclosure(props) {
3541
3892
  const { wizard } = props;
3893
+ if (wizard.discountAccess === "notOffered") return null;
3542
3894
  const preview = wizard.combinationCodeField;
3543
3895
  if (preview?.failed) return /* @__PURE__ */ jsxs("div", {
3544
3896
  role: "alert",
@@ -3549,6 +3901,12 @@ function EventDiscountCodeDisclosure(props) {
3549
3901
  })]
3550
3902
  });
3551
3903
  if (wizard.discountsAvailableLoading || !wizard.shouldShowDiscountToggle) return null;
3904
+ return /* @__PURE__ */ jsx(EventDiscountField, {
3905
+ wizard,
3906
+ preview
3907
+ });
3908
+ }
3909
+ function EventDiscountField({ wizard, preview }) {
3552
3910
  return /* @__PURE__ */ jsx(DiscountCodeDisclosure, {
3553
3911
  surface: "event-registration",
3554
3912
  isOpen: wizard.discountUiOpen,
@@ -3569,20 +3927,22 @@ function EventDiscountCodeDisclosure(props) {
3569
3927
  } : {}
3570
3928
  });
3571
3929
  }
3572
- function bookOnePlace(wizard) {
3573
- if (!wizard.ticketTypeSelectionRequired) wizard.setTicketsCount(1);
3574
- wizard.setStep("select-tickets");
3575
- }
3576
3930
  function PaymentSelectionContent(props) {
3577
3931
  const { wizard } = props;
3578
3932
  const subtotalCents = wizard.ticketSelectionSubtotalCents;
3579
3933
  if (!wizard.api.config.siteId) return null;
3934
+ const funding = selectionFundingShown(wizard);
3935
+ if (funding) return /* @__PURE__ */ jsx(SelectionFundingPayment, {
3936
+ wizard,
3937
+ model: funding,
3938
+ signInPrompt: props.signInPrompt
3939
+ });
3580
3940
  if (subtotalCents === null && wizard.combinationAwaitingVisitor) return /* @__PURE__ */ jsx(EventDiscountCodeDisclosure, { wizard });
3581
3941
  if (subtotalCents === null) return /* @__PURE__ */ jsx(PaymentBlockingPanel, {
3582
3942
  eligibility: wizard.eligibility,
3583
3943
  admission: wizard.admission,
3584
- eligibilityLoading: wizard.eligibilityLoading,
3585
- eligibilityError: wizard.eligibilityError,
3944
+ eligibilityLoading: wizard.paymentOptionsLoading,
3945
+ eligibilityError: wizard.paymentOptionsError,
3586
3946
  paysNothing: wizard.paymentDecision.paysNothing,
3587
3947
  email: wizard.formData.email,
3588
3948
  ticketsCount: wizard.ticketsCount,
@@ -3590,7 +3950,7 @@ function PaymentSelectionContent(props) {
3590
3950
  onRequestLogin: () => wizard.setShowMagicLinkModal(true)
3591
3951
  });
3592
3952
  return /* @__PURE__ */ jsxs(Fragment, { children: [
3593
- eventSiteTermsSurface(wizard.paymentSelection.method) === "commerce" ? /* @__PURE__ */ jsx(SiteTermsChangedNotice, { message: wizard.siteTerms.notice }) : null,
3953
+ wizard.paymentTermsSurface === "commerce" ? /* @__PURE__ */ jsx(SiteTermsChangedNotice, { message: wizard.siteTerms.notice }) : null,
3594
3954
  /* @__PURE__ */ jsx(SeveralItemsPaymentSummary, { wizard }),
3595
3955
  /* @__PURE__ */ jsx(PaymentSelectionStep, {
3596
3956
  event: wizard.selectedEvent,
@@ -3600,28 +3960,27 @@ function PaymentSelectionContent(props) {
3600
3960
  onSelectionChange: wizard.handlePaymentSelectionChange,
3601
3961
  eligibility: wizard.eligibility,
3602
3962
  admission: wizard.admission,
3603
- eligibilityLoading: wizard.eligibilityLoading,
3604
- eligibilityError: wizard.eligibilityError,
3963
+ eligibilityLoading: wizard.paymentOptionsLoading,
3964
+ eligibilityError: wizard.paymentOptionsError,
3605
3965
  onRequestLogin: () => wizard.setShowMagicLinkModal(true),
3606
3966
  decision: wizard.paymentDecision
3607
3967
  }),
3608
- /* @__PURE__ */ jsx(PaymentEntitlementNote, { wizard }),
3968
+ /* @__PURE__ */ jsx(PaymentStepNote, { wizard }),
3609
3969
  /* @__PURE__ */ jsx(EventDiscountCodeDisclosure, { wizard }),
3610
3970
  /* @__PURE__ */ jsx(BundleSiteTerms, { wizard })
3611
3971
  ] });
3612
3972
  }
3613
- /** What the places booked entitle the visitor to, under the payment choice. */
3614
- function PaymentEntitlementNote({ wizard }) {
3615
- if (wizard.severalItems !== null) return /* @__PURE__ */ jsx("p", {
3973
+ /**
3974
+ * The note under the ways to pay, in both payment layouts. Several runs: that
3975
+ * passes and memberships are for one run at a time (a date's pass and membership
3976
+ * notes come with its ways to pay). One booking: why it's paid in full.
3977
+ */
3978
+ function PaymentStepNote({ wizard }) {
3979
+ const note = wizard.severalItems === null ? wizard.paymentInFullNote : selectionEntitlementNote(wizard.severalItems);
3980
+ return note ? /* @__PURE__ */ jsx("p", {
3616
3981
  className: "er-entitlement-note",
3617
- children: selectionEntitlementNote(wizard.severalItems, wizard.paymentDecision.paysInFullBecauseSeveral)
3618
- });
3619
- if (wizard.paymentStepState.status !== "ready") return null;
3620
- return /* @__PURE__ */ jsx(SingleTicketEntitlementNote, {
3621
- ticketsCount: wizard.ticketsCount,
3622
- eligibility: wizard.eligibility,
3623
- onBookOnePlace: () => bookOnePlace(wizard)
3624
- });
3982
+ children: note
3983
+ }) : null;
3625
3984
  }
3626
3985
  function SeveralItemsPaymentSummary({ wizard }) {
3627
3986
  return wizard.selectionPaymentSummary && wizard.eligibility ? /* @__PURE__ */ jsx(SelectionPaymentSummary, {
@@ -3631,17 +3990,24 @@ function SeveralItemsPaymentSummary({ wizard }) {
3631
3990
  }
3632
3991
  function ClosedAdmissionNotice({ wizard }) {
3633
3992
  const admission = wizard.admission;
3634
- return admission.kind === "closed" && admission.reason !== "alreadyWaitlisted" && !wizard.eligibilityLoading ? /* @__PURE__ */ jsx("p", {
3993
+ if (admission.kind !== "closed" || admission.reason === "alreadyWaitlisted" || wizard.eligibilityLoading) return null;
3994
+ return registrationStopsHere(admission) ? /* @__PURE__ */ jsxs("div", {
3995
+ role: "status",
3996
+ className: "er-notice er-notice--info",
3997
+ children: [/* @__PURE__ */ jsx("p", { children: admission.message }), admission.contact ? /* @__PURE__ */ jsx(OrganiserContactLine, { contact: admission.contact }) : null]
3998
+ }) : /* @__PURE__ */ jsxs("div", {
3635
3999
  role: "alert",
3636
4000
  className: "er-error",
3637
- children: admission.message
3638
- }) : null;
4001
+ children: [/* @__PURE__ */ jsx("p", { children: admission.message }), admission.contact ? /* @__PURE__ */ jsx(OrganiserContactLine, { contact: admission.contact }) : null]
4002
+ });
3639
4003
  }
3640
4004
  function ticketStepInvitation(claim) {
3641
4005
  if (claim.kind === "none") return null;
3642
4006
  return claim.kind === "ready" ? {
3643
4007
  kind: "held",
3644
- expiresAt: claim.claim.expiresAt
4008
+ expiresAt: claim.claim.expiresAt,
4009
+ places: claim.restoration.claimed.places,
4010
+ ticketChoice: claim.restoration.claimed.kind === "anyTicket"
3645
4011
  } : { kind: "pending" };
3646
4012
  }
3647
4013
  /** With a date to pick, the choosing step has already said it. */
@@ -3662,41 +4028,72 @@ function TicketSelectionContent({ wizard, display }) {
3662
4028
  kind: "waitlisted",
3663
4029
  onBookForSomeoneElse: wizard.handleBookForSomeoneElse
3664
4030
  }),
4031
+ wizard.portalAuthState === "authenticated" && wizard.existingRegistrationState.tag === "failed" && !isWaitlisted && /* @__PURE__ */ jsx("p", {
4032
+ role: "status",
4033
+ className: "er-text",
4034
+ children: "We couldn’t check whether you’ve already booked this date. If you have, this will be a separate booking."
4035
+ }),
3665
4036
  /* @__PURE__ */ jsx(ClosedAdmissionNotice, { wizard }),
3666
4037
  /* @__PURE__ */ jsx(TicketStepBookingCloseLine, { wizard }),
3667
- wizard.severalItems === "runs" ? /* @__PURE__ */ jsx(SeveralRunsTicketStep, {
4038
+ /* @__PURE__ */ jsx(TicketChooser, {
3668
4039
  wizard,
3669
4040
  display
3670
- }) : /* @__PURE__ */ jsx(TicketSelectionStep, {
3671
- purpose: wizard.ticketSelectionPurpose,
3672
- display,
3673
- invitation: ticketStepInvitation(wizard.waitlistClaim),
3674
- event: wizard.selectedEvent,
3675
- occurrenceContext: wizard.occurrenceContext,
3676
- selectedAttendanceMode: wizard.selectedAttendanceMode,
3677
- onAttendanceModeChange: wizard.setSelectedAttendanceMode,
3678
- ticketsCount: wizard.ticketsCount,
3679
- maxTickets: wizard.maxTicketsNum,
3680
- placesCeiling: placeCountCeiling({
3681
- maxAllowed: wizard.maxTicketsNum,
3682
- admission: wizard.admission,
3683
- settledRemaining: settledRemainingPlaces(wizard.eligibility)
3684
- }),
3685
- visibleTicketTypes: wizard.visibleTicketTypes,
3686
- overallRemainingPlaces: wizard.overallRemainingPlaces,
3687
- heldPlacesBySelection: wizard.heldPlacesBySelection,
3688
- ticketSelections: wizard.selectedTicketLines,
3689
- onTicketSelectionsChange: wizard.setSelectedTicketLines,
3690
- slidingScale: wizard.selectedEventSlidingScale,
3691
- selectedSlidingAmountInput: wizard.selectedSlidingAmountInput,
3692
- slidingScaleSelectionMessage: wizard.slidingScaleSelectionMessage,
3693
- onSlidingAmountChange: wizard.setSelectedSlidingAmountInput,
3694
- onTicketsChange: wizard.setTicketsCount,
3695
- bookingUnit: resolveBookingUnit(wizard.selectedEvent),
3696
- selectionNote: wizard.severalItems === "dates" ? selectionPlacesNote("dates", wizard.selection.length) : null
3697
4041
  })
3698
4042
  ] });
3699
4043
  }
4044
+ /**
4045
+ * Whether choosing differently could reopen a refusal: the site can't take
4046
+ * this selection's payment, but a free ticket, the free end of a sliding scale,
4047
+ * or another room or run might not need one.
4048
+ */
4049
+ function selectionCouldChangePrice(wizard) {
4050
+ if (wizard.admission.kind === "closed" && wizard.admission.reason === "bookingsClosed") return false;
4051
+ return wizard.selectedEventSlidingScale != null || wizard.visibleTicketTypes.length > 1 || wizard.roomChooser != null || wizard.severalItems === "runs";
4052
+ }
4053
+ /**
4054
+ * How the client chooses their places. Where registration stops at the notice
4055
+ * above and no other choice could change that, there's nothing to choose.
4056
+ */
4057
+ function TicketChooser({ wizard, display }) {
4058
+ if (registrationStopsHere(wizard.admission) && !selectionCouldChangePrice(wizard)) return null;
4059
+ if (wizard.roomChooser) return /* @__PURE__ */ jsx(RoomChooser, {
4060
+ wizard,
4061
+ chooser: wizard.roomChooser,
4062
+ display
4063
+ });
4064
+ if (wizard.severalItems === "runs") return /* @__PURE__ */ jsx(SeveralRunsTicketStep, {
4065
+ wizard,
4066
+ display
4067
+ });
4068
+ return /* @__PURE__ */ jsx(TicketSelectionStep, {
4069
+ purpose: wizard.ticketSelectionPurpose,
4070
+ display,
4071
+ invitation: ticketStepInvitation(wizard.waitlistClaim),
4072
+ event: wizard.selectedEvent,
4073
+ occurrenceContext: wizard.occurrenceContext,
4074
+ selectedAttendanceMode: wizard.selectedAttendanceMode,
4075
+ onAttendanceModeChange: wizard.setSelectedAttendanceMode,
4076
+ ticketsCount: wizard.ticketsCount,
4077
+ maxTickets: wizard.maxTicketsNum,
4078
+ placesCeiling: placeCountCeiling({
4079
+ maxAllowed: wizard.maxTicketsNum,
4080
+ admission: wizard.admission,
4081
+ settledRemaining: settledRemainingPlaces(wizard.eligibility)
4082
+ }),
4083
+ visibleTicketTypes: wizard.visibleTicketTypes,
4084
+ overallRemainingPlaces: wizard.overallRemainingPlaces,
4085
+ heldPlacesBySelection: wizard.heldPlacesBySelection,
4086
+ ticketSelections: wizard.selectedTicketLines,
4087
+ onTicketSelectionsChange: wizard.setSelectedTicketLines,
4088
+ slidingScale: wizard.selectedEventSlidingScale,
4089
+ selectedSlidingAmountInput: wizard.selectedSlidingAmountInput,
4090
+ slidingScaleSelectionMessage: wizard.slidingScaleSelectionMessage,
4091
+ onSlidingAmountChange: wizard.setSelectedSlidingAmountInput,
4092
+ onTicketsChange: wizard.setTicketsCount,
4093
+ bookingUnit: resolveBookingUnit(wizard.selectedEvent),
4094
+ selectionNote: wizard.severalItems === "dates" ? selectionPlacesNote("dates", wizard.selection.length) : null
4095
+ });
4096
+ }
3700
4097
  function EventRegistrationWizardContent(props) {
3701
4098
  const { wizard } = props;
3702
4099
  switch (wizard.step) {
@@ -3721,6 +4118,7 @@ function EventRegistrationWizardContent(props) {
3721
4118
  ...wizard.selectionMode.kind === "several" ? {
3722
4119
  mode: wizard.selectionMode,
3723
4120
  selection: wizard.selection,
4121
+ pageDate: wizard.entry.kind === "pageDateAndMore" ? wizard.entry.event : null,
3724
4122
  onToggle: wizard.handleSelectionToggle,
3725
4123
  onJoinWaitlist: wizard.handleWaitlistChoose
3726
4124
  } : { mode: wizard.selectionMode },
@@ -3731,12 +4129,15 @@ function EventRegistrationWizardContent(props) {
3731
4129
  display: props.display
3732
4130
  });
3733
4131
  case "enter-details": return /* @__PURE__ */ jsx(AttendeeDetailsContent, { wizard });
3734
- case "select-payment": return /* @__PURE__ */ jsx(PaymentSelectionContent, { wizard });
4132
+ case "select-payment": return /* @__PURE__ */ jsx(PaymentSelectionContent, {
4133
+ wizard,
4134
+ signInPrompt: props.paymentSignInPrompt
4135
+ });
3735
4136
  default: return null;
3736
4137
  }
3737
4138
  }
3738
4139
  function BundleSiteTerms({ wizard }) {
3739
- if (eventSiteTermsSurface(wizard.paymentSelection.method) !== "commerce") return null;
4140
+ if (wizard.paymentTermsSurface !== "commerce") return null;
3740
4141
  return /* @__PURE__ */ jsx(SiteTermsAgreementField, {
3741
4142
  agreement: wizard.siteTerms.commerceView,
3742
4143
  onChange: wizard.siteTerms.onChange,
@@ -3745,6 +4146,34 @@ function BundleSiteTerms({ wizard }) {
3745
4146
  requiredMark: "none"
3746
4147
  });
3747
4148
  }
4149
+ /**
4150
+ * Dates keep their ways to pay on screen while a pass's money dates are
4151
+ * priced (Pay waits for the price). A closed or failed booking shows its
4152
+ * own panel instead.
4153
+ */
4154
+ function selectionFundingShown(wizard) {
4155
+ const model = wizard.selectionFunding;
4156
+ if (!model) return null;
4157
+ const status = wizard.paymentDecision.stepState.status;
4158
+ return status === "error" || status === "not-eligible" ? null : model;
4159
+ }
4160
+ function SelectionFundingPayment(props) {
4161
+ const { wizard } = props;
4162
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
4163
+ wizard.paymentTermsSurface === "commerce" ? /* @__PURE__ */ jsx(SiteTermsChangedNotice, { message: wizard.siteTerms.notice }) : null,
4164
+ /* @__PURE__ */ jsx(SelectionFundingStep, {
4165
+ model: props.model,
4166
+ currency: wizard.eligibility?.currency ?? "",
4167
+ cardSummary: wizard.selectionPaymentSummary,
4168
+ creditPreview: wizard.paymentDecision.preview,
4169
+ signInPrompt: props.signInPrompt,
4170
+ afterOptions: /* @__PURE__ */ jsx(EventDiscountCodeDisclosure, { wizard }),
4171
+ onChangeDates: entryChoosesEvent(wizard.entry) ? wizard.handleChangeDates : void 0
4172
+ }),
4173
+ /* @__PURE__ */ jsx(PaymentStepNote, { wizard }),
4174
+ /* @__PURE__ */ jsx(BundleSiteTerms, { wizard })
4175
+ ] });
4176
+ }
3748
4177
  //#endregion
3749
4178
  //#region ../blocks/src/system/runtime/nodes/event-registration/PaymentStatusStep.tsx
3750
4179
  function presentation(state) {
@@ -3783,8 +4212,8 @@ function presentation(state) {
3783
4212
  action: { label: "Check payment status" }
3784
4213
  };
3785
4214
  case "assistanceRequired": return {
3786
- title: "We still can’t confirm your payment",
3787
- message: "Please don’t make another payment. Contact the organiser so they can check your booking.",
4215
+ title: "We couldn’t confirm your booking",
4216
+ message: "Please don’t pay again. Contact the organiser to check your booking.",
3788
4217
  action: {
3789
4218
  label: "Return to booking",
3790
4219
  disabled: true
@@ -3907,7 +4336,10 @@ function EventRegistrationMagicLinkModal(props) {
3907
4336
  function EventRegistrationWholeScreen(props) {
3908
4337
  const { wizard } = props;
3909
4338
  switch (props.presentation.screen) {
3910
- case "processing": return /* @__PURE__ */ jsx(RegistrationProcessing, { selection: wizard.paymentSelection });
4339
+ case "processing": return /* @__PURE__ */ jsx(RegistrationProcessing, {
4340
+ selection: wizard.paymentSelection,
4341
+ takesPayment: wizard.selectionFunding?.view?.takesPayment ?? null
4342
+ });
3911
4343
  case "verifying": return /* @__PURE__ */ jsx(VerifyingPaymentStep, {});
3912
4344
  case "verifyingTimeout": return /* @__PURE__ */ jsx(RegistrationVerificationTimeout, {
3913
4345
  wizard,
@@ -3936,7 +4368,7 @@ function EventRegistrationSuccess(props) {
3936
4368
  const { wizard } = props;
3937
4369
  const { result, finished } = props.presentation;
3938
4370
  const copy = finished.several ? {
3939
- message: "",
4371
+ message: finished.creditsLeftSentence ?? "",
3940
4372
  defaultEmailSentence: severalConfirmationSentence(finished.several, wizard.formData.email)
3941
4373
  } : getRegistrationSuccessCopy(result, props.fallbackMessage);
3942
4374
  return /* @__PURE__ */ jsx(SuccessStep, {
@@ -3964,13 +4396,22 @@ function EventRegistrationProgress(props) {
3964
4396
  function EventRegistrationStepFooter(props) {
3965
4397
  return /* @__PURE__ */ jsxs("div", {
3966
4398
  className: "er-payment-layout-footer",
3967
- children: [/* @__PURE__ */ jsx(EventRegistrationSummaryBar, { wizard: props.wizard }), /* @__PURE__ */ jsx(EventRegistrationWizardActions, {
4399
+ "data-room-chooser": props.wizard.roomChooser ? "" : void 0,
4400
+ children: [props.wizard.roomChooser ? /* @__PURE__ */ jsx(RoomChooserSummary, {
4401
+ wizard: props.wizard,
4402
+ view: props.wizard.roomChooser.view
4403
+ }) : /* @__PURE__ */ jsx(EventRegistrationSummaryBar, { wizard: props.wizard }), /* @__PURE__ */ jsx(EventRegistrationWizardActions, {
3968
4404
  wizard: props.wizard,
3969
4405
  buttonText: props.buttonText,
3970
4406
  buttonVariant: props.buttonVariant
3971
4407
  })]
3972
4408
  });
3973
4409
  }
4410
+ /** Offer the same sign-in help before asking an anonymous visitor to buy cover. */
4411
+ function paymentOffersSignIn(wizard) {
4412
+ if (wizard.step !== "select-payment" || wizard.portalAuthState === "authenticated" || wizard.portalAuthState === "checking") return false;
4413
+ return wizard.selectionFunding?.view?.rows.some((row) => row.pick.kind === "entitlement" && (row.pick.source.kind === "buyPass" || row.pick.source.kind === "buyMembership")) ?? false;
4414
+ }
3974
4415
  function EventRegistrationStepLayout(props) {
3975
4416
  const { wizard, progress } = props;
3976
4417
  const prompt = /* @__PURE__ */ jsx(EventPortalAuthPrompt, {
@@ -3990,7 +4431,8 @@ function EventRegistrationStepLayout(props) {
3990
4431
  /* @__PURE__ */ jsx(EventRegistrationWizardContent, {
3991
4432
  wizard,
3992
4433
  display: props.display,
3993
- buttonVariant: props.buttonVariant
4434
+ buttonVariant: props.buttonVariant,
4435
+ paymentSignInPrompt: paymentOffersSignIn(wizard) ? prompt : null
3994
4436
  }),
3995
4437
  props.showPortalAuthPrompt && props.portalAuthCopy.placement === "after" ? prompt : null
3996
4438
  ]
@@ -4085,8 +4527,9 @@ function EventRegistrationSurface(props) {
4085
4527
  })]
4086
4528
  });
4087
4529
  }
4088
- function RegistrationProcessing({ selection }) {
4089
- const label = (selection.method === "stripe" ? selection.collectionOptionKind !== "deferred_manual" : selection.method === "pass_bundle" || selection.method === "membership_bundle") ? "Preparing your payment" : "Confirming your booking";
4530
+ /** `takesPayment`: dates say from their way to pay; null leaves it to the card choice. */
4531
+ function RegistrationProcessing({ selection, takesPayment }) {
4532
+ const label = takesPayment ?? (selection.method === "stripe" && selection.collectionOptionKind !== "deferred_manual") ? "Preparing your payment" : "Confirming your booking";
4090
4533
  return /* @__PURE__ */ jsxs("div", {
4091
4534
  className: "er-center",
4092
4535
  role: "status",
@@ -4267,7 +4710,8 @@ function useConfiguredEventRegistrationWizard(props) {
4267
4710
  siteTerms: props.siteTerms,
4268
4711
  pageNavigation: props.pageNavigation,
4269
4712
  offeringNoun: props.offeringNoun,
4270
- siteName: props.siteName
4713
+ siteName: props.siteName,
4714
+ datePageOffer: "addMoreDates"
4271
4715
  });
4272
4716
  }
4273
4717
  function EventRegistrationWizard(props) {