@riverbankcms/sdk 0.181.0 → 0.182.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 (196) hide show
  1. package/dist/_dts/{BlocksIslandsHydrator-CVCasDPz.d.ts → BlocksIslandsHydrator-Bvw2bUif.d.ts} +1 -1
  2. package/dist/_dts/{Page-Dtj2Ui3S.d.ts → Page-B2EAT-bE.d.ts} +7 -7
  3. package/dist/_dts/{SdkPreviewMode-D1f_60WW.d.ts → SdkPreviewMode-D0vww6rh.d.ts} +2 -2
  4. package/dist/_dts/{client-Chr9pNVW.d.ts → client-D6T430bk.d.ts} +1 -3
  5. package/dist/_dts/{content-types-kjccgopX.d.ts → content-types-wZVWccC6.d.ts} +2 -2
  6. package/dist/_dts/{contracts-BodaiS00.d.ts → contracts-B-vtOcr8.d.ts} +3 -3
  7. package/dist/_dts/{generatePageMetadata-BS6kaJFp.d.ts → generatePageMetadata-CxfwHE6z.d.ts} +2 -2
  8. package/dist/_dts/{index-Brl6_I2j.d.ts → index-CEyYMhLJ.d.ts} +1 -1
  9. package/dist/_dts/{index-DG0OvBs0.d.ts → index-CQrb3Ccc.d.ts} +4 -4
  10. package/dist/_dts/{index-Dy50xUMK.d.ts → index-CciRW_w1.d.ts} +2 -2
  11. package/dist/_dts/{index-Diqt0PvG.d.ts → index-Cqxis-nv.d.ts} +1 -1
  12. package/dist/_dts/{index-CJkefwYh.d.ts → index-DIU-wL1M.d.ts} +2 -2
  13. package/dist/_dts/{index-D1WpKwQe.d.ts → index-DqPKdeTk.d.ts} +1 -1
  14. package/dist/_dts/{loadContent-BgxshKrA.d.ts → loadContent-D0wrxiSp.d.ts} +7 -7
  15. package/dist/_dts/{request-CA0izds5.d.ts → request-DEwxUSw8.d.ts} +130 -28
  16. package/dist/_dts/{resolveBlockData-ChQmwEd3.d.ts → resolveBlockData-VaG_MYbN.d.ts} +5 -5
  17. package/dist/_dts/{resolvePageContent-BvGyvblj.d.ts → resolvePageContent-DTwklC_v.d.ts} +1 -1
  18. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  19. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  20. package/dist/_dts/sdk/src/client.d.ts +7 -7
  21. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  22. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  23. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  24. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  25. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  26. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  27. package/dist/_dts/sdk/src/gifting/client.d.ts +1 -1
  28. package/dist/_dts/sdk/src/index.d.ts +7 -7
  29. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  30. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  31. package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
  32. package/dist/_dts/sdk/src/next/index.d.ts +7 -7
  33. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  34. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  35. package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
  36. package/dist/_dts/sdk/src/portal/index.d.ts +1 -1
  37. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  38. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  39. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  40. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  41. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  42. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  43. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  44. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +4 -4
  45. package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
  46. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  47. package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
  48. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  49. package/dist/_dts/sdk/src/routing/index.d.ts +6 -6
  50. package/dist/_dts/sdk/src/server.d.ts +5 -5
  51. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  52. package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
  53. package/dist/_dts/{serviceBookingOutline-BgFbJQhU.d.ts → serviceBookingOutline-DtQuFlID.d.ts} +6 -6
  54. package/dist/_dts/{types-CgS3xLk8.d.ts → types-B3RjeBLV.d.ts} +2 -2
  55. package/dist/_dts/{types-CQrsP1x_.d.ts → types-BvUSGQrw.d.ts} +3 -3
  56. package/dist/_dts/{types-R65DKjPn.d.ts → types-CkRFtBqd.d.ts} +7 -7
  57. package/dist/_dts/{validation-6LTIbuBA.d.ts → validation-BZA3DhcV.d.ts} +4 -4
  58. package/dist/client/{BlocksIslandsHydrator-DqZPz6oW.mjs → BlocksIslandsHydrator-CQMf0HdN.mjs} +17 -17
  59. package/dist/client/{BookingMailingListNote-uWfR2kaG.mjs → BookingMailingListNote-7kdvuPow.mjs} +6 -6
  60. package/dist/client/{BookingQuestionFields-CyNIKw6k.mjs → BookingQuestionFields-BJI7mZuV.mjs} +1 -1
  61. package/dist/client/{CalendarNavigationChevron-BGCX3zwG.mjs → CalendarNavigationChevron-DPUD6wjy.mjs} +7 -7
  62. package/dist/client/{DemoBookingPortalAccess-DFLPyuqe.mjs → DemoBookingPortalAccess-8kwNF9HN.mjs} +4 -4
  63. package/dist/client/{EventCalendar.client-zDL4-t-B.mjs → EventCalendar.client-Dhb14bcC.mjs} +9 -9
  64. package/dist/client/{EventCombined.client-uciDKLID.mjs → EventCombined.client-C1jEZBN9.mjs} +8 -8
  65. package/dist/client/{EventItem-CwzrjcRw.mjs → EventItem-Bb0ppG2N.mjs} +8 -176
  66. package/dist/client/{EventListWeekNavigation-ChvcnPma.mjs → EventListWeekNavigation-DMryCaNV.mjs} +1 -1
  67. package/dist/client/{EventListing.client-DA57Qoyx.mjs → EventListing.client-BuH5kKA3.mjs} +3 -3
  68. package/dist/client/{EventListing.view-DZ0qMFF4.mjs → EventListing.view-DsqvuulZ.mjs} +7 -7
  69. package/dist/client/{EventRegistrationPayment-DSqCJL8E.mjs → EventRegistrationPayment-D4FvQSFF.mjs} +31 -164
  70. package/dist/client/{Page-C7mygH_f.mjs → Page-sV6BJkXX.mjs} +172 -102
  71. package/dist/client/{SiteTermsAgreementField-B4z-e4Wq.mjs → SiteTermsAgreementField-VfSd6JU-.mjs} +2 -2
  72. package/dist/client/{StepIndicator-Dn_DY4oY.mjs → StepIndicator-B6o5B7g3.mjs} +1 -1
  73. package/dist/client/{StepIndicator-atfDU82W.mjs → StepIndicator-BTqO7cJl.mjs} +220 -19
  74. package/dist/client/{accessibleSurfaces-n6kS6Hct.mjs → accessibleSurfaces-BogaGutk.mjs} +966 -693
  75. package/dist/client/{accordion-CsW8U3ff.mjs → accordion-6cuswD_s.mjs} +1 -1
  76. package/dist/client/{booking-form.client-cBWM392H.mjs → booking-form.client-BOMe_SKi.mjs} +15 -15
  77. package/dist/client/{bookingForm-DgySpp6C.mjs → bookingForm-DSCH-VHo.mjs} +4 -4
  78. package/dist/client/bookings.mjs +5 -5
  79. package/dist/client/{boxStyleClassNames-BpGVdLFD.mjs → boxStyleClassNames-BFuqZCfz.mjs} +2 -2
  80. package/dist/client/{carousel-DJoleFV3.mjs → carousel-CGyQVV1M.mjs} +1 -1
  81. package/dist/client/{cart-EO5o6uPH.mjs → cart-BYOe7MCh.mjs} +3 -3
  82. package/dist/client/{cart.client-D_gPw45z.mjs → cart.client-BKFkaXdV.mjs} +1 -1
  83. package/dist/client/{checkout-NVfZW0kR.mjs → checkout-Dwd7Di77.mjs} +3 -3
  84. package/dist/client/{checkout.client-DD3JuqOy.mjs → checkout.client-C25hpi-z.mjs} +1 -1
  85. package/dist/client/{checkoutUrls-z2gXvlGw.mjs → checkoutUrls-tG788sw0.mjs} +1 -1
  86. package/dist/client/client.mjs +25 -6
  87. package/dist/client/{constants-CoOkvw__.mjs → constants-DdxFG3Ic.mjs} +1 -1
  88. package/dist/client/{context-CRhn9qzS.mjs → context-Hi1RuYEM.mjs} +23 -5
  89. package/dist/client/{dateFormatting-BnWB4L1s.mjs → dateFormatting-C8vBCHuo.mjs} +1 -1
  90. package/dist/client/{demoPortalMagicLink-CWDGSTBu.mjs → demoPortalMagicLink-BAL5UIDG.mjs} +1 -1
  91. package/dist/client/{enhanceHeaderSection-tdP_-Z9o.mjs → enhanceHeaderSection-Dv1Lr9kJ.mjs} +3 -3
  92. package/dist/client/{event-registration.client-D7YYKySQ.mjs → event-registration.client-dB_Z7bb-.mjs} +12 -12
  93. package/dist/client/{eventCalendar-CsAfu5d0.mjs → eventCalendar-CQnRA4Ww.mjs} +4 -4
  94. package/dist/client/{eventCombined-VXJB5CoS.mjs → eventCombined-BDOG1hVp.mjs} +4 -4
  95. package/dist/client/{eventListing-B3KIZNfY.mjs → eventListing-DSVmhy9n.mjs} +4 -4
  96. package/dist/client/{eventRegistration-BP-dEk1c.mjs → eventRegistration-CD5mRtEH.mjs} +4 -4
  97. package/dist/client/{form-DM8Zbxbv.mjs → form-DWnlEVSK.mjs} +3 -3
  98. package/dist/client/{form.client-e2z_Tlgk.mjs → form.client-D7zmeqNI.mjs} +4 -4
  99. package/dist/client/{form.parts-Ctljy1a3.mjs → form.parts-C-G6N_MK.mjs} +1 -1
  100. package/dist/client/gifting/client.mjs +7 -7
  101. package/dist/client/{gifting-DWIsqQru.mjs → gifting-Cn0jidP5.mjs} +4 -4
  102. package/dist/client/{gifting.client-QsSWF0uA.mjs → gifting.client-DVo1YFLs.mjs} +4 -4
  103. package/dist/client/{gifting.parts-CedLgwa_.mjs → gifting.parts-Bak93gD2.mjs} +2 -2
  104. package/dist/client/{headerSection-DAkRkwb-.mjs → headerSection-DjQuj_6v.mjs} +2 -2
  105. package/dist/client/{newsletter-form.client-WYja9-WN.mjs → newsletter-form.client-rIYPziZC.mjs} +5 -5
  106. package/dist/client/{newsletter-form.interactive-RuM86VAv.mjs → newsletter-form.interactive-DVt3enLr.mjs} +162 -135
  107. package/dist/client/{newsletter-form.parts-2petDnWv.mjs → newsletter-form.parts-CH6dGfdn.mjs} +1 -1
  108. package/dist/client/{newsletterForm-BUbXdA_e.mjs → newsletterForm-Cg8cBDHd.mjs} +3 -3
  109. package/dist/client/{noop-Dl4mZ-rr.mjs → noop-jesvJXEE.mjs} +239 -229
  110. package/dist/client/portal/client.mjs +269 -83
  111. package/dist/client/{portalOrders-COGn4BKG.mjs → portalOrders-oEoTvzkW.mjs} +1 -1
  112. package/dist/client/{portalRoutes-D72yvtDh.mjs → portalRoutes-ByyVZfVq.mjs} +13 -2
  113. package/dist/client/{product-detail.client-pOAryevt.mjs → product-detail.client-5aHq-vuu.mjs} +1 -1
  114. package/dist/client/{product-list.client-CcUpUiud.mjs → product-list.client-CyAk5rnC.mjs} +1 -1
  115. package/dist/client/{productDetail-BZJCfqat.mjs → productDetail-B8aZ2mqY.mjs} +3 -3
  116. package/dist/client/{productList-CiRs3mNb.mjs → productList-BuLemmod.mjs} +3 -3
  117. package/dist/client/{propsDecoder--uHW4tFM.mjs → propsDecoder-0Unsqn3R.mjs} +2 -2
  118. package/dist/client/{registry.server-CDNNd8wC.mjs → registry.server-DzvtVVD0.mjs} +352 -166
  119. package/dist/client/rendering/client.mjs +23 -23
  120. package/dist/client/rendering/islands.mjs +1 -1
  121. package/dist/client/rendering.mjs +5 -5
  122. package/dist/client/{richText-coerce-CQGE_wHV.mjs → richText-coerce-Bnng7JFA.mjs} +2 -2
  123. package/dist/client/{routeIslandApiConfig-BtCg87-N.mjs → routeIslandApiConfig-BGfcc9sk.mjs} +1 -1
  124. package/dist/client/{runtimeResponse-Ds9cmBUf.mjs → runtimeResponse-DAPVRToN.mjs} +1 -1
  125. package/dist/client/{runtimeResponse-DL_ARBpa.mjs → runtimeResponse-nXT8VAMl.mjs} +1 -1
  126. package/dist/client/{shop-Rx_gEMK8.mjs → shop-GuMqnDL-.mjs} +3 -3
  127. package/dist/client/{shop-commerce-D8evQnMT.mjs → shop-commerce-D5bDY1o1.mjs} +12 -12
  128. package/dist/client/{shop-commerce-store-C9PcsSTj.mjs → shop-commerce-store-B7sHnLwI.mjs} +1 -1
  129. package/dist/client/{shop-discount-apply.state-D5CtGfJI.mjs → shop-discount-apply.state-Dos2zdC2.mjs} +2 -2
  130. package/dist/client/{shop.client-D4lzQ9oY.mjs → shop.client-uvj5GDZb.mjs} +11 -11
  131. package/dist/client/{shopShared-BVbq7Nm-.mjs → shopShared-3giNWE3H.mjs} +2 -2
  132. package/dist/client/{src-ZSqRK3dD.mjs → src-CmXh3JWs.mjs} +5 -1
  133. package/dist/client/{timetableModel-BQJrSK0K.mjs → timetableModel-GA-hn1qM.mjs} +8 -15
  134. package/dist/client/{useAvailableSlots-Dm3lKJKR.mjs → useAvailableSlots-CBneCxbG.mjs} +2 -2
  135. package/dist/client/{useDiscountCodeUi-klgfGn7f.mjs → useDiscountCodeUi-D0kGF0C7.mjs} +1 -1
  136. package/dist/client/{useEventPagination-Jnjt7_ly.mjs → useEventPagination-xX8n_Tuu.mjs} +7 -7
  137. package/dist/client/{view-CC_yQLSA.mjs → view-DOyZc-DF.mjs} +3 -3
  138. package/dist/client/{wizardSteps-BliJOzEX.mjs → wizardSteps-B952ify5.mjs} +303 -31
  139. package/dist/preview-next/client/{PageSectionToolbar-BhL0uADo.mjs → PageSectionToolbar-BI3UCdpu.mjs} +3 -3
  140. package/dist/preview-next/client/{PreviewEditorSidebar-Ct8eIm0i.mjs → PreviewEditorSidebar-jkfLVOgY.mjs} +12 -9
  141. package/dist/preview-next/client/{PreviewEditorUI-BS32G4V9.mjs → PreviewEditorUI-DwJQs4hM.mjs} +4 -4
  142. package/dist/preview-next/client/{PreviewShell-RL0WfZXD.mjs → PreviewShell-BAxAkuz8.mjs} +5 -5
  143. package/dist/preview-next/client/{SdkPreviewModeRuntime-MK_gHeGy.mjs → SdkPreviewModeRuntime-0UVB-39f.mjs} +44 -17
  144. package/dist/preview-next/client/{previewAssistantSlot-CQyS8pcq.mjs → previewAssistantSlot-BgiYk3PB.mjs} +2577 -1683
  145. package/dist/preview-next/client/{previewChromeRoot-BSxp3Mfu.mjs → previewChromeRoot-tieNdF3E.mjs} +1 -1
  146. package/dist/preview-next/client/runtime.mjs +3 -3
  147. package/dist/preview-next/client/{sdk-runtime-DKnTzy74.mjs → sdk-runtime-DXb_Evl0.mjs} +2 -2
  148. package/dist/preview-next/client/{siteStyleAccess-BlmbvbLN.mjs → siteStyleAccess-BlN0jt2c.mjs} +1 -1
  149. package/dist/preview-next/client/{useAutosaveStatus-D-7GwZOQ.mjs → useAutosaveStatus-BUEPA4oL.mjs} +1 -1
  150. package/dist/preview-next/client/{useOpenBlockForSetup-BNZtGM5g.mjs → useOpenBlockForSetup-BVfr5P--.mjs} +1 -1
  151. package/dist/preview-next/keepAlive.mjs +1 -1
  152. package/dist/preview-next/middleware.mjs +1 -1
  153. package/dist/preview-next/{route-contract-R3PcMmax.mjs → route-contract-BHTBA48n.mjs} +20 -1
  154. package/dist/server/{Block.shared-CniF9tSu.mjs → Block.shared-hGoyEdjJ.mjs} +5 -5
  155. package/dist/server/{ThemeScopeCore-BQWsnGT6.mjs → ThemeScopeCore-BfUCTOwj.mjs} +37 -25
  156. package/dist/server/{accessibleSurfaces-WPzUAHp4.mjs → accessibleSurfaces-Dskni4Xj.mjs} +94 -361
  157. package/dist/server/{bindings-DxojjtK3.mjs → bindings-DMJH4bvo.mjs} +4 -4
  158. package/dist/server/{client-CDndhbYO.mjs → client-DrwlRNAH.mjs} +22 -3
  159. package/dist/server/config-validation.mjs +1 -1
  160. package/dist/server/config.mjs +2 -2
  161. package/dist/server/{constants-VyF5nEhL.mjs → constants-CeMywaiD.mjs} +11 -0
  162. package/dist/server/data/resolveBlockData.mjs +1 -1
  163. package/dist/server/{resolveButtonColourStates-B0O1IM16.mjs → expandPalette-ehuW8r2g.mjs} +769 -227
  164. package/dist/server/index.mjs +2 -2
  165. package/dist/server/{loadContent-BKstMBmX.mjs → loadContent-D0prFflT.mjs} +4 -4
  166. package/dist/server/{loadPage-IgNnZaqr.mjs → loadPage-CBLke9pJ.mjs} +3 -3
  167. package/dist/server/{lookMediaFrame-TFjgNG61.mjs → lookMediaFrame-H0fi4bJk.mjs} +2 -2
  168. package/dist/server/{navigation-quBYlSKD.mjs → navigation-wrcuWmgp.mjs} +1 -1
  169. package/dist/server/navigation.mjs +1 -1
  170. package/dist/server/next.mjs +8 -8
  171. package/dist/server/{overrideResolution-CCaAPpIa.mjs → overrideResolution-DUgCEH8z.mjs} +1 -1
  172. package/dist/server/page-converter.mjs +1 -1
  173. package/dist/server/{pageRenderPlan-B7iULvKe.mjs → pageRenderPlan-BHrmogsW.mjs} +161 -244
  174. package/dist/server/{pageRuntimeSupport-BytMroxn.mjs → pageRuntimeSupport-D2-YMRei.mjs} +1 -1
  175. package/dist/server/{pageShared-Dcs_XTIO.mjs → pageShared-CG8O31Eo.mjs} +1265 -1032
  176. package/dist/server/{parseThemeForPersistence-Bihl4W5K.mjs → parseThemeForPersistence-CrPlbJEN.mjs} +1 -1
  177. package/dist/server/{portal-CMW_b9mG.mjs → portal-pG_uhsI2.mjs} +1 -1
  178. package/dist/server/portal.mjs +2 -2
  179. package/dist/server/{prebuild-agaH-vZV.mjs → prebuild-C8Amvzce.mjs} +1 -1
  180. package/dist/server/prebuild.mjs +1 -1
  181. package/dist/server/{prefetchBlockData-DwpRjqw4.mjs → prefetchBlockData-BxUETRIZ.mjs} +2 -2
  182. package/dist/server/{registry-DM9dHfDC.mjs → registry-Cc88-23f.mjs} +1173 -745
  183. package/dist/server/rendering/components/pageShared.mjs +1 -1
  184. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  185. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  186. package/dist/server/rendering/server.mjs +4 -4
  187. package/dist/server/rendering.mjs +8 -8
  188. package/dist/server/{resolveBlockData-CinHGf8l.mjs → resolveBlockData-OG3KOkig.mjs} +1 -1
  189. package/dist/server/server.mjs +3 -3
  190. package/dist/server/{servicePageContent-BBBhOtdE.mjs → servicePageContent-BcFuhhD7.mjs} +5 -5
  191. package/dist/server/theme-bridge.mjs +33 -8
  192. package/dist/server/theme.mjs +1 -1
  193. package/dist/server/{validation-DG5jX3jH.mjs → validation-BovmbS8N.mjs} +3 -3
  194. package/dist/server/{version-CipbxPHL.mjs → version-hws4hgyX.mjs} +1 -1
  195. package/dist/styles/index.css +86 -46
  196. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { t as stableJsonStringify } from "./stable-json-D0XAEIXc.mjs";
