@riverbankcms/sdk 0.181.0 → 0.182.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 (196) hide show
  1. package/dist/_dts/{BlocksIslandsHydrator-CVCasDPz.d.ts → BlocksIslandsHydrator-Bvw2bUif.d.ts} +1 -1
  2. package/dist/_dts/{Page-Dtj2Ui3S.d.ts → Page-B2EAT-bE.d.ts} +7 -7
  3. package/dist/_dts/{SdkPreviewMode-D1f_60WW.d.ts → SdkPreviewMode-D0vww6rh.d.ts} +2 -2
  4. package/dist/_dts/{client-Chr9pNVW.d.ts → client-D6T430bk.d.ts} +1 -3
  5. package/dist/_dts/{content-types-kjccgopX.d.ts → content-types-wZVWccC6.d.ts} +2 -2
  6. package/dist/_dts/{contracts-BodaiS00.d.ts → contracts-B-vtOcr8.d.ts} +3 -3
  7. package/dist/_dts/{generatePageMetadata-BS6kaJFp.d.ts → generatePageMetadata-CxfwHE6z.d.ts} +2 -2
  8. package/dist/_dts/{index-Brl6_I2j.d.ts → index-CEyYMhLJ.d.ts} +1 -1
  9. package/dist/_dts/{index-DG0OvBs0.d.ts → index-CQrb3Ccc.d.ts} +4 -4
  10. package/dist/_dts/{index-Dy50xUMK.d.ts → index-CciRW_w1.d.ts} +2 -2
  11. package/dist/_dts/{index-Diqt0PvG.d.ts → index-Cqxis-nv.d.ts} +1 -1
  12. package/dist/_dts/{index-CJkefwYh.d.ts → index-DIU-wL1M.d.ts} +2 -2
  13. package/dist/_dts/{index-D1WpKwQe.d.ts → index-DqPKdeTk.d.ts} +1 -1
  14. package/dist/_dts/{loadContent-BgxshKrA.d.ts → loadContent-D0wrxiSp.d.ts} +7 -7
  15. package/dist/_dts/{request-CA0izds5.d.ts → request-DEwxUSw8.d.ts} +130 -28
  16. package/dist/_dts/{resolveBlockData-ChQmwEd3.d.ts → resolveBlockData-VaG_MYbN.d.ts} +5 -5
  17. package/dist/_dts/{resolvePageContent-BvGyvblj.d.ts → resolvePageContent-DTwklC_v.d.ts} +1 -1
  18. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  19. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  20. package/dist/_dts/sdk/src/client.d.ts +7 -7
  21. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  22. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  23. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  24. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  25. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  26. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  27. package/dist/_dts/sdk/src/gifting/client.d.ts +1 -1
  28. package/dist/_dts/sdk/src/index.d.ts +7 -7
  29. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  30. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  31. package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
  32. package/dist/_dts/sdk/src/next/index.d.ts +7 -7
  33. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  34. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  35. package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
  36. package/dist/_dts/sdk/src/portal/index.d.ts +1 -1
  37. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  38. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  39. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  40. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  41. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  42. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  43. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  44. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
  45. package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
  46. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  47. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  48. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  49. package/dist/_dts/sdk/src/routing/index.d.ts +6 -6
  50. package/dist/_dts/sdk/src/server.d.ts +5 -5
  51. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  52. package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
  53. package/dist/_dts/{serviceBookingOutline-BgFbJQhU.d.ts → serviceBookingOutline-DtQuFlID.d.ts} +6 -6
  54. package/dist/_dts/{types-CgS3xLk8.d.ts → types-B3RjeBLV.d.ts} +2 -2
  55. package/dist/_dts/{types-CQrsP1x_.d.ts → types-BvUSGQrw.d.ts} +3 -3
  56. package/dist/_dts/{types-R65DKjPn.d.ts → types-CkRFtBqd.d.ts} +7 -7
  57. package/dist/_dts/{validation-6LTIbuBA.d.ts → validation-BZA3DhcV.d.ts} +4 -4
  58. package/dist/client/{BlocksIslandsHydrator-DqZPz6oW.mjs → BlocksIslandsHydrator-CQMf0HdN.mjs} +17 -17
  59. package/dist/client/{BookingMailingListNote-uWfR2kaG.mjs → BookingMailingListNote-7kdvuPow.mjs} +6 -6
  60. package/dist/client/{BookingQuestionFields-CyNIKw6k.mjs → BookingQuestionFields-BJI7mZuV.mjs} +1 -1
  61. package/dist/client/{CalendarNavigationChevron-BGCX3zwG.mjs → CalendarNavigationChevron-DPUD6wjy.mjs} +7 -7
  62. package/dist/client/{DemoBookingPortalAccess-DFLPyuqe.mjs → DemoBookingPortalAccess-8kwNF9HN.mjs} +4 -4
  63. package/dist/client/{EventCalendar.client-zDL4-t-B.mjs → EventCalendar.client-Dhb14bcC.mjs} +9 -9
  64. package/dist/client/{EventCombined.client-uciDKLID.mjs → EventCombined.client-C1jEZBN9.mjs} +8 -8
  65. package/dist/client/{EventItem-CwzrjcRw.mjs → EventItem-Bb0ppG2N.mjs} +8 -176
  66. package/dist/client/{EventListWeekNavigation-ChvcnPma.mjs → EventListWeekNavigation-DMryCaNV.mjs} +1 -1
  67. package/dist/client/{EventListing.client-DA57Qoyx.mjs → EventListing.client-BuH5kKA3.mjs} +3 -3
  68. package/dist/client/{EventListing.view-DZ0qMFF4.mjs → EventListing.view-DsqvuulZ.mjs} +7 -7
  69. package/dist/client/{EventRegistrationPayment-DSqCJL8E.mjs → EventRegistrationPayment-D4FvQSFF.mjs} +31 -164
  70. package/dist/client/{Page-C7mygH_f.mjs → Page-sV6BJkXX.mjs} +172 -102
  71. package/dist/client/{SiteTermsAgreementField-B4z-e4Wq.mjs → SiteTermsAgreementField-VfSd6JU-.mjs} +2 -2
  72. package/dist/client/{StepIndicator-Dn_DY4oY.mjs → StepIndicator-B6o5B7g3.mjs} +1 -1
  73. package/dist/client/{StepIndicator-atfDU82W.mjs → StepIndicator-BTqO7cJl.mjs} +220 -19
  74. package/dist/client/{accessibleSurfaces-n6kS6Hct.mjs → accessibleSurfaces-BogaGutk.mjs} +966 -693
  75. package/dist/client/{accordion-CsW8U3ff.mjs → accordion-6cuswD_s.mjs} +1 -1
  76. package/dist/client/{booking-form.client-cBWM392H.mjs → booking-form.client-BOMe_SKi.mjs} +15 -15
  77. package/dist/client/{bookingForm-DgySpp6C.mjs → bookingForm-DSCH-VHo.mjs} +4 -4
  78. package/dist/client/bookings.mjs +5 -5
  79. package/dist/client/{boxStyleClassNames-BpGVdLFD.mjs → boxStyleClassNames-BFuqZCfz.mjs} +2 -2
  80. package/dist/client/{carousel-DJoleFV3.mjs → carousel-CGyQVV1M.mjs} +1 -1
  81. package/dist/client/{cart-EO5o6uPH.mjs → cart-BYOe7MCh.mjs} +3 -3
  82. package/dist/client/{cart.client-D_gPw45z.mjs → cart.client-BKFkaXdV.mjs} +1 -1
  83. package/dist/client/{checkout-NVfZW0kR.mjs → checkout-Dwd7Di77.mjs} +3 -3
  84. package/dist/client/{checkout.client-DD3JuqOy.mjs → checkout.client-C25hpi-z.mjs} +1 -1
  85. package/dist/client/{checkoutUrls-z2gXvlGw.mjs → checkoutUrls-tG788sw0.mjs} +1 -1
  86. package/dist/client/client.mjs +25 -6
  87. package/dist/client/{constants-CoOkvw__.mjs → constants-DdxFG3Ic.mjs} +1 -1
  88. package/dist/client/{context-CRhn9qzS.mjs → context-Hi1RuYEM.mjs} +23 -5
  89. package/dist/client/{dateFormatting-BnWB4L1s.mjs → dateFormatting-C8vBCHuo.mjs} +1 -1
  90. package/dist/client/{demoPortalMagicLink-CWDGSTBu.mjs → demoPortalMagicLink-BAL5UIDG.mjs} +1 -1
  91. package/dist/client/{enhanceHeaderSection-tdP_-Z9o.mjs → enhanceHeaderSection-Dv1Lr9kJ.mjs} +3 -3
  92. package/dist/client/{event-registration.client-D7YYKySQ.mjs → event-registration.client-dB_Z7bb-.mjs} +12 -12
  93. package/dist/client/{eventCalendar-CsAfu5d0.mjs → eventCalendar-CQnRA4Ww.mjs} +4 -4
  94. package/dist/client/{eventCombined-VXJB5CoS.mjs → eventCombined-BDOG1hVp.mjs} +4 -4
  95. package/dist/client/{eventListing-B3KIZNfY.mjs → eventListing-DSVmhy9n.mjs} +4 -4
  96. package/dist/client/{eventRegistration-BP-dEk1c.mjs → eventRegistration-CD5mRtEH.mjs} +4 -4
  97. package/dist/client/{form-DM8Zbxbv.mjs → form-DWnlEVSK.mjs} +3 -3
  98. package/dist/client/{form.client-e2z_Tlgk.mjs → form.client-D7zmeqNI.mjs} +4 -4
  99. package/dist/client/{form.parts-Ctljy1a3.mjs → form.parts-C-G6N_MK.mjs} +1 -1
  100. package/dist/client/gifting/client.mjs +7 -7
  101. package/dist/client/{gifting-DWIsqQru.mjs → gifting-Cn0jidP5.mjs} +4 -4
  102. package/dist/client/{gifting.client-QsSWF0uA.mjs → gifting.client-DVo1YFLs.mjs} +4 -4
  103. package/dist/client/{gifting.parts-CedLgwa_.mjs → gifting.parts-Bak93gD2.mjs} +2 -2
  104. package/dist/client/{headerSection-DAkRkwb-.mjs → headerSection-DjQuj_6v.mjs} +2 -2
  105. package/dist/client/{newsletter-form.client-WYja9-WN.mjs → newsletter-form.client-rIYPziZC.mjs} +5 -5
  106. package/dist/client/{newsletter-form.interactive-RuM86VAv.mjs → newsletter-form.interactive-DVt3enLr.mjs} +162 -135
  107. package/dist/client/{newsletter-form.parts-2petDnWv.mjs → newsletter-form.parts-CH6dGfdn.mjs} +1 -1
  108. package/dist/client/{newsletterForm-BUbXdA_e.mjs → newsletterForm-Cg8cBDHd.mjs} +3 -3
  109. package/dist/client/{noop-Dl4mZ-rr.mjs → noop-jesvJXEE.mjs} +239 -229
  110. package/dist/client/portal/client.mjs +269 -83
  111. package/dist/client/{portalOrders-COGn4BKG.mjs → portalOrders-oEoTvzkW.mjs} +1 -1
  112. package/dist/client/{portalRoutes-D72yvtDh.mjs → portalRoutes-ByyVZfVq.mjs} +13 -2
  113. package/dist/client/{product-detail.client-pOAryevt.mjs → product-detail.client-5aHq-vuu.mjs} +1 -1
  114. package/dist/client/{product-list.client-CcUpUiud.mjs → product-list.client-CyAk5rnC.mjs} +1 -1
  115. package/dist/client/{productDetail-BZJCfqat.mjs → productDetail-B8aZ2mqY.mjs} +3 -3
  116. package/dist/client/{productList-CiRs3mNb.mjs → productList-BuLemmod.mjs} +3 -3
  117. package/dist/client/{propsDecoder--uHW4tFM.mjs → propsDecoder-0Unsqn3R.mjs} +2 -2
  118. package/dist/client/{registry.server-CDNNd8wC.mjs → registry.server-DzvtVVD0.mjs} +352 -166
  119. package/dist/client/rendering/client.mjs +23 -23
  120. package/dist/client/rendering/islands.mjs +1 -1
  121. package/dist/client/rendering.mjs +5 -5
  122. package/dist/client/{richText-coerce-CQGE_wHV.mjs → richText-coerce-Bnng7JFA.mjs} +2 -2
  123. package/dist/client/{routeIslandApiConfig-BtCg87-N.mjs → routeIslandApiConfig-BGfcc9sk.mjs} +1 -1
  124. package/dist/client/{runtimeResponse-Ds9cmBUf.mjs → runtimeResponse-DAPVRToN.mjs} +1 -1
  125. package/dist/client/{runtimeResponse-DL_ARBpa.mjs → runtimeResponse-nXT8VAMl.mjs} +1 -1
  126. package/dist/client/{shop-Rx_gEMK8.mjs → shop-GuMqnDL-.mjs} +3 -3
  127. package/dist/client/{shop-commerce-D8evQnMT.mjs → shop-commerce-D5bDY1o1.mjs} +12 -12
  128. package/dist/client/{shop-commerce-store-C9PcsSTj.mjs → shop-commerce-store-B7sHnLwI.mjs} +1 -1
  129. package/dist/client/{shop-discount-apply.state-D5CtGfJI.mjs → shop-discount-apply.state-Dos2zdC2.mjs} +2 -2
  130. package/dist/client/{shop.client-D4lzQ9oY.mjs → shop.client-uvj5GDZb.mjs} +11 -11
  131. package/dist/client/{shopShared-BVbq7Nm-.mjs → shopShared-3giNWE3H.mjs} +2 -2
  132. package/dist/client/{src-ZSqRK3dD.mjs → src-CmXh3JWs.mjs} +5 -1
  133. package/dist/client/{timetableModel-BQJrSK0K.mjs → timetableModel-GA-hn1qM.mjs} +8 -15
  134. package/dist/client/{useAvailableSlots-Dm3lKJKR.mjs → useAvailableSlots-CBneCxbG.mjs} +2 -2
  135. package/dist/client/{useDiscountCodeUi-klgfGn7f.mjs → useDiscountCodeUi-D0kGF0C7.mjs} +1 -1
  136. package/dist/client/{useEventPagination-Jnjt7_ly.mjs → useEventPagination-xX8n_Tuu.mjs} +7 -7
  137. package/dist/client/{view-CC_yQLSA.mjs → view-DOyZc-DF.mjs} +3 -3
  138. package/dist/client/{wizardSteps-BliJOzEX.mjs → wizardSteps-B952ify5.mjs} +303 -31
  139. package/dist/preview-next/client/{PageSectionToolbar-BhL0uADo.mjs → PageSectionToolbar-BI3UCdpu.mjs} +3 -3
  140. package/dist/preview-next/client/{PreviewEditorSidebar-Ct8eIm0i.mjs → PreviewEditorSidebar-jkfLVOgY.mjs} +12 -9
  141. package/dist/preview-next/client/{PreviewEditorUI-BS32G4V9.mjs → PreviewEditorUI-DwJQs4hM.mjs} +4 -4
  142. package/dist/preview-next/client/{PreviewShell-RL0WfZXD.mjs → PreviewShell-BAxAkuz8.mjs} +5 -5
  143. package/dist/preview-next/client/{SdkPreviewModeRuntime-MK_gHeGy.mjs → SdkPreviewModeRuntime-0UVB-39f.mjs} +44 -17
  144. package/dist/preview-next/client/{previewAssistantSlot-CQyS8pcq.mjs → previewAssistantSlot-BgiYk3PB.mjs} +2577 -1683
  145. package/dist/preview-next/client/{previewChromeRoot-BSxp3Mfu.mjs → previewChromeRoot-tieNdF3E.mjs} +1 -1
  146. package/dist/preview-next/client/runtime.mjs +3 -3
  147. package/dist/preview-next/client/{sdk-runtime-DKnTzy74.mjs → sdk-runtime-DXb_Evl0.mjs} +2 -2
  148. package/dist/preview-next/client/{siteStyleAccess-BlmbvbLN.mjs → siteStyleAccess-BlN0jt2c.mjs} +1 -1
  149. package/dist/preview-next/client/{useAutosaveStatus-D-7GwZOQ.mjs → useAutosaveStatus-BUEPA4oL.mjs} +1 -1
  150. package/dist/preview-next/client/{useOpenBlockForSetup-BNZtGM5g.mjs → useOpenBlockForSetup-BVfr5P--.mjs} +1 -1
  151. package/dist/preview-next/keepAlive.mjs +1 -1
  152. package/dist/preview-next/middleware.mjs +1 -1
  153. package/dist/preview-next/{route-contract-R3PcMmax.mjs → route-contract-BHTBA48n.mjs} +20 -1
  154. package/dist/server/{Block.shared-CniF9tSu.mjs → Block.shared-hGoyEdjJ.mjs} +5 -5
  155. package/dist/server/{ThemeScopeCore-BQWsnGT6.mjs → ThemeScopeCore-BfUCTOwj.mjs} +37 -25
  156. package/dist/server/{accessibleSurfaces-WPzUAHp4.mjs → accessibleSurfaces-Dskni4Xj.mjs} +94 -361
  157. package/dist/server/{bindings-DxojjtK3.mjs → bindings-DMJH4bvo.mjs} +4 -4
  158. package/dist/server/{client-CDndhbYO.mjs → client-DrwlRNAH.mjs} +22 -3
  159. package/dist/server/config-validation.mjs +1 -1
  160. package/dist/server/config.mjs +2 -2
  161. package/dist/server/{constants-VyF5nEhL.mjs → constants-CeMywaiD.mjs} +11 -0
  162. package/dist/server/data/resolveBlockData.mjs +1 -1
  163. package/dist/server/{resolveButtonColourStates-B0O1IM16.mjs → expandPalette-ehuW8r2g.mjs} +769 -227
  164. package/dist/server/index.mjs +2 -2
  165. package/dist/server/{loadContent-BKstMBmX.mjs → loadContent-D0prFflT.mjs} +4 -4
  166. package/dist/server/{loadPage-IgNnZaqr.mjs → loadPage-CBLke9pJ.mjs} +3 -3
  167. package/dist/server/{lookMediaFrame-TFjgNG61.mjs → lookMediaFrame-H0fi4bJk.mjs} +2 -2
  168. package/dist/server/{navigation-quBYlSKD.mjs → navigation-wrcuWmgp.mjs} +1 -1
  169. package/dist/server/navigation.mjs +1 -1
  170. package/dist/server/next.mjs +8 -8
  171. package/dist/server/{overrideResolution-CCaAPpIa.mjs → overrideResolution-DUgCEH8z.mjs} +1 -1
  172. package/dist/server/page-converter.mjs +1 -1
  173. package/dist/server/{pageRenderPlan-B7iULvKe.mjs → pageRenderPlan-BHrmogsW.mjs} +161 -244
  174. package/dist/server/{pageRuntimeSupport-BytMroxn.mjs → pageRuntimeSupport-D2-YMRei.mjs} +1 -1
  175. package/dist/server/{pageShared-Dcs_XTIO.mjs → pageShared-CG8O31Eo.mjs} +1265 -1032
  176. package/dist/server/{parseThemeForPersistence-Bihl4W5K.mjs → parseThemeForPersistence-CrPlbJEN.mjs} +1 -1
  177. package/dist/server/{portal-CMW_b9mG.mjs → portal-pG_uhsI2.mjs} +1 -1
  178. package/dist/server/portal.mjs +2 -2
  179. package/dist/server/{prebuild-agaH-vZV.mjs → prebuild-C8Amvzce.mjs} +1 -1
  180. package/dist/server/prebuild.mjs +1 -1
  181. package/dist/server/{prefetchBlockData-DwpRjqw4.mjs → prefetchBlockData-BxUETRIZ.mjs} +2 -2
  182. package/dist/server/{registry-DM9dHfDC.mjs → registry-Cc88-23f.mjs} +1173 -745
  183. package/dist/server/rendering/components/pageShared.mjs +1 -1
  184. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  185. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  186. package/dist/server/rendering/server.mjs +4 -4
  187. package/dist/server/rendering.mjs +8 -8
  188. package/dist/server/{resolveBlockData-CinHGf8l.mjs → resolveBlockData-OG3KOkig.mjs} +1 -1
  189. package/dist/server/server.mjs +3 -3
  190. package/dist/server/{servicePageContent-BBBhOtdE.mjs → servicePageContent-BcFuhhD7.mjs} +5 -5
  191. package/dist/server/theme-bridge.mjs +33 -8
  192. package/dist/server/theme.mjs +1 -1
  193. package/dist/server/{validation-DG5jX3jH.mjs → validation-BovmbS8N.mjs} +3 -3
  194. package/dist/server/{version-CipbxPHL.mjs → version-hws4hgyX.mjs} +1 -1
  195. package/dist/styles/index.css +86 -46
  196. package/package.json +1 -1
