@riverbankcms/sdk 0.174.1 → 0.175.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 (195) hide show
  1. package/dist/_dts/{BlocksIslandsHydrator-YRmc-Yxz.d.ts → BlocksIslandsHydrator-hb2IWD8K.d.ts} +1 -1
  2. package/dist/_dts/{Page-Du0zX1B-.d.ts → Page-BlY68ZF-.d.ts} +7 -7
  3. package/dist/_dts/{SdkPreviewMode-4L8v3FkY.d.ts → SdkPreviewMode-CA8hU7hW.d.ts} +2 -2
  4. package/dist/_dts/{client-B1J6Akyf.d.ts → client-B6tCvmG4.d.ts} +487 -11
  5. package/dist/_dts/{content-types-CGGYI0u_.d.ts → content-types-B9qryk4R.d.ts} +2 -2
  6. package/dist/_dts/{contracts-CHMlw9hT.d.ts → contracts-DWoaRxj1.d.ts} +3 -3
  7. package/dist/_dts/{footerPageOutline-DIHSU1Vr.d.ts → footerPageOutline-Djdrhp5s.d.ts} +6 -6
  8. package/dist/_dts/{generatePageMetadata-JITXD6BU.d.ts → generatePageMetadata-CFi0vxov.d.ts} +2 -2
  9. package/dist/_dts/{index-yWDbUojb.d.ts → index-Bl5_pjmq.d.ts} +1 -1
  10. package/dist/_dts/{index-CF62FntA.d.ts → index-Btp5nIoz.d.ts} +2 -2
  11. package/dist/_dts/{index-BLEKFHt1.d.ts → index-CQUzwOxO.d.ts} +1 -1
  12. package/dist/_dts/{index-D9ZYmGAJ.d.ts → index-DmhFb6R1.d.ts} +1 -1
  13. package/dist/_dts/{index-CXZSy_9M.d.ts → index-OtazQE3U.d.ts} +2 -2
  14. package/dist/_dts/{index-BgOr1Xyz.d.ts → index-YRQulWB4.d.ts} +3 -3
  15. package/dist/_dts/{index-DpJm0NpL.d.ts → index-_pXaCO12.d.ts} +4 -4
  16. package/dist/_dts/{loadContent-M-s0p0rq.d.ts → loadContent-Hcuvs4pz.d.ts} +7 -7
  17. package/dist/_dts/{request-BK-pHf0P.d.ts → request-BT8i_vH-.d.ts} +1621 -385
  18. package/dist/_dts/{resolveBlockData-DZAlnhwt.d.ts → resolveBlockData-B-dJrunl.d.ts} +5 -5
  19. package/dist/_dts/{resolvePageContent-DXUCWJ3y.d.ts → resolvePageContent-CVLYWcoI.d.ts} +2 -2
  20. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  21. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  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 +2 -2
  29. package/dist/_dts/sdk/src/gifting/client.d.ts +13 -1
  30. package/dist/_dts/sdk/src/index.d.ts +8 -8
  31. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  32. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  33. package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
  34. package/dist/_dts/sdk/src/next/index.d.ts +7 -7
  35. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  36. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  37. package/dist/_dts/sdk/src/portal/client.d.ts +3 -2
  38. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  39. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  40. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  41. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  42. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  43. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  44. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  45. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
  46. package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
  47. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  48. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  49. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  50. package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
  51. package/dist/_dts/sdk/src/server.d.ts +5 -5
  52. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  53. package/dist/_dts/sdk/src/theme/index.d.ts +2 -1
  54. package/dist/_dts/{types-DjVNADXR.d.ts → types-C0XZnjXz.d.ts} +3 -3
  55. package/dist/_dts/{types-CwmB2NHU.d.ts → types-CXL1QJSY.d.ts} +7 -7
  56. package/dist/_dts/{types-Dmow_FI6.d.ts → types-OKzbqRBx.d.ts} +2 -2
  57. package/dist/_dts/{validation-h8t1HLlL.d.ts → validation-Bxi66FtQ.d.ts} +4 -4
  58. package/dist/client/{BlocksIslandsHydrator-DRVx_XLi.mjs → BlocksIslandsHydrator-2xzlERTG.mjs} +17 -16
  59. package/dist/client/{BookingMailingListNote-CwrMzj-k.mjs → BookingMailingListNote-qsohSEdQ.mjs} +6 -6
  60. package/dist/client/{BookingPanelArrangement-C2_hFT6K.mjs → BookingPanelArrangement-DrdtON0q.mjs} +1 -1
  61. package/dist/client/{BookingQuestionFields-DZMrGvBh.mjs → BookingQuestionFields-CUFxBaTM.mjs} +3 -3
  62. package/dist/client/{CalendarNavigationChevron-Az1-TIEI.mjs → CalendarNavigationChevron-Ch0w0Utn.mjs} +34 -9
  63. package/dist/client/DemoBookingPortalAccess-DGgsjqXK.mjs +545 -0
  64. package/dist/client/{EventCalendar.client-CDkkP-Lv.mjs → EventCalendar.client-Dg4PHFJJ.mjs} +15 -25
  65. package/dist/client/{EventCombined.client-DK3aaz62.mjs → EventCombined.client-tky8JcnQ.mjs} +25 -17
  66. package/dist/client/{EventItem-WeUipfIP.mjs → EventItem-BybMSKNL.mjs} +4 -3
  67. package/dist/client/{EventListWeekNavigation-D3sbAeDo.mjs → EventListWeekNavigation-uvWRE5wi.mjs} +1 -1
  68. package/dist/client/{EventListing.client-DL3gGGmF.mjs → EventListing.client-DQx9dohz.mjs} +3 -3
  69. package/dist/client/{EventListing.view-DKFImKOx.mjs → EventListing.view-r31k8Icz.mjs} +8 -7
  70. package/dist/client/{EventRegistrationPayment-Dn9TpWyL.mjs → EventRegistrationPayment-BMmPDmSf.mjs} +635 -359
  71. package/dist/client/{LocationMapActions-BJT7MqP2.mjs → LocationMapActions-BecH-qhI.mjs} +1 -1
  72. package/dist/client/{MapDrawingSvg-DCIwlON6.mjs → MapDrawingSvg-BJzmFdcn.mjs} +18 -3
  73. package/dist/client/{Page-BpeP9xdt.mjs → Page-CWN_8cLZ.mjs} +601 -579
  74. package/dist/client/{DemoBookingPortalAccess-1p-pJ1lg.mjs → SiteTermsAgreementField-Dr5lj4oY.mjs} +4 -301
  75. package/dist/client/{StepIndicator-CP6zrwkl.mjs → StepIndicator-C7RJBOW3.mjs} +37 -12
  76. package/dist/client/{accordion-nR7D4m1a.mjs → accordion-uUi_N6mZ.mjs} +1 -1
  77. package/dist/client/{booking-form.client-Ce-mQZ7W.mjs → booking-form.client-CKHgxvsh.mjs} +229 -42
  78. package/dist/client/{bookingForm-B-qT_AQB.mjs → bookingForm-Bi74dmiS.mjs} +4 -4
  79. package/dist/client/bookings.mjs +22 -15
  80. package/dist/client/{boxStyleClassNames-CrE3TDpW.mjs → boxStyleClassNames-C-gFwhnO.mjs} +2 -1
  81. package/dist/client/{carousel-CVUOatsY.mjs → carousel-C0_BqMA0.mjs} +1 -1
  82. package/dist/client/{cart-DE0K6E0R.mjs → cart-BOHuppVu.mjs} +3 -3
  83. package/dist/client/{cart.client-C23E6WQ5.mjs → cart.client-IfJE1zAp.mjs} +1 -1
  84. package/dist/client/{checkout-76cdHyPL.mjs → checkout-C3Aj-aNa.mjs} +3 -3
  85. package/dist/client/{checkout.client-DJOzqb26.mjs → checkout.client-Tg9lfeYf.mjs} +1 -1
  86. package/dist/client/{checkoutUrls-CvIP5DCO.mjs → checkoutUrls-OLqQdAXD.mjs} +1 -1
  87. package/dist/client/client.mjs +112 -21
  88. package/dist/client/{context-CNlesLfF.mjs → context-D8TpQXjX.mjs} +76 -58
  89. package/dist/client/{course-DHIrXqNT.mjs → course-DHmeQAvq.mjs} +2 -2
  90. package/dist/client/{creditProducts-KYMVIH3J.mjs → creditProducts-BQ1t1erI.mjs} +14 -61
  91. package/dist/client/{dateFormatting-B73Ll0s4.mjs → dateFormatting-ABCZWkpT.mjs} +1 -1
  92. package/dist/client/{demoPortalMagicLink-BVbLD4pi.mjs → demoPortalMagicLink-BdcuW_pa.mjs} +1 -1
  93. package/dist/client/display-DMqotaGU.mjs +11797 -0
  94. package/dist/client/{enhanceHeaderSection-5GD5o4Mt.mjs → enhanceHeaderSection-Ciuhsk0E.mjs} +3 -3
  95. package/dist/client/{event-details.client-D7Oz1q2L.mjs → event-details.client-CJapNbTv.mjs} +1 -1
  96. package/dist/client/{event-registration.client-zbuX36aA.mjs → event-registration.client-CAdcpnLc.mjs} +176 -75
  97. package/dist/client/{eventCalendar-uZrksODt.mjs → eventCalendar-BlsD5R8M.mjs} +4 -4
  98. package/dist/client/{eventCombined-DxhvNAx8.mjs → eventCombined-B9Ly3024.mjs} +4 -4
  99. package/dist/client/{eventDetails-DCIH4BYG.mjs → eventDetails-CbEGI4jO.mjs} +2 -2
  100. package/dist/client/{eventListing-B9KrnPvc.mjs → eventListing-ZSmvhWII.mjs} +4 -4
  101. package/dist/client/{eventRegistration-TjnURMKl.mjs → eventRegistration-D-yUcIyO.mjs} +4 -4
  102. package/dist/client/{form-CfqIAhfN.mjs → form-DG_YZSNn.mjs} +3 -3
  103. package/dist/client/{form.client-CL6fF0cW.mjs → form.client-BU6dM0-C.mjs} +4 -4
  104. package/dist/client/{form.parts-Bf-L66Gg.mjs → form.parts-Db0Iq7nx.mjs} +1 -1
  105. package/dist/client/{formatDate-Dp7POa9Y.mjs → formatDate-DFfWHpQB.mjs} +1 -1
  106. package/dist/client/gifting/client.mjs +5 -3
  107. package/dist/client/gifting-DMrsN4B4.mjs +28 -0
  108. package/dist/client/gifting.client-BVa2XYJB.mjs +404 -0
  109. package/dist/client/gifting.parts-C2u4Y-pf.mjs +86 -0
  110. package/dist/client/{headerSection-WVXtOcuW.mjs → headerSection-D91EzlOR.mjs} +2 -2
  111. package/dist/client/{display-Cf_j5stk.mjs → lookSurfaces-BDZLALxj.mjs} +2951 -14395
  112. package/dist/client/{newsletter-form.client-Bb7GAZpO.mjs → newsletter-form.client-BMGRiRpo.mjs} +7 -5
  113. package/dist/client/{newsletter-form.parts-BqOVRdIc.mjs → newsletter-form.parts-D5UfUaD3.mjs} +3 -3
  114. package/dist/client/{newsletterForm-DOVe-qY3.mjs → newsletterForm-B_67sNwa.mjs} +3 -3
  115. package/dist/client/{noop-D5mFWXtN.mjs → noop-DF8_EiFt.mjs} +93 -28
  116. package/dist/client/portal/client.mjs +313 -148
  117. package/dist/client/{product-detail.client-CNzeFnFf.mjs → product-detail.client-D-XNir0m.mjs} +1 -1
  118. package/dist/client/{product-list.client-LKpzC7pj.mjs → product-list.client-BLfYQ-qi.mjs} +1 -1
  119. package/dist/client/{productDetail-D2JNeEgx.mjs → productDetail-W0_0lDGe.mjs} +3 -3
  120. package/dist/client/{productList-DTgZXOEq.mjs → productList-ayAtPJdb.mjs} +3 -3
  121. package/dist/client/{propsDecoder-mpBQt2AT.mjs → propsDecoder-ChYKWjLA.mjs} +4 -3
  122. package/dist/client/{registry.server-DdTJyar2.mjs → registry.server-B1EEZkcr.mjs} +307 -240
  123. package/dist/client/rendering/client.mjs +25 -491
  124. package/dist/client/rendering/islands.mjs +1 -1
  125. package/dist/client/rendering.mjs +7 -6
  126. package/dist/client/{richText-coerce-C32cRQ03.mjs → richText-coerce-CDAfpMQU.mjs} +1 -1
  127. package/dist/client/{routeIslandApiConfig-8cfSgT0E.mjs → routeIslandApiConfig-CcGWvyht.mjs} +1 -1
  128. package/dist/client/{shop-5LBhftWx.mjs → shop-DbUUoHFJ.mjs} +3 -3
  129. package/dist/client/{shop-discount-apply.state-D0ifS6KX.mjs → shop-add-feedback-DvC2kP1K.mjs} +1 -78
  130. package/dist/client/{shop-commerce-DkValjZj.mjs → shop-commerce-aQqcDmyZ.mjs} +64 -32
  131. package/dist/client/{shop-commerce-store-BOmXFmk_.mjs → shop-commerce-store-Cd7USpuY.mjs} +1 -1
  132. package/dist/client/shop-discount-apply.state-DGvPBmVP.mjs +83 -0
  133. package/dist/client/{shop.client-BTtZqNmv.mjs → shop.client-BNZ9M8cG.mjs} +56 -19
  134. package/dist/client/{shop.interactive-DNRqG4aX.mjs → shop.interactive-CJAINJr3.mjs} +113 -35
  135. package/dist/client/{shopShared-Nky6kPYr.mjs → shopShared-DwVAuGsx.mjs} +2 -2
  136. package/dist/client/{timetableModel-DZArznD_.mjs → timetableModel-DBTIFWTb.mjs} +10 -10
  137. package/dist/client/{useAvailableSlots-CUVRD1nx.mjs → useAvailableSlots-BomyyKeo.mjs} +3 -3
  138. package/dist/client/{useDiscountCodeUi-d7viY_mu.mjs → useDiscountCodeUi-CCxHMWlU.mjs} +32 -17
  139. package/dist/client/{useEventPagination-Da2JqxGC.mjs → useEventPagination-Bjin_qaN.mjs} +7 -6
  140. package/dist/client/{view-BvuYmQJ5.mjs → view-BTk470k0.mjs} +3 -2
  141. package/dist/client/{view-D9ObkFtz.mjs → view-Cw4EmEPv.mjs} +99 -30
  142. package/dist/preview-next/client/{PageSectionToolbar-DwxHT-2k.mjs → PageSectionToolbar-bq7gbKvn.mjs} +4 -4
  143. package/dist/preview-next/client/{PreviewEditorSidebar-D4SBxGU6.mjs → PreviewEditorSidebar-DVsPNcos.mjs} +28 -25
  144. package/dist/preview-next/client/{PreviewEditorUI-D8mUct32.mjs → PreviewEditorUI-B-pq3aZc.mjs} +4 -4
  145. package/dist/preview-next/client/{PreviewShell-L2AEdNUQ.mjs → PreviewShell-ChyjB96e.mjs} +5 -5
  146. package/dist/preview-next/client/{SdkPreviewModeRuntime-bhVAU2D2.mjs → SdkPreviewModeRuntime-D_czeC0l.mjs} +84 -101
  147. package/dist/preview-next/client/{previewAssistantSlot-Jpj_HDra.mjs → previewAssistantSlot-B61mZd81.mjs} +4141 -2677
  148. package/dist/preview-next/client/{previewChromeRoot-CYTDvx4u.mjs → previewChromeRoot-dwOn9XtM.mjs} +1 -1
  149. package/dist/preview-next/client/runtime.mjs +3 -3
  150. package/dist/preview-next/client/{sdk-runtime-CZHX6J_4.mjs → sdk-runtime-DZDfOxoW.mjs} +2 -2
  151. package/dist/preview-next/client/{siteStyleAccess-DmGIG9Hk.mjs → siteStyleAccess-BZDIC-fA.mjs} +527 -236
  152. package/dist/preview-next/client/{useAutosaveStatus-DQCyswQ-.mjs → useAutosaveStatus-BbzLMf-l.mjs} +1 -1
  153. package/dist/preview-next/client/{useOpenBlockForSetup-LwE5yXvL.mjs → useOpenBlockForSetup-BEXcWQeI.mjs} +13 -4
  154. package/dist/preview-next/container-responsive.css +51 -3
  155. package/dist/preview-next/keepAlive.mjs +1 -1
  156. package/dist/preview-next/middleware.mjs +1 -1
  157. package/dist/preview-next/{route-contract-BOuNcOcN.mjs → route-contract-0gSlK9S0.mjs} +86 -12
  158. package/dist/server/{Block.shared-wfJfhs08.mjs → Block.shared-DeXXycg8.mjs} +4 -4
  159. package/dist/server/{ThemeScopeCore-BtrJNHTB.mjs → ThemeScopeCore-DFEM1a85.mjs} +16 -2
  160. package/dist/server/{bindings-P1CF2Gm6.mjs → bindings-7L3pC5Os.mjs} +13 -34
  161. package/dist/server/{client-CGtU5fHI.mjs → client-CgghATBm.mjs} +111 -20
  162. package/dist/server/config-validation.mjs +1 -1
  163. package/dist/server/config.mjs +2 -2
  164. package/dist/server/{customCss-BGB8gMVb.mjs → customCss-BZ8YSrQg.mjs} +1 -0
  165. package/dist/server/data/resolveBlockData.mjs +1 -1
  166. package/dist/server/index.mjs +2 -2
  167. package/dist/server/{loadContent-ChnkJSay.mjs → loadContent-D7M5Vcug.mjs} +5 -5
  168. package/dist/server/{loadPage-DesHhgxj.mjs → loadPage-CiTId05y.mjs} +2 -2
  169. package/dist/server/{lookMediaFrame-BBr0mkze.mjs → lookMediaFrame-CaH018pK.mjs} +24 -5
  170. package/dist/server/next.mjs +35 -9
  171. package/dist/server/{overrideResolution-DHEkHcZs.mjs → overrideResolution-CJ3MRI5Q.mjs} +1 -1
  172. package/dist/server/page-converter.mjs +1 -1
  173. package/dist/server/{pageRenderPlan-0jvm0RBk.mjs → pageRenderPlan-Cuos4Xcd.mjs} +97 -39
  174. package/dist/server/{pageRuntimeSupport-8-f1Zr9e.mjs → pageRuntimeSupport-CuVj3bkd.mjs} +4 -3
  175. package/dist/server/{pageShared-CuVFoV4z.mjs → pageShared-JxlV8_Bo.mjs} +1261 -1129
  176. package/dist/server/{parseThemeForPersistence-Cwqb5pZx.mjs → parseThemeForPersistence-DOsfofCy.mjs} +1 -1
  177. package/dist/server/{prebuild-Bms_Y7wQ.mjs → prebuild-BDhlJbAx.mjs} +1 -1
  178. package/dist/server/prebuild.mjs +1 -1
  179. package/dist/server/{prefetchBlockData-5oC5kyHe.mjs → prefetchBlockData-kERh_c0v.mjs} +2 -2
  180. package/dist/server/{registry-DmqxC8th.mjs → registry-cQ9N5W-n.mjs} +20432 -20165
  181. package/dist/server/rendering/components/pageShared.mjs +1 -1
  182. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  183. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  184. package/dist/server/rendering/server.mjs +3 -3
  185. package/dist/server/rendering.mjs +7 -7
  186. package/dist/server/{resolveBlockData-EYogtwQc.mjs → resolveBlockData-CN4UmmTK.mjs} +1 -1
  187. package/dist/server/{schema-CUDHMirj.mjs → schema-BpsqaSSU.mjs} +2 -2
  188. package/dist/server/server.mjs +3 -3
  189. package/dist/server/theme-bridge.mjs +1 -1
  190. package/dist/server/theme.mjs +2 -2
  191. package/dist/server/{validation-Bt_8IL1g.mjs → validation-3puM5SM8.mjs} +3 -3
  192. package/dist/server/{version-DT_efohp.mjs → version-B8g-Wx57.mjs} +1 -1
  193. package/dist/styles/index.css +295 -37
  194. package/package.json +1 -1
  195. package/dist/client/useDiscountApply-BBnStWXU.mjs +0 -199
