@riverbankcms/sdk 0.165.0 → 0.167.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 +7 -0
- package/README.md +5 -0
- package/dist/_dts/{BlocksIslandsHydrator-CdsSMQEv.d.ts → BlocksIslandsHydrator-Dgb-ptph.d.ts} +1 -1
- package/dist/_dts/{Page-D6gp2Ipb.d.ts → Page-Bs3WxFgr.d.ts} +20 -258
- package/dist/_dts/{SdkPreviewMode-DNXAvnet.d.ts → SdkPreviewMode-DtUCsaHY.d.ts} +26 -3
- package/dist/_dts/{client-BkkExozE.d.ts → client-CwsI23pj.d.ts} +13 -1
- package/dist/_dts/{content-types-CXNAD7ef.d.ts → content-types-CAeP_-cV.d.ts} +3 -3
- package/dist/_dts/{contracts-XRXhbLWP.d.ts → contracts-BXHCiF-b.d.ts} +8 -5
- package/dist/_dts/{footerPageOutline-BP2bJYdY.d.ts → footerPageOutline-Bb2gbppW.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-DcMtbztV.d.ts → generatePageMetadata-DaBBDx7M.d.ts} +2 -2
- package/dist/_dts/{index-DKNEgSOS.d.ts → index-5_jf52sZ.d.ts} +2 -2
- package/dist/_dts/{index-CQfJhOEA.d.ts → index-C20yUyob.d.ts} +1 -1
- package/dist/_dts/{index-CRRiddNp.d.ts → index-CS6b1B-c.d.ts} +4 -4
- package/dist/_dts/{index-B4ozSzFP.d.ts → index-ChpjHK0U.d.ts} +9737 -8316
- package/dist/_dts/{index-BdkHhyf8.d.ts → index-D7EbliE3.d.ts} +1 -1
- package/dist/_dts/{index-RXkE3a7M.d.ts → index-DeHDwMfu.d.ts} +4 -3
- package/dist/_dts/{index-DAPTSmBM.d.ts → index-RugyUnqR.d.ts} +2499 -2218
- package/dist/_dts/{index-C_3kdrUb.d.ts → index-bDln38Hm.d.ts} +2 -2
- package/dist/_dts/{loadContent-B9vJMq3s.d.ts → loadContent-CTqcL7CS.d.ts} +9 -6
- package/dist/_dts/resolveBlockData-C3s9WMPs.d.ts +136 -0
- package/dist/_dts/{resolvePageContent-DIQyYUi-.d.ts → resolvePageContent-JPwgRxwh.d.ts} +3 -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 +9 -6
- 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 +20 -0
- package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +2 -0
- package/dist/_dts/sdk/src/data/types.d.ts +54 -0
- 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 +6 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
- package/dist/_dts/sdk/src/next/index.d.ts +9 -8
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +36 -48
- package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +2 -0
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +3 -0
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +260 -0
- package/dist/_dts/sdk/src/rendering/index.d.ts +8 -7
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +3 -3
- package/dist/_dts/{themeAdmission-D_qtGYAT.d.ts → sdk/src/rendering/themeAdmission.d.ts} +3 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
- package/dist/_dts/sdk/src/server.d.ts +7 -5
- package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/{types-BDF73NzM.d.ts → types-BlaCuPLr.d.ts} +2 -2
- package/dist/_dts/{types-Cl0nP6al.d.ts → types-CwtTcaQP.d.ts} +3 -3
- package/dist/_dts/{types-mstFvhK4.d.ts → types-D-WElMCy.d.ts} +8 -7
- package/dist/_dts/{validation-DVWqSvjK.d.ts → validation-Y5wD9fGK.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-CzKpH9Pm.mjs → BlocksIslandsHydrator-DFqkx158.mjs} +31 -24
- package/dist/client/{BookingMailingListNote-rUqsBN7L.mjs → BookingMailingListNote-CCVXX1LN.mjs} +2 -2
- package/dist/client/{CalendarNavigationChevron-YGzw2IPB.mjs → CalendarNavigationChevron-DQwJ7BPx.mjs} +167 -18
- package/dist/client/{CheckboxChoice-DlTC4J2a.mjs → CheckboxChoice-CZ-anOqV.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-D2LyS_Bi.mjs → DemoBookingPortalAccess-DdkY86qI.mjs} +6 -6
- package/dist/client/{DemoPortalSignInLink-BaFg2Uit.mjs → DemoPortalSignInLink-B9YrzZt2.mjs} +1 -1
- package/dist/client/{EventCalendar.client-tRrhPscX.mjs → EventCalendar.client-DAeQPV76.mjs} +11 -30
- package/dist/client/{EventCombined.client-6cfAVtnZ.mjs → EventCombined.client-Bus9R0bj.mjs} +137 -61
- package/dist/client/{EventEmbeddedCheckoutStep-CDNUpI0S.mjs → EventEmbeddedCheckoutStep-D_14yqAU.mjs} +27 -2
- package/dist/client/{EventItem-dILw2PN_.mjs → EventItem-DPBLjGwj.mjs} +75 -13
- package/dist/client/{EventListWeekNavigation-ClgLtjNY.mjs → EventListWeekNavigation-D6cwU82_.mjs} +1 -1
- package/dist/client/{EventListing.client-BNueAHmU.mjs → EventListing.client-Bogi_SnJ.mjs} +3 -3
- package/dist/client/{EventListing.view-DtVbKVkt.mjs → EventListing.view-CEumpN7i.mjs} +35 -51
- package/dist/client/{EventRegistrationPayment-CzkG0NSJ.mjs → EventRegistrationPayment-CIQw6vNy.mjs} +113 -11
- package/dist/client/{LocationMapActions-zWQsJhE5.mjs → LocationMapActions-BVO-qx4q.mjs} +2 -2
- package/dist/client/{MapDrawingSvg-D1AO_o4h.mjs → MapDrawingSvg-CcGaFawl.mjs} +22 -2
- package/dist/client/{Page-DUr2YhFR.mjs → Page-D4_H_u9V.mjs} +23892 -32266
- package/dist/client/{ProtectedSubmitButton-2fJqT_NR.mjs → ProtectedSubmitButton-8DuDw2ag.mjs} +1 -1
- package/dist/client/{StepIndicator-udNHcpOT.mjs → StepIndicator-Dptantmg.mjs} +3 -3
- package/dist/client/{TabBarFragment-C_kt-PXh.mjs → TabBarFragment-BxEGsKUx.mjs} +19 -19
- package/dist/client/{ThemedButton-Cfbo1bfh.mjs → ThemedButton-8jUc02mZ.mjs} +64 -2
- package/dist/client/{accordion-3CYNWzTS.mjs → accordion--EUHmEGa.mjs} +1 -1
- package/dist/client/{booking-form.client-BSbWgLyx.mjs → booking-form.client-BCXwOnhc.mjs} +19 -14
- package/dist/client/{bookingForm-2MoFBWSt.mjs → bookingForm-sHHcdism.mjs} +4 -4
- package/dist/client/bookings.mjs +6 -6
- package/dist/client/{carousel-Cu5mcpO-.mjs → carousel-Cp9xPBFZ.mjs} +2 -2
- package/dist/client/{carousel.client-CQLV8_Al.mjs → carousel.client-BO7sCEpH.mjs} +1 -1
- package/dist/client/{cart-CDc6x9cR.mjs → cart-CCZZC-Lq.mjs} +3 -3
- package/dist/client/{cart.client-BWS2r5Ef.mjs → cart.client-B7JfA19I.mjs} +1 -1
- package/dist/client/{checkout-CkxPqSwD.mjs → checkout-CipmYL4A.mjs} +3 -3
- package/dist/client/{checkout.client-DJfomKQc.mjs → checkout.client-DraalWdH.mjs} +1 -1
- package/dist/client/client.mjs +9550 -17
- package/dist/client/{context-CBV21-9L.mjs → context-Cv3QHjAF.mjs} +11 -6
- package/dist/client/{cta-Bw-al3cs.mjs → cta-P2vJVTEn.mjs} +45 -28
- package/dist/client/{dateFormatting-CFIUJ4Uf.mjs → dateFormatting-D8D47VT4.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-D0veHJyi.mjs → demoPortalMagicLink-CXWZoV-d.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-CEqqq92r.mjs → enhanceHeaderSection-BkAro1DJ.mjs} +4 -4
- package/dist/client/{event-details.client-Bk2kQ7ax.mjs → event-details.client-dLmyuPap.mjs} +2 -2
- package/dist/client/{event-registration.client-QMqtIywj.mjs → event-registration.client-BEhC2_-Y.mjs} +34 -20
- package/dist/client/{eventCalendar-BTDTMosr.mjs → eventCalendar-FBMS2Cpb.mjs} +4 -4
- package/dist/client/{eventCombined-BC7a709c.mjs → eventCombined-BrBhUvGe.mjs} +4 -4
- package/dist/client/{eventDetails-DL08GpUc.mjs → eventDetails-C7WUrbZ2.mjs} +2 -2
- package/dist/client/{eventListing-BfzuEQp_.mjs → eventListing-Bih-BgQM.mjs} +4 -4
- package/dist/client/{eventRegistration-Lfyzh1Ab.mjs → eventRegistration-DfTlqGbl.mjs} +4 -4
- package/dist/client/{form-L-xZOBUS.mjs → form-Bw1uuiUs.mjs} +3 -3
- package/dist/client/{form.client-BtpK3TZW.mjs → form.client-pZ-9gN33.mjs} +5 -5
- package/dist/client/{form.parts-Djos5Un4.mjs → form.parts-PXlu6XQO.mjs} +3 -3
- package/dist/client/{formatDate-DGmrm7YB.mjs → formatDate-DI3DP48e.mjs} +1 -1
- package/dist/client/gifting/client.mjs +3 -4
- package/dist/client/{headerSection-f16OGkz-.mjs → headerSection-BpJYUMd6.mjs} +2 -2
- package/dist/client/{mediaAssets-DHAmrVIi.mjs → mediaAssets-DpPauppt.mjs} +1 -1
- package/dist/client/{mediaContext-CwT6ZOm7.mjs → mediaContext-BLo4NtjP.mjs} +25 -19
- package/dist/client/{newsletter-form.client-DpHNZc7k.mjs → newsletter-form.client-CSoP0cGR.mjs} +6 -6
- package/dist/client/{newsletter-form.parts-CLGH20PL.mjs → newsletter-form.parts-DDbX_Sj0.mjs} +2 -2
- package/dist/client/{newsletterForm-BEU0Ocu9.mjs → newsletterForm-vCxYRar_.mjs} +3 -3
- package/dist/client/{noop-CQU7tiMg.mjs → noop-ByVtIWf4.mjs} +420 -170
- package/dist/client/portal/client.mjs +13 -14
- package/dist/client/{product-detail.client-Be-om1BT.mjs → product-detail.client-7Pi6avM-.mjs} +1 -1
- package/dist/client/{product-list.client-DR7hD5Vs.mjs → product-list.client-DEad-Pma.mjs} +1 -1
- package/dist/client/{productDetail-BD42UOmG.mjs → productDetail-G1SMXG13.mjs} +3 -3
- package/dist/client/{productList-CSk8sXCl.mjs → productList-B21TGdpT.mjs} +3 -3
- package/dist/client/{propsDecoder-C_Y6VYnF.mjs → propsDecoder-B3vIBkex.mjs} +4 -5
- package/dist/client/{registry.server-CIKtTsCl.mjs → registry.server-B8aQhJpO.mjs} +399 -473
- package/dist/client/rendering/client.mjs +29 -28
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +70 -8
- package/dist/client/{richText-coerce-spWtx86G.mjs → richText-coerce-DHkBtO0G.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-CROHPlYS.mjs → routeIslandApiConfig-DbHX4JOS.mjs} +1 -1
- package/dist/client/{shop-commerce-CDUohm_2.mjs → shop-commerce-B2UmrQg_.mjs} +12 -12
- package/dist/client/{shop-commerce-store-B9nw4lRP.mjs → shop-commerce-store-B7n-Z7nY.mjs} +1 -1
- package/dist/client/{shop-DscvMz86.mjs → shop-mqyoOvOK.mjs} +3 -3
- package/dist/client/{shop.client-M3kNsVPi.mjs → shop.client-BH-BBnA9.mjs} +13 -13
- package/dist/client/{shop.interactive-BGmkdIAZ.mjs → shop.interactive-mdM3UMWG.mjs} +74 -36
- package/dist/client/{shopShared-BdWp6LHa.mjs → shopShared-CXF5wxdg.mjs} +2 -2
- package/dist/client/site-styles-CMCUxsIM.mjs +3 -0
- package/dist/{preview-next/client/ThemedButton-Dc6aJ34Z.mjs → client/site-styles-D56hT2u1.mjs} +26000 -16565
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/src-DjnxOjXG.mjs +217 -0
- package/dist/client/surfaceTransportMarker-BXepAVF6.mjs +152 -0
- package/dist/client/{timetableModel-Dynh5-j4.mjs → timetableModel-CrC80EOG.mjs} +13 -140
- package/dist/client/types-sF-IrGQr.mjs +633 -0
- package/dist/client/{useAvailableSlots-Cw9paRPY.mjs → useAvailableSlots-C4LOaI_Z.mjs} +8 -5
- package/dist/client/{useBookingNowIso-C9SF2rC6.mjs → useBookingNowIso-BDmWkYUW.mjs} +1 -1
- package/dist/client/{useDiscountApply-B-QJfBg0.mjs → useDiscountApply-6Q0nToVA.mjs} +3 -3
- package/dist/client/{useDiscountCodeUi-Uvum8q9d.mjs → useDiscountCodeUi-CM-DTX5X.mjs} +1 -1
- package/dist/client/{useEventPagination-BfM3xk6j.mjs → useEventPagination-Bcs89BR5.mjs} +9 -9
- package/dist/client/{view-DlkCDfuN.mjs → view-BN-fxyfq.mjs} +287 -232
- package/dist/client/{view-DXOuduIr.mjs → view-Dh2tGoS0.mjs} +4 -4
- package/dist/client/{wizardSteps-DManVJpc.mjs → wizardSteps-DtkhwKXK.mjs} +468 -149
- package/dist/preview-next/before-render.mjs +3 -140
- package/dist/preview-next/client/ArrangementLookControls-D4VjPs-r.mjs +31197 -0
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-Die6Y25O.mjs → EventEmbeddedCheckoutStep-C_h1cMYm.mjs} +33 -4
- package/dist/preview-next/client/{LocationPickerEnvironment-Bp4BHLCL.mjs → LocationPickerEnvironment-D56RD3e_.mjs} +1 -1
- package/dist/preview-next/client/{MapLibreEditMap-Cb0JhM9p.mjs → MapLibreEditMap-DFnyCckr.mjs} +2 -2
- package/dist/preview-next/client/PreviewEditorSidebar-Ckr2zk_L.mjs +37247 -0
- package/dist/preview-next/client/{PreviewEditorUI-CxwlLBGw.mjs → PreviewEditorUI-KOZgw_gS.mjs} +45 -17
- package/dist/preview-next/client/PreviewShell-CyO2V4kB.mjs +4757 -0
- package/dist/preview-next/client/SdkPreviewModeRuntime-DW3uKvNF.mjs +4258 -0
- package/dist/preview-next/client/SiteChromeCustomizeButton-CU9VD-7O.mjs +72202 -0
- package/dist/preview-next/client/ThemedButton-C0dgGJ5k.mjs +2006 -0
- package/dist/preview-next/client/{lucide-react-CqxuVAyz.mjs → lucide-react-CPBCf6QT.mjs} +15 -2
- package/dist/preview-next/client/previewAssistantSlot-DBi-WybM.mjs +112193 -0
- package/dist/preview-next/client/{previewChromeSurface-yuwnDP3B.mjs → previewChromeSurface-BhkUJst9.mjs} +90 -28
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/sdk-runtime-BjCb6lOn.mjs +5 -0
- package/dist/preview-next/client/{editorStatusDecision-DR4BBKhy.mjs → useAutosaveStatus-CKxTaC3j.mjs} +40 -3
- package/dist/preview-next/client/useBlockCustomizeControls-B7MLTjBX.mjs +2633 -0
- package/dist/preview-next/client/useOpenBlockForSetup-BTUc0g9X.mjs +28 -0
- package/dist/preview-next/keepAlive.mjs +25 -2
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-BBAJjFIz.mjs → route-contract-Bv3nkdpV.mjs} +215 -118
- package/dist/server/{Block.shared-ClFI3qpX.mjs → Block.shared-4fMqzltx.mjs} +7 -4
- package/dist/server/{src-DsYPhTbs.mjs → ThemeScopeCore-C72VC_lR.mjs} +894 -2556
- package/dist/server/accessibleSurfaces-B_Y_dA20.mjs +2305 -0
- package/dist/server/{bindings-Bi8EoRZD.mjs → bindings-ConMYJ2U.mjs} +2 -3
- package/dist/server/{publicProducts-Bz8loTRn.mjs → client-Cot-H5fQ.mjs} +2558 -343
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +33 -2
- package/dist/server/data/dataLoaderContext.mjs +2 -0
- package/dist/server/data/resolveBlockData.mjs +2 -0
- package/dist/server/data/types.mjs +1 -0
- package/dist/server/dataLoaderContext-B3fXA54R.mjs +47 -0
- package/dist/server/identity-Bn9OQiT1.mjs +6 -0
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-dEEhQxL7.mjs → loadContent-BkaWYEwt.mjs} +6 -5
- package/dist/server/{loadPage-DBFBad8A.mjs → loadPage-kviUdH8c.mjs} +4 -2
- package/dist/server/manifest.mjs +1 -1
- package/dist/server/media-DnlczCMA.mjs +231 -0
- package/dist/server/metadata.mjs +5 -1
- package/dist/server/mode-Cv_TG9gP.mjs +63 -0
- package/dist/server/next/revalidate.mjs +9 -4
- package/dist/server/next.mjs +11 -11
- package/dist/server/opaqueSurface-BTnS09GS.mjs +54 -0
- package/dist/server/{overrideResolution-BIJbiXYc.mjs → overrideResolution-itXZCXs7.mjs} +2 -1
- package/dist/server/overrides-CD4d-1w7.mjs +177 -0
- package/dist/server/page-converter.mjs +243 -91
- package/dist/server/pageRenderPlan-CDyn7iLy.mjs +4162 -0
- package/dist/server/{themeAdmission-CSknYpxk.mjs → pageRuntimeSupport-DZ6cLxrM.mjs} +13 -28
- package/dist/server/{overrides-DhF87Vsd.mjs → pageShared-Q_Vij87H.mjs} +3808 -1928
- package/dist/server/parseThemeForPersistence-CDrF51tJ.mjs +52 -0
- package/dist/server/{prebuild-DaemmWQL.mjs → prebuild-DOG4MkOy.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/prefetchBlockData-DlprLLsc.mjs +756 -0
- package/dist/server/{registry-Cdvz1OtL.mjs → registry-BPFcpn6k.mjs} +21838 -709
- package/dist/server/rendering/components/pageShared.mjs +2 -0
- package/dist/server/rendering/helpers/loadPage.mjs +2 -0
- package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +2 -0
- package/dist/server/rendering/server.mjs +5 -4
- package/dist/server/rendering/themeAdmission.mjs +2 -0
- package/dist/server/rendering.mjs +11 -10
- package/dist/server/repeaterFields-MIz7r1ez.mjs +9 -0
- package/dist/server/{resolveBlockData-CLpAJWWf.mjs → resolveBlockData-BHvfGD4y.mjs} +6 -48
- package/dist/server/resolveButtonColourStates-OXFRGn5M.mjs +2682 -0
- package/dist/server/responseMedia-D8J3VAFs.mjs +115 -0
- package/dist/server/{richTextSchema-YYc85FX4.mjs → richTextSchema-Euhuj-7V.mjs} +26 -1
- package/dist/server/routing.mjs +1 -1
- package/dist/server/schema-DEizlyi4.mjs +2524 -0
- package/dist/server/server.mjs +3 -3
- package/dist/server/theme-bridge.mjs +1031 -1
- package/dist/server/theme.mjs +2 -1
- package/dist/server/themeAdmission-DGSAlFUK.mjs +18 -0
- package/dist/server/{three-pass-converter-Chnb1XD-.mjs → three-pass-converter-_j2UE2tR.mjs} +1 -1
- package/dist/server/validation-CDd6m8Ry.mjs +140 -0
- package/dist/server/{validation-DYxhLzqQ.mjs → validation-bl6WcAi_.mjs} +419 -3
- package/dist/server/{version-Beu4q-Gv.mjs → version-BLXZ31S-.mjs} +1 -1
- package/dist/styles/index.css +710 -29
- package/package.json +39 -1
- package/dist/client/events-BmqPeeQm.mjs +0 -20
- package/dist/client/purchase-BV5xfaZH.mjs +0 -894
- package/dist/client/schema-BdSglH2X.mjs +0 -16084
- package/dist/client/site-styles-CWHmlVT5.mjs +0 -14503
- package/dist/client/src-VIsPY-kw.mjs +0 -62
- package/dist/preview-next/client/PreviewEditorSidebar-DEP3xD9K.mjs +0 -5810
- package/dist/preview-next/client/SdkPreviewModeRuntime-Cpe-XP8e.mjs +0 -3
- package/dist/preview-next/client/SdkPreviewModeRuntime-QDkMPASV.mjs +0 -8059
- package/dist/preview-next/client/SiteChromeCustomizeButton-1JaoGOKX.mjs +0 -9367
- package/dist/preview-next/client/previewSidebarNavigation-AXUj9-qQ.mjs +0 -224683
- package/dist/preview-next/client/result-BjJUoxUF.mjs +0 -16
- package/dist/preview-next/client/sdk-runtime-O-eA9-rV.mjs +0 -4
- package/dist/preview-next/refresh-contract-uQ6BXgLJ.mjs +0 -25
- package/dist/server/bindings-Dgt_0goJ.mjs +0 -17
- package/dist/server/client-DfMDbZ41.mjs +0 -2330
- package/dist/server/effectiveNavLinkStyle-BHIYPVG1.mjs +0 -13713
- package/dist/server/loadPage-CnVB-aeL.mjs +0 -2
- package/dist/server/prefetchBlockData-FwcsT5H2.mjs +0 -4359
- package/dist/server/schema-uSA_x1Zh.mjs +0 -16311
- package/dist/server/site-styles-CntHn2KI.mjs +0 -793
- package/dist/server/siteChromeOverlayClearance-DqP40Ka0.mjs +0 -802
|
@@ -1,894 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { Nr as err, Pr as ok } from "./schema-BdSglH2X.mjs";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
//#region ../core/src/date-math.ts
|
|
5
|
-
function addDaysToDate(date, dayCount) {
|
|
6
|
-
const next = new Date(date);
|
|
7
|
-
next.setUTCDate(next.getUTCDate() + dayCount);
|
|
8
|
-
return next;
|
|
9
|
-
}
|
|
10
|
-
function addDaysToIso(isoString, dayCount) {
|
|
11
|
-
const date = new Date(isoString);
|
|
12
|
-
if (!Number.isFinite(date.getTime())) return isoString;
|
|
13
|
-
return addDaysToDate(date, dayCount).toISOString();
|
|
14
|
-
}
|
|
15
|
-
function subtractDaysFromIso(isoString, dayCount) {
|
|
16
|
-
return addDaysToIso(isoString, -dayCount);
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region ../core/src/currency-format.ts
|
|
20
|
-
const CURRENCY_CODE_INPUT_PATTERN = /^[A-Za-z]{3}$/;
|
|
21
|
-
/** Parse + normalize a currency code, or return null if it isn't a 3-letter code. */
|
|
22
|
-
function parseCurrencyCode(value) {
|
|
23
|
-
return CURRENCY_CODE_INPUT_PATTERN.test(value) ? value.toUpperCase() : null;
|
|
24
|
-
}
|
|
25
|
-
const CURRENCY_LOCALE_BY_CODE = {
|
|
26
|
-
USD: "en-US",
|
|
27
|
-
GBP: "en-GB",
|
|
28
|
-
EUR: "de-DE",
|
|
29
|
-
AUD: "en-AU",
|
|
30
|
-
CAD: "en-CA",
|
|
31
|
-
NZD: "en-NZ",
|
|
32
|
-
JPY: "ja-JP",
|
|
33
|
-
CNY: "zh-CN",
|
|
34
|
-
CHF: "de-CH"
|
|
35
|
-
};
|
|
36
|
-
function resolveCurrencyLocale(currencyCode, override) {
|
|
37
|
-
return override ?? CURRENCY_LOCALE_BY_CODE[currencyCode] ?? "en";
|
|
38
|
-
}
|
|
39
|
-
function fractionDigitsFor(decimals, exactFormatter, amount) {
|
|
40
|
-
switch (decimals) {
|
|
41
|
-
case "exact": return {};
|
|
42
|
-
case "auto": return exactFormatter.formatToParts(amount).find((part) => part.type === "fraction")?.value === exactFormatter.formatToParts(0).find((part) => part.type === "fraction")?.value ? {
|
|
43
|
-
minimumFractionDigits: 0,
|
|
44
|
-
maximumFractionDigits: exactFormatter.resolvedOptions().maximumFractionDigits
|
|
45
|
-
} : {};
|
|
46
|
-
case "whole": return {
|
|
47
|
-
minimumFractionDigits: 0,
|
|
48
|
-
maximumFractionDigits: 0
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* The single currency-amount formatter for the product: minor units in,
|
|
54
|
-
* localized string out.
|
|
55
|
-
*
|
|
56
|
-
* The locale is derived from the currency by default, so output is deterministic
|
|
57
|
-
* across server and client (no SSR/hydration mismatch). All other money
|
|
58
|
-
* formatters in the codebase should delegate here rather than constructing their
|
|
59
|
-
* own `Intl.NumberFormat`.
|
|
60
|
-
*/
|
|
61
|
-
function formatCurrencyAmount(amountCents, currency, options) {
|
|
62
|
-
return formatCurrencyMajorUnits(amountCents / 100, currency, options);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* `formatCurrencyAmount` for an amount already in MAJOR units (29.99 = £29.99),
|
|
66
|
-
* such as a registrar price. Prefer minor units everywhere else.
|
|
67
|
-
*/
|
|
68
|
-
function formatCurrencyMajorUnits(amount, currency, options) {
|
|
69
|
-
const currencyCode = currency.toUpperCase();
|
|
70
|
-
const locale = resolveCurrencyLocale(currencyCode, options?.locale);
|
|
71
|
-
try {
|
|
72
|
-
const exactFormatter = new Intl.NumberFormat(locale, {
|
|
73
|
-
style: "currency",
|
|
74
|
-
currency: currencyCode
|
|
75
|
-
});
|
|
76
|
-
return new Intl.NumberFormat(locale, {
|
|
77
|
-
style: "currency",
|
|
78
|
-
currency: currencyCode,
|
|
79
|
-
...fractionDigitsFor(options?.decimals ?? "exact", exactFormatter, amount)
|
|
80
|
-
}).format(amount);
|
|
81
|
-
} catch {
|
|
82
|
-
return `${amount.toFixed(2)} ${currencyCode}`;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
/** Gift-card copy retains pence only when the amount has a fractional part. */
|
|
86
|
-
function formatGiftCardAmountLabel(amountCents, currency = "GBP") {
|
|
87
|
-
return formatCurrencyAmount(amountCents, currency, {
|
|
88
|
-
locale: "en-GB",
|
|
89
|
-
decimals: amountCents % 100 === 0 ? "whole" : "exact"
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
//#endregion
|
|
93
|
-
//#region ../core/src/money-input.ts
|
|
94
|
-
function unsafeAsCents(value) {
|
|
95
|
-
return value;
|
|
96
|
-
}
|
|
97
|
-
function unsafeAsNonNegativeCents(value) {
|
|
98
|
-
return value;
|
|
99
|
-
}
|
|
100
|
-
function unsafeAsPositiveCents(value) {
|
|
101
|
-
return value;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Normalizes a derived amount to non-negative whole cents. This intentionally
|
|
105
|
-
* clamps negatives to zero; use parseNonNegativeCents for validation.
|
|
106
|
-
*/
|
|
107
|
-
function toNonNegativeCents(value) {
|
|
108
|
-
return unsafeAsNonNegativeCents(Math.max(0, Math.trunc(value)));
|
|
109
|
-
}
|
|
110
|
-
function parseCents(value) {
|
|
111
|
-
if (!Number.isFinite(value)) return err({ kind: "invalid-number" });
|
|
112
|
-
if (!Number.isInteger(value)) return err({ kind: "not-whole-cents" });
|
|
113
|
-
return ok(unsafeAsCents(value));
|
|
114
|
-
}
|
|
115
|
-
function parseNonNegativeCents(value) {
|
|
116
|
-
const parsed = parseCents(value);
|
|
117
|
-
if (!parsed.ok) return parsed;
|
|
118
|
-
if (parsed.value < 0) return err({ kind: "negative" });
|
|
119
|
-
return ok(unsafeAsNonNegativeCents(parsed.value));
|
|
120
|
-
}
|
|
121
|
-
function parsePositiveCents(value) {
|
|
122
|
-
const parsed = parseNonNegativeCents(value);
|
|
123
|
-
if (!parsed.ok) return parsed;
|
|
124
|
-
if (parsed.value === 0) return err({ kind: "zero-not-allowed" });
|
|
125
|
-
return ok(unsafeAsPositiveCents(parsed.value));
|
|
126
|
-
}
|
|
127
|
-
function normalizeMoneyInput(value, options) {
|
|
128
|
-
return (options.stripFormatting === true ? value.replace(/[^0-9.-]/g, "") : value).trim();
|
|
129
|
-
}
|
|
130
|
-
function parseFiniteMoneyAmount(value, options) {
|
|
131
|
-
const normalized = normalizeMoneyInput(value, options);
|
|
132
|
-
if (normalized.length === 0) return err({ kind: "empty" });
|
|
133
|
-
const amount = Number(normalized);
|
|
134
|
-
if (!Number.isFinite(amount)) return err({ kind: "invalid-number" });
|
|
135
|
-
return ok(amount);
|
|
136
|
-
}
|
|
137
|
-
function roundMoneyAmountToCents(amount) {
|
|
138
|
-
return Math.round(amount * 100);
|
|
139
|
-
}
|
|
140
|
-
function parsePositiveMoneyInputToCents(value, options = {}) {
|
|
141
|
-
const parsed = parseFiniteMoneyAmount(value, options);
|
|
142
|
-
if (!parsed.ok) return parsed;
|
|
143
|
-
if (parsed.value < 0) return err({ kind: "negative" });
|
|
144
|
-
const amountCents = roundMoneyAmountToCents(parsed.value);
|
|
145
|
-
if (amountCents <= 0) return err({ kind: "zero-not-allowed" });
|
|
146
|
-
return ok(unsafeAsPositiveCents(amountCents));
|
|
147
|
-
}
|
|
148
|
-
//#endregion
|
|
149
|
-
//#region ../core/src/booking-flexible-balance.ts
|
|
150
|
-
function clampFlexibleBalanceConfiguredAmount(amountCents, totalAmountCents) {
|
|
151
|
-
return Math.max(0, Math.min(amountCents, totalAmountCents));
|
|
152
|
-
}
|
|
153
|
-
function resolveFlexibleBalanceInitialPaymentCents(input) {
|
|
154
|
-
return clampFlexibleBalanceConfiguredAmount(input.config.upfrontAmountCents, input.totalAmountCents);
|
|
155
|
-
}
|
|
156
|
-
function resolveFlexibleBalanceDueAt(input) {
|
|
157
|
-
switch (input.dueDateRule.kind) {
|
|
158
|
-
case "relative_to_start_date": return subtractDaysFromIso(input.bookingStartAt, input.dueDateRule.daysBeforeStart);
|
|
159
|
-
case "fixed_calendar_date": return input.dueDateRule.dueAt;
|
|
160
|
-
default: return assertNever$2(input.dueDateRule);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
function calculateFlexibleBalanceMinimumPaymentCents(input) {
|
|
164
|
-
if (input.remainingBalanceCents <= 0) return 0;
|
|
165
|
-
const minimumPercentageBps = input.minimumPercentageBps ?? 1e3;
|
|
166
|
-
const percentageFloor = Math.ceil(input.remainingBalanceCents * minimumPercentageBps / 1e4);
|
|
167
|
-
return Math.min(input.remainingBalanceCents, Math.max(input.stripeMinimumChargeCents, percentageFloor));
|
|
168
|
-
}
|
|
169
|
-
function resolveFlexibleBalancePaymentEligibility(input) {
|
|
170
|
-
if (input.remainingBalanceCents <= 0 || input.status === "completed") return {
|
|
171
|
-
kind: "unavailable",
|
|
172
|
-
reason: "already_settled"
|
|
173
|
-
};
|
|
174
|
-
switch (input.status) {
|
|
175
|
-
case "payment_pending":
|
|
176
|
-
case "cancelled_due_to_non_payment":
|
|
177
|
-
case "refunded":
|
|
178
|
-
case "waived": return {
|
|
179
|
-
kind: "unavailable",
|
|
180
|
-
reason: input.status
|
|
181
|
-
};
|
|
182
|
-
case "closed_order_failed": return {
|
|
183
|
-
kind: "unavailable",
|
|
184
|
-
reason: "order_failed"
|
|
185
|
-
};
|
|
186
|
-
case "overdue": return {
|
|
187
|
-
kind: "full_balance_only",
|
|
188
|
-
remainingBalanceCents: input.remainingBalanceCents,
|
|
189
|
-
reason: "overdue"
|
|
190
|
-
};
|
|
191
|
-
case "active": {
|
|
192
|
-
const minimumAmountCents = calculateFlexibleBalanceMinimumPaymentCents({
|
|
193
|
-
remainingBalanceCents: input.remainingBalanceCents,
|
|
194
|
-
stripeMinimumChargeCents: input.stripeMinimumChargeCents,
|
|
195
|
-
minimumPercentageBps: input.minimumPercentageBps
|
|
196
|
-
});
|
|
197
|
-
if (minimumAmountCents >= input.remainingBalanceCents) return {
|
|
198
|
-
kind: "full_balance_only",
|
|
199
|
-
remainingBalanceCents: input.remainingBalanceCents,
|
|
200
|
-
reason: "dust_balance"
|
|
201
|
-
};
|
|
202
|
-
return {
|
|
203
|
-
kind: "eligible",
|
|
204
|
-
minimumAmountCents,
|
|
205
|
-
maximumCustomAmountCents: input.remainingBalanceCents,
|
|
206
|
-
suggestedPayFullAmountCents: input.remainingBalanceCents
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
default: return assertNever$2(input.status);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
function assertNever$2(value) {
|
|
213
|
-
throw new Error(`Unexpected value: ${String(value)}`);
|
|
214
|
-
}
|
|
215
|
-
//#endregion
|
|
216
|
-
//#region ../core/src/booking-instalments.ts
|
|
217
|
-
function isDepositBearingBookingInstalmentPlan(plan) {
|
|
218
|
-
switch (plan.kind) {
|
|
219
|
-
case "deposit_plus_one_remainder":
|
|
220
|
-
case "deposit_plus_scheduled_instalments": return true;
|
|
221
|
-
case "equal_scheduled_instalments": return false;
|
|
222
|
-
default: return assertNever$1(plan);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
function getBookingInstalmentDepositRefundability(plan) {
|
|
226
|
-
return isDepositBearingBookingInstalmentPlan(plan) ? plan.depositRefundability : null;
|
|
227
|
-
}
|
|
228
|
-
function clampConfiguredAmount(amountCents, totalAmountCents) {
|
|
229
|
-
return Math.max(0, Math.min(amountCents, totalAmountCents));
|
|
230
|
-
}
|
|
231
|
-
function splitAmountWithRemainderInFirst(totalAmountCents, partCount) {
|
|
232
|
-
if (partCount <= 0) return [];
|
|
233
|
-
const baseAmountCents = Math.floor(totalAmountCents / partCount);
|
|
234
|
-
const remainderCents = totalAmountCents - baseAmountCents * partCount;
|
|
235
|
-
return Array.from({ length: partCount }, (_, index) => index === 0 ? baseAmountCents + remainderCents : baseAmountCents);
|
|
236
|
-
}
|
|
237
|
-
function addIntervalPreservingMonthAnchor(isoString, intervalCount, intervalUnit) {
|
|
238
|
-
const date = new Date(isoString);
|
|
239
|
-
if (!Number.isFinite(date.getTime())) return isoString;
|
|
240
|
-
switch (intervalUnit) {
|
|
241
|
-
case "day":
|
|
242
|
-
date.setUTCDate(date.getUTCDate() + intervalCount);
|
|
243
|
-
return date.toISOString();
|
|
244
|
-
case "week":
|
|
245
|
-
date.setUTCDate(date.getUTCDate() + intervalCount * 7);
|
|
246
|
-
return date.toISOString();
|
|
247
|
-
case "month": return addMonthsPreservingAnchorDay(date, intervalCount).toISOString();
|
|
248
|
-
default: return assertNever$1(intervalUnit);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
function getBookingInstalmentPlanIntervalCount(plan) {
|
|
252
|
-
switch (plan.kind) {
|
|
253
|
-
case "deposit_plus_one_remainder": return plan.remainderDueCount;
|
|
254
|
-
case "deposit_plus_scheduled_instalments":
|
|
255
|
-
case "equal_scheduled_instalments": return plan.intervalCount;
|
|
256
|
-
default: return assertNever$1(plan);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
function omitZeroAmountFutureRows(rows) {
|
|
260
|
-
if (rows.length <= 1) return rows;
|
|
261
|
-
const firstRow = rows[0];
|
|
262
|
-
if (firstRow === void 0) return [];
|
|
263
|
-
return [firstRow, ...rows.slice(1).filter((row) => row.amountCents > 0)];
|
|
264
|
-
}
|
|
265
|
-
function formatOrderInstalmentStatusLabel(input) {
|
|
266
|
-
switch (input.status) {
|
|
267
|
-
case "pending_initial_payment": return input.phaseKind === "initial" ? "Due today" : "Scheduled";
|
|
268
|
-
case "scheduled": return "Scheduled";
|
|
269
|
-
case "paid": return input.phaseKind === "initial" ? "Paid today" : "Paid";
|
|
270
|
-
case "failed": return "Payment failed";
|
|
271
|
-
case "waived": return "Waived";
|
|
272
|
-
case "cancelled": return "Cancelled";
|
|
273
|
-
case "cancelled_as_paid_early": return "Paid early";
|
|
274
|
-
case "refunded": return "Refunded";
|
|
275
|
-
default: return assertNever$1(input.status);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
function addMonthsPreservingAnchorDay(date, intervalCount) {
|
|
279
|
-
const anchorDay = date.getUTCDate();
|
|
280
|
-
const nextMonth = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + intervalCount, 1, date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds()));
|
|
281
|
-
const lastDayOfTargetMonth = new Date(Date.UTC(nextMonth.getUTCFullYear(), nextMonth.getUTCMonth() + 1, 0)).getUTCDate();
|
|
282
|
-
nextMonth.setUTCDate(Math.min(anchorDay, lastDayOfTargetMonth));
|
|
283
|
-
return nextMonth;
|
|
284
|
-
}
|
|
285
|
-
function assertNever$1(value) {
|
|
286
|
-
throw new Error(`Unexpected value: ${String(value)}`);
|
|
287
|
-
}
|
|
288
|
-
//#endregion
|
|
289
|
-
//#region ../core/src/booking-payment-options.ts
|
|
290
|
-
/** Automatic instalments and a flexible balance cannot share one booking offer. */
|
|
291
|
-
function validateBookingPaymentOptionKinds(kinds) {
|
|
292
|
-
if (kinds.length === 0) return err("no_options");
|
|
293
|
-
const uniqueKinds = new Set(kinds);
|
|
294
|
-
if (uniqueKinds.size !== kinds.length) return err("duplicate_kind");
|
|
295
|
-
if (uniqueKinds.has("instalment_plan") && uniqueKinds.has("flexible_balance")) return err("incompatible_collection_options");
|
|
296
|
-
return ok(void 0);
|
|
297
|
-
}
|
|
298
|
-
//#endregion
|
|
299
|
-
//#region ../commerce/src/utils/assertNever.ts
|
|
300
|
-
function assertNever(value, message) {
|
|
301
|
-
if (message) throw new Error(message);
|
|
302
|
-
throw new Error(`Unexpected value: ${String(value)}`);
|
|
303
|
-
}
|
|
304
|
-
//#endregion
|
|
305
|
-
//#region ../commerce/src/purchase/bookingInstalmentSchedule.ts
|
|
306
|
-
function resolveBookingInitialInstalmentAmountCents(input) {
|
|
307
|
-
const totalAmountCents = Math.max(0, input.totalAmountCents);
|
|
308
|
-
switch (input.plan.kind) {
|
|
309
|
-
case "deposit_plus_one_remainder":
|
|
310
|
-
case "deposit_plus_scheduled_instalments": return clampConfiguredAmount(input.plan.depositAmountCents, totalAmountCents);
|
|
311
|
-
case "equal_scheduled_instalments": return splitAmountWithRemainderInFirst(totalAmountCents, input.plan.instalmentCount)[0] ?? 0;
|
|
312
|
-
default: return assertNever(input.plan);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
function buildBookingInstalmentSchedule(input) {
|
|
316
|
-
const totalAmountCents = Math.max(0, input.totalAmountCents);
|
|
317
|
-
switch (input.plan.kind) {
|
|
318
|
-
case "deposit_plus_one_remainder": {
|
|
319
|
-
const depositAmountCents = resolveBookingInitialInstalmentAmountCents(input);
|
|
320
|
-
const remainderAmountCents = Math.max(0, totalAmountCents - depositAmountCents);
|
|
321
|
-
return omitZeroAmountFutureRows([createScheduleRow({
|
|
322
|
-
sequence: 1,
|
|
323
|
-
stateAtBooking: "paid_today",
|
|
324
|
-
dueAt: input.anchorAt,
|
|
325
|
-
amountCents: depositAmountCents
|
|
326
|
-
}), createScheduleRow({
|
|
327
|
-
sequence: 2,
|
|
328
|
-
stateAtBooking: "scheduled",
|
|
329
|
-
dueAt: addIntervalPreservingMonthAnchor(input.anchorAt, input.plan.remainderDueCount, input.plan.intervalUnit),
|
|
330
|
-
amountCents: remainderAmountCents
|
|
331
|
-
})]);
|
|
332
|
-
}
|
|
333
|
-
case "deposit_plus_scheduled_instalments": {
|
|
334
|
-
const plan = input.plan;
|
|
335
|
-
const depositAmountCents = resolveBookingInitialInstalmentAmountCents(input);
|
|
336
|
-
const instalmentAmounts = splitAmountWithRemainderInFirst(Math.max(0, totalAmountCents - depositAmountCents), plan.instalmentCount);
|
|
337
|
-
return omitZeroAmountFutureRows([createScheduleRow({
|
|
338
|
-
sequence: 1,
|
|
339
|
-
stateAtBooking: "paid_today",
|
|
340
|
-
dueAt: input.anchorAt,
|
|
341
|
-
amountCents: depositAmountCents
|
|
342
|
-
}), ...instalmentAmounts.map((amountCents, index) => createScheduleRow({
|
|
343
|
-
sequence: index + 2,
|
|
344
|
-
stateAtBooking: "scheduled",
|
|
345
|
-
dueAt: addIntervalPreservingMonthAnchor(input.anchorAt, plan.intervalCount * (index + 1), plan.intervalUnit),
|
|
346
|
-
amountCents
|
|
347
|
-
}))]);
|
|
348
|
-
}
|
|
349
|
-
case "equal_scheduled_instalments": {
|
|
350
|
-
const plan = input.plan;
|
|
351
|
-
return omitZeroAmountFutureRows(splitAmountWithRemainderInFirst(totalAmountCents, plan.instalmentCount).map((amountCents, index) => createScheduleRow({
|
|
352
|
-
sequence: index + 1,
|
|
353
|
-
stateAtBooking: index === 0 ? "paid_today" : "scheduled",
|
|
354
|
-
dueAt: index === 0 ? input.anchorAt : addIntervalPreservingMonthAnchor(input.anchorAt, plan.intervalCount * index, plan.intervalUnit),
|
|
355
|
-
amountCents
|
|
356
|
-
})));
|
|
357
|
-
}
|
|
358
|
-
default: return assertNever(input.plan);
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
function createScheduleRow(input) {
|
|
362
|
-
return {
|
|
363
|
-
id: `payment-${input.sequence}`,
|
|
364
|
-
sequence: input.sequence,
|
|
365
|
-
stateAtBooking: input.stateAtBooking,
|
|
366
|
-
dueAt: input.dueAt,
|
|
367
|
-
amountCents: input.amountCents
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
/** Resolve real rows first: zero future payments do not extend the deadline. */
|
|
371
|
-
function canInstalmentPlanCompleteBefore(input) {
|
|
372
|
-
const deadline = Date.parse(input.deadline);
|
|
373
|
-
if (!Number.isFinite(Date.parse(input.now)) || !Number.isFinite(deadline)) return false;
|
|
374
|
-
return input.schedule.every((row) => Date.parse(row.dueAt) < deadline);
|
|
375
|
-
}
|
|
376
|
-
/** Later obligations are identified by their state, never their position. */
|
|
377
|
-
function getBookingLaterInstalments(schedule) {
|
|
378
|
-
return schedule.filter((row) => row.stateAtBooking === "scheduled");
|
|
379
|
-
}
|
|
380
|
-
//#endregion
|
|
381
|
-
//#region ../commerce/src/purchase/bookingPaymentSelection.ts
|
|
382
|
-
/** Identity is decided against the authoritative quote, before display repricing. */
|
|
383
|
-
function resolveAvailableBookingCollectionOptions(input) {
|
|
384
|
-
const configured = input.paymentTerms.allowedOptions;
|
|
385
|
-
if (!validateBookingPaymentOptionKinds(configured.map((option) => option.kind)).ok) return [];
|
|
386
|
-
const available = configured.filter((option) => option.kind !== "instalment_plan" || Number.isFinite(Date.parse(input.now))).map((option) => resolveBookingCollectionOptionFacts({
|
|
387
|
-
option,
|
|
388
|
-
totalCents: input.totalCents,
|
|
389
|
-
anchorAt: input.now,
|
|
390
|
-
bookingStartAt: input.bookingStartAt
|
|
391
|
-
})).filter((option) => option.kind !== "instalment_plan" || input.bookingStartAt !== null && canInstalmentPlanCompleteBefore({
|
|
392
|
-
now: input.now,
|
|
393
|
-
deadline: input.bookingStartAt,
|
|
394
|
-
schedule: option.schedule
|
|
395
|
-
}));
|
|
396
|
-
const upfront = resolveBookingCollectionOptionFacts({
|
|
397
|
-
option: { kind: "upfront" },
|
|
398
|
-
totalCents: input.totalCents,
|
|
399
|
-
anchorAt: input.now,
|
|
400
|
-
bookingStartAt: input.bookingStartAt
|
|
401
|
-
});
|
|
402
|
-
const collapsed = available.map((option) => isBookingCollectionEquivalentToUpfront(option) ? upfront : option);
|
|
403
|
-
const unique = collapsed.filter((option, index) => collapsed.findIndex((other) => other.kind === option.kind) === index);
|
|
404
|
-
return unique.length > 0 ? unique : [upfront];
|
|
405
|
-
}
|
|
406
|
-
function isBookingCollectionEquivalentToUpfront(option) {
|
|
407
|
-
switch (option.kind) {
|
|
408
|
-
case "upfront": return true;
|
|
409
|
-
case "deferred_manual": return false;
|
|
410
|
-
case "flexible_balance": return option.config.depositRefundability === "refundable" && option.dueNowCents === option.totalCents;
|
|
411
|
-
case "instalment_plan": return option.depositRefundability !== "non_refundable" && option.schedule.length === 1;
|
|
412
|
-
default: return assertNever(option);
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
function resolveBookingCollectionOptionFacts(input) {
|
|
416
|
-
const money = {
|
|
417
|
-
totalCents: input.totalCents,
|
|
418
|
-
anchorAt: input.anchorAt,
|
|
419
|
-
bookingStartAt: input.bookingStartAt
|
|
420
|
-
};
|
|
421
|
-
switch (input.option.kind) {
|
|
422
|
-
case "upfront": return {
|
|
423
|
-
...money,
|
|
424
|
-
kind: "upfront",
|
|
425
|
-
dueNowCents: input.totalCents
|
|
426
|
-
};
|
|
427
|
-
case "deferred_manual": return {
|
|
428
|
-
...money,
|
|
429
|
-
kind: "deferred_manual",
|
|
430
|
-
dueNowCents: 0
|
|
431
|
-
};
|
|
432
|
-
case "instalment_plan": {
|
|
433
|
-
const schedule = buildBookingInstalmentSchedule({
|
|
434
|
-
anchorAt: input.anchorAt,
|
|
435
|
-
totalAmountCents: input.totalCents,
|
|
436
|
-
plan: input.option.plan
|
|
437
|
-
});
|
|
438
|
-
return {
|
|
439
|
-
...money,
|
|
440
|
-
kind: "instalment_plan",
|
|
441
|
-
plan: input.option.plan,
|
|
442
|
-
schedule,
|
|
443
|
-
dueNowCents: schedule[0]?.amountCents ?? 0,
|
|
444
|
-
depositRefundability: getBookingInstalmentDepositRefundability(input.option.plan)
|
|
445
|
-
};
|
|
446
|
-
}
|
|
447
|
-
case "flexible_balance": {
|
|
448
|
-
const dueNowCents = resolveFlexibleBalanceInitialPaymentCents({
|
|
449
|
-
totalAmountCents: input.totalCents,
|
|
450
|
-
config: input.option.config
|
|
451
|
-
});
|
|
452
|
-
return {
|
|
453
|
-
...money,
|
|
454
|
-
kind: "flexible_balance",
|
|
455
|
-
config: input.option.config,
|
|
456
|
-
dueNowCents,
|
|
457
|
-
remainingBalanceCents: Math.max(0, input.totalCents - dueNowCents),
|
|
458
|
-
balanceDueAt: resolveFlexibleBalanceDueAt({
|
|
459
|
-
bookingStartAt: input.bookingStartAt ?? input.anchorAt,
|
|
460
|
-
dueDateRule: input.option.config.dueDateRule
|
|
461
|
-
})
|
|
462
|
-
};
|
|
463
|
-
}
|
|
464
|
-
default: return assertNever(input.option);
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
/** Discounts change preview money, never an already admitted collection identity. */
|
|
468
|
-
function repriceBookingCollectionOptions(input) {
|
|
469
|
-
return input.options.map((option) => option.totalCents === input.totalCents ? option : resolveBookingCollectionOptionFacts({
|
|
470
|
-
option,
|
|
471
|
-
totalCents: input.totalCents,
|
|
472
|
-
anchorAt: option.anchorAt,
|
|
473
|
-
bookingStartAt: option.bookingStartAt
|
|
474
|
-
}));
|
|
475
|
-
}
|
|
476
|
-
//#endregion
|
|
477
|
-
//#region ../commerce/src/purchase/checkoutPaymentFlow.ts
|
|
478
|
-
function planCheckoutPaymentFlow(options) {
|
|
479
|
-
const amountDueCents = toNonNegativeCents(options.amountDueCents);
|
|
480
|
-
const discountCents = toNonNegativeCents(options.discountCents);
|
|
481
|
-
const availableCreditCents = toNonNegativeCents(options.availableCreditCents);
|
|
482
|
-
const minimumStripeChargeCents = toNonNegativeCents(options.minimumStripeChargeCents ?? 0);
|
|
483
|
-
if (amountDueCents <= 0) return {
|
|
484
|
-
kind: "bypass",
|
|
485
|
-
bypassReason: discountCents > 0 ? "discount_free" : "free",
|
|
486
|
-
reserveCreditCents: 0
|
|
487
|
-
};
|
|
488
|
-
if (!options.creditCurrencyMatches || availableCreditCents <= 0) return {
|
|
489
|
-
kind: "stripe",
|
|
490
|
-
reserveCreditCents: toNonNegativeCents(0)
|
|
491
|
-
};
|
|
492
|
-
if (availableCreditCents >= amountDueCents) return {
|
|
493
|
-
kind: "store_credit_only",
|
|
494
|
-
reserveCreditCents: amountDueCents
|
|
495
|
-
};
|
|
496
|
-
return {
|
|
497
|
-
kind: "stripe",
|
|
498
|
-
reserveCreditCents: planMixedPaymentCreditReservation({
|
|
499
|
-
amountDueCents,
|
|
500
|
-
availableCreditCents,
|
|
501
|
-
minimumStripeChargeCents
|
|
502
|
-
})
|
|
503
|
-
};
|
|
504
|
-
}
|
|
505
|
-
function planMixedPaymentCreditReservation(input) {
|
|
506
|
-
const chargeAfterFullCredit = input.amountDueCents - input.availableCreditCents;
|
|
507
|
-
if (input.minimumStripeChargeCents <= 0 || chargeAfterFullCredit <= 0 || chargeAfterFullCredit >= input.minimumStripeChargeCents) return input.availableCreditCents;
|
|
508
|
-
if (input.amountDueCents < input.minimumStripeChargeCents) return toNonNegativeCents(0);
|
|
509
|
-
return toNonNegativeCents(input.amountDueCents - input.minimumStripeChargeCents);
|
|
510
|
-
}
|
|
511
|
-
/**
|
|
512
|
-
* Apply site credit to a flexible-balance booking before card payment.
|
|
513
|
-
*
|
|
514
|
-
* Credit first reduces the configured payment due now. Once that payment is
|
|
515
|
-
* covered, any remaining credit reduces the later balance. If a partial credit
|
|
516
|
-
* application would leave a positive card charge below Stripe's minimum, less
|
|
517
|
-
* credit is used so the configured payment can still be collected.
|
|
518
|
-
*/
|
|
519
|
-
function planFlexibleBalanceCreditFirst(input) {
|
|
520
|
-
const totalCents = toNonNegativeCents(input.totalAfterDiscountCents);
|
|
521
|
-
const configuredDueNowCents = toNonNegativeCents(Math.min(input.configuredPaymentDueNowCents, totalCents));
|
|
522
|
-
const availableCreditCents = toNonNegativeCents(input.creditCurrencyMatches ? input.availableCreditCents : 0);
|
|
523
|
-
const minimumStripeChargeCents = toNonNegativeCents(input.minimumStripeChargeCents ?? 0);
|
|
524
|
-
if (availableCreditCents >= totalCents && totalCents > 0) return {
|
|
525
|
-
kind: "credit_only",
|
|
526
|
-
reserveCreditCents: totalCents,
|
|
527
|
-
cardDueNowCents: toNonNegativeCents(0),
|
|
528
|
-
laterBalanceCents: toNonNegativeCents(0)
|
|
529
|
-
};
|
|
530
|
-
let reserveCreditCents = toNonNegativeCents(Math.min(availableCreditCents, totalCents));
|
|
531
|
-
if (reserveCreditCents >= configuredDueNowCents) return {
|
|
532
|
-
kind: "flexible_balance",
|
|
533
|
-
reserveCreditCents,
|
|
534
|
-
cardDueNowCents: toNonNegativeCents(0),
|
|
535
|
-
laterBalanceCents: toNonNegativeCents(totalCents - reserveCreditCents)
|
|
536
|
-
};
|
|
537
|
-
const plannedCardDueNowCents = toNonNegativeCents(configuredDueNowCents - reserveCreditCents);
|
|
538
|
-
if (plannedCardDueNowCents > 0 && plannedCardDueNowCents < minimumStripeChargeCents) {
|
|
539
|
-
if (configuredDueNowCents < minimumStripeChargeCents) return {
|
|
540
|
-
kind: "card_below_minimum",
|
|
541
|
-
reserveCreditCents: toNonNegativeCents(0),
|
|
542
|
-
cardDueNowCents: configuredDueNowCents,
|
|
543
|
-
laterBalanceCents: toNonNegativeCents(totalCents - configuredDueNowCents)
|
|
544
|
-
};
|
|
545
|
-
reserveCreditCents = toNonNegativeCents(configuredDueNowCents - minimumStripeChargeCents);
|
|
546
|
-
}
|
|
547
|
-
const cardDueNowCents = toNonNegativeCents(configuredDueNowCents - reserveCreditCents);
|
|
548
|
-
return {
|
|
549
|
-
kind: "flexible_balance",
|
|
550
|
-
reserveCreditCents,
|
|
551
|
-
cardDueNowCents,
|
|
552
|
-
laterBalanceCents: toNonNegativeCents(totalCents - reserveCreditCents - cardDueNowCents)
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
//#endregion
|
|
556
|
-
//#region ../commerce/src/purchase/settlement.ts
|
|
557
|
-
function normalizeCurrencyCode(raw) {
|
|
558
|
-
const normalized = raw.trim().toUpperCase();
|
|
559
|
-
if (!/^[A-Z]{3}$/.test(normalized)) throw new Error(`Invalid currency code: ${raw}`);
|
|
560
|
-
return normalized;
|
|
561
|
-
}
|
|
562
|
-
//#endregion
|
|
563
|
-
//#region ../commerce/src/purchase/checkoutSessionMetadata.ts
|
|
564
|
-
const datedOfferingSharedEngineMetadataShape = {
|
|
565
|
-
datedOfferingEngineContractVersion: z.literal("shared_v1"),
|
|
566
|
-
datedOfferingEngineRouteKind: z.literal("shared_whole_series_registration"),
|
|
567
|
-
datedOfferingCapacityHoldId: z.string().uuid(),
|
|
568
|
-
datedOfferingCapacityHoldAuditRef: z.string().uuid(),
|
|
569
|
-
customerId: z.string().uuid(),
|
|
570
|
-
eventSeriesId: z.string().uuid()
|
|
571
|
-
};
|
|
572
|
-
z.object(datedOfferingSharedEngineMetadataShape);
|
|
573
|
-
const orderCheckoutSessionMetadataBaseShape = {
|
|
574
|
-
type: z.literal("order"),
|
|
575
|
-
site_id: z.string().uuid(),
|
|
576
|
-
order_id: z.string().uuid().optional(),
|
|
577
|
-
customer_email: z.string().email().optional(),
|
|
578
|
-
customer_name: z.string().optional(),
|
|
579
|
-
product_id: z.string().uuid().optional(),
|
|
580
|
-
attendee_id: z.string().uuid().optional(),
|
|
581
|
-
occurrence_id: z.string().uuid().optional(),
|
|
582
|
-
tickets_count: z.string().optional(),
|
|
583
|
-
notes: z.string().optional(),
|
|
584
|
-
discount_redemption_id: z.string().uuid().optional(),
|
|
585
|
-
discount_code_id: z.string().uuid().optional(),
|
|
586
|
-
discount_code: z.string().optional(),
|
|
587
|
-
discount_public_label: z.string().optional(),
|
|
588
|
-
credit_reservation_id: z.string().uuid().optional(),
|
|
589
|
-
credit_reserved_cents: z.string().optional(),
|
|
590
|
-
discount_code_amount_cents: z.string().optional(),
|
|
591
|
-
order_payment_reason: z.enum([
|
|
592
|
-
"instalment_payoff",
|
|
593
|
-
"flexible_balance_initial",
|
|
594
|
-
"flexible_balance_paydown"
|
|
595
|
-
]).optional(),
|
|
596
|
-
order_payment_plan_id: z.string().uuid().optional(),
|
|
597
|
-
order_flexible_balance_contract_id: z.string().uuid().optional()
|
|
598
|
-
};
|
|
599
|
-
const absentDatedOfferingSharedEngineMetadataShape = {
|
|
600
|
-
datedOfferingEngineContractVersion: z.never().optional(),
|
|
601
|
-
datedOfferingEngineRouteKind: z.never().optional(),
|
|
602
|
-
datedOfferingCapacityHoldId: z.never().optional(),
|
|
603
|
-
datedOfferingCapacityHoldAuditRef: z.never().optional(),
|
|
604
|
-
customerId: z.never().optional(),
|
|
605
|
-
eventSeriesId: z.never().optional()
|
|
606
|
-
};
|
|
607
|
-
const LegacyOrderCheckoutSessionMetadataSchema = z.object({
|
|
608
|
-
...orderCheckoutSessionMetadataBaseShape,
|
|
609
|
-
...absentDatedOfferingSharedEngineMetadataShape
|
|
610
|
-
});
|
|
611
|
-
const SharedDatedOfferingOrderCheckoutSessionMetadataSchema = z.object({
|
|
612
|
-
...orderCheckoutSessionMetadataBaseShape,
|
|
613
|
-
...datedOfferingSharedEngineMetadataShape
|
|
614
|
-
});
|
|
615
|
-
z.union([SharedDatedOfferingOrderCheckoutSessionMetadataSchema, LegacyOrderCheckoutSessionMetadataSchema]);
|
|
616
|
-
//#endregion
|
|
617
|
-
//#region ../commerce/src/purchase/confirmationPaymentSchema.ts
|
|
618
|
-
const settledBalanceSchema = z.strictObject({ kind: z.literal("settled") });
|
|
619
|
-
const dueBalanceSchema = z.strictObject({
|
|
620
|
-
kind: z.literal("due"),
|
|
621
|
-
amountCents: z.number().int().positive().transform((value, ctx) => {
|
|
622
|
-
const cents = parsePositiveCents(value);
|
|
623
|
-
if (cents.ok) return cents.value;
|
|
624
|
-
ctx.addIssue({
|
|
625
|
-
code: "custom",
|
|
626
|
-
message: "Expected positive whole cents"
|
|
627
|
-
});
|
|
628
|
-
return z.NEVER;
|
|
629
|
-
}),
|
|
630
|
-
dueAt: z.string().nullable()
|
|
631
|
-
});
|
|
632
|
-
const paymentBalanceSchema = z.discriminatedUnion("kind", [settledBalanceSchema, dueBalanceSchema]);
|
|
633
|
-
const currencySchema = z.string().regex(/^[A-Z]{3}$/).transform(normalizeCurrencyCode);
|
|
634
|
-
const moneyFields = {
|
|
635
|
-
amountPaidCents: z.number().int().nonnegative().transform(toNonNegativeCents),
|
|
636
|
-
currency: currencySchema
|
|
637
|
-
};
|
|
638
|
-
const confirmationPaymentSchema = z.discriminatedUnion("kind", [
|
|
639
|
-
z.strictObject({
|
|
640
|
-
kind: z.literal("free"),
|
|
641
|
-
balance: settledBalanceSchema
|
|
642
|
-
}),
|
|
643
|
-
z.strictObject({
|
|
644
|
-
kind: z.literal("waived"),
|
|
645
|
-
balance: settledBalanceSchema
|
|
646
|
-
}),
|
|
647
|
-
z.strictObject({
|
|
648
|
-
kind: z.literal("pass"),
|
|
649
|
-
passName: z.string().nullable(),
|
|
650
|
-
passCreditsUsed: z.number().int().positive().nullable(),
|
|
651
|
-
balance: settledBalanceSchema
|
|
652
|
-
}),
|
|
653
|
-
z.strictObject({
|
|
654
|
-
kind: z.literal("membership"),
|
|
655
|
-
membershipName: z.string().nullable(),
|
|
656
|
-
balance: settledBalanceSchema
|
|
657
|
-
}),
|
|
658
|
-
z.strictObject({
|
|
659
|
-
kind: z.literal("manual_due"),
|
|
660
|
-
currency: currencySchema,
|
|
661
|
-
balance: dueBalanceSchema
|
|
662
|
-
}),
|
|
663
|
-
z.strictObject({
|
|
664
|
-
kind: z.literal("managed_balance_due"),
|
|
665
|
-
...moneyFields,
|
|
666
|
-
balance: dueBalanceSchema
|
|
667
|
-
}),
|
|
668
|
-
z.strictObject({
|
|
669
|
-
kind: z.literal("monetary"),
|
|
670
|
-
...moneyFields,
|
|
671
|
-
paymentMethod: z.enum([
|
|
672
|
-
"stripe",
|
|
673
|
-
"store_credit",
|
|
674
|
-
"mixed",
|
|
675
|
-
"manual"
|
|
676
|
-
]),
|
|
677
|
-
balance: paymentBalanceSchema
|
|
678
|
-
})
|
|
679
|
-
]);
|
|
680
|
-
toNonNegativeCents(0);
|
|
681
|
-
//#endregion
|
|
682
|
-
//#region ../commerce/src/purchase/stripeCommissionMetadata.ts
|
|
683
|
-
/** Reasons are payment evidence, not an independent pricing policy. */
|
|
684
|
-
const STRIPE_COMMISSION_FREE_REASONS = [
|
|
685
|
-
"managed_billing",
|
|
686
|
-
"no_commission_plan",
|
|
687
|
-
"billing_evidence_invalid",
|
|
688
|
-
"fee_rounds_to_zero",
|
|
689
|
-
"payment_not_stripe"
|
|
690
|
-
];
|
|
691
|
-
const historicalContext = {
|
|
692
|
-
currency: z.string().refine((value) => parseCurrencyCode(value) !== null).optional(),
|
|
693
|
-
sourcePlanId: z.string().trim().min(1).optional()
|
|
694
|
-
};
|
|
695
|
-
const percentSchema = z.number().finite().min(0).max(100);
|
|
696
|
-
z.discriminatedUnion("kind", [
|
|
697
|
-
z.object({
|
|
698
|
-
kind: z.literal("commission_free"),
|
|
699
|
-
reason: z.enum(STRIPE_COMMISSION_FREE_REASONS),
|
|
700
|
-
...historicalContext
|
|
701
|
-
}),
|
|
702
|
-
z.object({
|
|
703
|
-
kind: z.literal("application_fee_amount"),
|
|
704
|
-
amountCents: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
705
|
-
percent: percentSchema,
|
|
706
|
-
...historicalContext
|
|
707
|
-
}),
|
|
708
|
-
z.object({
|
|
709
|
-
kind: z.literal("application_fee_percent"),
|
|
710
|
-
percent: percentSchema,
|
|
711
|
-
...historicalContext
|
|
712
|
-
})
|
|
713
|
-
]);
|
|
714
|
-
//#endregion
|
|
715
|
-
//#region ../commerce/src/purchase/stripeMinimumCharge.ts
|
|
716
|
-
const STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY = {
|
|
717
|
-
GBP: 30,
|
|
718
|
-
USD: 50,
|
|
719
|
-
EUR: 50,
|
|
720
|
-
AED: 200,
|
|
721
|
-
AUD: 50,
|
|
722
|
-
BGN: 100,
|
|
723
|
-
BRL: 50,
|
|
724
|
-
CAD: 50,
|
|
725
|
-
CHF: 50,
|
|
726
|
-
CZK: 1500,
|
|
727
|
-
DKK: 250,
|
|
728
|
-
HKD: 400,
|
|
729
|
-
HUF: 17500,
|
|
730
|
-
JPY: 50,
|
|
731
|
-
MXN: 1e3,
|
|
732
|
-
MYR: 200,
|
|
733
|
-
NOK: 300,
|
|
734
|
-
NZD: 50,
|
|
735
|
-
PLN: 200,
|
|
736
|
-
RON: 200,
|
|
737
|
-
SEK: 300,
|
|
738
|
-
SGD: 50,
|
|
739
|
-
THB: 1e3
|
|
740
|
-
};
|
|
741
|
-
function isStripeMinimumChargeCurrency(currency) {
|
|
742
|
-
return currency in STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY;
|
|
743
|
-
}
|
|
744
|
-
function getStripeMinimumChargeRequirement(rawCurrency) {
|
|
745
|
-
let currency;
|
|
746
|
-
try {
|
|
747
|
-
currency = normalizeCurrencyCode(rawCurrency);
|
|
748
|
-
} catch {
|
|
749
|
-
return null;
|
|
750
|
-
}
|
|
751
|
-
const currencyKey = currency;
|
|
752
|
-
if (!isStripeMinimumChargeCurrency(currencyKey)) return null;
|
|
753
|
-
return {
|
|
754
|
-
currency,
|
|
755
|
-
minimumAmountCents: STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY[currencyKey]
|
|
756
|
-
};
|
|
757
|
-
}
|
|
758
|
-
//#endregion
|
|
759
|
-
//#region ../commerce/src/purchase/checkoutCopy.ts
|
|
760
|
-
/**
|
|
761
|
-
* Customer copy shared by checkout surfaces, so one approved wording reaches
|
|
762
|
-
* every place that shows it.
|
|
763
|
-
*/
|
|
764
|
-
const checkoutCopy = {
|
|
765
|
-
/** A payment is still being confirmed; checking again is safe. */
|
|
766
|
-
checkoutStillConfirming: "We’re still confirming your payment. This can take a minute – you can check again, and you won’t be charged twice.",
|
|
767
|
-
/** A previous attempt can't be confirmed automatically; the business needs to check it. */
|
|
768
|
-
checkoutAssistanceRequired: "We can’t confirm your last payment attempt yet. Please don’t pay again – contact the business so they can check it."
|
|
769
|
-
};
|
|
770
|
-
//#endregion
|
|
771
|
-
//#region ../commerce/src/purchase/event-registration-errors.ts
|
|
772
|
-
const eventRegistrationErrors = {
|
|
773
|
-
registrationClosed: {
|
|
774
|
-
endsCommand: false,
|
|
775
|
-
message: "Booking is currently closed for this event. Please contact the organiser if you’d like to find out more.",
|
|
776
|
-
action: "none"
|
|
777
|
-
},
|
|
778
|
-
paymentInvestigationRequired: {
|
|
779
|
-
endsCommand: false,
|
|
780
|
-
message: "We still can’t confirm your payment. Please don’t make another payment. Contact the organiser so they can check your booking.",
|
|
781
|
-
action: "none"
|
|
782
|
-
},
|
|
783
|
-
paymentProviderUnavailable: {
|
|
784
|
-
endsCommand: false,
|
|
785
|
-
message: "We couldn’t reach the payment provider. Please try again in a minute.",
|
|
786
|
-
action: "retry"
|
|
787
|
-
},
|
|
788
|
-
paymentHostUnavailable: {
|
|
789
|
-
endsCommand: false,
|
|
790
|
-
message: "Card payments aren’t available on this web address yet. Please contact the organiser to book.",
|
|
791
|
-
action: "none"
|
|
792
|
-
},
|
|
793
|
-
paymentPageUnavailable: {
|
|
794
|
-
endsCommand: false,
|
|
795
|
-
message: "We couldn’t open the payment page. Please refresh this page and try again. If this keeps happening, contact the organiser for help.",
|
|
796
|
-
action: "retry"
|
|
797
|
-
},
|
|
798
|
-
paymentUnavailable: {
|
|
799
|
-
endsCommand: false,
|
|
800
|
-
message: "Online payment is not available for this event right now. Please contact the organiser for help with booking.",
|
|
801
|
-
action: "none"
|
|
802
|
-
},
|
|
803
|
-
capacityChanged: {
|
|
804
|
-
endsCommand: false,
|
|
805
|
-
message: "Sorry, there aren’t enough places left for your selection. Please check the available places and choose again.",
|
|
806
|
-
action: "places"
|
|
807
|
-
},
|
|
808
|
-
selectionChanged: {
|
|
809
|
-
endsCommand: false,
|
|
810
|
-
message: "The booking options for this event have changed. Please check the latest options and choose your places again.",
|
|
811
|
-
action: "places"
|
|
812
|
-
},
|
|
813
|
-
paymentSetupFailed: {
|
|
814
|
-
endsCommand: true,
|
|
815
|
-
message: "We couldn't set up payment for this booking, so your place hasn't been reserved and you haven't been charged. Please try again in a few minutes, or contact the organiser if it keeps happening.",
|
|
816
|
-
action: "retry"
|
|
817
|
-
},
|
|
818
|
-
registrationAttemptEnded: {
|
|
819
|
-
endsCommand: true,
|
|
820
|
-
message: "That booking attempt has ended, so we couldn't finish it. You haven't been charged. Please start your booking again.",
|
|
821
|
-
action: "start"
|
|
822
|
-
},
|
|
823
|
-
registrationPreparationChanged: {
|
|
824
|
-
endsCommand: true,
|
|
825
|
-
message: "The booking options for this event have changed. Please check the latest options and choose your places again.",
|
|
826
|
-
action: "places"
|
|
827
|
-
},
|
|
828
|
-
registrationAlreadyExists: {
|
|
829
|
-
endsCommand: false,
|
|
830
|
-
message: "You already have a booking for this event. Please check your bookings to see its status. If you need help, contact the organiser.",
|
|
831
|
-
action: "portal"
|
|
832
|
-
},
|
|
833
|
-
holdExpired: {
|
|
834
|
-
endsCommand: false,
|
|
835
|
-
message: "Your reservation has timed out. Please check availability and choose your places again.",
|
|
836
|
-
action: "start"
|
|
837
|
-
},
|
|
838
|
-
waitlistUnavailable: {
|
|
839
|
-
endsCommand: false,
|
|
840
|
-
message: "Sorry, the waiting list place offered in this invitation is no longer available. Please check the event for available places or contact the organiser for help.",
|
|
841
|
-
action: "event"
|
|
842
|
-
},
|
|
843
|
-
paymentContextMismatch: {
|
|
844
|
-
endsCommand: false,
|
|
845
|
-
message: "The payment options for this event have changed. Please check the latest options before continuing.",
|
|
846
|
-
action: "payment-options"
|
|
847
|
-
},
|
|
848
|
-
idempotencyConflict: {
|
|
849
|
-
endsCommand: false,
|
|
850
|
-
message: "You’ve already started booking this event. Please finish in the other tab if it’s still open, or check your booking status before starting again.",
|
|
851
|
-
action: "portal"
|
|
852
|
-
},
|
|
853
|
-
invalidCommitInput: {
|
|
854
|
-
endsCommand: false,
|
|
855
|
-
message: "We couldn’t accept your booking details. Please check the information you entered and try again. If this keeps happening, contact the organiser for help.",
|
|
856
|
-
action: "details"
|
|
857
|
-
}
|
|
858
|
-
};
|
|
859
|
-
function parseEventRegistrationErrorReason(value) {
|
|
860
|
-
return typeof value === "string" && Object.prototype.hasOwnProperty.call(eventRegistrationErrors, value) ? value : null;
|
|
861
|
-
}
|
|
862
|
-
/** Only a server-confirmed refusal ends an identity; transport uncertainty retains it. */
|
|
863
|
-
function eventRegistrationErrorEndsCommand(value) {
|
|
864
|
-
const reason = parseEventRegistrationErrorReason(value);
|
|
865
|
-
return reason !== null && eventRegistrationErrors[reason].endsCommand;
|
|
866
|
-
}
|
|
867
|
-
//#endregion
|
|
868
|
-
//#region ../commerce/src/purchase/checkoutPresentation.ts
|
|
869
|
-
function publishableKeyMode(publishableKey) {
|
|
870
|
-
if (publishableKey.startsWith("pk_live_")) return "live";
|
|
871
|
-
if (publishableKey.startsWith("pk_test_")) return "test";
|
|
872
|
-
return null;
|
|
873
|
-
}
|
|
874
|
-
function checkBrowserStripeKey(publishableKey, livemode) {
|
|
875
|
-
const key = publishableKey?.trim();
|
|
876
|
-
if (!key) return {
|
|
877
|
-
tag: "unavailable",
|
|
878
|
-
reason: "missing_key"
|
|
879
|
-
};
|
|
880
|
-
const mode = publishableKeyMode(key);
|
|
881
|
-
if (mode === null) return {
|
|
882
|
-
tag: "unavailable",
|
|
883
|
-
reason: "invalid_key"
|
|
884
|
-
};
|
|
885
|
-
return mode === (livemode ? "live" : "test") ? {
|
|
886
|
-
tag: "ready",
|
|
887
|
-
publishableKey: key
|
|
888
|
-
} : {
|
|
889
|
-
tag: "unavailable",
|
|
890
|
-
reason: "mode_mismatch"
|
|
891
|
-
};
|
|
892
|
-
}
|
|
893
|
-
//#endregion
|
|
894
|
-
export { getBookingInstalmentPlanIntervalCount as _, checkoutCopy as a, formatCurrencyAmount as b, planCheckoutPaymentFlow as c, repriceBookingCollectionOptions as d, resolveAvailableBookingCollectionOptions as f, formatOrderInstalmentStatusLabel as g, validateBookingPaymentOptionKinds as h, parseEventRegistrationErrorReason as i, planFlexibleBalanceCreditFirst as l, getBookingLaterInstalments as m, eventRegistrationErrorEndsCommand as n, getStripeMinimumChargeRequirement as o, resolveBookingCollectionOptionFacts as p, eventRegistrationErrors as r, confirmationPaymentSchema as s, checkBrowserStripeKey as t, isBookingCollectionEquivalentToUpfront as u, resolveFlexibleBalancePaymentEligibility as v, formatGiftCardAmountLabel as x, parsePositiveMoneyInputToCents as y };
|