@riverbankcms/sdk 0.151.0 → 0.152.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/CHANGELOG.md +37 -0
- package/dist/{EventEmbeddedCheckoutStep-BBHbM22D.mjs → EventEmbeddedCheckoutStep-DVQXWFm6.mjs} +10 -9
- package/dist/{PreviewEditorSidebar-BHplI9HE.mjs → PreviewEditorSidebar-Dr4NJi3Q.mjs} +4 -3
- package/dist/{PreviewEditorUI-DuyN8nsD.mjs → PreviewEditorUI-DSZXQbyh.mjs} +5 -4
- package/dist/{SdkPreviewModeRuntime-CR5ypwxJ.mjs → SdkPreviewModeRuntime-Dl4GyMc3.mjs} +124 -53
- package/dist/{SiteChromeCustomizeContext-D5t6joF_.mjs → SiteChromeCustomizeContext-DgBe-FlM.mjs} +20418 -32298
- package/dist/ThemedButton-B8ViBnLK.mjs +16350 -0
- package/dist/_dts/api/src/bookingOperations.d.ts +5 -3
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +4 -0
- package/dist/_dts/api/src/endpoints.d.ts +7 -0
- package/dist/_dts/api/src/index.d.ts +1 -1
- package/dist/_dts/api/src/navigation/types.d.ts +7 -0
- package/dist/_dts/api/src/navigation.d.ts +1 -1
- package/dist/_dts/api/src/publicAppointmentBookingContracts.d.ts +10 -1
- package/dist/_dts/api/src/siteAssets.d.ts +1 -0
- package/dist/_dts/blocks/src/definitions.d.ts +1 -1
- package/dist/_dts/blocks/src/index.d.ts +1 -0
- package/dist/_dts/blocks/src/pageRenderPreparation.d.ts +1 -0
- package/dist/_dts/blocks/src/pageRendererContracts.d.ts +1 -1
- package/dist/_dts/blocks/src/primitives/content/utils/sanitizeHref.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/event-registration.d.ts +4 -4
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +16 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +5 -0
- package/dist/_dts/blocks/src/system/blocks/offerings-preview/model.d.ts +2 -0
- package/dist/_dts/blocks/src/system/helpers/normalizeMailingListBlockContent.d.ts +2 -0
- package/dist/_dts/blocks/src/system/registry.d.ts +14 -2
- package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +0 -5
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/api/schemas/events.d.ts +971 -0
- package/dist/_dts/blocks/src/system/runtime/api/schemas/waitlist-claims.d.ts +42 -0
- package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +10 -2
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +10 -136
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +48 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -3
- package/dist/_dts/blocks/src/system/runtime/hooks/useBookingSubmission.state.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.state.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +23 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +6 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/carousel.client.hooks.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/carousel.client.state.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/BookingEntryViews.d.ts +42 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventEmbeddedCheckoutStep.d.ts +4 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationBookingLayer.d.ts +19 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationPayment.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationSurface.d.ts +24 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardContent.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventSelectionStep.d.ts +5 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/GuestDetailsSection.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentStatusStep.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/SingleTicketEntitlementNote.d.ts +11 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/SuccessStep.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/TicketSelectionStep.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/VerifyingTimeoutStep.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/bookingCardDisplay.d.ts +31 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/bookingEntry.d.ts +154 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/bookingFocus.d.ts +12 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventSourceRecovery.d.ts +9 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/finishedBooking.d.ts +77 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/index.d.ts +0 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/offeringNoun.d.ts +12 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentResponse.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationCompletion.d.ts +33 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationDerivations.d.ts +11 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationDisplay.d.ts +31 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationDraft.state.d.ts +60 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationErrorRecovery.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationEventAdapter.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationStateMachine.d.ts +58 -10
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationSurface.d.ts +17 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +23 -7
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useBookingBarFacts.d.ts +12 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationRecoveryRequest.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +4 -11
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +1563 -31
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventSourceRecovery.d.ts +2 -12
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/usePaymentStatusRecovery.d.ts +147 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/utils.d.ts +50 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/waitlistClaimRestoration.d.ts +6 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/wizardSteps.d.ts +85 -15
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +53 -8
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/MonthLookView.d.ts +10 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +16 -0
- package/dist/_dts/blocks/src/system/runtime/shared/bookingPaymentOptionCopy.d.ts +5 -1
- package/dist/_dts/blocks/src/system/runtime/shared/bookingPaymentOptions.d.ts +37 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/ModalShell.d.ts +9 -2
- package/dist/_dts/blocks/src/system/runtime/shared/components/PaymentChoiceRows.d.ts +28 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/StepIndicator.d.ts +6 -8
- package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/shared/index.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/shared/useWaitlistClaim.d.ts +9 -12
- package/dist/_dts/blocks/src/system/runtime/shared/useWaitlistClaim.state.d.ts +15 -0
- package/dist/_dts/blocks/src/system/runtime/shared/utils/themePortalRoot.d.ts +10 -15
- package/dist/_dts/blocks/src/system/transforms/registry/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/transforms/registry/links.d.ts +3 -1
- package/dist/_dts/commerce/src/purchase/bookingInstalmentSchedule.d.ts +2 -0
- package/dist/_dts/commerce/src/purchase/bookingPaymentSelection.d.ts +6 -0
- package/dist/_dts/commerce/src/purchase/confirmationEmailPayment.d.ts +14 -14
- package/dist/_dts/commerce/src/purchase/confirmationPayment.d.ts +65 -0
- package/dist/_dts/commerce/src/purchase/confirmationPaymentSchema.d.ts +66 -0
- package/dist/_dts/commerce/src/purchase/index.d.ts +2 -0
- package/dist/_dts/commerce/src/purchase/orderPaymentState.d.ts +8 -0
- package/dist/_dts/content-model/src/templates/defaults.d.ts +2 -2
- package/dist/_dts/core/src/appointment-booking-terms.d.ts +20 -0
- package/dist/_dts/core/src/booking-payment-schemas.d.ts +70 -0
- package/dist/_dts/core/src/branded.d.ts +0 -2
- package/dist/_dts/core/src/demo-claim-access.d.ts +1 -1
- package/dist/_dts/core/src/demo-claim-readiness.d.ts +18 -0
- package/dist/_dts/core/src/demo-lifecycle-status.d.ts +1 -1
- package/dist/_dts/core/src/demo-warm-pool-target.d.ts +1 -1
- package/dist/_dts/core/src/index.d.ts +4 -0
- package/dist/_dts/core/src/mailing-list-targeting-availability.d.ts +68 -0
- package/dist/_dts/core/src/mailing-list-targeting.d.ts +2 -0
- package/dist/_dts/core/src/ticket-quantity.d.ts +13 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +51 -32
- package/dist/_dts/editor/src/chrome/chromeLayers.d.ts +7 -0
- package/dist/_dts/editor/src/index.d.ts +1 -0
- package/dist/_dts/editor-blocks/src/widgets/link/LinkAddressInput.d.ts +8 -0
- package/dist/_dts/editor-blocks/src/widgets/link/LinkContentList.d.ts +12 -0
- package/dist/_dts/editor-blocks/src/widgets/link/LinkPicker.d.ts +5 -1
- package/dist/_dts/editor-blocks/src/widgets/link/LinkPickerDialog.d.ts +3 -3
- package/dist/_dts/editor-blocks/src/widgets/link/LinkSummary.d.ts +8 -2
- package/dist/_dts/editor-blocks/src/widgets/link/LinkWidget.d.ts +4 -3
- package/dist/_dts/editor-blocks/src/widgets/link/LinkWidgetContext.d.ts +2 -1
- package/dist/_dts/editor-blocks/src/widgets/link/draft.d.ts +44 -0
- package/dist/_dts/editor-blocks/src/widgets/link/presentation.d.ts +13 -0
- package/dist/_dts/editor-blocks/src/widgets/link/types.d.ts +14 -0
- package/dist/_dts/editor-blocks/src/widgets/link/useRoutableContent.d.ts +2 -0
- package/dist/_dts/editor-blocks/src/widgets/link/utils.d.ts +5 -4
- package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/MailingListTargetingField.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/targetingState.d.ts +13 -8
- package/dist/_dts/media-core/src/fileStorage.d.ts +4 -3
- package/dist/_dts/media-core/src/index.d.ts +1 -0
- package/dist/_dts/media-core/src/storageObjectKey.d.ts +12 -0
- package/dist/_dts/media-react/src/hooks/useSupabaseMediaUploader.d.ts +1 -1
- package/dist/_dts/media-react/src/internal/supabaseResumableUpload.d.ts +13 -0
- package/dist/_dts/preview-next/src/client/preview/previewModeRootAttribute.d.ts +11 -0
- package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +0 -1
- package/dist/_dts/sdk/src/rendering/image.d.ts +10 -0
- package/dist/_dts/sdk/src/rendering/index.d.ts +3 -1
- package/dist/_dts/sdk/src/rendering/link.d.ts +9 -0
- package/dist/_dts/sdk/src/rendering/overrides.d.ts +1 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/blocks/opaquePanels.d.ts +3 -3
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/client/BookingMailingListNote-CBuMKN0w.mjs +386 -0
- package/dist/client/{CardListItem-ZDLYh6dL.mjs → CardListItem-Dc9XTXhB.mjs} +3 -4
- package/dist/client/CheckIcon-CpyXr-Kg.mjs +35 -0
- package/dist/client/{CheckboxChoice-M-3HycLw.mjs → CheckboxChoice-CIqx_o0E.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-BMtvPTWE.mjs → DemoBookingPortalAccess-D3VQ_kLj.mjs} +85 -85
- package/dist/client/{EventCombined.client-DUm_DOxW.mjs → EventCombined.client-BHGEKise.mjs} +8 -9
- package/dist/client/{EventEmbeddedCheckoutStep-DsNNzgRm.mjs → EventEmbeddedCheckoutStep-Bo1Cm23R.mjs} +11 -10
- package/dist/client/{EventListing.client-DjNYGUVm.mjs → EventListing.client-D5OQgVPr.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-DuFiOHq_.mjs → LeafletStaticMap-CLL5cWrr.mjs} +1 -1
- package/dist/client/{ModalShell-CqkBvBIC.mjs → ModalShell-BXzucfR6.mjs} +83 -12
- package/dist/client/{RichText-LjPCUGGi.mjs → RichText-BoDmnopf.mjs} +6 -3
- package/dist/client/{ThemedButton-DZKjtaDD.mjs → ThemedButton-Ciltp0IK.mjs} +2 -2
- package/dist/client/{accordion-Qe--SILD.mjs → accordion-DOkRS64-.mjs} +1 -1
- package/dist/client/aspectTransforms-D-TnDdq4.mjs +93 -0
- package/dist/client/{bookingForm-3BCl4g_f.mjs → bookingForm-wlMVwo9h.mjs} +289 -149
- package/dist/client/bookings.mjs +12212 -10832
- package/dist/client/{carousel-h2YjKOS2.mjs → carousel-CGWk-Z0u.mjs} +2 -2
- package/dist/client/{carousel.client-BLrd4hmY.mjs → carousel.client-kX5mN1Eg.mjs} +46 -41
- package/dist/client/{cart-5NeiigVd.mjs → cart-OBBPlaH4.mjs} +3 -3
- package/dist/client/{checkout-G4UWjOEw.mjs → checkout-Bmw2WjQX.mjs} +3 -3
- package/dist/client/client.mjs +9541 -6039
- package/dist/client/{colorStyles-DTunOThj.mjs → colorStyles-ECDNPE_P.mjs} +23 -86
- package/dist/client/{context-GK4-AVAh.mjs → context-BI77UFAn.mjs} +275 -10
- package/dist/client/{eventCalendar-Prw3Yo_L.mjs → eventCalendar-qkej2Edn.mjs} +19 -17
- package/dist/client/{eventCombined-BUugi6__.mjs → eventCombined-DApKHvat.mjs} +4 -4
- package/dist/client/{eventDetails-CBHUda-R.mjs → eventDetails-BQyUDPH0.mjs} +3 -4
- package/dist/client/{eventListing-CQeG45Dg.mjs → eventListing-CeAnshlZ.mjs} +4 -4
- package/dist/client/{eventRegistration-Dif3p3oJ.mjs → eventRegistration-C3A3NyBO.mjs} +2209 -2144
- package/dist/client/{form-Cf0WMtfG.mjs → form-DW8rU7jO.mjs} +6 -6
- package/dist/client/{headerSection-Bqdr3JWp.mjs → headerSection-CkIhsoNm.mjs} +9 -9
- package/dist/client/hooks.mjs +1289 -380
- package/dist/client/{locationMap-BVvPou4O.mjs → locationMap-D4O8wbli.mjs} +4 -4
- package/dist/client/{media-47fcnhzD.mjs → media-C5K_0xPd.mjs} +2 -2
- package/dist/client/{newsletterForm-Cx-1dnic.mjs → newsletterForm-B7IxSPuz.mjs} +5 -5
- package/dist/client/{productDetail-DaUMaJYk.mjs → productDetail-Bqxpwy5N.mjs} +3 -3
- package/dist/client/{productList-BKQlWEKE.mjs → productList-u9Lz8V15.mjs} +3 -3
- package/dist/client/{propsDecoder-DO5iXphQ.mjs → propsDecoder-Bf1jucUp.mjs} +17333 -14489
- package/dist/client/rendering/client.mjs +58216 -55133
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +9099 -5636
- package/dist/client/{routeIslandApiConfig-BNm0Z3-g.mjs → routeIslandApiConfig-BgP-aPMl.mjs} +1 -1
- package/dist/client/{shop-D7ytcFBC.mjs → shop-B_eykR-_.mjs} +16 -14
- package/dist/client/{shop-commerce-D68-hHy2.mjs → shop-commerce-CT0APkFV.mjs} +9 -9
- package/dist/client/{shop-commerce-store-Cu7X2lyu.mjs → shop-commerce-store-DcvZxdEK.mjs} +1 -1
- package/dist/client/{shopShared-D12rxE69.mjs → shopShared-BVJOiUiJ.mjs} +5 -5
- package/dist/client/themePortalRoot-DS92SRVZ.mjs +47 -0
- package/dist/client/{TerminalPanel-DOTSUCO0.mjs → useDiscountCodeUi-DPmYDunz.mjs} +60 -77
- package/dist/client/{useEventPagination-jgKa67KV.mjs → useEventPagination-8-U55vH5.mjs} +7 -8
- package/dist/preview-next/before-render.mjs +7 -0
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/keepAlive.mjs +7 -0
- package/dist/preview-next/middleware.mjs +7 -0
- package/dist/{sdk-runtime-4cCWO_3i.mjs → sdk-runtime-C5jPdSrk.mjs} +1 -1
- package/dist/server/components.mjs +3138 -1373
- package/dist/server/config-validation.mjs +1395 -486
- package/dist/server/config.mjs +1395 -486
- package/dist/server/data.mjs +1289 -380
- package/dist/server/index.mjs +8 -1
- package/dist/server/next.mjs +3362 -1538
- package/dist/server/page-converter.mjs +1357 -453
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +2335 -1044
- package/dist/server/rendering.mjs +3152 -1370
- package/dist/server/routing.mjs +1437 -490
- package/dist/server/server.mjs +1297 -381
- package/dist/server/theme-bridge.mjs +1135 -795
- package/dist/{spinner-tSdG9YvG.mjs → spinner-B-ab2rJp.mjs} +1 -1
- package/dist/styles/index.css +1088 -721
- package/package.json +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/OrderSummary.d.ts +0 -15
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useWaitlistClaimRestoration.d.ts +0 -22
- package/dist/_dts/blocks/src/system/runtime/shared/components/SelectableOptionCard.d.ts +0 -30
- package/dist/client/BookingMailingListNote-DlDSs5Vm.mjs +0 -567
- package/dist/client/pricing-CMD0kADd.mjs +0 -314
- package/dist/client/result-DRW7JWXz.mjs +0 -30
- package/dist/client/scrollToBlock-C86BYkyV.mjs +0 -17
- package/dist/client/themePortalRoot-AGs4cE7t.mjs +0 -30
- package/dist/spinner-BL3kW9Uh.mjs +0 -803
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { i as SpinnerNode, t as ThemedButton } from "./ThemedButton-
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
7
|
-
import {
|
|
8
|
-
import { o as DiscountCodeDisclosure, p as storeDemoBookingPassIfAvailable, t as BookingConfirmation } from "./DemoBookingPortalAccess-BMtvPTWE.mjs";
|
|
9
|
-
import { i as useDiscountCodeUi, n as StateIcon, r as CheckIcon, t as TerminalPanel } from "./TerminalPanel-DOTSUCO0.mjs";
|
|
2
|
+
import { c as unsafeAsAppointmentServiceId, f as unsafeAsPassId, l as unsafeAsCustomerPassId, s as unsafeAsAppointmentResourceId, u as unsafeAsFormId } from "./aspectTransforms-D-TnDdq4.mjs";
|
|
3
|
+
import { Ar as toSelectedCollectionOptionKind, At as buildBookingPaymentSelectionViewModel, Cr as parseBookingCurrencyInputToCents, Dr as resolveBookingSiteId, Er as resolveBookingPaymentStep, Hr as reportWorkflowError, Lr as assertNever, Mr as resolveSelectedAppointmentConsent, Mt as paymentChoiceDetails, Nr as BOOKING_FORM_DATA_RESERVED_KEYS, Nt as paymentChoicePrice, Or as resolveDefaultBookingServiceId, Pr as isBookingRequirementConsentFieldId, Rr as clearWorkflowFeedback, Sr as isBookingServiceSlidingAmountInRange, Tr as resolveAppointmentCheckoutVerificationState, Ur as reportWorkflowSuccess, Vr as okWith, _r as getBookingRedirectStateFromLocation, ai as formatLocalScheduleDate, ci as parseBookingLocalDate, gr as formatBookingSubmissionPreparationError, hr as formatBookingCentsAsCurrencyInput, ii as formatBookingInstant, jr as projectSelectedAppointmentConsentIntoForm, jt as buildReviewedBookingPaymentViewModel, kr as selectedBookingCollectionOptionKind, li as resolveBookingTimeZoneId, mr as deriveBookingFormViewState, ni as resolveBookingSignupOffer, pr as logger, ri as addLocalScheduleDays, t as defineIslandPropsDecoder, vi as formatCurrencyAmount, vr as getBookingServiceSlidingScale, wr as prepareBookingSubmission, yr as getBookingSuccessCopy, zr as err } from "./propsDecoder-Bf1jucUp.mjs";
|
|
4
|
+
import { i as SpinnerNode, t as ThemedButton } from "./ThemedButton-Ciltp0IK.mjs";
|
|
5
|
+
import { t as buildCheckoutReturnUrls } from "./checkoutUrls-ChxwaNtO.mjs";
|
|
6
|
+
import { n as scrollToBlock, t as CheckIcon } from "./CheckIcon-CpyXr-Kg.mjs";
|
|
7
|
+
import { f as storeDemoBookingPassIfAvailable, p as DiscountCodeDisclosure, t as BookingConfirmation } from "./DemoBookingPortalAccess-D3VQ_kLj.mjs";
|
|
10
8
|
import { t as FeedbackMessage } from "./FeedbackMessage-CtLvvS_d.mjs";
|
|
9
|
+
import { n as TerminalPanel, r as StateIcon, t as useDiscountCodeUi } from "./useDiscountCodeUi-DPmYDunz.mjs";
|
|
10
|
+
import { a as useBookingNowIso, i as usePolling, n as BookingConsentAgreement, o as StepIndicator, r as PaymentChoiceRows, t as BookingMailingListNote } from "./BookingMailingListNote-CBuMKN0w.mjs";
|
|
11
|
+
import { n as useBlockApi, t as BlockApiProvider } from "./context-BI77UFAn.mjs";
|
|
12
|
+
import { n as isSpamProtectionEnabled, r as AltchaWidget, t as getChallengeUrl } from "./src-B833rYRr.mjs";
|
|
11
13
|
import { i as getFieldValidationControlProps, r as FieldValidationMessage } from "./mailingListSignupCopy-DZSHZrm6.mjs";
|
|
12
|
-
import { t as CheckboxChoice } from "./CheckboxChoice-
|
|
13
|
-
import { t as buildCheckoutReturnUrls } from "./checkoutUrls-ChxwaNtO.mjs";
|
|
14
|
-
import { t as scrollToBlock } from "./scrollToBlock-C86BYkyV.mjs";
|
|
14
|
+
import { t as CheckboxChoice } from "./CheckboxChoice-CIqx_o0E.mjs";
|
|
15
15
|
import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
|
|
16
|
-
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-
|
|
16
|
+
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-BgP-aPMl.mjs";
|
|
17
17
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
18
18
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
19
|
//#region ../core/src/appointment-service-categories.ts
|
|
@@ -572,6 +572,10 @@ function bookingSubmissionReducer(state, action) {
|
|
|
572
572
|
...clearWorkflowFeedback(state),
|
|
573
573
|
status: { tag: "submitting" }
|
|
574
574
|
};
|
|
575
|
+
case "submission-reviewed": return {
|
|
576
|
+
status: { tag: "idle" },
|
|
577
|
+
feedback: { tag: "idle" }
|
|
578
|
+
};
|
|
575
579
|
case "submission-succeeded": return {
|
|
576
580
|
status: { tag: "idle" },
|
|
577
581
|
feedback: reportWorkflowSuccess(state, action.message).feedback
|
|
@@ -628,32 +632,11 @@ function useBookingSubmission(_siteId) {
|
|
|
628
632
|
const submit = async (data) => {
|
|
629
633
|
dispatch({ type: "submission-started" });
|
|
630
634
|
try {
|
|
631
|
-
const response =
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
endAt: data.endAt,
|
|
637
|
-
customFields: data.customFields,
|
|
638
|
-
mailingListOptIn: data.mailingListOptIn,
|
|
639
|
-
timezone: data.timezone,
|
|
640
|
-
customerPassId: data.customerPassId
|
|
641
|
-
}) : await api.submitBooking({
|
|
642
|
-
formId: data.formId,
|
|
643
|
-
serviceId: data.serviceId,
|
|
644
|
-
resourceId: data.resourceId || null,
|
|
645
|
-
startAt: data.startAt,
|
|
646
|
-
endAt: data.endAt,
|
|
647
|
-
customFields: data.customFields,
|
|
648
|
-
mailingListOptIn: data.mailingListOptIn,
|
|
649
|
-
timezone: data.timezone,
|
|
650
|
-
discountCode: data.discountCode,
|
|
651
|
-
selectedSlidingAmount: data.selectedSlidingAmount,
|
|
652
|
-
selectedCollectionOptionKind: data.selectedCollectionOptionKind,
|
|
653
|
-
altchaSolution: data.altchaSolution ?? null,
|
|
654
|
-
successUrl: data.successUrl,
|
|
655
|
-
cancelUrl: data.cancelUrl
|
|
656
|
-
});
|
|
635
|
+
const response = await executeBookingSubmission(api, data);
|
|
636
|
+
if (response.type === "review_required" || response.type === "payment_choice_required") {
|
|
637
|
+
dispatch({ type: "submission-reviewed" });
|
|
638
|
+
return okWith(response);
|
|
639
|
+
}
|
|
657
640
|
storeDemoBookingPassIfAvailable(response.customer.email, response.demoBookingPass);
|
|
658
641
|
dispatch({
|
|
659
642
|
type: "submission-succeeded",
|
|
@@ -681,6 +664,35 @@ function useBookingSubmission(_siteId) {
|
|
|
681
664
|
isSubmitting: selectIsSubmitting(state)
|
|
682
665
|
};
|
|
683
666
|
}
|
|
667
|
+
function executeBookingSubmission(api, data) {
|
|
668
|
+
return data.kind === "appointment_package" ? api.submitBookingWithPackage({
|
|
669
|
+
formId: data.formId,
|
|
670
|
+
serviceId: data.serviceId,
|
|
671
|
+
resourceId: data.resourceId || null,
|
|
672
|
+
startAt: data.startAt,
|
|
673
|
+
endAt: data.endAt,
|
|
674
|
+
customFields: data.customFields,
|
|
675
|
+
mailingListOptIn: data.mailingListOptIn,
|
|
676
|
+
timezone: data.timezone,
|
|
677
|
+
customerPassId: data.customerPassId
|
|
678
|
+
}) : api.submitBooking({
|
|
679
|
+
formId: data.formId,
|
|
680
|
+
serviceId: data.serviceId,
|
|
681
|
+
resourceId: data.resourceId || null,
|
|
682
|
+
startAt: data.startAt,
|
|
683
|
+
endAt: data.endAt,
|
|
684
|
+
customFields: data.customFields,
|
|
685
|
+
mailingListOptIn: data.mailingListOptIn,
|
|
686
|
+
timezone: data.timezone,
|
|
687
|
+
shownTerms: data.shownTerms,
|
|
688
|
+
discountCode: data.discountCode,
|
|
689
|
+
selectedSlidingAmount: data.selectedSlidingAmount,
|
|
690
|
+
selectedCollectionOptionKind: data.selectedCollectionOptionKind,
|
|
691
|
+
altchaSolution: data.altchaSolution ?? null,
|
|
692
|
+
successUrl: data.successUrl,
|
|
693
|
+
cancelUrl: data.cancelUrl
|
|
694
|
+
});
|
|
695
|
+
}
|
|
684
696
|
//#endregion
|
|
685
697
|
//#region ../blocks/src/system/runtime/nodes/booking-form.validationErrors.ts
|
|
686
698
|
function omitRecordKey(record, key) {
|
|
@@ -789,6 +801,7 @@ function createInitialBookingFlowReducerState(input) {
|
|
|
789
801
|
selectedSlidingAmountInput: toOptionalString(initialData.selectedSlidingAmountInput) ?? bookingSlidingAmountDefault(input.services, input.defaultServiceId),
|
|
790
802
|
selectedCollectionOptionKind: toSelectedCollectionOptionKind(initialData.selectedCollectionOptionKind),
|
|
791
803
|
selectedAppointmentPackageId: toOptionalCustomerPassId(toOptionalString(initialData.selectedAppointmentPackageId)),
|
|
804
|
+
review: null,
|
|
792
805
|
altchaSolution: null,
|
|
793
806
|
validationErrors: createEmptyBookingValidationErrors(),
|
|
794
807
|
feedback: { kind: "none" }
|
|
@@ -891,6 +904,25 @@ function reduceBookingFlowEvent(state, event) {
|
|
|
891
904
|
phase: "editing",
|
|
892
905
|
feedback: { kind: "none" }
|
|
893
906
|
};
|
|
907
|
+
case "review-required": return {
|
|
908
|
+
...state,
|
|
909
|
+
phase: "editing",
|
|
910
|
+
review: event.review,
|
|
911
|
+
feedback: { kind: "none" }
|
|
912
|
+
};
|
|
913
|
+
case "payment-choice-required": return {
|
|
914
|
+
...state,
|
|
915
|
+
phase: "editing",
|
|
916
|
+
review: null,
|
|
917
|
+
paymentChoices: event.paymentChoices,
|
|
918
|
+
selectedCollectionOptionKind: void 0,
|
|
919
|
+
currentStepId: "payment-selection",
|
|
920
|
+
feedback: {
|
|
921
|
+
kind: "error",
|
|
922
|
+
scope: "submission",
|
|
923
|
+
message: "The payment details have changed. Please review them before continuing."
|
|
924
|
+
}
|
|
925
|
+
};
|
|
894
926
|
case "submission-started": return {
|
|
895
927
|
...state,
|
|
896
928
|
phase: "submitting"
|
|
@@ -1028,7 +1060,7 @@ function resolveBookingStepVisibility(input, defaultServiceId, payment) {
|
|
|
1028
1060
|
!hasValidConfiguredService && input.services.length > 1,
|
|
1029
1061
|
(input.form?.settings?.serviceIds?.length ?? 0) > 1
|
|
1030
1062
|
].some(Boolean),
|
|
1031
|
-
needsPayment: needsBookingPaymentStep(input, payment),
|
|
1063
|
+
needsPayment: Boolean(input.forcePaymentSelection) || needsBookingPaymentStep(input, payment),
|
|
1032
1064
|
hasFields: Boolean(input.form?.schema?.fields.length)
|
|
1033
1065
|
};
|
|
1034
1066
|
}
|
|
@@ -1196,24 +1228,11 @@ function deriveBookingFieldViews(input) {
|
|
|
1196
1228
|
});
|
|
1197
1229
|
}
|
|
1198
1230
|
function buildBookingSubmitPlan(input) {
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
return {
|
|
1202
|
-
ok: false,
|
|
1203
|
-
errors: createFormBookingValidationError(message),
|
|
1204
|
-
message
|
|
1205
|
-
};
|
|
1206
|
-
}
|
|
1207
|
-
const fieldErrors = validateBookingFields({
|
|
1208
|
-
fields: input.form?.schema?.fields ?? [],
|
|
1209
|
-
values: input.state.fieldValues
|
|
1210
|
-
});
|
|
1211
|
-
if (Object.keys(fieldErrors).length > 0) return {
|
|
1212
|
-
ok: false,
|
|
1213
|
-
errors: createFieldBookingValidationErrors(fieldErrors),
|
|
1214
|
-
message: "Please check the highlighted fields."
|
|
1215
|
-
};
|
|
1231
|
+
const invalid = validateBookingSubmissionContact(input);
|
|
1232
|
+
if (invalid) return invalid;
|
|
1216
1233
|
const prepared = prepareBookingSubmission({
|
|
1234
|
+
shownTerms: input.state.review?.terms,
|
|
1235
|
+
promisedDiscountId: input.promisedDiscountId,
|
|
1217
1236
|
formId: input.formId,
|
|
1218
1237
|
nowIso: input.nowIso,
|
|
1219
1238
|
data: bookingFormDataWithEligibleOptIn(toBookingFormData(input.state), Boolean(input.mailingListEligible)),
|
|
@@ -1234,17 +1253,39 @@ function buildBookingSubmitPlan(input) {
|
|
|
1234
1253
|
return {
|
|
1235
1254
|
ok: true,
|
|
1236
1255
|
redirect: input.redirect,
|
|
1237
|
-
value: prepared.value
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
}
|
|
1256
|
+
value: finalizeBookingSubmissionCommand(prepared.value, input)
|
|
1257
|
+
};
|
|
1258
|
+
}
|
|
1259
|
+
function validateBookingSubmissionContact(input) {
|
|
1260
|
+
if (input.requiresResourceSelection && !(input.state.selectedResourceId ?? input.defaultResourceId)) {
|
|
1261
|
+
const message = "Please select a practitioner";
|
|
1262
|
+
return {
|
|
1263
|
+
ok: false,
|
|
1264
|
+
errors: createFormBookingValidationError(message),
|
|
1265
|
+
message
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
const fieldErrors = validateBookingFields({
|
|
1269
|
+
fields: input.form?.schema?.fields ?? [],
|
|
1270
|
+
values: input.state.fieldValues
|
|
1271
|
+
});
|
|
1272
|
+
if (Object.keys(fieldErrors).length > 0) return {
|
|
1273
|
+
ok: false,
|
|
1274
|
+
errors: createFieldBookingValidationErrors(fieldErrors),
|
|
1275
|
+
message: "Please check the highlighted fields."
|
|
1276
|
+
};
|
|
1277
|
+
return null;
|
|
1278
|
+
}
|
|
1279
|
+
function finalizeBookingSubmissionCommand(value, input) {
|
|
1280
|
+
const selected = {
|
|
1281
|
+
...value,
|
|
1282
|
+
endAt: input.state.selectedSlot?.endAt ?? value.endAt,
|
|
1283
|
+
resourceId: value.resourceId ?? input.state.selectedSlot?.resourceId
|
|
1284
|
+
};
|
|
1285
|
+
return selected.kind === "appointment_package" ? selected : {
|
|
1286
|
+
...selected,
|
|
1287
|
+
successUrl: input.successUrl,
|
|
1288
|
+
cancelUrl: input.cancelUrl
|
|
1248
1289
|
};
|
|
1249
1290
|
}
|
|
1250
1291
|
function resolveAppointmentPackagesModel(input) {
|
|
@@ -1360,7 +1401,10 @@ function isBlankFieldValue(value) {
|
|
|
1360
1401
|
}
|
|
1361
1402
|
/** Reconcile customer intent as part of the edit, never from a rendering effect. */
|
|
1362
1403
|
function bookingFlowReducer(state, event, context) {
|
|
1363
|
-
const changed = reduceBookingFlowEvent(state
|
|
1404
|
+
const changed = reduceBookingFlowEvent(state.review && changesBookingIntent(event) ? {
|
|
1405
|
+
...state,
|
|
1406
|
+
review: null
|
|
1407
|
+
} : state, event);
|
|
1364
1408
|
const next = event.type === "service-selected" ? {
|
|
1365
1409
|
...changed,
|
|
1366
1410
|
selectedSlidingAmountInput: bookingSlidingAmountDefault(context.services, event.serviceId)
|
|
@@ -1497,41 +1541,46 @@ function isBookingPaymentEvent(event) {
|
|
|
1497
1541
|
return event.type === "payment-option-selected" || event.type === "sliding-amount-changed" || event.type === "appointment-package-selected" || event.type === "discount-code-changed" || event.type === "altcha-solution-set" || event.type === "altcha-solution-invalidated";
|
|
1498
1542
|
}
|
|
1499
1543
|
function applyBookingPaymentEvent(state, event) {
|
|
1544
|
+
const change = bookingPaymentEventChange(event);
|
|
1545
|
+
return {
|
|
1546
|
+
...state,
|
|
1547
|
+
...change,
|
|
1548
|
+
validationErrors: event.type === "altcha-solution-invalidated" ? state.validationErrors : clearBookingFormError(state.validationErrors)
|
|
1549
|
+
};
|
|
1550
|
+
}
|
|
1551
|
+
function bookingPaymentEventChange(event) {
|
|
1500
1552
|
switch (event.type) {
|
|
1501
1553
|
case "payment-option-selected": return {
|
|
1502
|
-
...state,
|
|
1503
1554
|
selectedCollectionOptionKind: event.kind ?? void 0,
|
|
1504
|
-
selectedAppointmentPackageId: void 0
|
|
1505
|
-
validationErrors: clearBookingFormError(state.validationErrors)
|
|
1555
|
+
selectedAppointmentPackageId: void 0
|
|
1506
1556
|
};
|
|
1507
1557
|
case "sliding-amount-changed": return {
|
|
1508
|
-
...state,
|
|
1509
1558
|
selectedSlidingAmountInput: event.value,
|
|
1510
|
-
selectedAppointmentPackageId: void 0
|
|
1511
|
-
validationErrors: clearBookingFormError(state.validationErrors)
|
|
1559
|
+
selectedAppointmentPackageId: void 0
|
|
1512
1560
|
};
|
|
1513
1561
|
case "appointment-package-selected": return {
|
|
1514
|
-
...state,
|
|
1515
1562
|
selectedAppointmentPackageId: event.packageId ?? void 0,
|
|
1516
|
-
selectedCollectionOptionKind: void 0
|
|
1517
|
-
validationErrors: clearBookingFormError(state.validationErrors)
|
|
1518
|
-
};
|
|
1519
|
-
case "discount-code-changed": return {
|
|
1520
|
-
...state,
|
|
1521
|
-
discountCode: event.code,
|
|
1522
|
-
validationErrors: clearBookingFormError(state.validationErrors)
|
|
1523
|
-
};
|
|
1524
|
-
case "altcha-solution-set": return {
|
|
1525
|
-
...state,
|
|
1526
|
-
altchaSolution: event.solution,
|
|
1527
|
-
validationErrors: clearBookingFormError(state.validationErrors)
|
|
1528
|
-
};
|
|
1529
|
-
case "altcha-solution-invalidated": return {
|
|
1530
|
-
...state,
|
|
1531
|
-
altchaSolution: null
|
|
1563
|
+
selectedCollectionOptionKind: void 0
|
|
1532
1564
|
};
|
|
1565
|
+
case "discount-code-changed": return { discountCode: event.code };
|
|
1566
|
+
case "altcha-solution-set": return { altchaSolution: event.solution };
|
|
1567
|
+
case "altcha-solution-invalidated": return { altchaSolution: null };
|
|
1533
1568
|
}
|
|
1534
1569
|
}
|
|
1570
|
+
function changesBookingIntent(event) {
|
|
1571
|
+
return changesBookingPaymentFacts(event) || [
|
|
1572
|
+
"field-updated",
|
|
1573
|
+
"discount-code-changed",
|
|
1574
|
+
"appointment-package-selected"
|
|
1575
|
+
].includes(event.type);
|
|
1576
|
+
}
|
|
1577
|
+
/** Applies server-owned recovery facts to the existing catalogue model. */
|
|
1578
|
+
function applyBookingPaymentChoices(services, choices) {
|
|
1579
|
+
return choices ? services.map((service) => choices.id === service.id ? {
|
|
1580
|
+
...service,
|
|
1581
|
+
...choices
|
|
1582
|
+
} : service) : services;
|
|
1583
|
+
}
|
|
1535
1584
|
//#endregion
|
|
1536
1585
|
//#region ../blocks/src/system/runtime/hooks/useBookingChoices.ts
|
|
1537
1586
|
/** Accept remote facts here; payment/navigation controllers do not own request lifetime. */
|
|
@@ -1626,6 +1675,30 @@ function useBookingChoicesRequest(key, load, accept, errorMessage) {
|
|
|
1626
1675
|
//#region ../blocks/src/system/runtime/nodes/booking-form.submit-success.ts
|
|
1627
1676
|
function planBookingSubmissionCompletion(input) {
|
|
1628
1677
|
const { data } = input;
|
|
1678
|
+
if (data.type === "review_required") return {
|
|
1679
|
+
navigation: { kind: "none" },
|
|
1680
|
+
events: [{
|
|
1681
|
+
type: "review-required",
|
|
1682
|
+
review: data.review
|
|
1683
|
+
}],
|
|
1684
|
+
result: {
|
|
1685
|
+
ok: false,
|
|
1686
|
+
reason: "review-required",
|
|
1687
|
+
review: data.review
|
|
1688
|
+
}
|
|
1689
|
+
};
|
|
1690
|
+
if (data.type === "payment_choice_required") return {
|
|
1691
|
+
navigation: { kind: "none" },
|
|
1692
|
+
events: [{
|
|
1693
|
+
type: "payment-choice-required",
|
|
1694
|
+
paymentChoices: data.paymentChoices
|
|
1695
|
+
}],
|
|
1696
|
+
result: {
|
|
1697
|
+
ok: false,
|
|
1698
|
+
reason: "payment-choice-required",
|
|
1699
|
+
paymentChoices: data.paymentChoices
|
|
1700
|
+
}
|
|
1701
|
+
};
|
|
1629
1702
|
const extras = {
|
|
1630
1703
|
...data.demoBookingPass ? { demoBookingPass: data.demoBookingPass } : {},
|
|
1631
1704
|
...data.mailingListSignupNote ? { mailingListSignupNote: data.mailingListSignupNote } : {},
|
|
@@ -1753,6 +1826,11 @@ function useBookingSubmitAction(latestRef) {
|
|
|
1753
1826
|
submittingRef.current = true;
|
|
1754
1827
|
try {
|
|
1755
1828
|
const result = await latest.submit(start.plan.value);
|
|
1829
|
+
if (isOutdatedBookingReview(result, latest.state, latestRef.current.state)) return {
|
|
1830
|
+
ok: false,
|
|
1831
|
+
reason: "blocked",
|
|
1832
|
+
message: "booking-details-changed"
|
|
1833
|
+
};
|
|
1756
1834
|
if (!result.ok) return failBookingSubmission(result.error, latest.dispatch);
|
|
1757
1835
|
return completeBookingSubmission({
|
|
1758
1836
|
data: result.data,
|
|
@@ -1833,6 +1911,12 @@ function failBookingSubmission(message, dispatch) {
|
|
|
1833
1911
|
message
|
|
1834
1912
|
};
|
|
1835
1913
|
}
|
|
1914
|
+
function sameBookingIntent(left, right) {
|
|
1915
|
+
return left.selectedServiceId === right.selectedServiceId && left.selectedResourceId === right.selectedResourceId && left.selectedSlot?.key === right.selectedSlot?.key && left.selectedSlidingAmountInput === right.selectedSlidingAmountInput && left.selectedCollectionOptionKind === right.selectedCollectionOptionKind && left.selectedAppointmentPackageId === right.selectedAppointmentPackageId && left.discountCode === right.discountCode && left.fieldValues === right.fieldValues;
|
|
1916
|
+
}
|
|
1917
|
+
function isOutdatedBookingReview(result, submitted, current) {
|
|
1918
|
+
return result.ok && (result.data.type === "review_required" || result.data.type === "payment_choice_required") && !sameBookingIntent(submitted, current);
|
|
1919
|
+
}
|
|
1836
1920
|
//#endregion
|
|
1837
1921
|
//#region ../blocks/src/system/runtime/hooks/useHeadlessBookingFlow.ts
|
|
1838
1922
|
function useHeadlessBookingFlow(options) {
|
|
@@ -1853,14 +1937,15 @@ function useHeadlessBookingFlow(options) {
|
|
|
1853
1937
|
options.services
|
|
1854
1938
|
]);
|
|
1855
1939
|
const [state, dispatch] = useReducer((previous, event) => bookingFlowReducer(previous, event, {
|
|
1856
|
-
services: options.services,
|
|
1940
|
+
services: applyBookingPaymentChoices(options.services, previous.paymentChoices),
|
|
1857
1941
|
defaultServiceId,
|
|
1858
1942
|
nowIso: bookingNowIso
|
|
1859
1943
|
}), initialState);
|
|
1860
1944
|
const api = useBlockApi();
|
|
1861
1945
|
const selectedServiceId = state.selectedServiceId ?? defaultServiceId;
|
|
1862
1946
|
const selectedResourceId = state.selectedResourceId ?? defaultResourceId;
|
|
1863
|
-
const
|
|
1947
|
+
const services = useMemo(() => applyBookingPaymentChoices(options.services, state.paymentChoices), [options.services, state.paymentChoices]);
|
|
1948
|
+
const selectedService = services.find((service) => service.id === selectedServiceId) ?? null;
|
|
1864
1949
|
const runtimeForm = useSelectedAppointmentConsentForm(options.form, selectedService);
|
|
1865
1950
|
const hasPortalBearerAuth = (api.config.authOverrides?.portal ?? api.config.auth).type === "bearer";
|
|
1866
1951
|
const selectedServiceSlidingScale = getBookingServiceSlidingScale(selectedService);
|
|
@@ -1895,7 +1980,8 @@ function useHeadlessBookingFlow(options) {
|
|
|
1895
1980
|
const stepState = useMemo(() => deriveBookingFlowSteps({
|
|
1896
1981
|
form: runtimeForm,
|
|
1897
1982
|
nowIso: bookingNowIso,
|
|
1898
|
-
services
|
|
1983
|
+
services,
|
|
1984
|
+
forcePaymentSelection: state.paymentChoices?.id === selectedServiceId,
|
|
1899
1985
|
data,
|
|
1900
1986
|
defaultServiceId,
|
|
1901
1987
|
defaultResourceId,
|
|
@@ -1914,7 +2000,9 @@ function useHeadlessBookingFlow(options) {
|
|
|
1914
2000
|
runtimeForm,
|
|
1915
2001
|
options.requiresResourceSelection,
|
|
1916
2002
|
options.requiresServiceSelection,
|
|
1917
|
-
|
|
2003
|
+
services,
|
|
2004
|
+
state.paymentChoices,
|
|
2005
|
+
selectedServiceId,
|
|
1918
2006
|
state.currentStepId
|
|
1919
2007
|
]);
|
|
1920
2008
|
const { availableDates, isLoading: isLoadingDates, error: datesError, hasMore, loadMore, loadedRange: availableDatesLoadedRange } = useAvailableDates({
|
|
@@ -2002,7 +2090,8 @@ function useHeadlessBookingFlow(options) {
|
|
|
2002
2090
|
nowIso: bookingNowIso,
|
|
2003
2091
|
form: runtimeForm,
|
|
2004
2092
|
formId: formKey,
|
|
2005
|
-
services
|
|
2093
|
+
services,
|
|
2094
|
+
promisedDiscountId: resolveDisclosedBookingDiscountId(discountUi),
|
|
2006
2095
|
defaultServiceId,
|
|
2007
2096
|
defaultResourceId,
|
|
2008
2097
|
requiresResourceSelection: options.requiresResourceSelection,
|
|
@@ -2089,6 +2178,8 @@ function useHeadlessBookingFlow(options) {
|
|
|
2089
2178
|
confirmationSummary: paymentConfirmationSummary
|
|
2090
2179
|
};
|
|
2091
2180
|
return {
|
|
2181
|
+
review: state.review,
|
|
2182
|
+
paymentAnchorAt: bookingNowIso,
|
|
2092
2183
|
mailingList,
|
|
2093
2184
|
mailingListOptIn: state.mailingListOptIn,
|
|
2094
2185
|
status,
|
|
@@ -2097,7 +2188,7 @@ function useHeadlessBookingFlow(options) {
|
|
|
2097
2188
|
currentStep: stepState.currentStep,
|
|
2098
2189
|
data,
|
|
2099
2190
|
services: {
|
|
2100
|
-
items:
|
|
2191
|
+
items: services,
|
|
2101
2192
|
categories: readServiceCategories(options),
|
|
2102
2193
|
selected: selectedService,
|
|
2103
2194
|
defaultServiceId,
|
|
@@ -2170,6 +2261,9 @@ function readServiceCategories(options) {
|
|
|
2170
2261
|
function navigateToCheckout(checkoutUrl) {
|
|
2171
2262
|
window.location.href = checkoutUrl;
|
|
2172
2263
|
}
|
|
2264
|
+
function resolveDisclosedBookingDiscountId(discount) {
|
|
2265
|
+
return discount.discountsAvailableLoading || discount.discountCode.trim() ? void 0 : discount.autoAppliedDiscount?.id;
|
|
2266
|
+
}
|
|
2173
2267
|
//#endregion
|
|
2174
2268
|
//#region ../blocks/src/system/runtime/hooks/useAppointmentCheckoutVerification.ts
|
|
2175
2269
|
const APPOINTMENT_CHECKOUT_MAX_ATTEMPTS = 12;
|
|
@@ -2505,8 +2599,8 @@ function resolvePrimaryActionLabel(isLastStep, requiresPayment) {
|
|
|
2505
2599
|
if (!isLastStep) return "Continue";
|
|
2506
2600
|
return requiresPayment ? "Continue to payment" : "Complete";
|
|
2507
2601
|
}
|
|
2508
|
-
function formatBookingConfirmationDateTime(booking) {
|
|
2509
|
-
const startAt = booking.currentStep?.id === "datetime-selection" ? booking.availability.selectedSlot?.startAt : void 0;
|
|
2602
|
+
function formatBookingConfirmationDateTime(booking, includeSelection = false) {
|
|
2603
|
+
const startAt = includeSelection || booking.currentStep?.id === "datetime-selection" ? booking.availability.selectedSlot?.startAt : void 0;
|
|
2510
2604
|
return startAt ? new Intl.DateTimeFormat(void 0, {
|
|
2511
2605
|
dateStyle: "medium",
|
|
2512
2606
|
timeStyle: "short",
|
|
@@ -2538,8 +2632,9 @@ function BookingFormSubmitActions({ booking, onSubmit }) {
|
|
|
2538
2632
|
const handlePrimaryAction = async () => {
|
|
2539
2633
|
if ((await booking.actions.next()).ok && isLastStep) await onSubmit();
|
|
2540
2634
|
};
|
|
2541
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(
|
|
2635
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BookingSubmissionSummary, {
|
|
2542
2636
|
booking,
|
|
2637
|
+
isLastStep,
|
|
2543
2638
|
summary: paymentSummary
|
|
2544
2639
|
}), /* @__PURE__ */ jsxs("div", {
|
|
2545
2640
|
className: "rb-wizard-actions",
|
|
@@ -2557,7 +2652,7 @@ function BookingFormSubmitActions({ booking, onSubmit }) {
|
|
|
2557
2652
|
disabled: isSubmitting,
|
|
2558
2653
|
variant: "primary",
|
|
2559
2654
|
size: "md",
|
|
2560
|
-
label:
|
|
2655
|
+
label: bookingPrimaryActionLabel(booking, isLastStep, paymentSummary),
|
|
2561
2656
|
pending: isSubmitting ? {
|
|
2562
2657
|
label: "Submitting...",
|
|
2563
2658
|
srLabel: "Submitting"
|
|
@@ -2565,6 +2660,72 @@ function BookingFormSubmitActions({ booking, onSubmit }) {
|
|
|
2565
2660
|
})]
|
|
2566
2661
|
})] });
|
|
2567
2662
|
}
|
|
2663
|
+
function reviewedActionLabel(review) {
|
|
2664
|
+
if (review.terms.dueNowCents > 0) return "Continue to payment";
|
|
2665
|
+
return review.terms.totalCents > 0 ? `Confirm booking at ${formatCurrencyAmount(review.terms.totalCents, review.terms.currency, { decimals: "auto" })}` : "Confirm booking";
|
|
2666
|
+
}
|
|
2667
|
+
function BookingOfferReview({ review, booking }) {
|
|
2668
|
+
const payment = buildReviewedBookingPaymentViewModel({
|
|
2669
|
+
terms: review.terms,
|
|
2670
|
+
bookingStartAt: booking.availability.selectedSlot?.startAt ?? null,
|
|
2671
|
+
anchorAt: booking.paymentAnchorAt
|
|
2672
|
+
});
|
|
2673
|
+
const money = (amount) => formatCurrencyAmount(amount, review.terms.currency, { decimals: "auto" });
|
|
2674
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
2675
|
+
className: "rb-reg-summary",
|
|
2676
|
+
"aria-label": "Updated booking price",
|
|
2677
|
+
"aria-live": "polite",
|
|
2678
|
+
children: [
|
|
2679
|
+
/* @__PURE__ */ jsx("p", {
|
|
2680
|
+
className: "ab-text",
|
|
2681
|
+
children: review.reason === "discount_unavailable" ? "The discount previously shown is no longer available for this booking. Please review the updated price before continuing." : review.reason === "payment_terms_changed" ? "The payment details have changed. Please review them before continuing." : "The amount due has changed. Please review the updated price before continuing."
|
|
2682
|
+
}),
|
|
2683
|
+
/* @__PURE__ */ jsxs("dl", { children: [
|
|
2684
|
+
/* @__PURE__ */ jsx("dt", { children: "Price" }),
|
|
2685
|
+
/* @__PURE__ */ jsx("dd", { children: money(review.subtotalCents) }),
|
|
2686
|
+
review.discountCents > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", { children: "Discount" }), /* @__PURE__ */ jsx("dd", { children: money(review.discountCents) })] }) : null,
|
|
2687
|
+
review.creditCents > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", { children: "Account credit applied" }), /* @__PURE__ */ jsx("dd", { children: money(review.creditCents) })] }) : null,
|
|
2688
|
+
payment ? payment.summaryRows.map((row) => /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsx("dt", { children: row.label }), /* @__PURE__ */ jsx("dd", { children: row.value })] }, row.label)) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2689
|
+
/* @__PURE__ */ jsx("dt", { children: "Total" }),
|
|
2690
|
+
/* @__PURE__ */ jsx("dd", { children: money(review.terms.totalCents) }),
|
|
2691
|
+
/* @__PURE__ */ jsx("dt", { children: "Due today" }),
|
|
2692
|
+
/* @__PURE__ */ jsx("dd", { children: money(0) })
|
|
2693
|
+
] })
|
|
2694
|
+
] }),
|
|
2695
|
+
payment?.helperText ? /* @__PURE__ */ jsx("p", {
|
|
2696
|
+
className: "ab-text rb-on-surface--muted",
|
|
2697
|
+
children: payment.helperText
|
|
2698
|
+
}) : null
|
|
2699
|
+
]
|
|
2700
|
+
});
|
|
2701
|
+
}
|
|
2702
|
+
function bookingPrimaryActionLabel(booking, isLastStep, summary) {
|
|
2703
|
+
return isLastStep && booking.review ? reviewedActionLabel(booking.review) : resolvePrimaryActionLabel(isLastStep, Boolean(summary));
|
|
2704
|
+
}
|
|
2705
|
+
function BookingSubmissionSummary({ booking, isLastStep, summary }) {
|
|
2706
|
+
return isLastStep && booking.review ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BookingReviewIdentity, { booking }), /* @__PURE__ */ jsx(BookingOfferReview, {
|
|
2707
|
+
review: booking.review,
|
|
2708
|
+
booking
|
|
2709
|
+
})] }) : /* @__PURE__ */ jsx(BookingPaymentConfirmationText, {
|
|
2710
|
+
booking,
|
|
2711
|
+
summary
|
|
2712
|
+
});
|
|
2713
|
+
}
|
|
2714
|
+
function BookingReviewIdentity({ booking }) {
|
|
2715
|
+
const service = booking.services.selected;
|
|
2716
|
+
if (!service) return null;
|
|
2717
|
+
const dateTime = formatBookingConfirmationDateTime(booking, true);
|
|
2718
|
+
return /* @__PURE__ */ jsxs("p", {
|
|
2719
|
+
className: "ab-text rb-on-surface--muted",
|
|
2720
|
+
children: [
|
|
2721
|
+
service.title,
|
|
2722
|
+
" · ",
|
|
2723
|
+
service.durationMinutes,
|
|
2724
|
+
" min",
|
|
2725
|
+
dateTime ? ` · ${dateTime}` : ""
|
|
2726
|
+
]
|
|
2727
|
+
});
|
|
2728
|
+
}
|
|
2568
2729
|
//#endregion
|
|
2569
2730
|
//#region ../blocks/src/system/runtime/nodes/booking-form.default-ui.tsx
|
|
2570
2731
|
function formatBookingAmount(amount, currency) {
|
|
@@ -2847,53 +3008,32 @@ function HeadlessBookingPaymentSelectionStep({ booking }) {
|
|
|
2847
3008
|
})
|
|
2848
3009
|
]
|
|
2849
3010
|
}) : null,
|
|
2850
|
-
/* @__PURE__ */
|
|
2851
|
-
className: "rb-reg-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
id: option.kind,
|
|
2877
|
-
title: option.title,
|
|
2878
|
-
description: option.description,
|
|
2879
|
-
summaryRows: option.summaryRows,
|
|
2880
|
-
helperText: option.helperText
|
|
2881
|
-
})
|
|
2882
|
-
}, option.kind);
|
|
2883
|
-
return /* @__PURE__ */ jsxs("button", {
|
|
2884
|
-
type: "button",
|
|
2885
|
-
className: optionCardClassName(isSelected),
|
|
2886
|
-
onClick: () => booking.actions.selectPaymentOption(option.kind),
|
|
2887
|
-
"aria-pressed": isSelected,
|
|
2888
|
-
children: [/* @__PURE__ */ jsx(PaymentOptionContent, {
|
|
2889
|
-
id: option.kind,
|
|
2890
|
-
title: option.title,
|
|
2891
|
-
description: option.description,
|
|
2892
|
-
summaryRows: option.summaryRows,
|
|
2893
|
-
helperText: option.helperText
|
|
2894
|
-
}), isSelected ? /* @__PURE__ */ jsx(SelectedCheck, {}) : null]
|
|
2895
|
-
}, option.kind);
|
|
2896
|
-
})]
|
|
3011
|
+
viewModel.mode === "single_option" && !hasPackageOptions ? viewModel.options.map((option) => /* @__PURE__ */ jsx("div", {
|
|
3012
|
+
className: "rb-reg-summary",
|
|
3013
|
+
children: /* @__PURE__ */ jsx(PaymentOptionContent, {
|
|
3014
|
+
id: option.kind,
|
|
3015
|
+
title: option.title,
|
|
3016
|
+
description: option.description,
|
|
3017
|
+
summaryRows: option.summaryRows,
|
|
3018
|
+
helperText: option.helperText
|
|
3019
|
+
})
|
|
3020
|
+
}, option.kind)) : /* @__PURE__ */ jsx(PaymentChoiceRows, {
|
|
3021
|
+
label: "Payment options",
|
|
3022
|
+
rows: [...packageOptions.map((appointmentPackage) => ({
|
|
3023
|
+
id: appointmentPackage.customerPassId,
|
|
3024
|
+
label: appointmentPackage.passName,
|
|
3025
|
+
details: ["Use 1 package credit", `Balance: ${appointmentPackage.creditsRemaining} of ${appointmentPackage.creditsTotal} credits remaining`],
|
|
3026
|
+
price: "1 credit",
|
|
3027
|
+
selected: booking.payment.selectedAppointmentPackageId === appointmentPackage.customerPassId,
|
|
3028
|
+
onSelect: () => booking.actions.selectAppointmentPackage(appointmentPackage.customerPassId)
|
|
3029
|
+
})), ...viewModel.options.map((option) => ({
|
|
3030
|
+
id: option.kind,
|
|
3031
|
+
label: option.title,
|
|
3032
|
+
details: paymentChoiceDetails(option),
|
|
3033
|
+
price: paymentChoicePrice(option.amounts),
|
|
3034
|
+
selected: !booking.payment.selectedAppointmentPackageId && (booking.payment.selectedCollectionOptionKind === option.kind || viewModel.mode === "single_option"),
|
|
3035
|
+
onSelect: () => booking.actions.selectPaymentOption(option.kind)
|
|
3036
|
+
}))]
|
|
2897
3037
|
})
|
|
2898
3038
|
]
|
|
2899
3039
|
});
|
|
@@ -3155,7 +3295,7 @@ function DefaultBookingDiscount({ booking }) {
|
|
|
3155
3295
|
booking.discount.clear();
|
|
3156
3296
|
booking.discount.setOpen(false);
|
|
3157
3297
|
}
|
|
3158
|
-
}) : null, booking.discount.autoAppliedDiscount && booking.discount.code.trim().length === 0 ? /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
3298
|
+
}) : null, !booking.review && booking.discount.autoAppliedDiscount && booking.discount.code.trim().length === 0 ? /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
3159
3299
|
tone: "info",
|
|
3160
3300
|
className: "alert alert-info rb-mt-4",
|
|
3161
3301
|
role: "status",
|