@@ -1,18 +1,18 @@
1
1
  "use client";
2
2
  "use client";
3
- import { fn as parsePositiveMoneyInputToCents, mn as formatCurrencyAmount, t as logger } from "../noop-D5mFWXtN.mjs";
4
- import { A as assertNever$1, M as unsafeAsAppointmentResourceId, S as formatCreditProductUnits, T as formatOrderInstalmentStatusLabel$1, c as initialBookingQuestionValues, f as unansweredRequiredBookingQuestions, i as UNANSWERED_QUESTION_MESSAGE, n as getCreditProductTypeLabel, p as assertNever, r as UNANSWERED_QUESTIONS_SUMMARY, t as deriveCreditProductLabels, x as formatCreditProductBalance } from "../creditProducts-KYMVIH3J.mjs";
3
+ import { n as assertNever, t as logger, xn as formatCurrencyAmount, yn as parsePositiveMoneyInputToCents } from "../noop-DF8_EiFt.mjs";
4
+ import { D as unsafeAsAppointmentResourceId, T as assertNever$1, c as initialBookingQuestionValues, f as unansweredRequiredBookingQuestions, g as formatCreditProductUnits, i as UNANSWERED_QUESTION_MESSAGE, m as formatCreditProductBalance, n as getCreditProductTypeLabel, r as UNANSWERED_QUESTIONS_SUMMARY, t as deriveCreditProductLabels, y as formatOrderInstalmentStatusLabel$1 } from "../creditProducts-BQ1t1erI.mjs";
5
5
  import { t as generateUuidV4 } from "../uuid-BETKW8rS.mjs";