3
- import { C as paletteModeSchema, O as VARIANT_ROLES, T as parseThemeColorToken, _ as hexColorSchema, c as buttonEffectApplicationSchema, h as PALETTE_TOKEN_NAMES, m as parseOpaqueButtonColourToken, n as STANDARD_BUTTON_SURFACE_POLICY, p as opaqueButtonColourTokenSchema, s as unsafeAsOpaqueButtonColourToken, u as buttonSystemSchema, w as parseColorTokenParts, x as paletteColorsFromEntries, y as normalizePaletteHex } from "./types-BEaKfam_.mjs";
3
+ import { C as paletteModeSchema, O as VARIANT_ROLES, T as parseThemeColorToken, _ as hexColorSchema, c as buttonEffectApplicationSchema, h as PALETTE_TOKEN_NAMES, m as parseOpaqueButtonColourToken, n as STANDARD_BUTTON_SURFACE_POLICY, p as opaqueButtonColourTokenSchema, s as unsafeAsOpaqueButtonColourToken, u as buttonSystemSchema, v as isThemeColorToken, w as parseColorTokenParts, x as paletteColorsFromEntries, y as normalizePaletteHex } from "./types-BEaKfam_.mjs";
4
4
  import { t as SURFACE_TRANSPORT_KEY } from "./surfaceTransportMarker-BuwkYxsI.mjs";
5
5
  import { z } from "zod";
6
6
  //#region ../theme-core/src/palette/utils/colorConversion.ts
@@ -231,6 +231,10 @@ function solidPaint(hex, index) {
231
231
  const y = hexLuminance(hex, index);
232
232
  return new Interval(y, y);
233
233
  }
234
+ /** The smallest paint covering every given paint: an ink that clears it clears each of them. */
235
+ function spanningPaint(first, ...rest) {
236
+ return rest.reduce((span, paint) => new Interval(paint.lo < span.lo ? paint.lo : span.lo, paint.hi > span.hi ? paint.hi : span.hi), first);
237
+ }
234
238
  function luminanceRatio(a, b) {
235
239
  return a >= b ? (a + .05) / (b + .05) : (b + .05) / (a + .05);
236
240
  }
