@riverbankcms/sdk 0.138.0 → 0.139.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.
Files changed (208) hide show
  1. package/README.md +11 -15
  2. package/dist/{PreviewEditorSidebar-BVPur_CU.mjs → PreviewEditorSidebar-BDeenhi3.mjs} +4 -4
  3. package/dist/{PreviewEditorUI-DLhWX8oh.mjs → PreviewEditorUI-DSRhgjF5.mjs} +3 -3
  4. package/dist/{PreviewQueryProvider-BguJY1SW.mjs → PreviewQueryProvider-D2K8GLUG.mjs} +1 -1
  5. package/dist/{SdkPreviewModeRuntime-Tda6qw4z.mjs → SdkPreviewModeRuntime-CL7wSnYu.mjs} +47 -27
  6. package/dist/{SiteChromeCustomizeContext-BHFgMjde.mjs → SiteChromeCustomizeContext-BhDn-5ir.mjs} +7771 -5863
  7. package/dist/_dts/ai/src/contracts/proposals.d.ts +99 -330
  8. package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +9 -30
  9. package/dist/_dts/api/src/billing.d.ts +10 -3
  10. package/dist/_dts/api/src/contentRuntime.d.ts +8 -1
  11. package/dist/_dts/api/src/endpoints.d.ts +182 -103
  12. package/dist/_dts/api/src/footerSettings.d.ts +2 -5
  13. package/dist/_dts/api/src/index.d.ts +11 -9
  14. package/dist/_dts/api/src/mailchimpIntegration.d.ts +2 -59
  15. package/dist/_dts/api/src/mailingListIntegration.d.ts +117 -0
  16. package/dist/_dts/api/src/navigation/locations.d.ts +1 -0
  17. package/dist/_dts/api/src/navigation.d.ts +1 -26
  18. package/dist/_dts/api/src/newsletterEndpointDefinitions.d.ts +109 -2
  19. package/dist/_dts/api/src/onboarding/surfaceData.d.ts +185 -0
  20. package/dist/_dts/api/src/privacyPolicy.d.ts +74 -2
  21. package/dist/_dts/api/src/publicBookingAvailabilityEndpointDefinitions.d.ts +6 -6
  22. package/dist/_dts/api/src/publicEventEndpointDefinitions.d.ts +1 -1
  23. package/dist/_dts/api/src/publicExperience/newsletterEndpoints.d.ts +2 -4
  24. package/dist/_dts/api/src/publicExperience/sharedTypes.d.ts +10 -24
  25. package/dist/_dts/api/src/publicReadEndpointDefinitions.d.ts +73 -0
  26. package/dist/_dts/api/src/schemas/site-api-keys.d.ts +1 -1
  27. package/dist/_dts/api/src/sdkContracts.d.ts +2 -10
  28. package/dist/_dts/api/src/sdkThemeWire.d.ts +2 -2
  29. package/dist/_dts/api/src/siteManagementEndpoints.d.ts +0 -29
  30. package/dist/_dts/api/src/siteOnboarding.d.ts +91 -228
  31. package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +1 -9
  32. package/dist/_dts/api/src/siteSettings.d.ts +20 -1
  33. package/dist/_dts/api/src/types.d.ts +5 -4
  34. package/dist/_dts/billing/src/membership/index.d.ts +14 -7
  35. package/dist/_dts/billing/src/plans/display.d.ts +15 -0
  36. package/dist/_dts/billing/src/plans/registry.d.ts +2 -0
  37. package/dist/_dts/billing/src/plans/standing.d.ts +19 -0
  38. package/dist/_dts/billing/src/plans/types.d.ts +1 -7
  39. package/dist/_dts/billing/src/subscriptions/evidence.d.ts +12 -0
  40. package/dist/_dts/billing/src/subscriptions/standingEvidence.d.ts +31 -0
  41. package/dist/_dts/billing/src/subscriptions/store.d.ts +23 -5
  42. package/dist/_dts/blocks/src/PageRenderer.d.ts +6 -15
  43. package/dist/_dts/blocks/src/client.d.ts +1 -1
  44. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +32 -16
  45. package/dist/_dts/blocks/src/pageRendererContracts.d.ts +4 -0
  46. package/dist/_dts/blocks/src/pageRenderingMode.d.ts +12 -6
  47. package/dist/_dts/blocks/src/system/blocks/appointment-services.d.ts +11 -0
  48. package/dist/_dts/blocks/src/system/blocks/contact-newsletter.d.ts +39 -66
  49. package/dist/_dts/blocks/src/system/blocks/newsletter-signup.d.ts +39 -114
  50. package/dist/_dts/blocks/src/system/blocks/offerings-preview/catalogue.d.ts +18 -0
  51. package/dist/_dts/blocks/src/system/blocks/offerings-preview/fields.d.ts +2 -0
  52. package/dist/_dts/blocks/src/system/blocks/offerings-preview/index.d.ts +4 -0
  53. package/dist/_dts/blocks/src/system/blocks/site-footer-runtime.d.ts +7 -13
  54. package/dist/_dts/blocks/src/system/constants/blockKinds.d.ts +1 -1
  55. package/dist/_dts/blocks/src/system/data/index.d.ts +2 -2
  56. package/dist/_dts/blocks/src/system/data/loaderEndpoints.d.ts +1 -1
  57. package/dist/_dts/blocks/src/system/data/publicLoaderCachePolicy.d.ts +2 -74
  58. package/dist/_dts/blocks/src/system/fragments/library/newsletterForm.d.ts +33 -100
  59. package/dist/_dts/blocks/src/system/runtime/api/types/newsletter.d.ts +5 -15
  60. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +48 -24
  61. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -12
  62. package/dist/_dts/blocks/src/system/runtime/hooks/useCalendarEvents.d.ts +3 -0
  63. package/dist/_dts/blocks/src/system/runtime/hooks/useCalendarEvents.state.d.ts +1 -1
  64. package/dist/_dts/blocks/src/system/runtime/hooks/useCalendarToday.d.ts +22 -0
  65. package/dist/_dts/blocks/src/system/runtime/nodes/appointment-services.d.ts +51 -0
  66. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +2 -0
  67. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +0 -1
  68. package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.client.d.ts +28 -0
  69. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/bookability.d.ts +9 -0
  70. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/dates.d.ts +14 -0
  71. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/duration.d.ts +2 -0
  72. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/index.d.ts +4 -0
  73. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/location.d.ts +2 -0
  74. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/quickDates.d.ts +16 -0
  75. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/AgendaEventCard.d.ts +9 -1
  76. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/CalendarDayCell.d.ts +2 -0
  77. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/CalendarDayHeaders.d.ts +4 -0
  78. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/DayEventsModal.d.ts +2 -1
  79. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventCard.d.ts +5 -0
  80. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventModals.d.ts +2 -1
  81. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventQuickDates.d.ts +15 -0
  82. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekAgendaView.d.ts +7 -3
  83. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekTimetableView.d.ts +1 -0
  84. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/index.d.ts +2 -0
  85. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/timetableModel.d.ts +1 -0
  86. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/useHydrationReady.d.ts +6 -0
  87. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.client.state.d.ts +3 -0
  88. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.interactive.d.ts +56 -33
  89. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.submission.d.ts +3 -3
  90. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.types.d.ts +13 -31
  91. package/dist/_dts/blocks/src/system/runtime/nodes/offerings-preview-catalogue.d.ts +14 -0
  92. package/dist/_dts/blocks/src/system/runtime/nodes/offerings-preview-content.d.ts +23 -0
  93. package/dist/_dts/blocks/src/system/runtime/nodes/offerings-preview.d.ts +4 -2
  94. package/dist/_dts/blocks/src/system/transforms/registry/formatting.d.ts +5 -0
  95. package/dist/_dts/commerce/src/purchase/index.d.ts +1 -0
  96. package/dist/_dts/commerce/src/purchase/orderItemMetadata.d.ts +5 -12
  97. package/dist/_dts/commerce/src/purchase/stripeCommissionMetadata.d.ts +34 -0
  98. package/dist/_dts/content-editor/src/footerEngagementDraft.d.ts +6 -24
  99. package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +1 -2
  100. package/dist/_dts/core/src/footer-engagement.d.ts +2 -6
  101. package/dist/_dts/core/src/index.d.ts +9 -1
  102. package/dist/_dts/core/src/mailing-list-identifiers.d.ts +21 -0
  103. package/dist/_dts/core/src/mailing-list-runtime.d.ts +42 -0
  104. package/dist/_dts/core/src/mailing-list-setup-parser.d.ts +14 -0
  105. package/dist/_dts/core/src/mailing-list-setup.d.ts +129 -0
  106. package/dist/_dts/core/src/mailing-list-submission.d.ts +244 -0
  107. package/dist/_dts/core/src/mailing-list-targeting-parser.d.ts +12 -0
  108. package/dist/_dts/core/src/mailing-list-targeting.d.ts +93 -0
  109. package/dist/_dts/core/src/navigation-locations.d.ts +28 -0
  110. package/dist/_dts/core/src/public-profile.d.ts +9 -1
  111. package/dist/_dts/core/src/public-read-cache-contract.d.ts +45 -0
  112. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +529 -373
  113. package/dist/_dts/editor-blocks/src/widgets/index.d.ts +1 -0
  114. package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/MailingListTargetingField.d.ts +11 -0
  115. package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/context.d.ts +13 -0
  116. package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/index.d.ts +3 -0
  117. package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/loaders.d.ts +6 -0
  118. package/dist/_dts/preview-next/src/client/widgets/widgetOverrides.d.ts +1 -0
  119. package/dist/_dts/sdk/src/client/publicAppointmentReadOperations.d.ts +12 -0
  120. package/dist/_dts/sdk/src/client/publicEventReadOperations.d.ts +2 -1
  121. package/dist/_dts/sdk/src/client/publicLoaderCacheAccess.d.ts +11 -4
  122. package/dist/_dts/sdk/src/config/content-types.d.ts +3 -13
  123. package/dist/_dts/sdk/src/config/content-validation.d.ts +5 -8
  124. package/dist/_dts/sdk/src/constants.d.ts +3 -3
  125. package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
  126. package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +12 -31
  127. package/dist/_dts/sdk/src/navigation/index.d.ts +11 -29
  128. package/dist/_dts/sdk/src/next/index.d.ts +4 -4
  129. package/dist/_dts/sdk/src/prebuild/types.d.ts +1 -5
  130. package/dist/_dts/sdk/src/public-api/contracts.d.ts +33 -16
  131. package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +3 -0
  132. package/dist/_dts/sdk/src/rendering/client.d.ts +3 -20
  133. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +3 -0
  134. package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +4 -0
  135. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +1 -0
  136. package/dist/_dts/sdk/src/rendering/index.d.ts +1 -1
  137. package/dist/_dts/sdk/src/types/block-kinds.d.ts +1 -1
  138. package/dist/_dts/sdk/src/version.d.ts +1 -1
  139. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  140. package/dist/_dts/theme-core/src/hosted-booking-appearance.d.ts +41 -0
  141. package/dist/_dts/theme-core/src/index.d.ts +1 -0
  142. package/dist/_dts/theme-core/src/runtime/buildThemeRuntime.d.ts +0 -1
  143. package/dist/_dts/theme-core/src/tokens/tokens.d.ts +7 -0
  144. package/dist/_dts/ui/src/badge.d.ts +1 -1
  145. package/dist/_dts/ui/src/callout.d.ts +1 -1
  146. package/dist/client/{BookingConsentAgreement-DQUik1Mx.mjs → BookingConsentAgreement-CZvTDtsK.mjs} +2 -2
  147. package/dist/client/{DiscountCodeDisclosure-CU67Q4vH.mjs → DiscountCodeDisclosure-D-DsLCMU.mjs} +1 -1
  148. package/dist/client/{EventCombined.client-a02TXUgg.mjs → EventCombined.client-dWqgd5ZO.mjs} +443 -199
  149. package/dist/client/{EventListing.client-99qx7jFl.mjs → EventListing.client-BMRa9IYp.mjs} +2 -2
  150. package/dist/client/{LeafletStaticMap-CWzcq73L.mjs → LeafletStaticMap-D21W9kBZ.mjs} +1 -1
  151. package/dist/client/{accordion-D1nb3-Oj.mjs → accordion-FxF_ta47.mjs} +1 -1
  152. package/dist/client/{bookingForm-BGrmLhaO.mjs → bookingForm-YnwW4TGw.mjs} +5 -5
  153. package/dist/client/bookings.mjs +43 -2
  154. package/dist/client/{carousel-DSmOx3ad.mjs → carousel-vng7fFT5.mjs} +1 -1
  155. package/dist/client/{cart-COWeOIUk.mjs → cart-DEPDsjNk.mjs} +3 -3
  156. package/dist/client/{checkout-CeysaIJK.mjs → checkout-CZRWu9rW.mjs} +3 -3
  157. package/dist/client/client.mjs +3331 -1407
  158. package/dist/client/{context-DBzX85Xc.mjs → context-DvU_WUmd.mjs} +4 -3
  159. package/dist/client/{dates-DCYhZBlW.mjs → dates-wnPMiRl5.mjs} +21 -3
  160. package/dist/client/{eventCalendar-BgsN73Ul.mjs → eventCalendar-BA3Q5L15.mjs} +80 -78
  161. package/dist/client/{eventCombined-DcZQAMQP.mjs → eventCombined-51wgR-1R.mjs} +3 -3
  162. package/dist/client/{eventDetails-BWwGJ54l.mjs → eventDetails-modaetpm.mjs} +4 -4
  163. package/dist/client/{eventListing-DqYqV8vp.mjs → eventListing-D8t2J3Kv.mjs} +3 -3
  164. package/dist/client/{eventRegistration-DQGDgu_e.mjs → eventRegistration-CYqtkCE_.mjs} +49 -9
  165. package/dist/client/{form-ClfpasVT.mjs → form-CBKXN5In.mjs} +2 -2
  166. package/dist/client/{headerSection-BuOMe98N.mjs → headerSection-DylDqNrs.mjs} +2 -2
  167. package/dist/client/hooks.mjs +1259 -555
  168. package/dist/client/{locationMap-CEqu_sfa.mjs → locationMap-CvWrG0vZ.mjs} +2 -2
  169. package/dist/client/{newsletterForm-IbrHjMxy.mjs → newsletterForm-Btwk70zw.mjs} +117 -38
  170. package/dist/client/{pricing-xj7MPZlK.mjs → pricing-Uzw-GQ6Y.mjs} +1 -1
  171. package/dist/client/{productDetail-vxqTt5Xj.mjs → productDetail-JLcUYKnd.mjs} +3 -3
  172. package/dist/client/{productList-OTdZu8sb.mjs → productList-FM0cbUzj.mjs} +3 -3
  173. package/dist/client/{propsDecoder-CY9gGEF7.mjs → propsDecoder-DYzafZb2.mjs} +592 -152
  174. package/dist/client/rendering/client.mjs +2259 -835
  175. package/dist/client/rendering/islands.mjs +17 -17
  176. package/dist/client/rendering.mjs +3308 -1236
  177. package/dist/client/{scrollToBlock--BFV6kl-.mjs → scrollToBlock-CvXszexS.mjs} +1 -1
  178. package/dist/client/{shop-CP4YbDL9.mjs → shop-BIcjvy5a.mjs} +6 -6
  179. package/dist/client/{shop-commerce-APs4XBXE.mjs → shop-commerce-BZQsy7xw.mjs} +5 -5
  180. package/dist/client/{shop-commerce-store-CAVLxLFr.mjs → shop-commerce-store-D5V7XAb5.mjs} +1 -1
  181. package/dist/client/{shopShared-BnSRrwXI.mjs → shopShared-DowkXevB.mjs} +3 -3
  182. package/dist/client/{useEventFilters-1a1by4c8.mjs → useEventFilters-oMoTw_JE.mjs} +56 -9
  183. package/dist/preview-next/before-render.mjs +238 -111
  184. package/dist/preview-next/client/runtime.mjs +4 -4
  185. package/dist/preview-next/keepAlive.mjs +238 -111
  186. package/dist/preview-next/middleware.mjs +238 -111
  187. package/dist/{previewAuthStore-BkEgnYPP.mjs → previewAuthStore-COUyAKaX.mjs} +238 -111
  188. package/dist/{sdk-runtime-DwGfsT0S.mjs → sdk-runtime-D4k2LSGF.mjs} +2 -2
  189. package/dist/{separator-BeqDLneQ.mjs → separator-UGtpag4Z.mjs} +1 -1
  190. package/dist/server/components.mjs +2697 -1023
  191. package/dist/server/config-validation.mjs +2424 -1720
  192. package/dist/server/config.mjs +2429 -1724
  193. package/dist/server/data.mjs +1164 -454
  194. package/dist/server/index.mjs +364 -280
  195. package/dist/server/navigation.mjs +16 -47
  196. package/dist/server/next.mjs +2915 -1380
  197. package/dist/server/page-converter.mjs +969 -522
  198. package/dist/server/prebuild.mjs +2 -3
  199. package/dist/server/rendering/server.mjs +2704 -1030
  200. package/dist/server/rendering.mjs +2742 -1063
  201. package/dist/server/routing.mjs +1386 -595
  202. package/dist/server/server.mjs +2878 -2324
  203. package/dist/server/theme-bridge.mjs +292 -24
  204. package/dist/styles/index.css +289 -25
  205. package/package.json +1 -1
  206. package/dist/_dts/api/src/navigation/identity.d.ts +0 -59
  207. package/dist/_dts/blocks/src/system/blocks/newsletter-signup-destination.d.ts +0 -291
  208. package/dist/_dts/core/src/newsletter-signup-destination.d.ts +0 -38
