@riverbankcms/sdk 0.177.0 → 0.179.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 (225) hide show
  1. package/README.md +15 -8
  2. package/dist/_dts/{BlocksIslandsHydrator-sYraeqm9.d.ts → BlocksIslandsHydrator-DKwgs95u.d.ts} +1 -1
  3. package/dist/_dts/{Page-Bp7hTDTy.d.ts → Page-lWenra5i.d.ts} +7 -7
  4. package/dist/_dts/{SdkPreviewMode-CxkCCyKw.d.ts → SdkPreviewMode-BRxhRw4I.d.ts} +2 -2
  5. package/dist/_dts/{client-K6UhbL3t.d.ts → client-qWn7xAwJ.d.ts} +77 -23
  6. package/dist/_dts/{content-types-BLAdIMyr.d.ts → content-types-DL6GIvTm.d.ts} +2 -2
  7. package/dist/_dts/{contracts-BG7yTZ6t.d.ts → contracts-CzWyAiJj.d.ts} +6 -116
  8. package/dist/_dts/{generatePageMetadata-X_WpGzZZ.d.ts → generatePageMetadata-CBKd0cJ4.d.ts} +2 -2
  9. package/dist/_dts/{index--n-wV8Xd.d.ts → index-7CDBZGb-.d.ts} +1 -1
  10. package/dist/_dts/{index-Bygd2RCg.d.ts → index-BU9uAkHB.d.ts} +4 -4
  11. package/dist/_dts/{index-BMGif2r3.d.ts → index-BYnG_vF5.d.ts} +1 -1
  12. package/dist/_dts/{index-CBRbZJ6u.d.ts → index-CZgJrhzT.d.ts} +4 -2
  13. package/dist/_dts/{index-BLseXObg.d.ts → index-CaCum9mM.d.ts} +2 -2
  14. package/dist/_dts/{index-BpAW9AKB.d.ts → index-DCiSHd-C.d.ts} +1 -1
  15. package/dist/_dts/{index-CX9bp60k.d.ts → index-DVSipdrT.d.ts} +3 -3
  16. package/dist/_dts/{loadContent-uhUThWaq.d.ts → loadContent-CPKbFQyq.d.ts} +15 -13
  17. package/dist/_dts/{request-Bf9YImJw.d.ts → request-BjKBCS7t.d.ts} +1687 -373
  18. package/dist/_dts/{resolveBlockData-D6M5NMZB.d.ts → resolveBlockData-DupbMCup.d.ts} +8 -5
  19. package/dist/_dts/resolvePageContent-BqNyCHi8.d.ts +61 -0
  20. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  21. package/dist/_dts/sdk/src/client/types.d.ts +3 -3
  22. package/dist/_dts/sdk/src/client.d.ts +7 -7
  23. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  24. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  25. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  26. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  27. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  28. package/dist/_dts/sdk/src/data/types.d.ts +7 -2
  29. package/dist/_dts/sdk/src/gifting/client.d.ts +1 -2
  30. package/dist/_dts/sdk/src/index.d.ts +8 -8
  31. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  32. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  33. package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
  34. package/dist/_dts/sdk/src/next/index.d.ts +32 -12
  35. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  36. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  37. package/dist/_dts/sdk/src/portal/client.d.ts +56 -4
  38. package/dist/_dts/sdk/src/portal/index.d.ts +95 -13
  39. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  40. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  41. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  42. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  43. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  44. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  45. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  46. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
  47. package/dist/_dts/sdk/src/rendering/index.d.ts +7 -7
  48. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  49. package/dist/_dts/sdk/src/rendering/server.d.ts +3 -3
  50. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  51. package/dist/_dts/sdk/src/routing/index.d.ts +19 -6
  52. package/dist/_dts/sdk/src/server.d.ts +5 -5
  53. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  54. package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
  55. package/dist/_dts/serviceBookingOutline-YcsIjvn1.d.ts +582 -0
  56. package/dist/_dts/{types-C1l2Sm2h.d.ts → types-B7e6Lmo5.d.ts} +3 -3
  57. package/dist/_dts/{types-DgV8P2mz.d.ts → types-BOxSq-Bq.d.ts} +8 -7
  58. package/dist/_dts/{types-BdZ5pJSk.d.ts → types-CT-KOxl_.d.ts} +5 -39
  59. package/dist/_dts/{validation-BtbZIT5f.d.ts → validation-Dz6qccue.d.ts} +4 -4
  60. package/dist/client/{BlocksIslandsHydrator-CeYQQQs7.mjs → BlocksIslandsHydrator-1XifJg6V.mjs} +17 -18
  61. package/dist/client/{BookingMailingListNote-CDDWrY_W.mjs → BookingMailingListNote-BsbEgagJ.mjs} +7 -7
  62. package/dist/client/{BookingQuestionFields-MbvIo2jS.mjs → BookingQuestionFields-C8IbeLHj.mjs} +4 -4
  63. package/dist/client/{CalendarNavigationChevron-C6CSVfEB.mjs → CalendarNavigationChevron-Bbqij1XQ.mjs} +43 -10
  64. package/dist/client/{CheckboxChoice-b-PJLEXe.mjs → CheckboxChoice-BZPLCgTU.mjs} +1 -1
  65. package/dist/client/{DemoBookingPortalAccess-C9Ggcfx3.mjs → DemoBookingPortalAccess-uA9H8LIL.mjs} +4 -4
  66. package/dist/client/{EventCalendar.client-BSMuSqg0.mjs → EventCalendar.client-yoSI77ov.mjs} +11 -11
  67. package/dist/client/{EventCombined.client-BTrmSyUB.mjs → EventCombined.client-HeCNlliq.mjs} +11 -11
  68. package/dist/client/{EventEmbeddedCheckoutStep-B18VbNS_.mjs → EventEmbeddedCheckoutStep-BDnicDM6.mjs} +1 -1
  69. package/dist/client/{EventItem-B0WjGXsH.mjs → EventItem-Duhk1vnF.mjs} +247 -7
  70. package/dist/client/{EventListWeekNavigation-8Ij7vuxY.mjs → EventListWeekNavigation-BiutEqPK.mjs} +1 -1
  71. package/dist/client/{EventListing.client-CWk2NEwd.mjs → EventListing.client-B5ln77jG.mjs} +3 -3
  72. package/dist/client/{EventListing.view-BEH4UbSL.mjs → EventListing.view-hUDhNtMv.mjs} +203 -9
  73. package/dist/client/{EventRegistrationPayment-B2EikR3f.mjs → EventRegistrationPayment-DqtX1vB2.mjs} +439 -123
  74. package/dist/client/{Page-C03rc6jw.mjs → Page-ChJ2TGVk.mjs} +24314 -20226
  75. package/dist/client/{ProtectedSubmitButton-C-ql101B.mjs → ProtectedSubmitButton-De6AzhE6.mjs} +1 -1
  76. package/dist/client/{SiteTermsAgreementField-BYACYP0T.mjs → SiteTermsAgreementField-CDBU31xW.mjs} +3 -3
  77. package/dist/client/{StepIndicator-Bb7rPtSq.mjs → StepIndicator-2Dl9zon2.mjs} +80 -33
  78. package/dist/client/{BookingPanelArrangement-BShQSial.mjs → StepIndicator-JQA-VuEH.mjs} +12 -12
  79. package/dist/client/{TabBarFragment-BqfRLojo.mjs → TabBarFragment-DlKQRhP4.mjs} +1 -1
  80. package/dist/client/{ThemedButton-DuaYtnvG.mjs → ThemedButton-CnSa7o-I.mjs} +66 -66
  81. package/dist/client/{accessibleSurfaces-DN8it_Cx.mjs → accessibleSurfaces-Wl8-_OVJ.mjs} +1 -1
  82. package/dist/client/{accordion-BfsOiweL.mjs → accordion-B6SqU49k.mjs} +1 -1
  83. package/dist/client/{booking-form.client-B8ohIj13.mjs → booking-form.client-DrEOjQ3N.mjs} +15 -15
  84. package/dist/client/{bookingForm-CXsck2oH.mjs → bookingForm-drZBwEZW.mjs} +4 -4
  85. package/dist/client/bookings.mjs +5 -5
  86. package/dist/client/{boxStyleClassNames-B_hcuT06.mjs → boxStyleClassNames-DEh45w16.mjs} +19 -19
  87. package/dist/client/{carousel-Cz5Ddbsx.mjs → carousel-C-YJliD-.mjs} +2 -2
  88. package/dist/client/{carousel.client-h65clfUO.mjs → carousel.client-DMtGYTTM.mjs} +1 -1
  89. package/dist/client/{cart-CTC2oS3p.mjs → cart-acGFWK9R.mjs} +3 -3
  90. package/dist/client/{cart.client-c1YkTC-Q.mjs → cart.client-BzlOGP2j.mjs} +1 -1
  91. package/dist/client/{checkout-BeW1ufaH.mjs → checkout-SEontwhy.mjs} +3 -3
  92. package/dist/client/{checkout.client-BeU32khQ.mjs → checkout.client-C0Qvh-d4.mjs} +1 -1
  93. package/dist/client/{checkoutUrls-DVfSUSKp.mjs → checkoutUrls-yUKeq1N9.mjs} +1 -1
  94. package/dist/client/client.mjs +469 -320
  95. package/dist/client/{context-R9p5c8IH.mjs → context-DTrwaQtg.mjs} +2 -1
  96. package/dist/client/{dateFormatting-CF6FWCoo.mjs → dateFormatting-Cg8E1r9l.mjs} +1 -1
  97. package/dist/client/{demoPortalMagicLink-tZxIm3RL.mjs → demoPortalMagicLink-D0kOJYOX.mjs} +5 -4
  98. package/dist/client/{enhanceHeaderSection-DEYDI54E.mjs → enhanceHeaderSection-DyrpZ7ks.mjs} +4 -4
  99. package/dist/client/{event-registration.client-DWvSODTI.mjs → event-registration.client-RLZQWi2V.mjs} +121 -183
  100. package/dist/client/{eventCalendar-C9Pn9eeZ.mjs → eventCalendar-CphYnImh.mjs} +4 -4
  101. package/dist/client/{eventCombined-Bdhk0fp0.mjs → eventCombined-BvqjASB_.mjs} +4 -4
  102. package/dist/client/{eventListing-B-bJOQUk.mjs → eventListing-BaNAoC_M.mjs} +4 -4
  103. package/dist/client/{eventRegistration-CbdmUiDT.mjs → eventRegistration-COMHoRl6.mjs} +4 -4
  104. package/dist/client/events-9LPvwbWp.mjs +28 -0
  105. package/dist/client/{form-BbUUt784.mjs → form-DyH2juYT.mjs} +3 -3
  106. package/dist/client/{form.client-BVlz-9_t.mjs → form.client-DBwzkB0M.mjs} +5 -5
  107. package/dist/client/{form.parts-TB4UIrML.mjs → form.parts-CY4kX3mh.mjs} +3 -3
  108. package/dist/client/{formatDate-TDHhFjFN.mjs → formatDate-CTEN7gxW.mjs} +1 -1
  109. package/dist/client/gifting/client.mjs +7 -6
  110. package/dist/client/{gifting-CbNSrp7C.mjs → gifting-CIx4V378.mjs} +4 -4
  111. package/dist/client/{gifting.client-B__bGhFc.mjs → gifting.client-BEVPpzJM.mjs} +5 -5
  112. package/dist/client/{gifting.parts-CTA1sDW6.mjs → gifting.parts-VnORjnZK.mjs} +2 -2
  113. package/dist/client/{headerSection-5Wn9nUW_.mjs → headerSection-DGcJfRS8.mjs} +2 -2
  114. package/dist/client/{lookSurfaces-BwiNdgMU.mjs → lookSurfaces-IqT_SVnX.mjs} +167 -85
  115. package/dist/client/{newsletter-form.client-B17WYHxZ.mjs → newsletter-form.client-BvEDkjiD.mjs} +6 -6
  116. package/dist/client/{shop.interactive-CxDJ8P2r.mjs → newsletter-form.interactive-DCO1lErD.mjs} +3970 -3997
  117. package/dist/client/{newsletter-form.parts-DN9wD1ZG.mjs → newsletter-form.parts-BIy4IUT3.mjs} +2 -2
  118. package/dist/client/{newsletterForm-DLMlxInp.mjs → newsletterForm-CoTXDNFS.mjs} +3 -3
  119. package/dist/client/portal/client.mjs +346 -21
  120. package/dist/client/{product-detail.client-Di_anRGR.mjs → product-detail.client-YHQ2aKX1.mjs} +1 -1
  121. package/dist/client/{product-list.client-Duhl6rtL.mjs → product-list.client-DxoZw1vF.mjs} +1 -1
  122. package/dist/client/{productDetail-BgKmCwA8.mjs → productDetail-DjuFvkey.mjs} +3 -3
  123. package/dist/client/{productList-C_wMKsYS.mjs → productList-DE9GEFoZ.mjs} +3 -3
  124. package/dist/client/{propsDecoder-y3LvxaiG.mjs → propsDecoder-Cyag_HOs.mjs} +2 -48
  125. package/dist/client/{registry.server-CIWYKz1V.mjs → registry.server-BPwV-0Pp.mjs} +10426 -9114
  126. package/dist/client/rendering/client.mjs +41 -27
  127. package/dist/client/rendering/islands.mjs +1 -1
  128. package/dist/client/rendering.mjs +23 -2836
  129. package/dist/client/{richText-coerce-DkPBFb_a.mjs → richText-coerce-NrRqDeOg.mjs} +1 -1
  130. package/dist/client/{routeIslandApiConfig-BgO0rZce.mjs → routeIslandApiConfig-BWq5gKFK.mjs} +1 -1
  131. package/dist/client/runtimeResponse-D2j2-mOk.mjs +3 -0
  132. package/dist/client/{runtimeResponse-9v8q2NBc.mjs → runtimeResponse-DtWSfWSZ.mjs} +1 -1
  133. package/dist/client/{shop-CFbWlv_W.mjs → shop-C3wM0Hr4.mjs} +3 -3
  134. package/dist/client/{shop-commerce-C-I29eaA.mjs → shop-commerce-34YvcpbX.mjs} +14 -14
  135. package/dist/client/{shop-commerce-store-DGcc7twO.mjs → shop-commerce-store-B7xHksOs.mjs} +1 -1
  136. package/dist/client/{shop-discount-apply.state-DOm7vx0X.mjs → shop-discount-apply.state-BiBnozfO.mjs} +2 -2
  137. package/dist/client/{shop.client-GHTWUKD6.mjs → shop.client-C0v88nLd.mjs} +14 -14
  138. package/dist/client/{shopShared-Be9QJJpT.mjs → shopShared-Ct-BRNez.mjs} +2 -2
  139. package/dist/client/spam-protection.mjs +1 -1
  140. package/dist/client/{noop-CaQxI-Js.mjs → src-CCtanNlD.mjs} +462 -455
  141. package/dist/client/src-DqMbCjI1.mjs +3 -0
  142. package/dist/client/{src-xrjaKaCj.mjs → src-uwCpbHXG.mjs} +2 -1
  143. package/dist/client/{timetableModel--R0zVzZO.mjs → timetableModel-lhE29TNT.mjs} +66 -12
  144. package/dist/client/{types-DjWUR_O6.mjs → types-BEaKfam_.mjs} +65 -65
  145. package/dist/client/{useAvailableSlots-BGu_2F50.mjs → useAvailableSlots-BelJviOT.mjs} +2 -2
  146. package/dist/client/useDiscountCodeUi-rQRE1-Ho.mjs +196 -0
  147. package/dist/client/{useEventPagination-DxIJ--JZ.mjs → useEventPagination-C4rS2Xxl.mjs} +8 -8
  148. package/dist/client/{view-3foOzGWR.mjs → view-LJVHVqsy.mjs} +4 -4
  149. package/dist/client/{display-4HYOb-AK.mjs → wizardSteps-CNDsxeJH.mjs} +9168 -8981
  150. package/dist/preview-next/before-render.mjs +4 -3
  151. package/dist/preview-next/client/{PageSectionToolbar-D6-jojqh.mjs → PageSectionToolbar-C4TtBPN-.mjs} +3 -3
  152. package/dist/preview-next/client/{PreviewEditorSidebar-BUVFKZ4k.mjs → PreviewEditorSidebar-D6fkE59-.mjs} +15 -13
  153. package/dist/preview-next/client/{PreviewEditorUI-292pOiSt.mjs → PreviewEditorUI-amcDlj0O.mjs} +4 -4
  154. package/dist/preview-next/client/{PreviewShell-CW0Yzj3h.mjs → PreviewShell-DeQjx4zk.mjs} +5 -5
  155. package/dist/preview-next/client/{SdkPreviewModeRuntime-Dba7zoZK.mjs → SdkPreviewModeRuntime-Cx0SXnoX.mjs} +5 -5
  156. package/dist/preview-next/client/{previewAssistantSlot-B-utyhbS.mjs → previewAssistantSlot-aqpU34WI.mjs} +1764 -1090
  157. package/dist/preview-next/client/{previewChromeRoot-CCoGydUD.mjs → previewChromeRoot-D3Gy_Rs0.mjs} +1 -1
  158. package/dist/preview-next/client/runtime.mjs +3 -3
  159. package/dist/preview-next/client/{sdk-runtime-DCpXVcA0.mjs → sdk-runtime-Dzx_RrN7.mjs} +2 -2
  160. package/dist/preview-next/client/{siteStyleAccess-sjOvRAHY.mjs → siteStyleAccess-LHedw83e.mjs} +1 -1
  161. package/dist/preview-next/client/src-EO5QoRlU.mjs +3 -0
  162. package/dist/preview-next/client/{src-DzXUmsyK.mjs → src-lX6heoDA.mjs} +2 -1
  163. package/dist/preview-next/client/{useAutosaveStatus-R1rZ9-IZ.mjs → useAutosaveStatus-DpSd9aVk.mjs} +1 -1
  164. package/dist/preview-next/client/{useOpenBlockForSetup-BS7CANPv.mjs → useOpenBlockForSetup-BGZn5AT1.mjs} +1 -1
  165. package/dist/preview-next/keepAlive.mjs +1 -1
  166. package/dist/preview-next/middleware.mjs +1 -1
  167. package/dist/preview-next/{route-contract-BSSbtz6A.mjs → route-contract-DnL-FgSV.mjs} +83 -11
  168. package/dist/server/{Block.shared-Dc3DX7Cf.mjs → Block.shared-BEbq6EwO.mjs} +5 -5
  169. package/dist/server/{bindings-VGgS6UvF.mjs → bindings-Bly0dRs7.mjs} +36 -5
  170. package/dist/server/{client-BPLLL22F.mjs → client-CGJ2ztYp.mjs} +1021 -1118
  171. package/dist/server/config-validation.mjs +1 -1
  172. package/dist/server/config.mjs +2 -2
  173. package/dist/server/constants-Cj7hfbrA.mjs +41 -0
  174. package/dist/server/contentTypeResolver-B9vy8BrF.mjs +19 -0
  175. package/dist/server/data/dataLoaderContext.mjs +1 -1
  176. package/dist/server/data/resolveBlockData.mjs +1 -1
  177. package/dist/server/{dataLoaderContext-B3fXA54R.mjs → dataLoaderContext-lMRTfG5Z.mjs} +1 -0
  178. package/dist/server/error-f4g44bKx.mjs +387 -0
  179. package/dist/server/index.mjs +3 -2
  180. package/dist/server/loadContent-BkK1w3QQ.mjs +692 -0
  181. package/dist/server/{loadPage-CQgde5DN.mjs → loadPage-DTLe0FEs.mjs} +22 -4
  182. package/dist/server/{navigation-iC_hXjJI.mjs → navigation-BcNfYYuu.mjs} +1 -1
  183. package/dist/server/navigation.mjs +1 -1
  184. package/dist/server/next.mjs +103 -100
  185. package/dist/server/{overrideResolution-CkpwAHvW.mjs → overrideResolution-Uy9Zp2Ks.mjs} +1 -1
  186. package/dist/server/page-converter.mjs +1 -1
  187. package/dist/server/{pageRenderPlan-CfSnAkCO.mjs → pageRenderPlan-JzxBnqfV.mjs} +19 -7
  188. package/dist/server/{pageRuntimeSupport-uz4gzBOo.mjs → pageRuntimeSupport-DyNSd2Yj.mjs} +50 -2
  189. package/dist/server/{pageShared-6z6JBU41.mjs → pageShared-DU4ETFPS.mjs} +89 -83
  190. package/dist/server/portal-B4JVkdjc.mjs +783 -0
  191. package/dist/server/portal.mjs +3 -3
  192. package/dist/server/{prebuild-B4_Llisx.mjs → prebuild-8jNtDXmS.mjs} +5 -4
  193. package/dist/server/prebuild.mjs +1 -1
  194. package/dist/server/{prefetchBlockData-CCiYV8_s.mjs → prefetchBlockData-xeMG42aw.mjs} +3 -2
  195. package/dist/server/{registry-CXRXsFSx.mjs → registry-DH1VrsCl.mjs} +587 -329
  196. package/dist/server/rendering/components/pageShared.mjs +1 -1
  197. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  198. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  199. package/dist/server/rendering/server.mjs +5 -4
  200. package/dist/server/rendering.mjs +9 -8
  201. package/dist/server/{resolveBlockData-yfe8WLEA.mjs → resolveBlockData-BN8tweTx.mjs} +24 -5
  202. package/dist/server/resolvePageContent-DnM16_f9.mjs +89 -0
  203. package/dist/server/routing.mjs +271 -57
  204. package/dist/server/server.mjs +3 -3
  205. package/dist/server/{loadContent-CxASA3PE.mjs → servicePageContent-B-FezJmH.mjs} +709 -453
  206. package/dist/server/{validation-BvHio6QI.mjs → validation-3jOzYdPL.mjs} +3 -3
  207. package/dist/server/{version-SuFlio6n.mjs → version-8t0o6_jd.mjs} +1 -1
  208. package/dist/styles/index.css +19 -0
  209. package/package.json +1 -1
  210. package/dist/_dts/footerPageOutline-DwMHeYmQ.d.ts +0 -256
  211. package/dist/_dts/resolvePageContent-DkzWvFbG.d.ts +0 -162
  212. package/dist/client/LocationMapActions-myIQIvQL.mjs +0 -62
  213. package/dist/client/MapDrawingSvg-BfsVyPvB.mjs +0 -200
  214. package/dist/client/course-CUFVJEAc.mjs +0 -237
  215. package/dist/client/duration-Q6_QNgiv.mjs +0 -37
  216. package/dist/client/event-details.client-BwjBJP-f.mjs +0 -53
  217. package/dist/client/eventDetails-C2LfNW_o.mjs +0 -13
  218. package/dist/client/runtimeResponse-CVkM0dHy.mjs +0 -3
  219. package/dist/client/src-BozhJ43Z.mjs +0 -3
  220. package/dist/client/useDiscountCodeUi-I_mXI9Yd.mjs +0 -237
  221. package/dist/client/view-BbzH5MQb.mjs +0 -1371
  222. package/dist/preview-next/client/src-LUhVXBEQ.mjs +0 -3
  223. package/dist/server/constants-hl17xz6x.mjs +0 -22
  224. package/dist/server/portal-BjVHMAUC.mjs +0 -371
  225. package/dist/server/resolvePageContent-CAELMBEJ.mjs +0 -438