6
- import { n as useAvailableDates, s as clientPersonPhrases, t as useAvailableSlots } from "../useAvailableSlots-CUVRD1nx.mjs";
7
- import { a as createBlockApi, i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "../context-CNlesLfF.mjs";
6
+ import { n as useAvailableDates, s as clientPersonPhrases, t as useAvailableSlots } from "../useAvailableSlots-BomyyKeo.mjs";
7
+ import { a as createBlockApi, i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "../context-D8TpQXjX.mjs";
8
8
  import { S as clsx, i as ThemedButtonLink, l as SpinnerNode, o as ThemedFileChooser, r as ThemedButton, t as ThemedActionsButton } from "../ThemedButton-DuaYtnvG.mjs";
9
9
  import { t as resolveDedicatedBookingHref } from "../bookingRoute-D6DlxYx6.mjs";
10
- import { a as DemoPortalSignInLink, i as useBookingNowIso, r as parseBookingSubmissionFailure, t as BookingQuestionFields } from "../BookingQuestionFields-DZMrGvBh.mjs";
10
+ import { a as DemoPortalSignInLink, i as useBookingNowIso, r as parseBookingSubmissionFailure, t as BookingQuestionFields } from "../BookingQuestionFields-CUFxBaTM.mjs";
11
11
  import { t as ModalShell } from "../ModalShell-B_fHWK71.mjs";
12
12
  import { t as TabBarFragment } from "../TabBarFragment-BqfRLojo.mjs";
13
- import { t as formatDate } from "../formatDate-Dp7POa9Y.mjs";
14
- import { n as buildPortalCallbackUrl, r as requestDemoPortalMagicLink } from "../demoPortalMagicLink-BVbLD4pi.mjs";
15
- import { a as formatPortalSessionDay, c as isPast, i as formatPortalSession, l as portalSessionDisplay, n as formatDateTime, o as formatPortalSessionTime, r as formatEntitlementEnd, s as formatPortalSessionWithWeekday, t as formatDate$1 } from "../dateFormatting-B73Ll0s4.mjs";
13
+ import { t as formatDate } from "../formatDate-DFfWHpQB.mjs";
14
+ import { n as buildPortalCallbackUrl, r as requestDemoPortalMagicLink } from "../demoPortalMagicLink-BdcuW_pa.mjs";
15
+ import { a as formatPortalSessionDay, c as isPast, i as formatPortalSession, l as portalSessionDisplay, n as formatDateTime, o as formatPortalSessionTime, r as formatEntitlementEnd, s as formatPortalSessionWithWeekday, t as formatDate$1 } from "../dateFormatting-ABCZWkpT.mjs";
16
16
  import * as React$1 from "react";
17
17
  import React, { createContext, forwardRef, useCallback, useContext, useEffect, useId, useMemo, useReducer, useRef, useState } from "react";
18
18
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -5628,6 +5628,87 @@ function BeforeYouComeTaskDisplay({ task, ...props }) {
5628
5628
  });
5629
5629
  }
