@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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as BlockApiProvider } from "./context-
|
|
3
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
4
|
-
import { t as EventCalendarClient } from "./EventCalendar.client-
|
|
2
|
+
import { t as BlockApiProvider } from "./context-D8TpQXjX.mjs";
|
|
3
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-ChYKWjLA.mjs";
|
|
4
|
+
import { t as EventCalendarClient } from "./EventCalendar.client-Dg4PHFJJ.mjs";
|
|
5
5
|
import { t as mountReactIsland } from "./reactMount-DFQy3CmO.mjs";
|
|
6
|
-
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-
|
|
6
|
+
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-CcGWvyht.mjs";
|
|
7
7
|
import "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
//#region src/rendering/islands/enhancers/eventCalendar.tsx
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as BlockApiProvider } from "./context-
|
|
3
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
4
|
-
import { n as EventCombinedIslandClient } from "./EventCombined.client-
|
|
2
|
+
import { t as BlockApiProvider } from "./context-D8TpQXjX.mjs";
|
|
3
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-ChYKWjLA.mjs";
|
|
4
|
+
import { n as EventCombinedIslandClient } from "./EventCombined.client-tky8JcnQ.mjs";
|
|
5
5
|
import { t as mountReactIsland } from "./reactMount-DFQy3CmO.mjs";
|
|
6
|
-
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-
|
|
6
|
+
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-CcGWvyht.mjs";
|
|
7
7
|
import "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
//#region src/rendering/islands/enhancers/eventCombined.tsx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
3
|
-
import { t as EventDetailsIslandClient } from "./event-details.client-
|
|
2
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-ChYKWjLA.mjs";
|
|
3
|
+
import { t as EventDetailsIslandClient } from "./event-details.client-CJapNbTv.mjs";
|
|
4
4
|
import { t as mountReactIsland } from "./reactMount-DFQy3CmO.mjs";
|
|
5
5
|
import "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as BlockApiProvider } from "./context-
|
|
3
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
4
|
-
import { t as EventListingClient } from "./EventListing.client-
|
|
2
|
+
import { t as BlockApiProvider } from "./context-D8TpQXjX.mjs";
|
|
3
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-ChYKWjLA.mjs";
|
|
4
|
+
import { t as EventListingClient } from "./EventListing.client-DQx9dohz.mjs";
|
|
5
5
|
import { t as mountReactIsland } from "./reactMount-DFQy3CmO.mjs";
|
|
6
|
-
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-
|
|
6
|
+
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-CcGWvyht.mjs";
|
|
7
7
|
import "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
//#region src/rendering/islands/enhancers/eventListing.tsx
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { n as EventRegistrationIslandClient } from "./event-registration.client-
|
|
3
|
-
import { t as BlockApiProvider } from "./context-
|
|
4
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
2
|
+
import { n as EventRegistrationIslandClient } from "./event-registration.client-CAdcpnLc.mjs";
|
|
3
|
+
import { t as BlockApiProvider } from "./context-D8TpQXjX.mjs";
|
|
4
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-ChYKWjLA.mjs";
|
|
5
5
|
import { t as mountReactIsland } from "./reactMount-DFQy3CmO.mjs";
|
|
6
|
-
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-
|
|
6
|
+
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-CcGWvyht.mjs";
|
|
7
7
|
import "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
//#region src/rendering/islands/enhancers/eventRegistration.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as BlockApiProvider } from "./context-
|
|
3
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
4
|
-
import { t as FormNodeClient } from "./form.client-
|
|
2
|
+
import { t as BlockApiProvider } from "./context-D8TpQXjX.mjs";
|
|
3
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-ChYKWjLA.mjs";
|
|
4
|
+
import { t as FormNodeClient } from "./form.client-BU6dM0-C.mjs";
|
|
5
5
|
import { t as mountReactIsland } from "./reactMount-DFQy3CmO.mjs";
|
|
6
6
|
import { n as snapshotForm, t as restoreForm } from "./formSnapshot-Cy4abc0T.mjs";
|
|
7
7
|
import "react";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { i as ok, n as assertNever, r as err } from "./noop-DF8_EiFt.mjs";
|
|
3
|
+
import { n as useBlockApi } from "./context-D8TpQXjX.mjs";
|
|
4
|
+
import { r as listLookSlot } from "./lookSurfaces-BDZLALxj.mjs";
|
|
5
5
|
import { S as clsx } from "./ThemedButton-DuaYtnvG.mjs";
|
|
6
6
|
import { t as FeedbackMessage } from "./FeedbackMessage-CSJrAuXH.mjs";
|
|
7
|
-
import { n as FormSubmitAction, t as FormFieldGroups } from "./form.parts-
|
|
7
|
+
import { n as FormSubmitAction, t as FormFieldGroups } from "./form.parts-Db0Iq7nx.mjs";
|
|
8
8
|
import { t as SpamProtectionWidget } from "./SpamProtectionWidget-CCF6YLUX.mjs";
|
|
9
9
|
import { t as useAltchaProtection } from "./altchaProtection-DjIV9A5n.mjs";
|
|
10
10
|
import { useReducer, useRef } from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { n as listLookControl, r as listLookSlot } from "./lookSurfaces-BDZLALxj.mjs";
|
|
3
3
|
import { t as CheckboxChoice } from "./CheckboxChoice-b-PJLEXe.mjs";
|
|
4
4
|
import { t as ProtectedSubmitButton } from "./ProtectedSubmitButton-C-ql101B.mjs";
|
|
5
5
|
import "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { Yt as formatDateTime, hn as parseUtcIsoDateTimeString, qt as formatDate$1, un as parseBookingLocalDate } from "./noop-DF8_EiFt.mjs";
|
|
3
3
|
//#region ../blocks/src/bindings/formatDate.ts
|
|
4
4
|
/** Admit stored civil dates or offset-aware instants before core projection. */
|
|
5
5
|
function formatDate(value, context, options) {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
|
-
import {
|
|
4
|
-
import { i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "../context-
|
|
3
|
+
import { Sn as formatGiftCardAmountLabel, gn as toUtcIsoDateTimeString, pn as resolveBookingTimeZoneId, qt as formatDate, t as logger } from "../noop-DF8_EiFt.mjs";
|
|
4
|
+
import { i as BlockApiError, n as useBlockApi, t as BlockApiProvider } from "../context-D8TpQXjX.mjs";
|
|
5
5
|
import { i as ThemedButtonLink, r as ThemedButton } from "../ThemedButton-DuaYtnvG.mjs";
|
|
6
6
|
import { t as CheckIcon } from "../CheckIcon-CVcKteXH.mjs";
|
|
7
|
+
import { s as readChosenGiftAmounts } from "../gifting.parts-C2u4Y-pf.mjs";
|
|
8
|
+
import { t as GiftingClient } from "../gifting.client-BVa2XYJB.mjs";
|
|
7
9
|
import React from "react";
|
|
8
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
11
|
import { useRouter } from "next/navigation";
|
|
@@ -476,4 +478,4 @@ function RedeemGiftCardRouteClient(props) {
|
|
|
476
478
|
});
|
|
477
479
|
}
|
|
478
480
|
//#endregion
|
|
479
|
-
export { RedeemGiftCard, RedeemGiftCardRouteClient };
|
|
481
|
+
export { BlockApiProvider, GiftingClient, RedeemGiftCard, RedeemGiftCardRouteClient, readChosenGiftAmounts };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as BlockApiProvider } from "./context-D8TpQXjX.mjs";
|
|
3
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-ChYKWjLA.mjs";
|
|
4
|
+
import { s as readChosenGiftAmounts } from "./gifting.parts-C2u4Y-pf.mjs";
|
|
5
|
+
import { t as GiftingClient } from "./gifting.client-BVa2XYJB.mjs";
|
|
6
|
+
import { t as mountReactIsland } from "./reactMount-DFQy3CmO.mjs";
|
|
7
|
+
import "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
//#region src/rendering/islands/enhancers/gifting.tsx
|
|
10
|
+
const decode = defineIslandPropsDecoder("gifting");
|
|
11
|
+
const enhance = (root, props) => {
|
|
12
|
+
const { siteId, apiBaseUrl } = props;
|
|
13
|
+
if (!siteId) throw new Error("[sdk:islands] gifting requires siteId");
|
|
14
|
+
if (!apiBaseUrl) throw new Error("[sdk:islands] gifting requires apiBaseUrl");
|
|
15
|
+
return mountReactIsland(root, /* @__PURE__ */ jsx(BlockApiProvider, {
|
|
16
|
+
config: {
|
|
17
|
+
baseUrl: apiBaseUrl,
|
|
18
|
+
auth: { type: "none" },
|
|
19
|
+
siteId
|
|
20
|
+
},
|
|
21
|
+
children: /* @__PURE__ */ jsx(GiftingClient, {
|
|
22
|
+
...props,
|
|
23
|
+
chosenAmounts: readChosenGiftAmounts(root)
|
|
24
|
+
})
|
|
25
|
+
}));
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { decode, enhance };
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { n as assertNever, xn as formatCurrencyAmount } from "./noop-DF8_EiFt.mjs";
|
|
3
|
+
import { i as useSiteTermsAgreement, n as SiteTermsChangedNotice, t as SiteTermsAgreementField } from "./SiteTermsAgreementField-Dr5lj4oY.mjs";
|
|
4
|
+
import { n as useBlockApi } from "./context-D8TpQXjX.mjs";
|
|
5
|
+
import { r as ThemedButton } from "./ThemedButton-DuaYtnvG.mjs";
|
|
6
|
+
import { t as FeedbackMessage } from "./FeedbackMessage-CSJrAuXH.mjs";
|
|
7
|
+
import { a as giftingEyebrow, i as firstGiftAmountChoice, n as GiftCardAmounts, o as giftingSlot, r as GiftingPanelHead } from "./gifting.parts-C2u4Y-pf.mjs";
|
|
8
|
+
import { startTransition, useEffect, useReducer, useRef, useState } from "react";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region ../blocks/src/system/runtime/nodes/gifting.client.state.ts
|
|
11
|
+
function createInitialGiftingClientState(initialOffers) {
|
|
12
|
+
return {
|
|
13
|
+
offers: initialOffers,
|
|
14
|
+
submittingOfferId: null,
|
|
15
|
+
errorMessage: null,
|
|
16
|
+
purchaseNotice: null,
|
|
17
|
+
submissions: /* @__PURE__ */ new Map()
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function giftingClientReducer(state, action) {
|
|
21
|
+
switch (action.type) {
|
|
22
|
+
case "offersLoaded": return {
|
|
23
|
+
...state,
|
|
24
|
+
offers: action.offers,
|
|
25
|
+
errorMessage: null
|
|
26
|
+
};
|
|
27
|
+
case "offersFailed": return {
|
|
28
|
+
...state,
|
|
29
|
+
errorMessage: action.message
|
|
30
|
+
};
|
|
31
|
+
case "checkoutStarted": return {
|
|
32
|
+
...state,
|
|
33
|
+
submittingOfferId: action.offerId,
|
|
34
|
+
errorMessage: null,
|
|
35
|
+
submissions: new Map([...state.submissions, [action.offerId, action.submission]])
|
|
36
|
+
};
|
|
37
|
+
case "checkoutFailed": return {
|
|
38
|
+
...state,
|
|
39
|
+
submittingOfferId: null,
|
|
40
|
+
errorMessage: action.message
|
|
41
|
+
};
|
|
42
|
+
case "purchaseNoticeResolved": return {
|
|
43
|
+
...state,
|
|
44
|
+
purchaseNotice: action.notice
|
|
45
|
+
};
|
|
46
|
+
case "pageRestored": return {
|
|
47
|
+
...state,
|
|
48
|
+
submittingOfferId: null
|
|
49
|
+
};
|
|
50
|
+
default: return assertNever(action);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function resolveGiftingPurchaseNotice(search, defaultSuccessMessage) {
|
|
54
|
+
switch (new URLSearchParams(search).get("gifting")) {
|
|
55
|
+
case null: return null;
|
|
56
|
+
case "success": return {
|
|
57
|
+
kind: "success",
|
|
58
|
+
message: defaultSuccessMessage
|
|
59
|
+
};
|
|
60
|
+
case "cancelled": return {
|
|
61
|
+
kind: "cancelled",
|
|
62
|
+
message: "Purchase cancelled."
|
|
63
|
+
};
|
|
64
|
+
default: return null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function toGiftingControllerProps(props) {
|
|
68
|
+
return {
|
|
69
|
+
className: props.render.display.className,
|
|
70
|
+
heading: props.render.display.heading,
|
|
71
|
+
intro: props.render.display.intro,
|
|
72
|
+
giftCardsHeading: props.render.display.giftCardsHeading,
|
|
73
|
+
vouchersHeading: props.render.display.vouchersHeading,
|
|
74
|
+
emptyStateText: props.render.display.emptyStateText,
|
|
75
|
+
checkoutButtonText: props.render.hydration.checkoutButtonText,
|
|
76
|
+
successMessage: props.render.hydration.successMessage
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function buildGiftingCheckoutReturnUrl(currentHref, kind) {
|
|
80
|
+
const url = new URL(currentHref);
|
|
81
|
+
url.searchParams.set("gifting", kind);
|
|
82
|
+
return url.toString();
|
|
83
|
+
}
|
|
84
|
+
function hasPublicGiftingOffers(offers) {
|
|
85
|
+
return Boolean((offers?.giftCards.length ?? 0) > 0 || (offers?.vouchers.length ?? 0) > 0);
|
|
86
|
+
}
|
|
87
|
+
function buildGiftingCheckoutInput(formData, input) {
|
|
88
|
+
const readFormString = (name) => {
|
|
89
|
+
const value = formData.get(name);
|
|
90
|
+
return typeof value === "string" ? value : "";
|
|
91
|
+
};
|
|
92
|
+
const selectedAmount = formData.get("amountChoice");
|
|
93
|
+
const customAmount = formData.get("customAmount");
|
|
94
|
+
const amountCents = input.kind === "gift_card" ? selectedAmount === "custom" ? Math.round(Number(customAmount ?? 0) * 100) : Number(selectedAmount ?? 0) : null;
|
|
95
|
+
return {
|
|
96
|
+
purchaseToken: input.purchaseToken,
|
|
97
|
+
offerId: input.offerId,
|
|
98
|
+
purchaserName: readFormString("purchaserName") || null,
|
|
99
|
+
purchaserEmail: readFormString("purchaserEmail"),
|
|
100
|
+
recipientName: readFormString("recipientName") || null,
|
|
101
|
+
recipientEmail: readFormString("recipientEmail"),
|
|
102
|
+
message: readFormString("message") || null,
|
|
103
|
+
amountCents,
|
|
104
|
+
sendOnDate: readFormString("sendOnDate") || null,
|
|
105
|
+
successUrl: input.successUrl,
|
|
106
|
+
cancelUrl: input.cancelUrl
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/** Retries of the same form keep one purchase; changed details start another. */
|
|
110
|
+
function giftingSubmission(previous, fields, createToken) {
|
|
111
|
+
return previous?.fields === fields ? previous : {
|
|
112
|
+
fields,
|
|
113
|
+
token: createToken()
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region ../blocks/src/system/runtime/nodes/gifting.client.tsx
|
|
118
|
+
function GiftingClient(props) {
|
|
119
|
+
const api = useBlockApi();
|
|
120
|
+
const siteTerms = useSiteTermsAgreement({
|
|
121
|
+
terms: props.render.hydration.siteTerms,
|
|
122
|
+
context: { kind: "purchase" }
|
|
123
|
+
});
|
|
124
|
+
const controller = toGiftingControllerProps(props);
|
|
125
|
+
const [state, dispatch] = useReducer(giftingClientReducer, props.render.hydration.offers, createInitialGiftingClientState);
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
dispatch({
|
|
128
|
+
type: "purchaseNoticeResolved",
|
|
129
|
+
notice: resolveGiftingPurchaseNotice(window.location.search, props.render.hydration.successMessage)
|
|
130
|
+
});
|
|
131
|
+
}, [props.render.hydration.successMessage]);
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
if (state.offers) return;
|
|
134
|
+
let cancelled = false;
|
|
135
|
+
startTransition(() => {
|
|
136
|
+
api.getPublicGiftingOffers().then((nextOffers) => {
|
|
137
|
+
if (!cancelled) dispatch({
|
|
138
|
+
type: "offersLoaded",
|
|
139
|
+
offers: nextOffers
|
|
140
|
+
});
|
|
141
|
+
}).catch((error) => {
|
|
142
|
+
if (!cancelled) dispatch({
|
|
143
|
+
type: "offersFailed",
|
|
144
|
+
message: error instanceof Error ? error.message : "Unable to load gift offers."
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
return () => {
|
|
149
|
+
cancelled = true;
|
|
150
|
+
};
|
|
151
|
+
}, [api, state.offers]);
|
|
152
|
+
useEffect(() => {
|
|
153
|
+
const onPageShow = (event) => {
|
|
154
|
+
if (event.persisted) dispatch({ type: "pageRestored" });
|
|
155
|
+
};
|
|
156
|
+
window.addEventListener("pageshow", onPageShow);
|
|
157
|
+
return () => window.removeEventListener("pageshow", onPageShow);
|
|
158
|
+
}, []);
|
|
159
|
+
const hasOffers = hasPublicGiftingOffers(state.offers);
|
|
160
|
+
async function handleSubmit(event, offerId, kind) {
|
|
161
|
+
event.preventDefault();
|
|
162
|
+
if (!siteTerms.requireAgreement("commerce")) return;
|
|
163
|
+
const formData = new FormData(event.currentTarget);
|
|
164
|
+
const fields = JSON.stringify([...formData.entries()]);
|
|
165
|
+
const submission = giftingSubmission(state.submissions.get(offerId), fields, () => crypto.randomUUID());
|
|
166
|
+
dispatch({
|
|
167
|
+
type: "checkoutStarted",
|
|
168
|
+
offerId,
|
|
169
|
+
submission
|
|
170
|
+
});
|
|
171
|
+
try {
|
|
172
|
+
const checkout = await siteTerms.api.createGiftingCheckout(buildGiftingCheckoutInput(formData, {
|
|
173
|
+
offerId,
|
|
174
|
+
purchaseToken: submission.token,
|
|
175
|
+
kind,
|
|
176
|
+
successUrl: buildGiftingCheckoutReturnUrl(window.location.href, "success"),
|
|
177
|
+
cancelUrl: buildGiftingCheckoutReturnUrl(window.location.href, "cancelled")
|
|
178
|
+
}));
|
|
179
|
+
window.location.href = checkout.checkoutUrl;
|
|
180
|
+
} catch (error) {
|
|
181
|
+
dispatch({
|
|
182
|
+
type: "checkoutFailed",
|
|
183
|
+
message: error instanceof Error ? error.message : "Unable to start checkout."
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
const offers = state.offers;
|
|
188
|
+
const currency = offers?.currency ?? "GBP";
|
|
189
|
+
const giftCards = offers?.giftCards ?? [];
|
|
190
|
+
const vouchers = offers?.vouchers ?? [];
|
|
191
|
+
const eyebrow = giftingEyebrow(offers, {
|
|
192
|
+
giftCards: controller.giftCardsHeading ?? "Gift cards",
|
|
193
|
+
vouchers: controller.vouchersHeading ?? "Vouchers"
|
|
194
|
+
});
|
|
195
|
+
const look = props.render.display;
|
|
196
|
+
const purchaseFields = (offerId) => /* @__PURE__ */ jsx(GiftingPurchaseFields, {
|
|
197
|
+
siteTerms,
|
|
198
|
+
submitting: state.submittingOfferId === offerId,
|
|
199
|
+
buttonText: controller.checkoutButtonText ?? "Continue"
|
|
200
|
+
});
|
|
201
|
+
return /* @__PURE__ */ jsx("section", {
|
|
202
|
+
className: controller.className ?? void 0,
|
|
203
|
+
"data-block": "gifting",
|
|
204
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
205
|
+
className: "gifting-panel",
|
|
206
|
+
...giftingSlot(look, "panel"),
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ jsx(GiftingPanelHead, {
|
|
209
|
+
eyebrow,
|
|
210
|
+
heading: props.render.display.heading,
|
|
211
|
+
intro: props.render.display.intro,
|
|
212
|
+
look
|
|
213
|
+
}),
|
|
214
|
+
state.purchaseNotice ? /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
215
|
+
tone: state.purchaseNotice.kind === "success" ? "success" : "warning",
|
|
216
|
+
className: "gifting-feedback",
|
|
217
|
+
role: "status",
|
|
218
|
+
children: state.purchaseNotice.message
|
|
219
|
+
}) : null,
|
|
220
|
+
state.errorMessage ? /* @__PURE__ */ jsx(FeedbackMessage, {
|
|
221
|
+
tone: "error",
|
|
222
|
+
className: "gifting-feedback",
|
|
223
|
+
role: "alert",
|
|
224
|
+
children: state.errorMessage
|
|
225
|
+
}) : null,
|
|
226
|
+
/* @__PURE__ */ jsx(SiteTermsChangedNotice, { message: siteTerms.notice }),
|
|
227
|
+
hasOffers ? /* @__PURE__ */ jsxs("div", {
|
|
228
|
+
className: "gifting-panel-offers",
|
|
229
|
+
children: [giftCards.map((offer) => /* @__PURE__ */ jsx(GiftCardOfferForm, {
|
|
230
|
+
offer,
|
|
231
|
+
currency,
|
|
232
|
+
showTitle: giftCards.length > 1,
|
|
233
|
+
initialAmount: props.chosenAmounts?.[offer.id],
|
|
234
|
+
look,
|
|
235
|
+
onSubmit: (event) => void handleSubmit(event, offer.id, "gift_card"),
|
|
236
|
+
fields: purchaseFields(offer.id)
|
|
237
|
+
}, offer.id)), vouchers.map((offer) => /* @__PURE__ */ jsxs(RevealingOfferForm, {
|
|
238
|
+
buyLabel: "Buy this voucher",
|
|
239
|
+
look,
|
|
240
|
+
onSubmit: (event) => void handleSubmit(event, offer.id, "voucher"),
|
|
241
|
+
fields: purchaseFields(offer.id),
|
|
242
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
243
|
+
className: "gifting-offer-summary",
|
|
244
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
245
|
+
className: "gifting-offer-title",
|
|
246
|
+
children: offer.title
|
|
247
|
+
}), /* @__PURE__ */ jsx("strong", { children: formatCurrencyAmount(offer.voucher.purchaseAmountCents, currency) })]
|
|
248
|
+
}), offer.description ? /* @__PURE__ */ jsx("p", {
|
|
249
|
+
className: "gifting-offer-description",
|
|
250
|
+
children: offer.description
|
|
251
|
+
}) : null]
|
|
252
|
+
}, offer.id))]
|
|
253
|
+
}) : /* @__PURE__ */ jsx("p", {
|
|
254
|
+
className: "gifting-empty",
|
|
255
|
+
children: controller.emptyStateText ?? "Nothing is available right now."
|
|
256
|
+
})
|
|
257
|
+
]
|
|
258
|
+
})
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
function GiftCardOfferForm(props) {
|
|
262
|
+
const { offer, currency } = props;
|
|
263
|
+
const [amountChoice, setAmountChoice] = useState(() => props.initialAmount ?? firstGiftAmountChoice(offer));
|
|
264
|
+
return /* @__PURE__ */ jsxs(RevealingOfferForm, {
|
|
265
|
+
buyLabel: "Buy a gift card",
|
|
266
|
+
look: props.look,
|
|
267
|
+
onSubmit: props.onSubmit,
|
|
268
|
+
fields: props.fields,
|
|
269
|
+
row: /* @__PURE__ */ jsx(GiftCardAmounts, {
|
|
270
|
+
offer,
|
|
271
|
+
currency,
|
|
272
|
+
initialChoice: props.initialAmount,
|
|
273
|
+
onChoose: setAmountChoice,
|
|
274
|
+
look: props.look
|
|
275
|
+
}),
|
|
276
|
+
extraFields: amountChoice === "custom" ? /* @__PURE__ */ jsx(CustomGiftAmount, { offer }) : null,
|
|
277
|
+
children: [props.showTitle ? /* @__PURE__ */ jsx("h3", {
|
|
278
|
+
className: "gifting-offer-title",
|
|
279
|
+
children: offer.title
|
|
280
|
+
}) : null, offer.description ? /* @__PURE__ */ jsx("p", {
|
|
281
|
+
className: "gifting-offer-description",
|
|
282
|
+
children: offer.description
|
|
283
|
+
}) : null]
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
function CustomGiftAmount({ offer }) {
|
|
287
|
+
const min = offer.giftCard.customAmountMinCents / 100;
|
|
288
|
+
const max = offer.giftCard.customAmountMaxCents / 100;
|
|
289
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
290
|
+
className: "gifting-field",
|
|
291
|
+
children: [/* @__PURE__ */ jsx("span", { children: "Amount" }), /* @__PURE__ */ jsx("input", {
|
|
292
|
+
type: "number",
|
|
293
|
+
name: "customAmount",
|
|
294
|
+
required: true,
|
|
295
|
+
min,
|
|
296
|
+
max,
|
|
297
|
+
step: "1",
|
|
298
|
+
placeholder: `${min} - ${max}`
|
|
299
|
+
})]
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
/** The panel stays short until someone wants to buy: the details open from the buy button, and focus moves to them. */
|
|
303
|
+
function RevealingOfferForm(props) {
|
|
304
|
+
const [open, setOpen] = useState(false);
|
|
305
|
+
const detailsRef = useRef(null);
|
|
306
|
+
useEffect(() => {
|
|
307
|
+
if (open) detailsRef.current?.querySelector("input")?.focus();
|
|
308
|
+
}, [open]);
|
|
309
|
+
return /* @__PURE__ */ jsxs("form", {
|
|
310
|
+
onSubmit: props.onSubmit,
|
|
311
|
+
className: "gifting-offer",
|
|
312
|
+
children: [
|
|
313
|
+
props.children,
|
|
314
|
+
/* @__PURE__ */ jsxs("div", {
|
|
315
|
+
className: "gifting-offer-row",
|
|
316
|
+
"data-gift-offer-row": "",
|
|
317
|
+
children: [props.row, open ? null : /* @__PURE__ */ jsx(ThemedButton, {
|
|
318
|
+
...giftingSlot(props.look, "action"),
|
|
319
|
+
type: "button",
|
|
320
|
+
variant: "primary",
|
|
321
|
+
size: "md",
|
|
322
|
+
extraClassName: "gifting-buy",
|
|
323
|
+
label: props.buyLabel,
|
|
324
|
+
onClick: () => setOpen(true)
|
|
325
|
+
})]
|
|
326
|
+
}),
|
|
327
|
+
open ? /* @__PURE__ */ jsxs("div", {
|
|
328
|
+
ref: detailsRef,
|
|
329
|
+
className: "gifting-fields",
|
|
330
|
+
children: [props.extraFields, props.fields]
|
|
331
|
+
}) : null
|
|
332
|
+
]
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
function GiftingCustomerFields() {
|
|
336
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
337
|
+
/* @__PURE__ */ jsxs("div", {
|
|
338
|
+
className: "gifting-field-grid",
|
|
339
|
+
children: [
|
|
340
|
+
/* @__PURE__ */ jsxs("label", {
|
|
341
|
+
className: "gifting-field",
|
|
342
|
+
children: [/* @__PURE__ */ jsx("span", { children: "Your name" }), /* @__PURE__ */ jsx("input", { name: "purchaserName" })]
|
|
343
|
+
}),
|
|
344
|
+
/* @__PURE__ */ jsxs("label", {
|
|
345
|
+
className: "gifting-field",
|
|
346
|
+
children: [/* @__PURE__ */ jsx("span", { children: "Your email" }), /* @__PURE__ */ jsx("input", {
|
|
347
|
+
name: "purchaserEmail",
|
|
348
|
+
type: "email",
|
|
349
|
+
required: true
|
|
350
|
+
})]
|
|
351
|
+
}),
|
|
352
|
+
/* @__PURE__ */ jsxs("label", {
|
|
353
|
+
className: "gifting-field",
|
|
354
|
+
children: [/* @__PURE__ */ jsx("span", { children: "Recipient name" }), /* @__PURE__ */ jsx("input", { name: "recipientName" })]
|
|
355
|
+
}),
|
|
356
|
+
/* @__PURE__ */ jsxs("label", {
|
|
357
|
+
className: "gifting-field",
|
|
358
|
+
children: [/* @__PURE__ */ jsx("span", { children: "Recipient email" }), /* @__PURE__ */ jsx("input", {
|
|
359
|
+
name: "recipientEmail",
|
|
360
|
+
type: "email",
|
|
361
|
+
required: true
|
|
362
|
+
})]
|
|
363
|
+
})
|
|
364
|
+
]
|
|
365
|
+
}),
|
|
366
|
+
/* @__PURE__ */ jsxs("label", {
|
|
367
|
+
className: "gifting-field",
|
|
368
|
+
children: [/* @__PURE__ */ jsx("span", { children: "Message" }), /* @__PURE__ */ jsx("textarea", {
|
|
369
|
+
name: "message",
|
|
370
|
+
rows: 4
|
|
371
|
+
})]
|
|
372
|
+
}),
|
|
373
|
+
/* @__PURE__ */ jsxs("label", {
|
|
374
|
+
className: "gifting-field",
|
|
375
|
+
children: [/* @__PURE__ */ jsx("span", { children: "Send on" }), /* @__PURE__ */ jsx("input", {
|
|
376
|
+
name: "sendOnDate",
|
|
377
|
+
type: "date"
|
|
378
|
+
})]
|
|
379
|
+
})
|
|
380
|
+
] });
|
|
381
|
+
}
|
|
382
|
+
function GiftingPurchaseFields(props) {
|
|
383
|
+
const { siteTerms } = props;
|
|
384
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
385
|
+
/* @__PURE__ */ jsx(GiftingCustomerFields, {}),
|
|
386
|
+
/* @__PURE__ */ jsx(SiteTermsAgreementField, {
|
|
387
|
+
agreement: siteTerms.view,
|
|
388
|
+
onChange: siteTerms.onChange,
|
|
389
|
+
error: siteTerms.error,
|
|
390
|
+
disabled: siteTerms.disabled || props.submitting
|
|
391
|
+
}),
|
|
392
|
+
/* @__PURE__ */ jsx(ThemedButton, {
|
|
393
|
+
type: "submit",
|
|
394
|
+
variant: "primary",
|
|
395
|
+
size: "md",
|
|
396
|
+
extraClassName: "gifting-buy",
|
|
397
|
+
pending: props.submitting ? { label: "Starting checkout…" } : void 0,
|
|
398
|
+
disabled: props.submitting,
|
|
399
|
+
label: props.buttonText
|
|
400
|
+
})
|
|
401
|
+
] });
|
|
402
|
+
}
|
|
403
|
+
//#endregion
|
|
404
|
+
export { GiftingClient as t };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { xn as formatCurrencyAmount } from "./noop-DF8_EiFt.mjs";
|
|
3
|
+
import { r as listLookSlot } from "./lookSurfaces-BDZLALxj.mjs";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region ../blocks/src/system/runtime/nodes/gifting.parts.tsx
|
|
7
|
+
const CUSTOM_GIFT_AMOUNT = "custom";
|
|
8
|
+
/** A Look's hook (and, for the panel, its surface) on one part of the gifting panel; nothing outside a Look. */
|
|
9
|
+
function giftingSlot(look, slot) {
|
|
10
|
+
return listLookSlot(look ?? {}, slot);
|
|
11
|
+
}
|
|
12
|
+
/** The word above the heading: only one kind on offer names it here, two kinds label their own groups. */
|
|
13
|
+
function giftingEyebrow(offers, headings) {
|
|
14
|
+
const giftCards = offers?.giftCards.length ?? 0;
|
|
15
|
+
const vouchers = offers?.vouchers.length ?? 0;
|
|
16
|
+
if (giftCards > 0 && vouchers === 0) return headings.giftCards;
|
|
17
|
+
if (vouchers > 0 && giftCards === 0) return headings.vouchers;
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
function GiftingPanelHead(props) {
|
|
21
|
+
const { look } = props;
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
23
|
+
className: "gifting-panel-head",
|
|
24
|
+
...giftingSlot(look, "head"),
|
|
25
|
+
children: [
|
|
26
|
+
props.eyebrow ? /* @__PURE__ */ jsx("span", {
|
|
27
|
+
className: "gifting-eyebrow",
|
|
28
|
+
...giftingSlot(look, "eyebrow"),
|
|
29
|
+
children: props.eyebrow
|
|
30
|
+
}) : null,
|
|
31
|
+
/* @__PURE__ */ jsx("h2", {
|
|
32
|
+
className: "gifting-heading",
|
|
33
|
+
...giftingSlot(look, "heading"),
|
|
34
|
+
children: props.heading
|
|
35
|
+
}),
|
|
36
|
+
props.intro ? /* @__PURE__ */ jsx("p", {
|
|
37
|
+
className: "gifting-intro",
|
|
38
|
+
...giftingSlot(look, "intro"),
|
|
39
|
+
children: props.intro
|
|
40
|
+
}) : null
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/** Amount buttons are radios, so they keep working from the keyboard and post with the form. */
|
|
45
|
+
function GiftCardAmounts(props) {
|
|
46
|
+
const { offer, currency, disabled, onChoose } = props;
|
|
47
|
+
const denominations = offer.giftCard.fixedDenominations;
|
|
48
|
+
const checkedChoice = props.initialChoice ?? firstGiftAmountChoice(offer);
|
|
49
|
+
const chip = (value, label) => /* @__PURE__ */ jsxs("label", {
|
|
50
|
+
className: "gifting-amount",
|
|
51
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
52
|
+
type: "radio",
|
|
53
|
+
name: props.groupName ?? "amountChoice",
|
|
54
|
+
value,
|
|
55
|
+
required: true,
|
|
56
|
+
disabled,
|
|
57
|
+
defaultChecked: value === checkedChoice,
|
|
58
|
+
onChange: onChoose ? () => onChoose(value) : void 0
|
|
59
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
60
|
+
...giftingSlot(props.look, "chip"),
|
|
61
|
+
children: label
|
|
62
|
+
})]
|
|
63
|
+
}, value);
|
|
64
|
+
return /* @__PURE__ */ jsxs("fieldset", {
|
|
65
|
+
className: "gifting-amounts",
|
|
66
|
+
...giftingSlot(props.look, "chips"),
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsx("legend", {
|
|
69
|
+
className: "gifting-visually-hidden",
|
|
70
|
+
children: "Amount"
|
|
71
|
+
}),
|
|
72
|
+
denominations.map((amount) => chip(String(amount), formatCurrencyAmount(amount, currency))),
|
|
73
|
+
offer.giftCard.customAmountEnabled ? chip(CUSTOM_GIFT_AMOUNT, "Another amount") : null
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function firstGiftAmountChoice(offer) {
|
|
78
|
+
const first = offer.giftCard.fixedDenominations[0];
|
|
79
|
+
return first === void 0 ? CUSTOM_GIFT_AMOUNT : String(first);
|
|
80
|
+
}
|
|
81
|
+
function readChosenGiftAmounts(root) {
|
|
82
|
+
const entries = Array.from(root.querySelectorAll("[data-gift-offer]"), (offer) => [offer.dataset.giftOffer ?? "", offer.querySelector("input[type=\"radio\"]:checked")?.value ?? ""]);
|
|
83
|
+
return Object.fromEntries(entries.filter(([id, amount]) => id !== "" && amount !== ""));
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
export { giftingEyebrow as a, firstGiftAmountChoice as i, GiftCardAmounts as n, giftingSlot as o, GiftingPanelHead as r, readChosenGiftAmounts as s, CUSTOM_GIFT_AMOUNT as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as defineIslandPropsDecoder } from "./propsDecoder-
|
|
3
|
-
import { t as mountHeaderChromeRuntime } from "./enhanceHeaderSection-
|
|
2
|
+
import { t as defineIslandPropsDecoder } from "./propsDecoder-ChYKWjLA.mjs";
|
|
3
|
+
import { t as mountHeaderChromeRuntime } from "./enhanceHeaderSection-Ciuhsk0E.mjs";
|
|
4
4
|
//#region src/rendering/islands/enhancers/headerSection.ts
|
|
5
5
|
const decode = defineIslandPropsDecoder("headerSection");
|
|
6
6
|
const enhance = (root, props) => {
|