@@ -1,20 +1,46 @@
1
1
  "use client";
2
- import { $ as resolveEventRegistrationSubmitPlan, $n as parseCurrencyInputToCents, $t as planSelectionPrice, An as serverPricedTotalCents, B as getTicketSelectionPurpose, Ba as PAGE_NAVIGATION, Bn as getImplicitSingleTicketType, Bt as deriveRunRequirements, Ct as validateFormData, D as registrationRoute, E as registrationPresentation, En as selectionCombinationHint, F as registrationFlowReducer, Fo as eventRegistrationErrors, Ft as eventSignInRestoration, G as resolveRegistrationAdmission, Gn as transformRegistrationOptionsResponse, Go as resolveBookingSignupOffer, Gt as withoutKeptAnswers, H as planRegistrationDetailsCheck, Ha as leavePage, Ht as runFieldErrors, I as buildEventRegistrationPaymentOptionsViewModel, Io as parseEventRegistrationErrorReason, It as toEventSignInDraft, Jn as getEligibilityFlowFlags, Kt as paymentReturnRestoration, L as decideEventRegistrationPayment, Lt as buildSelectionRequirementsSubmission, M as decideEventChoice, Mt as EVENT_SIGN_IN_FORM_ID, N as getDeclinedPass, Nn as findSelectedTicketType, No as decideSelectionAttendance, Nt as eventSignInDraftStore, On as selectionPreviewKey, Ot as getRegistrationStartAt, P as isRegistrationLocked, Po as eventRegistrationErrorEndsCommand, Pt as eventSignInEnds, Qn as getTicketSelectionRemainingPlaces, Qt as incompleteRunChoiceMessage, Rt as checkRunRequirements, Sn as combinationHintCopy, St as registrationQuestionsMessage, T as registrationPaymentRoute, Tn as combinationWorking, Tt as toWaitlistClaimResolveFailure, U as planRegistrationDetailsContinuation, Ui as formatCentsAsCurrencyInput, Un as getVisibleTicketTypes, Ut as runsKeepingAnswers, Vn as getPortalSubjectEmail, Vt as nextRunToRead, W as resolveGuestNextStepCheck, Wa as requestSignIn, Wt as toRunRequirementsSnapshots, Xn as getSlidingScaleForEvent, Xt as decideSelectionPayment, Y as visitorHoldsOwnPlace, Yn as getRegistrationOccurrenceId, Yt as canToggleSelectionItem, Za as resolveEventRegistrationChoices, Zn as getSlidingScaleSelectionMessage, Zt as effectiveSelection, _t as resolveRouteRequiresPayment, aa as toBookingQuestionsPaymentSnapshot, bn as summariseSelectionPayment, bt as createRegistrationDraftData, c as formatCommercePrice, cr as hasValidPricingOptionSelection, dn as selectionItemPrice, dt as restorableBrowserDraftCode, en as primarySelectionItem, er as resolveHeldTicketPlaces, ft as buildRegistrationSelectionRequest, gn as selectionTicketInputs, gt as resolveRegistrationTarget, ht as resolveEventRequiresPayment, ir as getSingleSelectedPricingOptionId, is as publicEventPricingCurrency, it as calculateEventRegistrationPreviewTotal, j as createInitialRegistrationFlowState, jt as toWholeSeriesRegistrationEvents, kn as selectionPreviewLines, kt as toRegistrationEvents, lr as normalizeTicketSelectionLines, lt as registrationBrowserDraft, mt as resolveDiscountContext, na as needsBookingQuestionsRefresh, nr as withRegistrationAvailability, pt as findPreSelectedEvent, q as resolveRegistrationTicketContinuation, qn as getCurrentTicketSelection, t as appliedDiscountHint, ta as deriveBookingQuestions, tn as registrationSelectionMode, tr as shouldLoadRegistrationOptions, un as selectionIncludes, ut as registrationBrowserDraftSchema, vn as severalItemsOf, vt as toRegistrationRequestSubject, wn as combinationOffersOf, wt as isSameWaitlistClaim, xn as toggleSelectionItem, xt as invitationSubmission, yn as severalRunsChoiceMessage, yt as beginWaitlistInvitation, zt as decideSelectionRequirementsLayout } from "./display-4HYOb-AK.mjs";
3
- import { $t as inferSiteDateLocale, dn as resolveBookingBusinessTimeZone, n as assertNever } from "./noop-CaQxI-Js.mjs";
2
+ import { f as err, p as ok } from "./renderableMediaAssetAdmission-BlfqYLJW.mjs";
3
+ import { $ as beginWaitlistInvitation, $t as severalRunsChoiceMessage, An as getSlidingScaleForEvent, Ar as resolveEventRegistrationScopedEvents, At as decideSelectionPayment, Bo as eventRegistrationErrorEndsCommand, C as resolveGuestNextStepCheck, Cn as getVisibleTicketTypes, Ct as runsKeepingAnswers, Dn as getCurrentTicketSelection, E as resolveRegistrationTicketContinuation, Er as closedDateCopy, Et as paymentReturnRestoration, Fn as shouldLoadRegistrationOptions, Ft as registrationSelectionMode, G as withOfferedEvent, Gt as selectionItemPrice, H as registrationBrowserDraft, Hn as hasValidPricingOptionSelection, Ho as parseEventRegistrationErrorReason, Hr as groupPublicEventsByRun, In as withRegistrationAvailability, J as resolveDiscountContext, Jo as resolveWholeSeriesBookingPhase, K as buildRegistrationSelectionRequest, L as calculateEventRegistrationPreviewTotal, M as resolveEventRegistrationSubmitPlan, Mn as getTicketSelectionRemainingPlaces, Mt as incompleteRunChoiceMessage, Nn as parseCurrencyInputToCents, Nt as planSelectionPrice, O as visitorHoldsOwnPlace, Oi as toBookingQuestionsPaymentSnapshot, On as getEligibilityFlowFlags, Pn as resolveHeldTicketPlaces, Pt as primarySelectionItem, Q as toRegistrationRequestSubject, Qt as severalItemsOf, Rn as getSingleSelectedPricingOptionId, S as planRegistrationDetailsContinuation, St as runFieldErrors, Ti as needsBookingQuestionsRefresh, Tn as transformRegistrationOptionsResponse, Tr as closedRunCopy, Tt as withoutKeptAnswers, U as registrationBrowserDraftSchema, Un as normalizeTicketSelectionLines, Vo as eventRegistrationErrors, W as restorableBrowserDraftCode, Wt as selectionIncludes, X as resolveRegistrationTarget, Xt as selectionTicketInputs, Y as resolveEventRequiresPayment, Z as resolveRouteRequiresPayment, Zo as resolveBookingSignupOffer, _t as buildSelectionRequirementsSubmission, a as registrationPresentation, an as combinationWorking, at as toWaitlistClaimResolveFailure, bn as getImplicitSingleTicketType, bt as deriveRunRequirements, cn as selectionPreviewKey, ct as getRegistrationStartAt, d as decideEventChoice, da as PAGE_NAVIGATION, dt as toWholeSeriesRegistrationEvents, en as summariseSelectionPayment, et as createRegistrationDraftData, f as getDeclinedPass, fi as formatCentsAsCurrencyInput, ft as EVENT_SIGN_IN_FORM_ID, g as decideEventRegistrationPayment, gt as toEventSignInDraft, h as buildEventRegistrationPaymentOptionsViewModel, ha as requestSignIn, ht as eventSignInRestoration, i as registrationPaymentRoute, in as combinationOffersOf, it as isSameWaitlistClaim, jn as getSlidingScaleSelectionMessage, jt as effectiveSelection, kn as getRegistrationOccurrenceId, kr as resolveEventRegistrationChoices, kt as canToggleSelectionItem, ln as selectionPreviewLines, lt as toRegistrationEvents, m as registrationFlowReducer, mt as eventSignInEnds, nn as combinationHintCopy, nt as registrationQuestionsMessage, o as registrationRoute, on as selectionCombinationHint, p as isRegistrationLocked, pa as leavePage, pn as findSelectedTicketType, pt as eventSignInDraftStore, q as findPreSelectedEvent, qo as orderedLiveRunSessions, rr as appliedDiscountHint, rt as validateFormData, tn as toggleSelectionItem, tt as invitationSubmission, u as createInitialRegistrationFlowState, un as serverPricedTotalCents, ur as formatCommercePrice, us as publicEventPricingCurrency, vt as checkRunRequirements, w as resolveRegistrationAdmission, wi as deriveBookingQuestions, wr as closedDatesCopy, wt as toRunRequirementsSnapshots, x as planRegistrationDetailsCheck, xn as getPortalSubjectEmail, xt as nextRunToRead, y as getTicketSelectionPurpose, yt as decideSelectionRequirementsLayout, zo as decideSelectionAttendance } from "./wizardSteps-CNDsxeJH.mjs";
4
+ import { mn as resolveBookingBusinessTimeZone, t as assertNever, tn as inferSiteDateLocale } from "./src-CCtanNlD.mjs";
4
5
  import { o as checkBookingQuestionsAnswered } from "./creditProducts-BQ1t1erI.mjs";