5630
5630
  //#endregion
5631
+ //#region ../blocks/src/customer-portal/components/bookings/eventCancelCopy.ts
5632
+ const CANCEL = "This will cancel your booking.";
5633
+ const CARD_TIME = "It can take 5–10 working days to appear.";
5634
+ function keepReason(reason, siteTitle) {
5635
+ switch (reason.kind) {
5636
+ case "cutoff_passed": return `it's less than ${formatCancellationCutoffSpan(reason.cutoffHours)} until it starts`;
5637
+ case "never_refunded": return siteTitle ? `${siteTitle} doesn't refund cancelled bookings` : "cancelled bookings aren't refunded";
5638
+ case "non_refundable_deposit": return "the deposit isn't refundable";
5639
+ }
5640
+ }
5641
+ function passCredits(credits) {
5642
+ return credits === 1 ? "pass credit" : `${credits} pass credits`;
5643
+ }
5644
+ function refundSentence(outcome) {
5645
+ const amount = formatCurrencyAmount(outcome.money.amountCents, outcome.money.currency);
5646
+ const deposit = protectedDepositCancelSentence(outcome);
5647
+ const suffix = deposit ? ` ${deposit}` : "";
5648
+ switch (outcome.to) {
5649
+ case "card": return `You'll get ${amount} back on your card. ${CARD_TIME}${suffix}`;
5650
+ case "site_credit": return `You'll get ${amount} back as credit on your account.${suffix}`;
5651
+ case "card_and_site_credit": return `You'll get ${amount} back, partly on your card and partly as credit on your account. The card part can take 5–10 working days to appear.${suffix}`;
5652
+ }
5653
+ }
5654
+ function moneySentence(outcome, siteTitle) {
5655
+ switch (outcome.kind) {
5656
+ case "nothing_to_return": return null;
5657
+ case "refund": return refundSentence(outcome);
5658
+ case "credit_back": return `You'll get your ${passCredits(outcome.credits)} back.`;
5659
+ case "keep_money": return `You won't get your ${formatCurrencyAmount(outcome.money.amountCents, outcome.money.currency)} back, because ${keepReason(outcome.reason, siteTitle)}.`;
5660
+ case "keep_credit": return `You won't get your ${passCredits(outcome.credits)} back, because ${keepReason(outcome.reason, siteTitle)}.`;
5661
+ case "contact_business": return `Your ${formatCurrencyAmount(outcome.money.amountCents, outcome.money.currency)} can't be refunded online, so please contact ${siteTitle ?? "the business"} about it.`;
5662
+ }
5663
+ }
5664
+ /** The cancel dialog's words. The server decides the outcome; this only says it. */
5665
+ function eventCancelBody(outcome, siteTitle) {
5666
+ const money = outcome ? moneySentence(outcome, siteTitle) : null;
5667
+ return money ? `${CANCEL} ${money}` : CANCEL;
5668
+ }
5669
+ /** The protected amount stays explicit wherever a client confirms cancellation. */
5670
+ function protectedDepositCancelSentence(outcome) {
5671
+ const deposit = outcome?.kind === "refund" ? outcome.keptDeposit : outcome?.kind === "keep_money" && outcome.reason.kind === "non_refundable_deposit" ? outcome.money : null;
5672
+ return deposit ? `You won't get your ${formatCurrencyAmount(deposit.amountCents, deposit.currency)} deposit back, as it isn't refundable.` : null;
5673
+ }
5674
+ //#endregion
5675
+ //#region ../blocks/src/customer-portal/components/bookings/PortalCancelNote.tsx
5676
+ const PortalCancelNoticesContext = React$1.createContext({
5677
+ notices: {},
5678
+ record: () => void 0
5679
+ });
5680
+ /** Cancelling moves a row to another group, which remounts it, so its confirmation is kept above the groups. */
5681
+ function PortalCancelNotices({ children }) {
5682
+ const [notices, setNotices] = React$1.useState({});
5683
+ const record = React$1.useCallback((bookingId, message) => {
5684
+ setNotices((current) => ({
5685
+ ...current,
5686
+ [bookingId]: message
5687
+ }));
5688
+ }, []);
5689
+ const value = React$1.useMemo(() => ({
5690
+ notices,
5691
+ record
5692
+ }), [notices, record]);
5693
+ return /* @__PURE__ */ jsx(PortalCancelNoticesContext.Provider, {
5694
+ value,
5695
+ children
5696
+ });
5697
+ }
5698
+ /** A row's latest cancel or transfer message, or the confirmation kept from before it moved. */
5699
+ function PortalCancelNote({ feedback, bookingId }) {
5700
+ const kept = React$1.useContext(PortalCancelNoticesContext).notices[bookingId];
5701
+ if (feedback.tag === "error") return /* @__PURE__ */ jsx("div", {
5702
+ className: "cp-row-note cp-row-note--error",
5703
+ children: feedback.message
5704
+ });
5705
+ const message = feedback.tag === "success" ? feedback.message : kept;
5706
+ return message ? /* @__PURE__ */ jsx("div", {
5707
+ className: "cp-row-note cp-row-note--success",
5708
+ children: message
5709
+ }) : null;
5710
+ }
5711
+ //#endregion
5631
5712
  //#region ../blocks/src/customer-portal/components/bookings/portalEventReschedulePresentation.ts
5632
5713
  const studioName = (studio) => studio?.trim() || "the organiser";
5633
5714
  function firstName(name) {
@@ -5979,10 +6060,10 @@ function EventSeriesRegistrationTableRow({ enrollment, primaryDateLabel, session
5979
6060
  className: "cp-row-mobile-actions cp-only-mobile",
5980
6061
  children: actionsButton
5981
6062
  }) : null,
5982
- cancelFlow.feedback.tag !== "idle" ? /* @__PURE__ */ jsx("div", {
5983
- className: `cp-row-note ${cancelFlow.feedback.tag === "error" ? "cp-row-note--error" : "cp-row-note--success"}`,
5984
- children: cancelFlow.feedback.message
5985
- }) : null
6063
+ /* @__PURE__ */ jsx(PortalCancelNote, {
6064
+ feedback: cancelFlow.feedback,
6065
+ bookingId: enrollment.id
6066
+ })
5986
6067
  ] }),