@@ -1,14 +1,30 @@
1
1
  "use client";
2
2
  import { D as clsx } from "./colorStyles-CrxJrPjJ.mjs";
3
- import { $ as getOrderedDayNames, B as buildEventRuntimeFilters, F as calendarWindowBounds, G as getCardOrientation, I as calendarWindowMonths$1, Jt as formatLocalScheduleDate, K as getContainerClass, M as calendarMonthDate, N as calendarPageResponseError, P as calendarQueryKey, Q as getDayOfWeek, R as planCalendarMonthRanges, V as getEventRuntimeFiltersKey, X as buildCalendarViewport, Xt as getLocalScheduleDate, Y as addMonths, Z as formatDateKey, nt as isToday, q as MONTH_NAMES, rt as shiftCalendarAnchorDate, ut as themeButtonClassName } from "./propsDecoder-CY9gGEF7.mjs";
4
- import { a as EventCardClient, i as EventPaginatedListView, n as useEventPagination, o as EventFilters, r as toError, s as formatEventTeacherLine, t as useEventFilters } from "./useEventFilters-1a1by4c8.mjs";
5
- import { o as formatEventRemainingPlaces, p as isEventFull, t as formatEventPrice } from "./pricing-xj7MPZlK.mjs";
6
- import { a as groupEventsByDate, i as formatTime, l as resolveEventLinkProps, t as formatDate } from "./dates-DCYhZBlW.mjs";
7
- import { n as useBlockApi } from "./context-DBzX85Xc.mjs";
3
+ import { $ as getOrderedDayNames, B as buildEventRuntimeFilters, F as calendarWindowBounds, G as getCardOrientation, I as calendarWindowMonths$1, K as getContainerClass, M as calendarMonthDate, N as calendarPageResponseError, P as calendarQueryKey, Q as getDayOfWeek, R as planCalendarMonthRanges, V as getEventRuntimeFiltersKey, X as buildCalendarViewport, Y as addMonths, Yt as formatLocalScheduleDate, Z as formatDateKey, Zt as getLocalScheduleDate, nt as isToday, q as MONTH_NAMES, rt as shiftCalendarAnchorDate, tt as isSameCalendarDay, ut as themeButtonClassName } from "./propsDecoder-DYzafZb2.mjs";
4
+ import { a as EventCardClient, i as EventPaginatedListView, n as useEventPagination, o as EventFilters, r as toError, s as formatEventTeacherLine, t as useEventFilters } from "./useEventFilters-oMoTw_JE.mjs";
5
+ import { o as formatEventRemainingPlaces, p as isEventFull, t as formatEventPrice } from "./pricing-Uzw-GQ6Y.mjs";
6
+ import { a as formatTime, d as resolveEventLinkProps, o as groupEventsByDate, s as resolveEventTimeZone, t as formatDate, u as resolveEventCta } from "./dates-wnPMiRl5.mjs";
7
+ import { n as useBlockApi } from "./context-DvU_WUmd.mjs";
8
8
  import { t as createBodyThemePortalRoot } from "./themePortalRoot-AGs4cE7t.mjs";