5
- import { a as eventSiteTermsSurface, i as useSiteTermsAgreement, r as siteTermsFailureKind } from "./SiteTermsAgreementField-BYACYP0T.mjs";
6
+ import { a as eventSiteTermsSurface, i as useSiteTermsAgreement, r as siteTermsFailureKind } from "./SiteTermsAgreementField-CDBU31xW.mjs";
6
7
  import { t as generateUuidV4 } from "./uuid-BETKW8rS.mjs";
7
- import { i as BlockApiError, n as useBlockApi } from "./context-R9p5c8IH.mjs";
8
+ import { i as BlockApiError, n as useBlockApi } from "./context-DTrwaQtg.mjs";
8
9
  import { t as resolveDedicatedBookingHref } from "./bookingRoute-D6DlxYx6.mjs";
9
- import { r as DISCOUNT_APPLY_MESSAGES } from "./DemoBookingPortalAccess-C9Ggcfx3.mjs";
10
- import { i as useBookingNowIso, r as parseBookingSubmissionFailure } from "./BookingQuestionFields-MbvIo2jS.mjs";
11
- import { t as useDiscountCodeUi } from "./useDiscountCodeUi-I_mXI9Yd.mjs";
12
- import { a as usePolling, c as useBookingQuestionsRefresh, o as portalSessionIdentity, s as useSignInReturn } from "./BookingMailingListNote-CDDWrY_W.mjs";
13
10
  import { n as EVENT_REGISTRATION_CHECKOUT_ATTEMPT_PARAM, t as EVENT_REGISTRATION_ANCHOR_ID } from "./constants-4o4_hl34.mjs";