@@ -1,21 +1,21 @@
1
1
  "use client";
2
2
  "use client";
3
3
  import { m as ok, p as err } from "../renderableMediaAssetAdmission-BsOWd9lf.mjs";
4
- import { An as formatCurrencyAmount, Fn as unsafeAsAppointmentResourceId, On as parsePositiveMoneyInputToCents, Sn as parseUtcIsoDateTimeString, _t as unknownKind, an as formatDateTimeRange, bn as parseBookingLocalDate, cn as formatTime, gt as exactSchema, ht as evolvingSchema, in as formatDateTime, ln as formatTimeRange, nn as formatDate, rn as formatDateRange, t as assertNever, vt as unknownTag } from "../src-ZSqRK3dD.mjs";
5
- import { a as withPortalArrival, c as portalBookingViewSchema, d as portalWaitlistOfferPriceSchema, h as parseOrderPaymentReceiptId, i as portalPath, l as portalBookingsResponseSchema, m as parseOrderId, n as isServerPortalTarget, o as portalBookingPath, r as parsePortalLocation, s as portalBookingResponseSchema, u as portalRegularSessionsResponseSchema } from "../portalRoutes-D72yvtDh.mjs";
4
+ import { An as formatCurrencyAmount, Fn as unsafeAsAppointmentResourceId, On as parsePositiveMoneyInputToCents, Sn as parseUtcIsoDateTimeString, _t as unknownKind, an as formatDateTimeRange, bn as parseBookingLocalDate, cn as formatTime, gt as exactSchema, ht as evolvingSchema, in as formatDateTime, ln as formatTimeRange, nn as formatDate, rn as formatDateRange, t as assertNever, vt as unknownTag } from "../src-CmXh3JWs.mjs";
5
+ import { a as withPortalArrival, c as portalBookingViewSchema, d as portalWaitlistOfferPriceSchema, h as parseOrderPaymentReceiptId, i as portalPath, l as portalBookingsResponseSchema, m as parseOrderId, n as isServerPortalTarget, o as portalBookingPath, r as parsePortalLocation, s as portalBookingResponseSchema, u as portalRegularSessionsResponseSchema } from "../portalRoutes-ByyVZfVq.mjs";
6
6
  import { a as calendarEntryEnd, h as assertNever$1, i as bookingCalendarFromEntries, l as getInitialFieldValue, m as unansweredRequiredBookingQuestions, n as ONLINE_CALENDAR_LOCATION, o as UNANSWERED_QUESTION_MESSAGE, t as ONLINE_CALENDAR_DESCRIPTION, u as initialBookingQuestionValues } from "../bookingCalendar--aWnqFDn.mjs";
