@globalpayments/vega 2.87.0 → 2.88.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 (589) hide show
  1. package/dist/cjs/action-color-accessibility-validator-15fa91e4.js +1817 -0
  2. package/dist/cjs/{app-globals-885090b1.js → app-globals-6fbbcb2f.js} +16 -7
  3. package/dist/cjs/{child-nodes-event-prevent-slimmer-b7498e5a.js → child-nodes-event-prevent-slimmer-01930b4e.js} +1 -1
  4. package/dist/cjs/{code-block-15411c14.js → code-block-00fee034.js} +31 -13
  5. package/dist/cjs/{component-value-history-controller-slimmer.abstract-5218e4b3.js → component-value-history-controller-slimmer.abstract-066645b3.js} +25 -5
  6. package/dist/cjs/{content-state-a69d99b4.js → content-state-d4f54659.js} +66 -54
  7. package/dist/cjs/{dark-mode-style-controller-bd765afb.js → dark-mode-style-controller-ed481250.js} +41 -2
  8. package/dist/cjs/{date-required-rule-d65727c5.js → date-required-rule-4cea8fc8.js} +1 -1
  9. package/dist/cjs/{design-token-3bc36220.js → design-token-ad9f413c.js} +3 -3
  10. package/dist/cjs/{element-appender-slimmer-f86e6811.js → element-appender-slimmer-d04aa177.js} +2 -2
  11. package/dist/cjs/{event-emit-slimmer-73c42d7e.js → event-emit-slimmer-5fd6e54a.js} +1 -1
  12. package/dist/cjs/{form-field-controller-slimmer-44091874.js → form-field-controller-slimmer-23d112bd.js} +1 -1
  13. package/dist/cjs/{image-annotation-action-aad07357.js → image-annotation-action-bcf2a1b4.js} +4 -4
  14. package/dist/cjs/index-58ea899e.js +4 -0
  15. package/dist/cjs/index.cjs.js +27 -17
  16. package/dist/cjs/{inject-keyboard-manager-d06b337e.js → inject-keyboard-manager-acaf1530.js} +1 -1
  17. package/dist/cjs/{internal-translation-controller-f0da24b2.js → internal-translation-controller-a1250419.js} +8 -0
  18. package/dist/cjs/{internal-vega-event-manager-063c17cb.js → internal-vega-event-manager-c515cf5e.js} +2 -2
  19. package/dist/cjs/{keyboard-manager-1e045791.js → keyboard-manager-6821709a.js} +1 -1
  20. package/dist/cjs/{keyboard-manager-slimmer-861d991f.js → keyboard-manager-slimmer-74528545.js} +1 -1
  21. package/dist/cjs/loader.cjs.js +13 -12
  22. package/dist/cjs/{month-view-generator-8ed9818e.js → month-view-generator-61578283.js} +1 -1
  23. package/dist/cjs/{public-rules-c7726702.js → public-rules-d2fbbbf5.js} +8 -8
  24. package/dist/cjs/{range-d6fb50a4.js → range-e797475c.js} +1 -1
  25. package/dist/cjs/replace-selected-text-action-a098523f.js +20 -0
  26. package/dist/cjs/{responsive-format-facade-9647775d.js → responsive-format-facade-bf330592.js} +1 -1
  27. package/dist/cjs/{rich-text-editor-required-rule-a1a070ce.js → rich-text-editor-required-rule-ba9d42fa.js} +1 -1
  28. package/dist/cjs/{split-cell-operation-39b19943.js → split-cell-operation-91ee6894.js} +79 -16
  29. package/dist/cjs/{state-border-formatter-1a483a9b.js → state-border-formatter-fd194e53.js} +1 -1
  30. package/dist/cjs/{string-format-strategy.abstract-2aec209d.js → string-format-strategy.abstract-af9fc35e.js} +1 -1
  31. package/dist/cjs/{string-input-formatter-slimmer-e061bd10.js → string-input-formatter-slimmer-a3fb1292.js} +1 -1
  32. package/dist/cjs/{string-mask-strategy-4bc07c00.js → string-mask-strategy-2054f3fb.js} +2 -2
  33. package/dist/cjs/{style-formatter-263d5eb6.js → style-formatter-7d60fb70.js} +2 -2
  34. package/dist/cjs/{time-required-rule-f9a7e897.js → time-required-rule-ba450bbd.js} +1 -1
  35. package/dist/cjs/{token-extension-927062b9.js → token-extension-8b69f7e1.js} +1136 -26
  36. package/dist/cjs/{translation-slimmer-a4a7f0eb.js → translation-slimmer-aee3fb1c.js} +1 -1
  37. package/dist/cjs/{type-guard-c1195e50.js → type-guard-424efe26.js} +1 -1
  38. package/dist/cjs/{valid-credit-card-number-rule-22f3e6cf.js → valid-credit-card-number-rule-6bd5834c.js} +1 -1
  39. package/dist/cjs/vega-accordion.cjs.entry.js +22 -15
  40. package/dist/cjs/vega-app-footer.cjs.entry.js +1 -1
  41. package/dist/cjs/vega-app-header-button.cjs.entry.js +9 -9
  42. package/dist/cjs/vega-banner.cjs.entry.js +3 -3
  43. package/dist/cjs/vega-box.cjs.entry.js +6 -6
  44. package/dist/cjs/vega-brand-logo.cjs.entry.js +1 -1
  45. package/dist/cjs/vega-breadcrumb.cjs.entry.js +4 -4
  46. package/dist/cjs/vega-button-circle.cjs.entry.js +9 -9
  47. package/dist/cjs/vega-button-group_2.cjs.entry.js +4 -4
  48. package/dist/cjs/vega-button-link.cjs.entry.js +4 -4
  49. package/dist/cjs/vega-button.cjs.entry.js +7 -7
  50. package/dist/cjs/vega-calendar_4.cjs.entry.js +10 -10
  51. package/dist/cjs/vega-card.cjs.entry.js +5 -5
  52. package/dist/cjs/vega-carousel.cjs.entry.js +6 -6
  53. package/dist/cjs/vega-checkbox_2.cjs.entry.js +6 -6
  54. package/dist/cjs/vega-chip.cjs.entry.js +9 -9
  55. package/dist/cjs/vega-code-block.cjs.entry.js +16 -15
  56. package/dist/cjs/vega-color-picker.cjs.entry.js +5 -5
  57. package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +7 -7
  58. package/dist/cjs/vega-color-swatch.cjs.entry.js +5 -5
  59. package/dist/cjs/vega-combo-box.cjs.entry.js +23 -10
  60. package/dist/cjs/vega-date-picker_2.cjs.entry.js +327 -267
  61. package/dist/cjs/vega-dialog_2.cjs.entry.js +7 -7
  62. package/dist/cjs/vega-divider.cjs.entry.js +5 -5
  63. package/dist/cjs/vega-dropdown_5.cjs.entry.js +11 -11
  64. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  65. package/dist/cjs/{vega-event-id-f95480b7.js → vega-event-id-39dedd17.js} +2 -0
  66. package/dist/cjs/vega-field-label.cjs.entry.js +22 -5
  67. package/dist/cjs/vega-file-uploader.cjs.entry.js +20 -7
  68. package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -5
  69. package/dist/cjs/vega-flex.cjs.entry.js +6 -6
  70. package/dist/cjs/vega-font.cjs.entry.js +5 -5
  71. package/dist/cjs/vega-form.cjs.entry.js +7 -7
  72. package/dist/cjs/vega-grid.cjs.entry.js +5 -5
  73. package/dist/cjs/vega-icon.cjs.entry.js +5 -5
  74. package/dist/cjs/vega-image-uploader.cjs.entry.js +10 -10
  75. package/dist/cjs/vega-input-credit-card.cjs.entry.js +10 -10
  76. package/dist/cjs/vega-input-numeric.cjs.entry.js +9 -9
  77. package/dist/cjs/vega-input-passcode.cjs.entry.js +23 -10
  78. package/dist/cjs/vega-input-phone-number.cjs.entry.js +22 -9
  79. package/dist/cjs/vega-input-range.cjs.entry.js +7 -7
  80. package/dist/cjs/vega-input-select.cjs.entry.js +9 -9
  81. package/dist/cjs/vega-input.cjs.entry.js +23 -10
  82. package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
  83. package/dist/cjs/vega-left-nav_5.cjs.entry.js +11 -11
  84. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
  85. package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
  86. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +3 -3
  87. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +3 -3
  88. package/dist/cjs/vega-pagination.cjs.entry.js +8 -8
  89. package/dist/cjs/vega-popover_2.cjs.entry.js +11 -11
  90. package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +6 -6
  91. package/dist/cjs/vega-radio_2.cjs.entry.js +9 -9
  92. package/dist/cjs/vega-rich-text-content.cjs.entry.js +7 -7
  93. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +289 -193
  94. package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +400 -0
  95. package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +12 -12
  96. package/dist/cjs/vega-section-title.cjs.entry.js +3 -2
  97. package/dist/cjs/vega-segment-control.cjs.entry.js +3 -3
  98. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +8 -8
  99. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +6 -6
  100. package/dist/cjs/vega-sidenav_3.cjs.entry.js +6 -6
  101. package/dist/cjs/vega-signature-capture.cjs.entry.js +10 -10
  102. package/dist/cjs/vega-stepper.cjs.entry.js +6 -6
  103. package/dist/cjs/vega-tab-group_2.cjs.entry.js +4 -4
  104. package/dist/cjs/vega-table_11.cjs.entry.js +8 -8
  105. package/dist/cjs/vega-textarea.cjs.entry.js +17 -7
  106. package/dist/cjs/vega-time-picker_2.cjs.entry.js +13 -13
  107. package/dist/cjs/vega-toggle-switch.cjs.entry.js +5 -5
  108. package/dist/cjs/vega-tooltip_2.cjs.entry.js +6 -6
  109. package/dist/cjs/vega.cjs.js +13 -12
  110. package/dist/collection/collection-manifest.json +6 -0
  111. package/dist/collection/components/vega-accordion/slimmers/vega-accordion-renderer.js +12 -5
  112. package/dist/collection/components/vega-accordion/vega-accordion.css +23 -0
  113. package/dist/collection/components/vega-accordion/vega-accordion.js +28 -0
  114. package/dist/collection/components/vega-box/vega-box.js +3 -3
  115. package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-copy-button-renderer.js +2 -2
  116. package/dist/collection/components/vega-code-block/vega-code-block.js +4 -0
  117. package/dist/collection/components/vega-combo-box/slimmers/renderers/vega-combo-box-renderer.js +4 -1
  118. package/dist/collection/components/vega-combo-box/vega-combo-box.js +34 -0
  119. package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-size-controller.js +46 -0
  120. package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-header-render.js +8 -4
  121. package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-year-month-switcher-renderer.js +3 -3
  122. package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.js +0 -3
  123. package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.js +67 -6
  124. package/dist/collection/components/vega-field-label/vega-field-label.css +37 -0
  125. package/dist/collection/components/vega-field-label/vega-field-label.js +40 -0
  126. package/dist/collection/components/vega-file-uploader/slimmers/renderers/vega-file-uploader-renderer.js +4 -1
  127. package/dist/collection/components/vega-file-uploader/vega-file-uploader.js +34 -0
  128. package/dist/collection/components/vega-input/slimmers/renderers/vega-input-renderer.js +4 -1
  129. package/dist/collection/components/vega-input/vega-input.js +34 -0
  130. package/dist/collection/components/vega-input-passcode/slimmers/renderers/vega-input-passcode-renderer.js +4 -1
  131. package/dist/collection/components/vega-input-passcode/vega-input-passcode.js +34 -0
  132. package/dist/collection/components/vega-input-phone-number/slimmers/renderers/vega-input-phone-number-renderer.js +4 -1
  133. package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +34 -0
  134. package/dist/collection/components/vega-rich-text-editor/assets/redo.js +3 -0
  135. package/dist/collection/components/vega-rich-text-editor/assets/undo.js +3 -0
  136. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.js +1 -1
  137. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.js +1 -1
  138. package/dist/collection/components/vega-rich-text-editor/dto/annotations/annotation-style.js +2 -2
  139. package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +5 -0
  140. package/dist/collection/components/vega-rich-text-editor/dto/blocks/code-block.js +2 -0
  141. package/dist/collection/components/vega-rich-text-editor/dto/blocks/html-block.js +2 -0
  142. package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +2 -0
  143. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +2 -0
  144. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +2 -0
  145. package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +2 -0
  146. package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +3 -0
  147. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/code-block/code-block-filter-styles-strategy.js +1 -1
  148. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/filter-styles-strategy-registry.js +1 -1
  149. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-block-filter-styles-strategy.js +1 -1
  150. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-heading-item-block-filter-styles-strategy.js +1 -1
  151. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-item-block-filter-styles-strategy.js +1 -1
  152. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-title-item-block-filter-styles-strategy.js +1 -1
  153. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/predicate.js +4 -4
  154. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-block/paragraph-filter-styles-strategy.js +1 -2
  155. package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/title-heading-node-filter-styles-strategy.js +1 -1
  156. package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +2 -0
  157. package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +2 -0
  158. package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +5 -0
  159. package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +2 -0
  160. package/dist/collection/components/vega-rich-text-editor/dto/setup.js +29 -29
  161. package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +105 -1
  162. package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +50 -1
  163. package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/function-block.js +2 -0
  164. package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/logic-control-block.js +2 -0
  165. package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.js +2 -0
  166. package/dist/collection/components/vega-rich-text-editor/extensions/functions/function-extension.js +4 -2
  167. package/dist/collection/components/vega-rich-text-editor/extensions/line-height/action-handler-strategies/block-update-line-height-strategy.js +18 -0
  168. package/dist/collection/components/vega-rich-text-editor/extensions/line-height/actions/line-height-annotation-action.js +20 -0
  169. package/dist/collection/components/vega-rich-text-editor/extensions/line-height/annotations/line-height-annotation.js +61 -0
  170. package/dist/collection/components/vega-rich-text-editor/extensions/line-height/assets/line-height.js +3 -0
  171. package/dist/collection/components/vega-rich-text-editor/extensions/line-height/constants.js +11 -0
  172. package/dist/collection/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-annotation-handler.js +41 -0
  173. package/dist/collection/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-filter-styles-strategy.js +41 -0
  174. package/dist/collection/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-from-json-handler.js +65 -0
  175. package/dist/collection/components/vega-rich-text-editor/extensions/line-height/line-height-extension.js +44 -0
  176. package/dist/collection/components/vega-rich-text-editor/extensions/line-height/line-height-toolbar-button-renderer.js +131 -0
  177. package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/arrow-characters.js +24 -0
  178. package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/currency-characters.js +38 -0
  179. package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/default-categories.js +37 -0
  180. package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/latin-characters.js +130 -0
  181. package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/mathematical-characters.js +46 -0
  182. package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/text-characters.js +29 -0
  183. package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/special-characters-extension.js +34 -0
  184. package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/special-characters-icon.js +3 -0
  185. package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/special-characters-toolbar-button-renderer.js +184 -0
  186. package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/types.js +1 -0
  187. package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/constants.js +11 -0
  188. package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/slimmers/controllers/special-characters-panel-keyboard-controller.js +85 -0
  189. package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/slimmers/renderers/special-characters-panel-renderer.js +210 -0
  190. package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/vega-rich-text-special-characters-panel.css +66 -0
  191. package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/vega-rich-text-special-characters-panel.js +174 -0
  192. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler.js +1 -1
  193. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-cell-annotation-handler.js +1 -1
  194. package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-head-cell-annotation-handler.js +1 -1
  195. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-block.js +2 -0
  196. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-body-block.js +2 -0
  197. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.js +2 -0
  198. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.js +2 -0
  199. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-block.js +2 -0
  200. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.js +2 -0
  201. package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-row-block.js +2 -0
  202. package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-block/table-block-filter-styles-strategy.js +1 -1
  203. package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-caption/table-caption-filter-styles-strategy.js +1 -1
  204. package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-cell/table-cell-filter-styles-strategy.js +1 -1
  205. package/dist/collection/components/vega-rich-text-editor/extensions/table/table-extension.js +4 -4
  206. package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-extension.js +5 -2
  207. package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node.js +2 -0
  208. package/dist/collection/components/vega-rich-text-editor/extensions/type.js +1 -0
  209. package/dist/collection/components/vega-rich-text-editor/helpers/extension-context-manager.js +8 -2
  210. package/dist/collection/components/vega-rich-text-editor/public-api.js +4 -0
  211. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/bold-annotaion-handler.js +1 -1
  212. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/code-annotation-handler.js +1 -1
  213. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/color-annotation-handler.js +1 -1
  214. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.js +3 -3
  215. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/image-alt-annotation-handler.js +1 -1
  216. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/image-size-annotation-handler.js +1 -1
  217. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/indent-annotation-handler.js +1 -1
  218. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/inline-html-annotation-handler.js +1 -1
  219. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/italic-annotation-handler.js +1 -1
  220. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/link-annotation-handler.js +1 -1
  221. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/strike-through-annotation-handler.js +1 -1
  222. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/text-align-annotation-handler.js +1 -1
  223. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/text-style-annotation-handler.js +1 -1
  224. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/underline-annotation-handler.js +1 -1
  225. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/history-controller.js +1 -0
  226. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/state-entity-rendering-registry.js +1 -1
  227. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +14 -0
  228. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/redo-toolbar-button-slimmer.js +36 -0
  229. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/undo-toolbar-button-slimmer.js +36 -0
  230. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.js +4 -1
  231. package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +44 -0
  232. package/dist/collection/components/vega-section-title/slimmers/renderers/vega-section-title-renderer.js +1 -1
  233. package/dist/collection/components/vega-section-title/vega-section-title.js +2 -1
  234. package/dist/collection/components/vega-textarea/vega-textarea.js +35 -1
  235. package/dist/collection/constants/runtime-metrics-payload-definition/public-api/ThemeManager/runtime-metrics-payload-definition.js +30 -10
  236. package/dist/collection/constants/ui.js +1 -0
  237. package/dist/collection/global/scripts/before-vega-load.js +13 -0
  238. package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +2 -2
  239. package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +1 -0
  240. package/dist/collection/helpers/slimmers/component-value-history-controller-slimmer.abstract.js +22 -2
  241. package/dist/collection/helpers/theme/controllers/action-color-accessibility-validator.js +34 -0
  242. package/dist/collection/helpers/theme/internal-theme-manager.js +39 -2
  243. package/dist/collection/helpers/theme/theme-manager.js +33 -2
  244. package/dist/collection/helpers/translation/locales/en.js +8 -0
  245. package/dist/esm/action-color-accessibility-validator-3d8efb64.js +1815 -0
  246. package/dist/esm/{app-globals-be458779.js → app-globals-98c3d676.js} +16 -7
  247. package/dist/esm/{child-nodes-event-prevent-slimmer-0a406a71.js → child-nodes-event-prevent-slimmer-2f823df2.js} +1 -1
  248. package/dist/esm/{code-block-ff52d912.js → code-block-6261a99d.js} +32 -14
  249. package/dist/esm/{component-value-history-controller-slimmer.abstract-ad5f29cd.js → component-value-history-controller-slimmer.abstract-07488472.js} +25 -5
  250. package/dist/esm/{content-state-6fccd284.js → content-state-9bf85e00.js} +66 -54
  251. package/dist/esm/{dark-mode-style-controller-e9a6b097.js → dark-mode-style-controller-fcda24ec.js} +40 -3
  252. package/dist/esm/{date-required-rule-70324452.js → date-required-rule-281aab50.js} +1 -1
  253. package/dist/esm/{design-token-0e6fb2c4.js → design-token-b7ce7ed4.js} +3 -3
  254. package/dist/esm/{element-appender-slimmer-afe5a638.js → element-appender-slimmer-3926470f.js} +2 -2
  255. package/dist/esm/{event-emit-slimmer-697ad0b7.js → event-emit-slimmer-0990037c.js} +1 -1
  256. package/dist/esm/{form-field-controller-slimmer-9e70a18d.js → form-field-controller-slimmer-24aca6c4.js} +1 -1
  257. package/dist/esm/{image-annotation-action-245eaa54.js → image-annotation-action-dadda36f.js} +4 -4
  258. package/dist/esm/index-090d31ca.js +4 -0
  259. package/dist/esm/index.js +18 -17
  260. package/dist/esm/{inject-keyboard-manager-05d5db90.js → inject-keyboard-manager-6317d1b3.js} +1 -1
  261. package/dist/esm/{internal-translation-controller-d8217d93.js → internal-translation-controller-0b9589d0.js} +8 -0
  262. package/dist/esm/{internal-vega-event-manager-1ac5ee9a.js → internal-vega-event-manager-dc4c3a37.js} +2 -2
  263. package/dist/esm/{keyboard-manager-26e2fc32.js → keyboard-manager-69761aa6.js} +1 -1
  264. package/dist/esm/{keyboard-manager-slimmer-012a9a9b.js → keyboard-manager-slimmer-c2d038f0.js} +1 -1
  265. package/dist/esm/loader.js +13 -12
  266. package/dist/esm/{month-view-generator-918f1f88.js → month-view-generator-4c1ee949.js} +1 -1
  267. package/dist/esm/{public-rules-22320bdf.js → public-rules-da28b413.js} +8 -8
  268. package/dist/esm/{range-76f8e7dd.js → range-342cbce9.js} +1 -1
  269. package/dist/esm/replace-selected-text-action-a45bee4b.js +18 -0
  270. package/dist/esm/{responsive-format-facade-2a1d6398.js → responsive-format-facade-3ca1422d.js} +1 -1
  271. package/dist/esm/{rich-text-editor-required-rule-6eb90840.js → rich-text-editor-required-rule-46d0bc5b.js} +1 -1
  272. package/dist/esm/{split-cell-operation-7652e813.js → split-cell-operation-1d114aa3.js} +79 -16
  273. package/dist/esm/{state-border-formatter-a243f3fc.js → state-border-formatter-3ebc76a4.js} +1 -1
  274. package/dist/esm/{string-format-strategy.abstract-f6625ed7.js → string-format-strategy.abstract-95d691e1.js} +1 -1
  275. package/dist/esm/{string-input-formatter-slimmer-e801bd7e.js → string-input-formatter-slimmer-e18d202c.js} +1 -1
  276. package/dist/esm/{string-mask-strategy-53cb9b33.js → string-mask-strategy-43d846ac.js} +2 -2
  277. package/dist/esm/{style-formatter-a622a045.js → style-formatter-197e2fd3.js} +2 -2
  278. package/dist/esm/{time-required-rule-2fd8df50.js → time-required-rule-78d8ecf1.js} +1 -1
  279. package/dist/esm/{token-extension-5838c71b.js → token-extension-30011dc4.js} +1128 -27
  280. package/dist/esm/{translation-slimmer-32353a1c.js → translation-slimmer-49903fc8.js} +1 -1
  281. package/dist/esm/{type-guard-ed1004cc.js → type-guard-b18807dc.js} +1 -1
  282. package/dist/esm/{valid-credit-card-number-rule-7c9d6808.js → valid-credit-card-number-rule-fe1c8a9c.js} +1 -1
  283. package/dist/esm/vega-accordion.entry.js +22 -15
  284. package/dist/esm/vega-app-footer.entry.js +1 -1
  285. package/dist/esm/vega-app-header-button.entry.js +9 -9
  286. package/dist/esm/vega-banner.entry.js +3 -3
  287. package/dist/esm/vega-box.entry.js +6 -6
  288. package/dist/esm/vega-brand-logo.entry.js +1 -1
  289. package/dist/esm/vega-breadcrumb.entry.js +4 -4
  290. package/dist/esm/vega-button-circle.entry.js +9 -9
  291. package/dist/esm/vega-button-group_2.entry.js +4 -4
  292. package/dist/esm/vega-button-link.entry.js +4 -4
  293. package/dist/esm/vega-button.entry.js +7 -7
  294. package/dist/esm/vega-calendar_4.entry.js +10 -10
  295. package/dist/esm/vega-card.entry.js +5 -5
  296. package/dist/esm/vega-carousel.entry.js +6 -6
  297. package/dist/esm/vega-checkbox_2.entry.js +6 -6
  298. package/dist/esm/vega-chip.entry.js +9 -9
  299. package/dist/esm/vega-code-block.entry.js +16 -15
  300. package/dist/esm/vega-color-picker.entry.js +5 -5
  301. package/dist/esm/vega-color-swatch-picker.entry.js +7 -7
  302. package/dist/esm/vega-color-swatch.entry.js +5 -5
  303. package/dist/esm/vega-combo-box.entry.js +23 -10
  304. package/dist/esm/vega-date-picker_2.entry.js +327 -267
  305. package/dist/esm/vega-dialog_2.entry.js +7 -7
  306. package/dist/esm/vega-divider.entry.js +5 -5
  307. package/dist/esm/vega-dropdown_5.entry.js +11 -11
  308. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  309. package/dist/esm/{vega-event-id-578c6c6d.js → vega-event-id-20494454.js} +2 -1
  310. package/dist/esm/vega-field-label.entry.js +22 -5
  311. package/dist/esm/vega-file-uploader.entry.js +20 -7
  312. package/dist/esm/vega-flag-icon.entry.js +5 -5
  313. package/dist/esm/vega-flex.entry.js +6 -6
  314. package/dist/esm/vega-font.entry.js +5 -5
  315. package/dist/esm/vega-form.entry.js +7 -7
  316. package/dist/esm/vega-grid.entry.js +5 -5
  317. package/dist/esm/vega-icon.entry.js +5 -5
  318. package/dist/esm/vega-image-uploader.entry.js +10 -10
  319. package/dist/esm/vega-input-credit-card.entry.js +10 -10
  320. package/dist/esm/vega-input-numeric.entry.js +9 -9
  321. package/dist/esm/vega-input-passcode.entry.js +23 -10
  322. package/dist/esm/vega-input-phone-number.entry.js +22 -9
  323. package/dist/esm/vega-input-range.entry.js +7 -7
  324. package/dist/esm/vega-input-select.entry.js +9 -9
  325. package/dist/esm/vega-input.entry.js +23 -10
  326. package/dist/esm/vega-item-toggle.entry.js +3 -3
  327. package/dist/esm/vega-left-nav_5.entry.js +11 -11
  328. package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
  329. package/dist/esm/vega-page-notification_2.entry.js +1 -1
  330. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +3 -3
  331. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +3 -3
  332. package/dist/esm/vega-pagination.entry.js +8 -8
  333. package/dist/esm/vega-popover_2.entry.js +11 -11
  334. package/dist/esm/vega-progress-tracker_2.entry.js +6 -6
  335. package/dist/esm/vega-radio_2.entry.js +9 -9
  336. package/dist/esm/vega-rich-text-content.entry.js +7 -7
  337. package/dist/esm/vega-rich-text-editor_4.entry.js +285 -189
  338. package/dist/esm/vega-rich-text-special-characters-panel.entry.js +396 -0
  339. package/dist/esm/vega-rich-text-table-properties_3.entry.js +12 -12
  340. package/dist/esm/vega-section-title.entry.js +3 -2
  341. package/dist/esm/vega-segment-control.entry.js +3 -3
  342. package/dist/esm/vega-selection-chip_2.entry.js +8 -8
  343. package/dist/esm/vega-selection-tile_2.entry.js +6 -6
  344. package/dist/esm/vega-sidenav_3.entry.js +6 -6
  345. package/dist/esm/vega-signature-capture.entry.js +10 -10
  346. package/dist/esm/vega-stepper.entry.js +6 -6
  347. package/dist/esm/vega-tab-group_2.entry.js +4 -4
  348. package/dist/esm/vega-table_11.entry.js +8 -8
  349. package/dist/esm/vega-textarea.entry.js +17 -7
  350. package/dist/esm/vega-time-picker_2.entry.js +13 -13
  351. package/dist/esm/vega-toggle-switch.entry.js +5 -5
  352. package/dist/esm/vega-tooltip_2.entry.js +6 -6
  353. package/dist/esm/vega.js +13 -12
  354. package/dist/sri/vega-sri-manifest.json +363 -351
  355. package/dist/types/components/vega-accordion/slimmers/vega-accordion-renderer.d.ts +1 -0
  356. package/dist/types/components/vega-accordion/vega-accordion.d.ts +14 -0
  357. package/dist/types/components/vega-code-block/vega-code-block.d.ts +1 -0
  358. package/dist/types/components/vega-combo-box/slimmers/renderers/vega-combo-box-renderer.d.ts +1 -0
  359. package/dist/types/components/vega-combo-box/vega-combo-box.d.ts +10 -0
  360. package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-size-controller.d.ts +20 -0
  361. package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-header-render.d.ts +2 -1
  362. package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-year-month-switcher-renderer.d.ts +1 -1
  363. package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.d.ts +0 -1
  364. package/dist/types/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.d.ts +22 -2
  365. package/dist/types/components/vega-field-label/vega-field-label.d.ts +12 -0
  366. package/dist/types/components/vega-file-uploader/slimmers/renderers/vega-file-uploader-renderer.d.ts +1 -0
  367. package/dist/types/components/vega-file-uploader/vega-file-uploader.d.ts +10 -0
  368. package/dist/types/components/vega-input/slimmers/renderers/vega-input-renderer.d.ts +1 -0
  369. package/dist/types/components/vega-input/vega-input.d.ts +10 -0
  370. package/dist/types/components/vega-input-passcode/slimmers/renderers/vega-input-passcode-renderer.d.ts +1 -0
  371. package/dist/types/components/vega-input-passcode/vega-input-passcode.d.ts +10 -0
  372. package/dist/types/components/vega-input-phone-number/slimmers/renderers/vega-input-phone-number-renderer.d.ts +1 -0
  373. package/dist/types/components/vega-input-phone-number/vega-input-phone-number.d.ts +10 -0
  374. package/dist/types/components/vega-rich-text-editor/assets/redo.d.ts +3 -0
  375. package/dist/types/components/vega-rich-text-editor/assets/undo.d.ts +3 -0
  376. package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation-style.d.ts +1 -1
  377. package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +5 -0
  378. package/dist/types/components/vega-rich-text-editor/dto/blocks/code-block.d.ts +2 -0
  379. package/dist/types/components/vega-rich-text-editor/dto/blocks/html-block.d.ts +2 -0
  380. package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +2 -0
  381. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +2 -0
  382. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +2 -0
  383. package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +2 -0
  384. package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +3 -0
  385. package/dist/types/components/vega-rich-text-editor/dto/nodes/code-block-node.d.ts +2 -0
  386. package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +2 -0
  387. package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +5 -0
  388. package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +2 -0
  389. package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +31 -0
  390. package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +19 -0
  391. package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/function-block.d.ts +2 -0
  392. package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/logic-control-block.d.ts +2 -0
  393. package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.d.ts +2 -0
  394. package/dist/types/components/vega-rich-text-editor/extensions/functions/function-extension.d.ts +2 -1
  395. package/dist/types/components/vega-rich-text-editor/extensions/line-height/action-handler-strategies/block-update-line-height-strategy.d.ts +18 -0
  396. package/dist/types/components/vega-rich-text-editor/extensions/line-height/actions/line-height-annotation-action.d.ts +16 -0
  397. package/dist/types/components/vega-rich-text-editor/extensions/line-height/annotations/line-height-annotation.d.ts +46 -0
  398. package/dist/types/components/vega-rich-text-editor/extensions/line-height/assets/line-height.d.ts +3 -0
  399. package/dist/types/components/vega-rich-text-editor/extensions/line-height/constants.d.ts +6 -0
  400. package/dist/types/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-annotation-handler.d.ts +23 -0
  401. package/dist/types/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-filter-styles-strategy.d.ts +26 -0
  402. package/dist/types/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-from-json-handler.d.ts +17 -0
  403. package/dist/types/components/vega-rich-text-editor/extensions/line-height/line-height-extension.d.ts +19 -0
  404. package/dist/types/components/vega-rich-text-editor/extensions/line-height/line-height-toolbar-button-renderer.d.ts +44 -0
  405. package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/arrow-characters.d.ts +2 -0
  406. package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/currency-characters.d.ts +2 -0
  407. package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/default-categories.d.ts +7 -0
  408. package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/latin-characters.d.ts +2 -0
  409. package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/mathematical-characters.d.ts +2 -0
  410. package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/text-characters.d.ts +2 -0
  411. package/dist/types/components/vega-rich-text-editor/extensions/special-characters/special-characters-extension.d.ts +20 -0
  412. package/dist/types/components/vega-rich-text-editor/extensions/special-characters/special-characters-icon.d.ts +3 -0
  413. package/dist/types/components/vega-rich-text-editor/extensions/special-characters/special-characters-toolbar-button-renderer.d.ts +83 -0
  414. package/dist/types/components/vega-rich-text-editor/extensions/special-characters/types.d.ts +20 -0
  415. package/dist/types/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/constants.d.ts +11 -0
  416. package/dist/types/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/slimmers/controllers/special-characters-panel-keyboard-controller.d.ts +18 -0
  417. package/dist/types/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/slimmers/renderers/special-characters-panel-renderer.d.ts +66 -0
  418. package/dist/types/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/vega-rich-text-special-characters-panel.d.ts +58 -0
  419. package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-block.d.ts +2 -0
  420. package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-body-block.d.ts +2 -0
  421. package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.d.ts +2 -0
  422. package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.d.ts +2 -0
  423. package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-block.d.ts +2 -0
  424. package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.d.ts +2 -0
  425. package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-row-block.d.ts +2 -0
  426. package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-extension.d.ts +3 -1
  427. package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node.d.ts +2 -0
  428. package/dist/types/components/vega-rich-text-editor/extensions/type.d.ts +14 -0
  429. package/dist/types/components/vega-rich-text-editor/helpers/extension-context-manager.d.ts +1 -1
  430. package/dist/types/components/vega-rich-text-editor/interface.d.ts +8 -0
  431. package/dist/types/components/vega-rich-text-editor/public-api.d.ts +5 -0
  432. package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.d.ts +3 -1
  433. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.d.ts +3 -0
  434. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/redo-toolbar-button-slimmer.d.ts +9 -0
  435. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/undo-toolbar-button-slimmer.d.ts +9 -0
  436. package/dist/types/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.d.ts +1 -0
  437. package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +14 -0
  438. package/dist/types/components/vega-textarea/vega-textarea.d.ts +10 -0
  439. package/dist/types/components.d.ts +169 -5
  440. package/dist/types/constants/ui.d.ts +1 -1
  441. package/dist/types/helpers/event-manager/event-id/vega-event-id.d.ts +1 -0
  442. package/dist/types/helpers/slimmers/component-value-history-controller-slimmer.abstract.d.ts +13 -0
  443. package/dist/types/helpers/theme/controllers/action-color-accessibility-validator.d.ts +10 -0
  444. package/dist/types/helpers/theme/internal-theme-manager.d.ts +28 -1
  445. package/dist/types/helpers/theme/theme-manager.d.ts +24 -1
  446. package/dist/types/helpers/theme/theme.d.ts +8 -0
  447. package/dist/types/helpers/translation/interface.d.ts +10 -1
  448. package/dist/types/types/components.type.d.ts +11 -10
  449. package/dist/types/types/public-api.d.ts +1 -0
  450. package/dist/types/vega-color-token-contrast-checker/src/check/checker.d.ts +177 -0
  451. package/dist/types/vega-color-token-contrast-checker/src/check/color-math.d.ts +125 -0
  452. package/dist/types/vega-color-token-contrast-checker/src/check/contrast-check-strategy.d.ts +38 -0
  453. package/dist/types/vega-color-token-contrast-checker/src/check/search.d.ts +58 -0
  454. package/dist/types/vega-color-token-contrast-checker/src/check/token-checks.d.ts +122 -0
  455. package/dist/types/vega-color-token-contrast-checker/src/check/token-checks.generated.d.ts +2 -0
  456. package/dist/types/vega-color-token-contrast-checker/src/index.d.ts +2 -0
  457. package/dist/vega/index.esm.js +1 -1
  458. package/dist/vega/{p-636d890e.entry.js → p-01f617ee.entry.js} +1 -1
  459. package/dist/vega/{p-fdb97cb7.entry.js → p-03b32939.entry.js} +1 -1
  460. package/dist/vega/{p-2927b7a1.js → p-05dc6718.js} +1 -1
  461. package/dist/vega/{p-72e2a587.js → p-0b2ca33b.js} +1 -1
  462. package/dist/vega/p-0c460945.js +1 -0
  463. package/dist/vega/{p-d286da1d.entry.js → p-0d248322.entry.js} +1 -1
  464. package/dist/vega/{p-2b2fefc6.js → p-0d3830f1.js} +1 -1
  465. package/dist/vega/{p-c45acdc3.entry.js → p-0dafd071.entry.js} +1 -1
  466. package/dist/vega/{p-a67d52ce.entry.js → p-0edf9c6e.entry.js} +1 -1
  467. package/dist/vega/{p-a03341d8.entry.js → p-1385da31.entry.js} +1 -1
  468. package/dist/vega/{p-d1a6e126.entry.js → p-18d1d404.entry.js} +1 -1
  469. package/dist/vega/{p-aa8f4713.entry.js → p-1d752c37.entry.js} +1 -1
  470. package/dist/vega/p-1f563387.js +1 -0
  471. package/dist/vega/{p-e85497ec.entry.js → p-296c90bd.entry.js} +1 -1
  472. package/dist/vega/p-30f76962.js +3 -0
  473. package/dist/vega/p-3186995a.entry.js +1 -0
  474. package/dist/vega/p-3312e3dd.js +1 -0
  475. package/dist/vega/{p-a0dd08b1.js → p-36e46c4f.js} +1 -1
  476. package/dist/vega/p-36f3dd19.entry.js +1 -0
  477. package/dist/vega/{p-d5aad9f0.entry.js → p-3ab50c06.entry.js} +1 -1
  478. package/dist/vega/{p-31ebace1.js → p-3d6568cc.js} +1 -1
  479. package/dist/vega/{p-19df2831.entry.js → p-3e2e4b00.entry.js} +1 -1
  480. package/dist/vega/{p-ff5208f5.entry.js → p-416e89b0.entry.js} +1 -1
  481. package/dist/vega/{p-79bb216e.entry.js → p-4914a5f8.entry.js} +1 -1
  482. package/dist/vega/{p-ac26924d.entry.js → p-4f53b45d.entry.js} +1 -1
  483. package/dist/vega/p-50958342.js +1 -0
  484. package/dist/vega/{p-2d694684.js → p-518e0a24.js} +1 -1
  485. package/dist/vega/p-540bd78a.entry.js +1 -0
  486. package/dist/vega/p-5424e837.js +1 -0
  487. package/dist/vega/p-54ed506c.entry.js +1 -0
  488. package/dist/vega/{p-7e7e2f85.entry.js → p-5a960f83.entry.js} +1 -1
  489. package/dist/vega/{p-879d3cc9.entry.js → p-5c1a4fd7.entry.js} +1 -1
  490. package/dist/vega/{p-5b43a303.entry.js → p-5c8522eb.entry.js} +1 -1
  491. package/dist/vega/p-5f377954.js +1 -1
  492. package/dist/vega/{p-0b41b49a.entry.js → p-6205288e.entry.js} +1 -1
  493. package/dist/vega/{p-04a65b3f.js → p-6629a68b.js} +1 -1
  494. package/dist/vega/p-696d7b8f.js +1 -0
  495. package/dist/vega/{p-931dac8c.entry.js → p-6ab23e89.entry.js} +1 -1
  496. package/dist/vega/{p-154cc614.js → p-6bd37d32.js} +1 -1
  497. package/dist/vega/{p-ce034372.entry.js → p-6be01c6b.entry.js} +1 -1
  498. package/dist/vega/{p-294cff20.entry.js → p-70e0c3eb.entry.js} +1 -1
  499. package/dist/vega/{p-4a9c8ec0.entry.js → p-7168ef16.entry.js} +1 -1
  500. package/dist/vega/{p-ab04eff6.js → p-7292ac20.js} +1 -1
  501. package/dist/vega/p-7348a091.entry.js +1 -0
  502. package/dist/vega/{p-19adf714.js → p-788ada42.js} +1 -1
  503. package/dist/vega/p-7cd8d054.entry.js +1 -0
  504. package/dist/vega/{p-bee5dfb0.entry.js → p-7dcc0b23.entry.js} +1 -1
  505. package/dist/vega/{p-189d36ec.js → p-81d55efd.js} +1 -1
  506. package/dist/vega/{p-8077b117.js → p-8ee917b4.js} +1 -1
  507. package/dist/vega/{p-52645382.entry.js → p-92468c30.entry.js} +1 -1
  508. package/dist/vega/{p-3a3720c7.entry.js → p-92710213.entry.js} +1 -1
  509. package/dist/vega/{p-e8de9535.js → p-9c48e4e5.js} +1 -1
  510. package/dist/vega/{p-891815d6.js → p-9f03856e.js} +1 -1
  511. package/dist/vega/{p-7ffe8081.entry.js → p-a0dd5273.entry.js} +1 -1
  512. package/dist/vega/p-a0fa5ccc.entry.js +1 -0
  513. package/dist/vega/{p-4a954d9d.entry.js → p-a32ad1ac.entry.js} +1 -1
  514. package/dist/vega/{p-01a54c29.entry.js → p-a36d4199.entry.js} +1 -1
  515. package/dist/vega/{p-d97974be.entry.js → p-a53e1a60.entry.js} +1 -1
  516. package/dist/vega/{p-d4262f06.entry.js → p-a73d8915.entry.js} +1 -1
  517. package/dist/vega/{p-07225567.entry.js → p-a87bc75a.entry.js} +1 -1
  518. package/dist/vega/{p-09076646.js → p-abfe46ca.js} +1 -1
  519. package/dist/vega/p-ad815280.js +1 -0
  520. package/dist/vega/p-b0fb5099.entry.js +1 -0
  521. package/dist/vega/{p-d05915af.entry.js → p-b218141f.entry.js} +1 -1
  522. package/dist/vega/{p-e7c930d9.entry.js → p-b2a0d104.entry.js} +1 -1
  523. package/dist/vega/{p-3bf3c8bb.entry.js → p-b31802b3.entry.js} +1 -1
  524. package/dist/vega/{p-255a7387.entry.js → p-b3e97e2f.entry.js} +1 -1
  525. package/dist/vega/{p-15b4f1ce.entry.js → p-b519b9ab.entry.js} +1 -1
  526. package/dist/vega/{p-8aee6b74.js → p-b565a6a5.js} +1 -1
  527. package/dist/vega/{p-2e0bdc53.entry.js → p-b5a3de00.entry.js} +1 -1
  528. package/dist/vega/p-b5d00d38.entry.js +1 -0
  529. package/dist/vega/p-b72d7b57.entry.js +1 -0
  530. package/dist/vega/{p-f5ae99b4.entry.js → p-b7f30f68.entry.js} +1 -1
  531. package/dist/vega/p-b857a661.js +1 -0
  532. package/dist/vega/{p-d9d4bdbf.entry.js → p-ba4f23d8.entry.js} +1 -1
  533. package/dist/vega/{p-5df7ab03.entry.js → p-c0c13993.entry.js} +1 -1
  534. package/dist/vega/p-c4675cd2.entry.js +1 -0
  535. package/dist/vega/p-c51e3b9e.js +1 -0
  536. package/dist/vega/{p-bd47d8a7.entry.js → p-c6201e76.entry.js} +1 -1
  537. package/dist/vega/p-c84aa55a.js +1 -0
  538. package/dist/vega/{p-858ec529.js → p-c93dfe23.js} +1 -1
  539. package/dist/vega/p-cacec680.js +1 -0
  540. package/dist/vega/{p-186df871.entry.js → p-cd382652.entry.js} +1 -1
  541. package/dist/vega/{p-49341532.entry.js → p-cdd3af89.entry.js} +1 -1
  542. package/dist/vega/{p-ec663f00.entry.js → p-ce8a0aa6.entry.js} +1 -1
  543. package/dist/vega/{p-648be36d.entry.js → p-cf5c6172.entry.js} +1 -1
  544. package/dist/vega/{p-0a322971.entry.js → p-d1641644.entry.js} +1 -1
  545. package/dist/vega/p-d2237b95.entry.js +1 -0
  546. package/dist/vega/{p-76075a1c.entry.js → p-d24892d6.entry.js} +1 -1
  547. package/dist/vega/p-d25ca0c3.entry.js +1 -0
  548. package/dist/vega/{p-b69755c7.entry.js → p-d8591207.entry.js} +1 -1
  549. package/dist/vega/p-da42fde0.js +1 -0
  550. package/dist/vega/{p-aa4e9a4b.entry.js → p-dc0f7ef1.entry.js} +1 -1
  551. package/dist/vega/{p-70ae9157.entry.js → p-dcd3b421.entry.js} +1 -1
  552. package/dist/vega/{p-c19132c9.entry.js → p-df4f9264.entry.js} +1 -1
  553. package/dist/vega/p-e5726df7.entry.js +1 -0
  554. package/dist/vega/{p-4c91b13d.js → p-e7fb7eee.js} +1 -1
  555. package/dist/vega/{p-98dad153.entry.js → p-ea4b5520.entry.js} +1 -1
  556. package/dist/vega/p-ecbead18.entry.js +1 -0
  557. package/dist/vega/{p-b02b985d.js → p-f0d70de3.js} +1 -1
  558. package/dist/vega/{p-78ba7ca9.js → p-f7ad9349.js} +1 -1
  559. package/dist/vega/{p-a6565e02.js → p-fdf6f368.js} +1 -1
  560. package/dist/vega/{p-0a261b66.js → p-fea75b87.js} +1 -1
  561. package/dist/vega/{p-296c5e52.js → p-ffda64ac.js} +1 -1
  562. package/dist/vega/{p-74a1a82a.entry.js → p-ffe8a826.entry.js} +1 -1
  563. package/dist/vega/vega.esm.js +1 -1
  564. package/package.json +3 -2
  565. package/dist/vega/p-042933f1.js +0 -1
  566. package/dist/vega/p-0d97dcb9.js +0 -1
  567. package/dist/vega/p-1da42a63.entry.js +0 -1
  568. package/dist/vega/p-281fa1e0.js +0 -1
  569. package/dist/vega/p-32a0f887.js +0 -1
  570. package/dist/vega/p-4a6f241d.entry.js +0 -1
  571. package/dist/vega/p-4dd02704.js +0 -1
  572. package/dist/vega/p-50fb936f.entry.js +0 -1
  573. package/dist/vega/p-612808ce.entry.js +0 -1
  574. package/dist/vega/p-6399b5ed.js +0 -1
  575. package/dist/vega/p-686e0b6b.entry.js +0 -1
  576. package/dist/vega/p-6d4faebc.js +0 -1
  577. package/dist/vega/p-88e56a47.entry.js +0 -1
  578. package/dist/vega/p-8d36afcc.entry.js +0 -1
  579. package/dist/vega/p-979a5e91.entry.js +0 -1
  580. package/dist/vega/p-a2b8d49d.js +0 -1
  581. package/dist/vega/p-ab4c307b.js +0 -1
  582. package/dist/vega/p-ce2d9efe.entry.js +0 -1
  583. package/dist/vega/p-e46a23fc.entry.js +0 -1
  584. package/dist/vega/p-e8ea3b16.js +0 -3
  585. package/dist/vega/p-ea0e922f.entry.js +0 -1
  586. package/dist/vega/p-ec2333f7.entry.js +0 -1
  587. package/dist/vega/p-ed2b0e01.entry.js +0 -1
  588. package/dist/vega/p-ef13b346.js +0 -1
  589. package/dist/vega/p-fe220f3a.entry.js +0 -1
