@riverbankcms/sdk 0.174.1 → 0.175.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_dts/{BlocksIslandsHydrator-YRmc-Yxz.d.ts → BlocksIslandsHydrator-hb2IWD8K.d.ts} +1 -1
- package/dist/_dts/{Page-Du0zX1B-.d.ts → Page-BlY68ZF-.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-4L8v3FkY.d.ts → SdkPreviewMode-CA8hU7hW.d.ts} +2 -2
- package/dist/_dts/{client-B1J6Akyf.d.ts → client-B6tCvmG4.d.ts} +487 -11
- package/dist/_dts/{content-types-CGGYI0u_.d.ts → content-types-B9qryk4R.d.ts} +2 -2
- package/dist/_dts/{contracts-CHMlw9hT.d.ts → contracts-DWoaRxj1.d.ts} +3 -3
- package/dist/_dts/{footerPageOutline-DIHSU1Vr.d.ts → footerPageOutline-Djdrhp5s.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-JITXD6BU.d.ts → generatePageMetadata-CFi0vxov.d.ts} +2 -2
- package/dist/_dts/{index-yWDbUojb.d.ts → index-Bl5_pjmq.d.ts} +1 -1
- package/dist/_dts/{index-CF62FntA.d.ts → index-Btp5nIoz.d.ts} +2 -2
- package/dist/_dts/{index-BLEKFHt1.d.ts → index-CQUzwOxO.d.ts} +1 -1
- package/dist/_dts/{index-D9ZYmGAJ.d.ts → index-DmhFb6R1.d.ts} +1 -1
- package/dist/_dts/{index-CXZSy_9M.d.ts → index-OtazQE3U.d.ts} +2 -2
- package/dist/_dts/{index-BgOr1Xyz.d.ts → index-YRQulWB4.d.ts} +3 -3
- package/dist/_dts/{index-DpJm0NpL.d.ts → index-_pXaCO12.d.ts} +4 -4
- package/dist/_dts/{loadContent-M-s0p0rq.d.ts → loadContent-Hcuvs4pz.d.ts} +7 -7
- package/dist/_dts/{request-BK-pHf0P.d.ts → request-BT8i_vH-.d.ts} +1621 -385
- package/dist/_dts/{resolveBlockData-DZAlnhwt.d.ts → resolveBlockData-B-dJrunl.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-DXUCWJ3y.d.ts → resolvePageContent-CVLYWcoI.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/gifting/client.d.ts +13 -1
- package/dist/_dts/sdk/src/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
- package/dist/_dts/sdk/src/next/index.d.ts +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 +3 -2
- 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 +2 -1
- package/dist/_dts/{types-DjVNADXR.d.ts → types-C0XZnjXz.d.ts} +3 -3
- package/dist/_dts/{types-CwmB2NHU.d.ts → types-CXL1QJSY.d.ts} +7 -7
- package/dist/_dts/{types-Dmow_FI6.d.ts → types-OKzbqRBx.d.ts} +2 -2
- package/dist/_dts/{validation-h8t1HLlL.d.ts → validation-Bxi66FtQ.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DRVx_XLi.mjs → BlocksIslandsHydrator-2xzlERTG.mjs} +17 -16
- package/dist/client/{BookingMailingListNote-CwrMzj-k.mjs → BookingMailingListNote-qsohSEdQ.mjs} +6 -6
- package/dist/client/{BookingPanelArrangement-C2_hFT6K.mjs → BookingPanelArrangement-DrdtON0q.mjs} +1 -1
- package/dist/client/{BookingQuestionFields-DZMrGvBh.mjs → BookingQuestionFields-CUFxBaTM.mjs} +3 -3
- package/dist/client/{CalendarNavigationChevron-Az1-TIEI.mjs → CalendarNavigationChevron-Ch0w0Utn.mjs} +34 -9
- package/dist/client/DemoBookingPortalAccess-DGgsjqXK.mjs +545 -0
- package/dist/client/{EventCalendar.client-CDkkP-Lv.mjs → EventCalendar.client-Dg4PHFJJ.mjs} +15 -25
- package/dist/client/{EventCombined.client-DK3aaz62.mjs → EventCombined.client-tky8JcnQ.mjs} +25 -17
- package/dist/client/{EventItem-WeUipfIP.mjs → EventItem-BybMSKNL.mjs} +4 -3
- package/dist/client/{EventListWeekNavigation-D3sbAeDo.mjs → EventListWeekNavigation-uvWRE5wi.mjs} +1 -1
- package/dist/client/{EventListing.client-DL3gGGmF.mjs → EventListing.client-DQx9dohz.mjs} +3 -3
- package/dist/client/{EventListing.view-DKFImKOx.mjs → EventListing.view-r31k8Icz.mjs} +8 -7
- package/dist/client/{EventRegistrationPayment-Dn9TpWyL.mjs → EventRegistrationPayment-BMmPDmSf.mjs} +635 -359
- package/dist/client/{LocationMapActions-BJT7MqP2.mjs → LocationMapActions-BecH-qhI.mjs} +1 -1
- package/dist/client/{MapDrawingSvg-DCIwlON6.mjs → MapDrawingSvg-BJzmFdcn.mjs} +18 -3
- package/dist/client/{Page-BpeP9xdt.mjs → Page-CWN_8cLZ.mjs} +601 -579
- package/dist/client/{DemoBookingPortalAccess-1p-pJ1lg.mjs → SiteTermsAgreementField-Dr5lj4oY.mjs} +4 -301
- package/dist/client/{StepIndicator-CP6zrwkl.mjs → StepIndicator-C7RJBOW3.mjs} +37 -12
- package/dist/client/{accordion-nR7D4m1a.mjs → accordion-uUi_N6mZ.mjs} +1 -1
- package/dist/client/{booking-form.client-Ce-mQZ7W.mjs → booking-form.client-CKHgxvsh.mjs} +229 -42
- package/dist/client/{bookingForm-B-qT_AQB.mjs → bookingForm-Bi74dmiS.mjs} +4 -4
- package/dist/client/bookings.mjs +22 -15
- package/dist/client/{boxStyleClassNames-CrE3TDpW.mjs → boxStyleClassNames-C-gFwhnO.mjs} +2 -1
- package/dist/client/{carousel-CVUOatsY.mjs → carousel-C0_BqMA0.mjs} +1 -1
- package/dist/client/{cart-DE0K6E0R.mjs → cart-BOHuppVu.mjs} +3 -3
- package/dist/client/{cart.client-C23E6WQ5.mjs → cart.client-IfJE1zAp.mjs} +1 -1
- package/dist/client/{checkout-76cdHyPL.mjs → checkout-C3Aj-aNa.mjs} +3 -3
- package/dist/client/{checkout.client-DJOzqb26.mjs → checkout.client-Tg9lfeYf.mjs} +1 -1
- package/dist/client/{checkoutUrls-CvIP5DCO.mjs → checkoutUrls-OLqQdAXD.mjs} +1 -1
- package/dist/client/client.mjs +112 -21
- package/dist/client/{context-CNlesLfF.mjs → context-D8TpQXjX.mjs} +76 -58
- package/dist/client/{course-DHIrXqNT.mjs → course-DHmeQAvq.mjs} +2 -2
- package/dist/client/{creditProducts-KYMVIH3J.mjs → creditProducts-BQ1t1erI.mjs} +14 -61
- package/dist/client/{dateFormatting-B73Ll0s4.mjs → dateFormatting-ABCZWkpT.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-BVbLD4pi.mjs → demoPortalMagicLink-BdcuW_pa.mjs} +1 -1
- package/dist/client/display-DMqotaGU.mjs +11797 -0
- package/dist/client/{enhanceHeaderSection-5GD5o4Mt.mjs → enhanceHeaderSection-Ciuhsk0E.mjs} +3 -3
- package/dist/client/{event-details.client-D7Oz1q2L.mjs → event-details.client-CJapNbTv.mjs} +1 -1
- package/dist/client/{event-registration.client-zbuX36aA.mjs → event-registration.client-CAdcpnLc.mjs} +176 -75
- package/dist/client/{eventCalendar-uZrksODt.mjs → eventCalendar-BlsD5R8M.mjs} +4 -4
- package/dist/client/{eventCombined-DxhvNAx8.mjs → eventCombined-B9Ly3024.mjs} +4 -4
- package/dist/client/{eventDetails-DCIH4BYG.mjs → eventDetails-CbEGI4jO.mjs} +2 -2
- package/dist/client/{eventListing-B9KrnPvc.mjs → eventListing-ZSmvhWII.mjs} +4 -4
- package/dist/client/{eventRegistration-TjnURMKl.mjs → eventRegistration-D-yUcIyO.mjs} +4 -4
- package/dist/client/{form-CfqIAhfN.mjs → form-DG_YZSNn.mjs} +3 -3
- package/dist/client/{form.client-CL6fF0cW.mjs → form.client-BU6dM0-C.mjs} +4 -4
- package/dist/client/{form.parts-Bf-L66Gg.mjs → form.parts-Db0Iq7nx.mjs} +1 -1
- package/dist/client/{formatDate-Dp7POa9Y.mjs → formatDate-DFfWHpQB.mjs} +1 -1
- package/dist/client/gifting/client.mjs +5 -3
- package/dist/client/gifting-DMrsN4B4.mjs +28 -0
- package/dist/client/gifting.client-BVa2XYJB.mjs +404 -0
- package/dist/client/gifting.parts-C2u4Y-pf.mjs +86 -0
- package/dist/client/{headerSection-WVXtOcuW.mjs → headerSection-D91EzlOR.mjs} +2 -2
- package/dist/client/{display-Cf_j5stk.mjs → lookSurfaces-BDZLALxj.mjs} +2951 -14395
- package/dist/client/{newsletter-form.client-Bb7GAZpO.mjs → newsletter-form.client-BMGRiRpo.mjs} +7 -5
- package/dist/client/{newsletter-form.parts-BqOVRdIc.mjs → newsletter-form.parts-D5UfUaD3.mjs} +3 -3
- package/dist/client/{newsletterForm-DOVe-qY3.mjs → newsletterForm-B_67sNwa.mjs} +3 -3
- package/dist/client/{noop-D5mFWXtN.mjs → noop-DF8_EiFt.mjs} +93 -28
- package/dist/client/portal/client.mjs +313 -148
- package/dist/client/{product-detail.client-CNzeFnFf.mjs → product-detail.client-D-XNir0m.mjs} +1 -1
- package/dist/client/{product-list.client-LKpzC7pj.mjs → product-list.client-BLfYQ-qi.mjs} +1 -1
- package/dist/client/{productDetail-D2JNeEgx.mjs → productDetail-W0_0lDGe.mjs} +3 -3
- package/dist/client/{productList-DTgZXOEq.mjs → productList-ayAtPJdb.mjs} +3 -3
- package/dist/client/{propsDecoder-mpBQt2AT.mjs → propsDecoder-ChYKWjLA.mjs} +4 -3
- package/dist/client/{registry.server-DdTJyar2.mjs → registry.server-B1EEZkcr.mjs} +307 -240
- package/dist/client/rendering/client.mjs +25 -491
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +7 -6
- package/dist/client/{richText-coerce-C32cRQ03.mjs → richText-coerce-CDAfpMQU.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-8cfSgT0E.mjs → routeIslandApiConfig-CcGWvyht.mjs} +1 -1
- package/dist/client/{shop-5LBhftWx.mjs → shop-DbUUoHFJ.mjs} +3 -3
- package/dist/client/{shop-discount-apply.state-D0ifS6KX.mjs → shop-add-feedback-DvC2kP1K.mjs} +1 -78
- package/dist/client/{shop-commerce-DkValjZj.mjs → shop-commerce-aQqcDmyZ.mjs} +64 -32
- package/dist/client/{shop-commerce-store-BOmXFmk_.mjs → shop-commerce-store-Cd7USpuY.mjs} +1 -1
- package/dist/client/shop-discount-apply.state-DGvPBmVP.mjs +83 -0
- package/dist/client/{shop.client-BTtZqNmv.mjs → shop.client-BNZ9M8cG.mjs} +56 -19
- package/dist/client/{shop.interactive-DNRqG4aX.mjs → shop.interactive-CJAINJr3.mjs} +113 -35
- package/dist/client/{shopShared-Nky6kPYr.mjs → shopShared-DwVAuGsx.mjs} +2 -2
- package/dist/client/{timetableModel-DZArznD_.mjs → timetableModel-DBTIFWTb.mjs} +10 -10
- package/dist/client/{useAvailableSlots-CUVRD1nx.mjs → useAvailableSlots-BomyyKeo.mjs} +3 -3
- package/dist/client/{useDiscountCodeUi-d7viY_mu.mjs → useDiscountCodeUi-CCxHMWlU.mjs} +32 -17
- package/dist/client/{useEventPagination-Da2JqxGC.mjs → useEventPagination-Bjin_qaN.mjs} +7 -6
- package/dist/client/{view-BvuYmQJ5.mjs → view-BTk470k0.mjs} +3 -2
- package/dist/client/{view-D9ObkFtz.mjs → view-Cw4EmEPv.mjs} +99 -30
- package/dist/preview-next/client/{PageSectionToolbar-DwxHT-2k.mjs → PageSectionToolbar-bq7gbKvn.mjs} +4 -4
- package/dist/preview-next/client/{PreviewEditorSidebar-D4SBxGU6.mjs → PreviewEditorSidebar-DVsPNcos.mjs} +28 -25
- package/dist/preview-next/client/{PreviewEditorUI-D8mUct32.mjs → PreviewEditorUI-B-pq3aZc.mjs} +4 -4
- package/dist/preview-next/client/{PreviewShell-L2AEdNUQ.mjs → PreviewShell-ChyjB96e.mjs} +5 -5
- package/dist/preview-next/client/{SdkPreviewModeRuntime-bhVAU2D2.mjs → SdkPreviewModeRuntime-D_czeC0l.mjs} +84 -101
- package/dist/preview-next/client/{previewAssistantSlot-Jpj_HDra.mjs → previewAssistantSlot-B61mZd81.mjs} +4141 -2677
- package/dist/preview-next/client/{previewChromeRoot-CYTDvx4u.mjs → previewChromeRoot-dwOn9XtM.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-CZHX6J_4.mjs → sdk-runtime-DZDfOxoW.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-DmGIG9Hk.mjs → siteStyleAccess-BZDIC-fA.mjs} +527 -236
- package/dist/preview-next/client/{useAutosaveStatus-DQCyswQ-.mjs → useAutosaveStatus-BbzLMf-l.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-LwE5yXvL.mjs → useOpenBlockForSetup-BEXcWQeI.mjs} +13 -4
- package/dist/preview-next/container-responsive.css +51 -3
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-BOuNcOcN.mjs → route-contract-0gSlK9S0.mjs} +86 -12
- package/dist/server/{Block.shared-wfJfhs08.mjs → Block.shared-DeXXycg8.mjs} +4 -4
- package/dist/server/{ThemeScopeCore-BtrJNHTB.mjs → ThemeScopeCore-DFEM1a85.mjs} +16 -2
- package/dist/server/{bindings-P1CF2Gm6.mjs → bindings-7L3pC5Os.mjs} +13 -34
- package/dist/server/{client-CGtU5fHI.mjs → client-CgghATBm.mjs} +111 -20
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{customCss-BGB8gMVb.mjs → customCss-BZ8YSrQg.mjs} +1 -0
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/index.mjs +2 -2
- package/dist/server/{loadContent-ChnkJSay.mjs → loadContent-D7M5Vcug.mjs} +5 -5
- package/dist/server/{loadPage-DesHhgxj.mjs → loadPage-CiTId05y.mjs} +2 -2
- package/dist/server/{lookMediaFrame-BBr0mkze.mjs → lookMediaFrame-CaH018pK.mjs} +24 -5
- package/dist/server/next.mjs +35 -9
- package/dist/server/{overrideResolution-DHEkHcZs.mjs → overrideResolution-CJ3MRI5Q.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-0jvm0RBk.mjs → pageRenderPlan-Cuos4Xcd.mjs} +97 -39
- package/dist/server/{pageRuntimeSupport-8-f1Zr9e.mjs → pageRuntimeSupport-CuVj3bkd.mjs} +4 -3
- package/dist/server/{pageShared-CuVFoV4z.mjs → pageShared-JxlV8_Bo.mjs} +1261 -1129
- package/dist/server/{parseThemeForPersistence-Cwqb5pZx.mjs → parseThemeForPersistence-DOsfofCy.mjs} +1 -1
- package/dist/server/{prebuild-Bms_Y7wQ.mjs → prebuild-BDhlJbAx.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-5oC5kyHe.mjs → prefetchBlockData-kERh_c0v.mjs} +2 -2
- package/dist/server/{registry-DmqxC8th.mjs → registry-cQ9N5W-n.mjs} +20432 -20165
- 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 +7 -7
- package/dist/server/{resolveBlockData-EYogtwQc.mjs → resolveBlockData-CN4UmmTK.mjs} +1 -1
- package/dist/server/{schema-CUDHMirj.mjs → schema-BpsqaSSU.mjs} +2 -2
- package/dist/server/server.mjs +3 -3
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{validation-Bt_8IL1g.mjs → validation-3puM5SM8.mjs} +3 -3
- package/dist/server/{version-DT_efohp.mjs → version-B8g-Wx57.mjs} +1 -1
- package/dist/styles/index.css +295 -37
- package/package.json +1 -1
- package/dist/client/useDiscountApply-BBnStWXU.mjs +0 -199
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { $i as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { $i as restoreBookingQuestionsAnswers, Ai as prepareBookingSubmission, Di as normalizeBookingFormConfig, Ei as isSameOpenCheckout, Fi as resolveDefaultBookingServiceId, Gi as appointmentQuestionsRefusal, Hi as resolveSelectedAppointmentConsent, Ii as selectedBookingCollectionOptionKind, Ji as needsAppointmentQuestionsRefresh, Ki as deriveAppointmentBookingQuestions, Li as snapshotBookingShownTerms, Ma as resolveDateRuntimeContext, Mi as resolveBookingPaymentStep, Ni as resolveBookingSelectedService, Oi as normalizeBookingServices, Pi as resolveBookingSiteId, Po as repriceBookingCollectionOptions, Ra as leavePage, Ri as toSelectedCollectionOptionKind, Si as getBookingSuccessCopy, Ti as isBookingServiceSlidingAmountInRange, Ui as EMPTY_APPOINTMENT_BOOKING_QUESTIONS, Vi as projectSelectedAppointmentConsentIntoForm, Vo as resolveBookingSignupOffer, Wi as applyAppointmentBookingQuestionsEvent, Xi as decideBookingQuestionsRestoration, Yi as bookingQuestionsAnswerDraftSchema, _i as buildBookingFormInteractiveIslandProps, aa as bookingHasPackagePaymentChoices, at as buildBookingPaymentSelectionViewModel, bi as formatBookingSubmissionPreparationError, c as formatCommercePrice, ca as reconcileBookingPackagePurchase, ct as paymentChoicePrice, da as resolveBookingPaymentAvailability, ea as toBookingQuestionsAnswerDraft, fa as resolveBookingPaymentChoice, ga as getBookingServiceSlidingScale, ha as toBookingPurchasablePackages, ia as applyBookingPaymentAdmission, ja as readRuntimeNow, ji as resolveAppointmentCheckoutVerificationState, ki as parseBookingCurrencyInputToCents, la as resolveBookingPackagePaymentSelection, ma as resolveBookingPurchasablePackages, na as BOOKING_FORM_DATA_RESERVED_KEYS, oa as bookingPackageRequestKey, os as unsafeAsSiteId, ot as buildReviewedBookingPaymentViewModel, pa as resolveBookingPaymentMode, pr as createSignInReturnDraftStore, qi as isAppointmentBookingQuestionsEvent, sa as bookingRequiresResourceSelection, st as paymentChoiceDetails, u as formatValidity, ua as resolveBookingPackageSources, vi as readOverrideServiceCategories, xi as getBookingRedirectStateFromLocation, yi as deriveBookingFormViewState, yr as bookingPresentation, zi as formatCentsAsCurrencyInput } from "./display-DMqotaGU.mjs";
|
|
3
|
+
import { $t as formatTimeZoneCityLabel, Q as isBookingRequirementConsentFieldId, Xt as formatDateTimeRange, Zt as formatTime, a as okWith, c as reportWorkflowSuccess, fn as resolveBookingBusinessTimeZone, gn as toUtcIsoDateTimeString, hn as parseUtcIsoDateTimeString, n as assertNever, o as clearWorkflowFeedback, pn as resolveBookingTimeZoneId, qt as formatDate, r as err, s as reportWorkflowError, t as logger, tn as resolveBookingDisplayContext, xn as formatCurrencyAmount } from "./noop-DF8_EiFt.mjs";
|
|
4
|
+
import { D as unsafeAsAppointmentResourceId, O as unsafeAsAppointmentServiceId, g as formatCreditProductUnits, h as formatCreditProductPayment, m as formatCreditProductBalance, o as checkBookingQuestionsAnswered } from "./creditProducts-BQ1t1erI.mjs";
|
|
5
|
+
import { i as useSiteTermsAgreement, n as SiteTermsChangedNotice, t as SiteTermsAgreementField } from "./SiteTermsAgreementField-Dr5lj4oY.mjs";
|
|
6
6
|
import { t as layoutServicesByCategory } from "./appointment-service-categories-Cl2pqw-z.mjs";
|
|
7
|
-
import { a as formatTime$1, i as formatDatePillParts, n as useAvailableDates, o as getRuntimeTimeZone, r as formatDate$1, s as clientPersonPhrases, t as useAvailableSlots } from "./useAvailableSlots-
|
|
8
|
-
import { n as useBlockApi, t as BlockApiProvider } from "./context-
|
|
7
|
+
import { a as formatTime$1, i as formatDatePillParts, n as useAvailableDates, o as getRuntimeTimeZone, r as formatDate$1, s as clientPersonPhrases, t as useAvailableSlots } from "./useAvailableSlots-BomyyKeo.mjs";
|
|
8
|
+
import { i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "./context-D8TpQXjX.mjs";
|
|
9
9
|
import { l as SpinnerNode, r as ThemedButton } from "./ThemedButton-DuaYtnvG.mjs";
|
|
10
|
-
import { t as
|
|
10
|
+
import { f as NavigationHandOffPanel, p as DiscountCodeDisclosure, r as DISCOUNT_APPLY_MESSAGES, t as BookingConfirmation } from "./DemoBookingPortalAccess-DGgsjqXK.mjs";
|
|
11
|
+
import { t as buildCheckoutReturnUrls } from "./checkoutUrls-OLqQdAXD.mjs";
|
|
11
12
|
import { t as scrollToBlock } from "./scrollToBlock-DrgKE0qZ.mjs";
|
|
12
13
|
import { t as CheckboxChoice } from "./CheckboxChoice-b-PJLEXe.mjs";
|
|
13
14
|
import { t as CheckIcon } from "./CheckIcon-CVcKteXH.mjs";
|
|
14
15
|
import { n as getFieldValidationControlProps, t as FieldValidationMessage } from "./FieldValidationMessage-CsqxShw4.mjs";
|
|
15
16
|
import { t as FeedbackMessage } from "./FeedbackMessage-CSJrAuXH.mjs";
|
|
16
|
-
import { i as useBookingNowIso, n as OptionalMark, r as parseBookingSubmissionFailure } from "./BookingQuestionFields-
|
|
17
|
-
import { n as TerminalPanel, r as StateIcon, t as useDiscountCodeUi } from "./useDiscountCodeUi-
|
|
18
|
-
import { a as usePolling, c as useBookingQuestionsRefresh, i as BookingConsentAgreement, l as PaymentChoiceRows, n as BookingQuestionSections, o as portalSessionIdentity, s as useSignInReturn, t as BookingMailingListNote } from "./BookingMailingListNote-
|
|
19
|
-
import { n as StepIndicator, t as BookingPanelArrangement } from "./BookingPanelArrangement-
|
|
20
|
-
import { s as storeDemoBookingPassIfAvailable } from "./demoPortalMagicLink-
|
|
17
|
+
import { i as useBookingNowIso, n as OptionalMark, r as parseBookingSubmissionFailure } from "./BookingQuestionFields-CUFxBaTM.mjs";
|
|
18
|
+
import { n as TerminalPanel, r as StateIcon, t as useDiscountCodeUi } from "./useDiscountCodeUi-CCxHMWlU.mjs";
|
|
19
|
+
import { a as usePolling, c as useBookingQuestionsRefresh, i as BookingConsentAgreement, l as PaymentChoiceRows, n as BookingQuestionSections, o as portalSessionIdentity, s as useSignInReturn, t as BookingMailingListNote } from "./BookingMailingListNote-qsohSEdQ.mjs";
|
|
20
|
+
import { n as StepIndicator, t as BookingPanelArrangement } from "./BookingPanelArrangement-DrdtON0q.mjs";
|
|
21
|
+
import { s as storeDemoBookingPassIfAvailable } from "./demoPortalMagicLink-BdcuW_pa.mjs";
|
|
22
|
+
import { i as getDiscountApplyFeedback } from "./shop-discount-apply.state-DGvPBmVP.mjs";
|
|
21
23
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
22
24
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
23
25
|
import { z } from "zod";
|
|
@@ -237,6 +239,26 @@ function resolveBookingPaymentConfirmationSummary(input) {
|
|
|
237
239
|
function bookingPaymentNeedsCardConfirmation(payment) {
|
|
238
240
|
return payment.kind === "ready" && payment.choice.kind === "selected" && payment.choice.option.kind !== "deferred_manual";
|
|
239
241
|
}
|
|
242
|
+
/** The discounted amount actually shown is the submission's ceiling, using the existing term snapshot. */
|
|
243
|
+
function discountedBookingShownTerms(payment, totalCents, currency) {
|
|
244
|
+
if (payment.kind !== "ready" || payment.choice.kind !== "selected") return void 0;
|
|
245
|
+
const [first, ...rest] = repriceBookingCollectionOptions({
|
|
246
|
+
options: payment.availableOptions,
|
|
247
|
+
totalCents,
|
|
248
|
+
currency
|
|
249
|
+
});
|
|
250
|
+
if (!first) return void 0;
|
|
251
|
+
const selectedKind = payment.choice.option.kind;
|
|
252
|
+
const option = [first, ...rest].find((option) => option.kind === selectedKind) ?? first;
|
|
253
|
+
return snapshotBookingShownTerms({
|
|
254
|
+
...payment,
|
|
255
|
+
availableOptions: [first, ...rest],
|
|
256
|
+
choice: {
|
|
257
|
+
kind: "selected",
|
|
258
|
+
option
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
240
262
|
//#endregion
|
|
241
263
|
//#region ../blocks/src/system/runtime/hooks/useSelectedAppointmentConsentForm.ts
|
|
242
264
|
function useSelectedAppointmentConsentForm(form, selectedService) {
|
|
@@ -548,7 +570,7 @@ function selectIsSubmitting(state) {
|
|
|
548
570
|
* }
|
|
549
571
|
* ```
|
|
550
572
|
*/
|
|
551
|
-
function useBookingSubmission(siteId, terms) {
|
|
573
|
+
function useBookingSubmission(siteId, terms, onDiscountRefused) {
|
|
552
574
|
const api = terms.api;
|
|
553
575
|
const [state, dispatch] = useReducer(bookingSubmissionReducer, initialBookingSubmissionState);
|
|
554
576
|
const submit = async (data) => {
|
|
@@ -567,6 +589,7 @@ function useBookingSubmission(siteId, terms) {
|
|
|
567
589
|
});
|
|
568
590
|
return okWith(response);
|
|
569
591
|
} catch (error) {
|
|
592
|
+
if (error instanceof BlockApiError && error.tag === "INVALID_DISCOUNT_CODE") onDiscountRefused?.(error.message);
|
|
570
593
|
console.error("Booking submission error:", error);
|
|
571
594
|
const failure = parseBookingSubmissionFailure(error, "Failed to book appointment");
|
|
572
595
|
dispatch({
|
|
@@ -2172,6 +2195,74 @@ function isOutdatedBookingReview(result, submitted, current) {
|
|
|
2172
2195
|
return result.ok && (result.data.type === "review_required" || result.data.type === "payment_choice_required") && !sameBookingIntent(submitted, current);
|
|
2173
2196
|
}
|
|
2174
2197
|
//#endregion
|
|
2198
|
+
//#region ../blocks/src/system/runtime/hooks/useManualDiscountPreview.ts
|
|
2199
|
+
/** A preview belongs to the exact code, email and basket; late responses cannot price a newer draft. */
|
|
2200
|
+
function useManualDiscountPreview(input) {
|
|
2201
|
+
const key = JSON.stringify([
|
|
2202
|
+
input.code.trim(),
|
|
2203
|
+
input.email.trim().toLowerCase(),
|
|
2204
|
+
input.lines
|
|
2205
|
+
]);
|
|
2206
|
+
const [state, setState] = useState(null);
|
|
2207
|
+
const status = state?.key === key ? state.status : { type: "idle" };
|
|
2208
|
+
const refuse = (message) => setState({
|
|
2209
|
+
key,
|
|
2210
|
+
status: {
|
|
2211
|
+
type: "rejected",
|
|
2212
|
+
reason: "invalid_or_not_applicable",
|
|
2213
|
+
message
|
|
2214
|
+
}
|
|
2215
|
+
});
|
|
2216
|
+
const apply = async () => {
|
|
2217
|
+
if (status.type === "applying") return;
|
|
2218
|
+
if (!input.code.trim()) return refuse(DISCOUNT_APPLY_MESSAGES.emptyCode);
|
|
2219
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(input.email.trim())) return refuse(DISCOUNT_APPLY_MESSAGES.emailRequired);
|
|
2220
|
+
if (!input.lines.length) return refuse(DISCOUNT_APPLY_MESSAGES.unavailable);
|
|
2221
|
+
const pending = {
|
|
2222
|
+
key,
|
|
2223
|
+
status: { type: "applying" }
|
|
2224
|
+
};
|
|
2225
|
+
setState(pending);
|
|
2226
|
+
const next = await requestManualPreview(input);
|
|
2227
|
+
setState((previous) => previous === pending ? {
|
|
2228
|
+
key,
|
|
2229
|
+
status: next
|
|
2230
|
+
} : previous);
|
|
2231
|
+
};
|
|
2232
|
+
const discount = status.type === "applied" ? status.discount : null;
|
|
2233
|
+
return {
|
|
2234
|
+
discount,
|
|
2235
|
+
apply,
|
|
2236
|
+
refuse,
|
|
2237
|
+
isApplying: status.type === "applying",
|
|
2238
|
+
ready: !input.code.trim() || discount !== null,
|
|
2239
|
+
feedback: getDiscountApplyFeedback(status, formatCommercePrice)
|
|
2240
|
+
};
|
|
2241
|
+
}
|
|
2242
|
+
async function requestManualPreview(input) {
|
|
2243
|
+
try {
|
|
2244
|
+
const result = await input.api.applyDiscountCode({
|
|
2245
|
+
discountCode: input.code.trim(),
|
|
2246
|
+
customerEmail: input.email.trim(),
|
|
2247
|
+
lines: input.lines
|
|
2248
|
+
});
|
|
2249
|
+
return result.type === "applied" ? {
|
|
2250
|
+
type: "applied",
|
|
2251
|
+
discount: result
|
|
2252
|
+
} : {
|
|
2253
|
+
type: "rejected",
|
|
2254
|
+
reason: result.type === "rejected" ? result.reason : "unavailable",
|
|
2255
|
+
message: result.type === "rejected" ? result.message : DISCOUNT_APPLY_MESSAGES.unavailable
|
|
2256
|
+
};
|
|
2257
|
+
} catch {
|
|
2258
|
+
return {
|
|
2259
|
+
type: "rejected",
|
|
2260
|
+
reason: "unknown",
|
|
2261
|
+
message: DISCOUNT_APPLY_MESSAGES.unknown
|
|
2262
|
+
};
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
//#endregion
|
|
2175
2266
|
//#region ../blocks/src/system/runtime/hooks/useHeadlessBookingFlow.ts
|
|
2176
2267
|
function HeadlessBookingProvider({ config, children }) {
|
|
2177
2268
|
return React.createElement(BlockApiProvider, {
|
|
@@ -2179,6 +2270,29 @@ function HeadlessBookingProvider({ config, children }) {
|
|
|
2179
2270
|
children
|
|
2180
2271
|
});
|
|
2181
2272
|
}
|
|
2273
|
+
/** A chosen package pays with credit, so it never carries a typed code. */
|
|
2274
|
+
function bookingManualDiscountInput(input) {
|
|
2275
|
+
return {
|
|
2276
|
+
code: input.packageSelected ? "" : input.code,
|
|
2277
|
+
email: typeof input.email === "string" ? input.email : "",
|
|
2278
|
+
lines: input.context ? [{
|
|
2279
|
+
context: input.context,
|
|
2280
|
+
subtotalCents: input.subtotalCents,
|
|
2281
|
+
currency: input.service?.priceCurrency ?? "GBP"
|
|
2282
|
+
}] : []
|
|
2283
|
+
};
|
|
2284
|
+
}
|
|
2285
|
+
function bookingPreviewOptions(resolution, discount) {
|
|
2286
|
+
if (resolution.kind !== "ready") return [];
|
|
2287
|
+
return discount ? repriceBookingCollectionOptions({
|
|
2288
|
+
options: resolution.availableOptions,
|
|
2289
|
+
currency: discount.currency,
|
|
2290
|
+
totalCents: discount.totalAfterDiscountCents
|
|
2291
|
+
}) : resolution.availableOptions;
|
|
2292
|
+
}
|
|
2293
|
+
function discountedPriceAmount(discount, priceAmount) {
|
|
2294
|
+
return discount?.totalAfterDiscountCents ?? priceAmount;
|
|
2295
|
+
}
|
|
2182
2296
|
function useHeadlessBookingFlow(options) {
|
|
2183
2297
|
const viewerTimeZone = options.viewerTimeZone ?? getRuntimeTimeZone();
|
|
2184
2298
|
const availabilityTimeZone = options.dateContext.timeZone;
|
|
@@ -2370,22 +2484,59 @@ function useHeadlessBookingFlow(options) {
|
|
|
2370
2484
|
const resources = resourcesState.tag === "loaded" ? resourcesState.value : [];
|
|
2371
2485
|
const purchase = state.packagePurchase;
|
|
2372
2486
|
const paymentPriceAmount = purchase.kind === "selected" ? purchase.package.price : selectedAppointmentPriceAmount;
|
|
2487
|
+
const appointmentDiscountContext = useMemo(() => purchase.kind === "selected" ? {
|
|
2488
|
+
type: "pass",
|
|
2489
|
+
passId: purchase.package.id
|
|
2490
|
+
} : selectedService && selectedAppointmentPriceAmount > 0 ? {
|
|
2491
|
+
type: "appointment",
|
|
2492
|
+
serviceId: selectedService.id
|
|
2493
|
+
} : null, [
|
|
2494
|
+
purchase,
|
|
2495
|
+
selectedAppointmentPriceAmount,
|
|
2496
|
+
selectedService?.id
|
|
2497
|
+
]);
|
|
2373
2498
|
const discountUi = useDiscountCodeUi({
|
|
2374
2499
|
api,
|
|
2375
|
-
discountContext:
|
|
2376
|
-
type: "pass",
|
|
2377
|
-
passId: purchase.package.id
|
|
2378
|
-
} : selectedService && selectedAppointmentPriceAmount > 0 ? {
|
|
2379
|
-
type: "appointment",
|
|
2380
|
-
serviceId: selectedService.id
|
|
2381
|
-
} : null, [
|
|
2382
|
-
purchase,
|
|
2383
|
-
selectedAppointmentPriceAmount,
|
|
2384
|
-
selectedService?.id
|
|
2385
|
-
]),
|
|
2500
|
+
discountContext: appointmentDiscountContext,
|
|
2386
2501
|
subtotalCents: paymentPriceAmount
|
|
2387
2502
|
});
|
|
2388
|
-
const
|
|
2503
|
+
const manualDiscount = useManualDiscountPreview({
|
|
2504
|
+
api,
|
|
2505
|
+
...bookingManualDiscountInput({
|
|
2506
|
+
packageSelected: Boolean(state.selectedAppointmentPackageId),
|
|
2507
|
+
code: discountUi.discountCode,
|
|
2508
|
+
email: state.fieldValues.email,
|
|
2509
|
+
context: appointmentDiscountContext,
|
|
2510
|
+
subtotalCents: paymentPriceAmount,
|
|
2511
|
+
service: selectedService
|
|
2512
|
+
})
|
|
2513
|
+
});
|
|
2514
|
+
const { submit: submitBooking, clearFeedback } = useBookingSubmission(options.siteId, siteTerms, (message) => {
|
|
2515
|
+
manualDiscount.refuse(message);
|
|
2516
|
+
discountUi.setDiscountUiOpen(true);
|
|
2517
|
+
dispatch({
|
|
2518
|
+
type: "step-changed",
|
|
2519
|
+
stepId: "payment-selection"
|
|
2520
|
+
});
|
|
2521
|
+
});
|
|
2522
|
+
const submit = async (booking) => {
|
|
2523
|
+
if (!manualDiscount.ready) {
|
|
2524
|
+
manualDiscount.refuse("Apply your code before paying.");
|
|
2525
|
+
return {
|
|
2526
|
+
ok: false,
|
|
2527
|
+
error: {
|
|
2528
|
+
message: "Apply your code before paying.",
|
|
2529
|
+
questionFieldErrors: {},
|
|
2530
|
+
answersNeeded: false
|
|
2531
|
+
}
|
|
2532
|
+
};
|
|
2533
|
+
}
|
|
2534
|
+
const shownTerms = !state.review && manualDiscount.discount ? discountedBookingShownTerms(stepState.paymentResolution, manualDiscount.discount.totalAfterDiscountCents, manualDiscount.discount.currency) : void 0;
|
|
2535
|
+
return submitBooking(booking.kind === "standard" && shownTerms ? {
|
|
2536
|
+
...booking,
|
|
2537
|
+
shownTerms
|
|
2538
|
+
} : booking);
|
|
2539
|
+
};
|
|
2389
2540
|
const promisedDiscountId = resolveDisclosedBookingDiscountId(discountUi);
|
|
2390
2541
|
const actions = useBookingFlowController({
|
|
2391
2542
|
state,
|
|
@@ -2422,23 +2573,25 @@ function useHeadlessBookingFlow(options) {
|
|
|
2422
2573
|
dispatch
|
|
2423
2574
|
});
|
|
2424
2575
|
const paymentResolution = stepState.paymentResolution;
|
|
2576
|
+
const previewOptions = bookingPreviewOptions(paymentResolution, manualDiscount.discount);
|
|
2425
2577
|
const selectedCollectionOptionKind = selectedBookingCollectionOptionKind(paymentResolution);
|
|
2426
2578
|
const paymentSelection = useMemo(() => paymentResolution.kind === "ready" || paymentResolution.kind === "not_required" ? buildBookingPaymentSelectionViewModel({
|
|
2427
2579
|
dateContext: options.dateContext,
|
|
2428
2580
|
serviceTitle: paymentResolution.service.title,
|
|
2429
|
-
availableOptions:
|
|
2581
|
+
availableOptions: previewOptions,
|
|
2430
2582
|
priceCurrency: paymentResolution.service.priceCurrency
|
|
2431
2583
|
}) : null, [
|
|
2432
2584
|
options.dateContext,
|
|
2433
2585
|
bookingNowIso,
|
|
2434
2586
|
paymentResolution,
|
|
2587
|
+
manualDiscount.discount,
|
|
2435
2588
|
selectedAppointmentPriceAmount,
|
|
2436
2589
|
selectedService,
|
|
2437
2590
|
state.selectedSlot?.startAt
|
|
2438
2591
|
]);
|
|
2439
2592
|
const paymentConfirmationSummary = resolveBookingPaymentConfirmationSummary({
|
|
2440
2593
|
service: selectedService,
|
|
2441
|
-
priceAmount: selectedAppointmentPriceAmount,
|
|
2594
|
+
priceAmount: discountedPriceAmount(manualDiscount.discount, selectedAppointmentPriceAmount),
|
|
2442
2595
|
hasSelectedAppointmentPackage: Boolean(state.selectedAppointmentPackageId) || purchase.kind === "selected",
|
|
2443
2596
|
paymentResolution
|
|
2444
2597
|
});
|
|
@@ -2559,6 +2712,7 @@ function useHeadlessBookingFlow(options) {
|
|
|
2559
2712
|
},
|
|
2560
2713
|
payment,
|
|
2561
2714
|
discount: {
|
|
2715
|
+
preview: manualDiscount,
|
|
2562
2716
|
code: discountUi.discountCode,
|
|
2563
2717
|
isOpen: discountUi.discountUiOpen,
|
|
2564
2718
|
manualCodeEntryAllowed: discountUi.manualCodeEntryAllowed,
|
|
@@ -3087,7 +3241,14 @@ function BookingOfferReview({ review, booking }) {
|
|
|
3087
3241
|
}
|
|
3088
3242
|
function bookingPrimaryActionLabel(booking, isLastStep, summary) {
|
|
3089
3243
|
if (isLastStep && booking.services.selected?.requiresApproval) return "Send request";
|
|
3090
|
-
|
|
3244
|
+
if (isLastStep && booking.review) return reviewedActionLabel(booking.review);
|
|
3245
|
+
const discount = booking.discount.preview?.discount;
|
|
3246
|
+
if (isLastStep && discount) return discountedActionLabel(booking, discount);
|
|
3247
|
+
return resolvePrimaryActionLabel(isLastStep, Boolean(summary));
|
|
3248
|
+
}
|
|
3249
|
+
function discountedActionLabel(booking, discount) {
|
|
3250
|
+
if (discount.totalAfterDiscountCents === 0) return "Confirm booking";
|
|
3251
|
+
return (booking.payment.selection?.options.find((option) => option.kind === booking.payment.selectedCollectionOptionKind))?.ctaLabel ?? `Pay ${formatCurrencyAmount(discount.totalAfterDiscountCents, discount.currency, { decimals: "auto" })} now`;
|
|
3091
3252
|
}
|
|
3092
3253
|
function BookingSubmissionSummary({ booking, isLastStep, summary }) {
|
|
3093
3254
|
if (isLastStep && booking.services.selected?.requiresApproval) return /* @__PURE__ */ jsxs("p", {
|
|
@@ -4035,21 +4196,35 @@ function PaymentOptionContent({ description, helperText, id, summaryRows, title
|
|
|
4035
4196
|
]
|
|
4036
4197
|
});
|
|
4037
4198
|
}
|
|
4199
|
+
function shouldShowBookingDiscountSection(booking) {
|
|
4200
|
+
return !booking.payment.selectedAppointmentPackageId && !booking.discount.loading && (booking.discount.manualCodeEntryAllowed || Boolean(booking.discount.autoAppliedDiscount));
|
|
4201
|
+
}
|
|
4202
|
+
function shouldShowAutomaticDiscountNotice(booking) {
|
|
4203
|
+
return !booking.review && Boolean(booking.discount.autoAppliedDiscount) && booking.discount.code.trim().length === 0;
|
|
4204
|
+
}
|
|
4205
|
+
function DefaultBookingDiscountCode({ discount }) {
|
|
4206
|
+
return /* @__PURE__ */ jsx(DiscountCodeDisclosure, {
|
|
4207
|
+
surface: "theme-form",
|
|
4208
|
+
onApply: () => void discount.preview?.apply(),
|
|
4209
|
+
isApplying: discount.preview?.isApplying,
|
|
4210
|
+
applied: Boolean(discount.preview?.discount),
|
|
4211
|
+
feedback: discount.preview?.feedback,
|
|
4212
|
+
hint: discount.preview?.discount?.totalAfterDiscountCents === 0 ? "There's nothing to pay. You won't need to enter card details." : void 0,
|
|
4213
|
+
isOpen: discount.isOpen,
|
|
4214
|
+
code: discount.code,
|
|
4215
|
+
onOpen: () => discount.setOpen(true),
|
|
4216
|
+
onChange: discount.setCode,
|
|
4217
|
+
onRemove: () => {
|
|
4218
|
+
discount.clear();
|
|
4219
|
+
discount.setOpen(false);
|
|
4220
|
+
}
|
|
4221
|
+
});
|
|
4222
|
+
}
|
|
4038
4223
|
function DefaultBookingDiscount({ booking }) {
|
|
4039
|
-
if (!(
|
|
4224
|
+
if (!shouldShowBookingDiscountSection(booking)) return null;
|
|
4040
4225
|
return /* @__PURE__ */ jsxs("div", {
|
|
4041
4226
|
className: "rb-mt-6",
|
|
4042
|
-
children: [booking.discount.manualCodeEntryAllowed ? /* @__PURE__ */ jsx(
|
|
4043
|
-
surface: "theme-form",
|
|
4044
|
-
isOpen: booking.discount.isOpen,
|
|
4045
|
-
code: booking.discount.code,
|
|
4046
|
-
onOpen: () => booking.discount.setOpen(true),
|
|
4047
|
-
onChange: booking.discount.setCode,
|
|
4048
|
-
onRemove: () => {
|
|
4049
|
-
booking.discount.clear();
|
|
4050
|
-
booking.discount.setOpen(false);
|
|
4051
|
-
}
|
|
4052
|
-
}) : null, !booking.review && booking.discount.autoAppliedDiscount && booking.discount.code.trim().length === 0 ? /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
4227
|
+
children: [booking.discount.manualCodeEntryAllowed ? /* @__PURE__ */ jsx(DefaultBookingDiscountCode, { discount: booking.discount }) : null, shouldShowAutomaticDiscountNotice(booking) ? /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
4053
4228
|
tone: "info",
|
|
4054
4229
|
className: "alert alert-info rb-mt-4",
|
|
4055
4230
|
role: "status",
|
|
@@ -4058,7 +4233,7 @@ function DefaultBookingDiscount({ booking }) {
|
|
|
4058
4233
|
children: [
|
|
4059
4234
|
"Discount available:",
|
|
4060
4235
|
" ",
|
|
4061
|
-
booking.discount.autoAppliedDiscount
|
|
4236
|
+
booking.discount.autoAppliedDiscount?.publicLabel,
|
|
4062
4237
|
" will apply automatically at checkout."
|
|
4063
4238
|
]
|
|
4064
4239
|
})
|
|
@@ -4135,7 +4310,19 @@ function AppointmentDetails({ appointment, dateContext, resourceName, person })
|
|
|
4135
4310
|
dateContext
|
|
4136
4311
|
}),
|
|
4137
4312
|
appointment.resourceName ? /* @__PURE__ */ jsx("p", { children: person.withName(appointment.resourceName) }) : null,
|
|
4138
|
-
appointment.location ? /* @__PURE__ */ jsx("p", { children: appointment.location }) : null
|
|
4313
|
+
appointment.location ? /* @__PURE__ */ jsx("p", { children: appointment.location }) : null,
|
|
4314
|
+
appointment.paymentSummary?.discount ? /* @__PURE__ */ jsxs("p", { children: [
|
|
4315
|
+
"Discount code ",
|
|
4316
|
+
appointment.paymentSummary.discount.code,
|
|
4317
|
+
": ",
|
|
4318
|
+
formatCommercePrice(appointment.paymentSummary.discount.savingCents, appointment.paymentSummary.discount.currency),
|
|
4319
|
+
" off"
|
|
4320
|
+
] }) : null,
|
|
4321
|
+
appointment.paymentSummary?.kind === "pass" ? /* @__PURE__ */ jsx("p", { children: formatCreditProductPayment({
|
|
4322
|
+
name: appointment.paymentSummary.passName ?? "package",
|
|
4323
|
+
creditsUsed: appointment.paymentSummary.passCreditsUsed,
|
|
4324
|
+
creditsRemaining: appointment.paymentSummary.passCreditsRemaining
|
|
4325
|
+
}) }) : null
|
|
4139
4326
|
]
|
|
4140
4327
|
});
|
|
4141
4328
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as BookingFormClient } from "./booking-form.client-
|
|
3
|
-
import { t as BlockApiProvider } from "./context-
|
|
4
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
2
|
+
import { t as BookingFormClient } from "./booking-form.client-CKHgxvsh.mjs";
|
|
3
|
+
import { t as BlockApiProvider } from "./context-D8TpQXjX.mjs";
|
|
4
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-ChYKWjLA.mjs";
|
|
5
5
|
import { t as mountReactIsland } from "./reactMount-DFQy3CmO.mjs";
|
|
6
|
-
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-
|
|
6
|
+
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-CcGWvyht.mjs";
|
|
7
7
|
import "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
//#region src/rendering/islands/enhancers/bookingForm.tsx
|
package/dist/client/bookings.mjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { $ as
|
|
3
|
-
import { a as useHeadlessBookingFlow, i as HeadlessBookingProvider$1, o as createBookingBlockApiConfig, r as HeadlessBookingPaymentSelectionStep$1, s as getAppointmentBookingOverrideInput, t as BookingFormClient$1 } from "./booking-form.client-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
7
|
-
import { n as EventRegistrationPayment, r as useEventRegistrationWizard } from "./EventRegistrationPayment-Dn9TpWyL.mjs";
|
|
2
|
+
import { $ as resolveEventRegistrationSubmitPlan, Di as normalizeBookingFormConfig, Ka as normalizeEventRegistrationPageSurfaceSubject, Oi as normalizeBookingServices, Pa as createHostedBlockApiConfig, Q as normalizeEventRegistrationMaxTickets, Sr as resolveRegistrationDisplay, X as deriveEventRegistrationSteps, et as resolveHeadlessEventRegistrationStatus, hi as resolveRuntimeEventDestination, ir as getSingleSelectedPricingOptionId, ja as readRuntimeNow, nt as toHeadlessPaymentSelection, ra as BOOKING_FORM_DATA_RESERVED_KEY_VALUES, rt as toInternalPaymentSelection, tt as resolveHeadlessEventRegistrationView } from "./display-DMqotaGU.mjs";
|
|
3
|
+
import { a as useHeadlessBookingFlow, i as HeadlessBookingProvider$1, o as createBookingBlockApiConfig, r as HeadlessBookingPaymentSelectionStep$1, s as getAppointmentBookingOverrideInput, t as BookingFormClient$1 } from "./booking-form.client-CKHgxvsh.mjs";
|
|
4
|
+
import { n as assertNever, q as publicEventSchema } from "./noop-DF8_EiFt.mjs";
|
|
5
|
+
import { n as useBlockApi, t as BlockApiProvider } from "./context-D8TpQXjX.mjs";
|
|
6
|
+
import { n as EventRegistrationPayment, r as useEventRegistrationWizard } from "./EventRegistrationPayment-BMmPDmSf.mjs";
|
|
8
7
|
import * as React$1 from "react";
|
|
9
8
|
import React, { useCallback, useEffect, useMemo, useReducer } from "react";
|
|
10
9
|
//#region ../blocks/src/system/runtime/nodes/event-registration/event-registration.headless.override.ts
|
|
@@ -171,14 +170,7 @@ function useEventRegistrationControllerWithDeps(options, deps) {
|
|
|
171
170
|
shake: wizard.guestSectionShake
|
|
172
171
|
},
|
|
173
172
|
payment,
|
|
174
|
-
discount:
|
|
175
|
-
code: wizard.discountCode,
|
|
176
|
-
isOpen: wizard.discountUiOpen,
|
|
177
|
-
available: wizard.discountsAvailable,
|
|
178
|
-
manualCodeEntryAllowed: wizard.manualCodeEntryAllowed,
|
|
179
|
-
loading: wizard.discountsAvailableLoading,
|
|
180
|
-
autoAppliedDiscount: wizard.autoAppliedDiscount
|
|
181
|
-
},
|
|
173
|
+
discount: projectRegistrationDiscount(wizard),
|
|
182
174
|
portalAuth: {
|
|
183
175
|
state: wizard.portalAuthState,
|
|
184
176
|
profile: wizard.portalProfile,
|
|
@@ -204,6 +196,9 @@ function useEventRegistrationControllerWithDeps(options, deps) {
|
|
|
204
196
|
selectPayment,
|
|
205
197
|
setDiscountCode: wizard.setDiscountCode,
|
|
206
198
|
setDiscountOpen: wizard.setDiscountUiOpen,
|
|
199
|
+
applyDiscountCode: async () => {
|
|
200
|
+
await wizard.combinationCodeField?.apply();
|
|
201
|
+
},
|
|
207
202
|
requestLogin: () => wizard.setShowMagicLinkModal(true),
|
|
208
203
|
logout: wizard.handleLogout,
|
|
209
204
|
next,
|
|
@@ -289,7 +284,7 @@ function useEventRegistrationNext(wizard, submit) {
|
|
|
289
284
|
function useEventRegistrationBack(wizard) {
|
|
290
285
|
return useCallback(() => {
|
|
291
286
|
if (wizard.paymentController.state.kind !== "idle") {
|
|
292
|
-
wizard.paymentController.
|
|
287
|
+
wizard.paymentController.check();
|
|
293
288
|
return;
|
|
294
289
|
}
|
|
295
290
|
switch (wizard.step) {
|
|
@@ -375,6 +370,18 @@ function resolvePaymentModel(wizard, directPaymentOptions) {
|
|
|
375
370
|
eligibilityError: wizard.eligibilityError
|
|
376
371
|
};
|
|
377
372
|
}
|
|
373
|
+
function projectRegistrationDiscount(wizard) {
|
|
374
|
+
return {
|
|
375
|
+
code: wizard.discountCode,
|
|
376
|
+
isOpen: wizard.discountUiOpen,
|
|
377
|
+
available: wizard.discountsAvailable,
|
|
378
|
+
manualCodeEntryAllowed: wizard.manualCodeEntryAllowed,
|
|
379
|
+
loading: wizard.discountsAvailableLoading,
|
|
380
|
+
autoAppliedDiscount: wizard.autoAppliedDiscount,
|
|
381
|
+
applying: wizard.combinationCodeField?.applying ?? false,
|
|
382
|
+
feedback: wizard.combinationCodeField?.feedback ?? null
|
|
383
|
+
};
|
|
384
|
+
}
|
|
378
385
|
function projectRegistrationAttendee(wizard) {
|
|
379
386
|
return {
|
|
380
387
|
values: wizard.formData,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { Wr as asPartialObject } from "./display-DMqotaGU.mjs";
|
|
3
|
+
import { an as cardVariantRoleValues, en as boxBackgroundOverlaySchema, nn as runtimeBoxBackgroundSchema, on as itemRoleValues, rn as boxlessCardVariantValue, sn as openCardRoleValue, tn as boxBackgroundSchema } from "./lookSurfaces-BDZLALxj.mjs";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
z.enum(itemRoleValues);
|
|
5
6
|
z.enum(cardVariantRoleValues);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
2
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-ChYKWjLA.mjs";
|
|
3
3
|
import { i as carouselRegionAttributes } from "./carousel.shared-BFQ3kBEw.mjs";
|
|
4
4
|
import { t as CarouselNodeClient } from "./carousel.client-h65clfUO.mjs";
|
|
5
5
|
import { t as mountReactIsland } from "./reactMount-DFQy3CmO.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
3
|
-
import { t as CartClient } from "./cart.client-
|
|
4
|
-
import { t as mountShopBlockIsland } from "./shopShared-
|
|
2
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-ChYKWjLA.mjs";
|
|
3
|
+
import { t as CartClient } from "./cart.client-IfJE1zAp.mjs";
|
|
4
|
+
import { t as mountShopBlockIsland } from "./shopShared-DwVAuGsx.mjs";
|
|
5
5
|
//#region src/rendering/islands/enhancers/cart.tsx
|
|
6
6
|
const decode = defineIslandPropsDecoder("cart");
|
|
7
7
|
const enhance = (root, props) => mountShopBlockIsland(root, props, CartClient, "cart");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as CartController } from "./shop-commerce-
|
|
2
|
+
import { t as CartController } from "./shop-commerce-aQqcDmyZ.mjs";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region ../blocks/src/system/runtime/nodes/cart.client.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
3
|
-
import { t as CheckoutClient } from "./checkout.client-
|
|
4
|
-
import { t as mountShopBlockIsland } from "./shopShared-
|
|
2
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-ChYKWjLA.mjs";
|
|
3
|
+
import { t as CheckoutClient } from "./checkout.client-Tg9lfeYf.mjs";
|
|
4
|
+
import { t as mountShopBlockIsland } from "./shopShared-DwVAuGsx.mjs";
|
|
5
5
|
//#region src/rendering/islands/enhancers/checkout.tsx
|
|
6
6
|
const decode = defineIslandPropsDecoder("checkout");
|
|
7
7
|
const enhance = (root, props) => mountShopBlockIsland(root, props, CheckoutClient, "checkout");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { n as CheckoutController } from "./shop-commerce-
|
|
2
|
+
import { n as CheckoutController } from "./shop-commerce-aQqcDmyZ.mjs";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region ../blocks/src/system/runtime/nodes/checkout.client.tsx
|