9
9
  import { t as ModalShell } from "./ModalShell-CqkBvBIC.mjs";
10
10
  import React, { createContext, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from "react";
11
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
+ //#region ../blocks/src/system/runtime/nodes/events/domain/duration.ts
13
+ function formatEventDuration(event) {
14
+ const durationMinutes = Math.max(0, Math.round((Date.parse(event.endsAt) - Date.parse(event.startsAt)) / 6e4));
15
+ if (durationMinutes < 120 || durationMinutes % 60 !== 0) return `${durationMinutes} min`;
16
+ return `${durationMinutes / 60} hrs`;
17
+ }
18
+ //#endregion
19
+ //#region ../blocks/src/system/runtime/nodes/events/domain/location.ts
20
+ function formatEventLocation(event) {
21
+ switch (event.deliveryMode) {
22
+ case "online": return "Online";
23
+ case "hybrid": return event.venue ? `${event.venue.name} + online` : "Hybrid";
24
+ case "in_person": return event.venue?.name ?? "In person";
25
+ }
26
+ }
27
+ //#endregion
12
28
  //#region ../blocks/src/system/runtime/shared/components/TabBarFragment.tsx
13
29
  function clampIndex(idx, len) {
14
30
  if (len <= 0) return 0;
@@ -201,6 +217,82 @@ function projectCalendarLoadState(state, months) {
201
217
  return entries.some((entry) => !entry || entry.kind === "partial" || entry.kind === "loading") ? { kind: "loading" } : { kind: "idle" };
202
218
  }
203
219
  //#endregion
220
+ //#region ../blocks/src/system/runtime/hooks/useCalendarToday.ts
221
+ const SEARCH_STEP_MS = 3600 * 1e3;
222
+ const MAX_BOUNDARY_SEARCH_MS = 72 * SEARCH_STEP_MS;
223
+ const MAX_TIMER_DELAY_MS = 2147483647;
224
+ const systemCalendarTodayClock = { now: () => /* @__PURE__ */ new Date() };
225
+ /** Find the first instant after `now` whose site-local civil date differs. */
226
+ function findNextCalendarDateBoundary(now, timeZone, resolveDate = getLocalScheduleDate) {
227
+ const currentDate = resolveDate(now, timeZone);
228
+ const lowerBound = now.getTime();
229
+ let upperBound = lowerBound + SEARCH_STEP_MS;
230
+ const searchLimit = lowerBound + MAX_BOUNDARY_SEARCH_MS;
231
+ while (upperBound <= searchLimit && isSameCalendarDay(resolveDate(new Date(upperBound), timeZone), currentDate)) upperBound += SEARCH_STEP_MS;
232
+ if (upperBound > searchLimit) return {
233
+ kind: "retry",
234
+ delayMs: SEARCH_STEP_MS
235
+ };
236
+ let lower = lowerBound;
237
+ let upper = upperBound;
238
+ while (upper - lower > 1) {
239
+ const midpoint = lower + Math.floor((upper - lower) / 2);
240
+ if (isSameCalendarDay(resolveDate(new Date(midpoint), timeZone), currentDate)) lower = midpoint;
241
+ else upper = midpoint;
242
+ }
243
+ return {
244
+ kind: "found",
245
+ instant: new Date(upper)
246
+ };
247
+ }
248
+ function useCalendarToday(context, clock = systemCalendarTodayClock) {
249
+ const [today, setToday] = useState(context.initialToday);
250
+ const now = clock.now;
251
+ const resolveDate = clock.resolveDate ?? getLocalScheduleDate;
252
+ const refreshToday = useCallback(() => {
253
+ const next = resolveDate(now(), context.timeZone);
254
+ setToday((current) => isSameCalendarDay(current, next) ? current : next);
255
+ }, [
256
+ context.timeZone,
257
+ now,
258
+ resolveDate
259
+ ]);
260
+ useEffect(() => {
261
+ let timeoutId;
262
+ const scheduleBoundary = () => {
263
+ if (timeoutId !== void 0) clearTimeout(timeoutId);
264
+ const currentInstant = now();
265
+ const boundary = findNextCalendarDateBoundary(currentInstant, context.timeZone, resolveDate);
266
+ const boundaryDelay = boundary.kind === "found" ? boundary.instant.getTime() - currentInstant.getTime() : boundary.delayMs;
267
+ timeoutId = setTimeout(() => {
268
+ refreshToday();
269
+ scheduleBoundary();
270
+ }, Math.min(Math.max(1, boundaryDelay), MAX_TIMER_DELAY_MS));
271
+ };
272
+ const reconcileAndReschedule = () => {
273
+ refreshToday();
274
+ scheduleBoundary();
275
+ };
276
+ const handleVisibilityChange = () => {
277
+ if (document.visibilityState === "visible") reconcileAndReschedule();
278
+ };
279
+ reconcileAndReschedule();
280
+ document.addEventListener("visibilitychange", handleVisibilityChange);
281
+ window.addEventListener("focus", reconcileAndReschedule);
282
+ return () => {
283
+ if (timeoutId !== void 0) clearTimeout(timeoutId);
284
+ document.removeEventListener("visibilitychange", handleVisibilityChange);
285
+ window.removeEventListener("focus", reconcileAndReschedule);
286
+ };
287
+ }, [
288
+ context.timeZone,
289
+ now,
290
+ refreshToday,
291
+ resolveDate
292
+ ]);
293
+ return today;
294
+ }
295
+ //#endregion
204
296
  //#region ../blocks/src/system/runtime/hooks/useCalendarEvents.ts
205
297
  /**
206
298
  * Hook for calendar event management with month-based caching
@@ -208,7 +300,7 @@ function projectCalendarLoadState(state, months) {
208
300
  * Uses the Block API Client for type-safe API calls.
209
301
  * Must be used within a BlockApiProvider.
210
302
  */
211
- function useCalendarViewport({ view = "month", startOfWeek = "monday", initialDate }) {
303
+ function useCalendarViewport({ view = "month", startOfWeek = "monday", initialDate, today }) {
212
304
  const [viewDate, setViewDate] = useState(initialDate);
213
305
  const viewport = useMemo(() => buildCalendarViewport({
214
306
  view,
@@ -234,8 +326,8 @@ function useCalendarViewport({ view = "month", startOfWeek = "monday", initialDa
234
326
  goToPrevious,
235
327
  goToNext,
236
328
  goToToday: useCallback(() => {
237
- setViewDate(initialDate);
238
- }, [initialDate])
329
+ setViewDate(today);
330
+ }, [today])
239
331
  };
240
332
  }
241
333
  /**
@@ -357,10 +449,12 @@ function useCalendarEventCache({ readProfile = "listing-card", viewDate, calenda
357
449
  };
358
450
  }
359
451
  function useCalendarEvents({ readProfile, siteId: _siteId, calendarWindow, view = "month", startOfWeek = "monday", preloadMonths = 1, filters, stage, calendarContext }) {
452
+ const today = useCalendarToday(calendarContext);
360
453
  const { viewDate, viewport, goToDate, goToPrevious, goToNext, goToToday } = useCalendarViewport({
361
454
  view,
362
455
  startOfWeek,
363
- initialDate: calendarContext.initialToday
456
+ initialDate: calendarContext.initialToday,
457
+ today
364
458
  });
365
459
  const { events, loadState, retryCurrentView } = useCalendarEventCache({
366
460
  readProfile,
@@ -374,6 +468,7 @@ function useCalendarEvents({ readProfile, siteId: _siteId, calendarWindow, view
374
468
  return {
375
469
  events,
376
470
  viewDate,
471
+ today,
377
472
  viewport,
378
473
  loadState,
379
474
  setViewDate: useCallback((date) => {
@@ -449,7 +544,7 @@ function useEventModal() {
449
544
  * Clicking an event opens the EventDetailModal.
450
545
  * Clicking "+N more" opens the DayEventsModal.
451
546
  */
452
- const CalendarDayCell = ({ date, events, isCurrentMonth, today: currentDate }) => {
547
+ const CalendarDayCell = ({ date, events, isCurrentMonth, calendarTimeZone, today: currentDate }) => {
453
548
  const { openEventModal, openDayModal } = useEventModal();
454
549
  const today = isToday(date, currentDate);
455
550
  const dayClasses = [
@@ -471,7 +566,7 @@ const CalendarDayCell = ({ date, events, isCurrentMonth, today: currentDate }) =
471
566
  }), /* @__PURE__ */ jsxs("div", {
472
567
  className: "event-calendar-events",
473
568
  children: [events.slice(0, 3).map((event) => {
474
- const timeZone = event.timeZone ?? null;
569
+ const timeZone = resolveEventTimeZone(event, calendarTimeZone);
475
570
  return /* @__PURE__ */ jsxs("button", {
476
571
  type: "button",
477
572
  className: "event-calendar-event",
@@ -503,85 +598,202 @@ const CalendarDayCell = ({ date, events, isCurrentMonth, today: currentDate }) =
503
598
  });
504
599
  };
505
600
  //#endregion
601
+ //#region ../blocks/src/system/runtime/nodes/events/shared/CalendarDayHeaders.tsx
602
+ function CalendarDayHeaders({ dayNames }) {
603
+ return /* @__PURE__ */ jsx("div", {
604
+ className: "event-calendar-day-headers",
605
+ children: dayNames.map((day) => /* @__PURE__ */ jsx("div", {
606
+ className: "event-calendar-day-header",
607
+ children: day
608
+ }, day))
609
+ });
610
+ }
611
+ //#endregion
612
+ //#region ../blocks/src/system/runtime/nodes/events/shared/CalendarNavigationChevron.tsx
613
+ function CalendarNavigationChevron({ direction }) {
614
+ return /* @__PURE__ */ jsx("svg", {
615
+ width: "20",
616
+ height: "20",
617
+ fill: "none",
618
+ stroke: "currentColor",
619
+ strokeWidth: 2,
620
+ viewBox: "0 0 24 24",
621
+ "aria-hidden": "true",
622
+ children: /* @__PURE__ */ jsx("path", {
623
+ strokeLinecap: "round",
624
+ strokeLinejoin: "round",
625
+ d: direction === "previous" ? "M15 19l-7-7 7-7" : "M9 5l7 7-7 7"
626
+ })
627
+ });
628
+ }
629
+ //#endregion
506
630
  //#region ../blocks/src/system/runtime/nodes/events/shared/AgendaEventCard.tsx
507
631
  /**
508
632
  * AgendaEventCard Component
509
633
  *
510
634
  * Rich event card for agenda/week view with category color, time, venue, pricing, and capacity.
511
635
  */
512
- const AgendaEventCard = ({ event, showCapacity, onClick }) => {
513
- const eventLinkProps = resolveEventLinkProps(event);
636
+ const AgendaEventCard = ({ event, showCapacity, showVenue = true, buttonVariant = "primary", buttonText, calendarTimeZone, onClick }) => {
637
+ if (onClick) return /* @__PURE__ */ jsx(AgendaModalCard, {
638
+ event,
639
+ showCapacity,
640
+ calendarTimeZone,
641
+ onClick
642
+ });
643
+ return /* @__PURE__ */ jsx(AgendaLinkCard, {
644
+ event,
645
+ showCapacity,
646
+ showVenue,
647
+ buttonVariant,
648
+ buttonText,
649
+ calendarTimeZone
650
+ });
651
+ };
652
+ function AgendaModalCard({ event, showCapacity, calendarTimeZone, onClick }) {
514
653
  const categoryColor = event.eventCategory?.color || "rgb(var(--tb-accent))";
515
654
  const price = formatEventPrice(event);
516
655
  const capacity = showCapacity ? formatEventRemainingPlaces(event) : null;
517
656
  const isFull = isEventFull(event);
518
- const title = event.title;
519
- const timeZone = event.timeZone ?? null;
520
657
  const teacherLine = formatEventTeacherLine(event);
521
- const cardContent = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
522
- className: "event-agenda-card-indicator",
523
- style: { backgroundColor: categoryColor },
524
- "aria-hidden": "true"
525
- }), /* @__PURE__ */ jsxs("div", {
526
- className: "event-agenda-card-content",
527
- children: [/* @__PURE__ */ jsxs("div", {
528
- className: "event-agenda-card-header",
529
- children: [/* @__PURE__ */ jsx("span", {
658
+ const timeZone = resolveEventTimeZone(event, calendarTimeZone);
659
+ return /* @__PURE__ */ jsxs("button", {
660
+ type: "button",
661
+ className: "event-agenda-card",
662
+ onClick: () => onClick(event),
663
+ children: [/* @__PURE__ */ jsx("div", {
664
+ className: "event-agenda-card-indicator",
665
+ style: { backgroundColor: categoryColor },
666
+ "aria-hidden": "true"
667
+ }), /* @__PURE__ */ jsxs("div", {
668
+ className: "event-agenda-card-content",
669
+ children: [/* @__PURE__ */ jsxs("div", {
670
+ className: "event-agenda-card-header",
671
+ children: [/* @__PURE__ */ jsx("span", {
672
+ className: "event-agenda-card-time",
673
+ children: formatTime(event.startsAt, { timeZone })
674
+ }), /* @__PURE__ */ jsx("span", {
675
+ className: "event-agenda-card-title",
676
+ children: event.title
677
+ })]
678
+ }), /* @__PURE__ */ jsxs("div", {
679
+ className: "event-agenda-card-details status-muted",
680
+ children: [
681
+ event.venue && /* @__PURE__ */ jsxs("span", {
682
+ className: "event-agenda-card-venue",
683
+ children: [/* @__PURE__ */ jsx(LocationIcon, {}), event.venue.name]
684
+ }),
685
+ teacherLine && /* @__PURE__ */ jsx("span", {
686
+ className: "event-agenda-card-teacher",
687
+ children: teacherLine
688
+ }),
689
+ /* @__PURE__ */ jsx("span", {
690
+ className: "event-agenda-card-price",
691
+ children: price
692
+ }),
693
+ capacity && /* @__PURE__ */ jsx("span", {
694
+ className: `event-agenda-card-capacity ${isFull ? "event-agenda-card-capacity--full status-error" : ""}`,
695
+ children: capacity
696
+ })
697
+ ]
698
+ })]
699
+ })]
700
+ });
701
+ }
702
+ function AgendaLinkCard({ event, showCapacity, showVenue, buttonVariant, buttonText, calendarTimeZone }) {
703
+ const eventLinkProps = resolveEventLinkProps(event);
704
+ const categoryColor = event.eventCategory?.color || "rgb(var(--tb-accent))";
705
+ const timeZone = resolveEventTimeZone(event, calendarTimeZone);
706
+ const teacherLine = formatEventTeacherLine(event);
707
+ const location = formatEventLocation(event);
708
+ const duration = formatEventDuration(event);
709
+ const price = formatEventPrice(event);
710
+ const capacity = showCapacity ? formatEventRemainingPlaces(event) : null;
711
+ const cta = resolveEventCta(event, buttonText);
712
+ const buttonClass = themeButtonClassName({
713
+ variant: buttonVariant,
714
+ size: "sm"
715
+ });
716
+ return /* @__PURE__ */ jsxs("article", {
717
+ className: "event-agenda-card event-agenda-card--agenda",
718
+ children: [
719
+ /* @__PURE__ */ jsx("div", {
720
+ className: "event-agenda-card-indicator",
721
+ style: { backgroundColor: categoryColor },
722
+ "aria-hidden": "true"
723
+ }),
724
+ /* @__PURE__ */ jsx("time", {
530
725
  className: "event-agenda-card-time",
726
+ dateTime: event.startsAt,
531
727
  children: formatTime(event.startsAt, { timeZone })
532
- }), /* @__PURE__ */ jsx("span", {
533
- className: "event-agenda-card-title",
534
- children: title
535
- })]
536
- }), /* @__PURE__ */ jsxs("div", {
537
- className: "event-agenda-card-details",
538
- children: [
539
- event.venue && /* @__PURE__ */ jsxs("span", {
540
- className: "event-agenda-card-venue",
541
- children: [/* @__PURE__ */ jsxs("svg", {
542
- className: "event-agenda-card-icon",
543
- width: "14",
544
- height: "14",
545
- viewBox: "0 0 24 24",
546
- fill: "none",
547
- stroke: "currentColor",
548
- strokeWidth: "2",
549
- strokeLinecap: "round",
550
- strokeLinejoin: "round",
551
- children: [/* @__PURE__ */ jsx("path", { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z" }), /* @__PURE__ */ jsx("circle", {
552
- cx: "12",
553
- cy: "10",
554
- r: "3"
555
- })]
556
- }), event.venue.name]
557
- }),
558
- teacherLine && /* @__PURE__ */ jsx("span", {
559
- className: "event-agenda-card-teacher",
560
- children: teacherLine
561
- }),
562
- /* @__PURE__ */ jsx("span", {
728
+ }),
729
+ /* @__PURE__ */ jsxs("div", {
730
+ className: "event-agenda-card-content",
731
+ children: [/* @__PURE__ */ jsx("h5", {
732
+ className: "event-agenda-card-title",
733
+ children: /* @__PURE__ */ jsx("a", {
734
+ ...eventLinkProps,
735
+ children: event.title
736
+ })
737
+ }), /* @__PURE__ */ jsxs("div", {
738
+ className: "event-agenda-card-details status-muted",
739
+ children: [
740
+ showVenue ? /* @__PURE__ */ jsxs("span", {
741
+ className: "event-agenda-card-location",
742
+ children: [/* @__PURE__ */ jsx(LocationIcon, {}), location]
743
+ }) : null,
744
+ /* @__PURE__ */ jsx("span", {
745
+ className: "event-agenda-card-duration",
746
+ children: duration
747
+ }),
748
+ teacherLine && /* @__PURE__ */ jsx("span", {
749
+ className: "event-agenda-card-teacher",
750
+ children: teacherLine
751
+ }),
752
+ capacity && /* @__PURE__ */ jsx("span", {
753
+ className: `event-agenda-card-capacity ${isEventFull(event) ? "event-agenda-card-capacity--full status-error" : ""}`,
754
+ children: capacity
755
+ })
756
+ ]
757
+ })]
758
+ }),
759
+ /* @__PURE__ */ jsxs("div", {
760
+ className: "event-agenda-card-action",
761
+ children: [/* @__PURE__ */ jsx("span", {
563
762
  className: "event-agenda-card-price",
564
763
  children: price
565
- }),
566
- capacity && /* @__PURE__ */ jsx("span", {
567
- className: `event-agenda-card-capacity ${isFull ? "event-agenda-card-capacity--full" : ""}`,
568
- children: capacity
569
- })
570
- ]
571
- })]
572
- })] });
573
- if (onClick) return /* @__PURE__ */ jsx("button", {
574
- type: "button",
575
- className: "event-agenda-card",
576
- onClick: () => onClick(event),
577
- children: cardContent
764
+ }), cta.hidden ? /* @__PURE__ */ jsx("span", {
765
+ className: "event-agenda-card-status status-muted",
766
+ children: cta.label
767
+ }) : /* @__PURE__ */ jsx("a", {
768
+ href: cta.href,
769
+ target: cta.external ? "_blank" : void 0,
770
+ rel: cta.external ? "noopener noreferrer" : void 0,
771
+ className: `${buttonClass} event-agenda-card-cta`,
772
+ children: cta.label
773
+ })]
774
+ })
775
+ ]
578
776
  });
579
- return /* @__PURE__ */ jsx("a", {
580
- ...eventLinkProps,
581
- className: "event-agenda-card",
582
- children: cardContent
777
+ }
778
+ function LocationIcon() {
779
+ return /* @__PURE__ */ jsxs("svg", {
780
+ className: "event-agenda-card-icon",
781
+ width: "14",
782
+ height: "14",
783
+ viewBox: "0 0 24 24",
784
+ fill: "none",
785
+ stroke: "currentColor",
786
+ strokeWidth: "2",
787
+ strokeLinecap: "round",
788
+ strokeLinejoin: "round",
789
+ "aria-hidden": "true",
790
+ children: [/* @__PURE__ */ jsx("path", { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z" }), /* @__PURE__ */ jsx("circle", {
791
+ cx: "12",
792
+ cy: "10",
793
+ r: "3"
794
+ })]
583
795
  });
584
- };
796
+ }
585
797
  //#endregion
586
798
  //#region ../blocks/src/system/runtime/nodes/events/shared/WeekAgendaView.tsx
587
799
  /** Full day names for agenda headers */
@@ -606,14 +818,16 @@ function formatAgendaDayHeader(date) {
606
818
  /**
607
819
  * WeekAgendaView Component
608
820
  *
609
- * Displays a week of events in an agenda/list style with rich event details.
610
- * Shows all 7 days with date headers, empty days show "No events scheduled".
821
+ * Displays populated days in a week as an agenda/list with rich event details.
822
+ * A week without events has one empty state instead of seven repeated messages.
611
823
  */
612
- const WeekAgendaView = ({ days, events, showCapacity, emptyMessage = "No events scheduled", calendarTimeZone, today: currentDate }) => {
824
+ const WeekAgendaView = ({ days, events, showCapacity, showVenue = true, emptyMessage = "No events scheduled", showEmptyState, calendarTimeZone, today: currentDate, buttonVariant = "primary", buttonText }) => {
613
825
  const eventsByDate = groupEventsByDate(events, calendarTimeZone);
614
- return /* @__PURE__ */ jsx("div", {
826
+ const populatedDays = days.filter((date) => (eventsByDate.get(formatDateKey(date))?.length ?? 0) > 0);
827
+ return /* @__PURE__ */ jsxs("div", {
615
828
  className: "event-agenda-week",
616
- children: days.map((date) => {
829
+ "data-agenda-state": populatedDays.length > 0 ? "populated" : showEmptyState ? "empty" : "loading",
830
+ children: [populatedDays.map((date) => {
617
831
  const dateKey = formatDateKey(date);
618
832
  const dayEvents = eventsByDate.get(dateKey) || [];
619
833
  const today = isToday(date, currentDate);
@@ -630,22 +844,40 @@ const WeekAgendaView = ({ days, events, showCapacity, emptyMessage = "No events
630
844
  })
631
845
  }), /* @__PURE__ */ jsx("div", {
632
846
  className: "event-agenda-day-content",
633
- children: dayEvents.length === 0 ? /* @__PURE__ */ jsx("p", {
634
- className: "event-agenda-day-empty",
635
- children: emptyMessage
636
- }) : /* @__PURE__ */ jsx("div", {
847
+ children: /* @__PURE__ */ jsx("div", {
637
848
  className: "event-agenda-day-events",
638
849
  children: dayEvents.map((event) => /* @__PURE__ */ jsx(AgendaEventCard, {
639
850
  event,
640
- showCapacity
851
+ showCapacity,
852
+ showVenue,
853
+ buttonVariant,
854
+ buttonText,
855
+ calendarTimeZone
641
856
  }, event.occurrenceId || event.id))
642
857
  })
643
858
  })]
644
859
  }, dateKey);
645
- })
860
+ }), populatedDays.length === 0 && showEmptyState ? /* @__PURE__ */ jsx("p", {
861
+ className: "event-agenda-empty",
862
+ children: emptyMessage
863
+ }) : null]
646
864
  });
647
865
  };
648
866
  //#endregion
867
+ //#region ../blocks/src/system/runtime/nodes/events/shared/useHydrationReady.ts
868
+ /**
869
+ * The first client render must retain the server's data-dependent shell.
870
+ * State becomes ready after hydration so subsequent loading transitions can
871
+ * use the live calendar state without changing the server markup mid-hydrate.
872
+ */
873
+ function useHydrationReady() {
874
+ const [ready, setReady] = useState(false);
875
+ useEffect(() => {
876
+ setReady(true);
877
+ }, []);
878
+ return ready;
879
+ }
880
+ //#endregion
649
881
  //#region ../blocks/src/system/runtime/nodes/events/shared/EventModalCloseButton.tsx
650
882
  function EventModalCloseButton({ closeButtonRef, onClose }) {
651
883
  return /* @__PURE__ */ jsx("button", {
@@ -714,7 +946,7 @@ function EventDetailModal({ event, showCapacity, onClose, portalRoot, cardRole =
714
946
  * Uses AgendaEventCard with onClick prop to display events.
715
947
  * Clicking an event triggers onSelectEvent (typically opens EventDetailModal).
716
948
  */
717
- function DayEventsModal({ date, events, showCapacity, onClose, onSelectEvent, portalRoot }) {
949
+ function DayEventsModal({ date, events, showCapacity, calendarTimeZone, onClose, onSelectEvent, portalRoot }) {
718
950
  const formattedDate = formatDate(`${formatLocalScheduleDate(date)}T12:00:00Z`);
719
951
  return /* @__PURE__ */ jsxs(ModalShell, {
720
952
  title: formattedDate,
@@ -744,7 +976,8 @@ function DayEventsModal({ date, events, showCapacity, onClose, onSelectEvent, po
744
976
  children: events.map((event) => /* @__PURE__ */ jsx(AgendaEventCard, {
745
977
  event,
746
978
  onClick: onSelectEvent,
747
- showCapacity
979
+ showCapacity,
980
+ calendarTimeZone
748
981
  }, event.occurrenceId || event.id))
749
982
  })]
750
983
  });
@@ -759,7 +992,7 @@ function DayEventsModal({ date, events, showCapacity, onClose, onSelectEvent, po
759
992
  * - EventDetailModal for single event view
760
993
  * - DayEventsModal for day events list (clicking an event switches to event modal)
761
994
  */
762
- function EventModals({ showCapacity, cardRole, buttonVariant, buttonText }) {
995
+ function EventModals({ showCapacity, cardRole, buttonVariant, buttonText, calendarTimeZone }) {
763
996
  const markerRef = React.useRef(null);
764
997
  const [portalRoot, setPortalRoot] = React.useState(null);
765
998
  const { modalState, openEventModal, closeModal } = useEventModal();
@@ -800,7 +1033,8 @@ function EventModals({ showCapacity, cardRole, buttonVariant, buttonText }) {
800
1033
  openEventModal(event);
801
1034
  },
802
1035
  portalRoot,
803
- showCapacity
1036
+ showCapacity,
1037
+ calendarTimeZone
804
1038
  })] });
805
1039
  return marker;
806
1040
  }
@@ -860,6 +1094,103 @@ function toEventCombinedControllerProps(props) {
860
1094
  calendarWindow: props.render.hydration.calendarWindow
861
1095
  };
862
1096
  }
1097
+ const EventCombinedCalendarHeader = ({ calendarView, title, loadState, onPrevious, onNext, onToday, buttonVariant }) => /* @__PURE__ */ jsxs("div", {
1098
+ className: "event-calendar-header",
1099
+ children: [/* @__PURE__ */ jsxs("div", {
1100
+ className: "event-calendar-nav",
1101
+ children: [
1102
+ /* @__PURE__ */ jsx("button", {
1103
+ type: "button",
1104
+ onClick: onPrevious,
1105
+ className: "event-calendar-nav-btn",
1106
+ "aria-label": calendarView === "week" ? "Previous week" : "Previous month",
1107
+ children: /* @__PURE__ */ jsx(CalendarNavigationChevron, { direction: "previous" })
1108
+ }),
1109
+ /* @__PURE__ */ jsxs("h3", {
1110
+ className: "event-calendar-title",
1111
+ children: [title, loadState.kind === "loading" && /* @__PURE__ */ jsx("span", {
1112
+ className: "rb-ml-2 rb-caption status-muted",
1113
+ children: "(loading...)"
1114
+ })]
1115
+ }),
1116
+ /* @__PURE__ */ jsx("button", {
1117
+ type: "button",
1118
+ onClick: onNext,
1119
+ className: "event-calendar-nav-btn",
1120
+ "aria-label": calendarView === "week" ? "Next week" : "Next month",
1121
+ children: /* @__PURE__ */ jsx(CalendarNavigationChevron, { direction: "next" })
1122
+ })
1123
+ ]
1124
+ }), /* @__PURE__ */ jsx("button", {
1125
+ type: "button",
1126
+ onClick: onToday,
1127
+ className: themeButtonClassName({
1128
+ variant: buttonVariant,
1129
+ size: "sm"
1130
+ }),
1131
+ children: "Today"
1132
+ })]
1133
+ });
1134
+ const EventCombinedCalendarTab = ({ calendarTabViews, calendarView, calendarViewOptions, onCalendarViewChange, calendarEvents, eventsByDate, viewDate, viewport, calendarLoadState, dayNames, calendarContext, today, goToPrevious, goToNext, goToToday, emptyMessage, showCapacity, showVenue, cardRole, buttonVariant, buttonText, showEmptyState }) => /* @__PURE__ */ jsxs(EventModalProvider, { children: [/* @__PURE__ */ jsxs("div", {
1135
+ className: "event-combined-content event-calendar",
1136
+ children: [
1137
+ calendarTabViews === "both" && /* @__PURE__ */ jsx("div", {
1138
+ className: "event-calendar-view-toggle",
1139
+ children: calendarViewOptions.map((option) => /* @__PURE__ */ jsx("button", {
1140
+ type: "button",
1141
+ className: `event-calendar-view-btn ${calendarView === option.id ? "event-calendar-view-btn--active" : ""}`,
1142
+ onClick: () => onCalendarViewChange(option.id),
1143
+ children: option.label
1144
+ }, option.id))
1145
+ }),
1146
+ /* @__PURE__ */ jsx(EventCombinedCalendarHeader, {
1147
+ calendarView,
1148
+ title: viewport.title,
1149
+ loadState: calendarLoadState,
1150
+ onPrevious: goToPrevious,
1151
+ onNext: goToNext,
1152
+ onToday: goToToday,
1153
+ buttonVariant
1154
+ }),
1155
+ viewport.kind === "week" ? /* @__PURE__ */ jsx(WeekAgendaView, {
1156
+ days: viewport.days,
1157
+ events: calendarEvents,
1158
+ emptyMessage,
1159
+ showCapacity,
1160
+ showVenue,
1161
+ showEmptyState,
1162
+ buttonVariant,
1163
+ buttonText,
1164
+ calendarTimeZone: calendarContext.timeZone,
1165
+ today
1166
+ }) : /* @__PURE__ */ jsxs("div", {
1167
+ className: "event-calendar-container",
1168
+ children: [/* @__PURE__ */ jsx(CalendarDayHeaders, { dayNames }), /* @__PURE__ */ jsx("div", {
1169
+ className: "event-calendar-grid",
1170
+ children: viewport.days.map((date) => {
1171
+ const dateKey = formatDateKey(date);
1172
+ return /* @__PURE__ */ jsx(CalendarDayCell, {
1173
+ date,
1174
+ events: eventsByDate.get(dateKey) ?? [],
1175
+ isCurrentMonth: date.month === viewDate.month,
1176
+ calendarTimeZone: calendarContext.timeZone,
1177
+ today
1178
+ }, dateKey);
1179
+ })
1180
+ })]
1181
+ }),
1182
+ viewport.kind !== "week" && calendarEvents.length === 0 && showEmptyState && /* @__PURE__ */ jsx("p", {
1183
+ className: "event-calendar-empty",
1184
+ children: emptyMessage
1185
+ })
1186
+ ]
1187
+ }), /* @__PURE__ */ jsx(EventModals, {
1188
+ cardRole,
1189
+ buttonVariant,
1190
+ buttonText,
1191
+ showCapacity,
1192
+ calendarTimeZone: calendarContext.timeZone
1193
+ })] });
863
1194
  /**
864
1195
  * EventCombined Component
865
1196
  *
@@ -870,6 +1201,7 @@ const EventCombinedClient = ({ events: initialEvents, siteId, stage, listLayout
870
1201
  kind: "loadMore",
871
1202
  label: "Load more events"
872
1203
  }, startOfWeek = "monday", calendarTabViews = "both", defaultCalendarView, showFilters, showCategoryFilter = "auto", showVenueFilter, showStaffFilter, eventSurface, filterEventPresets, scheduleScope, filterCategoryIds, filterStaffMemberId, filterVenueId, showVenue, showMap, showCapacity, cardRole, buttonVariant = "primary", buttonText = "Book", emptyMessage = "No upcoming events scheduled.", className, calendarContext, calendarWindow }) => {
1204
+ const hydrationReady = useHydrationReady();
873
1205
  const fetchInitialEventsOnMount = initialEvents == null;
874
1206
  const resolvedShowFilters = showFilters ?? true;
875
1207
  const resolvedShowVenueFilter = showVenueFilter ?? false;
@@ -927,7 +1259,7 @@ const EventCombinedClient = ({ events: initialEvents, siteId, stage, listLayout
927
1259
  pageSize,
928
1260
  stage
929
1261
  });
930
- const { events: calendarEventsRaw, viewDate, viewport, loadState: calendarLoadState, goToPrevious, goToNext, goToToday } = useCalendarEvents({
1262
+ const { events: calendarEventsRaw, viewDate, today, viewport, loadState: calendarLoadState, goToPrevious, goToNext, goToToday } = useCalendarEvents({
931
1263
  siteId,
932
1264
  view: calendarView,
933
1265
  startOfWeek,
@@ -1001,121 +1333,33 @@ const EventCombinedClient = ({ events: initialEvents, siteId, stage, listLayout
1001
1333
  hasActiveFilters,
1002
1334
  onResetFilters: resetFilters
1003
1335
  }),
1004
- activeTab === "calendar" && /* @__PURE__ */ jsxs(EventModalProvider, { children: [/* @__PURE__ */ jsxs("div", {
1005
- className: "event-combined-content event-calendar",
1006
- children: [
1007
- calendarTabViews === "both" && /* @__PURE__ */ jsx("div", {
1008
- className: "event-calendar-view-toggle",
1009
- children: calendarViewOptions.map((option) => /* @__PURE__ */ jsx("button", {
1010
- type: "button",
1011
- className: `event-calendar-view-btn ${calendarView === option.id ? "event-calendar-view-btn--active" : ""}`,
1012
- onClick: () => setCalendarView(option.id),
1013
- children: option.label
1014
- }, option.id))
1015
- }),
1016
- /* @__PURE__ */ jsxs("div", {
1017
- className: "event-calendar-header",
1018
- children: [/* @__PURE__ */ jsxs("div", {
1019
- className: "event-calendar-nav",
1020
- children: [
1021
- /* @__PURE__ */ jsx("button", {
1022
- type: "button",
1023
- onClick: goToPrevious,
1024
- className: "event-calendar-nav-btn",
1025
- "aria-label": calendarView === "week" ? "Previous week" : "Previous month",
1026
- children: /* @__PURE__ */ jsx("svg", {
1027
- width: "20",
1028
- height: "20",
1029
- fill: "none",
1030
- stroke: "currentColor",
1031
- strokeWidth: 2,
1032
- viewBox: "0 0 24 24",
1033
- children: /* @__PURE__ */ jsx("path", {
1034
- strokeLinecap: "round",
1035
- strokeLinejoin: "round",
1036
- d: "M15 19l-7-7 7-7"
1037
- })
1038
- })
1039
- }),
1040
- /* @__PURE__ */ jsxs("h3", {
1041
- className: "event-calendar-title",
1042
- children: [viewport.title, calendarLoadState.kind === "loading" && /* @__PURE__ */ jsx("span", {
1043
- className: "rb-ml-2 rb-caption status-muted",
1044
- children: "(loading...)"
1045
- })]
1046
- }),
1047
- /* @__PURE__ */ jsx("button", {
1048
- type: "button",
1049
- onClick: goToNext,
1050
- className: "event-calendar-nav-btn",
1051
- "aria-label": calendarView === "week" ? "Next week" : "Next month",
1052
- children: /* @__PURE__ */ jsx("svg", {
1053
- width: "20",
1054
- height: "20",
1055
- fill: "none",
1056
- stroke: "currentColor",
1057
- strokeWidth: 2,
1058
- viewBox: "0 0 24 24",
1059
- children: /* @__PURE__ */ jsx("path", {
1060
- strokeLinecap: "round",
1061
- strokeLinejoin: "round",
1062
- d: "M9 5l7 7-7 7"
1063
- })
1064
- })
1065
- })
1066
- ]
1067
- }), /* @__PURE__ */ jsx("button", {
1068
- type: "button",
1069
- onClick: goToToday,
1070
- className: themeButtonClassName({
1071
- variant: buttonVariant,
1072
- size: "sm"
1073
- }),
1074
- children: "Today"
1075
- })]
1076
- }),
1077
- viewport.kind === "week" ? /* @__PURE__ */ jsx(WeekAgendaView, {
1078
- days: viewport.days,
1079
- events: calendarEventsRaw,
1080
- emptyMessage: "No events scheduled",
1081
- showCapacity: resolvedShowCapacity,
1082
- calendarTimeZone: calendarContext.timeZone,
1083
- today: calendarContext.initialToday
1084
- }) : /* @__PURE__ */ jsxs("div", {
1085
- className: "event-calendar-container",
1086
- children: [/* @__PURE__ */ jsx("div", {
1087
- className: "event-calendar-day-headers",
1088
- children: dayNames.map((day) => /* @__PURE__ */ jsx("div", {
1089
- className: "event-calendar-day-header",
1090
- children: day
1091
- }, day))
1092
- }), /* @__PURE__ */ jsx("div", {
1093
- className: "event-calendar-grid",
1094
- children: viewport.days.map((date) => {
1095
- const dateKey = formatDateKey(date);
1096
- return /* @__PURE__ */ jsx(CalendarDayCell, {
1097
- date,
1098
- events: eventsByDate.get(dateKey) || [],
1099
- isCurrentMonth: date.month === viewDate.month,
1100
- today: calendarContext.initialToday
1101
- }, dateKey);
1102
- })
1103
- })]
1104
- }),
1105
- calendarEventsRaw.length === 0 && calendarLoadState.kind === "idle" && /* @__PURE__ */ jsx("p", {
1106
- className: "event-calendar-empty",
1107
- children: emptyMessage
1108
- })
1109
- ]
1110
- }), /* @__PURE__ */ jsx(EventModals, {
1336
+ activeTab === "calendar" && /* @__PURE__ */ jsx(EventCombinedCalendarTab, {
1337
+ calendarTabViews,
1338
+ calendarView,
1339
+ calendarViewOptions,
1340
+ onCalendarViewChange: setCalendarView,
1341
+ calendarEvents: calendarEventsRaw,
1342
+ eventsByDate,
1343
+ viewDate,
1344
+ viewport,
1345
+ calendarLoadState,
1346
+ dayNames,
1347
+ calendarContext,
1348
+ today,
1349
+ goToPrevious,
1350
+ goToNext,
1351
+ goToToday,
1352
+ emptyMessage,
1353
+ showCapacity: resolvedShowCapacity,
1354
+ showVenue: resolvedShowVenue,
1111
1355
  cardRole,
1112
1356
  buttonVariant,
1113
1357
  buttonText,
1114
- showCapacity: resolvedShowCapacity
1115
- })] })
1358
+ showEmptyState: hydrationReady && calendarLoadState.kind === "idle"
1359
+ })
1116
1360
  ]
1117
1361
  });
1118
1362
  };
1119
1363
  const EventCombinedIslandClient = (props) => /* @__PURE__ */ jsx(EventCombinedClient, { ...toEventCombinedControllerProps(props) });
1120
1364
  //#endregion
1121
- export { CalendarDayCell as a, useCalendarEvents as c, WeekAgendaView as i, EventCombinedIslandClient as n, EventModalProvider as o, EventModals as r, useEventModal as s, EventCombinedClient as t };
1365
+ export { WeekAgendaView as a, CalendarDayCell as c, useCalendarEvents as d, useHydrationReady as i, EventModalProvider as l, EventCombinedIslandClient as n, CalendarNavigationChevron as o, EventModals as r, CalendarDayHeaders as s, EventCombinedClient as t, useEventModal as u };