7
7
  import { t as generateUuidV4 } from "../uuid-BETKW8rS.mjs";
8
- import { a as questionControlProps, i as isChoiceGroup, o as clientPersonPhrases, t as BookingQuestionFieldInput } from "../BookingQuestionFields-CyNIKw6k.mjs";
9
- import { C as customerProfileSchema, _ as portalPaymentToDoSchema, f as portalDeadlineSchema, g as portalPaymentDueSchema, h as portalOrderNameSchema, i as bookingContextRefSchema, l as eventAttendeeRefSchema, m as portalOrderBreakdownSchema, n as customerOrderSchema, p as portalMoneySchema, x as customerPassUseCaseSchema } from "../portalOrders-COGn4BKG.mjs";
10
- import { C as portalMeUpdateResponseSchema, E as portalTransferEventRegistrationResultSchema, S as portalMeResponseSchema, T as portalRescheduleAppointmentResponseSchema, _ as portalDigitalProductsResponseSchema, a as createPortalTransport, b as portalEventRescheduleResultSchema, c as PORTAL, d as portalBookingQuestionsTaskResponseSchema, f as portalBookingQuestionsUploadUrlResponseSchema, g as portalDigitalProductDownloadUrlResponseSchema, h as portalDigitalProductAccessResponseSchema, l as magicLinkResponseSchema, m as portalCancelOutcomeSchema, n as useBlockApi, o as field, p as portalCancelMembershipAtPeriodEndResultSchema, s as isUncertainPortalFailure, t as BlockApiProvider, u as portalBookingQuestionsFinalizeUploadResponseSchema, v as portalEventGuestsResponseSchema, w as portalOrderCheckoutResponseSchema, x as portalEventTicketResponseSchema, y as portalEventRescheduleDatesSchema } from "../context-CRhn9qzS.mjs";
8
+ import { a as questionControlProps, i as isChoiceGroup, o as clientPersonPhrases, t as BookingQuestionFieldInput } from "../BookingQuestionFields-BJI7mZuV.mjs";
9
+ import { C as customerProfileSchema, _ as portalPaymentToDoSchema, f as portalDeadlineSchema, g as portalPaymentDueSchema, h as portalOrderNameSchema, i as bookingContextRefSchema, l as eventAttendeeRefSchema, m as portalOrderBreakdownSchema, n as customerOrderSchema, p as portalMoneySchema, x as customerPassUseCaseSchema } from "../portalOrders-oEoTvzkW.mjs";
10
+ import { C as portalMeUpdateResponseSchema, E as portalTransferEventRegistrationResultSchema, S as portalMeResponseSchema, T as portalRescheduleAppointmentResponseSchema, _ as portalDigitalProductsResponseSchema, a as createPortalTransport, b as portalEventRescheduleResultSchema, c as PORTAL, d as portalBookingQuestionsTaskResponseSchema, f as portalBookingQuestionsUploadUrlResponseSchema, g as portalDigitalProductDownloadUrlResponseSchema, h as portalDigitalProductAccessResponseSchema, l as magicLinkResponseSchema, m as portalCancelOutcomeSchema, n as useBlockApi, o as field, p as portalCancelMembershipAtPeriodEndResultSchema, s as isUncertainPortalFailure, t as BlockApiProvider, u as portalBookingQuestionsFinalizeUploadResponseSchema, v as portalEventGuestsResponseSchema, w as portalOrderCheckoutResponseSchema, x as portalEventTicketResponseSchema, y as portalEventRescheduleDatesSchema } from "../context-Hi1RuYEM.mjs";
11
11
  import { a as ThemedFileChooser, n as ThemedButton, r as ThemedButtonLink, x as clsx } from "../ThemedButton-PFOhXktM.mjs";