14
- import { o as storeDemoBookingPass, t as CUSTOMER_PORTAL_PATH } from "./demoPortalMagicLink-tZxIm3RL.mjs";
11
+ import { r as DISCOUNT_APPLY_MESSAGES } from "./DemoBookingPortalAccess-uA9H8LIL.mjs";
12
+ import { i as useBookingNowIso, r as parseBookingSubmissionFailure } from "./BookingQuestionFields-C8IbeLHj.mjs";
13
+ import { t as useDiscountCodeUi } from "./useDiscountCodeUi-rQRE1-Ho.mjs";
14
+ import { a as usePolling, c as useBookingQuestionsRefresh, o as portalSessionIdentity, s as useSignInReturn } from "./BookingMailingListNote-BsbEgagJ.mjs";
15
+ import { s as storeDemoBookingPass, t as CUSTOMER_PORTAL_PATH } from "./demoPortalMagicLink-D0kOJYOX.mjs";
15
16
  import { Suspense, lazy, useCallback, useEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
16
17
  import { jsx } from "react/jsx-runtime";
17
18
  import { z } from "zod";
19
+ //#region ../core/src/participants.ts
20
+ function unsafeAsParticipantEmail(value) {
21
+ return value;
22
+ }
23
+ /**
24
+ * Canonicalizes an optional participant email for equality checks.
25
+ *
26
+ * This intentionally does not validate email shape; call parseParticipantEmail at
27
+ * API/DB boundaries that require a syntactically usable address.
28
+ */
29
+ function normalizeParticipantEmail(value) {
30
+ const normalized = value?.trim().normalize("NFC").toLowerCase() ?? "";
31
+ return normalized.length > 0 ? unsafeAsParticipantEmail(normalized) : null;
32
+ }
33
+ function parseParticipantEmail(value) {
34
+ const normalized = normalizeParticipantEmail(value);
35
+ if (normalized === null) return err({ kind: "empty_email" });
36
+ if (!isEmailLike(normalized)) return err({ kind: "invalid_email_shape" });
37
+ return ok(normalized);
38
+ }
39
+ function isEmailLike(value) {
40
+ const atIndex = value.indexOf("@");
41
+ return atIndex > 0 && atIndex === value.lastIndexOf("@") && atIndex < value.length - 1;
42
+ }
43
+ //#endregion
18
44
  //#region ../blocks/src/system/runtime/shared/utils/portalLogout.ts
19
45
  /**
20
46
  * Portal Logout Utility
@@ -40,6 +66,184 @@ function logoutPortal(anchorId) {
40
66
  form.submit();
41
67
  }
42
68
  //#endregion
69
+ //#region ../blocks/src/system/runtime/nodes/event-registration/registrationSurface.ts
70
+ /** Admission only limits fresh bookings; existing purchases always reach recovery. */
71
+ function registrationAdmissionSurface(input) {
72
+ if (input.recoveryRequested) return "registration";
73
+ switch (input.availability) {
74
+ case "open": return "registration";
75
+ case "closed": return "closed";
76
+ case "empty": return "empty";
77
+ default: return assertNever(input.availability);
78
+ }
79
+ }
80
+ /** Resolve the host guard once. Bookings closing is the wizard's to decide: it owns the step. */
81
+ function resolveEventRegistrationClientSurface(input) {
82
+ if (input.recoveryRequest !== "none") return "wizard";
83
+ switch (input.plan.kind) {
84
+ case "wholeSeries":
85
+ case "occurrence": return "wizard";
86
+ case "unavailableWholeSeries":
87
+ case "mixedBookingScopes": return "unavailable";
88
+ default: return assertNever(input.plan);
89
+ }
90
+ }
91
+ function isPastOccurrence(startsAt, now) {
92
+ if (!startsAt) return false;
93
+ const startsAtTime = Date.parse(startsAt);
94
+ if (!Number.isFinite(startsAtTime)) return false;
95
+ return startsAtTime <= Date.parse(now);
96
+ }
97
+ /** Whether someone on this step hasn't been admitted yet, so closing stops them. */
98
+ function stepStartsNewBooking(step) {
99
+ switch (step) {
100
+ case "select-event":
101
+ case "select-tickets":
102
+ case "enter-details":
103
+ case "select-payment": return true;
104
+ case "submitting":
105
+ case "payment":
106
+ case "verifying-payment":
107
+ case "verifying-timeout":
108
+ case "payment-status":
109
+ case "payment-failed":
110
+ case "error":
111
+ case "success": return false;
112
+ default: return assertNever(step);
113
+ }
114
+ }
115
+ const FRESH_BOOKING_OPEN = { kind: "open" };
116
+ /**
117
+ * Whether this page has stopped taking new bookings, by the clock: a date's page
118
+ * when that date closes or starts, a course run's when the run closes, and a page
119
+ * with several to choose from when none of them is left.
120
+ *
121
+ * Closing only stops someone starting: a person with a checkout under way, a
122
+ * confirmation on screen, a place held for them or a payment to come back to
123
+ * keeps it, whenever the date closes or starts around them.
124
+ */
125
+ function resolveFreshBookingClosure(input) {
126
+ if (input.holdsPlace || input.recoveryRequest !== "none" || !stepStartsNewBooking(input.step)) return { kind: "underway" };
127
+ const { events, occurrenceContext, subject } = input;
128
+ const plan = planEventRegistrationSurface({
129
+ events,
130
+ occurrenceContext,
131
+ subject
132
+ });
133
+ switch (plan.kind) {
134
+ case "wholeSeries": return closedRunsClosure(plan.runs, new Date(input.now));
135
+ case "occurrence": return occurrenceContext ? datePageClosure(events, occurrenceContext, input.now) : closedEarlyClosure(closedDatesCopy(plan.events, new Date(input.now)));
136
+ case "unavailableWholeSeries":
137
+ case "mixedBookingScopes": return FRESH_BOOKING_OPEN;
138
+ default: return assertNever(plan);
139
+ }
140
+ }
141
+ function closedEarlyClosure(copy) {
142
+ return copy ? {
143
+ kind: "closedEarly",
144
+ copy
145
+ } : FRESH_BOOKING_OPEN;
146
+ }
147
+ function datePageClosure(events, occurrenceContext, now) {
148
+ const date = events.find((event) => event.occurrenceId === occurrenceContext.id);
149
+ const copy = date ? closedDateCopy(date, new Date(now)) : null;
150
+ if (copy) return {
151
+ kind: "closedEarly",
152
+ copy
153
+ };
154
+ return isPastOccurrence(occurrenceContext.startsAt, now) ? {
155
+ kind: "started",
156
+ startsAt: occurrenceContext.startsAt
157
+ } : FRESH_BOOKING_OPEN;
158
+ }
159
+ /** One run speaks for itself; several say so together, since each closed at its own time. */
160
+ function closedRunsClosure(runs, now) {
161
+ const closed = runs.flatMap(({ run }) => {
162
+ const phase = resolveWholeSeriesBookingPhase(run, now);
163
+ return phase.kind === "closed" ? [{
164
+ run,
165
+ reason: phase.reason
166
+ }] : [];
167
+ });
168
+ const [first] = closed;
169
+ if (!first || closed.length < runs.length) return FRESH_BOOKING_OPEN;
170
+ return {
171
+ kind: "closedEarly",
172
+ copy: {
173
+ ...closed.length === 1 ? closedRunCopy(first.reason, first.run) : closedRunCopy("bookings-closed"),
174
+ otherDatesHref: null
175
+ }
176
+ };
177
+ }
178
+ /**
179
+ * The moment that decision next changes while the page stays open. With several
180
+ * to choose from that's when the last of them closes: the chooser's own clock
181
+ * takes each one off the list before then.
182
+ */
183
+ function nextFreshBookingBoundary(events, occurrenceContext, subject) {
184
+ const plan = planEventRegistrationSurface({
185
+ events,
186
+ occurrenceContext,
187
+ subject
188
+ });
189
+ switch (plan.kind) {
190
+ case "wholeSeries": return latestInstant(plan.runs.map(({ run }) => run.bookingClosesAt ?? orderedLiveRunSessions(run.sessions)[0]?.startsAt));
191
+ case "occurrence":
192
+ if (!occurrenceContext) return latestInstant(plan.events.map((date) => date.bookingClosesAt ?? date.startsAt));
193
+ return events.find((event) => event.occurrenceId === occurrenceContext.id)?.bookingClosesAt ?? occurrenceContext.startsAt;
194
+ case "unavailableWholeSeries":
195
+ case "mixedBookingScopes": return null;
196
+ default: return assertNever(plan);
197
+ }
198
+ }
199
+ function latestInstant(instants) {
200
+ return instants.reduce((latest, instant) => instant && (latest === null || Date.parse(instant) > Date.parse(latest)) ? instant : latest, null);
201
+ }
202
+ /**
203
+ * Whether a run agrees with the offering whose page it arrived on.
204
+ *
205
+ * Scoping has already restricted the events to the subject's series, so the
206
+ * series set needs no second check here. What is still worth checking is the
207
+ * run's own idea of its parent: a run that claims a different offering means
208
+ * the page and the data disagree about who owns it, and the surface fails
209
+ * closed rather than taking a booking against an offering it cannot vouch for.
210
+ */
211
+ function agreesWithSubjectOffering(run, subject) {
212
+ if (subject?.kind !== "eventOffering") return true;
213
+ return run.run.eventOfferingId === subject.eventOfferingId;
214
+ }
215
+ /**
216
+ * Subjects whose page only ever registers for a whole run.
217
+ *
218
+ * The subject's own booking scope decides, for an offering exactly as for a
219
+ * series: an ordinary offering with no dates is a normal empty state, not a
220
+ * whole-series page with nothing bookable.
221
+ */
222
+ function isWholeSeriesSubject(subject) {
223
+ return (subject?.kind === "eventOffering" || subject?.kind === "eventSeries") && subject.bookingScope === "whole_series";
224
+ }
225
+ function planEventRegistrationSurface(input) {
226
+ const scopedEvents = resolveEventRegistrationScopedEvents(input.events, {
227
+ occurrenceContext: input.occurrenceContext,
228
+ subject: input.subject
229
+ });
230
+ const bookingScopes = new Set(scopedEvents.map((event) => event.bookingScope));
231
+ if (scopedEvents.length === 0 && isWholeSeriesSubject(input.subject)) return { kind: "unavailableWholeSeries" };
232
+ if (!input.occurrenceContext && !input.subject && bookingScopes.has("single_occurrence")) return {
233
+ kind: "occurrence",
234
+ events: scopedEvents.filter((event) => event.bookingScope === "single_occurrence")
235
+ };
236
+ if (bookingScopes.size === 0 || bookingScopes.has("single_occurrence")) return bookingScopes.has("whole_series") ? { kind: "mixedBookingScopes" } : {
237
+ kind: "occurrence",
238
+ events: scopedEvents
239
+ };
240
+ const runs = groupPublicEventsByRun(scopedEvents);
241
+ return runs.every((run) => agreesWithSubjectOffering(run, input.subject)) && runs.length > 0 ? {
242
+ kind: "wholeSeries",
243
+ runs
244
+ } : { kind: "unavailableWholeSeries" };
245
+ }
246
+ //#endregion
43
247
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationDiscountView.state.ts
44
248
  /** The quote owns the code for one booking or several; one booking still finds out what's on offer from availability. */
45
249
  function registrationDiscountView(input) {
@@ -80,7 +284,7 @@ const NO_REDUCTION = {
80
284
  function decideSingleBookingPrices(input) {
81
285
  const { context, quote } = input;
82
286
  if (input.several || !context) return NO_REDUCTION;
83
- if (context.type === "event") return eventPrices(input, quote);
287
+ if (context.type === "event" || context.type === "whole_series") return eventPrices(input, quote);
84
288
  if (!quote) return NO_REDUCTION;
85
289
  if (context.type === "pass") return {
86
290
  ...NO_REDUCTION,
@@ -96,12 +300,16 @@ function eventPrices(input, quote) {
96
300
  ...NO_REDUCTION,
97
301
  automaticDiscount: input.advertisedAutomatic
98
302
  };
99
- if (quote.preview.type !== "applied") return NO_REDUCTION;
303
+ if (quote.preview.type !== "applied") return {
304
+ ...NO_REDUCTION,
305
+ bookingTotalCents: quote.preview.totalAfterDiscountCents
306
+ };
100
307
  return quote.source === "typed" ? {
101
308
  ...NO_REDUCTION,
102
309
  bookingTotalCents: quote.preview.totalAfterDiscountCents
103
310
  } : {
104
311
  ...NO_REDUCTION,
312
+ bookingTotalCents: quote.preview.totalAfterDiscountCents + quote.preview.discountCents,
105
313
  automaticDiscount: automaticFromQuote(quote.preview, input.advertisedAutomatic)
106
314
  };
107
315
  }
@@ -1018,13 +1226,20 @@ function useEligibility(params) {
1018
1226
  function eligibilityRequest(params) {
1019
1227
  const selections = normalizeTicketSelectionLines(params.ticketSelections);
1020
1228
  if (!params.enabled || !params.subject || selections.length === 0) return null;
1229
+ const email = parseParticipantEmail(params.buyerEmail);
1021
1230
  return {
1231
+ buyer: email.ok ? {
1232
+ kind: "email",
1233
+ email: email.value
1234
+ } : { kind: "unknown" },
1235
+ purchaseTarget: params.purchaseTarget ?? "eventTickets",
1022
1236
  subject: toRegistrationRequestSubject(params.subject, params.attendanceMode),
1023
1237
  selections: selections.map(({ pricingOptionId, quantity }) => ({
1024
1238
  pricingOptionId,
1025
1239
  quantity
1026
1240
  })),
1027
- selectedSlidingAmount: params.selectedSlidingAmount ?? void 0
1241
+ selectedSlidingAmount: params.selectedSlidingAmount ?? void 0,
1242
+ ...params.waitlistClaim ? { waitlistClaim: params.waitlistClaim } : {}
1028
1243
  };
1029
1244
  }
1030
1245
  /** One effective union owns readiness, including the pre-fetch debounce window. */
@@ -1056,11 +1271,24 @@ async function loadEligibility(input) {
1056
1271
  function useEligibilityWithDeps(params, deps) {
1057
1272
  const api = deps.useBlockApi();
1058
1273
  const request = eligibilityRequest(params);
1274
+ const scope = useRef({
1275
+ api,
1276
+ version: 0
1277
+ });
1278
+ if (scope.current.api !== api) scope.current = {
1279
+ api,
1280
+ version: scope.current.version + 1
1281
+ };
1059
1282
  const requestKey = JSON.stringify({
1283
+ scope: scope.current.version,
1284
+ subjectEmail: params.subjectEmail,
1285
+ purchaseKey: params.purchaseKey,
1060
1286
  refreshKey: params.refreshKey ?? 0,
1061
1287
  request
1062
1288
  });
1063
1289
  const [state, dispatch] = useReducer(eligibilityLookupReducer, initialEligibilityLookupState);
1290
+ const activeKey = useRef(requestKey);
1291
+ activeKey.current = requestKey;
1064
1292
  useEffect(() => {
1065
1293
  const lifetime = { current: true };
1066
1294
  const timeoutId = window.setTimeout(() => {
@@ -1070,7 +1298,7 @@ function useEligibilityWithDeps(params, deps) {
1070
1298
  request,
1071
1299
  requestKey,
1072
1300
  dispatch,
1073
- isCurrent: () => lifetime.current
1301
+ isCurrent: () => lifetime.current && activeKey.current === requestKey
1074
1302
  });
1075
1303
  }, REGISTRATION_OPTIONS_DEBOUNCE_MS);
1076
1304
  return () => {
@@ -1691,8 +1919,12 @@ function quoteFeedback(state) {
1691
1919
  } : null;
1692
1920
  }
1693
1921
  /** A quote belongs to the complete priced input and the customer, never just the draft code. */
1694
- function selectionQuoteKey(lines, email) {
1695
- return lines ? JSON.stringify([selectionPreviewKey(null, lines), email.trim().toLowerCase()]) : null;
1922
+ function selectionQuoteKey(lines, email, scope) {
1923
+ return lines ? JSON.stringify([
1924
+ selectionPreviewKey(null, lines),
1925
+ email.trim().toLowerCase(),
1926
+ ...scope ? [scope] : []
1927
+ ]) : null;
1696
1928
  }
1697
1929
  function currentSelectionQuote(state, key) {
1698
1930
  return state.key === key ? state : emptyQuoteDraft(key, state.draftCode);
@@ -1734,12 +1966,9 @@ function decideSelectionQuoteResponse(pending, result) {
1734
1966
  * or before going to Stripe and coming back), which they've already applied
1735
1967
  * as far as they know. A code typed here waits for Apply.
1736
1968
  */
1737
- function automaticSelectionQuoteWanted(state, input, carried = false) {
1738
- return input.automaticWanted && state.status === "draft" && (carried || uncodedQuoteWanted(input) && !state.draftCode.trim());
1739
- }
1740
- /** Several items have no total until the server prices them; one booking has a price already. */
1741
- function uncodedQuoteWanted(input) {
1742
- return input.several !== null || input.automaticOffered;
1969
+ function explicitSelectionQuoteWanted(state, input, carried = false) {
1970
+ if (input.several === null && input.combinedPending) return false;
1971
+ return input.automaticWanted && state.status === "draft" && (carried || (input.several !== null || input.productAutomaticOffered) && !state.draftCode.trim());
1743
1972
  }
1744
1973
  /** Nothing to price: no code or automatic discount can change a free selection. */
1745
1974
  function freeSelection(input) {
@@ -1758,11 +1987,14 @@ function pricedPreview(state) {
1758
1987
  if (state.status === "priced") return state.preview;
1759
1988
  return state.status === "refused" ? state.uncoded ?? null : null;
1760
1989
  }
1990
+ function selectionPriceSettled(input, state) {
1991
+ return !(input.several === null && state.key !== null && Boolean(state.draftCode.trim()) && state.status !== "priced") && (pricedPreview(state) !== null || freeSelection(input) || singleBookingNeedsNoAnswer(input, state));
1992
+ }
1761
1993
  /** The only projection that can expose a selection's payable total and submitted code. */
1762
1994
  function decidedSelectionPricing(input, state, apply) {
1763
1995
  const priced = state.status === "priced" ? state : null;
1764
1996
  const fallback = priced === null ? pricedPreview(state) : null;
1765
- const settled = priced !== null || fallback !== null || freeSelection(input) || singleBookingNeedsNoAnswer(input, state);
1997
+ const settled = selectionPriceSettled(input, state);
1766
1998
  const waiting = quoteWaiting(input, state, settled);
1767
1999
  return {
1768
2000
  state,
@@ -1789,11 +2021,11 @@ function decidedSelectionPricing(input, state, apply) {
1789
2021
  * price anyway, so a preview that failed never stops a booking. A typed code always waits.
1790
2022
  */
1791
2023
  function singleBookingNeedsNoAnswer(input, state) {
1792
- if (input.several !== null) return false;
2024
+ if (input.several !== null || input.combinedPending) return false;
1793
2025
  if (state.key === null) return true;
1794
2026
  if (state.draftCode.trim()) return false;
1795
2027
  if (state.status === "failed") return true;
1796
- return state.status === "draft" && !(uncodedQuoteWanted(input) && input.automaticWanted);
2028
+ return state.status === "draft" && !((input.several !== null || input.productAutomaticOffered) && input.automaticWanted);
1797
2029
  }
1798
2030
  /** What the payment step is waiting for. Checking a typed code on one booking leaves its choices on screen, with Pay held. */
1799
2031
  function quoteWaiting(input, state, settled) {
@@ -1829,6 +2061,31 @@ function codeFieldFor(state, apply, settled) {
1829
2061
  hint: state.status === "priced" && state.preview.totalAfterDiscountCents === 0 ? "There's nothing to pay. You won't need to enter card details." : ""
1830
2062
  };
1831
2063
  }
2064
+ /** A combined response may settle only an uncoded draft. Explicit code requests own their result. */
2065
+ function seedRegistrationQuote(state, preview) {
2066
+ if (state.status !== "draft" || state.draftCode.trim() || !preview) return state;
2067
+ if (preview.kind === "incomplete_selection") return state;
2068
+ if (preview.kind === "lookup_failure") return {
2069
+ ...state,
2070
+ status: "failed"
2071
+ };
2072
+ const [first, ...rest] = preview.price.priceReductions;
2073
+ const fields = {
2074
+ subtotalCents: preview.price.subtotalCents,
2075
+ totalAfterDiscountCents: preview.price.totalCents,
2076
+ currency: preview.price.currency,
2077
+ manualCodeEntryAllowed: preview.manualCodeEntryAllowed,
2078
+ ...first ? { priceReductions: [first, ...rest] } : {}
2079
+ };
2080
+ return decideSelectionQuoteResponse(state, preview.automaticCode ? {
2081
+ type: "applied",
2082
+ ...fields,
2083
+ ...preview.automaticCode
2084
+ } : {
2085
+ type: "priced",
2086
+ ...fields
2087
+ });
2088
+ }
1832
2089
  //#endregion
1833
2090
  //#region ../blocks/src/system/runtime/nodes/event-registration/useSelectionCombinationPricing.ts
1834
2091
  const NOTHING = {
@@ -1887,10 +2144,13 @@ async function requestSelectionQuote(input) {
1887
2144
  */
1888
2145
  function useSelectionCombinationPricing(input) {
1889
2146
  const lines = input.several !== null ? selectionPreviewLines(input) : input.singleLines.length > 0 ? input.singleLines : null;
1890
- const key = selectionQuoteKey(lines, input.email);
2147
+ const key = selectionQuoteKey(lines, input.email, input.registrationRequestKey);
1891
2148
  const [state, setState] = useState(() => emptyQuoteDraft(key));
1892
2149
  const [carried, setCarried] = useState(false);
1893
- const current = currentSelectionQuote(state, key);
2150
+ const registrationPreview = input.several === null ? input.registrationPreview : null;
2151
+ const current = seedRegistrationQuote(currentSelectionQuote(state, key), registrationPreview);
2152
+ const activeKey = useRef(key);
2153
+ activeKey.current = key;
1894
2154
  const apply = async () => {
1895
2155
  if (key === null || lines === null) return;
1896
2156
  if (current.draftCode.trim() && !input.email.trim()) {
@@ -1913,26 +2173,27 @@ function useSelectionCombinationPricing(input) {
1913
2173
  lines,
1914
2174
  pending
1915
2175
  });
1916
- setState((previous) => previous === pending ? next : previous);
2176
+ setState((previous) => activeKey.current === key && previous === pending ? next : previous);
1917
2177
  };
1918
2178
  useEffect(() => {
1919
- if (automaticSelectionQuoteWanted(current, input, carried)) apply();
2179
+ if (explicitSelectionQuoteWanted(current, input, carried)) apply();
1920
2180
  }, [
1921
2181
  key,
1922
2182
  input.automaticWanted,
1923
- input.automaticOffered,
2183
+ input.productAutomaticOffered,
2184
+ input.combinedPending,
1924
2185
  current.status,
1925
2186
  current.draftCode,
1926
2187
  carried
1927
2188
  ]);
1928
2189
  const editCode = (draftCode) => {
1929
2190
  setCarried(false);
1930
- setState((previous) => editedSelectionCode(previous, key, draftCode));
2191
+ setState((previous) => editedSelectionCode(seedRegistrationQuote(currentSelectionQuote(previous, key), registrationPreview), key, draftCode));
1931
2192
  };
1932
2193
  /** A code typed in one item's box, or restored after Stripe: priced as soon as payment wants a price. */
1933
2194
  const carryCode = (draftCode) => {
1934
2195
  setCarried(Boolean(draftCode.trim()));
1935
- setState((previous) => editedSelectionCode(previous, key, draftCode));
2196
+ setState((previous) => editedSelectionCode(seedRegistrationQuote(currentSelectionQuote(previous, key), registrationPreview), key, draftCode));
1936
2197
  };
1937
2198
  /** A new booking starts with no code and no earlier price. */
1938
2199
  const reset = () => {
@@ -1952,66 +2213,15 @@ function useSelectionCombinationPricing(input) {
1952
2213
  };
1953
2214
  }
1954
2215
  //#endregion
1955
- //#region ../blocks/src/system/runtime/nodes/event-registration/useSettledCommerceView.ts
1956
- function buildCandidate(input) {
1957
- if (!input.eligibilityIsSettled || !input.eligibility || !input.currentEvent) return null;
1958
- return {
1959
- eventSelectionId: input.currentEvent.selectionId,
1960
- discountContext: resolveDiscountContext({
1961
- paymentSelection: input.paymentSelection,
1962
- event: input.currentEvent,
1963
- eventRequiresPayment: input.eventRequiresPayment,
1964
- ticketsCount: input.ticketsCount
1965
- }),
1966
- subtotalCents: input.eligibility.price,
1967
- summaryLines: input.eligibility.ticketLines.map((line) => ({
1968
- pricingOptionId: line.pricingOptionId,
1969
- label: line.label,
1970
- quantity: line.quantity,
1971
- unitPriceCents: line.unitPriceCents,
1972
- subtotalCents: line.subtotalCents
1973
- }))
1974
- };
1975
- }
1976
- function eligibilityIsSettled(result) {
1977
- return result.settledRequestKey === result.requestKey;
1978
- }
1979
- function viewIsStale(view, currentEvent, eligibilityState) {
1980
- return view.eventSelectionId !== currentEvent?.selectionId || eligibilityState?.tag === "failed" || eligibilityState?.tag === "idle";
1981
- }
1982
- function requestIsSettled(discountUi) {
1983
- return discountUi.discountAvailabilityRequestKey === "disabled" || discountUi.settledDiscountAvailabilityRequestKey === discountUi.discountAvailabilityRequestKey;
1984
- }
1985
- function discountRequest(view, several = false) {
1986
- const discountContext = several ? null : view?.discountContext ?? null;
1987
- return {
1988
- discountContext,
1989
- subtotalCents: discountContext?.type === "event" && view?.subtotalCents !== null ? view?.subtotalCents : void 0
1990
- };
1991
- }
1992
- function useSettledCommerceView(input) {
1993
- const candidate = buildCandidate({
1994
- eligibilityIsSettled: eligibilityIsSettled(input.eligibilityResult),
1995
- eligibility: input.eligibility,
1996
- currentEvent: input.currentEvent,
1997
- paymentSelection: input.paymentSelection,
1998
- eventRequiresPayment: input.eventRequiresPayment,
1999
- ticketsCount: input.ticketsCount
2000
- });
2001
- const settledRef = useRef(candidate);
2002
- if (settledRef.current && viewIsStale(settledRef.current, input.currentEvent, input.eligibilityResult.state)) settledRef.current = null;
2003
- const requestView = candidate ?? settledRef.current;
2004
- const discountUi = input.useDiscountCodeUi({
2005
- api: input.api,
2006
- ...discountRequest(requestView, input.several)
2216
+ //#region ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationRecoveryRequest.ts
2217
+ /** Retain arrival intent while the payment controller cleans up the return URL. */
2218
+ function useEventRegistrationRecoveryRequest() {
2219
+ const [arrival] = useState(() => {
2220
+ if (typeof window === "undefined") return "none";
2221
+ if (eventRegistrationCheckoutReturnRequest(new URLSearchParams(window.location.search))) return "paymentReturn";
2222
+ return getWaitlistClaimTokenFromUrl() || getWaitlistClaimEntryIdFromUrl() ? "waitlistInvitation" : "none";
2007
2223
  });
2008
- if (candidate && requestIsSettled(discountUi)) settledRef.current = candidate;
2009
- return {
2010
- discountUi,
2011
- discountContext: settledRef.current?.discountContext ?? null,
2012
- ticketSelectionSubtotalCents: settledRef.current?.subtotalCents ?? null,
2013
- ticketSelectionSummaryLines: settledRef.current?.summaryLines ?? []
2014
- };
2224
+ return arrival;
2015
2225
  }
2016
2226
  //#endregion
2017
2227
  //#region ../blocks/src/system/runtime/nodes/event-registration/useGuestDetailsCheck.ts
@@ -2049,11 +2259,17 @@ async function checkGuestNextStep(input, request, setCheckingNextStep) {
2049
2259
  }
2050
2260
  }
2051
2261
  function guestNextStepRequest(input) {
2262
+ const buyer = parseParticipantEmail(input.formData.email);
2052
2263
  return input.registrationTarget ? {
2053
2264
  subject: toRegistrationRequestSubject(input.registrationTarget.subject, input.selectedAttendanceMode),
2054
2265
  selections: input.ticketSelections,
2055
2266
  selectedSlidingAmount: input.selectedSlidingAmount ?? void 0,
2056
- email: input.formData.email
2267
+ email: input.formData.email,
2268
+ buyer: buyer.ok ? {
2269
+ kind: "email",
2270
+ email: buyer.value
2271
+ } : { kind: "unknown" },
2272
+ purchaseTarget: "eventTickets"
2057
2273
  } : null;
2058
2274
  }
2059
2275
  //#endregion
@@ -2569,16 +2785,54 @@ function useEventRegistrationWizard(options) {
2569
2785
  return useEventRegistrationWizardWithDeps(options, eventRegistrationWizardDeps);
2570
2786
  }
2571
2787
  const CHOOSER_CLOCK = { kind: "relative" };
2788
+ /** The wizard owns the step, so it owns whether the clock has stopped this visitor starting a booking. */
2789
+ function useFreshBookingClosure(deps, options, events, step, visitorHoldsPlace) {
2790
+ const recoveryRequest = useEventRegistrationRecoveryRequest();
2791
+ const nextBoundary = useMemo(() => nextFreshBookingBoundary(events, options.occurrenceContext, options.subject), [
2792
+ events,
2793
+ options.occurrenceContext,
2794
+ options.subject
2795
+ ]);
2796
+ const now = deps.useBookingNowIso(options.now, {
2797
+ kind: "presentation",
2798
+ nextBoundary
2799
+ });
2800
+ return resolveFreshBookingClosure({
2801
+ step,
2802
+ holdsPlace: visitorHoldsPlace,
2803
+ recoveryRequest,
2804
+ events,
2805
+ occurrenceContext: options.occurrenceContext,
2806
+ subject: options.subject,
2807
+ now
2808
+ });
2809
+ }
2810
+ function holdsPlace(claim, payment) {
2811
+ return claim.kind !== "none" || payment.retryingHeldPlace;
2812
+ }
2813
+ /** A date that has closed has nothing to quote for a new booking. */
2814
+ function bookingClosureAllowsQuote(closure, wanted) {
2815
+ return closure.kind !== "closedEarly" && closure.kind !== "started" && wanted;
2816
+ }
2817
+ function waitlistClaimCredential(claim) {
2818
+ return claim.kind === "none" ? null : claim.request.credential;
2819
+ }
2572
2820
  /**
2573
2821
  * Preserve source availability through event adaptation and page scoping.
2574
2822
  *
2575
2823
  * `choiceNowIso` is the chooser's clock: it starts at the server snapshot so hydration matches, then
2576
2824
  * follows the browser, so a date that starts while the page is open leaves the chooser.
2577
- * `registrationEvents` stays the full set, so payment recovery still finds a date that has started.
2825
+ * `registrationEvents` stays the full set, so payment recovery still finds a date that has started,
2826
+ * and `recoveryEvents` is that set within this page, so an invitation finds a run that has closed.
2578
2827
  */
2579
2828
  function useRegistrationEventSource(options, choiceNowIso) {
2580
2829
  const events = options.eventSource.kind === "ready" ? options.eventSource.events : NO_EVENTS;
2581
2830
  const registrationEvents = useMemo(() => [...toRegistrationEvents(events), ...toWholeSeriesRegistrationEvents(events)], [events]);
2831
+ const scopeOfPage = [
2832
+ options.occurrenceContext?.seriesId,
2833
+ options.subject?.kind,
2834
+ options.subject?.kind === "eventSeries" ? options.subject.eventSeriesId : options.subject?.kind === "eventOffering" ? `${options.subject.eventOfferingId}:${options.subject.catalogueEventSeriesIds.join(",")}` : options.subject?.reason
2835
+ ].join("|");
2582
2836
  const choiceKey = useMemo(() => {
2583
2837
  const choices = resolveEventRegistrationChoices(events, {
2584
2838
  occurrenceContext: options.occurrenceContext,
@@ -2588,22 +2842,25 @@ function useRegistrationEventSource(options, choiceNowIso) {
2588
2842
  }, [
2589
2843
  events,
2590
2844
  choiceNowIso,
2591
- options.occurrenceContext?.seriesId,
2592
- options.subject?.kind,
2593
- options.subject?.kind === "eventSeries" ? options.subject.eventSeriesId : options.subject?.kind === "eventOffering" ? `${options.subject.eventOfferingId}:${options.subject.catalogueEventSeriesIds.join(",")}` : options.subject?.reason
2845
+ scopeOfPage
2594
2846
  ]);
2595
2847
  const scopedEvents = useMemo(() => {
2596
2848
  const choiceIds = new Set(choiceKey.split("\n"));
2597
2849
  return registrationEvents.filter((event) => choiceIds.has(event.selectionId));
2598
2850
  }, [registrationEvents, choiceKey]);
2851
+ const recoveryEvents = useMemo(() => resolveEventRegistrationScopedEvents(registrationEvents, {
2852
+ occurrenceContext: options.occurrenceContext,
2853
+ subject: options.subject
2854
+ }), [registrationEvents, scopeOfPage]);
2599
2855
  return {
2600
2856
  events,
2601
2857
  registrationEvents,
2858
+ recoveryEvents,
2602
2859
  scopedEvents,
2603
- scopedEventSource: useMemo(() => options.eventSource.kind === "ready" ? {
2860
+ claimEventSource: useMemo(() => options.eventSource.kind === "ready" ? {
2604
2861
  kind: "ready",
2605
- events: scopedEvents
2606
- } : options.eventSource, [options.eventSource, scopedEvents])
2862
+ events: recoveryEvents
2863
+ } : options.eventSource, [options.eventSource, recoveryEvents])
2607
2864
  };
2608
2865
  }
2609
2866
  /** A signed-in booker's email is their verified identity, never a draft copy. */
@@ -2614,11 +2871,51 @@ function useVerifiedFormData(draft, authState, profile) {
2614
2871
  email: verifiedEmail
2615
2872
  }, [draft, verifiedEmail]);
2616
2873
  }
2874
+ function registrationQuoteInputs(eligibility) {
2875
+ return {
2876
+ primarySubtotalCents: eligibility?.price ?? null,
2877
+ ticketSelectionSummaryLines: eligibility?.ticketLines ?? []
2878
+ };
2879
+ }
2880
+ function registrationDiscountPreview(state) {
2881
+ return state.tag === "resolved" ? state.eligibility.discountPreview : null;
2882
+ }
2883
+ function registrationPurchaseTarget(payment) {
2884
+ return registrationPurchaseIdentity(payment) === "eventTickets" ? "eventTickets" : "other";
2885
+ }
2886
+ function registrationPurchaseIdentity(payment) {
2887
+ return payment.method === null || payment.method === "stripe" || payment.method === "free" ? "eventTickets" : payment;
2888
+ }
2889
+ function registrationDiscountContext(input) {
2890
+ const { several, currentEvent, paymentIntent, eventRequiresPayment, ticketsCount } = input;
2891
+ const selectedDiscountContext = several !== null || !currentEvent ? null : resolveDiscountContext({
2892
+ paymentSelection: paymentIntent,
2893
+ event: currentEvent,
2894
+ eventRequiresPayment,
2895
+ ticketsCount
2896
+ });
2897
+ return selectedDiscountContext?.type === "event" && currentEvent?.registrationSubject.kind === "wholeSeries" ? {
2898
+ type: "whole_series",
2899
+ eventSeriesId: selectedDiscountContext.eventSeriesId
2900
+ } : selectedDiscountContext;
2901
+ }
2902
+ function registrationClaimRequest(claim) {
2903
+ return claim.kind === "none" ? null : claim.request;
2904
+ }
2905
+ function registrationClaimError(claim, message, action) {
2906
+ return claim.kind === "error" ? {
2907
+ message: claim.message,
2908
+ action: claim.action
2909
+ } : {
2910
+ message,
2911
+ action
2912
+ };
2913
+ }
2617
2914
  function useEventRegistrationWizardWithDeps(options, deps) {
2618
2915
  const api = useBlockApi();
2619
2916
  const arrivalCredential = deps.useWaitlistClaimCredential();
2620
2917
  const nowIso = deps.useBookingNowIso(options.now);
2621
- const { events, registrationEvents, scopedEvents, scopedEventSource } = useRegistrationEventSource(options, deps.useBookingNowIso(options.now, CHOOSER_CLOCK));
2918
+ const { events, registrationEvents, recoveryEvents, scopedEvents, claimEventSource } = useRegistrationEventSource(options, deps.useBookingNowIso(options.now, CHOOSER_CLOCK));
2622
2919
  const preSelectedEvent = useMemo(() => findPreSelectedEvent({
2623
2920
  scopedEvents,
2624
2921
  occurrenceContext: options.occurrenceContext
@@ -2717,7 +3014,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
2717
3014
  const formData = useVerifiedFormData(draftFormData, portalAuthState, portalProfile);
2718
3015
  const portalIdentity = portalSessionIdentity(api.config);
2719
3016
  const waitlistClaim = flowState.invitation;
2720
- const claimLookup = deps.useWaitlistClaim(waitlistClaim.kind === "none" ? null : waitlistClaim.request);
3017
+ const claimLookup = deps.useWaitlistClaim(registrationClaimRequest(waitlistClaim));
2721
3018
  useEffect(() => {
2722
3019
  dispatchFlow({
2723
3020
  type: "claim-arrived",
@@ -2729,16 +3026,15 @@ function useEventRegistrationWizardWithDeps(options, deps) {
2729
3026
  if (claimLookup) dispatchFlow({
2730
3027
  type: "claim-updated",
2731
3028
  lookup: claimLookup,
2732
- events: scopedEventSource,
3029
+ events: claimEventSource,
2733
3030
  occurrenceContextId: options.occurrenceContext?.id
2734
3031
  });
2735
3032
  }, [
2736
3033
  claimLookup,
2737
- scopedEventSource,
3034
+ claimEventSource,
2738
3035
  options.occurrenceContext?.id
2739
3036
  ]);
2740
- const errorMessage = waitlistClaim.kind === "error" ? waitlistClaim.message : submissionErrorMessage;
2741
- const errorAction = waitlistClaim.kind === "error" ? waitlistClaim.action : submissionErrorAction;
3037
+ const { message: errorMessage, action: errorAction } = registrationClaimError(waitlistClaim, submissionErrorMessage, submissionErrorAction);
2742
3038
  const selectionLocked = isRegistrationLocked(step);
2743
3039
  useEffect(() => {
2744
3040
  if (selectionLocked || portalAuthState !== "authenticated" || !portalProfile) return;
@@ -2807,20 +3103,31 @@ function useEventRegistrationWizardWithDeps(options, deps) {
2807
3103
  detailsInPage: () => Object.keys(validateFormData(formData)).length === 0
2808
3104
  });
2809
3105
  const { recovery: paymentStatusRecovery, showRecovery: setPaymentStatusRecovery, check: handleCheckPaymentStatus, continuePayment: handleContinueExistingPayment, returnToPayment: handleReturnToPayment, returnToBooking: handleReturnToBooking } = paymentController;
3106
+ const bookingClosure = useFreshBookingClosure(deps, options, events, step, holdsPlace(waitlistClaim, paymentController));
2810
3107
  const eligibilityResult = deps.useEligibility({
2811
3108
  refreshKey: optionsRefreshKey,
2812
- enabled: shouldRefreshAfterRegistrationError(step, errorAction, shouldLoadRegistrationOptions(portalAuthState, step)),
3109
+ buyerEmail: formData.email,
3110
+ purchaseTarget: registrationPurchaseTarget(paymentIntent),
3111
+ purchaseKey: JSON.stringify([
3112
+ registrationPurchaseIdentity(paymentIntent),
3113
+ several,
3114
+ api.config.siteId,
3115
+ portalIdentity
3116
+ ]),
3117
+ enabled: bookingClosureAllowsQuote(bookingClosure, shouldRefreshAfterRegistrationError(step, errorAction, shouldLoadRegistrationOptions(portalAuthState, step))),
2813
3118
  subject: registrationTarget?.subject ?? null,
2814
3119
  attendanceMode: selectedAttendanceMode,
2815
3120
  ticketSelections,
2816
3121
  selectedSlidingAmount: parseCurrencyInputToCents(selectedSlidingAmountInput),
2817
- subjectEmail: getPortalSubjectEmail(portalProfile)
3122
+ subjectEmail: getPortalSubjectEmail(portalProfile),
3123
+ waitlistClaim: waitlistClaimCredential(waitlistClaim)
2818
3124
  });
2819
3125
  const existingRegistrationResult = deps.useExistingEventRegistration({
2820
3126
  isAuthenticated: portalAuthState === "authenticated",
2821
3127
  occurrenceId: registrationOccurrenceId
2822
3128
  });
2823
3129
  const existingRegistrations = useMemo(() => existingRegistrationResult.registrations.filter((registration) => registration.occurrenceId === registrationOccurrenceId), [existingRegistrationResult.registrations, registrationOccurrenceId]);
3130
+ const registrationOptionsState = eligibilityResult.state;
2824
3131
  const eligibility = eligibilityResult.eligibility;
2825
3132
  const eligibilityLoading = eligibilityResult.isLoading;
2826
3133
  const eligibilityError = eligibilityResult.error;
@@ -3138,16 +3445,21 @@ function useEventRegistrationWizardWithDeps(options, deps) {
3138
3445
  }
3139
3446
  setStep("select-tickets");
3140
3447
  };
3141
- const { discountUi, discountContext, ticketSelectionSubtotalCents: primarySubtotalCents, ticketSelectionSummaryLines } = useSettledCommerceView({
3142
- api,
3143
- useDiscountCodeUi: deps.useDiscountCodeUi,
3144
- eligibilityResult,
3145
- eligibility,
3448
+ const currentPreview = registrationDiscountPreview(eligibilityResult.state);
3449
+ const discountContext = registrationDiscountContext({
3450
+ several,
3146
3451
  currentEvent,
3452
+ paymentIntent,
3147
3453
  eventRequiresPayment,
3148
- paymentSelection: paymentIntent,
3149
- ticketsCount,
3150
- several: several !== null
3454
+ ticketsCount
3455
+ });
3456
+ const { primarySubtotalCents, ticketSelectionSummaryLines } = registrationQuoteInputs(eligibility);
3457
+ const discountUi = deps.useDiscountCodeUi({
3458
+ api,
3459
+ discountContext,
3460
+ preview: currentPreview,
3461
+ loading: eligibilityLoading,
3462
+ scopeKey: eligibilityResult.requestKey
3151
3463
  });
3152
3464
  const selectionPrice = planSelectionPrice({
3153
3465
  several,
@@ -3181,7 +3493,10 @@ function useEventRegistrationWizardWithDeps(options, deps) {
3181
3493
  ticketLines: ticketSelectionSummaryLines,
3182
3494
  currentEvent
3183
3495
  }),
3184
- automaticOffered: automaticQuoteOffered(discountUi.autoAppliedDiscount, discountContext)
3496
+ registrationPreview: currentPreview,
3497
+ registrationRequestKey: eligibilityResult.requestKey,
3498
+ combinedPending: eligibilityLoading,
3499
+ productAutomaticOffered: discountUi.autoAppliedDiscount !== null && discountContext?.type === "pass"
3185
3500
  });
3186
3501
  const discountView = registrationDiscountView({
3187
3502
  several: several !== null,
@@ -3436,6 +3751,8 @@ function useEventRegistrationWizardWithDeps(options, deps) {
3436
3751
  ...registrationNavigation.presentation,
3437
3752
  api,
3438
3753
  nowIso,
3754
+ /** Whether the clock has stopped this visitor starting a booking on this page. */
3755
+ bookingClosure,
3439
3756
  directPaymentOptions,
3440
3757
  paymentDecision,
3441
3758
  anchorId: options.anchorId,
@@ -3444,7 +3761,10 @@ function useEventRegistrationWizardWithDeps(options, deps) {
3444
3761
  subject: options.subject,
3445
3762
  events,
3446
3763
  maxTicketsNum: waitlistClaim.kind === "ready" ? waitlistClaim.restoration.ticketsCount : options.maxTicketsNum,
3447
- scopedEvents,
3764
+ /** The new-booking choices, plus the run or date an invitation holds a place on. */
3765
+ scopedEvents: withOfferedEvent(scopedEvents, waitlistClaim),
3766
+ /** Everything on this page a booking could be for, whether or not it's still a choice. */
3767
+ recoveryEvents,
3448
3768
  preSelectedEvent: preSelectedDisplayEvent(preSelectedEvent, currentEvent, displayEvent),
3449
3769
  hasPreSelectedContext,
3450
3770
  presentation,
@@ -3576,7 +3896,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
3576
3896
  isMembershipFastTrack,
3577
3897
  waitlistClaim,
3578
3898
  eligibility,
3579
- registrationOptionsState: eligibilityResult.state,
3899
+ registrationOptionsState,
3580
3900
  eligibilityLoading: anyLoading(eligibilityLoading, checkingNextStep, combinationPricing.quoting),
3581
3901
  eligibilityError,
3582
3902
  existingRegistrations,
@@ -3709,10 +4029,6 @@ function singleBookingTicketDetails(contextType, input) {
3709
4029
  ticketUnits
3710
4030
  };
3711
4031
  }
3712
- /** The server can't yet preview an automatic discount on a membership, so its summary shows the regular price and checkout takes the discount off. */
3713
- function automaticQuoteOffered(automatic, context) {
3714
- return automatic !== null && context?.type !== "membership";
3715
- }
3716
4032
  /** The quote's field, saying beside an applied code what it does to this purchase. */
3717
4033
  function registrationCodeField(field, quote, paymentIntent) {
3718
4034
  if (!field) return null;
@@ -3811,7 +4127,7 @@ function resolveWizardPaymentView(input) {
3811
4127
  }
3812
4128
  //#endregion
3813
4129
  //#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationPayment.tsx
3814
- const Payment = lazy(() => import("./EventEmbeddedCheckoutStep-B18VbNS_.mjs"));
4130
+ const Payment = lazy(() => import("./EventEmbeddedCheckoutStep-BDnicDM6.mjs"));
3815
4131
  /** The one Stripe mount, shared by the standard wizard and headless arrangements. */
3816
4132
  function EventPaymentMount({ state, onComplete, onRetry, onBack, buttonVariant }) {
3817
4133
  if (state.kind === "abandoning") return /* @__PURE__ */ jsx("p", {
@@ -3844,4 +4160,4 @@ function EventRegistrationPayment({ flow }) {
3844
4160
  });
3845
4161
  }
3846
4162
  //#endregion
3847
- export { getWaitlistClaimEntryIdFromUrl as a, eventRegistrationCheckoutReturnRequest as i, EventRegistrationPayment as n, getWaitlistClaimTokenFromUrl as o, useEventRegistrationWizard as r, EventPaymentMount as t };
4163
+ export { planEventRegistrationSurface as a, useEventRegistrationRecoveryRequest as i, EventRegistrationPayment as n, registrationAdmissionSurface as o, useEventRegistrationWizard as r, resolveEventRegistrationClientSurface as s, EventPaymentMount as t };