@riverbankcms/sdk 0.178.0 → 0.179.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/README.md +15 -8
- package/dist/_dts/{BlocksIslandsHydrator-CrKsXtpD.d.ts → BlocksIslandsHydrator-DKwgs95u.d.ts} +1 -1
- package/dist/_dts/{Page-C9i27wZA.d.ts → Page-lWenra5i.d.ts} +7 -7
- package/dist/_dts/{SdkPreviewMode-DzGSR3jh.d.ts → SdkPreviewMode-BRxhRw4I.d.ts} +2 -2
- package/dist/_dts/{client-BnYN6XsH.d.ts → client-qWn7xAwJ.d.ts} +47 -17
- package/dist/_dts/{content-types-CXj6lp3d.d.ts → content-types-DL6GIvTm.d.ts} +2 -2
- package/dist/_dts/{contracts-BZLwkTwL.d.ts → contracts-CzWyAiJj.d.ts} +6 -116
- package/dist/_dts/{generatePageMetadata-ByEWwe9j.d.ts → generatePageMetadata-CBKd0cJ4.d.ts} +2 -2
- package/dist/_dts/{index-DCa-8TEY.d.ts → index-7CDBZGb-.d.ts} +1 -1
- package/dist/_dts/{index-CKDRr54L.d.ts → index-BU9uAkHB.d.ts} +4 -4
- package/dist/_dts/{index-D9-N1d9v.d.ts → index-BYnG_vF5.d.ts} +1 -1
- package/dist/_dts/{index-nnEdgc3Z.d.ts → index-CZgJrhzT.d.ts} +4 -2
- package/dist/_dts/{index-cTpvQg_Q.d.ts → index-CaCum9mM.d.ts} +2 -2
- package/dist/_dts/{index-0HFgCnGz.d.ts → index-DCiSHd-C.d.ts} +1 -1
- package/dist/_dts/{index-BE9dWIsr.d.ts → index-DVSipdrT.d.ts} +3 -3
- package/dist/_dts/{loadContent-DYkVV6w4.d.ts → loadContent-CPKbFQyq.d.ts} +15 -13
- package/dist/_dts/{request-B20VRWHH.d.ts → request-BjKBCS7t.d.ts} +1201 -335
- package/dist/_dts/{resolveBlockData-C_aK5GIS.d.ts → resolveBlockData-DupbMCup.d.ts} +8 -5
- package/dist/_dts/resolvePageContent-BqNyCHi8.d.ts +61 -0
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +3 -3
- 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 +7 -2
- package/dist/_dts/sdk/src/gifting/client.d.ts +1 -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 +16 -8
- 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 +1 -1
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +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 +7 -7
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +3 -3
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
- package/dist/_dts/sdk/src/routing/index.d.ts +19 -6
- 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 +1 -1
- package/dist/_dts/serviceBookingOutline-YcsIjvn1.d.ts +582 -0
- package/dist/_dts/{types-rm2M4LGx.d.ts → types-B7e6Lmo5.d.ts} +3 -3
- package/dist/_dts/{types-CYcd15BQ.d.ts → types-BOxSq-Bq.d.ts} +8 -7
- package/dist/_dts/{types-CMZ5mkpv.d.ts → types-CT-KOxl_.d.ts} +5 -39
- package/dist/_dts/{validation-BSxnRhyy.d.ts → validation-Dz6qccue.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-D1n09bu-.mjs → BlocksIslandsHydrator-1XifJg6V.mjs} +17 -18
- package/dist/client/{BookingMailingListNote-DSD4gS96.mjs → BookingMailingListNote-BsbEgagJ.mjs} +7 -7
- package/dist/client/{BookingQuestionFields-B57oGPcj.mjs → BookingQuestionFields-C8IbeLHj.mjs} +4 -4
- package/dist/client/{CalendarNavigationChevron-qXvsFYOg.mjs → CalendarNavigationChevron-Bbqij1XQ.mjs} +42 -9
- package/dist/client/{CheckboxChoice-b-PJLEXe.mjs → CheckboxChoice-BZPLCgTU.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-Olvrwi3Z.mjs → DemoBookingPortalAccess-uA9H8LIL.mjs} +4 -4
- package/dist/client/{EventCalendar.client-DwFNFb-0.mjs → EventCalendar.client-yoSI77ov.mjs} +10 -10
- package/dist/client/{EventCombined.client-Ffu-aVOb.mjs → EventCombined.client-HeCNlliq.mjs} +10 -10
- package/dist/client/{EventEmbeddedCheckoutStep-B18VbNS_.mjs → EventEmbeddedCheckoutStep-BDnicDM6.mjs} +1 -1
- package/dist/client/{EventItem-b8tVkNHA.mjs → EventItem-Duhk1vnF.mjs} +247 -7
- package/dist/client/{EventListWeekNavigation-BxnJW_Gf.mjs → EventListWeekNavigation-BiutEqPK.mjs} +1 -1
- package/dist/client/{EventListing.client-ViCnrNg4.mjs → EventListing.client-B5ln77jG.mjs} +3 -3
- package/dist/client/{EventListing.view-CdjiepMf.mjs → EventListing.view-hUDhNtMv.mjs} +203 -9
- package/dist/client/{EventRegistrationPayment-BVd70XkH.mjs → EventRegistrationPayment-DqtX1vB2.mjs} +189 -111
- package/dist/client/{Page-DqETUt-U.mjs → Page-ChJ2TGVk.mjs} +24314 -20226
- package/dist/client/{ProtectedSubmitButton-C-ql101B.mjs → ProtectedSubmitButton-De6AzhE6.mjs} +1 -1
- package/dist/client/{SiteTermsAgreementField-DkFnbzf_.mjs → SiteTermsAgreementField-CDBU31xW.mjs} +3 -3
- package/dist/client/{StepIndicator-JO2PS03n.mjs → StepIndicator-2Dl9zon2.mjs} +6 -6
- package/dist/client/{BookingPanelArrangement--EkA1ZQd.mjs → StepIndicator-JQA-VuEH.mjs} +12 -12
- package/dist/client/{TabBarFragment-BqfRLojo.mjs → TabBarFragment-DlKQRhP4.mjs} +1 -1
- package/dist/client/{ThemedButton-DuaYtnvG.mjs → ThemedButton-CnSa7o-I.mjs} +66 -66
- package/dist/client/{accessibleSurfaces-DN8it_Cx.mjs → accessibleSurfaces-Wl8-_OVJ.mjs} +1 -1
- package/dist/client/{accordion-XgNxl0Wg.mjs → accordion-B6SqU49k.mjs} +1 -1
- package/dist/client/{booking-form.client-ljJoDwuI.mjs → booking-form.client-DrEOjQ3N.mjs} +15 -15
- package/dist/client/{bookingForm-DtEHwY4W.mjs → bookingForm-drZBwEZW.mjs} +4 -4
- package/dist/client/bookings.mjs +5 -5
- package/dist/client/{boxStyleClassNames-BHoMAcun.mjs → boxStyleClassNames-DEh45w16.mjs} +19 -19
- package/dist/client/{carousel-B3UhbFu7.mjs → carousel-C-YJliD-.mjs} +2 -2
- package/dist/client/{carousel.client-h65clfUO.mjs → carousel.client-DMtGYTTM.mjs} +1 -1
- package/dist/client/{cart-DzOJfYOR.mjs → cart-acGFWK9R.mjs} +3 -3
- package/dist/client/{cart.client-DBG77v-5.mjs → cart.client-BzlOGP2j.mjs} +1 -1
- package/dist/client/{checkout-LmePoEgM.mjs → checkout-SEontwhy.mjs} +3 -3
- package/dist/client/{checkout.client-DmgZuLBT.mjs → checkout.client-C0Qvh-d4.mjs} +1 -1
- package/dist/client/{checkoutUrls-CMZI8o_V.mjs → checkoutUrls-yUKeq1N9.mjs} +1 -1
- package/dist/client/client.mjs +414 -319
- package/dist/client/{context-CJIz4FdL.mjs → context-DTrwaQtg.mjs} +2 -1
- package/dist/client/{dateFormatting-UoXqBh10.mjs → dateFormatting-Cg8E1r9l.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-6CgFZNvu.mjs → demoPortalMagicLink-D0kOJYOX.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-DaMo6len.mjs → enhanceHeaderSection-DyrpZ7ks.mjs} +4 -4
- package/dist/client/{event-registration.client-b6APrFQe.mjs → event-registration.client-RLZQWi2V.mjs} +13 -13
- package/dist/client/{eventCalendar-DJYz7yZf.mjs → eventCalendar-CphYnImh.mjs} +4 -4
- package/dist/client/{eventCombined-j9VCVgMW.mjs → eventCombined-BvqjASB_.mjs} +4 -4
- package/dist/client/{eventListing-DWgpGuFM.mjs → eventListing-BaNAoC_M.mjs} +4 -4
- package/dist/client/{eventRegistration-DCinRot3.mjs → eventRegistration-COMHoRl6.mjs} +4 -4
- package/dist/client/events-9LPvwbWp.mjs +28 -0
- package/dist/client/{form-BBBtRwvy.mjs → form-DyH2juYT.mjs} +3 -3
- package/dist/client/{form.client-CZeRQLGF.mjs → form.client-DBwzkB0M.mjs} +5 -5
- package/dist/client/{form.parts-DhGGv4_L.mjs → form.parts-CY4kX3mh.mjs} +3 -3
- package/dist/client/{formatDate-DVFVDcDW.mjs → formatDate-CTEN7gxW.mjs} +1 -1
- package/dist/client/gifting/client.mjs +6 -6
- package/dist/client/{gifting-Di9-SpwW.mjs → gifting-CIx4V378.mjs} +4 -4
- package/dist/client/{gifting.client-CjT5PrAZ.mjs → gifting.client-BEVPpzJM.mjs} +5 -5
- package/dist/client/{gifting.parts-ffP6mjMd.mjs → gifting.parts-VnORjnZK.mjs} +2 -2
- package/dist/client/{headerSection-jjAvtSZk.mjs → headerSection-DGcJfRS8.mjs} +2 -2
- package/dist/client/{lookSurfaces-C2VzJfyG.mjs → lookSurfaces-IqT_SVnX.mjs} +167 -85
- package/dist/client/{newsletter-form.client-D45frHoa.mjs → newsletter-form.client-BvEDkjiD.mjs} +6 -6
- package/dist/client/{shop.interactive-D7wky1GL.mjs → newsletter-form.interactive-DCO1lErD.mjs} +3975 -3975
- package/dist/client/{newsletter-form.parts-CHdg82ct.mjs → newsletter-form.parts-BIy4IUT3.mjs} +2 -2
- package/dist/client/{newsletterForm-tS465_vl.mjs → newsletterForm-CoTXDNFS.mjs} +3 -3
- package/dist/client/portal/client.mjs +9 -9
- package/dist/client/{product-detail.client-DIWSeW7P.mjs → product-detail.client-YHQ2aKX1.mjs} +1 -1
- package/dist/client/{product-list.client-BRf14h_e.mjs → product-list.client-DxoZw1vF.mjs} +1 -1
- package/dist/client/{productDetail-gxF5whea.mjs → productDetail-DjuFvkey.mjs} +3 -3
- package/dist/client/{productList-B9t0XJrN.mjs → productList-DE9GEFoZ.mjs} +3 -3
- package/dist/client/{propsDecoder-Db8wAmgr.mjs → propsDecoder-Cyag_HOs.mjs} +2 -48
- package/dist/client/{registry.server-Bn0gE0uP.mjs → registry.server-BPwV-0Pp.mjs} +10420 -9108
- package/dist/client/rendering/client.mjs +41 -27
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +23 -2836
- package/dist/client/{richText-coerce-COnKrLO7.mjs → richText-coerce-NrRqDeOg.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-Bok1Oy50.mjs → routeIslandApiConfig-BWq5gKFK.mjs} +1 -1
- package/dist/client/runtimeResponse-D2j2-mOk.mjs +3 -0
- package/dist/client/{runtimeResponse-9v8q2NBc.mjs → runtimeResponse-DtWSfWSZ.mjs} +1 -1
- package/dist/client/{shop-D1oTPDxm.mjs → shop-C3wM0Hr4.mjs} +3 -3
- package/dist/client/{shop-commerce-DyMZLC0a.mjs → shop-commerce-34YvcpbX.mjs} +14 -14
- package/dist/client/{shop-commerce-store-FODNS63D.mjs → shop-commerce-store-B7xHksOs.mjs} +1 -1
- package/dist/client/{shop-discount-apply.state-C4xcmFzZ.mjs → shop-discount-apply.state-BiBnozfO.mjs} +2 -2
- package/dist/client/{shop.client-CRgRulfI.mjs → shop.client-C0v88nLd.mjs} +14 -14
- package/dist/client/{shopShared-Bd_hy9ZO.mjs → shopShared-Ct-BRNez.mjs} +2 -2
- package/dist/client/spam-protection.mjs +1 -1
- package/dist/client/{noop-D11X-B6n.mjs → src-CCtanNlD.mjs} +317 -342
- package/dist/client/{timetableModel-UlWfP1gh.mjs → timetableModel-lhE29TNT.mjs} +65 -11
- package/dist/client/{types-DjWUR_O6.mjs → types-BEaKfam_.mjs} +65 -65
- package/dist/client/{useAvailableSlots-D-qoooLy.mjs → useAvailableSlots-BelJviOT.mjs} +2 -2
- package/dist/client/useDiscountCodeUi-rQRE1-Ho.mjs +196 -0
- package/dist/client/{useEventPagination-CQH2e9sQ.mjs → useEventPagination-C4rS2Xxl.mjs} +8 -8
- package/dist/client/{view-bGU1ws-m.mjs → view-LJVHVqsy.mjs} +4 -4
- package/dist/client/{display-D1oVR5Eh.mjs → wizardSteps-CNDsxeJH.mjs} +8935 -8913
- package/dist/preview-next/before-render.mjs +4 -3
- package/dist/preview-next/client/{PageSectionToolbar-D-Le7O3o.mjs → PageSectionToolbar-C4TtBPN-.mjs} +3 -3
- package/dist/preview-next/client/{PreviewEditorSidebar-DNy5j_ce.mjs → PreviewEditorSidebar-D6fkE59-.mjs} +5 -5
- package/dist/preview-next/client/{PreviewEditorUI-CzJvgbqt.mjs → PreviewEditorUI-amcDlj0O.mjs} +4 -4
- package/dist/preview-next/client/{PreviewShell-xhJ6ca1i.mjs → PreviewShell-DeQjx4zk.mjs} +5 -5
- package/dist/preview-next/client/{SdkPreviewModeRuntime-BmYO1TdT.mjs → SdkPreviewModeRuntime-Cx0SXnoX.mjs} +5 -5
- package/dist/preview-next/client/{previewAssistantSlot-BN93X9o1.mjs → previewAssistantSlot-aqpU34WI.mjs} +627 -498
- package/dist/preview-next/client/{previewChromeRoot-C51RQseo.mjs → previewChromeRoot-D3Gy_Rs0.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-oeGquJM-.mjs → sdk-runtime-Dzx_RrN7.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-BGTAcPud.mjs → siteStyleAccess-LHedw83e.mjs} +1 -1
- package/dist/preview-next/client/{useAutosaveStatus-BMGXjGZq.mjs → useAutosaveStatus-DpSd9aVk.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-CTDoR_gQ.mjs → useOpenBlockForSetup-BGZn5AT1.mjs} +1 -1
- package/dist/preview-next/keepAlive.mjs +1 -1
- package/dist/preview-next/middleware.mjs +1 -1
- package/dist/preview-next/{route-contract-BtdzkSUg.mjs → route-contract-DnL-FgSV.mjs} +28 -10
- package/dist/server/{Block.shared-Bp3OlOjj.mjs → Block.shared-BEbq6EwO.mjs} +4 -4
- package/dist/server/{bindings-DrbJuftt.mjs → bindings-Bly0dRs7.mjs} +36 -5
- package/dist/server/{client-Bf06n9oj.mjs → client-CGJ2ztYp.mjs} +1449 -1600
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/contentTypeResolver-B9vy8BrF.mjs +19 -0
- package/dist/server/data/dataLoaderContext.mjs +1 -1
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/{dataLoaderContext-B3fXA54R.mjs → dataLoaderContext-lMRTfG5Z.mjs} +1 -0
- package/dist/server/error-f4g44bKx.mjs +387 -0
- package/dist/server/index.mjs +3 -2
- package/dist/server/loadContent-BkK1w3QQ.mjs +692 -0
- package/dist/server/{loadPage-5iZefzDd.mjs → loadPage-DTLe0FEs.mjs} +22 -4
- package/dist/server/next.mjs +54 -94
- package/dist/server/{overrideResolution-CUHtm7tW.mjs → overrideResolution-Uy9Zp2Ks.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-GmPXForc.mjs → pageRenderPlan-JzxBnqfV.mjs} +7 -2
- package/dist/server/{pageRuntimeSupport-Dd8LFzfa.mjs → pageRuntimeSupport-DyNSd2Yj.mjs} +50 -2
- package/dist/server/{pageShared-tz-GVWft.mjs → pageShared-DU4ETFPS.mjs} +8 -50
- package/dist/server/{prebuild-JmsuYCIH.mjs → prebuild-8jNtDXmS.mjs} +5 -4
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-Ce9DDwON.mjs → prefetchBlockData-xeMG42aw.mjs} +3 -2
- package/dist/server/{registry-D12XF_h1.mjs → registry-DH1VrsCl.mjs} +122 -19
- 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 +5 -4
- package/dist/server/rendering.mjs +9 -8
- package/dist/server/{resolveBlockData-D9yZIN3V.mjs → resolveBlockData-BN8tweTx.mjs} +24 -5
- package/dist/server/resolvePageContent-DnM16_f9.mjs +89 -0
- package/dist/server/routing.mjs +271 -57
- package/dist/server/server.mjs +3 -3
- package/dist/server/{loadContent-eaTY7RPg.mjs → servicePageContent-B-FezJmH.mjs} +709 -453
- package/dist/server/{validation-CLq5cw6M.mjs → validation-3jOzYdPL.mjs} +3 -3
- package/dist/server/{version-oPbhAx8E.mjs → version-8t0o6_jd.mjs} +1 -1
- package/package.json +1 -1
- package/dist/_dts/footerPageOutline-D_XbQW_o.d.ts +0 -256
- package/dist/_dts/resolvePageContent-YT6ndha1.d.ts +0 -162
- package/dist/client/LocationMapActions-CiMtl1Ha.mjs +0 -62
- package/dist/client/MapDrawingSvg-BCZa3dpf.mjs +0 -200
- package/dist/client/course-DBEU9IA9.mjs +0 -244
- package/dist/client/duration-Q6_QNgiv.mjs +0 -37
- package/dist/client/event-details.client-BwASwKIq.mjs +0 -53
- package/dist/client/eventDetails-BzGOVDI-.mjs +0 -13
- package/dist/client/runtimeResponse-CVkM0dHy.mjs +0 -3
- package/dist/client/useDiscountCodeUi-B9DODAkj.mjs +0 -237
- package/dist/client/view-DNX59QwM.mjs +0 -1372
- package/dist/server/resolvePageContent-CAELMBEJ.mjs +0 -438
|
@@ -1041,90 +1041,6 @@ function isRecord(value) {
|
|
|
1041
1041
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1042
1042
|
}
|
|
1043
1043
|
//#endregion
|
|
1044
|
-
//#region ../commerce/src/purchase/settlement.ts
|
|
1045
|
-
function normalizeCurrencyCode(raw) {
|
|
1046
|
-
const normalized = raw.trim().toUpperCase();
|
|
1047
|
-
if (!/^[A-Z]{3}$/.test(normalized)) throw new Error(`Invalid currency code: ${raw}`);
|
|
1048
|
-
return normalized;
|
|
1049
|
-
}
|
|
1050
|
-
function allocateReductionCents(inputs, requestedCents) {
|
|
1051
|
-
const sanitizedInputs = inputs.map((input) => ({
|
|
1052
|
-
lineId: input.lineId,
|
|
1053
|
-
basisCents: toNonNegativeCents(input.basisCents),
|
|
1054
|
-
maxReducibleCents: toNonNegativeCents(input.maxReducibleCents)
|
|
1055
|
-
}));
|
|
1056
|
-
const totalReducibleCents = sanitizedInputs.reduce((sum, input) => sum + input.maxReducibleCents, 0);
|
|
1057
|
-
const targetCents = Math.max(0, Math.min(Math.trunc(requestedCents), totalReducibleCents));
|
|
1058
|
-
const allocations = sanitizedInputs.map((input) => ({
|
|
1059
|
-
lineId: input.lineId,
|
|
1060
|
-
amountCents: toNonNegativeCents(0)
|
|
1061
|
-
}));
|
|
1062
|
-
if (targetCents === 0 || sanitizedInputs.length === 0) return {
|
|
1063
|
-
requestedCents: toNonNegativeCents(requestedCents),
|
|
1064
|
-
appliedCents: toNonNegativeCents(0),
|
|
1065
|
-
allocations
|
|
1066
|
-
};
|
|
1067
|
-
const remainingCaps = sanitizedInputs.map((input) => input.maxReducibleCents);
|
|
1068
|
-
let remainingCents = targetCents;
|
|
1069
|
-
while (remainingCents > 0) {
|
|
1070
|
-
const eligibleIndexes = sanitizedInputs.map((input, index) => ({
|
|
1071
|
-
input,
|
|
1072
|
-
index
|
|
1073
|
-
})).filter(({ input, index }) => input.basisCents > 0 && (remainingCaps[index] ?? 0) > 0);
|
|
1074
|
-
if (eligibleIndexes.length === 0) break;
|
|
1075
|
-
const eligibleBasis = eligibleIndexes.reduce((sum, { input }) => sum + input.basisCents, 0);
|
|
1076
|
-
if (eligibleBasis <= 0) break;
|
|
1077
|
-
const roundCandidates = eligibleIndexes.map(({ input, index }) => {
|
|
1078
|
-
const exactShare = input.basisCents / eligibleBasis * remainingCents;
|
|
1079
|
-
const floorShare = Math.min(Math.floor(exactShare), remainingCaps[index] ?? 0);
|
|
1080
|
-
return {
|
|
1081
|
-
index,
|
|
1082
|
-
floorShare,
|
|
1083
|
-
remainder: exactShare - floorShare
|
|
1084
|
-
};
|
|
1085
|
-
});
|
|
1086
|
-
let assignedThisRound = 0;
|
|
1087
|
-
for (const candidate of roundCandidates) {
|
|
1088
|
-
if (candidate.floorShare <= 0) continue;
|
|
1089
|
-
const allocation = allocations[candidate.index];
|
|
1090
|
-
if (!allocation) continue;
|
|
1091
|
-
allocation.amountCents = toNonNegativeCents(allocation.amountCents + candidate.floorShare);
|
|
1092
|
-
remainingCaps[candidate.index] = toNonNegativeCents((remainingCaps[candidate.index] ?? 0) - candidate.floorShare);
|
|
1093
|
-
assignedThisRound += candidate.floorShare;
|
|
1094
|
-
}
|
|
1095
|
-
remainingCents -= assignedThisRound;
|
|
1096
|
-
if (remainingCents <= 0) break;
|
|
1097
|
-
const remainderCandidates = roundCandidates.filter((candidate) => (remainingCaps[candidate.index] ?? 0) > 0).sort((a, b) => {
|
|
1098
|
-
if (b.remainder !== a.remainder) return b.remainder - a.remainder;
|
|
1099
|
-
return a.index - b.index;
|
|
1100
|
-
});
|
|
1101
|
-
if (remainderCandidates.length === 0) break;
|
|
1102
|
-
let remainderAssigned = 0;
|
|
1103
|
-
for (const candidate of remainderCandidates) {
|
|
1104
|
-
if (remainingCents <= 0) break;
|
|
1105
|
-
if ((remainingCaps[candidate.index] ?? 0) <= 0) continue;
|
|
1106
|
-
const allocation = allocations[candidate.index];
|
|
1107
|
-
if (!allocation) continue;
|
|
1108
|
-
allocation.amountCents = toNonNegativeCents(allocation.amountCents + 1);
|
|
1109
|
-
remainingCaps[candidate.index] = toNonNegativeCents((remainingCaps[candidate.index] ?? 0) - 1);
|
|
1110
|
-
remainingCents -= 1;
|
|
1111
|
-
remainderAssigned += 1;
|
|
1112
|
-
}
|
|
1113
|
-
if (assignedThisRound === 0 && remainderAssigned === 0) break;
|
|
1114
|
-
}
|
|
1115
|
-
const appliedCents = allocations.reduce((sum, allocation) => sum + allocation.amountCents, 0);
|
|
1116
|
-
return {
|
|
1117
|
-
requestedCents: toNonNegativeCents(requestedCents),
|
|
1118
|
-
appliedCents: toNonNegativeCents(appliedCents),
|
|
1119
|
-
allocations
|
|
1120
|
-
};
|
|
1121
|
-
}
|
|
1122
|
-
//#endregion
|
|
1123
|
-
//#region ../commerce/src/purchase/checkoutQuantity.ts
|
|
1124
|
-
function unsafeAsPositiveCheckoutQuantity(quantity) {
|
|
1125
|
-
return quantity;
|
|
1126
|
-
}
|
|
1127
|
-
//#endregion
|
|
1128
1044
|
//#region ../site-contracts/src/siteData/eventQueries.ts
|
|
1129
1045
|
const eventSurfacePresetValues = SURFACE_EVENT_PRESET_VALUES;
|
|
1130
1046
|
const eventSurfaceScopeValues = [
|
|
@@ -1350,6 +1266,167 @@ const eventCalendarListLayoutValues = [
|
|
|
1350
1266
|
];
|
|
1351
1267
|
const eventCalendarListLayoutCompatibleDisplayModeValues = ["combined", "list"];
|
|
1352
1268
|
//#endregion
|
|
1269
|
+
//#region ../commerce/src/purchase/settlement.ts
|
|
1270
|
+
function normalizeCurrencyCode(raw) {
|
|
1271
|
+
const normalized = raw.trim().toUpperCase();
|
|
1272
|
+
if (!/^[A-Z]{3}$/.test(normalized)) throw new Error(`Invalid currency code: ${raw}`);
|
|
1273
|
+
return normalized;
|
|
1274
|
+
}
|
|
1275
|
+
function allocateReductionCents(inputs, requestedCents) {
|
|
1276
|
+
const sanitizedInputs = inputs.map((input) => ({
|
|
1277
|
+
lineId: input.lineId,
|
|
1278
|
+
basisCents: toNonNegativeCents(input.basisCents),
|
|
1279
|
+
maxReducibleCents: toNonNegativeCents(input.maxReducibleCents)
|
|
1280
|
+
}));
|
|
1281
|
+
const totalReducibleCents = sanitizedInputs.reduce((sum, input) => sum + input.maxReducibleCents, 0);
|
|
1282
|
+
const targetCents = Math.max(0, Math.min(Math.trunc(requestedCents), totalReducibleCents));
|
|
1283
|
+
const allocations = sanitizedInputs.map((input) => ({
|
|
1284
|
+
lineId: input.lineId,
|
|
1285
|
+
amountCents: toNonNegativeCents(0)
|
|
1286
|
+
}));
|
|
1287
|
+
if (targetCents === 0 || sanitizedInputs.length === 0) return {
|
|
1288
|
+
requestedCents: toNonNegativeCents(requestedCents),
|
|
1289
|
+
appliedCents: toNonNegativeCents(0),
|
|
1290
|
+
allocations
|
|
1291
|
+
};
|
|
1292
|
+
const remainingCaps = sanitizedInputs.map((input) => input.maxReducibleCents);
|
|
1293
|
+
let remainingCents = targetCents;
|
|
1294
|
+
while (remainingCents > 0) {
|
|
1295
|
+
const eligibleIndexes = sanitizedInputs.map((input, index) => ({
|
|
1296
|
+
input,
|
|
1297
|
+
index
|
|
1298
|
+
})).filter(({ input, index }) => input.basisCents > 0 && (remainingCaps[index] ?? 0) > 0);
|
|
1299
|
+
if (eligibleIndexes.length === 0) break;
|
|
1300
|
+
const eligibleBasis = eligibleIndexes.reduce((sum, { input }) => sum + input.basisCents, 0);
|
|
1301
|
+
if (eligibleBasis <= 0) break;
|
|
1302
|
+
const roundCandidates = eligibleIndexes.map(({ input, index }) => {
|
|
1303
|
+
const exactShare = input.basisCents / eligibleBasis * remainingCents;
|
|
1304
|
+
const floorShare = Math.min(Math.floor(exactShare), remainingCaps[index] ?? 0);
|
|
1305
|
+
return {
|
|
1306
|
+
index,
|
|
1307
|
+
floorShare,
|
|
1308
|
+
remainder: exactShare - floorShare
|
|
1309
|
+
};
|
|
1310
|
+
});
|
|
1311
|
+
let assignedThisRound = 0;
|
|
1312
|
+
for (const candidate of roundCandidates) {
|
|
1313
|
+
if (candidate.floorShare <= 0) continue;
|
|
1314
|
+
const allocation = allocations[candidate.index];
|
|
1315
|
+
if (!allocation) continue;
|
|
1316
|
+
allocation.amountCents = toNonNegativeCents(allocation.amountCents + candidate.floorShare);
|
|
1317
|
+
remainingCaps[candidate.index] = toNonNegativeCents((remainingCaps[candidate.index] ?? 0) - candidate.floorShare);
|
|
1318
|
+
assignedThisRound += candidate.floorShare;
|
|
1319
|
+
}
|
|
1320
|
+
remainingCents -= assignedThisRound;
|
|
1321
|
+
if (remainingCents <= 0) break;
|
|
1322
|
+
const remainderCandidates = roundCandidates.filter((candidate) => (remainingCaps[candidate.index] ?? 0) > 0).sort((a, b) => {
|
|
1323
|
+
if (b.remainder !== a.remainder) return b.remainder - a.remainder;
|
|
1324
|
+
return a.index - b.index;
|
|
1325
|
+
});
|
|
1326
|
+
if (remainderCandidates.length === 0) break;
|
|
1327
|
+
let remainderAssigned = 0;
|
|
1328
|
+
for (const candidate of remainderCandidates) {
|
|
1329
|
+
if (remainingCents <= 0) break;
|
|
1330
|
+
if ((remainingCaps[candidate.index] ?? 0) <= 0) continue;
|
|
1331
|
+
const allocation = allocations[candidate.index];
|
|
1332
|
+
if (!allocation) continue;
|
|
1333
|
+
allocation.amountCents = toNonNegativeCents(allocation.amountCents + 1);
|
|
1334
|
+
remainingCaps[candidate.index] = toNonNegativeCents((remainingCaps[candidate.index] ?? 0) - 1);
|
|
1335
|
+
remainingCents -= 1;
|
|
1336
|
+
remainderAssigned += 1;
|
|
1337
|
+
}
|
|
1338
|
+
if (assignedThisRound === 0 && remainderAssigned === 0) break;
|
|
1339
|
+
}
|
|
1340
|
+
const appliedCents = allocations.reduce((sum, allocation) => sum + allocation.amountCents, 0);
|
|
1341
|
+
return {
|
|
1342
|
+
requestedCents: toNonNegativeCents(requestedCents),
|
|
1343
|
+
appliedCents: toNonNegativeCents(appliedCents),
|
|
1344
|
+
allocations
|
|
1345
|
+
};
|
|
1346
|
+
}
|
|
1347
|
+
//#endregion
|
|
1348
|
+
//#region ../commerce/src/purchase/checkoutQuantity.ts
|
|
1349
|
+
function unsafeAsPositiveCheckoutQuantity(quantity) {
|
|
1350
|
+
return quantity;
|
|
1351
|
+
}
|
|
1352
|
+
//#endregion
|
|
1353
|
+
//#region ../site-contracts/src/identity/presentationVocabulary.ts
|
|
1354
|
+
const arrangementModes = [
|
|
1355
|
+
"list",
|
|
1356
|
+
"calendar",
|
|
1357
|
+
"week",
|
|
1358
|
+
"combined"
|
|
1359
|
+
];
|
|
1360
|
+
function isArrangementMode(value) {
|
|
1361
|
+
return value === "list" || value === "calendar" || value === "week" || value === "combined";
|
|
1362
|
+
}
|
|
1363
|
+
/** Every transition that draws something; `none` is the absence of a join. */
|
|
1364
|
+
const decorativeTransitionIntentValues = [
|
|
1365
|
+
"soft-fade-short",
|
|
1366
|
+
"soft-fade-long",
|
|
1367
|
+
"soft-fade-expansive",
|
|
1368
|
+
"wave-edge",
|
|
1369
|
+
"wave-edge-balanced",
|
|
1370
|
+
"wave-edge-gentle",
|
|
1371
|
+
"wave-edge-bold",
|
|
1372
|
+
"wave-edge-drift",
|
|
1373
|
+
"wave-edge-echo",
|
|
1374
|
+
"arc-edge-echo",
|
|
1375
|
+
"arc-edge-bulge",
|
|
1376
|
+
"angle-edge",
|
|
1377
|
+
"angle-edge-subtle",
|
|
1378
|
+
"angle-edge-steep"
|
|
1379
|
+
];
|
|
1380
|
+
const tileTreatmentValues = [
|
|
1381
|
+
"default",
|
|
1382
|
+
"quiet",
|
|
1383
|
+
"brand-depth"
|
|
1384
|
+
];
|
|
1385
|
+
const eventListTreatmentValues = [
|
|
1386
|
+
"plain",
|
|
1387
|
+
"lined-panel",
|
|
1388
|
+
"ruled-register",
|
|
1389
|
+
"editorial-register",
|
|
1390
|
+
"dense-index"
|
|
1391
|
+
];
|
|
1392
|
+
const eyebrowTreatmentValues = [
|
|
1393
|
+
"plain",
|
|
1394
|
+
"accent",
|
|
1395
|
+
"pill",
|
|
1396
|
+
"accent-pill",
|
|
1397
|
+
"pill-bounce",
|
|
1398
|
+
"accent-pill-bounce"
|
|
1399
|
+
];
|
|
1400
|
+
const visibleHeadingDecorationFamilyValues = ["organic-squiggle", "short-center-rule"];
|
|
1401
|
+
const headingDecorationOverrideValues = ["site-default", "off"];
|
|
1402
|
+
const headingDecorationColorTokenValues = [
|
|
1403
|
+
"text",
|
|
1404
|
+
"primary",
|
|
1405
|
+
"secondary",
|
|
1406
|
+
"accent",
|
|
1407
|
+
"border",
|
|
1408
|
+
"muted"
|
|
1409
|
+
];
|
|
1410
|
+
const accordionIconSetValues = [
|
|
1411
|
+
"plus",
|
|
1412
|
+
"chevron",
|
|
1413
|
+
"caret",
|
|
1414
|
+
"minimal-cross"
|
|
1415
|
+
];
|
|
1416
|
+
const accordionIconColorTokenValues = [
|
|
1417
|
+
"text",
|
|
1418
|
+
"muted",
|
|
1419
|
+
"primary",
|
|
1420
|
+
"secondary",
|
|
1421
|
+
"accent",
|
|
1422
|
+
"current"
|
|
1423
|
+
];
|
|
1424
|
+
const accordionIconMotionValues = [
|
|
1425
|
+
"none",
|
|
1426
|
+
"rotate",
|
|
1427
|
+
"swap"
|
|
1428
|
+
];
|
|
1429
|
+
//#endregion
|
|
1353
1430
|
//#region ../media-core/src/mediaKinds.ts
|
|
1354
1431
|
const mediaTypeDiscriminants = [
|
|
1355
1432
|
"image",
|
|
@@ -1554,45 +1631,152 @@ function isRichTextDoc(value) {
|
|
|
1554
1631
|
*/
|
|
1555
1632
|
function createRichTextDoc(paragraphs) {
|
|
1556
1633
|
return {
|
|
1557
|
-
type: "doc",
|
|
1558
|
-
content: paragraphs.map((text) => text ? {
|
|
1559
|
-
type: "paragraph",
|
|
1560
|
-
content: [{
|
|
1561
|
-
type: "text",
|
|
1562
|
-
text
|
|
1563
|
-
}]
|
|
1564
|
-
} : { type: "paragraph" })
|
|
1634
|
+
type: "doc",
|
|
1635
|
+
content: paragraphs.map((text) => text ? {
|
|
1636
|
+
type: "paragraph",
|
|
1637
|
+
content: [{
|
|
1638
|
+
type: "text",
|
|
1639
|
+
text
|
|
1640
|
+
}]
|
|
1641
|
+
} : { type: "paragraph" })
|
|
1642
|
+
};
|
|
1643
|
+
}
|
|
1644
|
+
/**
|
|
1645
|
+
* Build Zod validation schema for rich text fields
|
|
1646
|
+
*
|
|
1647
|
+
* @param options - Optional configuration
|
|
1648
|
+
* @param options.required - If true, validates that content is not empty
|
|
1649
|
+
* @param options.label - Field label for error messages (defaults to 'This field')
|
|
1650
|
+
* @returns Zod schema for rich text validation
|
|
1651
|
+
*
|
|
1652
|
+
* @example
|
|
1653
|
+
* // Basic usage
|
|
1654
|
+
* const schema = buildRichTextSchema()
|
|
1655
|
+
*
|
|
1656
|
+
* @example
|
|
1657
|
+
* // Required field with custom label
|
|
1658
|
+
* const schema = buildRichTextSchema({ required: true, label: 'Description' })
|
|
1659
|
+
*/
|
|
1660
|
+
function buildRichTextSchema(options) {
|
|
1661
|
+
if (options?.required === true) {
|
|
1662
|
+
const label = options.label ?? "This field";
|
|
1663
|
+
return RichTextDocSchema.refine((val) => {
|
|
1664
|
+
const content = val.content;
|
|
1665
|
+
if (!Array.isArray(content) || content.length === 0) return false;
|
|
1666
|
+
const first = content[0];
|
|
1667
|
+
if (content.length === 1 && isRecord(first) && first.type === "paragraph" && (!("content" in first) || first.content == null)) return false;
|
|
1668
|
+
return true;
|
|
1669
|
+
}, { message: `${label} is required` });
|
|
1670
|
+
}
|
|
1671
|
+
return RichTextDocSchema;
|
|
1672
|
+
}
|
|
1673
|
+
//#endregion
|
|
1674
|
+
//#region ../blocks/src/system/constants/events.ts
|
|
1675
|
+
/**
|
|
1676
|
+
* Event-related constants
|
|
1677
|
+
*
|
|
1678
|
+
* Shared constants for event content types and booking system integration.
|
|
1679
|
+
*/
|
|
1680
|
+
const arrangementOnlyListLayouts = [
|
|
1681
|
+
"ledger",
|
|
1682
|
+
"timetable-rows",
|
|
1683
|
+
"day-groups",
|
|
1684
|
+
"week-groups",
|
|
1685
|
+
"week-columns"
|
|
1686
|
+
];
|
|
1687
|
+
const eventListArrangementValues = [...eventCalendarListLayoutValues, ...arrangementOnlyListLayouts];
|
|
1688
|
+
const eventCalendarListLayoutOptions = [
|
|
1689
|
+
{
|
|
1690
|
+
id: "stack",
|
|
1691
|
+
label: "Stack"
|
|
1692
|
+
},
|
|
1693
|
+
{
|
|
1694
|
+
id: "grid",
|
|
1695
|
+
label: "Grid"
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
id: "compact",
|
|
1699
|
+
label: "Compact"
|
|
1700
|
+
}
|
|
1701
|
+
];
|
|
1702
|
+
function isEventCalendarDisplayMode(value) {
|
|
1703
|
+
return typeof value === "string" && eventCalendarDisplayModeValues.includes(value);
|
|
1704
|
+
}
|
|
1705
|
+
function normalizeEventCalendarDisplayMode(input) {
|
|
1706
|
+
if (isEventCalendarDisplayMode(input.variant)) return input.variant;
|
|
1707
|
+
return isEventCalendarDisplayMode(input.displayMode) ? input.displayMode : void 0;
|
|
1708
|
+
}
|
|
1709
|
+
/**
|
|
1710
|
+
* One closed authority for the projections each mode needs on the server. Combined always opens on
|
|
1711
|
+
* its list, so its calendar tab reads its own months in the browser when it opens.
|
|
1712
|
+
*/
|
|
1713
|
+
function resolveEventCalendarReadPlan(input) {
|
|
1714
|
+
const mode = normalizeEventCalendarDisplayMode(input) ?? "combined";
|
|
1715
|
+
switch (mode) {
|
|
1716
|
+
case "combined": return {
|
|
1717
|
+
mode,
|
|
1718
|
+
jobs: "list",
|
|
1719
|
+
readProfile: "listing-card"
|
|
1720
|
+
};
|
|
1721
|
+
case "week": return {
|
|
1722
|
+
mode,
|
|
1723
|
+
jobs: "schedule",
|
|
1724
|
+
readProfile: "listing-card"
|
|
1725
|
+
};
|
|
1726
|
+
case "list": return {
|
|
1727
|
+
mode,
|
|
1728
|
+
jobs: "list",
|
|
1729
|
+
readProfile: "listing-card"
|
|
1730
|
+
};
|
|
1731
|
+
case "calendar": return {
|
|
1732
|
+
mode,
|
|
1733
|
+
jobs: "calendar",
|
|
1734
|
+
readProfile: "listing-card"
|
|
1735
|
+
};
|
|
1736
|
+
case "timetable":
|
|
1737
|
+
case "week-board": return {
|
|
1738
|
+
mode,
|
|
1739
|
+
jobs: "calendar",
|
|
1740
|
+
readProfile: "timetable"
|
|
1741
|
+
};
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
function isEventCalendarDefaultView(value) {
|
|
1745
|
+
return typeof value === "string" && eventCalendarDefaultViewValues.includes(value);
|
|
1746
|
+
}
|
|
1747
|
+
function isEventCalendarListLayout(value) {
|
|
1748
|
+
return typeof value === "string" && eventCalendarListLayoutValues.includes(value);
|
|
1749
|
+
}
|
|
1750
|
+
/** The calendar manifest owns its secondary arrangement axis. */
|
|
1751
|
+
const eventCalendarVariantMeaning = {
|
|
1752
|
+
kind: "mode",
|
|
1753
|
+
modes: arrangementModes,
|
|
1754
|
+
defaultMode: "list",
|
|
1755
|
+
arrangementField: "listLayout",
|
|
1756
|
+
keys: eventCalendarListLayoutValues,
|
|
1757
|
+
lookOnlyKeys: [
|
|
1758
|
+
...arrangementOnlyListLayouts,
|
|
1759
|
+
"month-grid",
|
|
1760
|
+
"month-day"
|
|
1761
|
+
],
|
|
1762
|
+
defaultKey: "stack",
|
|
1763
|
+
modeLabels: {
|
|
1764
|
+
list: "List",
|
|
1765
|
+
calendar: "Month",
|
|
1766
|
+
combined: "List and month",
|
|
1767
|
+
timetable: "Timetable",
|
|
1768
|
+
"week-board": "Week board",
|
|
1769
|
+
week: "Week"
|
|
1770
|
+
}
|
|
1771
|
+
};
|
|
1772
|
+
/** Weekly lists share the arrangement-Look admission used by calendar arrangements. */
|
|
1773
|
+
function eventCalendarListGroupingDecision(input) {
|
|
1774
|
+
const available = input.arrangementLooks && resolveEventCalendarReadPlan(input).mode === "list";
|
|
1775
|
+
return {
|
|
1776
|
+
available,
|
|
1777
|
+
grouping: available && input.listBy === "week" ? "week" : "upcoming"
|
|
1565
1778
|
};
|
|
1566
1779
|
}
|
|
1567
|
-
/**
|
|
1568
|
-
* Build Zod validation schema for rich text fields
|
|
1569
|
-
*
|
|
1570
|
-
* @param options - Optional configuration
|
|
1571
|
-
* @param options.required - If true, validates that content is not empty
|
|
1572
|
-
* @param options.label - Field label for error messages (defaults to 'This field')
|
|
1573
|
-
* @returns Zod schema for rich text validation
|
|
1574
|
-
*
|
|
1575
|
-
* @example
|
|
1576
|
-
* // Basic usage
|
|
1577
|
-
* const schema = buildRichTextSchema()
|
|
1578
|
-
*
|
|
1579
|
-
* @example
|
|
1580
|
-
* // Required field with custom label
|
|
1581
|
-
* const schema = buildRichTextSchema({ required: true, label: 'Description' })
|
|
1582
|
-
*/
|
|
1583
|
-
function buildRichTextSchema(options) {
|
|
1584
|
-
if (options?.required === true) {
|
|
1585
|
-
const label = options.label ?? "This field";
|
|
1586
|
-
return RichTextDocSchema.refine((val) => {
|
|
1587
|
-
const content = val.content;
|
|
1588
|
-
if (!Array.isArray(content) || content.length === 0) return false;
|
|
1589
|
-
const first = content[0];
|
|
1590
|
-
if (content.length === 1 && isRecord(first) && first.type === "paragraph" && (!("content" in first) || first.content == null)) return false;
|
|
1591
|
-
return true;
|
|
1592
|
-
}, { message: `${label} is required` });
|
|
1593
|
-
}
|
|
1594
|
-
return RichTextDocSchema;
|
|
1595
|
-
}
|
|
1596
1780
|
//#endregion
|
|
1597
1781
|
//#region ../blocks/src/system/runtime/api/schemas/bookingQuestions.ts
|
|
1598
1782
|
const optionSchema = z.object({
|
|
@@ -2196,189 +2380,9 @@ const publicEventSchema = z.union([publicEventBaseSchema.extend({
|
|
|
2196
2380
|
*/
|
|
2197
2381
|
const publicEventsArraySchema = z.array(publicEventSchema);
|
|
2198
2382
|
//#endregion
|
|
2199
|
-
//#region ../
|
|
2200
|
-
const
|
|
2201
|
-
|
|
2202
|
-
"calendar",
|
|
2203
|
-
"week",
|
|
2204
|
-
"combined"
|
|
2205
|
-
];
|
|
2206
|
-
function isArrangementMode(value) {
|
|
2207
|
-
return value === "list" || value === "calendar" || value === "week" || value === "combined";
|
|
2208
|
-
}
|
|
2209
|
-
/** Every transition that draws something; `none` is the absence of a join. */
|
|
2210
|
-
const decorativeTransitionIntentValues = [
|
|
2211
|
-
"soft-fade-short",
|
|
2212
|
-
"soft-fade-long",
|
|
2213
|
-
"soft-fade-expansive",
|
|
2214
|
-
"wave-edge",
|
|
2215
|
-
"wave-edge-balanced",
|
|
2216
|
-
"wave-edge-gentle",
|
|
2217
|
-
"wave-edge-bold",
|
|
2218
|
-
"wave-edge-drift",
|
|
2219
|
-
"wave-edge-echo",
|
|
2220
|
-
"arc-edge-echo",
|
|
2221
|
-
"arc-edge-bulge",
|
|
2222
|
-
"angle-edge",
|
|
2223
|
-
"angle-edge-subtle",
|
|
2224
|
-
"angle-edge-steep"
|
|
2225
|
-
];
|
|
2226
|
-
const tileTreatmentValues = [
|
|
2227
|
-
"default",
|
|
2228
|
-
"quiet",
|
|
2229
|
-
"brand-depth"
|
|
2230
|
-
];
|
|
2231
|
-
const eventListTreatmentValues = [
|
|
2232
|
-
"plain",
|
|
2233
|
-
"lined-panel",
|
|
2234
|
-
"ruled-register",
|
|
2235
|
-
"editorial-register",
|
|
2236
|
-
"dense-index"
|
|
2237
|
-
];
|
|
2238
|
-
const eyebrowTreatmentValues = [
|
|
2239
|
-
"plain",
|
|
2240
|
-
"accent",
|
|
2241
|
-
"pill",
|
|
2242
|
-
"accent-pill",
|
|
2243
|
-
"pill-bounce",
|
|
2244
|
-
"accent-pill-bounce"
|
|
2245
|
-
];
|
|
2246
|
-
const visibleHeadingDecorationFamilyValues = ["organic-squiggle", "short-center-rule"];
|
|
2247
|
-
const headingDecorationOverrideValues = ["site-default", "off"];
|
|
2248
|
-
const headingDecorationColorTokenValues = [
|
|
2249
|
-
"text",
|
|
2250
|
-
"primary",
|
|
2251
|
-
"secondary",
|
|
2252
|
-
"accent",
|
|
2253
|
-
"border",
|
|
2254
|
-
"muted"
|
|
2255
|
-
];
|
|
2256
|
-
const accordionIconSetValues = [
|
|
2257
|
-
"plus",
|
|
2258
|
-
"chevron",
|
|
2259
|
-
"caret",
|
|
2260
|
-
"minimal-cross"
|
|
2261
|
-
];
|
|
2262
|
-
const accordionIconColorTokenValues = [
|
|
2263
|
-
"text",
|
|
2264
|
-
"muted",
|
|
2265
|
-
"primary",
|
|
2266
|
-
"secondary",
|
|
2267
|
-
"accent",
|
|
2268
|
-
"current"
|
|
2269
|
-
];
|
|
2270
|
-
const accordionIconMotionValues = [
|
|
2271
|
-
"none",
|
|
2272
|
-
"rotate",
|
|
2273
|
-
"swap"
|
|
2274
|
-
];
|
|
2275
|
-
//#endregion
|
|
2276
|
-
//#region ../blocks/src/system/constants/events.ts
|
|
2277
|
-
/**
|
|
2278
|
-
* Event-related constants
|
|
2279
|
-
*
|
|
2280
|
-
* Shared constants for event content types and booking system integration.
|
|
2281
|
-
*/
|
|
2282
|
-
const arrangementOnlyListLayouts = [
|
|
2283
|
-
"ledger",
|
|
2284
|
-
"timetable-rows",
|
|
2285
|
-
"day-groups",
|
|
2286
|
-
"week-groups",
|
|
2287
|
-
"week-columns"
|
|
2288
|
-
];
|
|
2289
|
-
const eventListArrangementValues = [...eventCalendarListLayoutValues, ...arrangementOnlyListLayouts];
|
|
2290
|
-
const eventCalendarListLayoutOptions = [
|
|
2291
|
-
{
|
|
2292
|
-
id: "stack",
|
|
2293
|
-
label: "Stack"
|
|
2294
|
-
},
|
|
2295
|
-
{
|
|
2296
|
-
id: "grid",
|
|
2297
|
-
label: "Grid"
|
|
2298
|
-
},
|
|
2299
|
-
{
|
|
2300
|
-
id: "compact",
|
|
2301
|
-
label: "Compact"
|
|
2302
|
-
}
|
|
2303
|
-
];
|
|
2304
|
-
function isEventCalendarDisplayMode(value) {
|
|
2305
|
-
return typeof value === "string" && eventCalendarDisplayModeValues.includes(value);
|
|
2306
|
-
}
|
|
2307
|
-
function normalizeEventCalendarDisplayMode(input) {
|
|
2308
|
-
if (isEventCalendarDisplayMode(input.variant)) return input.variant;
|
|
2309
|
-
return isEventCalendarDisplayMode(input.displayMode) ? input.displayMode : void 0;
|
|
2310
|
-
}
|
|
2311
|
-
/**
|
|
2312
|
-
* One closed authority for the projections each mode needs on the server. Combined always opens on
|
|
2313
|
-
* its list, so its calendar tab reads its own months in the browser when it opens.
|
|
2314
|
-
*/
|
|
2315
|
-
function resolveEventCalendarReadPlan(input) {
|
|
2316
|
-
const mode = normalizeEventCalendarDisplayMode(input) ?? "combined";
|
|
2317
|
-
switch (mode) {
|
|
2318
|
-
case "combined": return {
|
|
2319
|
-
mode,
|
|
2320
|
-
jobs: "list",
|
|
2321
|
-
readProfile: "listing-card"
|
|
2322
|
-
};
|
|
2323
|
-
case "week": return {
|
|
2324
|
-
mode,
|
|
2325
|
-
jobs: "schedule",
|
|
2326
|
-
readProfile: "listing-card"
|
|
2327
|
-
};
|
|
2328
|
-
case "list": return {
|
|
2329
|
-
mode,
|
|
2330
|
-
jobs: "list",
|
|
2331
|
-
readProfile: "listing-card"
|
|
2332
|
-
};
|
|
2333
|
-
case "calendar": return {
|
|
2334
|
-
mode,
|
|
2335
|
-
jobs: "calendar",
|
|
2336
|
-
readProfile: "listing-card"
|
|
2337
|
-
};
|
|
2338
|
-
case "timetable":
|
|
2339
|
-
case "week-board": return {
|
|
2340
|
-
mode,
|
|
2341
|
-
jobs: "calendar",
|
|
2342
|
-
readProfile: "timetable"
|
|
2343
|
-
};
|
|
2344
|
-
}
|
|
2345
|
-
}
|
|
2346
|
-
function isEventCalendarDefaultView(value) {
|
|
2347
|
-
return typeof value === "string" && eventCalendarDefaultViewValues.includes(value);
|
|
2348
|
-
}
|
|
2349
|
-
function isEventCalendarListLayout(value) {
|
|
2350
|
-
return typeof value === "string" && eventCalendarListLayoutValues.includes(value);
|
|
2351
|
-
}
|
|
2352
|
-
/** The calendar manifest owns its secondary arrangement axis. */
|
|
2353
|
-
const eventCalendarVariantMeaning = {
|
|
2354
|
-
kind: "mode",
|
|
2355
|
-
modes: arrangementModes,
|
|
2356
|
-
defaultMode: "list",
|
|
2357
|
-
arrangementField: "listLayout",
|
|
2358
|
-
keys: eventCalendarListLayoutValues,
|
|
2359
|
-
lookOnlyKeys: [
|
|
2360
|
-
...arrangementOnlyListLayouts,
|
|
2361
|
-
"month-grid",
|
|
2362
|
-
"month-day"
|
|
2363
|
-
],
|
|
2364
|
-
defaultKey: "stack",
|
|
2365
|
-
modeLabels: {
|
|
2366
|
-
list: "List",
|
|
2367
|
-
calendar: "Month",
|
|
2368
|
-
combined: "List and month",
|
|
2369
|
-
timetable: "Timetable",
|
|
2370
|
-
"week-board": "Week board",
|
|
2371
|
-
week: "Week"
|
|
2372
|
-
}
|
|
2373
|
-
};
|
|
2374
|
-
/** Weekly lists share the arrangement-Look admission used by calendar arrangements. */
|
|
2375
|
-
function eventCalendarListGroupingDecision(input) {
|
|
2376
|
-
const available = input.arrangementLooks && resolveEventCalendarReadPlan(input).mode === "list";
|
|
2377
|
-
return {
|
|
2378
|
-
available,
|
|
2379
|
-
grouping: available && input.listBy === "week" ? "week" : "upcoming"
|
|
2380
|
-
};
|
|
2381
|
-
}
|
|
2383
|
+
//#region ../blocks/src/system/blocks/shop.shared.ts
|
|
2384
|
+
const publicPassProductCollectionSchema = z.object({ passes: z.array(publicPassProductSchema) });
|
|
2385
|
+
const publicMembershipProductCollectionSchema = z.object({ memberships: z.array(publicMembershipProductSchema) });
|
|
2382
2386
|
//#endregion
|
|
2383
2387
|
//#region ../blocks/src/system/blocks/events/shared/calendarWindow.ts
|
|
2384
2388
|
function resolveCalendarReadProfile(content) {
|
|
@@ -2468,34 +2472,15 @@ function planCalendarMonthRanges(months) {
|
|
|
2468
2472
|
return ranges;
|
|
2469
2473
|
}
|
|
2470
2474
|
//#endregion
|
|
2471
|
-
//#region ../
|
|
2472
|
-
const
|
|
2473
|
-
const
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
const EVENT_BOOKING_DECODER_QUERY = "bookingDecoder";
|
|
2480
|
-
const EVENT_BOOKING_RESPONSE_QUERY = {
|
|
2481
|
-
[EVENT_BOOKING_ARRIVAL_QUERY]: 1,
|
|
2482
|
-
[EVENT_BOOKING_DECODER_QUERY]: "tolerant"
|
|
2475
|
+
//#region ../logger/src/noop.ts
|
|
2476
|
+
const noop = () => {};
|
|
2477
|
+
const logger = {
|
|
2478
|
+
debug: noop,
|
|
2479
|
+
info: noop,
|
|
2480
|
+
warn: noop,
|
|
2481
|
+
error: noop,
|
|
2482
|
+
withFields: (_) => logger
|
|
2483
2483
|
};
|
|
2484
|
-
const eventAutoApplyDiscountPreviewBaseSchema = z.object({
|
|
2485
|
-
id: z.string(),
|
|
2486
|
-
publicLabel: z.string(),
|
|
2487
|
-
description: z.string().nullable(),
|
|
2488
|
-
minTicketsRequired: z.number().nullable()
|
|
2489
|
-
});
|
|
2490
|
-
const eventAutoApplyDiscountPreviewSchema = z.discriminatedUnion("discountType", [eventAutoApplyDiscountPreviewBaseSchema.extend({
|
|
2491
|
-
discountType: z.literal("percent"),
|
|
2492
|
-
discountPercent: z.number(),
|
|
2493
|
-
discountAmountCents: z.null()
|
|
2494
|
-
}), eventAutoApplyDiscountPreviewBaseSchema.extend({
|
|
2495
|
-
discountType: z.literal("fixed"),
|
|
2496
|
-
discountPercent: z.null(),
|
|
2497
|
-
discountAmountCents: z.number()
|
|
2498
|
-
})]);
|
|
2499
2484
|
//#endregion
|
|
2500
2485
|
//#region ../blocks/src/system/blocks/shared/siteTerms.ts
|
|
2501
2486
|
const versionId = z.string().uuid().transform((value, ctx) => {
|
|
@@ -2577,14 +2562,4 @@ function assertNever(value, message) {
|
|
|
2577
2562
|
throw new Error(message ?? `Unexpected value: ${String(value)}`);
|
|
2578
2563
|
}
|
|
2579
2564
|
//#endregion
|
|
2580
|
-
|
|
2581
|
-
const noop = () => {};
|
|
2582
|
-
const logger = {
|
|
2583
|
-
debug: noop,
|
|
2584
|
-
info: noop,
|
|
2585
|
-
warn: noop,
|
|
2586
|
-
error: noop,
|
|
2587
|
-
withFields: (_) => logger
|
|
2588
|
-
};
|
|
2589
|
-
//#endregion
|
|
2590
|
-
export { toBookingRequirementConsentField as $, formatSiteInstantTime as $t, normalizeEventCalendarDisplayMode as A, publicEventLoaderQuerySchemaShape as At, headingDecorationOverrideValues as B, projectPublicLocation as Bt, eventCalendarListGroupingDecision as C, formatGiftCardAmountLabel as Cn, purchasablePublicMembershipProductSchema as Ct, isEventCalendarDefaultView as D, eventScheduleScopeValues as Dt, eventListArrangementValues as E, calendarWindowQuerySchema as Et, arrangementModes as F, EVENT_PRESET_VALUES as Ft, publicEventDestinationSchema as G, mapDrawingSchema as Gt, tileTreatmentValues as H, toLocationCoordinates as Ht, decorativeTransitionIntentValues as I, WHOLE_SERIES_EVENT_PRESET_VALUES as It, publicEventsArraySchema as J, formatDate as Jt, publicEventPricingSchema as K, buildBookingUtcDateWindow as Kt, eventListTreatmentValues as L, locationValueSchema as Lt, accordionIconColorTokenValues as M, allocateReductionCents as Mt, accordionIconMotionValues as N, normalizeCurrencyCode as Nt, isEventCalendarDisplayMode as O, eventSurfacePresetValues as Ot, accordionIconSetValues as P, isRecord as Pt, isBookingRequirementConsentFieldId as Q, formatSiteInstantDate as Qt, eyebrowTreatmentValues as R, normalizeLocationAddressText as Rt, resolveCalendarReadProfile as S, formatCurrencyAmount as Sn, publicProductSchema as St, eventCalendarVariantMeaning as T, calendarMonthDate as Tt, visibleHeadingDecorationFamilyValues as U, capitalize as Ut, isArrangementMode as V, publicLocationSchema as Vt, eventVenueDrawingSchema as W, trimmedStringOrNull as Wt, blockBookingConsentSchema as X, formatDateTime as Xt, blockBookingPaymentTermsSchema as Y, formatDateRange as Yt, bookingConsentCarrierSchema as Z, formatDateTimeRange as Zt, calendarQueryKey as _, resolveBookingTimeZoneId as _n, eventCalendarDisplayModeValues as _t, okWith as a, formatBookingCompactEnglishTime as an, isRichTextDoc as at, calendarWindowPageSchema as b, parsePositiveMoneyInputToCents as bn, publicMembershipProductSchema as bt, reportWorkflowSuccess as c, compareLocalScheduleDates as cn, imageMediaSchema as ct, EVENT_BOOKING_RESPONSE_QUERY as d, getLocalScheduleDate as dn, runtimeMediaSchema as dt, formatTime as en, beforeBookingQuestionsPresentationSchema as et, eventAutoApplyDiscountPreviewSchema as f, parseBookingLocalDate as fn, videoMediaSchema as ft, calendarPageResponseError as g, resolveBookingBusinessTimeZone as gn, eventCalendarDefaultViewValues as gt, calendarMonthKey as h, toUtcIsoDateTimeString as hn, mediaTypeDiscriminants as ht, ok as i, resolveBookingDisplayContext as in, createRichTextDoc as it, resolveEventCalendarReadPlan as j, unsafeAsPositiveCheckoutQuantity as jt, isEventCalendarListLayout as k, eventSurfaceScopeValues as kt, blockSiteTermsSchema as l, formatLocalScheduleDate as ln, mediaSchema as lt, publicPassProductCollectionSchema as m, parseUtcIsoDateTimeString as mn, isDisplayMediaKind as mt, assertNever as n, formatTimeZoneCityLabel as nn, RichTextDocSchema as nt, clearWorkflowFeedback as o, toScheduledBookingDateTime as on, assetMediaSchema as ot, publicMembershipProductCollectionSchema as p, parseLocalScheduleTime as pn, PUBLIC_FILE_FIELD_KINDS as pt, publicEventSchema as q, validateBookingPaymentOptionKinds as qt, err as r, inferSiteDateLocale as rn, buildRichTextSchema as rt, reportWorkflowError as s, addLocalScheduleDays as sn, externalMediaSchema as st, logger as t, formatTimeRange as tn, bookingQuestionsAnswerValueSchema as tt, verifiedSiteTermsAcceptanceSchema as u, getBookingLocalDateKey as un, persistableMediaSchema as ut, calendarWindowBounds as v, toBookingTimeZone as vn, eventCalendarListLayoutCompatibleDisplayModeValues as vt, eventCalendarListLayoutOptions as w, purchasablePublicPassProductSchema as wt, planCalendarMonthRanges as x, toNonNegativeCents as xn, publicPassProductSchema as xt, calendarWindowMonths as y, parsePositiveCents as yn, eventCalendarListLayoutValues as yt, headingDecorationColorTokenValues as z, parseLocationValue as zt };
|
|
2565
|
+
export { PUBLIC_FILE_FIELD_KINDS as $, formatTimeRange as $t, toBookingRequirementConsentField as A, eventSurfaceScopeValues as At, normalizeEventCalendarDisplayMode as B, toLocationCoordinates as Bt, publicEventPricingSchema as C, publicProductSchema as Ct, blockBookingConsentSchema as D, calendarWindowQuerySchema as Dt, blockBookingPaymentTermsSchema as E, calendarMonthDate as Et, eventCalendarVariantMeaning as F, locationValueSchema as Ft, isRichTextDoc as G, validateBookingPaymentOptionKinds as Gt, RichTextDocSchema as H, trimmedStringOrNull as Ht, eventListArrangementValues as I, normalizeLocationAddressText as It, imageMediaSchema as J, formatDateTime as Jt, assetMediaSchema as K, formatDate as Kt, isEventCalendarDefaultView as L, parseLocationValue as Lt, bookingQuestionsAnswerValueSchema as M, isRecord as Mt, eventCalendarListGroupingDecision as N, EVENT_PRESET_VALUES as Nt, bookingConsentCarrierSchema as O, eventScheduleScopeValues as Ot, eventCalendarListLayoutOptions as P, WHOLE_SERIES_EVENT_PRESET_VALUES as Pt, videoMediaSchema as Q, formatTime as Qt, isEventCalendarDisplayMode as R, projectPublicLocation as Rt, publicEventDestinationSchema as S, publicPassProductSchema as St, publicEventsArraySchema as T, purchasablePublicPassProductSchema as Tt, buildRichTextSchema as U, mapDrawingSchema as Ut, resolveEventCalendarReadPlan as V, capitalize as Vt, createRichTextDoc as W, buildBookingUtcDateWindow as Wt, persistableMediaSchema as X, formatSiteInstantDate as Xt, mediaSchema as Y, formatDateTimeRange as Yt, runtimeMediaSchema as Z, formatSiteInstantTime as Zt, planCalendarMonthRanges as _, parsePositiveCents as _n, eventCalendarDefaultViewValues as _t, clearWorkflowFeedback as a, addLocalScheduleDays as an, arrangementModes as at, publicPassProductCollectionSchema as b, formatCurrencyAmount as bn, eventCalendarListLayoutValues as bt, blockSiteTermsSchema as c, getBookingLocalDateKey as cn, eyebrowTreatmentValues as ct, calendarMonthKey as d, parseLocalScheduleTime as dn, isArrangementMode as dt, formatTimeZoneCityLabel as en, isDisplayMediaKind as et, calendarPageResponseError as f, parseUtcIsoDateTimeString as fn, tileTreatmentValues as ft, calendarWindowPageSchema as g, toBookingTimeZone as gn, normalizeCurrencyCode as gt, calendarWindowMonths as h, resolveBookingTimeZoneId as hn, allocateReductionCents as ht, okWith as i, toScheduledBookingDateTime as in, accordionIconSetValues as it, beforeBookingQuestionsPresentationSchema as j, publicEventLoaderQuerySchemaShape as jt, isBookingRequirementConsentFieldId as k, eventSurfacePresetValues as kt, verifiedSiteTermsAcceptanceSchema as l, getLocalScheduleDate as ln, headingDecorationColorTokenValues as lt, calendarWindowBounds as m, resolveBookingBusinessTimeZone as mn, unsafeAsPositiveCheckoutQuantity as mt, err as n, resolveBookingDisplayContext as nn, accordionIconColorTokenValues as nt, reportWorkflowError as o, compareLocalScheduleDates as on, decorativeTransitionIntentValues as ot, calendarQueryKey as p, toUtcIsoDateTimeString as pn, visibleHeadingDecorationFamilyValues as pt, externalMediaSchema as q, formatDateRange as qt, ok as r, formatBookingCompactEnglishTime as rn, accordionIconMotionValues as rt, reportWorkflowSuccess as s, formatLocalScheduleDate as sn, eventListTreatmentValues as st, assertNever as t, inferSiteDateLocale as tn, mediaTypeDiscriminants as tt, logger as u, parseBookingLocalDate as un, headingDecorationOverrideValues as ut, resolveCalendarReadProfile as v, parsePositiveMoneyInputToCents as vn, eventCalendarDisplayModeValues as vt, publicEventSchema as w, purchasablePublicMembershipProductSchema as wt, eventVenueDrawingSchema as x, formatGiftCardAmountLabel as xn, publicMembershipProductSchema as xt, publicMembershipProductCollectionSchema as y, toNonNegativeCents as yn, eventCalendarListLayoutCompatibleDisplayModeValues as yt, isEventCalendarListLayout as z, publicLocationSchema as zt };
|