@riverbankcms/sdk 0.172.0 → 0.173.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/dist/_dts/{BlocksIslandsHydrator-DtrzTJ77.d.ts → BlocksIslandsHydrator-O50mTMCY.d.ts} +1 -1
- package/dist/_dts/{Page-DViYbakk.d.ts → Page-Bk99sJwV.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-D-5OeDbT.d.ts → SdkPreviewMode-DzAue6Kj.d.ts} +2 -2
- package/dist/_dts/{client-DZBOzd3U.d.ts → client-ZlNEIvlU.d.ts} +1002 -139
- package/dist/_dts/{content-types-DS3DrYn_.d.ts → content-types-DBXPNc0h.d.ts} +2 -2
- package/dist/_dts/{contracts-C3QGPCUf.d.ts → contracts-D9bhu0bb.d.ts} +4 -3
- package/dist/_dts/{footerPageOutline-D9Q7VIul.d.ts → footerPageOutline-Bfap3soN.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-R7NeFT1u.d.ts → generatePageMetadata-DwCdg31h.d.ts} +2 -2
- package/dist/_dts/{index-CpOkfBt1.d.ts → index-BnatulTs.d.ts} +3 -3
- package/dist/_dts/{index-Dns7OHyl.d.ts → index-C611wjIL.d.ts} +1 -1
- package/dist/_dts/{index-Da4UMgbs.d.ts → index-CJzs-yIJ.d.ts} +2 -2
- package/dist/_dts/{index-MuMYjetm.d.ts → index-DW3eeNph.d.ts} +4 -4
- package/dist/_dts/{index-DkFV_1Bc.d.ts → index-Dq_AboWN.d.ts} +1 -1
- package/dist/_dts/{index-C0zjLMAW.d.ts → index-DutLU2d2.d.ts} +1 -1
- package/dist/_dts/{index-BnMavhoh.d.ts → index-KXh8FQ2s.d.ts} +2 -2
- package/dist/_dts/{loadContent-DJmXHzfi.d.ts → loadContent-Bde2y870.d.ts} +7 -7
- package/dist/_dts/{request-wQ28JWbr.d.ts → request-Bysk4QPI.d.ts} +1842 -262
- package/dist/_dts/{resolveBlockData-C-IP53u9.d.ts → resolveBlockData-ChbNvpSF.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-Cc4zqaEC.d.ts → resolvePageContent-CGa6QMgc.d.ts} +2 -2
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- 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 +2 -2
- 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 +6 -2
- package/dist/_dts/sdk/src/next/index.d.ts +7 -7
- 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 +1 -1
- 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 +6 -6
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
- 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/{types-DrinAfeW.d.ts → types-BoEk9ZON.d.ts} +3 -3
- package/dist/_dts/{types-CpjyP5I4.d.ts → types-BwitGNTl.d.ts} +7 -7
- package/dist/_dts/{types-ZuZoGsZV.d.ts → types-kpp8XyXv.d.ts} +2 -2
- package/dist/_dts/{validation-CIZ_fP5l.d.ts → validation-ChftKX-o.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-UFmQB1BE.mjs → BlocksIslandsHydrator-BnUeSE3d.mjs} +17 -17
- package/dist/client/{BookingMailingListNote-VjRYhx1c.mjs → BookingMailingListNote-LHQMODqB.mjs} +13 -7
- package/dist/client/{BookingPanelArrangement-DpqnRo-t.mjs → BookingPanelArrangement-Be704P85.mjs} +1 -1
- package/dist/client/{BookingQuestionFields-CzOT8ZWo.mjs → BookingQuestionFields-BewbU_cV.mjs} +2 -2
- package/dist/client/{CalendarNavigationChevron-CNckKZct.mjs → CalendarNavigationChevron-BMZp3RS3.mjs} +41 -34
- package/dist/client/{DemoBookingPortalAccess-CmZLVXOy.mjs → DemoBookingPortalAccess-CARUWQ_E.mjs} +21 -21
- package/dist/client/{EventCalendar.client-BU-SxLCn.mjs → EventCalendar.client-CaI6upCX.mjs} +11 -10
- package/dist/client/{EventCombined.client-f28VltfY.mjs → EventCombined.client-CoRUaYHY.mjs} +10 -9
- package/dist/client/{EventItem-sKBofjiW.mjs → EventItem-Doe4KodB.mjs} +25 -16
- package/dist/client/{EventListWeekNavigation-IAcax47T.mjs → EventListWeekNavigation-CXWLKDfa.mjs} +1 -1
- package/dist/client/{EventListing.client-BEtnRvZr.mjs → EventListing.client-DvJ5tGTx.mjs} +3 -3
- package/dist/client/{EventListing.view-BZ4l_rmT.mjs → EventListing.view-BmfyK7S5.mjs} +37 -14
- package/dist/client/{EventRegistrationPayment-BWb295cD.mjs → EventRegistrationPayment-DwMlJB2V.mjs} +846 -145
- package/dist/client/{LocationMapActions-Hsj2HC_1.mjs → LocationMapActions-CdRPU6gp.mjs} +1 -1
- package/dist/client/{MapDrawingSvg-C7E7Lyfa.mjs → MapDrawingSvg-DCLtxOnt.mjs} +1 -1
- package/dist/client/{Page-Ds1s3DuC.mjs → Page-D46Dmr7b.mjs} +548 -44
- package/dist/client/{StepIndicator-CSCyAaKY.mjs → StepIndicator-CrSZCZn1.mjs} +82 -11
- package/dist/client/{accessibleSurfaces-OsAseM7H.mjs → accessibleSurfaces-D4DhWo9j.mjs} +1 -20
- package/dist/client/{accordion-DgwFZJSx.mjs → accordion-P8xcfKxq.mjs} +1 -1
- package/dist/client/bookability-SargNwlO.mjs +17 -0
- package/dist/client/{booking-form.client-CKY9oksp.mjs → booking-form.client-BM2s-NqR.mjs} +11 -11
- package/dist/client/{bookingForm-CsHhcdSF.mjs → bookingForm-JnaZPZge.mjs} +4 -4
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{boxStyleClassNames-B1Z_TGAe.mjs → boxStyleClassNames-Cahps5kR.mjs} +1 -1
- package/dist/client/{carousel-0sw2Kc3a.mjs → carousel-CQQ_m0KA.mjs} +1 -1
- package/dist/client/{cart-CPfvMDGJ.mjs → cart-0Q4fjw_K.mjs} +3 -3
- package/dist/client/{cart.client-BJBPUTmg.mjs → cart.client-BI0IaHX3.mjs} +1 -1
- package/dist/client/{checkout-DU4JFjGT.mjs → checkout-1J-3ftxF.mjs} +3 -3
- package/dist/client/{checkout.client-BbNCO4xa.mjs → checkout.client-DOGYDlDk.mjs} +1 -1
- package/dist/client/{checkoutUrls-BQ3OlWlM.mjs → checkoutUrls-CwHqcqzP.mjs} +1 -1
- package/dist/client/client.mjs +52 -4
- package/dist/client/{context-xNC1Cyjw.mjs → context-D0KCgbOq.mjs} +81 -14
- package/dist/client/{cta-CNVQHLKs.mjs → course-CmOuoZHN.mjs} +76 -2
- package/dist/client/{dateFormatting-B6ea-egy.mjs → dateFormatting-Dmfaczzq.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-BhjGxhX3.mjs → demoPortalMagicLink-CL7KGRta.mjs} +1 -1
- package/dist/client/{display-B5DfNb6A.mjs → display-lL-YRApN.mjs} +2462 -426
- package/dist/client/{enhanceHeaderSection-BFcHLuqk.mjs → enhanceHeaderSection-B-eLGs2C.mjs} +3 -3
- package/dist/client/{event-details.client-WHT5GLn2.mjs → event-details.client-DH1-Jxsh.mjs} +1 -1
- package/dist/client/{event-registration.client-CmnRKELC.mjs → event-registration.client-GuuElczW.mjs} +1314 -552
- package/dist/client/{eventCalendar-2NbdCyov.mjs → eventCalendar-BiCINPkV.mjs} +4 -4
- package/dist/client/{eventCombined-D1lH1n2T.mjs → eventCombined-BtzmH6FW.mjs} +4 -4
- package/dist/client/{eventDetails-BHvnF2Tw.mjs → eventDetails-BJpAD10-.mjs} +2 -2
- package/dist/client/{eventListing-EhSDk4UL.mjs → eventListing-jLB8iRqp.mjs} +4 -4
- package/dist/client/{eventRegistration-z_0jN_KS.mjs → eventRegistration-WhtpDEbq.mjs} +4 -4
- package/dist/client/{form-BfChzSkS.mjs → form-DO6qKH3M.mjs} +3 -3
- package/dist/client/{form.client-D1zehtPk.mjs → form.client-D12ljYiX.mjs} +3 -3
- package/dist/client/{form.parts-rMDlUQIv.mjs → form.parts-C8QHaQOI.mjs} +1 -1
- package/dist/client/{formatDate-ymSVT9Y5.mjs → formatDate-BnhfIpCa.mjs} +1 -1
- package/dist/client/gifting/client.mjs +2 -2
- package/dist/client/{headerSection-BX9bQ84k.mjs → headerSection-BtFWtoUm.mjs} +2 -2
- package/dist/client/{newsletter-form.client-DMbuJCtJ.mjs → newsletter-form.client-oHrqM_Ao.mjs} +4 -4
- package/dist/client/{newsletter-form.parts-BxrVsoI0.mjs → newsletter-form.parts-D5U-FuVy.mjs} +1 -1
- package/dist/client/{newsletterForm-B_I3FJFS.mjs → newsletterForm-CBYbFxSx.mjs} +3 -3
- package/dist/client/{noop-CamIX2yK.mjs → noop-CN0o0yjH.mjs} +115 -12
- package/dist/client/portal/client.mjs +7 -7
- package/dist/client/{product-detail.client-qxuiYCof.mjs → product-detail.client-d_sNCapC.mjs} +1 -1
- package/dist/client/{product-list.client-CDL-jihv.mjs → product-list.client-DkSpw6WQ.mjs} +1 -1
- package/dist/client/{productDetail-B97m0uZy.mjs → productDetail-DaqM-LgL.mjs} +3 -3
- package/dist/client/{productList-DE4vSSG_.mjs → productList-CMx4-XlG.mjs} +3 -3
- package/dist/client/{propsDecoder-BTde6Syh.mjs → propsDecoder-BZbUKstC.mjs} +3 -3
- package/dist/client/{registry.server-Cn8XjRte.mjs → registry.server-Cdot3dMk.mjs} +85 -57
- package/dist/client/rendering/client.mjs +25 -25
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +24 -55
- package/dist/client/{richText-coerce-Bcl3vTb4.mjs → richText-coerce-ByApwB4q.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-BjRoLoMD.mjs → routeIslandApiConfig-DTET8f__.mjs} +1 -1
- package/dist/client/{runtimeResponse-B-lrAGhX.mjs → runtimeResponse-IkOwKZD0.mjs} +1 -1
- package/dist/client/runtimeResponse-Wd6kwhE_.mjs +3 -0
- package/dist/client/{shop-BC4H0oYT.mjs → shop-Cy6xXDM7.mjs} +3 -3
- package/dist/client/{shop-commerce-BsY7a71m.mjs → shop-commerce-oDR76k1q.mjs} +11 -10
- package/dist/client/{shop-commerce-store-BZ5j90HD.mjs → shop-commerce-store-DjoUpL3a.mjs} +1 -1
- package/dist/client/shop-discount-apply.state-WsGb9DD8.mjs +166 -0
- package/dist/client/{shop.client-WgGVGelc.mjs → shop.client-Brha4BSM.mjs} +11 -10
- package/dist/client/{shop.interactive-Bb67gPLL.mjs → shop.interactive-CXhYl0DW.mjs} +35 -12
- package/dist/client/{shopShared-BE6TEk2A.mjs → shopShared-JCa_SRhP.mjs} +2 -2
- package/dist/client/stable-json-D0XAEIXc.mjs +22 -0
- package/dist/client/{timetableModel-Bbz_ECL5.mjs → timetableModel-CZeJwMxP.mjs} +10 -10
- package/dist/client/{useAvailableSlots-CdP14E_b.mjs → useAvailableSlots-DfbSkWop.mjs} +17 -6
- package/dist/client/{useDiscountApply-DvOSso2l.mjs → useDiscountApply-Dq-wjb1d.mjs} +4 -167
- package/dist/client/{useDiscountCodeUi-B4fRd2jy.mjs → useDiscountCodeUi-Cyy0meCH.mjs} +1 -1
- package/dist/client/{useEventPagination-M3jC8lgP.mjs → useEventPagination-CCAGQHsD.mjs} +5 -5
- package/dist/client/{view-B0TFnP4y.mjs → view-D6yebI4r.mjs} +51 -31
- package/dist/client/{view-DNNNbnNj.mjs → view-Sw075FOY.mjs} +2 -2
- package/dist/preview-next/client/{PageSectionToolbar-D59tHj_L.mjs → PageSectionToolbar-DG2rXUmo.mjs} +26 -19
- package/dist/preview-next/client/{PreviewEditorSidebar-CjOIZlUk.mjs → PreviewEditorSidebar-BDY5vdHU.mjs} +27 -360
- package/dist/preview-next/client/{PreviewEditorUI--kS9Cwsc.mjs → PreviewEditorUI-CqZCfOaz.mjs} +4 -4
- package/dist/preview-next/client/{PreviewShell-Bi8-rclb.mjs → PreviewShell-Bv2HZ7JY.mjs} +7 -7
- package/dist/preview-next/client/{SdkPreviewModeRuntime-CWTUw-3L.mjs → SdkPreviewModeRuntime-BMTcR-MW.mjs} +5 -55
- package/dist/preview-next/client/{SiteChromeCustomizeButton-CrgS3I8d.mjs → SiteChromeCustomizeButton-D1MGyN_Z.mjs} +2668 -799
- package/dist/preview-next/client/{previewAssistantSlot-Caofnr1Z.mjs → previewAssistantSlot-La6MerV_.mjs} +3540 -684
- package/dist/preview-next/client/{previewChromeRoot-CbAI_jSH.mjs → previewChromeRoot-BcOQqJIP.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-DY65_hLk.mjs → sdk-runtime-BkckHox4.mjs} +2 -2
- package/dist/preview-next/client/{useAutosaveStatus-CakNU3lp.mjs → useAutosaveStatus-CPAHgGqI.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-CCEMkosU.mjs → useOpenBlockForSetup-BDkuSZxQ.mjs} +1 -1
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-DsKDQoVW.mjs → route-contract-CPV30ABr.mjs} +48 -0
- package/dist/server/{Block.shared-D7Qy9F4a.mjs → Block.shared-BaMMstO1.mjs} +5 -5
- package/dist/server/{bindings-Bp6OnR3n.mjs → bindings-Dge4sqel.mjs} +4 -4
- package/dist/server/{client-dROAfMRa.mjs → client-VVIQjC4r.mjs} +51 -3
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/{identity-20XHqyuO.mjs → identity-DQD_8lNO.mjs} +1 -1
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-zOIrtqz-.mjs → loadContent-BIJb3WAK.mjs} +5 -6
- package/dist/server/{loadPage-vwFiq1Rk.mjs → loadPage-DjTU19y7.mjs} +2 -2
- package/dist/server/{media-Brn9FW5s.mjs → media-luf7RF22.mjs} +2 -2
- package/dist/server/{navigation-DAwbICEL.mjs → navigation-iC_hXjJI.mjs} +3 -1
- package/dist/server/navigation.mjs +1 -1
- package/dist/server/next.mjs +6 -6
- package/dist/server/{overrideResolution-DjboggbB.mjs → overrideResolution-1Ru3NMQj.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-BR4t1rOw.mjs → pageRenderPlan-CytPhrI9.mjs} +143 -27
- package/dist/server/{pageRuntimeSupport-BKo6XVK-.mjs → pageRuntimeSupport-DWspU5EZ.mjs} +3 -3
- package/dist/server/{pageShared-BJjptSGp.mjs → pageShared-Bhx8bVe1.mjs} +166 -67
- package/dist/server/{parseThemeForPersistence-B18KDEue.mjs → parseThemeForPersistence-CtgRtvo3.mjs} +1 -1
- package/dist/server/{prebuild-CntSkZQI.mjs → prebuild-BjvFb0CA.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-BM9Ds0OQ.mjs → prefetchBlockData-Db3stNpp.mjs} +3 -3
- package/dist/server/{registry-wYH0LH5f.mjs → registry-BMCfcev6.mjs} +809 -191
- 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 +3 -3
- package/dist/server/rendering.mjs +8 -8
- package/dist/server/{resolveBlockData-Bu_p4HxZ.mjs → resolveBlockData--yUbI-Ll.mjs} +1 -1
- package/dist/server/{responseMedia-t6gs0cB7.mjs → responseMedia-DpBC1hTM.mjs} +1 -1
- package/dist/server/{schema-BFOqYIMQ.mjs → schema-D5Vfmqzw.mjs} +394 -1
- package/dist/server/server.mjs +3 -3
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{validation-DAQdPDku.mjs → validation-EgTtnTcY.mjs} +4 -4
- package/dist/server/{version-DAB0O3yx.mjs → version-LjgU0Cq1.mjs} +1 -1
- package/dist/styles/index.css +174 -0
- package/package.json +1 -1
- package/dist/client/runtimeResponse-CPcA8xSm.mjs +0 -3
- package/dist/server/rich-text-CRcONdyM.mjs +0 -33
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { c as unsafeAsMediaAssetId, d as parseUuidBrand, f as err, i as resolveManagedMediaReference, l as unsafeAsStorageBucketName, o as parseCanonicalMediaIdentifier, p as ok$1, u as unsafeAsStoragePath } from "./renderableMediaAssetAdmission-BlfqYLJW.mjs";
|
|
3
|
-
import { $ as externalMediaSchema, A as eyebrowTreatmentValues, Bt as
|
|
4
|
-
import { A as resolveFlexibleBalanceDueAt, C as addIntervalPreservingMonthAnchor, D as getBookingInstalmentPlanIntervalCount, E as getBookingInstalmentDepositRefundability, N as assertNever$2, O as omitZeroAmountFutureRows, P as parseAppointmentServiceId, S as formatCreditProductUnits, a as buildBookingQuestionsSubmission, b as creditProductUnitNoun, d as resolveBookingQuestionsAnswerMode, j as resolveFlexibleBalanceInitialPaymentCents, k as splitAmountWithRemainderInFirst, l as initialBookingQuestionsAnswerMode, p as assertNever$3, t as deriveCreditProductLabels, u as initialBookingQuestionsValues, w as clampConfiguredAmount } from "./creditProducts-BTRX4edc.mjs";
|
|
5
|
-
import {
|
|
3
|
+
import { $ as externalMediaSchema, $t as getBookingLocalDateKey, A as eyebrowTreatmentValues, Bt as formatDateTime, Ct as allocateReductionCents, D as accordionIconSetValues, E as accordionIconMotionValues, F as visibleHeadingDecorationFamilyValues, G as toBookingRequirementConsentField, Gt as inferSiteDateLocale, H as blockBookingConsentSchema, Ht as formatTime$2, Jt as toScheduledBookingDateTime, K as beforeBookingQuestionsPresentationSchema, Kt as resolveBookingDisplayContext, M as headingDecorationOverrideValues, N as isArrangementMode, O as arrangementModes, P as tileTreatmentValues, Q as assetMediaSchema, Rt as formatDate$2, T as accordionIconColorTokenValues, Tt as unsafeAsPositiveCheckoutQuantity, Ut as formatTimeRange, V as blockBookingPaymentTermsSchema, Vt as formatDateTimeRange, Zt as compareLocalScheduleDates, an as toBookingTimeZone, cn as validateBookingPaymentOptionKinds, ct as eventCalendarDefaultViewValues, dn as toNonNegativeCents, dt as eventCalendarListLayoutValues, en as getLocalScheduleDate, et as imageMediaSchema, fn as formatCurrencyAmount, in as resolveBookingTimeZoneId, it as videoMediaSchema, j as headingDecorationColorTokenValues, k as eventListTreatmentValues, lt as eventCalendarDisplayModeValues, n as blockSiteTermsSchema, nn as parseLocalScheduleTime, on as parseUtcIsoDateTimeString, q as bookingQuestionsAnswerValueSchema, rn as resolveBookingBusinessTimeZone, rt as runtimeMediaSchema, sn as toUtcIsoDateTimeString, tt as mediaSchema, wt as normalizeCurrencyCode, zt as formatDateRange } from "./noop-CN0o0yjH.mjs";
|
|
4
|
+
import { A as resolveFlexibleBalanceDueAt, C as addIntervalPreservingMonthAnchor, D as getBookingInstalmentPlanIntervalCount, E as getBookingInstalmentDepositRefundability, N as assertNever$2, O as omitZeroAmountFutureRows, P as parseAppointmentServiceId, S as formatCreditProductUnits, a as buildBookingQuestionsSubmission, b as creditProductUnitNoun, d as resolveBookingQuestionsAnswerMode, j as resolveFlexibleBalanceInitialPaymentCents, k as splitAmountWithRemainderInFirst, l as initialBookingQuestionsAnswerMode, o as checkBookingQuestionsAnswered, p as assertNever$3, t as deriveCreditProductLabels, u as initialBookingQuestionsValues, w as clampConfiguredAmount } from "./creditProducts-BTRX4edc.mjs";
|
|
5
|
+
import { t as stableJsonStringify } from "./stable-json-D0XAEIXc.mjs";
|
|
6
6
|
import { l as buildCalendarViewport$1, n as calendarLinks, r as groupItemsByDate } from "./src-xrjaKaCj.mjs";
|
|
7
|
+
import { Ct as paletteValueKey, Dt as preparePaletteColourIndex, F as defineButtonStyleRecipe, G as mergeStyles, H as backgroundColorStyle, I as mapButtonRoleAppearances, J as textColorStyle, K as rgbColorValue, L as mapButtonVisualAppearances, P as PUBLIC_BUTTON_ROLES, St as resolveOpaqueSurfaceHex, Tt as requirePaletteColorsFromEntries, X as resolveSurfaceForeground, _ as contextualButtonSurfaceResetStyles, _t as surfaceInkDeclarations, a as requireResolvedSurface, b as BUTTON_CONTRAST_POLICY, bt as ownedThemeSnapshot, c as surfaceButtonRequest, d as toAccessibleColorSurfaceIntent, dt as SURFACE_INK_CSS_VARS, ft as surfaceForegroundDeclarations, h as scrimTone, ht as surfaceForegroundValue, i as prepareThemeSurfaceRevision, it as contrastThresholdByPolicy, j as ELEVATION_OFFSET, kt as featuresFromHex, m as minimumScrimOpacity, o as resolveSurface, ot as expandPalette, p as gradientScrimSamples, t as parseResolvedSurface, u as surfaceTransportContext, ut as SURFACE_FOREGROUND_CSS_VARS, wt as paletteValueKeySchema, xt as resolveConcreteColorHex, yt as freezeOwnedThemeValue } from "./accessibleSurfaces-D4DhWo9j.mjs";
|
|
7
8
|
import { C as paletteColorsFromEntries, D as parseThemeColorToken, E as parseColorTokenParts, O as themeColorTokenSchema, S as paletteColorEntries, T as paletteModeSchema, b as isThemeColorToken, c as buttonEffectApplicationSchema, f as buttonVisualStatesSchema, g as VARIANT_ROLES, l as buttonPressOffsetSchema, s as unsafeAsOpaqueButtonColourToken, u as buttonSystemSchema, w as paletteColorsSchema, y as hexColorSchema } from "./types-DjWUR_O6.mjs";
|
|
8
9
|
import { S as clsx } from "./ThemedButton-DuaYtnvG.mjs";
|
|
9
10
|
import { a as getSupabaseUrl, i as getSiteId, n as getCurrentResolveImageUrlContext, r as getMediaAssetIndex } from "./mediaContext-Fusweriw.mjs";
|
|
@@ -1099,6 +1100,279 @@ const checkoutCopy = {
|
|
|
1099
1100
|
checkoutAssistanceRequired: "We can’t confirm your last payment attempt yet. Please don’t pay again – contact the business so they can check it."
|
|
1100
1101
|
};
|
|
1101
1102
|
//#endregion
|
|
1103
|
+
//#region ../commerce/src/purchase/combinationPricing.ts
|
|
1104
|
+
const cents = toNonNegativeCents;
|
|
1105
|
+
const compareText = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
1106
|
+
const compareLine = (a, b) => compareText(a.date, b.date) || compareText(a.lineId, b.lineId);
|
|
1107
|
+
const compareOffer = (a, b) => a.sortOrder - b.sortOrder || compareText(a.id, b.id);
|
|
1108
|
+
const sumPrices = (lines) => lines.reduce((sum, line) => sum + line.unitPriceCents, 0);
|
|
1109
|
+
function application(offer, lines, places) {
|
|
1110
|
+
const ordered = [...lines].sort(compareLine);
|
|
1111
|
+
const savingCents = cents((sumPrices(lines) - offer.priceCents) * places);
|
|
1112
|
+
const allocation = allocateReductionCents(ordered.map((line) => ({
|
|
1113
|
+
lineId: line.lineId,
|
|
1114
|
+
basisCents: cents(line.unitPriceCents * places),
|
|
1115
|
+
maxReducibleCents: cents(line.unitPriceCents * places)
|
|
1116
|
+
})), savingCents);
|
|
1117
|
+
return {
|
|
1118
|
+
offer,
|
|
1119
|
+
lines: ordered,
|
|
1120
|
+
totalCents: cents(offer.priceCents * places),
|
|
1121
|
+
savingCents,
|
|
1122
|
+
allocations: allocation.allocations.map((row, index) => ({
|
|
1123
|
+
lineId: row.lineId,
|
|
1124
|
+
reductionCents: row.amountCents,
|
|
1125
|
+
totalCents: cents((ordered[index]?.unitPriceCents ?? 0) * places - row.amountCents)
|
|
1126
|
+
}))
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
const compareApplication = (a, b) => compareOffer(a.offer, b.offer) || compareText(JSON.stringify(a.lines.map((line) => [line.date, line.lineId])), JSON.stringify(b.lines.map((line) => [line.date, line.lineId])));
|
|
1130
|
+
const saving = (apps) => apps.reduce((sum, app) => sum + app.savingCents, 0);
|
|
1131
|
+
function prefer(a, b) {
|
|
1132
|
+
const money = saving(b) - saving(a);
|
|
1133
|
+
if (money !== 0) return money < 0 ? a : b;
|
|
1134
|
+
if (a.length !== b.length) return a.length < b.length ? a : b;
|
|
1135
|
+
const left = [...a].sort(compareApplication);
|
|
1136
|
+
const right = [...b].sort(compareApplication);
|
|
1137
|
+
const offerDifference = left.map((app, index) => right[index] ? compareOffer(app.offer, right[index].offer) : 0).find((value) => value !== 0) ?? 0;
|
|
1138
|
+
if (offerDifference !== 0) return offerDifference < 0 ? left : right;
|
|
1139
|
+
return (left.map((app, index) => right[index] ? compareApplication(app, right[index]) : 0).find((value) => value !== 0) ?? 0) <= 0 ? left : right;
|
|
1140
|
+
}
|
|
1141
|
+
function cheaperSelection(a, b) {
|
|
1142
|
+
if (!a) return b;
|
|
1143
|
+
if (a.priceCents !== b.priceCents) return a.priceCents < b.priceCents ? a : b;
|
|
1144
|
+
if (a.offers.length !== b.offers.length) return a.offers.length < b.offers.length ? a : b;
|
|
1145
|
+
return (a.offers.map((offer, index) => b.offers[index] ? compareOffer(offer, b.offers[index]) : 0).find((value) => value !== 0) ?? 0) <= 0 ? a : b;
|
|
1146
|
+
}
|
|
1147
|
+
/** Cheapest exact cover of each count, independent of which dates fill it. */
|
|
1148
|
+
function anySelections(count, offers) {
|
|
1149
|
+
const memo = /* @__PURE__ */ new Map([[0, {
|
|
1150
|
+
offers: [],
|
|
1151
|
+
priceCents: 0
|
|
1152
|
+
}]]);
|
|
1153
|
+
const visit = (size) => {
|
|
1154
|
+
if (memo.has(size)) return memo.get(size) ?? null;
|
|
1155
|
+
const best = offers.reduce((best, offer) => {
|
|
1156
|
+
if (offer.itemCount > size) return best;
|
|
1157
|
+
const previous = visit(size - offer.itemCount);
|
|
1158
|
+
return previous ? cheaperSelection(best, {
|
|
1159
|
+
offers: [...previous.offers, offer].sort(compareOffer),
|
|
1160
|
+
priceCents: previous.priceCents + offer.priceCents
|
|
1161
|
+
}) : best;
|
|
1162
|
+
}, null);
|
|
1163
|
+
memo.set(size, best);
|
|
1164
|
+
return best;
|
|
1165
|
+
};
|
|
1166
|
+
return Array.from({ length: count + 1 }, (_, size) => visit(size));
|
|
1167
|
+
}
|
|
1168
|
+
/**
|
|
1169
|
+
* Covering k items always uses the k highest list prices (earliest dates on ties).
|
|
1170
|
+
* Once offer counts are fixed, grouping cannot change the total. A globally best
|
|
1171
|
+
* candidate cannot contain a non-saving group: dropping it would improve the
|
|
1172
|
+
* total or the application-count tie. So canonical date grouping is sufficient.
|
|
1173
|
+
*/
|
|
1174
|
+
function planAny(lines, offers, places) {
|
|
1175
|
+
const ranked = [...lines].sort((a, b) => b.unitPriceCents - a.unitPriceCents || compareLine(a, b));
|
|
1176
|
+
return anySelections(lines.length, offers.filter((offer) => offer.kind === "any")).reduce((best, selected, count) => {
|
|
1177
|
+
if (!selected) return best;
|
|
1178
|
+
const chosen = ranked.slice(0, count).sort(compareLine);
|
|
1179
|
+
const grouped = selected.offers.reduce((state, offer) => {
|
|
1180
|
+
const size = offer.itemCount;
|
|
1181
|
+
const group = chosen.slice(state.offset, state.offset + size);
|
|
1182
|
+
return {
|
|
1183
|
+
offset: state.offset + size,
|
|
1184
|
+
apps: [...state.apps, application(offer, group, places)]
|
|
1185
|
+
};
|
|
1186
|
+
}, {
|
|
1187
|
+
offset: 0,
|
|
1188
|
+
apps: []
|
|
1189
|
+
});
|
|
1190
|
+
return grouped.apps.every((app) => app.savingCents > 0) ? prefer(best, grouped.apps) : best;
|
|
1191
|
+
}, []);
|
|
1192
|
+
}
|
|
1193
|
+
/** Search particular-set subsets; memoised masks collapse different application orders. */
|
|
1194
|
+
function search(input) {
|
|
1195
|
+
const memo = /* @__PURE__ */ new Map();
|
|
1196
|
+
const visit = (mask) => {
|
|
1197
|
+
const cached = memo.get(mask);
|
|
1198
|
+
if (cached) return cached;
|
|
1199
|
+
const remaining = input.lines.filter((_, index) => (mask & 1 << index) !== 0);
|
|
1200
|
+
const best = input.offers.reduce((best, offer) => {
|
|
1201
|
+
if (offer.kind !== "particular") return best;
|
|
1202
|
+
const group = remaining.filter((line) => offer.lineIds.includes(line.lineId));
|
|
1203
|
+
if (group.length !== offer.lineIds.length || sumPrices(group) <= offer.priceCents) return best;
|
|
1204
|
+
const used = input.lines.reduce((bits, line, index) => group.includes(line) ? bits | 1 << index : bits, 0);
|
|
1205
|
+
return prefer(best, [application(offer, group, input.places), ...visit(mask ^ used)]);
|
|
1206
|
+
}, planAny(remaining, input.offers, input.places));
|
|
1207
|
+
memo.set(mask, best);
|
|
1208
|
+
return best;
|
|
1209
|
+
};
|
|
1210
|
+
return visit((1 << input.lines.length) - 1);
|
|
1211
|
+
}
|
|
1212
|
+
function validate(input) {
|
|
1213
|
+
if (input.lines.length > 20 || new Set(input.lines.map((line) => line.lineId)).size !== input.lines.length) throw new Error("Combination pricing requires at most 20 distinct lines");
|
|
1214
|
+
if (input.offers.some((offer) => offer.kind === "any" ? offer.itemCount < 2 : offer.lineIds.length < 2 || new Set(offer.lineIds).size !== offer.lineIds.length)) throw new Error("Combination offers require at least two distinct items");
|
|
1215
|
+
}
|
|
1216
|
+
function planCombinationPrices(input) {
|
|
1217
|
+
validate(input);
|
|
1218
|
+
const applications = [...search(input)].sort(compareApplication);
|
|
1219
|
+
const lines = [...input.lines].sort(compareLine).map((line) => {
|
|
1220
|
+
const allocated = applications.flatMap((app) => app.allocations).find((row) => row.lineId === line.lineId);
|
|
1221
|
+
const listCents = cents(line.unitPriceCents * input.places);
|
|
1222
|
+
return {
|
|
1223
|
+
line,
|
|
1224
|
+
listCents,
|
|
1225
|
+
totalCents: allocated?.totalCents ?? listCents,
|
|
1226
|
+
combined: allocated !== void 0
|
|
1227
|
+
};
|
|
1228
|
+
});
|
|
1229
|
+
return {
|
|
1230
|
+
places: input.places,
|
|
1231
|
+
applications,
|
|
1232
|
+
lines,
|
|
1233
|
+
totalCents: cents(lines.reduce((sum, line) => sum + line.totalCents, 0)),
|
|
1234
|
+
listTotalCents: cents(sumPrices(input.lines) * input.places)
|
|
1235
|
+
};
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* The offers a selection can use, with particular offers mapped from the item
|
|
1239
|
+
* ids they name to this basket's line ids. A particular offer applies only
|
|
1240
|
+
* when every item it names is selected. Which items an offer may cover at all
|
|
1241
|
+
* (fixed-price ones) is decided when offers are stored and published, so the
|
|
1242
|
+
* offers arriving here already exclude ticket types and sliding scales.
|
|
1243
|
+
*/
|
|
1244
|
+
function combinationOffersForSelection(offers, items) {
|
|
1245
|
+
const lineIds = new Map(items.map((item) => [item.itemId, item.lineId]));
|
|
1246
|
+
return offers.flatMap((offer) => {
|
|
1247
|
+
if (offer.kind === "any") return [offer];
|
|
1248
|
+
const selected = offer.lineIds.map((id) => lineIds.get(id));
|
|
1249
|
+
return selected.every((id) => id !== void 0) ? [{
|
|
1250
|
+
...offer,
|
|
1251
|
+
lineIds: selected
|
|
1252
|
+
}] : [];
|
|
1253
|
+
});
|
|
1254
|
+
}
|
|
1255
|
+
/**
|
|
1256
|
+
* Checkout and the booking block price a selection here (issue 1725). Every
|
|
1257
|
+
* item enters at its resolved price, so an item no offer covers (a run with
|
|
1258
|
+
* ticket types next to "Part 1 and Part 2 for £120") stays at the price
|
|
1259
|
+
* chosen for it and still counts in the total.
|
|
1260
|
+
*/
|
|
1261
|
+
function planSelectionCombinationPrices(input) {
|
|
1262
|
+
const plan = planCombinationPrices({
|
|
1263
|
+
lines: input.items.map(({ lineId, date, label, unitPriceCents }) => ({
|
|
1264
|
+
lineId,
|
|
1265
|
+
date,
|
|
1266
|
+
label,
|
|
1267
|
+
unitPriceCents
|
|
1268
|
+
})),
|
|
1269
|
+
offers: combinationOffersForSelection(input.offers, input.items),
|
|
1270
|
+
places: input.places
|
|
1271
|
+
});
|
|
1272
|
+
const uncovered = (input.uncovered ?? []).map(({ line, subtotalCents }) => ({
|
|
1273
|
+
line,
|
|
1274
|
+
listCents: subtotalCents,
|
|
1275
|
+
totalCents: subtotalCents,
|
|
1276
|
+
combined: false
|
|
1277
|
+
}));
|
|
1278
|
+
const extra = uncovered.reduce((sum, row) => sum + row.totalCents, 0);
|
|
1279
|
+
return {
|
|
1280
|
+
...plan,
|
|
1281
|
+
lines: [...plan.lines, ...uncovered],
|
|
1282
|
+
totalCents: cents(plan.totalCents + extra),
|
|
1283
|
+
listTotalCents: cents(plan.listTotalCents + extra)
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
/** One completion per offer, never arbitrary subsets of the available items. */
|
|
1287
|
+
function missingOfferLines(input, offer) {
|
|
1288
|
+
const selected = new Set(input.lines.map((line) => line.lineId));
|
|
1289
|
+
if (offer.kind === "particular") {
|
|
1290
|
+
const missing = offer.lineIds.filter((id) => !selected.has(id));
|
|
1291
|
+
const added = missing.flatMap((id) => input.addable.filter((line) => line.lineId === id));
|
|
1292
|
+
return added.length === missing.length ? added.sort(compareLine) : null;
|
|
1293
|
+
}
|
|
1294
|
+
const count = Math.max(0, offer.itemCount - input.lines.length);
|
|
1295
|
+
return [...input.addable].sort((a, b) => a.unitPriceCents - b.unitPriceCents || compareLine(a, b)).slice(0, count);
|
|
1296
|
+
}
|
|
1297
|
+
function nextCombinationHint(input) {
|
|
1298
|
+
const current = planCombinationPrices(input);
|
|
1299
|
+
const used = new Set(current.applications.map((app) => app.offer.id));
|
|
1300
|
+
return input.offers.filter((offer) => !used.has(offer.id)).flatMap((offer) => {
|
|
1301
|
+
const added = missingOfferLines(input, offer);
|
|
1302
|
+
if (!added?.length || input.lines.length + added.length > 20) return [];
|
|
1303
|
+
const plan = planCombinationPrices({
|
|
1304
|
+
...input,
|
|
1305
|
+
lines: [...input.lines, ...added]
|
|
1306
|
+
});
|
|
1307
|
+
const fresh = plan.applications.find((app) => !used.has(app.offer.id) && app.lines.some((line) => added.some((item) => item.lineId === line.lineId)));
|
|
1308
|
+
return fresh ? [{
|
|
1309
|
+
added,
|
|
1310
|
+
offer: fresh.offer,
|
|
1311
|
+
plan,
|
|
1312
|
+
savingCents: cents(plan.listTotalCents - plan.totalCents)
|
|
1313
|
+
}] : [];
|
|
1314
|
+
}).sort((a, b) => a.added.length - b.added.length || a.plan.totalCents - b.plan.totalCents || compareOffer(a.offer, b.offer))[0] ?? null;
|
|
1315
|
+
}
|
|
1316
|
+
//#endregion
|
|
1317
|
+
//#region ../site-contracts/src/siteData/eventSelection.ts
|
|
1318
|
+
function isHybrid(item) {
|
|
1319
|
+
return item.deliveryMode === "hybrid";
|
|
1320
|
+
}
|
|
1321
|
+
function offeredModes(item) {
|
|
1322
|
+
const delivery = item.deliveryMode ?? "in_person";
|
|
1323
|
+
return delivery === "hybrid" ? (item.attendanceModes ?? []).map((row) => row.mode) : [delivery];
|
|
1324
|
+
}
|
|
1325
|
+
function decideSelectionAttendance(items) {
|
|
1326
|
+
const [first, ...rest] = items;
|
|
1327
|
+
if (!first) return { kind: "none" };
|
|
1328
|
+
const common = rest.reduce((modes, item) => modes.filter((mode) => offeredModes(item).includes(mode)), offeredModes(first));
|
|
1329
|
+
const [only, ...others] = common;
|
|
1330
|
+
if (!items.every(isHybrid)) return only && others.length === 0 ? {
|
|
1331
|
+
kind: "fixed",
|
|
1332
|
+
mode: only
|
|
1333
|
+
} : { kind: "incompatible" };
|
|
1334
|
+
return rest.length > 0 && common.length === 0 ? { kind: "incompatible" } : {
|
|
1335
|
+
kind: "choose",
|
|
1336
|
+
modes: common
|
|
1337
|
+
};
|
|
1338
|
+
}
|
|
1339
|
+
/** The way of attending the booking uses: the fixed one, or the visitor's choice while it's still offered. */
|
|
1340
|
+
function resolveSelectionAttendanceMode(attendance, selected) {
|
|
1341
|
+
switch (attendance.kind) {
|
|
1342
|
+
case "none":
|
|
1343
|
+
case "incompatible": return null;
|
|
1344
|
+
case "fixed": return attendance.mode;
|
|
1345
|
+
case "choose": return selected !== null && attendance.modes.includes(selected) ? selected : null;
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
const INCOMPATIBLE_ATTENDANCE_MESSAGE = "These runs can’t be booked together, because they don’t share a way to attend. Book them one at a time.";
|
|
1349
|
+
//#endregion
|
|
1350
|
+
//#region ../site-contracts/src/siteData/eventSelectionRequirements.ts
|
|
1351
|
+
/** The consent text is its version: attachment IDs alone do not change when copy is edited. */
|
|
1352
|
+
function eventBookingConsentContentKey(consent) {
|
|
1353
|
+
return stableJsonStringify({
|
|
1354
|
+
title: consent.title,
|
|
1355
|
+
agreement: consent.agreement,
|
|
1356
|
+
checkboxLabel: consent.checkboxLabel
|
|
1357
|
+
});
|
|
1358
|
+
}
|
|
1359
|
+
/** Unavailable or older question payloads cannot prove that sharing is safe. */
|
|
1360
|
+
function areEventBookingRequirementsIdentical(requirements) {
|
|
1361
|
+
const keys = requirements.map(requirementsKey);
|
|
1362
|
+
const first = keys[0];
|
|
1363
|
+
return first !== void 0 && first !== null && keys.every((key) => key === first);
|
|
1364
|
+
}
|
|
1365
|
+
function requirementsKey(view) {
|
|
1366
|
+
const questions = view.bookingQuestions;
|
|
1367
|
+
if (questions.kind === "unavailable") return null;
|
|
1368
|
+
const questionKey = questions.kind === "none" ? null : questions.set.sharingKey;
|
|
1369
|
+
if (questionKey === void 0) return null;
|
|
1370
|
+
return stableJsonStringify({
|
|
1371
|
+
consent: view.consent ? eventBookingConsentContentKey(view.consent) : null,
|
|
1372
|
+
questions: questionKey
|
|
1373
|
+
});
|
|
1374
|
+
}
|
|
1375
|
+
//#endregion
|
|
1102
1376
|
//#region ../media-core/src/fileSafety.ts
|
|
1103
1377
|
const CONTROL_CHARACTER_PATTERN = /[\u0000-\u001f\u007f]/u;
|
|
1104
1378
|
function containsUnsafePathSegmentCharacter(value) {
|
|
@@ -2153,6 +2427,398 @@ const gradientsSchema = z.object({
|
|
|
2153
2427
|
background: z.string().min(1).nullable().optional()
|
|
2154
2428
|
});
|
|
2155
2429
|
//#endregion
|
|
2430
|
+
//#region ../site-contracts/src/theme/bodyFontFamilies.generated.ts
|
|
2431
|
+
const bodyFontFamilies = [
|
|
2432
|
+
"AR One Sans",
|
|
2433
|
+
"Abhaya Libre",
|
|
2434
|
+
"Advent Pro",
|
|
2435
|
+
"Afacad",
|
|
2436
|
+
"Afacad Flux",
|
|
2437
|
+
"Agdasima",
|
|
2438
|
+
"Akatab",
|
|
2439
|
+
"Akshar",
|
|
2440
|
+
"Albert Sans",
|
|
2441
|
+
"Alef",
|
|
2442
|
+
"Alegreya",
|
|
2443
|
+
"Alegreya Sans",
|
|
2444
|
+
"Aleo",
|
|
2445
|
+
"Alexandria",
|
|
2446
|
+
"Almarai",
|
|
2447
|
+
"Alumni Sans",
|
|
2448
|
+
"Amaranth",
|
|
2449
|
+
"Amiko",
|
|
2450
|
+
"Amiri",
|
|
2451
|
+
"Anaheim",
|
|
2452
|
+
"Andada Pro",
|
|
2453
|
+
"Andika",
|
|
2454
|
+
"Anek Bangla",
|
|
2455
|
+
"Anek Latin",
|
|
2456
|
+
"Anek Telugu",
|
|
2457
|
+
"Anuphan",
|
|
2458
|
+
"Archivo",
|
|
2459
|
+
"Aref Ruqaa",
|
|
2460
|
+
"Arimo",
|
|
2461
|
+
"Arsenal",
|
|
2462
|
+
"Arvo",
|
|
2463
|
+
"Asap",
|
|
2464
|
+
"Asap Sharp",
|
|
2465
|
+
"Assistant",
|
|
2466
|
+
"Asul",
|
|
2467
|
+
"Athiti",
|
|
2468
|
+
"Atkinson Hyperlegible",
|
|
2469
|
+
"Atkinson Hyperlegible Next",
|
|
2470
|
+
"B612",
|
|
2471
|
+
"BIZ UDGothic",
|
|
2472
|
+
"BIZ UDMincho",
|
|
2473
|
+
"BIZ UDPGothic",
|
|
2474
|
+
"BIZ UDPMincho",
|
|
2475
|
+
"Bai Jamjuree",
|
|
2476
|
+
"Barlow",
|
|
2477
|
+
"Baskervville",
|
|
2478
|
+
"Be Vietnam Pro",
|
|
2479
|
+
"Belanosima",
|
|
2480
|
+
"BenchNine",
|
|
2481
|
+
"Besley",
|
|
2482
|
+
"BioRhyme",
|
|
2483
|
+
"Biryani",
|
|
2484
|
+
"Bitter",
|
|
2485
|
+
"Blinker",
|
|
2486
|
+
"Bodoni Moda",
|
|
2487
|
+
"Bona Nova",
|
|
2488
|
+
"Bricolage Grotesque",
|
|
2489
|
+
"Brygada 1918",
|
|
2490
|
+
"Buenard",
|
|
2491
|
+
"Cabin",
|
|
2492
|
+
"Cairo",
|
|
2493
|
+
"Caladea",
|
|
2494
|
+
"Cambay",
|
|
2495
|
+
"Cantarell",
|
|
2496
|
+
"Cardo",
|
|
2497
|
+
"Carlito",
|
|
2498
|
+
"Castoro",
|
|
2499
|
+
"Catamaran",
|
|
2500
|
+
"Caudex",
|
|
2501
|
+
"Changa",
|
|
2502
|
+
"Charis SIL",
|
|
2503
|
+
"Chiron GoRound TC",
|
|
2504
|
+
"Chivo",
|
|
2505
|
+
"Commissioner",
|
|
2506
|
+
"Cormorant",
|
|
2507
|
+
"Cormorant Garamond",
|
|
2508
|
+
"Cormorant Infant",
|
|
2509
|
+
"Cormorant Upright",
|
|
2510
|
+
"Crimson Pro",
|
|
2511
|
+
"Crimson Text",
|
|
2512
|
+
"Cuprum",
|
|
2513
|
+
"DM Sans",
|
|
2514
|
+
"Darker Grotesque",
|
|
2515
|
+
"David Libre",
|
|
2516
|
+
"Domine",
|
|
2517
|
+
"Dongle",
|
|
2518
|
+
"Dosis",
|
|
2519
|
+
"EB Garamond",
|
|
2520
|
+
"Economica",
|
|
2521
|
+
"Eczar",
|
|
2522
|
+
"El Messiri",
|
|
2523
|
+
"Elms Sans",
|
|
2524
|
+
"Encode Sans",
|
|
2525
|
+
"Encode Sans Expanded",
|
|
2526
|
+
"Encode Sans Semi Expanded",
|
|
2527
|
+
"Enriqueta",
|
|
2528
|
+
"Epilogue",
|
|
2529
|
+
"Estedad",
|
|
2530
|
+
"Exo",
|
|
2531
|
+
"Exo 2",
|
|
2532
|
+
"Fahkwang",
|
|
2533
|
+
"Familjen Grotesk",
|
|
2534
|
+
"Farro",
|
|
2535
|
+
"Faustina",
|
|
2536
|
+
"Figtree",
|
|
2537
|
+
"Finlandica Text",
|
|
2538
|
+
"Fira Sans",
|
|
2539
|
+
"Frank Ruhl Libre",
|
|
2540
|
+
"Fraunces",
|
|
2541
|
+
"Fredoka",
|
|
2542
|
+
"Funnel Sans",
|
|
2543
|
+
"Fustat",
|
|
2544
|
+
"Gantari",
|
|
2545
|
+
"Gayathri",
|
|
2546
|
+
"Geist",
|
|
2547
|
+
"Gelasio",
|
|
2548
|
+
"Gentium Book Plus",
|
|
2549
|
+
"Gentium Plus",
|
|
2550
|
+
"Geologica",
|
|
2551
|
+
"Geom",
|
|
2552
|
+
"Georama",
|
|
2553
|
+
"Glegoo",
|
|
2554
|
+
"Glory",
|
|
2555
|
+
"Golos Text",
|
|
2556
|
+
"Google Sans",
|
|
2557
|
+
"Google Sans Flex",
|
|
2558
|
+
"Gothic A1",
|
|
2559
|
+
"Gowun Batang",
|
|
2560
|
+
"Gudea",
|
|
2561
|
+
"Halant",
|
|
2562
|
+
"Hanken Grotesk",
|
|
2563
|
+
"Hanuman",
|
|
2564
|
+
"Heebo",
|
|
2565
|
+
"Hepta Slab",
|
|
2566
|
+
"Hind",
|
|
2567
|
+
"Hind Guntur",
|
|
2568
|
+
"Hind Madurai",
|
|
2569
|
+
"Hind Siliguri",
|
|
2570
|
+
"Hind Vadodara",
|
|
2571
|
+
"Host Grotesk",
|
|
2572
|
+
"IBM Plex Sans",
|
|
2573
|
+
"IBM Plex Sans Arabic",
|
|
2574
|
+
"IBM Plex Sans Hebrew",
|
|
2575
|
+
"IBM Plex Sans JP",
|
|
2576
|
+
"IBM Plex Sans KR",
|
|
2577
|
+
"IBM Plex Sans Thai",
|
|
2578
|
+
"IBM Plex Sans Thai Looped",
|
|
2579
|
+
"IBM Plex Serif",
|
|
2580
|
+
"Ibarra Real Nova",
|
|
2581
|
+
"Inclusive Sans",
|
|
2582
|
+
"Inknut Antiqua",
|
|
2583
|
+
"Inria Sans",
|
|
2584
|
+
"Inria Serif",
|
|
2585
|
+
"Instrument Sans",
|
|
2586
|
+
"Inter",
|
|
2587
|
+
"Inter Tight",
|
|
2588
|
+
"Istok Web",
|
|
2589
|
+
"Josefin Sans",
|
|
2590
|
+
"Jost",
|
|
2591
|
+
"Jura",
|
|
2592
|
+
"K2D",
|
|
2593
|
+
"Kaisei Decol",
|
|
2594
|
+
"Kaisei Opti",
|
|
2595
|
+
"Kalnia",
|
|
2596
|
+
"Kameron",
|
|
2597
|
+
"Kanit",
|
|
2598
|
+
"Kantumruy Pro",
|
|
2599
|
+
"Karla",
|
|
2600
|
+
"Karma",
|
|
2601
|
+
"Khula",
|
|
2602
|
+
"KoHo",
|
|
2603
|
+
"Kreon",
|
|
2604
|
+
"Krub",
|
|
2605
|
+
"Kumbh Sans",
|
|
2606
|
+
"LINE Seed JP",
|
|
2607
|
+
"Laila",
|
|
2608
|
+
"Lateef",
|
|
2609
|
+
"Lato",
|
|
2610
|
+
"League Spartan",
|
|
2611
|
+
"Lexend",
|
|
2612
|
+
"Lexend Deca",
|
|
2613
|
+
"Lexend Exa",
|
|
2614
|
+
"Lexend Giga",
|
|
2615
|
+
"Lexend Mega",
|
|
2616
|
+
"Lexend Zetta",
|
|
2617
|
+
"Libertinus Sans",
|
|
2618
|
+
"Libre Baskerville",
|
|
2619
|
+
"Libre Bodoni",
|
|
2620
|
+
"Libre Caslon Text",
|
|
2621
|
+
"Libre Franklin",
|
|
2622
|
+
"Literata",
|
|
2623
|
+
"Livvic",
|
|
2624
|
+
"Lora",
|
|
2625
|
+
"Lusitana",
|
|
2626
|
+
"M PLUS 1",
|
|
2627
|
+
"M PLUS 1p",
|
|
2628
|
+
"M PLUS 2",
|
|
2629
|
+
"M PLUS Rounded 1c",
|
|
2630
|
+
"Mada",
|
|
2631
|
+
"Maitree",
|
|
2632
|
+
"Manrope",
|
|
2633
|
+
"Markazi Text",
|
|
2634
|
+
"Martel",
|
|
2635
|
+
"Martel Sans",
|
|
2636
|
+
"Marvel",
|
|
2637
|
+
"Maven Pro",
|
|
2638
|
+
"Menbere",
|
|
2639
|
+
"Merriweather",
|
|
2640
|
+
"Merriweather Sans",
|
|
2641
|
+
"Mina",
|
|
2642
|
+
"Miriam Libre",
|
|
2643
|
+
"Mitr",
|
|
2644
|
+
"Moderustic",
|
|
2645
|
+
"Mona Sans",
|
|
2646
|
+
"Monda",
|
|
2647
|
+
"Montagu Slab",
|
|
2648
|
+
"Montserrat",
|
|
2649
|
+
"Montserrat Underline",
|
|
2650
|
+
"Mozilla Headline",
|
|
2651
|
+
"Mozilla Text",
|
|
2652
|
+
"Mukta",
|
|
2653
|
+
"Mukta Malar",
|
|
2654
|
+
"Mukta Vaani",
|
|
2655
|
+
"Mulish",
|
|
2656
|
+
"Murecho",
|
|
2657
|
+
"Nanum Gothic",
|
|
2658
|
+
"Nanum Myeongjo",
|
|
2659
|
+
"Neuton",
|
|
2660
|
+
"News Cycle",
|
|
2661
|
+
"Newsreader",
|
|
2662
|
+
"Niramit",
|
|
2663
|
+
"Nokora",
|
|
2664
|
+
"Noticia Text",
|
|
2665
|
+
"Noto Emoji",
|
|
2666
|
+
"Noto Kufi Arabic",
|
|
2667
|
+
"Noto Naskh Arabic",
|
|
2668
|
+
"Noto Nastaliq Urdu",
|
|
2669
|
+
"Noto Sans",
|
|
2670
|
+
"Noto Sans Arabic",
|
|
2671
|
+
"Noto Sans Armenian",
|
|
2672
|
+
"Noto Sans Bengali",
|
|
2673
|
+
"Noto Sans Devanagari",
|
|
2674
|
+
"Noto Sans Duployan",
|
|
2675
|
+
"Noto Sans Georgian",
|
|
2676
|
+
"Noto Sans Gujarati",
|
|
2677
|
+
"Noto Sans Gurmukhi",
|
|
2678
|
+
"Noto Sans HK",
|
|
2679
|
+
"Noto Sans Hebrew",
|
|
2680
|
+
"Noto Sans JP",
|
|
2681
|
+
"Noto Sans KR",
|
|
2682
|
+
"Noto Sans Kannada",
|
|
2683
|
+
"Noto Sans Khmer",
|
|
2684
|
+
"Noto Sans Malayalam",
|
|
2685
|
+
"Noto Sans Meetei Mayek",
|
|
2686
|
+
"Noto Sans Mono",
|
|
2687
|
+
"Noto Sans Myanmar",
|
|
2688
|
+
"Noto Sans Ol Chiki",
|
|
2689
|
+
"Noto Sans Oriya",
|
|
2690
|
+
"Noto Sans Sinhala",
|
|
2691
|
+
"Noto Sans Sundanese",
|
|
2692
|
+
"Noto Sans Symbols",
|
|
2693
|
+
"Noto Sans TC",
|
|
2694
|
+
"Noto Sans Tamil",
|
|
2695
|
+
"Noto Sans Telugu",
|
|
2696
|
+
"Noto Sans Thai",
|
|
2697
|
+
"Noto Sans Thai Looped",
|
|
2698
|
+
"Noto Serif",
|
|
2699
|
+
"Noto Serif Bengali",
|
|
2700
|
+
"Noto Serif Devanagari",
|
|
2701
|
+
"Noto Serif Georgian",
|
|
2702
|
+
"Noto Serif JP",
|
|
2703
|
+
"Noto Serif KR",
|
|
2704
|
+
"Noto Serif Malayalam",
|
|
2705
|
+
"Noto Serif TC",
|
|
2706
|
+
"Noto Serif Tamil",
|
|
2707
|
+
"Noto Serif Thai",
|
|
2708
|
+
"Nunito",
|
|
2709
|
+
"Nunito Sans",
|
|
2710
|
+
"Ojuju",
|
|
2711
|
+
"Old Standard TT",
|
|
2712
|
+
"Onest",
|
|
2713
|
+
"Open Sans",
|
|
2714
|
+
"Outfit",
|
|
2715
|
+
"Overpass",
|
|
2716
|
+
"Oxygen",
|
|
2717
|
+
"PT Sans",
|
|
2718
|
+
"PT Sans Caption",
|
|
2719
|
+
"PT Serif",
|
|
2720
|
+
"Padauk",
|
|
2721
|
+
"Palanquin",
|
|
2722
|
+
"Palanquin Dark",
|
|
2723
|
+
"Parkinsans",
|
|
2724
|
+
"Petrona",
|
|
2725
|
+
"Philosopher",
|
|
2726
|
+
"Piazzolla",
|
|
2727
|
+
"Platypi",
|
|
2728
|
+
"Play",
|
|
2729
|
+
"Playfair",
|
|
2730
|
+
"Plus Jakarta Sans",
|
|
2731
|
+
"Podkova",
|
|
2732
|
+
"Pontano Sans",
|
|
2733
|
+
"Poppins",
|
|
2734
|
+
"Pridi",
|
|
2735
|
+
"Prompt",
|
|
2736
|
+
"Proza Libre",
|
|
2737
|
+
"Public Sans",
|
|
2738
|
+
"Quattrocento",
|
|
2739
|
+
"Quattrocento Sans",
|
|
2740
|
+
"Quicksand",
|
|
2741
|
+
"REM",
|
|
2742
|
+
"Radio Canada",
|
|
2743
|
+
"Radio Canada Big",
|
|
2744
|
+
"Raleway",
|
|
2745
|
+
"Rasa",
|
|
2746
|
+
"Readex Pro",
|
|
2747
|
+
"Recursive",
|
|
2748
|
+
"Red Hat Text",
|
|
2749
|
+
"Reddit Sans",
|
|
2750
|
+
"Reem Kufi",
|
|
2751
|
+
"Rethink Sans",
|
|
2752
|
+
"Roboto",
|
|
2753
|
+
"Roboto Serif",
|
|
2754
|
+
"Roboto Slab",
|
|
2755
|
+
"Rokkitt",
|
|
2756
|
+
"Rosario",
|
|
2757
|
+
"Rubik",
|
|
2758
|
+
"Ruda",
|
|
2759
|
+
"Rufina",
|
|
2760
|
+
"Ruwudu",
|
|
2761
|
+
"STIX Two Text",
|
|
2762
|
+
"Saira",
|
|
2763
|
+
"Sansita",
|
|
2764
|
+
"Sarabun",
|
|
2765
|
+
"Sarala",
|
|
2766
|
+
"Scada",
|
|
2767
|
+
"Schibsted Grotesk",
|
|
2768
|
+
"Sen",
|
|
2769
|
+
"Share",
|
|
2770
|
+
"Shippori Mincho",
|
|
2771
|
+
"Shippori Mincho B1",
|
|
2772
|
+
"Signika",
|
|
2773
|
+
"Signika Negative",
|
|
2774
|
+
"Sintony",
|
|
2775
|
+
"Sofia Sans",
|
|
2776
|
+
"Solway",
|
|
2777
|
+
"Sora",
|
|
2778
|
+
"Sour Gummy",
|
|
2779
|
+
"Source Sans 3",
|
|
2780
|
+
"Source Serif 4",
|
|
2781
|
+
"Space Grotesk",
|
|
2782
|
+
"Special Gothic",
|
|
2783
|
+
"Spectral",
|
|
2784
|
+
"Spline Sans",
|
|
2785
|
+
"Sulphur Point",
|
|
2786
|
+
"Sumana",
|
|
2787
|
+
"Sura",
|
|
2788
|
+
"Syne",
|
|
2789
|
+
"TASA Orbiter",
|
|
2790
|
+
"Tajawal",
|
|
2791
|
+
"Taviraj",
|
|
2792
|
+
"TikTok Sans",
|
|
2793
|
+
"Tinos",
|
|
2794
|
+
"Titillium Web",
|
|
2795
|
+
"Trirong",
|
|
2796
|
+
"Trispace",
|
|
2797
|
+
"Ubuntu",
|
|
2798
|
+
"Ubuntu Sans",
|
|
2799
|
+
"Unbounded",
|
|
2800
|
+
"Unna",
|
|
2801
|
+
"Urbanist",
|
|
2802
|
+
"Vazirmatn",
|
|
2803
|
+
"Vesper Libre",
|
|
2804
|
+
"Volkhov",
|
|
2805
|
+
"Vollkorn",
|
|
2806
|
+
"Wix Madefor Text",
|
|
2807
|
+
"Work Sans",
|
|
2808
|
+
"Xmind",
|
|
2809
|
+
"Yanone Kaffeesatz",
|
|
2810
|
+
"Yantramanav",
|
|
2811
|
+
"Yrsa",
|
|
2812
|
+
"Ysabeau",
|
|
2813
|
+
"Zalando Sans",
|
|
2814
|
+
"Zalando Sans SemiExpanded",
|
|
2815
|
+
"Zen Kaku Gothic Antique",
|
|
2816
|
+
"Zen Kaku Gothic New",
|
|
2817
|
+
"Zen Maru Gothic",
|
|
2818
|
+
"Zen Old Mincho",
|
|
2819
|
+
"Zilla Slab"
|
|
2820
|
+
];
|
|
2821
|
+
//#endregion
|
|
2156
2822
|
//#region ../site-contracts/src/theme/fonts.ts
|
|
2157
2823
|
const fontWeightListSchema = z.array(z.number().int().min(100).max(900));
|
|
2158
2824
|
const fontLoadingSchema = z.object({
|
|
@@ -2176,6 +2842,7 @@ const curatedFontWidths = {
|
|
|
2176
2842
|
function getFontWidthRange(family) {
|
|
2177
2843
|
return curatedFontWidths[(family.split(",")[0] ?? "").trim().replace(/^["']|["']$/g, "")];
|
|
2178
2844
|
}
|
|
2845
|
+
new Set(bodyFontFamilies.map((family) => family.toLocaleLowerCase()));
|
|
2179
2846
|
//#endregion
|
|
2180
2847
|
//#region ../site-contracts/src/theme/typography.ts
|
|
2181
2848
|
const typographyStyleSchema = z.object({
|
|
@@ -27622,14 +28289,16 @@ function sessionFingerprint(identity) {
|
|
|
27622
28289
|
const pass = (seed) => codes.reduce((hash, code) => Math.imul(hash ^ code, 16777619) >>> 0, seed).toString(16).padStart(8, "0");
|
|
27623
28290
|
return `${pass(2166136261)}${pass(84696351)}`;
|
|
27624
28291
|
}
|
|
27625
|
-
|
|
28292
|
+
/** Whose saved answers (or agreement) these are, for the current portal identity. */
|
|
28293
|
+
function bookingQuestionsOwnerOf(identity) {
|
|
27626
28294
|
return identity === null ? { kind: "signed_out" } : {
|
|
27627
28295
|
kind: "session",
|
|
27628
28296
|
fingerprint: sessionFingerprint(identity)
|
|
27629
28297
|
};
|
|
27630
28298
|
}
|
|
27631
|
-
|
|
27632
|
-
|
|
28299
|
+
/** Whether something saved for `owner` belongs to the current portal identity. */
|
|
28300
|
+
function isBookingQuestionsOwner(owner, identity) {
|
|
28301
|
+
const current = bookingQuestionsOwnerOf(identity);
|
|
27633
28302
|
if (current.kind === "signed_out") return owner.kind === "signed_out";
|
|
27634
28303
|
return owner.kind === "session" && owner.fingerprint === current.fingerprint;
|
|
27635
28304
|
}
|
|
@@ -27641,7 +28310,7 @@ const bookingQuestionsAnswerDraftSchema = z.object({
|
|
|
27641
28310
|
});
|
|
27642
28311
|
function toBookingQuestionsAnswerDraft(state) {
|
|
27643
28312
|
return {
|
|
27644
|
-
owner:
|
|
28313
|
+
owner: bookingQuestionsOwnerOf(state.scope?.identity ?? null),
|
|
27645
28314
|
requirementId: state.scope?.requirementId ?? null,
|
|
27646
28315
|
edits: state.edits,
|
|
27647
28316
|
answerMode: state.answerMode
|
|
@@ -27660,7 +28329,7 @@ function toBookingQuestionsPaymentSnapshot(view) {
|
|
|
27660
28329
|
const { submission } = view;
|
|
27661
28330
|
if (!submission) return void 0;
|
|
27662
28331
|
return {
|
|
27663
|
-
owner:
|
|
28332
|
+
owner: bookingQuestionsOwnerOf(view.scope.identity),
|
|
27664
28333
|
requirementId: submission.requirementId,
|
|
27665
28334
|
answers: submission.kind === "keep_existing" ? { kind: "keep_existing" } : {
|
|
27666
28335
|
kind: "answers",
|
|
@@ -27675,7 +28344,7 @@ function decided(restoration) {
|
|
|
27675
28344
|
function decideBookingQuestionsRestoration(source) {
|
|
27676
28345
|
if (source.kind === "sign_in_draft") {
|
|
27677
28346
|
const { draft, verifiedIdentity } = source;
|
|
27678
|
-
if (draft.owner.kind === "session" && !
|
|
28347
|
+
if (draft.owner.kind === "session" && !isBookingQuestionsOwner(draft.owner, verifiedIdentity)) return null;
|
|
27679
28348
|
return decided({
|
|
27680
28349
|
scope: {
|
|
27681
28350
|
identity: verifiedIdentity,
|
|
@@ -27686,7 +28355,7 @@ function decideBookingQuestionsRestoration(source) {
|
|
|
27686
28355
|
});
|
|
27687
28356
|
}
|
|
27688
28357
|
const { snapshot, currentIdentity } = source;
|
|
27689
|
-
if (!
|
|
28358
|
+
if (!isBookingQuestionsOwner(snapshot.owner, currentIdentity)) return null;
|
|
27690
28359
|
const scope = {
|
|
27691
28360
|
identity: currentIdentity,
|
|
27692
28361
|
requirementId: snapshot.requirementId
|
|
@@ -30685,292 +31354,6 @@ function readSignInReturn(location) {
|
|
|
30685
31354
|
};
|
|
30686
31355
|
}
|
|
30687
31356
|
//#endregion
|
|
30688
|
-
//#region ../blocks/src/system/runtime/nodes/event-registration/registrationSignInReturn.ts
|
|
30689
|
-
/**
|
|
30690
|
-
* What event registration keeps while the booker follows a sign-in link, so
|
|
30691
|
-
* they come back to the same step with what they'd typed. The storage, nonce
|
|
30692
|
-
* and return address are shared with the appointment booking form
|
|
30693
|
-
* (`shared/signInReturnDrafts.ts`, owned by `useSignInReturn`); this file owns
|
|
30694
|
-
* the event draft and how it's put back.
|
|
30695
|
-
*/
|
|
30696
|
-
/** Steps a draft can bring the booker back to; payment and later are never resumed this way. */
|
|
30697
|
-
const RESUMABLE_STEPS = [
|
|
30698
|
-
"select-event",
|
|
30699
|
-
"select-tickets",
|
|
30700
|
-
"enter-details",
|
|
30701
|
-
"select-payment"
|
|
30702
|
-
];
|
|
30703
|
-
/** Event registration's drafts, for the shared `useSignInReturn` owner. */
|
|
30704
|
-
const eventSignInDraftStore = createSignInReturnDraftStore(z.object({
|
|
30705
|
-
nonce: z.string().min(1),
|
|
30706
|
-
email: z.string(),
|
|
30707
|
-
step: z.enum(RESUMABLE_STEPS),
|
|
30708
|
-
selectedEventId: z.string().nullable(),
|
|
30709
|
-
selectedAttendanceMode: z.enum(["in_person", "online"]).nullable(),
|
|
30710
|
-
ticketSelections: z.array(z.object({
|
|
30711
|
-
pricingOptionId: z.string().nullable(),
|
|
30712
|
-
quantity: z.number().int().positive()
|
|
30713
|
-
})),
|
|
30714
|
-
ticketsCount: z.number().int().positive(),
|
|
30715
|
-
selectedSlidingAmountInput: z.string(),
|
|
30716
|
-
formData: z.object({
|
|
30717
|
-
name: z.string(),
|
|
30718
|
-
email: z.string(),
|
|
30719
|
-
phone: z.string(),
|
|
30720
|
-
notes: z.string(),
|
|
30721
|
-
mailingListOptIn: z.boolean().optional()
|
|
30722
|
-
}),
|
|
30723
|
-
guests: z.array(z.object({
|
|
30724
|
-
name: z.string(),
|
|
30725
|
-
email: z.string().nullable(),
|
|
30726
|
-
phone: z.string().nullable()
|
|
30727
|
-
})),
|
|
30728
|
-
discountCode: z.string(),
|
|
30729
|
-
questions: bookingQuestionsAnswerDraftSchema
|
|
30730
|
-
}));
|
|
30731
|
-
/** The flow's key in sign-in storage: one registration surface per page. */
|
|
30732
|
-
const EVENT_SIGN_IN_FORM_ID = "event-registration";
|
|
30733
|
-
function resumableStep(step) {
|
|
30734
|
-
return RESUMABLE_STEPS.includes(step) ? step : "enter-details";
|
|
30735
|
-
}
|
|
30736
|
-
function toEventSignInDraft(source, attempt) {
|
|
30737
|
-
const { flow } = source;
|
|
30738
|
-
const { draft } = flow;
|
|
30739
|
-
const { consentAccepted: _consent, ...formData } = draft.formData;
|
|
30740
|
-
return {
|
|
30741
|
-
nonce: attempt.nonce,
|
|
30742
|
-
email: attempt.email,
|
|
30743
|
-
step: resumableStep(flow.step),
|
|
30744
|
-
selectedEventId: draft.selectedEvent?.selectionId ?? null,
|
|
30745
|
-
selectedAttendanceMode: draft.selectedAttendanceMode,
|
|
30746
|
-
ticketSelections: draft.selectedTicketLines,
|
|
30747
|
-
ticketsCount: flow.ticketsCount,
|
|
30748
|
-
selectedSlidingAmountInput: draft.selectedSlidingAmountInput,
|
|
30749
|
-
formData,
|
|
30750
|
-
guests: draft.guests,
|
|
30751
|
-
discountCode: source.discountCode,
|
|
30752
|
-
questions: toBookingQuestionsAnswerDraft(draft.bookingQuestions)
|
|
30753
|
-
};
|
|
30754
|
-
}
|
|
30755
|
-
const HANDED_ON = [
|
|
30756
|
-
"success",
|
|
30757
|
-
"payment",
|
|
30758
|
-
"verifying-payment",
|
|
30759
|
-
"verifying-timeout",
|
|
30760
|
-
"payment-status"
|
|
30761
|
-
];
|
|
30762
|
-
/**
|
|
30763
|
-
* A booking that's confirmed or has gone to checkout ends every draft. Picking
|
|
30764
|
-
* another event doesn't: the draft follows what the booker is doing.
|
|
30765
|
-
*/
|
|
30766
|
-
function eventSignInEnds(previous, next) {
|
|
30767
|
-
return HANDED_ON.includes(next.flow.step) && !HANDED_ON.includes(previous.flow.step) ? "finished" : null;
|
|
30768
|
-
}
|
|
30769
|
-
/**
|
|
30770
|
-
* How a returned draft lands once `useSignInReturn` has matched it to the
|
|
30771
|
-
* signed-in profile and the page's events have loaded.
|
|
30772
|
-
*/
|
|
30773
|
-
function eventSignInRestoration(draft, events, verifiedIdentity) {
|
|
30774
|
-
const event = draft.selectedEventId === null ? null : events.find((candidate) => candidate.selectionId === draft.selectedEventId) ?? null;
|
|
30775
|
-
return {
|
|
30776
|
-
draft,
|
|
30777
|
-
event,
|
|
30778
|
-
selectionFound: draft.selectedEventId === null || event !== null,
|
|
30779
|
-
questions: decideBookingQuestionsRestoration({
|
|
30780
|
-
kind: "sign_in_draft",
|
|
30781
|
-
draft: draft.questions,
|
|
30782
|
-
verifiedIdentity
|
|
30783
|
-
})
|
|
30784
|
-
};
|
|
30785
|
-
}
|
|
30786
|
-
/**
|
|
30787
|
-
* Puts the booker's draft back. Details and answers always return; the event
|
|
30788
|
-
* choice, tickets and step only when that event is still offered and no
|
|
30789
|
-
* waiting-list invitation owns the selection.
|
|
30790
|
-
*/
|
|
30791
|
-
/** What the booker typed comes back; a blank field never erases details already filled in. */
|
|
30792
|
-
function restoredFormData(current, saved) {
|
|
30793
|
-
const typed = Object.fromEntries(Object.entries(saved).filter(([, value]) => typeof value !== "string" || value.trim() !== ""));
|
|
30794
|
-
return {
|
|
30795
|
-
...current,
|
|
30796
|
-
...typed,
|
|
30797
|
-
consentAccepted: false
|
|
30798
|
-
};
|
|
30799
|
-
}
|
|
30800
|
-
function restoreEventSignInDraft(state, restoration) {
|
|
30801
|
-
const { draft } = restoration;
|
|
30802
|
-
const details = {
|
|
30803
|
-
...state.draft,
|
|
30804
|
-
formData: restoredFormData(state.draft.formData, draft.formData),
|
|
30805
|
-
guests: draft.guests.map((guest) => ({ ...guest })),
|
|
30806
|
-
bookingQuestions: restoreBookingQuestionsAnswers(state.draft.bookingQuestions, restoration.questions)
|
|
30807
|
-
};
|
|
30808
|
-
if (!restoration.selectionFound || state.invitation.kind !== "none") return {
|
|
30809
|
-
...state,
|
|
30810
|
-
draft: details
|
|
30811
|
-
};
|
|
30812
|
-
return {
|
|
30813
|
-
...state,
|
|
30814
|
-
step: draft.step,
|
|
30815
|
-
ticketsCount: draft.ticketsCount,
|
|
30816
|
-
draft: {
|
|
30817
|
-
...details,
|
|
30818
|
-
selectedEvent: restoration.event ?? state.draft.selectedEvent,
|
|
30819
|
-
selectedAttendanceMode: draft.selectedAttendanceMode,
|
|
30820
|
-
selectedTicketLines: draft.ticketSelections.map((line) => ({ ...line })),
|
|
30821
|
-
selectedSlidingAmountInput: draft.selectedSlidingAmountInput
|
|
30822
|
-
}
|
|
30823
|
-
};
|
|
30824
|
-
}
|
|
30825
|
-
//#endregion
|
|
30826
|
-
//#region ../blocks/src/system/runtime/shared/bookingPaymentOptionCopy.ts
|
|
30827
|
-
function buildUpfrontBookingPaymentOptionCopy(formattedTotal) {
|
|
30828
|
-
return {
|
|
30829
|
-
title: "Pay in full",
|
|
30830
|
-
description: "Pay everything today and your booking is confirmed.",
|
|
30831
|
-
ctaLabel: `Pay ${formattedTotal} now`
|
|
30832
|
-
};
|
|
30833
|
-
}
|
|
30834
|
-
/** Reused after booking; payment remains outside the platform. */
|
|
30835
|
-
const OFFLINE_BOOKING_PAYMENT_INSTRUCTIONS = "Pay the business later, outside the platform.";
|
|
30836
|
-
function buildDeferredManualBookingPaymentOptionCopy() {
|
|
30837
|
-
return {
|
|
30838
|
-
title: "Pay offline",
|
|
30839
|
-
description: `Book now and ${OFFLINE_BOOKING_PAYMENT_INSTRUCTIONS.toLowerCase()}`,
|
|
30840
|
-
helperText: "Nothing is due today.",
|
|
30841
|
-
ctaLabel: "Book now"
|
|
30842
|
-
};
|
|
30843
|
-
}
|
|
30844
|
-
function buildInstalmentBookingPaymentOptionCopy(input) {
|
|
30845
|
-
return {
|
|
30846
|
-
title: "Payment plan",
|
|
30847
|
-
description: describeInstalmentPlanCopy(input),
|
|
30848
|
-
helperText: input.futurePaymentCount > 0 ? "You can pay the rest early any time in your customer portal." : void 0,
|
|
30849
|
-
ctaLabel: `Pay ${input.formattedDueToday} now`
|
|
30850
|
-
};
|
|
30851
|
-
}
|
|
30852
|
-
function describeInstalmentPlanCopy(input) {
|
|
30853
|
-
if (input.futurePaymentCount === 0) {
|
|
30854
|
-
const depositPolicy = input.depositRefundability ? ` Your deposit is ${formatDepositRefundabilityLabel(input.depositRefundability)}.` : "";
|
|
30855
|
-
return `Pay ${input.formattedDueToday} today.${depositPolicy}`;
|
|
30856
|
-
}
|
|
30857
|
-
if (input.depositRefundability) return `Pay ${input.formattedDueToday} today, then continue with scheduled payments. Your deposit is ${formatDepositRefundabilityLabel(input.depositRefundability)}.`;
|
|
30858
|
-
if (input.futurePaymentCount === 1) return `Pay ${input.formattedDueToday} today, then one more payment later.`;
|
|
30859
|
-
const formattedFirstFuture = input.formattedFirstFuture ?? input.formattedDueToday;
|
|
30860
|
-
return `Pay ${input.formattedDueToday} today, then ${input.futurePaymentCount} more ${input.cadenceLabel} payments from ${formattedFirstFuture}.`;
|
|
30861
|
-
}
|
|
30862
|
-
function buildFlexibleBalanceBookingPaymentOptionCopy(input) {
|
|
30863
|
-
return {
|
|
30864
|
-
title: "Deposit now, pay the rest later",
|
|
30865
|
-
description: `Pay ${input.formattedDueToday} today, then pay the remaining balance any time before ${input.dueDateLabel}. Your deposit is ${formatDepositRefundabilityLabel(input.depositRefundability)}.`,
|
|
30866
|
-
helperText: "You can return in your customer portal to pay the rest before the due date.",
|
|
30867
|
-
ctaLabel: `Pay ${input.formattedDueToday} now`
|
|
30868
|
-
};
|
|
30869
|
-
}
|
|
30870
|
-
function formatDepositRefundabilityLabel(depositRefundability) {
|
|
30871
|
-
return depositRefundability === "non_refundable" ? "non-refundable" : "refundable";
|
|
30872
|
-
}
|
|
30873
|
-
/** Configured cadence for the existing instalment description. */
|
|
30874
|
-
function buildBookingInstalmentCadenceLabel(plan) {
|
|
30875
|
-
const interval = getBookingInstalmentPlanIntervalCount(plan);
|
|
30876
|
-
const unit = interval === 1 ? plan.intervalUnit : `${plan.intervalUnit}s`;
|
|
30877
|
-
return interval === 1 ? unit : `every ${interval} ${unit}`;
|
|
30878
|
-
}
|
|
30879
|
-
//#endregion
|
|
30880
|
-
//#region ../blocks/src/system/runtime/nodes/event-registration/bookingCalendar.ts
|
|
30881
|
-
/** Public schedule plus the authorised outcome's arrival text; online access stays in email. */
|
|
30882
|
-
function bookingCalendar(event, outcome) {
|
|
30883
|
-
if (!event) return null;
|
|
30884
|
-
const { identity } = outcome;
|
|
30885
|
-
const sessions = event.registrationSubject.kind === "wholeSeries" ? event.registrationSubject.sessions : [{
|
|
30886
|
-
occurrenceId: event.registrationSubject.occurrenceId,
|
|
30887
|
-
startsAt: event.startsAt,
|
|
30888
|
-
endsAt: event.endsAt
|
|
30889
|
-
}];
|
|
30890
|
-
const bookingId = identity.scope === "occurrence" ? identity.attendeeId : identity.registrationId;
|
|
30891
|
-
const entries = sessions.map((session) => ({
|
|
30892
|
-
uid: `booking-${bookingId}-${session.occurrenceId}@riverbankcms.com`,
|
|
30893
|
-
sequence: 0,
|
|
30894
|
-
title: event.title,
|
|
30895
|
-
startsAt: new Date(session.startsAt),
|
|
30896
|
-
endsAt: new Date(session.endsAt),
|
|
30897
|
-
timezone: "UTC",
|
|
30898
|
-
status: "confirmed",
|
|
30899
|
-
location: identity.attendanceMode === "online" ? "Online" : outcome.arrivalVenues?.[session.occurrenceId] ?? event.venue?.name,
|
|
30900
|
-
description: identity.attendanceMode === "online" ? "See your confirmation email for joining instructions." : void 0
|
|
30901
|
-
}));
|
|
30902
|
-
const first = entries[0];
|
|
30903
|
-
if (!first) return null;
|
|
30904
|
-
const common = {
|
|
30905
|
-
fileName: `${slugify(event.title) || "event"}.ics`,
|
|
30906
|
-
feed: {
|
|
30907
|
-
timezone: "UTC",
|
|
30908
|
-
entries
|
|
30909
|
-
}
|
|
30910
|
-
};
|
|
30911
|
-
return entries.length === 1 ? {
|
|
30912
|
-
...common,
|
|
30913
|
-
kind: "single",
|
|
30914
|
-
...calendarLinks(first)
|
|
30915
|
-
} : {
|
|
30916
|
-
...common,
|
|
30917
|
-
kind: "sessions",
|
|
30918
|
-
sessionCount: entries.length
|
|
30919
|
-
};
|
|
30920
|
-
}
|
|
30921
|
-
//#endregion
|
|
30922
|
-
//#region ../blocks/src/system/runtime/nodes/event-registration/registrationEventAdapter.ts
|
|
30923
|
-
function toRegistrationEvent(event) {
|
|
30924
|
-
return {
|
|
30925
|
-
...event,
|
|
30926
|
-
selectionId: event.id,
|
|
30927
|
-
registrationSubject: {
|
|
30928
|
-
kind: "occurrence",
|
|
30929
|
-
occurrenceId: event.occurrenceId
|
|
30930
|
-
}
|
|
30931
|
-
};
|
|
30932
|
-
}
|
|
30933
|
-
function toRegistrationEvents(events) {
|
|
30934
|
-
return events.filter((event) => event.bookingScope === "single_occurrence").map(toRegistrationEvent);
|
|
30935
|
-
}
|
|
30936
|
-
/**
|
|
30937
|
-
* Project one whole-series run onto the registration surface.
|
|
30938
|
-
*
|
|
30939
|
-
* Capacity, pricing, payment terms and consent come straight off the canonical
|
|
30940
|
-
* Event record; only the schedule is widened from the single occurrence to the
|
|
30941
|
-
* live run. A run without live sessions has no registration event.
|
|
30942
|
-
*/
|
|
30943
|
-
function toWholeSeriesRegistrationEvent(group) {
|
|
30944
|
-
const { representative, run } = group;
|
|
30945
|
-
const sessions = orderedLiveRunSessions(run.sessions);
|
|
30946
|
-
const firstSession = sessions[0];
|
|
30947
|
-
if (!firstSession) return null;
|
|
30948
|
-
const lastSession = sessions[sessions.length - 1] ?? firstSession;
|
|
30949
|
-
return {
|
|
30950
|
-
...representative,
|
|
30951
|
-
selectionId: run.eventSeriesId,
|
|
30952
|
-
registrationSubject: {
|
|
30953
|
-
kind: "wholeSeries",
|
|
30954
|
-
eventSeriesId: run.eventSeriesId,
|
|
30955
|
-
sessions
|
|
30956
|
-
},
|
|
30957
|
-
startsAt: firstSession.startsAt,
|
|
30958
|
-
endsAt: lastSession.endsAt,
|
|
30959
|
-
timeZone: firstSession.timeZone
|
|
30960
|
-
};
|
|
30961
|
-
}
|
|
30962
|
-
function toWholeSeriesRegistrationEvents(events) {
|
|
30963
|
-
return groupPublicEventsByRun(events).map(toWholeSeriesRegistrationEvent).filter((event) => event !== null);
|
|
30964
|
-
}
|
|
30965
|
-
/** An occurrence-page context must not replace a whole run's booking start. */
|
|
30966
|
-
function getRegistrationStartAt(event, occurrenceContext) {
|
|
30967
|
-
return event?.registrationSubject.kind === "wholeSeries" ? event.startsAt : occurrenceContext?.startsAt ?? event?.startsAt;
|
|
30968
|
-
}
|
|
30969
|
-
/** Confirmation identifies its persisted subject, independently of the current draft. */
|
|
30970
|
-
function findBookedEvent(events, identity) {
|
|
30971
|
-
return events.find((event) => identity.scope === "occurrence" ? event.seriesId === identity.seriesId && event.registrationSubject.kind === "occurrence" && event.registrationSubject.occurrenceId === identity.occurrenceId : event.registrationSubject.kind === "wholeSeries" && event.registrationSubject.eventSeriesId === identity.seriesId) ?? null;
|
|
30972
|
-
}
|
|
30973
|
-
//#endregion
|
|
30974
31357
|
//#region ../blocks/src/system/runtime/nodes/event-registration/ticketSelectionLines.ts
|
|
30975
31358
|
/** Waitlists request places; bookings can only request currently available capacity. */
|
|
30976
31359
|
function canRequestTicketOption(availability, purpose) {
|
|
@@ -31042,6 +31425,92 @@ function getHeldPlacesBySelection(current, held) {
|
|
|
31042
31425
|
return held?.selectionId === current.selectionId && held?.attendanceMode === current.attendanceMode ? held.lines : [];
|
|
31043
31426
|
}
|
|
31044
31427
|
//#endregion
|
|
31428
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/registrationWizardContext.ts
|
|
31429
|
+
function getEventSelectionDefaults(event) {
|
|
31430
|
+
const suggestedAmount = getSlidingScaleForEvent(event)?.suggestedAmount;
|
|
31431
|
+
return {
|
|
31432
|
+
slidingAmountInput: suggestedAmount == null ? "" : formatCentsAsCurrencyInput(suggestedAmount),
|
|
31433
|
+
attendanceMode: event.deliveryMode === "hybrid" ? null : event.deliveryMode ?? "in_person"
|
|
31434
|
+
};
|
|
31435
|
+
}
|
|
31436
|
+
function parseCurrencyInputToCents(value) {
|
|
31437
|
+
const trimmed = value.trim();
|
|
31438
|
+
if (!trimmed) return null;
|
|
31439
|
+
const amount = Number(trimmed);
|
|
31440
|
+
return Number.isFinite(amount) && amount >= 0 ? Math.round(amount * 100) : null;
|
|
31441
|
+
}
|
|
31442
|
+
function getSlidingScaleForEvent(event) {
|
|
31443
|
+
const pricing = event?.pricing ?? null;
|
|
31444
|
+
return pricing?.kind === "sliding_scale" ? {
|
|
31445
|
+
minAmount: pricing.minimum,
|
|
31446
|
+
maxAmount: pricing.maximum,
|
|
31447
|
+
suggestedAmount: pricing.suggested
|
|
31448
|
+
} : null;
|
|
31449
|
+
}
|
|
31450
|
+
function getSlidingScaleSelectionMessage(input) {
|
|
31451
|
+
if (!input.slidingScale) return null;
|
|
31452
|
+
if (input.selectedAmount === null) return "Choose an amount to continue.";
|
|
31453
|
+
const { minAmount, maxAmount } = input.slidingScale;
|
|
31454
|
+
return input.selectedAmount < minAmount || input.selectedAmount > maxAmount ? "Choose an amount within the sliding scale." : null;
|
|
31455
|
+
}
|
|
31456
|
+
function getRegistrationOccurrenceId(target) {
|
|
31457
|
+
return target?.subject.kind === "occurrence" ? target.subject.occurrenceId : "";
|
|
31458
|
+
}
|
|
31459
|
+
function shouldLoadRegistrationOptions(authState, step) {
|
|
31460
|
+
return authState === "authenticated" || step === "select-tickets" || step === "enter-details" || step === "select-payment";
|
|
31461
|
+
}
|
|
31462
|
+
function getEligibilityFlowFlags(input) {
|
|
31463
|
+
const hasPass = (input.eligibility?.eligiblePasses.length ?? 0) > 0;
|
|
31464
|
+
const hasMembership = (input.eligibility?.eligibleMemberships.length ?? 0) > 0;
|
|
31465
|
+
return {
|
|
31466
|
+
hasEligibility: hasPass || hasMembership,
|
|
31467
|
+
hasMembershipEligibility: hasMembership,
|
|
31468
|
+
isMembershipFastTrack: input.portalAuthState === "authenticated" && hasMembership && input.ticketsCount === 1 && input.paymentMethod === "membership"
|
|
31469
|
+
};
|
|
31470
|
+
}
|
|
31471
|
+
/** Prefer refreshed capacity, including a known zero; fall back while options load. */
|
|
31472
|
+
function getTicketSelectionRemainingPlaces(input) {
|
|
31473
|
+
const availability = input.eligibility?.availability;
|
|
31474
|
+
if (availability && "remainingPlaces" in availability) return availability.remainingPlaces ?? null;
|
|
31475
|
+
return input.event ? getEventAvailability(selectEventCapacitySource(input.event, input.attendanceMode)).available : null;
|
|
31476
|
+
}
|
|
31477
|
+
/** Keep the card and ticket step on the same fresh capacity as admission. */
|
|
31478
|
+
function withRegistrationAvailability(event, eligibility, attendanceMode) {
|
|
31479
|
+
const availability = eligibility?.availability;
|
|
31480
|
+
if (!event || !availability || !("remainingPlaces" in availability)) return event;
|
|
31481
|
+
const mode = attendanceMode ?? (event.deliveryMode === "hybrid" ? null : event.deliveryMode ?? "in_person");
|
|
31482
|
+
if (!mode) return event;
|
|
31483
|
+
const source = selectEventCapacitySource(event, mode);
|
|
31484
|
+
const remaining = availability.remainingPlaces ?? null;
|
|
31485
|
+
const refreshed = {
|
|
31486
|
+
capacity: remaining === null ? null : source.capacity ?? remaining,
|
|
31487
|
+
availableSpots: remaining,
|
|
31488
|
+
waitlistEnabled: availability.waitlistEnabled
|
|
31489
|
+
};
|
|
31490
|
+
return {
|
|
31491
|
+
...event,
|
|
31492
|
+
...event.deliveryMode === "hybrid" ? {} : refreshed,
|
|
31493
|
+
attendanceModes: event.attendanceModes?.map((row) => row.mode === mode ? {
|
|
31494
|
+
...row,
|
|
31495
|
+
...refreshed
|
|
31496
|
+
} : row)
|
|
31497
|
+
};
|
|
31498
|
+
}
|
|
31499
|
+
function resolveHeldTicketPlaces(current, invitation, paymentHold) {
|
|
31500
|
+
return getHeldPlacesBySelection(current, invitation.kind === "ready" ? {
|
|
31501
|
+
selectionId: invitation.restoration.event?.selectionId ?? current.selectionId,
|
|
31502
|
+
attendanceMode: invitation.restoration.attendanceMode,
|
|
31503
|
+
lines: invitation.restoration.ticketSelections
|
|
31504
|
+
} : paymentHold);
|
|
31505
|
+
}
|
|
31506
|
+
function getCurrentTicketSelection(event, attendanceMode, lines) {
|
|
31507
|
+
return {
|
|
31508
|
+
selectionId: event?.selectionId ?? null,
|
|
31509
|
+
attendanceMode,
|
|
31510
|
+
lines
|
|
31511
|
+
};
|
|
31512
|
+
}
|
|
31513
|
+
//#endregion
|
|
31045
31514
|
//#region ../blocks/src/system/runtime/nodes/event-registration/utils.ts
|
|
31046
31515
|
function getPortalSubjectEmail(profile) {
|
|
31047
31516
|
return profile?.email ?? null;
|
|
@@ -31167,6 +31636,7 @@ function withOccurrenceTitle(event, occurrence) {
|
|
|
31167
31636
|
title
|
|
31168
31637
|
} : event;
|
|
31169
31638
|
}
|
|
31639
|
+
/** A course runs from its first session's start until its last session ends. */
|
|
31170
31640
|
function courseSchedule(sessions, siteTimeZone, deliveryMode) {
|
|
31171
31641
|
const first = sessions[0];
|
|
31172
31642
|
if (!first) return null;
|
|
@@ -31176,8 +31646,12 @@ function courseSchedule(sessions, siteTimeZone, deliveryMode) {
|
|
|
31176
31646
|
siteTimeZone,
|
|
31177
31647
|
deliveryMode
|
|
31178
31648
|
});
|
|
31179
|
-
if (
|
|
31180
|
-
|
|
31649
|
+
if (sessions.length === 1) return `1 session · ${formatBookingWhen({
|
|
31650
|
+
...first,
|
|
31651
|
+
siteTimeZone,
|
|
31652
|
+
deliveryMode
|
|
31653
|
+
}, "long")}`;
|
|
31654
|
+
const lastLabel = formatEventDateTime(last.endsAt, {
|
|
31181
31655
|
timeZone: last.timeZone,
|
|
31182
31656
|
siteTimeZone,
|
|
31183
31657
|
deliveryMode
|
|
@@ -31270,6 +31744,7 @@ function transformRegistrationOptionsResponse(response) {
|
|
|
31270
31744
|
ticketTypes: response.pricing.options,
|
|
31271
31745
|
price: response.pricing.subtotalCents,
|
|
31272
31746
|
currency: response.pricing.currency,
|
|
31747
|
+
requiresAuthForCredit: response.entitlements.requiresLoginForCredit ?? false,
|
|
31273
31748
|
requiresAuthForPasses: response.entitlements.requiresLoginForPasses,
|
|
31274
31749
|
requiresAuthForMemberships: response.entitlements.requiresLoginForMemberships,
|
|
31275
31750
|
eligiblePasses,
|
|
@@ -31352,6 +31827,1384 @@ function findSelectedTicketType(input) {
|
|
|
31352
31827
|
}).find((ticketType) => ticketType.pricingOptionId === input.selectedPricingOptionId) ?? null;
|
|
31353
31828
|
}
|
|
31354
31829
|
//#endregion
|
|
31830
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/combinationPrices.state.ts
|
|
31831
|
+
/**
|
|
31832
|
+
* Combination prices in the registration block (issue 1725): "any 4 dates for
|
|
31833
|
+
* £40", "Part 1 and Part 2 for £120". Everything here is pure.
|
|
31834
|
+
*
|
|
31835
|
+
* Prices come from the commerce planner checkout uses, so the block shows the
|
|
31836
|
+
* total checkout will charge. Once the server has priced the order (a code
|
|
31837
|
+
* preview), its figures win over the planner's. Offer labels are the stored
|
|
31838
|
+
* ones the server sends ("4 dates for £40"), never rebuilt here.
|
|
31839
|
+
*/
|
|
31840
|
+
/** Dates and runs of one event share its offers, so the first item's are everyone's. */
|
|
31841
|
+
function combinationOffersOf(events) {
|
|
31842
|
+
return events[0]?.combinationPrices ?? [];
|
|
31843
|
+
}
|
|
31844
|
+
/** Offers name dates by occurrence and runs by series. */
|
|
31845
|
+
function lineIdOf(event) {
|
|
31846
|
+
const subject = event.registrationSubject;
|
|
31847
|
+
return subject.kind === "occurrence" ? subject.occurrenceId : subject.eventSeriesId;
|
|
31848
|
+
}
|
|
31849
|
+
/**
|
|
31850
|
+
* What a date or run is called among the items named with it: "Fri 30 Oct,
|
|
31851
|
+
* 7pm", or the run's name. Runs of one course can share a name, so a run
|
|
31852
|
+
* whose name another of `peers` has also gets its start day:
|
|
31853
|
+
* "Beginners Yoga (starts Thu 5 Nov)". Dates already differ by date and time.
|
|
31854
|
+
*/
|
|
31855
|
+
function selectionItemName(event, peers) {
|
|
31856
|
+
if (event.registrationSubject.kind !== "wholeSeries") return formatBookingWhen(event, "short");
|
|
31857
|
+
return peers.some((peer) => peer.selectionId !== event.selectionId && peer.title === event.title) ? `${event.title} (starts ${formatBookingWhen(event, "day")})` : event.title;
|
|
31858
|
+
}
|
|
31859
|
+
/** A selected item as checkout prices it, at its resolved price for one place. */
|
|
31860
|
+
function toItem(event, unitPriceCents, peers) {
|
|
31861
|
+
if (unitPriceCents === null) return null;
|
|
31862
|
+
const id = lineIdOf(event);
|
|
31863
|
+
return {
|
|
31864
|
+
itemId: id,
|
|
31865
|
+
lineId: id,
|
|
31866
|
+
date: event.startsAt,
|
|
31867
|
+
label: selectionItemName(event, peers),
|
|
31868
|
+
unitPriceCents: toNonNegativeCents(unitPriceCents)
|
|
31869
|
+
};
|
|
31870
|
+
}
|
|
31871
|
+
/** `peers` are every item named alongside these, so two runs sharing a name read apart. */
|
|
31872
|
+
function toItems(events, itemPrice, peers = events) {
|
|
31873
|
+
const items = events.map((event) => {
|
|
31874
|
+
const price = itemPrice(event);
|
|
31875
|
+
return price === null ? null : {
|
|
31876
|
+
line: {
|
|
31877
|
+
lineId: lineIdOf(event),
|
|
31878
|
+
date: event.startsAt,
|
|
31879
|
+
label: selectionItemName(event, peers)
|
|
31880
|
+
},
|
|
31881
|
+
subtotalCents: toNonNegativeCents(price.subtotalCents),
|
|
31882
|
+
item: toItem(event, price.unitPriceCents, peers)
|
|
31883
|
+
};
|
|
31884
|
+
});
|
|
31885
|
+
return items.every((item) => item !== null) ? items : null;
|
|
31886
|
+
}
|
|
31887
|
+
/** A row that could still be ticked, at its one fixed price; the hint never guesses a ticket type. */
|
|
31888
|
+
function addableLine(event, peers) {
|
|
31889
|
+
return event.pricing.kind === "single" ? toItem(event, event.pricing.amount, peers) : null;
|
|
31890
|
+
}
|
|
31891
|
+
/**
|
|
31892
|
+
* The planner's price for the selection, or null when it can't apply: no
|
|
31893
|
+
* offers, one item, or an item whose price isn't known yet. Checkout's own
|
|
31894
|
+
* projection decides it (`planSelectionCombinationPrices`): every item enters
|
|
31895
|
+
* at its resolved price, so a run with ticket types that no offer covers keeps
|
|
31896
|
+
* the price chosen for it. The planner refuses input checkout would refuse
|
|
31897
|
+
* too, which leaves the usual prices.
|
|
31898
|
+
*/
|
|
31899
|
+
function planSelectionCombination(input) {
|
|
31900
|
+
const items = toItems(input.selection, input.itemPrice);
|
|
31901
|
+
if (input.offers.length === 0 || input.selection.length < 2 || items === null || input.places < 1) return null;
|
|
31902
|
+
try {
|
|
31903
|
+
return planSelectionCombinationPrices({
|
|
31904
|
+
items: items.flatMap(({ item }) => item ? [item] : []),
|
|
31905
|
+
offers: input.offers,
|
|
31906
|
+
places: unsafeAsPositiveCheckoutQuantity(input.places),
|
|
31907
|
+
uncovered: items.filter(({ item }) => item === null)
|
|
31908
|
+
});
|
|
31909
|
+
} catch {
|
|
31910
|
+
return null;
|
|
31911
|
+
}
|
|
31912
|
+
}
|
|
31913
|
+
/** Whether the plan takes anything off. */
|
|
31914
|
+
function planCombines(plan) {
|
|
31915
|
+
return plan !== null && plan.applications.length > 0;
|
|
31916
|
+
}
|
|
31917
|
+
/** "£40.00", matching the totals beside it; stored offer labels keep their own wording. */
|
|
31918
|
+
function money(cents, currency) {
|
|
31919
|
+
return formatCurrencyAmount(cents, currency);
|
|
31920
|
+
}
|
|
31921
|
+
/** "Part 1 and Part 2", "A, B and C". */
|
|
31922
|
+
function joinNames$1(names) {
|
|
31923
|
+
const last = names[names.length - 1] ?? "";
|
|
31924
|
+
return names.length < 2 ? last : `${names.slice(0, -1).join(", ")} and ${last}`;
|
|
31925
|
+
}
|
|
31926
|
+
function plural(count, singular) {
|
|
31927
|
+
return `${count} ${singular}${count === 1 ? "" : "s"}`;
|
|
31928
|
+
}
|
|
31929
|
+
/** "Book any **4 dates for £40**, or any **8 dates for £75**." Particular offers name their items. */
|
|
31930
|
+
function combinationOfferLine(offers) {
|
|
31931
|
+
const sorted = [...offers].sort((a, b) => a.sortOrder - b.sortOrder);
|
|
31932
|
+
if (sorted.length === 0) return null;
|
|
31933
|
+
return [...sorted.flatMap((offer, index) => {
|
|
31934
|
+
const lead = index === 0 ? "Book " : ", or ";
|
|
31935
|
+
return [{ text: offer.kind === "any" ? `${lead}any ` : lead }, {
|
|
31936
|
+
text: offer.label,
|
|
31937
|
+
strong: true
|
|
31938
|
+
}];
|
|
31939
|
+
}), { text: "." }];
|
|
31940
|
+
}
|
|
31941
|
+
/** The usual-price items after the combinations: "plus 1 at £12", "plus Part 3 at £70". */
|
|
31942
|
+
function leftoverText(plan, several, currency) {
|
|
31943
|
+
const leftover = plan.lines.filter((row) => !row.combined).map((row) => ({
|
|
31944
|
+
...row.line,
|
|
31945
|
+
unitPriceCents: row.listCents / plan.places
|
|
31946
|
+
}));
|
|
31947
|
+
if (leftover.length === 0) return null;
|
|
31948
|
+
if (several === "runs") return `plus ${joinNames$1(leftover.map((line) => `${line.label} at ${money(line.unitPriceCents, currency)}`))}`;
|
|
31949
|
+
return `plus ${joinNames$1([...new Set(leftover.map((line) => line.unitPriceCents))].map((price) => `${leftover.filter((line) => line.unitPriceCents === price).length} at ${money(price, currency)}`))}`;
|
|
31950
|
+
}
|
|
31951
|
+
/** "4 dates for £40", or "2 × 4 dates for £40" when an offer repeats. */
|
|
31952
|
+
function applicationsText(plan) {
|
|
31953
|
+
return [...new Set(plan.applications.map((app) => app.offer.id))].flatMap((id) => {
|
|
31954
|
+
const apps = plan.applications.filter((app) => app.offer.id === id);
|
|
31955
|
+
const label = apps[0]?.offer.label;
|
|
31956
|
+
if (label === void 0) return [];
|
|
31957
|
+
return [apps.length > 1 ? `${apps.length} × ${label}` : label];
|
|
31958
|
+
});
|
|
31959
|
+
}
|
|
31960
|
+
/**
|
|
31961
|
+
* The summary bar's detail line: "4 dates for £40, plus 1 at £12" and
|
|
31962
|
+
* "You save £8"; with places, "…, for each place".
|
|
31963
|
+
*/
|
|
31964
|
+
function combinationWorking(input) {
|
|
31965
|
+
const { plan } = input;
|
|
31966
|
+
if (!planCombines(plan)) return null;
|
|
31967
|
+
const leftover = leftoverText(plan, input.several, input.currency);
|
|
31968
|
+
const working = [...applicationsText(plan), ...leftover ? [leftover] : []].join(", ");
|
|
31969
|
+
return {
|
|
31970
|
+
working: plan.places > 1 ? `${working}, for each place` : working,
|
|
31971
|
+
saving: `You save ${money(plan.listTotalCents - plan.totalCents, input.currency)}`
|
|
31972
|
+
};
|
|
31973
|
+
}
|
|
31974
|
+
/**
|
|
31975
|
+
* The next saving, worked out by the planner from the items the visitor could
|
|
31976
|
+
* still tick, so it never promises a price checkout won't give.
|
|
31977
|
+
*/
|
|
31978
|
+
function selectionCombinationHint(input) {
|
|
31979
|
+
const peers = [...input.selection, ...input.addable];
|
|
31980
|
+
const items = toItems(input.selection, input.itemPrice, peers);
|
|
31981
|
+
if (input.offers.length === 0 || input.selection.length === 0 || items === null || input.places < 1) return null;
|
|
31982
|
+
if (items.some(({ item }) => item === null)) return null;
|
|
31983
|
+
const chosen = new Set(items.map(({ line }) => line.lineId));
|
|
31984
|
+
const addable = input.addable.flatMap((event) => {
|
|
31985
|
+
const line = addableLine(event, peers);
|
|
31986
|
+
return line && !chosen.has(line.lineId) ? [line] : [];
|
|
31987
|
+
});
|
|
31988
|
+
const lines = items.flatMap(({ item }) => item ? [item] : []);
|
|
31989
|
+
try {
|
|
31990
|
+
return nextCombinationHint({
|
|
31991
|
+
lines,
|
|
31992
|
+
addable,
|
|
31993
|
+
offers: input.offers,
|
|
31994
|
+
places: unsafeAsPositiveCheckoutQuantity(input.places)
|
|
31995
|
+
});
|
|
31996
|
+
} catch {
|
|
31997
|
+
return null;
|
|
31998
|
+
}
|
|
31999
|
+
}
|
|
32000
|
+
/**
|
|
32001
|
+
* "**Add 1 more date** to get 4 dates for £40." · "**Add Part 2** to get Part
|
|
32002
|
+
* 1 and Part 2 for £120. You’d save £20." Particular dates are named.
|
|
32003
|
+
*/
|
|
32004
|
+
function combinationHintCopy(input) {
|
|
32005
|
+
const { hint } = input;
|
|
32006
|
+
const count = hint.added.length;
|
|
32007
|
+
const lead = input.several === "dates" && hint.offer.kind === "any" ? `Add ${count} more ${count === 1 ? "date" : "dates"}` : `Add ${joinNames$1(hint.added.map((line) => line.label))}`;
|
|
32008
|
+
const saving = input.several === "runs" ? ` You’d save ${money(hint.savingCents, input.currency)}.` : "";
|
|
32009
|
+
return [{
|
|
32010
|
+
text: lead,
|
|
32011
|
+
strong: true
|
|
32012
|
+
}, { text: ` to get ${hint.offer.label}.${saving}` }];
|
|
32013
|
+
}
|
|
32014
|
+
/**
|
|
32015
|
+
* The lines the server prices a selection from, for a typed code or the
|
|
32016
|
+
* automatic one: each date by occurrence, each run with its places, each at
|
|
32017
|
+
* its resolved price, so the server prices them as checkout will.
|
|
32018
|
+
*/
|
|
32019
|
+
function selectionPreviewLines(input) {
|
|
32020
|
+
const lines = input.selection.map((event) => {
|
|
32021
|
+
const currency = publicEventPricingCurrency(event.pricing);
|
|
32022
|
+
const price = input.itemPrice(event);
|
|
32023
|
+
if (price === null || currency === null) return null;
|
|
32024
|
+
const { subtotalCents } = price;
|
|
32025
|
+
const subject = event.registrationSubject;
|
|
32026
|
+
return subject.kind === "occurrence" ? {
|
|
32027
|
+
occurrenceId: subject.occurrenceId,
|
|
32028
|
+
quantity: input.places,
|
|
32029
|
+
subtotalCents,
|
|
32030
|
+
currency,
|
|
32031
|
+
...price.ticketUnits ? { ticketUnits: price.ticketUnits } : {},
|
|
32032
|
+
context: {
|
|
32033
|
+
type: "event",
|
|
32034
|
+
eventSeriesId: event.seriesId,
|
|
32035
|
+
eventCategoryId: event.eventCategory?.id ?? null,
|
|
32036
|
+
ticketsCount: input.places
|
|
32037
|
+
}
|
|
32038
|
+
} : {
|
|
32039
|
+
quantity: input.places,
|
|
32040
|
+
subtotalCents,
|
|
32041
|
+
currency,
|
|
32042
|
+
context: {
|
|
32043
|
+
type: "whole_series",
|
|
32044
|
+
eventSeriesId: subject.eventSeriesId
|
|
32045
|
+
}
|
|
32046
|
+
};
|
|
32047
|
+
});
|
|
32048
|
+
return lines.length > 0 && lines.every((line) => line !== null) ? lines : null;
|
|
32049
|
+
}
|
|
32050
|
+
/** A preview belongs to one code (or none, for the automatic one), one set of items and one number of places. */
|
|
32051
|
+
function selectionPreviewKey(code, lines) {
|
|
32052
|
+
const trimmed = code === null ? "" : code.trim().toUpperCase();
|
|
32053
|
+
if (code !== null && !trimmed || !lines) return null;
|
|
32054
|
+
return JSON.stringify([trimmed, lines]);
|
|
32055
|
+
}
|
|
32056
|
+
const USUAL_PRICE = "At the usual price";
|
|
32057
|
+
function plannedGroups(plan) {
|
|
32058
|
+
const label = (lineId) => plan.lines.find((row) => row.line.lineId === lineId)?.line.label ?? "";
|
|
32059
|
+
const combined = plan.applications.map((app, index) => ({
|
|
32060
|
+
key: `combination-${index}`,
|
|
32061
|
+
heading: app.offer.label,
|
|
32062
|
+
lines: app.allocations.map((row) => ({
|
|
32063
|
+
key: row.lineId,
|
|
32064
|
+
label: label(row.lineId),
|
|
32065
|
+
amountCents: row.totalCents
|
|
32066
|
+
}))
|
|
32067
|
+
}));
|
|
32068
|
+
const usual = plan.lines.filter((row) => !row.combined).map((row) => ({
|
|
32069
|
+
key: row.line.lineId,
|
|
32070
|
+
label: row.line.label,
|
|
32071
|
+
amountCents: row.listCents
|
|
32072
|
+
}));
|
|
32073
|
+
return [...combined, ...usual.length > 0 ? [{
|
|
32074
|
+
key: "usual",
|
|
32075
|
+
heading: USUAL_PRICE,
|
|
32076
|
+
lines: usual
|
|
32077
|
+
}] : []];
|
|
32078
|
+
}
|
|
32079
|
+
function usualGroups(plan) {
|
|
32080
|
+
return [{
|
|
32081
|
+
key: "usual",
|
|
32082
|
+
heading: null,
|
|
32083
|
+
lines: plan.lines.map((row) => ({
|
|
32084
|
+
key: row.line.lineId,
|
|
32085
|
+
label: row.line.label,
|
|
32086
|
+
amountCents: row.listCents
|
|
32087
|
+
}))
|
|
32088
|
+
}];
|
|
32089
|
+
}
|
|
32090
|
+
function sumKind(reductions, kind) {
|
|
32091
|
+
return reductions.filter((row) => row.kind === kind).reduce((sum, row) => sum + row.amountCents, 0);
|
|
32092
|
+
}
|
|
32093
|
+
/** "Code WELCOME10 (10% off)", or just the code when its label says nothing more. */
|
|
32094
|
+
function codeLineLabel(preview) {
|
|
32095
|
+
const label = preview.publicLabel.trim();
|
|
32096
|
+
return label && label.toUpperCase() !== preview.code.toUpperCase() ? `Code ${preview.code} (${label})` : `Code ${preview.code}`;
|
|
32097
|
+
}
|
|
32098
|
+
/** An automatic code is named by its label, as the summary bar names it for one booking. */
|
|
32099
|
+
function quoteLineLabel(quote) {
|
|
32100
|
+
if (quote.preview.type === "priced") return "";
|
|
32101
|
+
return quote.source === "automatic" ? quote.preview.publicLabel.trim() || quote.preview.code : codeLineLabel(quote.preview);
|
|
32102
|
+
}
|
|
32103
|
+
/** "This code can’t be used with the “4 dates for £40” price, so it’s been taken off your other date." */
|
|
32104
|
+
function codeNote(plan, several) {
|
|
32105
|
+
const label = plan.applications[0]?.offer.label;
|
|
32106
|
+
const others = plan.lines.filter((row) => !row.combined).length;
|
|
32107
|
+
if (label === void 0 || others === 0) return null;
|
|
32108
|
+
const noun = several === "dates" ? "date" : "run";
|
|
32109
|
+
return `This code can’t be used with the “${label}” price, so it’s been taken off your other ${others === 1 ? noun : `${noun}s`}.`;
|
|
32110
|
+
}
|
|
32111
|
+
function placesLabel$1(several, places) {
|
|
32112
|
+
return `${plural(places, "place")} on each ${several === "runs" ? "run" : "date"}`;
|
|
32113
|
+
}
|
|
32114
|
+
/**
|
|
32115
|
+
* The payment step's list when combinations apply: each combination's items
|
|
32116
|
+
* with what each now costs, the rest at the usual price, any code, the total
|
|
32117
|
+
* and the saving. Once the server has priced the selection (a typed code, or
|
|
32118
|
+
* the automatic one) its figures decide: when its combinations match the
|
|
32119
|
+
* planner's, the planner's working is shown with the server's code amount and
|
|
32120
|
+
* total; otherwise only the server's own figures.
|
|
32121
|
+
*/
|
|
32122
|
+
function summariseCombinedPayment(input) {
|
|
32123
|
+
const { plan, quote } = input;
|
|
32124
|
+
if (quote) return previewedPayment({
|
|
32125
|
+
...input,
|
|
32126
|
+
quote
|
|
32127
|
+
});
|
|
32128
|
+
if (!planCombines(plan)) return null;
|
|
32129
|
+
return {
|
|
32130
|
+
kind: "combined",
|
|
32131
|
+
placesLabel: placesLabel$1(input.several, plan.places),
|
|
32132
|
+
groups: plannedGroups(plan),
|
|
32133
|
+
subtotalCents: plan.totalCents,
|
|
32134
|
+
reductions: [],
|
|
32135
|
+
note: null,
|
|
32136
|
+
totalCents: plan.totalCents,
|
|
32137
|
+
savingCents: savingFrom(plan, plan.totalCents)
|
|
32138
|
+
};
|
|
32139
|
+
}
|
|
32140
|
+
function savingFrom(plan, totalCents) {
|
|
32141
|
+
return plan.listTotalCents > totalCents ? plan.listTotalCents - totalCents : null;
|
|
32142
|
+
}
|
|
32143
|
+
/** The server's reductions; an older server reports only the code's amount. */
|
|
32144
|
+
function serverReductions(preview) {
|
|
32145
|
+
return preview.priceReductions ?? (preview.type === "applied" ? [{
|
|
32146
|
+
kind: "discount_code",
|
|
32147
|
+
label: preview.publicLabel,
|
|
32148
|
+
amountCents: preview.discountCents
|
|
32149
|
+
}] : []);
|
|
32150
|
+
}
|
|
32151
|
+
/** Which of the planner's working the server's price keeps: all of it, the items only, or none. */
|
|
32152
|
+
function previewAgreement(plan, preview) {
|
|
32153
|
+
const combinationCents = sumKind(serverReductions(preview), "combination_price");
|
|
32154
|
+
if (preview.subtotalCents !== plan.listTotalCents) return "server";
|
|
32155
|
+
if (planCombines(plan) && combinationCents === plan.listTotalCents - plan.totalCents) return "combinations";
|
|
32156
|
+
return combinationCents === 0 ? "usual" : "server";
|
|
32157
|
+
}
|
|
32158
|
+
function previewedPayment(input) {
|
|
32159
|
+
const { plan, quote } = input;
|
|
32160
|
+
const { preview } = quote;
|
|
32161
|
+
const server = serverReductions(preview);
|
|
32162
|
+
const code = {
|
|
32163
|
+
key: "code",
|
|
32164
|
+
label: quoteLineLabel(quote),
|
|
32165
|
+
amountCents: sumKind(server, "discount_code")
|
|
32166
|
+
};
|
|
32167
|
+
const codeRows = code.amountCents > 0 ? [code] : [];
|
|
32168
|
+
const base = {
|
|
32169
|
+
kind: "combined",
|
|
32170
|
+
placesLabel: placesLabel$1(input.several, plan.places),
|
|
32171
|
+
note: null,
|
|
32172
|
+
totalCents: preview.totalAfterDiscountCents,
|
|
32173
|
+
savingCents: savingFrom(plan, preview.totalAfterDiscountCents)
|
|
32174
|
+
};
|
|
32175
|
+
switch (previewAgreement(plan, preview)) {
|
|
32176
|
+
case "combinations": {
|
|
32177
|
+
const limited = quote.source === "typed" && preview.type === "applied" && preview.codeCombinesWithCombinationPrices === false && code.amountCents > 0;
|
|
32178
|
+
return {
|
|
32179
|
+
...base,
|
|
32180
|
+
groups: plannedGroups(plan),
|
|
32181
|
+
subtotalCents: plan.totalCents,
|
|
32182
|
+
reductions: codeRows,
|
|
32183
|
+
note: limited ? codeNote(plan, input.several) : null
|
|
32184
|
+
};
|
|
32185
|
+
}
|
|
32186
|
+
case "usual": return {
|
|
32187
|
+
...base,
|
|
32188
|
+
groups: usualGroups(plan),
|
|
32189
|
+
subtotalCents: plan.listTotalCents,
|
|
32190
|
+
reductions: codeRows
|
|
32191
|
+
};
|
|
32192
|
+
case "server": {
|
|
32193
|
+
const rows = server.map((row, index) => ({
|
|
32194
|
+
key: `reduction-${index}`,
|
|
32195
|
+
label: row.kind === "discount_code" ? code.label : row.label,
|
|
32196
|
+
amountCents: row.amountCents
|
|
32197
|
+
}));
|
|
32198
|
+
const sameBasket = preview.subtotalCents === plan.listTotalCents;
|
|
32199
|
+
return {
|
|
32200
|
+
...base,
|
|
32201
|
+
groups: sameBasket ? usualGroups(plan) : [],
|
|
32202
|
+
subtotalCents: preview.subtotalCents,
|
|
32203
|
+
reductions: rows
|
|
32204
|
+
};
|
|
32205
|
+
}
|
|
32206
|
+
}
|
|
32207
|
+
}
|
|
32208
|
+
/**
|
|
32209
|
+
* What the visitor pays, once checkout has priced the order: the usual total
|
|
32210
|
+
* less every reduction it reports. Null when it hasn't.
|
|
32211
|
+
*/
|
|
32212
|
+
function serverPricedTotalCents(input) {
|
|
32213
|
+
if (input.listTotalCents === null || input.reductions === null) return null;
|
|
32214
|
+
return Math.max(0, input.listTotalCents - input.reductions.reduce((sum, row) => sum + row.amountCents, 0));
|
|
32215
|
+
}
|
|
32216
|
+
//#endregion
|
|
32217
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/registrationSelection.state.ts
|
|
32218
|
+
const SINGLE = { kind: "single" };
|
|
32219
|
+
function sameOffering(events) {
|
|
32220
|
+
const offerings = new Set(events.map((event) => event.registrationSubject.kind === "wholeSeries" ? event.registrationSubject.eventOfferingId : null));
|
|
32221
|
+
return offerings.size === 1 && !offerings.has(null);
|
|
32222
|
+
}
|
|
32223
|
+
function registrationSelectionMode(input) {
|
|
32224
|
+
const { events } = input;
|
|
32225
|
+
if (input.hasPreSelectedContext || events.length < 2) return SINGLE;
|
|
32226
|
+
if (!events.every((event) => event.allowsMultipleBooking)) return SINGLE;
|
|
32227
|
+
const firstSeriesId = events[0]?.seriesId;
|
|
32228
|
+
if (events.every((event) => event.registrationSubject.kind === "occurrence" && event.seriesId === firstSeriesId)) return {
|
|
32229
|
+
kind: "several",
|
|
32230
|
+
items: "dates"
|
|
32231
|
+
};
|
|
32232
|
+
return events.every((event) => event.registrationSubject.kind === "wholeSeries") && sameOffering(events) ? {
|
|
32233
|
+
kind: "several",
|
|
32234
|
+
items: "runs"
|
|
32235
|
+
} : SINGLE;
|
|
32236
|
+
}
|
|
32237
|
+
/**
|
|
32238
|
+
* The kind of several items chosen, or null for a selection of one. Only a
|
|
32239
|
+
* page that allows several lets a second item in, so the list alone decides.
|
|
32240
|
+
*/
|
|
32241
|
+
function severalItemsOf(selection) {
|
|
32242
|
+
if (selection.length < 2) return null;
|
|
32243
|
+
return selection[0]?.registrationSubject.kind === "wholeSeries" ? "runs" : "dates";
|
|
32244
|
+
}
|
|
32245
|
+
function selectionRowAvailability(event) {
|
|
32246
|
+
if (!isEventFull(event)) return "open";
|
|
32247
|
+
return canJoinEventWaitlistOnAnyMode(event) ? "waitlist" : "full";
|
|
32248
|
+
}
|
|
32249
|
+
/** One booking names at most this many items; the request parser refuses more. */
|
|
32250
|
+
const MAX_SELECTION_ITEMS = 20;
|
|
32251
|
+
const SELECTION_LIMIT_NOTE = `You can book up to ${MAX_SELECTION_ITEMS} at once.`;
|
|
32252
|
+
function selectionAtLimit(selection) {
|
|
32253
|
+
return selection.length >= MAX_SELECTION_ITEMS;
|
|
32254
|
+
}
|
|
32255
|
+
/** An open row can be ticked until the limit; a ticked row can always be unticked. */
|
|
32256
|
+
function canToggleSelectionItem(selection, event) {
|
|
32257
|
+
if (selectionIncludes(selection, event)) return true;
|
|
32258
|
+
return selectionRowAvailability(event) === "open" && !selectionAtLimit(selection);
|
|
32259
|
+
}
|
|
32260
|
+
/**
|
|
32261
|
+
* Ticking adds a row and unticking removes it; the list stays in date order.
|
|
32262
|
+
* A row that can't be ticked leaves the selection as it is.
|
|
32263
|
+
*/
|
|
32264
|
+
function toggleSelectionItem(selection, event) {
|
|
32265
|
+
if (!canToggleSelectionItem(selection, event)) return selection;
|
|
32266
|
+
return [...selection.some((item) => item.selectionId === event.selectionId) ? selection.filter((item) => item.selectionId !== event.selectionId) : [...selection, event]].sort((left, right) => Date.parse(left.startsAt) - Date.parse(right.startsAt));
|
|
32267
|
+
}
|
|
32268
|
+
/** What the visitor is booking: the ticked items, or the page's own event before anything is ticked. */
|
|
32269
|
+
function effectiveSelection(selection, preSelectedEvent) {
|
|
32270
|
+
if (selection.length > 0) return selection;
|
|
32271
|
+
return preSelectedEvent ? [preSelectedEvent] : [];
|
|
32272
|
+
}
|
|
32273
|
+
function primarySelectionItem(selection) {
|
|
32274
|
+
return selection[0] ?? null;
|
|
32275
|
+
}
|
|
32276
|
+
function selectionIncludes(selection, event) {
|
|
32277
|
+
return selection.some((item) => item.selectionId === event.selectionId);
|
|
32278
|
+
}
|
|
32279
|
+
function nonEmpty(items) {
|
|
32280
|
+
const [first, ...rest] = items;
|
|
32281
|
+
return first === void 0 ? null : [first, ...rest];
|
|
32282
|
+
}
|
|
32283
|
+
function singleBookingSelection(subject, eventSeriesId) {
|
|
32284
|
+
return subject.kind === "occurrence" ? {
|
|
32285
|
+
kind: "dates",
|
|
32286
|
+
...eventSeriesId ? { eventSeriesId } : {},
|
|
32287
|
+
occurrenceIds: [subject.occurrenceId]
|
|
32288
|
+
} : {
|
|
32289
|
+
kind: "runs",
|
|
32290
|
+
eventOfferingId: subject.eventOfferingId,
|
|
32291
|
+
eventSeriesIds: [subject.eventSeriesId]
|
|
32292
|
+
};
|
|
32293
|
+
}
|
|
32294
|
+
function severalBookingSelection(selection) {
|
|
32295
|
+
const subjects = selection.map((event) => event.registrationSubject);
|
|
32296
|
+
const occurrenceIds = nonEmpty(subjects.flatMap((subject) => subject.kind === "occurrence" ? [subject.occurrenceId] : []));
|
|
32297
|
+
if (occurrenceIds && occurrenceIds.length === subjects.length) return {
|
|
32298
|
+
kind: "dates",
|
|
32299
|
+
eventSeriesId: selection[0]?.seriesId,
|
|
32300
|
+
occurrenceIds
|
|
32301
|
+
};
|
|
32302
|
+
const runs = subjects.flatMap((subject) => subject.kind === "wholeSeries" ? [subject] : []);
|
|
32303
|
+
const eventSeriesIds = nonEmpty(runs.map((run) => run.eventSeriesId));
|
|
32304
|
+
return eventSeriesIds && runs.length === subjects.length ? {
|
|
32305
|
+
kind: "runs",
|
|
32306
|
+
eventOfferingId: runs[0]?.eventOfferingId,
|
|
32307
|
+
eventSeriesIds
|
|
32308
|
+
} : null;
|
|
32309
|
+
}
|
|
32310
|
+
/**
|
|
32311
|
+
* The booking request's selection. One item keeps the subject the page
|
|
32312
|
+
* decided (a dated page books its date); several items name them all.
|
|
32313
|
+
*/
|
|
32314
|
+
function toBookingSelection(input) {
|
|
32315
|
+
return (input.selection.length > 1 ? severalBookingSelection(input.selection) : null) ?? singleBookingSelection(input.subject, input.selection[0]?.seriesId);
|
|
32316
|
+
}
|
|
32317
|
+
function toBookingSelectionRequest(selection, attendanceMode) {
|
|
32318
|
+
const mode = attendanceMode ? { attendanceMode } : {};
|
|
32319
|
+
return {
|
|
32320
|
+
...selection,
|
|
32321
|
+
...mode
|
|
32322
|
+
};
|
|
32323
|
+
}
|
|
32324
|
+
/** "Part 1 and Part 2", "A, B and C". */
|
|
32325
|
+
function joinNames(names) {
|
|
32326
|
+
const last = names[names.length - 1] ?? "";
|
|
32327
|
+
return names.length < 2 ? last : `${names.slice(0, -1).join(", ")} and ${last}`;
|
|
32328
|
+
}
|
|
32329
|
+
function countLabel(count, singular) {
|
|
32330
|
+
return `${count} ${singular}${count === 1 ? "" : "s"}`;
|
|
32331
|
+
}
|
|
32332
|
+
/** The summary bar's "what": "3 dates", or the runs by name. */
|
|
32333
|
+
function selectionItemsLabel(kind, selection) {
|
|
32334
|
+
return kind === "dates" ? countLabel(selection.length, "date") : joinNames(selection.map((event) => selectionItemName(event, selection)));
|
|
32335
|
+
}
|
|
32336
|
+
/** "5 dates × 2 places" once places are counted; just the items for one place. */
|
|
32337
|
+
function selectionPlacesLabel(kind, selection, places) {
|
|
32338
|
+
const items = selectionItemsLabel(kind, selection);
|
|
32339
|
+
return places > 1 ? `${items} × ${countLabel(places, "place")}` : items;
|
|
32340
|
+
}
|
|
32341
|
+
/** The tickets step's note: one number covers every chosen item. */
|
|
32342
|
+
function selectionPlacesNote(kind, count) {
|
|
32343
|
+
return `You’ll have this many places on each of your ${count} ${kind === "dates" ? "dates" : "runs"}.`;
|
|
32344
|
+
}
|
|
32345
|
+
/** The details step's email hint. */
|
|
32346
|
+
function selectionConfirmationHint(kind) {
|
|
32347
|
+
switch (kind) {
|
|
32348
|
+
case null: return "We’ll send your confirmation here.";
|
|
32349
|
+
case "dates": return "We’ll send a confirmation for each date here.";
|
|
32350
|
+
case "runs": return "We’ll send a confirmation for each run here.";
|
|
32351
|
+
}
|
|
32352
|
+
}
|
|
32353
|
+
/** The consent tick for dates covers them all; runs keep their own wording. */
|
|
32354
|
+
function selectionConsentLabel(kind, count, label) {
|
|
32355
|
+
return kind === "dates" ? `I agree. This applies to all ${count} dates.` : label;
|
|
32356
|
+
}
|
|
32357
|
+
/** The confirmation's line for several bookings: each gets its own email. */
|
|
32358
|
+
function severalConfirmationSentence(kind, email) {
|
|
32359
|
+
const each = kind === "dates" ? "date" : "run";
|
|
32360
|
+
const to = email.trim();
|
|
32361
|
+
return to ? `We’ve emailed a confirmation for each ${each} to ${to}.` : `We’ve emailed a confirmation for each ${each}.`;
|
|
32362
|
+
}
|
|
32363
|
+
const SEVERAL_BOOKINGS_ACCOUNT_NOTE = "You can see and manage your bookings in your account.";
|
|
32364
|
+
/**
|
|
32365
|
+
* Why passes and memberships, and the first item's deposit or instalments
|
|
32366
|
+
* when it had them, aren't offered while several items are ticked.
|
|
32367
|
+
*/
|
|
32368
|
+
function selectionEntitlementNote(kind, hadDepositOrInstalments) {
|
|
32369
|
+
return `${hadDepositOrInstalments ? "Deposits, instalments, class passes and memberships" : "Class passes and memberships"} can be used when you book one ${kind === "dates" ? "date" : "run"} at a time.`;
|
|
32370
|
+
}
|
|
32371
|
+
const NO_RUN_PRICING_CHOICES = {};
|
|
32372
|
+
/** Runs whose price needs a choice get their own section on the tickets step. */
|
|
32373
|
+
function runNeedsPricingChoice(run) {
|
|
32374
|
+
const strategy = publicEventPricingStrategy(run.pricing);
|
|
32375
|
+
return strategy === "tiered" || strategy === "sliding_scale";
|
|
32376
|
+
}
|
|
32377
|
+
function firstOpenTicketType(pricing) {
|
|
32378
|
+
return pricing.kind === "tiered" ? pricing.options.find((option) => option.isActive && option.availability.kind === "available")?.id ?? null : null;
|
|
32379
|
+
}
|
|
32380
|
+
/** A run starts on its first open ticket type, or its suggested amount, as a single booking does. */
|
|
32381
|
+
function defaultRunPricingChoice(run) {
|
|
32382
|
+
const suggested = run.pricing.kind === "sliding_scale" ? run.pricing.suggested : null;
|
|
32383
|
+
return {
|
|
32384
|
+
pricingOptionId: firstOpenTicketType(run.pricing),
|
|
32385
|
+
slidingAmountInput: suggested === null ? "" : formatCentsAsCurrencyInput(suggested)
|
|
32386
|
+
};
|
|
32387
|
+
}
|
|
32388
|
+
function runPricingChoice(choices, run) {
|
|
32389
|
+
return choices[run.selectionId] ?? defaultRunPricingChoice(run);
|
|
32390
|
+
}
|
|
32391
|
+
/** Keeps the choices of runs still selected, so unticking a run forgets it. */
|
|
32392
|
+
function keepRunPricingChoices(choices, selection) {
|
|
32393
|
+
return Object.fromEntries(Object.entries(choices).filter(([id]) => selection.some((event) => event.selectionId === id)));
|
|
32394
|
+
}
|
|
32395
|
+
/** One run's price per place under its choice, or null while the choice is incomplete. */
|
|
32396
|
+
function runUnitPriceCents(run, choice) {
|
|
32397
|
+
const pricing = run.pricing;
|
|
32398
|
+
switch (pricing.kind) {
|
|
32399
|
+
case "free": return 0;
|
|
32400
|
+
case "single": return pricing.amount;
|
|
32401
|
+
case "sliding_scale": {
|
|
32402
|
+
const amount = parseCurrencyInputToCents(choice.slidingAmountInput);
|
|
32403
|
+
return amount !== null && amount >= pricing.minimum && amount <= pricing.maximum ? amount : null;
|
|
32404
|
+
}
|
|
32405
|
+
case "tiered": return pricing.options.find((option) => option.id === choice.pricingOptionId)?.priceAmount ?? null;
|
|
32406
|
+
case "external": return null;
|
|
32407
|
+
}
|
|
32408
|
+
}
|
|
32409
|
+
/**
|
|
32410
|
+
* Whether a run's choice can be booked. A ticket type passes the same rules
|
|
32411
|
+
* a single booking's ticket lines do (active, available in this way of
|
|
32412
|
+
* attending, enough places left), so a choice restored from an earlier visit
|
|
32413
|
+
* is checked again rather than trusted because its ID still exists.
|
|
32414
|
+
*/
|
|
32415
|
+
function runChoiceUsable(run, choice, facts) {
|
|
32416
|
+
if (runUnitPriceCents(run, choice) === null) return false;
|
|
32417
|
+
if (run.pricing.kind !== "tiered") return true;
|
|
32418
|
+
const lines = [{
|
|
32419
|
+
pricingOptionId: choice.pricingOptionId,
|
|
32420
|
+
quantity: facts.places
|
|
32421
|
+
}];
|
|
32422
|
+
return hasValidPricingOptionSelection({
|
|
32423
|
+
selectionRequired: true,
|
|
32424
|
+
purpose: "book",
|
|
32425
|
+
maxTickets: facts.maxTickets,
|
|
32426
|
+
overallRemainingPlaces: getTicketSelectionRemainingPlaces({
|
|
32427
|
+
event: run,
|
|
32428
|
+
eligibility: null,
|
|
32429
|
+
attendanceMode: facts.attendanceMode
|
|
32430
|
+
}),
|
|
32431
|
+
lines,
|
|
32432
|
+
visibleOptions: getVisibleTicketTypes({
|
|
32433
|
+
event: run,
|
|
32434
|
+
eligibility: null,
|
|
32435
|
+
selectedAttendanceMode: facts.attendanceMode,
|
|
32436
|
+
ticketSelections: lines
|
|
32437
|
+
})
|
|
32438
|
+
});
|
|
32439
|
+
}
|
|
32440
|
+
/** The first run whose choice can't be booked yet, with why. */
|
|
32441
|
+
function incompleteRunChoiceMessage(input) {
|
|
32442
|
+
const incomplete = input.selection.find((run) => !runChoiceUsable(run, runPricingChoice(input.runChoices, run), input.facts));
|
|
32443
|
+
if (!incomplete) return null;
|
|
32444
|
+
const name = selectionItemName(incomplete, input.selection);
|
|
32445
|
+
return incomplete.pricing.kind === "tiered" ? `Choose a ticket for ${name}.` : `Choose an amount for ${name} within the sliding scale.`;
|
|
32446
|
+
}
|
|
32447
|
+
/**
|
|
32448
|
+
* How the visitor attends, decided once for the whole selection. One way of
|
|
32449
|
+
* attending applies to every item: the visitor picks from the ways every
|
|
32450
|
+
* item offers, and an item that only runs one way decides it. Items with no
|
|
32451
|
+
* way in common can't be booked together.
|
|
32452
|
+
*/
|
|
32453
|
+
/**
|
|
32454
|
+
* What several runs still need before the tickets step can go on: one way
|
|
32455
|
+
* of attending for them all, then a usable ticket or amount for each run.
|
|
32456
|
+
*/
|
|
32457
|
+
function severalRunsChoiceMessage(input) {
|
|
32458
|
+
if (input.attendance.kind === "incompatible") return INCOMPATIBLE_ATTENDANCE_MESSAGE;
|
|
32459
|
+
if (input.attendance.kind === "choose" && input.facts.attendanceMode === null) return "Choose whether you want to attend in person or online.";
|
|
32460
|
+
return incompleteRunChoiceMessage(input);
|
|
32461
|
+
}
|
|
32462
|
+
function selectionTicketInputs(input) {
|
|
32463
|
+
const priced = pricedTicketInputs(input);
|
|
32464
|
+
const ticketsCount = input.invitation.kind === "ready" ? input.invitation.restoration.ticketsCount : priced.usesTicketLines ? getTicketSelectionTotal(priced.lines) : input.placeCount;
|
|
32465
|
+
return {
|
|
32466
|
+
...priced,
|
|
32467
|
+
ticketsCount
|
|
32468
|
+
};
|
|
32469
|
+
}
|
|
32470
|
+
function pricedTicketInputs(input) {
|
|
32471
|
+
if (input.several === "runs" && input.primary) {
|
|
32472
|
+
const choice = runPricingChoice(input.runChoices, input.primary);
|
|
32473
|
+
return {
|
|
32474
|
+
usesTicketLines: false,
|
|
32475
|
+
lines: [{
|
|
32476
|
+
pricingOptionId: choice.pricingOptionId,
|
|
32477
|
+
quantity: input.placeCount
|
|
32478
|
+
}],
|
|
32479
|
+
slidingAmountInput: choice.slidingAmountInput
|
|
32480
|
+
};
|
|
32481
|
+
}
|
|
32482
|
+
const tiered = input.primary ? publicEventPricingStrategy(input.primary.pricing) === "tiered" : input.lines.some((line) => line.pricingOptionId !== null);
|
|
32483
|
+
return {
|
|
32484
|
+
usesTicketLines: tiered,
|
|
32485
|
+
lines: tiered ? input.lines : [{
|
|
32486
|
+
pricingOptionId: null,
|
|
32487
|
+
quantity: input.placeCount
|
|
32488
|
+
}],
|
|
32489
|
+
slidingAmountInput: input.slidingAmountInput
|
|
32490
|
+
};
|
|
32491
|
+
}
|
|
32492
|
+
function planSelectionPrice(input) {
|
|
32493
|
+
const listTotalCents = selectionListTotalCents(input);
|
|
32494
|
+
const combination = input.several === null ? null : planSelectionCombination({
|
|
32495
|
+
offers: combinationOffersOf(input.selection),
|
|
32496
|
+
selection: input.selection,
|
|
32497
|
+
places: input.places,
|
|
32498
|
+
itemPrice: selectionItemPrice(input)
|
|
32499
|
+
});
|
|
32500
|
+
return planCombines(combination) ? {
|
|
32501
|
+
listTotalCents: combination.listTotalCents,
|
|
32502
|
+
totalCents: combination.totalCents,
|
|
32503
|
+
combination
|
|
32504
|
+
} : {
|
|
32505
|
+
listTotalCents,
|
|
32506
|
+
totalCents: listTotalCents,
|
|
32507
|
+
combination
|
|
32508
|
+
};
|
|
32509
|
+
}
|
|
32510
|
+
function publicSinglePriceCents(event, places) {
|
|
32511
|
+
const pricing = event?.pricing;
|
|
32512
|
+
if (pricing?.kind === "free") return 0;
|
|
32513
|
+
return pricing?.kind === "single" ? pricing.amount * places : null;
|
|
32514
|
+
}
|
|
32515
|
+
function selectionListTotalCents(input) {
|
|
32516
|
+
switch (input.several) {
|
|
32517
|
+
case null: return input.primarySubtotalCents;
|
|
32518
|
+
case "dates": {
|
|
32519
|
+
const each = input.primarySubtotalCents ?? publicSinglePriceCents(input.selection[0], input.places);
|
|
32520
|
+
return each === null ? null : each * input.selection.length;
|
|
32521
|
+
}
|
|
32522
|
+
case "runs": {
|
|
32523
|
+
const units = input.selection.map((run) => runUnitPriceCents(run, runPricingChoice(input.runChoices, run)));
|
|
32524
|
+
return units.every((unit) => unit !== null) ? units.reduce((total, unit) => total + unit * input.places, 0) : null;
|
|
32525
|
+
}
|
|
32526
|
+
}
|
|
32527
|
+
}
|
|
32528
|
+
function summariseSelectionPayment(input) {
|
|
32529
|
+
const { listTotalCents } = input.price;
|
|
32530
|
+
const { several, quote } = input;
|
|
32531
|
+
if (several === null || input.ready === false) return null;
|
|
32532
|
+
const combination = input.price.combination;
|
|
32533
|
+
return (combination ? summariseCombinedPayment({
|
|
32534
|
+
plan: combination,
|
|
32535
|
+
several,
|
|
32536
|
+
quote
|
|
32537
|
+
}) : null) ?? plainSelectionPayment({
|
|
32538
|
+
...input,
|
|
32539
|
+
several,
|
|
32540
|
+
listTotalCents
|
|
32541
|
+
});
|
|
32542
|
+
}
|
|
32543
|
+
/** Several items without combination prices: each at its price, the places, any automatic code, the total. */
|
|
32544
|
+
function plainSelectionPayment(input) {
|
|
32545
|
+
const { several, quote, listTotalCents } = input;
|
|
32546
|
+
const lines = input.selection.map((event) => ({
|
|
32547
|
+
key: event.selectionId,
|
|
32548
|
+
label: selectionItemName(event, input.selection),
|
|
32549
|
+
price: itemPriceCents(input, event)
|
|
32550
|
+
}));
|
|
32551
|
+
const priced = lines.flatMap((line) => line.price === null ? [] : [{
|
|
32552
|
+
key: line.key,
|
|
32553
|
+
label: line.price.unitPriceCents === null ? `${line.label} (${countLabel(input.places, "place")})` : line.label,
|
|
32554
|
+
amountCents: line.price.unitPriceCents ?? line.price.subtotalCents
|
|
32555
|
+
}]);
|
|
32556
|
+
const totalCents = quote ? quote.preview.totalAfterDiscountCents : input.price.totalCents;
|
|
32557
|
+
if (priced.length !== lines.length || listTotalCents === null || totalCents === null) return null;
|
|
32558
|
+
return {
|
|
32559
|
+
kind: "plain",
|
|
32560
|
+
lines: priced,
|
|
32561
|
+
placesLabel: `${countLabel(input.places, "place")} on each ${several === "runs" ? "run" : "date"}`,
|
|
32562
|
+
subtotalCents: listTotalCents,
|
|
32563
|
+
reductions: quoteReductions(quote),
|
|
32564
|
+
totalCents
|
|
32565
|
+
};
|
|
32566
|
+
}
|
|
32567
|
+
/** The code's line, when it takes anything off. */
|
|
32568
|
+
function quoteReductions(quote) {
|
|
32569
|
+
if (!quote) return [];
|
|
32570
|
+
if (quote.preview.priceReductions) return quote.preview.priceReductions.map((row, index) => ({
|
|
32571
|
+
key: `reduction-${index}`,
|
|
32572
|
+
label: row.kind === "discount_code" ? quoteLineLabel(quote) : row.label,
|
|
32573
|
+
amountCents: row.amountCents
|
|
32574
|
+
}));
|
|
32575
|
+
return quote.preview.type === "applied" && quote.preview.discountCents > 0 ? [{
|
|
32576
|
+
key: "code",
|
|
32577
|
+
label: quoteLineLabel(quote),
|
|
32578
|
+
amountCents: quote.preview.discountCents
|
|
32579
|
+
}] : [];
|
|
32580
|
+
}
|
|
32581
|
+
/** Exact totals are never reconstructed from an average ticket price. */
|
|
32582
|
+
function itemPriceCents(input, event) {
|
|
32583
|
+
const unitPriceCents = input.several === "runs" ? runUnitPriceCents(event, runPricingChoice(input.runChoices, event)) : publicSinglePriceCents(event, 1);
|
|
32584
|
+
const subtotalCents = input.several === "runs" ? unitPriceCents === null ? null : unitPriceCents * input.places : input.primarySubtotalCents ?? publicSinglePriceCents(event, input.places);
|
|
32585
|
+
return subtotalCents === null ? null : {
|
|
32586
|
+
subtotalCents,
|
|
32587
|
+
unitPriceCents,
|
|
32588
|
+
...input.several !== "runs" && input.primaryTicketUnits?.length ? { ticketUnits: input.primaryTicketUnits } : {}
|
|
32589
|
+
};
|
|
32590
|
+
}
|
|
32591
|
+
/** Exact item totals, with a unit price only when its places have one price. */
|
|
32592
|
+
function selectionItemPrice(input) {
|
|
32593
|
+
return (event) => itemPriceCents(input, event);
|
|
32594
|
+
}
|
|
32595
|
+
function decideSelectionPayment(input) {
|
|
32596
|
+
const several = severalItemsOf(input.selection);
|
|
32597
|
+
if (several === null) return { kind: "one-item" };
|
|
32598
|
+
return {
|
|
32599
|
+
kind: "several",
|
|
32600
|
+
due: selectionCostsNothing(several, input) ? "nothing" : "card"
|
|
32601
|
+
};
|
|
32602
|
+
}
|
|
32603
|
+
function selectionCostsNothing(several, input) {
|
|
32604
|
+
switch (several) {
|
|
32605
|
+
case "runs": return input.selection.every((run) => runUnitPriceCents(run, runPricingChoice(input.runChoices, run)) === 0);
|
|
32606
|
+
case "dates": {
|
|
32607
|
+
const first = input.selection[0];
|
|
32608
|
+
if (input.eligibility) return input.eligibility.isFree;
|
|
32609
|
+
return first !== void 0 && publicEventPricingType(first.pricing) === "free";
|
|
32610
|
+
}
|
|
32611
|
+
}
|
|
32612
|
+
}
|
|
32613
|
+
//#endregion
|
|
32614
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/selectionRequirements.state.ts
|
|
32615
|
+
const ONE = { kind: "one" };
|
|
32616
|
+
function decideSelectionRequirementsLayout(selection) {
|
|
32617
|
+
const [first, ...rest] = selection;
|
|
32618
|
+
if (severalItemsOf(selection) !== "runs" || first === void 0) return ONE;
|
|
32619
|
+
return areEventBookingRequirementsIdentical(selection.map((run) => ({
|
|
32620
|
+
consent: run.consent ?? null,
|
|
32621
|
+
bookingQuestions: run.bookingQuestions
|
|
32622
|
+
}))) ? {
|
|
32623
|
+
kind: "shared",
|
|
32624
|
+
source: first
|
|
32625
|
+
} : {
|
|
32626
|
+
kind: "per_run",
|
|
32627
|
+
runs: [first, ...rest]
|
|
32628
|
+
};
|
|
32629
|
+
}
|
|
32630
|
+
/**
|
|
32631
|
+
* Keeping earlier answers is offered only when every run offers it. Shared
|
|
32632
|
+
* questions are shown for one run, so they're always answered afresh (with
|
|
32633
|
+
* the earlier answers filled in); the server checks each run either way.
|
|
32634
|
+
*/
|
|
32635
|
+
function withoutKeptAnswers(state) {
|
|
32636
|
+
const refreshed = state.refreshed;
|
|
32637
|
+
if (refreshed?.presentation.kind !== "already_answered") return state;
|
|
32638
|
+
const { set, answers } = refreshed.presentation;
|
|
32639
|
+
return {
|
|
32640
|
+
...state,
|
|
32641
|
+
refreshed: {
|
|
32642
|
+
...refreshed,
|
|
32643
|
+
presentation: {
|
|
32644
|
+
kind: "prefill",
|
|
32645
|
+
set,
|
|
32646
|
+
answers
|
|
32647
|
+
}
|
|
32648
|
+
}
|
|
32649
|
+
};
|
|
32650
|
+
}
|
|
32651
|
+
const runConsentAcceptanceSchema = z.object({
|
|
32652
|
+
requirementId: z.string().min(1),
|
|
32653
|
+
contentKey: z.string().min(1),
|
|
32654
|
+
owner: bookingQuestionsOwnerSchema
|
|
32655
|
+
});
|
|
32656
|
+
const NO_RUN_REQUIREMENTS = {};
|
|
32657
|
+
const EMPTY_RUN_ANSWERS = {
|
|
32658
|
+
questions: EMPTY_BOOKING_QUESTIONS_ANSWERS,
|
|
32659
|
+
consent: null,
|
|
32660
|
+
readFailedFor: null
|
|
32661
|
+
};
|
|
32662
|
+
function runAnswers(state, seriesId) {
|
|
32663
|
+
return state[seriesId] ?? EMPTY_RUN_ANSWERS;
|
|
32664
|
+
}
|
|
32665
|
+
function acceptanceOf(consent, identity) {
|
|
32666
|
+
return {
|
|
32667
|
+
requirementId: consent.requirementId,
|
|
32668
|
+
contentKey: eventBookingConsentContentKey(consent),
|
|
32669
|
+
owner: bookingQuestionsOwnerOf(identity)
|
|
32670
|
+
};
|
|
32671
|
+
}
|
|
32672
|
+
/** Whether a tick still stands for this run's agreement as it is now, and for this visitor. */
|
|
32673
|
+
function isRunConsentAccepted(acceptance, consent, identity) {
|
|
32674
|
+
if (!acceptance || !consent) return false;
|
|
32675
|
+
return acceptance.requirementId === consent.requirementId && acceptance.contentKey === eventBookingConsentContentKey(consent) && isBookingQuestionsOwner(acceptance.owner, identity);
|
|
32676
|
+
}
|
|
32677
|
+
function applyRunEvent(current, event) {
|
|
32678
|
+
switch (event.type) {
|
|
32679
|
+
case "consent-accepted": return {
|
|
32680
|
+
...current,
|
|
32681
|
+
consent: acceptanceOf(event.consent, event.identity)
|
|
32682
|
+
};
|
|
32683
|
+
case "consent-withdrawn": return {
|
|
32684
|
+
...current,
|
|
32685
|
+
consent: null
|
|
32686
|
+
};
|
|
32687
|
+
case "questions-read-failed": return {
|
|
32688
|
+
...current,
|
|
32689
|
+
readFailedFor: event.identity
|
|
32690
|
+
};
|
|
32691
|
+
case "questions": {
|
|
32692
|
+
const questions = applyBookingQuestionsAnswerEvent(current.questions, event.event);
|
|
32693
|
+
const readAgain = event.event.type === "booking-questions-refreshed" || event.event.type === "booking-questions-keep-refused";
|
|
32694
|
+
return {
|
|
32695
|
+
...current,
|
|
32696
|
+
questions,
|
|
32697
|
+
readFailedFor: readAgain ? null : current.readFailedFor
|
|
32698
|
+
};
|
|
32699
|
+
}
|
|
32700
|
+
}
|
|
32701
|
+
}
|
|
32702
|
+
function applyRunRequirementsEvent(state, seriesId, event) {
|
|
32703
|
+
return {
|
|
32704
|
+
...state,
|
|
32705
|
+
[seriesId]: applyRunEvent(runAnswers(state, seriesId), event)
|
|
32706
|
+
};
|
|
32707
|
+
}
|
|
32708
|
+
function deriveRunRequirements(state, runs, identity) {
|
|
32709
|
+
return runs.map((run) => {
|
|
32710
|
+
const answers = runAnswers(state, run.seriesId);
|
|
32711
|
+
const consent = run.consent ?? null;
|
|
32712
|
+
return {
|
|
32713
|
+
run,
|
|
32714
|
+
questions: deriveBookingQuestions(answers.questions, runQuestionsTarget(run), identity),
|
|
32715
|
+
consent,
|
|
32716
|
+
consentAccepted: isRunConsentAccepted(answers.consent, consent, identity)
|
|
32717
|
+
};
|
|
32718
|
+
});
|
|
32719
|
+
}
|
|
32720
|
+
/**
|
|
32721
|
+
* The next run whose signed-in read is still owed: the first that needs one
|
|
32722
|
+
* and hasn't already failed for this identity. Null when none is owed.
|
|
32723
|
+
*/
|
|
32724
|
+
function nextRunToRead(state, runs, identity) {
|
|
32725
|
+
return runs.find((run) => {
|
|
32726
|
+
const answers = runAnswers(state, run.seriesId);
|
|
32727
|
+
return answers.readFailedFor !== identity && needsBookingQuestionsRefresh({
|
|
32728
|
+
target: runQuestionsTarget(run),
|
|
32729
|
+
identity,
|
|
32730
|
+
refreshed: answers.questions.refreshed
|
|
32731
|
+
});
|
|
32732
|
+
})?.seriesId ?? null;
|
|
32733
|
+
}
|
|
32734
|
+
/**
|
|
32735
|
+
* The server refused "keep my earlier answers" for a booking of several runs.
|
|
32736
|
+
* Its refusal doesn't say which run, so every run that chose to keep its
|
|
32737
|
+
* answers is asked afresh.
|
|
32738
|
+
*/
|
|
32739
|
+
function runsKeepingAnswers(runs) {
|
|
32740
|
+
return runs.filter((view) => view.questions.submission?.kind === "keep_existing");
|
|
32741
|
+
}
|
|
32742
|
+
function runQuestionsTarget(run) {
|
|
32743
|
+
return {
|
|
32744
|
+
targetKey: run.seriesId,
|
|
32745
|
+
publicPresentation: run.bookingQuestions
|
|
32746
|
+
};
|
|
32747
|
+
}
|
|
32748
|
+
/** The agreement is pinned to the attachment and the exact words shown. */
|
|
32749
|
+
function runSubmission(consent, consentAccepted, questions) {
|
|
32750
|
+
return {
|
|
32751
|
+
...questions ? { bookingQuestions: questions } : {},
|
|
32752
|
+
...consent ? { consent: {
|
|
32753
|
+
requirementId: consent.requirementId,
|
|
32754
|
+
contentKey: eventBookingConsentContentKey(consent),
|
|
32755
|
+
accepted: consentAccepted
|
|
32756
|
+
} } : {}
|
|
32757
|
+
};
|
|
32758
|
+
}
|
|
32759
|
+
/**
|
|
32760
|
+
* What a runs selection sends for its questions and agreement; nothing for
|
|
32761
|
+
* `one`, which keeps the request a single booking has always sent.
|
|
32762
|
+
*/
|
|
32763
|
+
function buildSelectionRequirementsSubmission(input) {
|
|
32764
|
+
const { layout } = input;
|
|
32765
|
+
switch (layout.kind) {
|
|
32766
|
+
case "one": return;
|
|
32767
|
+
case "shared": return {
|
|
32768
|
+
kind: "shared",
|
|
32769
|
+
sourceEventSeriesId: layout.source.seriesId,
|
|
32770
|
+
submission: runSubmission(layout.source.consent ?? null, input.shared.consentAccepted, input.shared.questions)
|
|
32771
|
+
};
|
|
32772
|
+
case "per_run": return {
|
|
32773
|
+
kind: "per_run",
|
|
32774
|
+
bySeriesId: Object.fromEntries(input.runs.map((view) => [view.run.seriesId, runSubmission(view.consent, view.consentAccepted, view.questions.submission)]))
|
|
32775
|
+
};
|
|
32776
|
+
}
|
|
32777
|
+
}
|
|
32778
|
+
/** Field errors for one run's questions are kept apart, since two runs can share field IDs. */
|
|
32779
|
+
function runFieldErrorKey(seriesId, fieldId) {
|
|
32780
|
+
return `${seriesId}:${fieldId}`;
|
|
32781
|
+
}
|
|
32782
|
+
/**
|
|
32783
|
+
* One run's field errors: its own, plus any the server named by field alone
|
|
32784
|
+
* for a question this run asks.
|
|
32785
|
+
*/
|
|
32786
|
+
function runFieldErrors(errors, seriesId, presentation) {
|
|
32787
|
+
const fieldIds = presentation.kind === "none" || presentation.kind === "unavailable" ? [] : presentation.set.sections.flatMap((section) => section.items.map((field) => field.id));
|
|
32788
|
+
return Object.fromEntries(fieldIds.flatMap((fieldId) => {
|
|
32789
|
+
const message = errors[runFieldErrorKey(seriesId, fieldId)] ?? errors[fieldId];
|
|
32790
|
+
return message === void 0 ? [] : [[fieldId, message]];
|
|
32791
|
+
}));
|
|
32792
|
+
}
|
|
32793
|
+
const RUN_CONSENT_REQUIRED_MESSAGE = "Please read and accept the agreement before continuing.";
|
|
32794
|
+
/**
|
|
32795
|
+
* Every run's questions and agreement before the details step moves on. A
|
|
32796
|
+
* run whose questions can't be shown stops the booking; otherwise each
|
|
32797
|
+
* unanswered question and unticked agreement is pointed at.
|
|
32798
|
+
*/
|
|
32799
|
+
function checkRunRequirements(runs) {
|
|
32800
|
+
const checks = runs.map((view) => ({
|
|
32801
|
+
seriesId: view.run.seriesId,
|
|
32802
|
+
check: checkBookingQuestionsAnswered(view.questions)
|
|
32803
|
+
}));
|
|
32804
|
+
const refused = checks.find((entry) => entry.check.kind === "refused")?.check;
|
|
32805
|
+
const unanswered = checks.flatMap(({ seriesId, check }) => check.kind === "unanswered" ? [{
|
|
32806
|
+
message: check.message,
|
|
32807
|
+
fieldErrors: Object.entries(check.fieldErrors).map(([fieldId, message]) => [runFieldErrorKey(seriesId, fieldId), message])
|
|
32808
|
+
}] : []);
|
|
32809
|
+
const first = unanswered[0];
|
|
32810
|
+
return {
|
|
32811
|
+
questions: refused ?? (first ? {
|
|
32812
|
+
kind: "unanswered",
|
|
32813
|
+
message: first.message,
|
|
32814
|
+
fieldErrors: Object.fromEntries(unanswered.flatMap((entry) => entry.fieldErrors))
|
|
32815
|
+
} : { kind: "ok" }),
|
|
32816
|
+
consentErrors: Object.fromEntries(runs.flatMap((view) => view.consent && !view.consentAccepted ? [[view.run.seriesId, RUN_CONSENT_REQUIRED_MESSAGE]] : []))
|
|
32817
|
+
};
|
|
32818
|
+
}
|
|
32819
|
+
/** Entries saved before a tick named its agreement carry only a boolean, which is dropped: the box comes back unticked. */
|
|
32820
|
+
const runRequirementsSnapshotSchema = z.object({
|
|
32821
|
+
bookingQuestions: bookingQuestionsPaymentSnapshotSchema.optional(),
|
|
32822
|
+
consent: z.optional(runConsentAcceptanceSchema)
|
|
32823
|
+
});
|
|
32824
|
+
function toRunRequirementsSnapshots(state, runs) {
|
|
32825
|
+
return Object.fromEntries(runs.map((view) => {
|
|
32826
|
+
const questions = toBookingQuestionsPaymentSnapshot(view.questions);
|
|
32827
|
+
const consent = view.consentAccepted ? runAnswers(state, view.run.seriesId).consent : null;
|
|
32828
|
+
return [view.run.seriesId, {
|
|
32829
|
+
...questions ? { bookingQuestions: questions } : {},
|
|
32830
|
+
...consent ? { consent } : {}
|
|
32831
|
+
}];
|
|
32832
|
+
}));
|
|
32833
|
+
}
|
|
32834
|
+
/** Each run's answers come back only for whoever started the checkout, as a single booking's do. */
|
|
32835
|
+
function decideRunRequirementsRestoration(snapshots, currentIdentity) {
|
|
32836
|
+
return Object.fromEntries(Object.entries(snapshots).map(([seriesId, snapshot]) => [seriesId, {
|
|
32837
|
+
questions: snapshot.bookingQuestions ? decideBookingQuestionsRestoration({
|
|
32838
|
+
kind: "payment_snapshot",
|
|
32839
|
+
snapshot: snapshot.bookingQuestions,
|
|
32840
|
+
currentIdentity
|
|
32841
|
+
}) : null,
|
|
32842
|
+
consent: snapshot.consent ?? null
|
|
32843
|
+
}]));
|
|
32844
|
+
}
|
|
32845
|
+
function restoreRunRequirements(state, restoration) {
|
|
32846
|
+
return Object.entries(restoration).reduce((restored, [seriesId, run]) => {
|
|
32847
|
+
const current = runAnswers(restored, seriesId);
|
|
32848
|
+
return {
|
|
32849
|
+
...restored,
|
|
32850
|
+
[seriesId]: {
|
|
32851
|
+
...current,
|
|
32852
|
+
questions: restoreBookingQuestionsAnswers(current.questions, run.questions),
|
|
32853
|
+
consent: run.consent
|
|
32854
|
+
}
|
|
32855
|
+
};
|
|
32856
|
+
}, state);
|
|
32857
|
+
}
|
|
32858
|
+
/** Each run's answers in progress, kept in the sign-in draft. The agreement is ticked again, as a single booking's is. */
|
|
32859
|
+
function toRunQuestionsSignInDrafts(state) {
|
|
32860
|
+
return Object.fromEntries(Object.entries(state).map(([seriesId, answers]) => [seriesId, toBookingQuestionsAnswerDraft(answers.questions)]));
|
|
32861
|
+
}
|
|
32862
|
+
/** Each run's answers come back through the same verified decision as a single booking's. */
|
|
32863
|
+
function decideRunSignInRestoration(drafts, verifiedIdentity) {
|
|
32864
|
+
return Object.fromEntries(Object.entries(drafts).map(([seriesId, draft]) => [seriesId, {
|
|
32865
|
+
questions: decideBookingQuestionsRestoration({
|
|
32866
|
+
kind: "sign_in_draft",
|
|
32867
|
+
draft,
|
|
32868
|
+
verifiedIdentity
|
|
32869
|
+
}),
|
|
32870
|
+
consent: null
|
|
32871
|
+
}]));
|
|
32872
|
+
}
|
|
32873
|
+
//#endregion
|
|
32874
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/registrationPaymentReturn.ts
|
|
32875
|
+
/**
|
|
32876
|
+
* How a saved checkout lands once the page's events are ready. Its answers
|
|
32877
|
+
* come back only for the session (or signed-out visitor) that started it.
|
|
32878
|
+
*/
|
|
32879
|
+
function paymentReturnRestoration(pending, events, currentIdentity) {
|
|
32880
|
+
return {
|
|
32881
|
+
selection: findSelection(pending.selectedEventIds, events),
|
|
32882
|
+
runChoices: pending.runChoices ?? NO_RUN_PRICING_CHOICES,
|
|
32883
|
+
ticketLines: pending.ticketSelections,
|
|
32884
|
+
placeCount: getTicketSelectionTotal(pending.ticketSelections),
|
|
32885
|
+
formData: pending.formData,
|
|
32886
|
+
guests: pending.guests,
|
|
32887
|
+
slidingAmountInput: pending.selectedSlidingAmount === null ? "" : formatCentsAsCurrencyInput(pending.selectedSlidingAmount),
|
|
32888
|
+
attendanceMode: pending.selectedAttendanceMode ?? null,
|
|
32889
|
+
paymentSelection: pending.paymentSelection,
|
|
32890
|
+
questions: pending.bookingQuestions ? decideBookingQuestionsRestoration({
|
|
32891
|
+
kind: "payment_snapshot",
|
|
32892
|
+
snapshot: pending.bookingQuestions,
|
|
32893
|
+
currentIdentity
|
|
32894
|
+
}) : null,
|
|
32895
|
+
runRequirements: decideRunRequirementsRestoration(pending.runRequirements ?? {}, currentIdentity)
|
|
32896
|
+
};
|
|
32897
|
+
}
|
|
32898
|
+
/** Every saved item found again, in order, or none. */
|
|
32899
|
+
function findSelection(ids, events) {
|
|
32900
|
+
const found = ids.flatMap((id) => events.filter((event) => event.selectionId === id).slice(0, 1));
|
|
32901
|
+
return found.length === ids.length ? found : [];
|
|
32902
|
+
}
|
|
32903
|
+
//#endregion
|
|
32904
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/registrationSignInReturn.ts
|
|
32905
|
+
/**
|
|
32906
|
+
* What event registration keeps while the booker follows a sign-in link, so
|
|
32907
|
+
* they come back to the same step with what they'd typed. The storage, nonce
|
|
32908
|
+
* and return address are shared with the appointment booking form
|
|
32909
|
+
* (`shared/signInReturnDrafts.ts`, owned by `useSignInReturn`); this file owns
|
|
32910
|
+
* the event draft and how it's put back.
|
|
32911
|
+
*/
|
|
32912
|
+
/** Steps a draft can bring the booker back to; payment and later are never resumed this way. */
|
|
32913
|
+
const RESUMABLE_STEPS = [
|
|
32914
|
+
"select-event",
|
|
32915
|
+
"select-tickets",
|
|
32916
|
+
"enter-details",
|
|
32917
|
+
"select-payment"
|
|
32918
|
+
];
|
|
32919
|
+
/** Drafts saved before booking several existed name one event (or none). */
|
|
32920
|
+
const savedSelection = z.union([z.object({
|
|
32921
|
+
selectedEventIds: z.array(z.string()),
|
|
32922
|
+
runChoices: z.record(z.string(), z.object({
|
|
32923
|
+
pricingOptionId: z.string().nullable(),
|
|
32924
|
+
slidingAmountInput: z.string()
|
|
32925
|
+
}))
|
|
32926
|
+
}), z.object({ selectedEventId: z.string().nullable() }).transform(({ selectedEventId }) => ({
|
|
32927
|
+
selectedEventIds: selectedEventId === null ? [] : [selectedEventId],
|
|
32928
|
+
runChoices: NO_RUN_PRICING_CHOICES
|
|
32929
|
+
}))]);
|
|
32930
|
+
const draftFields = z.object({
|
|
32931
|
+
nonce: z.string().min(1),
|
|
32932
|
+
email: z.string(),
|
|
32933
|
+
step: z.enum(RESUMABLE_STEPS),
|
|
32934
|
+
selectedAttendanceMode: z.enum(["in_person", "online"]).nullable(),
|
|
32935
|
+
ticketSelections: z.array(z.object({
|
|
32936
|
+
pricingOptionId: z.string().nullable(),
|
|
32937
|
+
quantity: z.number().int().positive()
|
|
32938
|
+
})),
|
|
32939
|
+
ticketsCount: z.number().int().positive(),
|
|
32940
|
+
selectedSlidingAmountInput: z.string(),
|
|
32941
|
+
formData: z.object({
|
|
32942
|
+
name: z.string(),
|
|
32943
|
+
email: z.string(),
|
|
32944
|
+
phone: z.string(),
|
|
32945
|
+
notes: z.string(),
|
|
32946
|
+
mailingListOptIn: z.boolean().optional()
|
|
32947
|
+
}),
|
|
32948
|
+
guests: z.array(z.object({
|
|
32949
|
+
name: z.string(),
|
|
32950
|
+
email: z.string().nullable(),
|
|
32951
|
+
phone: z.string().nullable()
|
|
32952
|
+
})),
|
|
32953
|
+
discountCode: z.string(),
|
|
32954
|
+
questions: bookingQuestionsAnswerDraftSchema,
|
|
32955
|
+
runQuestions: z.record(z.string(), bookingQuestionsAnswerDraftSchema).default({})
|
|
32956
|
+
});
|
|
32957
|
+
/** Event registration's drafts, for the shared `useSignInReturn` owner. */
|
|
32958
|
+
const eventSignInDraftStore = createSignInReturnDraftStore(z.intersection(draftFields, savedSelection).transform((draft) => draft));
|
|
32959
|
+
/** The flow's key in sign-in storage: one registration surface per page. */
|
|
32960
|
+
const EVENT_SIGN_IN_FORM_ID = "event-registration";
|
|
32961
|
+
function resumableStep(step) {
|
|
32962
|
+
return RESUMABLE_STEPS.includes(step) ? step : "enter-details";
|
|
32963
|
+
}
|
|
32964
|
+
function toEventSignInDraft(source, attempt) {
|
|
32965
|
+
const { flow } = source;
|
|
32966
|
+
const { draft } = flow;
|
|
32967
|
+
const { consentAccepted: _consent, ...formData } = draft.formData;
|
|
32968
|
+
return {
|
|
32969
|
+
nonce: attempt.nonce,
|
|
32970
|
+
email: attempt.email,
|
|
32971
|
+
step: resumableStep(flow.step),
|
|
32972
|
+
selectedEventIds: draft.selection.map((event) => event.selectionId),
|
|
32973
|
+
runChoices: draft.runChoices,
|
|
32974
|
+
selectedAttendanceMode: draft.selectedAttendanceMode,
|
|
32975
|
+
ticketSelections: draft.selectedTicketLines,
|
|
32976
|
+
ticketsCount: flow.placeCount,
|
|
32977
|
+
selectedSlidingAmountInput: draft.selectedSlidingAmountInput,
|
|
32978
|
+
formData,
|
|
32979
|
+
guests: draft.guests,
|
|
32980
|
+
discountCode: source.discountCode,
|
|
32981
|
+
questions: toBookingQuestionsAnswerDraft(draft.bookingQuestions),
|
|
32982
|
+
runQuestions: toRunQuestionsSignInDrafts(draft.runRequirements)
|
|
32983
|
+
};
|
|
32984
|
+
}
|
|
32985
|
+
const HANDED_ON = [
|
|
32986
|
+
"success",
|
|
32987
|
+
"payment",
|
|
32988
|
+
"verifying-payment",
|
|
32989
|
+
"verifying-timeout",
|
|
32990
|
+
"payment-status"
|
|
32991
|
+
];
|
|
32992
|
+
/**
|
|
32993
|
+
* A booking that's confirmed or has gone to checkout ends every draft. Picking
|
|
32994
|
+
* another event doesn't: the draft follows what the booker is doing.
|
|
32995
|
+
*/
|
|
32996
|
+
function eventSignInEnds(previous, next) {
|
|
32997
|
+
return HANDED_ON.includes(next.flow.step) && !HANDED_ON.includes(previous.flow.step) ? "finished" : null;
|
|
32998
|
+
}
|
|
32999
|
+
/**
|
|
33000
|
+
* How a returned draft lands once `useSignInReturn` has matched it to the
|
|
33001
|
+
* signed-in profile and the page's events have loaded.
|
|
33002
|
+
*/
|
|
33003
|
+
function eventSignInRestoration(draft, events, verifiedIdentity) {
|
|
33004
|
+
const selection = findSelection(draft.selectedEventIds, events);
|
|
33005
|
+
return {
|
|
33006
|
+
draft,
|
|
33007
|
+
selection,
|
|
33008
|
+
selectionFound: draft.selectedEventIds.length === selection.length,
|
|
33009
|
+
questions: decideBookingQuestionsRestoration({
|
|
33010
|
+
kind: "sign_in_draft",
|
|
33011
|
+
draft: draft.questions,
|
|
33012
|
+
verifiedIdentity
|
|
33013
|
+
}),
|
|
33014
|
+
runRequirements: decideRunSignInRestoration(draft.runQuestions, verifiedIdentity)
|
|
33015
|
+
};
|
|
33016
|
+
}
|
|
33017
|
+
/**
|
|
33018
|
+
* Puts the booker's draft back. Details and answers always return; the event
|
|
33019
|
+
* choice, tickets and step only when that event is still offered and no
|
|
33020
|
+
* waiting-list invitation owns the selection.
|
|
33021
|
+
*/
|
|
33022
|
+
/** What the booker typed comes back; a blank field never erases details already filled in. */
|
|
33023
|
+
function restoredFormData(current, saved) {
|
|
33024
|
+
const typed = Object.fromEntries(Object.entries(saved).filter(([, value]) => typeof value !== "string" || value.trim() !== ""));
|
|
33025
|
+
return {
|
|
33026
|
+
...current,
|
|
33027
|
+
...typed,
|
|
33028
|
+
consentAccepted: false
|
|
33029
|
+
};
|
|
33030
|
+
}
|
|
33031
|
+
function restoreEventSignInDraft(state, restoration) {
|
|
33032
|
+
const { draft } = restoration;
|
|
33033
|
+
const details = {
|
|
33034
|
+
...state.draft,
|
|
33035
|
+
formData: restoredFormData(state.draft.formData, draft.formData),
|
|
33036
|
+
guests: draft.guests.map((guest) => ({ ...guest })),
|
|
33037
|
+
bookingQuestions: restoreBookingQuestionsAnswers(state.draft.bookingQuestions, restoration.questions),
|
|
33038
|
+
runRequirements: restoreRunRequirements(state.draft.runRequirements, restoration.runRequirements)
|
|
33039
|
+
};
|
|
33040
|
+
if (!restoration.selectionFound || state.invitation.kind !== "none") return {
|
|
33041
|
+
...state,
|
|
33042
|
+
draft: details
|
|
33043
|
+
};
|
|
33044
|
+
return {
|
|
33045
|
+
...state,
|
|
33046
|
+
step: draft.step,
|
|
33047
|
+
placeCount: draft.ticketsCount,
|
|
33048
|
+
draft: {
|
|
33049
|
+
...details,
|
|
33050
|
+
selection: restoration.selection.length > 0 ? restoration.selection : state.draft.selection,
|
|
33051
|
+
runChoices: draft.runChoices,
|
|
33052
|
+
selectedAttendanceMode: draft.selectedAttendanceMode,
|
|
33053
|
+
selectedTicketLines: draft.ticketSelections.map((line) => ({ ...line })),
|
|
33054
|
+
selectedSlidingAmountInput: draft.selectedSlidingAmountInput
|
|
33055
|
+
}
|
|
33056
|
+
};
|
|
33057
|
+
}
|
|
33058
|
+
//#endregion
|
|
33059
|
+
//#region ../blocks/src/system/runtime/shared/bookingPaymentOptionCopy.ts
|
|
33060
|
+
function buildUpfrontBookingPaymentOptionCopy(formattedTotal) {
|
|
33061
|
+
return {
|
|
33062
|
+
title: "Pay in full",
|
|
33063
|
+
description: "Pay everything today and your booking is confirmed.",
|
|
33064
|
+
ctaLabel: `Pay ${formattedTotal} now`
|
|
33065
|
+
};
|
|
33066
|
+
}
|
|
33067
|
+
/** Reused after booking; payment remains outside the platform. */
|
|
33068
|
+
const OFFLINE_BOOKING_PAYMENT_INSTRUCTIONS = "Pay the business later, outside the platform.";
|
|
33069
|
+
function buildDeferredManualBookingPaymentOptionCopy() {
|
|
33070
|
+
return {
|
|
33071
|
+
title: "Pay offline",
|
|
33072
|
+
description: `Book now and ${OFFLINE_BOOKING_PAYMENT_INSTRUCTIONS.toLowerCase()}`,
|
|
33073
|
+
helperText: "Nothing is due today.",
|
|
33074
|
+
ctaLabel: "Book now"
|
|
33075
|
+
};
|
|
33076
|
+
}
|
|
33077
|
+
function buildInstalmentBookingPaymentOptionCopy(input) {
|
|
33078
|
+
return {
|
|
33079
|
+
title: "Payment plan",
|
|
33080
|
+
description: describeInstalmentPlanCopy(input),
|
|
33081
|
+
helperText: input.futurePaymentCount > 0 ? "You can pay the rest early any time in your customer portal." : void 0,
|
|
33082
|
+
ctaLabel: `Pay ${input.formattedDueToday} now`
|
|
33083
|
+
};
|
|
33084
|
+
}
|
|
33085
|
+
function describeInstalmentPlanCopy(input) {
|
|
33086
|
+
if (input.futurePaymentCount === 0) {
|
|
33087
|
+
const depositPolicy = input.depositRefundability ? ` Your deposit is ${formatDepositRefundabilityLabel(input.depositRefundability)}.` : "";
|
|
33088
|
+
return `Pay ${input.formattedDueToday} today.${depositPolicy}`;
|
|
33089
|
+
}
|
|
33090
|
+
if (input.depositRefundability) return `Pay ${input.formattedDueToday} today, then continue with scheduled payments. Your deposit is ${formatDepositRefundabilityLabel(input.depositRefundability)}.`;
|
|
33091
|
+
if (input.futurePaymentCount === 1) return `Pay ${input.formattedDueToday} today, then one more payment later.`;
|
|
33092
|
+
const formattedFirstFuture = input.formattedFirstFuture ?? input.formattedDueToday;
|
|
33093
|
+
return `Pay ${input.formattedDueToday} today, then ${input.futurePaymentCount} more ${input.cadenceLabel} payments from ${formattedFirstFuture}.`;
|
|
33094
|
+
}
|
|
33095
|
+
function buildFlexibleBalanceBookingPaymentOptionCopy(input) {
|
|
33096
|
+
return {
|
|
33097
|
+
title: "Deposit now, pay the rest later",
|
|
33098
|
+
description: `Pay ${input.formattedDueToday} today, then pay the remaining balance any time before ${input.dueDateLabel}. Your deposit is ${formatDepositRefundabilityLabel(input.depositRefundability)}.`,
|
|
33099
|
+
helperText: "You can return in your customer portal to pay the rest before the due date.",
|
|
33100
|
+
ctaLabel: `Pay ${input.formattedDueToday} now`
|
|
33101
|
+
};
|
|
33102
|
+
}
|
|
33103
|
+
function formatDepositRefundabilityLabel(depositRefundability) {
|
|
33104
|
+
return depositRefundability === "non_refundable" ? "non-refundable" : "refundable";
|
|
33105
|
+
}
|
|
33106
|
+
/** Configured cadence for the existing instalment description. */
|
|
33107
|
+
function buildBookingInstalmentCadenceLabel(plan) {
|
|
33108
|
+
const interval = getBookingInstalmentPlanIntervalCount(plan);
|
|
33109
|
+
const unit = interval === 1 ? plan.intervalUnit : `${plan.intervalUnit}s`;
|
|
33110
|
+
return interval === 1 ? unit : `every ${interval} ${unit}`;
|
|
33111
|
+
}
|
|
33112
|
+
//#endregion
|
|
33113
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/bookingCalendar.ts
|
|
33114
|
+
/** Public schedule plus the authorised outcome's arrival text; online access stays in email. */
|
|
33115
|
+
function bookingCalendar(event, outcome) {
|
|
33116
|
+
if (!event) return null;
|
|
33117
|
+
const { identity } = outcome;
|
|
33118
|
+
const sessions = event.registrationSubject.kind === "wholeSeries" ? event.registrationSubject.sessions : [{
|
|
33119
|
+
occurrenceId: event.registrationSubject.occurrenceId,
|
|
33120
|
+
startsAt: event.startsAt,
|
|
33121
|
+
endsAt: event.endsAt
|
|
33122
|
+
}];
|
|
33123
|
+
const bookingId = identity.scope === "occurrence" ? identity.attendeeId : identity.registrationId;
|
|
33124
|
+
const entries = sessions.map((session) => ({
|
|
33125
|
+
uid: `booking-${bookingId}-${session.occurrenceId}@riverbankcms.com`,
|
|
33126
|
+
sequence: 0,
|
|
33127
|
+
title: event.title,
|
|
33128
|
+
startsAt: new Date(session.startsAt),
|
|
33129
|
+
endsAt: new Date(session.endsAt),
|
|
33130
|
+
timezone: "UTC",
|
|
33131
|
+
status: "confirmed",
|
|
33132
|
+
location: identity.attendanceMode === "online" ? "Online" : outcome.arrivalVenues?.[session.occurrenceId] ?? event.venue?.name,
|
|
33133
|
+
description: identity.attendanceMode === "online" ? "See your confirmation email for joining instructions." : void 0
|
|
33134
|
+
}));
|
|
33135
|
+
const first = entries[0];
|
|
33136
|
+
if (!first) return null;
|
|
33137
|
+
const common = {
|
|
33138
|
+
fileName: `${slugify(event.title) || "event"}.ics`,
|
|
33139
|
+
feed: {
|
|
33140
|
+
timezone: "UTC",
|
|
33141
|
+
entries
|
|
33142
|
+
}
|
|
33143
|
+
};
|
|
33144
|
+
return entries.length === 1 ? {
|
|
33145
|
+
...common,
|
|
33146
|
+
kind: "single",
|
|
33147
|
+
...calendarLinks(first)
|
|
33148
|
+
} : {
|
|
33149
|
+
...common,
|
|
33150
|
+
kind: "sessions",
|
|
33151
|
+
sessionCount: entries.length
|
|
33152
|
+
};
|
|
33153
|
+
}
|
|
33154
|
+
//#endregion
|
|
33155
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/registrationEventAdapter.ts
|
|
33156
|
+
function toRegistrationEvent(event) {
|
|
33157
|
+
return {
|
|
33158
|
+
...event,
|
|
33159
|
+
selectionId: event.id,
|
|
33160
|
+
registrationSubject: {
|
|
33161
|
+
kind: "occurrence",
|
|
33162
|
+
occurrenceId: event.occurrenceId
|
|
33163
|
+
}
|
|
33164
|
+
};
|
|
33165
|
+
}
|
|
33166
|
+
function toRegistrationEvents(events) {
|
|
33167
|
+
return events.filter((event) => event.bookingScope === "single_occurrence").map(toRegistrationEvent);
|
|
33168
|
+
}
|
|
33169
|
+
/**
|
|
33170
|
+
* Project one whole-series run onto the registration surface.
|
|
33171
|
+
*
|
|
33172
|
+
* Capacity, pricing, payment terms and consent come straight off the canonical
|
|
33173
|
+
* Event record; only the schedule is widened from the single occurrence to the
|
|
33174
|
+
* live run. A run without live sessions has no registration event.
|
|
33175
|
+
*/
|
|
33176
|
+
function toWholeSeriesRegistrationEvent(group) {
|
|
33177
|
+
const { representative, run } = group;
|
|
33178
|
+
const sessions = orderedLiveRunSessions(run.sessions);
|
|
33179
|
+
const firstSession = sessions[0];
|
|
33180
|
+
if (!firstSession) return null;
|
|
33181
|
+
const lastSession = sessions[sessions.length - 1] ?? firstSession;
|
|
33182
|
+
return {
|
|
33183
|
+
...representative,
|
|
33184
|
+
selectionId: run.eventSeriesId,
|
|
33185
|
+
registrationSubject: {
|
|
33186
|
+
kind: "wholeSeries",
|
|
33187
|
+
eventSeriesId: run.eventSeriesId,
|
|
33188
|
+
eventOfferingId: run.eventOfferingId,
|
|
33189
|
+
sessions
|
|
33190
|
+
},
|
|
33191
|
+
startsAt: firstSession.startsAt,
|
|
33192
|
+
endsAt: lastSession.endsAt,
|
|
33193
|
+
timeZone: firstSession.timeZone
|
|
33194
|
+
};
|
|
33195
|
+
}
|
|
33196
|
+
function toWholeSeriesRegistrationEvents(events) {
|
|
33197
|
+
return groupPublicEventsByRun(events).map(toWholeSeriesRegistrationEvent).filter((event) => event !== null);
|
|
33198
|
+
}
|
|
33199
|
+
/** An occurrence-page context must not replace a whole run's booking start. */
|
|
33200
|
+
function getRegistrationStartAt(event, occurrenceContext) {
|
|
33201
|
+
return event?.registrationSubject.kind === "wholeSeries" ? event.startsAt : occurrenceContext?.startsAt ?? event?.startsAt;
|
|
33202
|
+
}
|
|
33203
|
+
/** Confirmation identifies its persisted subject, independently of the current draft. */
|
|
33204
|
+
function findBookedEvent(events, identity) {
|
|
33205
|
+
return events.find((event) => identity.scope === "occurrence" ? event.seriesId === identity.seriesId && event.registrationSubject.kind === "occurrence" && event.registrationSubject.occurrenceId === identity.occurrenceId : event.registrationSubject.kind === "wholeSeries" && event.registrationSubject.eventSeriesId === identity.seriesId) ?? null;
|
|
33206
|
+
}
|
|
33207
|
+
//#endregion
|
|
31355
33208
|
//#region ../blocks/src/system/runtime/nodes/event-registration/finishedBooking.ts
|
|
31356
33209
|
/**
|
|
31357
33210
|
* What a finished booking says, decided once (issue 1581).
|
|
@@ -31469,7 +33322,15 @@ function completedBookingPlaces(outcomes, identity) {
|
|
|
31469
33322
|
return total === null || quantity === null ? null : total + quantity;
|
|
31470
33323
|
}, 0);
|
|
31471
33324
|
}
|
|
33325
|
+
/** Every booking a confirmation covers, in order: several when booked together, otherwise the one. */
|
|
33326
|
+
function confirmedOutcomes(result) {
|
|
33327
|
+
return result.outcomes && result.outcomes.length > 0 ? result.outcomes : [result.outcome];
|
|
33328
|
+
}
|
|
31472
33329
|
function bookedBooking(result, context) {
|
|
33330
|
+
const outcomes = confirmedOutcomes(result);
|
|
33331
|
+
return outcomes.length > 1 ? severalBookings(result, outcomes, context) : oneBooking(result, context);
|
|
33332
|
+
}
|
|
33333
|
+
function oneBooking(result, context) {
|
|
31473
33334
|
const { identity } = result.outcome;
|
|
31474
33335
|
const event = findBookedEvent(context.events, identity);
|
|
31475
33336
|
const dates = entryFacts(event);
|
|
@@ -31489,7 +33350,67 @@ function bookedBooking(result, context) {
|
|
|
31489
33350
|
...facts.rows
|
|
31490
33351
|
],
|
|
31491
33352
|
payment: facts.payment,
|
|
31492
|
-
calendar: bookingCalendar(event, result.outcome)
|
|
33353
|
+
calendar: bookingCalendar(event, result.outcome),
|
|
33354
|
+
several: null
|
|
33355
|
+
};
|
|
33356
|
+
}
|
|
33357
|
+
/**
|
|
33358
|
+
* Several bookings made together: a line for each, in order, then the places
|
|
33359
|
+
* each one has and what was paid in all. The finished card and bar keep the
|
|
33360
|
+
* first booking's facts; there's no single calendar entry for them all.
|
|
33361
|
+
*/
|
|
33362
|
+
function severalBookings(result, outcomes, context) {
|
|
33363
|
+
const several = outcomes[0]?.identity.scope === "occurrence" ? "dates" : "runs";
|
|
33364
|
+
const items = outcomes.flatMap((outcome) => {
|
|
33365
|
+
const event = findBookedEvent(context.events, outcome.identity);
|
|
33366
|
+
return event ? [bookedItemRow(several, event)] : [];
|
|
33367
|
+
});
|
|
33368
|
+
return {
|
|
33369
|
+
entry: oneBooking(result, context).entry,
|
|
33370
|
+
summary: [...items, ...placesOnEachRow(several, outcomes)],
|
|
33371
|
+
payment: severalPayment(outcomes),
|
|
33372
|
+
calendar: null,
|
|
33373
|
+
several
|
|
33374
|
+
};
|
|
33375
|
+
}
|
|
33376
|
+
/** Runs by name and dates; dates by day, both with their times. */
|
|
33377
|
+
function bookedItemRow(several, event) {
|
|
33378
|
+
return several === "runs" ? {
|
|
33379
|
+
label: event.title,
|
|
33380
|
+
value: formatRegistrationSchedule(event) ?? ""
|
|
33381
|
+
} : {
|
|
33382
|
+
label: formatBookingWhen(event, "dayLong"),
|
|
33383
|
+
value: formatBookingWhen(event, "timeRange")
|
|
33384
|
+
};
|
|
33385
|
+
}
|
|
33386
|
+
/** Every booking has the same places; said only when there's more than one. */
|
|
33387
|
+
function placesOnEachRow(several, outcomes) {
|
|
33388
|
+
const first = outcomes[0];
|
|
33389
|
+
const places = first?.kind === "detailsAvailable" ? deriveTotalTicketQuantity(first.ticketLines) : null;
|
|
33390
|
+
return places !== null && places > 1 ? [{
|
|
33391
|
+
label: "Places",
|
|
33392
|
+
value: `${places} on each ${several === "runs" ? "run" : "date"}`
|
|
33393
|
+
}] : [];
|
|
33394
|
+
}
|
|
33395
|
+
/**
|
|
33396
|
+
* What several bookings cost together. They're always paid up front by card
|
|
33397
|
+
* or free, so anything else (or a booking whose details didn't load) shows
|
|
33398
|
+
* no payment rather than a partial sum.
|
|
33399
|
+
*/
|
|
33400
|
+
function severalPayment(outcomes) {
|
|
33401
|
+
const payments = outcomes.flatMap((outcome) => outcome.kind === "detailsAvailable" ? [outcome.payment] : []);
|
|
33402
|
+
if (payments.length !== outcomes.length) return { kind: "none" };
|
|
33403
|
+
const paid = payments.flatMap((payment) => payment.kind === "monetary" && payment.balance.kind === "settled" ? [payment] : []);
|
|
33404
|
+
const free = payments.filter((payment) => payment.kind === "free" || payment.kind === "waived");
|
|
33405
|
+
const currency = paid[0]?.currency;
|
|
33406
|
+
if (paid.length + free.length !== payments.length || paid.some((payment) => payment.currency !== currency)) return { kind: "none" };
|
|
33407
|
+
const total = paid.reduce((sum, payment) => sum + payment.amountPaidCents, 0);
|
|
33408
|
+
return {
|
|
33409
|
+
kind: "settled",
|
|
33410
|
+
rows: currency && total > 0 ? [{
|
|
33411
|
+
label: "Paid",
|
|
33412
|
+
value: formatPrice(total, currency)
|
|
33413
|
+
}] : []
|
|
31493
33414
|
};
|
|
31494
33415
|
}
|
|
31495
33416
|
function waitlistedBooking(context) {
|
|
@@ -31502,7 +33423,8 @@ function waitlistedBooking(context) {
|
|
|
31502
33423
|
},
|
|
31503
33424
|
summary: scheduleRows(event, dates.shortWhen, "venue", context.display),
|
|
31504
33425
|
payment: { kind: "none" },
|
|
31505
|
-
calendar: null
|
|
33426
|
+
calendar: null,
|
|
33427
|
+
several: null
|
|
31506
33428
|
};
|
|
31507
33429
|
}
|
|
31508
33430
|
/**
|
|
@@ -31553,103 +33475,19 @@ function registrationQuestionsMessage(questionFieldErrors, errorMessage) {
|
|
|
31553
33475
|
return Object.keys(questionFieldErrors).length > 0 ? errorMessage : "";
|
|
31554
33476
|
}
|
|
31555
33477
|
//#endregion
|
|
31556
|
-
//#region ../blocks/src/system/runtime/nodes/event-registration/registrationWizardContext.ts
|
|
31557
|
-
function getEventSelectionDefaults(event) {
|
|
31558
|
-
const suggestedAmount = getSlidingScaleForEvent(event)?.suggestedAmount;
|
|
31559
|
-
return {
|
|
31560
|
-
slidingAmountInput: suggestedAmount == null ? "" : formatCentsAsCurrencyInput(suggestedAmount),
|
|
31561
|
-
attendanceMode: event.deliveryMode === "hybrid" ? null : event.deliveryMode ?? "in_person"
|
|
31562
|
-
};
|
|
31563
|
-
}
|
|
31564
|
-
function parseCurrencyInputToCents(value) {
|
|
31565
|
-
const trimmed = value.trim();
|
|
31566
|
-
if (!trimmed) return null;
|
|
31567
|
-
const amount = Number(trimmed);
|
|
31568
|
-
return Number.isFinite(amount) && amount >= 0 ? Math.round(amount * 100) : null;
|
|
31569
|
-
}
|
|
31570
|
-
function getSlidingScaleForEvent(event) {
|
|
31571
|
-
const pricing = event?.pricing ?? null;
|
|
31572
|
-
return pricing?.kind === "sliding_scale" ? {
|
|
31573
|
-
minAmount: pricing.minimum,
|
|
31574
|
-
maxAmount: pricing.maximum,
|
|
31575
|
-
suggestedAmount: pricing.suggested
|
|
31576
|
-
} : null;
|
|
31577
|
-
}
|
|
31578
|
-
function getSlidingScaleSelectionMessage(input) {
|
|
31579
|
-
if (!input.slidingScale) return null;
|
|
31580
|
-
if (input.selectedAmount === null) return "Choose an amount to continue.";
|
|
31581
|
-
const { minAmount, maxAmount } = input.slidingScale;
|
|
31582
|
-
return input.selectedAmount < minAmount || input.selectedAmount > maxAmount ? "Choose an amount within the sliding scale." : null;
|
|
31583
|
-
}
|
|
31584
|
-
function getRegistrationOccurrenceId(target) {
|
|
31585
|
-
return target?.subject.kind === "occurrence" ? target.subject.occurrenceId : "";
|
|
31586
|
-
}
|
|
31587
|
-
function shouldLoadRegistrationOptions(authState, step) {
|
|
31588
|
-
return authState === "authenticated" || step === "select-tickets" || step === "enter-details" || step === "select-payment";
|
|
31589
|
-
}
|
|
31590
|
-
function getEligibilityFlowFlags(input) {
|
|
31591
|
-
const hasPass = (input.eligibility?.eligiblePasses.length ?? 0) > 0;
|
|
31592
|
-
const hasMembership = (input.eligibility?.eligibleMemberships.length ?? 0) > 0;
|
|
31593
|
-
return {
|
|
31594
|
-
hasEligibility: hasPass || hasMembership,
|
|
31595
|
-
hasMembershipEligibility: hasMembership,
|
|
31596
|
-
isMembershipFastTrack: input.portalAuthState === "authenticated" && hasMembership && input.ticketsCount === 1 && input.paymentMethod === "membership"
|
|
31597
|
-
};
|
|
31598
|
-
}
|
|
31599
|
-
/** Prefer refreshed capacity, including a known zero; fall back while options load. */
|
|
31600
|
-
function getTicketSelectionRemainingPlaces(input) {
|
|
31601
|
-
const availability = input.eligibility?.availability;
|
|
31602
|
-
if (availability && "remainingPlaces" in availability) return availability.remainingPlaces ?? null;
|
|
31603
|
-
return input.event ? getEventAvailability(selectEventCapacitySource(input.event, input.attendanceMode)).available : null;
|
|
31604
|
-
}
|
|
31605
|
-
/** Keep the card and ticket step on the same fresh capacity as admission. */
|
|
31606
|
-
function withRegistrationAvailability(event, eligibility, attendanceMode) {
|
|
31607
|
-
const availability = eligibility?.availability;
|
|
31608
|
-
if (!event || !availability || !("remainingPlaces" in availability)) return event;
|
|
31609
|
-
const mode = attendanceMode ?? (event.deliveryMode === "hybrid" ? null : event.deliveryMode ?? "in_person");
|
|
31610
|
-
if (!mode) return event;
|
|
31611
|
-
const source = selectEventCapacitySource(event, mode);
|
|
31612
|
-
const remaining = availability.remainingPlaces ?? null;
|
|
31613
|
-
const refreshed = {
|
|
31614
|
-
capacity: remaining === null ? null : source.capacity ?? remaining,
|
|
31615
|
-
availableSpots: remaining,
|
|
31616
|
-
waitlistEnabled: availability.waitlistEnabled
|
|
31617
|
-
};
|
|
31618
|
-
return {
|
|
31619
|
-
...event,
|
|
31620
|
-
...event.deliveryMode === "hybrid" ? {} : refreshed,
|
|
31621
|
-
attendanceModes: event.attendanceModes?.map((row) => row.mode === mode ? {
|
|
31622
|
-
...row,
|
|
31623
|
-
...refreshed
|
|
31624
|
-
} : row)
|
|
31625
|
-
};
|
|
31626
|
-
}
|
|
31627
|
-
function resolveHeldTicketPlaces(current, invitation, paymentHold) {
|
|
31628
|
-
return getHeldPlacesBySelection(current, invitation.kind === "ready" ? {
|
|
31629
|
-
selectionId: invitation.restoration.event?.selectionId ?? current.selectionId,
|
|
31630
|
-
attendanceMode: invitation.restoration.attendanceMode,
|
|
31631
|
-
lines: invitation.restoration.ticketSelections
|
|
31632
|
-
} : paymentHold);
|
|
31633
|
-
}
|
|
31634
|
-
function getCurrentTicketSelection(event, attendanceMode, lines) {
|
|
31635
|
-
return {
|
|
31636
|
-
selectionId: event?.selectionId ?? null,
|
|
31637
|
-
attendanceMode,
|
|
31638
|
-
lines
|
|
31639
|
-
};
|
|
31640
|
-
}
|
|
31641
|
-
//#endregion
|
|
31642
33478
|
//#region ../blocks/src/system/runtime/nodes/event-registration/registrationDraft.state.ts
|
|
31643
33479
|
function createRegistrationDraftData(event) {
|
|
31644
33480
|
const defaults = event ? getEventSelectionDefaults(event) : null;
|
|
31645
33481
|
return {
|
|
31646
|
-
|
|
33482
|
+
selection: event ? [event] : [],
|
|
33483
|
+
runChoices: NO_RUN_PRICING_CHOICES,
|
|
31647
33484
|
formData: createInitialRegistrationFormData(),
|
|
31648
33485
|
guests: [],
|
|
31649
33486
|
selectedAttendanceMode: defaults?.attendanceMode ?? null,
|
|
31650
33487
|
selectedTicketLines: [],
|
|
31651
33488
|
selectedSlidingAmountInput: defaults?.slidingAmountInput ?? "",
|
|
31652
|
-
bookingQuestions: EMPTY_BOOKING_QUESTIONS_ANSWERS
|
|
33489
|
+
bookingQuestions: EMPTY_BOOKING_QUESTIONS_ANSWERS,
|
|
33490
|
+
runRequirements: NO_RUN_REQUIREMENTS
|
|
31653
33491
|
};
|
|
31654
33492
|
}
|
|
31655
33493
|
function updated(current, value) {
|
|
@@ -31657,9 +33495,17 @@ function updated(current, value) {
|
|
|
31657
33495
|
}
|
|
31658
33496
|
function editRegistrationDraft(draft, edit) {
|
|
31659
33497
|
switch (edit.field) {
|
|
31660
|
-
case "
|
|
33498
|
+
case "selection": {
|
|
33499
|
+
const selection = updated(draft.selection, edit.value);
|
|
33500
|
+
return {
|
|
33501
|
+
...draft,
|
|
33502
|
+
selection,
|
|
33503
|
+
selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(selection), draft.selectedAttendanceMode)
|
|
33504
|
+
};
|
|
33505
|
+
}
|
|
33506
|
+
case "runChoices": return {
|
|
31661
33507
|
...draft,
|
|
31662
|
-
|
|
33508
|
+
runChoices: updated(draft.runChoices, edit.value)
|
|
31663
33509
|
};
|
|
31664
33510
|
case "formData": return {
|
|
31665
33511
|
...draft,
|
|
@@ -31671,7 +33517,7 @@ function editRegistrationDraft(draft, edit) {
|
|
|
31671
33517
|
};
|
|
31672
33518
|
case "selectedAttendanceMode": return {
|
|
31673
33519
|
...draft,
|
|
31674
|
-
selectedAttendanceMode: updated(draft.selectedAttendanceMode, edit.value)
|
|
33520
|
+
selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(draft.selection), updated(draft.selectedAttendanceMode, edit.value))
|
|
31675
33521
|
};
|
|
31676
33522
|
case "selectedTicketLines": return {
|
|
31677
33523
|
...draft,
|
|
@@ -31701,7 +33547,9 @@ function receiveWaitlistInvitation(invitation, credential) {
|
|
|
31701
33547
|
function restoreRegistrationDraft(draft, claim, restoration) {
|
|
31702
33548
|
return {
|
|
31703
33549
|
bookingQuestions: draft.bookingQuestions,
|
|
31704
|
-
|
|
33550
|
+
runRequirements: NO_RUN_REQUIREMENTS,
|
|
33551
|
+
selection: restoration.event ? [restoration.event] : draft.selection,
|
|
33552
|
+
runChoices: NO_RUN_PRICING_CHOICES,
|
|
31705
33553
|
selectedAttendanceMode: restoration.attendanceMode,
|
|
31706
33554
|
selectedTicketLines: [...restoration.ticketSelections],
|
|
31707
33555
|
selectedSlidingAmountInput: restoration.slidingAmountInput ?? draft.selectedSlidingAmountInput,
|
|
@@ -31774,7 +33622,7 @@ function findPreSelectedEvent(input) {
|
|
|
31774
33622
|
})) === contextDate) ?? null;
|
|
31775
33623
|
}
|
|
31776
33624
|
function resolveRegistrationTarget(input) {
|
|
31777
|
-
const selectedSubject = input.
|
|
33625
|
+
const selectedSubject = input.selection[0]?.registrationSubject ?? null;
|
|
31778
33626
|
const subject = selectedSubject?.kind === "wholeSeries" ? selectedSubject : input.occurrenceContext ? {
|
|
31779
33627
|
kind: "occurrence",
|
|
31780
33628
|
occurrenceId: input.occurrenceContext.id
|
|
@@ -31782,7 +33630,12 @@ function resolveRegistrationTarget(input) {
|
|
|
31782
33630
|
if (!subject) return null;
|
|
31783
33631
|
return {
|
|
31784
33632
|
subject,
|
|
31785
|
-
|
|
33633
|
+
selectedEventIds: input.selection.map((event) => event.selectionId),
|
|
33634
|
+
selection: toBookingSelection({
|
|
33635
|
+
subject,
|
|
33636
|
+
selection: input.selection
|
|
33637
|
+
}),
|
|
33638
|
+
...subject.kind === "wholeSeries" && input.selection.length > 1 ? { runs: input.selection } : {}
|
|
31786
33639
|
};
|
|
31787
33640
|
}
|
|
31788
33641
|
function resolveEventRequiresPayment(input) {
|
|
@@ -31822,6 +33675,28 @@ function resolveDiscountContext(input) {
|
|
|
31822
33675
|
ticketsCount: input.ticketsCount
|
|
31823
33676
|
};
|
|
31824
33677
|
}
|
|
33678
|
+
/** Each run carries its own ticket choice; dates retain the shared top-level choice. */
|
|
33679
|
+
function buildRegistrationSelectionRequest(input) {
|
|
33680
|
+
const selection = toBookingSelectionRequest(input.target.selection, input.attendanceMode);
|
|
33681
|
+
if (selection.kind !== "runs" || selection.eventSeriesIds.length === 1) return selection;
|
|
33682
|
+
const requirements = input.requirements ? { requirements: input.requirements } : {};
|
|
33683
|
+
const runs = input.target.runs;
|
|
33684
|
+
if (!runs || runs.length !== selection.eventSeriesIds.length) throw new Error("Choose tickets for every run.");
|
|
33685
|
+
return {
|
|
33686
|
+
...selection,
|
|
33687
|
+
...requirements,
|
|
33688
|
+
ticketChoicesBySeriesId: Object.fromEntries(runs.map((run) => {
|
|
33689
|
+
const choice = runPricingChoice(input.runChoices, run);
|
|
33690
|
+
return [run.seriesId, {
|
|
33691
|
+
ticketSelections: [{
|
|
33692
|
+
pricingOptionId: choice.pricingOptionId,
|
|
33693
|
+
quantity: input.places
|
|
33694
|
+
}],
|
|
33695
|
+
...run.pricing.kind === "sliding_scale" ? { selectedSlidingAmount: parseCurrencyInputToCents(choice.slidingAmountInput) ?? void 0 } : {}
|
|
33696
|
+
}];
|
|
33697
|
+
}))
|
|
33698
|
+
};
|
|
33699
|
+
}
|
|
31825
33700
|
//#endregion
|
|
31826
33701
|
//#region ../blocks/src/system/runtime/nodes/event-registration/waitlistClaimRestoration.ts
|
|
31827
33702
|
function findClaimEvent(subject, events) {
|
|
@@ -32572,11 +34447,22 @@ function resolveRegistrationTicketContinuation(input) {
|
|
|
32572
34447
|
pending: false,
|
|
32573
34448
|
message: fullyBookedMessage(input.admission)
|
|
32574
34449
|
};
|
|
32575
|
-
if (input.
|
|
34450
|
+
if (input.selectionChoiceMessage) return {
|
|
34451
|
+
kind: "blocked",
|
|
34452
|
+
label: "Continue",
|
|
34453
|
+
pending: false,
|
|
34454
|
+
message: input.selectionChoiceMessage
|
|
34455
|
+
};
|
|
34456
|
+
const pricingBlocker = resolvePricingSelectionBlocker({
|
|
34457
|
+
selectionRequired: input.ticketSelectionRequired,
|
|
34458
|
+
hasValidSelection: input.hasValidTicketSelection,
|
|
34459
|
+
slidingScaleSelectionMessage: input.slidingScaleSelectionMessage
|
|
34460
|
+
});
|
|
34461
|
+
if (pricingBlocker) return {
|
|
32576
34462
|
kind: "blocked",
|
|
32577
|
-
label: "Choose a ticket",
|
|
34463
|
+
label: input.slidingScaleSelectionMessage ? "Continue" : "Choose a ticket",
|
|
32578
34464
|
pending: false,
|
|
32579
|
-
message:
|
|
34465
|
+
message: pricingBlocker
|
|
32580
34466
|
};
|
|
32581
34467
|
switch (input.admission.kind) {
|
|
32582
34468
|
case "checking": return {
|
|
@@ -32609,18 +34495,25 @@ function planRegistrationDetailsCheck(input) {
|
|
|
32609
34495
|
const errors = validateFormData(input.formData, input.requiresConsent);
|
|
32610
34496
|
const guestErrors = Object.fromEntries(input.requireGuestDetails ? input.guests.flatMap((guest, index) => guest.name.trim() ? [] : [[index, { name: "Name is required" }]]) : []);
|
|
32611
34497
|
const questionFieldErrors = input.questions.kind === "unanswered" ? input.questions.fieldErrors : {};
|
|
32612
|
-
const
|
|
34498
|
+
const { runConsentErrors } = input;
|
|
34499
|
+
const fieldsInvalid = [
|
|
34500
|
+
errors,
|
|
34501
|
+
guestErrors,
|
|
34502
|
+
runConsentErrors
|
|
34503
|
+
].some((group) => Object.keys(group).length > 0);
|
|
32613
34504
|
if (!fieldsInvalid && input.questions.kind === "ok") return {
|
|
32614
34505
|
kind: "check-recovery",
|
|
32615
34506
|
errors,
|
|
32616
34507
|
guestErrors,
|
|
32617
|
-
questionFieldErrors
|
|
34508
|
+
questionFieldErrors,
|
|
34509
|
+
runConsentErrors
|
|
32618
34510
|
};
|
|
32619
34511
|
return {
|
|
32620
34512
|
kind: "invalid",
|
|
32621
34513
|
errors,
|
|
32622
34514
|
guestErrors,
|
|
32623
34515
|
questionFieldErrors,
|
|
34516
|
+
runConsentErrors,
|
|
32624
34517
|
message: detailsCheckMessage(input.questions, fieldsInvalid)
|
|
32625
34518
|
};
|
|
32626
34519
|
}
|
|
@@ -32646,7 +34539,7 @@ function planRegistrationDetailsContinuation(input) {
|
|
|
32646
34539
|
message: input.next.message
|
|
32647
34540
|
};
|
|
32648
34541
|
const canJoinWaitlist = input.next.kind === "waitlist";
|
|
32649
|
-
if (!canJoinWaitlist && requiresPaymentStep(input)) return { kind: "payment-step" };
|
|
34542
|
+
if (!canJoinWaitlist && (input.quoteReady === false || requiresPaymentStep(input))) return { kind: "payment-step" };
|
|
32650
34543
|
const plan = resolveEventRegistrationSubmitPlan({
|
|
32651
34544
|
...input,
|
|
32652
34545
|
canJoinWaitlist
|
|
@@ -32780,9 +34673,25 @@ function decideEventRegistrationPayment(input) {
|
|
|
32780
34673
|
showLoginPrompt: shouldPromptForLogin(status, input.isAuthenticated, input.eligibility)
|
|
32781
34674
|
},
|
|
32782
34675
|
directPaymentOptions: input.directPaymentOptions,
|
|
32783
|
-
canShowDirectPaymentOptions: input.directPaymentOptions.length > 0
|
|
34676
|
+
canShowDirectPaymentOptions: input.directPaymentOptions.length > 0,
|
|
34677
|
+
...selectionPaymentPresentation(input.selectionPayment, input.eligibility)
|
|
32784
34678
|
};
|
|
32785
34679
|
}
|
|
34680
|
+
/** Whether nothing is due, and whether passes and memberships are offered, for the whole selection. */
|
|
34681
|
+
function selectionPaymentPresentation(payment, eligibility) {
|
|
34682
|
+
switch (payment.kind) {
|
|
34683
|
+
case "one-item": return {
|
|
34684
|
+
paysNothing: eligibility?.isFree ?? false,
|
|
34685
|
+
offersEntitlements: true,
|
|
34686
|
+
paysInFullBecauseSeveral: false
|
|
34687
|
+
};
|
|
34688
|
+
case "several": return {
|
|
34689
|
+
paysNothing: payment.due === "nothing",
|
|
34690
|
+
offersEntitlements: false,
|
|
34691
|
+
paysInFullBecauseSeveral: payment.due === "card" && (eligibility?.paymentOptions ?? []).some((option) => option.kind === "flexibleBalance" || option.kind === "instalmentPlan")
|
|
34692
|
+
};
|
|
34693
|
+
}
|
|
34694
|
+
}
|
|
32786
34695
|
/**
|
|
32787
34696
|
* Label for the button that acts on the chosen payment method.
|
|
32788
34697
|
*
|
|
@@ -32829,7 +34738,8 @@ function shouldPromptForLogin(status, isAuthenticated, eligibility) {
|
|
|
32829
34738
|
/** Identity, not clicking a row, decides whether this is a new booking. */
|
|
32830
34739
|
function decideEventChoice(state, event) {
|
|
32831
34740
|
const reservedEvent = state.invitation.kind === "ready" ? state.invitation.restoration.event : null;
|
|
32832
|
-
|
|
34741
|
+
const chosen = state.draft.selection.length === 1 ? state.draft.selection[0] : void 0;
|
|
34742
|
+
return event.selectionId === chosen?.selectionId || event.selectionId === reservedEvent?.selectionId ? { type: "event-continued" } : {
|
|
32833
34743
|
type: "event-replaced",
|
|
32834
34744
|
event
|
|
32835
34745
|
};
|
|
@@ -32864,7 +34774,7 @@ function resetRegistrationDraft(session, hasPreSelectedContext) {
|
|
|
32864
34774
|
formData: session.draft.formData
|
|
32865
34775
|
},
|
|
32866
34776
|
invitation: { kind: "none" },
|
|
32867
|
-
|
|
34777
|
+
placeCount: 1,
|
|
32868
34778
|
isAuthenticated: session.isAuthenticated,
|
|
32869
34779
|
completedOutcomes: session.completedOutcomes,
|
|
32870
34780
|
eligibility: null,
|
|
@@ -32893,11 +34803,41 @@ function normalizePaymentSelection(selection) {
|
|
|
32893
34803
|
if (!selection || !selection.method) return { method: null };
|
|
32894
34804
|
return selection;
|
|
32895
34805
|
}
|
|
32896
|
-
|
|
32897
|
-
|
|
34806
|
+
/**
|
|
34807
|
+
* How many places each item gets, at least one, from the draft as it stands.
|
|
34808
|
+
* The wizard reads the same derivation (`selectionTicketInputs`); nothing stores it.
|
|
34809
|
+
*/
|
|
34810
|
+
function flowTicketsCount(state) {
|
|
34811
|
+
const { ticketsCount } = selectionTicketInputs({
|
|
34812
|
+
several: severalItemsOf(state.draft.selection),
|
|
34813
|
+
primary: state.draft.selection[0] ?? null,
|
|
34814
|
+
lines: state.draft.selectedTicketLines,
|
|
34815
|
+
slidingAmountInput: state.draft.selectedSlidingAmountInput,
|
|
34816
|
+
placeCount: state.placeCount,
|
|
34817
|
+
runChoices: state.draft.runChoices,
|
|
34818
|
+
invitation: state.invitation
|
|
34819
|
+
});
|
|
34820
|
+
return Math.max(1, ticketsCount);
|
|
34821
|
+
}
|
|
34822
|
+
/** How the whole selection is paid; the wizard reads the same decision. */
|
|
34823
|
+
function flowSelectionPayment(state) {
|
|
34824
|
+
return decideSelectionPayment({
|
|
34825
|
+
selection: state.draft.selection,
|
|
34826
|
+
runChoices: state.draft.runChoices,
|
|
34827
|
+
eligibility: state.eligibility
|
|
34828
|
+
});
|
|
34829
|
+
}
|
|
34830
|
+
/** Passes, memberships and bundles cover one item for one person. */
|
|
34831
|
+
function entitlementsAllowed(state) {
|
|
34832
|
+
return flowTicketsCount(state) === 1 && severalItemsOf(state.draft.selection) === null;
|
|
34833
|
+
}
|
|
34834
|
+
function computeAutoSelection(state) {
|
|
34835
|
+
const { isAuthenticated, eligibility, passOptOut } = state;
|
|
32898
34836
|
if (!eligibility) return { method: null };
|
|
34837
|
+
const payment = flowSelectionPayment(state);
|
|
34838
|
+
if (payment.kind === "several") return payment.due === "nothing" ? { method: "free" } : { method: null };
|
|
32899
34839
|
if (eligibility.isFree) return { method: "free" };
|
|
32900
|
-
if (isAuthenticated &&
|
|
34840
|
+
if (isAuthenticated && entitlementsAllowed(state)) {
|
|
32901
34841
|
const membership = eligibility.eligibleMemberships[0];
|
|
32902
34842
|
if (membership) return {
|
|
32903
34843
|
method: "membership",
|
|
@@ -32914,21 +34854,36 @@ function computeAutoSelection(input) {
|
|
|
32914
34854
|
return { method: null };
|
|
32915
34855
|
}
|
|
32916
34856
|
function isSelectionValid(input) {
|
|
32917
|
-
const { selection, isAuthenticated, eligibility
|
|
34857
|
+
const { selection, isAuthenticated, eligibility } = input;
|
|
32918
34858
|
if (!selection.method) return false;
|
|
34859
|
+
if (input.payment.kind === "several") return isSeveralItemsSelectionValid(selection, input.payment.due);
|
|
32919
34860
|
if (!eligibility) return selection.method === "stripe" || selection.method === "pass_bundle" || selection.method === "membership_bundle";
|
|
32920
34861
|
switch (selection.method) {
|
|
32921
34862
|
case "free": return eligibility.isFree;
|
|
32922
|
-
case "stripe": return
|
|
34863
|
+
case "stripe": return isCardSelectionValid(selection, eligibility);
|
|
32923
34864
|
case "pass":
|
|
32924
34865
|
case "membership":
|
|
32925
34866
|
case "pass_bundle":
|
|
32926
|
-
case "membership_bundle": return isEntitlementSelectionValid(selection, eligibility, isAuthenticated
|
|
34867
|
+
case "membership_bundle": return input.entitlementsAllowed && isEntitlementSelectionValid(selection, eligibility, isAuthenticated);
|
|
32927
34868
|
default: return false;
|
|
32928
34869
|
}
|
|
32929
34870
|
}
|
|
32930
|
-
|
|
32931
|
-
|
|
34871
|
+
/**
|
|
34872
|
+
* Several items are free when nothing is due, otherwise paid up front by card
|
|
34873
|
+
* (issue 1725). The first item's own options don't apply: a free first run
|
|
34874
|
+
* doesn't make a paid second one free.
|
|
34875
|
+
*/
|
|
34876
|
+
function isSeveralItemsSelectionValid(selection, due) {
|
|
34877
|
+
switch (due) {
|
|
34878
|
+
case "nothing": return selection.method === "free";
|
|
34879
|
+
case "card": return selection.method === "stripe" && selection.collectionOptionKind === "upfront";
|
|
34880
|
+
}
|
|
34881
|
+
}
|
|
34882
|
+
function isCardSelectionValid(selection, eligibility) {
|
|
34883
|
+
if (!eligibility.requiresPayment || !eligibility.price) return false;
|
|
34884
|
+
return getApprovedDirectPaymentCollectionOptionKinds(eligibility.paymentOptions).includes(selection.collectionOptionKind);
|
|
34885
|
+
}
|
|
34886
|
+
function isEntitlementSelectionValid(selection, eligibility, isAuthenticated) {
|
|
32932
34887
|
if ((selection.method === "pass" || selection.method === "membership") && !isAuthenticated) return false;
|
|
32933
34888
|
switch (selection.method) {
|
|
32934
34889
|
case "pass": return eligibility.eligiblePasses.some((pass) => pass.id === selection.passId);
|
|
@@ -32943,7 +34898,8 @@ function normalizeRegistrationFlowState(state) {
|
|
|
32943
34898
|
selection: state.paymentSelection,
|
|
32944
34899
|
isAuthenticated: state.isAuthenticated,
|
|
32945
34900
|
eligibility: state.eligibility,
|
|
32946
|
-
|
|
34901
|
+
entitlementsAllowed: entitlementsAllowed(state),
|
|
34902
|
+
payment: flowSelectionPayment(state)
|
|
32947
34903
|
});
|
|
32948
34904
|
const nextSelection = canKeepManualSelection ? state.paymentSelection : autoSelection;
|
|
32949
34905
|
const nextSource = canKeepManualSelection ? "manual" : "auto";
|
|
@@ -32990,7 +34946,8 @@ function restorePaymentReturn(state, restoration) {
|
|
|
32990
34946
|
...state.draft,
|
|
32991
34947
|
formData: restoration.formData,
|
|
32992
34948
|
guests: restoration.guests.map((guest) => ({ ...guest })),
|
|
32993
|
-
bookingQuestions: restoreBookingQuestionsAnswers(state.draft.bookingQuestions, restoration.questions)
|
|
34949
|
+
bookingQuestions: restoreBookingQuestionsAnswers(state.draft.bookingQuestions, restoration.questions),
|
|
34950
|
+
runRequirements: restoreRunRequirements(state.draft.runRequirements, restoration.runRequirements)
|
|
32994
34951
|
};
|
|
32995
34952
|
if (state.invitation.kind !== "none") return {
|
|
32996
34953
|
...state,
|
|
@@ -32998,10 +34955,11 @@ function restorePaymentReturn(state, restoration) {
|
|
|
32998
34955
|
};
|
|
32999
34956
|
const restored = {
|
|
33000
34957
|
...state,
|
|
33001
|
-
|
|
34958
|
+
placeCount: Math.max(1, restoration.placeCount),
|
|
33002
34959
|
draft: {
|
|
33003
34960
|
...details,
|
|
33004
|
-
|
|
34961
|
+
selection: restoration.selection.length > 0 ? restoration.selection : state.draft.selection,
|
|
34962
|
+
runChoices: restoration.runChoices,
|
|
33005
34963
|
selectedTicketLines: restoration.ticketLines.map((line) => ({ ...line })),
|
|
33006
34964
|
selectedAttendanceMode: restoration.attendanceMode,
|
|
33007
34965
|
selectedSlidingAmountInput: restoration.slidingAmountInput
|
|
@@ -33038,12 +34996,10 @@ function reduceActiveRegistration(state, action) {
|
|
|
33038
34996
|
...state,
|
|
33039
34997
|
invitation: state.invitation.kind === "none" ? state.invitation : beginWaitlistInvitation(state.invitation.request.credential)
|
|
33040
34998
|
};
|
|
33041
|
-
case "draft-edited": return canEditInvitedDraft(state.invitation, action.edit) ?
|
|
33042
|
-
|
|
33043
|
-
draft: editRegistrationDraft(state.draft, action.edit),
|
|
33044
|
-
questionFieldErrors: {}
|
|
33045
|
-
} : state;
|
|
34999
|
+
case "draft-edited": return canEditInvitedDraft(state.invitation, action.edit) ? applyDraftEdit(state, action.edit) : state;
|
|
35000
|
+
case "selection-toggled": return state.invitation.kind === "ready" ? state : toggleRegistrationSelection(state, action.event);
|
|
33046
35001
|
case "booking-questions": return applyRegistrationQuestionsEvent(state, action.event);
|
|
35002
|
+
case "run-requirements": return applyRunRequirementsAction(state, action);
|
|
33047
35003
|
case "question-errors-set": return {
|
|
33048
35004
|
...state,
|
|
33049
35005
|
questionFieldErrors: action.fieldErrors
|
|
@@ -33089,6 +35045,70 @@ function applyRegistrationQuestionsEvent(state, event) {
|
|
|
33089
35045
|
questionFieldErrors
|
|
33090
35046
|
};
|
|
33091
35047
|
}
|
|
35048
|
+
/**
|
|
35049
|
+
* One run's answer or agreement. Answering a question clears the complaint
|
|
35050
|
+
* about it in that run's section, and nowhere else.
|
|
35051
|
+
*/
|
|
35052
|
+
function applyRunRequirementsAction(state, action) {
|
|
35053
|
+
const draft = {
|
|
35054
|
+
...state.draft,
|
|
35055
|
+
runRequirements: applyRunRequirementsEvent(state.draft.runRequirements, action.seriesId, action.event)
|
|
35056
|
+
};
|
|
35057
|
+
const answered = action.event.type === "questions" && action.event.event.type === "booking-question-answered" ? action.event.event.fieldId : null;
|
|
35058
|
+
if (answered === null) return {
|
|
35059
|
+
...state,
|
|
35060
|
+
draft
|
|
35061
|
+
};
|
|
35062
|
+
const cleared = /* @__PURE__ */ new Set([runFieldErrorKey(action.seriesId, answered), answered]);
|
|
35063
|
+
const questionFieldErrors = Object.fromEntries(Object.entries(state.questionFieldErrors).filter(([key]) => !cleared.has(key)));
|
|
35064
|
+
return {
|
|
35065
|
+
...state,
|
|
35066
|
+
draft,
|
|
35067
|
+
questionFieldErrors
|
|
35068
|
+
};
|
|
35069
|
+
}
|
|
35070
|
+
/** Edits that change what's booked, or how many, re-decide the payment choice. */
|
|
35071
|
+
const SELECTION_FIELDS = /* @__PURE__ */ new Set([
|
|
35072
|
+
"selection",
|
|
35073
|
+
"selectedTicketLines",
|
|
35074
|
+
"runChoices"
|
|
35075
|
+
]);
|
|
35076
|
+
function applyDraftEdit(state, edit) {
|
|
35077
|
+
const edited = {
|
|
35078
|
+
...state,
|
|
35079
|
+
draft: editRegistrationDraft(state.draft, edit),
|
|
35080
|
+
questionFieldErrors: {}
|
|
35081
|
+
};
|
|
35082
|
+
return SELECTION_FIELDS.has(edit.field) ? normalizeRegistrationFlowState(edited) : edited;
|
|
35083
|
+
}
|
|
35084
|
+
/**
|
|
35085
|
+
* Ticking or unticking a row while booking several. The details typed so far
|
|
35086
|
+
* stay; when the first item changes, its own defaults (amount, attendance)
|
|
35087
|
+
* start again, as they do when a single booking picks another event.
|
|
35088
|
+
*/
|
|
35089
|
+
function toggleRegistrationSelection(state, event) {
|
|
35090
|
+
const selection = toggleSelectionItem(state.draft.selection, event);
|
|
35091
|
+
if (selection === state.draft.selection) return state;
|
|
35092
|
+
const previousPrimary = state.draft.selection[0]?.selectionId;
|
|
35093
|
+
const primary = selection[0] ?? null;
|
|
35094
|
+
const fresh = primary?.selectionId === previousPrimary ? null : createRegistrationDraftData(primary);
|
|
35095
|
+
const draft = {
|
|
35096
|
+
...state.draft,
|
|
35097
|
+
...fresh ? {
|
|
35098
|
+
selectedTicketLines: fresh.selectedTicketLines,
|
|
35099
|
+
selectedSlidingAmountInput: fresh.selectedSlidingAmountInput,
|
|
35100
|
+
selectedAttendanceMode: fresh.selectedAttendanceMode
|
|
35101
|
+
} : {},
|
|
35102
|
+
selection,
|
|
35103
|
+
selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(selection), fresh?.selectedAttendanceMode ?? state.draft.selectedAttendanceMode),
|
|
35104
|
+
runChoices: keepRunPricingChoices(state.draft.runChoices, selection)
|
|
35105
|
+
};
|
|
35106
|
+
return normalizeRegistrationFlowState({
|
|
35107
|
+
...state,
|
|
35108
|
+
draft,
|
|
35109
|
+
questionFieldErrors: {}
|
|
35110
|
+
});
|
|
35111
|
+
}
|
|
33092
35112
|
function isRegistrationLocked(step) {
|
|
33093
35113
|
return [
|
|
33094
35114
|
"success",
|
|
@@ -33104,7 +35124,7 @@ function updateRegistrationDraft(state, action) {
|
|
|
33104
35124
|
switch (action.type) {
|
|
33105
35125
|
case "set-tickets-count": return {
|
|
33106
35126
|
...state,
|
|
33107
|
-
|
|
35127
|
+
placeCount: Math.max(1, action.ticketsCount)
|
|
33108
35128
|
};
|
|
33109
35129
|
case "eligibility-updated": return {
|
|
33110
35130
|
...state,
|
|
@@ -33188,9 +35208,11 @@ function reduceCompletedRegistration(state, action) {
|
|
|
33188
35208
|
step: "select-event"
|
|
33189
35209
|
}, action);
|
|
33190
35210
|
case "event-continued": return state;
|
|
35211
|
+
case "selection-toggled": return state;
|
|
33191
35212
|
case "submission-failed":
|
|
33192
35213
|
case "draft-edited":
|
|
33193
35214
|
case "booking-questions":
|
|
35215
|
+
case "run-requirements":
|
|
33194
35216
|
case "question-errors-set":
|
|
33195
35217
|
case "payment-return-restored":
|
|
33196
35218
|
case "sign-in-draft-restored":
|
|
@@ -33240,7 +35262,7 @@ function applyWaitlistClaimLookup(state, action) {
|
|
|
33240
35262
|
case "awaitingEvents": return state;
|
|
33241
35263
|
case "ready": return normalizeRegistrationFlowState({
|
|
33242
35264
|
...state,
|
|
33243
|
-
|
|
35265
|
+
placeCount: restoration.ticketsCount,
|
|
33244
35266
|
draft: restoreRegistrationDraft(state.draft, lookup.claim, restoration),
|
|
33245
35267
|
invitation: {
|
|
33246
35268
|
kind: "ready",
|
|
@@ -33272,7 +35294,7 @@ function completeRegistration(state, result) {
|
|
|
33272
35294
|
step: "success",
|
|
33273
35295
|
result,
|
|
33274
35296
|
invitation: { kind: "none" },
|
|
33275
|
-
completedOutcomes: result.status === "confirmed" ?
|
|
35297
|
+
completedOutcomes: result.status === "confirmed" ? confirmedOutcomes(result).reduce(recordCompletedOutcome, state.completedOutcomes) : state.completedOutcomes
|
|
33276
35298
|
};
|
|
33277
35299
|
}
|
|
33278
35300
|
//#endregion
|
|
@@ -33382,7 +35404,9 @@ function panelShouldOpen(step) {
|
|
|
33382
35404
|
}
|
|
33383
35405
|
const REGISTRATION_STEP_LABELS = [
|
|
33384
35406
|
"Event",
|
|
35407
|
+
"Choose what to book",
|
|
33385
35408
|
"Date",
|
|
35409
|
+
"Dates",
|
|
33386
35410
|
"Tickets",
|
|
33387
35411
|
"Places",
|
|
33388
35412
|
"Your details",
|
|
@@ -33394,17 +35418,29 @@ function getEventSelectionMode(events) {
|
|
|
33394
35418
|
const firstSeriesId = events[0]?.seriesId;
|
|
33395
35419
|
return events.length > 1 && firstSeriesId && events.every((event) => event.seriesId === firstSeriesId) ? "date" : "event";
|
|
33396
35420
|
}
|
|
35421
|
+
/** Several runs of one course that can be booked together, as the selection step lists them. */
|
|
35422
|
+
function severalRuns(events) {
|
|
35423
|
+
const offerings = new Set(events.map((event) => event.registrationSubject?.kind === "wholeSeries" ? event.registrationSubject.eventOfferingId : null));
|
|
35424
|
+
return events.length > 1 && offerings.size === 1 && !offerings.has(null) && events.every((event) => event.allowsMultipleBooking === true);
|
|
35425
|
+
}
|
|
33397
35426
|
/** The label facts for a surface: what the visitor chooses from, and what they book. */
|
|
33398
35427
|
function registrationStepLabelContext(scopedEvents, bookedEvent) {
|
|
35428
|
+
const mode = getEventSelectionMode(scopedEvents);
|
|
35429
|
+
const several = scopedEvents.every((event) => event.allowsMultipleBooking === true);
|
|
33399
35430
|
return {
|
|
33400
|
-
eventSelection:
|
|
35431
|
+
eventSelection: mode === "date" && several ? "dates" : severalRuns(scopedEvents) ? "runs" : mode,
|
|
33401
35432
|
booksWholeSeries: bookedEvent?.registrationSubject.kind === "wholeSeries"
|
|
33402
35433
|
};
|
|
33403
35434
|
}
|
|
33404
35435
|
/** One label owner for the live progress and the server placeholder. */
|
|
33405
35436
|
function registrationStepLabel(step, context) {
|
|
33406
35437
|
switch (step) {
|
|
33407
|
-
case "select-event":
|
|
35438
|
+
case "select-event": switch (context.eventSelection) {
|
|
35439
|
+
case "date": return "Date";
|
|
35440
|
+
case "dates": return "Dates";
|
|
35441
|
+
case "runs": return "Choose what to book";
|
|
35442
|
+
case "event": return "Event";
|
|
35443
|
+
}
|
|
33408
35444
|
case "select-tickets": return context.booksWholeSeries ? "Places" : "Tickets";
|
|
33409
35445
|
case "enter-details": return "Your details";
|
|
33410
35446
|
case "select-payment": return "How you’ll pay";
|
|
@@ -33834,4 +35870,4 @@ function membershipCardListContent(display) {
|
|
|
33834
35870
|
};
|
|
33835
35871
|
}
|
|
33836
35872
|
//#endregion
|
|
33837
|
-
export { resolveHeadlessEventRegistrationStatus as $, softBoundaryOption as $a, resolveLookSurfacePresentation as $i, canJoinEventWaitlist as $n, asLayoutVariantKey as $o, bookingHasPackagePaymentChoices as $r, normalizeTicketSelectionLines as $t, createInitialRegistrationFlowState as A, generateDefaultCardSystem as Aa, PAGE_NAVIGATION as Ai, resolveImageUrl as An, opaqueSurfaceDeclarations as Ao, selectedBookingCollectionOptionKind as Ar, resolvePricingOptionsPriceDisplay as As, resolveFinishedPresentation as At, placeCountCeiling as B, navLinkOwnsUnderline as Ba, normalizeEventRegistrationPageSurfaceSubject as Bi, formatDate$1 as Bn, boxBackgroundOverlaySchema as Bo, isAppointmentBookingQuestionsEvent as Br, getImplicitSingleTicketType as Bt, panelShouldOpen as C, compilePageRuntimeFields as Ca, blockButtonRoleSchema as Ci, ImagePresets as Cn, plainFrame as Co, parseBookingCurrencyInputToCents as Cr, formatEventPricing as Cs, parseCurrencyInputToCents as Ct, registrationStepLabel as D, gradientToCss as Da, browserReadAuthoritySchema as Di, renderAudio as Dn, cardListFamilyBlocks as Do, resolveBookingSelectedService as Dr, publicEventPricingStrategy as Ds, registrationQuestionsMessage as Dt, registrationRoute as E, surfaceResolutionContextFromTheme as Ea, resolveDateRuntimeContext as Ei, mediaImageHostProps as En, toNonEmptyReadonlyArray as Eo, resolveBookingPaymentStep as Er, publicEventPricingDisplay as Es, withRegistrationAvailability as Et, buildEventRegistrationPaymentOptionsViewModel as F, generateNavLinkCSS as Fa, bookingPageKindSchema as Fi, eventCalendarWeekStart as Fn, sectionStylesOverrideSchema as Fo, resolveSelectedAppointmentConsent as Fr, formatDate as Ft, resolveRegistrationAvailabilityBlocker as G, sectionShapeFromContent as Ga, isDecodeSuccess as Gi, formatEventNextDateFact as Gn, cardVariantRoleValues as Go, deriveBookingQuestions as Gr, transformRegistrationOptionsResponse as Gt, planRegistrationDetailsContinuation as H, resolvePageDesignBlockLookChoice as Ha, createZodCodec as Hi, formatEventCompactDateRail as Hn, runtimeBoxBackgroundSchema as Ho, bookingQuestionsAnswerDraftSchema as Hr, getTicketTypeAvailabilityLabel as Ht, decideEventRegistrationPayment as I, generateEffectsCSS as Ia, buildInteractiveIslandProps as Ii, eventDateLocale as In, themeSchema as Io, EMPTY_APPOINTMENT_BOOKING_QUESTIONS as Ir, formatEventDateTime as It, visitorHoldsOwnPlace as J, boundaryOptions as Ja, listLookSlot as Ji, formatEventWeekdayTime as Jn, surfaceCardRoleValues as Jo, toBookingQuestionsAnswerDraft as Jr, getSingleSelectedPricingOptionId as Jt, resolveRegistrationTicketContinuation as K, sectionShapeHook as Ka, listItemPresentation as Ki, formatEventRunDates as Kn, itemRoleValues as Ko, needsBookingQuestionsRefresh as Kr, withOccurrenceTitle as Kt, shouldPromptForLogin as L, generateInteractiveChildInheritanceCSS as La, createInteractiveIslandCodec as Li, eventDateOptions as Ln, headerVariantValues as Lo, applyAppointmentBookingQuestionsEvent as Lr, formatPassCreditUsageLabel as Lt, getDeclinedPass as M, footerForegroundCandidates as Ma, leavePage as Mi, resolveMediaNodeResponsiveImage as Mn, surfaceToneFromForegroundToken as Mo, formatCentsAsCurrencyInput as Mr, unsafeAsSiteId as Ms, areEntitlementsDisabledForTicketCount as Mt, isRegistrationLocked as N, getNavLinkPreset as Na, pageNavigationSchema as Ni, resolvePublicMediaUrl as Nn, arrangementSlotNames as No, formatPrice as Nr, parseEventSeriesId as Ns, findSelectedTicketType as Nt, registrationStepLabelContext as O, getGradientPreset as Oa, createHostedBlockApiConfig as Oi, renderVideo as On, cardListKnobBlocks as Oo, resolveBookingSiteId as Or, publicEventPricingType as Os, validateFormData as Ot, registrationFlowReducer as P, buildTextContrastShadow as Pa, requestSignIn as Pi, buildCalendarViewport as Pn, TokenResolver as Po, projectSelectedAppointmentConsentIntoForm as Pr, unsafeAsEventCategoryId as Ps, formatBookingWhen as Pt, resolveEventRegistrationSubmitPlan as Q, noneBoundaryOption as Qa, lookPresentationOnPalette as Qi, resolveRuntimeEventDestination as Qn, asDesignBlockId as Qo, applyBookingPaymentAdmission as Qr, hasValidPricingOptionSelection as Qt, fullyBookedLabel as R, navLinkHoverColorCandidate as Ra, defineInteractiveIslandMetaKeys as Ri, eventLocalDateKey as Rn, blockCustomCssRuleSchema as Ro, appointmentQuestionsRefusal as Rr, formatRegistrationSchedule as Rt, getEventSelectionMode as S, requireCuratedSiteStyle as Sa, BLOCK_BUTTON_ROLE_OPTIONS as Si, RichText as Sn, offeringsPreviewCompositionTreatmentValues as So, normalizeBookingServices as Sr, formatBookingPriceDisplay as Ss, getTicketSelectionRemainingPlaces as St, registrationPresentation as T, stripCompiledRuntimeStyleFields as Ta, readRuntimeNow as Ti, computeMediaTransformStyle as Tn, testimonialsCompositionTreatmentValues as To, resolveAppointmentCheckoutVerificationState as Tr, publicEventPricingCurrency as Ts, shouldLoadRegistrationOptions as Tt, resolveGuestNextStepCheck as U, resolvePageDesignBoundaryChoice as Ua, defineClientOwnedBlockRuntime as Ui, formatEventDateParts as Un, boxlessCardVariantValue as Uo, bookingQuestionsPaymentSnapshotSchema as Ur, getVisibleTicketTypes as Ut, planRegistrationDetailsCheck as V, parsePageDesignIntent as Va, resolveEventRegistrationScopedEvents as Vi, formatEventClockLabel as Vn, boxBackgroundSchema as Vo, needsAppointmentQuestionsRefresh as Vr, getPortalSubjectEmail as Vt, resolveRegistrationAdmission as W, sectionShapeForGround as Wa, defineProgressiveBlockRuntime as Wi, formatEventHourLabel as Wn, cardRoleSchema as Wo, decideBookingQuestionsRestoration as Wr, occurrenceTitleOverride as Wt, isEventRegistrationAvailable as X, boundaryTreatmentForBoundaryOptionId as Xa, resolvedItemSurfaceProps as Xi, groupEventsByDate as Xn, siteChromeBackgroundOverrideOwner as Xo, BOOKING_FORM_DATA_RESERVED_KEYS as Xr, getTicketSelectionTotal as Xt, deriveEventRegistrationSteps as Y, boundaryRuntimeMetricsForDecorativeTransition as Ya, lookListPresentationSchemaShape as Yi, formatTime$1 as Yn, parseGradientPresetId as Yo, toBookingQuestionsPaymentSnapshot as Yr, getTicketLineQuantity as Yt, normalizeEventRegistrationMaxTickets as Z, isDecorativeTransitionIntent as Za, itemRole as Zi, resolveEventTimeZone as Zn, asAppearancePresetId as Zo, BOOKING_FORM_DATA_RESERVED_KEY_VALUES as Zr, getTicketTypeLineMax as Zt, parseStoredCommerceCartState as _, filterLayoutProfilesForPolicy as _a, eventLayoutSchema as _i, bookingPresentation as _n, defineFrameCapability as _o, getBookingSuccessCopy as _r, parseMailchimpAudienceId as _s, getCurrentTicketSelection as _t, buildProductDetailDisplay as a, compileArrangementLookRuntime as aa, resolveBookingPaymentAvailability as ai, EVENT_SIGN_IN_FORM_ID as an, deriveSectionGround as ao, getEventAvailabilityStatus as ar, isRecord$4 as as, buildReviewedBookingPaymentViewModel as at, resolveSelectedProduct as b, designRuntimeRulesForSiteStyle as ba, registrationButtonVariantSchema as bi, resolveRegistrationDisplay as bn, featureCardCompositionTreatmentValues as bo, isBookingServiceSlidingAmountInRange as br, offeringLabelForPageSurfaceSubject as bs, getSlidingScaleForEvent as bt, formatInterval as c, resolveLookForBlock as ca, resolveBookingPurchasablePackages as ci, eventSignInRestoration as cn, sectionForegroundBackground as co, selectEventCapacitySource as cr, nextLiveRunSessionStartMs as cs, findPreSelectedEvent as ct, membershipClassesLabel as d, readStoredMode as da, bookingNowSchema as di, createSignInReturnDraftStore as dn, themeV2CompilerOwnedFieldNames as do, bookingFormInteractiveIslandPropsCodec as dr, resolveWholeSeriesRunLifecycle as ds, resolveRegistrationTarget as dt, selectItemSurfacePresentation as ea, bookingPackageRequestKey as ei, setTicketLineQuantity as en, spaciousBoundaryOption as eo, canJoinEventWaitlistOnAnyMode as er, asPageFlowPresetId as es, resolveHeadlessEventRegistrationView as et, passCardListContent as f, resolveEffectiveArrangement as fa, calendarTabViewsSchema as fi, decideSignInReturn as fn, appearancePresets as fo, buildBookingFormInteractiveIslandProps as fr, parseMailingListRuntimeContext as fs, resolveRouteRequiresPayment as ft, deriveCommerceCheckoutState as g, deriveSiteStyleBlockPolicy as ga, eventCalendarDisplayModeSchema as gi, sweepExpiredSignInReturnDrafts as gn, defineBlockDesignCapability as go, getBookingRedirectStateFromLocation as gr, parseBrevoListId as gs, invitationSubmission as gt, buildProductCartItem as h, buildInitialPolicyPageDesignIntent as ha, eventCalendarDefaultViewSchema as hi, signInReturnPath as hn, assertNever as ho, formatBookingSubmissionPreparationError as hr, DEFAULT_MAILING_LIST_SUCCESS_MESSAGE as hs, createRegistrationDraftData as ht, buildProductCardDisplay as i, automaticArrangementLook as ia, resolveBookingPackageSources as ii, toWholeSeriesRegistrationEvents as in, applyLookPhotoTreatment as io, getEventAvailability as ir, parseAspectRatioValue as is, buildBookingPaymentSelectionViewModel as it, decideEventChoice as j, generateFooterCss as ja, canonicalUrl as ji, resolveImageUrlWithContext as jn, selectLogoVariant as jo, toSelectedCollectionOptionKind as jr, parseSiteId as js, ENTITLEMENT_SINGLE_TICKET_TOOLTIP as jt, areEventRegistrationPaymentSelectionsEqual as k, resolveCardRole as ka, getBlockApiReadStage as ki, resolveImageSourceSetWithContext as kn, opaqueSurfaceContextFromTheme as ko, resolveDefaultBookingServiceId as kr, resolveExactOrFreePriceDisplay as ks, confirmationPaymentRows as kt, formatValidity as l, styleSectionBackgroundForColour as la, toBookingPurchasablePackages as li, toEventSignInDraft as ln, sectionSurfaceBase as lo, selectMostOpenCapacitySource as lr, orderedLiveRunSessions as ls, resolveDiscountContext as lt, buildPassCartItem as m, resolvePublishedLook as ma, eventButtonVariantSchema as mi, readSignInReturn as mn, lookModes as mo, deriveBookingFormViewState as mr, DEFAULT_MAILING_LIST_PRIVACY_NOTE as ms, beginWaitlistInvitation as mt, buildCheckoutDisplay as n, arrangementLookHooks as na, reconcileBookingPackagePurchase as ni, toRegistrationEvents as nn, anglePolygonCss as no, formatRemainingPlaces as nr, makeBoundaryId as ns, toInternalPaymentSelection as nt, buildProductListDisplay as o, getCompatibleBlockAppearancePresets as oa, resolveBookingPaymentChoice as oi, eventSignInDraftStore as on, parseCanonicalRuntimeBackground as oo, getRemainingPlaces as or, CANCELLED_SESSION_STATUS as os, paymentChoiceDetails as ot, EMPTY_COMMERCE_CART_STATE as p, resolveModeArrangement as pa, columnOptionSchema as pi, nextSignInReturnExpiry as pn, resolveEffectiveKnobs as po, readOverrideServiceCategories as pr, resolveBookingSignupOffer as ps, toRegistrationRequestSubject as pt, settledRemainingPlaces as q, boundaryOptionForTransitionIntent as qa, listLookControl as qi, formatEventTimeRange as qn, openCardRoleValue as qo, restoreBookingQuestionsAnswers as qr, canRequestTicketOption as qt, buildPassesMembershipsDisplay as r, arrangementStyleAvailability as ra, resolveBookingPackagePaymentSelection as ri, toWholeSeriesRegistrationEvent as rn, transitionCatalogueEntries as ro, formatTotalCapacity as rr, sanitizeHref as rs, calculateEventRegistrationPreviewTotal as rt, formatCommercePrice as s, resolveArrangementLookForBlock as sa, resolveBookingPaymentMode as si, eventSignInEnds as sn, resolveSectionBackground as so, isEventFull as sr, firstLiveRunSessionStartMs as ss, paymentChoicePrice as st, buildCartDisplay as t, arrangementAppearancePresets as ta, bookingRequiresResourceSelection as ti, getRegistrationStartAt as tn, transitionIntentForTreatment as to, formatEventRemainingPlaces as tr, asSiteStyleId as ts, toHeadlessPaymentSelection as tt, membershipCardListContent as u, arrangementManifestFromVariants as ua, getBookingServiceSlidingScale as ui, clearSignInReturnDrafts as un, stripStaleTransitionStyleGroup as uo, groupPublicEventsByRun as ur, resolveWholeSeriesBookingPhase as us, resolveEventRequiresPayment as ut, productItemKey as v, filterLookIdsForPolicy as va, filterAutoShowSchema as vi, placesLeftLabel as vn, defineNoBlockDesignCapability as vo, getRegistrationSuccessCopy as vr, parseMailchimpInterestId as vs, getEligibilityFlowFlags as vt, registrationPaymentRoute as w, compiledRuntimeStyleFieldNames as wa, isBlockButtonRole as wi, MediaPlaceholder as wn, sectionBackgroundPaintValues as wo, prepareBookingSubmission as wr, isPublicEventPricingOptionDisplayable as ws, resolveHeldTicketPlaces as wt, REGISTRATION_STEP_LABELS as x, getCuratedSiteStyle as xa, weekStartSchema as xi, shownVenue as xn, introCompositionTreatmentValues as xo, normalizeBookingFormConfig as xr, EVENT_PRESET_VOCABULARY as xs, getSlidingScaleSelectionMessage as xt, reduceCommerceCart as y, componentRuntimeRulesForSiteStyle as ya, previewStageSchema as yi, registrationDisplaySchema as yn, designIssueSeverityForPolicy as yo, getShopSuccessCopy as yr, parseNewsletterListId as ys, getRegistrationOccurrenceId as yt, getTicketSelectionPurpose as z, navLinkOwnsHoverForeground as za, eventRegistrationPageSurfaceSubjectSchema as zi, formatCalendarTitle as zn, customCssRuleSchema as zo, deriveAppointmentBookingQuestions as zr, formatTime as zt };
|
|
35873
|
+
export { resolveHeadlessEventRegistrationStatus as $, arrangementStyleAvailability as $a, resolveBookingPackagePaymentSelection as $i, getSingleSelectedPricingOptionId as $n, transitionCatalogueEntries as $o, formatTotalCapacity as $r, asPageFlowPresetId as $s, runPricingChoice as $t, createInitialRegistrationFlowState as A, requestSignIn as Aa, resolveExactOrFreePriceDisplay as Ac, projectSelectedAppointmentConsentIntoForm as Ai, formatDate as An, buildTextContrastShadow as Ao, buildCalendarViewport as Ar, arrangementSlotNames as As, toEventSignInDraft as At, placeCountCeiling as B, defineProgressiveBlockRuntime as Ba, decideBookingQuestionsRestoration as Bi, transformRegistrationOptionsResponse as Bn, sectionShapeForGround as Bo, formatEventHourLabel as Br, boxlessCardVariantValue as Bs, toRunRequirementsSnapshots as Bt, panelShouldOpen as C, browserReadAuthoritySchema as Ca, formatBookingPriceDisplay as Cc, resolveBookingSelectedService as Ci, selectionPreviewKey as Cn, gradientToCss as Co, renderAudio as Cr, toNonEmptyReadonlyArray as Cs, toRegistrationEvents as Ct, registrationStepLabel as D, canonicalUrl as Da, publicEventPricingDisplay as Dc, toSelectedCollectionOptionKind as Di, areEntitlementsDisabledForTicketCount as Dn, generateFooterCss as Do, resolveImageUrlWithContext as Dr, opaqueSurfaceDeclarations as Ds, eventSignInDraftStore as Dt, registrationRoute as E, PAGE_NAVIGATION as Ea, publicEventPricingCurrency as Ec, selectedBookingCollectionOptionKind as Ei, ENTITLEMENT_SINGLE_TICKET_TOOLTIP as En, generateDefaultCardSystem as Eo, resolveImageUrl as Er, opaqueSurfaceContextFromTheme as Es, EVENT_SIGN_IN_FORM_ID as Et, buildEventRegistrationPaymentOptionsViewModel as F, eventRegistrationPageSurfaceSubjectSchema as Fa, unsafeAsEventCategoryId as Fc, deriveAppointmentBookingQuestions as Fi, getImplicitSingleTicketType as Fn, navLinkOwnsHoverForeground as Fo, formatCalendarTitle as Fr, blockCustomCssRuleSchema as Fs, deriveRunRequirements as Ft, resolveRegistrationAvailabilityBlocker as G, lookListPresentationSchemaShape as Ga, toBookingQuestionsPaymentSnapshot as Gi, getSlidingScaleForEvent as Gn, boundaryRuntimeMetricsForDecorativeTransition as Go, formatTime$1 as Gr, surfaceCardRoleValues as Gs, decideSelectionPayment as Gt, planRegistrationDetailsContinuation as H, listItemPresentation as Ha, needsBookingQuestionsRefresh as Hi, getCurrentTicketSelection as Hn, sectionShapeHook as Ho, formatEventRunDates as Hr, cardVariantRoleValues as Hs, SELECTION_LIMIT_NOTE as Ht, decideEventRegistrationPayment as I, normalizeEventRegistrationPageSurfaceSubject as Ia, isAppointmentBookingQuestionsEvent as Ii, getPortalSubjectEmail as In, navLinkOwnsUnderline as Io, formatDate$1 as Ir, customCssRuleSchema as Is, nextRunToRead as It, visitorHoldsOwnPlace as J, lookPresentationOnPalette as Ja, applyBookingPaymentAdmission as Ji, parseCurrencyInputToCents as Jn, noneBoundaryOption as Jo, resolveRuntimeEventDestination as Jr, asHeaderStyleId as Js, planSelectionPrice as Jt, resolveRegistrationTicketContinuation as K, resolvedItemSurfaceProps as Ka, BOOKING_FORM_DATA_RESERVED_KEYS as Ki, getSlidingScaleSelectionMessage as Kn, boundaryTreatmentForBoundaryOptionId as Ko, groupEventsByDate as Kr, parseGradientPresetId as Ks, effectiveSelection as Kt, shouldPromptForLogin as L, resolveEventRegistrationScopedEvents as La, needsAppointmentQuestionsRefresh as Li, getTicketTypeAvailabilityLabel as Ln, parsePageDesignIntent as Lo, formatEventClockLabel as Lr, boxBackgroundOverlaySchema as Ls, runFieldErrors as Lt, getDeclinedPass as M, buildInteractiveIslandProps as Ma, parseSiteId as Mc, EMPTY_APPOINTMENT_BOOKING_QUESTIONS as Mi, formatPassCreditUsageLabel as Mn, generateEffectsCSS as Mo, eventDateLocale as Mr, sectionStylesOverrideSchema as Ms, buildSelectionRequirementsSubmission as Mt, isRegistrationLocked as N, createInteractiveIslandCodec as Na, unsafeAsSiteId as Nc, applyAppointmentBookingQuestionsEvent as Ni, formatRegistrationSchedule as Nn, generateInteractiveChildInheritanceCSS as No, eventDateOptions as Nr, themeSchema as Ns, checkRunRequirements as Nt, registrationStepLabelContext as O, leavePage as Oa, publicEventPricingStrategy as Oc, formatCentsAsCurrencyInput as Oi, findSelectedTicketType as On, footerForegroundCandidates as Oo, resolveMediaNodeResponsiveImage as Or, selectLogoVariant as Os, eventSignInEnds as Ot, registrationFlowReducer as P, defineInteractiveIslandMetaKeys as Pa, parseEventSeriesId as Pc, appointmentQuestionsRefusal as Pi, formatTime as Pn, navLinkHoverColorCandidate as Po, eventLocalDateKey as Pr, headerVariantValues as Ps, decideSelectionRequirementsLayout as Pt, resolveEventRegistrationSubmitPlan as Q, arrangementLookHooks as Qa, reconcileBookingPackagePurchase as Qi, canRequestTicketOption as Qn, anglePolygonCss as Qo, formatRemainingPlaces as Qr, asLayoutVariantKey as Qs, runNeedsPricingChoice as Qt, fullyBookedLabel as R, createZodCodec as Ra, bookingQuestionsAnswerDraftSchema as Ri, getVisibleTicketTypes as Rn, resolvePageDesignBlockLookChoice as Ro, formatEventCompactDateRail as Rr, boxBackgroundSchema as Rs, runRequirementsSnapshotSchema as Rt, getEventSelectionMode as S, resolveDateRuntimeContext as Sa, EVENT_PRESET_VOCABULARY as Sc, resolveBookingPaymentStep as Si, selectionItemName as Sn, surfaceResolutionContextFromTheme as So, mediaImageHostProps as Sr, testimonialsCompositionTreatmentValues as Ss, getRegistrationStartAt as St, registrationPresentation as T, getBlockApiReadStage as Ta, isPublicEventPricingOptionDisplayable as Tc, resolveDefaultBookingServiceId as Ti, serverPricedTotalCents as Tn, resolveCardRole as To, resolveImageSourceSetWithContext as Tr, cardListKnobBlocks as Ts, toWholeSeriesRegistrationEvents as Tt, resolveGuestNextStepCheck as U, listLookControl as Ua, restoreBookingQuestionsAnswers as Ui, getEligibilityFlowFlags as Un, boundaryOptionForTransitionIntent as Uo, formatEventTimeRange as Ur, itemRoleValues as Us, SEVERAL_BOOKINGS_ACCOUNT_NOTE as Ut, planRegistrationDetailsCheck as V, isDecodeSuccess as Va, deriveBookingQuestions as Vi, withOccurrenceTitle as Vn, sectionShapeFromContent as Vo, formatEventNextDateFact as Vr, cardRoleSchema as Vs, withoutKeptAnswers as Vt, resolveRegistrationAdmission as W, listLookSlot as Wa, toBookingQuestionsAnswerDraft as Wi, getRegistrationOccurrenceId as Wn, boundaryOptions as Wo, formatEventWeekdayTime as Wr, openCardRoleValue as Ws, canToggleSelectionItem as Wt, isEventRegistrationAvailable as X, selectItemSurfacePresentation as Xa, bookingPackageRequestKey as Xi, shouldLoadRegistrationOptions as Xn, spaciousBoundaryOption as Xo, canJoinEventWaitlistOnAnyMode as Xr, asAppearancePresetId as Xs, registrationSelectionMode as Xt, deriveEventRegistrationSteps as Y, resolveLookSurfacePresentation as Ya, bookingHasPackagePaymentChoices as Yi, resolveHeldTicketPlaces as Yn, softBoundaryOption as Yo, canJoinEventWaitlist as Yr, siteChromeBackgroundOverrideOwner as Ys, primarySelectionItem as Yt, normalizeEventRegistrationMaxTickets as Z, arrangementAppearancePresets as Za, bookingRequiresResourceSelection as Zi, withRegistrationAvailability as Zn, transitionIntentForTreatment as Zo, formatEventRemainingPlaces as Zr, asDesignBlockId as Zs, runChoiceUsable as Zt, parseStoredCommerceCartState as _, weekStartSchema as _a, parseBrevoListId as _c, normalizeBookingFormConfig as _i, combinationHintCopy as _n, getCuratedSiteStyle as _o, shownVenue as _r, featureCardCompositionTreatmentValues as _s, invitationSubmission as _t, buildProductDetailDisplay as a, toBookingPurchasablePackages as aa, INCOMPATIBLE_ATTENDANCE_MESSAGE as ac, selectMostOpenCapacitySource as ai, selectionIncludes as an, styleSectionBackgroundForColour as ao, setTicketLineQuantity as ar, sectionSurfaceBase as as, buildReviewedBookingPaymentViewModel as at, resolveSelectedProduct as b, isBlockButtonRole as ba, parseNewsletterListId as bc, prepareBookingSubmission as bi, combinationWorking as bn, compiledRuntimeStyleFieldNames as bo, MediaPlaceholder as br, plainFrame as bs, confirmationPaymentRows as bt, formatInterval as c, calendarTabViewsSchema as ca, firstLiveRunSessionStartMs as cc, buildBookingFormInteractiveIslandProps as ci, selectionPlacesLabel as cn, resolveEffectiveArrangement as co, decideSignInReturn as cr, appearancePresets as cs, buildRegistrationSelectionRequest as ct, membershipClassesLabel as d, eventCalendarDefaultViewSchema as da, resolveWholeSeriesBookingPhase as dc, formatBookingSubmissionPreparationError as di, selectionTicketInputs as dn, buildInitialPolicyPageDesignIntent as do, signInReturnPath as dr, assertNever as ds, resolveEventRequiresPayment as dt, resolveBookingPackageSources as ea, asSiteStyleId as ec, getEventAvailability as ei, runUnitPriceCents as en, automaticArrangementLook as eo, getTicketLineQuantity as er, applyLookPhotoTreatment as es, resolveHeadlessEventRegistrationView as et, passCardListContent as f, eventCalendarDisplayModeSchema as fa, resolveWholeSeriesRunLifecycle as fc, getBookingRedirectStateFromLocation as fi, severalConfirmationSentence as fn, deriveSiteStyleBlockPolicy as fo, sweepExpiredSignInReturnDrafts as fr, defineBlockDesignCapability as fs, resolveRegistrationTarget as ft, deriveCommerceCheckoutState as g, registrationButtonVariantSchema as ga, DEFAULT_MAILING_LIST_SUCCESS_MESSAGE as gc, isBookingServiceSlidingAmountInRange as gi, toggleSelectionItem as gn, designRuntimeRulesForSiteStyle as go, resolveRegistrationDisplay as gr, designIssueSeverityForPolicy as gs, createRegistrationDraftData as gt, buildProductCartItem as h, previewStageSchema as ha, DEFAULT_MAILING_LIST_PRIVACY_NOTE as hc, getShopSuccessCopy as hi, summariseSelectionPayment as hn, componentRuntimeRulesForSiteStyle as ho, registrationDisplaySchema as hr, defineNoBlockDesignCapability as hs, beginWaitlistInvitation as ht, buildProductCardDisplay as i, resolveBookingPurchasablePackages as ia, isRecord$4 as ic, selectEventCapacitySource as ii, selectionEntitlementNote as in, resolveLookForBlock as io, normalizeTicketSelectionLines as ir, sectionForegroundBackground as is, buildBookingPaymentSelectionViewModel as it, decideEventChoice as j, bookingPageKindSchema as ja, resolvePricingOptionsPriceDisplay as jc, resolveSelectedAppointmentConsent as ji, formatEventDateTime as jn, generateNavLinkCSS as jo, eventCalendarWeekStart as jr, TokenResolver as js, paymentReturnRestoration as jt, areEventRegistrationPaymentSelectionsEqual as k, pageNavigationSchema as ka, publicEventPricingType as kc, formatPrice as ki, formatBookingWhen as kn, getNavLinkPreset as ko, resolvePublicMediaUrl as kr, surfaceToneFromForegroundToken as ks, eventSignInRestoration as kt, formatValidity as l, columnOptionSchema as la, nextLiveRunSessionStartMs as lc, readOverrideServiceCategories as li, selectionPlacesNote as ln, resolveModeArrangement as lo, nextSignInReturnExpiry as lr, resolveEffectiveKnobs as ls, findPreSelectedEvent as lt, buildPassCartItem as m, filterAutoShowSchema as ma, resolveBookingSignupOffer as mc, getRegistrationSuccessCopy as mi, severalRunsChoiceMessage as mn, filterLookIdsForPolicy as mo, placesLeftLabel as mr, defineFrameCapability as ms, toRegistrationRequestSubject as mt, buildCheckoutDisplay as n, resolveBookingPaymentChoice as na, sanitizeHref as nc, getRemainingPlaces as ni, selectionConfirmationHint as nn, getCompatibleBlockAppearancePresets as no, getTicketTypeLineMax as nr, parseCanonicalRuntimeBackground as ns, toInternalPaymentSelection as nt, buildProductListDisplay as o, getBookingServiceSlidingScale as oa, decideSelectionAttendance as oc, groupPublicEventsByRun as oi, selectionItemPrice as on, arrangementManifestFromVariants as oo, clearSignInReturnDrafts as or, stripStaleTransitionStyleGroup as os, paymentChoiceDetails as ot, EMPTY_COMMERCE_CART_STATE as p, eventLayoutSchema as pa, parseMailingListRuntimeContext as pc, getBookingSuccessCopy as pi, severalItemsOf as pn, filterLayoutProfilesForPolicy as po, bookingPresentation as pr, defineExactCatalog as ps, resolveRouteRequiresPayment as pt, settledRemainingPlaces as q, itemRole as qa, BOOKING_FORM_DATA_RESERVED_KEY_VALUES as qi, getTicketSelectionRemainingPlaces as qn, isDecorativeTransitionIntent as qo, resolveEventTimeZone as qr, asHeaderLayoutId as qs, incompleteRunChoiceMessage as qt, buildPassesMembershipsDisplay as r, resolveBookingPaymentMode as ra, parseAspectRatioValue as rc, isEventFull as ri, selectionConsentLabel as rn, resolveArrangementLookForBlock as ro, hasValidPricingOptionSelection as rr, resolveSectionBackground as rs, calculateEventRegistrationPreviewTotal as rt, formatCommercePrice as s, bookingNowSchema as sa, CANCELLED_SESSION_STATUS as sc, bookingFormInteractiveIslandPropsCodec as si, selectionItemsLabel as sn, readStoredMode as so, createSignInReturnDraftStore as sr, themeV2CompilerOwnedFieldNames as ss, paymentChoicePrice as st, buildCartDisplay as t, resolveBookingPaymentAvailability as ta, makeBoundaryId as tc, getEventAvailabilityStatus as ti, selectionAtLimit as tn, compileArrangementLookRuntime as to, getTicketSelectionTotal as tr, deriveSectionGround as ts, toHeadlessPaymentSelection as tt, membershipCardListContent as u, eventButtonVariantSchema as ua, orderedLiveRunSessions as uc, deriveBookingFormViewState as ui, selectionRowAvailability as un, resolvePublishedLook as uo, readSignInReturn as ur, lookModes as us, resolveDiscountContext as ut, productItemKey as v, BLOCK_BUTTON_ROLE_OPTIONS as va, parseMailchimpAudienceId as vc, normalizeBookingServices as vi, combinationOfferLine as vn, requireCuratedSiteStyle as vo, RichText as vr, introCompositionTreatmentValues as vs, registrationQuestionsMessage as vt, registrationPaymentRoute as w, createHostedBlockApiConfig as wa, formatEventPricing as wc, resolveBookingSiteId as wi, selectionPreviewLines as wn, getGradientPreset as wo, renderVideo as wr, cardListFamilyBlocks as ws, toWholeSeriesRegistrationEvent as wt, REGISTRATION_STEP_LABELS as x, readRuntimeNow as xa, offeringLabelForPageSurfaceSubject as xc, resolveAppointmentCheckoutVerificationState as xi, selectionCombinationHint as xn, stripCompiledRuntimeStyleFields as xo, computeMediaTransformStyle as xr, sectionBackgroundPaintValues as xs, resolveFinishedPresentation as xt, reduceCommerceCart as y, blockButtonRoleSchema as ya, parseMailchimpInterestId as yc, parseBookingCurrencyInputToCents as yi, combinationOffersOf as yn, compilePageRuntimeFields as yo, ImagePresets as yr, offeringsPreviewCompositionTreatmentValues as ys, validateFormData as yt, getTicketSelectionPurpose as z, defineClientOwnedBlockRuntime as za, bookingQuestionsPaymentSnapshotSchema as zi, occurrenceTitleOverride as zn, resolvePageDesignBoundaryChoice as zo, formatEventDateParts as zr, runtimeBoxBackgroundSchema as zs, runsKeepingAnswers as zt };
|