@riverbankcms/sdk 0.125.0 → 0.126.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 (121) hide show
  1. package/README.md +3 -1
  2. package/dist/{PreviewEditorSidebar-BezDOtQ7.mjs → PreviewEditorSidebar-DcYJxTgc.mjs} +67 -266
  3. package/dist/{PreviewEditorUI-CgSqmfo2.mjs → PreviewEditorUI-Ctt1yTJr.mjs} +3 -3
  4. package/dist/{PreviewQueryProvider-BH-3-jSj.mjs → PreviewQueryProvider-DgFDIwvK.mjs} +1 -1
  5. package/dist/{SdkPreviewModeRuntime-Co3AHfj0.mjs → SdkPreviewModeRuntime-CvW1vdQ4.mjs} +27 -27
  6. package/dist/{SiteChromeCustomizeContext-BHF-KANn.mjs → SiteChromeCustomizeContext-C87qlKWw.mjs} +412 -1301
  7. package/dist/_dts/ai/src/contracts/proposals.d.ts +1354 -202
  8. package/dist/_dts/api/src/common/envelope.d.ts +1 -1
  9. package/dist/_dts/api/src/contentRuntime.d.ts +0 -2
  10. package/dist/_dts/api/src/endpoints.d.ts +0 -7
  11. package/dist/_dts/api/src/sdk-event-upsert.d.ts +42 -0
  12. package/dist/_dts/api/src/sdkContracts.d.ts +11 -9
  13. package/dist/_dts/api/src/siteOperations.d.ts +18 -1
  14. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +1 -14
  15. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +15 -2
  16. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +182 -19
  17. package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +1 -2
  18. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +2 -3
  19. package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +1 -2
  20. package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +3 -12
  21. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +3 -13
  22. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +8 -100
  23. package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +1 -4
  24. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +1 -15
  25. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorSnapshot.d.ts +11 -21
  26. package/dist/_dts/sdk/src/cli/commands/event.d.ts +2 -2
  27. package/dist/_dts/sdk/src/cli/commands/eventOccurrenceSchedule.d.ts +12 -0
  28. package/dist/_dts/sdk/src/cli/commands/push/pushAllExtras.d.ts +6 -0
  29. package/dist/_dts/sdk/src/cli/commands/style.d.ts +1 -1
  30. package/dist/_dts/sdk/src/cli/content/legacyEventScheduleShapeError.d.ts +5 -0
  31. package/dist/_dts/sdk/src/cli/content/localEventSchedule.d.ts +17 -0
  32. package/dist/_dts/sdk/src/cli/content/reader.d.ts +5 -10
  33. package/dist/_dts/sdk/src/cli/migrations/events.d.ts +1 -1
  34. package/dist/_dts/sdk/src/cli/site-commands/eventScheduleCompiler.d.ts +24 -0
  35. package/dist/_dts/sdk/src/client/management/http.d.ts +1 -1
  36. package/dist/_dts/sdk/src/client/management/types.d.ts +3 -28
  37. package/dist/_dts/sdk/src/config/index.d.ts +1 -1
  38. package/dist/_dts/sdk/src/public-api/contracts.d.ts +5 -20
  39. package/dist/_dts/sdk/src/rendering/index.d.ts +1 -1
  40. package/dist/_dts/sdk/src/version.d.ts +1 -1
  41. package/dist/_dts/site-commands/src/commandContract.d.ts +33 -5
  42. package/dist/_dts/site-commands/src/commandDomain.d.ts +2 -2
  43. package/dist/_dts/site-commands/src/commands.d.ts +38 -9
  44. package/dist/_dts/site-commands/src/siteStyleCommandSchema.d.ts +28 -1
  45. package/dist/_dts/site-commands/src/siteStyleSelectionSchemaBuilder.d.ts +4 -4
  46. package/dist/_dts/theme-core/src/palette/concretePalette.d.ts +20 -0
  47. package/dist/_dts/theme-core/src/palette/curated/index.d.ts +2 -17
  48. package/dist/_dts/theme-core/src/palette/index.d.ts +1 -6
  49. package/dist/_dts/theme-core/src/palette/schema.d.ts +39 -0
  50. package/dist/_dts/theme-core/src/schema.d.ts +38 -26
  51. package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +4 -6
  52. package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +5 -6
  53. package/dist/cli/index.mjs +612 -522
  54. package/dist/cli/init-docs/content/cli-reference.md +6 -3
  55. package/dist/cli/init-docs/content/content-management.md +24 -13
  56. package/dist/client/{DiscountCodeDisclosure-CyPpekBp.mjs → DiscountCodeDisclosure-DS0AuFWW.mjs} +1 -1
  57. package/dist/client/{EventCombined.client-zywit-60.mjs → EventCombined.client-DtMxLr7q.mjs} +2 -2
  58. package/dist/client/{EventListing.client-J2nLhkKT.mjs → EventListing.client-BdLSRNg1.mjs} +2 -2
  59. package/dist/client/{LeafletStaticMap-CSubXWt6.mjs → LeafletStaticMap-BrpC6vsT.mjs} +1 -1
  60. package/dist/client/{MagicLinkForm-DDLIfiq9.mjs → MagicLinkForm-Bt3IuLMy.mjs} +1 -1
  61. package/dist/client/{StepIndicator-DE8EvHIp.mjs → StepIndicator-CBYPFVoy.mjs} +2 -2
  62. package/dist/client/{accordion-Ct5T5NiA.mjs → accordion-BqqwPJWM.mjs} +1 -1
  63. package/dist/client/{bookingForm-DMxtLPxw.mjs → bookingForm-SneP3yxC.mjs} +5 -6
  64. package/dist/client/bookings.mjs +190 -24
  65. package/dist/client/{carousel--FMqgvob.mjs → carousel-BTIR9L3I.mjs} +1 -1
  66. package/dist/client/{cart-BKX1bWiU.mjs → cart-bqiqd8SX.mjs} +3 -3
  67. package/dist/client/{checkout-B_jxi4WW.mjs → checkout-WbTFV5v4.mjs} +3 -3
  68. package/dist/client/client.mjs +156 -220
  69. package/dist/client/{courseRegistration-DH4MlkRD.mjs → courseRegistration-BcemLAdN.mjs} +6 -7
  70. package/dist/client/{eventCalendar-BQILwAcL.mjs → eventCalendar-CsxIw0V_.mjs} +4 -4
  71. package/dist/client/{eventCombined-DFFW_Vmo.mjs → eventCombined-B6XMoHfa.mjs} +2 -2
  72. package/dist/client/{eventDetails-B045CTSJ.mjs → eventDetails-BJaoPPfo.mjs} +3 -3
  73. package/dist/client/{eventListing-BDMYNVzS.mjs → eventListing-DgwdYHRT.mjs} +2 -2
  74. package/dist/client/{eventRegistration-CQ2-BSnB.mjs → eventRegistration-C0O3folu.mjs} +30 -22
  75. package/dist/client/{form-DJKuyZgN.mjs → form-Bk9txGFt.mjs} +1 -1
  76. package/dist/client/{headerSection-DeTjfiDo.mjs → headerSection-yIBt0yTv.mjs} +2 -2
  77. package/dist/client/hooks.mjs +50 -102
  78. package/dist/client/{locationMap-i2wDA8gB.mjs → locationMap-C-3KIpv-.mjs} +2 -2
  79. package/dist/client/{newsletterForm-DKiueauk.mjs → newsletterForm-CzB8g8h2.mjs} +1 -1
  80. package/dist/client/{pricing-C01J3Epx.mjs → pricing-C1QeDes_.mjs} +1 -1
  81. package/dist/client/{productDetail-Dfc1sZaX.mjs → productDetail-w7SBp5uc.mjs} +3 -3
  82. package/dist/client/{productList-BXbvXWTF.mjs → productList-D0tGKHGf.mjs} +3 -3
  83. package/dist/client/{propsDecoder-CIR5DQ1l.mjs → propsDecoder-Bcin2DB3.mjs} +167 -11
  84. package/dist/client/rendering/client.mjs +219 -276
  85. package/dist/client/rendering/islands.mjs +18 -18
  86. package/dist/client/rendering.mjs +128 -185
  87. package/dist/client/{useDiscountCodeUi-Bcyh4508.mjs → scrollToBlock-h-o_STf_.mjs} +18 -2
  88. package/dist/client/{shop-BbNwPKM-.mjs → shop-BGzmL8O_.mjs} +5 -6
  89. package/dist/client/{shop-commerce-XO-XMFEt.mjs → shop-commerce-lX8QxjX-.mjs} +4 -4
  90. package/dist/client/{shop-commerce-store-Byh6OUGK.mjs → shop-commerce-store-CEurARtu.mjs} +1 -1
  91. package/dist/client/{shopShared-Bbq39mwr.mjs → shopShared-DXxH8xxw.mjs} +2 -2
  92. package/dist/client/{useEventFilters-C8OOJ3el.mjs → useEventFilters-B591g9vd.mjs} +2 -2
  93. package/dist/client/{usePolling-CyJVo9kF.mjs → usePolling-BvnChV4m.mjs} +2 -2
  94. package/dist/preview-next/before-render.mjs +0 -7
  95. package/dist/preview-next/client/runtime.mjs +4 -4
  96. package/dist/preview-next/middleware.mjs +0 -7
  97. package/dist/{previewAuthStore-CJX21dGi.mjs → previewAuthStore-Dev9CdG9.mjs} +0 -7
  98. package/dist/{sdk-runtime-BGhyuE-E.mjs → sdk-runtime-M__i3Jce.mjs} +2 -2
  99. package/dist/{separator-BFs-Kmv5.mjs → separator-VSlnI9bc.mjs} +1 -1
  100. package/dist/server/components.mjs +87 -139
  101. package/dist/server/config-validation.mjs +50 -102
  102. package/dist/server/config.mjs +50 -102
  103. package/dist/server/data.mjs +50 -102
  104. package/dist/server/index.mjs +1 -8
  105. package/dist/server/next.mjs +91 -150
  106. package/dist/server/page-converter.mjs +50 -102
  107. package/dist/server/prebuild.mjs +1 -1
  108. package/dist/server/rendering/server.mjs +50 -102
  109. package/dist/server/rendering.mjs +88 -140
  110. package/dist/server/routing.mjs +71 -147
  111. package/dist/server/server.mjs +51 -110
  112. package/dist/server/theme-bridge.mjs +172 -162
  113. package/dist/server/theme.mjs +167 -11
  114. package/package.json +1 -1
  115. package/dist/_dts/theme-core/src/palette/editorState.d.ts +0 -75
  116. package/dist/_dts/theme-core/src/palette/libraryModel.d.ts +0 -64
  117. package/dist/_dts/theme-core/src/palette/persistenceReadSource.d.ts +0 -81
  118. package/dist/_dts/theme-core/src/palette/resolveSelection.d.ts +0 -75
  119. package/dist/_dts/theme-core/src/palette/selection.d.ts +0 -74
  120. package/dist/_dts/theme-core/src/palette/sitePalettePersistence.d.ts +0 -34
  121. package/dist/client/scrollToBlock-C86BYkyV.mjs +0 -17
