@riverbankcms/sdk 0.174.0 → 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-GqVX3I8E.d.ts → BlocksIslandsHydrator-hb2IWD8K.d.ts} +1 -1
- package/dist/_dts/{Page-BhUH31M-.d.ts → Page-BlY68ZF-.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-DBn2x0UL.d.ts → SdkPreviewMode-CA8hU7hW.d.ts} +2 -2
- package/dist/_dts/{client-Cr-sOeSl.d.ts → client-B6tCvmG4.d.ts} +487 -11
- package/dist/_dts/{content-types-DKw1yJdN.d.ts → content-types-B9qryk4R.d.ts} +2 -2
- package/dist/_dts/{contracts-CJ2O03nB.d.ts → contracts-DWoaRxj1.d.ts} +3 -3
- package/dist/_dts/{footerPageOutline-DoGHHKr_.d.ts → footerPageOutline-Djdrhp5s.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-CJGu4hoa.d.ts → generatePageMetadata-CFi0vxov.d.ts} +2 -2
- package/dist/_dts/{index--39uLjrr.d.ts → index-Bl5_pjmq.d.ts} +1 -1
- package/dist/_dts/{index-DQZ5L0Gb.d.ts → index-Btp5nIoz.d.ts} +2 -2
- package/dist/_dts/{index-Bq-488M7.d.ts → index-CQUzwOxO.d.ts} +1 -1
- package/dist/_dts/{index-DYlfdT1O.d.ts → index-DmhFb6R1.d.ts} +1 -1
- package/dist/_dts/{index-3GzargmS.d.ts → index-OtazQE3U.d.ts} +2 -2
- package/dist/_dts/{index-DYsP4k6S.d.ts → index-YRQulWB4.d.ts} +3 -3
- package/dist/_dts/{index-DdEi2iXd.d.ts → index-_pXaCO12.d.ts} +4 -4
- package/dist/_dts/{loadContent-BVPagYmy.d.ts → loadContent-Hcuvs4pz.d.ts} +7 -7
- package/dist/_dts/{request-Be1E-H-V.d.ts → request-BT8i_vH-.d.ts} +2070 -503
- package/dist/_dts/{resolveBlockData-D1pL25bD.d.ts → resolveBlockData-B-dJrunl.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-B4sbTf96.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-Bm5_3VEd.d.ts → types-C0XZnjXz.d.ts} +3 -3
- package/dist/_dts/{types-5MeDI1w8.d.ts → types-CXL1QJSY.d.ts} +7 -7
- package/dist/_dts/{types-CVoCc_Ia.d.ts → types-OKzbqRBx.d.ts} +2 -2
- package/dist/_dts/{validation-lEtYD-Rh.d.ts → validation-Bxi66FtQ.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DkflFLGQ.mjs → BlocksIslandsHydrator-2xzlERTG.mjs} +17 -16
- package/dist/client/{BookingMailingListNote-CAyoiAGD.mjs → BookingMailingListNote-qsohSEdQ.mjs} +6 -6
- package/dist/client/{BookingPanelArrangement-C7yiJrxm.mjs → BookingPanelArrangement-DrdtON0q.mjs} +1 -1
- package/dist/client/{BookingQuestionFields-DZMrGvBh.mjs → BookingQuestionFields-CUFxBaTM.mjs} +3 -3
- package/dist/client/{CalendarNavigationChevron-BPQU5Snc.mjs → CalendarNavigationChevron-Ch0w0Utn.mjs} +34 -9
- package/dist/client/DemoBookingPortalAccess-DGgsjqXK.mjs +545 -0
- package/dist/client/{EventCalendar.client-BiWQc28-.mjs → EventCalendar.client-Dg4PHFJJ.mjs} +15 -25
- package/dist/client/{EventCombined.client-B_ytWQtn.mjs → EventCombined.client-tky8JcnQ.mjs} +25 -17
- package/dist/client/{EventItem-C-mxXpX_.mjs → EventItem-BybMSKNL.mjs} +4 -3
- package/dist/client/{EventListWeekNavigation-Bm3Ap1Rd.mjs → EventListWeekNavigation-uvWRE5wi.mjs} +1 -1
- package/dist/client/{EventListing.client-Bs_8im5_.mjs → EventListing.client-DQx9dohz.mjs} +3 -3
- package/dist/client/{EventListing.view-CN7BjGgC.mjs → EventListing.view-r31k8Icz.mjs} +8 -7
- package/dist/client/{EventRegistrationPayment-DPkRcSdw.mjs → EventRegistrationPayment-BMmPDmSf.mjs} +664 -362
- 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--xJ23nA5.mjs → Page-CWN_8cLZ.mjs} +736 -1667
- package/dist/client/{DemoBookingPortalAccess-BnEgvJas.mjs → SiteTermsAgreementField-Dr5lj4oY.mjs} +4 -301
- package/dist/client/{StepIndicator-D391QRNc.mjs → StepIndicator-C7RJBOW3.mjs} +37 -249
- package/dist/client/{accordion-BQtTkDN8.mjs → accordion-uUi_N6mZ.mjs} +1 -1
- package/dist/client/{booking-form.client-D9M7TKGV.mjs → booking-form.client-CKHgxvsh.mjs} +229 -42
- package/dist/client/{bookingForm-BsOS0sl9.mjs → bookingForm-Bi74dmiS.mjs} +4 -4
- package/dist/client/bookings.mjs +22 -15
- package/dist/client/{boxStyleClassNames-CNDLpT06.mjs → boxStyleClassNames-C-gFwhnO.mjs} +3 -29
- package/dist/client/{carousel-CPsW-FPh.mjs → carousel-C0_BqMA0.mjs} +1 -1
- package/dist/client/{cart-CwElmocm.mjs → cart-BOHuppVu.mjs} +3 -3
- package/dist/client/{cart.client-RpqI56w8.mjs → cart.client-IfJE1zAp.mjs} +1 -1
- package/dist/client/{checkout-CfMgqY8H.mjs → checkout-C3Aj-aNa.mjs} +3 -3
- package/dist/client/{checkout.client-BpuPyOuJ.mjs → checkout.client-Tg9lfeYf.mjs} +1 -1
- package/dist/client/{checkoutUrls-VeHY6WYj.mjs → checkoutUrls-OLqQdAXD.mjs} +1 -1
- package/dist/client/client.mjs +113 -21
- package/dist/client/{context-CNlesLfF.mjs → context-D8TpQXjX.mjs} +76 -58
- package/dist/client/{course-q1sA4Cj-.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-BzjY6AiY.mjs → enhanceHeaderSection-Ciuhsk0E.mjs} +3 -3
- package/dist/client/{event-details.client-CseTWUFC.mjs → event-details.client-CJapNbTv.mjs} +1 -1
- package/dist/client/{event-registration.client-b5TLxntR.mjs → event-registration.client-CAdcpnLc.mjs} +295 -188
- package/dist/client/{eventCalendar-C-kJNIc9.mjs → eventCalendar-BlsD5R8M.mjs} +4 -4
- package/dist/client/{eventCombined-BgHJGhwE.mjs → eventCombined-B9Ly3024.mjs} +4 -4
- package/dist/client/{eventDetails-CAwbreD0.mjs → eventDetails-CbEGI4jO.mjs} +2 -2
- package/dist/client/{eventListing-_14atrj8.mjs → eventListing-ZSmvhWII.mjs} +4 -4
- package/dist/client/{eventRegistration-BOqSdstJ.mjs → eventRegistration-D-yUcIyO.mjs} +4 -4
- package/dist/client/{form-DfAB-llc.mjs → form-DG_YZSNn.mjs} +3 -3
- package/dist/client/{form.client-DN-I9_qC.mjs → form.client-BU6dM0-C.mjs} +4 -4
- package/dist/client/{form.parts-t2Q1neM6.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-Dces54pb.mjs → headerSection-D91EzlOR.mjs} +2 -2
- package/dist/client/{display-D8MW2b0e.mjs → lookSurfaces-BDZLALxj.mjs} +3084 -12938
- package/dist/client/{newsletter-form.client-D_YFUlR2.mjs → newsletter-form.client-BMGRiRpo.mjs} +7 -5
- package/dist/client/{newsletter-form.parts-URO5Mn_I.mjs → newsletter-form.parts-D5UfUaD3.mjs} +3 -3
- package/dist/client/{newsletterForm-_c9fKIzS.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-CVW1UIxJ.mjs → product-detail.client-D-XNir0m.mjs} +1 -1
- package/dist/client/{product-list.client-CF9hO23G.mjs → product-list.client-BLfYQ-qi.mjs} +1 -1
- package/dist/client/{productDetail-C_qbmUuP.mjs → productDetail-W0_0lDGe.mjs} +3 -3
- package/dist/client/{productList-Df5qDD0z.mjs → productList-ayAtPJdb.mjs} +3 -3
- package/dist/client/{propsDecoder-BiEyK2ii.mjs → propsDecoder-ChYKWjLA.mjs} +4 -3
- package/dist/client/{registry.server-ClcfWpvM.mjs → registry.server-B1EEZkcr.mjs} +311 -262
- package/dist/client/rendering/client.mjs +25 -491
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +7 -7
- package/dist/client/{richText-coerce-C32cRQ03.mjs → richText-coerce-CDAfpMQU.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-DAypPzSo.mjs → routeIslandApiConfig-CcGWvyht.mjs} +1 -1
- package/dist/client/{shop-gteEpeO5.mjs → shop-DbUUoHFJ.mjs} +3 -3
- package/dist/client/{shop-discount-apply.state-DidgH7ow.mjs → shop-add-feedback-DvC2kP1K.mjs} +1 -78
- package/dist/client/{shop-commerce-Bw4_BXQg.mjs → shop-commerce-aQqcDmyZ.mjs} +64 -32
- package/dist/client/{shop-commerce-store-Da6Ah-_4.mjs → shop-commerce-store-Cd7USpuY.mjs} +1 -1
- package/dist/client/shop-discount-apply.state-DGvPBmVP.mjs +83 -0
- package/dist/client/{shop.client-CbbdjWWd.mjs → shop.client-BNZ9M8cG.mjs} +56 -19
- package/dist/client/{shop.interactive-CKFORzux.mjs → shop.interactive-CJAINJr3.mjs} +118 -39
- package/dist/client/{shopShared-C7QjoywZ.mjs → shopShared-DwVAuGsx.mjs} +2 -2
- package/dist/client/{timetableModel-CtZiIj9q.mjs → timetableModel-DBTIFWTb.mjs} +11 -148
- package/dist/client/{useAvailableSlots-CUVRD1nx.mjs → useAvailableSlots-BomyyKeo.mjs} +3 -3
- package/dist/client/{useDiscountCodeUi-BuLgof7O.mjs → useDiscountCodeUi-CCxHMWlU.mjs} +32 -17
- package/dist/client/{useEventPagination-B4VPtSEF.mjs → useEventPagination-Bjin_qaN.mjs} +7 -6
- package/dist/client/{view-CvlTplao.mjs → view-BTk470k0.mjs} +3 -2
- package/dist/client/{view-CxUpgcM6.mjs → view-Cw4EmEPv.mjs} +100 -32
- package/dist/preview-next/client/{PageSectionToolbar-BFbSrDbi.mjs → PageSectionToolbar-bq7gbKvn.mjs} +4 -4
- package/dist/preview-next/client/{PreviewEditorSidebar-BtpzqQ-i.mjs → PreviewEditorSidebar-DVsPNcos.mjs} +32 -29
- package/dist/preview-next/client/{PreviewEditorUI-z22h-CCY.mjs → PreviewEditorUI-B-pq3aZc.mjs} +4 -4
- package/dist/preview-next/client/{PreviewShell-BW3Qpoa_.mjs → PreviewShell-ChyjB96e.mjs} +5 -5
- package/dist/preview-next/client/{SdkPreviewModeRuntime-BvVeK1hR.mjs → SdkPreviewModeRuntime-D_czeC0l.mjs} +84 -101
- package/dist/preview-next/client/{previewAssistantSlot-BUqAh1FL.mjs → previewAssistantSlot-B61mZd81.mjs} +4981 -3275
- package/dist/preview-next/client/{previewChromeRoot-NCy5zHO8.mjs → previewChromeRoot-dwOn9XtM.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-CxmKDVGZ.mjs → sdk-runtime-DZDfOxoW.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-B_UaDyJO.mjs → siteStyleAccess-BZDIC-fA.mjs} +529 -238
- package/dist/preview-next/client/{useAutosaveStatus-BqmWvPLY.mjs → useAutosaveStatus-BbzLMf-l.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-LAllV0rU.mjs → useOpenBlockForSetup-BEXcWQeI.mjs} +25 -5
- 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-DV6SeCNv.mjs → route-contract-0gSlK9S0.mjs} +87 -12
- package/dist/server/{Block.shared-Ch2FKAvU.mjs → Block.shared-DeXXycg8.mjs} +4 -4
- package/dist/server/{ThemeScopeCore-DFvjDVzi.mjs → ThemeScopeCore-DFEM1a85.mjs} +16 -2
- package/dist/server/{bindings-CQg2lzZn.mjs → bindings-7L3pC5Os.mjs} +13 -34
- package/dist/server/{client-aYRTVneD.mjs → client-CgghATBm.mjs} +112 -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-Cgpfr44e.mjs → loadContent-D7M5Vcug.mjs} +5 -5
- package/dist/server/{loadPage-RDk10NMP.mjs → loadPage-CiTId05y.mjs} +2 -2
- package/dist/server/{lookMediaFrame-CQtkvlDn.mjs → lookMediaFrame-CaH018pK.mjs} +129 -12
- package/dist/server/next.mjs +35 -9
- package/dist/server/{overrideResolution-VhhN94d8.mjs → overrideResolution-CJ3MRI5Q.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-CkFTsxkd.mjs → pageRenderPlan-Cuos4Xcd.mjs} +105 -357
- package/dist/server/{pageRuntimeSupport-CpAtzNxD.mjs → pageRuntimeSupport-CuVj3bkd.mjs} +4 -3
- package/dist/server/{pageShared-B8yLPjs0.mjs → pageShared-JxlV8_Bo.mjs} +1707 -1811
- package/dist/server/{parseThemeForPersistence-Cwqb5pZx.mjs → parseThemeForPersistence-DOsfofCy.mjs} +1 -1
- package/dist/server/{prebuild-DOu6QceG.mjs → prebuild-BDhlJbAx.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-CfOXFKYG.mjs → prefetchBlockData-kERh_c0v.mjs} +2 -2
- package/dist/server/{registry-34rkAfaU.mjs → registry-cQ9N5W-n.mjs} +21091 -20209
- 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-D7VeoWgr.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-CLVKoJrX.mjs → validation-3puM5SM8.mjs} +3 -3
- package/dist/server/{version-HVfdvBJ0.mjs → version-B8g-Wx57.mjs} +1 -1
- package/dist/styles/index.css +361 -57
- package/package.json +1 -1
- package/dist/client/bookability-CE637yDE.mjs +0 -17
- package/dist/client/useDiscountApply-BZU5DWZQ.mjs +0 -199
package/dist/client/{DemoBookingPortalAccess-BnEgvJas.mjs → SiteTermsAgreementField-Dr5lj4oY.mjs}
RENAMED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { p as assertNever } from "./creditProducts-KYMVIH3J.mjs";
|
|
5
|
-
import { i as BlockApiError, n as useBlockApi } from "./context-CNlesLfF.mjs";
|
|
6
|
-
import { r as ThemedButton } from "./ThemedButton-DuaYtnvG.mjs";
|
|
2
|
+
import { n as assertNever, u as verifiedSiteTermsAcceptanceSchema } from "./noop-DF8_EiFt.mjs";
|
|
3
|
+
import { i as BlockApiError, n as useBlockApi } from "./context-D8TpQXjX.mjs";
|
|
7
4
|
import { t as CheckboxChoice } from "./CheckboxChoice-b-PJLEXe.mjs";
|
|
8
5
|
import { n as getFieldValidationControlProps, t as FieldValidationMessage } from "./FieldValidationMessage-CsqxShw4.mjs";
|
|
9
6
|
import { t as FeedbackMessage } from "./FeedbackMessage-CSJrAuXH.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import React, { useCallback, useEffect, useId, useMemo, useReducer, useState } from "react";
|
|
7
|
+
import { useCallback, useEffect, useId, useMemo, useReducer } from "react";
|
|
12
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
9
|
//#region ../core/src/site-terms.ts
|
|
14
10
|
function siteTermsApplies(operation, items) {
|
|
@@ -21,184 +17,6 @@ function siteTermsChangedMessage(businessName) {
|
|
|
21
17
|
return `${businessName} updated their booking terms while you were booking. Please have a look and tick the box again.`;
|
|
22
18
|
}
|
|
23
19
|
//#endregion
|
|
24
|
-
//#region ../blocks/src/system/runtime/api/types/discounts.ts
|
|
25
|
-
function discountAvailabilityHasDiscounts(availability) {
|
|
26
|
-
return availability.type !== "none";
|
|
27
|
-
}
|
|
28
|
-
function discountAvailabilityAllowsManualEntry(availability) {
|
|
29
|
-
return "manualCodeEntryAllowed" in availability && availability.manualCodeEntryAllowed;
|
|
30
|
-
}
|
|
31
|
-
function getAutoAppliedDiscountPreview(availability) {
|
|
32
|
-
switch (availability.type) {
|
|
33
|
-
case "none":
|
|
34
|
-
case "manual": return null;
|
|
35
|
-
case "auto":
|
|
36
|
-
case "auto_and_manual": return availability.autoAppliedDiscount;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region ../blocks/src/system/runtime/shared/components/DiscountCodeDisclosure.tsx
|
|
41
|
-
const BLOCK_DISCOUNT_CODE_DISCLOSURE_CLASSES = { "event-registration": {
|
|
42
|
-
root: "er-discount",
|
|
43
|
-
toggle: "er-discount__toggle",
|
|
44
|
-
form: "er-discount__form",
|
|
45
|
-
label: "er-discount__label",
|
|
46
|
-
row: "er-discount__row",
|
|
47
|
-
input: "er-discount__input",
|
|
48
|
-
apply: "er-discount__apply",
|
|
49
|
-
remove: "er-discount__remove",
|
|
50
|
-
hint: "er-discount__hint",
|
|
51
|
-
feedback: "er-discount__feedback"
|
|
52
|
-
} };
|
|
53
|
-
const themeFormClasses = {
|
|
54
|
-
root: "rb-flex rb-flex-col rb-gap-2 rb-mb-4",
|
|
55
|
-
toggle: `${["button", "link"].join("-")} rb-self-start`,
|
|
56
|
-
form: "rb-flex rb-flex-col rb-gap-2",
|
|
57
|
-
label: "form-label",
|
|
58
|
-
row: "rb-flex rb-flex-col rb-gap-2 rb-sm-flex-row",
|
|
59
|
-
input: "form-input",
|
|
60
|
-
apply: "",
|
|
61
|
-
remove: "",
|
|
62
|
-
hint: "rb-caption status-muted",
|
|
63
|
-
feedback: "rb-caption"
|
|
64
|
-
};
|
|
65
|
-
function getDiscountCodeDisclosureClasses(surface) {
|
|
66
|
-
if (surface === "theme-form") return themeFormClasses;
|
|
67
|
-
return BLOCK_DISCOUNT_CODE_DISCLOSURE_CLASSES[surface];
|
|
68
|
-
}
|
|
69
|
-
function DiscountActionButton(props) {
|
|
70
|
-
return props.surface === "theme-form" ? /* @__PURE__ */ jsx(ThemedButton, {
|
|
71
|
-
type: "button",
|
|
72
|
-
variant: "secondary",
|
|
73
|
-
size: "sm",
|
|
74
|
-
label: props.label,
|
|
75
|
-
onClick: props.onClick,
|
|
76
|
-
disabled: props.disabled
|
|
77
|
-
}) : /* @__PURE__ */ jsx("button", {
|
|
78
|
-
type: "button",
|
|
79
|
-
className: props.className,
|
|
80
|
-
onClick: props.onClick,
|
|
81
|
-
disabled: props.disabled,
|
|
82
|
-
children: props.label
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
function DiscountCodeDisclosure({ surface, isOpen, code, onOpen, onChange, onRemove, onApply, id, toggleLabel = "Have a discount code?", label = "Discount code", placeholder = "Enter code", applyLabel = "Apply", removeLabel = "Remove", hint = "Applied at checkout.", feedback = null, isApplying = false, applyDisabled = false, disabled = false }) {
|
|
86
|
-
const generatedId = useId();
|
|
87
|
-
const inputId = id ?? `discount-code-${generatedId}`;
|
|
88
|
-
const classes = getDiscountCodeDisclosureClasses(surface);
|
|
89
|
-
const handleChange = (event) => {
|
|
90
|
-
onChange(event.target.value);
|
|
91
|
-
};
|
|
92
|
-
const handleKeyDown = (event) => {
|
|
93
|
-
if (!onApply || event.key !== "Enter") return;
|
|
94
|
-
event.preventDefault();
|
|
95
|
-
onApply();
|
|
96
|
-
};
|
|
97
|
-
const feedbackClassName = feedback ? `${classes.feedback} status-${feedback.tone}` : classes.feedback;
|
|
98
|
-
return /* @__PURE__ */ jsx("div", {
|
|
99
|
-
className: classes.root,
|
|
100
|
-
children: !isOpen ? /* @__PURE__ */ jsx("button", {
|
|
101
|
-
type: "button",
|
|
102
|
-
className: classes.toggle,
|
|
103
|
-
onClick: onOpen,
|
|
104
|
-
children: toggleLabel
|
|
105
|
-
}) : /* @__PURE__ */ jsxs("div", {
|
|
106
|
-
className: classes.form,
|
|
107
|
-
children: [
|
|
108
|
-
/* @__PURE__ */ jsx("label", {
|
|
109
|
-
htmlFor: inputId,
|
|
110
|
-
className: classes.label,
|
|
111
|
-
children: label
|
|
112
|
-
}),
|
|
113
|
-
/* @__PURE__ */ jsxs("div", {
|
|
114
|
-
className: classes.row,
|
|
115
|
-
children: [
|
|
116
|
-
/* @__PURE__ */ jsx("input", {
|
|
117
|
-
id: inputId,
|
|
118
|
-
className: classes.input,
|
|
119
|
-
value: code,
|
|
120
|
-
onChange: handleChange,
|
|
121
|
-
onKeyDown: handleKeyDown,
|
|
122
|
-
placeholder,
|
|
123
|
-
autoComplete: "off",
|
|
124
|
-
disabled: disabled || isApplying
|
|
125
|
-
}),
|
|
126
|
-
onApply ? /* @__PURE__ */ jsx(DiscountActionButton, {
|
|
127
|
-
surface,
|
|
128
|
-
className: classes.apply,
|
|
129
|
-
label: isApplying ? "Applying..." : applyLabel,
|
|
130
|
-
onClick: onApply,
|
|
131
|
-
disabled: disabled || isApplying || applyDisabled
|
|
132
|
-
}) : null,
|
|
133
|
-
/* @__PURE__ */ jsx(DiscountActionButton, {
|
|
134
|
-
surface,
|
|
135
|
-
className: classes.remove,
|
|
136
|
-
label: removeLabel,
|
|
137
|
-
onClick: onRemove,
|
|
138
|
-
disabled: disabled || isApplying
|
|
139
|
-
})
|
|
140
|
-
]
|
|
141
|
-
}),
|
|
142
|
-
/* @__PURE__ */ jsx("p", {
|
|
143
|
-
className: classes.hint,
|
|
144
|
-
children: hint
|
|
145
|
-
}),
|
|
146
|
-
feedback ? /* @__PURE__ */ jsx("p", {
|
|
147
|
-
className: feedbackClassName,
|
|
148
|
-
role: feedback.tone === "error" ? "alert" : "status",
|
|
149
|
-
children: feedback.message
|
|
150
|
-
}) : null
|
|
151
|
-
]
|
|
152
|
-
})
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
//#endregion
|
|
156
|
-
//#region ../blocks/src/system/runtime/shared/navigation/NavigationHandOffPanel.tsx
|
|
157
|
-
function NavigationHandOffPanel(props) {
|
|
158
|
-
const [opened, setOpened] = useState(false);
|
|
159
|
-
const payment = props.purpose === "payment";
|
|
160
|
-
const offering = props.offeringLabel?.toLowerCase() ?? "event";
|
|
161
|
-
return /* @__PURE__ */ jsxs("section", {
|
|
162
|
-
className: "rb-reg-stack er-stack",
|
|
163
|
-
"aria-live": "polite",
|
|
164
|
-
children: [
|
|
165
|
-
/* @__PURE__ */ jsx("h3", {
|
|
166
|
-
className: "er-title",
|
|
167
|
-
children: opened ? "Finish booking in the new tab" : payment ? "Finish paying in a new tab" : "Continue in a new tab"
|
|
168
|
-
}),
|
|
169
|
-
!opened && /* @__PURE__ */ jsx("p", {
|
|
170
|
-
className: "er-text",
|
|
171
|
-
children: handOffDescription(props, offering)
|
|
172
|
-
}),
|
|
173
|
-
opened && /* @__PURE__ */ jsxs("p", { children: ["Tab didn't open? ", /* @__PURE__ */ jsx("a", {
|
|
174
|
-
href: props.handOff.url,
|
|
175
|
-
target: "_blank",
|
|
176
|
-
rel: "noopener",
|
|
177
|
-
children: "Open the booking page"
|
|
178
|
-
})] }),
|
|
179
|
-
!opened && /* @__PURE__ */ jsx("a", {
|
|
180
|
-
className: "rb-button",
|
|
181
|
-
href: props.handOff.url,
|
|
182
|
-
target: "_blank",
|
|
183
|
-
rel: "noopener",
|
|
184
|
-
onClick: () => setOpened(true),
|
|
185
|
-
children: payment ? "Pay in a new tab" : "Continue in a new tab"
|
|
186
|
-
}),
|
|
187
|
-
/* @__PURE__ */ jsx("button", {
|
|
188
|
-
type: "button",
|
|
189
|
-
className: "er-portal-auth-link",
|
|
190
|
-
onClick: props.onBack,
|
|
191
|
-
children: props.purpose === "signIn" ? `Back to pay for this ${offering} instead` : "Back to my booking"
|
|
192
|
-
})
|
|
193
|
-
]
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
function handOffDescription(props, offering) {
|
|
197
|
-
if (props.purpose === "payment") return "We'll open a secure payment page in a new tab. Your booking is confirmed once you've paid.";
|
|
198
|
-
if (props.purpose === "signIn") return `You'll need to sign in to use a pass or membership. We'll open ${props.businessName ?? "the business"}'s booking page in a new tab, with this ${offering} already picked, and you can finish booking there. You'll need to enter your booking details again.`;
|
|
199
|
-
return "Open the booking page in a new tab to continue.";
|
|
200
|
-
}
|
|
201
|
-
//#endregion
|
|
202
20
|
//#region ../blocks/src/system/runtime/shared/siteTermsAgreement.ts
|
|
203
21
|
/** Submission evidence is derived exclusively from the displayed state. */
|
|
204
22
|
function siteTermsSubmission(view) {
|
|
@@ -626,119 +444,4 @@ function SiteTermsChangedNotice(props) {
|
|
|
626
444
|
});
|
|
627
445
|
}
|
|
628
446
|
//#endregion
|
|
629
|
-
|
|
630
|
-
const SUPPRESSED_CONFIRMATION_NOTE = "This is a demo, so we haven’t sent a confirmation email. You can still see your booking in the customer portal.";
|
|
631
|
-
function BookingConfirmation(props) {
|
|
632
|
-
const content = renderConfirmationMessage((props.demoEmailSuppressed ? [props.copy.message] : [props.copy.message, props.copy.defaultEmailSentence ?? ""]).filter((part) => part.trim().length > 0).join(" "), props.messagePresentation);
|
|
633
|
-
if (!props.demoEmailSuppressed) return content;
|
|
634
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [content, /* @__PURE__ */ jsx(DemoBookingPortalAccess, {
|
|
635
|
-
email: props.email,
|
|
636
|
-
noteClassName: props.noteClassName,
|
|
637
|
-
showConfirmationNote: props.showConfirmationNote
|
|
638
|
-
})] });
|
|
639
|
-
}
|
|
640
|
-
function DemoBookingPortalAccess(props) {
|
|
641
|
-
const { state, openPortal, back } = useDemoBookingPortalAccess(props.email);
|
|
642
|
-
if (state.tag === "handOff") return /* @__PURE__ */ jsx(NavigationHandOffPanel, {
|
|
643
|
-
handOff: state.handOff,
|
|
644
|
-
onBack: back
|
|
645
|
-
});
|
|
646
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
647
|
-
className: "rb-mt-4 rb-flex rb-flex-col rb-items-start rb-gap-3",
|
|
648
|
-
"data-testid": "demo-booking-portal-access",
|
|
649
|
-
children: [
|
|
650
|
-
props.showConfirmationNote === false ? null : /* @__PURE__ */ jsx("p", {
|
|
651
|
-
className: props.noteClassName ?? "ab-text",
|
|
652
|
-
children: SUPPRESSED_CONFIRMATION_NOTE
|
|
653
|
-
}),
|
|
654
|
-
/* @__PURE__ */ jsx(ThemedButton, {
|
|
655
|
-
type: "button",
|
|
656
|
-
variant: "default",
|
|
657
|
-
size: "md",
|
|
658
|
-
label: state.tag === "opening" ? "Opening…" : "Open the customer portal",
|
|
659
|
-
disabled: state.tag === "opening",
|
|
660
|
-
onClick: openPortal
|
|
661
|
-
}),
|
|
662
|
-
state.tag === "refused" ? /* @__PURE__ */ jsx("p", {
|
|
663
|
-
role: "alert",
|
|
664
|
-
children: state.message
|
|
665
|
-
}) : null,
|
|
666
|
-
state.tag === "error" ? /* @__PURE__ */ jsx("p", {
|
|
667
|
-
role: "alert",
|
|
668
|
-
children: state.message
|
|
669
|
-
}) : null
|
|
670
|
-
]
|
|
671
|
-
});
|
|
672
|
-
}
|
|
673
|
-
function renderConfirmationMessage(message, presentation) {
|
|
674
|
-
if (!message) return null;
|
|
675
|
-
switch (presentation.kind) {
|
|
676
|
-
case "paragraph": return /* @__PURE__ */ jsx("p", {
|
|
677
|
-
className: presentation.className,
|
|
678
|
-
children: message
|
|
679
|
-
});
|
|
680
|
-
case "plain": return message;
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
function useDemoBookingPortalAccess(email) {
|
|
684
|
-
const api = useBlockApi();
|
|
685
|
-
const [state, setState] = React.useState({ tag: "idle" });
|
|
686
|
-
const openPortal = async () => {
|
|
687
|
-
if (state.tag === "opening") return;
|
|
688
|
-
if (!email) {
|
|
689
|
-
setState({
|
|
690
|
-
tag: "error",
|
|
691
|
-
message: "We couldn’t open the customer portal. Please try again."
|
|
692
|
-
});
|
|
693
|
-
return;
|
|
694
|
-
}
|
|
695
|
-
setState({ tag: "opening" });
|
|
696
|
-
try {
|
|
697
|
-
const result = await requestDemoPortalMagicLink({
|
|
698
|
-
email,
|
|
699
|
-
redirectUrl: buildPortalCallbackUrl(window.location.origin, CUSTOMER_PORTAL_PATH),
|
|
700
|
-
send: (request) => api.sendMagicLink(request)
|
|
701
|
-
});
|
|
702
|
-
switch (result.kind) {
|
|
703
|
-
case "demo_sign_in":
|
|
704
|
-
const outcome = leavePage(result.url, api.config.pageNavigation);
|
|
705
|
-
if (outcome.kind === "handOff") setState({
|
|
706
|
-
tag: "handOff",
|
|
707
|
-
handOff: outcome
|
|
708
|
-
});
|
|
709
|
-
return;
|
|
710
|
-
case "refused":
|
|
711
|
-
setState({
|
|
712
|
-
tag: "refused",
|
|
713
|
-
message: result.message
|
|
714
|
-
});
|
|
715
|
-
return;
|
|
716
|
-
case "email_sent":
|
|
717
|
-
setState({ tag: "idle" });
|
|
718
|
-
return;
|
|
719
|
-
}
|
|
720
|
-
} catch (error) {
|
|
721
|
-
setState(handlePortalAccessError(error));
|
|
722
|
-
}
|
|
723
|
-
};
|
|
724
|
-
return {
|
|
725
|
-
state,
|
|
726
|
-
openPortal,
|
|
727
|
-
back: () => setState({ tag: "idle" })
|
|
728
|
-
};
|
|
729
|
-
}
|
|
730
|
-
function handlePortalAccessError(error) {
|
|
731
|
-
if (error instanceof BlockApiError && error.tag === "demo_email_not_booked_here") return {
|
|
732
|
-
tag: "refused",
|
|
733
|
-
message: error.message
|
|
734
|
-
};
|
|
735
|
-
return error instanceof BlockApiError ? {
|
|
736
|
-
tag: "error",
|
|
737
|
-
message: error.message
|
|
738
|
-
} : {
|
|
739
|
-
tag: "error",
|
|
740
|
-
message: "We couldn’t open the customer portal. Please try again."
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
//#endregion
|
|
744
|
-
export { siteTermsFailureKind as a, NavigationHandOffPanel as c, discountAvailabilityHasDiscounts as d, getAutoAppliedDiscountPreview as f, SiteTermsChangedNotice as i, DiscountCodeDisclosure as l, DemoBookingPortalAccess as n, useSiteTermsAgreement as o, SiteTermsAgreementField as r, eventSiteTermsSurface as s, BookingConfirmation as t, discountAvailabilityAllowsManualEntry as u };
|
|
447
|
+
export { eventSiteTermsSurface as a, useSiteTermsAgreement as i, SiteTermsChangedNotice as n, siteTermsFailureKind as r, SiteTermsAgreementField as t };
|
|
@@ -1,251 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { I as resolveEventRegistrationEventSource,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { r as boxStyleClassNames } from "./boxStyleClassNames-
|
|
2
|
+
import { I as resolveEventRegistrationEventSource, dt as cancelledDateCopy, ft as hasCancelledRegistrationDate, ut as closedRunCopy } from "./shop.interactive-CJAINJr3.mjs";
|
|
3
|
+
import { $a as planOrdinarySeriesSelection, Ja as resolveEventRegistrationScopedEvents, Ka as normalizeEventRegistrationPageSurfaceSubject, Lo as orderedLiveRunSessions, Qa as planDropInPanel, Ro as resolveWholeSeriesBookingPhase, Xa as getPublicEventCanonicalPath, Ya as eventOccurrenceContext, Za as isOrdinaryPublicEvent, ei as eventDateOptions, eo as planWholeSeriesParentBooking, io as selectionRepresentativeEvent, no as planWholeSeriesRunSelection, ro as resolveSelectionBookingClosedDetail, to as planWholeSeriesParentSelection, yr as bookingPresentation } from "./display-DMqotaGU.mjs";
|
|
4
|
+
import { gn as toUtcIsoDateTimeString, qt as formatDate } from "./noop-DF8_EiFt.mjs";
|
|
5
|
+
import { T as assertNever } from "./creditProducts-BQ1t1erI.mjs";
|
|
6
|
+
import { r as boxStyleClassNames } from "./boxStyleClassNames-C-gFwhnO.mjs";
|
|
7
7
|
import { i as ThemedButtonLink, r as ThemedButton } from "./ThemedButton-DuaYtnvG.mjs";
|
|
8
|
-
import { t as
|
|
9
|
-
import { n as StepIndicator$1, t as BookingPanelArrangement } from "./BookingPanelArrangement-C7yiJrxm.mjs";
|
|
8
|
+
import { n as StepIndicator$1, t as BookingPanelArrangement } from "./BookingPanelArrangement-DrdtON0q.mjs";
|
|
10
9
|
import { t as EVENT_REGISTRATION_ANCHOR_ID } from "./constants-4o4_hl34.mjs";
|
|
11
10
|
import React from "react";
|
|
12
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
//#region ../blocks/src/system/blocks/events/shared/pageSelection.ts
|
|
14
|
-
/**
|
|
15
|
-
* What a system-managed Event URL actually selected.
|
|
16
|
-
*
|
|
17
|
-
* The resolver used to assume that one returned `PublicEvent` meant one
|
|
18
|
-
* occurrence. A whole-series Event breaks that assumption in two directions: a
|
|
19
|
-
* parent Event path selects nothing concrete until a run is chosen, and a run
|
|
20
|
-
* path selects a run whose identity spans every one of its sessions. This
|
|
21
|
-
* module parses those cases once, so the renderer switches over a closed set of
|
|
22
|
-
* page states instead of probing booking scopes at render time.
|
|
23
|
-
*
|
|
24
|
-
* Everything here is pure. Loading events and resolving run slugs is the
|
|
25
|
-
* resolver's job; deciding what the page is and which runs the chooser
|
|
26
|
-
* advertises happens here. When a run is open to join, and where it sits in its
|
|
27
|
-
* own life, come from `@riverbankcms/core`: the same authority the
|
|
28
|
-
* public read projection and the write-side run-facts loader use, so a run
|
|
29
|
-
* cannot report itself open on the storefront and closed at the point of
|
|
30
|
-
* booking.
|
|
31
|
-
*/
|
|
32
|
-
function planWholeSeriesParentBooking(eligibleRuns) {
|
|
33
|
-
const [first, second, ...rest] = eligibleRuns;
|
|
34
|
-
if (!second) return {
|
|
35
|
-
kind: "single",
|
|
36
|
-
run: first
|
|
37
|
-
};
|
|
38
|
-
return eligibleRuns.every((group) => group.representative.allowsMultipleBooking) ? {
|
|
39
|
-
kind: "bookTogether",
|
|
40
|
-
runs: [
|
|
41
|
-
first,
|
|
42
|
-
second,
|
|
43
|
-
...rest
|
|
44
|
-
]
|
|
45
|
-
} : {
|
|
46
|
-
kind: "choice",
|
|
47
|
-
runs: eligibleRuns
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function isOrdinaryPublicEvent(event) {
|
|
51
|
-
return event.bookingScope === "single_occurrence";
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* What a series' own page shows when its URL names no date.
|
|
55
|
-
*
|
|
56
|
-
* Two or more dates a visitor can book make a choice: the page lists every
|
|
57
|
-
* date whose booking is open and lets the visitor pick, so a full date still
|
|
58
|
-
* shows as full rather than vanishing. One bookable date isn't a choice, so the
|
|
59
|
-
* page books that date. With none, the first date speaks for the page and shows
|
|
60
|
-
* its own full or closed state.
|
|
61
|
-
*
|
|
62
|
-
* The caller passes every date it read for the series, not the cards a listing
|
|
63
|
-
* happened to show, so the one-date shortcut is decided on the complete set.
|
|
64
|
-
* "Has places" isn't enough on its own: only a date whose booking is open
|
|
65
|
-
* counts, and a drop-in date never does.
|
|
66
|
-
*/
|
|
67
|
-
function planOrdinarySeriesSelection(events) {
|
|
68
|
-
const ordinary = events.filter(isOrdinaryPublicEvent);
|
|
69
|
-
const firstSeriesId = ordinary[0]?.seriesId;
|
|
70
|
-
if (!firstSeriesId || ordinary.some((event) => event.seriesId !== firstSeriesId)) return null;
|
|
71
|
-
const [first, second] = ordinary.filter(isBookableEvent);
|
|
72
|
-
if (first && second) {
|
|
73
|
-
const [a, b, ...rest] = [...ordinary].filter(isOpenForBooking).sort((left, right) => Date.parse(left.startsAt) - Date.parse(right.startsAt));
|
|
74
|
-
if (a && b) return {
|
|
75
|
-
kind: "dateChoice",
|
|
76
|
-
dates: [
|
|
77
|
-
a,
|
|
78
|
-
b,
|
|
79
|
-
...rest
|
|
80
|
-
]
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
const event = first ?? ordinary[0];
|
|
84
|
-
return event ? {
|
|
85
|
-
kind: "occurrence",
|
|
86
|
-
event
|
|
87
|
-
} : null;
|
|
88
|
-
}
|
|
89
|
-
function isOpenForBooking(event) {
|
|
90
|
-
return event.requiresRegistration && event.bookingAvailability.kind === "open";
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Whether a parent Event page advertises this run.
|
|
94
|
-
*
|
|
95
|
-
* Visibility admission belongs to the scoped public read. Active, still-open
|
|
96
|
-
* admitted runs are advertised, and a run that has started,
|
|
97
|
-
* finished or been cancelled is informational wherever it appears.
|
|
98
|
-
*
|
|
99
|
-
* Capacity is deliberately not consulted (decision A24/A30): a full date is
|
|
100
|
-
* still one of the dates on offer, and its own page shows the full or waitlist
|
|
101
|
-
* state that the registration engine decides. Hiding it here would leave a
|
|
102
|
-
* visitor unable to see that the date exists at all.
|
|
103
|
-
*/
|
|
104
|
-
function resolveWholeSeriesChooserEligibility(group, now) {
|
|
105
|
-
const status = group.representative.status;
|
|
106
|
-
if (status !== void 0 && status !== "active") return {
|
|
107
|
-
kind: "excluded",
|
|
108
|
-
reason: "series-not-active"
|
|
109
|
-
};
|
|
110
|
-
const phase = resolveWholeSeriesBookingPhase(group.run, now);
|
|
111
|
-
return phase.kind === "open" ? { kind: "eligible" } : {
|
|
112
|
-
kind: "excluded",
|
|
113
|
-
reason: phase.reason
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Runs in the order a visitor reads them: soonest first session first.
|
|
118
|
-
*
|
|
119
|
-
* A run with no session left to attend has no place in the sequence, so it
|
|
120
|
-
* sorts last rather than being given an arbitrary date.
|
|
121
|
-
*/
|
|
122
|
-
function orderRunsBySchedule(groups) {
|
|
123
|
-
return [...groups].sort((left, right) => {
|
|
124
|
-
const leftStart = firstLiveRunSessionStartMs(left.run.sessions);
|
|
125
|
-
const rightStart = firstLiveRunSessionStartMs(right.run.sessions);
|
|
126
|
-
if (leftStart === null) return rightStart === null ? 0 : 1;
|
|
127
|
-
if (rightStart === null) return -1;
|
|
128
|
-
return leftStart - rightStart;
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
function asNonEmpty(groups) {
|
|
132
|
-
const [first, ...rest] = groups;
|
|
133
|
-
return first ? [first, ...rest] : null;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* What a parent Event path selects.
|
|
137
|
-
*
|
|
138
|
-
* The scoped read admits public and unlisted runs for the offering's own page.
|
|
139
|
-
* The chooser lists the ones still open; when none is, the most recent
|
|
140
|
-
* admitted run supplies the page's name and copy. Runs from another offering
|
|
141
|
-
* cannot speak for this page.
|
|
142
|
-
*/
|
|
143
|
-
function planWholeSeriesParentSelection(input) {
|
|
144
|
-
const offeringRuns = orderRunsBySchedule(groupPublicEventsByRun(input.events).filter((group) => group.run.eventOfferingId === input.offeringId));
|
|
145
|
-
const eligibleRuns = asNonEmpty(offeringRuns.filter((group) => resolveWholeSeriesChooserEligibility(group, input.now).kind === "eligible"));
|
|
146
|
-
if (eligibleRuns) return {
|
|
147
|
-
kind: "wholeSeriesParent",
|
|
148
|
-
admittedRuns: offeringRuns,
|
|
149
|
-
offeringId: input.offeringId,
|
|
150
|
-
eligibleRuns
|
|
151
|
-
};
|
|
152
|
-
const informationalRun = offeringRuns.at(-1);
|
|
153
|
-
return informationalRun ? {
|
|
154
|
-
kind: "wholeSeriesParentUnavailable",
|
|
155
|
-
admittedRuns: offeringRuns,
|
|
156
|
-
offeringId: input.offeringId,
|
|
157
|
-
informationalRun,
|
|
158
|
-
bookingClosedDetail: resolveParentBookingClosedDetail(offeringRuns, input.now)
|
|
159
|
-
} : null;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* What a course page says when none of its runs is bookable.
|
|
163
|
-
*
|
|
164
|
-
* A run whose page is up without bookings carries its own reason, so the course
|
|
165
|
-
* speaks for the runs it has: if any of them was live and has been taken
|
|
166
|
-
* offline the course is closed for now, and otherwise it is waiting to open. A
|
|
167
|
-
* course whose runs are simply cancelled, under way or finished carries no
|
|
168
|
-
* reason at all, and the page keeps the words it already has for that.
|
|
169
|
-
*
|
|
170
|
-
* Only a run with a session still to come counts. A run that was paused a year
|
|
171
|
-
* ago and whose dates have all passed says nothing about the course now, and
|
|
172
|
-
* letting it speak would tell a visitor that a newly announced run is closed.
|
|
173
|
-
*/
|
|
174
|
-
function resolveParentBookingClosedDetail(runs, now) {
|
|
175
|
-
const details = runs.flatMap((group) => {
|
|
176
|
-
const detail = group.representative.bookingClosedDetail;
|
|
177
|
-
return detail && hasSessionAhead(group, now) ? [detail] : [];
|
|
178
|
-
});
|
|
179
|
-
if (details.length === 0) return null;
|
|
180
|
-
return details.some((detail) => detail.kind === "paused") ? { kind: "paused" } : { kind: "opensSoon" };
|
|
181
|
-
}
|
|
182
|
-
/** Whether the run still has a session a visitor could attend. */
|
|
183
|
-
function hasSessionAhead(group, now) {
|
|
184
|
-
return orderedLiveRunSessions(group.run.sessions).some((session) => Date.parse(session.startsAt) > now.getTime());
|
|
185
|
-
}
|
|
186
|
-
/** What a targeted run path selects, when the named run projected any data. */
|
|
187
|
-
function planWholeSeriesRunSelection(input) {
|
|
188
|
-
const group = groupPublicEventsByRun(input.events).find((candidate) => candidate.eventSeriesId === input.eventSeriesId);
|
|
189
|
-
if (!group) return null;
|
|
190
|
-
return {
|
|
191
|
-
kind: "wholeSeriesRun",
|
|
192
|
-
offeringId: group.run.eventOfferingId,
|
|
193
|
-
run: group
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* The Event record that speaks for a selection.
|
|
198
|
-
*
|
|
199
|
-
* Page metadata, the destination mode and the shared presentation all need one
|
|
200
|
-
* record; every variant has one, so callers never re-derive it.
|
|
201
|
-
*/
|
|
202
|
-
function selectionRepresentativeEvent(selection) {
|
|
203
|
-
switch (selection.kind) {
|
|
204
|
-
case "occurrence": return selection.event;
|
|
205
|
-
case "dateChoice": return selection.dates[0];
|
|
206
|
-
case "wholeSeriesParent": return selection.eligibleRuns[0].representative;
|
|
207
|
-
case "wholeSeriesParentUnavailable": return selection.informationalRun.representative;
|
|
208
|
-
case "wholeSeriesRun": return selection.run.representative;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Why this page is not taking bookings, when its own state says so.
|
|
213
|
-
*
|
|
214
|
-
* A parent course page answers for its runs; everything else answers for the
|
|
215
|
-
* record the page is about. `null` leaves the booking column exactly as it was.
|
|
216
|
-
*/
|
|
217
|
-
function resolveSelectionBookingClosedDetail(selection) {
|
|
218
|
-
switch (selection.kind) {
|
|
219
|
-
case "occurrence": return selection.event.bookingClosedDetail ?? null;
|
|
220
|
-
case "wholeSeriesRun": return selection.run.representative.bookingClosedDetail ?? null;
|
|
221
|
-
case "dateChoice":
|
|
222
|
-
case "wholeSeriesParent": return null;
|
|
223
|
-
case "wholeSeriesParentUnavailable": return selection.bookingClosedDetail;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
function planDropInPanel(selection) {
|
|
227
|
-
const detail = resolveSelectionBookingClosedDetail(selection);
|
|
228
|
-
if (detail === null) return { kind: "comeAlong" };
|
|
229
|
-
switch (detail.kind) {
|
|
230
|
-
case "opensSoon":
|
|
231
|
-
case "paused": return { kind: "notRunning" };
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
function getPublicEventCanonicalPath(event) {
|
|
235
|
-
if (event.path) return event.path;
|
|
236
|
-
return event.destination.kind === "native" ? event.destination.path : null;
|
|
237
|
-
}
|
|
238
|
-
function eventOccurrenceContext(event) {
|
|
239
|
-
return {
|
|
240
|
-
id: event.occurrenceId,
|
|
241
|
-
seriesId: event.seriesId,
|
|
242
|
-
startsAt: event.startsAt,
|
|
243
|
-
endsAt: event.endsAt,
|
|
244
|
-
timeZone: event.timeZone,
|
|
245
|
-
...event.occurrenceTitle ? { overrides: { title: event.occurrenceTitle } } : {}
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
//#endregion
|
|
249
12
|
//#region ../blocks/src/system/runtime/nodes/event-registration/BookingPanel.tsx
|
|
250
13
|
function EventBookingPanelView({ panel, pageKind, children }) {
|
|
251
14
|
const body = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(EventBookingPanelBody, { panel }), children] });
|
|
@@ -267,6 +30,16 @@ function EventBookingPanelView({ panel, pageKind, children }) {
|
|
|
267
30
|
function EventBookingPanelBody({ panel }) {
|
|
268
31
|
switch (panel.kind) {
|
|
269
32
|
case "registration": return null;
|
|
33
|
+
case "cancelled": return /* @__PURE__ */ jsxs("div", {
|
|
34
|
+
className: "event-booking-panel__cancelled",
|
|
35
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
36
|
+
className: "card-title rb-mb-3",
|
|
37
|
+
children: cancelledDateCopy.titleText
|
|
38
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
39
|
+
className: "status-muted rb-text-base rb-leading-relaxed",
|
|
40
|
+
children: cancelledDateCopy.bodyText
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
270
43
|
case "dropIn": return /* @__PURE__ */ jsx(DropInPanel, { panel: panel.panel });
|
|
271
44
|
case "bookingClosed": return /* @__PURE__ */ jsx(BookingClosedPanel, { detail: panel.detail });
|
|
272
45
|
case "closedRun": return /* @__PURE__ */ jsx(ClosedRunPanel, { reason: panel.reason });
|
|
@@ -286,6 +59,7 @@ function EventBookingPanelBody({ panel }) {
|
|
|
286
59
|
}
|
|
287
60
|
function SingleDateBooking({ run }) {
|
|
288
61
|
const href = getPublicEventCanonicalPath(run.representative);
|
|
62
|
+
const coversAll = wholeCourseNote(run);
|
|
289
63
|
return /* @__PURE__ */ jsxs("div", {
|
|
290
64
|
className: "event-booking-panel__single-date",
|
|
291
65
|
children: [
|
|
@@ -293,9 +67,9 @@ function SingleDateBooking({ run }) {
|
|
|
293
67
|
className: "card-title rb-mb-3",
|
|
294
68
|
children: "Book your place"
|
|
295
69
|
}),
|
|
296
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ jsxs("p", {
|
|
297
71
|
className: "event-booking-panel__run-dates status-muted rb-mb-4 rb-text-base rb-leading-relaxed",
|
|
298
|
-
children: describeRun(run)
|
|
72
|
+
children: [describeRun(run), coversAll ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("br", {}), coversAll] }) : null]
|
|
299
73
|
}),
|
|
300
74
|
href ? /* @__PURE__ */ jsx(ThemedButtonLink, {
|
|
301
75
|
variant: "primary",
|
|
@@ -389,11 +163,11 @@ function RunChooser({ runs }) {
|
|
|
389
163
|
})]
|
|
390
164
|
});
|
|
391
165
|
}
|
|
392
|
-
/** "12 sessions from 5 March" — enough to tell two runs apart in a list. */
|
|
166
|
+
/** "12 sessions from 5 March" — enough to tell two runs apart in a list. Cancelled sessions aren't counted. */
|
|
393
167
|
function describeRun(run) {
|
|
394
|
-
const
|
|
395
|
-
const
|
|
396
|
-
const
|
|
168
|
+
const sessions = orderedLiveRunSessions(run.run.sessions);
|
|
169
|
+
const first = sessions[0];
|
|
170
|
+
const sessionLabel = sessionCountLabel(sessions.length);
|
|
397
171
|
if (!first) return sessionLabel;
|
|
398
172
|
return `${sessionLabel} from ${formatDate({
|
|
399
173
|
kind: "instant",
|
|
@@ -406,6 +180,12 @@ function describeRun(run) {
|
|
|
406
180
|
weekday: "long"
|
|
407
181
|
})}`;
|
|
408
182
|
}
|
|
183
|
+
const sessionCountLabel = (count) => count === 1 ? "1 session" : `${count} sessions`;
|
|
184
|
+
/** Said before booking, as the first step of booking says it: one place covers the whole course. */
|
|
185
|
+
function wholeCourseNote(run) {
|
|
186
|
+
const count = orderedLiveRunSessions(run.run.sessions).length;
|
|
187
|
+
return count > 1 ? `One booking covers all ${count} sessions.` : null;
|
|
188
|
+
}
|
|
409
189
|
//#endregion
|
|
410
190
|
//#region ../blocks/src/system/runtime/nodes/event-registration/bookingPanelSelection.ts
|
|
411
191
|
/** Adapt a loaded page surface to the existing page planners. Catalogues keep their picker. */
|
|
@@ -464,6 +244,10 @@ function selectOccurrenceForPanel(events, occurrenceId) {
|
|
|
464
244
|
} : null;
|
|
465
245
|
}
|
|
466
246
|
function planEventBookingPanel({ selection, subject }, now) {
|
|
247
|
+
if (isCancelledDateSelection(selection)) return {
|
|
248
|
+
kind: "cancelled",
|
|
249
|
+
registration: null
|
|
250
|
+
};
|
|
467
251
|
const nonBookingPanel = planNonBookingPanel(selection);
|
|
468
252
|
switch (selection.kind) {
|
|
469
253
|
case "occurrence":
|
|
@@ -539,6 +323,10 @@ function selectionRegistrationTarget(selection, subject) {
|
|
|
539
323
|
};
|
|
540
324
|
}
|
|
541
325
|
}
|
|
326
|
+
/** Cancelled dates have no new-booking or recovery form, including old direct links. */
|
|
327
|
+
function isCancelledDateSelection(selection) {
|
|
328
|
+
return selection.kind === "occurrence" && hasCancelledRegistrationDate([selection.event]);
|
|
329
|
+
}
|
|
542
330
|
//#endregion
|
|
543
331
|
//#region ../blocks/src/system/runtime/nodes/event-registration/RegistrationClosedState.tsx
|
|
544
332
|
function RegistrationClosedState({ title, body }) {
|
|
@@ -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
|
//#region src/rendering/islands/enhancers/accordion.ts
|
|
4
4
|
const decode = defineIslandPropsDecoder("accordion");
|
|
5
5
|
function parseDefaultValues(value) {
|