@@ -0,0 +1,1817 @@
1
+ 'use strict';
2
+
3
+ const darkModeStyleController = require('./dark-mode-style-controller-ed481250.js');
4
+ require('./static-subject-title-5829a298.js');
5
+ require('./change-manager-a297e4d2.js');
6
+ require('./global-slimmer-registry-b3bce7e0.js');
7
+ require('./observer-f49483e8.js');
8
+ require('./tinycolor-polyfill-502efaa8.js');
9
+ require('./vega-nonce-manager-df69d3ed.js');
10
+ require('./try-get-document-c0ebd39a.js');
11
+ require('./index-592b4052.js');
12
+
13
+ // Self-contained hex-color validation: this package is consumed by vega-stencil
14
+ // (which has its own `isValidHexColor` in `utils/ui.ts`), but we cannot import
15
+ // across the package boundary. Pattern matches vega-stencil's exactly.
16
+ const HEX_COLOR_PATTERN = /^#?(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
17
+ /** Matches `rgb(r, g, b)` with integer channel values 0–255. */
18
+ const RGB_PATTERN = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i;
19
+ /** Matches `rgba(r, g, b, a)` with integer channels 0–255 and alpha 0–1. */
20
+ const RGBA_PATTERN = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([01]?\.?\d*)\s*\)$/i;
21
+ /** Returns true if the string is a valid 3- or 6-digit hex color (with optional `#`). */
22
+ function isValidHexColor(hex) {
23
+ return HEX_COLOR_PATTERN.test(hex);
24
+ }
25
+ /**
26
+ * Returns true if the string is a valid color in any supported format:
27
+ * hex (3/6 digits), rgb(), or rgba().
28
+ */
29
+ function isValidColor(color) {
30
+ if (isValidHexColor(color))
31
+ return true;
32
+ const rgbMatch = color.match(RGB_PATTERN);
33
+ if (rgbMatch) {
34
+ return isValidRgbChannels(+rgbMatch[1], +rgbMatch[2], +rgbMatch[3]);
35
+ }
36
+ const rgbaMatch = color.match(RGBA_PATTERN);
37
+ if (rgbaMatch) {
38
+ return isValidRgbChannels(+rgbaMatch[1], +rgbaMatch[2], +rgbaMatch[3]) &&
39
+ +rgbaMatch[4] >= 0 && +rgbaMatch[4] <= 1;
40
+ }
41
+ return false;
42
+ }
43
+ /** Check that each channel is an integer in 0–255 range. */
44
+ function isValidRgbChannels(r, g, b) {
45
+ return r >= 0 && r <= 255 && g >= 0 && g <= 255 && b >= 0 && b <= 255;
46
+ }
47
+ /**
48
+ * sRGB linearization constants per IEC 61966-2-1
49
+ *
50
+ * Threshold on companded (sRGB) channel value (0–1) below which the linear form is used.
51
+ * Note: WCAG 2.0/2.1 reference uses 0.03928 (pre-amendment IEC 61966-2-1). The 2001
52
+ * amendment updated to 0.04045; difference is negligible (<0.3% of sRGB gamut).
53
+ */
54
+ const SRGB_THRESHOLD = 0.03928;
55
+ /** Equivalent threshold on linearized channel value (0–1) — used for the inverse transform. */
56
+ const SRGB_LINEAR_THRESHOLD = 0.0031308;
57
+ const SRGB_LINEAR_FACTOR = 12.92;
58
+ const SRGB_GAMMA_OFFSET = 0.055;
59
+ const SRGB_GAMMA_DIVISOR = 1.055;
60
+ const SRGB_GAMMA_EXPONENT = 2.4;
61
+ /** ITU-R BT.709 luminance coefficients */
62
+ const LUMINANCE_R = 0.2126;
63
+ const LUMINANCE_G = 0.7152;
64
+ const LUMINANCE_B = 0.0722;
65
+ /** WCAG contrast ratio offset */
66
+ const CONTRAST_OFFSET = 0.05;
67
+ const MAX_RGB = 255;
68
+ // ────────────────────────────────────────────────────────────────────────────────
69
+ // sRGB ↔ linear
70
+ // ────────────────────────────────────────────────────────────────────────────────
71
+ /**
72
+ * Convert a companded sRGB channel value (0–1) to its linear-light equivalent.
73
+ *
74
+ * @param {number} c - Companded sRGB channel value (0–1).
75
+ * @returns {number} Linearized channel value.
76
+ */
77
+ function srgbChannelToLinear(c) {
78
+ return c <= SRGB_THRESHOLD
79
+ ? c / SRGB_LINEAR_FACTOR
80
+ : ((c + SRGB_GAMMA_OFFSET) / SRGB_GAMMA_DIVISOR) ** SRGB_GAMMA_EXPONENT;
81
+ }
82
+ /**
83
+ * Convert a linear-light channel value (0–1) to its companded sRGB equivalent.
84
+ *
85
+ * @param {number} c - Linear channel value (0–1).
86
+ * @returns {number} Companded sRGB channel value.
87
+ */
88
+ function linearChannelToSrgb(c) {
89
+ return c <= SRGB_LINEAR_THRESHOLD
90
+ ? SRGB_LINEAR_FACTOR * c
91
+ : SRGB_GAMMA_DIVISOR * c ** (1 / SRGB_GAMMA_EXPONENT) - SRGB_GAMMA_OFFSET;
92
+ }
93
+ // ────────────────────────────────────────────────────────────────────────────────
94
+ // WCAG luminance / contrast
95
+ // ────────────────────────────────────────────────────────────────────────────────
96
+ /**
97
+ * Calculate the relative luminance of a color per WCAG 2.0.
98
+ *
99
+ * @param {RgbColor} color - RGB color to compute luminance for.
100
+ * @returns {number} Relative luminance value.
101
+ * @see https://www.w3.org/TR/WCAG20/#relativeluminancedef
102
+ */
103
+ function getRelativeLuminance(color) {
104
+ const r = srgbChannelToLinear(color.r / MAX_RGB);
105
+ const g = srgbChannelToLinear(color.g / MAX_RGB);
106
+ const b = srgbChannelToLinear(color.b / MAX_RGB);
107
+ return LUMINANCE_R * r + LUMINANCE_G * g + LUMINANCE_B * b;
108
+ }
109
+ /**
110
+ * Calculate the contrast ratio between two colors per WCAG 2.0. The operation is
111
+ * symmetric, so callers don't need to sort the arguments.
112
+ *
113
+ * @param {RgbColor} a - First color.
114
+ * @param {RgbColor} b - Second color.
115
+ * @returns {number} WCAG contrast ratio.
116
+ * @see https://www.w3.org/TR/WCAG20/#contrast-ratiodef
117
+ */
118
+ function getContrastRatio(a, b) {
119
+ const la = getRelativeLuminance(a);
120
+ const lb = getRelativeLuminance(b);
121
+ const lighter = Math.max(la, lb);
122
+ const darker = Math.min(la, lb);
123
+ return (lighter + CONTRAST_OFFSET) / (darker + CONTRAST_OFFSET);
124
+ }
125
+ // ────────────────────────────────────────────────────────────────────────────────
126
+ // Compositing & format helpers
127
+ // ────────────────────────────────────────────────────────────────────────────────
128
+ /**
129
+ * Composite a semi-transparent foreground color over an opaque background using the
130
+ * standard alpha compositing formula.
131
+ *
132
+ * @param {RgbColor} fg - Foreground color.
133
+ * @param {number} fgAlpha - Foreground alpha (0–1).
134
+ * @param {RgbColor} bg - Background color.
135
+ * @returns {RgbColor} Composited opaque color.
136
+ */
137
+ function alphaComposite(fg, fgAlpha, bg) {
138
+ return {
139
+ r: Math.round(fg.r * fgAlpha + bg.r * (1 - fgAlpha)),
140
+ g: Math.round(fg.g * fgAlpha + bg.g * (1 - fgAlpha)),
141
+ b: Math.round(fg.b * fgAlpha + bg.b * (1 - fgAlpha)),
142
+ };
143
+ }
144
+ /**
145
+ * Convert an RGB color to its hex string representation.
146
+ *
147
+ * @param {RgbColor} color - RGB color to convert.
148
+ * @returns {string} Hex color string with leading `#`.
149
+ */
150
+ function rgbToHex(color) {
151
+ /**
152
+ * Convert a single channel to a two-digit hex string.
153
+ *
154
+ * @param {number} n - Channel value (0–255).
155
+ * @returns {string} Two-digit hex string.
156
+ */
157
+ const toHex = (n) => n.toString(16).padStart(2, '0');
158
+ return `#${toHex(color.r)}${toHex(color.g)}${toHex(color.b)}`;
159
+ }
160
+ /**
161
+ * Parse a 3- or 6-char hex string into an RGB triplet.
162
+ *
163
+ * Throws on malformed input rather than returning a silently-NaN-poisoned color — a bad
164
+ * hex here is a programmer error (invalid `actionColor` on `VegaThemeOverrideColors`) and
165
+ * a fail-fast surface is easier to debug than garbage-propagating contrast ratios.
166
+ *
167
+ * @param {string} hex - Hex color string (3 or 6 digits, optional `#` prefix).
168
+ * @returns {RgbColor} Parsed RGB triplet.
169
+ */
170
+ function hexToRgb(hex) {
171
+ if (!isValidHexColor(hex)) {
172
+ throw new Error(`Invalid hex color: "${hex}". Expected 3- or 6-digit hex with optional leading #.`);
173
+ }
174
+ const cleaned = hex.replace(/^#/, '');
175
+ const full = cleaned.length === 3
176
+ ? cleaned[0] + cleaned[0] + cleaned[1] + cleaned[1] + cleaned[2] + cleaned[2]
177
+ : cleaned;
178
+ return {
179
+ r: parseInt(full.substring(0, 2), 16),
180
+ g: parseInt(full.substring(2, 4), 16),
181
+ b: parseInt(full.substring(4, 6), 16),
182
+ };
183
+ }
184
+ /**
185
+ * Parse any supported color format (hex, rgb(), rgba()) into an RGB triplet.
186
+ *
187
+ * Throws on malformed input. Alpha from rgba() is discarded — actionColor is opaque.
188
+ *
189
+ * @param {string} color - Color string in hex, rgb(), or rgba() format.
190
+ * @returns {RgbColor} Parsed RGB triplet.
191
+ */
192
+ function parseColorToRgb(color) {
193
+ if (isValidHexColor(color)) {
194
+ return hexToRgb(color);
195
+ }
196
+ const rgbMatch = color.match(RGB_PATTERN);
197
+ if (rgbMatch && isValidRgbChannels(+rgbMatch[1], +rgbMatch[2], +rgbMatch[3])) {
198
+ return { r: +rgbMatch[1], g: +rgbMatch[2], b: +rgbMatch[3] };
199
+ }
200
+ const rgbaMatch = color.match(RGBA_PATTERN);
201
+ if (rgbaMatch && isValidRgbChannels(+rgbaMatch[1], +rgbaMatch[2], +rgbaMatch[3])) {
202
+ return { r: +rgbaMatch[1], g: +rgbaMatch[2], b: +rgbaMatch[3] };
203
+ }
204
+ throw new Error(`Invalid color: "${color}". Expected hex, rgb(), or rgba() format.`);
205
+ }
206
+ /**
207
+ * Format a token value back to the `r g b / a` shape consumed by the theme layer.
208
+ *
209
+ * @param {RgbColor} rgb - RGB color.
210
+ * @param {number} alpha - Alpha value (0–1).
211
+ * @returns {string} Formatted token value string.
212
+ */
213
+ function formatTokenValue(rgb, alpha) {
214
+ // Round to 2 decimals — matches tinycolor's output precision and keeps CSS var readable.
215
+ const a = Math.round(alpha * 100) / 100;
216
+ return `${rgb.r} ${rgb.g} ${rgb.b} / ${a}`;
217
+ }
218
+ /**
219
+ * Inverse of {@link formatTokenValue}. Returns `null` on unparseable input.
220
+ *
221
+ * @param {string} value - Token value string in `r g b / a` format.
222
+ * @returns {ParsedTokenValue | null} Parsed result or null.
223
+ */
224
+ function parseTokenValue(value) {
225
+ const match = value.match(/^\s*(\d+)\s+(\d+)\s+(\d+)\s*\/\s*([\d.]+)\s*$/);
226
+ if (!match) {
227
+ return null;
228
+ }
229
+ return {
230
+ rgb: {
231
+ r: parseInt(match[1], 10),
232
+ g: parseInt(match[2], 10),
233
+ b: parseInt(match[3], 10),
234
+ },
235
+ a: parseFloat(match[4]),
236
+ };
237
+ }
238
+ // ────────────────────────────────────────────────────────────────────────────────
239
+ // OKLab / OKLCH conversions
240
+ // ────────────────────────────────────────────────────────────────────────────────
241
+ /**
242
+ * Convert an RGB color to its OKLab representation.
243
+ *
244
+ * @param {RgbColor} rgb - RGB color to convert.
245
+ * @returns {OklabColor} OKLab color.
246
+ */
247
+ function rgbToOklab(rgb) {
248
+ const r = srgbChannelToLinear(rgb.r / MAX_RGB);
249
+ const g = srgbChannelToLinear(rgb.g / MAX_RGB);
250
+ const b = srgbChannelToLinear(rgb.b / MAX_RGB);
251
+ const l_ = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
252
+ const m_ = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
253
+ const s_ = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
254
+ return {
255
+ L: 0.2104542553 * l_ + 0.793617785 * m_ - 0.0040720468 * s_,
256
+ a: 1.9779984951 * l_ - 2.428592205 * m_ + 0.4505937099 * s_,
257
+ b: 0.0259040371 * l_ + 0.7827717662 * m_ - 0.808675766 * s_,
258
+ };
259
+ }
260
+ /**
261
+ * Convert an OKLab color to its RGB representation.
262
+ *
263
+ * @param {OklabColor} lab - OKLab color to convert.
264
+ * @returns {RgbColor} RGB color.
265
+ */
266
+ function oklabToRgb(lab) {
267
+ const l_ = lab.L + 0.3963377774 * lab.a + 0.2158037573 * lab.b;
268
+ const m_ = lab.L - 0.1055613458 * lab.a - 0.0638541728 * lab.b;
269
+ const s_ = lab.L - 0.0894841775 * lab.a - 1.291485548 * lab.b;
270
+ const l = l_ ** 3;
271
+ const m = m_ ** 3;
272
+ const s = s_ ** 3;
273
+ const rLinear = 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s;
274
+ const gLinear = -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s;
275
+ const bLinear = -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s;
276
+ /**
277
+ * Clamp and round a linear-light channel to a byte (0–255).
278
+ *
279
+ * @param {number} linear - Linear-light channel value.
280
+ * @returns {number} Clamped byte value (0–255).
281
+ */
282
+ const toByte = (linear) => Math.max(0, Math.min(MAX_RGB, Math.round(linearChannelToSrgb(linear) * MAX_RGB)));
283
+ return { r: toByte(rLinear), g: toByte(gLinear), b: toByte(bLinear) };
284
+ }
285
+ /**
286
+ * Convert an OKLab color to its OKLCH (cylindrical) representation.
287
+ *
288
+ * @param {OklabColor} lab - OKLab color to convert.
289
+ * @returns {OklchColor} OKLCH color.
290
+ */
291
+ function oklabToOklch(lab) {
292
+ return {
293
+ L: lab.L,
294
+ C: Math.sqrt(lab.a * lab.a + lab.b * lab.b),
295
+ h: (Math.atan2(lab.b, lab.a) * 180) / Math.PI,
296
+ };
297
+ }
298
+ /**
299
+ * Convert an OKLCH color to its OKLab (Cartesian) representation.
300
+ *
301
+ * @param {OklchColor} lch - OKLCH color to convert.
302
+ * @returns {OklabColor} OKLab color.
303
+ */
304
+ function oklchToOklab(lch) {
305
+ const hRad = (lch.h * Math.PI) / 180;
306
+ return {
307
+ L: lch.L,
308
+ a: lch.C * Math.cos(hRad),
309
+ b: lch.C * Math.sin(hRad),
310
+ };
311
+ }
312
+ /**
313
+ * Perceptual color distance in OKLab (Euclidean ΔE, since OKLab is designed to be uniform).
314
+ *
315
+ * @param {OklabColor} a - First OKLab color.
316
+ * @param {OklabColor} b - Second OKLab color.
317
+ * @returns {number} Euclidean distance in OKLab space.
318
+ */
319
+ function oklabDeltaE(a, b) {
320
+ const dL = a.L - b.L;
321
+ const deltaA = a.a - b.a;
322
+ const db = a.b - b.b;
323
+ return Math.sqrt(dL * dL + deltaA * deltaA + db * db);
324
+ }
325
+
326
+ /**
327
+ * Light mode bg-primary ({@link LightModeColorTokens}'s `bg-primary` = `252, 252, 252, 1`).
328
+ * Duplicated here to avoid a circular dependency with `token-checks.ts`, which imports from
329
+ * this file. Must stay in sync with `LIGHT_BG_PRIMARY` in `token-checks.ts`.
330
+ */
331
+ const LIGHT_BG_PRIMARY = { r: 252, g: 252, b: 252 };
332
+ /**
333
+ * Resolve a surface to its effective opaque foreground color via alpha compositing.
334
+ *
335
+ * @param {ContextSurface} surface - Surface to resolve.
336
+ * @param {RgbColor} bg - Background color for alpha compositing.
337
+ * @returns {RgbColor} Effective foreground RGB.
338
+ */
339
+ function effectiveFgRgb$1(surface, bg) {
340
+ return surface.a < 1 ? alphaComposite(surface.rgb, surface.a, bg) : surface.rgb;
341
+ }
342
+ // ────────────────────────────────────────────────────────────────────────────────
343
+ // WCAG AA thresholds
344
+ // ────────────────────────────────────────────────────────────────────────────────
345
+ /** WCAG 2.1 AA minimum contrast ratio for normal-size text. */
346
+ const WCAG_AA_NORMAL_TEXT = 4.5;
347
+ /** WCAG 2.1 AA minimum contrast ratio for UI components and large text. */
348
+ const WCAG_AA_NON_TEXT_CONTRAST = 3;
349
+ /**
350
+ * Abstract strategy for computing the rendered fg/bg pair from a token and its paired surface.
351
+ * Each subclass implements the compositing logic specific to its WCAG check category.
352
+ */
353
+ class ContrastCheckStrategy {
354
+ }
355
+ /**
356
+ * Token is a background; paired text sits on top.
357
+ * Contrast is measured between the composited background and the effective foreground text.
358
+ */
359
+ class BgTextStrategy extends ContrastCheckStrategy {
360
+ constructor() {
361
+ super(...arguments);
362
+ this.requiredRatio = WCAG_AA_NORMAL_TEXT;
363
+ }
364
+ /**
365
+ * Compute fg/bg: token is background, paired text on top.
366
+ *
367
+ * @param {ParsedTokenValue} token - Background token value.
368
+ * @param {ContextSurface} paired - Foreground text surface.
369
+ * @returns {FgBgPair} Rendered foreground and background.
370
+ */
371
+ computeFgBg(token, paired) {
372
+ const bg = token.a < 1 ? alphaComposite(token.rgb, token.a, LIGHT_BG_PRIMARY) : token.rgb;
373
+ const fg = effectiveFgRgb$1(paired, bg);
374
+ return { fg, bg };
375
+ }
376
+ }
377
+ /**
378
+ * Token is foreground text; paired surface is the background behind it.
379
+ * Contrast is measured between the composited text color and its background.
380
+ */
381
+ class TextBgStrategy extends ContrastCheckStrategy {
382
+ constructor() {
383
+ super(...arguments);
384
+ this.requiredRatio = WCAG_AA_NORMAL_TEXT;
385
+ }
386
+ /**
387
+ * Compute fg/bg: token is foreground text, paired surface behind.
388
+ *
389
+ * @param {ParsedTokenValue} token - Foreground text token value.
390
+ * @param {ContextSurface} paired - Background surface.
391
+ * @returns {FgBgPair} Rendered foreground and background.
392
+ */
393
+ computeFgBg(token, paired) {
394
+ const pairedBg = paired.a < 1 ? alphaComposite(paired.rgb, paired.a, LIGHT_BG_PRIMARY) : paired.rgb;
395
+ const fg = token.a < 1 ? alphaComposite(token.rgb, token.a, pairedBg) : token.rgb;
396
+ return { fg, bg: pairedBg };
397
+ }
398
+ }
399
+ /**
400
+ * Token is a UI component (border, ring); `compositedOn` may override the composite surface.
401
+ * For box-shadow rings that paint outside an element (on the page background) but are compared
402
+ * against the element's fill, `compositedOn` ensures the alpha composite uses the correct surface.
403
+ */
404
+ class NonTextContrastStrategy extends ContrastCheckStrategy {
405
+ constructor() {
406
+ super(...arguments);
407
+ this.requiredRatio = WCAG_AA_NON_TEXT_CONTRAST;
408
+ }
409
+ /**
410
+ * Compute fg/bg: token is UI component, optional composite surface override.
411
+ *
412
+ * @param {ParsedTokenValue} token - UI component token value.
413
+ * @param {ContextSurface} paired - Adjacent surface for contrast.
414
+ * @param {ContextSurface | undefined} compositedOn - Override composite surface.
415
+ * @returns {FgBgPair} Rendered foreground and background.
416
+ */
417
+ computeFgBg(token, paired, compositedOn) {
418
+ const pairedBg = paired.a < 1 ? alphaComposite(paired.rgb, paired.a, LIGHT_BG_PRIMARY) : paired.rgb;
419
+ let compositeSurface = pairedBg;
420
+ if (compositedOn && token.a < 1) {
421
+ compositeSurface =
422
+ compositedOn.a < 1
423
+ ? alphaComposite(compositedOn.rgb, compositedOn.a, LIGHT_BG_PRIMARY)
424
+ : compositedOn.rgb;
425
+ }
426
+ const fg = token.a < 1 ? alphaComposite(token.rgb, token.a, compositeSurface) : token.rgb;
427
+ return { fg, bg: pairedBg };
428
+ }
429
+ }
430
+ /** Strategy registry — maps check type to its strategy instance. */
431
+ const STRATEGY_MAP = {
432
+ 'bg-text': new BgTextStrategy(),
433
+ 'text-bg': new TextBgStrategy(),
434
+ 'non-text-contrast': new NonTextContrastStrategy(),
435
+ };
436
+
437
+ // ────────────────────────────────────────────────────────────────────────────────
438
+ // Fixed paired-surface table — built by the consumer from a design-token map
439
+ // ────────────────────────────────────────────────────────────────────────────────
440
+ /**
441
+ * Names of the static design tokens that have no `overrideGetter` — the surfaces every
442
+ * actionColor-derived token may be paired with. Source-of-truth for which static tokens
443
+ * the checker must know about. Kept here (not in the consumer) so adding new pair targets
444
+ * is a one-line change in this package.
445
+ *
446
+ * Each entry's real SCSS consumer is documented in the catalogue's inline comment.
447
+ * `bg-action-tertiary` is α=0 (fully transparent) — composites collapse to `bg-primary`.
448
+ */
449
+ const FIXED_PAIRED_SURFACE_TOKENS = [
450
+ 'text-on-action',
451
+ 'text-primary',
452
+ 'text-secondary',
453
+ 'text-inverted-primary',
454
+ 'text-inverted-secondary',
455
+ 'bg-primary',
456
+ 'bg-page',
457
+ 'bg-secondary',
458
+ 'bg-tertiary',
459
+ 'bg-quaternary',
460
+ 'bg-action-secondary',
461
+ 'bg-action-tertiary',
462
+ 'bg-action-tertiary-hover',
463
+ 'bg-tile',
464
+ 'bg-tile-hover',
465
+ 'bg-tile-selected',
466
+ 'bg-tile-selected-hover',
467
+ 'bg-transparent',
468
+ 'bg-danger',
469
+ 'bg-divider-secondary',
470
+ 'bg-table-row-hover',
471
+ 'bg-toggle-switch',
472
+ 'bg-status-error',
473
+ 'bg-status-info',
474
+ 'bg-status-success',
475
+ 'bg-status-warning',
476
+ 'bg-table-header',
477
+ 'bg-segment-control',
478
+ 'bg-action-tertiary-active',
479
+ 'bg-chip-active',
480
+ 'bg-chip-hover',
481
+ 'bg-segment-hover',
482
+ 'bg-toggle-switch-hover',
483
+ 'bg-danger-tertiary-active',
484
+ 'bg-danger-tertiary-hover',
485
+ ];
486
+ /**
487
+ * Parse the comma-separated `r, g, b, a` shape used by the generated `*-color-tokens.ts` files.
488
+ *
489
+ * @param {string} value - Comma-separated string in `"r, g, b, a"` format (e.g. `"252, 252, 254, 0.9"`).
490
+ * @returns {ContextSurface} Parsed {@link ContextSurface} with `rgb` and `a` fields.
491
+ * @throws {Error} If the string has fewer than 4 parts or contains non-numeric values.
492
+ */
493
+ function parseCommaTokenValue(value) {
494
+ const parts = value.split(',').map((s) => parseFloat(s.trim()));
495
+ if (parts.length < 4 || parts.some(isNaN)) {
496
+ throw new Error(`Malformed token value: "${value}". Expected "r, g, b, a" format.`);
497
+ }
498
+ const [r, g, b, a] = parts;
499
+ return { rgb: { r, g, b }, a };
500
+ }
501
+ /**
502
+ * Build the fixed paired-surface table from the consumer's static design-token map.
503
+ *
504
+ * @param {Record<string, string>} designTokens - Source design tokens (token name → "r, g, b, a").
505
+ * @returns {Readonly<Record<string, ContextSurface>>} Frozen table for the checker.
506
+ */
507
+ function buildFixedPairedSurfaces(designTokens) {
508
+ const out = {};
509
+ for (const name of FIXED_PAIRED_SURFACE_TOKENS) {
510
+ const raw = designTokens[name];
511
+ if (raw === undefined) {
512
+ throw new Error(`buildFixedPairedSurfaces: missing required design token "${name}" in the supplied map.`);
513
+ }
514
+ out[name] = parseCommaTokenValue(raw);
515
+ }
516
+ return Object.freeze(out);
517
+ }
518
+ // ────────────────────────────────────────────────────────────────────────────────
519
+ // Pure surface / contrast helpers (parameterized on fixed-surface table)
520
+ // ────────────────────────────────────────────────────────────────────────────────
521
+ /**
522
+ * Resolve a `pairedWith` name to its rendered {@link ContextSurface}.
523
+ *
524
+ * Lookup order:
525
+ * 1. **`tokenMap` (actionColor-derived)** — covers every token that has an
526
+ * `overrideGetter` and therefore depends on `actionColor`.
527
+ * 2. **`fixedSurfaces`** — covers the static design tokens that have no `overrideGetter`.
528
+ *
529
+ * @param {string} pairedWith - Token name to resolve.
530
+ * @param {Map<string, string>} tokenMap - Resolved token map for dynamic lookups.
531
+ * @param {Readonly<Record<string, ContextSurface>>} fixedSurfaces - Static surface table.
532
+ * @returns {ContextSurface | undefined} Resolved surface, or undefined if not found.
533
+ */
534
+ function resolvePairedSurface(pairedWith, tokenMap, fixedSurfaces) {
535
+ const dynamicValue = tokenMap.get(pairedWith);
536
+ if (dynamicValue) {
537
+ const parsed = parseTokenValue(dynamicValue);
538
+ if (parsed) {
539
+ return { rgb: parsed.rgb, a: parsed.a };
540
+ }
541
+ }
542
+ return fixedSurfaces[pairedWith];
543
+ }
544
+ /**
545
+ * Resolve a paired surface to its rendered foreground RGB when it sits on top of `bg`.
546
+ * For opaque surfaces this is a no-op; for `text-on-action` (α<1) it performs the alpha
547
+ * composite the browser does at paint time, so the contrast ratio we compute matches
548
+ * what axe / Chrome DevTools see.
549
+ *
550
+ * @param {ContextSurface} surface - Surface to resolve.
551
+ * @param {RgbColor} bg - Background color for alpha compositing.
552
+ * @returns {RgbColor} Effective foreground RGB.
553
+ */
554
+ function effectiveFgRgb(surface, bg) {
555
+ return surface.a < 1 ? alphaComposite(surface.rgb, surface.a, bg) : surface.rgb;
556
+ }
557
+ /**
558
+ * Return the WCAG AA required contrast ratio for a check type.
559
+ *
560
+ * @param {TokenCheckConfig['type']} type - Check type.
561
+ * @returns {number} Required contrast ratio.
562
+ */
563
+ function requiredRatioFor(type) {
564
+ return type === 'non-text-contrast' ? WCAG_AA_NON_TEXT_CONTRAST : WCAG_AA_NORMAL_TEXT;
565
+ }
566
+ /**
567
+ * Compute the contrast ratio + rendered colors for a single token check under a given
568
+ * `actionColor`. Returns null when the token has no override value, the value can't be
569
+ * parsed, or the paired surface fails to resolve (catalogue typo).
570
+ *
571
+ * @param {TokenCheckConfig} checkConfig - Token check configuration.
572
+ * @param {Map<string, string>} tokenMap - Resolved token map for surface lookups.
573
+ * @param {Readonly<Record<string, ContextSurface>>} fixedSurfaces - Static surface table.
574
+ * @returns {ContrastResult | null} Contrast result or null.
575
+ */
576
+ function computeTokenContrast(checkConfig, tokenMap, fixedSurfaces) {
577
+ const tokenValue = tokenMap.get(checkConfig.tokenName);
578
+ if (!tokenValue) {
579
+ return null;
580
+ }
581
+ const parsed = parseTokenValue(tokenValue);
582
+ if (!parsed) {
583
+ return null;
584
+ }
585
+ const paired = resolvePairedSurface(checkConfig.pairedWith, tokenMap, fixedSurfaces);
586
+ if (!paired) {
587
+ return null;
588
+ }
589
+ const compositedOn = checkConfig.compositedOn
590
+ ? resolvePairedSurface(checkConfig.compositedOn, tokenMap, fixedSurfaces)
591
+ : undefined;
592
+ const strategy = STRATEGY_MAP[checkConfig.type];
593
+ const { fg, bg } = strategy.computeFgBg(parsed, paired, compositedOn);
594
+ const contrastRatio = Math.round(getContrastRatio(fg, bg) * 100) / 100;
595
+ return { fg, bg, contrastRatio };
596
+ }
597
+
598
+ /**
599
+ * Search engine for finding perceptually-closest feasible colors in OKLCH space and
600
+ * resolving minimum-alpha / RGB-shift fixes for WCAG contrast requirements.
601
+ *
602
+ * The constructor takes the static `fixedSurfaces` table and the `bg-primary` RGB used
603
+ * as the underlying composite surface for semi-transparent paint. Both come from the
604
+ * design-token map supplied by the consumer.
605
+ */
606
+ class ColorSearchEngine {
607
+ constructor(fixedSurfaces) {
608
+ this.fixedSurfaces = fixedSurfaces;
609
+ const bgPrimary = fixedSurfaces['bg-primary'];
610
+ if (!bgPrimary) {
611
+ throw new Error('ColorSearchEngine: fixedSurfaces is missing required key "bg-primary".');
612
+ }
613
+ this.lightBgPrimary = bgPrimary.rgb;
614
+ }
615
+ /**
616
+ * Find the closest feasible color (by OKLab ΔE) within a (hue ± 5°, chroma × 0.6–1.4) grid.
617
+ *
618
+ * @param {RgbColor} origin - Starting RGB color to search from.
619
+ * @param {Function} isFeasible - Predicate returning true if a candidate RGB meets constraints.
620
+ * @param {boolean} assumeMonotone - `true`: binary search on L (fast, monotone predicate required);
621
+ * `false`: linear scan on L (handles internal-band feasibility).
622
+ * @returns {RgbColor | undefined} Closest feasible RGB, or `undefined` if none found in envelope.
623
+ */
624
+ searchClosestFeasibleInOklch(origin, isFeasible, assumeMonotone = true) {
625
+ const originalLab = rgbToOklab(origin);
626
+ const { L: L0, C: C0, h: H0 } = oklabToOklch(originalLab);
627
+ /**
628
+ * Try a candidate OKLCH point and return its RGB + perceptual distance if feasible.
629
+ *
630
+ * @param {OklchColor} lch - Candidate OKLCH color.
631
+ * @returns {{ rgb: RgbColor; deltaE: number } | undefined} Result or undefined.
632
+ */
633
+ const tryCandidate = (lch) => {
634
+ const rgb = oklabToRgb(oklchToOklab(lch));
635
+ if (!isFeasible(rgb))
636
+ return undefined;
637
+ return { rgb, deltaE: oklabDeltaE(originalLab, rgbToOklab(rgb)) };
638
+ };
639
+ /**
640
+ * Binary search on L axis from both endpoints inward (monotone assumption).
641
+ *
642
+ * @param {number} C - Chroma value.
643
+ * @param {number} h - Hue angle in degrees.
644
+ * @returns {{ rgb: RgbColor; deltaE: number } | undefined} Best candidate or undefined.
645
+ */
646
+ const searchLAxisMonotone = (C, h) => {
647
+ const atL0 = tryCandidate({ L: L0, C, h });
648
+ if (atL0)
649
+ return atL0;
650
+ let best;
651
+ // Search darker direction: [0, L₀]
652
+ const darkEnd = tryCandidate({ L: 0, C, h });
653
+ if (darkEnd) {
654
+ best = darkEnd;
655
+ let lo = 0;
656
+ let hi = L0;
657
+ for (let i = 0; i < ColorSearchEngine.SUGGESTION_SEARCH_ITERATIONS; i++) {
658
+ const mid = (lo + hi) / 2;
659
+ const midResult = tryCandidate({
660
+ L: mid,
661
+ C,
662
+ h,
663
+ });
664
+ if (midResult) {
665
+ lo = mid;
666
+ best = midResult;
667
+ }
668
+ else {
669
+ hi = mid;
670
+ }
671
+ }
672
+ }
673
+ // Search lighter direction: [L₀, 1]
674
+ const lightEnd = tryCandidate({ L: 1, C, h });
675
+ if (lightEnd) {
676
+ let lightBest = lightEnd;
677
+ let lo = L0;
678
+ let hi = 1;
679
+ for (let i = 0; i < ColorSearchEngine.SUGGESTION_SEARCH_ITERATIONS; i++) {
680
+ const mid = (lo + hi) / 2;
681
+ const midResult = tryCandidate({
682
+ L: mid,
683
+ C,
684
+ h,
685
+ });
686
+ if (midResult) {
687
+ hi = mid;
688
+ lightBest = midResult;
689
+ }
690
+ else {
691
+ lo = mid;
692
+ }
693
+ }
694
+ if (!best || lightBest.deltaE < best.deltaE) {
695
+ best = lightBest;
696
+ }
697
+ }
698
+ return best;
699
+ };
700
+ /**
701
+ * Linear scan on L ∈ [0,1]; handles non-monotone feasibility regions.
702
+ *
703
+ * @param {number} C - Chroma value.
704
+ * @param {number} h - Hue angle in degrees.
705
+ * @returns {{ rgb: RgbColor; deltaE: number } | undefined} Best candidate or undefined.
706
+ */
707
+ const searchLAxisLinear = (C, h) => {
708
+ let best;
709
+ for (let i = 0; i <= ColorSearchEngine.L_SCAN_STEPS; i++) {
710
+ const L = i / ColorSearchEngine.L_SCAN_STEPS;
711
+ const result = tryCandidate({ L, C, h });
712
+ if (result && (!best || result.deltaE < best.deltaE)) {
713
+ best = result;
714
+ }
715
+ }
716
+ return best;
717
+ };
718
+ const searchLAxis = assumeMonotone ? searchLAxisMonotone : searchLAxisLinear;
719
+ let bestRgb;
720
+ let bestDeltaE = Infinity;
721
+ /**
722
+ * Update best candidate if the new one has a smaller perceptual distance.
723
+ *
724
+ * @param {{ rgb: RgbColor; deltaE: number } | undefined} candidate - Candidate to consider.
725
+ */
726
+ const consider = (candidate) => {
727
+ if (candidate && candidate.deltaE < bestDeltaE) {
728
+ bestDeltaE = candidate.deltaE;
729
+ bestRgb = candidate.rgb;
730
+ }
731
+ };
732
+ if (C0 < ColorSearchEngine.ACHROMATIC_CHROMA_EPSILON) {
733
+ consider(searchLAxis(0, 0));
734
+ return bestRgb;
735
+ }
736
+ for (const hueOffset of ColorSearchEngine.SUGGESTION_HUE_OFFSETS_DEG) {
737
+ const h = H0 + hueOffset;
738
+ for (const cScale of ColorSearchEngine.SUGGESTION_CHROMA_SCALES) {
739
+ const C = Math.max(0, C0 * cScale);
740
+ consider(searchLAxis(C, h));
741
+ }
742
+ }
743
+ return bestRgb;
744
+ }
745
+ /**
746
+ * Binary-search for the minimum alpha that makes composite contrast ≥ threshold.
747
+ * Result is ceil-rounded to 2 decimals. Returns `undefined` if α=1.0 still fails.
748
+ *
749
+ * @param {RgbColor} rgb - Token's base RGB color.
750
+ * @param {number} currentAlpha - Current alpha (lower bound for search).
751
+ * @param {TokenCheckConfig} checkConfig - Token check configuration (pairing, type, compositedOn).
752
+ * @param {number} threshold - Required WCAG contrast ratio.
753
+ * @param {Map<string, string>} tokenMap - Resolved token map for surface lookups.
754
+ * @returns {number | undefined} Minimum alpha (ceil-rounded), or `undefined` if infeasible.
755
+ */
756
+ findMinimumAlphaForContrast(rgb, currentAlpha, checkConfig, threshold, tokenMap) {
757
+ const paired = resolvePairedSurface(checkConfig.pairedWith, tokenMap, this.fixedSurfaces);
758
+ if (!paired) {
759
+ return undefined;
760
+ }
761
+ const lightBgPrimary = this.lightBgPrimary;
762
+ const fixedSurfaces = this.fixedSurfaces;
763
+ /**
764
+ * Compute contrast at a given alpha for binary search.
765
+ *
766
+ * @param {number} alpha - Alpha value to test.
767
+ * @returns {number} WCAG contrast ratio at the given alpha.
768
+ */
769
+ const contrastAt = (alpha) => {
770
+ if (checkConfig.type === 'bg-text') {
771
+ const bg = alpha < 1 ? alphaComposite(rgb, alpha, lightBgPrimary) : rgb;
772
+ return getContrastRatio(effectiveFgRgb(paired, bg), bg);
773
+ }
774
+ // Composite paired surface onto bg-primary if semi-transparent.
775
+ const pairedBg = paired.a < 1 ? alphaComposite(paired.rgb, paired.a, lightBgPrimary) : paired.rgb;
776
+ // compositedOn: fg composites onto a different surface, contrast still vs pairedBg.
777
+ let compositeSurface = pairedBg;
778
+ if (checkConfig.compositedOn) {
779
+ const overrideSurface = resolvePairedSurface(checkConfig.compositedOn, tokenMap, fixedSurfaces);
780
+ if (overrideSurface) {
781
+ compositeSurface =
782
+ overrideSurface.a < 1
783
+ ? alphaComposite(overrideSurface.rgb, overrideSurface.a, lightBgPrimary)
784
+ : overrideSurface.rgb;
785
+ }
786
+ }
787
+ const fg = alpha < 1 ? alphaComposite(rgb, alpha, compositeSurface) : rgb;
788
+ return getContrastRatio(fg, pairedBg);
789
+ };
790
+ if (contrastAt(1) < threshold) {
791
+ return undefined;
792
+ }
793
+ let lo = currentAlpha;
794
+ let hi = 1;
795
+ for (let i = 0; i < ColorSearchEngine.ALPHA_ASCENT_ITERATIONS; i++) {
796
+ const mid = (lo + hi) / 2;
797
+ if (contrastAt(mid) >= threshold) {
798
+ hi = mid;
799
+ }
800
+ else {
801
+ lo = mid;
802
+ }
803
+ }
804
+ return Math.min(1, Math.ceil(hi * 100) / 100);
805
+ }
806
+ /**
807
+ * Find the closest opaque RGB (by OKLab ΔE) satisfying WCAG threshold against all configs.
808
+ *
809
+ * @param {RgbColor} originalRgb - Starting RGB color.
810
+ * @param {TokenCheckConfig[]} configs - Token check configs (one per paired surface).
811
+ * @param {Map<string, string>} tokenMap - Resolved token map for surface lookups.
812
+ * @returns {RgbColor | undefined} Closest feasible RGB, or `undefined` if none found.
813
+ */
814
+ findRgbPatchForContrastAll(originalRgb, configs, tokenMap) {
815
+ // Pre-resolve surfaces for the feasibility predicate.
816
+ const surfaces = [];
817
+ for (const config of configs) {
818
+ const paired = resolvePairedSurface(config.pairedWith, tokenMap, this.fixedSurfaces);
819
+ if (!paired)
820
+ continue;
821
+ const pairedBg = paired.a < 1 ? alphaComposite(paired.rgb, paired.a, this.lightBgPrimary) : paired.rgb;
822
+ surfaces.push({ bg: pairedBg, threshold: requiredRatioFor(config.type), type: config.type, paired });
823
+ }
824
+ if (surfaces.length === 0) {
825
+ return undefined;
826
+ }
827
+ /**
828
+ * Check if a candidate RGB satisfies all surface constraints.
829
+ *
830
+ * @param {RgbColor} rgb - Candidate RGB color.
831
+ * @returns {boolean} True if all constraints are satisfied.
832
+ */
833
+ const isFeasible = (rgb) => surfaces.every((s) => s.type === 'bg-text'
834
+ ? getContrastRatio(effectiveFgRgb(s.paired, rgb), rgb) >= s.threshold
835
+ : getContrastRatio(rgb, s.bg) >= s.threshold);
836
+ return this.searchClosestFeasibleInOklch(originalRgb, isFeasible, false);
837
+ }
838
+ }
839
+ /** Binary-search iterations on L axis; 10 → ~0.001 precision. */
840
+ ColorSearchEngine.SUGGESTION_SEARCH_ITERATIONS = 10;
841
+ /** Hue offsets (degrees) sampled during search; ±5° preserves brand hue family. */
842
+ ColorSearchEngine.SUGGESTION_HUE_OFFSETS_DEG = [-5, -2.5, 0, 2.5, 5];
843
+ /** Chroma multipliers sampled during search; allows modest saturation drift. */
844
+ ColorSearchEngine.SUGGESTION_CHROMA_SCALES = [0.6, 0.8, 1.0, 1.2, 1.4];
845
+ /** Chroma below which the origin is treated as achromatic (hue/chroma grid skipped). */
846
+ ColorSearchEngine.ACHROMATIC_CHROMA_EPSILON = 0.001;
847
+ /** Uniform L-axis steps for linear scan; 100 → 0.01 precision, enough for narrow bands. */
848
+ ColorSearchEngine.L_SCAN_STEPS = 100;
849
+ /** 2⁻⁷ ≈ 0.008 precision; matches 2-decimal output rounding. */
850
+ ColorSearchEngine.ALPHA_ASCENT_ITERATIONS = 7;
851
+
852
+ // ╔════════════════════════════════════════════════════════════════════════════╗
853
+ // ║ AUTO-GENERATED FILE — DO NOT EDIT BY HAND. ║
854
+ // ║ Source: vega-color-token-contrast-checker/src/generator/ ║
855
+ // ║ Run `yarn prepare:a11y-checks` to regenerate. ║
856
+ // ╚════════════════════════════════════════════════════════════════════════════╝
857
+ const ACTION_COLOR_CHECKS = [
858
+ // consumed by: vega-progress-tracker, vega-time-picker
859
+ {
860
+ tokenName: 'bg-action',
861
+ pairedWith: 'text-inverted-primary',
862
+ type: 'bg-text',
863
+ },
864
+ // consumed by: vega-button, vega-button-circle, vega-calendar, vega-carousel, vega-checkbox, vega-counter-badge, vega-date-picker, vega-progress-tracker, vega-radio, vega-toggle-switch
865
+ {
866
+ tokenName: 'bg-action',
867
+ pairedWith: 'text-on-action',
868
+ type: 'bg-text',
869
+ },
870
+ // consumed by: vega-progress-tracker
871
+ {
872
+ tokenName: 'bg-action-active',
873
+ pairedWith: 'text-inverted-primary',
874
+ type: 'bg-text',
875
+ },
876
+ // consumed by: vega-button, vega-button-circle, vega-calendar, vega-checkbox, vega-date-picker, vega-radio
877
+ {
878
+ tokenName: 'bg-action-active',
879
+ pairedWith: 'text-on-action',
880
+ type: 'bg-text',
881
+ },
882
+ // consumed by: vega-date-picker
883
+ {
884
+ tokenName: 'bg-action-focus',
885
+ pairedWith: 'text-on-action',
886
+ type: 'bg-text',
887
+ },
888
+ // consumed by: vega-progress-tracker
889
+ {
890
+ tokenName: 'bg-action-hover',
891
+ pairedWith: 'text-inverted-primary',
892
+ type: 'bg-text',
893
+ },
894
+ // consumed by: vega-button, vega-button-circle, vega-calendar, vega-checkbox, vega-date-picker, vega-radio, vega-toggle-switch
895
+ {
896
+ tokenName: 'bg-action-hover',
897
+ pairedWith: 'text-on-action',
898
+ type: 'bg-text',
899
+ },
900
+ // consumed by: vega-button, vega-button-circle, vega-button-link
901
+ {
902
+ tokenName: 'bg-action-secondary-active',
903
+ pairedWith: 'text-link-active',
904
+ type: 'bg-text',
905
+ },
906
+ // consumed by: vega-calendar
907
+ {
908
+ tokenName: 'bg-action-secondary-active',
909
+ pairedWith: 'text-primary',
910
+ type: 'bg-text',
911
+ },
912
+ // consumed by: vega-calendar
913
+ {
914
+ tokenName: 'bg-action-secondary-active',
915
+ pairedWith: 'text-secondary',
916
+ type: 'bg-text',
917
+ },
918
+ // consumed by: vega-button, vega-button-circle, vega-button-link
919
+ {
920
+ tokenName: 'bg-action-secondary-hover',
921
+ pairedWith: 'text-link-hover',
922
+ type: 'bg-text',
923
+ },
924
+ // consumed by: vega-calendar
925
+ {
926
+ tokenName: 'bg-action-secondary-hover',
927
+ pairedWith: 'text-primary',
928
+ type: 'bg-text',
929
+ },
930
+ // consumed by: vega-calendar
931
+ {
932
+ tokenName: 'bg-action-secondary-hover',
933
+ pairedWith: 'text-secondary',
934
+ type: 'bg-text',
935
+ },
936
+ // consumed by: vega-date-picker
937
+ {
938
+ tokenName: 'bg-date-picker-range',
939
+ pairedWith: 'text-primary',
940
+ type: 'bg-text',
941
+ },
942
+ // consumed by: vega-nav
943
+ {
944
+ tokenName: 'bg-selected',
945
+ pairedWith: 'text-primary',
946
+ type: 'bg-text',
947
+ },
948
+ // consumed by: vega-table
949
+ {
950
+ tokenName: 'bg-table-selected-row',
951
+ pairedWith: 'text-primary',
952
+ type: 'bg-text',
953
+ },
954
+ // consumed by: vega-app-footer, vega-date-picker, vega-divider, vega-dropdown, vega-nav, vega-tab-group, vega-table, vega-time-picker
955
+ {
956
+ tokenName: 'bg-divider',
957
+ pairedWith: 'bg-primary',
958
+ type: 'non-text-contrast',
959
+ },
960
+ // consumed by: vega-button, vega-button-circle
961
+ {
962
+ tokenName: 'border-color-action',
963
+ pairedWith: 'bg-action-secondary',
964
+ type: 'non-text-contrast',
965
+ },
966
+ // consumed by: vega-button, vega-button-circle, vega-calendar
967
+ {
968
+ tokenName: 'border-color-action',
969
+ pairedWith: 'bg-action-secondary-active',
970
+ type: 'non-text-contrast',
971
+ },
972
+ // consumed by: vega-button, vega-button-circle, vega-calendar
973
+ {
974
+ tokenName: 'border-color-action',
975
+ pairedWith: 'bg-action-secondary-hover',
976
+ type: 'non-text-contrast',
977
+ },
978
+ // consumed by: vega-progress-tracker
979
+ {
980
+ tokenName: 'border-color-action',
981
+ pairedWith: 'bg-action-tertiary',
982
+ type: 'non-text-contrast',
983
+ },
984
+ // consumed by: vega-button-circle
985
+ {
986
+ tokenName: 'border-color-action',
987
+ pairedWith: 'bg-action-tertiary-active',
988
+ type: 'non-text-contrast',
989
+ },
990
+ // consumed by: vega-button-circle
991
+ {
992
+ tokenName: 'border-color-action',
993
+ pairedWith: 'bg-action-tertiary-hover',
994
+ type: 'non-text-contrast',
995
+ },
996
+ // consumed by: vega-chip
997
+ {
998
+ tokenName: 'border-color-action',
999
+ pairedWith: 'bg-chip-active',
1000
+ type: 'non-text-contrast',
1001
+ },
1002
+ // consumed by: vega-chip
1003
+ {
1004
+ tokenName: 'border-color-action',
1005
+ pairedWith: 'bg-chip-hover',
1006
+ type: 'non-text-contrast',
1007
+ },
1008
+ // consumed by: vega-app-footer, vega-app-header-button, vega-button, vega-button-circle, vega-button-group, vega-button-link, vega-calendar, vega-carousel, vega-checkbox, vega-chip, vega-code-block, vega-color-picker, vega-color-swatch, vega-combo-box, vega-date-picker, vega-dropdown, vega-file-uploader, vega-image-uploader, vega-input, vega-input-range, vega-input-select, vega-nav, vega-pagination, vega-progress-tracker, vega-radio, vega-rich-text-content, vega-rich-text-editor, vega-segment-control, vega-selection-chip, vega-selection-tile, vega-signature-capture, vega-tab-group, vega-textarea, vega-time-picker, vega-toggle-switch
1009
+ {
1010
+ tokenName: 'border-color-action',
1011
+ pairedWith: 'bg-primary',
1012
+ type: 'non-text-contrast',
1013
+ },
1014
+ // consumed by: vega-app-header-button, vega-carousel, vega-rich-text-editor
1015
+ {
1016
+ tokenName: 'border-color-action',
1017
+ pairedWith: 'bg-quaternary',
1018
+ type: 'non-text-contrast',
1019
+ },
1020
+ // consumed by: vega-file-uploader, vega-image-uploader
1021
+ {
1022
+ tokenName: 'border-color-action',
1023
+ pairedWith: 'bg-secondary',
1024
+ type: 'non-text-contrast',
1025
+ },
1026
+ // consumed by: vega-segment-control
1027
+ {
1028
+ tokenName: 'border-color-action',
1029
+ pairedWith: 'bg-segment-control',
1030
+ type: 'non-text-contrast',
1031
+ },
1032
+ // consumed by: vega-segment-control
1033
+ {
1034
+ tokenName: 'border-color-action',
1035
+ pairedWith: 'bg-segment-hover',
1036
+ type: 'non-text-contrast',
1037
+ },
1038
+ // consumed by: vega-nav
1039
+ {
1040
+ tokenName: 'border-color-action',
1041
+ pairedWith: 'bg-selected',
1042
+ type: 'non-text-contrast',
1043
+ },
1044
+ // consumed by: vega-app-header-button, vega-image-uploader, vega-nav
1045
+ {
1046
+ tokenName: 'border-color-action',
1047
+ pairedWith: 'bg-tertiary',
1048
+ type: 'non-text-contrast',
1049
+ },
1050
+ // consumed by: vega-selection-chip, vega-selection-tile
1051
+ {
1052
+ tokenName: 'border-color-action',
1053
+ pairedWith: 'bg-tile',
1054
+ type: 'non-text-contrast',
1055
+ },
1056
+ // consumed by: vega-selection-chip, vega-selection-tile
1057
+ {
1058
+ tokenName: 'border-color-action',
1059
+ pairedWith: 'bg-tile-selected',
1060
+ type: 'non-text-contrast',
1061
+ },
1062
+ // consumed by: vega-toggle-switch
1063
+ {
1064
+ tokenName: 'border-color-action',
1065
+ pairedWith: 'bg-toggle-switch',
1066
+ type: 'non-text-contrast',
1067
+ },
1068
+ // consumed by: vega-toggle-switch
1069
+ {
1070
+ tokenName: 'border-color-action',
1071
+ pairedWith: 'bg-toggle-switch-hover',
1072
+ type: 'non-text-contrast',
1073
+ },
1074
+ // consumed by: vega-progress-tracker
1075
+ {
1076
+ tokenName: 'border-color-action-active',
1077
+ pairedWith: 'bg-action-tertiary',
1078
+ type: 'non-text-contrast',
1079
+ },
1080
+ // consumed by: vega-checkbox, vega-file-uploader, vega-progress-tracker, vega-radio
1081
+ {
1082
+ tokenName: 'border-color-action-active',
1083
+ pairedWith: 'bg-primary',
1084
+ type: 'non-text-contrast',
1085
+ },
1086
+ // consumed by: vega-file-uploader
1087
+ {
1088
+ tokenName: 'border-color-action-active',
1089
+ pairedWith: 'bg-secondary',
1090
+ type: 'non-text-contrast',
1091
+ },
1092
+ // consumed by: vega-progress-tracker
1093
+ {
1094
+ tokenName: 'border-color-action-hover',
1095
+ pairedWith: 'bg-action-tertiary',
1096
+ type: 'non-text-contrast',
1097
+ },
1098
+ // consumed by: vega-progress-tracker
1099
+ {
1100
+ tokenName: 'border-color-action-hover',
1101
+ pairedWith: 'bg-primary',
1102
+ type: 'non-text-contrast',
1103
+ },
1104
+ // consumed by: vega-calendar, vega-date-picker, vega-table, vega-time-picker
1105
+ {
1106
+ tokenName: 'border-color-divider',
1107
+ pairedWith: 'bg-primary',
1108
+ type: 'non-text-contrast',
1109
+ },
1110
+ // consumed by: vega-table
1111
+ {
1112
+ tokenName: 'border-color-divider',
1113
+ pairedWith: 'bg-quaternary',
1114
+ type: 'non-text-contrast',
1115
+ },
1116
+ // consumed by: vega-table
1117
+ {
1118
+ tokenName: 'border-color-divider',
1119
+ pairedWith: 'bg-secondary',
1120
+ type: 'non-text-contrast',
1121
+ },
1122
+ // consumed by: vega-table
1123
+ {
1124
+ tokenName: 'border-color-divider',
1125
+ pairedWith: 'bg-table-header',
1126
+ type: 'non-text-contrast',
1127
+ },
1128
+ // consumed by: vega-table
1129
+ {
1130
+ tokenName: 'border-color-divider',
1131
+ pairedWith: 'bg-table-selected-row',
1132
+ type: 'non-text-contrast',
1133
+ },
1134
+ // consumed by: vega-button-group
1135
+ {
1136
+ tokenName: 'border-color-divider-secondary',
1137
+ pairedWith: 'bg-primary',
1138
+ type: 'non-text-contrast',
1139
+ },
1140
+ // consumed by: vega-image-uploader, vega-input-range, vega-table
1141
+ {
1142
+ tokenName: 'border-color-input-field',
1143
+ pairedWith: 'bg-primary',
1144
+ type: 'non-text-contrast',
1145
+ },
1146
+ // consumed by: vega-table
1147
+ {
1148
+ tokenName: 'border-color-input-field',
1149
+ pairedWith: 'bg-quaternary',
1150
+ type: 'non-text-contrast',
1151
+ },
1152
+ // consumed by: vega-table
1153
+ {
1154
+ tokenName: 'border-color-input-field',
1155
+ pairedWith: 'bg-secondary',
1156
+ type: 'non-text-contrast',
1157
+ },
1158
+ // consumed by: vega-table
1159
+ {
1160
+ tokenName: 'border-color-input-field',
1161
+ pairedWith: 'bg-table-selected-row',
1162
+ type: 'non-text-contrast',
1163
+ },
1164
+ // consumed by: vega-image-uploader
1165
+ {
1166
+ tokenName: 'border-color-input-field',
1167
+ pairedWith: 'bg-tertiary',
1168
+ type: 'non-text-contrast',
1169
+ },
1170
+ // consumed by: vega-app-header-button, vega-color-picker, vega-date-picker, vega-image-uploader, vega-input, vega-input-range, vega-input-select, vega-rich-text-content, vega-rich-text-editor, vega-signature-capture, vega-textarea, vega-time-picker
1171
+ {
1172
+ tokenName: 'border-color-input-field-focus',
1173
+ pairedWith: 'bg-primary',
1174
+ type: 'non-text-contrast',
1175
+ },
1176
+ // consumed by: vega-app-header-button
1177
+ {
1178
+ tokenName: 'border-color-input-field-focus',
1179
+ pairedWith: 'bg-quaternary',
1180
+ type: 'non-text-contrast',
1181
+ },
1182
+ // consumed by: vega-image-uploader
1183
+ {
1184
+ tokenName: 'border-color-input-field-focus',
1185
+ pairedWith: 'bg-secondary',
1186
+ type: 'non-text-contrast',
1187
+ },
1188
+ // consumed by: vega-image-uploader
1189
+ {
1190
+ tokenName: 'border-color-input-field-focus',
1191
+ pairedWith: 'bg-tertiary',
1192
+ type: 'non-text-contrast',
1193
+ },
1194
+ // consumed by: vega-file-uploader, vega-image-uploader
1195
+ {
1196
+ tokenName: 'border-color-input-field-hover',
1197
+ pairedWith: 'bg-primary',
1198
+ type: 'non-text-contrast',
1199
+ },
1200
+ // consumed by: vega-file-uploader, vega-image-uploader
1201
+ {
1202
+ tokenName: 'border-color-input-field-hover',
1203
+ pairedWith: 'bg-secondary',
1204
+ type: 'non-text-contrast',
1205
+ },
1206
+ // consumed by: vega-rich-text-editor
1207
+ {
1208
+ tokenName: 'border-color-tile-selected',
1209
+ pairedWith: 'bg-primary',
1210
+ type: 'non-text-contrast',
1211
+ },
1212
+ // consumed by: vega-calendar
1213
+ {
1214
+ tokenName: 'border-divider',
1215
+ pairedWith: 'bg-primary',
1216
+ type: 'non-text-contrast',
1217
+ },
1218
+ // consumed by: vega-calendar, vega-card, vega-code-block
1219
+ {
1220
+ tokenName: 'border-divider-secondary',
1221
+ pairedWith: 'bg-primary',
1222
+ type: 'non-text-contrast',
1223
+ },
1224
+ // consumed by: vega-code-block
1225
+ {
1226
+ tokenName: 'border-divider-secondary',
1227
+ pairedWith: 'bg-secondary',
1228
+ type: 'non-text-contrast',
1229
+ },
1230
+ // consumed by: vega-checkbox, vega-color-picker, vega-combo-box, vega-date-picker, vega-dropdown, vega-input, vega-input-range, vega-input-select, vega-popover, vega-radio, vega-rich-text-editor, vega-selection-tile, vega-signature-capture, vega-textarea, vega-time-picker
1231
+ {
1232
+ tokenName: 'border-input-field',
1233
+ pairedWith: 'bg-primary',
1234
+ type: 'non-text-contrast',
1235
+ },
1236
+ // consumed by: vega-selection-tile
1237
+ {
1238
+ tokenName: 'border-input-field',
1239
+ pairedWith: 'bg-tile',
1240
+ type: 'non-text-contrast',
1241
+ },
1242
+ // consumed by: vega-combo-box, vega-rich-text-editor, vega-selection-tile, vega-signature-capture, vega-textarea
1243
+ {
1244
+ tokenName: 'border-input-field-focus',
1245
+ pairedWith: 'bg-primary',
1246
+ type: 'non-text-contrast',
1247
+ },
1248
+ // consumed by: vega-rich-text-editor
1249
+ {
1250
+ tokenName: 'border-input-field-focus',
1251
+ pairedWith: 'bg-quaternary',
1252
+ type: 'non-text-contrast',
1253
+ },
1254
+ // consumed by: vega-selection-tile
1255
+ {
1256
+ tokenName: 'border-input-field-focus',
1257
+ pairedWith: 'bg-tile',
1258
+ type: 'non-text-contrast',
1259
+ },
1260
+ // consumed by: vega-date-picker
1261
+ {
1262
+ tokenName: 'border-input-field-hover',
1263
+ pairedWith: 'bg-date-picker-range',
1264
+ type: 'non-text-contrast',
1265
+ },
1266
+ // consumed by: vega-checkbox, vega-color-swatch, vega-combo-box, vega-date-picker, vega-input, vega-input-range, vega-input-select, vega-radio, vega-rich-text-editor, vega-selection-tile, vega-signature-capture, vega-textarea, vega-time-picker
1267
+ {
1268
+ tokenName: 'border-input-field-hover',
1269
+ pairedWith: 'bg-primary',
1270
+ type: 'non-text-contrast',
1271
+ },
1272
+ // consumed by: vega-rich-text-editor
1273
+ {
1274
+ tokenName: 'border-input-field-hover',
1275
+ pairedWith: 'bg-quaternary',
1276
+ type: 'non-text-contrast',
1277
+ },
1278
+ // consumed by: vega-selection-tile
1279
+ {
1280
+ tokenName: 'border-input-field-hover',
1281
+ pairedWith: 'bg-tile-hover',
1282
+ type: 'non-text-contrast',
1283
+ },
1284
+ // consumed by: vega-button, vega-button-circle, vega-button-link
1285
+ {
1286
+ tokenName: 'border-secondary-btn',
1287
+ pairedWith: 'bg-action-secondary',
1288
+ type: 'non-text-contrast',
1289
+ },
1290
+ // consumed by: vega-button-link
1291
+ {
1292
+ tokenName: 'border-secondary-btn',
1293
+ pairedWith: 'bg-action-secondary-hover',
1294
+ type: 'non-text-contrast',
1295
+ },
1296
+ // consumed by: vega-date-picker
1297
+ {
1298
+ tokenName: 'border-secondary-btn',
1299
+ pairedWith: 'bg-date-picker-range',
1300
+ type: 'non-text-contrast',
1301
+ },
1302
+ // consumed by: vega-button, vega-button-circle, vega-button-link, vega-carousel, vega-date-picker, vega-dropdown
1303
+ {
1304
+ tokenName: 'border-secondary-btn',
1305
+ pairedWith: 'bg-primary',
1306
+ type: 'non-text-contrast',
1307
+ },
1308
+ // consumed by: vega-carousel, vega-dropdown
1309
+ {
1310
+ tokenName: 'border-secondary-btn',
1311
+ pairedWith: 'bg-quaternary',
1312
+ type: 'non-text-contrast',
1313
+ },
1314
+ // consumed by: vega-button, vega-button-circle, vega-button-link
1315
+ {
1316
+ tokenName: 'border-secondary-btn-active',
1317
+ pairedWith: 'bg-action-secondary-active',
1318
+ type: 'non-text-contrast',
1319
+ },
1320
+ // consumed by: vega-button, vega-button-circle, vega-button-link
1321
+ {
1322
+ tokenName: 'border-secondary-btn-active',
1323
+ pairedWith: 'bg-primary',
1324
+ type: 'non-text-contrast',
1325
+ },
1326
+ // consumed by: vega-button, vega-button-circle, vega-button-link
1327
+ {
1328
+ tokenName: 'border-secondary-btn-hover',
1329
+ pairedWith: 'bg-action-secondary-hover',
1330
+ type: 'non-text-contrast',
1331
+ },
1332
+ // consumed by: vega-button, vega-button-circle, vega-button-link, vega-carousel
1333
+ {
1334
+ tokenName: 'border-secondary-btn-hover',
1335
+ pairedWith: 'bg-primary',
1336
+ type: 'non-text-contrast',
1337
+ },
1338
+ // consumed by: vega-carousel
1339
+ {
1340
+ tokenName: 'border-secondary-btn-hover',
1341
+ pairedWith: 'bg-quaternary',
1342
+ type: 'non-text-contrast',
1343
+ },
1344
+ // consumed by: vega-selection-chip
1345
+ {
1346
+ tokenName: 'border-tile-focus',
1347
+ pairedWith: 'bg-primary',
1348
+ type: 'non-text-contrast',
1349
+ },
1350
+ // consumed by: vega-selection-chip
1351
+ {
1352
+ tokenName: 'border-tile-focus',
1353
+ pairedWith: 'bg-tile',
1354
+ type: 'non-text-contrast',
1355
+ },
1356
+ // consumed by: vega-selection-chip, vega-selection-tile
1357
+ {
1358
+ tokenName: 'border-tile-selected',
1359
+ pairedWith: 'bg-primary',
1360
+ type: 'non-text-contrast',
1361
+ },
1362
+ // consumed by: vega-selection-chip, vega-selection-tile
1363
+ {
1364
+ tokenName: 'border-tile-selected',
1365
+ pairedWith: 'bg-tile-selected',
1366
+ type: 'non-text-contrast',
1367
+ },
1368
+ // consumed by: vega-selection-chip
1369
+ {
1370
+ tokenName: 'border-tile-selected-focus',
1371
+ pairedWith: 'bg-primary',
1372
+ type: 'non-text-contrast',
1373
+ },
1374
+ // consumed by: vega-selection-chip
1375
+ {
1376
+ tokenName: 'border-tile-selected-focus',
1377
+ pairedWith: 'bg-tile-selected',
1378
+ type: 'non-text-contrast',
1379
+ },
1380
+ // consumed by: vega-selection-chip, vega-selection-tile
1381
+ {
1382
+ tokenName: 'border-tile-selected-hover',
1383
+ pairedWith: 'bg-primary',
1384
+ type: 'non-text-contrast',
1385
+ },
1386
+ // consumed by: vega-selection-chip, vega-selection-tile
1387
+ {
1388
+ tokenName: 'border-tile-selected-hover',
1389
+ pairedWith: 'bg-tile-selected-hover',
1390
+ type: 'non-text-contrast',
1391
+ },
1392
+ // consumed by: vega-progress-tracker
1393
+ {
1394
+ tokenName: 'ring-input-focus',
1395
+ pairedWith: 'bg-action',
1396
+ type: 'non-text-contrast',
1397
+ compositedOn: 'bg-primary',
1398
+ },
1399
+ // consumed by: vega-color-picker, vega-progress-tracker
1400
+ {
1401
+ tokenName: 'ring-input-focus',
1402
+ pairedWith: 'bg-primary',
1403
+ type: 'non-text-contrast',
1404
+ },
1405
+ // consumed by: vega-button, vega-button-circle, vega-button-link
1406
+ {
1407
+ tokenName: 'text-link',
1408
+ pairedWith: 'bg-action-secondary',
1409
+ type: 'text-bg',
1410
+ },
1411
+ // consumed by: vega-progress-tracker
1412
+ {
1413
+ tokenName: 'text-link',
1414
+ pairedWith: 'bg-action-tertiary',
1415
+ type: 'text-bg',
1416
+ },
1417
+ // consumed by: vega-app-footer, vega-breadcrumb, vega-button-group, vega-button-link, vega-calendar, vega-date-picker, vega-dropdown, vega-input-select, vega-item-toggle, vega-pagination, vega-rich-text-content, vega-tab-group
1418
+ {
1419
+ tokenName: 'text-link',
1420
+ pairedWith: 'bg-primary',
1421
+ type: 'text-bg',
1422
+ },
1423
+ // consumed by: vega-app-header-button, vega-dropdown
1424
+ {
1425
+ tokenName: 'text-link',
1426
+ pairedWith: 'bg-quaternary',
1427
+ type: 'text-bg',
1428
+ },
1429
+ // consumed by: vega-image-uploader
1430
+ {
1431
+ tokenName: 'text-link',
1432
+ pairedWith: 'bg-secondary',
1433
+ type: 'text-bg',
1434
+ },
1435
+ // consumed by: vega-image-uploader
1436
+ {
1437
+ tokenName: 'text-link',
1438
+ pairedWith: 'bg-tertiary',
1439
+ type: 'text-bg',
1440
+ },
1441
+ // consumed by: vega-progress-tracker
1442
+ {
1443
+ tokenName: 'text-link-active',
1444
+ pairedWith: 'bg-action-tertiary',
1445
+ type: 'text-bg',
1446
+ },
1447
+ // consumed by: vega-app-footer, vega-button-link, vega-rich-text-content
1448
+ {
1449
+ tokenName: 'text-link-active',
1450
+ pairedWith: 'bg-primary',
1451
+ type: 'text-bg',
1452
+ },
1453
+ // consumed by: vega-app-header-button
1454
+ {
1455
+ tokenName: 'text-link-active',
1456
+ pairedWith: 'bg-quaternary',
1457
+ type: 'text-bg',
1458
+ },
1459
+ // consumed by: vega-file-uploader
1460
+ {
1461
+ tokenName: 'text-link-active',
1462
+ pairedWith: 'bg-secondary',
1463
+ type: 'text-bg',
1464
+ },
1465
+ // consumed by: vega-app-footer, vega-button-link, vega-rich-text-content
1466
+ {
1467
+ tokenName: 'text-link-focus',
1468
+ pairedWith: 'bg-primary',
1469
+ type: 'text-bg',
1470
+ },
1471
+ // consumed by: vega-progress-tracker
1472
+ {
1473
+ tokenName: 'text-link-hover',
1474
+ pairedWith: 'bg-action-tertiary',
1475
+ type: 'text-bg',
1476
+ },
1477
+ // consumed by: vega-app-footer, vega-button-link, vega-dropdown, vega-item-toggle, vega-rich-text-content
1478
+ {
1479
+ tokenName: 'text-link-hover',
1480
+ pairedWith: 'bg-primary',
1481
+ type: 'text-bg',
1482
+ },
1483
+ // consumed by: vega-app-header-button, vega-dropdown
1484
+ {
1485
+ tokenName: 'text-link-hover',
1486
+ pairedWith: 'bg-quaternary',
1487
+ type: 'text-bg',
1488
+ },
1489
+ // consumed by: vega-file-uploader, vega-image-uploader
1490
+ {
1491
+ tokenName: 'text-link-hover',
1492
+ pairedWith: 'bg-secondary',
1493
+ type: 'text-bg',
1494
+ },
1495
+ // consumed by: vega-button-link
1496
+ {
1497
+ tokenName: 'text-link-visited',
1498
+ pairedWith: 'bg-action-secondary',
1499
+ type: 'text-bg',
1500
+ },
1501
+ // consumed by: vega-app-footer, vega-button-link, vega-chip, vega-rich-text-content
1502
+ {
1503
+ tokenName: 'text-link-visited',
1504
+ pairedWith: 'bg-primary',
1505
+ type: 'text-bg',
1506
+ },
1507
+ ];
1508
+
1509
+ /**
1510
+ * WCAG 2.1 AA contrast checker for `actionColor`-driven theme overrides. Combines
1511
+ * the static token-pair catalogue (generated at build time) with consumer-supplied
1512
+ * design-token values and an override-themes generator, and exposes a single
1513
+ * pre-bound instance ready for `validate(input)` / `computeContrastCapPatches(input)`.
1514
+ *
1515
+ * Stateless against per-call inputs; holds a process-lifetime fixability cache keyed
1516
+ * by `(tokenName, pairedWith, compositedOn)` — that property depends only on the
1517
+ * catalogue and the override formulas, not on the user's input, so it can be probed
1518
+ * once.
1519
+ *
1520
+ * @template TInput Shape of the override-color input. In vega-stencil this is
1521
+ * `VegaThemeOverrideColors`; tests can use a stricter or looser shape.
1522
+ */
1523
+ class VegaColorTokenContrastChecker {
1524
+ constructor(deps) {
1525
+ this.fixabilityCache = null;
1526
+ this.deps = deps;
1527
+ this.fixedSurfaces = buildFixedPairedSurfaces(deps.fixedSurfaceTokens);
1528
+ this.search = new ColorSearchEngine(this.fixedSurfaces);
1529
+ }
1530
+ // ────────────────────────────────────────────────────────────────────────
1531
+ // Public API
1532
+ // ────────────────────────────────────────────────────────────────────────
1533
+ /**
1534
+ * Build the resolved token map for an input by collapsing
1535
+ * {@link CheckerDeps.generateOverrideThemes} into a `Map<tokenName, value>`,
1536
+ * dropping entries with empty values.
1537
+ *
1538
+ * Public so tests can assert on the materialized map and so the wrapper can
1539
+ * re-export it as a convenience helper.
1540
+ *
1541
+ * @param {TInput} input - Override-color payload.
1542
+ * @returns {Map<string, string>} Token name → CSS `r g b / a` value.
1543
+ */
1544
+ buildTokenMap(input) {
1545
+ const themes = this.deps.generateOverrideThemes(input);
1546
+ const map = new Map();
1547
+ for (const entry of themes) {
1548
+ if (entry.value) {
1549
+ map.set(entry.name, entry.value);
1550
+ }
1551
+ }
1552
+ return map;
1553
+ }
1554
+ /**
1555
+ * Validate overrides against WCAG 2.1 AA (light mode).
1556
+ *
1557
+ * @param {TInput} input - Override-color payload to validate.
1558
+ * @returns {ContrastCheckResult} Accessibility result, including failing details and optional patches.
1559
+ */
1560
+ validate(input) {
1561
+ if (!VegaColorTokenContrastChecker.isValidActionColor(input)) {
1562
+ return { isAccessible: false, details: [], invalidInput: true, contrastCapPatches: {} };
1563
+ }
1564
+ const tokenMap = this.buildTokenMap(input);
1565
+ const details = this.collectFailures(tokenMap);
1566
+ const contrastCapPatches = this.computeContrastCapPatches(input);
1567
+ const result = {
1568
+ isAccessible: details.length === 0,
1569
+ details,
1570
+ contrastCapPatches,
1571
+ };
1572
+ const actionColor = input.actionColor;
1573
+ if (actionColor) {
1574
+ result.suggestedActionColor = result.isAccessible
1575
+ ? actionColor
1576
+ : this.findSuggestedActionColor(input, actionColor);
1577
+ }
1578
+ return result;
1579
+ }
1580
+ /**
1581
+ * Produce contrast-cap patches for tokens whose formula caps contrast below threshold.
1582
+ *
1583
+ * Two-tier strategy (minimal impact first):
1584
+ * 1. α-ascent: raise alpha to meet contrast (preserves brand hue).
1585
+ * 2. RGB shift: closest opaque color satisfying ALL surfaces (linear scan).
1586
+ *
1587
+ * @param {TInput} input - Override-color payload (must include `actionColor`).
1588
+ * @returns {Record<string, string>} Map of tokenName → patched CSS value; empty if no repair needed.
1589
+ */
1590
+ computeContrastCapPatches(input) {
1591
+ const patch = {};
1592
+ if (!input.actionColor || !VegaColorTokenContrastChecker.isValidActionColor(input)) {
1593
+ return patch;
1594
+ }
1595
+ const tokenMap = this.buildTokenMap(input);
1596
+ // Group all checks by token; identify tokens needing patch.
1597
+ const allChecksByToken = new Map();
1598
+ const tokensNeedingPatch = new Set();
1599
+ for (const checkConfig of ACTION_COLOR_CHECKS) {
1600
+ const allList = allChecksByToken.get(checkConfig.tokenName);
1601
+ if (allList) {
1602
+ allList.push(checkConfig);
1603
+ }
1604
+ else {
1605
+ allChecksByToken.set(checkConfig.tokenName, [checkConfig]);
1606
+ }
1607
+ if (!this.getFixabilityRecord(checkConfig).fixable) {
1608
+ tokensNeedingPatch.add(checkConfig.tokenName);
1609
+ }
1610
+ }
1611
+ for (const tokenName of tokensNeedingPatch) {
1612
+ const tokenValue = tokenMap.get(tokenName);
1613
+ if (!tokenValue) {
1614
+ continue;
1615
+ }
1616
+ const parsed = parseTokenValue(tokenValue);
1617
+ if (!parsed) {
1618
+ continue;
1619
+ }
1620
+ // All checks as constraints (not just unfixable) to avoid regressing passing checks.
1621
+ // Safe: tokensNeedingPatch is derived from the same ACTION_COLOR_CHECKS loop that populates allChecksByToken.
1622
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1623
+ const allConfigs = allChecksByToken.get(tokenName);
1624
+ // Tier 1: α-ascent — find minimum α satisfying all checks simultaneously.
1625
+ let strictestAlpha;
1626
+ let tierOneFeasible = true;
1627
+ for (const checkConfig of allConfigs) {
1628
+ const threshold = requiredRatioFor(checkConfig.type);
1629
+ const repairedAlpha = this.search.findMinimumAlphaForContrast(parsed.rgb, parsed.a, checkConfig, threshold, tokenMap);
1630
+ if (repairedAlpha === undefined) {
1631
+ tierOneFeasible = false;
1632
+ break;
1633
+ }
1634
+ if (strictestAlpha === undefined || repairedAlpha > strictestAlpha) {
1635
+ strictestAlpha = repairedAlpha;
1636
+ }
1637
+ }
1638
+ if (tierOneFeasible && strictestAlpha !== undefined) {
1639
+ // Verify the max α still satisfies all checks jointly.
1640
+ const candidateValue = formatTokenValue(parsed.rgb, strictestAlpha);
1641
+ if (this.verifyCandidateSatisfiesAll(tokenName, candidateValue, allConfigs, tokenMap)) {
1642
+ patch[tokenName] = candidateValue;
1643
+ continue;
1644
+ }
1645
+ }
1646
+ // Tier 2: RGB shift at α=1, satisfying all surfaces (linear scan).
1647
+ const repairedRgb = this.search.findRgbPatchForContrastAll(parsed.rgb, allConfigs, tokenMap);
1648
+ if (repairedRgb !== undefined) {
1649
+ patch[tokenName] = formatTokenValue(repairedRgb, 1);
1650
+ }
1651
+ }
1652
+ return patch;
1653
+ }
1654
+ /**
1655
+ * Compute contrast for a single check using the supplied token map.
1656
+ *
1657
+ * @param {TokenCheckConfig} check - Check configuration.
1658
+ * @param {Map<string, string>} tokenMap - Resolved token map.
1659
+ * @returns {ContrastResult | null} Contrast result or null when token/surface can't be resolved.
1660
+ */
1661
+ computeTokenContrast(check, tokenMap) {
1662
+ return computeTokenContrast(check, tokenMap, this.fixedSurfaces);
1663
+ }
1664
+ /**
1665
+ * Resolve a `pairedWith` name to a {@link ContextSurface} using this checker's
1666
+ * static surface table.
1667
+ *
1668
+ * @param {string} pairedWith - Token name to resolve.
1669
+ * @param {Map<string, string>} tokenMap - Resolved token map (dynamic lookup wins).
1670
+ * @returns {ContextSurface | undefined} Resolved surface, or undefined.
1671
+ */
1672
+ resolvePairedSurface(pairedWith, tokenMap) {
1673
+ return resolvePairedSurface(pairedWith, tokenMap, this.fixedSurfaces);
1674
+ }
1675
+ /**
1676
+ * Get the per-check fixability record (cached over the process lifetime).
1677
+ *
1678
+ * @param {TokenCheckConfig} config - Check configuration.
1679
+ * @returns {FixabilityRecord} `{ fixable, maxContrast }`.
1680
+ */
1681
+ getFixabilityRecord(config) {
1682
+ var _a;
1683
+ if (!this.fixabilityCache) {
1684
+ this.fixabilityCache = this.buildFixabilityCache();
1685
+ }
1686
+ return ((_a = this.fixabilityCache.get(VegaColorTokenContrastChecker.fixabilityCacheKey(config))) !== null && _a !== void 0 ? _a : {
1687
+ fixable: true,
1688
+ maxContrast: Infinity,
1689
+ });
1690
+ }
1691
+ /**
1692
+ * Collect failing fixable tokens under the supplied token map.
1693
+ *
1694
+ * @param {Map<string, string>} tokenMap - Resolved token map.
1695
+ * @param {boolean} earlyExit - If true, return after first failure.
1696
+ * @returns {ColorContrastDetail[]} Array of failing token detail entries.
1697
+ */
1698
+ collectFailures(tokenMap, earlyExit = false) {
1699
+ const failures = [];
1700
+ for (const checkConfig of ACTION_COLOR_CHECKS) {
1701
+ if (!this.getFixabilityRecord(checkConfig).fixable) {
1702
+ continue;
1703
+ }
1704
+ const computed = this.computeTokenContrast(checkConfig, tokenMap);
1705
+ if (!computed) {
1706
+ continue;
1707
+ }
1708
+ const threshold = requiredRatioFor(checkConfig.type);
1709
+ if (computed.contrastRatio >= threshold) {
1710
+ continue;
1711
+ }
1712
+ failures.push({
1713
+ tokenName: checkConfig.tokenName,
1714
+ contrastRatio: computed.contrastRatio,
1715
+ requiredRatio: threshold,
1716
+ });
1717
+ if (earlyExit) {
1718
+ return failures;
1719
+ }
1720
+ }
1721
+ return failures;
1722
+ }
1723
+ /**
1724
+ * Fast check: all fixable tokens pass contrast under the supplied token map.
1725
+ *
1726
+ * @param {Map<string, string>} tokenMap - Resolved token map.
1727
+ * @returns {boolean} True if all fixable tokens pass.
1728
+ */
1729
+ isAccessible(tokenMap) {
1730
+ return this.collectFailures(tokenMap, true).length === 0;
1731
+ }
1732
+ // ────────────────────────────────────────────────────────────────────────
1733
+ // Private helpers
1734
+ // ────────────────────────────────────────────────────────────────────────
1735
+ /** Empty `actionColor` is allowed (means "no override"); when present it must be a valid color. */
1736
+ static isValidActionColor(input) {
1737
+ return !input.actionColor || isValidColor(input.actionColor);
1738
+ }
1739
+ /** Produce a new input with a different `actionColor`, preserving every other field. */
1740
+ withActionColor(input, actionColor) {
1741
+ return Object.assign(Object.assign({}, input), { actionColor });
1742
+ }
1743
+ static fixabilityCacheKey(config) {
1744
+ var _a;
1745
+ return `${config.tokenName}|${config.pairedWith}|${(_a = config.compositedOn) !== null && _a !== void 0 ? _a : ''}`;
1746
+ }
1747
+ buildFixabilityCache() {
1748
+ const cache = new Map();
1749
+ // Probe maps depend only on `actionColor`; synthesize a minimal TInput for each
1750
+ // probe via the `withActionColor` helper applied to an empty object. TInput must
1751
+ // extend ActionColorInput, so the only required structural shape is `actionColor`.
1752
+ const baseInput = {};
1753
+ const probeMaps = VegaColorTokenContrastChecker.FIXABILITY_PROBE_COLORS.map((probe) => this.buildTokenMap(this.withActionColor(baseInput, probe)));
1754
+ for (const check of ACTION_COLOR_CHECKS) {
1755
+ let maxContrast = 0;
1756
+ for (const tokenMap of probeMaps) {
1757
+ const computed = this.computeTokenContrast(check, tokenMap);
1758
+ if (computed && computed.contrastRatio > maxContrast) {
1759
+ maxContrast = computed.contrastRatio;
1760
+ }
1761
+ }
1762
+ const required = requiredRatioFor(check.type);
1763
+ cache.set(VegaColorTokenContrastChecker.fixabilityCacheKey(check), {
1764
+ fixable: maxContrast >= required,
1765
+ maxContrast: Math.round(maxContrast * 100) / 100,
1766
+ });
1767
+ }
1768
+ return cache;
1769
+ }
1770
+ /**
1771
+ * Find the closest accessible actionColor (by OKLab ΔE) within ±5° hue tolerance.
1772
+ *
1773
+ * @param {TInput} input - Current override input.
1774
+ * @param {string} actionColor - Current action color hex (already extracted by validate()).
1775
+ * @returns {string | undefined} Suggested hex, or undefined if none feasible.
1776
+ */
1777
+ findSuggestedActionColor(input, actionColor) {
1778
+ const suggestedRgb = this.search.searchClosestFeasibleInOklch(parseColorToRgb(actionColor), (rgb) => this.isAccessible(this.buildTokenMap(this.withActionColor(input, rgbToHex(rgb)))));
1779
+ return suggestedRgb === undefined ? undefined : rgbToHex(suggestedRgb);
1780
+ }
1781
+ /** Verify a candidate value passes all checks for a token. */
1782
+ verifyCandidateSatisfiesAll(tokenName, candidateValue, allConfigs, tokenMap) {
1783
+ const patchedMap = new Map(tokenMap);
1784
+ patchedMap.set(tokenName, candidateValue);
1785
+ for (const config of allConfigs) {
1786
+ const threshold = requiredRatioFor(config.type);
1787
+ // Route through `this.computeTokenContrast` (not the free function) so test
1788
+ // suites can intercept the verification phase via a spy on the public method.
1789
+ const result = this.computeTokenContrast(config, patchedMap);
1790
+ if (!result || result.contrastRatio < threshold) {
1791
+ return false;
1792
+ }
1793
+ }
1794
+ return true;
1795
+ }
1796
+ }
1797
+ VegaColorTokenContrastChecker.FIXABILITY_PROBE_COLORS = ['#000000', '#808080', '#ffffff'];
1798
+
1799
+ // Thin wrapper around `vega-color-token-contrast-checker/core`. The
1800
+ /**
1801
+ * Process-lifetime singleton: a {@link VegaColorTokenContrastChecker} pre-bound
1802
+ * to vega-stencil's design-token table and override-themes generator. Consumers
1803
+ * call `.validate(overrideColors)` and `.computeContrastCapPatches(overrideColors)`
1804
+ * directly — no per-call configuration needed.
1805
+ */
1806
+ const vegaAccessibilityValidator = new VegaColorTokenContrastChecker({
1807
+ fixedSurfaceTokens: darkModeStyleController.LightModeColorTokens,
1808
+ /**
1809
+ * Generate override theme arrays from the supplied override colors.
1810
+ *
1811
+ * @param {VegaThemeOverrideColors} overrideColors The override colors input.
1812
+ * @returns {ReturnType<typeof VegaColorSchemaOverridingController.generateOverrideThemes>} The override theme arrays.
1813
+ */
1814
+ generateOverrideThemes: (overrideColors) => darkModeStyleController.VegaColorSchemaOverridingController.generateOverrideThemes(overrideColors),
1815
+ });
1816
+
1817
+ exports.vegaAccessibilityValidator = vegaAccessibilityValidator;