12
12
  import { n as assertSafeAppPath } from "../src-Al4ooTl_.mjs";
13
13
  import { t as resolveDedicatedBookingHref } from "../bookingRoute-D6DlxYx6.mjs";
14
14
  import { t as FieldValidationMessage } from "../FieldValidationMessage-CsqxShw4.mjs";
15
- import { n as useAvailableDates, t as useAvailableSlots } from "../useAvailableSlots-Dm3lKJKR.mjs";
16
- import { i as getDemoBookingPass, n as buildPortalCallbackUrl, t as PORTAL_CALLBACK_PATH } from "../demoPortalMagicLink-CWDGSTBu.mjs";
15
+ import { n as useAvailableDates, t as useAvailableSlots } from "../useAvailableSlots-CBneCxbG.mjs";
16
+ import { i as getDemoBookingPass, n as buildPortalCallbackUrl, t as PORTAL_CALLBACK_PATH } from "../demoPortalMagicLink-BAL5UIDG.mjs";
17
17
  import { n as downloadCalendar } from "../CalendarAction-D_Glwvz2.mjs";
18
- import { a as formatPortalSessionTime, c as portalSessionDisplay, i as formatPortalSessionDay, o as formatPortalSessionWithWeekday, r as formatPortalSession, s as lastCoveredInstant, t as formatDateTime$1 } from "../dateFormatting-BnWB4L1s.mjs";
18
+ import { a as formatPortalSessionTime, c as portalSessionDisplay, i as formatPortalSessionDay, o as formatPortalSessionWithWeekday, r as formatPortalSession, s as lastCoveredInstant, t as formatDateTime$1 } from "../dateFormatting-C8vBCHuo.mjs";
19
19
  import * as React$1 from "react";