@@ -1,16 +1,15 @@
1
1
  "use client";
2
- import { At as formatBookingTime, Dt as formatBookingDate, Ft as toBookingTimeZone, Gt as assertNever, It as toScheduledBookingDateTime, Lt as parseEventPageSurfaceSubject, X as themeButtonClassName, t as defineIslandPropsDecoder } from "./propsDecoder-CIR5DQ1l.mjs";
3
- import { n as formatCoursePriceDisplay, r as resolveCoursePricingState, t as formatCoursePriceAmount } from "./pricing-C01J3Epx.mjs";
2
+ import { At as formatBookingTime, Dt as formatBookingDate, Ft as toBookingTimeZone, Gt as assertNever, It as toScheduledBookingDateTime, Lt as parseEventPageSurfaceSubject, X as themeButtonClassName, t as defineIslandPropsDecoder } from "./propsDecoder-Bcin2DB3.mjs";
3
+ import { n as formatCoursePriceDisplay, r as resolveCoursePricingState, t as formatCoursePriceAmount } from "./pricing-C1QeDes_.mjs";
4
4
  import { n as useBlockApi, t as BlockApiProvider } from "./context-CJz1Vlsz.mjs";
5
5
  import { n as isSpamProtectionEnabled, r as AltchaWidget, t as getChallengeUrl } from "./src-B833rYRr.mjs";
6
- import { i as CheckIcon, n as TerminalPanel, r as StateIcon, t as useDiscountCodeUi } from "./useDiscountCodeUi-Bcyh4508.mjs";
7
- import { t as DiscountCodeDisclosure } from "./DiscountCodeDisclosure-CyPpekBp.mjs";
8
- import { n as SpinnerNode, r as formatPrice, t as StepIndicator$1 } from "./StepIndicator-DE8EvHIp.mjs";
6
+ import { a as CheckIcon, i as StateIcon, n as useDiscountCodeUi, r as TerminalPanel, t as scrollToBlock } from "./scrollToBlock-h-o_STf_.mjs";
7
+ import { t as DiscountCodeDisclosure } from "./DiscountCodeDisclosure-DS0AuFWW.mjs";
8
+ import { n as SpinnerNode, r as formatPrice, t as StepIndicator$1 } from "./StepIndicator-CBYPFVoy.mjs";
9
9
  import { t as FeedbackMessage } from "./FeedbackMessage-ByMrs3cr.mjs";
10
10
  import { n as getFieldValidationControlProps, t as FieldValidationMessage } from "./FieldValidationMessage-AYanWFb-.mjs";