5987
6068
  /* @__PURE__ */ jsx(RegistrationTicketCells, {
5988
6069
  enrollment,
@@ -6077,6 +6158,7 @@ function formatPortalCancelSuccessMessage(result) {
6077
6158
  //#endregion
6078
6159
  //#region ../blocks/src/customer-portal/components/bookings/usePortalCancelFlow.ts
6079
6160
  function usePortalCancelFlow(options) {
6161
+ const recordNotice = React$1.useContext(PortalCancelNoticesContext).record;
6080
6162
  const [state, dispatch] = React$1.useReducer(portalCancelReducer, initialPortalCancelState);
6081
6163
  const startCancelFlow = React$1.useCallback(() => {
6082
6164
  dispatch({ type: "start-cancel-flow" });
@@ -6100,10 +6182,12 @@ function usePortalCancelFlow(options) {
6100
6182
  });
6101
6183
  return;
6102
6184
  }
6185
+ const message = formatPortalCancelSuccessMessage(res);
6103
6186
  dispatch({
6104
6187
  type: "submit-succeeded",
6105
- message: formatPortalCancelSuccessMessage(res)
6188
+ message
6106
6189
  });
6190
+ if (options.bookingId) recordNotice(options.bookingId, message);
6107
6191
  try {
6108
6192
  await options.onRefresh();
6109
6193
  } catch (refreshError) {
@@ -6116,7 +6200,11 @@ function usePortalCancelFlow(options) {
6116
6200
  message: err instanceof Error ? err.message : "Failed to cancel booking."
6117
6201
  });
6118
6202
  }
6119
- }, [options, state.submitting]);
6203
+ }, [
6204
+ options,
6205
+ recordNotice,
6206
+ state.submitting
6207
+ ]);
6120
6208
  const dismissCancelFlow = React$1.useCallback(() => {
6121
6209
  dispatch({ type: "dismiss-dialog" });
6122
6210
  }, []);
@@ -6193,6 +6281,7 @@ function EventSeriesRegistrationDialogs({ enrollment, actionsOpen, setActionsOpe
6193
6281
  })
6194
6282
  }) : null, /* @__PURE__ */ jsx(EventSeriesCancellationDialog, {
6195
6283
  enrollmentId: enrollment.id,
6284
+ moneyOnCancel: enrollment.actions?.moneyOnCancel,
6196
6285
  cancelFlow
6197
6286
  })] });
6198
6287
  }
@@ -6227,14 +6316,18 @@ function CourseCancelTile({ tile, cancelFlow, close }) {
6227
6316
  })]
6228
6317
  });
6229
6318
  }
