@riverbankcms/sdk 0.174.1 → 0.176.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_dts/{BlocksIslandsHydrator-YRmc-Yxz.d.ts → BlocksIslandsHydrator-DvoTk7Py.d.ts} +1 -1
- package/dist/_dts/{Page-Du0zX1B-.d.ts → Page-D-l374tU.d.ts} +8 -16
- package/dist/_dts/{SdkPreviewMode-4L8v3FkY.d.ts → SdkPreviewMode-22DdQAj5.d.ts} +2 -2
- package/dist/_dts/{client-B1J6Akyf.d.ts → client-D4p0J1lK.d.ts} +487 -11
- package/dist/_dts/{content-types-CGGYI0u_.d.ts → content-types-0WWR6dC4.d.ts} +2 -2
- package/dist/_dts/{contracts-CHMlw9hT.d.ts → contracts-f_ZG_SwY.d.ts} +8 -8
- package/dist/_dts/{footerPageOutline-DIHSU1Vr.d.ts → footerPageOutline-DSeZvOaj.d.ts} +85 -8
- package/dist/_dts/{generatePageMetadata-JITXD6BU.d.ts → generatePageMetadata-BlitPA2D.d.ts} +2 -2
- package/dist/_dts/{index-BLEKFHt1.d.ts → index-CKkkCgb6.d.ts} +1 -1
- package/dist/_dts/{index-yWDbUojb.d.ts → index-CoLcwjqJ.d.ts} +1 -1
- package/dist/_dts/{index-DpJm0NpL.d.ts → index-D-ai8IQd.d.ts} +4 -4
- package/dist/_dts/{index-CXZSy_9M.d.ts → index-DDsfmM4d.d.ts} +2 -2
- package/dist/_dts/{index-CF62FntA.d.ts → index-EJMo-KSo.d.ts} +2 -2
- package/dist/_dts/{index-D9ZYmGAJ.d.ts → index-ZKEDvLuN.d.ts} +1 -1
- package/dist/_dts/{index-BgOr1Xyz.d.ts → index-tcPtGdag.d.ts} +3 -3
- package/dist/_dts/{loadContent-M-s0p0rq.d.ts → loadContent-Ci932ORy.d.ts} +7 -7
- package/dist/_dts/{request-BK-pHf0P.d.ts → request-B8jVdvgI.d.ts} +1993 -407
- package/dist/_dts/{resolveBlockData-DZAlnhwt.d.ts → resolveBlockData-DrSMuD76.d.ts} +5 -5
- package/dist/_dts/{resolvePageContent-DXUCWJ3y.d.ts → resolvePageContent-Be4iL6-F.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 +5 -177
- 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 +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-CwmB2NHU.d.ts → types-BXMX4z2j.d.ts} +7 -7
- package/dist/_dts/{types-DjVNADXR.d.ts → types-DXY64Xh4.d.ts} +4 -4
- package/dist/_dts/{types-Dmow_FI6.d.ts → types-lwSgCWZ4.d.ts} +11 -2
- package/dist/_dts/{validation-h8t1HLlL.d.ts → validation-C5xp--Fu.d.ts} +7 -4
- package/dist/client/{BlocksIslandsHydrator-DRVx_XLi.mjs → BlocksIslandsHydrator-CeYQQQs7.mjs} +17 -16
- package/dist/client/{BookingMailingListNote-CwrMzj-k.mjs → BookingMailingListNote-CDDWrY_W.mjs} +6 -6
- package/dist/client/{BookingPanelArrangement-C2_hFT6K.mjs → BookingPanelArrangement-BShQSial.mjs} +1 -1
- package/dist/client/{BookingQuestionFields-DZMrGvBh.mjs → BookingQuestionFields-MbvIo2jS.mjs} +3 -3
- package/dist/client/{CalendarNavigationChevron-Az1-TIEI.mjs → CalendarNavigationChevron-C6CSVfEB.mjs} +36 -11
- package/dist/client/DemoBookingPortalAccess-C9Ggcfx3.mjs +545 -0
- package/dist/client/{EventCalendar.client-CDkkP-Lv.mjs → EventCalendar.client-BSMuSqg0.mjs} +15 -25
- package/dist/client/{EventCombined.client-DK3aaz62.mjs → EventCombined.client-BTrmSyUB.mjs} +25 -17
- package/dist/client/{EventItem-WeUipfIP.mjs → EventItem-B0WjGXsH.mjs} +4 -3
- package/dist/client/{EventListWeekNavigation-D3sbAeDo.mjs → EventListWeekNavigation-8Ij7vuxY.mjs} +1 -1
- package/dist/client/{EventListing.client-DL3gGGmF.mjs → EventListing.client-CWk2NEwd.mjs} +3 -3
- package/dist/client/{EventListing.view-DKFImKOx.mjs → EventListing.view-BEH4UbSL.mjs} +18 -8
- package/dist/client/{EventRegistrationPayment-Dn9TpWyL.mjs → EventRegistrationPayment-B2EikR3f.mjs} +635 -359
- package/dist/client/{LocationMapActions-BJT7MqP2.mjs → LocationMapActions-myIQIvQL.mjs} +1 -1
- package/dist/client/{MapDrawingSvg-DCIwlON6.mjs → MapDrawingSvg-BfsVyPvB.mjs} +2 -22
- package/dist/client/{Page-BpeP9xdt.mjs → Page-F3lhDvw1.mjs} +1036 -953
- package/dist/client/{DemoBookingPortalAccess-1p-pJ1lg.mjs → SiteTermsAgreementField-BYACYP0T.mjs} +4 -301
- package/dist/client/{StepIndicator-CP6zrwkl.mjs → StepIndicator-Bb7rPtSq.mjs} +37 -12
- package/dist/client/{accordion-nR7D4m1a.mjs → accordion-BfsOiweL.mjs} +1 -1
- package/dist/client/{booking-form.client-Ce-mQZ7W.mjs → booking-form.client-B8ohIj13.mjs} +229 -42
- package/dist/client/{bookingForm-B-qT_AQB.mjs → bookingForm-CXsck2oH.mjs} +4 -4
- package/dist/client/bookings.mjs +22 -15
- package/dist/client/{boxStyleClassNames-CrE3TDpW.mjs → boxStyleClassNames-B_hcuT06.mjs} +2 -1
- package/dist/client/{carousel-CVUOatsY.mjs → carousel-Cz5Ddbsx.mjs} +1 -1
- package/dist/client/{cart-DE0K6E0R.mjs → cart-CTC2oS3p.mjs} +3 -3
- package/dist/client/{cart.client-C23E6WQ5.mjs → cart.client-c1YkTC-Q.mjs} +1 -1
- package/dist/client/{checkout-76cdHyPL.mjs → checkout-BeW1ufaH.mjs} +3 -3
- package/dist/client/{checkout.client-DJOzqb26.mjs → checkout.client-BeU32khQ.mjs} +1 -1
- package/dist/client/{checkoutUrls-CvIP5DCO.mjs → checkoutUrls-DVfSUSKp.mjs} +1 -1
- package/dist/client/client.mjs +145 -21
- package/dist/client/{context-CNlesLfF.mjs → context-R9p5c8IH.mjs} +76 -58
- package/dist/client/{course-DHIrXqNT.mjs → course-CUFVJEAc.mjs} +2 -2
- package/dist/client/{creditProducts-KYMVIH3J.mjs → creditProducts-BQ1t1erI.mjs} +14 -61
- package/dist/client/{dateFormatting-B73Ll0s4.mjs → dateFormatting-CF6FWCoo.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-BVbLD4pi.mjs → demoPortalMagicLink-tZxIm3RL.mjs} +1 -1
- package/dist/client/display-4HYOb-AK.mjs +11844 -0
- package/dist/client/{enhanceHeaderSection-5GD5o4Mt.mjs → enhanceHeaderSection-DEYDI54E.mjs} +3 -3
- package/dist/client/{event-details.client-D7Oz1q2L.mjs → event-details.client-BwjBJP-f.mjs} +1 -1
- package/dist/client/{event-registration.client-zbuX36aA.mjs → event-registration.client-DWvSODTI.mjs} +176 -75
- package/dist/client/{eventCalendar-uZrksODt.mjs → eventCalendar-C9Pn9eeZ.mjs} +4 -4
- package/dist/client/{eventCombined-DxhvNAx8.mjs → eventCombined-Bdhk0fp0.mjs} +4 -4
- package/dist/client/{eventDetails-DCIH4BYG.mjs → eventDetails-C2LfNW_o.mjs} +2 -2
- package/dist/client/{eventListing-B9KrnPvc.mjs → eventListing-B-bJOQUk.mjs} +4 -4
- package/dist/client/{eventRegistration-TjnURMKl.mjs → eventRegistration-CbdmUiDT.mjs} +4 -4
- package/dist/client/{form-CfqIAhfN.mjs → form-BbUUt784.mjs} +3 -3
- package/dist/client/{form.client-CL6fF0cW.mjs → form.client-BVlz-9_t.mjs} +4 -4
- package/dist/client/{form.parts-Bf-L66Gg.mjs → form.parts-TB4UIrML.mjs} +1 -1
- package/dist/client/{formatDate-Dp7POa9Y.mjs → formatDate-TDHhFjFN.mjs} +1 -1
- package/dist/client/gifting/client.mjs +5 -3
- package/dist/client/gifting-CbNSrp7C.mjs +28 -0
- package/dist/client/gifting.client-B__bGhFc.mjs +404 -0
- package/dist/client/gifting.parts-CTA1sDW6.mjs +86 -0
- package/dist/client/{headerSection-WVXtOcuW.mjs → headerSection-5Wn9nUW_.mjs} +2 -2
- package/dist/client/{display-Cf_j5stk.mjs → lookSurfaces-BwiNdgMU.mjs} +2951 -14395
- package/dist/client/{newsletter-form.client-Bb7GAZpO.mjs → newsletter-form.client-B17WYHxZ.mjs} +7 -5
- package/dist/client/{newsletter-form.parts-BqOVRdIc.mjs → newsletter-form.parts-DN9wD1ZG.mjs} +3 -3
- package/dist/client/{newsletterForm-DOVe-qY3.mjs → newsletterForm-DLMlxInp.mjs} +3 -3
- package/dist/client/{noop-D5mFWXtN.mjs → noop-CaQxI-Js.mjs} +94 -36
- package/dist/client/portal/client.mjs +313 -148
- package/dist/client/{product-detail.client-CNzeFnFf.mjs → product-detail.client-Di_anRGR.mjs} +1 -1
- package/dist/client/{product-list.client-LKpzC7pj.mjs → product-list.client-Duhl6rtL.mjs} +1 -1
- package/dist/client/{productDetail-D2JNeEgx.mjs → productDetail-BgKmCwA8.mjs} +3 -3
- package/dist/client/{productList-DTgZXOEq.mjs → productList-C_wMKsYS.mjs} +3 -3
- package/dist/client/{propsDecoder-mpBQt2AT.mjs → propsDecoder-y3LvxaiG.mjs} +4 -3
- package/dist/client/{registry.server-DdTJyar2.mjs → registry.server-CIWYKz1V.mjs} +369 -246
- package/dist/client/rendering/client.mjs +25 -491
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +87 -21
- package/dist/client/{richText-coerce-C32cRQ03.mjs → richText-coerce-DkPBFb_a.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-8cfSgT0E.mjs → routeIslandApiConfig-BgO0rZce.mjs} +1 -1
- package/dist/client/{shop-5LBhftWx.mjs → shop-CFbWlv_W.mjs} +3 -3
- package/dist/client/{shop-discount-apply.state-D0ifS6KX.mjs → shop-add-feedback-DvC2kP1K.mjs} +1 -78
- package/dist/client/{shop-commerce-DkValjZj.mjs → shop-commerce-C-I29eaA.mjs} +64 -32
- package/dist/client/{shop-commerce-store-BOmXFmk_.mjs → shop-commerce-store-DGcc7twO.mjs} +1 -1
- package/dist/client/shop-discount-apply.state-DOm7vx0X.mjs +83 -0
- package/dist/client/{shop.client-BTtZqNmv.mjs → shop.client-GHTWUKD6.mjs} +56 -19
- package/dist/client/{shop.interactive-DNRqG4aX.mjs → shop.interactive-CxDJ8P2r.mjs} +113 -35
- package/dist/client/{shopShared-Nky6kPYr.mjs → shopShared-Be9QJJpT.mjs} +2 -2
- package/dist/client/{timetableModel-DZArznD_.mjs → timetableModel--R0zVzZO.mjs} +10 -10
- package/dist/client/{useAvailableSlots-CUVRD1nx.mjs → useAvailableSlots-BGu_2F50.mjs} +3 -3
- package/dist/client/{useDiscountCodeUi-d7viY_mu.mjs → useDiscountCodeUi-I_mXI9Yd.mjs} +32 -17
- package/dist/client/{useEventPagination-Da2JqxGC.mjs → useEventPagination-DxIJ--JZ.mjs} +7 -6
- package/dist/client/{view-BvuYmQJ5.mjs → view-3foOzGWR.mjs} +3 -2
- package/dist/client/{view-D9ObkFtz.mjs → view-BbzH5MQb.mjs} +128 -32
- package/dist/preview-next/client/{PageSectionToolbar-DwxHT-2k.mjs → PageSectionToolbar-0xyUPWUB.mjs} +4 -4
- package/dist/preview-next/client/{PreviewEditorSidebar-D4SBxGU6.mjs → PreviewEditorSidebar-D8vUzXtI.mjs} +61 -55
- package/dist/preview-next/client/{PreviewEditorUI-D8mUct32.mjs → PreviewEditorUI-CRjS4gAu.mjs} +4 -4
- package/dist/preview-next/client/{PreviewShell-L2AEdNUQ.mjs → PreviewShell-BvdBdeH_.mjs} +5 -5
- package/dist/preview-next/client/{SdkPreviewModeRuntime-bhVAU2D2.mjs → SdkPreviewModeRuntime-DWTyKbFj.mjs} +156 -143
- package/dist/preview-next/client/{previewAssistantSlot-Jpj_HDra.mjs → previewAssistantSlot-BqY2TTcZ.mjs} +4535 -2913
- package/dist/preview-next/client/{previewChromeRoot-CYTDvx4u.mjs → previewChromeRoot-BuRYe2iL.mjs} +1 -1
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-CZHX6J_4.mjs → sdk-runtime-BnK5kH9f.mjs} +2 -2
- package/dist/preview-next/client/{siteStyleAccess-DmGIG9Hk.mjs → siteStyleAccess-DbKozRSn.mjs} +527 -236
- package/dist/preview-next/client/{useAutosaveStatus-DQCyswQ-.mjs → useAutosaveStatus-D9s6dyMW.mjs} +1 -1
- package/dist/preview-next/client/{useOpenBlockForSetup-LwE5yXvL.mjs → useOpenBlockForSetup-Ce4WCxpT.mjs} +28 -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-BOuNcOcN.mjs → route-contract-BYezcMx5.mjs} +94 -12
- package/dist/server/{Block.shared-wfJfhs08.mjs → Block.shared-Cn7gg13_.mjs} +84 -16
- package/dist/server/{ThemeScopeCore-BtrJNHTB.mjs → ThemeScopeCore-DFEM1a85.mjs} +16 -2
- package/dist/server/{bindings-P1CF2Gm6.mjs → bindings-VGgS6UvF.mjs} +13 -34
- package/dist/server/{client-CGtU5fHI.mjs → client-Bvag5OtW.mjs} +145 -22
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{customCss-BGB8gMVb.mjs → customCss-BZ8YSrQg.mjs} +1 -0
- package/dist/server/data/resolveBlockData.mjs +1 -1
- package/dist/server/index.mjs +2 -2
- package/dist/server/{loadContent-ChnkJSay.mjs → loadContent-CxASA3PE.mjs} +6 -9
- package/dist/server/{loadPage-DesHhgxj.mjs → loadPage-CQgde5DN.mjs} +2 -2
- package/dist/server/{lookMediaFrame-BBr0mkze.mjs → lookMediaFrame-CaH018pK.mjs} +24 -5
- package/dist/server/mapLocation-BM5WX7FY.mjs +315 -0
- package/dist/server/next.mjs +35 -9
- package/dist/server/{overrideResolution-DHEkHcZs.mjs → overrideResolution-BqVLO4gX.mjs} +1 -1
- package/dist/server/page-converter.mjs +1 -1
- package/dist/server/{pageRenderPlan-0jvm0RBk.mjs → pageRenderPlan-CfSnAkCO.mjs} +67 -40
- package/dist/server/{pageRuntimeSupport-8-f1Zr9e.mjs → pageRuntimeSupport-uz4gzBOo.mjs} +7 -15
- package/dist/server/{pageShared-CuVFoV4z.mjs → pageShared-D23o5QgC.mjs} +1068 -891
- package/dist/server/{parseThemeForPersistence-Cwqb5pZx.mjs → parseThemeForPersistence-DOsfofCy.mjs} +1 -1
- package/dist/server/{prebuild-Bms_Y7wQ.mjs → prebuild-BuoXWT9y.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-5oC5kyHe.mjs → prefetchBlockData-CCiYV8_s.mjs} +21 -6
- package/dist/server/{registry-DmqxC8th.mjs → registry-CXRXsFSx.mjs} +19721 -19621
- 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 +4 -4
- package/dist/server/rendering.mjs +7 -7
- package/dist/server/{resolveBlockData-EYogtwQc.mjs → resolveBlockData-yfe8WLEA.mjs} +1 -1
- package/dist/server/{responseMedia-DpBC1hTM.mjs → responseMedia-F-ElH2Rd.mjs} +1 -0
- package/dist/server/{schema-CUDHMirj.mjs → schema-BpsqaSSU.mjs} +2 -2
- package/dist/server/server.mjs +3 -3
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/theme.mjs +2 -2
- package/dist/server/{validation-Bt_8IL1g.mjs → validation-CozQ7wE0.mjs} +4 -4
- package/dist/server/{version-DT_efohp.mjs → version-CgCWRFEY.mjs} +1 -1
- package/dist/styles/index.css +295 -37
- package/package.json +1 -1
- package/dist/client/useDiscountApply-BBnStWXU.mjs +0 -199
- package/dist/server/identity-DQD_8lNO.mjs +0 -6
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { Dt as parseThemeColorToken, Et as parseColorTokenParts, G as hexToRgb, R as contrastRatio, a as formatButtonColourContractError, at as surfaceForegroundValue, c as DEFAULT_BUTTON_SIZES, ct as surfaceInkStyle, d as generateShadowValue$1, et as SURFACE_INK_CSS_VARS, f as DEFAULT_VARIANT_ALIAS_ID, ft as cssVarValue, g as createStandardButtonSurfacePolicy, gt as textColorValue, h as buttonSizeNameSchema, ht as textColorStyle, i as BUTTON_CONTRAST_POLICY, j as expandPalette, mt as rgbColorValue, n as compileButtonColourStates, nt as surfaceForegroundDeclarations, pt as mergeStyles, r as resolveSolidButtonColour, rt as surfaceForegroundInputFromResolved, s as BORDER_WIDTH_MAP, st as surfaceInkDeclarations, u as FONT_SIZE_MAP, ut as backgroundColorStyle, v as unsafeAsOpaqueButtonColourToken } from "./resolveButtonColourStates--6yJp9Tq.mjs";
|
|
2
|
-
import { $ as resolveEventLinkProps, A as deriveEventScheduleSummary, B as MapPinIcon, C as EventHeader, D as OfferingCourseCards, E as EventListingFrameView, F as CardListCollection, G as buildMonthDay, H as eventDisplayTitleText, I as CardListItems, J as selectQuickDateEvents, K as resolveMonthSelectedDay, L as EventItem, M as createEditorPresentationPageReader, N as createPresentationPageReader, O as eventCardListContent, P as EmptyState, Q as resolveEventCta, R as eventCategoryBadge, S as lookPartShown, T as MonthLookView, U as formatCourseDatesAfter, V as eventDisplayTitle, W as formatCourseSessions, X as formatEventDuration, Y as formatEventTeacherLine, Z as resolveEventCardBooking, _ as publicAppointmentPricingSchema, a as joinSlotKey, at as defaultThemeTokens, b as resolvePageRouteTarget, c as buildLinkedContentEditTarget, et as parseStoredVariant, f as defaultTransforms, g as publicAppointmentLocationSchema, h as formatAppointmentPrice, i as composePageJoins, it as buildThemeTokens, j as derivePreviewRunSchedule, k as offeringDatesBySeries, m as formatAppointmentLocation, n as createPageRenderPlanReader, o as renderedJoinLayout, p as formatAppointmentDuration, q as formatEventQuickDate, s as retargetJoinsAcrossOmissions, u as resolveLinkedEntryInlineFieldEligibility, w as EVENT_REGISTRATION_ANCHOR_ID, x as resolveRouteTarget, y as resolveEntryRouteTarget, z as CalendarIcon } from "./pageRenderPlan-
|
|
3
|
-
import { $ as
|
|
2
|
+
import { $ as resolveEventLinkProps, A as deriveEventScheduleSummary, B as MapPinIcon, C as EventHeader, D as OfferingCourseCards, E as EventListingFrameView, F as CardListCollection, G as buildMonthDay, H as eventDisplayTitleText, I as CardListItems, J as selectQuickDateEvents, K as resolveMonthSelectedDay, L as EventItem, M as createEditorPresentationPageReader, N as createPresentationPageReader, O as eventCardListContent, P as EmptyState, Q as resolveEventCta, R as eventCategoryBadge, S as lookPartShown, T as MonthLookView, U as formatCourseDatesAfter, V as eventDisplayTitle, W as formatCourseSessions, X as formatEventDuration, Y as formatEventTeacherLine, Z as resolveEventCardBooking, _ as publicAppointmentPricingSchema, a as joinSlotKey, at as defaultThemeTokens, b as resolvePageRouteTarget, c as buildLinkedContentEditTarget, et as parseStoredVariant, f as defaultTransforms, g as publicAppointmentLocationSchema, h as formatAppointmentPrice, i as composePageJoins, it as buildThemeTokens, j as derivePreviewRunSchedule, k as offeringDatesBySeries, m as formatAppointmentLocation, n as createPageRenderPlanReader, o as renderedJoinLayout, p as formatAppointmentDuration, q as formatEventQuickDate, s as retargetJoinsAcrossOmissions, u as resolveLinkedEntryInlineFieldEligibility, w as EVENT_REGISTRATION_ANCHOR_ID, x as resolveRouteTarget, y as resolveEntryRouteTarget, z as CalendarIcon } from "./pageRenderPlan-CfSnAkCO.mjs";
|
|
3
|
+
import { $i as chosenString, $n as parseTeamMemberSpecialties, $o as getDayOfWeek, $r as testimonialsHeadingFragment, $s as resolveExactOrFreePriceDisplay, $t as formatCalendarTitle, A as membershipClassesLabel, Ai as resolveBlockIconRenderValue, An as planOrdinarySeriesSelection, As as sameMailingListPlacementTargeting, At as groupOfferingRunsByCourse, B as eventListingBlockDefinition, Bi as MinusIcon, Bs as getBookingLocalDateKey, Bt as ThemedButtonLink, C as buildCartInteractiveIslandProps, Ca as readOpeningToneProjection, Cn as bookingPageKindSchema, Cr as lookListPresentationSchemaShape, Ct as normalizeEventRegistrationPageSurfaceSubject, D as buildShopInteractiveIslandProps, Da as headerRootPaint, Di as when, Dn as getPublicEventCanonicalPath, Dr as clsx, Ds as parseMailingListRuntimeContext, E as buildProductListInteractiveIslandProps, Ea as headerRootIsTransparent, Ei as el, En as eventOccurrenceContext, Eo as transitionCatalogueEntries, Er as Grid, Es as buildMailingListSignupBlockSourceRef, F as offeringsCatalogueShape, Fi as ClockIcon, Fn as selectionRepresentativeEvent, Fr as formatCoursePrice, Ft as resolveOfferingsPreviewGroupCta, G as eventCollectionDisplaySchemaShape, Gn as resolveFeatureCardGeneratedIconSizePx, Gr as cardFragment, Gs as toBookingTimeZone, Gt as eventListWeekDays, H as buildEventCollectionDisplay, Hi as inlineTextToPlainText, Hn as isEventFull, Ht as getIconComponent, I as eventCalendarBlockDefinition, Ii as FileArchiveIcon, In as isBookableEvent, Ir as formatEventDepositNote, It as resolveOfferingsPreviewGroups, J as catalogueEventCardProps, Ji as parseFieldDefinitions, Jr as blogFeaturedPostFragment, Js as formatBookingPriceDisplay, K as eventCollectionHydrationSchema, Kn as shouldReserveFeatureCardIconZone, Kr as faqAccordionFragment, Ks as toUtcIsoDateTimeString, Kt as eventWeekGroupingContext, L as buildEventCalendarInteractiveIslandProps, La as arrangementManifestFromVariants, Li as FileAudioIcon, Lo as bindingSchema, Lr as formatEventPrice, Ls as formatBookingCompactEnglishTime, Lt as resolveOfferingsRenderInput, M as offeringsPreviewBlockDefinition, Mi as ChevronDownIcon, Mn as planWholeSeriesParentSelection, Ms as EVENT_ADDRESS_AFTER_BOOKING_LABEL, Mt as offeringRunLifecycle, N as publicRouteCandidatesSchema, Ni as CircleMinusIcon, Nn as planWholeSeriesRunSelection, Ns as formatDate$1, Nt as offeringsListingFor, O as shopProductPresentation, Oi as buildGeneratedBlockIconRenderAssetLookupFromUnknown, On as isOrdinaryPublicEvent, Ot as OFFERINGS_PREVIEW_EVENT_PRESET_DEFINITIONS, P as buildOfferingsCatalogueListing, Pi as CirclePlusIcon, Pn as resolveSelectionBookingClosedDetail, Pt as readOfferingsGrouping, Q as cardListPresentationSchemaShape, Qi as isRecord$4, Qo as formatDateKey, Qr as testimonialsCarouselFragment, Qs as publicEventPricingType, R as buildEventCalendarListingDisplay, Ri as FileSpreadsheetIcon, Rn as formatEventRemainingPlaces, Rr as formatEventPriceAmount, Rs as toScheduledBookingDateTime, Rt as ThemedAuthoredButton, S as shopBlockDefinition, Sa as effectiveHeaderNavLinkStyle, Sn as closedRunCopy, Sr as listLookSlot, Ss as CANCELLED_SESSION_STATUS, St as previewStageSchema, T as buildProductDetailInteractiveIslandProps, Ta as headerNeedsPhotoShade, Ti as runTransforms, Tn as hasCancelledRegistrationDate, To as anglePolygonCss, Tr as itemRole, Ts as resolveWholeSeriesBookingPhase, U as buildEventCollectionHydration, Ui as isInlineTextEmpty, Un as groupPublicEventsByRun, Ur as richTextFragment, Us as parseLocalScheduleTime, Ut as SpinnerNode, V as buildEventListingInteractiveIslandProps, Vi as PlusIcon, Vn as getEventAvailabilityStatus, Vt as ThemedDownloadLink, W as buildEventCollectionListingDisplay, Wi as parseInlineTextFromUnknown, Wn as FEATURE_CARD_ICON_TREATMENTS, Wr as headingFragment, Ws as resolveBookingBusinessTimeZone, Wt as buildEventListWeek, X as CardListContentPart, Xn as markEditableSurfaceForwarding, Xo as getLocalMinuteOfDay, Xr as formEmbedFragment, Xs as publicEventPricingCurrency, Y as listingEventCardProps, Ya as requireCuratedSiteStyle, Yi as PUBLIC_DOWNLOAD_MEDIA_TYPES, Yn as composeHeaderSectionWrapperClassName, Yo as getLocalDateKey, Yr as singleButtonFragment, Ys as isPublicEventPricingOptionDisplayable, Yt as buildCalendarViewport, Zi as isObjectRecord, Zn as splitPositioningClasses, Zo as addDays, Zr as formCopyFragment, Zs as publicEventPricingDisplay, Zt as eventDateOptions, _ as buildGiftingInteractiveIslandProps, _i as bodyCopyFragment, _n as eventPlaceName, _r as createZodCodec, _s as loadedReadinessFact, _t as getContainerClass, a as LOCATION_MAP_LOADER_KEYS, an as formatEventNextDateFact, ao as generateNavLinkCSS, b as productDetailBlockDefinition, bn as blockSiteTermsSchema, br as listItemPresentation, bt as resolveEventRegistrationEventSource, c as normalizeLocationMapSource, ci as resolveCardRoleForBoxStyles, co as resolveEffectPaint, cr as staticHeaderChromeRuntime, cs as blockBookingConsentSchema, d as newsletterSignupBlockDefinition, dn as resolveEventTimeZone, ds as sanitizeHref, ei as ctaCopyFragment, en as formatDate, er as teamMemberBiography, es as getOrderedDayNames, fn as resolveRuntimeEventDestination, fr as formBlockDefinition, ft as buildResolveImageUrlContext, g as giftingBlockDefinition, ga as resolveHeaderRootForeground, gn as eventOnlinePlace, gr as defineInteractiveIslandMetaKeys, gs as hiddenFromVisitors, gt as getCardOrientation, h as newsletterBlockSubmissionMessage, ha as AFFORDANCE_SUPPRESS_CLASS, hi as ctaButton, hn as browserReadAuthoritySchema, hr as createInteractiveIslandCodec, hs as admitReadinessFacts, ht as EventQuickFacts, ia as eventReadinessResultSchema, ii as heroCopyFragment, in as formatEventHourLabel, io as buildTextContrastShadow, is as isToday, it as MediaPlaceholder, j as passCardListContent, ji as ArrowDownIcon, jn as planWholeSeriesParentBooking, jt as normalizeOfferingsPreviewItemLimit, k as membershipCardListContent, ka as arrangementLookHooks, ki as parseBlockIconValue, kn as planDropInPanel, ks as parseMailingListPlacementTargeting, kt as buildOfferingsPreviewListing, l as parseLocationMapLoaderResult, ln as formatTime, lo as generateInteractiveChildInheritanceCSS, ls as bookingConsentCarrierSchema, lt as resolvePublicMediaUrl, m as buildNewsletterFormInteractiveIslandProps, ma as themeButtonSelector, mi as resolveBackgroundColorValue, mn as bookingPresentation, mr as buildInteractiveIslandProps, mt as setContextResolveImageUrlContext, ni as ctaRowFragment, nn as formatEventCompactDateRail, no as generateDefaultCardSystem, nr as readRuntimeNow, ns as getWeekCalendarDays, nt as RichText, o as describeUnresolvedLocationMapLocation, oi as boxStyleClassNames, oo as generateEffectsCSS, os as publicEventsArraySchema, p as NEWSLETTER_SIGNUPS_PAUSED_MESSAGE, pa as parseThemeButtonVariantId, pr as buildFormInteractiveIslandProps, pt as getCurrentResolveImageUrlContext, q as eventCollectionSourceSchemaShape, qr as faqHeadingFragment, r as normalizeBlockContent, ri as isBlockButtonRole, rn as formatEventDateParts, ro as generateFooterCss, rr as resolveDateRuntimeContext, rs as isSameCalendarDay, rt as ImagePresets, s as normalizeLocationMapProps, sc as TokenResolver, si as normalizeBoxStylesBorder, sn as formatEventTimeRange, so as resolveEffectApplications, ss as blockBookingPaymentTermsSchema, t as getBlockDefinition, ta as eventReadinessLoaderKey, tc as formatCurrencyAmount, ti as heroCtaRowFragment, tn as formatEventClockLabel, to as resolveCardRole, tr as teamMemberCardBiography, ts as getWeekCalendarDayTuple, tt as MediaNodeServer, u as resolveLocationMapLocation, un as groupEventsByDate, us as beforeBookingQuestionsPresentationSchema, v as checkoutBlockDefinition, vi as defineFragment, vn as eventVenuePlace, vo as boundaryRuntimeMetricsForDecorativeTransition, vr as defineClientOwnedBlockRuntime, vs as pageTemplateFromEntry, vt as eventRegistrationBlockDefinition, w as buildCheckoutInteractiveIslandProps, wn as cancelledDateCopy, wr as resolvedItemSurfaceProps, ws as orderedLiveRunSessions, wt as resolveEventRegistrationScopedEvents, x as productListBlockDefinition, xa as authoredHeaderLinkForeground, xn as pageNavigationSchema, xr as listLookControl, xt as bookingNowSchema, y as cartBlockDefinition, ya as selectItemSurfacePresentation, yn as formatEventLocation, yr as defineProgressiveBlockRuntime, ys as unavailableReadinessFact, yt as buildEventRegistrationInteractiveIslandProps, za as resolveEffectiveArrangement, zi as FileTextIcon, zn as formatTotalCapacity, zt as ThemedButton } from "./registry-CXRXsFSx.mjs";
|
|
4
4
|
import { B as HOVER_TEXT_THRESHOLD, C as materializeRuntimeButtonAppearance, F as resolveSurfaceForeground, G as resolveConcreteColorHex, H as contrastThresholdByPolicy, K as resolveOpaqueSurfaceHex, L as surfaceInkPublication, N as freezeOwnedThemeValue, O as mapButtonVisualAppearances, P as ownedThemeSnapshot, S as buttonTypographyDeclarations, U as inkReference, V as certifyPaint, b as buttonShadow, f as compositeHex, g as actionVariableFallback, n as parseSurfaceTree, o as resolveSurface, s as serializeSurfaceTree, v as buttonBorder, w as paddingDeclarations, x as buttonStateAppearanceDeclarations, y as buttonRadius } from "./accessibleSurfaces-CM3QANtw.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { b as siteChromeBackgroundOverrideOwner, m as surfaceCardRoleValues, s as boxBackgroundSchema } from "./schema-BpsqaSSU.mjs";
|
|
6
6
|
import { l as renderableMediaAssetSchema, o as runtimeMediaSchema } from "./media-luf7RF22.mjs";
|
|
7
|
+
import { a as normalizeLocationAddressText, d as mapDrawingSchema } from "./mapLocation-BM5WX7FY.mjs";
|
|
7
8
|
import { t as assertNever$1 } from "./assert-never-ku-PUn9U.mjs";
|
|
8
|
-
import { A as MQ_TABLET_ONLY, D as MQ_MD_UP, E as MQ_MD_DOWN, O as MQ_SM_DOWN, T as MQ_LG_UP, c as readSdkPreviewPublishedPlacement, g as validateManifestDraft, k as MQ_SM_UP, m as compileManifestContentContract } from "./pageRuntimeSupport-
|
|
9
|
+
import { A as MQ_TABLET_ONLY, D as MQ_MD_UP, E as MQ_MD_DOWN, O as MQ_SM_DOWN, T as MQ_LG_UP, c as readSdkPreviewPublishedPlacement, g as validateManifestDraft, k as MQ_SM_UP, m as compileManifestContentContract } from "./pageRuntimeSupport-uz4gzBOo.mjs";
|
|
9
10
|
import { n as RichTextDocSchema } from "./richTextSchema-QLaQrbII.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { c as
|
|
13
|
-
import { t as parseThemeForPersistence } from "./parseThemeForPersistence-
|
|
11
|
+
import { M as opaqueSurfaceDeclarations, T as testimonialsCompositionTreatmentValues, j as opaqueSurfaceContextFromTheme, v as featureCardCompositionTreatmentValues, x as offeringsPreviewCompositionTreatmentValues, y as introCompositionTreatmentValues } from "./lookMediaFrame-CaH018pK.mjs";
|
|
12
|
+
import { c as mergeHeaderNavTypographyPreference, l as readHeaderNavFontSizePreference } from "./bindings-VGgS6UvF.mjs";
|
|
13
|
+
import { A as generateShadowCssVars, C as INPUT_ERROR_BORDER_COLOR_VAR, D as RESOLVED_BUTTON_DISABLED_DECLARATIONS, E as generateOpaquePanelCss, M as cardBorderDeclarations, N as cardDecorationPseudoRules, O as resolvedButtonColourDeclarations, S as INPUT_EDGE_COLOR_VAR, T as generateCheckableCss, _ as getResponsiveScopeSpec, a as prefixSelector, b as INPUT_GROUP_SELECTOR, c as parseCustomCssRules, d as THEME_RADIUS_CSS_VARS, f as generateTypographyCss, g as THEME_RESPONSIVE_CONTAINER_NAME, h as DEFAULT_THEME_RESPONSIVE_MODE, i as escapeStyleContent, j as renderCssDeclarations, k as resolvedButtonFocusDeclarations, l as generateAllBlockVarsCss, m as generateStatusCss, n as compileBlockCustomCssRules, o as toKebabCase, p as generateProgressCss, r as compileCustomCssRules, s as parseBlockCustomCssRules, t as ThemeScopeCore, u as generateBlockCustomVarsCss, v as INPUT_GROUP_ERROR_SELECTOR, w as inputEdgeColorValue, x as generateInputGroupCss, y as INPUT_GROUP_FOCUS_SELECTOR } from "./ThemeScopeCore-DFEM1a85.mjs";
|
|
14
|
+
import { t as parseThemeForPersistence } from "./parseThemeForPersistence-DOsfofCy.mjs";
|
|
14
15
|
import { n as mapOutlineBlocks } from "./pageRegions-BaeEF2MU.mjs";
|
|
15
16
|
import { t as getAtPath } from "./src-DHK4JUlp.mjs";
|
|
16
17
|
import * as React$1 from "react";
|
|
@@ -159,225 +160,320 @@ function formatOpeningHoursRows(hours, options = {}) {
|
|
|
159
160
|
}, []);
|
|
160
161
|
}
|
|
161
162
|
//#endregion
|
|
162
|
-
//#region ../
|
|
163
|
-
/**
|
|
164
|
-
* Corner style to border-radius value map for content-bearing card surfaces.
|
|
165
|
-
* Full pill radii are reserved for controls; cards need a capped radius so
|
|
166
|
-
* long titles, media, and expanded content do not clip into capsule shapes.
|
|
167
|
-
*/
|
|
168
|
-
const CORNER_RADIUS_MAP = {
|
|
169
|
-
square: "0px",
|
|
170
|
-
soft: "8px",
|
|
171
|
-
rounded: "16px",
|
|
172
|
-
pill: "24px"
|
|
173
|
-
};
|
|
174
|
-
/**
|
|
175
|
-
* Gradient direction to CSS direction map
|
|
176
|
-
*/
|
|
177
|
-
const GRADIENT_DIRECTION_MAP = {
|
|
178
|
-
"to-r": "to right",
|
|
179
|
-
"to-l": "to left",
|
|
180
|
-
"to-t": "to top",
|
|
181
|
-
"to-b": "to bottom",
|
|
182
|
-
"to-tr": "to top right",
|
|
183
|
-
"to-tl": "to top left",
|
|
184
|
-
"to-br": "to bottom right",
|
|
185
|
-
"to-bl": "to bottom left"
|
|
186
|
-
};
|
|
187
|
-
/**
|
|
188
|
-
* Generate CSS box-shadow value from Shadow object
|
|
189
|
-
*/
|
|
190
|
-
function generateShadowValue(shadow) {
|
|
191
|
-
if (shadow.elevation === "none") return "none";
|
|
192
|
-
const offset = {
|
|
193
|
-
low: 2,
|
|
194
|
-
medium: 4,
|
|
195
|
-
high: 6
|
|
196
|
-
}[shadow.elevation];
|
|
197
|
-
const xOffset = shadow.position === "bottom-right" ? offset : 0;
|
|
198
|
-
if (shadow.softness === "hard") return `${xOffset}px ${offset}px 0 0 rgba(0,0,0,1)`;
|
|
199
|
-
const soft = shadow.softness !== "crisp";
|
|
200
|
-
switch (shadow.elevation) {
|
|
201
|
-
case "low": return soft ? `${xOffset}px 1px 2px rgba(0,0,0,.06)` : `${xOffset}px 1px 1px rgba(0,0,0,.12)`;
|
|
202
|
-
case "medium": return soft ? `${xOffset}px 10px 20px rgba(0,0,0,.08)` : `${xOffset}px 6px 12px rgba(0,0,0,.16)`;
|
|
203
|
-
case "high": return soft ? `${xOffset}px 25px 50px rgba(0,0,0,.18)` : `${xOffset}px 20px 30px rgba(0,0,0,.28)`;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
//#endregion
|
|
207
|
-
//#region ../theme-core/src/cards/generateCardCss.ts
|
|
208
|
-
const PER_CORNER_RADIUS_MAP = {
|
|
209
|
-
square: "0",
|
|
210
|
-
soft: "0.5rem",
|
|
211
|
-
rounded: "1rem",
|
|
212
|
-
pill: "1.5rem",
|
|
213
|
-
expressive: "calc(var(--rb-block-radius) * 3)"
|
|
214
|
-
};
|
|
215
|
-
function resolveCornerRadiiCss(cornerRadii, fallback) {
|
|
216
|
-
const fallbackValue = CORNER_RADIUS_MAP[fallback];
|
|
217
|
-
const at = (value) => value ? PER_CORNER_RADIUS_MAP[value] : fallbackValue;
|
|
218
|
-
return `${at(cornerRadii.topLeft)} ${at(cornerRadii.topRight)} ${at(cornerRadii.bottomRight)} ${at(cornerRadii.bottomLeft)}`;
|
|
219
|
-
}
|
|
220
|
-
function generateCardCss(options) {
|
|
221
|
-
const { themeId, cardSystem: providedCardSystem, solvedInks } = options;
|
|
222
|
-
const theme = {
|
|
223
|
-
...options.theme,
|
|
224
|
-
buttons: ownedThemeSnapshot(options.theme.buttons)
|
|
225
|
-
};
|
|
226
|
-
const tokens = new TokenResolver(theme);
|
|
227
|
-
const palette = freezeOwnedThemeValue(expandPalette(theme.palette));
|
|
228
|
-
const cardSystem = providedCardSystem ?? generateDefaultCardSystem(theme);
|
|
229
|
-
const source = providedCardSystem ? "site-style" : "generated-baseline";
|
|
230
|
-
const aliasGroups = resolveRoleAliasGroups(theme, providedCardSystem ?? null);
|
|
231
|
-
const cssChunks = [];
|
|
232
|
-
const emittedGroupKeys = /* @__PURE__ */ new Set();
|
|
233
|
-
for (const variant of cardSystem.variants) {
|
|
234
|
-
if (!variant.enabled) continue;
|
|
235
|
-
const groupKey = roleAliasGroupKey(source, variant.id);
|
|
236
|
-
emittedGroupKeys.add(groupKey);
|
|
237
|
-
const aliasClasses = aliasGroups.get(groupKey)?.classes ?? [];
|
|
238
|
-
cssChunks.push(generateVariantCSS(variant, themeId, [`card-${variant.id}`, ...aliasClasses], tokens, theme, palette, solvedInks));
|
|
239
|
-
}
|
|
240
|
-
for (const [groupKey, group] of aliasGroups) {
|
|
241
|
-
if (emittedGroupKeys.has(groupKey)) continue;
|
|
242
|
-
cssChunks.push(generateVariantCSS(group.variant, themeId, group.classes, tokens, theme, palette, solvedInks));
|
|
243
|
-
}
|
|
244
|
-
return cssChunks.filter(Boolean).join("\n\n");
|
|
245
|
-
}
|
|
246
|
-
function roleAliasGroupKey(source, variantId) {
|
|
247
|
-
return `${source}:${variantId}`;
|
|
248
|
-
}
|
|
163
|
+
//#region ../calendar/src/lane-packing.ts
|
|
249
164
|
/**
|
|
250
|
-
*
|
|
251
|
-
* through the fallback chain so compiled content can address a role without
|
|
252
|
-
* knowing which variant id a site style used — or whether it defined one.
|
|
165
|
+
* Assign lanes to a list of intervals.
|
|
253
166
|
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
167
|
+
* Returns one result per input in the same order as the input. Internally
|
|
168
|
+
* sorts a copy by `(start, end, orderKey)` to ensure determinism, then
|
|
169
|
+
* permutes results back to input order.
|
|
256
170
|
*/
|
|
257
|
-
function
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
171
|
+
function assignLanes(intervals) {
|
|
172
|
+
if (intervals.length === 0) return [];
|
|
173
|
+
const indexed = intervals.map((interval, index) => ({
|
|
174
|
+
interval,
|
|
175
|
+
index
|
|
176
|
+
}));
|
|
177
|
+
indexed.sort((left, right) => left.interval.start - right.interval.start || left.interval.end - right.interval.end || left.interval.orderKey.localeCompare(right.interval.orderKey));
|
|
178
|
+
const results = new Array(intervals.length);
|
|
179
|
+
let cluster = [];
|
|
180
|
+
let activeLaneEnds = [];
|
|
181
|
+
let clusterMaxEnd = -Infinity;
|
|
182
|
+
const closeCluster = () => {
|
|
183
|
+
if (cluster.length === 0) return;
|
|
184
|
+
const laneCount = Math.max(1, cluster.reduce((max, entry) => Math.max(max, entry.laneIndex + 1), 0));
|
|
185
|
+
for (const entry of cluster) results[entry.index] = {
|
|
186
|
+
laneIndex: entry.laneIndex,
|
|
187
|
+
laneCount
|
|
188
|
+
};
|
|
189
|
+
cluster = [];
|
|
190
|
+
activeLaneEnds = [];
|
|
191
|
+
clusterMaxEnd = -Infinity;
|
|
192
|
+
};
|
|
193
|
+
for (const { interval, index } of indexed) {
|
|
194
|
+
if (interval.start >= clusterMaxEnd) closeCluster();
|
|
195
|
+
const laneIndex = firstAvailableLane(activeLaneEnds, interval.start);
|
|
196
|
+
activeLaneEnds[laneIndex] = interval.end;
|
|
197
|
+
clusterMaxEnd = Math.max(clusterMaxEnd, interval.end);
|
|
198
|
+
cluster.push({
|
|
199
|
+
index,
|
|
200
|
+
laneIndex
|
|
269
201
|
});
|
|
270
202
|
}
|
|
271
|
-
|
|
203
|
+
closeCluster();
|
|
204
|
+
return results;
|
|
272
205
|
}
|
|
206
|
+
function firstAvailableLane(activeLaneEnds, start) {
|
|
207
|
+
const laneIndex = activeLaneEnds.findIndex((end) => end <= start);
|
|
208
|
+
return laneIndex >= 0 ? laneIndex : activeLaneEnds.length;
|
|
209
|
+
}
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region ../calendar/src/timetable.ts
|
|
273
212
|
/**
|
|
274
|
-
*
|
|
275
|
-
*/
|
|
276
|
-
const CONTENT_PADDING_MAP = {
|
|
277
|
-
none: "0",
|
|
278
|
-
compact: "0.75rem",
|
|
279
|
-
cozy: "1rem",
|
|
280
|
-
medium: "1.25rem",
|
|
281
|
-
comfortable: "1.5rem",
|
|
282
|
-
spacious: "2rem"
|
|
283
|
-
};
|
|
284
|
-
/**
|
|
285
|
-
* Corner radius map for card media (top corners only). Match card surface
|
|
286
|
-
* radii rather than button pills so media does not become capsule-clipped.
|
|
287
|
-
*/
|
|
288
|
-
const MEDIA_CORNER_MAP = {
|
|
289
|
-
square: "0",
|
|
290
|
-
soft: "0.5rem",
|
|
291
|
-
rounded: "1rem",
|
|
292
|
-
pill: "1.5rem"
|
|
293
|
-
};
|
|
294
|
-
/**
|
|
295
|
-
* Generate CSS for a single card variant
|
|
213
|
+
* Timetable model — the package's core surface.
|
|
296
214
|
*
|
|
297
|
-
*
|
|
298
|
-
* -
|
|
299
|
-
*
|
|
300
|
-
* - .card-content: padding based on spacing
|
|
215
|
+
* Generic over `T`. Takes a list of timed items + a viewport; returns a
|
|
216
|
+
* day-by-day layout with overlap-packed lanes and percent-based positions
|
|
217
|
+
* plus a diagnostics list for items dropped during processing.
|
|
301
218
|
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
219
|
+
* The function is pure: given identical input (including `now`), it returns
|
|
220
|
+
* the same output. The model has no opinion on what an item is — pass
|
|
221
|
+
* accessors.
|
|
304
222
|
*/
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
const
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
223
|
+
const DEFAULT_BOUNDS = {
|
|
224
|
+
minStartHour: 5,
|
|
225
|
+
maxEndHour: 23,
|
|
226
|
+
defaultStartHour: 6,
|
|
227
|
+
defaultEndHour: 21,
|
|
228
|
+
minHeightPercent: 2.5,
|
|
229
|
+
marginMinutes: 0
|
|
230
|
+
};
|
|
231
|
+
function buildTimetableModel$1(input) {
|
|
232
|
+
const bounds = resolveBounds(input.bounds);
|
|
233
|
+
const viewportDays = getTimetableDays(input.viewDate, input.view ?? "week", input.startOfWeek);
|
|
234
|
+
const viewportKeys = new Set(viewportDays.map(formatDateKey));
|
|
235
|
+
const parsed = parseAllItems(input.items, input);
|
|
236
|
+
const inViewport = deriveVisibleSegments(parsed.drafts, viewportKeys);
|
|
237
|
+
const hourRange = input.hours === void 0 ? resolveHourRange(inViewport, bounds) : fixedHourRange(input.hours);
|
|
238
|
+
const laid = layoutCellsByDate(inViewport, hourRange, bounds);
|
|
239
|
+
return {
|
|
240
|
+
days: assembleDays(viewportDays, laid.cellsByDate, input.today),
|
|
241
|
+
hourTicks: buildHourTicks(hourRange.startHour, hourRange.endHour),
|
|
242
|
+
startHour: hourRange.startHour,
|
|
243
|
+
endHour: hourRange.endHour,
|
|
244
|
+
rangeMinutes: (hourRange.endHour - hourRange.startHour) * 60,
|
|
245
|
+
hasItems: inViewport.length > 0,
|
|
246
|
+
diagnostics: [...parsed.diagnostics, ...laid.diagnostics]
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
function parseAllItems(items, accessors) {
|
|
250
|
+
const drafts = [];
|
|
251
|
+
const diagnostics = [];
|
|
252
|
+
for (const item of items) {
|
|
253
|
+
const result = parseDraft(item, accessors);
|
|
254
|
+
if (result.ok) drafts.push(result.draft);
|
|
255
|
+
else diagnostics.push({
|
|
256
|
+
item,
|
|
257
|
+
reason: result.reason
|
|
258
|
+
});
|
|
323
259
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
return [
|
|
329
|
-
`${structureSelector} {\n display: flex;\n flex-direction: column;\n position: relative;\n overflow: visible;\n}`,
|
|
330
|
-
`${containerSelector} {\n ${renderCssDeclarations(rules)}\n}`,
|
|
331
|
-
...cardDecorationPseudoRules(containerSelectors, variant.decorations, resolveColor),
|
|
332
|
-
`${fallbackBackgroundSelector} {\n background: transparent;\n}`,
|
|
333
|
-
`${mediaSelector} {\n ${mediaRules.join(";\n ")};\n}`,
|
|
334
|
-
`${contentSelector} {\n ${contentRules.join(";\n ")};\n}`
|
|
335
|
-
].join("\n\n");
|
|
260
|
+
return {
|
|
261
|
+
drafts,
|
|
262
|
+
diagnostics
|
|
263
|
+
};
|
|
336
264
|
}
|
|
337
|
-
function
|
|
338
|
-
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
265
|
+
function layoutCellsByDate(segments, hourRange, bounds) {
|
|
266
|
+
const rangeMinutes = (hourRange.endHour - hourRange.startHour) * 60;
|
|
267
|
+
const rangeStartMinutes = hourRange.startHour * 60;
|
|
268
|
+
const rangeEndMinutes = hourRange.endHour * 60;
|
|
269
|
+
const segmentsByDate = groupSegmentsByDate(segments);
|
|
270
|
+
const cellsByDate = /* @__PURE__ */ new Map();
|
|
271
|
+
const diagnostics = [];
|
|
272
|
+
for (const [dateKey, daySegments] of segmentsByDate) {
|
|
273
|
+
const clipped = [];
|
|
274
|
+
for (const segment of daySegments) {
|
|
275
|
+
const result = clipDraft(segment, rangeStartMinutes, rangeEndMinutes);
|
|
276
|
+
if (result.ok) clipped.push(result.clipped);
|
|
277
|
+
else diagnostics.push({
|
|
278
|
+
item: segment.draft.item,
|
|
279
|
+
reason: result.reason
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
const laneResults = assignLanes(clipped.map((entry) => ({
|
|
283
|
+
start: entry.visibleStart,
|
|
284
|
+
end: entry.visibleEnd,
|
|
285
|
+
orderKey: entry.segment.draft.orderKey
|
|
286
|
+
})));
|
|
287
|
+
cellsByDate.set(dateKey, clipped.map((entry, idx) => buildCell(entry, laneResults[idx] ?? {
|
|
288
|
+
laneIndex: 0,
|
|
289
|
+
laneCount: 1
|
|
290
|
+
}, rangeStartMinutes, rangeMinutes, bounds.minHeightPercent)));
|
|
291
|
+
}
|
|
292
|
+
return {
|
|
293
|
+
cellsByDate,
|
|
294
|
+
diagnostics
|
|
295
|
+
};
|
|
349
296
|
}
|
|
350
|
-
function
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
case "gradient": return {
|
|
359
|
-
kind: "gradient",
|
|
360
|
-
foregroundToken: variant.foregroundToken
|
|
297
|
+
function assembleDays(viewportDays, cellsByDate, today) {
|
|
298
|
+
return viewportDays.map((date) => {
|
|
299
|
+
const dateKey = formatDateKey(date);
|
|
300
|
+
return {
|
|
301
|
+
date,
|
|
302
|
+
dateKey,
|
|
303
|
+
isToday: isSameCalendarDay(date, today),
|
|
304
|
+
cells: cellsByDate.get(dateKey) ?? []
|
|
361
305
|
};
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
function parseDraft(item, accessors) {
|
|
309
|
+
const startsAtIso = accessors.getStartsAt(item);
|
|
310
|
+
const endsAtIso = accessors.getEndsAt(item);
|
|
311
|
+
const timeZone = accessors.getTimeZone(item);
|
|
312
|
+
const startsAtMinutes = getLocalMinuteOfDay(startsAtIso, timeZone);
|
|
313
|
+
if (Number.isNaN(startsAtMinutes)) return {
|
|
314
|
+
ok: false,
|
|
315
|
+
reason: "invalid-start"
|
|
316
|
+
};
|
|
317
|
+
const startDateKey = getLocalDateKey(startsAtIso, timeZone);
|
|
318
|
+
if (startDateKey == null) return {
|
|
319
|
+
ok: false,
|
|
320
|
+
reason: "invalid-timezone"
|
|
321
|
+
};
|
|
322
|
+
const endDateKey = getLocalDateKey(endsAtIso, timeZone);
|
|
323
|
+
if (endDateKey == null) return {
|
|
324
|
+
ok: false,
|
|
325
|
+
reason: "invalid-end"
|
|
326
|
+
};
|
|
327
|
+
const endsAtMinutesRaw = getLocalMinuteOfDay(endsAtIso, timeZone);
|
|
328
|
+
if (Number.isNaN(endsAtMinutesRaw)) return {
|
|
329
|
+
ok: false,
|
|
330
|
+
reason: "invalid-end"
|
|
331
|
+
};
|
|
332
|
+
const spansMultipleDays = startDateKey < endDateKey;
|
|
333
|
+
const endsAtMinutes = spansMultipleDays || endsAtMinutesRaw > startsAtMinutes ? endsAtMinutesRaw : Math.min(1440, startsAtMinutes + 60);
|
|
334
|
+
if (!spansMultipleDays && endsAtMinutes <= startsAtMinutes) return {
|
|
335
|
+
ok: false,
|
|
336
|
+
reason: "non-positive-duration"
|
|
337
|
+
};
|
|
338
|
+
return {
|
|
339
|
+
ok: true,
|
|
340
|
+
draft: {
|
|
341
|
+
item,
|
|
342
|
+
startDateKey,
|
|
343
|
+
endDateKey,
|
|
344
|
+
startsAtMinutes,
|
|
345
|
+
endsAtMinutes,
|
|
346
|
+
color: accessors.getColor?.(item) ?? null,
|
|
347
|
+
orderKey: accessors.getOrderKey?.(item) ?? accessors.getId(item)
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
function deriveVisibleSegments(drafts, viewportKeys) {
|
|
352
|
+
const segments = [];
|
|
353
|
+
for (const draft of drafts) for (const dateKey of enumerateDateKeys(draft.startDateKey, draft.endDateKey)) {
|
|
354
|
+
if (!viewportKeys.has(dateKey)) continue;
|
|
355
|
+
const isStartDay = dateKey === draft.startDateKey;
|
|
356
|
+
const isEndDay = dateKey === draft.endDateKey;
|
|
357
|
+
const startsAtMinutes = isStartDay ? draft.startsAtMinutes : 0;
|
|
358
|
+
const endsAtMinutes = isEndDay ? draft.endsAtMinutes : 1440;
|
|
359
|
+
if (endsAtMinutes <= startsAtMinutes) continue;
|
|
360
|
+
segments.push({
|
|
361
|
+
draft,
|
|
362
|
+
dateKey,
|
|
363
|
+
startsAtMinutes,
|
|
364
|
+
endsAtMinutes,
|
|
365
|
+
continuesBefore: !isStartDay,
|
|
366
|
+
continuesAfter: !isEndDay
|
|
367
|
+
});
|
|
362
368
|
}
|
|
369
|
+
return segments;
|
|
363
370
|
}
|
|
364
|
-
function
|
|
365
|
-
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
|
|
371
|
+
function clipDraft(segment, rangeStartMinutes, rangeEndMinutes) {
|
|
372
|
+
const visibleStart = Math.max(rangeStartMinutes, segment.startsAtMinutes);
|
|
373
|
+
const visibleEnd = Math.min(rangeEndMinutes, segment.endsAtMinutes);
|
|
374
|
+
if (visibleEnd <= visibleStart) return {
|
|
375
|
+
ok: false,
|
|
376
|
+
reason: "out-of-visible-hours"
|
|
377
|
+
};
|
|
378
|
+
return {
|
|
379
|
+
ok: true,
|
|
380
|
+
clipped: {
|
|
381
|
+
segment,
|
|
382
|
+
visibleStart,
|
|
383
|
+
visibleEnd
|
|
384
|
+
}
|
|
385
|
+
};
|
|
369
386
|
}
|
|
370
|
-
function
|
|
371
|
-
const
|
|
372
|
-
|
|
387
|
+
function buildCell(entry, lane, rangeStartMinutes, rangeMinutes, minHeightPercent) {
|
|
388
|
+
const heightPercent = Math.max(minHeightPercent, toRangePercent(entry.visibleEnd - entry.visibleStart, rangeMinutes));
|
|
389
|
+
const rawTopPercent = toRangePercent(entry.visibleStart - rangeStartMinutes, rangeMinutes);
|
|
390
|
+
const topPercent = Math.min(rawTopPercent, 100 - heightPercent);
|
|
391
|
+
return {
|
|
392
|
+
item: entry.segment.draft.item,
|
|
393
|
+
dateKey: entry.segment.dateKey,
|
|
394
|
+
startsAtMinutes: entry.segment.startsAtMinutes,
|
|
395
|
+
endsAtMinutes: entry.segment.endsAtMinutes,
|
|
396
|
+
visibleStartsAtMinutes: entry.visibleStart,
|
|
397
|
+
visibleEndsAtMinutes: entry.visibleEnd,
|
|
398
|
+
topPercent,
|
|
399
|
+
heightPercent,
|
|
400
|
+
isClippedStart: entry.segment.continuesBefore || entry.segment.startsAtMinutes < entry.visibleStart,
|
|
401
|
+
isClippedEnd: entry.segment.continuesAfter || entry.segment.endsAtMinutes > entry.visibleEnd,
|
|
402
|
+
laneIndex: lane.laneIndex,
|
|
403
|
+
laneCount: lane.laneCount,
|
|
404
|
+
color: entry.segment.draft.color
|
|
405
|
+
};
|
|
373
406
|
}
|
|
374
|
-
function
|
|
375
|
-
return
|
|
407
|
+
function resolveBounds(bounds) {
|
|
408
|
+
return {
|
|
409
|
+
...DEFAULT_BOUNDS,
|
|
410
|
+
...bounds
|
|
411
|
+
};
|
|
376
412
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
413
|
+
function resolveHourRange(segments, bounds) {
|
|
414
|
+
if (segments.length === 0) return {
|
|
415
|
+
startHour: bounds.defaultStartHour,
|
|
416
|
+
endHour: bounds.defaultEndHour
|
|
417
|
+
};
|
|
418
|
+
const earliestStart = Math.min(...segments.map((segment) => segment.startsAtMinutes));
|
|
419
|
+
const latestEnd = Math.max(...segments.map((segment) => segment.endsAtMinutes));
|
|
420
|
+
const startHour = Math.max(bounds.minStartHour, Math.floor((earliestStart - bounds.marginMinutes) / 60));
|
|
421
|
+
const endHour = Math.min(bounds.maxEndHour, Math.ceil((latestEnd + bounds.marginMinutes) / 60));
|
|
422
|
+
return {
|
|
423
|
+
startHour,
|
|
424
|
+
endHour: Math.max(startHour + 1, endHour)
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
function fixedHourRange(hours) {
|
|
428
|
+
const startHour = Math.min(23, Math.max(0, Math.floor(hours.startHour)));
|
|
429
|
+
return {
|
|
430
|
+
startHour,
|
|
431
|
+
endHour: Math.min(24, Math.max(startHour + 1, Math.ceil(hours.endHour)))
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
function buildHourTicks(startHour, endHour) {
|
|
435
|
+
const ticks = [];
|
|
436
|
+
for (let hour = startHour; hour <= endHour; hour += 1) ticks.push(hour);
|
|
437
|
+
return ticks;
|
|
438
|
+
}
|
|
439
|
+
function groupSegmentsByDate(segments) {
|
|
440
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
441
|
+
for (const segment of segments) {
|
|
442
|
+
const existing = grouped.get(segment.dateKey) ?? [];
|
|
443
|
+
existing.push(segment);
|
|
444
|
+
grouped.set(segment.dateKey, existing);
|
|
445
|
+
}
|
|
446
|
+
return grouped;
|
|
447
|
+
}
|
|
448
|
+
function toRangePercent(minutes, rangeMinutes) {
|
|
449
|
+
if (rangeMinutes <= 0) return 0;
|
|
450
|
+
return minutes / rangeMinutes * 100;
|
|
451
|
+
}
|
|
452
|
+
function getTimetableDays(viewDate, view, startOfWeek) {
|
|
453
|
+
if (view === "day") return [viewDate];
|
|
454
|
+
return getWeekCalendarDays(viewDate, startOfWeek);
|
|
455
|
+
}
|
|
456
|
+
function enumerateDateKeys(startDateKey, endDateKey) {
|
|
457
|
+
if (startDateKey > endDateKey) throw new Error(`Invalid timetable date range: ${startDateKey} is after ${endDateKey}`);
|
|
458
|
+
const start = parseDateKey(startDateKey);
|
|
459
|
+
parseDateKey(endDateKey);
|
|
460
|
+
const keys = [];
|
|
461
|
+
let cursor = start;
|
|
462
|
+
while (formatDateKey(cursor) <= endDateKey) {
|
|
463
|
+
keys.push(formatDateKey(cursor));
|
|
464
|
+
cursor = addDays(cursor, 1);
|
|
465
|
+
}
|
|
466
|
+
return keys;
|
|
467
|
+
}
|
|
468
|
+
function parseDateKey(dateKey) {
|
|
469
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(dateKey);
|
|
470
|
+
if (match === null) throw new Error(`Invalid timetable date key: ${dateKey}`);
|
|
471
|
+
const [, year, month, day] = match;
|
|
472
|
+
return {
|
|
473
|
+
year: Number(year),
|
|
474
|
+
month: Number(month),
|
|
475
|
+
day: Number(day)
|
|
476
|
+
};
|
|
381
477
|
}
|
|
382
478
|
//#endregion
|
|
383
479
|
//#region ../theme-core/src/styles/skinTokens.ts
|
|
@@ -385,21 +481,242 @@ function skinTokenCssVars(tokens) {
|
|
|
385
481
|
return Object.fromEntries(Object.entries(tokens ?? {}).map(([name, value]) => [`--rb-skin-${name}`, value]));
|
|
386
482
|
}
|
|
387
483
|
//#endregion
|
|
388
|
-
//#region ../theme-core/src/
|
|
484
|
+
//#region ../theme-core/src/cards/constants.ts
|
|
389
485
|
/**
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
* visual language (spacing, borders, shadows, colors).
|
|
486
|
+
* Corner style to border-radius value map for content-bearing card surfaces.
|
|
487
|
+
* Full pill radii are reserved for controls; cards need a capped radius so
|
|
488
|
+
* long titles, media, and expanded content do not clip into capsule shapes.
|
|
394
489
|
*/
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
490
|
+
const CORNER_RADIUS_MAP = {
|
|
491
|
+
square: "0px",
|
|
492
|
+
soft: "8px",
|
|
493
|
+
rounded: "16px",
|
|
494
|
+
pill: "24px"
|
|
495
|
+
};
|
|
496
|
+
/**
|
|
497
|
+
* Gradient direction to CSS direction map
|
|
498
|
+
*/
|
|
499
|
+
const GRADIENT_DIRECTION_MAP = {
|
|
500
|
+
"to-r": "to right",
|
|
501
|
+
"to-l": "to left",
|
|
502
|
+
"to-t": "to top",
|
|
503
|
+
"to-b": "to bottom",
|
|
504
|
+
"to-tr": "to top right",
|
|
505
|
+
"to-tl": "to top left",
|
|
506
|
+
"to-br": "to bottom right",
|
|
507
|
+
"to-bl": "to bottom left"
|
|
508
|
+
};
|
|
509
|
+
/**
|
|
510
|
+
* Generate CSS box-shadow value from Shadow object
|
|
511
|
+
*/
|
|
512
|
+
function generateShadowValue(shadow) {
|
|
513
|
+
if (shadow.elevation === "none") return "none";
|
|
514
|
+
const offset = {
|
|
515
|
+
low: 2,
|
|
516
|
+
medium: 4,
|
|
517
|
+
high: 6
|
|
518
|
+
}[shadow.elevation];
|
|
519
|
+
const xOffset = shadow.position === "bottom-right" ? offset : 0;
|
|
520
|
+
if (shadow.softness === "hard") return `${xOffset}px ${offset}px 0 0 rgba(0,0,0,1)`;
|
|
521
|
+
const soft = shadow.softness !== "crisp";
|
|
522
|
+
switch (shadow.elevation) {
|
|
523
|
+
case "low": return soft ? `${xOffset}px 1px 2px rgba(0,0,0,.06)` : `${xOffset}px 1px 1px rgba(0,0,0,.12)`;
|
|
524
|
+
case "medium": return soft ? `${xOffset}px 10px 20px rgba(0,0,0,.08)` : `${xOffset}px 6px 12px rgba(0,0,0,.16)`;
|
|
525
|
+
case "high": return soft ? `${xOffset}px 25px 50px rgba(0,0,0,.18)` : `${xOffset}px 20px 30px rgba(0,0,0,.28)`;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
//#endregion
|
|
529
|
+
//#region ../theme-core/src/cards/generateCardCss.ts
|
|
530
|
+
const PER_CORNER_RADIUS_MAP = {
|
|
531
|
+
square: "0",
|
|
532
|
+
soft: "0.5rem",
|
|
533
|
+
rounded: "1rem",
|
|
534
|
+
pill: "1.5rem",
|
|
535
|
+
expressive: "calc(var(--rb-block-radius) * 3)"
|
|
536
|
+
};
|
|
537
|
+
function resolveCornerRadiiCss(cornerRadii, fallback) {
|
|
538
|
+
const fallbackValue = CORNER_RADIUS_MAP[fallback];
|
|
539
|
+
const at = (value) => value ? PER_CORNER_RADIUS_MAP[value] : fallbackValue;
|
|
540
|
+
return `${at(cornerRadii.topLeft)} ${at(cornerRadii.topRight)} ${at(cornerRadii.bottomRight)} ${at(cornerRadii.bottomLeft)}`;
|
|
541
|
+
}
|
|
542
|
+
function generateCardCss(options) {
|
|
543
|
+
const { themeId, cardSystem: providedCardSystem, solvedInks } = options;
|
|
544
|
+
const theme = {
|
|
545
|
+
...options.theme,
|
|
546
|
+
buttons: ownedThemeSnapshot(options.theme.buttons)
|
|
547
|
+
};
|
|
548
|
+
const tokens = new TokenResolver(theme);
|
|
549
|
+
const palette = freezeOwnedThemeValue(expandPalette(theme.palette));
|
|
550
|
+
const cardSystem = providedCardSystem ?? generateDefaultCardSystem(theme);
|
|
551
|
+
const source = providedCardSystem ? "site-style" : "generated-baseline";
|
|
552
|
+
const aliasGroups = resolveRoleAliasGroups(theme, providedCardSystem ?? null);
|
|
553
|
+
const cssChunks = [];
|
|
554
|
+
const emittedGroupKeys = /* @__PURE__ */ new Set();
|
|
555
|
+
for (const variant of cardSystem.variants) {
|
|
556
|
+
if (!variant.enabled) continue;
|
|
557
|
+
const groupKey = roleAliasGroupKey(source, variant.id);
|
|
558
|
+
emittedGroupKeys.add(groupKey);
|
|
559
|
+
const aliasClasses = aliasGroups.get(groupKey)?.classes ?? [];
|
|
560
|
+
cssChunks.push(generateVariantCSS(variant, themeId, [`card-${variant.id}`, ...aliasClasses], tokens, theme, palette, solvedInks));
|
|
561
|
+
}
|
|
562
|
+
for (const [groupKey, group] of aliasGroups) {
|
|
563
|
+
if (emittedGroupKeys.has(groupKey)) continue;
|
|
564
|
+
cssChunks.push(generateVariantCSS(group.variant, themeId, group.classes, tokens, theme, palette, solvedInks));
|
|
565
|
+
}
|
|
566
|
+
return cssChunks.filter(Boolean).join("\n\n");
|
|
567
|
+
}
|
|
568
|
+
function roleAliasGroupKey(source, variantId) {
|
|
569
|
+
return `${source}:${variantId}`;
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Stable per-theme role aliases (`.card-role-default` and friends), resolved
|
|
573
|
+
* through the fallback chain so compiled content can address a role without
|
|
574
|
+
* knowing which variant id a site style used — or whether it defined one.
|
|
575
|
+
*
|
|
576
|
+
* Aliases are grouped by the variant they resolve to, so an alias shares one
|
|
577
|
+
* rule with that variant rather than duplicating its declarations.
|
|
578
|
+
*/
|
|
579
|
+
function resolveRoleAliasGroups(theme, cardSystem) {
|
|
580
|
+
const groups = /* @__PURE__ */ new Map();
|
|
581
|
+
for (const role of surfaceCardRoleValues) {
|
|
582
|
+
const resolved = resolveCardRole(theme, cardSystem, role);
|
|
583
|
+
if (resolved.kind === "none") continue;
|
|
584
|
+
const groupKey = roleAliasGroupKey(resolved.source, resolved.variant.id);
|
|
585
|
+
const aliasClass = `card-role-${role}`;
|
|
586
|
+
const group = groups.get(groupKey);
|
|
587
|
+
if (group) group.classes.push(aliasClass);
|
|
588
|
+
else groups.set(groupKey, {
|
|
589
|
+
variant: resolved.variant,
|
|
590
|
+
classes: [aliasClass]
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
return groups;
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Padding map for card content based on spacing semantic values
|
|
597
|
+
*/
|
|
598
|
+
const CONTENT_PADDING_MAP = {
|
|
599
|
+
none: "0",
|
|
600
|
+
compact: "0.75rem",
|
|
601
|
+
cozy: "1rem",
|
|
602
|
+
medium: "1.25rem",
|
|
603
|
+
comfortable: "1.5rem",
|
|
604
|
+
spacious: "2rem"
|
|
605
|
+
};
|
|
606
|
+
/**
|
|
607
|
+
* Corner radius map for card media (top corners only). Match card surface
|
|
608
|
+
* radii rather than button pills so media does not become capsule-clipped.
|
|
609
|
+
*/
|
|
610
|
+
const MEDIA_CORNER_MAP = {
|
|
611
|
+
square: "0",
|
|
612
|
+
soft: "0.5rem",
|
|
613
|
+
rounded: "1rem",
|
|
614
|
+
pill: "1.5rem"
|
|
615
|
+
};
|
|
616
|
+
/**
|
|
617
|
+
* Generate CSS for a single card variant
|
|
618
|
+
*
|
|
619
|
+
* Generates complete CSS for card containers and their children:
|
|
620
|
+
* - Container: background, shadow, corners, border
|
|
621
|
+
* - .card-media: top corners matching container
|
|
622
|
+
* - .card-content: padding based on spacing
|
|
623
|
+
*
|
|
624
|
+
* This CSS-first approach eliminates runtime transforms for styling,
|
|
625
|
+
* keeping transforms only for data normalization and dynamic layout.
|
|
626
|
+
*/
|
|
627
|
+
function generateVariantCSS(variant, themeId, cardClasses, tokens, theme, palette, solvedInks) {
|
|
628
|
+
const selectorsFor = (suffix) => cardClasses.map((cardClass) => `:where([data-theme-scope="${themeId}"]) .${cardClass}.${cardClass}${suffix}`).join(",\n");
|
|
629
|
+
const containerSelectors = cardClasses.map((cardClass) => `:where([data-theme-scope="${themeId}"]) .${cardClass}.${cardClass}`);
|
|
630
|
+
const containerSelector = containerSelectors.join(",\n");
|
|
631
|
+
const mediaSelector = selectorsFor(" .card-media");
|
|
632
|
+
const contentSelector = selectorsFor(" .card-content");
|
|
633
|
+
const fallbackBackgroundSelector = selectorsFor(" > .rb-bg-surface");
|
|
634
|
+
const rules = [];
|
|
635
|
+
rules.push(...cardSurfaceRules(variant, tokens, theme, palette, solvedInks));
|
|
636
|
+
const resolveColor = (token) => tokens.getColor(token);
|
|
637
|
+
rules.push(...cardBorderDeclarations(variant.border ? borderDeclaration(variant.border, tokens) : null, variant.decorations, resolveColor));
|
|
638
|
+
const corners = variant.corners ?? theme.corners;
|
|
639
|
+
const radius = variant.cornerRadii ? resolveCornerRadiiCss(variant.cornerRadii, corners) : CORNER_RADIUS_MAP[corners];
|
|
640
|
+
rules.push(`border-radius: ${radius}`);
|
|
641
|
+
const shadow = variant.shadow ?? theme.shadow;
|
|
642
|
+
if (shadow.elevation !== "none") {
|
|
643
|
+
const shadowValue = generateShadowValue(shadow);
|
|
644
|
+
rules.push(`box-shadow: ${shadowValue}`);
|
|
645
|
+
}
|
|
646
|
+
const structureSelector = cardClasses.map((cardClass) => `:where([data-theme-scope="${themeId}"]) :where(.${cardClass})`).join(",\n");
|
|
647
|
+
const mediaRadius = MEDIA_CORNER_MAP[corners];
|
|
648
|
+
const mediaRules = [`border-top-left-radius: ${mediaRadius}`, `border-top-right-radius: ${mediaRadius}`];
|
|
649
|
+
const contentRules = [`padding: ${resolveContentPadding(variant)}`];
|
|
650
|
+
return [
|
|
651
|
+
`${structureSelector} {\n display: flex;\n flex-direction: column;\n position: relative;\n overflow: visible;\n}`,
|
|
652
|
+
`${containerSelector} {\n ${renderCssDeclarations(rules)}\n}`,
|
|
653
|
+
...cardDecorationPseudoRules(containerSelectors, variant.decorations, resolveColor),
|
|
654
|
+
`${fallbackBackgroundSelector} {\n background: transparent;\n}`,
|
|
655
|
+
`${mediaSelector} {\n ${mediaRules.join(";\n ")};\n}`,
|
|
656
|
+
`${contentSelector} {\n ${contentRules.join(";\n ")};\n}`
|
|
657
|
+
].join("\n\n");
|
|
658
|
+
}
|
|
659
|
+
function cardSurfaceRules(variant, tokens, theme, palette, solvedInks) {
|
|
660
|
+
if (variant.background.type === "transparent") return ["background: transparent"];
|
|
661
|
+
const surface = resolveSurface({
|
|
662
|
+
kind: "paint",
|
|
663
|
+
paint: cardSurfacePaint(variant)
|
|
664
|
+
}, {
|
|
665
|
+
palette,
|
|
666
|
+
buttonSystem: theme.buttons,
|
|
667
|
+
linkHoverToken: theme.typography.proseLinkStyle?.hoverColorToken,
|
|
668
|
+
solvedInks
|
|
669
|
+
});
|
|
670
|
+
return [cardBackgroundRule(variant.background, tokens), ...opaqueSurfaceDeclarations(surface)];
|
|
671
|
+
}
|
|
672
|
+
function cardSurfacePaint(variant) {
|
|
673
|
+
switch (variant.background.type) {
|
|
674
|
+
case "transparent": return { kind: "transparent" };
|
|
675
|
+
case "solid": return {
|
|
676
|
+
kind: "solid",
|
|
677
|
+
token: variant.background.colorToken,
|
|
678
|
+
foregroundToken: variant.foregroundToken
|
|
679
|
+
};
|
|
680
|
+
case "gradient": return {
|
|
681
|
+
kind: "gradient",
|
|
682
|
+
foregroundToken: variant.foregroundToken
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
function cardBackgroundRule(background, tokens) {
|
|
687
|
+
if (background.type === "solid") return `background: ${tokens.getColor(background.colorToken)}`;
|
|
688
|
+
const from = tokens.getColor(background.fromToken);
|
|
689
|
+
const to = tokens.getColor(background.toToken);
|
|
690
|
+
return `background: linear-gradient(${GRADIENT_DIRECTION_MAP[background.direction] || "to right"}, ${from}, ${to})`;
|
|
691
|
+
}
|
|
692
|
+
function borderDeclaration(border, tokens) {
|
|
693
|
+
const borderColor = tokens.getColor(border.colorToken);
|
|
694
|
+
return `border: ${border.widthClass === "border-4" ? "4px" : border.widthClass === "border-2" ? "2px" : border.widthClass === "border" ? "1px" : "1px"} solid ${borderColor}`;
|
|
695
|
+
}
|
|
696
|
+
function paddingFor(spacing) {
|
|
697
|
+
return CONTENT_PADDING_MAP[spacing] || CONTENT_PADDING_MAP.comfortable;
|
|
698
|
+
}
|
|
699
|
+
/** A card's padding: one value for both axes, or one per axis. */
|
|
700
|
+
function resolveContentPadding(variant) {
|
|
701
|
+
const spacing = variant.spacing;
|
|
702
|
+
return typeof spacing === "string" ? paddingFor(spacing) : `${paddingFor(spacing.block)} ${paddingFor(spacing.inline)}`;
|
|
703
|
+
}
|
|
704
|
+
//#endregion
|
|
705
|
+
//#region ../theme-core/src/accordions/defaults.ts
|
|
706
|
+
/**
|
|
707
|
+
* Generate default accordion system based on theme configuration
|
|
708
|
+
*
|
|
709
|
+
* Creates a single accordion style that harmonizes with the theme's
|
|
710
|
+
* visual language (spacing, borders, shadows, colors).
|
|
711
|
+
*/
|
|
712
|
+
function generateDefaultAccordionSystem(theme) {
|
|
713
|
+
const overrides = theme.siteStyleId ? requireCuratedSiteStyle(theme.siteStyleId).themeOverrides?.accordions : void 0;
|
|
714
|
+
if (overrides) return overrides;
|
|
715
|
+
const { axes, space } = theme;
|
|
716
|
+
return {
|
|
717
|
+
background: {
|
|
718
|
+
type: "solid",
|
|
719
|
+
colorToken: "surface"
|
|
403
720
|
},
|
|
404
721
|
spacing: space === "comfortable" ? "comfortable" : space === "dense" ? "compact" : "medium",
|
|
405
722
|
corners: null,
|
|
@@ -2194,77 +2511,26 @@ const NAV_RENDERED_STATES = [
|
|
|
2194
2511
|
function isNavHover(state) {
|
|
2195
2512
|
return state === "hover" || state === "current-hover";
|
|
2196
2513
|
}
|
|
2197
|
-
|
|
2198
|
-
return state === "current" || state === "current-hover";
|
|
2199
|
-
}
|
|
2200
|
-
/** Mirrors the historical emitters: every group writes a base gradient and hover opacity;
|
|
2201
|
-
* active groups additionally write the more specific current-page selector. */
|
|
2514
|
+
/** Project the emitted declarations into the four disjoint nav states. */
|
|
2202
2515
|
function resolveRenderedNavEffects(effects, state) {
|
|
2203
|
-
const
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
"
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
})));
|
|
2212
|
-
const opacity = winner(
|
|
2516
|
+
const current = state === "current" || state === "current-hover";
|
|
2517
|
+
const declarations = resolveEffectApplications(effects).flatMap((application) => {
|
|
2518
|
+
if (application.currentPage && !current) return [];
|
|
2519
|
+
return resolveEffectPaint(application.effect, { background: { type: "transparent" } }).filter((paint) => paint.when === "always" || isNavHover(state)).map((paint) => ({
|
|
2520
|
+
paint,
|
|
2521
|
+
specificity: 1 + Number(application.currentPage) + Number(paint.when === "hover")
|
|
2522
|
+
}));
|
|
2523
|
+
});
|
|
2524
|
+
const text = winner(declarations.filter(({ paint }) => paint.property === "text"));
|
|
2525
|
+
const opacity = winner(declarations.filter(({ paint }) => paint.property === "opacity"));
|
|
2213
2526
|
return {
|
|
2214
|
-
text:
|
|
2215
|
-
opacity: opacity
|
|
2216
|
-
};
|
|
2217
|
-
}
|
|
2218
|
-
function authoredOpacity(effect) {
|
|
2219
|
-
const options = effect.options ?? {};
|
|
2220
|
-
const opacity = effect.effectId === "fade-background" ? Number(options.opacity || 80) / 100 : 1 - Number(options.reduction || 15) / 100;
|
|
2221
|
-
return Number.isFinite(opacity) && opacity >= 0 && opacity <= 1 ? opacity : null;
|
|
2222
|
-
}
|
|
2223
|
-
function textCandidates(app, state) {
|
|
2224
|
-
const gradient = {
|
|
2225
|
-
effect: app.effect,
|
|
2226
|
-
fill: "gradient"
|
|
2527
|
+
text: text?.property === "text" ? text : null,
|
|
2528
|
+
opacity: opacity?.property === "opacity" && Number.isFinite(opacity.opacity) && opacity.opacity >= 0 && opacity.opacity <= 1 ? opacity.opacity : null
|
|
2227
2529
|
};
|
|
2228
|
-
const solid = {
|
|
2229
|
-
effect: app.effect,
|
|
2230
|
-
fill: "solid"
|
|
2231
|
-
};
|
|
2232
|
-
const solidOnHover = app.effect.options?.solidOnHover === true || app.effect.options?.solidOnHover === "true";
|
|
2233
|
-
const hover = isNavHover(state) && solidOnHover ? [{
|
|
2234
|
-
value: solid,
|
|
2235
|
-
specificity: 2
|
|
2236
|
-
}] : [];
|
|
2237
|
-
const currentHover = isNavHover(state) && solidOnHover ? [{
|
|
2238
|
-
value: solid,
|
|
2239
|
-
specificity: 3
|
|
2240
|
-
}] : [];
|
|
2241
|
-
const current = isCurrent(state) && app.group === "active" ? [{
|
|
2242
|
-
value: gradient,
|
|
2243
|
-
specificity: 2
|
|
2244
|
-
}, ...currentHover] : [];
|
|
2245
|
-
return [
|
|
2246
|
-
{
|
|
2247
|
-
value: gradient,
|
|
2248
|
-
specificity: 1
|
|
2249
|
-
},
|
|
2250
|
-
...hover,
|
|
2251
|
-
...current
|
|
2252
|
-
];
|
|
2253
|
-
}
|
|
2254
|
-
function opacityCandidates(app, state) {
|
|
2255
|
-
if (!isNavHover(state)) return [];
|
|
2256
|
-
const current = isCurrent(state) && app.group === "active" ? [{
|
|
2257
|
-
value: app.effect,
|
|
2258
|
-
specificity: 3
|
|
2259
|
-
}] : [];
|
|
2260
|
-
return [{
|
|
2261
|
-
value: app.effect,
|
|
2262
|
-
specificity: 2
|
|
2263
|
-
}, ...current];
|
|
2264
2530
|
}
|
|
2265
2531
|
/** Later declarations win equal specificity, just as they do in the emitted CSS. */
|
|
2266
2532
|
function winner(candidates) {
|
|
2267
|
-
return candidates.reduce((chosen, candidate) => chosen === null || candidate.specificity >= chosen.specificity ? candidate : chosen, null)?.
|
|
2533
|
+
return candidates.reduce((chosen, candidate) => chosen === null || candidate.specificity >= chosen.specificity ? candidate : chosen, null)?.paint ?? null;
|
|
2268
2534
|
}
|
|
2269
2535
|
//#endregion
|
|
2270
2536
|
//#region ../theme-core/src/header/navEffectPaint.ts
|
|
@@ -2328,7 +2594,7 @@ function planText(text, plainInk, state, context) {
|
|
|
2328
2594
|
rules: [],
|
|
2329
2595
|
inks: [plainInk]
|
|
2330
2596
|
};
|
|
2331
|
-
const stops =
|
|
2597
|
+
const stops = text.tokens.map((token) => resolveConcreteColorHex(token, context.palette));
|
|
2332
2598
|
if (decideNavEffectContrast(context.paint, plainInk, {
|
|
2333
2599
|
effect: "gradient-text",
|
|
2334
2600
|
option: stops,
|
|
@@ -2350,15 +2616,6 @@ function planText(text, plainInk, state, context) {
|
|
|
2350
2616
|
} : null)
|
|
2351
2617
|
};
|
|
2352
2618
|
}
|
|
2353
|
-
function renderedTextStops(text, palette) {
|
|
2354
|
-
if (text.fill === "solid") return [resolveConcreteColorHex("neutral-50", palette)];
|
|
2355
|
-
const colors = text.effect.options?.gradientColors;
|
|
2356
|
-
return (typeof colors === "string" && colors ? colors.split(",").map((token) => token.trim()) : [
|
|
2357
|
-
"primary-400",
|
|
2358
|
-
"secondary-400",
|
|
2359
|
-
"accent-400"
|
|
2360
|
-
]).map((token) => resolveConcreteColorHex(token, palette));
|
|
2361
|
-
}
|
|
2362
2619
|
function opacityRules(authored, inks, paint) {
|
|
2363
2620
|
if (authored === null || inks.length === 0 || inks.some((ink) => ink === null)) return [];
|
|
2364
2621
|
const decisions = inks.map((ink) => decideNavEffectContrast(paint, ink, {
|
|
@@ -2389,30 +2646,35 @@ function resolveInk(reference, palette) {
|
|
|
2389
2646
|
//#endregion
|
|
2390
2647
|
//#region ../theme-core/src/header/generateHeaderNavLinkStyles.ts
|
|
2391
2648
|
function generateHeaderNavLinkStyles(header, themeId, tokens, theme, contrastTreatment, navTextSize) {
|
|
2392
|
-
const style =
|
|
2649
|
+
const style = resolvedHeaderNavLinkStyle(header, contrastTreatment, navTextSize);
|
|
2393
2650
|
if (!style) {
|
|
2394
2651
|
console.warn(`[generateHeaderCss] Nav link preset not found: ${header.navStyle}`);
|
|
2395
2652
|
return "";
|
|
2396
2653
|
}
|
|
2397
|
-
const renderedStyle = mergeHeaderNavTypographyPreference(style, {
|
|
2398
|
-
typography: header.navFontRole ?? "inherit",
|
|
2399
|
-
fontSize: readHeaderNavFontSizePreference(header.navTextSize),
|
|
2400
|
-
interactionPalette: header.interactionPalette ?? "recommended"
|
|
2401
|
-
});
|
|
2402
2654
|
return generateNavLinkCSS({
|
|
2403
2655
|
themeId,
|
|
2404
2656
|
tokens,
|
|
2405
2657
|
theme,
|
|
2406
|
-
style
|
|
2658
|
+
style,
|
|
2407
2659
|
className: "header-nav-link",
|
|
2408
2660
|
surfaceDependent: true,
|
|
2409
2661
|
surfaceRestingColor: header.background?.contentOwner === siteChromeBackgroundOverrideOwner
|
|
2410
|
-
}) + generateHeaderNavEffectContrastCss(header,
|
|
2662
|
+
}) + generateHeaderNavEffectContrastCss(header, style, theme, themeId);
|
|
2411
2663
|
}
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2664
|
+
/** The top-level nav link style as it renders, with the owner's font role and size preferences applied. */
|
|
2665
|
+
function resolvedHeaderNavLinkStyle(header, contrastTreatment, navTextSize) {
|
|
2666
|
+
const style = effectiveHeaderNavLinkStyle(header, contrastTreatment, navTextSize);
|
|
2667
|
+
if (!style) return null;
|
|
2668
|
+
return mergeHeaderNavTypographyPreference(style, {
|
|
2669
|
+
typography: header.navFontRole ?? "inherit",
|
|
2670
|
+
fontSize: readHeaderNavFontSizePreference(header.navTextSize),
|
|
2671
|
+
interactionPalette: header.interactionPalette ?? "recommended"
|
|
2672
|
+
});
|
|
2673
|
+
}
|
|
2674
|
+
//#endregion
|
|
2675
|
+
//#region ../theme-core/src/header/generateHeaderLogoStyles.ts
|
|
2676
|
+
function generateHeaderLogoStyles(input) {
|
|
2677
|
+
const { logo, themeId } = input;
|
|
2416
2678
|
return `\n${`:where([data-theme-scope="${themeId}"]) .header-logo-text`} {\n ${[
|
|
2417
2679
|
...logoTextColorRules(input),
|
|
2418
2680
|
logo?.fontFamily === "body" ? "font-family: var(--font-body);" : "font-family: var(--font-heading);",
|
|
@@ -2479,7 +2741,8 @@ function generateHeaderCss(options) {
|
|
|
2479
2741
|
cssChunks.push(generateHeaderNavLinkStyles(header, themeId, tokens, theme, headerContrastTreatment, headerNavTextSize));
|
|
2480
2742
|
const dropdown = resolveDropdownSurface(header, theme, tokens, solvedInks);
|
|
2481
2743
|
cssChunks.push(generateDropdownContainerStyles(themeId, tokens, dropdown));
|
|
2482
|
-
|
|
2744
|
+
const navLinkStyle = resolvedHeaderNavLinkStyle(header, headerContrastTreatment, headerNavTextSize);
|
|
2745
|
+
cssChunks.push(generateDropdownLinkStyles(header, themeId, tokens, theme, dropdown, navLinkStyle));
|
|
2483
2746
|
cssChunks.push(generateDropdownCaretStyles(themeId));
|
|
2484
2747
|
cssChunks.push(generateDropdownTriggerOverrides(header, themeId));
|
|
2485
2748
|
cssChunks.push(generateMobilePanelStyles(themeId, dropdown));
|
|
@@ -2608,16 +2871,37 @@ function dropdownLinkEffects({ linkFill, linkText }, state) {
|
|
|
2608
2871
|
options: { hoverColorToken: text }
|
|
2609
2872
|
}] : []];
|
|
2610
2873
|
}
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2874
|
+
/**
|
|
2875
|
+
* The type the menu takes from the nav links above it: font, case and letter spacing follow the nav,
|
|
2876
|
+
* unless the header Look gives the menu its own case or spacing.
|
|
2877
|
+
*/
|
|
2878
|
+
function dropdownTypeFromNav(style, navLinkStyle) {
|
|
2879
|
+
const nav = navLinkStyle ?? {
|
|
2880
|
+
typography: "body",
|
|
2881
|
+
textTransform: "none",
|
|
2882
|
+
letterSpacing: void 0
|
|
2883
|
+
};
|
|
2884
|
+
const ownCase = dropdownOwnCase(style);
|
|
2885
|
+
const followsNavSpacing = (style?.letterSpacing ?? "normal") === "normal";
|
|
2886
|
+
return {
|
|
2887
|
+
typography: nav.typography,
|
|
2888
|
+
textTransform: ownCase ?? nav.textTransform ?? "none",
|
|
2889
|
+
...followsNavSpacing && nav.letterSpacing ? { letterSpacing: nav.letterSpacing } : {}
|
|
2890
|
+
};
|
|
2891
|
+
}
|
|
2892
|
+
/** The case a header Look gives the menu itself, or null when the menu follows the nav. */
|
|
2893
|
+
function dropdownOwnCase(style) {
|
|
2894
|
+
const textTransform = style?.textTransform ?? "none";
|
|
2895
|
+
return textTransform === "none" ? null : textTransform;
|
|
2896
|
+
}
|
|
2897
|
+
/** The menu's links set in the nav links' type; size and weight stay the menu's. */
|
|
2898
|
+
function dropdownNavLinkStyle(header, surface, navLinkStyle) {
|
|
2614
2899
|
return {
|
|
2615
2900
|
name: "Dropdown",
|
|
2616
|
-
|
|
2617
|
-
fontWeight: style?.fontWeight ?? header.navWeight ?? "medium",
|
|
2618
|
-
textTransform: style?.textTransform ?? "none",
|
|
2901
|
+
...dropdownTypeFromNav(surface.style, navLinkStyle),
|
|
2902
|
+
fontWeight: surface.style?.fontWeight ?? header.navWeight ?? "medium",
|
|
2619
2903
|
italic: false,
|
|
2620
|
-
colorToken: textToken,
|
|
2904
|
+
colorToken: surface.textToken,
|
|
2621
2905
|
padding: "compact",
|
|
2622
2906
|
borderRadius: "sm",
|
|
2623
2907
|
effects: {
|
|
@@ -2641,12 +2925,12 @@ function dropdownTypographyRules(style) {
|
|
|
2641
2925
|
};
|
|
2642
2926
|
return [...letterSpacing === "normal" ? [] : [`letter-spacing: ${spacing[letterSpacing]};`], `font-size: ${sizes[style?.textSize ?? "sm"]};`];
|
|
2643
2927
|
}
|
|
2644
|
-
function generateDropdownLinkStyles(header, themeId, tokens, theme, surface) {
|
|
2928
|
+
function generateDropdownLinkStyles(header, themeId, tokens, theme, surface, navLinkStyle) {
|
|
2645
2929
|
return generateNavLinkCSS({
|
|
2646
2930
|
themeId,
|
|
2647
2931
|
tokens,
|
|
2648
2932
|
theme,
|
|
2649
|
-
style: dropdownNavLinkStyle(header, surface),
|
|
2933
|
+
style: dropdownNavLinkStyle(header, surface, navLinkStyle),
|
|
2650
2934
|
className: "nav-dropdown-link"
|
|
2651
2935
|
}) + `\n${`:where([data-theme-scope="${themeId}"]) .nav-dropdown-link`} {\n ${dropdownTypographyRules(surface.style).join("\n ")}\n}\n`;
|
|
2652
2936
|
}
|
|
@@ -2944,6 +3228,11 @@ const waveMaskSvgPaths = {
|
|
|
2944
3228
|
*/
|
|
2945
3229
|
const arcShapePath = "M0 110V60Q720 -30 1440 60V110Z";
|
|
2946
3230
|
const arcEchoLinePaths = ["M0 84Q720 -6 1440 84", "M0 102Q720 12 1440 102"];
|
|
3231
|
+
/** The arc turned over: the next section's colour sits lowest in the middle, under the swell of the section above. */
|
|
3232
|
+
const arcBulgeShapePath = "M0 110V50Q720 140 1440 50V110Z";
|
|
3233
|
+
function arcBulgeMaskDataUrl() {
|
|
3234
|
+
return svgDataUrl(`<svg viewBox='0 0 1440 110' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><path d='${arcBulgeShapePath}' fill='white'/></svg>`);
|
|
3235
|
+
}
|
|
2947
3236
|
function arcMaskDataUrl(echo) {
|
|
2948
3237
|
const lines = arcEchoLinePaths.map((d) => `<path d='${d}' fill='none' stroke='url(#fade)' stroke-width='1.5' vector-effect='non-scaling-stroke'/>`).join("");
|
|
2949
3238
|
return svgDataUrl(`<svg viewBox='0 0 1440 110' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'>${echo ? `<defs><linearGradient id='fade' gradientUnits='userSpaceOnUse' x1='0' y1='0' x2='1440' y2='0'><stop offset='0' stop-color='black' stop-opacity='0.42'/><stop offset='0.5' stop-color='black' stop-opacity='0'/><stop offset='1' stop-color='black' stop-opacity='0.42'/></linearGradient><mask id='lines'><rect width='1440' height='110' fill='white'/>${lines}</mask></defs><path d='${arcShapePath}' fill='white' mask='url(#lines)'/>` : `<path d='${arcShapePath}' fill='white'/>`}</svg>`);
|
|
@@ -3052,7 +3341,7 @@ function shapeDeclarations(entry) {
|
|
|
3052
3341
|
"background: linear-gradient(to bottom, transparent 0%, color-mix(in srgb, var(--boundary-shape-paint) 16%, transparent) 34%, color-mix(in srgb, var(--boundary-shape-paint) 68%, transparent) 78%, var(--boundary-shape-paint) 100%);"
|
|
3053
3342
|
];
|
|
3054
3343
|
case "wave": return maskDeclarations(waveMaskDataUrl(entry.shape.mask));
|
|
3055
|
-
case "arc": return [...maskDeclarations(arcMaskDataUrl(entry.shape.echo === true)), "height: calc(var(--boundary-height) + 2px);"];
|
|
3344
|
+
case "arc": return [...maskDeclarations(entry.shape.bulge ? arcBulgeMaskDataUrl() : arcMaskDataUrl(entry.shape.echo === true)), "height: calc(var(--boundary-height) + 2px);"];
|
|
3056
3345
|
case "angle": return [
|
|
3057
3346
|
"height: calc(var(--boundary-height) + 2px);",
|
|
3058
3347
|
"background: var(--boundary-shape-paint);",
|
|
@@ -3133,21 +3422,46 @@ function generateHeroTypographyCss(themeId, theme) {
|
|
|
3133
3422
|
if (microSubheadlineRules.length > 0) chunks.push(`${microSubheadlineSelector} {\n ${microSubheadlineRules.join("\n ")}\n}`);
|
|
3134
3423
|
const selectors = {
|
|
3135
3424
|
headline: headlineSelector,
|
|
3136
|
-
subheadline: subheadlineSelector
|
|
3425
|
+
subheadline: subheadlineSelector,
|
|
3426
|
+
microHeadline: microHeadlineSelector,
|
|
3427
|
+
microSubheadline: microSubheadlineSelector
|
|
3428
|
+
};
|
|
3429
|
+
const microSizes = {
|
|
3430
|
+
headlineSize: typography.microHeadlineSize,
|
|
3431
|
+
subheadlineSize: typography.microSubheadlineSize
|
|
3137
3432
|
};
|
|
3138
|
-
const responsiveChunks = [responsiveHeroTypographyCss(MQ_TABLET_ONLY, selectors, typography.responsive?.tablet), responsiveHeroTypographyCss(MQ_SM_DOWN, selectors, typography.responsive?.mobile)];
|
|
3433
|
+
const responsiveChunks = [responsiveHeroTypographyCss(MQ_TABLET_ONLY, selectors, typography.responsive?.tablet, microSizes), responsiveHeroTypographyCss(MQ_SM_DOWN, selectors, typography.responsive?.mobile, microSizes)];
|
|
3139
3434
|
for (const chunk of responsiveChunks) if (chunk) chunks.push(chunk);
|
|
3140
3435
|
return chunks.join("\n\n");
|
|
3141
3436
|
}
|
|
3142
|
-
function responsiveHeroTypographyCss(media, selectors, overrides) {
|
|
3437
|
+
function responsiveHeroTypographyCss(media, selectors, overrides, microSizes) {
|
|
3143
3438
|
if (!overrides) return null;
|
|
3144
3439
|
const headlineRules = buildTypographyRules("headline", overrides.headlineSize, overrides.headlineLineHeight);
|
|
3145
3440
|
const subheadlineRules = buildTypographyRules("subheadline", overrides.subheadlineSize, overrides.subheadlineLineHeight);
|
|
3146
3441
|
const mediaChunks = [];
|
|
3147
3442
|
if (headlineRules.length > 0) mediaChunks.push(`${selectors.headline} {\n ${headlineRules.join("\n ")}\n }`);
|
|
3148
3443
|
if (subheadlineRules.length > 0) mediaChunks.push(`${selectors.subheadline} {\n ${subheadlineRules.join("\n ")}\n }`);
|
|
3444
|
+
const microHeadlineSize = microSizeAtBreakpoint(microSizes.headlineSize, overrides.headlineSize);
|
|
3445
|
+
if (microHeadlineSize) {
|
|
3446
|
+
const rules = buildTypographyRules("headline", microHeadlineSize, overrides.headlineLineHeight);
|
|
3447
|
+
mediaChunks.push(`${selectors.microHeadline} {\n ${rules.join("\n ")}\n }`);
|
|
3448
|
+
}
|
|
3449
|
+
const microSubheadlineSize = microSizeAtBreakpoint(microSizes.subheadlineSize, overrides.subheadlineSize);
|
|
3450
|
+
if (microSubheadlineSize) {
|
|
3451
|
+
const rules = buildTypographyRules("subheadline", microSubheadlineSize, overrides.subheadlineLineHeight);
|
|
3452
|
+
mediaChunks.push(`${selectors.microSubheadline} {\n ${rules.join("\n ")}\n }`);
|
|
3453
|
+
}
|
|
3149
3454
|
return mediaChunks.length > 0 ? `@media ${media} {\n ${mediaChunks.join("\n\n ")}\n}` : null;
|
|
3150
3455
|
}
|
|
3456
|
+
/**
|
|
3457
|
+
* A micro hero steps down to the breakpoint's size, but a micro size that's
|
|
3458
|
+
* already smaller stays as it is. The editorial size is fluid, so it needs no step.
|
|
3459
|
+
*/
|
|
3460
|
+
function microSizeAtBreakpoint(microSize, breakpointSize) {
|
|
3461
|
+
if (!microSize || !breakpointSize || microSize === "editorial") return void 0;
|
|
3462
|
+
if (breakpointSize === "editorial") return breakpointSize;
|
|
3463
|
+
return HERO_SIZE_ORDER.indexOf(breakpointSize) < HERO_SIZE_ORDER.indexOf(microSize) ? breakpointSize : void 0;
|
|
3464
|
+
}
|
|
3151
3465
|
function buildTypographyRules(role, size, lineHeight) {
|
|
3152
3466
|
const rules = [];
|
|
3153
3467
|
if (size) rules.push(`font-size: ${toHeroSize(role, size)};`);
|
|
@@ -3171,6 +3485,17 @@ function generateBodyTextTypographyCss(themeId, theme) {
|
|
|
3171
3485
|
}`);
|
|
3172
3486
|
return chunks.join("\n\n");
|
|
3173
3487
|
}
|
|
3488
|
+
const HERO_SIZE_ORDER = [
|
|
3489
|
+
"sm",
|
|
3490
|
+
"base",
|
|
3491
|
+
"lg",
|
|
3492
|
+
"xl",
|
|
3493
|
+
"2xl",
|
|
3494
|
+
"3xl",
|
|
3495
|
+
"4xl",
|
|
3496
|
+
"5xl",
|
|
3497
|
+
"6xl"
|
|
3498
|
+
];
|
|
3174
3499
|
function toHeroSize(role, size) {
|
|
3175
3500
|
const baseMap = {
|
|
3176
3501
|
sm: "0.875rem",
|
|
@@ -3933,394 +4258,78 @@ function applyHeadingSizeOverrides(base, typography) {
|
|
|
3933
4258
|
h1Fluid: `clamp(${Math.round(h1 * fluidMin)}px, calc(${Math.round(h1 * fluidMin)}px + ${Math.round(h1 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * fluidMax)}px)`,
|
|
3934
4259
|
h2Fluid: `clamp(${Math.round(h2 * h2FluidMin)}px, calc(${Math.round(h2 * h2FluidMin)}px + ${Math.round(h2 * (fluidMax - h2FluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h2 * fluidMax)}px)`,
|
|
3935
4260
|
h3Fluid: `clamp(${Math.round(h3 * fluidMin)}px, calc(${Math.round(h3 * fluidMin)}px + ${Math.round(h3 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h3 * fluidMax)}px)`,
|
|
3936
|
-
h1Display: `${Math.round(h1 * 1.5)}px`,
|
|
3937
|
-
h1DisplayFluid: `clamp(${Math.round(h1 * 1.5 * fluidMin)}px, calc(${Math.round(h1 * 1.5 * fluidMin)}px + ${Math.round(h1 * 1.5 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * 1.5 * fluidMax)}px)`
|
|
3938
|
-
};
|
|
3939
|
-
}
|
|
3940
|
-
function mapLetterSpacing(s) {
|
|
3941
|
-
return {
|
|
3942
|
-
tight: "-0.01em",
|
|
3943
|
-
normal: "0em",
|
|
3944
|
-
loose: "0.02em"
|
|
3945
|
-
}[s];
|
|
3946
|
-
}
|
|
3947
|
-
function mapEyebrowSize(s) {
|
|
3948
|
-
return {
|
|
3949
|
-
sm: "0.75rem",
|
|
3950
|
-
md: "0.875rem",
|
|
3951
|
-
lg: "1rem"
|
|
3952
|
-
}[s];
|
|
3953
|
-
}
|
|
3954
|
-
function mapEyebrowLetterSpacing(s) {
|
|
3955
|
-
return {
|
|
3956
|
-
tight: "0em",
|
|
3957
|
-
normal: "0.025em",
|
|
3958
|
-
loose: "0.06em",
|
|
3959
|
-
wide: "0.12em"
|
|
3960
|
-
}[s];
|
|
3961
|
-
}
|
|
3962
|
-
function mapEyebrowCase(c) {
|
|
3963
|
-
return c === "uppercase" ? "uppercase" : "none";
|
|
3964
|
-
}
|
|
3965
|
-
function mapLineHeight(s) {
|
|
3966
|
-
return {
|
|
3967
|
-
normal: "1.5",
|
|
3968
|
-
relaxed: "1.65",
|
|
3969
|
-
loose: "1.8"
|
|
3970
|
-
}[s];
|
|
3971
|
-
}
|
|
3972
|
-
/**
|
|
3973
|
-
* Headings get their own line-height scale, decoupled from body. `mapLineHeight`
|
|
3974
|
-
* is floored at 1.5 (a body leading) which reads as too airy on headings — the
|
|
3975
|
-
* more so as size drops. These values sit well under 1.5 and let presets taper
|
|
3976
|
-
* per level (larger headings tighter). `tight`/`snug` extend the token set for
|
|
3977
|
-
* display headings; body keeps `mapLineHeight`.
|
|
3978
|
-
*/
|
|
3979
|
-
function mapHeadingLineHeight(s) {
|
|
3980
|
-
return {
|
|
3981
|
-
tight: "1.1",
|
|
3982
|
-
snug: "1.15",
|
|
3983
|
-
normal: "1.2",
|
|
3984
|
-
relaxed: "1.3",
|
|
3985
|
-
loose: "1.4"
|
|
3986
|
-
}[s];
|
|
3987
|
-
}
|
|
3988
|
-
function mapTextTransform(c) {
|
|
3989
|
-
if (c === "uppercase") return "uppercase";
|
|
3990
|
-
return "none";
|
|
3991
|
-
}
|
|
3992
|
-
function mapFontVariant(c) {
|
|
3993
|
-
if (c === "smallCaps") return "small-caps";
|
|
3994
|
-
return "normal";
|
|
3995
|
-
}
|
|
3996
|
-
function mapFontStyle(italic) {
|
|
3997
|
-
return italic ? "italic" : "normal";
|
|
3998
|
-
}
|
|
3999
|
-
/** Adapt the canonical default-card decision for the embedded registration. */
|
|
4000
|
-
function generateThemeBlockVarsCss(theme, themeId) {
|
|
4001
|
-
const card = resolveCardRole(theme, theme.cards ?? null, "default");
|
|
4002
|
-
return generateAllBlockVarsCss({
|
|
4003
|
-
theme,
|
|
4004
|
-
themeId,
|
|
4005
|
-
surface: opaqueSurfaceContextFromTheme(theme),
|
|
4006
|
-
embeddedRegistrationPaint: card.kind === "surface" ? cardSurfacePaint(card.variant) : { kind: "transparent" }
|
|
4007
|
-
});
|
|
4008
|
-
}
|
|
4009
|
-
//#endregion
|
|
4010
|
-
//#region ../calendar/src/lane-packing.ts
|
|
4011
|
-
/**
|
|
4012
|
-
* Assign lanes to a list of intervals.
|
|
4013
|
-
*
|
|
4014
|
-
* Returns one result per input in the same order as the input. Internally
|
|
4015
|
-
* sorts a copy by `(start, end, orderKey)` to ensure determinism, then
|
|
4016
|
-
* permutes results back to input order.
|
|
4017
|
-
*/
|
|
4018
|
-
function assignLanes(intervals) {
|
|
4019
|
-
if (intervals.length === 0) return [];
|
|
4020
|
-
const indexed = intervals.map((interval, index) => ({
|
|
4021
|
-
interval,
|
|
4022
|
-
index
|
|
4023
|
-
}));
|
|
4024
|
-
indexed.sort((left, right) => left.interval.start - right.interval.start || left.interval.end - right.interval.end || left.interval.orderKey.localeCompare(right.interval.orderKey));
|
|
4025
|
-
const results = new Array(intervals.length);
|
|
4026
|
-
let cluster = [];
|
|
4027
|
-
let activeLaneEnds = [];
|
|
4028
|
-
let clusterMaxEnd = -Infinity;
|
|
4029
|
-
const closeCluster = () => {
|
|
4030
|
-
if (cluster.length === 0) return;
|
|
4031
|
-
const laneCount = Math.max(1, cluster.reduce((max, entry) => Math.max(max, entry.laneIndex + 1), 0));
|
|
4032
|
-
for (const entry of cluster) results[entry.index] = {
|
|
4033
|
-
laneIndex: entry.laneIndex,
|
|
4034
|
-
laneCount
|
|
4035
|
-
};
|
|
4036
|
-
cluster = [];
|
|
4037
|
-
activeLaneEnds = [];
|
|
4038
|
-
clusterMaxEnd = -Infinity;
|
|
4039
|
-
};
|
|
4040
|
-
for (const { interval, index } of indexed) {
|
|
4041
|
-
if (interval.start >= clusterMaxEnd) closeCluster();
|
|
4042
|
-
const laneIndex = firstAvailableLane(activeLaneEnds, interval.start);
|
|
4043
|
-
activeLaneEnds[laneIndex] = interval.end;
|
|
4044
|
-
clusterMaxEnd = Math.max(clusterMaxEnd, interval.end);
|
|
4045
|
-
cluster.push({
|
|
4046
|
-
index,
|
|
4047
|
-
laneIndex
|
|
4048
|
-
});
|
|
4049
|
-
}
|
|
4050
|
-
closeCluster();
|
|
4051
|
-
return results;
|
|
4052
|
-
}
|
|
4053
|
-
function firstAvailableLane(activeLaneEnds, start) {
|
|
4054
|
-
const laneIndex = activeLaneEnds.findIndex((end) => end <= start);
|
|
4055
|
-
return laneIndex >= 0 ? laneIndex : activeLaneEnds.length;
|
|
4056
|
-
}
|
|
4057
|
-
//#endregion
|
|
4058
|
-
//#region ../calendar/src/timetable.ts
|
|
4059
|
-
/**
|
|
4060
|
-
* Timetable model — the package's core surface.
|
|
4061
|
-
*
|
|
4062
|
-
* Generic over `T`. Takes a list of timed items + a viewport; returns a
|
|
4063
|
-
* day-by-day layout with overlap-packed lanes and percent-based positions
|
|
4064
|
-
* plus a diagnostics list for items dropped during processing.
|
|
4065
|
-
*
|
|
4066
|
-
* The function is pure: given identical input (including `now`), it returns
|
|
4067
|
-
* the same output. The model has no opinion on what an item is — pass
|
|
4068
|
-
* accessors.
|
|
4069
|
-
*/
|
|
4070
|
-
const DEFAULT_BOUNDS = {
|
|
4071
|
-
minStartHour: 5,
|
|
4072
|
-
maxEndHour: 23,
|
|
4073
|
-
defaultStartHour: 6,
|
|
4074
|
-
defaultEndHour: 21,
|
|
4075
|
-
minHeightPercent: 2.5,
|
|
4076
|
-
marginMinutes: 0
|
|
4077
|
-
};
|
|
4078
|
-
function buildTimetableModel$1(input) {
|
|
4079
|
-
const bounds = resolveBounds(input.bounds);
|
|
4080
|
-
const viewportDays = getTimetableDays(input.viewDate, input.view ?? "week", input.startOfWeek);
|
|
4081
|
-
const viewportKeys = new Set(viewportDays.map(formatDateKey));
|
|
4082
|
-
const parsed = parseAllItems(input.items, input);
|
|
4083
|
-
const inViewport = deriveVisibleSegments(parsed.drafts, viewportKeys);
|
|
4084
|
-
const hourRange = input.hours === void 0 ? resolveHourRange(inViewport, bounds) : fixedHourRange(input.hours);
|
|
4085
|
-
const laid = layoutCellsByDate(inViewport, hourRange, bounds);
|
|
4086
|
-
return {
|
|
4087
|
-
days: assembleDays(viewportDays, laid.cellsByDate, input.today),
|
|
4088
|
-
hourTicks: buildHourTicks(hourRange.startHour, hourRange.endHour),
|
|
4089
|
-
startHour: hourRange.startHour,
|
|
4090
|
-
endHour: hourRange.endHour,
|
|
4091
|
-
rangeMinutes: (hourRange.endHour - hourRange.startHour) * 60,
|
|
4092
|
-
hasItems: inViewport.length > 0,
|
|
4093
|
-
diagnostics: [...parsed.diagnostics, ...laid.diagnostics]
|
|
4094
|
-
};
|
|
4095
|
-
}
|
|
4096
|
-
function parseAllItems(items, accessors) {
|
|
4097
|
-
const drafts = [];
|
|
4098
|
-
const diagnostics = [];
|
|
4099
|
-
for (const item of items) {
|
|
4100
|
-
const result = parseDraft(item, accessors);
|
|
4101
|
-
if (result.ok) drafts.push(result.draft);
|
|
4102
|
-
else diagnostics.push({
|
|
4103
|
-
item,
|
|
4104
|
-
reason: result.reason
|
|
4105
|
-
});
|
|
4106
|
-
}
|
|
4107
|
-
return {
|
|
4108
|
-
drafts,
|
|
4109
|
-
diagnostics
|
|
4110
|
-
};
|
|
4111
|
-
}
|
|
4112
|
-
function layoutCellsByDate(segments, hourRange, bounds) {
|
|
4113
|
-
const rangeMinutes = (hourRange.endHour - hourRange.startHour) * 60;
|
|
4114
|
-
const rangeStartMinutes = hourRange.startHour * 60;
|
|
4115
|
-
const rangeEndMinutes = hourRange.endHour * 60;
|
|
4116
|
-
const segmentsByDate = groupSegmentsByDate(segments);
|
|
4117
|
-
const cellsByDate = /* @__PURE__ */ new Map();
|
|
4118
|
-
const diagnostics = [];
|
|
4119
|
-
for (const [dateKey, daySegments] of segmentsByDate) {
|
|
4120
|
-
const clipped = [];
|
|
4121
|
-
for (const segment of daySegments) {
|
|
4122
|
-
const result = clipDraft(segment, rangeStartMinutes, rangeEndMinutes);
|
|
4123
|
-
if (result.ok) clipped.push(result.clipped);
|
|
4124
|
-
else diagnostics.push({
|
|
4125
|
-
item: segment.draft.item,
|
|
4126
|
-
reason: result.reason
|
|
4127
|
-
});
|
|
4128
|
-
}
|
|
4129
|
-
const laneResults = assignLanes(clipped.map((entry) => ({
|
|
4130
|
-
start: entry.visibleStart,
|
|
4131
|
-
end: entry.visibleEnd,
|
|
4132
|
-
orderKey: entry.segment.draft.orderKey
|
|
4133
|
-
})));
|
|
4134
|
-
cellsByDate.set(dateKey, clipped.map((entry, idx) => buildCell(entry, laneResults[idx] ?? {
|
|
4135
|
-
laneIndex: 0,
|
|
4136
|
-
laneCount: 1
|
|
4137
|
-
}, rangeStartMinutes, rangeMinutes, bounds.minHeightPercent)));
|
|
4138
|
-
}
|
|
4139
|
-
return {
|
|
4140
|
-
cellsByDate,
|
|
4141
|
-
diagnostics
|
|
4142
|
-
};
|
|
4143
|
-
}
|
|
4144
|
-
function assembleDays(viewportDays, cellsByDate, today) {
|
|
4145
|
-
return viewportDays.map((date) => {
|
|
4146
|
-
const dateKey = formatDateKey(date);
|
|
4147
|
-
return {
|
|
4148
|
-
date,
|
|
4149
|
-
dateKey,
|
|
4150
|
-
isToday: isSameCalendarDay(date, today),
|
|
4151
|
-
cells: cellsByDate.get(dateKey) ?? []
|
|
4152
|
-
};
|
|
4153
|
-
});
|
|
4154
|
-
}
|
|
4155
|
-
function parseDraft(item, accessors) {
|
|
4156
|
-
const startsAtIso = accessors.getStartsAt(item);
|
|
4157
|
-
const endsAtIso = accessors.getEndsAt(item);
|
|
4158
|
-
const timeZone = accessors.getTimeZone(item);
|
|
4159
|
-
const startsAtMinutes = getLocalMinuteOfDay(startsAtIso, timeZone);
|
|
4160
|
-
if (Number.isNaN(startsAtMinutes)) return {
|
|
4161
|
-
ok: false,
|
|
4162
|
-
reason: "invalid-start"
|
|
4163
|
-
};
|
|
4164
|
-
const startDateKey = getLocalDateKey(startsAtIso, timeZone);
|
|
4165
|
-
if (startDateKey == null) return {
|
|
4166
|
-
ok: false,
|
|
4167
|
-
reason: "invalid-timezone"
|
|
4168
|
-
};
|
|
4169
|
-
const endDateKey = getLocalDateKey(endsAtIso, timeZone);
|
|
4170
|
-
if (endDateKey == null) return {
|
|
4171
|
-
ok: false,
|
|
4172
|
-
reason: "invalid-end"
|
|
4173
|
-
};
|
|
4174
|
-
const endsAtMinutesRaw = getLocalMinuteOfDay(endsAtIso, timeZone);
|
|
4175
|
-
if (Number.isNaN(endsAtMinutesRaw)) return {
|
|
4176
|
-
ok: false,
|
|
4177
|
-
reason: "invalid-end"
|
|
4178
|
-
};
|
|
4179
|
-
const spansMultipleDays = startDateKey < endDateKey;
|
|
4180
|
-
const endsAtMinutes = spansMultipleDays || endsAtMinutesRaw > startsAtMinutes ? endsAtMinutesRaw : Math.min(1440, startsAtMinutes + 60);
|
|
4181
|
-
if (!spansMultipleDays && endsAtMinutes <= startsAtMinutes) return {
|
|
4182
|
-
ok: false,
|
|
4183
|
-
reason: "non-positive-duration"
|
|
4184
|
-
};
|
|
4185
|
-
return {
|
|
4186
|
-
ok: true,
|
|
4187
|
-
draft: {
|
|
4188
|
-
item,
|
|
4189
|
-
startDateKey,
|
|
4190
|
-
endDateKey,
|
|
4191
|
-
startsAtMinutes,
|
|
4192
|
-
endsAtMinutes,
|
|
4193
|
-
color: accessors.getColor?.(item) ?? null,
|
|
4194
|
-
orderKey: accessors.getOrderKey?.(item) ?? accessors.getId(item)
|
|
4195
|
-
}
|
|
4196
|
-
};
|
|
4197
|
-
}
|
|
4198
|
-
function deriveVisibleSegments(drafts, viewportKeys) {
|
|
4199
|
-
const segments = [];
|
|
4200
|
-
for (const draft of drafts) for (const dateKey of enumerateDateKeys(draft.startDateKey, draft.endDateKey)) {
|
|
4201
|
-
if (!viewportKeys.has(dateKey)) continue;
|
|
4202
|
-
const isStartDay = dateKey === draft.startDateKey;
|
|
4203
|
-
const isEndDay = dateKey === draft.endDateKey;
|
|
4204
|
-
const startsAtMinutes = isStartDay ? draft.startsAtMinutes : 0;
|
|
4205
|
-
const endsAtMinutes = isEndDay ? draft.endsAtMinutes : 1440;
|
|
4206
|
-
if (endsAtMinutes <= startsAtMinutes) continue;
|
|
4207
|
-
segments.push({
|
|
4208
|
-
draft,
|
|
4209
|
-
dateKey,
|
|
4210
|
-
startsAtMinutes,
|
|
4211
|
-
endsAtMinutes,
|
|
4212
|
-
continuesBefore: !isStartDay,
|
|
4213
|
-
continuesAfter: !isEndDay
|
|
4214
|
-
});
|
|
4215
|
-
}
|
|
4216
|
-
return segments;
|
|
4217
|
-
}
|
|
4218
|
-
function clipDraft(segment, rangeStartMinutes, rangeEndMinutes) {
|
|
4219
|
-
const visibleStart = Math.max(rangeStartMinutes, segment.startsAtMinutes);
|
|
4220
|
-
const visibleEnd = Math.min(rangeEndMinutes, segment.endsAtMinutes);
|
|
4221
|
-
if (visibleEnd <= visibleStart) return {
|
|
4222
|
-
ok: false,
|
|
4223
|
-
reason: "out-of-visible-hours"
|
|
4224
|
-
};
|
|
4225
|
-
return {
|
|
4226
|
-
ok: true,
|
|
4227
|
-
clipped: {
|
|
4228
|
-
segment,
|
|
4229
|
-
visibleStart,
|
|
4230
|
-
visibleEnd
|
|
4231
|
-
}
|
|
4261
|
+
h1Display: `${Math.round(h1 * 1.5)}px`,
|
|
4262
|
+
h1DisplayFluid: `clamp(${Math.round(h1 * 1.5 * fluidMin)}px, calc(${Math.round(h1 * 1.5 * fluidMin)}px + ${Math.round(h1 * 1.5 * (fluidMax - fluidMin))} * ((100vw - 320px) / 880)), ${Math.round(h1 * 1.5 * fluidMax)}px)`
|
|
4232
4263
|
};
|
|
4233
4264
|
}
|
|
4234
|
-
function
|
|
4235
|
-
const heightPercent = Math.max(minHeightPercent, toRangePercent(entry.visibleEnd - entry.visibleStart, rangeMinutes));
|
|
4236
|
-
const rawTopPercent = toRangePercent(entry.visibleStart - rangeStartMinutes, rangeMinutes);
|
|
4237
|
-
const topPercent = Math.min(rawTopPercent, 100 - heightPercent);
|
|
4265
|
+
function mapLetterSpacing(s) {
|
|
4238
4266
|
return {
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
visibleStartsAtMinutes: entry.visibleStart,
|
|
4244
|
-
visibleEndsAtMinutes: entry.visibleEnd,
|
|
4245
|
-
topPercent,
|
|
4246
|
-
heightPercent,
|
|
4247
|
-
isClippedStart: entry.segment.continuesBefore || entry.segment.startsAtMinutes < entry.visibleStart,
|
|
4248
|
-
isClippedEnd: entry.segment.continuesAfter || entry.segment.endsAtMinutes > entry.visibleEnd,
|
|
4249
|
-
laneIndex: lane.laneIndex,
|
|
4250
|
-
laneCount: lane.laneCount,
|
|
4251
|
-
color: entry.segment.draft.color
|
|
4252
|
-
};
|
|
4267
|
+
tight: "-0.01em",
|
|
4268
|
+
normal: "0em",
|
|
4269
|
+
loose: "0.02em"
|
|
4270
|
+
}[s];
|
|
4253
4271
|
}
|
|
4254
|
-
function
|
|
4272
|
+
function mapEyebrowSize(s) {
|
|
4255
4273
|
return {
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4274
|
+
sm: "0.75rem",
|
|
4275
|
+
md: "0.875rem",
|
|
4276
|
+
lg: "1rem"
|
|
4277
|
+
}[s];
|
|
4259
4278
|
}
|
|
4260
|
-
function
|
|
4261
|
-
if (segments.length === 0) return {
|
|
4262
|
-
startHour: bounds.defaultStartHour,
|
|
4263
|
-
endHour: bounds.defaultEndHour
|
|
4264
|
-
};
|
|
4265
|
-
const earliestStart = Math.min(...segments.map((segment) => segment.startsAtMinutes));
|
|
4266
|
-
const latestEnd = Math.max(...segments.map((segment) => segment.endsAtMinutes));
|
|
4267
|
-
const startHour = Math.max(bounds.minStartHour, Math.floor((earliestStart - bounds.marginMinutes) / 60));
|
|
4268
|
-
const endHour = Math.min(bounds.maxEndHour, Math.ceil((latestEnd + bounds.marginMinutes) / 60));
|
|
4279
|
+
function mapEyebrowLetterSpacing(s) {
|
|
4269
4280
|
return {
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4281
|
+
tight: "0em",
|
|
4282
|
+
normal: "0.025em",
|
|
4283
|
+
loose: "0.06em",
|
|
4284
|
+
wide: "0.12em"
|
|
4285
|
+
}[s];
|
|
4273
4286
|
}
|
|
4274
|
-
function
|
|
4275
|
-
|
|
4276
|
-
return {
|
|
4277
|
-
startHour,
|
|
4278
|
-
endHour: Math.min(24, Math.max(startHour + 1, Math.ceil(hours.endHour)))
|
|
4279
|
-
};
|
|
4287
|
+
function mapEyebrowCase(c) {
|
|
4288
|
+
return c === "uppercase" ? "uppercase" : "none";
|
|
4280
4289
|
}
|
|
4281
|
-
function
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4290
|
+
function mapLineHeight(s) {
|
|
4291
|
+
return {
|
|
4292
|
+
normal: "1.5",
|
|
4293
|
+
relaxed: "1.65",
|
|
4294
|
+
loose: "1.8"
|
|
4295
|
+
}[s];
|
|
4285
4296
|
}
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4297
|
+
/**
|
|
4298
|
+
* Headings get their own line-height scale, decoupled from body. `mapLineHeight`
|
|
4299
|
+
* is floored at 1.5 (a body leading) which reads as too airy on headings — the
|
|
4300
|
+
* more so as size drops. These values sit well under 1.5 and let presets taper
|
|
4301
|
+
* per level (larger headings tighter). `tight`/`snug` extend the token set for
|
|
4302
|
+
* display headings; body keeps `mapLineHeight`.
|
|
4303
|
+
*/
|
|
4304
|
+
function mapHeadingLineHeight(s) {
|
|
4305
|
+
return {
|
|
4306
|
+
tight: "1.1",
|
|
4307
|
+
snug: "1.15",
|
|
4308
|
+
normal: "1.2",
|
|
4309
|
+
relaxed: "1.3",
|
|
4310
|
+
loose: "1.4"
|
|
4311
|
+
}[s];
|
|
4294
4312
|
}
|
|
4295
|
-
function
|
|
4296
|
-
if (
|
|
4297
|
-
return
|
|
4313
|
+
function mapTextTransform(c) {
|
|
4314
|
+
if (c === "uppercase") return "uppercase";
|
|
4315
|
+
return "none";
|
|
4298
4316
|
}
|
|
4299
|
-
function
|
|
4300
|
-
if (
|
|
4301
|
-
return
|
|
4317
|
+
function mapFontVariant(c) {
|
|
4318
|
+
if (c === "smallCaps") return "small-caps";
|
|
4319
|
+
return "normal";
|
|
4302
4320
|
}
|
|
4303
|
-
function
|
|
4304
|
-
|
|
4305
|
-
const start = parseDateKey(startDateKey);
|
|
4306
|
-
parseDateKey(endDateKey);
|
|
4307
|
-
const keys = [];
|
|
4308
|
-
let cursor = start;
|
|
4309
|
-
while (formatDateKey(cursor) <= endDateKey) {
|
|
4310
|
-
keys.push(formatDateKey(cursor));
|
|
4311
|
-
cursor = addDays(cursor, 1);
|
|
4312
|
-
}
|
|
4313
|
-
return keys;
|
|
4321
|
+
function mapFontStyle(italic) {
|
|
4322
|
+
return italic ? "italic" : "normal";
|
|
4314
4323
|
}
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
};
|
|
4324
|
+
/** Adapt the canonical default-card decision for the embedded registration. */
|
|
4325
|
+
function generateThemeBlockVarsCss(theme, themeId) {
|
|
4326
|
+
const card = resolveCardRole(theme, theme.cards ?? null, "default");
|
|
4327
|
+
return generateAllBlockVarsCss({
|
|
4328
|
+
theme,
|
|
4329
|
+
themeId,
|
|
4330
|
+
surface: opaqueSurfaceContextFromTheme(theme),
|
|
4331
|
+
embeddedRegistrationPaint: card.kind === "surface" ? cardSurfacePaint(card.variant) : { kind: "transparent" }
|
|
4332
|
+
});
|
|
4324
4333
|
}
|
|
4325
4334
|
//#endregion
|
|
4326
4335
|
//#region ../blocks/src/system/node/fragments/headingDecoration.ts
|
|
@@ -4490,26 +4499,6 @@ function selectEventDetailsCandidate(events, requested, nowIso) {
|
|
|
4490
4499
|
} : null;
|
|
4491
4500
|
}
|
|
4492
4501
|
//#endregion
|
|
4493
|
-
//#region ../blocks/src/system/runtime/nodes/events/domain/location.ts
|
|
4494
|
-
function formatEventLocation(event) {
|
|
4495
|
-
switch (event.deliveryMode) {
|
|
4496
|
-
case "online": return "Online";
|
|
4497
|
-
case "hybrid": return event.venue ? `${event.venue.name} + online` : "Hybrid";
|
|
4498
|
-
case "in_person": return event.venue?.name ?? "In person";
|
|
4499
|
-
}
|
|
4500
|
-
}
|
|
4501
|
-
/** The line under the venue name. A booked-only venue shows its area, and the address follows the booking. */
|
|
4502
|
-
function eventVenuePlace(venue) {
|
|
4503
|
-
if (venue.addressWithBooking) return {
|
|
4504
|
-
place: venue.area ?? null,
|
|
4505
|
-
addressWithBooking: true
|
|
4506
|
-
};
|
|
4507
|
-
return {
|
|
4508
|
-
place: venue.address,
|
|
4509
|
-
addressWithBooking: false
|
|
4510
|
-
};
|
|
4511
|
-
}
|
|
4512
|
-
//#endregion
|
|
4513
4502
|
//#region ../blocks/src/system/runtime/shared/utils/bookingRoute.ts
|
|
4514
4503
|
const BOOK_TARGET_PARAMS = {
|
|
4515
4504
|
service: "service",
|
|
@@ -5132,7 +5121,7 @@ function EventCardContent(props) {
|
|
|
5132
5121
|
}
|
|
5133
5122
|
function EventCardVenue(props) {
|
|
5134
5123
|
const venue = props.showVenue ? props.event.venue : null;
|
|
5135
|
-
if (!venue) return null;
|
|
5124
|
+
if (!venue) return props.showVenue && props.event.addressAfterBooking ? /* @__PURE__ */ jsx(AddressAfterBookingLine, {}) : null;
|
|
5136
5125
|
const { place } = eventVenuePlace(venue);
|
|
5137
5126
|
return /* @__PURE__ */ jsxs("div", {
|
|
5138
5127
|
className: "rb-mb-3",
|
|
@@ -5145,6 +5134,15 @@ function EventCardVenue(props) {
|
|
|
5145
5134
|
})]
|
|
5146
5135
|
});
|
|
5147
5136
|
}
|
|
5137
|
+
function AddressAfterBookingLine() {
|
|
5138
|
+
return /* @__PURE__ */ jsx("div", {
|
|
5139
|
+
className: "rb-mb-3",
|
|
5140
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
5141
|
+
className: "rb-flex rb-items-center rb-gap-2 rb-caption",
|
|
5142
|
+
children: [/* @__PURE__ */ jsx(MapPinIcon, { className: "rb-shrink-0" }), /* @__PURE__ */ jsx("span", { children: EVENT_ADDRESS_AFTER_BOOKING_LABEL })]
|
|
5143
|
+
})
|
|
5144
|
+
});
|
|
5145
|
+
}
|
|
5148
5146
|
function EventCardFooter(props) {
|
|
5149
5147
|
return /* @__PURE__ */ jsxs("div", {
|
|
5150
5148
|
...listLookSlot(props, "item-actions"),
|
|
@@ -8054,14 +8052,22 @@ function membershipCoversEvent(args, event) {
|
|
|
8054
8052
|
return isCategoryEligible(args.eligibleCategoryIds, event.eventCategoryId);
|
|
8055
8053
|
}
|
|
8056
8054
|
/**
|
|
8055
|
+
* Whether a pass or membership could get someone into this event at all. Nobody
|
|
8056
|
+
* books an event that takes no bookings, and a free one has nothing to pay. A
|
|
8057
|
+
* tiered event whose tickets are all free isn't `free`: the dashboard treats it
|
|
8058
|
+
* as priced, and the server refuses to spend anything on a free ticket.
|
|
8059
|
+
*/
|
|
8060
|
+
function eventCanUseProducts(event) {
|
|
8061
|
+
return event.requiresRegistration !== false && event.pricing.kind !== "free";
|
|
8062
|
+
}
|
|
8063
|
+
/**
|
|
8057
8064
|
* Filter site passes to only those that cover the selected event.
|
|
8058
8065
|
*
|
|
8059
8066
|
* Public purchasable products are a pre-auth proxy for whether the pass path is
|
|
8060
8067
|
* worth advertising; owned pass eligibility is checked later after portal auth.
|
|
8061
8068
|
*/
|
|
8062
8069
|
function filterPassesForEvent(sitePasses, event) {
|
|
8063
|
-
if (!sitePasses || !event) return [];
|
|
8064
|
-
if (event.requiresRegistration === false) return [];
|
|
8070
|
+
if (!sitePasses || !event || !eventCanUseProducts(event)) return [];
|
|
8065
8071
|
const eventCategoryId = event.eventCategory?.id ?? null;
|
|
8066
8072
|
return sitePasses.filter((pass) => pass.productUseCase === "event_pass" && passCoversEvent({ eligibleCategoryIds: pass.eligibleCategoryIds }, {
|
|
8067
8073
|
acceptsPasses: event.acceptsPasses,
|
|
@@ -8076,8 +8082,7 @@ function filterPassesForEvent(sitePasses, event) {
|
|
|
8076
8082
|
* after portal auth.
|
|
8077
8083
|
*/
|
|
8078
8084
|
function filterMembershipsForEvent(siteMemberships, event) {
|
|
8079
|
-
if (!siteMemberships || !event) return [];
|
|
8080
|
-
if (event.requiresRegistration === false) return [];
|
|
8085
|
+
if (!siteMemberships || !event || !eventCanUseProducts(event)) return [];
|
|
8081
8086
|
const eventCategoryId = event.eventCategory?.id ?? null;
|
|
8082
8087
|
return siteMemberships.filter((membership) => membershipCoversEvent({ eligibleCategoryIds: membership.eligibleCategoryIds }, {
|
|
8083
8088
|
acceptsMemberships: event.acceptsMemberships,
|
|
@@ -8236,7 +8241,11 @@ function resolveEventDetailsPresentation(input) {
|
|
|
8236
8241
|
function wholeSeriesPriceOptions(pricing) {
|
|
8237
8242
|
return pricing.kind === "tiered" ? pricing.options.filter((option) => option.isActive) : [];
|
|
8238
8243
|
}
|
|
8239
|
-
|
|
8244
|
+
/** The price, with any deposit option said beside it. */
|
|
8245
|
+
function PriceLine({ price, depositNote }) {
|
|
8246
|
+
return /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("strong", { children: price }), depositNote ? `, ${depositNote}` : null] });
|
|
8247
|
+
}
|
|
8248
|
+
function WholeSeriesPricingDisplay({ pricing, depositNote, acceptedItems }) {
|
|
8240
8249
|
const options = wholeSeriesPriceOptions(pricing);
|
|
8241
8250
|
return /* @__PURE__ */ jsxs("div", {
|
|
8242
8251
|
className: "rb-mt-6",
|
|
@@ -8256,7 +8265,14 @@ function WholeSeriesPricingDisplay({ pricing, acceptedItems }) {
|
|
|
8256
8265
|
className: "rb-caption status-muted",
|
|
8257
8266
|
children: option.description
|
|
8258
8267
|
}) : null] }, option.id))
|
|
8259
|
-
}) : /* @__PURE__ */ jsx(
|
|
8268
|
+
}) : /* @__PURE__ */ jsx(PriceLine, {
|
|
8269
|
+
price: formatBookingPriceDisplay(publicEventPricingDisplay(pricing), { decimals: "auto" }),
|
|
8270
|
+
depositNote
|
|
8271
|
+
}),
|
|
8272
|
+
depositNote && options.length > 1 ? /* @__PURE__ */ jsxs("p", {
|
|
8273
|
+
className: "rb-caption rb-mt-1",
|
|
8274
|
+
children: [depositNote.charAt(0).toUpperCase(), depositNote.slice(1)]
|
|
8275
|
+
}) : null,
|
|
8260
8276
|
acceptedItems.length > 0 ? /* @__PURE__ */ jsxs("p", {
|
|
8261
8277
|
className: "rb-caption rb-mt-1",
|
|
8262
8278
|
children: ["You can also attend with: ", acceptedItems.join(", ")]
|
|
@@ -8297,7 +8313,7 @@ function TicketTypePriceList({ ticketTypes, currency }) {
|
|
|
8297
8313
|
}, ticketType.id))
|
|
8298
8314
|
});
|
|
8299
8315
|
}
|
|
8300
|
-
function EventPricingDetails({ isDropIn, wholeSeriesPricingDisplay, acceptedItems, eventCostLabel, eventPricingCurrency, ticketTypes, autoApplyDiscount }) {
|
|
8316
|
+
function EventPricingDetails({ isDropIn, wholeSeriesPricingDisplay, acceptedItems, eventCostLabel, depositNote, eventPricingCurrency, ticketTypes, autoApplyDiscount }) {
|
|
8301
8317
|
if (isDropIn) return /* @__PURE__ */ jsxs("div", {
|
|
8302
8318
|
className: "rb-mt-6",
|
|
8303
8319
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -8310,6 +8326,7 @@ function EventPricingDetails({ isDropIn, wholeSeriesPricingDisplay, acceptedItem
|
|
|
8310
8326
|
});
|
|
8311
8327
|
if (wholeSeriesPricingDisplay) return /* @__PURE__ */ jsx(WholeSeriesPricingDisplay, {
|
|
8312
8328
|
pricing: wholeSeriesPricingDisplay,
|
|
8329
|
+
depositNote,
|
|
8313
8330
|
acceptedItems: [...acceptedItems]
|
|
8314
8331
|
});
|
|
8315
8332
|
if (eventCostLabel) return /* @__PURE__ */ jsxs("div", {
|
|
@@ -8319,7 +8336,10 @@ function EventPricingDetails({ isDropIn, wholeSeriesPricingDisplay, acceptedItem
|
|
|
8319
8336
|
className: "rb-label rb-mb-2",
|
|
8320
8337
|
children: "Cost"
|
|
8321
8338
|
}),
|
|
8322
|
-
/* @__PURE__ */ jsx(
|
|
8339
|
+
/* @__PURE__ */ jsx(PriceLine, {
|
|
8340
|
+
price: eventCostLabel,
|
|
8341
|
+
depositNote
|
|
8342
|
+
}),
|
|
8323
8343
|
autoApplyDiscount && eventPricingCurrency ? /* @__PURE__ */ jsx("p", {
|
|
8324
8344
|
className: "rb-caption rb-mt-1",
|
|
8325
8345
|
children: formatAutoApplyDiscountLine(autoApplyDiscount, eventPricingCurrency)
|
|
@@ -8342,7 +8362,7 @@ function EventPricingDetails({ isDropIn, wholeSeriesPricingDisplay, acceptedItem
|
|
|
8342
8362
|
})
|
|
8343
8363
|
}) : null;
|
|
8344
8364
|
}
|
|
8345
|
-
function EventFacts({ selection, selected, venue, teamMembers, pricing, showCapacity, lookSlots }) {
|
|
8365
|
+
function EventFacts({ selection, selected, venue, online, addressAfterBooking, teamMembers, pricing, showCapacity, lookSlots }) {
|
|
8346
8366
|
const { date, timeRange } = formatEventDateParts({
|
|
8347
8367
|
startsAt: selected.startsAt,
|
|
8348
8368
|
endsAt: selected.endsAt,
|
|
@@ -8364,7 +8384,11 @@ function EventFacts({ selection, selected, venue, teamMembers, pricing, showCapa
|
|
|
8364
8384
|
children: timeRange
|
|
8365
8385
|
})
|
|
8366
8386
|
] }),
|
|
8367
|
-
/* @__PURE__ */ jsx(EventVenueFact, {
|
|
8387
|
+
/* @__PURE__ */ jsx(EventVenueFact, {
|
|
8388
|
+
venue,
|
|
8389
|
+
online,
|
|
8390
|
+
addressAfterBooking
|
|
8391
|
+
}),
|
|
8368
8392
|
/* @__PURE__ */ jsx(EventTeacherFacts, { teamMembers }),
|
|
8369
8393
|
showCapacity && selected.capacity != null ? /* @__PURE__ */ jsxs("div", {
|
|
8370
8394
|
className: "rb-mt-6",
|
|
@@ -8381,8 +8405,44 @@ function EventFacts({ selection, selected, venue, teamMembers, pricing, showCapa
|
|
|
8381
8405
|
]
|
|
8382
8406
|
});
|
|
8383
8407
|
}
|
|
8384
|
-
|
|
8385
|
-
|
|
8408
|
+
const eventOnlinePlaceShown = (event, showVenue) => showVenue ? eventOnlinePlace(event) : null;
|
|
8409
|
+
const hasEventPlaceFact = (event, showVenue) => showVenue && (Boolean(event.venue) || eventOnlinePlace(event) !== null || event.addressAfterBooking === true);
|
|
8410
|
+
const addressAfterBookingShown = (event, showVenue) => showVenue && event.addressAfterBooking === true;
|
|
8411
|
+
/** Where a venue would go: online, the owner's word that the address follows the booking, or nothing at all. */
|
|
8412
|
+
function EventPlaceWithoutVenue({ online, addressAfterBooking }) {
|
|
8413
|
+
if (!online && !addressAfterBooking) return null;
|
|
8414
|
+
if (!online) return /* @__PURE__ */ jsxs("div", {
|
|
8415
|
+
className: "rb-mt-6",
|
|
8416
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
8417
|
+
className: "rb-label rb-mb-2",
|
|
8418
|
+
children: "Venue"
|
|
8419
|
+
}), /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: EVENT_ADDRESS_AFTER_BOOKING_LABEL }) })]
|
|
8420
|
+
});
|
|
8421
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
8422
|
+
className: "rb-mt-6",
|
|
8423
|
+
children: [
|
|
8424
|
+
/* @__PURE__ */ jsx("div", {
|
|
8425
|
+
className: "rb-label rb-mb-2",
|
|
8426
|
+
children: "Venue"
|
|
8427
|
+
}),
|
|
8428
|
+
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("strong", { children: online.mode === "online" ? "Online" : "In person or online" }) }),
|
|
8429
|
+
addressAfterBooking ? /* @__PURE__ */ jsxs("p", {
|
|
8430
|
+
className: "rb-caption",
|
|
8431
|
+
children: [EVENT_ADDRESS_AFTER_BOOKING_LABEL, "."]
|
|
8432
|
+
}) : null,
|
|
8433
|
+
online.note ? /* @__PURE__ */ jsx("p", {
|
|
8434
|
+
className: "rb-caption",
|
|
8435
|
+
children: online.note
|
|
8436
|
+
}) : null
|
|
8437
|
+
]
|
|
8438
|
+
});
|
|
8439
|
+
}
|
|
8440
|
+
/** An online event says so where a venue would go; a hybrid one adds it under the venue. */
|
|
8441
|
+
function EventVenueFact({ venue, online, addressAfterBooking }) {
|
|
8442
|
+
if (!venue) return /* @__PURE__ */ jsx(EventPlaceWithoutVenue, {
|
|
8443
|
+
online,
|
|
8444
|
+
addressAfterBooking
|
|
8445
|
+
});
|
|
8386
8446
|
const { place, addressWithBooking } = eventVenuePlace(venue);
|
|
8387
8447
|
return /* @__PURE__ */ jsxs("div", {
|
|
8388
8448
|
className: "rb-mt-6",
|
|
@@ -8402,7 +8462,11 @@ function EventVenueFact({ venue }) {
|
|
|
8402
8462
|
}) : /* @__PURE__ */ jsx(LocationMapActions, {
|
|
8403
8463
|
location: venue.location,
|
|
8404
8464
|
addressText: venue.address
|
|
8405
|
-
})
|
|
8465
|
+
}),
|
|
8466
|
+
online ? /* @__PURE__ */ jsxs("p", {
|
|
8467
|
+
className: "rb-caption rb-mt-1",
|
|
8468
|
+
children: ["You can also join online.", online.note ? ` ${online.note}` : ""]
|
|
8469
|
+
}) : null
|
|
8406
8470
|
]
|
|
8407
8471
|
});
|
|
8408
8472
|
}
|
|
@@ -8554,21 +8618,28 @@ function EventVenueMap({ venue, drawing, showMap, mapHeight, mapClassName }) {
|
|
|
8554
8618
|
}
|
|
8555
8619
|
/** One pricing projection governs the selected panel, including drop-in and whole-series behavior. */
|
|
8556
8620
|
function selectedEventPricing(event, showCost) {
|
|
8557
|
-
const isDropIn = event
|
|
8558
|
-
const wholeSeriesPricing = event
|
|
8559
|
-
const showEventCost = showCost &&
|
|
8621
|
+
const isDropIn = isDropInEvent(event);
|
|
8622
|
+
const wholeSeriesPricing = wholeSeriesPricingOf(event);
|
|
8623
|
+
const showEventCost = showCost && !isDropIn && wholeSeriesPricing === null;
|
|
8560
8624
|
return {
|
|
8561
8625
|
isDropIn,
|
|
8562
8626
|
wholeSeriesPricingDisplay: showCost ? wholeSeriesPricing : null,
|
|
8563
8627
|
eventCostLabel: showEventCost ? formatEventPrice(event) : null,
|
|
8628
|
+
depositNote: showCost && !isDropIn ? paidDepositNote(event) : null,
|
|
8564
8629
|
eventPricingCurrency: publicEventPricingCurrency(event.pricing),
|
|
8565
|
-
ticketTypes: showEventCost ? getDisplayablePricingOptions(event) : []
|
|
8630
|
+
ticketTypes: showEventCost && isPaid(event) ? getDisplayablePricingOptions(event) : []
|
|
8566
8631
|
};
|
|
8567
8632
|
}
|
|
8633
|
+
const isDropInEvent = (event) => event.bookingScope === "single_occurrence" && event.requiresRegistration === false;
|
|
8634
|
+
const wholeSeriesPricingOf = (event) => event.bookingScope === "whole_series" && event.pricing.kind !== "external" ? event.pricing : null;
|
|
8635
|
+
const isPaid = (event) => publicEventPricingType(event.pricing) !== "free";
|
|
8636
|
+
const paidDepositNote = (event) => isPaid(event) ? formatEventDepositNote(event.pricing, event.paymentTerms, event) : null;
|
|
8568
8637
|
function SelectedEventDetailsView(props) {
|
|
8569
8638
|
const { selection, showVenue, showMap, showOtherDates, showTitle, showDescription, showCapacity, mapHeight, mapClassName, acceptedItems } = props;
|
|
8570
8639
|
const selected = selection.selected;
|
|
8571
8640
|
const venue = showVenue ? selected.venue : void 0;
|
|
8641
|
+
const online = eventOnlinePlaceShown(selected, showVenue);
|
|
8642
|
+
const addressAfterBooking = addressAfterBookingShown(selected, showVenue);
|
|
8572
8643
|
const pricing = selectedEventPricing(selected, props.showCost);
|
|
8573
8644
|
return /* @__PURE__ */ jsxs("div", {
|
|
8574
8645
|
className: "rb-flex rb-flex-col rb-gap-6 rb-text-left",
|
|
@@ -8586,6 +8657,8 @@ function SelectedEventDetailsView(props) {
|
|
|
8586
8657
|
selection,
|
|
8587
8658
|
selected,
|
|
8588
8659
|
venue,
|
|
8660
|
+
online,
|
|
8661
|
+
addressAfterBooking,
|
|
8589
8662
|
showCapacity,
|
|
8590
8663
|
teamMembers: selected.teamMembers ?? [],
|
|
8591
8664
|
pricing: /* @__PURE__ */ jsx(EventPricingDetails, {
|
|
@@ -8678,11 +8751,15 @@ function EventHeaderPanel(props) {
|
|
|
8678
8751
|
})
|
|
8679
8752
|
});
|
|
8680
8753
|
}
|
|
8681
|
-
function HeaderPanelFacts({ venue, teamMembers, pricing }) {
|
|
8754
|
+
function HeaderPanelFacts({ venue, online, addressAfterBooking, teamMembers, pricing }) {
|
|
8682
8755
|
return /* @__PURE__ */ jsxs("div", {
|
|
8683
8756
|
className: "rb-flex rb-flex-col rb-gap-4",
|
|
8684
8757
|
children: [
|
|
8685
|
-
/* @__PURE__ */ jsx(EventVenueFact, {
|
|
8758
|
+
/* @__PURE__ */ jsx(EventVenueFact, {
|
|
8759
|
+
venue,
|
|
8760
|
+
online,
|
|
8761
|
+
addressAfterBooking
|
|
8762
|
+
}),
|
|
8686
8763
|
/* @__PURE__ */ jsx(EventTeacherFacts, { teamMembers }),
|
|
8687
8764
|
pricing ? /* @__PURE__ */ jsx(EventPricingDetails, { ...pricing }) : null
|
|
8688
8765
|
]
|
|
@@ -8692,15 +8769,18 @@ function HeaderPanelFacts({ venue, teamMembers, pricing }) {
|
|
|
8692
8769
|
function headerPanelContent(props) {
|
|
8693
8770
|
const { selection } = props;
|
|
8694
8771
|
const venue = props.showVenue ? selection.selected.venue : void 0;
|
|
8772
|
+
const online = eventOnlinePlaceShown(selection.selected, props.showVenue);
|
|
8695
8773
|
const teamMembers = selection.selected.teamMembers ?? [];
|
|
8696
8774
|
const pricing = headerPanelPricing(props, selection.selected);
|
|
8697
8775
|
const scheduled = selection.kind === "wholeSeries" ? selection.sessions.length : selection.otherDates.length;
|
|
8698
8776
|
return {
|
|
8699
8777
|
venue,
|
|
8778
|
+
online,
|
|
8779
|
+
addressAfterBooking: addressAfterBookingShown(selection.selected, props.showVenue),
|
|
8700
8780
|
teamMembers,
|
|
8701
8781
|
pricing,
|
|
8702
8782
|
hasMap: Boolean(props.showMap && venue && props.selectedVenueDrawing),
|
|
8703
|
-
hasFacts:
|
|
8783
|
+
hasFacts: hasEventPlaceFact(selection.selected, props.showVenue) || teamMembers.length > 0 || pricing !== null,
|
|
8704
8784
|
hasDates: props.showOtherDates && scheduled > 0
|
|
8705
8785
|
};
|
|
8706
8786
|
}
|
|
@@ -8714,6 +8794,7 @@ function headerPanelPricing(props, event) {
|
|
|
8714
8794
|
if (pricing.isDropIn) return null;
|
|
8715
8795
|
const detail = {
|
|
8716
8796
|
...pricing,
|
|
8797
|
+
depositNote: null,
|
|
8717
8798
|
acceptedItems: acceptedProductNames(props),
|
|
8718
8799
|
autoApplyDiscount: props.autoApplyDiscount ?? null
|
|
8719
8800
|
};
|
|
@@ -10673,120 +10754,168 @@ function CheckoutSSR({ blockId, siteId, apiBaseUrl, stage, demoEmailSuppressed,
|
|
|
10673
10754
|
});
|
|
10674
10755
|
}
|
|
10675
10756
|
//#endregion
|
|
10757
|
+
//#region ../blocks/src/system/runtime/nodes/gifting.parts.tsx
|
|
10758
|
+
const CUSTOM_GIFT_AMOUNT = "custom";
|
|
10759
|
+
/** A Look's hook (and, for the panel, its surface) on one part of the gifting panel; nothing outside a Look. */
|
|
10760
|
+
function giftingSlot(look, slot) {
|
|
10761
|
+
return listLookSlot(look ?? {}, slot);
|
|
10762
|
+
}
|
|
10763
|
+
/** The word above the heading: only one kind on offer names it here, two kinds label their own groups. */
|
|
10764
|
+
function giftingEyebrow(offers, headings) {
|
|
10765
|
+
const giftCards = offers?.giftCards.length ?? 0;
|
|
10766
|
+
const vouchers = offers?.vouchers.length ?? 0;
|
|
10767
|
+
if (giftCards > 0 && vouchers === 0) return headings.giftCards;
|
|
10768
|
+
if (vouchers > 0 && giftCards === 0) return headings.vouchers;
|
|
10769
|
+
return null;
|
|
10770
|
+
}
|
|
10771
|
+
function GiftingPanelHead(props) {
|
|
10772
|
+
const { look } = props;
|
|
10773
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
10774
|
+
className: "gifting-panel-head",
|
|
10775
|
+
...giftingSlot(look, "head"),
|
|
10776
|
+
children: [
|
|
10777
|
+
props.eyebrow ? /* @__PURE__ */ jsx("span", {
|
|
10778
|
+
className: "gifting-eyebrow",
|
|
10779
|
+
...giftingSlot(look, "eyebrow"),
|
|
10780
|
+
children: props.eyebrow
|
|
10781
|
+
}) : null,
|
|
10782
|
+
/* @__PURE__ */ jsx("h2", {
|
|
10783
|
+
className: "gifting-heading",
|
|
10784
|
+
...giftingSlot(look, "heading"),
|
|
10785
|
+
children: props.heading
|
|
10786
|
+
}),
|
|
10787
|
+
props.intro ? /* @__PURE__ */ jsx("p", {
|
|
10788
|
+
className: "gifting-intro",
|
|
10789
|
+
...giftingSlot(look, "intro"),
|
|
10790
|
+
children: props.intro
|
|
10791
|
+
}) : null
|
|
10792
|
+
]
|
|
10793
|
+
});
|
|
10794
|
+
}
|
|
10795
|
+
/** Amount buttons are radios, so they keep working from the keyboard and post with the form. */
|
|
10796
|
+
function GiftCardAmounts(props) {
|
|
10797
|
+
const { offer, currency, disabled, onChoose } = props;
|
|
10798
|
+
const denominations = offer.giftCard.fixedDenominations;
|
|
10799
|
+
const checkedChoice = props.initialChoice ?? firstGiftAmountChoice(offer);
|
|
10800
|
+
const chip = (value, label) => /* @__PURE__ */ jsxs("label", {
|
|
10801
|
+
className: "gifting-amount",
|
|
10802
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
10803
|
+
type: "radio",
|
|
10804
|
+
name: props.groupName ?? "amountChoice",
|
|
10805
|
+
value,
|
|
10806
|
+
required: true,
|
|
10807
|
+
disabled,
|
|
10808
|
+
defaultChecked: value === checkedChoice,
|
|
10809
|
+
onChange: onChoose ? () => onChoose(value) : void 0
|
|
10810
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
10811
|
+
...giftingSlot(props.look, "chip"),
|
|
10812
|
+
children: label
|
|
10813
|
+
})]
|
|
10814
|
+
}, value);
|
|
10815
|
+
return /* @__PURE__ */ jsxs("fieldset", {
|
|
10816
|
+
className: "gifting-amounts",
|
|
10817
|
+
...giftingSlot(props.look, "chips"),
|
|
10818
|
+
children: [
|
|
10819
|
+
/* @__PURE__ */ jsx("legend", {
|
|
10820
|
+
className: "gifting-visually-hidden",
|
|
10821
|
+
children: "Amount"
|
|
10822
|
+
}),
|
|
10823
|
+
denominations.map((amount) => chip(String(amount), formatCurrencyAmount(amount, currency))),
|
|
10824
|
+
offer.giftCard.customAmountEnabled ? chip(CUSTOM_GIFT_AMOUNT, "Another amount") : null
|
|
10825
|
+
]
|
|
10826
|
+
});
|
|
10827
|
+
}
|
|
10828
|
+
function firstGiftAmountChoice(offer) {
|
|
10829
|
+
const first = offer.giftCard.fixedDenominations[0];
|
|
10830
|
+
return first === void 0 ? CUSTOM_GIFT_AMOUNT : String(first);
|
|
10831
|
+
}
|
|
10832
|
+
//#endregion
|
|
10676
10833
|
//#region ../blocks/src/system/runtime/nodes/gifting.server.tsx
|
|
10834
|
+
/** What shows until the island takes over: the same panel, with the details form still closed. */
|
|
10677
10835
|
function GiftingSSR({ blockId, ...rest }) {
|
|
10678
10836
|
const islandProps = buildGiftingInteractiveIslandProps(rest);
|
|
10679
|
-
const
|
|
10680
|
-
const
|
|
10837
|
+
const { display, hydration } = islandProps.render;
|
|
10838
|
+
const offers = hydration.offers;
|
|
10839
|
+
const giftCards = offers?.giftCards ?? [];
|
|
10840
|
+
const vouchers = offers?.vouchers ?? [];
|
|
10841
|
+
const hasOffers = giftCards.length > 0 || vouchers.length > 0;
|
|
10842
|
+
const eyebrow = giftingEyebrow(offers, {
|
|
10843
|
+
giftCards: display.giftCardsHeading,
|
|
10844
|
+
vouchers: display.vouchersHeading
|
|
10845
|
+
});
|
|
10681
10846
|
return /* @__PURE__ */ jsx(IslandRoot, {
|
|
10682
10847
|
kind: "gifting",
|
|
10683
10848
|
id: blockId,
|
|
10684
10849
|
as: "section",
|
|
10685
10850
|
attributes: {
|
|
10686
10851
|
className: rest.className ?? void 0,
|
|
10687
|
-
"data-block": "gifting"
|
|
10688
|
-
style: { color: "rgb(var(--tb-text, 17 24 39))" }
|
|
10852
|
+
"data-block": "gifting"
|
|
10689
10853
|
},
|
|
10690
10854
|
value: islandProps,
|
|
10691
10855
|
children: /* @__PURE__ */ jsxs("div", {
|
|
10692
|
-
className: "
|
|
10693
|
-
|
|
10694
|
-
children: [/* @__PURE__ */
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
fontSize: "clamp(1.75rem, 3vw, 2.5rem)",
|
|
10700
|
-
fontWeight: 700,
|
|
10701
|
-
margin: 0
|
|
10702
|
-
},
|
|
10703
|
-
children: islandProps.render.display.heading
|
|
10704
|
-
}), islandProps.render.display.intro ? /* @__PURE__ */ jsx("p", {
|
|
10705
|
-
style: {
|
|
10706
|
-
margin: 0,
|
|
10707
|
-
color: "rgb(var(--tb-text, 17 24 39) / 0.72)"
|
|
10708
|
-
},
|
|
10709
|
-
children: islandProps.render.display.intro
|
|
10710
|
-
}) : null]
|
|
10856
|
+
className: "gifting-panel",
|
|
10857
|
+
...giftingSlot(display, "panel"),
|
|
10858
|
+
children: [/* @__PURE__ */ jsx(GiftingPanelHead, {
|
|
10859
|
+
eyebrow,
|
|
10860
|
+
heading: display.heading,
|
|
10861
|
+
intro: display.intro,
|
|
10862
|
+
look: display
|
|
10711
10863
|
}), hasOffers ? /* @__PURE__ */ jsxs("div", {
|
|
10712
|
-
className: "
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10724
|
-
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
|
|
10733
|
-
},
|
|
10734
|
-
|
|
10735
|
-
|
|
10736
|
-
|
|
10737
|
-
|
|
10738
|
-
|
|
10739
|
-
|
|
10740
|
-
|
|
10741
|
-
|
|
10742
|
-
|
|
10743
|
-
|
|
10744
|
-
|
|
10745
|
-
|
|
10746
|
-
|
|
10747
|
-
|
|
10748
|
-
|
|
10749
|
-
|
|
10750
|
-
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
|
|
10754
|
-
|
|
10755
|
-
|
|
10756
|
-
|
|
10757
|
-
|
|
10758
|
-
|
|
10759
|
-
|
|
10760
|
-
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
|
|
10764
|
-
style: {
|
|
10765
|
-
border: "1px solid rgb(var(--tb-text, 17 24 39) / 0.12)",
|
|
10766
|
-
borderRadius: "1rem",
|
|
10767
|
-
padding: "1rem",
|
|
10768
|
-
background: "rgb(var(--tb-surface, 255 255 255) / 0.92)"
|
|
10769
|
-
},
|
|
10770
|
-
children: [/* @__PURE__ */ jsx("h4", {
|
|
10771
|
-
style: {
|
|
10772
|
-
margin: 0,
|
|
10773
|
-
fontSize: "1.05rem",
|
|
10774
|
-
fontWeight: 700
|
|
10775
|
-
},
|
|
10776
|
-
children: offer.title
|
|
10777
|
-
}), offer.description ? /* @__PURE__ */ jsx("p", {
|
|
10778
|
-
style: {
|
|
10779
|
-
margin: "0.5rem 0 0",
|
|
10780
|
-
color: "rgb(var(--tb-text, 17 24 39) / 0.72)"
|
|
10781
|
-
},
|
|
10782
|
-
children: offer.description
|
|
10783
|
-
}) : null]
|
|
10784
|
-
}, offer.id))
|
|
10785
|
-
})]
|
|
10786
|
-
}) : null]
|
|
10864
|
+
className: "gifting-panel-offers",
|
|
10865
|
+
children: [giftCards.map((offer) => /* @__PURE__ */ jsxs("div", {
|
|
10866
|
+
className: "gifting-offer",
|
|
10867
|
+
"data-gift-offer": offer.id,
|
|
10868
|
+
children: [
|
|
10869
|
+
giftCards.length > 1 ? /* @__PURE__ */ jsx("h3", {
|
|
10870
|
+
className: "gifting-offer-title",
|
|
10871
|
+
children: offer.title
|
|
10872
|
+
}) : null,
|
|
10873
|
+
offer.description ? /* @__PURE__ */ jsx("p", {
|
|
10874
|
+
className: "gifting-offer-description",
|
|
10875
|
+
children: offer.description
|
|
10876
|
+
}) : null,
|
|
10877
|
+
/* @__PURE__ */ jsxs("div", {
|
|
10878
|
+
className: "gifting-offer-row",
|
|
10879
|
+
"data-gift-offer-row": "",
|
|
10880
|
+
children: [/* @__PURE__ */ jsx(GiftCardAmounts, {
|
|
10881
|
+
offer,
|
|
10882
|
+
currency: offers?.currency ?? "GBP",
|
|
10883
|
+
groupName: `amountChoice-${offer.id}`,
|
|
10884
|
+
look: display
|
|
10885
|
+
}), /* @__PURE__ */ jsx(ThemedButton, {
|
|
10886
|
+
...giftingSlot(display, "action"),
|
|
10887
|
+
type: "button",
|
|
10888
|
+
variant: "primary",
|
|
10889
|
+
size: "md",
|
|
10890
|
+
extraClassName: "gifting-buy",
|
|
10891
|
+
label: "Buy a gift card"
|
|
10892
|
+
})]
|
|
10893
|
+
})
|
|
10894
|
+
]
|
|
10895
|
+
}, offer.id)), vouchers.map((offer) => /* @__PURE__ */ jsxs("div", {
|
|
10896
|
+
className: "gifting-offer",
|
|
10897
|
+
children: [
|
|
10898
|
+
/* @__PURE__ */ jsx("h3", {
|
|
10899
|
+
className: "gifting-offer-title",
|
|
10900
|
+
children: offer.title
|
|
10901
|
+
}),
|
|
10902
|
+
offer.description ? /* @__PURE__ */ jsx("p", {
|
|
10903
|
+
className: "gifting-offer-description",
|
|
10904
|
+
children: offer.description
|
|
10905
|
+
}) : null,
|
|
10906
|
+
/* @__PURE__ */ jsx(ThemedButton, {
|
|
10907
|
+
...giftingSlot(display, "action"),
|
|
10908
|
+
type: "button",
|
|
10909
|
+
variant: "primary",
|
|
10910
|
+
size: "md",
|
|
10911
|
+
extraClassName: "gifting-buy",
|
|
10912
|
+
label: "Buy this voucher"
|
|
10913
|
+
})
|
|
10914
|
+
]
|
|
10915
|
+
}, offer.id))]
|
|
10787
10916
|
}) : /* @__PURE__ */ jsx("p", {
|
|
10788
|
-
|
|
10789
|
-
children:
|
|
10917
|
+
className: "gifting-empty",
|
|
10918
|
+
children: display.emptyStateText
|
|
10790
10919
|
})]
|
|
10791
10920
|
})
|
|
10792
10921
|
});
|
|
@@ -10912,6 +11041,7 @@ function AgendaModalCard({ event, showCapacity, calendarTimeZone, onClick }) {
|
|
|
10912
11041
|
const capacity = showCapacity ? formatEventRemainingPlaces(event) : null;
|
|
10913
11042
|
const isFull = isEventFull(event);
|
|
10914
11043
|
const teacherLine = formatEventTeacherLine(event);
|
|
11044
|
+
const placeName = eventPlaceName(event);
|
|
10915
11045
|
const timeZone = resolveEventTimeZone(event, calendarTimeZone);
|
|
10916
11046
|
return /* @__PURE__ */ jsxs("button", {
|
|
10917
11047
|
type: "button",
|
|
@@ -10938,9 +11068,9 @@ function AgendaModalCard({ event, showCapacity, calendarTimeZone, onClick }) {
|
|
|
10938
11068
|
}), /* @__PURE__ */ jsxs("div", {
|
|
10939
11069
|
className: "event-agenda-card-details status-muted",
|
|
10940
11070
|
children: [
|
|
10941
|
-
|
|
11071
|
+
placeName && /* @__PURE__ */ jsxs("span", {
|
|
10942
11072
|
className: "event-agenda-card-venue",
|
|
10943
|
-
children: [/* @__PURE__ */ jsx(LocationIcon, {}),
|
|
11073
|
+
children: [/* @__PURE__ */ jsx(LocationIcon, {}), placeName]
|
|
10944
11074
|
}),
|
|
10945
11075
|
teacherLine && /* @__PURE__ */ jsx("span", {
|
|
10946
11076
|
className: "event-agenda-card-teacher",
|
|
@@ -11120,6 +11250,10 @@ const WeekAgendaView = ({ days, events, showCapacity, showVenue = true, emptyMes
|
|
|
11120
11250
|
});
|
|
11121
11251
|
};
|
|
11122
11252
|
//#endregion
|
|
11253
|
+
//#region ../blocks/src/system/runtime/nodes/events/shared/CalendarLoadFailure.tsx
|
|
11254
|
+
/** The same words on the calendar and the week board. */
|
|
11255
|
+
const CALENDAR_LOAD_FAILURE_MESSAGE = "We couldn’t load the events for these dates.";
|
|
11256
|
+
//#endregion
|
|
11123
11257
|
//#region ../blocks/src/system/runtime/nodes/events/shared/CalendarNavigationChevron.tsx
|
|
11124
11258
|
function CalendarNavigationChevron({ direction }) {
|
|
11125
11259
|
return /* @__PURE__ */ jsx("svg", {
|
|
@@ -11281,7 +11415,7 @@ const WeekBoardLoadError = ({ navigation, buttonVariant }) => {
|
|
|
11281
11415
|
return /* @__PURE__ */ jsxs("div", {
|
|
11282
11416
|
className: "event-week-board-error",
|
|
11283
11417
|
role: "status",
|
|
11284
|
-
children: [/* @__PURE__ */ jsx("p", { children:
|
|
11418
|
+
children: [/* @__PURE__ */ jsx("p", { children: CALENDAR_LOAD_FAILURE_MESSAGE }), /* @__PURE__ */ jsx(ThemedButton, {
|
|
11285
11419
|
type: "button",
|
|
11286
11420
|
variant: buttonVariant,
|
|
11287
11421
|
size: "sm",
|
|
@@ -11889,6 +12023,16 @@ function EventBookingPanelView({ panel, pageKind, children }) {
|
|
|
11889
12023
|
function EventBookingPanelBody({ panel }) {
|
|
11890
12024
|
switch (panel.kind) {
|
|
11891
12025
|
case "registration": return null;
|
|
12026
|
+
case "cancelled": return /* @__PURE__ */ jsxs("div", {
|
|
12027
|
+
className: "event-booking-panel__cancelled",
|
|
12028
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
12029
|
+
className: "card-title rb-mb-3",
|
|
12030
|
+
children: cancelledDateCopy.titleText
|
|
12031
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
12032
|
+
className: "status-muted rb-text-base rb-leading-relaxed",
|
|
12033
|
+
children: cancelledDateCopy.bodyText
|
|
12034
|
+
})]
|
|
12035
|
+
});
|
|
11892
12036
|
case "dropIn": return /* @__PURE__ */ jsx(DropInPanel, { panel: panel.panel });
|
|
11893
12037
|
case "bookingClosed": return /* @__PURE__ */ jsx(BookingClosedPanel, { detail: panel.detail });
|
|
11894
12038
|
case "closedRun": return /* @__PURE__ */ jsx(ClosedRunPanel, { reason: panel.reason });
|
|
@@ -11908,6 +12052,7 @@ function EventBookingPanelBody({ panel }) {
|
|
|
11908
12052
|
}
|
|
11909
12053
|
function SingleDateBooking({ run }) {
|
|
11910
12054
|
const href = getPublicEventCanonicalPath(run.representative);
|
|
12055
|
+
const coversAll = wholeCourseNote(run);
|
|
11911
12056
|
return /* @__PURE__ */ jsxs("div", {
|
|
11912
12057
|
className: "event-booking-panel__single-date",
|
|
11913
12058
|
children: [
|
|
@@ -11915,9 +12060,9 @@ function SingleDateBooking({ run }) {
|
|
|
11915
12060
|
className: "card-title rb-mb-3",
|
|
11916
12061
|
children: "Book your place"
|
|
11917
12062
|
}),
|
|
11918
|
-
/* @__PURE__ */
|
|
12063
|
+
/* @__PURE__ */ jsxs("p", {
|
|
11919
12064
|
className: "event-booking-panel__run-dates status-muted rb-mb-4 rb-text-base rb-leading-relaxed",
|
|
11920
|
-
children: describeRun(run)
|
|
12065
|
+
children: [describeRun(run), coversAll ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("br", {}), coversAll] }) : null]
|
|
11921
12066
|
}),
|
|
11922
12067
|
href ? /* @__PURE__ */ jsx(ThemedButtonLink, {
|
|
11923
12068
|
variant: "primary",
|
|
@@ -12011,11 +12156,11 @@ function RunChooser({ runs }) {
|
|
|
12011
12156
|
})]
|
|
12012
12157
|
});
|
|
12013
12158
|
}
|
|
12014
|
-
/** "12 sessions from 5 March" — enough to tell two runs apart in a list. */
|
|
12159
|
+
/** "12 sessions from 5 March" — enough to tell two runs apart in a list. Cancelled sessions aren't counted. */
|
|
12015
12160
|
function describeRun(run) {
|
|
12016
|
-
const
|
|
12017
|
-
const
|
|
12018
|
-
const
|
|
12161
|
+
const sessions = orderedLiveRunSessions(run.run.sessions);
|
|
12162
|
+
const first = sessions[0];
|
|
12163
|
+
const sessionLabel = sessionCountLabel(sessions.length);
|
|
12019
12164
|
if (!first) return sessionLabel;
|
|
12020
12165
|
return `${sessionLabel} from ${formatDate$1({
|
|
12021
12166
|
kind: "instant",
|
|
@@ -12028,6 +12173,12 @@ function describeRun(run) {
|
|
|
12028
12173
|
weekday: "long"
|
|
12029
12174
|
})}`;
|
|
12030
12175
|
}
|
|
12176
|
+
const sessionCountLabel = (count) => count === 1 ? "1 session" : `${count} sessions`;
|
|
12177
|
+
/** Said before booking, as the first step of booking says it: one place covers the whole course. */
|
|
12178
|
+
function wholeCourseNote(run) {
|
|
12179
|
+
const count = orderedLiveRunSessions(run.run.sessions).length;
|
|
12180
|
+
return count > 1 ? `One booking covers all ${count} sessions.` : null;
|
|
12181
|
+
}
|
|
12031
12182
|
//#endregion
|
|
12032
12183
|
//#region ../blocks/src/system/runtime/nodes/event-registration/bookingPanelSelection.ts
|
|
12033
12184
|
/** Adapt a loaded page surface to the existing page planners. Catalogues keep their picker. */
|
|
@@ -12086,6 +12237,10 @@ function selectOccurrenceForPanel(events, occurrenceId) {
|
|
|
12086
12237
|
} : null;
|
|
12087
12238
|
}
|
|
12088
12239
|
function planEventBookingPanel({ selection, subject }, now) {
|
|
12240
|
+
if (isCancelledDateSelection(selection)) return {
|
|
12241
|
+
kind: "cancelled",
|
|
12242
|
+
registration: null
|
|
12243
|
+
};
|
|
12089
12244
|
const nonBookingPanel = planNonBookingPanel(selection);
|
|
12090
12245
|
switch (selection.kind) {
|
|
12091
12246
|
case "occurrence":
|
|
@@ -12161,6 +12316,10 @@ function selectionRegistrationTarget(selection, subject) {
|
|
|
12161
12316
|
};
|
|
12162
12317
|
}
|
|
12163
12318
|
}
|
|
12319
|
+
/** Cancelled dates have no new-booking or recovery form, including old direct links. */
|
|
12320
|
+
function isCancelledDateSelection(selection) {
|
|
12321
|
+
return selection.kind === "occurrence" && hasCancelledRegistrationDate([selection.event]);
|
|
12322
|
+
}
|
|
12164
12323
|
//#endregion
|
|
12165
12324
|
//#region ../blocks/src/system/runtime/nodes/event-registration/RegistrationClosedState.tsx
|
|
12166
12325
|
function RegistrationClosedState({ title, body }) {
|
|
@@ -12955,14 +13114,14 @@ function NewsletterSubmitRow({ emailField, lookSlots, buttonVariant, buttonLabel
|
|
|
12955
13114
|
});
|
|
12956
13115
|
}
|
|
12957
13116
|
/** Visitor-chosen topics as toggle chips. Real checkboxes underneath. */
|
|
12958
|
-
function NewsletterTopicChips({ choices, disabled, error }) {
|
|
13117
|
+
function NewsletterTopicChips({ choices, question, disabled, error }) {
|
|
12959
13118
|
const errorId = `newsletter_${TOPIC_CHOICE_FIELD_ID}-error`;
|
|
12960
13119
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("fieldset", {
|
|
12961
13120
|
className: "newsletter-topics",
|
|
12962
13121
|
"aria-describedby": error ? errorId : void 0,
|
|
12963
13122
|
children: [/* @__PURE__ */ jsx("legend", {
|
|
12964
13123
|
className: "newsletter-topics-legend",
|
|
12965
|
-
children:
|
|
13124
|
+
children: question
|
|
12966
13125
|
}), /* @__PURE__ */ jsx("div", {
|
|
12967
13126
|
className: "newsletter-topic-chips",
|
|
12968
13127
|
children: choices.map((choice) => /* @__PURE__ */ jsxs("label", {
|
|
@@ -13035,7 +13194,10 @@ function NewsletterFormSSR(props) {
|
|
|
13035
13194
|
className: "newsletter-form-fields",
|
|
13036
13195
|
...listLookSlot(display, "grid"),
|
|
13037
13196
|
children: [
|
|
13038
|
-
islandProps.render.hydration.choicePresentation === "visitor_choice" ? /* @__PURE__ */ jsx(NewsletterTopicChips, {
|
|
13197
|
+
islandProps.render.hydration.choicePresentation === "visitor_choice" ? /* @__PURE__ */ jsx(NewsletterTopicChips, {
|
|
13198
|
+
choices: display.choices,
|
|
13199
|
+
question: display.topicsQuestion
|
|
13200
|
+
}) : null,
|
|
13039
13201
|
extraFields.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
13040
13202
|
className: "newsletter-extra-fields",
|
|
13041
13203
|
...listLookSlot(display, "items"),
|
|
@@ -14331,8 +14493,10 @@ function bindItemSurfacePresentation(node, context) {
|
|
|
14331
14493
|
if (!isPlainObject(content) || !isPlainObject(content._effectiveLook)) return context;
|
|
14332
14494
|
const look = content._effectiveLook;
|
|
14333
14495
|
if (!look.surfacePresentation) return context;
|
|
14334
|
-
const
|
|
14335
|
-
const
|
|
14496
|
+
const itemScope = context.scopes.reduce((found, scope) => scope.repeater ? scope : found, void 0);
|
|
14497
|
+
const repeater = itemScope?.repeater;
|
|
14498
|
+
const featured = isPlainObject(itemScope?.value) && itemScope.value.featured === true;
|
|
14499
|
+
const role = repeater ? itemRole(repeater.index, repeater.count, look.itemRoles, featured) : void 0;
|
|
14336
14500
|
return {
|
|
14337
14501
|
...context,
|
|
14338
14502
|
surfacePresentation: selectItemSurfacePresentation(look.surfacePresentation, role)
|
|
@@ -14837,6 +15001,11 @@ function authoringMessage(reason) {
|
|
|
14837
15001
|
case "missing-layout": return reason.isCustom ? `No renderer available for block kind "${reason.blockKind}". This custom block has no layout/variants, so it must be rendered via blockOverrides["${reason.blockKind}"].` : `No renderer available for block kind "${reason.blockKind}".`;
|
|
14838
15002
|
case "hidden-business-location": return "This map is hidden because your business address is hidden.";
|
|
14839
15003
|
case "unresolved-location":
|
|
15004
|
+
if (reason.locationReason === "location_loading" || reason.locationReason === "location_load_failed") return describeUnresolvedLocationMapLocation({
|
|
15005
|
+
kind: "unresolved",
|
|
15006
|
+
source: reason.source,
|
|
15007
|
+
reason: reason.locationReason
|
|
15008
|
+
}) ?? "";
|
|
14840
15009
|
if (reason.source === "business_address") return "Business address details are not configured yet.";
|
|
14841
15010
|
return reason.source === "venue" ? "This map is hidden on your site until the venue has a location." : "This map is hidden on your site until you choose a place.";
|
|
14842
15011
|
case "editor-unpreviewable":
|
|
@@ -15016,11 +15185,7 @@ function buildPageRendererRootRuntime(dataContext) {
|
|
|
15016
15185
|
};
|
|
15017
15186
|
}
|
|
15018
15187
|
function publicLocationRuntime(context) {
|
|
15019
|
-
return {
|
|
15020
|
-
businessAddress: context?.businessLocation ?? null,
|
|
15021
|
-
venuesById: context?.venuesById ?? {},
|
|
15022
|
-
siteCountry: context?.siteCountry ?? null
|
|
15023
|
-
};
|
|
15188
|
+
return { siteCountry: context?.siteCountry ?? null };
|
|
15024
15189
|
}
|
|
15025
15190
|
function resolveDemoEmailSuppression(dataContext) {
|
|
15026
15191
|
return dataContext?.demoEmailSuppressed === true;
|
|
@@ -15450,11 +15615,10 @@ function createPageRenderPreparationReader() {
|
|
|
15450
15615
|
};
|
|
15451
15616
|
}
|
|
15452
15617
|
function preparePageRenderEntries(input, previous = null) {
|
|
15453
|
-
const
|
|
15454
|
-
const prepared = admission.entries.map((entry) => [entry, readPreparedPlanEntry(entry, input, previous, admission.permission)]);
|
|
15618
|
+
const prepared = preparationAdmission(input).entries.map((entry) => [entry, readPreparedPlanEntry(entry, input, previous)]);
|
|
15455
15619
|
const entries = prepared.map(([, value]) => value);
|
|
15456
15620
|
const constructionFailures = entries.filter((candidate) => candidate.prepared.kind === "render-threw").map((candidate) => candidate.entry);
|
|
15457
|
-
const survivors = input.audience === "authoring" ? entries : entries.filter((candidate) => candidate.prepared.kind !== "render-threw" && candidate.prepared.kind !== "unresolved-location" && !(candidate.prepared.kind === "content" && candidate.prepared.publicVisibility === "omitted"));
|
|
15621
|
+
const survivors = input.audience === "authoring" ? entries : entries.filter((candidate) => candidate.prepared.kind !== "render-threw" && candidate.prepared.kind !== "unresolved-location" && candidate.prepared.kind !== "hidden-business-location" && !(candidate.prepared.kind === "content" && candidate.prepared.publicVisibility === "omitted"));
|
|
15458
15622
|
const surviving = new Set(survivors);
|
|
15459
15623
|
const survivingByEntry = new Map(prepared.filter(([, candidate]) => surviving.has(candidate)));
|
|
15460
15624
|
const regions = {
|
|
@@ -15487,47 +15651,61 @@ function preparationAdmission(input) {
|
|
|
15487
15651
|
mailingList: input.dataContext?.mailingList,
|
|
15488
15652
|
template: input.dataContext?.template ?? pageTemplateFromEntry(input.dataContext?.contentEntry)
|
|
15489
15653
|
});
|
|
15490
|
-
|
|
15491
|
-
return {
|
|
15492
|
-
permission,
|
|
15493
|
-
entries: input.plan.entries.filter((entry) => input.audience === "authoring" || !entryHiddenFromVisitors(entry, facts, input.dataContext?.interactionContext)).filter((entry) => isPublicSourcePermitted(entry, permission) || input.audience === "authoring" && permission.kind === "hidden")
|
|
15494
|
-
};
|
|
15654
|
+
return { entries: input.plan.entries.filter((entry) => input.audience === "authoring" || !entryHiddenFromVisitors(entry, facts, input.dataContext?.interactionContext)) };
|
|
15495
15655
|
}
|
|
15496
|
-
function readPreparedPlanEntry(entry, input, previous
|
|
15656
|
+
function readPreparedPlanEntry(entry, input, previous) {
|
|
15497
15657
|
const cached = previous?.byEntry.get(entry);
|
|
15498
15658
|
if (cached && previous && samePreparationSettings(previous.input, input) && sameBlockRenderDataContext(previous.input.dataContext, input.dataContext, entry.block.id)) return cached;
|
|
15499
|
-
return preparedPlanEntry(entry, prepareSourceEntry(entry, input
|
|
15659
|
+
return preparedPlanEntry(entry, prepareSourceEntry(entry, input));
|
|
15500
15660
|
}
|
|
15501
15661
|
function samePreparationSettings(previous, current) {
|
|
15502
15662
|
return previous.audience === current.audience && previous.routeMap === current.routeMap && previous.themeResources === current.themeResources && previous.imageResolveContext === current.imageResolveContext;
|
|
15503
15663
|
}
|
|
15504
|
-
/**
|
|
15505
|
-
|
|
15506
|
-
|
|
15507
|
-
|
|
15508
|
-
|
|
15509
|
-
|
|
15664
|
+
/**
|
|
15665
|
+
* A map's place is decided before constructing the block or its hydration props,
|
|
15666
|
+
* so a map with nothing to show touches no override, wrapper or authored detail.
|
|
15667
|
+
* Anything short of a loaded place leaves visitors with no map at all.
|
|
15668
|
+
*/
|
|
15669
|
+
function prepareSourceEntry(entry, input) {
|
|
15510
15670
|
if (entry.block.kind === "block.location-map") {
|
|
15511
15671
|
const content = entry.renderableContent;
|
|
15672
|
+
const locationSource = typeof content.locationSource === "string" ? content.locationSource : null;
|
|
15512
15673
|
const resolved = resolveLocationMapLocation({
|
|
15513
15674
|
location: content.location,
|
|
15514
|
-
locationSource
|
|
15675
|
+
locationSource,
|
|
15515
15676
|
venueId: typeof content.venueId === "string" ? content.venueId : null,
|
|
15516
|
-
|
|
15517
|
-
venuesById: input.dataContext?.venuesById
|
|
15677
|
+
loaded: readLocationMapLoad(entry.block.id, normalizeLocationMapSource(locationSource), input.dataContext)
|
|
15518
15678
|
});
|
|
15519
|
-
if (resolved.kind === "unresolved") return {
|
|
15679
|
+
if (resolved.kind === "unresolved") return resolved.reason === "hidden_business_address" ? {
|
|
15680
|
+
kind: "hidden-business-location",
|
|
15681
|
+
businessDetailsHref: input.dataContext?.authoringBusinessDetailsHref ?? null
|
|
15682
|
+
} : {
|
|
15520
15683
|
kind: "unresolved-location",
|
|
15521
|
-
source: resolved.source
|
|
15684
|
+
source: resolved.source,
|
|
15685
|
+
reason: resolved.reason
|
|
15522
15686
|
};
|
|
15687
|
+
if (resolved.kind === "venue" && resolved.disclosure === "area") return prepareEntry(withoutEntrancePhoto(entry), input);
|
|
15523
15688
|
}
|
|
15524
15689
|
return prepareEntry(entry, input);
|
|
15525
15690
|
}
|
|
15526
|
-
/**
|
|
15527
|
-
function
|
|
15528
|
-
|
|
15529
|
-
|
|
15530
|
-
|
|
15691
|
+
/** A photo of the entrance gives away a place whose address is only shared with a booking. */
|
|
15692
|
+
function withoutEntrancePhoto(entry) {
|
|
15693
|
+
const { entrancePhoto: _withheld, ...content } = entry.renderableContent;
|
|
15694
|
+
return {
|
|
15695
|
+
...entry,
|
|
15696
|
+
renderableContent: content
|
|
15697
|
+
};
|
|
15698
|
+
}
|
|
15699
|
+
/** A custom place is in the content. The other sources read only this block's own loader. */
|
|
15700
|
+
function readLocationMapLoad(blockId, source, dataContext) {
|
|
15701
|
+
if (source === "custom" || !blockId) return void 0;
|
|
15702
|
+
const key = LOCATION_MAP_LOADER_KEYS[source];
|
|
15703
|
+
const failure = dataContext?.loaderFailures?.[blockId]?.[key];
|
|
15704
|
+
if (failure) return locationMapLoadFromFailure(failure);
|
|
15705
|
+
return parseLocationMapLoaderResult(dataContext?.resolvedData?.[blockId]?.[key]);
|
|
15706
|
+
}
|
|
15707
|
+
function locationMapLoadFromFailure(failure) {
|
|
15708
|
+
return { kind: failure.pending ? "pending" : "failed" };
|
|
15531
15709
|
}
|
|
15532
15710
|
function entryHiddenFromVisitors(entry, facts, interaction) {
|
|
15533
15711
|
return entry.kind === "renderable" && entry.definition.readiness !== void 0 && hiddenFromVisitors(entry.definition.readiness.assess(entry.renderableContent, facts, {
|
|
@@ -15577,13 +15755,15 @@ function prepareEntry(entry, input) {
|
|
|
15577
15755
|
}
|
|
15578
15756
|
}
|
|
15579
15757
|
/**
|
|
15580
|
-
* Editor admission validates
|
|
15581
|
-
* proof.
|
|
15758
|
+
* Editor admission validates what the owner still decides, without minting a
|
|
15759
|
+
* renderable proof. The Look's decisions are not authoring choices (a frame's
|
|
15760
|
+
* 4/5 is not on the block's ratio list), so the preview renders them unvalidated,
|
|
15761
|
+
* as a public page does, and a hidden stale value can't block it. Returns `null`
|
|
15762
|
+
* when even relaxed validation rejects the draft.
|
|
15582
15763
|
*/
|
|
15583
15764
|
function previewableEditorContent(entry) {
|
|
15584
15765
|
if (entry.block.presentationAdmission.kind !== "editor") return entry.renderableContent;
|
|
15585
|
-
|
|
15586
|
-
return draft.kind === "previewable" ? draft.data : null;
|
|
15766
|
+
return validateManifestDraft(compileManifestContentContract(entry.definition.manifest), entry.ownerEditableContent).kind === "previewable" ? entry.renderableContent : null;
|
|
15587
15767
|
}
|
|
15588
15768
|
function buildPreparedContent(entry, content, input) {
|
|
15589
15769
|
const { dataContext } = input;
|
|
@@ -16163,7 +16343,8 @@ function preparationDiagnostic(prepared, blockKind) {
|
|
|
16163
16343
|
reason: {
|
|
16164
16344
|
kind: prepared.kind,
|
|
16165
16345
|
blockKind,
|
|
16166
|
-
source: prepared.source
|
|
16346
|
+
source: prepared.source,
|
|
16347
|
+
locationReason: prepared.reason
|
|
16167
16348
|
},
|
|
16168
16349
|
outcome: "invalidPlaceholder"
|
|
16169
16350
|
};
|
|
@@ -16630,10 +16811,6 @@ function buildPageIdentityRenderContext(dataContext) {
|
|
|
16630
16811
|
now: dataContext.now,
|
|
16631
16812
|
siteName: dataContext.siteName,
|
|
16632
16813
|
businessPerson: dataContext.businessPerson ?? null,
|
|
16633
|
-
businessLocationPermission: dataContext.businessLocationPermission,
|
|
16634
|
-
businessAddressVisibility: dataContext.businessAddressVisibility,
|
|
16635
|
-
businessLocation: dataContext.businessLocation,
|
|
16636
|
-
venuesById: dataContext.venuesById,
|
|
16637
16814
|
siteCountry: dataContext.siteCountry,
|
|
16638
16815
|
pathname: dataContext.pathname
|
|
16639
16816
|
};
|