11
11
  import { t as buildCheckoutReturnUrls } from "./checkoutUrls-Ct8Mxna3.mjs";
12
- import { t as scrollToBlock } from "./scrollToBlock-C86BYkyV.mjs";
13
- import { a as ClockIcon, i as LoggedInAsUser, n as logoutPortal, r as useWaitlistClaim, t as MagicLinkForm } from "./MagicLinkForm-DDLIfiq9.mjs";
12
+ import { a as ClockIcon, i as LoggedInAsUser, n as logoutPortal, r as useWaitlistClaim, t as MagicLinkForm } from "./MagicLinkForm-Bt3IuLMy.mjs";
14
13
  import { t as CrossIcon } from "./CrossIcon-Dn1KRKW5.mjs";
15
14
  import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
16
15
  import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-UNsfPcYq.mjs";
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { t as clsx } from "./clsx-DgIEfj3H.mjs";
3
- import { E as getEventRuntimeFiltersKey, F as formatEventTeacherLine, G as getLocalDateKey, I as formatTime, K as getLocalMinuteOfDay, T as buildEventRuntimeFilters, U as getEventAvailability, V as resolveEventLinkProps, W as getEventAvailabilityStatus, X as themeButtonClassName, t as defineIslandPropsDecoder, w as buildEventCalendarListingRender, z as groupEventsByDate } from "./propsDecoder-CIR5DQ1l.mjs";
4
- import { o as EventFilters, t as useEventFilters } from "./useEventFilters-C8OOJ3el.mjs";
5
- import { a as CalendarDayCell, c as useCalendarEvents, d as getOrderedDayNames, f as getWeekCalendarDayTuple, h as isToday, i as WeekAgendaView, l as MONTH_NAMES, m as isSameLocalDay, o as EventModalProvider, p as getWeekCalendarDays, r as EventModals, s as useEventModal, t as EventCombinedClient, u as formatDateKey } from "./EventCombined.client-zywit-60.mjs";
3
+ import { E as getEventRuntimeFiltersKey, F as formatEventTeacherLine, G as getLocalDateKey, I as formatTime, K as getLocalMinuteOfDay, T as buildEventRuntimeFilters, U as getEventAvailability, V as resolveEventLinkProps, W as getEventAvailabilityStatus, X as themeButtonClassName, t as defineIslandPropsDecoder, w as buildEventCalendarListingRender, z as groupEventsByDate } from "./propsDecoder-Bcin2DB3.mjs";
4
+ import { o as EventFilters, t as useEventFilters } from "./useEventFilters-B591g9vd.mjs";
5
+ import { a as CalendarDayCell, c as useCalendarEvents, d as getOrderedDayNames, f as getWeekCalendarDayTuple, h as isToday, i as WeekAgendaView, l as MONTH_NAMES, m as isSameLocalDay, o as EventModalProvider, p as getWeekCalendarDays, r as EventModals, s as useEventModal, t as EventCombinedClient, u as formatDateKey } from "./EventCombined.client-DtMxLr7q.mjs";
6
6
  import { t as BlockApiProvider } from "./context-CJz1Vlsz.mjs";
7
7
  import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
8
8
  import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-UNsfPcYq.mjs";
9
- import { n as EventListingController } from "./EventListing.client-J2nLhkKT.mjs";
9
+ import { n as EventListingController } from "./EventListing.client-BdLSRNg1.mjs";
10
10
  import { useEffect, useId, useMemo, useState } from "react";
11
11
  import { jsx, jsxs } from "react/jsx-runtime";
12
12
  //#region ../calendar/src/lane-packing.ts
@@ -1,5 +1,5 @@
1
- import { t as defineIslandPropsDecoder } from "./propsDecoder-CIR5DQ1l.mjs";
2
- import { n as EventCombinedIslandClient } from "./EventCombined.client-zywit-60.mjs";
1
+ import { t as defineIslandPropsDecoder } from "./propsDecoder-Bcin2DB3.mjs";
2
+ import { n as EventCombinedIslandClient } from "./EventCombined.client-DtMxLr7q.mjs";
3
3
  import { t as BlockApiProvider } from "./context-CJz1Vlsz.mjs";
4
4
  import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
5
5
  import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-UNsfPcYq.mjs";
@@ -1,8 +1,8 @@
1
- import { Ft as toBookingTimeZone, H as resolveRuntimeEventPricing, It as toScheduledBookingDateTime, M as formatEventDateParts, Mt as getBookingLocalDateKey, N as formatEventPrice, V as resolveEventLinkProps, Vt as publicEventPricingType, Wt as formatCurrencyAmount, Y as resolveEventRegistrationScopedEvents, t as defineIslandPropsDecoder, zt as publicEventPricingCurrency } from "./propsDecoder-CIR5DQ1l.mjs";
2
- import { n as formatCoursePriceDisplay, r as resolveCoursePricingState, t as formatCoursePriceAmount } from "./pricing-C01J3Epx.mjs";
1
+ import { Ft as toBookingTimeZone, H as resolveRuntimeEventPricing, It as toScheduledBookingDateTime, M as formatEventDateParts, Mt as getBookingLocalDateKey, N as formatEventPrice, V as resolveEventLinkProps, Vt as publicEventPricingType, Wt as formatCurrencyAmount, Y as resolveEventRegistrationScopedEvents, t as defineIslandPropsDecoder, zt as publicEventPricingCurrency } from "./propsDecoder-Bcin2DB3.mjs";
2
+ import { n as formatCoursePriceDisplay, r as resolveCoursePricingState, t as formatCoursePriceAmount } from "./pricing-C1QeDes_.mjs";
3
3
  import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
4
4
  import { n as filterPassesForEvent, t as filterMembershipsForEvent } from "./eventProductEligibility-AVxyCB1u.mjs";
5
- import { t as LeafletStaticMap } from "./LeafletStaticMap-CSubXWt6.mjs";
5
+ import { t as LeafletStaticMap } from "./LeafletStaticMap-BrpC6vsT.mjs";
6
6
  import "react";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  //#region ../blocks/src/system/runtime/nodes/event-details/logic.ts
@@ -1,8 +1,8 @@
1
- import { t as defineIslandPropsDecoder } from "./propsDecoder-CIR5DQ1l.mjs";
1
+ import { t as defineIslandPropsDecoder } from "./propsDecoder-Bcin2DB3.mjs";
2
2
  import { t as BlockApiProvider } from "./context-CJz1Vlsz.mjs";
3
3
  import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
4
4
  import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-UNsfPcYq.mjs";
5
- import { t as EventListingClient } from "./EventListing.client-J2nLhkKT.mjs";
5
+ import { t as EventListingClient } from "./EventListing.client-BdLSRNg1.mjs";
6
6
  import "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  //#region src/rendering/islands/enhancers/eventListing.tsx
@@ -1,16 +1,17 @@
1
1
  "use client";