6230
- function EventSeriesCancellationDialog({ enrollmentId, cancelFlow }) {
6319
+ function seriesCancelConfirmLabel(submitting, withoutRefund) {
6320
+ if (submitting) return "Cancelling…";
6321
+ return withoutRefund ? "Cancel without refund" : "Confirm cancel";
6322
+ }
6323
+ function EventSeriesCancellationDialog({ enrollmentId, moneyOnCancel, cancelFlow }) {
6231
6324
  if (cancelFlow.dialog.tag === "closed") return null;
6232
6325
  const withoutRefund = cancelFlow.dialog.tag === "confirmWithoutRefund";
6233
6326
  return /* @__PURE__ */ jsxs(PortalModal, {
6234
6327
  title: withoutRefund ? "Cancel without a refund?" : "Cancel booking?",
6235
6328
  titleId: `cp-cancel-course-${withoutRefund ? "no-refund-" : ""}${enrollmentId}`,
6236
6329
  onClose: cancelFlow.dismissCancelFlow,
6237
- children: [/* @__PURE__ */ jsx("div", { children: cancelFlow.dialog.tag === "confirmWithoutRefund" ? cancelFlow.dialog.message : "This will cancel your booking for every session." }), /* @__PURE__ */ jsxs("div", {
6330
+ children: [/* @__PURE__ */ jsx("div", { children: cancelFlow.dialog.tag === "confirmWithoutRefund" ? cancelFlow.dialog.message : ["This will cancel your booking for every session.", protectedDepositCancelSentence(moneyOnCancel)].filter(Boolean).join(" ") }), /* @__PURE__ */ jsxs("div", {
6238
6331
  className: "cp-modal__actions",
6239
6332
  children: [/* @__PURE__ */ jsx(ThemedButton, {
6240
6333
  type: "button",
@@ -6249,7 +6342,7 @@ function EventSeriesCancellationDialog({ enrollmentId, cancelFlow }) {
6249
6342
  onClick: () => void cancelFlow.submitCancel(withoutRefund ? { confirmCancelWithoutRefund: true } : void 0),
6250
6343
  variant: "primary",
6251
6344
  size: "sm",
6252
- label: cancelFlow.submitting ? "Cancelling…" : withoutRefund ? "Cancel without refund" : "Confirm cancel"
6345
+ label: seriesCancelConfirmLabel(cancelFlow.submitting, withoutRefund)
6253
6346
  })]
6254
6347
  })]
6255
6348
  });
@@ -6260,7 +6353,8 @@ function EventSeriesRegistrationRow({ enrollment, siteTitle, isPast = false, sho
6260
6353
  const [actionsOpen, setActionsOpen] = React$1.useState(false);
6261
6354
  const cancelFlow = usePortalCancelFlow({
6262
6355
  cancel: React$1.useCallback((opts) => api.cancelWholeSeriesRegistration(enrollment.id, { confirmCancelWithoutRefund: opts?.confirmCancelWithoutRefund }), [api, enrollment.id]),
6263
- onRefresh
6356
+ onRefresh,
6357
+ bookingId: enrollment.id
6264
6358
  });
6265
6359
  const { primaryDateLabel, sessionDatesSummary, sessionCountLabel, cancelTile, canViewEventDetails, hasAnyActions, statusBadge, isMuted, additionalParticipants } = presentEventSeriesRegistration(enrollment, isPast, siteTitle, context);
6266
6360
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(EventSeriesRegistrationDialogs, {
@@ -7140,7 +7234,8 @@ function EventRow({ event, siteTitle, isPast: isEventPast = false, showActionsCo
7140
7234
  const [guestError, setGuestError] = React$1.useState(null);
7141
7235
  const cancelFlow = usePortalCancelFlow({
7142
7236
  cancel: React$1.useCallback((opts) => api.cancelEventRegistration(event.id, opts), [api, event.id]),
7143
- onRefresh
7237
+ onRefresh,
7238
+ bookingId: event.id
7144
7239
  });
7145
7240
  const expectedGuestCount = event.ticketsCount - 1;
7146
7241
  const showGuestSection = expectedGuestCount > 0;
@@ -7469,7 +7564,7 @@ function EventRow({ event, siteTitle, isPast: isEventPast = false, showActionsCo
7469
7564
  title: "Cancel booking?",
7470
7565
  titleId: `cp-cancel-${event.id}`,
7471
7566
  onClose: cancelFlow.dismissCancelFlow,
7472
- children: [/* @__PURE__ */ jsx("div", { children: "This will cancel your booking." }), /* @__PURE__ */ jsxs("div", {
7567
+ children: [/* @__PURE__ */ jsx("div", { children: eventCancelBody(event.actions.moneyOnCancel, siteTitle) }), /* @__PURE__ */ jsxs("div", {
7473
7568
  className: "cp-modal__actions",
7474
7569
  children: [/* @__PURE__ */ jsx(ThemedButton, {
7475
7570
  type: "button",
@@ -7557,9 +7652,9 @@ function EventRow({ event, siteTitle, isPast: isEventPast = false, showActionsCo
7557
7652
  disabled: anySubmitting
7558
7653
  })
7559
7654
  }),
7560
- cancelFlow.feedback.tag !== "idle" && /* @__PURE__ */ jsx("div", {
7561
- className: `cp-row-note ${cancelFlow.feedback.tag === "error" ? "cp-row-note--error" : "cp-row-note--success"}`,
7562
- children: cancelFlow.feedback.message
7655
+ /* @__PURE__ */ jsx(PortalCancelNote, {
7656
+ feedback: cancelFlow.feedback,
7657
+ bookingId: event.id
7563
7658
  })
7564
7659
  ] }),
7565
7660
  /* @__PURE__ */ jsx("td", {
@@ -7856,7 +7951,7 @@ function WaitlistsSection({ waitlists, focusedEntryId, onLeave, onRefresh, onFee
7856
7951
  //#region ../blocks/src/customer-portal/components/bookings/BookingsSection.tsx
7857
7952
  function BookingsSection({ siteTitle, events, wholeSeriesRegistrations, waitlists = [], focusedWaitlistEntryId = null, emptyMessage, onRefresh, onWaitlistFeedback, onUpdateGuests, onLeaveWaitlist = async () => ({ outcome: "notFound" }) }) {
7858
7953
  const { now } = usePortalDateDisplay();
7859
- const { items, upcoming, past } = React$1.useMemo(() => groupPortalBookings(events, wholeSeriesRegistrations, now), [
7954
+ const { items, upcoming, cancelled, past } = React$1.useMemo(() => groupPortalBookings(events, wholeSeriesRegistrations, now), [
7860
7955
  events,
7861
7956
  wholeSeriesRegistrations,
7862
7957
  now
@@ -7878,34 +7973,47 @@ function BookingsSection({ siteTitle, events, wholeSeriesRegistrations, waitlist
7878
7973
  });
7879
7974
  return /* @__PURE__ */ jsxs("div", {
7880
7975
  className: "cp-section cp-section--events",
7881
- children: [
7882
- /* @__PURE__ */ jsx(WaitlistsSection, {
7883
- waitlists,
7884
- focusedEntryId: focusedWaitlistEntryId,
7885
- onLeave: onLeaveWaitlist,
7886
- onFeedback: onWaitlistFeedback,
7887
- onRefresh
7888
- }),
7889
- upcoming.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h3", {
7890
- className: "cp-section-title",
7891
- style: { marginTop: waitlists.length > 0 ? "2rem" : 0 },
7892
- children: "Upcoming bookings"
7893
- }), /* @__PURE__ */ jsx(BookingsTable, {
7976
+ children: [/* @__PURE__ */ jsx(WaitlistsSection, {
7977
+ waitlists,
7978
+ focusedEntryId: focusedWaitlistEntryId,
7979
+ onLeave: onLeaveWaitlist,
7980
+ onFeedback: onWaitlistFeedback,
7981
+ onRefresh
7982
+ }), /* @__PURE__ */ jsxs(PortalCancelNotices, { children: [
7983
+ /* @__PURE__ */ jsx(BookingGroup, {
7984
+ title: "Upcoming bookings",
7894
7985
  items: upcoming,
7895
- ...tableProps
7896
- })] }),
7897
- past.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h3", {
7898
- className: "cp-section-title",
7899
- style: { marginTop: upcoming.length > 0 ? "2rem" : 0 },
7900
- children: "Past bookings"
7901
- }), /* @__PURE__ */ jsx(BookingsTable, {
7986
+ first: waitlists.length === 0,
7987
+ tableProps
7988
+ }),
7989
+ /* @__PURE__ */ jsx(BookingGroup, {
7990
+ title: "Cancelled",
7991
+ items: cancelled,
7992
+ first: waitlists.length === 0 && upcoming.length === 0,
7993
+ tableProps
7994
+ }),
7995
+ /* @__PURE__ */ jsx(BookingGroup, {
7996
+ title: "Past bookings",
7902
7997
  items: past,
7903
7998
  isPast: true,
7904
- ...tableProps
7905
- })] })
7906
- ]
7999
+ first: upcoming.length + cancelled.length === 0,
8000
+ tableProps
8001
+ })
8002
+ ] })]
7907
8003
  });
7908
8004
  }
8005
+ function BookingGroup({ title, items, isPast, first, tableProps }) {
8006
+ if (items.length === 0) return null;
8007
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h3", {
8008
+ className: "cp-section-title",
8009
+ style: { marginTop: first ? 0 : "2rem" },
8010
+ children: title
8011
+ }), /* @__PURE__ */ jsx(BookingsTable, {
8012
+ items,
8013
+ isPast,
8014
+ ...tableProps
8015
+ })] });
8016
+ }
7909
8017
  function groupPortalBookings(events, wholeSeriesRegistrations, now) {
7910
8018
  const items = [...events.map((event) => ({
7911
8019
  kind: "event",
@@ -7916,12 +8024,17 @@ function groupPortalBookings(events, wholeSeriesRegistrations, now) {
7916
8024
  startsAt: getEventSeriesRegistrationSortDate(enrollment),
7917
8025
  enrollment
7918
8026
  }))];
8027
+ const future = items.filter((item) => !isPast(item.startsAt, now)).sort((a, b) => a.startsAt.localeCompare(b.startsAt));
7919
8028
  return {
7920
8029
  items,
7921
- upcoming: items.filter((item) => !isPast(item.startsAt, now)).sort((a, b) => a.startsAt.localeCompare(b.startsAt)),
8030
+ upcoming: future.filter((item) => !isCancelledBooking(item)),
8031
+ cancelled: future.filter(isCancelledBooking),
7922
8032
  past: items.filter((item) => isPast(item.startsAt, now)).sort((a, b) => b.startsAt.localeCompare(a.startsAt))
7923
8033
  };
7924
8034
  }
8035
+ function isCancelledBooking(item) {
8036
+ return (item.kind === "event" ? item.event.status : item.enrollment.status) === "cancelled";
8037
+ }
7925
8038
  //#endregion
7926
8039
  //#region ../blocks/src/system/runtime/shared/useAppointmentRescheduleFlow.state.ts
7927
8040
  const ANY_PRACTITIONER_SENTINEL = "__any__";
@@ -8501,6 +8614,7 @@ function keepReasonClause(reason, siteTitle) {
8501
8614
  switch (reason.kind) {
8502
8615
  case "cutoff_passed": return `your appointment starts in less than ${formatCancellationCutoffSpan(reason.cutoffHours)}`;
8503
8616
  case "never_refunded": return siteTitle !== null && siteTitle !== void 0 && siteTitle !== "" ? `${siteTitle} doesn't refund cancelled appointments` : "cancelled appointments aren't refunded";
8617
+ case "non_refundable_deposit": return "the deposit isn't refundable";
8504
8618
  }
8505
8619
  }
8506
8620
  function packageCredits(credits) {
@@ -8529,7 +8643,7 @@ function appointmentCancelCopy(appointment, siteTitle) {
8529
8643
  return {
8530
8644
  buttonLabel: "Cancel",
8531
8645
  title: "Cancel appointment?",
8532
- body: cancelBody(outcome, siteTitle),
8646
+ body: [cancelBody(outcome, siteTitle), outcome.kind === "refund" ? protectedDepositCancelSentence(outcome) : null].filter(Boolean).join(" "),
8533
8647
  keepLabel: "Keep appointment",
8534
8648
  confirmLabel: "Confirm cancel",
8535
8649
  confirmAcceptsNoRefund: outcome.kind === "keep_credit"
@@ -9827,7 +9941,7 @@ async function loadOptionalPortalSectionWithFallback(label, load, buildFallback)
9827
9941
  * Provides authenticated customers access to their passes, memberships,
9828
9942
  * event registrations, appointments, and profile.
9829
9943
  */
9830
- function CustomerPortalClient({ callbackPath: suppliedCallbackPath, logoutPath: suppliedLogoutPath, bookPath: suppliedBookPath, hasInitialPortalToken = false, siteTitle, demoEmailSuppressed, className, showPasses = true, showMemberships = true, showEvents = true, showWholeSeries = true, showAppointments = true, showOrders = true, showCredit = true, showProfile = true, loginTitle = "Customer Portal", loginSubtitle = "Enter your email to access your account", loginButtonText = getDefaultLoginButtonText(demoEmailSuppressed), passesTabLabel, membershipsTabLabel = "Memberships", eventsTabLabel = "Bookings", appointmentsTabLabel = "Appointments", ordersTabLabel = "Orders", creditTabLabel = "Credit", profileTabLabel = "Profile", emptyPassesMessage, emptyMembershipsMessage = "You don't have any active memberships.", emptyEventsMessage = "You're not registered for any events.", emptyAppointmentsMessage = "You don't have any appointments scheduled.", emptyOrdersMessage = "You don't have any orders yet." }) {
9944
+ function CustomerPortalClient({ callbackPath: suppliedCallbackPath, logoutPath: suppliedLogoutPath, bookPath: suppliedBookPath, hasInitialPortalToken = false, siteTitle, demoEmailSuppressed, privacyPolicyHref, className, showPasses = true, showMemberships = true, showEvents = true, showWholeSeries = true, showAppointments = true, showOrders = true, showCredit = true, showProfile = true, loginTitle = "Customer Portal", loginSubtitle = "Enter your email to access your account", loginButtonText = getDefaultLoginButtonText(demoEmailSuppressed), passesTabLabel, membershipsTabLabel = "Memberships", eventsTabLabel = "Bookings", appointmentsTabLabel = "Appointments", ordersTabLabel = "Orders", creditTabLabel = "Credit", profileTabLabel = "Profile", emptyPassesMessage, emptyMembershipsMessage = "You don't have any active memberships.", emptyEventsMessage = "You're not registered for any events.", emptyAppointmentsMessage = "You don't have any appointments scheduled.", emptyOrdersMessage = "You don't have any orders yet." }) {
9831
9945
  const { callbackPath, logoutPath, bookPath } = resolvePortalHostPaths({
9832
9946
  callbackPath: suppliedCallbackPath,
9833
9947
  logoutPath: suppliedLogoutPath,
@@ -10208,6 +10322,7 @@ function CustomerPortalClient({ callbackPath: suppliedCallbackPath, logoutPath:
10208
10322
  }),
10209
10323
  activeTab === "credit" && showCredit && data.credit && /* @__PURE__ */ jsx(CreditSection, { credit: data.credit }),
10210
10324
  activeTab === "profile" && showProfile && customer && /* @__PURE__ */ jsx(ProfileSection, {
10325
+ privacyPolicyHref,
10211
10326
  customer,
10212
10327
  onUpdate: (nextCustomer) => dispatch({
10213
10328
  type: "customer-updated",
@@ -10380,7 +10495,9 @@ function PassDates({ pass }) {
10380
10495
  }) : null] });
10381
10496
  }
10382
10497
  function formatCustomerPassCreditHistoryEntry(entry, productUseCase, context) {
10383
- return `${entry.kind === "restoration" ? "Restored" : "Used"} ${formatCreditProductUnits(productUseCase, entry.credits)} on ${formatDate$1(entry.occurredAt, context, "long")}`;
10498
+ const units = formatCreditProductUnits(productUseCase, entry.credits);
10499
+ const date = formatDate$1(entry.occurredAt, context, "long");
10500
+ return entry.kind === "restoration" ? `${units} returned on ${date}` : `Used ${units} on ${date}`;
10384
10501
  }
10385
10502
  function MembershipsCards({ memberships, onRefresh }) {
10386
10503
  const api = useBlockApi();
@@ -10557,7 +10674,7 @@ function MembershipCancelConfirmation({ membership, isSubmitting, onConfirm, onC
10557
10674
  /* @__PURE__ */ jsxs("div", {
10558
10675
  className: "cp-cancel-confirm__message",
10559
10676
  children: [
10560
- "Your access will remain active until",
10677
+ "You'll keep your membership until",
10561
10678
  " ",
10562
10679
  formatEntitlementEnd(membership.currentPeriodEnd, "long"),
10563
10680
  "."
@@ -10565,7 +10682,7 @@ function MembershipCancelConfirmation({ membership, isSubmitting, onConfirm, onC
10565
10682
  }),
10566
10683
  /* @__PURE__ */ jsx("div", {
10567
10684
  className: "cp-cancel-confirm__warning",
10568
- children: "Any event bookings after this date made using this membership will be cancelled."
10685
+ children: "Anything you've booked with it after that date will be cancelled."
10569
10686
  }),
10570
10687
  /* @__PURE__ */ jsxs("div", {
10571
10688
  className: "cp-cancel-confirm__actions",
@@ -10929,7 +11046,7 @@ function AppointmentCard({ appointment, bookPath, siteTitle, isPast: isApptPast
10929
11046
  })
10930
11047
  ] });
10931
11048
  }
10932
- function ProfileSection({ customer, onUpdate }) {
11049
+ function useProfileEditor(customer, onUpdate) {
10933
11050
  const api = useBlockApi();
10934
11051
  const [isEditing, setIsEditing] = useState(false);
10935
11052
  const [editName, setEditName] = useState(customer.name);
@@ -10952,58 +11069,90 @@ function ProfileSection({ customer, onUpdate }) {
10952
11069
  setSaving(false);
10953
11070
  }
10954
11071
  };
10955
- if (isEditing) return /* @__PURE__ */ jsx("div", {
11072
+ const cancel = () => {
11073
+ setIsEditing(false);
11074
+ setEditName(customer.name);
11075
+ setEditPhone(customer.phone || "");
11076
+ setError(null);
11077
+ };
11078
+ return {
11079
+ isEditing,
11080
+ startEditing: () => setIsEditing(true),
11081
+ editName,
11082
+ setEditName,
11083
+ editPhone,
11084
+ setEditPhone,
11085
+ saving,
11086
+ error,
11087
+ handleSave,
11088
+ cancel
11089
+ };
11090
+ }
11091
+ function ProfileEditField({ id, label, type, value, onChange, disabled }) {
11092
+ return /* @__PURE__ */ jsxs("div", {
11093
+ className: "cp-field",
11094
+ children: [/* @__PURE__ */ jsx("label", {
11095
+ htmlFor: id,
11096
+ className: "form-label",
11097
+ children: label
11098
+ }), /* @__PURE__ */ jsx("input", {
11099
+ id,
11100
+ type,
11101
+ className: "form-input",
11102
+ value,
11103
+ onChange: (e) => onChange(e.target.value),
11104
+ disabled
11105
+ })]
11106
+ });
11107
+ }
11108
+ function ProfileEditForm({ email, editor }) {
11109
+ return /* @__PURE__ */ jsx("div", {
10956
11110
  className: "cp-section cp-section--profile",
10957
11111
  children: /* @__PURE__ */ jsxs("div", {
10958
11112
  className: "cp-profile",
10959
11113
  children: [
10960
11114
  /* @__PURE__ */ jsxs("div", {
10961
11115
  className: "cp-field",
10962
- children: [/* @__PURE__ */ jsx("label", {
10963
- htmlFor: "cp-profile-email",
10964
- className: "form-label",
10965
- children: "Email"
10966
- }), /* @__PURE__ */ jsx("input", {
10967
- id: "cp-profile-email",
10968
- type: "email",
10969
- className: "form-input",
10970
- value: customer.email,
10971
- disabled: true
10972
- })]
11116
+ children: [
11117
+ /* @__PURE__ */ jsx("label", {
11118
+ htmlFor: "cp-profile-email",
11119
+ className: "form-label",
11120
+ children: "Email"
11121
+ }),
11122
+ /* @__PURE__ */ jsx("input", {
11123
+ id: "cp-profile-email",
11124
+ type: "email",
11125
+ className: "form-input",
11126
+ value: email,
11127
+ disabled: true,
11128
+ "aria-describedby": "cp-profile-email-hint"
11129
+ }),
11130
+ /* @__PURE__ */ jsx("p", {
11131
+ id: "cp-profile-email-hint",
11132
+ className: "cp-profile__note",
11133
+ children: "You sign in with this address, so it can't be changed here."
11134
+ })
11135
+ ]
10973
11136
  }),
10974
- /* @__PURE__ */ jsxs("div", {
10975
- className: "cp-field",
10976
- children: [/* @__PURE__ */ jsx("label", {
10977
- htmlFor: "cp-profile-name",
10978
- className: "form-label",
10979
- children: "Name"
10980
- }), /* @__PURE__ */ jsx("input", {
10981
- id: "cp-profile-name",
10982
- type: "text",
10983
- className: "form-input",
10984
- value: editName,
10985
- onChange: (e) => setEditName(e.target.value),
10986
- disabled: saving
10987
- })]
11137
+ /* @__PURE__ */ jsx(ProfileEditField, {
11138
+ id: "cp-profile-name",
11139
+ label: "Name",
11140
+ type: "text",
11141
+ value: editor.editName,
11142
+ onChange: editor.setEditName,
11143
+ disabled: editor.saving
10988
11144
  }),
10989
- /* @__PURE__ */ jsxs("div", {
10990
- className: "cp-field",
10991
- children: [/* @__PURE__ */ jsx("label", {
10992
- htmlFor: "cp-profile-phone",
10993
- className: "form-label",
10994
- children: "Phone"
10995
- }), /* @__PURE__ */ jsx("input", {
10996
- id: "cp-profile-phone",
10997
- type: "tel",
10998
- className: "form-input",
10999
- value: editPhone,
11000
- onChange: (e) => setEditPhone(e.target.value),
11001
- disabled: saving
11002
- })]
11145
+ /* @__PURE__ */ jsx(ProfileEditField, {
11146
+ id: "cp-profile-phone",
11147
+ label: "Phone",
11148
+ type: "tel",
11149
+ value: editor.editPhone,
11150
+ onChange: editor.setEditPhone,
11151
+ disabled: editor.saving
11003
11152
  }),
11004
- error && /* @__PURE__ */ jsx("div", {
11153
+ editor.error && /* @__PURE__ */ jsx("div", {
11005
11154
  className: "cp-alert cp-alert--error",
11006
- children: error
11155
+ children: editor.error
11007
11156
  }),
11008
11157
  /* @__PURE__ */ jsxs("div", {
11009
11158
  className: "cp-profile__actions",
@@ -11011,72 +11160,88 @@ function ProfileSection({ customer, onUpdate }) {
11011
11160
  type: "button",
11012
11161
  variant: "primary",
11013
11162
  size: "md",
11014
- label: saving ? "Saving..." : "Save",
11015
- onClick: handleSave,
11016
- disabled: saving
11163
+ label: editor.saving ? "Saving..." : "Save",
11164
+ onClick: editor.handleSave,
11165
+ disabled: editor.saving
11017
11166
  }), /* @__PURE__ */ jsx(ThemedButton, {
11018
11167
  type: "button",
11019
11168
  variant: "secondary",
11020
11169
  size: "md",
11021
11170
  label: "Cancel",
11022
- onClick: () => {
11023
- setIsEditing(false);
11024
- setEditName(customer.name);
11025
- setEditPhone(customer.phone || "");
11026
- setError(null);
11027
- },
11028
- disabled: saving
11171
+ onClick: editor.cancel,
11172
+ disabled: editor.saving
11029
11173
  })]
11030
11174
  })
11031
11175
  ]
11032
11176
  })
11033
11177
  });
11178
+ }
11179
+ function ProfileSection({ customer, onUpdate, privacyPolicyHref }) {
11180
+ const editor = useProfileEditor(customer, onUpdate);
11181
+ if (editor.isEditing) return /* @__PURE__ */ jsx(ProfileEditForm, {
11182
+ email: customer.email,
11183
+ editor
11184
+ });
11034
11185
  return /* @__PURE__ */ jsx("div", {
11035
11186
  className: "cp-section cp-section--profile",
11036
11187
  children: /* @__PURE__ */ jsxs("div", {
11037
11188
  className: "cp-profile",
11038
- children: [/* @__PURE__ */ jsxs("div", {
11039
- className: "cp-profile__tiles",
11040
- children: [
11041
- /* @__PURE__ */ jsxs("div", {
11042
- className: "rb-tile cp-profile__field",
11043
- children: [/* @__PURE__ */ jsx("span", {
11044
- className: "rb-label cp-profile__label",
11045
- children: "Email"
11046
- }), /* @__PURE__ */ jsx("span", {
11047
- className: "cp-profile__value",
11048
- children: customer.email
11049
- })]
11050
- }),
11051
- /* @__PURE__ */ jsxs("div", {
11052
- className: "rb-tile cp-profile__field",
11053
- children: [/* @__PURE__ */ jsx("span", {
11054
- className: "rb-label cp-profile__label",
11055
- children: "Name"
11056
- }), /* @__PURE__ */ jsx("span", {
11057
- className: "cp-profile__value",
11058
- children: customer.name || "—"
11059
- })]
11060
- }),
11061
- /* @__PURE__ */ jsxs("div", {
11062
- className: "rb-tile cp-profile__field",
11063
- children: [/* @__PURE__ */ jsx("span", {
11064
- className: "rb-label cp-profile__label",
11065
- children: "Phone"
11066
- }), /* @__PURE__ */ jsx("span", {
11067
- className: "cp-profile__value",
11068
- children: customer.phone || "—"
11069
- })]
11070
- })
11071
- ]
11072
- }), /* @__PURE__ */ jsx(ThemedButton, {
11073
- type: "button",
11074
- variant: "secondary",
11075
- size: "md",
11076
- extraClassName: "cp-profile__edit",
11077
- label: "Edit Profile",
11078
- onClick: () => setIsEditing(true)
11079
- })]
11189
+ children: [
11190
+ /* @__PURE__ */ jsxs("div", {
11191
+ className: "cp-profile__tiles",
11192
+ children: [
11193
+ /* @__PURE__ */ jsxs("div", {
11194
+ className: "rb-tile cp-profile__field",
11195
+ children: [/* @__PURE__ */ jsx("span", {
11196
+ className: "rb-label cp-profile__label",
11197
+ children: "Email"
11198
+ }), /* @__PURE__ */ jsx("span", {
11199
+ className: "cp-profile__value",
11200
+ children: customer.email
11201
+ })]
11202
+ }),
11203
+ /* @__PURE__ */ jsxs("div", {
11204
+ className: "rb-tile cp-profile__field",
11205
+ children: [/* @__PURE__ */ jsx("span", {
11206
+ className: "rb-label cp-profile__label",
11207
+ children: "Name"
11208
+ }), /* @__PURE__ */ jsx("span", {
11209
+ className: "cp-profile__value",
11210
+ children: customer.name || "—"
11211
+ })]
11212
+ }),
11213
+ /* @__PURE__ */ jsxs("div", {
11214
+ className: "rb-tile cp-profile__field",
11215
+ children: [/* @__PURE__ */ jsx("span", {
11216
+ className: "rb-label cp-profile__label",
11217
+ children: "Phone"
11218
+ }), /* @__PURE__ */ jsx("span", {
11219
+ className: "cp-profile__value",
11220
+ children: customer.phone || "—"
11221
+ })]
11222
+ })
11223
+ ]
11224
+ }),
11225
+ /* @__PURE__ */ jsx(ThemedButton, {
11226
+ type: "button",
11227
+ variant: "secondary",
11228
+ size: "md",
11229
+ extraClassName: "cp-profile__edit",
11230
+ label: "Edit Profile",
11231
+ onClick: editor.startEditing
11232
+ }),
11233
+ /* @__PURE__ */ jsxs("p", {
11234
+ className: "cp-profile__note",
11235
+ children: ["To ask for a copy of your data or have it removed, please contact us.", privacyPolicyHref ? /* @__PURE__ */ jsxs(Fragment, { children: [
11236
+ " You'll find how in our ",
11237
+ /* @__PURE__ */ jsx("a", {
11238
+ href: privacyPolicyHref,
11239
+ children: "privacy policy"
11240
+ }),
11241
+ "."
11242
+ ] }) : null]
11243
+ })
11244
+ ]
11080
11245
  })
11081
11246
  });
11082
11247
  }