@@ -246,8 +250,8 @@ function assertContrastRatio(ratio) {
246
250
  * The one black-or-white rule: literal black or white, whichever contrasts more
247
251
  * with the whole paint (black on a tie). It always returns, even when neither
248
252
  * reaches the ratio a caller wants; callers decide what a shortfall means.
249
- * A style's preferred neutral is a separate input (`neutralInk`) and never
250
- * part of this rule.
253
+ * A style's preferred neutral or the palette's own roles are separate inputs
254
+ * (`neutralInk`, `paletteInk`) that are tried before this rule, never part of it.
251
255
  */
252
256
  function maxContrastBlackOrWhite(paint) {
253
257
  const blackContrast = (paint.lo + .05) / .05;
@@ -260,6 +264,9 @@ function maxContrastBlackOrWhite(paint) {
260
264
  ratio: whiteContrast
261
265
  };
262
266
  }
267
+ function literalInkHex(ink) {
268
+ return ink === "black" ? "#000000" : "#FFFFFF";
269
+ }
263
270
  function contrastRatio(hex1, hex2, index) {
264
271
  const L1 = indexedLuminance(hex1, index);
265
272
  const L2 = indexedLuminance(hex2, index);
@@ -317,6 +324,314 @@ const paletteValueKeySchema = z.string().transform((value, ctx) => {
317
324
  return z.NEVER;
318
325
  });
319
326
  //#endregion
327
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/assertClassBrand.js
328
+ function _assertClassBrand(e, t, n) {
329
+ if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
330
+ throw new TypeError("Private element is not present on this object");
331
+ }
332
+ //#endregion
333
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/classPrivateFieldSet2.js
334
+ function _classPrivateFieldSet2(s, a, r) {
335
+ return s.set(_assertClassBrand(s, a), r), r;
336
+ }
337
+ //#endregion
338
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/classPrivateFieldGet2.js
339
+ function _classPrivateFieldGet2(s, a) {
340
+ return s.get(_assertClassBrand(s, a));
341
+ }
342
+ //#endregion
343
+ //#region ../theme-core/src/palette/family.ts
344
+ var _members = /* @__PURE__ */ new WeakMap();
345
+ /**
346
+ * Only `colourFamily` makes one (the class is not exported), so a caller can't
347
+ * swap in its own members and still hand the solver a valid family. That
348
+ * matters because `unpaintable` relies on the members running from black to
349
+ * white.
350
+ */
351
+ var Family = class {
352
+ constructor(seed, members) {
353
+ this.seed = seed;
354
+ _classPrivateFieldInitSpec(this, _members, void 0);
355
+ _classPrivateFieldSet2(_members, this, Object.freeze(members));
356
+ }
357
+ /** Unique by hex, ascending luminance. Includes the exact seed, black and white. */
358
+ get members() {
359
+ return _classPrivateFieldGet2(_members, this);
360
+ }
361
+ };
362
+ const GAMUT_BISECTION_STEPS = 18;
363
+ /** The highest chroma at or below `c` that stays inside sRGB at this lightness and hue. */
364
+ function gamutChroma(l, c, h) {
365
+ if (inLinearSrgbGamut(oklchToLinearSrgb(l, c, h))) return c;
366
+ return Array.from({ length: GAMUT_BISECTION_STEPS }).reduce(({ lo, hi }) => {
367
+ const mid = (lo + hi) / 2;
368
+ return inLinearSrgbGamut(oklchToLinearSrgb(l, mid, h)) ? {
369
+ lo: mid,
370
+ hi
371
+ } : {
372
+ lo,
373
+ hi: mid
374
+ };
375
+ }, {
376
+ lo: 0,
377
+ hi: c
378
+ }).lo;
379
+ }
380
+ function oklabDistance(a, b) {
381
+ return Math.hypot(a.L - b.L, a.a - b.a, a.b - b.b);
382
+ }
383
+ /** OKLab distance between two rendered opaque hex colours. */
384
+ function hexOklabDistance(first, second) {
385
+ const lab = (hex) => {
386
+ const { r, g, b } = hexToRgb(hex);
387
+ return srgbToOklab(r, g, b);
388
+ };
389
+ return oklabDistance(lab(first), lab(second));
390
+ }
391
+ function colourFamily(seedHex) {
392
+ if (!/^#[0-9a-f]{6}$/i.test(seedHex)) throw new Error(`Expected an opaque #rrggbb colour: ${seedHex}`);
393
+ const features = featuresFromHex(seedHex.toLowerCase());
394
+ const seed = member(seedHex.toLowerCase(), {
395
+ l: features.okL,
396
+ c: features.okC,
397
+ h: features.okH
398
+ });
399
+ const seedTaper = Math.max(.001, Math.sin(Math.PI * seed.sample.l));
400
+ const samples = Array.from({ length: 513 }, (_, i) => {
401
+ const l = i / 512;
402
+ return sampleMember({
403
+ l,
404
+ c: gamutChroma(l, seed.sample.c * Math.min(1, Math.sin(Math.PI * l) / seedTaper), seed.sample.h),
405
+ h: seed.sample.h
406
+ });
407
+ });
408
+ return new Family(seed, [...new Map([seed, ...samples].map((candidate) => [candidate.hex, candidate]).reverse()).values()].sort((a, b) => a.y - b.y || (a.hex < b.hex ? -1 : a.hex > b.hex ? 1 : 0)));
409
+ }
410
+ function sampleMember(sample) {
411
+ const { r, g, b } = oklchToLinearSrgb(sample.l, sample.c, sample.h);
412
+ return member(rgbToHex(linearToSrgb(r), linearToSrgb(g), linearToSrgb(b)), sample);
413
+ }
414
+ function member(hex, sample) {
415
+ const { r, g, b } = hexToRgb(hex);
416
+ return {
417
+ hex,
418
+ y: hexLuminance(hex),
419
+ oklab: srgbToOklab(r, g, b),
420
+ sample
421
+ };
422
+ }
423
+ //#endregion
424
+ //#region ../theme-core/src/palette/utils/inkSolver.ts
425
+ /**
426
+ * How far (OKLab ΔE) a brand colour drawn as ink may be nudged along its own
427
+ * family before it stops reading as that colour. Past this the caller uses
428
+ * neutral or palette text instead (Will, 2026-10-14).
429
+ */
430
+ const BRAND_INK_MAX_DELTA_E = .08;
431
+ /**
432
+ * The seed itself when it clears `paint`, otherwise the family member nearest
433
+ * the seed (OKLab ΔE) that clears. On a light ground that is darker, on a dark
434
+ * one lighter. A passing member further than `maxDistance` from the seed is
435
+ * refused as `too-far`, which is distinct from `unpaintable`: the family runs
436
+ * from black to white, so if no member clears, neither does black or white.
437
+ */
438
+ function inkFrom(family, paint, ratio, maxDistance = BRAND_INK_MAX_DELTA_E) {
439
+ assertContrastRatio(ratio);
440
+ if (!Number.isFinite(maxDistance) || maxDistance < 0) throw new RangeError(`Maximum ink distance must be finite and not negative: ${maxDistance}`);
441
+ const seedRatio = worstContrast(family.seed.y, paint);
442
+ if (seedRatio >= ratio) return {
443
+ kind: "ink",
444
+ hex: family.seed.hex,
445
+ ratio: seedRatio,
446
+ source: "exact"
447
+ };
448
+ const nearest = family.members.reduce((best, member) => {
449
+ const achieved = worstContrast(member.y, paint);
450
+ if (achieved < ratio) return best;
451
+ const distance = oklabDistance(member.oklab, family.seed.oklab);
452
+ return best === null || distance < best.distance ? {
453
+ hex: member.hex,
454
+ distance,
455
+ ratio: achieved
456
+ } : best;
457
+ }, null);
458
+ if (nearest === null) return {
459
+ kind: "unpaintable",
460
+ interval: paint,
461
+ ratio
462
+ };
463
+ if (nearest.distance > maxDistance) return {
464
+ kind: "too-far",
465
+ nearest: {
466
+ hex: nearest.hex,
467
+ distance: nearest.distance
468
+ },
469
+ maxDistance
470
+ };
471
+ return {
472
+ kind: "ink",
473
+ hex: nearest.hex,
474
+ ratio: nearest.ratio,
475
+ source: "family"
476
+ };
477
+ }
478
+ /**
479
+ * The one "preferred ink, else black or white" comparison. Of the candidates,
480
+ * the one with the most contrast against the whole paint wins if it reaches
481
+ * `ratio` (the earlier one on a tie); otherwise literal black or white by
482
+ * `maxContrastBlackOrWhite`; otherwise `unpaintable`. It's direction-neutral:
483
+ * a candidate pair of one dark and one light ink needs no light/dark branch.
484
+ */
485
+ function preferredOrLiteralInk(paint, ratio, candidates) {
486
+ assertContrastRatio(ratio);
487
+ const best = candidates.map((candidate) => ({
488
+ ...candidate,
489
+ ratio: worstContrast(hexLuminance(candidate.hex), paint)
490
+ })).reduce((winner, candidate) => winner === null || candidate.ratio > winner.ratio ? candidate : winner, null);
491
+ if (best !== null && best.ratio >= ratio) return {
492
+ kind: "candidate",
493
+ value: best.value,
494
+ ratio: best.ratio
495
+ };
496
+ const literal = maxContrastBlackOrWhite(paint);
497
+ return literal.ratio >= ratio ? {
498
+ kind: "literal",
499
+ ink: literal.ink,
500
+ ratio: literal.ratio
501
+ } : {
502
+ kind: "unpaintable",
503
+ interval: paint,
504
+ ratio
505
+ };
506
+ }
507
+ /**
508
+ * Neutral text for a paint. The style's preferred neutral wins when one of its
509
+ * pair clears (the higher-contrast one, dark on a tie); otherwise literal black
510
+ * or white by `maxContrastBlackOrWhite`; otherwise `unpaintable`.
511
+ */
512
+ function neutralInk(paint, ratio, preferred) {
513
+ const picked = preferredOrLiteralInk(paint, ratio, preferred ? [{
514
+ value: preferred.dark,
515
+ hex: preferred.dark
516
+ }, {
517
+ value: preferred.light,
518
+ hex: preferred.light
519
+ }] : []);
520
+ switch (picked.kind) {
521
+ case "candidate": return {
522
+ kind: "ink",
523
+ hex: picked.value,
524
+ ratio: picked.ratio,
525
+ source: "neutral"
526
+ };
527
+ case "literal": return {
528
+ kind: "ink",
529
+ hex: picked.ink === "black" ? "#000000" : "#ffffff",
530
+ ratio: picked.ratio,
531
+ source: "neutral"
532
+ };
533
+ case "unpaintable": return picked;
534
+ }
535
+ }
536
+ /** The palette's `background` and `text` as an ink pair, or null when either is missing or not a hex colour. */
537
+ function paletteInkRoles(palette) {
538
+ const background = hexColorSchema.safeParse(palette.background?.toLowerCase());
539
+ const text = hexColorSchema.safeParse(palette.text?.toLowerCase());
540
+ return background.success && text.success ? {
541
+ background: background.data,
542
+ text: text.data
543
+ } : null;
544
+ }
545
+ /**
546
+ * Palette text for a paint: of the palette's background and text, the one with
547
+ * more contrast against the whole paint when it reaches `ratio`; otherwise
548
+ * literal black or white; otherwise `unpaintable`. On a dark palette the
549
+ * background is the dark one, so the same rule mirrors with no mode branch.
550
+ */
551
+ function paletteInk(paint, roles, ratio = ORDINARY_TEXT_MIN_CONTRAST_RATIO) {
552
+ const picked = preferredOrLiteralInk(paint, ratio, roles ? ["text", "background"].map((role) => ({
553
+ value: {
554
+ role,
555
+ hex: roles[role]
556
+ },
557
+ hex: roles[role]
558
+ })) : []);
559
+ switch (picked.kind) {
560
+ case "candidate": return {
561
+ kind: "role",
562
+ ...picked.value,
563
+ ratio: picked.ratio
564
+ };
565
+ case "literal": return {
566
+ kind: "literal",
567
+ hex: literalInkHex(picked.ink),
568
+ ratio: picked.ratio
569
+ };
570
+ case "unpaintable": return picked;
571
+ }
572
+ }
573
+ /** Ordinary-text palette ink on one solid ground. Total: black or white always reaches 4.58:1 on a solid. */
574
+ function paletteInkOnSolid(groundHex, roles) {
575
+ const paint = solidPaint(groundHex);
576
+ const ink = paletteInk(paint, roles);
577
+ if (ink.kind !== "unpaintable") return ink;
578
+ const literal = maxContrastBlackOrWhite(paint);
579
+ return {
580
+ kind: "literal",
581
+ hex: literalInkHex(literal.ink),
582
+ ratio: literal.ratio
583
+ };
584
+ }
585
+ /**
586
+ * The ink as token emitters write it: the role's theme token, so CSS follows
587
+ * the palette's variables, or the literal hex.
588
+ */
589
+ function paletteInkToken(ink) {
590
+ if (ink.kind === "literal") return ink.hex;
591
+ if (!isThemeColorToken(ink.role)) throw new Error(`Palette ink role is not a theme token: ${ink.role}`);
592
+ return ink.role;
593
+ }
594
+ /**
595
+ * Secondary text that has to read on several grounds (a surface and the tinted
596
+ * cards laid on it). The full-strength ink is `preferred` when it reaches 4.5:1
597
+ * on every ground, otherwise the palette's ink over the same paint; the muted
598
+ * ink is then the faintest blend from the first ground toward it that still
599
+ * reaches 4.5:1 everywhere. When no ink reaches 4.5:1 on every ground (a light
600
+ * ground and a dark one together), it's `unpaintable` and the caller decides
601
+ * which grounds to give up, rather than receiving a colour that only claims to read.
602
+ */
603
+ function paletteMutedInk(grounds, preferred, roles) {
604
+ const [first, ...rest] = grounds;
605
+ const paint = spanningPaint(solidPaint(first), ...rest.map((ground) => solidPaint(ground)));
606
+ const contrast = (hex) => worstContrast(hexLuminance(hex), paint);
607
+ const passes = (hex) => contrast(hex) >= ORDINARY_TEXT_MIN_CONTRAST_RATIO;
608
+ const endpoint = preferred !== null && passes(preferred) ? {
609
+ kind: "preferred",
610
+ hex: preferred
611
+ } : paletteInk(paint, roles);
612
+ if (endpoint.kind === "unpaintable") return endpoint;
613
+ const start = hexToRgb(first);
614
+ const end = hexToRgb(endpoint.hex);
615
+ const sample = (index) => rgbToHex(mix$1(start.r, end.r, index / 100), mix$1(start.g, end.g, index / 100), mix$1(start.b, end.b, index / 100));
616
+ const firstPassing = (low, high) => {
617
+ if (low >= high) return high;
618
+ const middle = Math.floor((low + high) / 2);
619
+ return passes(sample(middle)) ? firstPassing(low, middle) : firstPassing(middle + 1, high);
620
+ };
621
+ const hex = sample(firstPassing(0, 100));
622
+ return {
623
+ kind: "muted",
624
+ hex,
625
+ ratio: contrast(hex)
626
+ };
627
+ }
628
+ /** The muted ink on one solid ground. Total: black or white always reaches 4.58:1 on a solid. */
629
+ function paletteMutedInkOnSolid(ground, preferred, roles) {
630
+ const ink = paletteMutedInk([ground], preferred, roles);
631
+ if (ink.kind === "unpaintable") throw new Error(`No muted ink reads on the solid ground ${ground}`);
632
+ return ink.hex;
633
+ }
634
+ //#endregion
320
635
  //#region ../theme-core/src/palette/utils/opaqueSurfaceColor.ts
321
636
  /** Resolve an opaque colour, compositing alpha against an explicit underlay. */
322
637
  function resolveOpaqueSurfaceHex(reference, palette, underlayReference) {
@@ -595,121 +910,6 @@ const BUTTON_VISUAL_STATES = [
595
910
  "disabled"
596
911
  ];
597
912
  //#endregion
598
- //#region ../theme-core/src/palette/generateShades.ts
599
- function generateShades(hexColor, name) {
600
- const shadeSteps = [
601
- 50,
602
- 100,
603
- 200,
604
- 300,
605
- 400,
606
- 500,
607
- 600,
608
- 700,
609
- 800,
610
- 900,
611
- 950
612
- ];
613
- const base = featuresFromHex(hexColor);
614
- const hue = base.okH;
615
- const baseChroma = base.okC;
616
- const toneMap = {
617
- 50: .975,
618
- 100: .945,
619
- 200: .89,
620
- 300: .82,
621
- 400: .74,
622
- 500: .66,
623
- 600: .58,
624
- 700: .49,
625
- 800: .4,
626
- 900: .28,
627
- 950: .16
628
- };
629
- const shadeDefs = shadeSteps.map((step, idx) => {
630
- const t = idx / (shadeSteps.length - 1);
631
- const L = toneMap[step];
632
- const C = baseChroma * (.06 + .94 * Math.sin(Math.PI * t));
633
- return {
634
- name: `${name}-${step}`,
635
- hex: oklchToHexGamut(L, C, hue)
636
- };
637
- });
638
- shadeDefs.push({
639
- name,
640
- hex: hexColor
641
- });
642
- return shadeDefs;
643
- }
644
- //#endregion
645
- //#region ../theme-core/src/palette/neutralScale.ts
646
- /**
647
- * A neutral scale from near-white (`neutral-50`) to near-black (`neutral-950`)
648
- * on every palette, light or dark. Readers that want "the ground" or "the
649
- * text" ask the palette for those roles, not a fixed end of this scale.
650
- */
651
- function generateNeutralScale({ steps = 11, warm = false } = {}) {
652
- const shadeNames = [
653
- 50,
654
- 100,
655
- 200,
656
- 300,
657
- 400,
658
- 500,
659
- 600,
660
- 700,
661
- 800,
662
- 900,
663
- 950
664
- ];
665
- const count = Math.min(steps, shadeNames.length);
666
- return shadeNames.slice(0, count).map((shadeName, index) => ({
667
- name: `neutral-${shadeName}`,
668
- hex: oklchToHexGamut(mix(.98, .1, index / (count - 1)), .02, warm ? 85 : 250)
669
- }));
670
- }
671
- function mix(a, b, t) {
672
- return a + (b - a) * Math.max(0, Math.min(1, t));
673
- }
674
- //#endregion
675
- //#region ../theme-core/src/palette/utils/textColor.ts
676
- /**
677
- * Pick the better of black/white text for a given background using actual
678
- * contrast ratios, not a simple luminance cutoff. This is
679
- * `maxContrastBlackOrWhite` for a solid ground.
680
- *
681
- * @param background - Background color in hex or rgb/rgba format (e.g., '#FFFFFF' or 'rgb(255, 255, 255)')
682
- * @param _minContrast - Kept for callers. It cannot change the result: when
683
- * only one of black or white reaches it, that one is also the better of the two.
684
- * @returns '#000000' for light backgrounds, '#FFFFFF' for dark backgrounds
685
- */
686
- function pickBlackOrWhiteTextColor(background, _minContrast = 4.5) {
687
- const { r, g, b } = parseColorToRgb(background);
688
- return maxContrastBlackOrWhite(luminanceInterval(relativeLuminance(r, g, b))).ink === "black" ? "#000000" : "#FFFFFF";
689
- }
690
- /**
691
- * Backwards-compatible alias for callers that want the best black/white text
692
- * color for a background.
693
- */
694
- function getTextColorForBackground(background) {
695
- return pickBlackOrWhiteTextColor(background);
696
- }
697
- function parseColorToRgb(input) {
698
- const trimmed = input.trim();
699
- if (trimmed.startsWith("#")) return hexToRgb(trimmed);
700
- const rgbMatch = trimmed.match(/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*(?:0|1|0?\.\d+))?\s*\)$/i);
701
- if (rgbMatch?.[1] && rgbMatch[2] && rgbMatch[3]) return {
702
- r: clamp255(Number(rgbMatch[1])),
703
- g: clamp255(Number(rgbMatch[2])),
704
- b: clamp255(Number(rgbMatch[3]))
705
- };
706
- throw new Error("Unsupported color format");
707
- }
708
- function clamp255(value) {
709
- if (Number.isNaN(value)) return 0;
710
- return Math.max(0, Math.min(255, value));
711
- }
712
- //#endregion
713
913
  //#region ../theme-core/src/palette/utils/onColor.ts
714
914
  const BACKGROUND_ROLE_NAMES = /* @__PURE__ */ new Set([
715
915
  "primary",
@@ -733,122 +933,12 @@ function isOnColorBackgroundCandidateToken(token) {
733
933
  return BACKGROUND_ROLE_NAMES.has(role);
734
934
  }
735
935
  //#endregion
736
- //#region ../theme-core/src/palette/expandPalette.ts
737
- function colorsToMap(palette) {
738
- const map = {};
739
- for (const c of palette.colors) map[c.name] = c.hex;
740
- return map;
741
- }
742
- const nonShadeablePaletteRoleNames = /* @__PURE__ */ new Set([
743
- "success",
744
- "warning",
745
- "destructive"
746
- ]);
747
- /**
748
- * Status role aliases the persisted palette does not carry itself.
749
- *
750
- * Generators reference `--tb-error` (the site-style-owned input error border)
751
- * and `--tb-info` (`.alert-info`, `.status-info`, the field-note rule), but the
752
- * palette schema only defines `destructive` and has no `info` role at all.
753
- * Without these aliases those declarations name variables that are never
754
- * defined and browsers drop them. The SDK bridge resolves the same pair via
755
- * TOKEN_ALIASES, so both runtimes agree on what a status token means.
756
- *
757
- * Runs after the danger → destructive promotion above, so `destructive` is
758
- * already the single source of truth for the error colour.
759
- */
760
- function statusAliasTokens(expanded) {
761
- const aliases = {};
762
- if (expanded.destructive) aliases.error = expanded.destructive;
763
- if (expanded.accent) aliases.info = expanded.accent;
764
- return aliases;
765
- }
766
- function expandPalette(palette, options = {}) {
767
- return {
768
- ...expandBasePalette(palette),
769
- ...arrangementPaletteTokens(colorsToMap(palette), options)
770
- };
771
- }
772
- function expandBasePalette(palette) {
773
- const base = colorsToMap(palette);
774
- const expanded = { ...base };
775
- generateNeutralScale({
776
- steps: 11,
777
- warm: false
778
- }).forEach((n) => {
779
- expanded[n.name] = n.hex;
780
- });
781
- for (const [name, hex] of Object.entries(base)) {
782
- if (nonShadeablePaletteRoleNames.has(name)) continue;
783
- if (hex) generateShades(hex, name).forEach((shade) => {
784
- expanded[shade.name] = shade.hex;
785
- });
786
- }
787
- if (base.text) expanded.body = base.text;
788
- if (base.danger && !base.destructive) expanded.destructive = base.danger;
789
- Object.assign(expanded, statusAliasTokens(expanded));
790
- expanded.mutedText = readableMutedText(expanded["neutral-500"] ?? "#888", base);
791
- for (const [token, hex] of Object.entries({ ...expanded })) {
792
- if (!hex || !isOnColorBackgroundCandidateToken(token)) continue;
793
- const onToken = onColorTokenName(token);
794
- if (expanded[onToken]) continue;
795
- expanded[onToken] = getTextColorForBackground(hex);
796
- }
797
- return expanded;
798
- }
799
- /**
800
- * The neutral step stays when it reads on the ground. Otherwise (a dark palette
801
- * on a mid-tone ground, or a tinted light one) it's the ground-to-text blend
802
- * with a 4.5:1 floor, heading for black or white when the text can't reach it.
803
- */
804
- function readableMutedText(step, base) {
805
- const ground = base.background || base.surface;
806
- if (!ground || contrastRatio(step, ground) >= 4.5) return step;
807
- return deriveSurfaceMutedColor(ground, base.text && contrastRatio(base.text, ground) >= 4.5 ? base.text : getTextColorForBackground(ground));
808
- }
809
- /** Derived decoration colours never become editable palette swatches. */
810
- function deriveSurfaceDecorationColors(ground, text, accent) {
811
- const ink = getTextColorForBackground(ground);
812
- return {
813
- line: firstContrastBlend(ground, text, ground, 1.5),
814
- mark: firstContrastBlend(accent, ink, ground, 3)
815
- };
816
- }
817
- /** Secondary ink is blended toward its ground, with an ordinary-text contrast floor. */
818
- function deriveSurfaceMutedColor(ground, text) {
819
- const start = hexToRgb(ground);
820
- const end = hexToRgb(text);
821
- const sample = (index) => rgbToHex(mix$1(start.r, end.r, index / 100), mix$1(start.g, end.g, index / 100), mix$1(start.b, end.b, index / 100));
822
- return firstSafeMutedSample(sample, ground, 0, 100);
823
- }
824
- /** The blend moves monotonically from the ground toward its validated ink. */
825
- function firstSafeMutedSample(sample, ground, low, high) {
826
- if (low === high) return sample(high);
827
- const middle = Math.floor((low + high) / 2);
828
- return contrastRatio(sample(middle), ground) >= 4.5 ? firstSafeMutedSample(sample, ground, low, middle) : firstSafeMutedSample(sample, ground, middle + 1, high);
829
- }
830
- function firstContrastBlend(from, to, ground, threshold) {
831
- const start = hexToRgb(from);
832
- const end = hexToRgb(to);
833
- return Array.from({ length: 101 }, (_, index) => {
834
- const amount = index / 100;
835
- return rgbToHex(mix$1(start.r, end.r, amount), mix$1(start.g, end.g, amount), mix$1(start.b, end.b, amount));
836
- }).find((hex) => contrastRatio(hex, ground) >= threshold) ?? to;
837
- }
838
- /** `markSource` names the colour surface marks are derived from when a style marks in its brand rather than its accent. */
839
- function arrangementPaletteTokens(base, options) {
840
- if (options.arrangement !== true || !base.text) return {};
841
- return {
842
- onText: getTextColorForBackground(base.text),
843
- ...options.marksFrom === "primary" && base.primary ? { markSource: base.primary } : {}
844
- };
845
- }
846
- //#endregion
847
936
  //#region ../theme-core/src/surfaces/inkCertificate.ts
848
937
  /**
849
938
  * The ink certificate: every colour the site paints text or a mark on is held to
850
939
  * its threshold here, on every backdrop it shows. An ink that misses takes the
851
- * black/white ink that clears all of them; inks that pass are kept as they are,
940
+ * palette ink that clears all of them (the site's background or text colour,
941
+ * else black or white); inks that pass are kept as they are,
852
942
  * so a palette that already passes paints exactly what it declared. It never
853
943
  * throws, because owner palettes are arbitrary.
854
944
  *
@@ -887,10 +977,16 @@ function inkClearsBackdrops(ink, threshold, backdrops, measurement) {
887
977
  return hex !== null && contrastRatio(hex, backdrop, measurement.colourIndex) >= threshold;
888
978
  });
889
979
  }
890
- /** The black/white ink that clears every backdrop at ordinary-text contrast, preferring the best one for the painted end. */
980
+ /** The palette ink that clears every backdrop at ordinary-text contrast, or null when not even black or white does. */
891
981
  function fallbackInk(backdrops, measurement) {
892
- const [endpoint] = backdrops.slice(-1);
893
- return [...endpoint ? [pickBlackOrWhiteTextColor(endpoint)] : [], ...FALLBACK_INKS].find((candidate) => inkClearsBackdrops(candidate, contrastThresholdByPolicy["body-aa"], backdrops, measurement)) ?? null;
982
+ const ys = backdrops.map((backdrop) => hexLuminance(backdrop, measurement.colourIndex));
983
+ if (ys.length === 0) return null;
984
+ const ink = paletteInk(luminanceInterval(Math.min(...ys), Math.max(...ys)), paletteInkRoles(measurement.palette), contrastThresholdByPolicy["body-aa"]);
985
+ return ink.kind === "unpaintable" ? null : paletteInkToken(ink);
986
+ }
987
+ /** One solid backdrop: total, because black or white always clears it. */
988
+ function solidFallbackInk(backdrop, measurement) {
989
+ return paletteInkToken(paletteInkOnSolid(backdrop, paletteInkRoles(measurement.palette)));
894
990
  }
895
991
  function failingInks(inks, backdrops, measurement) {
896
992
  return {
@@ -930,9 +1026,9 @@ function certifySolidSurfaceInks(inks, backdrop, measurement) {
930
1026
  ...inks,
931
1027
  fallback: []
932
1028
  };
933
- return replaceFailing(inks, failing, pickBlackOrWhiteTextColor(backdrop));
1029
+ return replaceFailing(inks, failing, solidFallbackInk(backdrop, measurement));
934
1030
  }
935
- /** Kept when the ink clears the threshold, otherwise the black/white ink, which always clears a solid backdrop. */
1031
+ /** Kept when the ink clears the threshold, otherwise the palette ink, which always clears a solid backdrop. */
936
1032
  function certifyPaint(place, ink, threshold, backdrop, measurement) {
937
1033
  return inkClearsBackdrops(ink, threshold, [backdrop], measurement) ? {
938
1034
  place,
@@ -942,7 +1038,7 @@ function certifyPaint(place, ink, threshold, backdrop, measurement) {
942
1038
  fallback: false
943
1039
  } : {
944
1040
  place,
945
- ink: pickBlackOrWhiteTextColor(backdrop),
1041
+ ink: solidFallbackInk(backdrop, measurement),
946
1042
  backdrop,
947
1043
  threshold,
948
1044
  fallback: true,
@@ -950,214 +1046,65 @@ function certifyPaint(place, ink, threshold, backdrop, measurement) {
950
1046
  };
951
1047
  }
952
1048
  //#endregion
953
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/assertClassBrand.js
954
- function _assertClassBrand(e, t, n) {
955
- if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
956
- throw new TypeError("Private element is not present on this object");
1049
+ //#region ../theme-core/src/palette/utils/textColor.ts
1050
+ /**
1051
+ * Pick the better of black/white text for a given background using actual
1052
+ * contrast ratios, not a simple luminance cutoff. This is
1053
+ * `maxContrastBlackOrWhite` for a solid ground. It is the literal fallback
1054
+ * only: where a palette is in scope, `paletteInkOnSolid` tries the site's own
1055
+ * background and text colours first.
1056
+ *
1057
+ * @param background - Background color in hex or rgb/rgba format (e.g., '#FFFFFF' or 'rgb(255, 255, 255)')
1058
+ * @param _minContrast - Kept for callers. It cannot change the result: when
1059
+ * only one of black or white reaches it, that one is also the better of the two.
1060
+ * @returns '#000000' for light backgrounds, '#FFFFFF' for dark backgrounds
1061
+ */
1062
+ function pickBlackOrWhiteTextColor(background, _minContrast = 4.5) {
1063
+ const { r, g, b } = parseColorToRgb(background);
1064
+ return literalInkHex(maxContrastBlackOrWhite(luminanceInterval(relativeLuminance(r, g, b))).ink);
957
1065
  }
958
- //#endregion
959
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/classPrivateFieldSet2.js
960
- function _classPrivateFieldSet2(s, a, r) {
961
- return s.set(_assertClassBrand(s, a), r), r;
1066
+ function parseColorToRgb(input) {
1067
+ const trimmed = input.trim();
1068
+ if (trimmed.startsWith("#")) return hexToRgb(trimmed);
1069
+ const rgbMatch = trimmed.match(/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*(?:0|1|0?\.\d+))?\s*\)$/i);
1070
+ if (rgbMatch?.[1] && rgbMatch[2] && rgbMatch[3]) return {
1071
+ r: clamp255(Number(rgbMatch[1])),
1072
+ g: clamp255(Number(rgbMatch[2])),
1073
+ b: clamp255(Number(rgbMatch[3]))
1074
+ };
1075
+ throw new Error("Unsupported color format");
962
1076
  }
963
- //#endregion
964
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/classPrivateFieldGet2.js
965
- function _classPrivateFieldGet2(s, a) {
966
- return s.get(_assertClassBrand(s, a));
1077
+ function clamp255(value) {
1078
+ if (Number.isNaN(value)) return 0;
1079
+ return Math.max(0, Math.min(255, value));
967
1080
  }
968
1081
  //#endregion
969
- //#region ../theme-core/src/palette/family.ts
970
- var _members = /* @__PURE__ */ new WeakMap();
1082
+ //#region ../theme-core/src/surfaces/surfaceInks.ts
1083
+ /** Lines and focus rings are graphics: WCAG non-text contrast. */
1084
+ const GRAPHIC_MIN_CONTRAST_RATIO = 3;
971
1085
  /**
972
- * Only `colourFamily` makes one (the class is not exported), so a caller can't
973
- * swap in its own members and still hand the solver a valid family. That
974
- * matters because `unpaintable` relies on the members running from black to
975
- * white.
1086
+ * The palette token the control edge ink is solved from. Input styles whose
1087
+ * border uses another token keep their own colour, since this ink would carry
1088
+ * the wrong hue for them.
976
1089
  */
977
- var Family = class {
978
- constructor(seed, members) {
979
- this.seed = seed;
980
- _classPrivateFieldInitSpec(this, _members, void 0);
981
- _classPrivateFieldSet2(_members, this, Object.freeze(members));
982
- }
983
- /** Unique by hex, ascending luminance. Includes the exact seed, black and white. */
984
- get members() {
985
- return _classPrivateFieldGet2(_members, this);
986
- }
987
- };
988
- const GAMUT_BISECTION_STEPS = 18;
989
- /** The highest chroma at or below `c` that stays inside sRGB at this lightness and hue. */
990
- function gamutChroma(l, c, h) {
991
- if (inLinearSrgbGamut(oklchToLinearSrgb(l, c, h))) return c;
992
- return Array.from({ length: GAMUT_BISECTION_STEPS }).reduce(({ lo, hi }) => {
993
- const mid = (lo + hi) / 2;
994
- return inLinearSrgbGamut(oklchToLinearSrgb(l, mid, h)) ? {
995
- lo: mid,
996
- hi
997
- } : {
998
- lo,
999
- hi: mid
1000
- };
1001
- }, {
1002
- lo: 0,
1003
- hi: c
1004
- }).lo;
1005
- }
1006
- function oklabDistance(a, b) {
1007
- return Math.hypot(a.L - b.L, a.a - b.a, a.b - b.b);
1008
- }
1009
- /** OKLab distance between two rendered opaque hex colours. */
1010
- function hexOklabDistance(first, second) {
1011
- const lab = (hex) => {
1012
- const { r, g, b } = hexToRgb(hex);
1013
- return srgbToOklab(r, g, b);
1014
- };
1015
- return oklabDistance(lab(first), lab(second));
1016
- }
1017
- function colourFamily(seedHex) {
1018
- if (!/^#[0-9a-f]{6}$/i.test(seedHex)) throw new Error(`Expected an opaque #rrggbb colour: ${seedHex}`);
1019
- const features = featuresFromHex(seedHex.toLowerCase());
1020
- const seed = member(seedHex.toLowerCase(), {
1021
- l: features.okL,
1022
- c: features.okC,
1023
- h: features.okH
1024
- });
1025
- const seedTaper = Math.max(.001, Math.sin(Math.PI * seed.sample.l));
1026
- const samples = Array.from({ length: 513 }, (_, i) => {
1027
- const l = i / 512;
1028
- return sampleMember({
1029
- l,
1030
- c: gamutChroma(l, seed.sample.c * Math.min(1, Math.sin(Math.PI * l) / seedTaper), seed.sample.h),
1031
- h: seed.sample.h
1032
- });
1033
- });
1034
- return new Family(seed, [...new Map([seed, ...samples].map((candidate) => [candidate.hex, candidate]).reverse()).values()].sort((a, b) => a.y - b.y || (a.hex < b.hex ? -1 : a.hex > b.hex ? 1 : 0)));
1035
- }
1036
- function sampleMember(sample) {
1037
- const { r, g, b } = oklchToLinearSrgb(sample.l, sample.c, sample.h);
1038
- return member(rgbToHex(linearToSrgb(r), linearToSrgb(g), linearToSrgb(b)), sample);
1039
- }
1040
- function member(hex, sample) {
1041
- const { r, g, b } = hexToRgb(hex);
1042
- return {
1043
- hex,
1044
- y: hexLuminance(hex),
1045
- oklab: srgbToOklab(r, g, b),
1046
- sample
1047
- };
1048
- }
1049
- //#endregion
1050
- //#region ../theme-core/src/palette/utils/inkSolver.ts
1051
- /**
1052
- * How far (OKLab ΔE) a brand colour drawn as ink may be nudged along its own
1053
- * family before it stops reading as that colour. Past this the caller uses
1054
- * neutral or palette text instead (Will, 2026-10-14).
1055
- */
1056
- const BRAND_INK_MAX_DELTA_E = .08;
1057
- /**
1058
- * The seed itself when it clears `paint`, otherwise the family member nearest
1059
- * the seed (OKLab ΔE) that clears. On a light ground that is darker, on a dark
1060
- * one lighter. A passing member further than `maxDistance` from the seed is
1061
- * refused as `too-far`, which is distinct from `unpaintable`: the family runs
1062
- * from black to white, so if no member clears, neither does black or white.
1063
- */
1064
- function inkFrom(family, paint, ratio, maxDistance = BRAND_INK_MAX_DELTA_E) {
1065
- assertContrastRatio(ratio);
1066
- if (!Number.isFinite(maxDistance) || maxDistance < 0) throw new RangeError(`Maximum ink distance must be finite and not negative: ${maxDistance}`);
1067
- const seedRatio = worstContrast(family.seed.y, paint);
1068
- if (seedRatio >= ratio) return {
1069
- kind: "ink",
1070
- hex: family.seed.hex,
1071
- ratio: seedRatio,
1072
- source: "exact"
1073
- };
1074
- const nearest = family.members.reduce((best, member) => {
1075
- const achieved = worstContrast(member.y, paint);
1076
- if (achieved < ratio) return best;
1077
- const distance = oklabDistance(member.oklab, family.seed.oklab);
1078
- return best === null || distance < best.distance ? {
1079
- hex: member.hex,
1080
- distance,
1081
- ratio: achieved
1082
- } : best;
1083
- }, null);
1084
- if (nearest === null) return {
1085
- kind: "unpaintable",
1086
- interval: paint,
1087
- ratio
1088
- };
1089
- if (nearest.distance > maxDistance) return {
1090
- kind: "too-far",
1091
- nearest: {
1092
- hex: nearest.hex,
1093
- distance: nearest.distance
1094
- },
1095
- maxDistance
1096
- };
1097
- return {
1098
- kind: "ink",
1099
- hex: nearest.hex,
1100
- ratio: nearest.ratio,
1101
- source: "family"
1102
- };
1103
- }
1104
- /**
1105
- * Neutral text for a paint. The style's preferred neutral wins when one of its
1106
- * pair clears (the higher-contrast one, dark on a tie); otherwise literal black
1107
- * or white by `maxContrastBlackOrWhite`; otherwise `unpaintable`.
1108
- */
1109
- function neutralInk(paint, ratio, preferred) {
1110
- assertContrastRatio(ratio);
1111
- if (preferred) {
1112
- const dark = worstContrast(hexLuminance(preferred.dark), paint);
1113
- const light = worstContrast(hexLuminance(preferred.light), paint);
1114
- const [hex, achieved] = dark >= light ? [preferred.dark, dark] : [preferred.light, light];
1115
- if (achieved >= ratio) return {
1116
- kind: "ink",
1117
- hex,
1118
- ratio: achieved,
1119
- source: "neutral"
1120
- };
1121
- }
1122
- const literal = maxContrastBlackOrWhite(paint);
1123
- return literal.ratio >= ratio ? {
1124
- kind: "ink",
1125
- hex: literal.ink === "black" ? "#000000" : "#ffffff",
1126
- ratio: literal.ratio,
1127
- source: "neutral"
1128
- } : {
1129
- kind: "unpaintable",
1130
- interval: paint,
1131
- ratio
1132
- };
1133
- }
1134
- //#endregion
1135
- //#region ../theme-core/src/surfaces/surfaceInks.ts
1136
- /** Lines and focus rings are graphics: WCAG non-text contrast. */
1137
- const GRAPHIC_MIN_CONTRAST_RATIO = 3;
1138
- /**
1139
- * The palette token the control edge ink is solved from. Input styles whose
1140
- * border uses another token keep their own colour, since this ink would carry
1141
- * the wrong hue for them.
1142
- */
1143
- const CONTROL_EDGE_SEED_TOKEN = "border";
1144
- const INK_SEEDS = {
1145
- brand: {
1146
- token: "primary",
1147
- ratio: ORDINARY_TEXT_MIN_CONTRAST_RATIO
1148
- },
1149
- accent: {
1150
- token: "accent",
1151
- ratio: ORDINARY_TEXT_MIN_CONTRAST_RATIO
1152
- },
1153
- focus: {
1154
- token: "primary",
1155
- ratio: GRAPHIC_MIN_CONTRAST_RATIO
1156
- },
1157
- control: {
1158
- token: CONTROL_EDGE_SEED_TOKEN,
1159
- ratio: GRAPHIC_MIN_CONTRAST_RATIO,
1160
- maxDistance: 2
1090
+ const CONTROL_EDGE_SEED_TOKEN = "border";
1091
+ const INK_SEEDS = {
1092
+ brand: {
1093
+ token: "primary",
1094
+ ratio: ORDINARY_TEXT_MIN_CONTRAST_RATIO
1095
+ },
1096
+ accent: {
1097
+ token: "accent",
1098
+ ratio: ORDINARY_TEXT_MIN_CONTRAST_RATIO
1099
+ },
1100
+ focus: {
1101
+ token: "primary",
1102
+ ratio: GRAPHIC_MIN_CONTRAST_RATIO
1103
+ },
1104
+ control: {
1105
+ token: CONTROL_EDGE_SEED_TOKEN,
1106
+ ratio: GRAPHIC_MIN_CONTRAST_RATIO,
1107
+ maxDistance: 2
1161
1108
  }
1162
1109
  };
1163
1110
  /**
@@ -1168,7 +1115,7 @@ const INK_SEEDS = {
1168
1115
  */
1169
1116
  function solveSurfaceInks(backdropHex, textInk, palette, candidates = {}) {
1170
1117
  const paint = solidPaint(backdropHex);
1171
- const fallback = literalInk(resolveConcreteColorHex(textInk, palette) ?? pickBlackOrWhiteTextColor(backdropHex));
1118
+ const fallback = literalInk$1(resolveConcreteColorHex(textInk, palette) ?? pickBlackOrWhiteTextColor(backdropHex));
1172
1119
  return {
1173
1120
  brand: solveInk({
1174
1121
  ...INK_SEEDS.brand,
@@ -1194,12 +1141,12 @@ function solveInk(seed, paint, palette, fallback) {
1194
1141
  if (!token || !seedHex.success) return fallback;
1195
1142
  const solved = inkFrom(familyOf(seedHex.data), paint, seed.ratio, seed.maxDistance);
1196
1143
  switch (solved.kind) {
1197
- case "ink": return solved.source === "exact" ? token : literalInk(solved.hex);
1144
+ case "ink": return solved.source === "exact" ? token : literalInk$1(solved.hex);
1198
1145
  case "too-far":
1199
1146
  case "unpaintable": return fallback;
1200
1147
  }
1201
1148
  }
1202
- function literalInk(hex) {
1149
+ function literalInk$1(hex) {
1203
1150
  return hexColorSchema.parse(hex.toLowerCase());
1204
1151
  }
1205
1152
  const FAMILY_CACHE_LIMIT = 64;
@@ -1214,14 +1161,6 @@ function familyOf(seed) {
1214
1161
  }
1215
1162
  //#endregion
1216
1163
  //#region ../theme-core/src/surfaces/resolveSurfaceForeground.ts
1217
- const FALLBACK_TEXT_TOKENS = [
1218
- "text",
1219
- "primaryForeground",
1220
- "secondaryForeground",
1221
- "accentForeground",
1222
- "neutral-950",
1223
- "neutral-50"
1224
- ];
1225
1164
  const CANONICAL_EQUIVALENT_TOKEN_ORDER = [
1226
1165
  "text",
1227
1166
  "primaryForeground",
@@ -1272,11 +1211,7 @@ function resolveDeterministicForeground(backgroundReference, candidates, palette
1272
1211
  function resolveMeasuredForeground(backgroundReference, backgroundHex, candidates, palette) {
1273
1212
  const backgroundToken = paletteToken(backgroundReference);
1274
1213
  const derivedOnToken = backgroundToken ? onColorTokenName(backgroundToken) : null;
1275
- const text = firstSafeToken([
1276
- candidates.text,
1277
- derivedOnToken,
1278
- ...FALLBACK_TEXT_TOKENS
1279
- ], backgroundHex, palette, derivedOnToken ? [derivedOnToken] : []) ?? pickBlackOrWhiteTextColor(backgroundHex);
1214
+ const text = firstSafeToken([candidates.text, derivedOnToken], backgroundHex, palette, derivedOnToken ? [derivedOnToken] : []) ?? paletteTextInk(backgroundHex, palette);
1280
1215
  return certifiedForeground(knownForeground({
1281
1216
  text,
1282
1217
  heading: safeTokenOr(candidates.heading, text, backgroundHex, palette),
@@ -1288,118 +1223,537 @@ function resolveMeasuredForeground(backgroundReference, backgroundHex, candidate
1288
1223
  inks: solveSurfaceInks(backgroundHex, text, palette)
1289
1224
  }, candidates.linkHover, palette), palette);
1290
1225
  }
1226
+ /** The automatic text when neither the authored ink nor the ground's on-colour reads: the palette's own pair, then black or white. */
1227
+ function paletteTextInk(backgroundHex, palette) {
1228
+ return paletteInkToken(paletteInkOnSolid(backgroundHex, paletteInkRoles(palette)));
1229
+ }
1230
+ /**
1231
+ * Every measured foreground goes through the ink certificate, whoever paints it
1232
+ * (sections, cards, header, footer, accordions). The candidates above are chosen
1233
+ * to pass, so the certificate is normally a no-op and the foreground is returned
1234
+ * as it was; an ink that misses takes black/white, and the solved inks follow
1235
+ * the certified text.
1236
+ */
1237
+ function certifiedForeground(foreground, palette) {
1238
+ const { backdropHex } = foreground.provenance;
1239
+ const certified = certifySolidSurfaceInks({ foreground: foreground.roles }, backdropHex, { palette });
1240
+ if (certified.fallback.length === 0) return foreground;
1241
+ return {
1242
+ ...foreground,
1243
+ roles: certified.foreground,
1244
+ provenance: {
1245
+ ...foreground.provenance,
1246
+ inks: solveSurfaceInks(backdropHex, certified.foreground.text, palette),
1247
+ fallback: certified.fallback
1248
+ }
1249
+ };
1250
+ }
1251
+ function resolveTrustedTreatmentForeground(candidates, palette) {
1252
+ const text = canonicalInk(candidates.text, palette);
1253
+ if (!text) return { kind: "unmeasured-paint" };
1254
+ return knownForeground({
1255
+ text,
1256
+ heading: canonicalInk(candidates.heading, palette) ?? text,
1257
+ link: canonicalInk(candidates.link, palette) ?? text,
1258
+ supporting: canonicalInk(candidates.supporting, palette) ?? text
1259
+ }, { kind: "trusted-treatment" }, candidates.linkHover, palette);
1260
+ }
1261
+ function knownForeground(roles, provenance, hoverCandidate, palette) {
1262
+ const hover = planForegroundHover({
1263
+ restingToken: roles.link,
1264
+ candidate: canonicalHoverToken(hoverCandidate, palette),
1265
+ palette,
1266
+ backdrops: provenance.kind === "measured" ? [provenance.backdropHex] : null
1267
+ });
1268
+ return {
1269
+ kind: "known",
1270
+ provenance,
1271
+ roles: {
1272
+ ...roles,
1273
+ linkHover: hover.token,
1274
+ muted: provenance.kind === "measured" ? paletteMutedInkOnSolid(provenance.backdropHex, resolveConcreteColorHex(roles.text, palette), paletteInkRoles(palette)) : roles.text
1275
+ },
1276
+ hoverDecoration: hover.decoration
1277
+ };
1278
+ }
1279
+ function canonicalHoverToken(reference, palette) {
1280
+ const token = parseThemeColorToken(reference);
1281
+ if (token) {
1282
+ const parts = parseColorTokenParts(token);
1283
+ if (parts.kind === "token" && resolveConcreteColorHex(parts.token, palette)) return token;
1284
+ }
1285
+ return canonicalToken(reference, palette);
1286
+ }
1287
+ /**
1288
+ * The one rule for what a resolved foreground publishes for the solved inks.
1289
+ * Only a measured paint under a publishing runtime publishes inks; any other
1290
+ * paint it owns resets them, and a paint it only inherits publishes nothing.
1291
+ */
1292
+ function surfaceInkPublication(foreground, policy) {
1293
+ switch (foreground.kind) {
1294
+ case "inherits": return { kind: "none" };
1295
+ case "unmeasured-paint": return { kind: "reset" };
1296
+ case "known": return foreground.provenance.kind === "measured" && policy === "publish" ? {
1297
+ kind: "solved",
1298
+ inks: foreground.provenance.inks
1299
+ } : { kind: "reset" };
1300
+ }
1301
+ }
1302
+ /** Keep a candidate only when it meets ordinary-text contrast on the ground. */
1303
+ function safeTokenOr(candidate, fallback, backgroundHex, palette) {
1304
+ return firstSafeToken([candidate], backgroundHex, palette) ?? fallback;
1305
+ }
1306
+ function firstSafeToken(candidates, backgroundHex, palette, preferredEquivalentTokens = []) {
1307
+ const seen = /* @__PURE__ */ new Set();
1308
+ for (const candidate of candidates) {
1309
+ const token = canonicalToken(candidate, palette, preferredEquivalentTokens);
1310
+ if (!token || seen.has(token)) continue;
1311
+ seen.add(token);
1312
+ const foregroundHex = resolveConcreteColorHex(token, palette);
1313
+ if (foregroundHex && contrastRatio(backgroundHex, foregroundHex) >= 4.5) return token;
1314
+ }
1315
+ return null;
1316
+ }
1317
+ /**
1318
+ * A media treatment's ink as the resolved contract spells it. Nothing measures
1319
+ * the paint, so literal black or white (the photo tint's fallback) stays that
1320
+ * literal colour rather than borrowing whichever palette token shares its value
1321
+ * today, or being dropped when none does. Any other reference is a palette token.
1322
+ * Measured solids keep `firstSafeToken`, whose equivalent on-colour carries the
1323
+ * ground's own hover softening.
1324
+ */
1325
+ function canonicalInk(reference, palette) {
1326
+ return literalInk(reference) ?? canonicalToken(reference, palette);
1327
+ }
1328
+ function literalInk(reference) {
1329
+ const normalized = normalizedReference(reference)?.toUpperCase();
1330
+ return normalized === "#000000" || normalized === "#FFFFFF" ? normalized : null;
1331
+ }
1332
+ function canonicalToken(reference, palette, preferredEquivalentTokens = []) {
1333
+ const normalized = normalizedReference(reference);
1334
+ if (!normalized || normalized === "transparent") return null;
1335
+ const direct = parseThemeColorToken(normalized);
1336
+ if (direct && resolveConcreteColorHex(direct, palette)) return direct;
1337
+ const referenceHex = resolveConcreteColorHex(normalized, palette);
1338
+ if (!referenceHex) return null;
1339
+ const equivalent = [
1340
+ ...preferredEquivalentTokens,
1341
+ ...CANONICAL_EQUIVALENT_TOKEN_ORDER,
1342
+ ...Object.keys(palette).sort()
1343
+ ].find((token) => {
1344
+ const parsed = parseThemeColorToken(token);
1345
+ return parsed !== null && resolveConcreteColorHex(parsed, palette)?.toLowerCase() === referenceHex.toLowerCase();
1346
+ });
1347
+ return equivalent ? parseThemeColorToken(equivalent) : null;
1348
+ }
1349
+ function paletteToken(reference) {
1350
+ const parts = parseColorTokenParts(reference);
1351
+ return parts.kind === "token" && parts.opacityPercent === null ? parts.token : null;
1352
+ }
1353
+ function normalizedReference(value) {
1354
+ if (typeof value !== "string") return null;
1355
+ const normalized = value.trim();
1356
+ return normalized.length > 0 ? normalized : null;
1357
+ }
1358
+ //#endregion
1359
+ //#region ../theme-core/src/palette/generateShades.ts
1360
+ function generateShades(hexColor, name) {
1361
+ const shadeSteps = [
1362
+ 50,
1363
+ 100,
1364
+ 200,
1365
+ 300,
1366
+ 400,
1367
+ 500,
1368
+ 600,
1369
+ 700,
1370
+ 800,
1371
+ 900,
1372
+ 950
1373
+ ];
1374
+ const base = featuresFromHex(hexColor);
1375
+ const hue = base.okH;
1376
+ const baseChroma = base.okC;
1377
+ const toneMap = {
1378
+ 50: .975,
1379
+ 100: .945,
1380
+ 200: .89,
1381
+ 300: .82,
1382
+ 400: .74,
1383
+ 500: .66,
1384
+ 600: .58,
1385
+ 700: .49,
1386
+ 800: .4,
1387
+ 900: .28,
1388
+ 950: .16
1389
+ };
1390
+ const shadeDefs = shadeSteps.map((step, idx) => {
1391
+ const t = idx / (shadeSteps.length - 1);
1392
+ const L = toneMap[step];
1393
+ const C = baseChroma * (.06 + .94 * Math.sin(Math.PI * t));
1394
+ return {
1395
+ name: `${name}-${step}`,
1396
+ hex: oklchToHexGamut(L, C, hue)
1397
+ };
1398
+ });
1399
+ shadeDefs.push({
1400
+ name,
1401
+ hex: hexColor
1402
+ });
1403
+ return shadeDefs;
1404
+ }
1405
+ //#endregion
1406
+ //#region ../theme-core/src/palette/neutralScale.ts
1407
+ /** The cool slate tint every scale had before #1863, kept for grounds with no hue to lend. */
1408
+ const SLATE_NEUTRAL_TINT = {
1409
+ hue: 250,
1410
+ chroma: .02
1411
+ };
1412
+ /** Below this OKLCH chroma a background reads as plain white, grey or black, so its hue is noise. */
1413
+ const ACHROMATIC_CHROMA = .005;
1414
+ /**
1415
+ * The tint a palette's greys take from its background: the background's own
1416
+ * hue at no more than the slate scale's chroma, so a cream site gets warm greys.
1417
+ * A background with no hue to lend (white, `#fafafa`, a missing or unreadable
1418
+ * value) keeps the slate tint, so those palettes keep their exact neutrals.
1419
+ */
1420
+ function neutralTint(background) {
1421
+ const parsed = hexColorSchema.safeParse(background?.toLowerCase());
1422
+ if (!parsed.success) return SLATE_NEUTRAL_TINT;
1423
+ const { r, g, b } = hexToRgb(parsed.data);
1424
+ const { L, a, b: ob } = srgbToOklab(r, g, b);
1425
+ const { C, h } = oklabToOklch(L, a, ob);
1426
+ return C < ACHROMATIC_CHROMA ? SLATE_NEUTRAL_TINT : {
1427
+ hue: h,
1428
+ chroma: Math.min(C, SLATE_NEUTRAL_TINT.chroma)
1429
+ };
1430
+ }
1431
+ /**
1432
+ * A neutral scale from near-white (`neutral-50`) to near-black (`neutral-950`)
1433
+ * on every palette, light or dark. Readers that want "the ground" or "the
1434
+ * text" ask the palette for those roles, not a fixed end of this scale.
1435
+ */
1436
+ function generateNeutralScale({ steps = 11, tint = SLATE_NEUTRAL_TINT } = {}) {
1437
+ const shadeNames = [
1438
+ 50,
1439
+ 100,
1440
+ 200,
1441
+ 300,
1442
+ 400,
1443
+ 500,
1444
+ 600,
1445
+ 700,
1446
+ 800,
1447
+ 900,
1448
+ 950
1449
+ ];
1450
+ const count = Math.min(steps, shadeNames.length);
1451
+ return shadeNames.slice(0, count).map((shadeName, index) => ({
1452
+ name: `neutral-${shadeName}`,
1453
+ hex: oklchToHexGamut(mix(.98, .1, index / (count - 1)), tint.chroma, tint.hue)
1454
+ }));
1455
+ }
1456
+ function mix(a, b, t) {
1457
+ return a + (b - a) * Math.max(0, Math.min(1, t));
1458
+ }
1459
+ //#endregion
1460
+ //#region ../theme-core/src/palette/utils/scrimContrast.ts
1461
+ const WHITE = "#ffffff";
1462
+ const BLACK = "#000000";
1463
+ /** `top` at `alpha` over opaque `bottom`, blended as CSS paints an overlay. */
1464
+ function compositeHex(topHex, alpha, bottomHex) {
1465
+ const top = hexToRgb(topHex);
1466
+ const bottom = hexToRgb(bottomHex);
1467
+ const mix = (a, b) => Math.round(alpha * a + (1 - alpha) * b);
1468
+ return rgbToHex(mix(top.r, bottom.r), mix(top.g, bottom.g), mix(top.b, bottom.b));
1469
+ }
1470
+ /**
1471
+ * The lowest contrast `foreground` can reach over `scrim` at `alpha` laid on
1472
+ * any pixel. A foreground whose luminance falls inside the range the
1473
+ * composites can take has a worst case of 1:1.
1474
+ */
1475
+ function worstCaseScrimContrast(input) {
1476
+ const overWhite = compositeHex(input.scrimHex, input.alpha, WHITE);
1477
+ const overBlack = compositeHex(input.scrimHex, input.alpha, BLACK);
1478
+ const luminance = (hex) => {
1479
+ const { r, g, b } = hexToRgb(hex);
1480
+ return relativeLuminance(r, g, b);
1481
+ };
1482
+ const foreground = luminance(input.foregroundHex);
1483
+ const low = luminance(overBlack);
1484
+ const high = luminance(overWhite);
1485
+ if (foreground >= low && foreground <= high) return 1;
1486
+ return Math.min(contrastRatio(input.foregroundHex, overWhite), contrastRatio(input.foregroundHex, overBlack));
1487
+ }
1488
+ /**
1489
+ * The smallest scrim opacity, in hundredths, at which every foreground keeps
1490
+ * `threshold` contrast over any pixel. `null` when even an opaque scrim fails,
1491
+ * which means the foreground was never legible on the scrim colour itself.
1492
+ */
1493
+ function minimumScrimOpacity(input) {
1494
+ const passes = (alpha) => input.foregroundHexes.every((foregroundHex) => worstCaseScrimContrast({
1495
+ foregroundHex,
1496
+ scrimHex: input.scrimHex,
1497
+ alpha
1498
+ }) >= input.threshold);
1499
+ return Array.from({ length: 101 }, (_, hundredths) => hundredths / 100).find(passes) ?? null;
1500
+ }
1501
+ /** Shared samples for literal RGB washes and palette-token gradient veils. */
1502
+ function gradientScrimSamples(gradient, alpha, palette) {
1503
+ const literal = [...gradient.matchAll(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/g)].map((stop) => ({
1504
+ hex: rgbToHex(Number(stop[1]), Number(stop[2]), Number(stop[3])),
1505
+ alpha: alpha * (stop[4] === void 0 ? 1 : Number(stop[4]))
1506
+ }));
1507
+ const tokens = [...gradient.matchAll(/var\(--tb-([\w-]+)\)/g)].flatMap((stop) => {
1508
+ const hex = stop[1] ? resolveConcreteColorHex(stop[1], palette) : null;
1509
+ return hex ? [{
1510
+ hex,
1511
+ alpha
1512
+ }] : [];
1513
+ });
1514
+ return [...literal, ...tokens];
1515
+ }
1516
+ /** The ink with the stronger worst-pixel guarantee identifies the veil tone.
1517
+ * No readable samples (or a tie) leaves classification to the foreground owner.
1518
+ */
1519
+ function scrimTone(samples) {
1520
+ if (samples.length === 0) return null;
1521
+ const worst = (foregroundHex) => Math.min(...samples.map((sample) => worstCaseScrimContrast({
1522
+ foregroundHex,
1523
+ scrimHex: sample.hex,
1524
+ alpha: sample.alpha
1525
+ })));
1526
+ const white = worst(WHITE);
1527
+ const black = worst(BLACK);
1528
+ return white === black ? null : white > black ? "dark" : "light";
1529
+ }
1530
+ //#endregion
1531
+ //#region ../theme-core/src/palette/expandPalette.ts
1532
+ function colorsToMap(palette) {
1533
+ const map = {};
1534
+ for (const c of palette.colors) map[c.name] = c.hex;
1535
+ return map;
1536
+ }
1537
+ const nonShadeablePaletteRoleNames = /* @__PURE__ */ new Set([
1538
+ "success",
1539
+ "warning",
1540
+ "destructive"
1541
+ ]);
1542
+ /**
1543
+ * Status role aliases the persisted palette does not carry itself.
1544
+ *
1545
+ * Generators reference `--tb-error` (the site-style-owned input error border)
1546
+ * and `--tb-info` (`.alert-info`, `.status-info`, the field-note rule), but the
1547
+ * palette schema only defines `destructive` and has no `info` role at all.
1548
+ * Without these aliases those declarations name variables that are never
1549
+ * defined and browsers drop them. The SDK bridge resolves the same pair via
1550
+ * TOKEN_ALIASES, so both runtimes agree on what a status token means.
1551
+ *
1552
+ * Runs after the danger → destructive promotion above, so `destructive` is
1553
+ * already the single source of truth for the error colour.
1554
+ */
1555
+ function statusAliasTokens(expanded) {
1556
+ const aliases = {};
1557
+ if (expanded.destructive) aliases.error = expanded.destructive;
1558
+ if (expanded.accent) aliases.info = expanded.accent;
1559
+ return aliases;
1560
+ }
1561
+ function expandPalette(palette, options = {}) {
1562
+ return {
1563
+ ...expandBasePalette(palette),
1564
+ ...arrangementPaletteTokens(colorsToMap(palette), options)
1565
+ };
1566
+ }
1567
+ function expandBasePalette(palette) {
1568
+ const base = colorsToMap(palette);
1569
+ const expanded = { ...base };
1570
+ const roles = paletteInkRoles(base);
1571
+ generateNeutralScale({
1572
+ steps: 11,
1573
+ tint: neutralTint(base.background)
1574
+ }).forEach((n) => {
1575
+ expanded[n.name] = n.hex;
1576
+ });
1577
+ for (const [name, hex] of Object.entries(base)) {
1578
+ if (nonShadeablePaletteRoleNames.has(name)) continue;
1579
+ if (hex) generateShades(hex, name).forEach((shade) => {
1580
+ expanded[shade.name] = shade.hex;
1581
+ });
1582
+ }
1583
+ if (base.text) expanded.body = base.text;
1584
+ if (base.danger && !base.destructive) expanded.destructive = base.danger;
1585
+ Object.assign(expanded, statusAliasTokens(expanded));
1586
+ expanded.mutedText = readableMutedText(expanded["neutral-500"] ?? "#888", base, roles);
1587
+ for (const [token, hex] of Object.entries({ ...expanded })) {
1588
+ if (!hex || !isOnColorBackgroundCandidateToken(token)) continue;
1589
+ const onToken = onColorTokenName(token);
1590
+ if (expanded[onToken]) continue;
1591
+ expanded[onToken] = paletteInkOnSolid(hex, roles).hex;
1592
+ }
1593
+ Object.assign(expanded, groundMutedInkTokens(expanded));
1594
+ return expanded;
1595
+ }
1596
+ /**
1597
+ * The strongest tints booking and registration screens lay over a ground
1598
+ * where secondary text sits: selected option cards, event tiles and summaries
1599
+ * tint `primary` at 5–10% (`blocks/vars/appointment-booking.ts`,
1600
+ * `blocks/vars/event-registration.ts`, `blocks-static/event-registration.css`),
1601
+ * the appointment summary and hover rows tint `text`/`onSurface` at 5%, and the
1602
+ * registration summary lays `muted` at 42%. A weaker tint of the same colour
1603
+ * sits between the ground and these, so solving against the strongest covers it.
1604
+ * A selected card lays its tint over its own ground, so the same list applies
1605
+ * over the surface and over the page background that event option cards paint.
1606
+ * A new tint under secondary text belongs here, and the CSS paints it with
1607
+ * the ground's faded tint token (`groundTintToken`) before the colour itself;
1608
+ * `secondaryTextTints.test.ts` fails if the CSS lays one that isn't covered or
1609
+ * doesn't read that token.
1610
+ */
1611
+ const SURFACE_SECONDARY_TEXT_TINTS = [
1612
+ {
1613
+ token: "primary",
1614
+ alpha: .1
1615
+ },
1616
+ {
1617
+ token: "text",
1618
+ alpha: .05
1619
+ },
1620
+ {
1621
+ token: "onSurface",
1622
+ alpha: .05
1623
+ },
1624
+ {
1625
+ token: "muted",
1626
+ alpha: .42
1627
+ }
1628
+ ];
1629
+ /** The strongest tint alpha per colour, for the CSS that paints those tints. */
1630
+ const SURFACE_SECONDARY_TEXT_TINT_ALPHA = Object.fromEntries(SURFACE_SECONDARY_TEXT_TINTS.map(({ token, alpha }) => [token, alpha]));
1291
1631
  /**
1292
- * Every measured foreground goes through the ink certificate, whoever paints it
1293
- * (sections, cards, header, footer, accordions). The candidates above are chosen
1294
- * to pass, so the certificate is normally a no-op and the foreground is returned
1295
- * as it was; an ink that misses takes black/white, and the solved inks follow
1296
- * the certified text.
1632
+ * The grounds booking and registration secondary text sits on, with the token
1633
+ * its solved muted ink is published as: the surface (panels, details) and the
1634
+ * page background (event registration's option, ticket and payment cards).
1297
1635
  */
1298
- function certifiedForeground(foreground, palette) {
1299
- const { backdropHex } = foreground.provenance;
1300
- const certified = certifySolidSurfaceInks({ foreground: foreground.roles }, backdropHex, { palette });
1301
- if (certified.fallback.length === 0) return foreground;
1302
- return {
1303
- ...foreground,
1304
- roles: certified.foreground,
1305
- provenance: {
1306
- ...foreground.provenance,
1307
- inks: solveSurfaceInks(backdropHex, certified.foreground.text, palette),
1308
- fallback: certified.fallback
1309
- }
1636
+ const MUTED_INK_TOKENS = {
1637
+ surface: "onSurfaceMuted",
1638
+ background: "onBackgroundMuted"
1639
+ };
1640
+ /**
1641
+ * Secondary text on a ground, solved rather than faded from the ground's
1642
+ * on-colour in CSS, against the ground and every tint laid over it.
1643
+ *
1644
+ * Some palettes admit no single ink for all of them: a mid-tone surface with a
1645
+ * dark `primary` tint and a light `muted` one. The plain ground always has one
1646
+ * (black or white reads on any solid), so the ground is kept, each tint is kept
1647
+ * in list order while one ink still reads on everything kept so far, and the
1648
+ * tints that can't join are faded toward the ground until that ink reads on
1649
+ * them too. Fading the tint rather than giving it an ink of its own keeps every
1650
+ * line of text on it (titles and prices as well as secondary text) close to the
1651
+ * ground its colours were chosen for. Hosted palettes and the SDK bridge both
1652
+ * derive it here.
1653
+ */
1654
+ function groundMutedInk(palette, ground) {
1655
+ const groundHex = palette[ground];
1656
+ if (!groundHex) return null;
1657
+ const preferred = palette[onColorTokenName(ground)] ?? null;
1658
+ const roles = paletteInkRoles(palette);
1659
+ const initial = {
1660
+ grounds: [groundHex],
1661
+ hex: paletteMutedInkOnSolid(groundHex, preferred, roles),
1662
+ uncovered: []
1310
1663
  };
1311
- }
1312
- function resolveTrustedTreatmentForeground(candidates, palette) {
1313
- const text = canonicalToken(candidates.text, palette);
1314
- if (!text) return { kind: "unmeasured-paint" };
1315
- return knownForeground({
1316
- text,
1317
- heading: canonicalToken(candidates.heading, palette) ?? text,
1318
- link: canonicalToken(candidates.link, palette) ?? text,
1319
- supporting: canonicalToken(candidates.supporting, palette) ?? text
1320
- }, { kind: "trusted-treatment" }, candidates.linkHover, palette);
1321
- }
1322
- function knownForeground(roles, provenance, hoverCandidate, palette) {
1323
- const hover = planForegroundHover({
1324
- restingToken: roles.link,
1325
- candidate: canonicalHoverToken(hoverCandidate, palette),
1326
- palette,
1327
- backdrops: provenance.kind === "measured" ? [provenance.backdropHex] : null
1328
- });
1664
+ const solved = SURFACE_SECONDARY_TEXT_TINTS.reduce((kept, { token, alpha }) => {
1665
+ const tintHex = palette[token];
1666
+ if (!tintHex) return kept;
1667
+ const grounds = [...kept.grounds, compositeHex(tintHex, alpha, groundHex)];
1668
+ const ink = paletteMutedInk(grounds, preferred, roles);
1669
+ return ink.kind === "unpaintable" ? {
1670
+ ...kept,
1671
+ uncovered: [...kept.uncovered, {
1672
+ token,
1673
+ alpha,
1674
+ tintHex
1675
+ }]
1676
+ } : {
1677
+ ...kept,
1678
+ grounds,
1679
+ hex: ink.hex
1680
+ };
1681
+ }, initial);
1329
1682
  return {
1330
- kind: "known",
1331
- provenance,
1332
- roles: {
1333
- ...roles,
1334
- linkHover: hover.token,
1335
- muted: provenance.kind === "measured" ? deriveSurfaceMutedColor(provenance.backdropHex, resolveConcreteColorHex(roles.text, palette) ?? provenance.backdropHex) : roles.text
1336
- },
1337
- hoverDecoration: hover.decoration
1683
+ hex: solved.hex,
1684
+ fadedTints: solved.uncovered.map(({ token, alpha, tintHex }) => ({
1685
+ token,
1686
+ hex: tintFadedUntilInkReads(tintHex, alpha, groundHex, solved.hex)
1687
+ }))
1338
1688
  };
1339
1689
  }
1340
- function canonicalHoverToken(reference, palette) {
1341
- const token = parseThemeColorToken(reference);
1342
- if (token) {
1343
- const parts = parseColorTokenParts(token);
1344
- if (parts.kind === "token" && resolveConcreteColorHex(parts.token, palette)) return token;
1345
- }
1346
- return canonicalToken(reference, palette);
1690
+ /** The tint colour a ground publishes in place of a tint its muted ink can't read on, e.g. `surfaceTintMuted`. */
1691
+ function groundTintToken(ground, tint) {
1692
+ return `${ground}Tint${tint.charAt(0).toUpperCase()}${tint.slice(1)}`;
1347
1693
  }
1348
1694
  /**
1349
- * The one rule for what a resolved foreground publishes for the solved inks.
1350
- * Only a measured paint under a publishing runtime publishes inks; any other
1351
- * paint it owns resets them, and a paint it only inherits publishes nothing.
1695
+ * The tint blended toward the ground in 1% steps, stopping at the first that
1696
+ * the ink reads on when laid at `alpha`. The ground itself always reads, since
1697
+ * the ink was solved on it.
1352
1698
  */
1353
- function surfaceInkPublication(foreground, policy) {
1354
- switch (foreground.kind) {
1355
- case "inherits": return { kind: "none" };
1356
- case "unmeasured-paint": return { kind: "reset" };
1357
- case "known": return foreground.provenance.kind === "measured" && policy === "publish" ? {
1358
- kind: "solved",
1359
- inks: foreground.provenance.inks
1360
- } : { kind: "reset" };
1361
- }
1699
+ function tintFadedUntilInkReads(tintHex, alpha, groundHex, inkHex) {
1700
+ const tint = hexToRgb(tintHex);
1701
+ const ground = hexToRgb(groundHex);
1702
+ return Array.from({ length: 101 }, (_, index) => {
1703
+ const amount = index / 100;
1704
+ return rgbToHex(mix$1(tint.r, ground.r, amount), mix$1(tint.g, ground.g, amount), mix$1(tint.b, ground.b, amount));
1705
+ }).find((hex) => contrastRatio(inkHex, compositeHex(hex, alpha, groundHex)) >= 4.5) ?? groundHex;
1362
1706
  }
1363
- /** Keep a candidate only when it meets ordinary-text contrast on the ground. */
1364
- function safeTokenOr(candidate, fallback, backgroundHex, palette) {
1365
- return firstSafeToken([candidate], backgroundHex, palette) ?? fallback;
1707
+ /**
1708
+ * The muted ink tokens a palette doesn't store itself, and the faded tint
1709
+ * colours of each ground whose ink is solved here, as hex.
1710
+ */
1711
+ function groundMutedInkTokens(palette) {
1712
+ return Object.fromEntries(Object.entries(MUTED_INK_TOKENS).flatMap(([ground, token]) => {
1713
+ if (palette[token]) return [];
1714
+ const ink = groundMutedInk(palette, ground);
1715
+ if (!ink) return [];
1716
+ const faded = ink.fadedTints.map(({ token: tint, hex }) => [groundTintToken(ground, tint), hex]);
1717
+ return [[token, ink.hex], ...faded.filter(([name]) => !palette[name])];
1718
+ }));
1366
1719
  }
1367
- function firstSafeToken(candidates, backgroundHex, palette, preferredEquivalentTokens = []) {
1368
- const seen = /* @__PURE__ */ new Set();
1369
- for (const candidate of candidates) {
1370
- const token = canonicalToken(candidate, palette, preferredEquivalentTokens);
1371
- if (!token || seen.has(token)) continue;
1372
- seen.add(token);
1373
- const foregroundHex = resolveConcreteColorHex(token, palette);
1374
- if (foregroundHex && contrastRatio(backgroundHex, foregroundHex) >= 4.5) return token;
1375
- }
1376
- return null;
1720
+ /**
1721
+ * The neutral step stays when it reads on the ground. Otherwise (a dark palette
1722
+ * on a mid-tone ground, or a tinted light one) it's the ground-to-text blend
1723
+ * with a 4.5:1 floor, heading for the palette's own ink on that ground.
1724
+ */
1725
+ function readableMutedText(step, base, roles) {
1726
+ const ground = base.background || base.surface;
1727
+ if (!ground || contrastRatio(step, ground) >= 4.5) return step;
1728
+ return paletteMutedInkOnSolid(ground, null, roles);
1377
1729
  }
1378
- function canonicalToken(reference, palette, preferredEquivalentTokens = []) {
1379
- const normalized = normalizedReference(reference);
1380
- if (!normalized || normalized === "transparent") return null;
1381
- const direct = parseThemeColorToken(normalized);
1382
- if (direct && resolveConcreteColorHex(direct, palette)) return direct;
1383
- const referenceHex = resolveConcreteColorHex(normalized, palette);
1384
- if (!referenceHex) return null;
1385
- const equivalent = [
1386
- ...preferredEquivalentTokens,
1387
- ...CANONICAL_EQUIVALENT_TOKEN_ORDER,
1388
- ...Object.keys(palette).sort()
1389
- ].find((token) => {
1390
- const parsed = parseThemeColorToken(token);
1391
- return parsed !== null && resolveConcreteColorHex(parsed, palette)?.toLowerCase() === referenceHex.toLowerCase();
1392
- });
1393
- return equivalent ? parseThemeColorToken(equivalent) : null;
1730
+ /**
1731
+ * Derived decoration colours never become editable palette swatches. The mark
1732
+ * blends toward literal black or white: it's a graphic endpoint for a 3:1
1733
+ * search, not text, so it stays off the palette ink rule.
1734
+ */
1735
+ function deriveSurfaceDecorationColors(ground, text, accent) {
1736
+ const ink = pickBlackOrWhiteTextColor(ground);
1737
+ return {
1738
+ line: firstContrastBlend(ground, text, ground, 1.5),
1739
+ mark: firstContrastBlend(accent, ink, ground, 3)
1740
+ };
1394
1741
  }
1395
- function paletteToken(reference) {
1396
- const parts = parseColorTokenParts(reference);
1397
- return parts.kind === "token" && parts.opacityPercent === null ? parts.token : null;
1742
+ function firstContrastBlend(from, to, ground, threshold) {
1743
+ const start = hexToRgb(from);
1744
+ const end = hexToRgb(to);
1745
+ return Array.from({ length: 101 }, (_, index) => {
1746
+ const amount = index / 100;
1747
+ return rgbToHex(mix$1(start.r, end.r, amount), mix$1(start.g, end.g, amount), mix$1(start.b, end.b, amount));
1748
+ }).find((hex) => contrastRatio(hex, ground) >= threshold) ?? to;
1398
1749
  }
1399
- function normalizedReference(value) {
1400
- if (typeof value !== "string") return null;
1401
- const normalized = value.trim();
1402
- return normalized.length > 0 ? normalized : null;
1750
+ /** `markSource` names the colour surface marks are derived from when a style marks in its brand rather than its accent. */
1751
+ function arrangementPaletteTokens(base, options) {
1752
+ if (options.arrangement !== true || !base.text) return {};
1753
+ return {
1754
+ onText: base.onText ?? paletteInkOnSolid(base.text, paletteInkRoles(base)).hex,
1755
+ ...options.marksFrom === "primary" && base.primary ? { markSource: base.primary } : {}
1756
+ };
1403
1757
  }
1404
1758
  //#endregion
1405
1759
  //#region ../theme-core/src/utils/cssValueSafety.ts
@@ -2740,13 +3094,13 @@ function resolveSolid(input, backgroundToken, preferredForeground) {
2740
3094
  function resolveSolidButtonColour(input, backgroundToken, preferredForeground) {
2741
3095
  return resolveSolid(input, backgroundToken, preferredForeground);
2742
3096
  }
2743
- /** Preserve checked on-colours (a requested label colour first); a solid state's last resort belongs to its actual fill. */
3097
+ /** Preserve checked on-colours (a requested label colour first); a solid state's last resort is the palette ink for its actual fill. */
2744
3098
  function resolveSolidInk(input, backgroundToken, backgroundHex, preferredForeground) {
2745
3099
  if (preferredForeground !== void 0) {
2746
3100
  const preferred = checkedSolidInk(input, backgroundToken, backgroundHex, preferredForeground);
2747
3101
  if (preferred) return preferred;
2748
3102
  }
2749
- return checkedSolidInk(input, backgroundToken, backgroundHex, unsafeAsOpaqueButtonColourToken(solidForegroundToken(backgroundToken))) ?? blackOrWhiteSolidInk(backgroundToken, backgroundHex);
3103
+ return checkedSolidInk(input, backgroundToken, backgroundHex, unsafeAsOpaqueButtonColourToken(solidForegroundToken(backgroundToken))) ?? paletteSolidInk(input, backgroundToken, backgroundHex);
2750
3104
  }
2751
3105
  function checkedSolidInk(input, backgroundToken, backgroundHex, foregroundToken) {
2752
3106
  const candidate = input.palette[foregroundToken];
@@ -2768,14 +3122,18 @@ function checkedSolidInk(input, backgroundToken, backgroundHex, foregroundToken)
2768
3122
  };
2769
3123
  return null;
2770
3124
  }
2771
- function blackOrWhiteSolidInk(backgroundToken, backgroundHex) {
2772
- const foregroundHex = pickBlackOrWhiteTextColor(backgroundHex);
3125
+ /** The palette's own background or text as the label where it reads (as a checked token), else literal black or white. */
3126
+ function paletteSolidInk(input, backgroundToken, backgroundHex) {
3127
+ const ink = paletteInkOnSolid(backgroundHex, paletteInkRoles(input.palette));
3128
+ const role = ink.kind === "role" ? checkedSolidInk(input, backgroundToken, backgroundHex, unsafeAsOpaqueButtonColourToken(ink.role)) : null;
3129
+ if (role) return role;
3130
+ const literal = pickBlackOrWhiteTextColor(backgroundHex);
2773
3131
  return {
2774
- foregroundHex,
3132
+ foregroundHex: literal,
2775
3133
  colour: {
2776
3134
  kind: "known-solid",
2777
3135
  backgroundCss: tokenCss(backgroundToken),
2778
- foregroundCss: foregroundHex
3136
+ foregroundCss: literal
2779
3137
  }
2780
3138
  };
2781
3139
  }
@@ -2854,7 +3212,7 @@ function interpolateHex(startHex, endHex, position) {
2854
3212
  }
2855
3213
  //#endregion
2856
3214
  //#region ../theme-core/src/buttons/buttonSurfaceContext.ts
2857
- /** The last resort, chosen by `maxContrastBlackOrWhite`. */
3215
+ /** The last resort, when neither palette role reads (`paletteInkOnSolid`). */
2858
3216
  const LITERAL_NEUTRALS = {
2859
3217
  black: {
2860
3218
  hex: "#000000",
@@ -2875,7 +3233,7 @@ function deriveButtonSurfaceContext(input, palette, fallbackToken, colourIndex)
2875
3233
  const background = deriveKnownBackground(input, palette, fallbackToken);
2876
3234
  if (background.kind === "unknown") return background;
2877
3235
  const explicitForeground = resolveKnownColour(input.kind === "solid" || input.kind === "inherit" ? input.foreground ?? "" : "", palette);
2878
- const foreground = explicitForeground && contrastRatio(background.colour.hex, explicitForeground.hex, colourIndex) >= 4.5 ? explicitForeground : LITERAL_NEUTRALS[maxContrastBlackOrWhite(solidPaint(background.colour.hex, colourIndex)).ink];
3236
+ const foreground = explicitForeground && contrastRatio(background.colour.hex, explicitForeground.hex, colourIndex) >= 4.5 ? explicitForeground : automaticForeground(background.colour.hex, palette);
2879
3237
  return {
2880
3238
  kind: "known-solid",
2881
3239
  source: background.source,
@@ -3180,6 +3538,16 @@ function boundaryForVariant(variant) {
3180
3538
  function findVariant(system, role) {
3181
3539
  return system.variants.find((variant) => variant.enabled && variant.id === role);
3182
3540
  }
3541
+ /** The surface's automatic text: the palette's own background or text where it reads, else black or white. */
3542
+ function automaticForeground(backgroundHex, palette) {
3543
+ const ink = paletteInkOnSolid(backgroundHex, paletteInkRoles(palette));
3544
+ if (ink.kind === "literal") return LITERAL_NEUTRALS[ink.hex === "#000000" ? "black" : "white"];
3545
+ return resolveKnownColour(ink.role, palette) ?? {
3546
+ hex: ink.hex,
3547
+ css: ink.hex,
3548
+ source: "literal-css"
3549
+ };
3550
+ }
3183
3551
  function resolveKnownColour(value, palette) {
3184
3552
  const reference = parseThemeColorReference(value, { palette });
3185
3553
  if (reference.kind !== "literal-css") {
@@ -3270,100 +3638,17 @@ function contextualBoundaryStyles(boundary) {
3270
3638
  };
3271
3639
  }
3272
3640
  //#endregion
3273
- //#region ../theme-core/src/palette/utils/scrimContrast.ts
3274
- const WHITE = "#ffffff";
3275
- const BLACK = "#000000";
3276
- /** `top` at `alpha` over opaque `bottom`, blended as CSS paints an overlay. */
3277
- function compositeHex(topHex, alpha, bottomHex) {
3278
- const top = hexToRgb(topHex);
3279
- const bottom = hexToRgb(bottomHex);
3280
- const mix = (a, b) => Math.round(alpha * a + (1 - alpha) * b);
3281
- return rgbToHex(mix(top.r, bottom.r), mix(top.g, bottom.g), mix(top.b, bottom.b));
3282
- }
3283
- /**
3284
- * The lowest contrast `foreground` can reach over `scrim` at `alpha` laid on
3285
- * any pixel. A foreground whose luminance falls inside the range the
3286
- * composites can take has a worst case of 1:1.
3287
- */
3288
- function worstCaseScrimContrast(input) {
3289
- const overWhite = compositeHex(input.scrimHex, input.alpha, WHITE);
3290
- const overBlack = compositeHex(input.scrimHex, input.alpha, BLACK);
3291
- const luminance = (hex) => {
3292
- const { r, g, b } = hexToRgb(hex);
3293
- return relativeLuminance(r, g, b);
3294
- };
3295
- const foreground = luminance(input.foregroundHex);
3296
- const low = luminance(overBlack);
3297
- const high = luminance(overWhite);
3298
- if (foreground >= low && foreground <= high) return 1;
3299
- return Math.min(contrastRatio(input.foregroundHex, overWhite), contrastRatio(input.foregroundHex, overBlack));
3300
- }
3301
- /**
3302
- * The smallest scrim opacity, in hundredths, at which every foreground keeps
3303
- * `threshold` contrast over any pixel. `null` when even an opaque scrim fails,
3304
- * which means the foreground was never legible on the scrim colour itself.
3305
- */
3306
- function minimumScrimOpacity(input) {
3307
- const passes = (alpha) => input.foregroundHexes.every((foregroundHex) => worstCaseScrimContrast({
3308
- foregroundHex,
3309
- scrimHex: input.scrimHex,
3310
- alpha
3311
- }) >= input.threshold);
3312
- return Array.from({ length: 101 }, (_, hundredths) => hundredths / 100).find(passes) ?? null;
3313
- }
3314
- /** Shared samples for literal RGB washes and palette-token gradient veils. */
3315
- function gradientScrimSamples(gradient, alpha, palette) {
3316
- const literal = [...gradient.matchAll(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/g)].map((stop) => ({
3317
- hex: rgbToHex(Number(stop[1]), Number(stop[2]), Number(stop[3])),
3318
- alpha: alpha * (stop[4] === void 0 ? 1 : Number(stop[4]))
3319
- }));
3320
- const tokens = [...gradient.matchAll(/var\(--tb-([\w-]+)\)/g)].flatMap((stop) => {
3321
- const hex = stop[1] ? resolveConcreteColorHex(stop[1], palette) : null;
3322
- return hex ? [{
3323
- hex,
3324
- alpha
3325
- }] : [];
3326
- });
3327
- return [...literal, ...tokens];
3328
- }
3329
- /** The ink with the stronger worst-pixel guarantee identifies the veil tone.
3330
- * No readable samples (or a tie) leaves classification to the foreground owner.
3331
- */
3332
- function scrimTone(samples) {
3333
- if (samples.length === 0) return null;
3334
- const worst = (foregroundHex) => Math.min(...samples.map((sample) => worstCaseScrimContrast({
3335
- foregroundHex,
3336
- scrimHex: sample.hex,
3337
- alpha: sample.alpha
3338
- })));
3339
- const white = worst(WHITE);
3340
- const black = worst(BLACK);
3341
- return white === black ? null : white > black ? "dark" : "light";
3342
- }
3343
- //#endregion
3344
3641
  //#region ../theme-core/src/site-styles/accessibleSurfaces.ts
3345
3642
  const ON_BACKGROUND = { kind: "on-background" };
3346
3643
  const surfaceRecipes = {
3347
3644
  base: {
3348
3645
  backgroundCandidates: ["background", "surface"],
3349
- headingCandidates: [
3350
- "text",
3351
- ON_BACKGROUND,
3352
- "neutral-950",
3353
- "neutral-50"
3354
- ],
3355
- textCandidates: [
3356
- "text",
3357
- ON_BACKGROUND,
3358
- "neutral-950",
3359
- "neutral-50"
3360
- ],
3646
+ headingCandidates: ["text", ON_BACKGROUND],
3647
+ textCandidates: ["text", ON_BACKGROUND],
3361
3648
  linkCandidates: [
3362
3649
  "primary",
3363
3650
  "text",
3364
- ON_BACKGROUND,
3365
- "neutral-950",
3366
- "neutral-50"
3651
+ ON_BACKGROUND
3367
3652
  ],
3368
3653
  supportingCandidates: ["mutedText"],
3369
3654
  inheritedBackground: true
@@ -3375,24 +3660,12 @@ const surfaceRecipes = {
3375
3660
  "surface",
3376
3661
  "background"
3377
3662
  ],
3378
- headingCandidates: [
3379
- ON_BACKGROUND,
3380
- "text",
3381
- "neutral-950",
3382
- "neutral-50"
3383
- ],
3384
- textCandidates: [
3385
- ON_BACKGROUND,
3386
- "text",
3387
- "neutral-950",
3388
- "neutral-50"
3389
- ],
3663
+ headingCandidates: [ON_BACKGROUND, "text"],
3664
+ textCandidates: [ON_BACKGROUND, "text"],
3390
3665
  linkCandidates: [
3391
3666
  "primary",
3392
3667
  ON_BACKGROUND,
3393
- "text",
3394
- "neutral-950",
3395
- "neutral-50"
3668
+ "text"
3396
3669
  ],
3397
3670
  supportingCandidates: [
3398
3671
  "mutedText",
@@ -3411,25 +3684,19 @@ const surfaceRecipes = {
3411
3684
  ON_BACKGROUND,
3412
3685
  "primaryForeground",
3413
3686
  "background",
3414
- "surface",
3415
- "neutral-50",
3416
- "neutral-950"
3687
+ "surface"
3417
3688
  ],
3418
3689
  textCandidates: [
3419
3690
  ON_BACKGROUND,
3420
3691
  "primaryForeground",
3421
3692
  "background",
3422
- "surface",
3423
- "neutral-50",
3424
- "neutral-950"
3693
+ "surface"
3425
3694
  ],
3426
3695
  linkCandidates: [
3427
3696
  ON_BACKGROUND,
3428
3697
  "primaryForeground",
3429
3698
  "background",
3430
- "surface",
3431
- "neutral-50",
3432
- "neutral-950"
3699
+ "surface"
3433
3700
  ],
3434
3701
  supportingCandidates: [
3435
3702
  ON_BACKGROUND,
@@ -3450,25 +3717,19 @@ const surfaceRecipes = {
3450
3717
  ON_BACKGROUND,
3451
3718
  "primaryForeground",
3452
3719
  "background",
3453
- "surface",
3454
- "neutral-50",
3455
- "neutral-950"
3720
+ "surface"
3456
3721
  ],
3457
3722
  textCandidates: [
3458
3723
  ON_BACKGROUND,
3459
3724
  "primaryForeground",
3460
3725
  "background",
3461
- "surface",
3462
- "neutral-50",
3463
- "neutral-950"
3726
+ "surface"
3464
3727
  ],
3465
3728
  linkCandidates: [
3466
3729
  ON_BACKGROUND,
3467
3730
  "primaryForeground",
3468
3731
  "background",
3469
- "surface",
3470
- "neutral-50",
3471
- "neutral-950"
3732
+ "surface"
3472
3733
  ],
3473
3734
  supportingCandidates: [
3474
3735
  ON_BACKGROUND,
@@ -3493,7 +3754,11 @@ function toAccessibleColorSurfaceIntent(surface) {
3493
3754
  default: return assertNeverSurface(surface);
3494
3755
  }
3495
3756
  }
3496
- /** Keep every successful legacy recipe; only exhausted candidates need neutral ink. */
3757
+ /**
3758
+ * Keep every successful recipe. When no ground has a passing ink, the first
3759
+ * ground present takes the palette's own ink there (the shared owner), which
3760
+ * always reaches ordinary-text contrast on a solid.
3761
+ */
3497
3762
  function resolveAccessibleSurfaceRecipe(input) {
3498
3763
  const result = tryAccessibleSurfaceRecipe(input);
3499
3764
  if (result.kind === "resolved-accessible-surface") return result;
@@ -3501,13 +3766,13 @@ function resolveAccessibleSurfaceRecipe(input) {
3501
3766
  const token = recipe.backgroundCandidates.find((candidate) => resolveConcreteColorHex(candidate, input.palette) !== null);
3502
3767
  const hex = token ? resolveConcreteColorHex(token, input.palette) : null;
3503
3768
  if (!token || !hex) return result;
3504
- const ink = pickBlackOrWhiteTextColor(hex);
3769
+ const ink = paletteInkOnSolid(hex, paletteInkRoles(input.palette));
3505
3770
  const foreground = (role) => ({
3506
3771
  kind: "safe-token",
3507
3772
  role,
3508
- token: asAccessibleSurfaceToken(ink),
3509
- hex: ink,
3510
- contrastRatio: contrastRatio(ink, hex)
3773
+ token: asAccessibleSurfaceToken(paletteInkToken(ink)),
3774
+ hex: ink.hex,
3775
+ contrastRatio: ink.ratio
3511
3776
  });
3512
3777
  return {
3513
3778
  kind: "resolved-accessible-surface",
@@ -3606,16 +3871,24 @@ function tryAccessibleSurfaceRecipe(input) {
3606
3871
  rejectedCandidates
3607
3872
  };
3608
3873
  }
3874
+ /**
3875
+ * The recipe's explicit candidates first; when none reads, the palette's own
3876
+ * ink on this ground at the recipe's threshold (the shared owner, which tries
3877
+ * the palette's text and background before black or white). Null only when
3878
+ * even black or white misses the threshold, so the recipe tries its next ground.
3879
+ */
3609
3880
  function resolveRequiredForeground(input) {
3610
- return resolveSafeToken({
3881
+ const explicit = resolveSafeToken(input);
3882
+ if (explicit) return explicit;
3883
+ const ink = paletteInk(solidPaint(input.backgroundHex), paletteInkRoles(input.palette), input.threshold);
3884
+ if (ink.kind === "unpaintable") return null;
3885
+ return {
3886
+ kind: "safe-token",
3611
3887
  role: input.role,
3612
- candidates: input.candidates,
3613
- backgroundToken: input.backgroundToken,
3614
- backgroundHex: input.backgroundHex,
3615
- palette: input.palette,
3616
- threshold: input.threshold,
3617
- rejectedCandidates: input.rejectedCandidates
3618
- });
3888
+ token: asAccessibleSurfaceToken(paletteInkToken(ink)),
3889
+ hex: ink.hex,
3890
+ contrastRatio: ink.ratio
3891
+ };
3619
3892
  }
3620
3893
  function resolveSupportingForeground(input) {
3621
3894
  const resolved = resolveSafeToken({
@@ -4473,4 +4746,4 @@ function mapSurfaceTreeChildren(value, map) {
4473
4746
  return isSurfaceTreeRecord(value) ? Object.fromEntries(Object.entries(value).map(([key, item]) => [key, map(item)])) : value;
4474
4747
  }
4475
4748
  //#endregion
4476
- export { surfaceInkPublication as $, DEFAULT_BUTTON_SIZES as A, ORDINARY_TEXT_MIN_CONTRAST_RATIO as At, resolveThemeColorReferenceValue as B, rgbToHex as Bt, buttonRadius as C, freezeOwnedThemeValue as Ct, materializeRuntimeButtonAppearance as D, paletteValueKey as Dt, buttonTypographyDeclarations as E, resolveOpaqueSurfaceHex as Et, defineButtonStyleRecipe as F, featuresFromHex as Ft, mergeStyles as G, backgroundColorStyle as H, mapButtonRoleAppearances as I, hexToRgb as It, textColorValue as J, rgbColorValue as K, mapButtonVisualAppearances as L, oklabToOklch as Lt, FONT_SIZE_MAP as M, preparePaletteColourIndex as Mt, generateShadowValue as N, solidPaint as Nt, paddingDeclarations as O, paletteValueKeySchema as Ot, PUBLIC_BUTTON_ROLES as P, _classPrivateFieldInitSpec as Pt, safeTokenOr as Q, isCssColorLiteral as R, oklabToSrgb as Rt, buttonBorder as S, surfaceInkValue as St, buttonStateAppearanceDeclarations as T, resolveConcreteColorHex as Tt, borderColorStyle as U, resolveTokenOrCssColorValue as V, srgbToOklab as Vt, cssVarValue as W, staysInsideDeclaration as X, callsCssLoadingFunction as Y, resolveSurfaceForeground as Z, contextualButtonSurfaceResetStyles as _, surfaceForegroundStyle as _t, requireResolvedSurface as a, HOVER_TEXT_THRESHOLD as at, BUTTON_CONTRAST_POLICY as b, surfaceInkDeclarations as bt, surfaceButtonRequest as c, inkReference as ct, toAccessibleColorSurfaceIntent as d, planForegroundHover as dt, CONTROL_EDGE_SEED_TOKEN as et, compositeHex as f, DEFAULT_SURFACE_TEXT_COLOR as ft, actionVariableFallback as g, surfaceForegroundInputFromResolved as gt, scrimTone as h, surfaceForegroundDeclarations as ht, prepareThemeSurfaceRevision as i, _classPrivateFieldSet2 as it, ELEVATION_OFFSET as j, contrastRatio as jt, BORDER_WIDTH_MAP as k, requirePaletteColorsFromEntries as kt, surfaceDecorationColors as l, expandPalette as lt, minimumScrimOpacity as m, SURFACE_INK_CSS_VARS as mt, parseSurfaceTree as n, neutralInk as nt, resolveSurface as o, certifyPaint as ot, gradientScrimSamples as p, SURFACE_FOREGROUND_CSS_VARS as pt, textColorStyle as q, prepareSurfaceIndex as r, _classPrivateFieldGet2 as rt, serializeSurfaceTree as s, contrastThresholdByPolicy as st, parseResolvedSurface as t, solveSurfaceInks as tt, surfaceTransportContext as u, getTextColorForBackground as ut, compileButtonColourStates as v, surfaceForegroundValue as vt, buttonShadow as w, ownedThemeSnapshot as wt, formatButtonColourContractError as x, surfaceInkStyle as xt, resolveSolidButtonColour as y, surfaceForegroundValueWithOpacity as yt, resolveOnColorForThemeToken as z, oklchToHexGamut as zt };
4749
+ export { resolveSurfaceForeground as $, PUBLIC_BUTTON_ROLES as A, _classPrivateFieldSet2 as At, cssVarValue as B, _classPrivateFieldInitSpec as Bt, materializeRuntimeButtonAppearance as C, resolveConcreteColorHex as Ct, ELEVATION_OFFSET as D, paletteInkRoles as Dt, DEFAULT_BUTTON_SIZES as E, paletteInk as Et, resolveOnColorForThemeToken as F, contrastRatio as Ft, callsCssLoadingFunction as G, oklchToHexGamut as Gt, rgbColorValue as H, hexToRgb as Ht, resolveThemeColorReferenceValue as I, hexLuminance as It, expandPalette as J, staysInsideDeclaration as K, rgbToHex as Kt, resolveTokenOrCssColorValue as L, luminanceInterval as Lt, mapButtonRoleAppearances as M, paletteValueKeySchema as Mt, mapButtonVisualAppearances as N, requirePaletteColorsFromEntries as Nt, FONT_SIZE_MAP as O, paletteInkToken as Ot, isCssColorLiteral as P, ORDINARY_TEXT_MIN_CONTRAST_RATIO as Pt, scrimTone as Q, backgroundColorStyle as R, preparePaletteColourIndex as Rt, buttonTypographyDeclarations as S, ownedThemeSnapshot as St, BORDER_WIDTH_MAP as T, neutralInk as Tt, textColorStyle as U, oklabToOklch as Ut, mergeStyles as V, featuresFromHex as Vt, textColorValue as W, oklabToSrgb as Wt, gradientScrimSamples as X, compositeHex as Y, minimumScrimOpacity as Z, formatButtonColourContractError as _, surfaceForegroundValueWithOpacity as _t, requireResolvedSurface as a, HOVER_TEXT_THRESHOLD as at, buttonShadow as b, surfaceInkValue as bt, surfaceButtonRequest as c, inkReference as ct, toAccessibleColorSurfaceIntent as d, SURFACE_FOREGROUND_CSS_VARS as dt, safeTokenOr as et, actionVariableFallback as f, SURFACE_INK_CSS_VARS as ft, BUTTON_CONTRAST_POLICY as g, surfaceForegroundValue as gt, resolveSolidButtonColour as h, surfaceForegroundStyle as ht, prepareThemeSurfaceRevision as i, pickBlackOrWhiteTextColor as it, defineButtonStyleRecipe as j, paletteValueKey as jt, generateShadowValue as k, _classPrivateFieldGet2 as kt, surfaceDecorationColors as l, planForegroundHover as lt, compileButtonColourStates as m, surfaceForegroundInputFromResolved as mt, parseSurfaceTree as n, CONTROL_EDGE_SEED_TOKEN as nt, resolveSurface as o, certifyPaint as ot, contextualButtonSurfaceResetStyles as p, surfaceForegroundDeclarations as pt, SURFACE_SECONDARY_TEXT_TINT_ALPHA as q, srgbToOklab as qt, prepareSurfaceIndex as r, solveSurfaceInks as rt, serializeSurfaceTree as s, contrastThresholdByPolicy as st, parseResolvedSurface as t, surfaceInkPublication as tt, surfaceTransportContext as u, DEFAULT_SURFACE_TEXT_COLOR as ut, buttonBorder as v, surfaceInkDeclarations as vt, paddingDeclarations as w, resolveOpaqueSurfaceHex as wt, buttonStateAppearanceDeclarations as x, freezeOwnedThemeValue as xt, buttonRadius as y, surfaceInkStyle as yt, borderColorStyle as z, solidPaint as zt };