@riverbankcms/sdk 0.178.0 → 0.180.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -8
- package/dist/_dts/{BlocksIslandsHydrator-CrKsXtpD.d.ts → BlocksIslandsHydrator-DC_AvZwy.d.ts} +1 -1
- package/dist/_dts/{Page-C9i27wZA.d.ts → Page-DQOxVtp3.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-DzGSR3jh.d.ts → SdkPreviewMode-DrLgY9_f.d.ts} +3 -2
- package/dist/_dts/{client-BnYN6XsH.d.ts → client-BP7VBRvs.d.ts} +281 -72
- package/dist/_dts/{content-types-CXj6lp3d.d.ts → content-types-1-K2qi__.d.ts} +2 -2
- package/dist/_dts/{contracts-BZLwkTwL.d.ts → contracts-Dfqz0Tcu.d.ts} +6 -116
- package/dist/_dts/{generatePageMetadata-ByEWwe9j.d.ts → generatePageMetadata-CSfAqmry.d.ts} +2 -2
- package/dist/_dts/{index-BE9dWIsr.d.ts → index-B0_2-65A.d.ts} +3 -3
- package/dist/_dts/{index-0HFgCnGz.d.ts → index-BeM5Ylwf.d.ts} +5 -3
- package/dist/_dts/{index-D9-N1d9v.d.ts → index-Blrw2oVk.d.ts} +1 -1
- package/dist/_dts/{index-cTpvQg_Q.d.ts → index-CB5Csefo.d.ts} +2 -2
- package/dist/_dts/{index-nnEdgc3Z.d.ts → index-DCcxLa8p.d.ts} +4 -2
- package/dist/_dts/{index-DCa-8TEY.d.ts → index-DQBGwBPx.d.ts} +1 -1
- package/dist/_dts/{index-CKDRr54L.d.ts → index-DQr358-m.d.ts} +4 -4
- package/dist/_dts/{loadContent-DYkVV6w4.d.ts → loadContent-BG2tLGXj.d.ts} +15 -13
- package/dist/_dts/{request-B20VRWHH.d.ts → request-P08l6mkr.d.ts} +3641 -994
- package/dist/_dts/{resolveBlockData-C_aK5GIS.d.ts → resolveBlockData-BDHc8lFs.d.ts} +8 -5
- package/dist/_dts/resolvePageContent-Y3IZBbtL.d.ts +61 -0
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +3 -3
- package/dist/_dts/sdk/src/client.d.ts +7 -7
- package/dist/_dts/sdk/src/config/index.d.ts +6 -6
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
- package/dist/_dts/sdk/src/data/types.d.ts +7 -2
- package/dist/_dts/sdk/src/gifting/client.d.ts +1 -1
- package/dist/_dts/sdk/src/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
- package/dist/_dts/sdk/src/next/index.d.ts +16 -8
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
- package/dist/_dts/sdk/src/portal/client.d.ts +3 -3
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/index.d.ts +7 -7
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +3 -3
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +19 -6
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/serviceBookingOutline-BvtNagjw.d.ts +583 -0
- package/dist/_dts/{types-CYcd15BQ.d.ts → types-BrK6SS5c.d.ts} +9 -7
- package/dist/_dts/{types-CMZ5mkpv.d.ts → types-DpEAnP4F.d.ts} +10 -39
- package/dist/_dts/{types-rm2M4LGx.d.ts → types-HAy1-Jjo.d.ts} +3 -3
- package/dist/_dts/{validation-BSxnRhyy.d.ts → validation-D6q3tOBA.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-D1n09bu-.mjs → BlocksIslandsHydrator-DJSmdNUJ.mjs} +17 -18
- package/dist/client/{BookingMailingListNote-DSD4gS96.mjs → BookingMailingListNote-CGxg37zx.mjs} +92 -60
- package/dist/client/{BookingQuestionFields-B57oGPcj.mjs → BookingQuestionFields-DXegGSnS.mjs} +26 -5
- package/dist/client/{CalendarNavigationChevron-qXvsFYOg.mjs → CalendarNavigationChevron-VfP50sYm.mjs} +42 -9
- package/dist/client/{CheckboxChoice-b-PJLEXe.mjs → CheckboxChoice-BZPLCgTU.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-Olvrwi3Z.mjs → DemoBookingPortalAccess-0Ua44F1j.mjs} +13 -8
- package/dist/client/{EventCalendar.client-DwFNFb-0.mjs → EventCalendar.client-CrpiyDSP.mjs} +10 -10
- package/dist/client/{EventCombined.client-Ffu-aVOb.mjs → EventCombined.client-D0me9wnz.mjs} +10 -10
- package/dist/client/{EventEmbeddedCheckoutStep-B18VbNS_.mjs → EventEmbeddedCheckoutStep-BDnicDM6.mjs} +1 -1
- package/dist/client/{EventItem-b8tVkNHA.mjs → EventItem-CJITrGkF.mjs} +249 -8
- package/dist/client/{EventListWeekNavigation-BxnJW_Gf.mjs → EventListWeekNavigation-BlEm_xjq.mjs} +1 -1
- package/dist/client/{EventListing.client-ViCnrNg4.mjs → EventListing.client-BNM_HuS0.mjs} +3 -3
- package/dist/client/{EventListing.view-CdjiepMf.mjs → EventListing.view-CXfb7RRy.mjs} +7 -16
- package/dist/client/{EventRegistrationPayment-BVd70XkH.mjs → EventRegistrationPayment-DiD9uYs6.mjs} +1439 -293
- package/dist/client/{Page-DqETUt-U.mjs → Page-bX7iy_MK.mjs} +24299 -20103
- package/dist/client/{ProtectedSubmitButton-C-ql101B.mjs → ProtectedSubmitButton-De6AzhE6.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-DkFnbzf_.mjs → SiteTermsAgreementField-BAdW5DvE.mjs} +23 -16
- package/dist/client/{BookingPanelArrangement--EkA1ZQd.mjs → StepIndicator-DCfdcb7s.mjs} +12 -12
- package/dist/client/{StepIndicator-JO2PS03n.mjs → StepIndicator-DCqorVne.mjs} +7 -7
- package/dist/client/{TabBarFragment-BqfRLojo.mjs → TabBarFragment-DlKQRhP4.mjs} +1 -1
- package/dist/client/{ThemedButton-DuaYtnvG.mjs → ThemedButton-CnSa7o-I.mjs} +66 -66
- package/dist/client/{accessibleSurfaces-DN8it_Cx.mjs → accessibleSurfaces-Wl8-_OVJ.mjs} +1 -1
- package/dist/client/{accordion-XgNxl0Wg.mjs → accordion-wofJY8xY.mjs} +1 -1
- package/dist/client/{booking-form.client-ljJoDwuI.mjs → booking-form.client-CYl9NrqS.mjs} +412 -79
- package/dist/client/{bookingForm-DtEHwY4W.mjs → bookingForm-kgVWtuMe.mjs} +4 -4
- package/dist/client/bookings.mjs +40 -10
- package/dist/client/{boxStyleClassNames-BHoMAcun.mjs → boxStyleClassNames-CQHWz5gJ.mjs} +19 -19
- package/dist/client/{carousel-B3UhbFu7.mjs → carousel-BE1dEFsD.mjs} +2 -2
- package/dist/client/{carousel.client-h65clfUO.mjs → carousel.client-DMtGYTTM.mjs} +1 -1
- package/dist/client/{cart-DzOJfYOR.mjs → cart-BsjsdGZE.mjs} +3 -3
- package/dist/client/{cart.client-DBG77v-5.mjs → cart.client-DylGUWXY.mjs} +1 -1
- package/dist/client/{checkout-LmePoEgM.mjs → checkout-B5KxEUDr.mjs} +3 -3
- package/dist/client/{checkout.client-DmgZuLBT.mjs → checkout.client-C98fhch3.mjs} +1 -1
- package/dist/client/{checkoutUrls-CMZI8o_V.mjs → checkoutUrls-BMLYTf38.mjs} +1 -1
- package/dist/client/client.mjs +502 -341
- package/dist/client/constants-PfYJsEZF.mjs +101 -0
- package/dist/client/{context-CJIz4FdL.mjs → context-DtKdUdkO.mjs} +200 -27
- package/dist/client/{dateFormatting-UoXqBh10.mjs → dateFormatting-BaGPvQS3.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-6CgFZNvu.mjs → demoPortalMagicLink-B8eDjhuG.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-DaMo6len.mjs → enhanceHeaderSection-DvhD-8eE.mjs} +4 -4
- package/dist/client/{event-registration.client-b6APrFQe.mjs → event-registration.client-Du9a_xAN.mjs} +1982 -1519
- package/dist/client/{eventCalendar-DJYz7yZf.mjs → eventCalendar-Di9wDfzl.mjs} +4 -4
- package/dist/client/{eventCombined-j9VCVgMW.mjs → eventCombined-CNW6nBsB.mjs} +4 -4
- package/dist/client/{eventListing-DWgpGuFM.mjs → eventListing-CQMxQ8By.mjs} +4 -4
- package/dist/client/{eventRegistration-DCinRot3.mjs → eventRegistration-CprS9k1D.mjs} +4 -4
- package/dist/client/events-9LPvwbWp.mjs +28 -0
- package/dist/client/{form-BBBtRwvy.mjs → form-Zl1_8RJ6.mjs} +3 -3
- package/dist/client/{form.client-CZeRQLGF.mjs → form.client-TaMUys6I.mjs} +5 -5
- package/dist/client/{form.parts-DhGGv4_L.mjs → form.parts-CpNPbPPM.mjs} +3 -3
- package/dist/client/{formatDate-DVFVDcDW.mjs → formatDate-hhI1-tzt.mjs} +1 -1
- package/dist/client/gifting/client.mjs +6 -6
- package/dist/client/{gifting-Di9-SpwW.mjs → gifting-DNVa7-Wj.mjs} +4 -4
- package/dist/client/{gifting.client-CjT5PrAZ.mjs → gifting.client-CFUq3GVx.mjs} +5 -5
- package/dist/client/{gifting.parts-ffP6mjMd.mjs → gifting.parts-CDQvxA4A.mjs} +2 -2
- package/dist/client/{headerSection-jjAvtSZk.mjs → headerSection-Cg6083rn.mjs} +2 -2
- package/dist/client/{lookSurfaces-C2VzJfyG.mjs → lookSurfaces-gJ3OqPf9.mjs} +258 -86
- package/dist/client/{newsletter-form.client-D45frHoa.mjs → newsletter-form.client-VuL9I96G.mjs} +6 -6
- package/dist/client/{shop.interactive-D7wky1GL.mjs → newsletter-form.interactive-7Of3eYn0.mjs} +4023 -4029
- package/dist/client/{newsletter-form.parts-CHdg82ct.mjs → newsletter-form.parts-OBqsfT24.mjs} +2 -2
- package/dist/client/{newsletterForm-tS465_vl.mjs → newsletterForm-BkJe_RTv.mjs} +3 -3
- package/dist/client/portal/client.mjs +301 -117
- package/dist/client/{product-detail.client-DIWSeW7P.mjs → product-detail.client-B2hdxqJN.mjs} +1 -1
- package/dist/client/{product-list.client-BRf14h_e.mjs → product-list.client-CCEgu9rx.mjs} +1 -1
- package/dist/client/{productDetail-gxF5whea.mjs → productDetail-CRX_ZRfS.mjs} +3 -3
- package/dist/client/{productList-B9t0XJrN.mjs → productList-BAdJ6z5S.mjs} +3 -3
- package/dist/client/{propsDecoder-Db8wAmgr.mjs → propsDecoder-BLKAmX0S.mjs} +2 -48
- package/dist/client/{registry.server-Bn0gE0uP.mjs → registry.server-Bj9cmHHF.mjs} +10464 -9113
- package/dist/client/rendering/client.mjs +41 -27
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +23 -2836
- package/dist/client/{richText-coerce-COnKrLO7.mjs → richText-coerce-Z45OLLEX.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-Bok1Oy50.mjs → routeIslandApiConfig-DHpTTK77.mjs} +1 -1
- package/dist/client/runtimeResponse-D2j2-mOk.mjs +3 -0
- package/dist/client/{runtimeResponse-9v8q2NBc.mjs → runtimeResponse-DtWSfWSZ.mjs} +1 -1
- package/dist/client/{shop-D1oTPDxm.mjs → shop-BKsgxm_-.mjs} +3 -3
- package/dist/client/{shop-commerce-DyMZLC0a.mjs → shop-commerce-Cbtk_kUW.mjs} +14 -14
- package/dist/client/{shop-commerce-store-FODNS63D.mjs → shop-commerce-store-B-rv2p5h.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-C4xcmFzZ.mjs → shop-discount-apply.state-CiCDLNh7.mjs} +2 -2
- package/dist/client/{shop.client-CRgRulfI.mjs → shop.client-Rnqa74Tk.mjs} +14 -14
- package/dist/client/{shopShared-Bd_hy9ZO.mjs → shopShared-BaBfhjCq.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/{noop-D11X-B6n.mjs → src-o7WEvbK1.mjs} +398 -308
- package/dist/client/{timetableModel-UlWfP1gh.mjs → timetableModel-BOff1Kk5.mjs} +259 -11
- package/dist/client/{types-DjWUR_O6.mjs → types-BEaKfam_.mjs} +65 -65
- package/dist/client/{useAvailableSlots-D-qoooLy.mjs → useAvailableSlots-DQJNh10g.mjs} +3 -23
- package/dist/client/useDiscountCodeUi-BcFQRI_7.mjs +196 -0
- package/dist/client/{useEventPagination-CQH2e9sQ.mjs → useEventPagination-BvdcexDC.mjs} +8 -8
- package/dist/client/{view-bGU1ws-m.mjs → view-CTBwSpKv.mjs} +4 -4
- package/dist/client/{display-D1oVR5Eh.mjs → wizardSteps-CWIQyRIw.mjs} +10263 -9078
- package/dist/preview-next/before-render.mjs +5 -3
- package/dist/preview-next/client/{LocationPickerEnvironment-BHAT81Wx.mjs → LocationPickerEnvironment-BW3dRFIv.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-B52hkdIZ.mjs → MapLibreEditMap-Db9BHyXh.mjs} +2 -2
- package/dist/preview-next/client/{PageSectionToolbar-D-Le7O3o.mjs → PageSectionToolbar-CG6KwITA.mjs} +4 -4
- package/dist/preview-next/client/{PreviewEditorSidebar-DNy5j_ce.mjs → PreviewEditorSidebar-BGBqrC9m.mjs} +8 -7
- package/dist/preview-next/client/{PreviewEditorUI-CzJvgbqt.mjs → PreviewEditorUI-Bwkyx28x.mjs} +5 -5
- package/dist/preview-next/client/{PreviewShell-xhJ6ca1i.mjs → PreviewShell-DB1l6JNU.mjs} +7 -7
- package/dist/preview-next/client/{SdkPreviewModeRuntime-BmYO1TdT.mjs → SdkPreviewModeRuntime-Bs6Cwzr3.mjs} +15 -7
- package/dist/preview-next/client/{lucide-react-McYZeSMb.mjs → lucide-react-00FF_oar.mjs} +13 -1
- package/dist/preview-next/client/{previewAssistantSlot-BN93X9o1.mjs → previewAssistantSlot-T-oDD_Dd.mjs} +6252 -2461
- package/dist/preview-next/client/{previewChromeRoot-C51RQseo.mjs → previewChromeRoot-BeukcDRy.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-oeGquJM-.mjs → sdk-runtime-ceDW_9q2.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-BGTAcPud.mjs → siteStyleAccess-CCB9bScO.mjs} +35 -23
- package/dist/preview-next/client/{useAutosaveStatus-BMGXjGZq.mjs → useAutosaveStatus-D4o0CKq7.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-CTDoR_gQ.mjs → useOpenBlockForSetup-Seccrvwu.mjs} +2 -2
- package/dist/preview-next/container-responsive.css +103 -10
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-BtdzkSUg.mjs → route-contract-FwFj8zGL.mjs} +71 -10
- package/dist/server/{Block.shared-Bp3OlOjj.mjs → Block.shared-D6WrRCxX.mjs} +4 -4
- package/dist/server/{ThemeScopeCore-DFEM1a85.mjs → ThemeScopeCore-BQzjDQ2q.mjs} +8 -1
- package/dist/server/{bindings-DrbJuftt.mjs → bindings-CS6ih1Yc.mjs} +37 -6
- package/dist/server/{client-Bf06n9oj.mjs → client-m0ylCj_f.mjs} +436 -526
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/contentTypeResolver-B9vy8BrF.mjs +19 -0
- package/dist/server/data/dataLoaderContext.mjs +1 -1
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/{dataLoaderContext-B3fXA54R.mjs → dataLoaderContext-lMRTfG5Z.mjs} +1 -0
- package/dist/server/error-f4g44bKx.mjs +387 -0
- package/dist/server/index.mjs +3 -2
- package/dist/server/loadContent-vgWMz1uD.mjs +694 -0
- package/dist/server/{loadPage-5iZefzDd.mjs → loadPage-CIOL3-9t.mjs} +22 -4
- package/dist/server/{lookMediaFrame-CaH018pK.mjs → lookMediaFrame-m-91jGGn.mjs} +36 -0
- package/dist/server/next.mjs +67 -94
- package/dist/server/{overrideResolution-CUHtm7tW.mjs → overrideResolution-BiHmsvTZ.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-GmPXForc.mjs → pageRenderPlan-DJo_obpi.mjs} +15 -8
- package/dist/server/{pageRuntimeSupport-Dd8LFzfa.mjs → pageRuntimeSupport-BnSuoHON.mjs} +54 -2
- package/dist/server/{pageShared-tz-GVWft.mjs → pageShared-BJuOzxzn.mjs} +554 -304
- package/dist/server/{prebuild-JmsuYCIH.mjs → prebuild-Cr8p8T7V.mjs} +5 -4
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-Ce9DDwON.mjs → prefetchBlockData-BZh57-ua.mjs} +5 -3
- package/dist/server/{registry-D12XF_h1.mjs → registry-CvhFwbXJ.mjs} +358 -95
- package/dist/server/rendering/components/pageShared.mjs +1 -1
- package/dist/server/rendering/helpers/loadPage.mjs +1 -1
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
- package/dist/server/rendering/server.mjs +5 -4
- package/dist/server/rendering.mjs +9 -8
- package/dist/server/{resolveBlockData-D9yZIN3V.mjs → resolveBlockData-Cv_W1LVB.mjs} +61 -34
- package/dist/server/resolvePageContent-BWKUZUIn.mjs +89 -0
- package/dist/server/{responseMedia-F-ElH2Rd.mjs → responseMedia-KRKguBC5.mjs} +56 -1
- package/dist/server/routing.mjs +271 -57
- package/dist/server/server.mjs +3 -3
- package/dist/server/{loadContent-eaTY7RPg.mjs → servicePageContent-CRKbTm_7.mjs} +719 -459
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/{validation-CLq5cw6M.mjs → validation-DCl-FCk_.mjs} +4 -4
- package/dist/server/{version-oPbhAx8E.mjs → version-DT_R5JAR.mjs} +1 -1
- package/dist/styles/index.css +504 -27
- package/package.json +1 -1
- package/dist/_dts/footerPageOutline-D_XbQW_o.d.ts +0 -256
- package/dist/_dts/resolvePageContent-YT6ndha1.d.ts +0 -162
- package/dist/client/LocationMapActions-CiMtl1Ha.mjs +0 -62
- package/dist/client/MapDrawingSvg-BCZa3dpf.mjs +0 -200
- package/dist/client/constants-4o4_hl34.mjs +0 -6
- package/dist/client/course-DBEU9IA9.mjs +0 -244
- package/dist/client/duration-Q6_QNgiv.mjs +0 -37
- package/dist/client/event-details.client-BwASwKIq.mjs +0 -53
- package/dist/client/eventDetails-BzGOVDI-.mjs +0 -13
- package/dist/client/runtimeResponse-CVkM0dHy.mjs +0 -3
- package/dist/client/useDiscountCodeUi-B9DODAkj.mjs +0 -237
- package/dist/client/view-DNX59QwM.mjs +0 -1372
- package/dist/server/resolvePageContent-CAELMBEJ.mjs +0 -438
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
|
-
import {
|
|
3
|
+
import { Cn as parsePositiveMoneyInputToCents, Tn as formatCurrencyAmount, t as assertNever, tn as formatSiteInstantDate, u as logger } from "../src-o7WEvbK1.mjs";
|
|
4
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 {
|
|
7
|
-
import { a as createBlockApi, i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "../context-
|
|
8
|
-
import { S as clsx, i as ThemedButtonLink,
|
|
6
|
+
import { a as DemoPortalSignInLink, i as useBookingNowIso, o as clientPersonPhrases, r as parseBookingSubmissionFailure, t as BookingQuestionFields } from "../BookingQuestionFields-DXegGSnS.mjs";
|
|
7
|
+
import { a as createBlockApi, i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "../context-DtKdUdkO.mjs";
|
|
8
|
+
import { S as clsx, i as ThemedButtonLink, o as ThemedFileChooser, r as ThemedButton, t as ThemedActionsButton, x as SpinnerNode } from "../ThemedButton-CnSa7o-I.mjs";
|
|
9
|
+
import { t as formatDate } from "../formatDate-hhI1-tzt.mjs";
|
|
9
10
|
import { t as resolveDedicatedBookingHref } from "../bookingRoute-D6DlxYx6.mjs";
|
|
10
|
-
import { a as DemoPortalSignInLink, i as useBookingNowIso, r as parseBookingSubmissionFailure, t as BookingQuestionFields } from "../BookingQuestionFields-B57oGPcj.mjs";
|
|
11
11
|
import { t as ModalShell } from "../ModalShell-B_fHWK71.mjs";
|
|
12
|
-
import { t as TabBarFragment } from "../TabBarFragment-
|
|
13
|
-
import { t as
|
|
14
|
-
import { i as requestDemoPortalMagicLink, n as PORTAL_CALLBACK_PATH, r as buildPortalCallbackUrl } from "../demoPortalMagicLink-
|
|
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-
|
|
12
|
+
import { t as TabBarFragment } from "../TabBarFragment-DlKQRhP4.mjs";
|
|
13
|
+
import { n as useAvailableDates, t as useAvailableSlots } from "../useAvailableSlots-DQJNh10g.mjs";
|
|
14
|
+
import { i as requestDemoPortalMagicLink, n as PORTAL_CALLBACK_PATH, r as buildPortalCallbackUrl } from "../demoPortalMagicLink-B8eDjhuG.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-BaGPvQS3.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";
|
|
@@ -23,6 +23,33 @@ function formatCancellationCutoffSpan(cutoffHours) {
|
|
|
23
23
|
return cutoffHours === 1 ? "1 hour" : `${cutoffHours} hours`;
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
26
|
+
//#region ../core/src/cancellation-kept-copy.ts
|
|
27
|
+
function named(businessName) {
|
|
28
|
+
return businessName !== null && businessName !== void 0 && businessName.trim() !== "" ? businessName : null;
|
|
29
|
+
}
|
|
30
|
+
function keepReasonClause(reason, context) {
|
|
31
|
+
switch (reason.kind) {
|
|
32
|
+
case "cutoff_passed": return `it's less than ${formatCancellationCutoffSpan(reason.cutoffHours)} until it starts`;
|
|
33
|
+
case "never_refunded": {
|
|
34
|
+
const business = named(context.businessName);
|
|
35
|
+
return business !== null ? `${business} doesn't refund cancelled ${context.booking}s` : `cancelled ${context.booking}s aren't refunded`;
|
|
36
|
+
}
|
|
37
|
+
case "non_refundable_deposit": return "the deposit isn't refundable";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function credits(count, context) {
|
|
41
|
+
const noun = context.booking === "appointment" ? "package credit" : "pass credit";
|
|
42
|
+
return count === 1 ? noun : `${count} ${noun}s`;
|
|
43
|
+
}
|
|
44
|
+
/** "You won't get your £10.00 back, because it's less than 2 days until it starts." */
|
|
45
|
+
function cancellationKeptSentence(kept, context) {
|
|
46
|
+
switch (kept.kind) {
|
|
47
|
+
case "keep_money": return `You won't get your ${formatCurrencyAmount(kept.money.amountCents, kept.money.currency)} back, because ${keepReasonClause(kept.reason, context)}.`;
|
|
48
|
+
case "keep_credit": return `You won't get your ${credits(kept.credits, context)} back, because ${keepReasonClause(kept.reason, context)}.`;
|
|
49
|
+
case "contact_business": return `Your ${formatCurrencyAmount(kept.money.amountCents, kept.money.currency)} can't be refunded online, so please contact ${named(context.businessName) ?? "the business"} about it.`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
26
53
|
//#region ../core/src/appointment-lifecycle.ts
|
|
27
54
|
const appointmentStatusLabels = {
|
|
28
55
|
requested: "Waiting for approval",
|
|
@@ -84,13 +111,32 @@ function usePortalDateFormatting() {
|
|
|
84
111
|
}
|
|
85
112
|
//#endregion
|
|
86
113
|
//#region ../blocks/src/customer-portal/tabs.ts
|
|
114
|
+
/**
|
|
115
|
+
* Tabs in the order they show. The first visible one is where the portal
|
|
116
|
+
* opens, so bookings of either kind come before orders: a business that only
|
|
117
|
+
* takes appointments opens on Appointments.
|
|
118
|
+
*/
|
|
119
|
+
const CUSTOMER_PORTAL_TAB_ORDER = [
|
|
120
|
+
"events",
|
|
121
|
+
"appointments",
|
|
122
|
+
"orders",
|
|
123
|
+
"digital-products",
|
|
124
|
+
"passes-memberships",
|
|
125
|
+
"credit",
|
|
126
|
+
"profile"
|
|
127
|
+
];
|
|
128
|
+
/** The tab to open before the site's modules and the customer's data are known. */
|
|
87
129
|
function resolveInitialCustomerPortalTab(options) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
130
|
+
const enabled = {
|
|
131
|
+
events: options.showEvents || options.showWholeSeries,
|
|
132
|
+
appointments: options.showAppointments,
|
|
133
|
+
orders: options.showOrders,
|
|
134
|
+
"digital-products": false,
|
|
135
|
+
"passes-memberships": options.showPasses || options.showMemberships,
|
|
136
|
+
credit: false,
|
|
137
|
+
profile: options.showProfile
|
|
138
|
+
};
|
|
139
|
+
return CUSTOMER_PORTAL_TAB_ORDER.find((id) => enabled[id]) ?? "events";
|
|
94
140
|
}
|
|
95
141
|
function resolveCustomerPortalActiveTab(currentTab, tabs, data) {
|
|
96
142
|
switch (data.tag) {
|
|
@@ -103,15 +149,6 @@ function resolveCustomerPortalActiveTab(currentTab, tabs, data) {
|
|
|
103
149
|
default: return assertNever(data);
|
|
104
150
|
}
|
|
105
151
|
}
|
|
106
|
-
const CUSTOMER_PORTAL_TAB_ORDER = [
|
|
107
|
-
"events",
|
|
108
|
-
"orders",
|
|
109
|
-
"digital-products",
|
|
110
|
-
"passes-memberships",
|
|
111
|
-
"appointments",
|
|
112
|
-
"credit",
|
|
113
|
-
"profile"
|
|
114
|
-
];
|
|
115
152
|
/** One ordered tab selection; every section supplies its visibility and label. */
|
|
116
153
|
function resolveVisibleCustomerPortalTabs(sections) {
|
|
117
154
|
return CUSTOMER_PORTAL_TAB_ORDER.flatMap((id) => {
|
|
@@ -422,29 +459,41 @@ const PORTAL_LOGIN_QUERY_PARAM = "portal_login";
|
|
|
422
459
|
const PORTAL_TAB_QUERY_PARAM = "portal_tab";
|
|
423
460
|
const PORTAL_ORDER_QUERY_PARAM = "portal_order";
|
|
424
461
|
const PORTAL_TASK_QUERY_PARAM = "portal_task";
|
|
462
|
+
/** Set by order checkout's return URLs (`buildCheckoutReturnUrls`). */
|
|
463
|
+
const ORDER_CHECKOUT_QUERY_PARAM = "order";
|
|
425
464
|
const CUSTOMER_PORTAL_DEEP_LINK_QUERY_PARAMS = [
|
|
426
465
|
PORTAL_LOGIN_QUERY_PARAM,
|
|
427
466
|
PORTAL_TAB_QUERY_PARAM,
|
|
428
467
|
PORTAL_ORDER_QUERY_PARAM,
|
|
429
|
-
PORTAL_TASK_QUERY_PARAM
|
|
468
|
+
PORTAL_TASK_QUERY_PARAM,
|
|
469
|
+
ORDER_CHECKOUT_QUERY_PARAM
|
|
430
470
|
];
|
|
431
471
|
function parseCustomerPortalDeepLink(searchParams) {
|
|
432
472
|
const loginStatus = normalizeSearchParamValue(searchParams.get("portal_login")) === "success" ? "success" : null;
|
|
433
473
|
const rawRequestedTab = normalizeSearchParamValue(searchParams.get(PORTAL_TAB_QUERY_PARAM));
|
|
434
474
|
const requestedOrderId = normalizeSearchParamValue(searchParams.get(PORTAL_ORDER_QUERY_PARAM));
|
|
435
475
|
const requestedTask = parseRequestedTask(searchParams.get(PORTAL_TASK_QUERY_PARAM));
|
|
476
|
+
const orderCheckoutReturn = parseOrderCheckoutReturn(searchParams.get(ORDER_CHECKOUT_QUERY_PARAM));
|
|
436
477
|
return {
|
|
437
478
|
loginStatus,
|
|
438
|
-
requestedTab: resolveRequestedTab(rawRequestedTab, requestedOrderId, requestedTask),
|
|
479
|
+
requestedTab: resolveRequestedTab(rawRequestedTab, requestedOrderId, requestedTask, orderCheckoutReturn),
|
|
439
480
|
requestedOrderId,
|
|
440
|
-
requestedTask
|
|
481
|
+
requestedTask,
|
|
482
|
+
orderCheckoutReturn
|
|
441
483
|
};
|
|
442
484
|
}
|
|
443
|
-
function
|
|
485
|
+
function parseOrderCheckoutReturn(value) {
|
|
486
|
+
switch (normalizeSearchParamValue(value)) {
|
|
487
|
+
case "success": return "paid";
|
|
488
|
+
case "cancelled": return "cancelled";
|
|
489
|
+
default: return null;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
function resolveRequestedTab(requestedTab, requestedOrderId, requestedTask, orderCheckoutReturn) {
|
|
444
493
|
if (requestedTab && isCustomerPortalTabId(requestedTab)) return requestedTab;
|
|
445
494
|
if (requestedTask?.kind === "appointment") return "appointments";
|
|
446
495
|
if (requestedTask) return "events";
|
|
447
|
-
return requestedOrderId ? "orders" : null;
|
|
496
|
+
return requestedOrderId || orderCheckoutReturn ? "orders" : null;
|
|
448
497
|
}
|
|
449
498
|
function parseRequestedTask(value) {
|
|
450
499
|
const normalized = normalizeSearchParamValue(value);
|
|
@@ -724,11 +773,24 @@ function getMembershipBadgeVariant(status) {
|
|
|
724
773
|
case "trialing": return "info";
|
|
725
774
|
case "paused": return "warning";
|
|
726
775
|
case "past_due": return "error";
|
|
727
|
-
case "canceled": return "
|
|
776
|
+
case "canceled": return "default";
|
|
728
777
|
default: return "default";
|
|
729
778
|
}
|
|
730
779
|
}
|
|
731
780
|
/**
|
|
781
|
+
* A membership's status as the customer reads it. An ended one says
|
|
782
|
+
* "Cancelled" when it was cancelled and "Ended" when its period ran out.
|
|
783
|
+
*/
|
|
784
|
+
function getMembershipStatusLabel(membership) {
|
|
785
|
+
switch (membership.status) {
|
|
786
|
+
case "active": return "Active";
|
|
787
|
+
case "trialing": return "Trial";
|
|
788
|
+
case "paused": return "Paused";
|
|
789
|
+
case "past_due": return "Payment overdue";
|
|
790
|
+
case "canceled": return membership.canceledAt ? "Cancelled" : "Ended";
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
732
794
|
* Get badge variant for appointment status
|
|
733
795
|
*/
|
|
734
796
|
function getAppointmentBadgeVariant(status) {
|
|
@@ -5651,15 +5713,13 @@ function PortalJoiningDetails({ details }) {
|
|
|
5651
5713
|
}
|
|
5652
5714
|
//#endregion
|
|
5653
5715
|
//#region ../blocks/src/customer-portal/components/bookings/eventCancelCopy.ts
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
case "cutoff_passed": return `it's less than ${formatCancellationCutoffSpan(reason.cutoffHours)} until it starts`;
|
|
5659
|
-
case "never_refunded": return siteTitle ? `${siteTitle} doesn't refund cancelled bookings` : "cancelled bookings aren't refunded";
|
|
5660
|
-
case "non_refundable_deposit": return "the deposit isn't refundable";
|
|
5716
|
+
function cancelLead(scope) {
|
|
5717
|
+
switch (scope) {
|
|
5718
|
+
case "booking": return "This will cancel your booking.";
|
|
5719
|
+
case "every_session": return "This will cancel your booking for every session.";
|
|
5661
5720
|
}
|
|
5662
5721
|
}
|
|
5722
|
+
const CARD_TIME = "It can take 5–10 working days to appear.";
|
|
5663
5723
|
function passCredits(credits) {
|
|
5664
5724
|
return credits === 1 ? "pass credit" : `${credits} pass credits`;
|
|
5665
5725
|
}
|
|
@@ -5673,20 +5733,25 @@ function refundSentence(outcome) {
|
|
|
5673
5733
|
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}`;
|
|
5674
5734
|
}
|
|
5675
5735
|
}
|
|
5676
|
-
|
|
5736
|
+
/** What happens to the money when a booking is cancelled, or null when nothing was paid. */
|
|
5737
|
+
function cancelMoneySentence(outcome, siteTitle) {
|
|
5677
5738
|
switch (outcome.kind) {
|
|
5678
5739
|
case "nothing_to_return": return null;
|
|
5679
5740
|
case "refund": return refundSentence(outcome);
|
|
5680
5741
|
case "credit_back": return `You'll get your ${passCredits(outcome.credits)} back.`;
|
|
5681
|
-
case "keep_money":
|
|
5682
|
-
case "keep_credit":
|
|
5683
|
-
case "contact_business": return
|
|
5742
|
+
case "keep_money":
|
|
5743
|
+
case "keep_credit":
|
|
5744
|
+
case "contact_business": return cancellationKeptSentence(outcome, {
|
|
5745
|
+
businessName: siteTitle,
|
|
5746
|
+
booking: "booking"
|
|
5747
|
+
});
|
|
5684
5748
|
}
|
|
5685
5749
|
}
|
|
5686
|
-
/** The cancel dialog's words. The server decides the outcome; this only says it. */
|
|
5687
|
-
function eventCancelBody(outcome, siteTitle) {
|
|
5688
|
-
const
|
|
5689
|
-
|
|
5750
|
+
/** The cancel dialog's words, for events and courses. The server decides the outcome; this only says it. */
|
|
5751
|
+
function eventCancelBody(outcome, siteTitle, scope = "booking") {
|
|
5752
|
+
const lead = cancelLead(scope);
|
|
5753
|
+
const money = outcome ? cancelMoneySentence(outcome, siteTitle) : null;
|
|
5754
|
+
return money ? `${lead} ${money}` : lead;
|
|
5690
5755
|
}
|
|
5691
5756
|
/** The protected amount stays explicit wherever a client confirms cancellation. */
|
|
5692
5757
|
function protectedDepositCancelSentence(outcome) {
|
|
@@ -5879,8 +5944,12 @@ function rescheduleDoneSummary(subject, date, site) {
|
|
|
5879
5944
|
function rescheduledRowNote(date, site) {
|
|
5880
5945
|
return `Booking moved to ${formatPortalSessionDay(date.startsAt, dateFacts(date), site)}, ${formatPortalSessionTime(date.startsAt, dateFacts(date), site)}. We'll email you the new details.`;
|
|
5881
5946
|
}
|
|
5947
|
+
function roomRescheduleMessage(studio) {
|
|
5948
|
+
return `Bookings with a room can't be moved to another date. If you can't make it, get in touch with ${studioName(studio)}.`;
|
|
5949
|
+
}
|
|
5882
5950
|
/** When the booking turns out not to be reschedulable once the dialog opens. */
|
|
5883
5951
|
function rescheduleUnavailableMessage(source, studio) {
|
|
5952
|
+
if (source.kind === "not_offered" && source.reason === "has_room") return roomRescheduleMessage(studio);
|
|
5884
5953
|
return source.kind === "closed" ? `Rescheduling has closed for this booking. If you can't make it, get in touch with ${studioName(studio)}.` : `This booking can't be rescheduled here. If you need to change it, get in touch with ${studioName(studio)}.`;
|
|
5885
5954
|
}
|
|
5886
5955
|
const ACTION_NOUNS = {
|
|
@@ -5910,7 +5979,10 @@ function closedWhen(closedAt, facts) {
|
|
|
5910
5979
|
function portalActionTile(action, availability, facts, site) {
|
|
5911
5980
|
switch (availability.kind) {
|
|
5912
5981
|
case "available": return { kind: "offered" };
|
|
5913
|
-
case "not_offered": return
|
|
5982
|
+
case "not_offered": return action === "reschedule" && availability.reason === "has_room" ? {
|
|
5983
|
+
kind: "greyed",
|
|
5984
|
+
description: roomRescheduleMessage(facts.studio)
|
|
5985
|
+
} : { kind: "hidden" };
|
|
5914
5986
|
case "closed": {
|
|
5915
5987
|
const display = sessionFacts(facts);
|
|
5916
5988
|
const at = `${formatPortalSessionTime(availability.closedAt, display, site)} on ${formatPortalSessionDay(availability.closedAt, display, site)}`;
|
|
@@ -6001,8 +6073,29 @@ function courseCancelTile(enrollment, isPast, siteTitle, context) {
|
|
|
6001
6073
|
}, context);
|
|
6002
6074
|
}
|
|
6003
6075
|
//#endregion
|
|
6076
|
+
//#region ../blocks/src/customer-portal/components/bookings/bookingTicketsLine.ts
|
|
6077
|
+
/** Guest names as one short phrase: "Ana", "Ana, Ben", "Ana, Ben +2 more". Blank names are skipped. */
|
|
6078
|
+
function summarizeGuestNames(names) {
|
|
6079
|
+
const named = names.flatMap((name) => name && name.trim().length > 0 ? [name.trim()] : []);
|
|
6080
|
+
const firstTwo = named.slice(0, 2).join(", ");
|
|
6081
|
+
return named.length > 2 ? `${firstTwo} +${named.length - 2} more` : firstTwo;
|
|
6082
|
+
}
|
|
6083
|
+
/**
|
|
6084
|
+
* The line phones show under a booking in place of the Tickets and Guests
|
|
6085
|
+
* columns (`.cp-meta-tickets`): the tickets, then the guests' names when the
|
|
6086
|
+
* booking has guests. `guestNames` is null when there are no guests to name.
|
|
6087
|
+
*/
|
|
6088
|
+
function bookingTicketsLine(input) {
|
|
6089
|
+
if (input.guestNames === null) return input.tickets;
|
|
6090
|
+
const guests = summarizeGuestNames(input.guestNames);
|
|
6091
|
+
return `${input.tickets} · ${guests ? `Guests: ${guests}` : "No guest details yet"}`;
|
|
6092
|
+
}
|
|
6093
|
+
function ticketCountLabel(count) {
|
|
6094
|
+
return count === 1 ? "1 ticket" : `${count} tickets`;
|
|
6095
|
+
}
|
|
6096
|
+
//#endregion
|
|
6004
6097
|
//#region ../blocks/src/customer-portal/components/bookings/EventSeriesRegistrationTableRow.tsx
|
|
6005
|
-
function RegistrationDetails({ enrollment, primaryDateLabel, sessionDatesSummary, sessionCountLabel, statusBadge }) {
|
|
6098
|
+
function RegistrationDetails({ enrollment, primaryDateLabel, sessionDatesSummary, sessionCountLabel, statusBadge, additionalParticipants }) {
|
|
6006
6099
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6007
6100
|
/* @__PURE__ */ jsxs("div", {
|
|
6008
6101
|
className: "cp-row-title",
|
|
@@ -6029,12 +6122,26 @@ function RegistrationDetails({ enrollment, primaryDateLabel, sessionDatesSummary
|
|
|
6029
6122
|
/* @__PURE__ */ jsx("span", { children: sessionCountLabel })
|
|
6030
6123
|
]
|
|
6031
6124
|
}),
|
|
6032
|
-
/* @__PURE__ */
|
|
6125
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6033
6126
|
className: "cp-row-meta",
|
|
6034
|
-
children: /* @__PURE__ */ jsx("span", { children: sessionDatesSummary })
|
|
6127
|
+
children: [/* @__PURE__ */ jsx("span", { children: sessionDatesSummary }), /* @__PURE__ */ jsx(CourseTicketsLine, {
|
|
6128
|
+
enrollment,
|
|
6129
|
+
additionalParticipants
|
|
6130
|
+
})]
|
|
6035
6131
|
})
|
|
6036
6132
|
] });
|
|
6037
6133
|
}
|
|
6134
|
+
/** Phones show this in place of the Tickets and Guests columns. */
|
|
6135
|
+
function CourseTicketsLine({ enrollment, additionalParticipants }) {
|
|
6136
|
+
if (enrollment.ticketSummary.length === 0) return null;
|
|
6137
|
+
return /* @__PURE__ */ jsx("span", {
|
|
6138
|
+
className: "cp-meta-tickets",
|
|
6139
|
+
children: bookingTicketsLine({
|
|
6140
|
+
tickets: enrollment.ticketSummary.map((line) => `${line.quantity} × ${line.label}`).join(", "),
|
|
6141
|
+
guestNames: additionalParticipants.length > 0 ? additionalParticipants.map((participant) => participant.displayName) : null
|
|
6142
|
+
})
|
|
6143
|
+
});
|
|
6144
|
+
}
|
|
6038
6145
|
function RegistrationTicketCells({ enrollment, additionalParticipants }) {
|
|
6039
6146
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("td", {
|
|
6040
6147
|
className: "cp-col-tickets",
|
|
@@ -6072,7 +6179,8 @@ function EventSeriesRegistrationTableRow({ enrollment, primaryDateLabel, session
|
|
|
6072
6179
|
primaryDateLabel,
|
|
6073
6180
|
sessionDatesSummary,
|
|
6074
6181
|
sessionCountLabel,
|
|
6075
|
-
statusBadge
|
|
6182
|
+
statusBadge,
|
|
6183
|
+
additionalParticipants
|
|
6076
6184
|
}),
|
|
6077
6185
|
/* @__PURE__ */ jsx(RegistrationTask, {
|
|
6078
6186
|
enrollment,
|
|
@@ -6277,7 +6385,7 @@ function getWholeSeriesNonEnrolledBadge(enrollment) {
|
|
|
6277
6385
|
label: getEventSeriesRegistrationStatusLabel(enrollment)
|
|
6278
6386
|
};
|
|
6279
6387
|
}
|
|
6280
|
-
function EventSeriesRegistrationDialogs({ enrollment, actionsOpen, setActionsOpen, canViewEventDetails, cancelTile, cancelFlow }) {
|
|
6388
|
+
function EventSeriesRegistrationDialogs({ enrollment, actionsOpen, setActionsOpen, canViewEventDetails, cancelTile, cancelFlow, siteTitle }) {
|
|
6281
6389
|
return /* @__PURE__ */ jsxs(Fragment, { children: [actionsOpen ? /* @__PURE__ */ jsx(PortalModal, {
|
|
6282
6390
|
title: "Actions",
|
|
6283
6391
|
titleId: `cp-actions-course-${enrollment.id}`,
|
|
@@ -6304,6 +6412,7 @@ function EventSeriesRegistrationDialogs({ enrollment, actionsOpen, setActionsOpe
|
|
|
6304
6412
|
}) : null, /* @__PURE__ */ jsx(EventSeriesCancellationDialog, {
|
|
6305
6413
|
enrollmentId: enrollment.id,
|
|
6306
6414
|
moneyOnCancel: enrollment.actions?.moneyOnCancel,
|
|
6415
|
+
siteTitle,
|
|
6307
6416
|
cancelFlow
|
|
6308
6417
|
})] });
|
|
6309
6418
|
}
|
|
@@ -6342,14 +6451,14 @@ function seriesCancelConfirmLabel(submitting, withoutRefund) {
|
|
|
6342
6451
|
if (submitting) return "Cancelling…";
|
|
6343
6452
|
return withoutRefund ? "Cancel without refund" : "Confirm cancel";
|
|
6344
6453
|
}
|
|
6345
|
-
function EventSeriesCancellationDialog({ enrollmentId, moneyOnCancel, cancelFlow }) {
|
|
6454
|
+
function EventSeriesCancellationDialog({ enrollmentId, moneyOnCancel, siteTitle, cancelFlow }) {
|
|
6346
6455
|
if (cancelFlow.dialog.tag === "closed") return null;
|
|
6347
6456
|
const withoutRefund = cancelFlow.dialog.tag === "confirmWithoutRefund";
|
|
6348
6457
|
return /* @__PURE__ */ jsxs(PortalModal, {
|
|
6349
6458
|
title: withoutRefund ? "Cancel without a refund?" : "Cancel booking?",
|
|
6350
6459
|
titleId: `cp-cancel-course-${withoutRefund ? "no-refund-" : ""}${enrollmentId}`,
|
|
6351
6460
|
onClose: cancelFlow.dismissCancelFlow,
|
|
6352
|
-
children: [/* @__PURE__ */ jsx("div", { children: cancelFlow.dialog.tag === "confirmWithoutRefund" ? cancelFlow.dialog.message :
|
|
6461
|
+
children: [/* @__PURE__ */ jsx("div", { children: cancelFlow.dialog.tag === "confirmWithoutRefund" ? cancelFlow.dialog.message : eventCancelBody(moneyOnCancel, siteTitle, "every_session") }), /* @__PURE__ */ jsxs("div", {
|
|
6353
6462
|
className: "cp-modal__actions",
|
|
6354
6463
|
children: [/* @__PURE__ */ jsx(ThemedButton, {
|
|
6355
6464
|
type: "button",
|
|
@@ -6385,7 +6494,8 @@ function EventSeriesRegistrationRow({ enrollment, siteTitle, isPast = false, sho
|
|
|
6385
6494
|
setActionsOpen,
|
|
6386
6495
|
canViewEventDetails,
|
|
6387
6496
|
cancelTile,
|
|
6388
|
-
cancelFlow
|
|
6497
|
+
cancelFlow,
|
|
6498
|
+
siteTitle
|
|
6389
6499
|
}), /* @__PURE__ */ jsx(EventSeriesRegistrationTableRow, {
|
|
6390
6500
|
enrollment,
|
|
6391
6501
|
primaryDateLabel,
|
|
@@ -6526,6 +6636,7 @@ function rescheduleRefusalOutcome(reason) {
|
|
|
6526
6636
|
case "ticket_not_usable": return "pick_again";
|
|
6527
6637
|
case "source_changed":
|
|
6528
6638
|
case "source_unavailable":
|
|
6639
|
+
case "has_room":
|
|
6529
6640
|
case "not_found": return "stale";
|
|
6530
6641
|
}
|
|
6531
6642
|
}
|
|
@@ -7202,12 +7313,18 @@ function ChangeActionTiles({ tiles, eventTitle, disabled, choose }) {
|
|
|
7202
7313
|
}) });
|
|
7203
7314
|
}
|
|
7204
7315
|
function summarizeGuests(guests) {
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
return
|
|
7316
|
+
return summarizeGuestNames(guests.map((guest) => guest.name));
|
|
7317
|
+
}
|
|
7318
|
+
/** Phones show this in place of the Tickets and Guests columns. */
|
|
7319
|
+
function EventTicketsLine({ event, showGuestSection }) {
|
|
7320
|
+
const namesGuests = event.transferState !== "transferred_out" && showGuestSection;
|
|
7321
|
+
return /* @__PURE__ */ jsx("span", {
|
|
7322
|
+
className: "cp-meta-tickets",
|
|
7323
|
+
children: bookingTicketsLine({
|
|
7324
|
+
tickets: ticketCountLabel(event.ticketsCount),
|
|
7325
|
+
guestNames: namesGuests ? (event.guests ?? []).map((guest) => guest.name) : null
|
|
7326
|
+
})
|
|
7327
|
+
});
|
|
7211
7328
|
}
|
|
7212
7329
|
function getEventStatusLabel(event) {
|
|
7213
7330
|
if (event.transferState === "transferred_out") return event.status === "cancelled" ? "Cancelled" : "Transferred";
|
|
@@ -7651,7 +7768,14 @@ function EventRow({ event, siteTitle, isPast: isEventPast = false, showActionsCo
|
|
|
7651
7768
|
}),
|
|
7652
7769
|
/* @__PURE__ */ jsxs("div", {
|
|
7653
7770
|
className: "cp-row-meta",
|
|
7654
|
-
children: [
|
|
7771
|
+
children: [
|
|
7772
|
+
/* @__PURE__ */ jsx("span", { children: formatPortalSession(event.startsAt, event.endsAt, event, context) }),
|
|
7773
|
+
event.venueName && /* @__PURE__ */ jsx("span", { children: event.venueName }),
|
|
7774
|
+
/* @__PURE__ */ jsx(EventTicketsLine, {
|
|
7775
|
+
event,
|
|
7776
|
+
showGuestSection
|
|
7777
|
+
})
|
|
7778
|
+
]
|
|
7655
7779
|
}),
|
|
7656
7780
|
/* @__PURE__ */ jsx(PortalJoiningDetails, { details: event.joiningDetails }),
|
|
7657
7781
|
event.beforeYouCome ? /* @__PURE__ */ jsx(BeforeYouComeTaskDisplay, {
|
|
@@ -7691,7 +7815,7 @@ function EventRow({ event, siteTitle, isPast: isEventPast = false, showActionsCo
|
|
|
7691
7815
|
children: "—"
|
|
7692
7816
|
}) : showGuestSection ? event.guests?.length ? /* @__PURE__ */ jsx("span", { children: summarizeGuests(event.guests) }) : /* @__PURE__ */ jsx("span", {
|
|
7693
7817
|
className: "cp-row-muted",
|
|
7694
|
-
children: "No guest details"
|
|
7818
|
+
children: "No guest details yet"
|
|
7695
7819
|
}) : /* @__PURE__ */ jsx("span", {
|
|
7696
7820
|
className: "cp-row-muted",
|
|
7697
7821
|
children: "—"
|
|
@@ -8633,13 +8757,6 @@ function CurrentAppointment({ appointment }) {
|
|
|
8633
8757
|
}
|
|
8634
8758
|
//#endregion
|
|
8635
8759
|
//#region ../blocks/src/customer-portal/components/bookings/appointmentRequestPresentation.ts
|
|
8636
|
-
function keepReasonClause(reason, siteTitle) {
|
|
8637
|
-
switch (reason.kind) {
|
|
8638
|
-
case "cutoff_passed": return `your appointment starts in less than ${formatCancellationCutoffSpan(reason.cutoffHours)}`;
|
|
8639
|
-
case "never_refunded": return siteTitle !== null && siteTitle !== void 0 && siteTitle !== "" ? `${siteTitle} doesn't refund cancelled appointments` : "cancelled appointments aren't refunded";
|
|
8640
|
-
case "non_refundable_deposit": return "the deposit isn't refundable";
|
|
8641
|
-
}
|
|
8642
|
-
}
|
|
8643
8760
|
function packageCredits(credits) {
|
|
8644
8761
|
return credits === 1 ? "package credit" : `${credits} package credits`;
|
|
8645
8762
|
}
|
|
@@ -8656,9 +8773,12 @@ function cancelBody(outcome, siteTitle) {
|
|
|
8656
8773
|
break;
|
|
8657
8774
|
}
|
|
8658
8775
|
case "credit_back": return `This will cancel your appointment and put your ${packageCredits(outcome.credits)} back.`;
|
|
8659
|
-
case "keep_money":
|
|
8660
|
-
case "keep_credit":
|
|
8661
|
-
case "contact_business": return `This will cancel your appointment.
|
|
8776
|
+
case "keep_money":
|
|
8777
|
+
case "keep_credit":
|
|
8778
|
+
case "contact_business": return `This will cancel your appointment. ${cancellationKeptSentence(outcome, {
|
|
8779
|
+
businessName: siteTitle,
|
|
8780
|
+
booking: "appointment"
|
|
8781
|
+
})}`;
|
|
8662
8782
|
}
|
|
8663
8783
|
}
|
|
8664
8784
|
function appointmentCancelCopy(appointment, siteTitle) {
|
|
@@ -8756,17 +8876,21 @@ function portalAppointmentStatusLabel(status) {
|
|
|
8756
8876
|
}
|
|
8757
8877
|
//#endregion
|
|
8758
8878
|
//#region ../blocks/src/customer-portal/shared/checkoutUrls.ts
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8879
|
+
/**
|
|
8880
|
+
* Where order checkout sends someone back to: this portal page, with
|
|
8881
|
+
* `order=success|cancelled` for the portal to read once and clear
|
|
8882
|
+
* (`parseCustomerPortalDeepLink`). Any fragment already on the page is kept;
|
|
8883
|
+
* none is added.
|
|
8884
|
+
*/
|
|
8885
|
+
function buildOrderCheckoutReturnUrls(currentHref) {
|
|
8886
|
+
const withOutcome = (outcome) => {
|
|
8887
|
+
const url = new URL(currentHref);
|
|
8888
|
+
url.searchParams.set(ORDER_CHECKOUT_QUERY_PARAM, outcome);
|
|
8889
|
+
return url.toString();
|
|
8890
|
+
};
|
|
8767
8891
|
return {
|
|
8768
|
-
successUrl,
|
|
8769
|
-
cancelUrl:
|
|
8892
|
+
successUrl: withOutcome("success"),
|
|
8893
|
+
cancelUrl: withOutcome("cancelled")
|
|
8770
8894
|
};
|
|
8771
8895
|
}
|
|
8772
8896
|
//#endregion
|
|
@@ -8899,7 +9023,7 @@ function OrdersSection({ orders, emptyMessage, requestedOrderId = null, onReques
|
|
|
8899
9023
|
type: "checkout-started",
|
|
8900
9024
|
orderId: order.id
|
|
8901
9025
|
});
|
|
8902
|
-
const { successUrl, cancelUrl } =
|
|
9026
|
+
const { successUrl, cancelUrl } = buildOrderCheckoutReturnUrls(window.location.href);
|
|
8903
9027
|
const checkout = await api.createPortalOrderCheckout(order.id, {
|
|
8904
9028
|
successUrl,
|
|
8905
9029
|
cancelUrl,
|
|
@@ -9910,6 +10034,31 @@ function PortalActionFeedback({ feedback }) {
|
|
|
9910
10034
|
children: feedback.message
|
|
9911
10035
|
});
|
|
9912
10036
|
}
|
|
10037
|
+
function OrderCheckoutReturnNotice({ outcome }) {
|
|
10038
|
+
switch (outcome) {
|
|
10039
|
+
case null: return null;
|
|
10040
|
+
case "paid": return /* @__PURE__ */ jsx("div", {
|
|
10041
|
+
className: "cp-alert cp-alert--success cp-alert--mb",
|
|
10042
|
+
role: "status",
|
|
10043
|
+
children: "Thanks for your payment. It might take a moment to show as paid here."
|
|
10044
|
+
});
|
|
10045
|
+
case "cancelled": return /* @__PURE__ */ jsx("div", {
|
|
10046
|
+
className: "cp-alert cp-alert--mb",
|
|
10047
|
+
role: "status",
|
|
10048
|
+
children: "Your payment was cancelled, so nothing has been charged."
|
|
10049
|
+
});
|
|
10050
|
+
}
|
|
10051
|
+
}
|
|
10052
|
+
/**
|
|
10053
|
+
* The passes & memberships tab's name, from what the customer holds:
|
|
10054
|
+
* "Passes", "Packages & Memberships", "Passes, Packages & Memberships"…
|
|
10055
|
+
* A host's own passes label replaces the pass and package names.
|
|
10056
|
+
*/
|
|
10057
|
+
function passesAndMembershipsTabLabel(input) {
|
|
10058
|
+
const names = [...input.passesTabLabel !== void 0 ? input.passes.length > 0 ? [input.passesTabLabel] : [] : [...input.passes.some((pass) => pass.productUseCase === "event_pass") ? ["Passes"] : [], ...input.passes.some((pass) => pass.productUseCase === "appointment_package") ? ["Packages"] : []], ...input.hasMemberships ? [input.membershipsTabLabel] : []];
|
|
10059
|
+
const last = names[names.length - 1] ?? "";
|
|
10060
|
+
return names.length <= 1 ? last : `${names.slice(0, -1).join(", ")} & ${last}`;
|
|
10061
|
+
}
|
|
9913
10062
|
function hasAppointmentContent(data) {
|
|
9914
10063
|
return data.appointments.length > 0 || visibleRegularSessions(data.regularSessions).length > 0;
|
|
9915
10064
|
}
|
|
@@ -9970,7 +10119,7 @@ async function loadOptionalPortalSectionWithFallback(label, load, buildFallback)
|
|
|
9970
10119
|
* Provides authenticated customers access to their passes, memberships,
|
|
9971
10120
|
* event registrations, appointments, and profile.
|
|
9972
10121
|
*/
|
|
9973
|
-
function CustomerPortalClient({ 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",
|
|
10122
|
+
function CustomerPortalClient({ 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", emptyEventsMessage = "You're not registered for any events.", emptyAppointmentsMessage = "You don't have any appointments scheduled.", emptyOrdersMessage = "You don't have any orders yet." }) {
|
|
9974
10123
|
const { logoutPath, bookPath } = resolvePortalHostPaths({
|
|
9975
10124
|
logoutPath: suppliedLogoutPath,
|
|
9976
10125
|
bookPath: suppliedBookPath
|
|
@@ -10002,9 +10151,10 @@ function CustomerPortalClient({ logoutPath: suppliedLogoutPath, bookPath: suppli
|
|
|
10002
10151
|
const postLoginBannerMessage = selectPortalPostLoginBannerMessage(state);
|
|
10003
10152
|
const activeTab = selectPortalActiveTab(state);
|
|
10004
10153
|
const [waitlistFeedback, setWaitlistFeedback] = useState({ tag: "idle" });
|
|
10154
|
+
const [orderCheckoutReturn, setOrderCheckoutReturn] = useState(initialPortalDeepLink.orderCheckoutReturn);
|
|
10005
10155
|
const requestedOrderId = selectRequestedPortalOrderId(state);
|
|
10006
10156
|
const requestedTask = initialPortalDeepLink.requestedTask;
|
|
10007
|
-
const requestedBookingQuestionsTask = toBookingQuestionsTask(requestedTask);
|
|
10157
|
+
const requestedBookingQuestionsTask = useMemo(() => toBookingQuestionsTask(requestedTask), [requestedTask]);
|
|
10008
10158
|
const isCheckingSession = selectIsCheckingPortalSession(state);
|
|
10009
10159
|
const isUnauthenticatedSession = selectIsUnauthenticatedPortalSession(state);
|
|
10010
10160
|
const isAuthenticatedSession = state.session.tag === "authenticated";
|
|
@@ -10016,7 +10166,7 @@ function CustomerPortalClient({ logoutPath: suppliedLogoutPath, bookPath: suppli
|
|
|
10016
10166
|
const shouldFetchWholeSeries = showWholeSeries && (enabledModules?.events ?? false);
|
|
10017
10167
|
const [passes, memberships, eventData, wholeSeriesRegistrations, appointmentData, orders, credit, digitalProducts] = await Promise.all([
|
|
10018
10168
|
showPasses ? api.getPortalPasses() : Promise.resolve([]),
|
|
10019
|
-
showMemberships ? api.getPortalMemberships() : Promise.resolve([]),
|
|
10169
|
+
showMemberships ? api.getPortalMemberships({ includeInactive: true }) : Promise.resolve([]),
|
|
10020
10170
|
loadPortalEvents(api, shouldFetchEvents, requestedTask),
|
|
10021
10171
|
shouldFetchWholeSeries ? api.getPortalWholeSeriesRegistrations() : Promise.resolve([]),
|
|
10022
10172
|
loadPortalAppointmentData(api, shouldFetchAppointments),
|
|
@@ -10116,11 +10266,19 @@ function CustomerPortalClient({ logoutPath: suppliedLogoutPath, bookPath: suppli
|
|
|
10116
10266
|
modules: enabledModules,
|
|
10117
10267
|
style: "generic"
|
|
10118
10268
|
});
|
|
10119
|
-
const
|
|
10120
|
-
const
|
|
10121
|
-
const
|
|
10122
|
-
|
|
10123
|
-
|
|
10269
|
+
const heldPasses = showPasses ? data.passes : [];
|
|
10270
|
+
const heldMemberships = showMemberships ? data.memberships : [];
|
|
10271
|
+
const canShowPassesMemberships = shouldShowPortalSection({
|
|
10272
|
+
enabled: showPasses || showMemberships,
|
|
10273
|
+
hasLoadedData,
|
|
10274
|
+
hasContent: heldPasses.length > 0 || heldMemberships.length > 0
|
|
10275
|
+
});
|
|
10276
|
+
const passesMembershipsLabel = passesAndMembershipsTabLabel({
|
|
10277
|
+
passes: heldPasses,
|
|
10278
|
+
hasMemberships: heldMemberships.length > 0,
|
|
10279
|
+
passesTabLabel,
|
|
10280
|
+
membershipsTabLabel
|
|
10281
|
+
});
|
|
10124
10282
|
const tabs = useMemo(() => resolveVisibleCustomerPortalTabs({
|
|
10125
10283
|
events: {
|
|
10126
10284
|
visible: canShowBookings,
|
|
@@ -10243,12 +10401,14 @@ function CustomerPortalClient({ logoutPath: suppliedLogoutPath, bookPath: suppli
|
|
|
10243
10401
|
children: postLoginBannerMessage
|
|
10244
10402
|
}),
|
|
10245
10403
|
/* @__PURE__ */ jsx(PortalActionFeedback, { feedback: waitlistFeedback }),
|
|
10404
|
+
/* @__PURE__ */ jsx(OrderCheckoutReturnNotice, { outcome: orderCheckoutReturn }),
|
|
10246
10405
|
!requestedBookingQuestionsTask && tabs.length > 1 && /* @__PURE__ */ jsx(TabBarFragment, {
|
|
10247
10406
|
ariaLabel: "Portal sections",
|
|
10248
10407
|
tabs,
|
|
10249
10408
|
activeTab,
|
|
10250
10409
|
onTabChange: (tabId) => {
|
|
10251
10410
|
if (!isCustomerPortalTabId(tabId)) return;
|
|
10411
|
+
setOrderCheckoutReturn(null);
|
|
10252
10412
|
dispatch({
|
|
10253
10413
|
type: "active-tab-changed",
|
|
10254
10414
|
tab: tabId
|
|
@@ -10299,13 +10459,9 @@ function CustomerPortalClient({ logoutPath: suppliedLogoutPath, bookPath: suppli
|
|
|
10299
10459
|
})
|
|
10300
10460
|
}) : null,
|
|
10301
10461
|
activeTab === "passes-memberships" && canShowPassesMemberships && /* @__PURE__ */ jsx(PassesAndMembershipsSection, {
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
passes: data.passes,
|
|
10305
|
-
memberships: data.memberships,
|
|
10462
|
+
passes: heldPasses,
|
|
10463
|
+
memberships: heldMemberships,
|
|
10306
10464
|
creditProductHeading: creditProductLabels.heading,
|
|
10307
|
-
emptyPassesMessage: resolvedEmptyPassesMessage,
|
|
10308
|
-
emptyMembershipsMessage,
|
|
10309
10465
|
onRefresh: fetchPortalData
|
|
10310
10466
|
}),
|
|
10311
10467
|
activeTab === "events" && canShowBookings && /* @__PURE__ */ jsx(BookingsSection, {
|
|
@@ -10436,20 +10592,10 @@ function FocusedBookingQuestionsTask({ taskLink, api, onRefresh }) {
|
|
|
10436
10592
|
}) : null]
|
|
10437
10593
|
});
|
|
10438
10594
|
}
|
|
10439
|
-
function PassesAndMembershipsSection({
|
|
10440
|
-
const hasPasses =
|
|
10441
|
-
const hasMemberships =
|
|
10595
|
+
function PassesAndMembershipsSection({ passes, memberships, creditProductHeading, onRefresh }) {
|
|
10596
|
+
const hasPasses = passes.length > 0;
|
|
10597
|
+
const hasMemberships = memberships.length > 0;
|
|
10442
10598
|
const bothHaveContent = hasPasses && hasMemberships;
|
|
10443
|
-
if (!hasPasses && !hasMemberships) return /* @__PURE__ */ jsx("div", {
|
|
10444
|
-
className: "cp-section cp-section--passes-memberships",
|
|
10445
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
10446
|
-
className: "cp-empty",
|
|
10447
|
-
children: /* @__PURE__ */ jsx("p", {
|
|
10448
|
-
className: "cp-empty__text",
|
|
10449
|
-
children: showPasses ? emptyPassesMessage : emptyMembershipsMessage
|
|
10450
|
-
})
|
|
10451
|
-
})
|
|
10452
|
-
});
|
|
10453
10599
|
return /* @__PURE__ */ jsxs("div", {
|
|
10454
10600
|
className: "cp-section cp-section--passes-memberships",
|
|
10455
10601
|
children: [hasPasses && /* @__PURE__ */ jsxs(Fragment, { children: [bothHaveContent && /* @__PURE__ */ jsx("h3", {
|
|
@@ -10489,6 +10635,10 @@ function PassCard({ pass }) {
|
|
|
10489
10635
|
})]
|
|
10490
10636
|
}),
|
|
10491
10637
|
/* @__PURE__ */ jsx(PassCredits, { pass }),
|
|
10638
|
+
pass.creditsHeld > 0 ? /* @__PURE__ */ jsxs("p", {
|
|
10639
|
+
className: "cp-card-meta",
|
|
10640
|
+
children: [pass.creditsHeld, " held for a booking you're paying for"]
|
|
10641
|
+
}) : null,
|
|
10492
10642
|
/* @__PURE__ */ jsx(PassDates, { pass })
|
|
10493
10643
|
]
|
|
10494
10644
|
});
|
|
@@ -10518,10 +10668,18 @@ function PassDates({ pass }) {
|
|
|
10518
10668
|
children: [/* @__PURE__ */ jsxs("span", { children: ["Purchased ", formatDate(pass.purchasedAt)] }), pass.expiresAt && /* @__PURE__ */ jsxs("span", { children: ["Expires ", formatEntitlementEnd(pass.expiresAt)] })]
|
|
10519
10669
|
}), pass.creditHistory.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
10520
10670
|
className: "cp-card-meta",
|
|
10521
|
-
children: pass.creditHistory.slice(0, 3).map((entry) => /* @__PURE__ */
|
|
10671
|
+
children: pass.creditHistory.slice(0, 3).map((entry) => /* @__PURE__ */ jsxs("span", { children: [formatCustomerPassCreditHistoryEntry(entry, pass.productUseCase, context), entry.kind === "redemption" && entry.bookingStartsAt ? /* @__PURE__ */ jsxs("small", { children: [" · booked ", formatSiteInstantDate(entry.occurredAt, context.timeZone, {
|
|
10672
|
+
date: "short",
|
|
10673
|
+
year: "omit"
|
|
10674
|
+
})] }) : null] }, `${entry.kind}:${entry.id}`))
|
|
10522
10675
|
}) : null] });
|
|
10523
10676
|
}
|
|
10524
10677
|
function formatCustomerPassCreditHistoryEntry(entry, productUseCase, context) {
|
|
10678
|
+
if (entry.kind === "redemption" && entry.bookingStartsAt) return `${formatSiteInstantDate(entry.bookingStartsAt, context.timeZone, {
|
|
10679
|
+
weekday: "short",
|
|
10680
|
+
date: "short",
|
|
10681
|
+
year: "omit"
|
|
10682
|
+
})} ${productUseCase === "event_pass" ? "class" : "appointment"}`;
|
|
10525
10683
|
const units = formatCreditProductUnits(productUseCase, entry.credits);
|
|
10526
10684
|
const date = formatDate$1(entry.occurredAt, context, "long");
|
|
10527
10685
|
return entry.kind === "restoration" ? `${units} returned on ${date}` : `Used ${units} on ${date}`;
|
|
@@ -10539,7 +10697,7 @@ function MembershipsCards({ memberships, onRefresh }) {
|
|
|
10539
10697
|
children: feedback.message
|
|
10540
10698
|
}), /* @__PURE__ */ jsx("div", {
|
|
10541
10699
|
className: "cp-cards",
|
|
10542
|
-
children: memberships.map((membership) => /* @__PURE__ */ jsx(MembershipCard, {
|
|
10700
|
+
children: currentMembershipsFirst(memberships).map((membership) => /* @__PURE__ */ jsx(MembershipCard, {
|
|
10543
10701
|
membership,
|
|
10544
10702
|
cancelFlow
|
|
10545
10703
|
}, membership.id))
|
|
@@ -10560,7 +10718,7 @@ function MembershipCard({ membership, cancelFlow }) {
|
|
|
10560
10718
|
children: membership.membershipDescription
|
|
10561
10719
|
})] }), /* @__PURE__ */ jsx(Badge, {
|
|
10562
10720
|
variant: getMembershipBadgeVariant(membership.status),
|
|
10563
|
-
children: membership
|
|
10721
|
+
children: getMembershipStatusLabel(membership)
|
|
10564
10722
|
})]
|
|
10565
10723
|
}),
|
|
10566
10724
|
/* @__PURE__ */ jsx(MembershipDates, { membership }),
|
|
@@ -10608,6 +10766,10 @@ function membershipDatesView(membership) {
|
|
|
10608
10766
|
kind: "ended",
|
|
10609
10767
|
endedAt: membership.endedAt ?? null
|
|
10610
10768
|
};
|
|
10769
|
+
if (membership.status === "paused") return {
|
|
10770
|
+
kind: "paused",
|
|
10771
|
+
pausedAt: membership.pausedAt
|
|
10772
|
+
};
|
|
10611
10773
|
if (membership.renews) return {
|
|
10612
10774
|
kind: "renewing",
|
|
10613
10775
|
renewsAt: membership.currentPeriodEnd
|
|
@@ -10622,7 +10784,7 @@ function membershipDatesView(membership) {
|
|
|
10622
10784
|
};
|
|
10623
10785
|
}
|
|
10624
10786
|
function MembershipDates({ membership }) {
|
|
10625
|
-
const {
|
|
10787
|
+
const { formatEntitlementEnd } = usePortalDateFormatting();
|
|
10626
10788
|
const view = membershipDatesView(membership);
|
|
10627
10789
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
10628
10790
|
className: "cp-card-meta",
|
|
@@ -10630,7 +10792,7 @@ function MembershipDates({ membership }) {
|
|
|
10630
10792
|
"Billed ",
|
|
10631
10793
|
membership.billingInterval,
|
|
10632
10794
|
"ly"
|
|
10633
|
-
] }),
|
|
10795
|
+
] }), /* @__PURE__ */ jsx(MembershipDateLine, { view })]
|
|
10634
10796
|
}), view.kind === "ending" && /* @__PURE__ */ jsxs("div", {
|
|
10635
10797
|
className: "cp-alert cp-alert--success cp-alert--mt",
|
|
10636
10798
|
children: [
|
|
@@ -10642,6 +10804,20 @@ function MembershipDates({ membership }) {
|
|
|
10642
10804
|
]
|
|
10643
10805
|
})] });
|
|
10644
10806
|
}
|
|
10807
|
+
function MembershipDateLine({ view }) {
|
|
10808
|
+
const { formatDate, formatEntitlementEnd } = usePortalDateFormatting();
|
|
10809
|
+
switch (view.kind) {
|
|
10810
|
+
case "ended": return view.endedAt ? /* @__PURE__ */ jsxs("span", { children: ["Ended on ", formatEntitlementEnd(view.endedAt, "long")] }) : null;
|
|
10811
|
+
case "paused": return view.pausedAt ? /* @__PURE__ */ jsxs("span", { children: ["Paused since ", formatDate(view.pausedAt)] }) : null;
|
|
10812
|
+
case "renewing": return view.renewsAt ? /* @__PURE__ */ jsxs("span", { children: ["Renews ", formatDate(view.renewsAt)] }) : /* @__PURE__ */ jsx("span", { children: "Renewal date unavailable" });
|
|
10813
|
+
case "ending":
|
|
10814
|
+
case "set_period": return view.endsAt ? /* @__PURE__ */ jsxs("span", { children: ["Valid until ", formatEntitlementEnd(view.endsAt)] }) : null;
|
|
10815
|
+
}
|
|
10816
|
+
}
|
|
10817
|
+
/** Current memberships above ended ones; the server's newest-first order holds within each group. */
|
|
10818
|
+
function currentMembershipsFirst(memberships) {
|
|
10819
|
+
return [...memberships.filter((membership) => membership.status !== "canceled"), ...memberships.filter((membership) => membership.status === "canceled")];
|
|
10820
|
+
}
|
|
10645
10821
|
function CreditSection({ credit }) {
|
|
10646
10822
|
return /* @__PURE__ */ jsxs("div", {
|
|
10647
10823
|
className: "cp-section cp-section--credit",
|
|
@@ -11323,17 +11499,25 @@ function useFocusedBookingQuestionsTask(api, taskLink) {
|
|
|
11323
11499
|
const [detail, setDetail] = useState(null);
|
|
11324
11500
|
const [loading, setLoading] = useState(true);
|
|
11325
11501
|
const [error, setError] = useState(null);
|
|
11502
|
+
const { kind, id } = taskLink;
|
|
11326
11503
|
const refreshTask = useCallback(async () => {
|
|
11327
11504
|
setLoading(true);
|
|
11328
11505
|
setError(null);
|
|
11329
11506
|
try {
|
|
11330
|
-
setDetail(await loadFocusedBookingQuestionsTask(api,
|
|
11507
|
+
setDetail(await loadFocusedBookingQuestionsTask(api, {
|
|
11508
|
+
kind,
|
|
11509
|
+
id
|
|
11510
|
+
}));
|
|
11331
11511
|
} catch (cause) {
|
|
11332
11512
|
setError(cause instanceof Error ? cause.message : "We could not load this task. Please try the link again.");
|
|
11333
11513
|
} finally {
|
|
11334
11514
|
setLoading(false);
|
|
11335
11515
|
}
|
|
11336
|
-
}, [
|
|
11516
|
+
}, [
|
|
11517
|
+
api,
|
|
11518
|
+
kind,
|
|
11519
|
+
id
|
|
11520
|
+
]);
|
|
11337
11521
|
useEffect(() => {
|
|
11338
11522
|
refreshTask();
|
|
11339
11523
|
}, [refreshTask]);
|