20
20
  import { forwardRef, useCallback, useEffect, useId, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
21
21
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -269,6 +269,8 @@ const knownTaskSchema = evolvingSchema()(z.discriminatedUnion("kind", [
269
269
  ...taskBase,
270
270
  kind: z.literal("pay"),
271
271
  orderId: z.string(),
272
+ orderNumber: z.string(),
273
+ placedAt: z.string(),
272
274
  for: portalPaymentForViewSchema,
273
275
  due: portalPaymentDueSchema,
274
276
  moneyLine: z.string()
@@ -570,6 +572,7 @@ const knownEntrySchema = exactSchema()(z.discriminatedUnion("kind", [z.object({
570
572
  kind: z.literal("refund"),
571
573
  key: z.string(),
572
574
  order: paymentOrderSchema,
575
+ paymentReceiptId: z.string().nullable(),
573
576
  ...refundFields
574
577
  })]));
575
578
  const unsupportedEntrySchema = unknownKind(ENTRY_KINDS).extend({
@@ -1145,7 +1148,9 @@ function portalResourceShown(state) {
1145
1148
  value,
1146
1149
  stale: state.status === "failed" || !portalResourceCurrent(state)
1147
1150
  };
1148
- return state.status === "failed" && state.error.kind === "not_found" ? { kind: "not_found" } : { kind: "failed" };
1151
+ if (state.status !== "failed") return { kind: "failed" };
1152
+ if (state.error.kind === "not_found") return { kind: "not_found" };
1153
+ return state.error.kind === "rejected" && state.error.status === 410 ? { kind: "gone" } : { kind: "failed" };
1149
1154
  }
1150
1155
  /** The failed reload the showing value is under, kept through retries and next pages until a reload works. */
1151
1156
  function outOfDateBy(state) {
@@ -1849,6 +1854,19 @@ function portalLocalTime(local, site) {
1849
1854
  function holdsPlace(booking) {
1850
1855
  return booking.standing.kind === "booked" || booking.standing.kind === "awaiting_payment";
1851
1856
  }
1857
+ /** Cancelled, given away or a request that didn't go ahead: they won't be going, so where it is no longer matters to them. */
1858
+ function wontGo(booking) {
1859
+ switch (booking.standing.kind) {
1860
+ case "cancelled":
1861
+ case "given_away":
1862
+ case "request_not_accepted": return true;
1863
+ case "booked":
1864
+ case "awaiting_payment":
1865
+ case "requested":
1866
+ case "waitlisted":
1867
+ case "missed": return false;
1868
+ }
1869
+ }
1852
1870
  /** Still to come and still theirs, or still asked for: the bookings with plans to change and things to do. */
1853
1871
  function isLive(booking) {
1854
1872
  return booking.timing === "upcoming" && (holdsPlace(booking) || booking.standing.kind === "requested");
@@ -2569,6 +2587,8 @@ function sendingLine(to, context) {
2569
2587
  const PAYMENT_ON_ITS_WAY = "A payment for this is already on its way. If you've just paid, it can take a minute or two to show here.";
2570
2588
  /** The button that takes them back into a checkout they started and didn't finish. */
2571
2589
  const CONTINUE_TO_PAYMENT = "Continue to payment";
2590
+ /** For a link that opens the order page, where Continue to payment is, so it says where it goes. */
2591
+ const SEE_WHATS_LEFT_TO_PAY = "See what's left to pay";
2572
2592
  /**
2573
2593
  * What to say when paying isn't a button: a payment already on its way, who
2574
2594
  * to ask when it can't be paid online, or that we couldn't tell just now.
@@ -2877,7 +2897,7 @@ function onlineLines(booking, standing) {
2877
2897
  const ONLINE_JOIN_ABOVE = "Online. Use the Join online button at the top of this page.";
2878
2898
  const HYBRID_JOIN_ABOVE = "You can also join online, with the Join online button at the top of this page.";
2879
2899
  function where(booking, standing) {
2880
- if (booking.where.kind === "not_given") return null;
2900
+ if (booking.where.kind === "not_given" || wontGo(booking)) return null;
2881
2901
  const venue = venueOf(booking);
2882
2902
  return {
2883
2903
  venue: venue ? venueLines(venue) : null,
@@ -2928,7 +2948,7 @@ function rescheduleNote(booking, until, context) {
2928
2948
  }
2929
2949
  function rescheduleItem(booking, context) {
2930
2950
  if (booking.kind === "course") return null;
2931
- const label = booking.kind === "appointment" ? "Change the time" : "Change dates";
2951
+ const label = booking.kind === "appointment" ? "Change the time" : "Change the date";
2932
2952
  const { reschedule } = booking.actions;
2933
2953
  const note = reschedule.kind === "available" ? rescheduleNote(booking, reschedule.until, context) : null;
2934
2954
  return planItem("reschedule", label, reschedule, portalLink(label, {
@@ -3004,7 +3024,7 @@ function payButton(order, target) {
3004
3024
  switch (toDo.kind) {
3005
3025
  case "pay":
3006
3026
  case "instalment_failed": return toDo.online.kind === "available" ? portalLink(toDo.kind === "pay" ? `Pay ${money$1(toDo.amount)} now` : "Pay now", target, "primary") : null;
3007
- case "finish_paying": return portalLink(CONTINUE_TO_PAYMENT, target, "primary");
3027
+ case "finish_paying": return portalLink(SEE_WHATS_LEFT_TO_PAY, target, "primary");
3008
3028
  case "payment_underway":
3009
3029
  case "plan_running":
3010
3030
  case "nothing":
@@ -3755,7 +3775,8 @@ function BookingLoad({ session, bookingRef, you, onSignOut, children }) {
3755
3775
  count: 1,
3756
3776
  label: "Loading your booking"
3757
3777
  });
3758
- case "not_found": return /* @__PURE__ */ jsx(DifferentEmail, {
3778
+ case "not_found":
3779
+ case "gone": return /* @__PURE__ */ jsx(DifferentEmail, {
3759
3780
  email: you?.email ?? null,
3760
3781
  onSignOut
3761
3782
  });
@@ -4274,14 +4295,19 @@ const ORDER_TONE = {
4274
4295
  function isOnline(booking) {
4275
4296
  return booking.where.kind === "online";
4276
4297
  }
4277
- function whereLabel(booking) {
4278
- switch (booking.where.kind) {
4279
- case "venue": {
4280
- const { venue } = booking.where;
4281
- return venue.name ?? (venue.address.kind === "shown" ? venue.address.address : null);
4282
- }
4283
- case "hybrid": return booking.where.venue.name ? `${booking.where.venue.name} or online` : "In person or online";
4298
+ function locationLabel(mode, venueName, address = null) {
4299
+ switch (mode) {
4300
+ case "in_person": return venueName ?? address;
4301
+ case "hybrid": return venueName ? `${venueName} or online` : "In person or online";
4284
4302
  case "online": return "Online";
4303
+ }
4304
+ }
4305
+ function whereLabel(booking) {
4306
+ const where = booking.where;
4307
+ switch (where.kind) {
4308
+ case "venue": return locationLabel("in_person", where.venue.name, where.venue.address.kind === "shown" ? where.venue.address.address : null);
4309
+ case "hybrid": return locationLabel("hybrid", where.venue.name);
4310
+ case "online": return locationLabel("online", null);
4285
4311
  case "not_given": return null;
4286
4312
  }
4287
4313
  }
@@ -4321,7 +4347,7 @@ function cardWhen(booking) {
4321
4347
  function metaLines(booking, context) {
4322
4348
  const when = cardWhen(booking);
4323
4349
  const time = when ? portalWhenSummary(when, context.site, isOnline(booking)) : null;
4324
- return [booking.kind === "course" && booking.timing === "upcoming" && when && time ? `Next session ${portalShortDay(when.startsAt, context.site, when.timeZone, isOnline(booking)) ?? ""}, ${time}` : time, whereLabel(booking)].filter((line) => Boolean(line));
4350
+ return [booking.kind === "course" && booking.timing === "upcoming" && when && time ? `Next session ${portalShortDay(when.startsAt, context.site, when.timeZone, isOnline(booking)) ?? ""}, ${time}` : time, wontGo(booking) ? null : whereLabel(booking)].filter((line) => Boolean(line));
4325
4351
  }
4326
4352
  /**
4327
4353
  * A whole money sentence as a chip: a chip is a label, so a one-sentence line
@@ -4578,9 +4604,13 @@ function waitlistWhen(entry) {
4578
4604
  timeZone: entry.subject.timeZone
4579
4605
  } : null;
4580
4606
  }
4607
+ /** Where it is, as a booking card says it: the venue, "Online", or the venue "or online" when it's both. */
4608
+ function waitlistWhere(entry) {
4609
+ return locationLabel(entry.subject.deliveryMode, entry.venueName);
4610
+ }
4581
4611
  function waitlistCardBase(entry, context) {
4582
4612
  const when = waitlistWhen(entry);
4583
- const online = entry.subject.isOnline;
4613
+ const online = entry.subject.deliveryMode !== "in_person";
4584
4614
  const schedule = entry.subject.kind === "wholeSeries" ? entry.subject.scheduleSummary : null;
4585
4615
  return {
4586
4616
  key: `waitlist:${entry.id}`,
@@ -4589,7 +4619,7 @@ function waitlistCardBase(entry, context) {
4589
4619
  kind: placesSuffix(entry.requestedPlaces),
4590
4620
  title: entry.eventTitle,
4591
4621
  titleLink: entry.eventPath ? hrefLink(entry.eventTitle, entry.eventPath, "link") : null,
4592
- meta: [when ? portalWhenSummary(when, context.site, online) : schedule, online ? "Online" : null].filter((line) => Boolean(line)),
4622
+ meta: [when ? portalWhenSummary(when, context.site, online) : schedule, waitlistWhere(entry)].filter((line) => Boolean(line)),
4593
4623
  quiet: false
4594
4624
  };
4595
4625
  }
@@ -4646,8 +4676,10 @@ function waitlistCardModel(entry, context) {
4646
4676
  }
4647
4677
  }
4648
4678
  }
4649
- //#endregion
4650
- //#region ../blocks/src/portal/app/model/bookingsPage.ts
4679
+ /** The label for revealing a folded group's hidden cards: "Show 4 more". */
4680
+ function showMoreLabel(group) {
4681
+ return group.folded === null ? null : `Show ${group.cards.length - group.folded} more`;
4682
+ }
4651
4683
  const GROUP_TITLES = {
4652
4684
  waitlist: "From the waitlist",
4653
4685
  coming_up: "Coming up",
@@ -4659,22 +4691,26 @@ function bookingsPageModel(view, regular, context) {
4659
4691
  {
4660
4692
  id: "waitlist",
4661
4693
  title: GROUP_TITLES.waitlist,
4662
- cards: view.waitlist.map((entry) => waitlistCardModel(entry, context))
4694
+ cards: view.waitlist.map((entry) => waitlistCardModel(entry, context)),
4695
+ folded: null
4663
4696
  },
4664
4697
  {
4665
4698
  id: "coming_up",
4666
4699
  title: GROUP_TITLES.coming_up,
4667
- cards: view.comingUp.map((booking) => bookingCardModel(booking, context))
4700
+ cards: view.comingUp.map((booking) => bookingCardModel(booking, context)),
4701
+ folded: null
4668
4702
  },
4669
4703
  {
4670
4704
  id: "cancelled",
4671
4705
  title: GROUP_TITLES.cancelled,
4672
- cards: view.cancelled.map((booking) => bookingCardModel(booking, context))
4706
+ cards: view.cancelled.map((booking) => bookingCardModel(booking, context)),
4707
+ folded: view.cancelled.length > 3 ? 3 : null
4673
4708
  },
4674
4709
  {
4675
4710
  id: "past",
4676
4711
  title: GROUP_TITLES.past,
4677
- cards: view.past.map((booking) => bookingCardModel(booking, context))
4712
+ cards: view.past.map((booking) => bookingCardModel(booking, context)),
4713
+ folded: null
4678
4714
  }
4679
4715
  ].filter((group) => group.cards.length > 0);
4680
4716
  const regularModel = regularSessionsModel(regular, shown.length > 0, context);
@@ -5103,28 +5139,43 @@ function BookingsList({ session, bookPath, value, state }) {
5103
5139
  });
5104
5140
  }
5105
5141
  function GroupSection({ group, leave, read, more }) {
5142
+ const [unfolded, setUnfolded] = React$1.useState(false);
5143
+ const moreLabel = unfolded ? null : showMoreLabel(group);
5144
+ const cards = moreLabel && group.folded !== null ? group.cards.slice(0, group.folded) : group.cards;
5106
5145
  return /* @__PURE__ */ jsxs(PortalSection, {
5107
5146
  id: group.id,
5108
5147
  title: group.title,
5109
5148
  hang: true,
5110
- children: [group.cards.map((card) => group.id === "waitlist" ? /* @__PURE__ */ jsx(WaitlistCard, {
5111
- card,
5112
- leave,
5113
- read
5114
- }, card.key) : /* @__PURE__ */ jsx(BookingCard, { card }, card.key)), more?.show ? /* @__PURE__ */ jsxs("div", {
5115
- className: "rb-portal-more",
5116
- children: [/* @__PURE__ */ jsx(PortalButton, {
5117
- type: "button",
5118
- variant: "secondary",
5119
- disabled: more.loading,
5120
- label: more.loading ? "Loading…" : "Show older bookings",
5121
- onClick: more.load
5122
- }), more.failed ? /* @__PURE__ */ jsx("p", {
5123
- className: "rb-portal-inline-error",
5124
- role: "alert",
5125
- children: "We couldn't load older bookings. Try again in a moment."
5126
- }) : null]
5127
- }) : null]
5149
+ children: [
5150
+ cards.map((card) => group.id === "waitlist" ? /* @__PURE__ */ jsx(WaitlistCard, {
5151
+ card,
5152
+ leave,
5153
+ read
5154
+ }, card.key) : /* @__PURE__ */ jsx(BookingCard, { card }, card.key)),
5155
+ moreLabel ? /* @__PURE__ */ jsx("div", {
5156
+ className: "rb-portal-more",
5157
+ children: /* @__PURE__ */ jsx(PortalButton, {
5158
+ type: "button",
5159
+ variant: "secondary",
5160
+ label: moreLabel,
5161
+ onClick: () => setUnfolded(true)
5162
+ })
5163
+ }) : null,
5164
+ more?.show ? /* @__PURE__ */ jsxs("div", {
5165
+ className: "rb-portal-more",
5166
+ children: [/* @__PURE__ */ jsx(PortalButton, {
5167
+ type: "button",
5168
+ variant: "secondary",
5169
+ disabled: more.loading,
5170
+ label: more.loading ? "Loading…" : "Show older bookings",
5171
+ onClick: more.load
5172
+ }), more.failed ? /* @__PURE__ */ jsx("p", {
5173
+ className: "rb-portal-inline-error",
5174
+ role: "alert",
5175
+ children: "We couldn't load older bookings. Try again in a moment."
5176
+ }) : null]
5177
+ }) : null
5178
+ ]
5128
5179
  });
5129
5180
  }
5130
5181
  function RegularSessionsBlock({ regular, onRetry }) {
@@ -5231,6 +5282,7 @@ function questionsTask$1(task, context) {
5231
5282
  urgent: task.urgent,
5232
5283
  title: `Answer your questions for ${task.bookingTitle}`,
5233
5284
  text: due ? [textPart(due)] : [],
5285
+ sub: null,
5234
5286
  action: !("tag" in task.ref) ? portalLink("See your bookings", { page: "bookings" }, "quiet") : portalLink("Answer questions", {
5235
5287
  page: "booking_questions",
5236
5288
  ref: task.ref
@@ -5245,6 +5297,7 @@ function guestNamesTask(task, context) {
5245
5297
  urgent: task.urgent,
5246
5298
  title: one ? "Add the name of someone coming with you" : `Add the names of ${task.namesMissing} people coming with you`,
5247
5299
  text: [textPart(`${task.bookingTitle}${day ? ` on ${day}` : ""}. ${businessNameAtStart(context)} would like to know who's coming.`)],
5300
+ sub: null,
5248
5301
  action: portalLink(one ? "Add name" : "Add names", {
5249
5302
  page: "booking",
5250
5303
  ref: task.ref
@@ -5260,6 +5313,7 @@ function waitlistTask(task, context) {
5260
5313
  urgent: task.urgent,
5261
5314
  title: many ? `Your places for ${task.eventTitle} are ready` : `A place for ${task.eventTitle} is ready for you`,
5262
5315
  text: [...by ? [textPart(`Book by ${by} to take ${many ? "them" : "it"}. After that, we'll offer ${many ? "them" : "it"} to the next person on the waitlist.`)] : [], ...free ? [textPart(by ? ` ${free}` : free)] : []],
5316
+ sub: null,
5263
5317
  action: task.claimPath ? hrefLink(many ? "Book these places" : "Book this place", task.claimPath, "quiet") : portalLink("See the offer", { page: "bookings" }, "quiet")
5264
5318
  };
5265
5319
  }
@@ -5276,7 +5330,7 @@ function payTaskWords(task, name, contact, context) {
5276
5330
  case "finish_paying": return {
5277
5331
  title: `Finish paying for ${name}`,
5278
5332
  note: [],
5279
- action: CONTINUE_TO_PAYMENT
5333
+ action: SEE_WHATS_LEFT_TO_PAY
5280
5334
  };
5281
5335
  case "payment_underway": return {
5282
5336
  title: `Your payment for ${name}`,
@@ -5285,6 +5339,11 @@ function payTaskWords(task, name, contact, context) {
5285
5339
  };
5286
5340
  }
5287
5341
  }
5342
+ /** When it was booked (or ordered) and its order number, since two tasks for the same thing differ only by these. */
5343
+ function payTaskSub(task, context) {
5344
+ const on = portalSentenceDate(task.placedAt, context.site, context.now);
5345
+ return [on ? `${task.for.kind === "order" ? "Ordered" : "Booked"} on ${on}` : null, `Order ${task.orderNumber}`].filter(Boolean).join(" · ");
5346
+ }
5288
5347
  function payTask$1(task, contact, context) {
5289
5348
  const order = parseOrderId(task.orderId);
5290
5349
  const words = payTaskWords(task, paymentName(task.for), contact, context);
@@ -5293,6 +5352,7 @@ function payTask$1(task, contact, context) {
5293
5352
  urgent: task.urgent,
5294
5353
  title: words.title,
5295
5354
  text: words.note.length > 0 ? [textPart(`${task.moneyLine} `), ...words.note] : [textPart(task.moneyLine)],
5355
+ sub: payTaskSub(task, context),
5296
5356
  action: order.ok ? portalLink(words.action, {
5297
5357
  page: "order",
5298
5358
  orderId: order.value
@@ -5305,6 +5365,7 @@ function membershipTask$1(task, contact, context) {
5305
5365
  urgent: task.urgent,
5306
5366
  title: `Your last payment for ${task.membershipName} didn't go through`,
5307
5367
  text: membershipText(membershipPaymentFailedLine(task, context, task.membershipName), contact, context),
5368
+ sub: null,
5308
5369
  action: portalLink("See membership", { page: "passes" }, "quiet")
5309
5370
  };
5310
5371
  }
@@ -5315,6 +5376,7 @@ function unsupportedTask(task, contact, context) {
5315
5376
  urgent: task.urgent,
5316
5377
  title: "There's something waiting for you that we can't show here yet",
5317
5378
  text: contactSentence("To find out what it is, get in touch with", contact, context),
5379
+ sub: null,
5318
5380
  action: null
5319
5381
  };
5320
5382
  }
@@ -5451,7 +5513,7 @@ function homePageModel(view, context) {
5451
5513
  * bringing it up to date failed (what's showing stays). A failed next page is
5452
5514
  * the page's own to say, beside the button that asked for it.
5453
5515
  */
5454
- function PortalResourcePage({ session, resource, loading, failedTitle, notFound, children }) {
5516
+ function PortalResourcePage({ session, resource, loading, failedTitle, notFound, gone, children }) {
5455
5517
  const state = usePortalResource(session.resources, resource);
5456
5518
  const retry = () => session.resources.refresh(resource);
5457
5519
  const shown = portalResourceShown(state);
@@ -5462,6 +5524,7 @@ function PortalResourcePage({ session, resource, loading, failedTitle, notFound,
5462
5524
  switch (shown.kind) {
5463
5525
  case "loading": return /* @__PURE__ */ jsx(Fragment, { children: loading });
5464
5526
  case "not_found": return notFound ? /* @__PURE__ */ jsx(Fragment, { children: notFound }) : failed;
5527
+ case "gone": return gone ? /* @__PURE__ */ jsx(Fragment, { children: gone }) : notFound ? /* @__PURE__ */ jsx(Fragment, { children: notFound }) : failed;
5465
5528
  case "failed": return failed;
5466
5529
  case "shown": break;
5467
5530
  }
@@ -5595,16 +5658,24 @@ function Task({ task }) {
5595
5658
  "data-portal": "todo-mark",
5596
5659
  "aria-hidden": "true"
5597
5660
  }),
5598
- /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("p", {
5599
- className: "rb-portal-todo__title",
5600
- children: [task.urgent ? /* @__PURE__ */ jsx("span", {
5601
- className: "rb-sr-only",
5602
- children: "Needs doing soon: "
5603
- }) : null, task.title]
5604
- }), task.text.length > 0 ? /* @__PURE__ */ jsx("p", {
5605
- className: "rb-portal-todo__text",
5606
- children: /* @__PURE__ */ jsx(TextParts, { parts: task.text })
5607
- }) : null] }),
5661
+ /* @__PURE__ */ jsxs("div", { children: [
5662
+ /* @__PURE__ */ jsxs("p", {
5663
+ className: "rb-portal-todo__title",
5664
+ children: [task.urgent ? /* @__PURE__ */ jsx("span", {
5665
+ className: "rb-sr-only",
5666
+ children: "Needs doing soon: "
5667
+ }) : null, task.title]
5668
+ }),
5669
+ task.text.length > 0 ? /* @__PURE__ */ jsx("p", {
5670
+ className: "rb-portal-todo__text",
5671
+ children: /* @__PURE__ */ jsx(TextParts, { parts: task.text })
5672
+ }) : null,
5673
+ task.sub ? /* @__PURE__ */ jsx("p", {
5674
+ className: "rb-portal-todo__text rb-portal-small",
5675
+ "data-portal": "todo-sub",
5676
+ children: task.sub
5677
+ }) : null
5678
+ ] }),
5608
5679
  task.action ? /* @__PURE__ */ jsx(ActionView, { action: task.action }) : null
5609
5680
  ]
5610
5681
  });
@@ -10841,7 +10912,8 @@ function QuestionsPage({ session, bookingRef, you, onSignOut }) {
10841
10912
  count: 1,
10842
10913
  label: "Loading your questions"
10843
10914
  });
10844
- case "not_found": return /* @__PURE__ */ jsx(DifferentEmail, {
10915
+ case "not_found":
10916
+ case "gone": return /* @__PURE__ */ jsx(DifferentEmail, {
10845
10917
  email: you?.email ?? null,
10846
10918
  onSignOut
10847
10919
  });
@@ -13120,7 +13192,11 @@ function creditModel(account, context) {
13120
13192
  return {
13121
13193
  available: money(account.available),
13122
13194
  setAside: account.setAside.amountCents > 0 ? `${money(account.setAside)} more is held for a payment that's still going through.` : null,
13123
- history: account.history.map((entry) => creditEntry(entry, context))
13195
+ history: account.history.map((entry) => creditEntry(entry, context)),
13196
+ balance: `Balance: ${money({
13197
+ ...account.available,
13198
+ amountCents: account.available.amountCents + account.setAside.amountCents
13199
+ })}`
13124
13200
  };
13125
13201
  }
13126
13202
  function passesPageModel(view, context) {
@@ -13477,17 +13553,25 @@ function CreditCard({ credit }) {
13477
13553
  className: "rb-portal-muted rb-portal-small rb-portal-mt-s",
13478
13554
  children: credit.setAside
13479
13555
  }) : null,
13480
- credit.history.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h4", {
13481
- className: "rb-portal-mt-m",
13482
- children: "Where it came from and went"
13483
- }), /* @__PURE__ */ jsx("ul", {
13484
- className: "rb-portal-uses",
13485
- "data-portal": "uses",
13486
- children: credit.history.map((entry) => /* @__PURE__ */ jsxs("li", { children: [/* @__PURE__ */ jsx(Line, { line: entry.line }), /* @__PURE__ */ jsx("span", {
13487
- className: entry.incoming ? "rb-portal-ok" : "rb-portal-muted",
13488
- children: entry.amount
13489
- })] }, entry.key))
13490
- })] }) : null
13556
+ credit.history.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
13557
+ /* @__PURE__ */ jsx("h4", {
13558
+ className: "rb-portal-mt-m",
13559
+ children: "Credit history"
13560
+ }),
13561
+ /* @__PURE__ */ jsx("ul", {
13562
+ className: "rb-portal-uses",
13563
+ "data-portal": "uses",
13564
+ children: credit.history.map((entry) => /* @__PURE__ */ jsxs("li", { children: [/* @__PURE__ */ jsx(Line, { line: entry.line }), /* @__PURE__ */ jsx("span", {
13565
+ className: entry.incoming ? "rb-portal-ok" : "rb-portal-muted",
13566
+ children: entry.amount
13567
+ })] }, entry.key))
13568
+ }),
13569
+ /* @__PURE__ */ jsx("p", {
13570
+ className: "rb-portal-mt-s",
13571
+ "data-portal": "credit-balance",
13572
+ children: /* @__PURE__ */ jsx("strong", { children: credit.balance })
13573
+ })
13574
+ ] }) : null
13491
13575
  ] });
13492
13576
  }
13493
13577
  //#endregion
@@ -13930,6 +14014,10 @@ const STATUS_TONE = {
13930
14014
  problem: "problem",
13931
14015
  neutral: "plain"
13932
14016
  };
14017
+ /** "So far" only while the order can still take a payment; on a settled order it's simply what they paid. */
14018
+ function paidLabel(toDo) {
14019
+ return toDo.kind === "nothing" ? "Paid" : "Paid so far";
14020
+ }
13933
14021
  function totals(page, credit) {
13934
14022
  const { order } = page;
13935
14023
  const figure = (cents) => moneyFigure({
@@ -13938,10 +14026,19 @@ function totals(page, credit) {
13938
14026
  });
13939
14027
  return [
13940
14028
  ...credit ? [[credit.label, credit.amount]] : [],
13941
- ...order.paidCents > 0 ? [["Paid so far", figure(order.paidCents)]] : [],
14029
+ ...order.paidCents > 0 ? [[paidLabel(order.toDo), figure(order.paidCents)]] : [],
13942
14030
  ...order.refundedCents > 0 ? [["Refunded", figure(order.refundedCents)]] : []
13943
14031
  ];
13944
14032
  }
14033
+ /** What's left of what they paid once refunds are taken off, said only when something has been refunded. */
14034
+ function netLine(page) {
14035
+ const { order } = page;
14036
+ if (order.refundedCents <= 0) return null;
14037
+ return `You've paid ${moneyWords({
14038
+ amountCents: Math.max(0, order.paidCents - order.refundedCents),
14039
+ currency: order.currency
14040
+ })} after refunds`;
14041
+ }
13945
14042
  function shipment(entry, context, showItems) {
13946
14043
  const on = portalSentenceDate(entry.sentAt, context.site, context.now);
13947
14044
  const line = [on ? `Posted on ${on}` : "Posted", entry.carrier ? `with ${entry.carrier}` : null].filter(Boolean).join(" ");
@@ -14000,6 +14097,7 @@ function orderPageModel(page, context) {
14000
14097
  lines: breakdown.rows,
14001
14098
  total: breakdown.total,
14002
14099
  totals: totals(page, breakdown.credit),
14100
+ net: netLine(page),
14003
14101
  plan: planModel(page, context),
14004
14102
  payments: page.payments.map((payment) => ({
14005
14103
  key: payment.receiptId,
@@ -14037,6 +14135,7 @@ function OrderPage({ session, orderId }) {
14037
14135
  label: "Loading your order"
14038
14136
  }),
14039
14137
  notFound: /* @__PURE__ */ jsx(NotFound$1, {}),
14138
+ gone: /* @__PURE__ */ jsx(Unfinished, {}),
14040
14139
  children: (value) => /* @__PURE__ */ jsx(OrderView, {
14041
14140
  page: orderPageModel(value, context),
14042
14141
  session,
@@ -14254,6 +14353,11 @@ function OrderSummary({ page }) {
14254
14353
  page.totals.length > 0 ? /* @__PURE__ */ jsx("div", {
14255
14354
  className: "rb-portal-mt-m rb-portal-order-totals",
14256
14355
  children: /* @__PURE__ */ jsx(Facts, { facts: page.totals })
14356
+ }) : null,
14357
+ page.net ? /* @__PURE__ */ jsx("p", {
14358
+ className: "rb-portal-mt-s",
14359
+ "data-portal": "order-net",
14360
+ children: page.net
14257
14361
  }) : null
14258
14362
  ] })
14259
14363
  });
@@ -14486,6 +14590,27 @@ function CustomAmountField({ custom, task, onOpen, onType, onPay }) {
14486
14590
  ]
14487
14591
  });
14488
14592
  }
14593
+ /** Their own checkout that never finished, which the portal doesn't list. */
14594
+ function Unfinished() {
14595
+ return /* @__PURE__ */ jsxs(PortalCard, { children: [
14596
+ /* @__PURE__ */ jsx("h1", {
14597
+ className: "rb-portal-title",
14598
+ children: "This booking wasn't finished"
14599
+ }),
14600
+ /* @__PURE__ */ jsx("p", {
14601
+ className: "rb-portal-muted rb-portal-mt-s",
14602
+ children: "Nothing was paid, and no place is being held."
14603
+ }),
14604
+ /* @__PURE__ */ jsx("div", {
14605
+ className: "rb-portal-actions",
14606
+ children: /* @__PURE__ */ jsx(PortalPageLink, {
14607
+ className: "rb-portal-link",
14608
+ to: { page: "payments" },
14609
+ children: "Go to your payments"
14610
+ })
14611
+ })
14612
+ ] });
14613
+ }
14489
14614
  function NotFound$1() {
14490
14615
  return /* @__PURE__ */ jsxs(PortalCard, { children: [
14491
14616
  /* @__PURE__ */ jsx("h1", {
@@ -14522,11 +14647,24 @@ const orderLink = (orderId, text) => {
14522
14647
  target
14523
14648
  } : null;
14524
14649
  };
14650
+ /** A pay task whose payment has started and is going through, with nothing for them to do. */
14651
+ function isProcessing(task) {
14652
+ if (task.kind !== "pay") return false;
14653
+ switch (task.due.kind) {
14654
+ case "payment_underway": return true;
14655
+ case "pay": return task.due.online.kind === "in_progress";
14656
+ case "instalment_failed":
14657
+ case "finish_paying": return false;
14658
+ }
14659
+ }
14525
14660
  function toPayModel(view, context) {
14526
- const tasks = view.toPay.tasks.map((task) => portalTaskCard(task, view.contact, context));
14661
+ const card = (task) => portalTaskCard(task, view.contact, context);
14662
+ const processing = view.toPay.tasks.filter(isProcessing).map(card);
14663
+ const tasks = view.toPay.tasks.filter((task) => !isProcessing(task)).map(card);
14527
14664
  const checking = checkingLine(view.checking, context, "list");
14528
14665
  const notes = [...view.toPay.kind === "partly_checked" ? [uncheckedSourcesLine(view.toPay.unchecked, "to pay")] : [], ...checking ? [checking] : []];
14529
14666
  return {
14667
+ processing,
14530
14668
  tasks,
14531
14669
  notes,
14532
14670
  nothing: tasks.length === 0 && notes.length === 0 ? "There's nothing to pay right now." : null
@@ -14590,6 +14728,27 @@ function historyRow(entry, context) {
14590
14728
  };
14591
14729
  }
14592
14730
  }
14731
+ /**
14732
+ * Newest first, except that a refund reads after the payment it sends back
14733
+ * when both fall on the same day, so the money going out is never listed
14734
+ * before the money it reverses. The refund moves to just below the
14735
+ * older payment with the receipt it reverses and the same date; everything else keeps
14736
+ * the server's order.
14737
+ */
14738
+ function refundsAfterTheirPayments(rows) {
14739
+ const reverses = (refund, payment) => refund.entry.kind === "refund" && payment.entry.kind === "payment" && payment.date === refund.date && refund.entry.paymentReceiptId === payment.entry.receiptId;
14740
+ const anchors = rows.map((row, index) => {
14741
+ if (row.entry.kind !== "refund") return index;
14742
+ const payment = rows.findIndex((other, at) => at > index && reverses(row, other));
14743
+ return payment === -1 ? index : payment;
14744
+ });
14745
+ return rows.map((row, index) => ({
14746
+ row,
14747
+ index,
14748
+ anchor: anchors[index] ?? index,
14749
+ after: anchors[index] !== index ? 1 : 0
14750
+ })).sort((a, b) => a.anchor - b.anchor || a.after - b.after || a.index - b.index).map(({ row }) => row);
14751
+ }
14593
14752
  function otherOrder(order, context) {
14594
14753
  return {
14595
14754
  key: order.order.orderId,
@@ -14604,11 +14763,14 @@ function paymentsPageModel(view, context) {
14604
14763
  const toPay = toPayModel(view, context);
14605
14764
  const plans = partOf(view.plans, ({ plans: list }) => nonEmpty(list.map((plan) => planCard(plan, context))));
14606
14765
  const history = partOf(view.history, ({ entries, nextCursor }) => entries.length === 0 ? null : {
14607
- rows: entries.map((entry) => historyRow(entry, context)),
14766
+ rows: refundsAfterTheirPayments(entries.map((entry) => ({
14767
+ entry,
14768
+ date: portalListDate(entry.at, context.site, context.now) ?? ""
14769
+ }))).map(({ entry }) => historyRow(entry, context)),
14608
14770
  more: nextCursor !== null
14609
14771
  });
14610
14772
  const otherOrders = partOf(view.otherOrders, ({ orders }) => nonEmpty(orders.map((order) => otherOrder(order, context))));
14611
- if (toPay.nothing && plans.kind === "none" && history.kind === "none" && otherOrders.kind === "none") return { kind: "empty" };
14773
+ if (toPay.nothing && toPay.processing.length === 0 && plans.kind === "none" && history.kind === "none" && otherOrders.kind === "none") return { kind: "empty" };
14612
14774
  return {
14613
14775
  kind: "shown",
14614
14776
  toPay,
@@ -14646,6 +14808,15 @@ function PaymentsPage({ session }) {
14646
14808
  return /* @__PURE__ */ jsxs("div", {
14647
14809
  className: "rb-portal-stack",
14648
14810
  children: [
14811
+ page.toPay.processing.length > 0 ? /* @__PURE__ */ jsx(PortalSection, {
14812
+ id: "processing",
14813
+ title: "Being processed",
14814
+ hang: true,
14815
+ children: /* @__PURE__ */ jsx(TaskCards, {
14816
+ tasks: page.toPay.processing,
14817
+ paying: false
14818
+ })
14819
+ }) : null,
14649
14820
  /* @__PURE__ */ jsx(PortalSection, {
14650
14821
  id: "to-pay",
14651
14822
  title: "To pay",
@@ -14719,13 +14890,10 @@ function payingAction(action) {
14719
14890
  }
14720
14891
  function ToPay({ model }) {
14721
14892
  return /* @__PURE__ */ jsxs(Fragment, { children: [
14722
- model.tasks.map((task) => /* @__PURE__ */ jsx(PortalCard, { children: /* @__PURE__ */ jsxs("div", {
14723
- className: "rb-portal-split",
14724
- children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", { children: task.title }), task.text.length > 0 ? /* @__PURE__ */ jsx("p", {
14725
- className: "rb-portal-muted rb-portal-mt-s",
14726
- children: /* @__PURE__ */ jsx(TextParts, { parts: task.text })
14727
- }) : null] }), task.action ? /* @__PURE__ */ jsx(ActionView, { action: payingAction(task.action) }) : null]
14728
- }) }, task.key)),
14893
+ /* @__PURE__ */ jsx(TaskCards, {
14894
+ tasks: model.tasks,
14895
+ paying: true
14896
+ }),
14729
14897
  model.notes.map((note) => /* @__PURE__ */ jsx("p", {
14730
14898
  className: "rb-portal-muted",
14731
14899
  children: note
@@ -14736,6 +14904,24 @@ function ToPay({ model }) {
14736
14904
  }) : null
14737
14905
  ] });
14738
14906
  }
14907
+ /** `paying`: the order link is the one thing to do, so it's the button; a payment already on its way keeps a quiet link. */
14908
+ function TaskCards({ tasks, paying }) {
14909
+ return /* @__PURE__ */ jsx(Fragment, { children: tasks.map((task) => /* @__PURE__ */ jsx(PortalCard, { children: /* @__PURE__ */ jsxs("div", {
14910
+ className: "rb-portal-split",
14911
+ children: [/* @__PURE__ */ jsxs("div", { children: [
14912
+ /* @__PURE__ */ jsx("h3", { children: task.title }),
14913
+ task.text.length > 0 ? /* @__PURE__ */ jsx("p", {
14914
+ className: "rb-portal-muted rb-portal-mt-s",
14915
+ children: /* @__PURE__ */ jsx(TextParts, { parts: task.text })
14916
+ }) : null,
14917
+ task.sub ? /* @__PURE__ */ jsx("p", {
14918
+ className: "rb-portal-muted rb-portal-small rb-portal-mt-s",
14919
+ "data-portal": "todo-sub",
14920
+ children: task.sub
14921
+ }) : null
14922
+ ] }), task.action ? /* @__PURE__ */ jsx(ActionView, { action: paying ? payingAction(task.action) : task.action }) : null]
14923
+ }) }, task.key)) });
14924
+ }
14739
14925
  const TONE_CLASS = {
14740
14926
  ok: "rb-portal-ok",
14741
14927
  problem: "rb-portal-problem",