2
- import { n as buildBookingPaymentSelectionViewModel, t as usePolling } from "./usePolling-CyJVo9kF.mjs";
3
- import { At as formatBookingTime, Bt as publicEventPricingMode, C as getWizardStepsForContext, Dt as formatBookingDate, Ft as toBookingTimeZone, H as resolveRuntimeEventPricing, Ht as publicEventScalarPrice, It as toScheduledBookingDateTime, Ot as formatBookingDateTime, P as formatEventPriceDisplay, S as getStepNumber, Ut as publicEventTicketTypes, Vt as publicEventPricingType, Wt as formatCurrencyAmount, X as themeButtonClassName, Y as resolveEventRegistrationScopedEvents, _ as findPreSelectedEvent, b as resolveRegistrationTarget, g as findEventByOccurrenceId, h as toRegistrationEvents, t as defineIslandPropsDecoder, v as resolveDiscountContext, x as WIZARD_STEPS, y as resolveEventRequiresPayment, yt as assertNever, zt as publicEventPricingCurrency } from "./propsDecoder-CIR5DQ1l.mjs";
2
+ import { n as buildBookingPaymentSelectionViewModel, t as usePolling } from "./usePolling-BvnChV4m.mjs";
3
+ import { At as formatBookingTime, Bt as publicEventPricingMode, C as getWizardStepsForContext, Dt as formatBookingDate, Ft as toBookingTimeZone, H as resolveRuntimeEventPricing, Ht as publicEventScalarPrice, It as toScheduledBookingDateTime, Ot as formatBookingDateTime, P as formatEventPriceDisplay, S as getStepNumber, Ut as publicEventTicketTypes, Vt as publicEventPricingType, Wt as formatCurrencyAmount, X as themeButtonClassName, Y as resolveEventRegistrationScopedEvents, _ as findPreSelectedEvent, b as resolveRegistrationTarget, g as findEventByOccurrenceId, h as toRegistrationEvents, t as defineIslandPropsDecoder, v as resolveDiscountContext, x as WIZARD_STEPS, y as resolveEventRequiresPayment, yt as assertNever, zt as publicEventPricingCurrency } from "./propsDecoder-Bcin2DB3.mjs";
4
4
  import { n as useBlockApi, t as BlockApiProvider } from "./context-CJz1Vlsz.mjs";
5
5
  import { n as isSpamProtectionEnabled, r as AltchaWidget, t as getChallengeUrl } from "./src-B833rYRr.mjs";
6
- import { i as CheckIcon, n as TerminalPanel, r as StateIcon, t as useDiscountCodeUi } from "./useDiscountCodeUi-Bcyh4508.mjs";
7
- import { t as DiscountCodeDisclosure } from "./DiscountCodeDisclosure-CyPpekBp.mjs";
8
- import { n as SpinnerNode, r as formatPrice, t as StepIndicator$1 } from "./StepIndicator-DE8EvHIp.mjs";
6
+ import { a as CheckIcon, i as StateIcon, n as useDiscountCodeUi, r as TerminalPanel, t as scrollToBlock } from "./scrollToBlock-h-o_STf_.mjs";
7
+ import { t as DiscountCodeDisclosure } from "./DiscountCodeDisclosure-DS0AuFWW.mjs";
8
+ import { n as SpinnerNode, r as formatPrice, t as StepIndicator$1 } from "./StepIndicator-CBYPFVoy.mjs";
9
9
  import { t as FeedbackMessage } from "./FeedbackMessage-ByMrs3cr.mjs";
10
10
  import { n as getFieldValidationControlProps, t as FieldValidationMessage } from "./FieldValidationMessage-AYanWFb-.mjs";
11
+ import { t as buildCheckoutReturnUrls } from "./checkoutUrls-Ct8Mxna3.mjs";
11
12
  import { t as createBodyThemePortalRoot } from "./themePortalRoot-AGs4cE7t.mjs";
12
13
  import { t as consumeSearchParam } from "./urlParams-D71VXFGx.mjs";
13
- import { a as ClockIcon, i as LoggedInAsUser, n as logoutPortal, r as useWaitlistClaim, t as MagicLinkForm } from "./MagicLinkForm-DDLIfiq9.mjs";
14
+ import { a as ClockIcon, i as LoggedInAsUser, n as logoutPortal, r as useWaitlistClaim, t as MagicLinkForm } from "./MagicLinkForm-Bt3IuLMy.mjs";
14
15
  import { t as CrossIcon } from "./CrossIcon-Dn1KRKW5.mjs";
15
16
  import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
16
17
  import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-UNsfPcYq.mjs";
@@ -2595,6 +2596,9 @@ function usePaymentVerificationWithDeps(config, deps) {
2595
2596
  };
2596
2597
  }
2597
2598
  //#endregion
2599
+ //#region ../blocks/src/system/runtime/nodes/event-registration/constants.ts
2600
+ const EVENT_REGISTRATION_ANCHOR_ID = "event-registration";
2601
+ //#endregion
2598
2602
  //#region ../blocks/src/system/runtime/nodes/event-registration/sessionStorage.ts
2599
2603
  const STORAGE_PREFIX = "riverbank:event-registration:";
2600
2604
  const STALE_THRESHOLD_MS = 1440 * 60 * 1e3;
@@ -2771,16 +2775,29 @@ function cleanupStaleRegistrations() {
2771
2775
  }
2772
2776
  //#endregion
2773
2777
  //#region ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.ts
2778
+ const eventRegistrationStripeReturnDeps = {
2779
+ usePaymentVerification,
2780
+ consumeSearchParam,
2781
+ scrollToBlock,
2782
+ cleanupStaleRegistrations,
2783
+ clearPendingRegistration,
2784
+ getPendingRegistration
2785
+ };
2774
2786
  function useEventRegistrationStripeReturn(options) {
2787
+ return useEventRegistrationStripeReturnWithDeps(options, eventRegistrationStripeReturnDeps);
2788
+ }
2789
+ function useEventRegistrationStripeReturnWithDeps(options, deps) {
2775
2790
  const { api, events, occurrenceId, pendingAttendeeId, setErrorMessage, setFormData, setPaymentSelection, setPendingAttendeeId, setRegistrationResult, setSelectedEvent, setSelectedAttendanceMode, setTicketSelections, setStep, setTicketsCount, step } = options;
2776
- const verification = usePaymentVerification(useMemo(() => step === "verifying-payment" && pendingAttendeeId ? { transactionId: pendingAttendeeId } : null, [step, pendingAttendeeId]));
2791
+ const verificationConfig = useMemo(() => step === "verifying-payment" && pendingAttendeeId ? { transactionId: pendingAttendeeId } : null, [step, pendingAttendeeId]);
2792
+ const verification = deps.usePaymentVerification(verificationConfig);
2777
2793
  useEffect(() => {
2778
- cleanupStaleRegistrations();
2779
- const registrationStatus = consumeSearchParam("registration");
2780
- if (!registrationStatus) return;
2794
+ deps.cleanupStaleRegistrations();
2795
+ const registrationStatus = deps.consumeSearchParam("registration");
2796
+ if (registrationStatus !== "cancelled" && registrationStatus !== "success") return;
2797
+ deps.scrollToBlock(EVENT_REGISTRATION_ANCHOR_ID);
2781
2798
  const siteId = api.config.siteId;
2782
2799
  if (!siteId) return;
2783
- const pending = getPendingRegistration(siteId, occurrenceId || void 0);
2800
+ const pending = deps.getPendingRegistration(siteId, occurrenceId || void 0);
2784
2801
  if (!pending) return;
2785
2802
  setFormData(pending.formData);
2786
2803
  setTicketSelections(pending.ticketSelections);
@@ -2800,7 +2817,7 @@ function useEventRegistrationStripeReturn(options) {
2800
2817
  useEffect(() => {
2801
2818
  if (verification.status === "completed") {
2802
2819
  const siteId = api.config.siteId;
2803
- if (siteId && occurrenceId) clearPendingRegistration(siteId, occurrenceId);
2820
+ if (siteId && occurrenceId) deps.clearPendingRegistration(siteId, occurrenceId);
2804
2821
  setRegistrationResult({ status: "confirmed" });
2805
2822
  setStep("success");
2806
2823
  } else if (verification.status === "failed") {
@@ -2911,13 +2928,7 @@ function useEventRegistrationSubmitWithDeps(options, deps) {
2911
2928
  if (!result.alreadyRegistered && result.status === "confirmed" && result.pendingPayment && (method === "stripe" || method === "pass_bundle" || method === "membership_bundle")) {
2912
2929
  options.setPendingAttendeeId(result.attendeeId);
2913
2930
  options.setStep("redirecting");
2914
- const currentUrl = new URL(window.location.href);
2915
- const successParams = new URLSearchParams(currentUrl.search);
2916
- successParams.set("registration", "success");
2917
- const successUrl = `${currentUrl.origin}${currentUrl.pathname}?${successParams.toString()}${currentUrl.hash}`;
2918
- const cancelParams = new URLSearchParams(currentUrl.search);
2919
- cancelParams.set("registration", "cancelled");
2920
- const cancelUrl = `${currentUrl.origin}${currentUrl.pathname}?${cancelParams.toString()}${currentUrl.hash}`;
2931
+ const { successUrl, cancelUrl } = buildCheckoutReturnUrls("registration", EVENT_REGISTRATION_ANCHOR_ID);
2921
2932
  const checkoutType = method === "pass_bundle" ? "pass_bundle" : method === "membership_bundle" ? "membership_bundle" : "event";
2922
2933
  const checkoutResult = await options.api.createEventCheckout({
2923
2934
  attendeeId: result.attendeeId,
@@ -3653,9 +3664,6 @@ function useEventRegistrationWizardWithDeps(options, deps) {
3653
3664
  };
3654
3665
  }
3655
3666
  //#endregion
3656
- //#region ../blocks/src/system/runtime/nodes/event-registration/constants.ts
3657
- const EVENT_REGISTRATION_ANCHOR_ID = "event-registration";
3658
- //#endregion
3659
3667
  //#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizard.tsx
3660
3668
  const EVENT_PORTAL_AUTH_COPY = {
3661
3669
  membership: {
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { t as clsx } from "./clsx-DgIEfj3H.mjs";
3
- import { St as ok, X as themeButtonClassName, t as defineIslandPropsDecoder, xt as err, yt as assertNever } from "./propsDecoder-CIR5DQ1l.mjs";
3
+ import { St as ok, X as themeButtonClassName, t as defineIslandPropsDecoder, xt as err, yt as assertNever } from "./propsDecoder-Bcin2DB3.mjs";
4
4
  import { n as useBlockApi, t as BlockApiProvider } from "./context-CJz1Vlsz.mjs";
5
5
  import { n as isSpamProtectionEnabled, r as AltchaWidget, t as getChallengeUrl } from "./src-B833rYRr.mjs";
6
6
  import { t as FeedbackMessage } from "./FeedbackMessage-ByMrs3cr.mjs";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { X as themeButtonClassName, r as buildCartDisplay, t as defineIslandPropsDecoder } from "./propsDecoder-CIR5DQ1l.mjs";
2
+ import { X as themeButtonClassName, r as buildCartDisplay, t as defineIslandPropsDecoder } from "./propsDecoder-Bcin2DB3.mjs";
3
3
  import { t as resolveDedicatedCheckoutPath } from "./checkoutRoute-ClwHwYVA.mjs";
4
- import { n as useCommerceCart } from "./shop-commerce-store-Byh6OUGK.mjs";
4
+ import { n as useCommerceCart } from "./shop-commerce-store-CEurARtu.mjs";
5
5
  import { t as ModalShell } from "./ModalShell-CqkBvBIC.mjs";
6
6
  import * as React$1 from "react";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -2954,6 +2954,21 @@ const themeColorTokenSchema = z$1.string().min(1).refine((value) => Boolean(isTh
2954
2954
  //#region ../theme-core/src/palette/colors.ts
2955
2955
  const HEX_COLOR_REGEX = /^#[0-9a-f]{6}$/;
2956
2956
  const NORMALIZABLE_HEX_REGEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
2957
+ const THEME_PALETTE_COLOR_ORDER = [
2958
+ "primary",
2959
+ "secondary",
2960
+ "accent",
2961
+ "success",
2962
+ "warning",
2963
+ "destructive",
2964
+ "background",
2965
+ "surface",
2966
+ "surfaceAlt",
2967
+ "muted",
2968
+ "text",
2969
+ "primaryForeground",
2970
+ "border"
2971
+ ];
2957
2972
  const hexColorSchema = z$1.string().regex(HEX_COLOR_REGEX, "Hex must be #RRGGBB (lowercase)").transform((value) => value);
2958
2973
  const paletteModeSchema = z$1.enum(["light", "dark"]);
2959
2974
  const PALETTE_VALUE_KEY_PREFIX = "palette-value:v1|";
@@ -3031,6 +3046,12 @@ function requirePaletteColorsFromEntries(entries) {
3031
3046
  if (result.ok) return result.colors;
3032
3047
  throw new Error(`Invalid complete palette: ${result.error.kind}`);
3033
3048
  }
3049
+ function paletteColorEntries(colors) {
3050
+ return THEME_PALETTE_COLOR_ORDER.map((name) => ({
3051
+ name,
3052
+ hex: colors[name]
3053
+ }));
3054
+ }
3034
3055
  function paletteColorFingerprint(colors) {
3035
3056
  return PALETTE_TOKEN_NAMES.map((name) => `${name}:${colors[name]}`).join("|");
3036
3057
  }
@@ -4364,13 +4385,6 @@ const warmDarkKirtanGold = defineCuratedPalette({
4364
4385
  });
4365
4386
  //#endregion
4366
4387
  //#region ../theme-core/src/palette/curated/index.ts
4367
- /**
4368
- * Curated palette library.
4369
- *
4370
- * Authoring keys are readable source aliases. Value keys are derived from the
4371
- * complete mode and semantic colours and are the only curated identity used at
4372
- * persistence and runtime boundaries.
4373
- */
4374
4388
  function admitCuratedPaletteDefinition(definition) {
4375
4389
  return {
4376
4390
  ...definition,
@@ -4397,11 +4411,8 @@ const curatedPalettes = [
4397
4411
  admitCuratedPaletteDefinition(warmDarkEmber),
4398
4412
  admitCuratedPaletteDefinition(warmDarkKirtanGold)
4399
4413
  ];
4400
- const curatedPalettesByValueKey = new Map(curatedPalettes.map((palette) => [palette.valueKey, palette]));
4414
+ new Map(curatedPalettes.map((palette) => [palette.valueKey, palette]));
4401
4415
  const curatedPalettesByAuthoringKey = new Map(curatedPalettes.map((palette) => [palette.authoringKey, palette]));
4402
- function findCuratedPalette(valueKey) {
4403
- return curatedPalettesByValueKey.get(valueKey);
4404
- }
4405
4416
  function findCuratedPaletteByAuthoringKey(authoringKey) {
4406
4417
  return curatedPalettesByAuthoringKey.get(authoringKey);
4407
4418
  }
@@ -4410,87 +4421,6 @@ function requireCuratedPaletteValueKey(authoringKey) {
4410
4421
  if (!palette) throw new Error(`Unknown curated palette authoring key "${authoringKey}"`);
4411
4422
  return palette.valueKey;
4412
4423
  }
4413
- /** Parses a raw persisted key into catalogue-proven curated membership. */
4414
- const knownCuratedPaletteValueKeySchema = z$1.string().transform((value, ctx) => {
4415
- const valueKey = parsePaletteValueKey(value);
4416
- if (!valueKey) {
4417
- ctx.addIssue({
4418
- code: "custom",
4419
- message: "Invalid canonical palette value key"
4420
- });
4421
- return z$1.NEVER;
4422
- }
4423
- const palette = findCuratedPalette(valueKey);
4424
- if (!palette) {
4425
- ctx.addIssue({
4426
- code: "custom",
4427
- message: "Unknown curated palette value key"
4428
- });
4429
- return z$1.NEVER;
4430
- }
4431
- return palette.valueKey;
4432
- });
4433
- //#endregion
4434
- //#region ../theme-core/src/palette/selection.ts
4435
- const sitePaletteIdSchema = z$1.string().uuid().transform((value) => value);
4436
- const sitePaletteVersionSchema = z$1.number().int().nonnegative().transform((value) => value);
4437
- const paletteSelectionSchema = z$1.discriminatedUnion("kind", [z$1.object({
4438
- kind: z$1.literal("curated"),
4439
- valueKey: knownCuratedPaletteValueKeySchema
4440
- }), z$1.object({
4441
- kind: z$1.literal("site"),
4442
- paletteId: sitePaletteIdSchema
4443
- })]);
4444
- const onboardingPaletteOriginSchema = z$1.object({
4445
- kind: z$1.literal("onboarding"),
4446
- sourceKey: z$1.string().min(1).nullable()
4447
- });
4448
- const curatedForkPaletteOriginSchema = z$1.object({
4449
- kind: z$1.literal("curated-fork"),
4450
- sourceValueKey: paletteValueKeySchema
4451
- });
4452
- const manualPaletteOriginSchema = z$1.object({ kind: z$1.literal("manual") });
4453
- const legacyCustomizedPaletteOriginSchema = z$1.object({
4454
- kind: z$1.literal("legacy-customized"),
4455
- sourceKey: z$1.string().min(1).nullable()
4456
- });
4457
- const sitePaletteOriginSchema = z$1.discriminatedUnion("kind", [
4458
- onboardingPaletteOriginSchema,
4459
- curatedForkPaletteOriginSchema,
4460
- manualPaletteOriginSchema,
4461
- legacyCustomizedPaletteOriginSchema
4462
- ]);
4463
- const editorSitePaletteOriginSchema = z$1.discriminatedUnion("kind", [z$1.object({
4464
- kind: z$1.literal("curated-fork"),
4465
- sourceValueKey: knownCuratedPaletteValueKeySchema
4466
- }), manualPaletteOriginSchema]);
4467
- z$1.object({
4468
- id: sitePaletteIdSchema,
4469
- colors: paletteColorsSchema,
4470
- mode: paletteModeSchema,
4471
- origin: sitePaletteOriginSchema,
4472
- version: sitePaletteVersionSchema
4473
- });
4474
- z$1.discriminatedUnion("kind", [
4475
- z$1.object({ kind: z$1.literal("preserve") }),
4476
- z$1.object({
4477
- kind: z$1.literal("select"),
4478
- selection: paletteSelectionSchema
4479
- }),
4480
- z$1.object({
4481
- kind: z$1.literal("create-site"),
4482
- colors: paletteColorsSchema,
4483
- mode: paletteModeSchema,
4484
- origin: editorSitePaletteOriginSchema
4485
- }),
4486
- z$1.object({
4487
- kind: z$1.literal("update-site"),
4488
- paletteId: sitePaletteIdSchema,
4489
- expectedVersion: sitePaletteVersionSchema,
4490
- colors: paletteColorsSchema,
4491
- mode: paletteModeSchema
4492
- })
4493
- ]);
4494
4424
  //#endregion
4495
4425
  //#region ../theme-core/src/lib/media.ts
4496
4426
  const hotspotSchema$1 = z.object({
@@ -4549,6 +4479,34 @@ const mediaSchema$1 = z.object({
4549
4479
  transform: transformSchema$1.optional()
4550
4480
  });
4551
4481
  //#endregion
4482
+ //#region ../theme-core/src/palette/schema.ts
4483
+ const colourHexString = z$1.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
4484
+ const paletteColorSchema = z$1.object({
4485
+ name: z$1.string().min(1),
4486
+ hex: colourHexString
4487
+ });
4488
+ const paletteMetaSchema = z$1.object({ mode: z$1.enum(["light", "dark"]) });
4489
+ const paletteSchema = z$1.object({
4490
+ colors: z$1.array(paletteColorSchema),
4491
+ meta: paletteMetaSchema
4492
+ }).transform((palette, ctx) => {
4493
+ const colors = paletteColorsFromEntries(palette.colors);
4494
+ if (!colors.ok) {
4495
+ ctx.addIssue({
4496
+ code: "custom",
4497
+ message: `Invalid complete palette: ${colors.error.kind}`
4498
+ });
4499
+ return z$1.NEVER;
4500
+ }
4501
+ return {
4502
+ colors: paletteColorEntries(colors.colors).map(({ name, hex }) => ({
4503
+ name: String(name),
4504
+ hex: String(hex)
4505
+ })),
4506
+ meta: palette.meta
4507
+ };
4508
+ });
4509
+ //#endregion
4552
4510
  //#region ../theme-core/src/buttons/types.ts
4553
4511
  /**
4554
4512
  * Standard semantic variant roles a theme exposes.
@@ -7817,16 +7775,6 @@ const axesSchema = z$1.object({
7817
7775
  "expressive"
7818
7776
  ])
7819
7777
  });
7820
- const colourHexString = z$1.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
7821
- const paletteColorSchema = z$1.object({
7822
- name: z$1.string().min(1),
7823
- hex: colourHexString
7824
- });
7825
- const paletteMetaSchema = z$1.object({ mode: z$1.enum(["light", "dark"]) });
7826
- const paletteSchema = z$1.object({
7827
- colors: z$1.array(paletteColorSchema),
7828
- meta: paletteMetaSchema
7829
- });
7830
7778
  const typographyStyleSchema = z$1.object({
7831
7779
  family: z$1.string().min(1),
7832
7780
  weight: z$1.enum([
@@ -1,7 +1,7 @@
1
1
  import { i as textColorStyle } from "./colorStyles-BWpj_h4C.mjs";
2
- import { X as themeButtonClassName, t as defineIslandPropsDecoder } from "./propsDecoder-CIR5DQ1l.mjs";
2
+ import { X as themeButtonClassName, t as defineIslandPropsDecoder } from "./propsDecoder-Bcin2DB3.mjs";
3
3
  import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
4
- import { t as LeafletStaticMap } from "./LeafletStaticMap-CSubXWt6.mjs";
4
+ import { t as LeafletStaticMap } from "./LeafletStaticMap-BrpC6vsT.mjs";
5
5
  import "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  //#region ../core/src/location.ts
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { t as clsx } from "./clsx-DgIEfj3H.mjs";
3
- import { X as themeButtonClassName, t as defineIslandPropsDecoder, yt as assertNever } from "./propsDecoder-CIR5DQ1l.mjs";
3
+ import { X as themeButtonClassName, t as defineIslandPropsDecoder, yt as assertNever } from "./propsDecoder-Bcin2DB3.mjs";
4
4
  import { n as useBlockApi, t as BlockApiProvider } from "./context-CJz1Vlsz.mjs";
5
5
  import { n as isSpamProtectionEnabled, r as AltchaWidget, t as getChallengeUrl } from "./src-B833rYRr.mjs";
6
6
  import { t as FeedbackMessage } from "./FeedbackMessage-ByMrs3cr.mjs";
@@ -1,4 +1,4 @@
1
- import { Rt as formatBookingPriceDisplay } from "./propsDecoder-CIR5DQ1l.mjs";
1
+ import { Rt as formatBookingPriceDisplay } from "./propsDecoder-Bcin2DB3.mjs";
2
2
  //#region ../core/src/planner.ts
3
3
  /** Default clock for production callers that do not inject time explicitly. */
4
4
  const systemPlanningClock = { now: () => Date.now() };
@@ -1,6 +1,6 @@
1
- import { t as defineIslandPropsDecoder } from "./propsDecoder-CIR5DQ1l.mjs";
2
- import { r as ProductDetailController } from "./shop-commerce-XO-XMFEt.mjs";
3
- import { t as mountShopBlockIsland } from "./shopShared-Bbq39mwr.mjs";
1
+ import { t as defineIslandPropsDecoder } from "./propsDecoder-Bcin2DB3.mjs";
2
+ import { r as ProductDetailController } from "./shop-commerce-lX8QxjX-.mjs";
3
+ import { t as mountShopBlockIsland } from "./shopShared-DXxH8xxw.mjs";
4
4
  import "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  //#region ../blocks/src/system/runtime/nodes/product-detail.client.tsx
@@ -1,6 +1,6 @@
1
- import { t as defineIslandPropsDecoder } from "./propsDecoder-CIR5DQ1l.mjs";
2
- import { i as ProductListController } from "./shop-commerce-XO-XMFEt.mjs";
3
- import { t as mountShopBlockIsland } from "./shopShared-Bbq39mwr.mjs";
1
+ import { t as defineIslandPropsDecoder } from "./propsDecoder-Bcin2DB3.mjs";
2
+ import { i as ProductListController } from "./shop-commerce-lX8QxjX-.mjs";
3
+ import { t as mountShopBlockIsland } from "./shopShared-DXxH8xxw.mjs";
4
4
  import "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  //#region ../blocks/src/system/runtime/nodes/product-list.client.tsx
@@ -1517,7 +1517,7 @@ const PALETTE_TOKEN_NAMES = [
1517
1517
  "text",
1518
1518
  "border"
1519
1519
  ];
1520
- z$1.enum(PALETTE_TOKEN_NAMES);
1520
+ const paletteTokenNameSchema = z$1.enum(PALETTE_TOKEN_NAMES);
1521
1521
  const themeColorBaseTokenNames = [
1522
1522
  ...PALETTE_TOKEN_NAMES,
1523
1523
  ...blockColorTokenNames,
@@ -1998,6 +1998,172 @@ const mediaSchema$1 = z.object({
1998
1998
  transform: transformSchema$1.optional()
1999
1999
  });
2000
2000
  //#endregion
2001
+ //#region ../theme-core/src/palette/colors.ts
2002
+ const HEX_COLOR_REGEX = /^#[0-9a-f]{6}$/;
2003
+ const NORMALIZABLE_HEX_REGEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
2004
+ const THEME_PALETTE_COLOR_ORDER = [
2005
+ "primary",
2006
+ "secondary",
2007
+ "accent",
2008
+ "success",
2009
+ "warning",
2010
+ "destructive",
2011
+ "background",
2012
+ "surface",
2013
+ "surfaceAlt",
2014
+ "muted",
2015
+ "text",
2016
+ "primaryForeground",
2017
+ "border"
2018
+ ];
2019
+ const hexColorSchema = z$1.string().regex(HEX_COLOR_REGEX, "Hex must be #RRGGBB (lowercase)").transform((value) => value);
2020
+ const paletteModeSchema = z$1.enum(["light", "dark"]);
2021
+ const PALETTE_VALUE_KEY_PREFIX = "palette-value:v1|";
2022
+ z$1.string().regex(/^[0-9a-f]{64}$/, "Palette hash must be a lowercase SHA-256 value").transform((value) => value);
2023
+ const paletteColorsSchema = z$1.object({
2024
+ primary: hexColorSchema,
2025
+ primaryForeground: hexColorSchema,
2026
+ secondary: hexColorSchema,
2027
+ accent: hexColorSchema,
2028
+ success: hexColorSchema,
2029
+ warning: hexColorSchema,
2030
+ destructive: hexColorSchema,
2031
+ background: hexColorSchema,
2032
+ surface: hexColorSchema,
2033
+ surfaceAlt: hexColorSchema,
2034
+ muted: hexColorSchema,
2035
+ text: hexColorSchema,
2036
+ border: hexColorSchema
2037
+ }).strict().transform((value) => value);
2038
+ function normalizePaletteHex(value) {
2039
+ if (!NORMALIZABLE_HEX_REGEX.test(value)) return null;
2040
+ const normalized = value.toLowerCase();
2041
+ if (normalized.length === 7) return normalized;
2042
+ const triplet = normalized.slice(1);
2043
+ const red = triplet.charAt(0);
2044
+ const green = triplet.charAt(1);
2045
+ const blue = triplet.charAt(2);
2046
+ return `#${red}${red}${green}${green}${blue}${blue}`;
2047
+ }
2048
+ function paletteColorsFromEntries(entries) {
2049
+ const values = {};
2050
+ for (const entry of entries) {
2051
+ const parsedRole = paletteTokenNameSchema.safeParse(entry.name);
2052
+ if (!parsedRole.success) return {
2053
+ ok: false,
2054
+ error: {
2055
+ kind: "unknown-role",
2056
+ role: entry.name
2057
+ }
2058
+ };
2059
+ const role = parsedRole.data;
2060
+ if (values[role] !== void 0) return {
2061
+ ok: false,
2062
+ error: {
2063
+ kind: "duplicate-role",
2064
+ role
2065
+ }
2066
+ };
2067
+ const hex = normalizePaletteHex(entry.hex);
2068
+ if (!hex) return {
2069
+ ok: false,
2070
+ error: {
2071
+ kind: "invalid-color",
2072
+ role,
2073
+ value: entry.hex
2074
+ }
2075
+ };
2076
+ values[role] = hex;
2077
+ }
2078
+ const missing = PALETTE_TOKEN_NAMES.filter((role) => values[role] === void 0);
2079
+ if (missing.length > 0) return {
2080
+ ok: false,
2081
+ error: {
2082
+ kind: "missing-roles",
2083
+ roles: missing
2084
+ }
2085
+ };
2086
+ return {
2087
+ ok: true,
2088
+ colors: paletteColorsSchema.parse(values)
2089
+ };
2090
+ }
2091
+ function paletteColorEntries(colors) {
2092
+ return THEME_PALETTE_COLOR_ORDER.map((name) => ({
2093
+ name,
2094
+ hex: colors[name]
2095
+ }));
2096
+ }
2097
+ function paletteColorFingerprint(colors) {
2098
+ return PALETTE_TOKEN_NAMES.map((name) => `${name}:${colors[name]}`).join("|");
2099
+ }
2100
+ function canonicalPaletteHashInput(colors, mode) {
2101
+ return `${mode}|${paletteColorFingerprint(colors)}`;
2102
+ }
2103
+ /**
2104
+ * The shared TypeScript/SQL protocol. Do not reorder roles: the order comes
2105
+ * from PALETTE_TOKEN_NAMES through canonicalPaletteHashInput.
2106
+ */
2107
+ function paletteValueKey(colors, mode) {
2108
+ return `${PALETTE_VALUE_KEY_PREFIX}${canonicalPaletteHashInput(colors, mode)}`;
2109
+ }
2110
+ /** Parses only the exact v1 canonical form emitted by paletteValueKey. */
2111
+ function parsePaletteValueKey(value) {
2112
+ if (typeof value !== "string" || !value.startsWith(PALETTE_VALUE_KEY_PREFIX)) return null;
2113
+ const [rawMode, ...rawRoles] = value.slice(17).split("|");
2114
+ const mode = paletteModeSchema.safeParse(rawMode);
2115
+ if (!mode.success || rawRoles.length !== PALETTE_TOKEN_NAMES.length) return null;
2116
+ const colors = paletteColorsFromEntries(rawRoles.map((roleValue) => {
2117
+ const separator = roleValue.indexOf(":");
2118
+ return separator === -1 ? {
2119
+ name: "",
2120
+ hex: ""
2121
+ } : {
2122
+ name: roleValue.slice(0, separator),
2123
+ hex: roleValue.slice(separator + 1)
2124
+ };
2125
+ }));
2126
+ if (!colors.ok || paletteValueKey(colors.colors, mode.data) !== value) return null;
2127
+ return value;
2128
+ }
2129
+ z$1.string().transform((value, ctx) => {
2130
+ const parsed = parsePaletteValueKey(value);
2131
+ if (parsed) return parsed;
2132
+ ctx.addIssue({
2133
+ code: "custom",
2134
+ message: "Invalid canonical palette value key"
2135
+ });
2136
+ return z$1.NEVER;
2137
+ });
2138
+ //#endregion
2139
+ //#region ../theme-core/src/palette/schema.ts
2140
+ const colourHexString = z$1.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
2141
+ const paletteColorSchema = z$1.object({
2142
+ name: z$1.string().min(1),
2143
+ hex: colourHexString
2144
+ });
2145
+ const paletteMetaSchema = z$1.object({ mode: z$1.enum(["light", "dark"]) });
2146
+ const paletteSchema = z$1.object({
2147
+ colors: z$1.array(paletteColorSchema),
2148
+ meta: paletteMetaSchema
2149
+ }).transform((palette, ctx) => {
2150
+ const colors = paletteColorsFromEntries(palette.colors);
2151
+ if (!colors.ok) {
2152
+ ctx.addIssue({
2153
+ code: "custom",
2154
+ message: `Invalid complete palette: ${colors.error.kind}`
2155
+ });
2156
+ return z$1.NEVER;
2157
+ }
2158
+ return {
2159
+ colors: paletteColorEntries(colors.colors).map(({ name, hex }) => ({
2160
+ name: String(name),
2161
+ hex: String(hex)
2162
+ })),
2163
+ meta: palette.meta
2164
+ };
2165
+ });
2166
+ //#endregion
2001
2167
  //#region ../theme-core/src/cards/types.ts
2002
2168
  const cardVariantRoleValues = ["default", "alternative"];
2003
2169
  const boxlessCardVariantValue = "none";
@@ -3067,16 +3233,6 @@ const axesSchema = z$1.object({
3067
3233
  "expressive"
3068
3234
  ])
3069
3235
  });
3070
- const colourHexString = z$1.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
3071
- const paletteColorSchema = z$1.object({
3072
- name: z$1.string().min(1),
3073
- hex: colourHexString
3074
- });
3075
- const paletteMetaSchema = z$1.object({ mode: z$1.enum(["light", "dark"]) });
3076
- const paletteSchema = z$1.object({
3077
- colors: z$1.array(paletteColorSchema),
3078
- meta: paletteMetaSchema
3079
- });
3080
3236
  const typographyStyleSchema = z$1.object({
3081
3237
  family: z$1.string().min(1),
3082
3238
  weight: z$1.enum([