@heartlandone/vega 2.75.1 → 2.76.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 (725) hide show
  1. package/dist/cjs/{app-globals-35614ce8.js → app-globals-12b7d808.js} +28 -32
  2. package/dist/cjs/breakpoints-751d433a.js +56 -0
  3. package/dist/cjs/{child-nodes-event-prevent-slimmer-aca87dac.js → child-nodes-event-prevent-slimmer-84435957.js} +2 -2
  4. package/dist/cjs/{child-nodes-notify-observer-slimmer-257fedb3.js → child-nodes-notify-observer-slimmer-ed39283b.js} +1 -1
  5. package/dist/cjs/{code-block-c1d2e6a8.js → code-block-f1480ec3.js} +17 -17
  6. package/dist/cjs/{component-global-style-slimmer-adfa2e59.js → component-global-style-slimmer-93c5fb50.js} +2 -1
  7. package/dist/cjs/{component-usage-runtime-metrics-d10ace87.js → component-usage-runtime-metrics-4572c5b7.js} +1 -1
  8. package/dist/cjs/{component-value-history-controller-slimmer.abstract-787c67dc.js → component-value-history-controller-slimmer.abstract-a9264cc8.js} +5 -5
  9. package/dist/cjs/{create-public-api-runtime-metrics-slimmer-e2e274e1.js → create-public-api-runtime-metrics-slimmer-9cb09fb2.js} +3 -41
  10. package/dist/cjs/{dark-mode-style-controller-c21172aa.js → dark-mode-style-controller-3a04af3d.js} +292 -1254
  11. package/dist/cjs/{date-required-rule-30ee62d0.js → date-required-rule-912469e0.js} +1 -1
  12. package/dist/cjs/{design-token-bb39e07e.js → design-token-41baf118.js} +2 -2
  13. package/dist/cjs/dom-node-subject-observer-factory-c62823de.js +141 -0
  14. package/dist/cjs/{dto-renderer-manager-03e1a038.js → dto-renderer-manager-809c947b.js} +33 -33
  15. package/dist/cjs/{element-appender-slimmer-daa8b9f5.js → element-appender-slimmer-34e4eb56.js} +349 -166
  16. package/dist/cjs/{event-emit-slimmer-2dacabbd.js → event-emit-slimmer-062cdcb8.js} +2 -2
  17. package/dist/cjs/{feature-flag-controller-ce2162c8.js → feature-flag-controller-04cb1e69.js} +7 -1
  18. package/dist/cjs/{form-field-controller-slimmer-aef2fb1e.js → form-field-controller-slimmer-102f37c7.js} +13 -14
  19. package/dist/cjs/{internal-icon-manager-32f9ed63.js → icon-manager-c12c6ea9.js} +1 -52
  20. package/dist/cjs/{image-annotation-action-3fa501b7.js → image-annotation-action-8d9fa20c.js} +10 -9
  21. package/dist/cjs/index-592b4052.js +220 -0
  22. package/dist/cjs/{index-4d7bce1a.js → index-f054eb5d.js} +15 -3
  23. package/dist/cjs/index.cjs.js +68 -65
  24. package/dist/cjs/{inject-keyboard-manager-d21b4387.js → inject-keyboard-manager-0f5bd568.js} +1 -1
  25. package/dist/cjs/internal-icon-manager-c989189a.js +55 -0
  26. package/dist/cjs/{translation-5f9f9c0c.js → internal-translation-controller-053eb0f1.js} +0 -93
  27. package/dist/cjs/{internal-vega-event-manager-6befeb34.js → internal-vega-event-manager-f7ecf3d4.js} +81 -81
  28. package/dist/cjs/internal-vega-z-index-manager-f03ddb37.js +180 -0
  29. package/dist/cjs/{keyboard-manager-3dea6b28.js → keyboard-manager-055e9f67.js} +2 -2
  30. package/dist/cjs/{keyboard-manager-slimmer-0d45f944.js → keyboard-manager-slimmer-0cc0c1c7.js} +1 -1
  31. package/dist/cjs/loader.cjs.js +26 -23
  32. package/dist/cjs/misc-3d30df91.js +41 -0
  33. package/dist/cjs/{month-view-generator-49cc5fc2.js → month-view-generator-6a6dd527.js} +1 -1
  34. package/dist/cjs/{page-resize-observer-slimmer-11937d6f.js → page-resize-observer-slimmer-7f065ee1.js} +2 -54
  35. package/dist/cjs/{public-rules-dc2a8d62.js → public-rules-922849f3.js} +12 -13
  36. package/dist/cjs/{range-79b668e7.js → range-8aa49b08.js} +2 -2
  37. package/dist/cjs/{responsive-format-facade-d5dba942.js → responsive-format-facade-ea59bdcd.js} +13 -22
  38. package/dist/cjs/{rich-text-editor-required-rule-ba312af9.js → rich-text-editor-required-rule-22225840.js} +1 -1
  39. package/dist/cjs/{string-format-strategy.abstract-63514c60.js → string-format-strategy.abstract-f2575647.js} +1 -1
  40. package/dist/cjs/{string-input-formatter-slimmer-f3e0bbc7.js → string-input-formatter-slimmer-0a334fc6.js} +5 -5
  41. package/dist/cjs/{string-mask-strategy-d23ac21a.js → string-mask-strategy-dda58395.js} +2 -2
  42. package/dist/cjs/{style-formatter-49693da7.js → style-formatter-0c3ced39.js} +2 -2
  43. package/dist/cjs/{sub-state-notify-slimmer-468e19aa.js → sub-state-notify-slimmer-58121111.js} +1 -1
  44. package/dist/cjs/{sub-state-observer-slimmer-5d0b8ac3.js → sub-state-observer-slimmer-1dfbc4c3.js} +2 -2
  45. package/dist/cjs/{time-required-rule-c96ecdc9.js → time-required-rule-d6fa7aa8.js} +1 -1
  46. package/dist/cjs/{function-extension-cfbbc57e.js → token-extension-07cac85d.js} +501 -387
  47. package/dist/cjs/{translation-slimmer-f0ebe710.js → translation-slimmer-4533bd67.js} +4 -4
  48. package/dist/cjs/{type-guard-a0f026d8.js → type-guard-407ba0b8.js} +3 -3
  49. package/dist/cjs/{ui-9e181079.js → ui-234ea151.js} +12 -0
  50. package/dist/cjs/{valid-credit-card-number-rule-c854bed9.js → valid-credit-card-number-rule-41a8b51b.js} +1 -1
  51. package/dist/cjs/vega-accordion.cjs.entry.js +21 -30
  52. package/dist/cjs/vega-app-footer.cjs.entry.js +3 -3
  53. package/dist/cjs/vega-app-header-button.cjs.entry.js +183 -49
  54. package/dist/cjs/vega-backdrop.cjs.entry.js +2 -2
  55. package/dist/cjs/vega-banner.cjs.entry.js +15 -13
  56. package/dist/cjs/vega-bar-chart.cjs.entry.js +1 -1
  57. package/dist/cjs/vega-box.cjs.entry.js +18 -33
  58. package/dist/cjs/vega-brand-logo.cjs.entry.js +7 -5
  59. package/dist/cjs/vega-breadcrumb.cjs.entry.js +14 -13
  60. package/dist/cjs/vega-button-circle.cjs.entry.js +20 -30
  61. package/dist/cjs/vega-button-group_2.cjs.entry.js +15 -15
  62. package/dist/cjs/vega-button-link.cjs.entry.js +15 -14
  63. package/dist/cjs/vega-button.cjs.entry.js +21 -30
  64. package/dist/cjs/vega-calendar_4.cjs.entry.js +48 -45
  65. package/dist/cjs/vega-card.cjs.entry.js +9 -28
  66. package/dist/cjs/vega-carousel.cjs.entry.js +15 -26
  67. package/dist/cjs/vega-checkbox_2.cjs.entry.js +22 -20
  68. package/dist/cjs/vega-chip.cjs.entry.js +22 -33
  69. package/dist/cjs/vega-code-block.cjs.entry.js +658 -2709
  70. package/dist/cjs/vega-color-picker.cjs.entry.js +15 -12
  71. package/dist/cjs/vega-combo-box.cjs.entry.js +29 -28
  72. package/dist/cjs/vega-counter-badge.cjs.entry.js +1 -1
  73. package/dist/cjs/vega-date-picker_2.cjs.entry.js +53 -56
  74. package/dist/cjs/vega-dialog-controller-03ef4d9a.js +84 -0
  75. package/dist/cjs/vega-dialog_2.cjs.entry.js +37 -44
  76. package/dist/cjs/vega-divider.cjs.entry.js +12 -30
  77. package/dist/cjs/vega-dropdown_5.cjs.entry.js +49 -55
  78. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  79. package/dist/cjs/{dom-node-subject-observer-factory-b5e71bf6.js → vega-event-id-ee01d8dd.js} +0 -139
  80. package/dist/cjs/vega-field-error.cjs.entry.js +1 -1
  81. package/dist/cjs/vega-field-label.cjs.entry.js +9 -8
  82. package/dist/cjs/vega-file-uploader.cjs.entry.js +28 -23
  83. package/dist/cjs/vega-flag-icon.cjs.entry.js +13 -27
  84. package/dist/cjs/vega-flex.cjs.entry.js +11 -28
  85. package/dist/cjs/vega-font.cjs.entry.js +12 -29
  86. package/dist/cjs/vega-form.cjs.entry.js +24 -22
  87. package/dist/cjs/vega-grid.cjs.entry.js +9 -28
  88. package/dist/cjs/vega-hint.cjs.entry.js +1 -1
  89. package/dist/cjs/vega-icon.cjs.entry.js +18 -31
  90. package/dist/cjs/vega-image-uploader.cjs.entry.js +34 -37
  91. package/dist/cjs/vega-input-credit-card.cjs.entry.js +31 -27
  92. package/dist/cjs/vega-input-numeric.cjs.entry.js +24 -22
  93. package/dist/cjs/vega-input-passcode.cjs.entry.js +26 -24
  94. package/dist/cjs/vega-input-phone-number.cjs.entry.js +31 -35
  95. package/dist/cjs/vega-input-range.cjs.entry.js +22 -20
  96. package/dist/cjs/vega-input-select.cjs.entry.js +41 -46
  97. package/dist/cjs/vega-input.cjs.entry.js +43 -31
  98. package/dist/cjs/vega-item-toggle.cjs.entry.js +8 -7
  99. package/dist/cjs/vega-left-nav_5.cjs.entry.js +38 -40
  100. package/dist/cjs/vega-line-chart.cjs.entry.js +1 -1
  101. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +16 -32
  102. package/dist/cjs/vega-page-notification_2.cjs.entry.js +5 -4
  103. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +12 -12
  104. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +9 -10
  105. package/dist/cjs/vega-pagination.cjs.entry.js +28 -38
  106. package/dist/cjs/vega-pie-chart.cjs.entry.js +1 -1
  107. package/dist/cjs/vega-popover_2.cjs.entry.js +21 -31
  108. package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +66 -39
  109. package/dist/cjs/vega-radio_2.cjs.entry.js +25 -23
  110. package/dist/cjs/vega-rich-text-content.cjs.entry.js +22 -20
  111. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +58 -55
  112. package/dist/cjs/vega-section-title.cjs.entry.js +1 -1
  113. package/dist/cjs/vega-segment-control.cjs.entry.js +10 -8
  114. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +25 -32
  115. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +22 -20
  116. package/dist/cjs/vega-sidenav_3.cjs.entry.js +34 -40
  117. package/dist/cjs/vega-signature-capture.cjs.entry.js +27 -31
  118. package/dist/cjs/vega-skeleton.cjs.entry.js +1 -1
  119. package/dist/cjs/vega-slot-container.cjs.entry.js +1 -1
  120. package/dist/cjs/vega-stepper.cjs.entry.js +23 -21
  121. package/dist/cjs/vega-tab-group_2.cjs.entry.js +15 -14
  122. package/dist/cjs/vega-table_11.cjs.entry.js +67 -68
  123. package/dist/cjs/vega-text.cjs.entry.js +4 -3
  124. package/dist/cjs/vega-textarea.cjs.entry.js +22 -20
  125. package/dist/cjs/vega-time-picker_2.cjs.entry.js +35 -41
  126. package/dist/cjs/vega-toggle-switch.cjs.entry.js +15 -12
  127. package/dist/cjs/vega-tooltip_2.cjs.entry.js +17 -28
  128. package/dist/cjs/vega.cjs.js +26 -23
  129. package/dist/cjs/{index-95fca64f.js → wait-for-component-did-render-70a01bf9.js} +1 -12
  130. package/dist/collection/components/vega-app-header-button/vega-app-header-button.js +17 -2
  131. package/dist/collection/components/vega-box/slimmers/controllers/vega-box-responsive-style-controller.js +2 -1
  132. package/dist/collection/components/vega-box/slimmers/controllers/vega-box-state-styles-controller.js +2 -1
  133. package/dist/collection/components/vega-button/vega-button.js +2 -1
  134. package/dist/collection/components/vega-button-circle/vega-button-circle.js +2 -1
  135. package/dist/collection/components/vega-button-link/vega-button-link.css +1 -1
  136. package/dist/collection/components/vega-button-link/vega-button-link.js +2 -1
  137. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/base-repeat-pattern.js +1 -1
  138. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-daily-repeat-pattern.js +1 -1
  139. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-monthly-repeat-pattern.js +1 -1
  140. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-weekly-repeat-pattern.js +1 -1
  141. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-yearly-repeat-pattern.js +1 -1
  142. package/dist/collection/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.js +5 -14
  143. package/dist/collection/components/vega-combo-box/slimmers/renderers/vega-combo-box-dropdown-renderer.js +2 -2
  144. package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-open-state-controller.js +1 -1
  145. package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.js +1 -1
  146. package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-search-controller.js +2 -2
  147. package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.js +2 -2
  148. package/dist/collection/components/vega-dropdown/vega-dropdown-group/slimmers/renderers/vega-dropdown-group-renderer.js +3 -3
  149. package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.js +6 -4
  150. package/dist/collection/components/vega-icon/vega-icon.js +2 -1
  151. package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-container-renderer.js +10 -2
  152. package/dist/collection/components/vega-input-phone-number/slimmers/renderers/country-select-renderer.js +1 -1
  153. package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +2 -2
  154. package/dist/collection/components/vega-pagination/vega-pagination.js +1 -1
  155. package/dist/collection/components/vega-progress-tracker/slimmers/controllers/dto/internal-progress-tracker-step.js +30 -6
  156. package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-steps-controller.js +1 -1
  157. package/dist/collection/components/vega-progress-tracker/slimmers/renderers/vega-progress-tracker-renderer.js +8 -1
  158. package/dist/collection/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.js +27 -0
  159. package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.css +12 -0
  160. package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +8 -3
  161. package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.js +1 -1
  162. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +1 -1
  163. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +1 -1
  164. package/dist/collection/components/vega-signature-capture/slimmers/written-mode/controllers/written-mode-svg-controller.js +2 -1
  165. package/dist/collection/components/vega-table/interface.js +3 -0
  166. package/dist/collection/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.js +1 -1
  167. package/dist/collection/global/scripts/before-vega-load.js +4 -3
  168. package/dist/collection/helpers/calendar/calendar-date.js +1 -1
  169. package/dist/collection/helpers/calendar/calendar-event.js +1 -1
  170. package/dist/collection/helpers/calendar/calendar-time.js +1 -1
  171. package/dist/collection/helpers/code-format/test/code-formatter.test.js +1 -1
  172. package/dist/collection/helpers/common/index.js +2 -37
  173. package/dist/collection/helpers/common/test/wait-for-vega-handler.test.js +2 -2
  174. package/dist/collection/helpers/common/wait-for-component-did-render.js +27 -0
  175. package/dist/collection/helpers/common/wait-for-vega-handler.js +12 -1
  176. package/dist/collection/helpers/feature-control/feature-flags-map.js +6 -0
  177. package/dist/collection/helpers/formatter/responsive-map-formatter/responsive-border-radius-style-formatter.js +1 -1
  178. package/dist/collection/helpers/public-api.js +0 -2
  179. package/dist/collection/helpers/slimmers/component-global-style-slimmer.js +2 -1
  180. package/dist/collection/helpers/slimmers/field-error-ui-controller-slimmer.js +3 -4
  181. package/dist/collection/helpers/slimmers/form-field-message-translator.js +1 -1
  182. package/dist/collection/helpers/slimmers/global/vega-translate-observer-slimmer.js +1 -1
  183. package/dist/collection/helpers/slimmers/global/vega-watch-method-cancel-slimmer.js +1 -1
  184. package/dist/collection/helpers/slimmers/mutation-observer/aria-attributes-value-mapper.js +128 -0
  185. package/dist/collection/helpers/slimmers/mutation-observer/test/aria-attributes-value-mapper.test.js +196 -0
  186. package/dist/collection/helpers/slimmers/position-calculation/base-position-calculation-strategy.js +162 -151
  187. package/dist/collection/helpers/slimmers/position-calculation/position-calculation-controller.js +9 -0
  188. package/dist/collection/helpers/slimmers/position-calculation/screen-position-calculation-strategy.js +112 -1
  189. package/dist/collection/helpers/slimmers/position-calculation/screen-scroll-position-update.js +53 -0
  190. package/dist/collection/helpers/slimmers/position-calculation/test/screen-position-calculation-strategy.test.js +103 -6
  191. package/dist/collection/helpers/slimmers/string-input-formatter-slimmer.js +1 -1
  192. package/dist/collection/helpers/slimmers/translation/translation-slimmer.js +1 -1
  193. package/dist/collection/helpers/theme/controllers/brand-style-controller.js +3 -1
  194. package/dist/collection/helpers/theme/controllers/color-schema-overriding-controller.js +8 -6
  195. package/dist/collection/helpers/theme/controllers/dark-mode-style-controller.js +3 -1
  196. package/dist/collection/helpers/theme/internal-theme-manager.js +2 -1
  197. package/dist/collection/helpers/theme/tests/theme-manager-controller.test.js +1 -2
  198. package/dist/collection/helpers/ui/element-appender.js +4 -5
  199. package/dist/collection/helpers/ui/test/element-appender.test.js +66 -17
  200. package/dist/collection/index.js +2 -0
  201. package/dist/collection/polyfill/prism/index.js +2 -0
  202. package/dist/collection/polyfill/prism/languages/css.js +86 -0
  203. package/dist/collection/polyfill/prism/languages/javascript.js +96 -0
  204. package/dist/collection/polyfill/prism/languages/jsx.js +46 -0
  205. package/dist/collection/polyfill/prism/languages/language-registry.js +41 -0
  206. package/dist/collection/polyfill/prism/languages/markup.js +71 -0
  207. package/dist/collection/polyfill/prism/languages/tsx.js +10 -0
  208. package/dist/collection/polyfill/prism/languages/typescript.js +64 -0
  209. package/dist/collection/polyfill/prism/test/css.test.js +61 -0
  210. package/dist/collection/polyfill/prism/test/javascript.test.js +113 -0
  211. package/dist/collection/polyfill/prism/test/jsx.test.js +48 -0
  212. package/dist/collection/polyfill/prism/test/language-registry.test.js +77 -0
  213. package/dist/collection/polyfill/prism/test/markup.test.js +57 -0
  214. package/dist/collection/polyfill/prism/test/test-utils.js +22 -0
  215. package/dist/collection/polyfill/prism/test/tokenizer.test.js +180 -0
  216. package/dist/collection/polyfill/prism/test/tsx.test.js +87 -0
  217. package/dist/collection/polyfill/prism/test/typescript.test.js +86 -0
  218. package/dist/collection/polyfill/prism/tokenizer.js +242 -0
  219. package/dist/collection/polyfill/tinycolor/tinycolor-polyfill.js +320 -0
  220. package/dist/collection/polyfill/tinycolor/tinycolor-polyfill.test.js +361 -0
  221. package/dist/collection/types/ui.type.js +12 -0
  222. package/dist/collection/utils/e2e-utils.js +10 -3
  223. package/dist/collection/utils/sanitize/constants/tag-sets.js +5 -0
  224. package/dist/collection/utils/sanitize/core/html-sanitizer.js +39 -0
  225. package/dist/collection/utils/sanitize/core/sanitize-strategy.js +62 -0
  226. package/dist/collection/utils/sanitize/core/types.js +4 -0
  227. package/dist/collection/utils/sanitize/index.js +12 -0
  228. package/dist/collection/utils/sanitize/strategies/empty-sanitize-strategy.js +17 -0
  229. package/dist/collection/utils/sanitize/strategies/index.js +3 -0
  230. package/dist/collection/utils/sanitize/strategies/label-sanitize-strategy.js +13 -0
  231. package/dist/collection/utils/sanitize/strategies/style-sanitize-strategy.js +50 -0
  232. package/dist/collection/utils/sanitize/test/empty-strategy.test.js +12 -0
  233. package/dist/collection/utils/sanitize/test/html-sanitizer.test.js +57 -0
  234. package/dist/collection/utils/sanitize/test/label-strategy.test.js +56 -0
  235. package/dist/collection/utils/sanitize/test/sanitize-strategy.test.js +85 -0
  236. package/dist/collection/utils/sanitize/test/sanitize.test.js +22 -0
  237. package/dist/collection/utils/sanitize/test/serialize-fragment.test.js +25 -0
  238. package/dist/collection/utils/sanitize/test/style-strategy.test.js +45 -0
  239. package/dist/collection/utils/sanitize/utils/serialize-fragment.js +17 -0
  240. package/dist/esm/{app-globals-2ac60ff5.js → app-globals-c0676920.js} +12 -16
  241. package/dist/esm/breakpoints-56e5407b.js +53 -0
  242. package/dist/esm/{child-nodes-event-prevent-slimmer-e662bee2.js → child-nodes-event-prevent-slimmer-649b9d30.js} +2 -2
  243. package/dist/esm/{child-nodes-notify-observer-slimmer-b676cd2b.js → child-nodes-notify-observer-slimmer-541dd6a4.js} +1 -1
  244. package/dist/esm/{code-block-8ee34ab6.js → code-block-b6247a45.js} +7 -7
  245. package/dist/esm/{component-global-style-slimmer-08046b38.js → component-global-style-slimmer-ac703085.js} +2 -1
  246. package/dist/esm/{component-usage-runtime-metrics-a84cc93e.js → component-usage-runtime-metrics-46020a03.js} +1 -1
  247. package/dist/esm/{component-value-history-controller-slimmer.abstract-a61bf821.js → component-value-history-controller-slimmer.abstract-2bb8533d.js} +6 -6
  248. package/dist/esm/{create-public-api-runtime-metrics-slimmer-bedf3a1e.js → create-public-api-runtime-metrics-slimmer-aaadaa08.js} +3 -38
  249. package/dist/esm/{dark-mode-style-controller-de88a117.js → dark-mode-style-controller-82e5c1c6.js} +292 -1254
  250. package/dist/esm/{date-required-rule-47ecc28f.js → date-required-rule-e771e7d9.js} +1 -1
  251. package/dist/esm/{design-token-007efbaa.js → design-token-4aee1c56.js} +2 -2
  252. package/dist/esm/dom-node-subject-observer-factory-82f346e3.js +138 -0
  253. package/dist/esm/{dto-renderer-manager-ee1a5864.js → dto-renderer-manager-6fd22ab7.js} +7 -7
  254. package/dist/esm/{element-appender-slimmer-35e26b5a.js → element-appender-slimmer-e4713a72.js} +348 -165
  255. package/dist/esm/{event-emit-slimmer-09827cec.js → event-emit-slimmer-ffaecb9a.js} +2 -2
  256. package/dist/esm/{feature-flag-controller-51659753.js → feature-flag-controller-09ea7e87.js} +7 -1
  257. package/dist/esm/{form-field-controller-slimmer-5d9dc384.js → form-field-controller-slimmer-5817d14d.js} +10 -11
  258. package/dist/esm/{internal-icon-manager-f0486245.js → icon-manager-539d7cf7.js} +2 -52
  259. package/dist/esm/{image-annotation-action-285d432e.js → image-annotation-action-6701b4c9.js} +6 -5
  260. package/dist/esm/index-3b327f29.js +215 -0
  261. package/dist/esm/{index-e9da316f.js → index-bfc6dfa2.js} +13 -1
  262. package/dist/esm/index.js +32 -29
  263. package/dist/esm/{inject-keyboard-manager-83d76ff5.js → inject-keyboard-manager-78730062.js} +1 -1
  264. package/dist/esm/internal-icon-manager-bd80b3bb.js +53 -0
  265. package/dist/esm/{translation-96e5debd.js → internal-translation-controller-911515f9.js} +1 -93
  266. package/dist/esm/{internal-vega-event-manager-efb6786e.js → internal-vega-event-manager-32a3d848.js} +1 -1
  267. package/dist/esm/internal-vega-z-index-manager-7d2b54c3.js +178 -0
  268. package/dist/esm/{keyboard-manager-c92808d8.js → keyboard-manager-38934f94.js} +2 -2
  269. package/dist/esm/{keyboard-manager-slimmer-79c78ce8.js → keyboard-manager-slimmer-9984d922.js} +1 -1
  270. package/dist/esm/loader.js +27 -24
  271. package/dist/esm/misc-9fdbcfbb.js +37 -0
  272. package/dist/esm/{month-view-generator-16192182.js → month-view-generator-eaf9029c.js} +1 -1
  273. package/dist/esm/{page-resize-observer-slimmer-8744cb44.js → page-resize-observer-slimmer-d6af0d86.js} +2 -52
  274. package/dist/esm/{public-rules-724873f5.js → public-rules-25cc3a39.js} +13 -14
  275. package/dist/esm/{range-5257c062.js → range-663f44dc.js} +2 -2
  276. package/dist/esm/{responsive-format-facade-28ee2dbd.js → responsive-format-facade-7a071174.js} +3 -12
  277. package/dist/esm/{rich-text-editor-required-rule-873e2e67.js → rich-text-editor-required-rule-a238b862.js} +1 -1
  278. package/dist/esm/{string-format-strategy.abstract-fc60db79.js → string-format-strategy.abstract-713fba36.js} +1 -1
  279. package/dist/esm/{string-input-formatter-slimmer-ee32b1fd.js → string-input-formatter-slimmer-5b413ff9.js} +4 -4
  280. package/dist/esm/{string-mask-strategy-0b0accaa.js → string-mask-strategy-6beaf664.js} +2 -2
  281. package/dist/esm/{style-formatter-314b37f3.js → style-formatter-3d06b72d.js} +2 -2
  282. package/dist/esm/{sub-state-notify-slimmer-4453047a.js → sub-state-notify-slimmer-5133f1a8.js} +2 -2
  283. package/dist/esm/{sub-state-observer-slimmer-202ec7dc.js → sub-state-observer-slimmer-478c9f41.js} +3 -3
  284. package/dist/esm/{time-required-rule-5fa43804.js → time-required-rule-e4138a76.js} +1 -1
  285. package/dist/esm/{function-extension-e8c0e43e.js → token-extension-e33fd151.js} +488 -376
  286. package/dist/esm/{translation-slimmer-c936cb1b.js → translation-slimmer-2394b173.js} +1 -1
  287. package/dist/esm/{type-guard-c65a227d.js → type-guard-f50e34d6.js} +1 -1
  288. package/dist/esm/{ui-bb99c0c2.js → ui-ee31416b.js} +12 -0
  289. package/dist/esm/{valid-credit-card-number-rule-666c415d.js → valid-credit-card-number-rule-22ce81db.js} +1 -1
  290. package/dist/esm/vega-accordion.entry.js +19 -28
  291. package/dist/esm/vega-app-footer.entry.js +3 -3
  292. package/dist/esm/vega-app-header-button.entry.js +174 -40
  293. package/dist/esm/vega-backdrop.entry.js +2 -2
  294. package/dist/esm/vega-banner.entry.js +12 -10
  295. package/dist/esm/vega-bar-chart.entry.js +1 -1
  296. package/dist/esm/vega-box.entry.js +14 -29
  297. package/dist/esm/vega-brand-logo.entry.js +7 -5
  298. package/dist/esm/vega-breadcrumb.entry.js +11 -10
  299. package/dist/esm/vega-button-circle.entry.js +19 -29
  300. package/dist/esm/vega-button-group_2.entry.js +12 -12
  301. package/dist/esm/vega-button-link.entry.js +13 -12
  302. package/dist/esm/vega-button.entry.js +19 -28
  303. package/dist/esm/vega-calendar_4.entry.js +23 -20
  304. package/dist/esm/vega-card.entry.js +9 -28
  305. package/dist/esm/vega-carousel.entry.js +14 -25
  306. package/dist/esm/vega-checkbox_2.entry.js +19 -17
  307. package/dist/esm/vega-chip.entry.js +18 -29
  308. package/dist/esm/vega-code-block.entry.js +653 -2704
  309. package/dist/esm/vega-color-picker.entry.js +15 -12
  310. package/dist/esm/vega-combo-box.entry.js +22 -21
  311. package/dist/esm/vega-counter-badge.entry.js +1 -1
  312. package/dist/esm/vega-date-picker_2.entry.js +34 -37
  313. package/dist/esm/vega-dialog-controller-bbb2fc52.js +82 -0
  314. package/dist/esm/vega-dialog_2.entry.js +23 -30
  315. package/dist/esm/vega-divider.entry.js +11 -29
  316. package/dist/esm/vega-dropdown_5.entry.js +39 -45
  317. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  318. package/dist/esm/vega-event-id-38aa77a0.js +113 -0
  319. package/dist/esm/vega-field-error.entry.js +1 -1
  320. package/dist/esm/vega-field-label.entry.js +7 -6
  321. package/dist/esm/vega-file-uploader.entry.js +19 -14
  322. package/dist/esm/vega-flag-icon.entry.js +12 -26
  323. package/dist/esm/vega-flex.entry.js +11 -28
  324. package/dist/esm/vega-font.entry.js +11 -28
  325. package/dist/esm/vega-form.entry.js +20 -18
  326. package/dist/esm/vega-grid.entry.js +9 -28
  327. package/dist/esm/vega-hint.entry.js +1 -1
  328. package/dist/esm/vega-icon.entry.js +15 -28
  329. package/dist/esm/vega-image-uploader.entry.js +28 -31
  330. package/dist/esm/vega-input-credit-card.entry.js +25 -21
  331. package/dist/esm/vega-input-numeric.entry.js +21 -19
  332. package/dist/esm/vega-input-passcode.entry.js +20 -18
  333. package/dist/esm/vega-input-phone-number.entry.js +27 -31
  334. package/dist/esm/vega-input-range.entry.js +19 -17
  335. package/dist/esm/vega-input-select.entry.js +27 -32
  336. package/dist/esm/vega-input.entry.js +33 -21
  337. package/dist/esm/{vega-internal-event-id-4a06d705.js → vega-internal-event-id-799d012e.js} +1 -1
  338. package/dist/esm/vega-item-toggle.entry.js +6 -5
  339. package/dist/esm/vega-left-nav_5.entry.js +29 -31
  340. package/dist/esm/vega-line-chart.entry.js +1 -1
  341. package/dist/esm/vega-loader-wrapper_2.entry.js +13 -29
  342. package/dist/esm/vega-page-notification_2.entry.js +4 -3
  343. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +9 -9
  344. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +7 -8
  345. package/dist/esm/vega-pagination.entry.js +20 -30
  346. package/dist/esm/vega-pie-chart.entry.js +1 -1
  347. package/dist/esm/vega-popover_2.entry.js +20 -30
  348. package/dist/esm/vega-progress-tracker_2.entry.js +64 -37
  349. package/dist/esm/vega-radio_2.entry.js +21 -19
  350. package/dist/esm/vega-rich-text-content.entry.js +18 -16
  351. package/dist/esm/vega-rich-text-editor_4.entry.js +33 -30
  352. package/dist/esm/vega-section-title.entry.js +1 -1
  353. package/dist/esm/vega-segment-control.entry.js +9 -7
  354. package/dist/esm/vega-selection-chip_2.entry.js +22 -29
  355. package/dist/esm/vega-selection-tile_2.entry.js +19 -17
  356. package/dist/esm/vega-sidenav_3.entry.js +24 -30
  357. package/dist/esm/vega-signature-capture.entry.js +24 -28
  358. package/dist/esm/vega-skeleton.entry.js +1 -1
  359. package/dist/esm/vega-slot-container.entry.js +1 -1
  360. package/dist/esm/vega-stepper.entry.js +18 -16
  361. package/dist/esm/vega-tab-group_2.entry.js +11 -10
  362. package/dist/esm/vega-table_11.entry.js +28 -29
  363. package/dist/esm/vega-text.entry.js +4 -3
  364. package/dist/esm/vega-textarea.entry.js +18 -16
  365. package/dist/esm/vega-time-picker_2.entry.js +26 -32
  366. package/dist/esm/vega-toggle-switch.entry.js +15 -12
  367. package/dist/esm/vega-tooltip_2.entry.js +18 -29
  368. package/dist/esm/vega.js +27 -24
  369. package/dist/esm/{index-51a7da7f.js → wait-for-component-did-render-b08ef07b.js} +3 -13
  370. package/dist/sri/vega-sri-manifest.json +418 -406
  371. package/dist/types/components/vega-app-footer/types.d.ts +18 -0
  372. package/dist/types/components/vega-app-header-button/types.d.ts +31 -0
  373. package/dist/types/components/vega-app-header-button/vega-app-header-button.d.ts +2 -0
  374. package/dist/types/components/vega-banner/types.d.ts +9 -0
  375. package/dist/types/components/vega-box/interface.d.ts +46 -0
  376. package/dist/types/components/vega-breadcrumb/types.d.ts +28 -0
  377. package/dist/types/components/vega-button/types.d.ts +12 -0
  378. package/dist/types/components/vega-button-circle/types.d.ts +9 -0
  379. package/dist/types/components/vega-button-group/types.d.ts +48 -0
  380. package/dist/types/components/vega-button-link/types.d.ts +3 -0
  381. package/dist/types/components/vega-calendar/types.d.ts +189 -0
  382. package/dist/types/components/vega-calendar/vega-calendar-event-preview/types.d.ts +6 -0
  383. package/dist/types/components/vega-chart/vega-bar-chart/types.d.ts +3 -0
  384. package/dist/types/components/vega-chip/types.d.ts +12 -0
  385. package/dist/types/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.d.ts +2 -10
  386. package/dist/types/components/vega-combo-box/types.d.ts +6 -0
  387. package/dist/types/components/vega-date-picker/types.d.ts +39 -0
  388. package/dist/types/components/vega-dialog/types.d.ts +5 -0
  389. package/dist/types/components/vega-divider/interface.d.ts +18 -0
  390. package/dist/types/components/vega-dropdown/types.d.ts +30 -0
  391. package/dist/types/components/vega-dropdown/vega-dropdown-item/types.d.ts +9 -1
  392. package/dist/types/components/vega-field-error/types.d.ts +12 -0
  393. package/dist/types/components/vega-field-label/types.d.ts +16 -0
  394. package/dist/types/components/vega-file-uploader/types.d.ts +12 -0
  395. package/dist/types/components/vega-font/types.d.ts +3 -0
  396. package/dist/types/components/vega-form/types.d.ts +45 -0
  397. package/dist/types/components/vega-image-uploader/types.d.ts +33 -1
  398. package/dist/types/components/vega-input/types.d.ts +31 -0
  399. package/dist/types/components/vega-input-phone-number/types.d.ts +15 -0
  400. package/dist/types/components/vega-input-range/types.d.ts +9 -0
  401. package/dist/types/components/vega-input-select/types.d.ts +45 -0
  402. package/dist/types/components/vega-item-toggle/types.d.ts +21 -0
  403. package/dist/types/components/vega-loading-indicator/types.d.ts +3 -0
  404. package/dist/types/components/vega-modal/types.d.ts +9 -0
  405. package/dist/types/components/vega-nav/interface.d.ts +108 -0
  406. package/dist/types/components/vega-page-notification/types.d.ts +15 -0
  407. package/dist/types/components/vega-pagination/types.d.ts +11 -0
  408. package/dist/types/components/vega-progress-tracker/slimmers/controllers/dto/internal-progress-tracker-step.d.ts +16 -4
  409. package/dist/types/components/vega-progress-tracker/type.d.ts +8 -0
  410. package/dist/types/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.d.ts +6 -0
  411. package/dist/types/components/vega-progress-tracker/vega-progress-tracker.d.ts +2 -2
  412. package/dist/types/components/vega-rich-text-editor/interface.d.ts +473 -2
  413. package/dist/types/components/vega-rich-text-editor/vega-rich-text-image-editor/types.d.ts +24 -0
  414. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/types.d.ts +24 -0
  415. package/dist/types/components/vega-segment-control/types.d.ts +18 -0
  416. package/dist/types/components/vega-selection-chip/interface.d.ts +12 -0
  417. package/dist/types/components/vega-selection-chip/vega-selection-chip-group/interface.d.ts +4 -0
  418. package/dist/types/components/vega-selection-tile/interface.d.ts +9 -0
  419. package/dist/types/components/vega-sidenav/types.d.ts +51 -0
  420. package/dist/types/components/vega-signature-capture/types.d.ts +29 -2
  421. package/dist/types/components/vega-skeleton/interface.d.ts +6 -0
  422. package/dist/types/components/vega-tab-group/types.d.ts +36 -0
  423. package/dist/types/components/vega-table/interface.d.ts +237 -20
  424. package/dist/types/components/vega-table/vega-table-expand-row/types.d.ts +6 -0
  425. package/dist/types/components/vega-table/vega-table-foot/types.d.ts +9 -0
  426. package/dist/types/components/vega-table/vega-table-foot-row/types.d.ts +9 -0
  427. package/dist/types/components/vega-table/vega-table-head/types.d.ts +9 -0
  428. package/dist/types/components/vega-table/vega-table-head-row/types.d.ts +12 -0
  429. package/dist/types/components/vega-table/vega-table-row/types.d.ts +18 -0
  430. package/dist/types/components/vega-text/types.d.ts +6 -0
  431. package/dist/types/components/vega-time-picker/types.d.ts +33 -0
  432. package/dist/types/components/vega-virtual-scroll/types.d.ts +30 -1
  433. package/dist/types/components.d.ts +13 -3
  434. package/dist/types/helpers/common/index.d.ts +2 -15
  435. package/dist/types/helpers/common/wait-for-component-did-render.d.ts +8 -0
  436. package/dist/types/helpers/common/wait-for-vega-handler.d.ts +6 -15
  437. package/dist/types/helpers/feature-control/feature-flag.d.ts +2 -1
  438. package/dist/types/helpers/public-api.d.ts +0 -2
  439. package/dist/types/helpers/slimmers/mutation-observer/aria-attributes-value-mapper.d.ts +44 -0
  440. package/dist/types/helpers/slimmers/mutation-observer/test/aria-attributes-value-mapper.test.d.ts +1 -0
  441. package/dist/types/helpers/slimmers/position-calculation/base-position-calculation-strategy.d.ts +57 -48
  442. package/dist/types/helpers/slimmers/position-calculation/position-calculation-controller.d.ts +5 -0
  443. package/dist/types/helpers/slimmers/position-calculation/screen-position-calculation-strategy.d.ts +41 -1
  444. package/dist/types/helpers/slimmers/position-calculation/screen-scroll-position-update.d.ts +39 -0
  445. package/dist/types/helpers/ui/element-appender.d.ts +0 -1
  446. package/dist/types/index.d.ts +2 -0
  447. package/dist/types/polyfill/prism/index.d.ts +3 -0
  448. package/dist/types/polyfill/prism/languages/css.d.ts +6 -0
  449. package/dist/types/polyfill/prism/languages/javascript.d.ts +7 -0
  450. package/dist/types/polyfill/prism/languages/jsx.d.ts +7 -0
  451. package/dist/types/polyfill/prism/languages/language-registry.d.ts +8 -0
  452. package/dist/types/polyfill/prism/languages/markup.d.ts +6 -0
  453. package/dist/types/polyfill/prism/languages/tsx.d.ts +7 -0
  454. package/dist/types/polyfill/prism/languages/typescript.d.ts +2 -0
  455. package/dist/types/polyfill/prism/test/css.test.d.ts +1 -0
  456. package/dist/types/polyfill/prism/test/javascript.test.d.ts +1 -0
  457. package/dist/types/polyfill/prism/test/jsx.test.d.ts +1 -0
  458. package/dist/types/polyfill/prism/test/language-registry.test.d.ts +1 -0
  459. package/dist/types/polyfill/prism/test/markup.test.d.ts +1 -0
  460. package/dist/types/polyfill/prism/test/test-utils.d.ts +10 -0
  461. package/dist/types/polyfill/prism/test/tokenizer.test.d.ts +1 -0
  462. package/dist/types/polyfill/prism/test/tsx.test.d.ts +1 -0
  463. package/dist/types/polyfill/prism/test/typescript.test.d.ts +1 -0
  464. package/dist/types/polyfill/prism/tokenizer.d.ts +17 -0
  465. package/dist/types/polyfill/prism/types.d.ts +25 -0
  466. package/dist/types/polyfill/tinycolor/tinycolor-polyfill.d.ts +149 -0
  467. package/dist/types/polyfill/tinycolor/tinycolor-polyfill.test.d.ts +1 -0
  468. package/dist/types/types/components.type.d.ts +4 -1
  469. package/dist/types/types/design-token.type.d.ts +36 -0
  470. package/dist/types/types/flag.type.d.ts +3 -0
  471. package/dist/types/types/general.d.ts +12 -0
  472. package/dist/types/types/ui.type.d.ts +372 -0
  473. package/dist/types/types/vega-chart.d.ts +281 -2
  474. package/dist/types/utils/e2e-utils.d.ts +2 -0
  475. package/dist/types/utils/sanitize/constants/tag-sets.d.ts +6 -0
  476. package/dist/types/utils/sanitize/core/html-sanitizer.d.ts +22 -0
  477. package/dist/types/utils/sanitize/core/sanitize-strategy.d.ts +27 -0
  478. package/dist/types/utils/sanitize/core/types.d.ts +13 -0
  479. package/dist/types/utils/sanitize/index.d.ts +12 -0
  480. package/dist/types/utils/sanitize/strategies/empty-sanitize-strategy.d.ts +14 -0
  481. package/dist/types/utils/sanitize/strategies/index.d.ts +3 -0
  482. package/dist/types/utils/sanitize/strategies/label-sanitize-strategy.d.ts +10 -0
  483. package/dist/types/utils/sanitize/strategies/style-sanitize-strategy.d.ts +24 -0
  484. package/dist/types/utils/sanitize/test/empty-strategy.test.d.ts +1 -0
  485. package/dist/types/utils/sanitize/test/html-sanitizer.test.d.ts +1 -0
  486. package/dist/types/utils/sanitize/test/label-strategy.test.d.ts +1 -0
  487. package/dist/types/utils/sanitize/test/sanitize-strategy.test.d.ts +1 -0
  488. package/dist/types/utils/sanitize/test/sanitize.test.d.ts +1 -0
  489. package/dist/types/utils/sanitize/test/serialize-fragment.test.d.ts +1 -0
  490. package/dist/types/utils/sanitize/test/style-strategy.test.d.ts +1 -0
  491. package/dist/types/utils/sanitize/utils/serialize-fragment.d.ts +12 -0
  492. package/dist/vega/index.esm.js +1 -1
  493. package/dist/vega/p-01d58eb8.entry.js +1 -0
  494. package/dist/vega/p-021d4ae4.js +1 -0
  495. package/dist/vega/p-02a7d60c.entry.js +1 -0
  496. package/dist/vega/{p-66fa700b.js → p-02c9796a.js} +1 -1
  497. package/dist/vega/p-033c31d8.entry.js +1 -0
  498. package/dist/vega/{p-e77a83e4.js → p-07cb0243.js} +1 -1
  499. package/dist/vega/p-087ea379.entry.js +1 -0
  500. package/dist/vega/{p-e5af5a4d.entry.js → p-0b4880bd.entry.js} +1 -1
  501. package/dist/vega/{p-920719ad.js → p-0e679d8c.js} +1 -1
  502. package/dist/vega/{p-c9b6b5a9.js → p-10734a00.js} +1 -1
  503. package/dist/vega/p-154f9cf7.entry.js +1 -0
  504. package/dist/vega/p-179aad4f.entry.js +1 -0
  505. package/dist/vega/p-1a3236e7.entry.js +1 -0
  506. package/dist/vega/p-1f3cd061.entry.js +1 -0
  507. package/dist/vega/p-1f5e35dc.entry.js +1 -0
  508. package/dist/vega/p-242fbcad.entry.js +1 -0
  509. package/dist/vega/p-249df6d2.entry.js +1 -0
  510. package/dist/vega/p-28ad1864.entry.js +1 -0
  511. package/dist/vega/p-2a10e2e5.js +1 -0
  512. package/dist/vega/p-2b49686d.entry.js +1 -0
  513. package/dist/vega/p-2ba78982.entry.js +1 -0
  514. package/dist/vega/p-2bb5a232.js +1 -0
  515. package/dist/vega/{p-e9b86dac.entry.js → p-2c1a85dd.entry.js} +1 -1
  516. package/dist/vega/p-2cc9d126.entry.js +1 -0
  517. package/dist/vega/p-2d69632d.js +1 -0
  518. package/dist/vega/p-2e91295d.entry.js +1 -0
  519. package/dist/vega/p-31ac7386.js +1 -0
  520. package/dist/vega/p-32033e7a.js +1 -0
  521. package/dist/vega/p-32183637.entry.js +1 -0
  522. package/dist/vega/p-3244c605.entry.js +1 -0
  523. package/dist/vega/p-32faa460.entry.js +1 -0
  524. package/dist/vega/p-33f9ad94.entry.js +1 -0
  525. package/dist/vega/{p-4897bedd.entry.js → p-358b4a06.entry.js} +1 -1
  526. package/dist/vega/p-3afc025e.entry.js +1 -0
  527. package/dist/vega/p-3d8122ab.entry.js +1 -0
  528. package/dist/vega/{p-ea04a387.entry.js → p-3f3c771a.entry.js} +1 -1
  529. package/dist/vega/{p-1f83cebf.js → p-415ffa35.js} +1 -1
  530. package/dist/vega/{p-d849e0f5.js → p-4415ad28.js} +1 -1
  531. package/dist/vega/{p-0575d22e.js → p-464559e3.js} +1 -1
  532. package/dist/vega/p-49845a91.js +1 -0
  533. package/dist/vega/{p-e16b3adf.js → p-4bffdb28.js} +1 -1
  534. package/dist/vega/p-4e017458.entry.js +1 -0
  535. package/dist/vega/p-4e4a0228.entry.js +1 -0
  536. package/dist/vega/{p-a2aeb646.js → p-4ea30592.js} +1 -1
  537. package/dist/vega/{p-0b38a01f.entry.js → p-51fcb07f.entry.js} +1 -1
  538. package/dist/vega/p-57927b10.entry.js +1 -0
  539. package/dist/vega/p-5831d6d3.entry.js +1 -0
  540. package/dist/vega/p-593e0f80.js +1 -0
  541. package/dist/vega/p-5a25014f.js +1 -0
  542. package/dist/vega/p-5eb7f382.js +1 -0
  543. package/dist/vega/p-5f377954.js +1 -1
  544. package/dist/vega/p-644f701a.js +1 -0
  545. package/dist/vega/p-6a62e476.entry.js +1 -0
  546. package/dist/vega/{p-75f981ce.js → p-6b6f0fb4.js} +1 -1
  547. package/dist/vega/p-6d219c44.entry.js +1 -0
  548. package/dist/vega/p-6d60b66a.entry.js +1 -0
  549. package/dist/vega/{p-ad2055f4.entry.js → p-6dcdb580.entry.js} +1 -1
  550. package/dist/vega/{p-691ba1ae.js → p-7181861a.js} +1 -1
  551. package/dist/vega/p-76181a70.entry.js +1 -0
  552. package/dist/vega/p-781fd6e0.js +1 -0
  553. package/dist/vega/p-7958614a.entry.js +1 -0
  554. package/dist/vega/{p-5b71c85e.js → p-7c39ce96.js} +1 -1
  555. package/dist/vega/p-7d7aaff9.entry.js +1 -0
  556. package/dist/vega/{p-4dd6554e.entry.js → p-7f46cc1e.entry.js} +1 -1
  557. package/dist/vega/{p-badad9ed.js → p-81b044b9.js} +1 -1
  558. package/dist/vega/p-8950987b.entry.js +1 -0
  559. package/dist/vega/p-89f2e16d.entry.js +1 -0
  560. package/dist/vega/p-8ac2d165.js +1 -0
  561. package/dist/vega/p-8b153acd.entry.js +1 -0
  562. package/dist/vega/p-8b5d3a52.js +1 -0
  563. package/dist/vega/{p-fff13ed1.entry.js → p-8b891f36.entry.js} +1 -1
  564. package/dist/vega/p-8dbdd609.entry.js +1 -0
  565. package/dist/vega/{p-dd11f735.js → p-9339c6c4.js} +1 -1
  566. package/dist/vega/p-94a77fbe.entry.js +1 -0
  567. package/dist/vega/p-95528b47.js +1 -0
  568. package/dist/vega/p-9a137bab.entry.js +1 -0
  569. package/dist/vega/{p-6f8be8ea.js → p-a0b66c25.js} +1 -1
  570. package/dist/vega/{p-0bb3be0b.entry.js → p-a13a73fa.entry.js} +1 -1
  571. package/dist/vega/p-a560d8c5.entry.js +1 -0
  572. package/dist/vega/{p-d0e31633.js → p-a786259a.js} +1 -1
  573. package/dist/vega/p-a7a8a4eb.entry.js +1 -0
  574. package/dist/vega/p-a8792e3d.js +1 -0
  575. package/dist/vega/{p-60851f9d.js → p-aa1174dc.js} +1 -1
  576. package/dist/vega/p-ab834f06.js +1 -0
  577. package/dist/vega/p-b136ebba.entry.js +1 -0
  578. package/dist/vega/p-b201f379.js +1 -0
  579. package/dist/vega/p-b256b7a4.js +1 -0
  580. package/dist/vega/p-b366deff.entry.js +1 -0
  581. package/dist/vega/p-b597393b.entry.js +1 -0
  582. package/dist/vega/p-b7f3221f.js +1 -0
  583. package/dist/vega/p-bb5e0192.entry.js +1 -0
  584. package/dist/vega/p-be1a210b.js +1 -0
  585. package/dist/vega/p-bebfbe95.entry.js +1 -0
  586. package/dist/vega/p-bf6fc19f.entry.js +1 -0
  587. package/dist/vega/p-c1d13eec.entry.js +1 -0
  588. package/dist/vega/p-c29068fb.entry.js +1 -0
  589. package/dist/vega/p-c3d2f316.js +1 -0
  590. package/dist/vega/{p-671afda4.entry.js → p-c72e08c6.entry.js} +1 -1
  591. package/dist/vega/p-c801c85d.js +1 -0
  592. package/dist/vega/p-c8feb644.entry.js +1 -0
  593. package/dist/vega/p-ca5898dc.entry.js +1 -0
  594. package/dist/vega/p-d555f677.entry.js +1 -0
  595. package/dist/vega/p-d64fab3d.js +1 -0
  596. package/dist/vega/p-d6dbbe61.entry.js +1 -0
  597. package/dist/vega/p-d7a78c5e.entry.js +1 -0
  598. package/dist/vega/p-d8fadcdc.entry.js +1 -0
  599. package/dist/vega/p-dad3ba5f.js +1 -0
  600. package/dist/vega/p-dd3a94f4.entry.js +1 -0
  601. package/dist/vega/p-e1431c14.entry.js +1 -0
  602. package/dist/vega/p-e1fbfd20.js +1 -0
  603. package/dist/vega/p-e2af0e24.entry.js +1 -0
  604. package/dist/vega/{p-521d1d07.js → p-e52890db.js} +1 -1
  605. package/dist/vega/{p-1298b126.js → p-e632475e.js} +1 -1
  606. package/dist/vega/p-e6adf829.js +1 -0
  607. package/dist/vega/{p-77edf50c.js → p-e827d56d.js} +1 -1
  608. package/dist/vega/p-e8775a56.entry.js +1 -0
  609. package/dist/vega/p-e89e3ede.entry.js +1 -0
  610. package/dist/vega/p-eda988d5.entry.js +1 -0
  611. package/dist/vega/p-f05b8f76.entry.js +1 -0
  612. package/dist/vega/p-f0e828d8.js +1 -0
  613. package/dist/vega/p-f14a5eae.entry.js +1 -0
  614. package/dist/vega/p-f2b0b58a.js +1 -0
  615. package/dist/vega/p-f3d0f2dc.js +1 -0
  616. package/dist/vega/{p-5910be31.entry.js → p-f5bafc45.entry.js} +1 -1
  617. package/dist/vega/p-fc1fa345.js +1 -0
  618. package/dist/vega/p-fd7ddd64.entry.js +1 -0
  619. package/dist/vega/vega.esm.js +1 -1
  620. package/package.json +3 -5
  621. package/dist/cjs/_commonjsHelpers-537d719a.js +0 -20
  622. package/dist/cjs/language-extension-8c4a56ff.js +0 -210
  623. package/dist/cjs/sanitize-fb222510.js +0 -131
  624. package/dist/cjs/wait-for-vega-handler-5469ff80.js +0 -63
  625. package/dist/collection/utils/sanitize.js +0 -126
  626. package/dist/collection/utils/test/sanitize.test.js +0 -65
  627. package/dist/esm/_commonjsHelpers-9943807e.js +0 -17
  628. package/dist/esm/dom-node-subject-observer-factory-064ee2b2.js +0 -250
  629. package/dist/esm/language-extension-29bf8acd.js +0 -207
  630. package/dist/esm/sanitize-fd0cb40d.js +0 -129
  631. package/dist/esm/wait-for-vega-handler-c2c07ac3.js +0 -61
  632. package/dist/types/utils/sanitize.d.ts +0 -71
  633. package/dist/vega/p-011b94b1.entry.js +0 -1
  634. package/dist/vega/p-012753b5.entry.js +0 -1
  635. package/dist/vega/p-024331ce.entry.js +0 -1
  636. package/dist/vega/p-08a90cc6.entry.js +0 -1
  637. package/dist/vega/p-0ede1fea.entry.js +0 -1
  638. package/dist/vega/p-10ac8b57.js +0 -1
  639. package/dist/vega/p-112455b1.js +0 -1
  640. package/dist/vega/p-17c55205.entry.js +0 -1
  641. package/dist/vega/p-1e0d8228.entry.js +0 -1
  642. package/dist/vega/p-3353b3d7.js +0 -1
  643. package/dist/vega/p-365b1b35.entry.js +0 -1
  644. package/dist/vega/p-3ae9ee3d.entry.js +0 -1
  645. package/dist/vega/p-3af92370.entry.js +0 -1
  646. package/dist/vega/p-3bf66be2.js +0 -1
  647. package/dist/vega/p-3c5a28e4.entry.js +0 -1
  648. package/dist/vega/p-3e5f362f.js +0 -1
  649. package/dist/vega/p-430be941.js +0 -1
  650. package/dist/vega/p-43f585f7.entry.js +0 -1
  651. package/dist/vega/p-45296fd4.entry.js +0 -1
  652. package/dist/vega/p-476a173a.js +0 -1
  653. package/dist/vega/p-491618a6.entry.js +0 -1
  654. package/dist/vega/p-4a537391.entry.js +0 -1
  655. package/dist/vega/p-4aa893ef.entry.js +0 -1
  656. package/dist/vega/p-4c47e8bb.entry.js +0 -1
  657. package/dist/vega/p-4da75f2b.js +0 -1
  658. package/dist/vega/p-509eb52e.entry.js +0 -1
  659. package/dist/vega/p-5110ba73.entry.js +0 -1
  660. package/dist/vega/p-556f9a21.entry.js +0 -1
  661. package/dist/vega/p-55b54ba0.entry.js +0 -1
  662. package/dist/vega/p-5d676a94.js +0 -1
  663. package/dist/vega/p-5ea2e43c.entry.js +0 -1
  664. package/dist/vega/p-5efc6fe1.entry.js +0 -1
  665. package/dist/vega/p-64cd1931.entry.js +0 -1
  666. package/dist/vega/p-67fcf6f2.entry.js +0 -9
  667. package/dist/vega/p-68df4288.js +0 -1
  668. package/dist/vega/p-6a2205a1.entry.js +0 -1
  669. package/dist/vega/p-6a4277df.entry.js +0 -1
  670. package/dist/vega/p-6e136980.js +0 -1
  671. package/dist/vega/p-6fa8e231.entry.js +0 -1
  672. package/dist/vega/p-7045e84c.entry.js +0 -1
  673. package/dist/vega/p-7288f8c4.js +0 -1
  674. package/dist/vega/p-749f96a4.js +0 -1
  675. package/dist/vega/p-7aaece55.entry.js +0 -1
  676. package/dist/vega/p-7ec6a104.entry.js +0 -1
  677. package/dist/vega/p-81134e9e.entry.js +0 -1
  678. package/dist/vega/p-89d685a8.js +0 -1
  679. package/dist/vega/p-8c0eb12f.entry.js +0 -1
  680. package/dist/vega/p-8c9ea6f4.js +0 -1
  681. package/dist/vega/p-8d0ca805.js +0 -1
  682. package/dist/vega/p-8d701832.entry.js +0 -1
  683. package/dist/vega/p-8e42a14c.entry.js +0 -1
  684. package/dist/vega/p-8ed0faa2.entry.js +0 -1
  685. package/dist/vega/p-94394df7.entry.js +0 -1
  686. package/dist/vega/p-99aa554b.entry.js +0 -1
  687. package/dist/vega/p-9a2446f1.entry.js +0 -1
  688. package/dist/vega/p-9fd503e9.entry.js +0 -1
  689. package/dist/vega/p-a4670e23.js +0 -1
  690. package/dist/vega/p-a475d525.entry.js +0 -1
  691. package/dist/vega/p-a530797f.entry.js +0 -1
  692. package/dist/vega/p-a85ad369.entry.js +0 -1
  693. package/dist/vega/p-ac5e9955.entry.js +0 -1
  694. package/dist/vega/p-aedf7146.js +0 -1
  695. package/dist/vega/p-b1f869fb.js +0 -1
  696. package/dist/vega/p-b4ea3fad.js +0 -1
  697. package/dist/vega/p-bb4a558d.entry.js +0 -1
  698. package/dist/vega/p-bb8339ed.entry.js +0 -1
  699. package/dist/vega/p-be930e85.entry.js +0 -1
  700. package/dist/vega/p-bf2bd6d0.entry.js +0 -1
  701. package/dist/vega/p-c2488ed6.js +0 -1
  702. package/dist/vega/p-c379a5a5.entry.js +0 -1
  703. package/dist/vega/p-c616c592.js +0 -1
  704. package/dist/vega/p-ca3472c1.entry.js +0 -1
  705. package/dist/vega/p-cc43bffb.js +0 -1
  706. package/dist/vega/p-cf5b80f9.entry.js +0 -1
  707. package/dist/vega/p-db60a38e.entry.js +0 -1
  708. package/dist/vega/p-db8cdba6.js +0 -1
  709. package/dist/vega/p-e93545fd.js +0 -1
  710. package/dist/vega/p-e9c4fd24.entry.js +0 -1
  711. package/dist/vega/p-eb60cfe1.entry.js +0 -1
  712. package/dist/vega/p-ec192283.entry.js +0 -1
  713. package/dist/vega/p-ef9cbad1.js +0 -1
  714. package/dist/vega/p-f2a3a1ec.entry.js +0 -1
  715. package/dist/vega/p-f2cdd212.entry.js +0 -1
  716. package/dist/vega/p-f3c3ff26.entry.js +0 -1
  717. package/dist/vega/p-f4c05b4a.entry.js +0 -1
  718. package/dist/vega/p-f52a0155.entry.js +0 -1
  719. package/dist/vega/p-f69f84a7.js +0 -1
  720. package/dist/vega/p-f8641214.entry.js +0 -1
  721. package/dist/vega/p-f89443aa.entry.js +0 -1
  722. package/dist/vega/p-f8f7cf48.entry.js +0 -1
  723. package/dist/vega/p-fe12eff6.js +0 -1
  724. /package/dist/{types/utils/test/sanitize.test.d.ts → collection/polyfill/prism/types.js} +0 -0
  725. /package/dist/vega/{p-d9671d27.js → p-6c170474.js} +0 -0
@@ -1,8 +1,8 @@
1
1
  import { D as DARK_MODE_CHANGE, G as GP_BRAND_CHANGE } from './static-subject-title-52f93124.js';
2
2
  import { C as ChangeManager } from './change-manager-6a7eb88c.js';
3
3
  import { O as Observer } from './observer-3959f9dd.js';
4
- import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers-9943807e.js';
5
4
  import { v as vegaNonceManager } from './vega-nonce-manager-497e5eb5.js';
5
+ import { h as htmlSanitizer, s as styleSanitizeStrategy, e as emptySanitizeStrategy } from './index-3b327f29.js';
6
6
 
7
7
  /* This file is generated by vega-design 2.0.80 */
8
8
  const DarkModeColorTokens$1 = {
@@ -482,1291 +482,326 @@ const DarkModeRingTokens = {
482
482
  'ring-action-danger-focus': '255, 56, 97, 0.25',
483
483
  };
484
484
 
485
- var tinycolor = createCommonjsModule(function (module, exports) {
486
- // This file is autogenerated. It's used to publish CJS to npm.
487
- (function (global, factory) {
488
- module.exports = factory() ;
489
- })(commonjsGlobal, (function () {
490
- // https://github.com/bgrins/TinyColor
491
- // Brian Grinstead, MIT License
492
-
493
- const trimLeft = /^\s+/;
494
- const trimRight = /\s+$/;
495
-
496
- function tinycolor(color, opts) {
497
- color = color ? color : "";
498
- opts = opts || {};
499
-
500
- // If input is already a tinycolor, return itself
501
- if (color instanceof tinycolor) {
502
- return color;
503
- }
504
- // If we are called as a function, call using new instead
505
- if (!(this instanceof tinycolor)) {
506
- return new tinycolor(color, opts);
507
- }
508
-
509
- var rgb = inputToRGB(color);
510
- (this._originalInput = color),
511
- (this._r = rgb.r),
512
- (this._g = rgb.g),
513
- (this._b = rgb.b),
514
- (this._a = rgb.a),
515
- (this._roundA = Math.round(100 * this._a) / 100),
516
- (this._format = opts.format || rgb.format);
517
- this._gradientType = opts.gradientType;
518
-
519
- // Don't let the range of [0,255] come back in [0,1].
520
- // Potentially lose a little bit of precision here, but will fix issues where
521
- // .5 gets interpreted as half of the total, instead of half of 1
522
- // If it was supposed to be 128, this was already taken care of by `inputToRgb`
523
- if (this._r < 1) this._r = Math.round(this._r);
524
- if (this._g < 1) this._g = Math.round(this._g);
525
- if (this._b < 1) this._b = Math.round(this._b);
526
-
527
- this._ok = rgb.ok;
485
+ /**
486
+ * TinyColor Polyfill - A lightweight color manipulation utility.
487
+ *
488
+ * This is a drop-in replacement for tinycolor2, implementing only the methods
489
+ * used in the Vega theme overriding system.
490
+ *
491
+ * @see VD-5026 - [Zero Dependencies] remove tinycolor2 dependency
492
+ */
493
+ /**
494
+ * TinyColor polyfill class for color manipulation.
495
+ * Implements the same interface as tinycolor2.Instance for the methods used in Vega.
496
+ */
497
+ class TinyColorPolyfill {
498
+ /**
499
+ * Create a new TinyColorPolyfill instance.
500
+ *
501
+ * @param {string | RgbaValue} color - The color to parse.
502
+ */
503
+ constructor(color) {
504
+ const rgba = TinyColorPolyfill.parseColor(color);
505
+ this._r = rgba.r;
506
+ this._g = rgba.g;
507
+ this._b = rgba.b;
508
+ this._a = rgba.a;
528
509
  }
529
-
530
- tinycolor.prototype = {
531
- isDark: function () {
532
- return this.getBrightness() < 128;
533
- },
534
- isLight: function () {
535
- return !this.isDark();
536
- },
537
- isValid: function () {
538
- return this._ok;
539
- },
540
- getOriginalInput: function () {
541
- return this._originalInput;
542
- },
543
- getFormat: function () {
544
- return this._format;
545
- },
546
- getAlpha: function () {
547
- return this._a;
548
- },
549
- getBrightness: function () {
550
- //http://www.w3.org/TR/AERT#color-contrast
551
- var rgb = this.toRgb();
552
- return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
553
- },
554
- getLuminance: function () {
555
- //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
556
- var rgb = this.toRgb();
557
- var RsRGB, GsRGB, BsRGB, R, G, B;
558
- RsRGB = rgb.r / 255;
559
- GsRGB = rgb.g / 255;
560
- BsRGB = rgb.b / 255;
561
-
562
- if (RsRGB <= 0.03928) R = RsRGB / 12.92;
563
- else R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
564
- if (GsRGB <= 0.03928) G = GsRGB / 12.92;
565
- else G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
566
- if (BsRGB <= 0.03928) B = BsRGB / 12.92;
567
- else B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
568
- return 0.2126 * R + 0.7152 * G + 0.0722 * B;
569
- },
570
- setAlpha: function (value) {
571
- this._a = boundAlpha(value);
572
- this._roundA = Math.round(100 * this._a) / 100;
573
- return this;
574
- },
575
- toHsv: function () {
576
- var hsv = rgbToHsv(this._r, this._g, this._b);
577
- return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
578
- },
579
- toHsvString: function () {
580
- var hsv = rgbToHsv(this._r, this._g, this._b);
581
- var h = Math.round(hsv.h * 360),
582
- s = Math.round(hsv.s * 100),
583
- v = Math.round(hsv.v * 100);
584
- return this._a == 1
585
- ? "hsv(" + h + ", " + s + "%, " + v + "%)"
586
- : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")";
587
- },
588
- toHsl: function () {
589
- var hsl = rgbToHsl(this._r, this._g, this._b);
590
- return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
591
- },
592
- toHslString: function () {
593
- var hsl = rgbToHsl(this._r, this._g, this._b);
594
- var h = Math.round(hsl.h * 360),
595
- s = Math.round(hsl.s * 100),
596
- l = Math.round(hsl.l * 100);
597
- return this._a == 1
598
- ? "hsl(" + h + ", " + s + "%, " + l + "%)"
599
- : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
600
- },
601
- toHex: function (allow3Char) {
602
- return rgbToHex(this._r, this._g, this._b, allow3Char);
603
- },
604
- toHexString: function (allow3Char) {
605
- return "#" + this.toHex(allow3Char);
606
- },
607
- toHex8: function (allow4Char) {
608
- return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
609
- },
610
- toHex8String: function (allow4Char) {
611
- return "#" + this.toHex8(allow4Char);
612
- },
613
- toRgb: function () {
614
- return {
615
- r: Math.round(this._r),
616
- g: Math.round(this._g),
617
- b: Math.round(this._b),
618
- a: this._a,
619
- };
620
- },
621
- toRgbString: function () {
622
- return this._a == 1
623
- ? "rgb(" +
624
- Math.round(this._r) +
625
- ", " +
626
- Math.round(this._g) +
627
- ", " +
628
- Math.round(this._b) +
629
- ")"
630
- : "rgba(" +
631
- Math.round(this._r) +
632
- ", " +
633
- Math.round(this._g) +
634
- ", " +
635
- Math.round(this._b) +
636
- ", " +
637
- this._roundA +
638
- ")";
639
- },
640
- toPercentageRgb: function () {
510
+ // ==================== Private Static Helper Methods ====================
511
+ /**
512
+ * Clamp a value between a minimum and maximum.
513
+ *
514
+ * @param {number} value - The value to clamp.
515
+ * @param {number} min - The minimum allowed value.
516
+ * @param {number} max - The maximum allowed value.
517
+ * @returns {number} The clamped value.
518
+ */
519
+ static clamp(value, min, max) {
520
+ return Math.min(Math.max(value, min), max);
521
+ }
522
+ /**
523
+ * Parse a color string or RGBA object into an RgbaValue.
524
+ *
525
+ * Supported formats:
526
+ * - Hex: #RGB, #RRGGBB, #RRGGBBAA
527
+ * - RGB: rgb(r, g, b)
528
+ * - RGBA: rgba(r, g, b, a)
529
+ * - Object: { r, g, b, a? }
530
+ *
531
+ * @param {string | RgbaValue} color - The color to parse.
532
+ * @returns {RgbaValue} The parsed RGBA value.
533
+ */
534
+ static parseColor(color) {
535
+ if (typeof color === 'object' && 'r' in color && 'g' in color && 'b' in color) {
641
536
  return {
642
- r: Math.round(bound01(this._r, 255) * 100) + "%",
643
- g: Math.round(bound01(this._g, 255) * 100) + "%",
644
- b: Math.round(bound01(this._b, 255) * 100) + "%",
645
- a: this._a,
537
+ r: Math.round(TinyColorPolyfill.clamp(color.r, 0, 255)),
538
+ g: Math.round(TinyColorPolyfill.clamp(color.g, 0, 255)),
539
+ b: Math.round(TinyColorPolyfill.clamp(color.b, 0, 255)),
540
+ a: color.a !== undefined ? TinyColorPolyfill.clamp(color.a, 0, 1) : 1,
646
541
  };
647
- },
648
- toPercentageRgbString: function () {
649
- return this._a == 1
650
- ? "rgb(" +
651
- Math.round(bound01(this._r, 255) * 100) +
652
- "%, " +
653
- Math.round(bound01(this._g, 255) * 100) +
654
- "%, " +
655
- Math.round(bound01(this._b, 255) * 100) +
656
- "%)"
657
- : "rgba(" +
658
- Math.round(bound01(this._r, 255) * 100) +
659
- "%, " +
660
- Math.round(bound01(this._g, 255) * 100) +
661
- "%, " +
662
- Math.round(bound01(this._b, 255) * 100) +
663
- "%, " +
664
- this._roundA +
665
- ")";
666
- },
667
- toName: function () {
668
- if (this._a === 0) {
669
- return "transparent";
670
- }
671
-
672
- if (this._a < 1) {
673
- return false;
674
- }
675
-
676
- return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
677
- },
678
- toFilter: function (secondColor) {
679
- var hex8String = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a);
680
- var secondHex8String = hex8String;
681
- var gradientType = this._gradientType ? "GradientType = 1, " : "";
682
-
683
- if (secondColor) {
684
- var s = tinycolor(secondColor);
685
- secondHex8String = "#" + rgbaToArgbHex(s._r, s._g, s._b, s._a);
686
- }
687
-
688
- return (
689
- "progid:DXImageTransform.Microsoft.gradient(" +
690
- gradientType +
691
- "startColorstr=" +
692
- hex8String +
693
- ",endColorstr=" +
694
- secondHex8String +
695
- ")"
696
- );
697
- },
698
- toString: function (format) {
699
- var formatSet = !!format;
700
- format = format || this._format;
701
-
702
- var formattedString = false;
703
- var hasAlpha = this._a < 1 && this._a >= 0;
704
- var needsAlphaFormat =
705
- !formatSet &&
706
- hasAlpha &&
707
- (format === "hex" ||
708
- format === "hex6" ||
709
- format === "hex3" ||
710
- format === "hex4" ||
711
- format === "hex8" ||
712
- format === "name");
713
-
714
- if (needsAlphaFormat) {
715
- // Special case for "transparent", all other non-alpha formats
716
- // will return rgba when there is transparency.
717
- if (format === "name" && this._a === 0) {
718
- return this.toName();
719
- }
720
- return this.toRgbString();
721
- }
722
- if (format === "rgb") {
723
- formattedString = this.toRgbString();
724
- }
725
- if (format === "prgb") {
726
- formattedString = this.toPercentageRgbString();
727
- }
728
- if (format === "hex" || format === "hex6") {
729
- formattedString = this.toHexString();
730
- }
731
- if (format === "hex3") {
732
- formattedString = this.toHexString(true);
733
- }
734
- if (format === "hex4") {
735
- formattedString = this.toHex8String(true);
736
- }
737
- if (format === "hex8") {
738
- formattedString = this.toHex8String();
739
- }
740
- if (format === "name") {
741
- formattedString = this.toName();
742
- }
743
- if (format === "hsl") {
744
- formattedString = this.toHslString();
745
- }
746
- if (format === "hsv") {
747
- formattedString = this.toHsvString();
748
- }
749
-
750
- return formattedString || this.toHexString();
751
- },
752
- clone: function () {
753
- return tinycolor(this.toString());
754
- },
755
-
756
- _applyModification: function (fn, args) {
757
- var color = fn.apply(null, [this].concat([].slice.call(args)));
758
- this._r = color._r;
759
- this._g = color._g;
760
- this._b = color._b;
761
- this.setAlpha(color._a);
762
- return this;
763
- },
764
- lighten: function () {
765
- return this._applyModification(lighten, arguments);
766
- },
767
- brighten: function () {
768
- return this._applyModification(brighten, arguments);
769
- },
770
- darken: function () {
771
- return this._applyModification(darken, arguments);
772
- },
773
- desaturate: function () {
774
- return this._applyModification(desaturate, arguments);
775
- },
776
- saturate: function () {
777
- return this._applyModification(saturate, arguments);
778
- },
779
- greyscale: function () {
780
- return this._applyModification(greyscale, arguments);
781
- },
782
- spin: function () {
783
- return this._applyModification(spin, arguments);
784
- },
785
-
786
- _applyCombination: function (fn, args) {
787
- return fn.apply(null, [this].concat([].slice.call(args)));
788
- },
789
- analogous: function () {
790
- return this._applyCombination(analogous, arguments);
791
- },
792
- complement: function () {
793
- return this._applyCombination(complement, arguments);
794
- },
795
- monochromatic: function () {
796
- return this._applyCombination(monochromatic, arguments);
797
- },
798
- splitcomplement: function () {
799
- return this._applyCombination(splitcomplement, arguments);
800
- },
801
- // Disabled until https://github.com/bgrins/TinyColor/issues/254
802
- // polyad: function (number) {
803
- // return this._applyCombination(polyad, [number]);
804
- // },
805
- triad: function () {
806
- return this._applyCombination(polyad, [3]);
807
- },
808
- tetrad: function () {
809
- return this._applyCombination(polyad, [4]);
810
- },
811
- };
812
-
813
- // If input is an object, force 1 into "1.0" to handle ratios properly
814
- // String input requires "1.0" as input, so 1 will be treated as 1
815
- tinycolor.fromRatio = function (color, opts) {
816
- if (typeof color == "object") {
817
- var newColor = {};
818
- for (var i in color) {
819
- if (color.hasOwnProperty(i)) {
820
- if (i === "a") {
821
- newColor[i] = color[i];
822
- } else {
823
- newColor[i] = convertToPercentage(color[i]);
824
- }
825
- }
826
- }
827
- color = newColor;
828
542
  }
829
-
830
- return tinycolor(color, opts);
831
- };
832
-
833
- // Given a string or object, convert that input to RGB
834
- // Possible string inputs:
835
- //
836
- // "red"
837
- // "#f00" or "f00"
838
- // "#ff0000" or "ff0000"
839
- // "#ff000000" or "ff000000"
840
- // "rgb 255 0 0" or "rgb (255, 0, 0)"
841
- // "rgb 1.0 0 0" or "rgb (1, 0, 0)"
842
- // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
843
- // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
844
- // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
845
- // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
846
- // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
847
- //
848
- function inputToRGB(color) {
849
- var rgb = { r: 0, g: 0, b: 0 };
850
- var a = 1;
851
- var s = null;
852
- var v = null;
853
- var l = null;
854
- var ok = false;
855
- var format = false;
856
-
857
- if (typeof color == "string") {
858
- color = stringInputToObject(color);
543
+ if (typeof color !== 'string') {
544
+ return { r: 0, g: 0, b: 0, a: 1 };
859
545
  }
860
-
861
- if (typeof color == "object") {
862
- if (
863
- isValidCSSUnit(color.r) &&
864
- isValidCSSUnit(color.g) &&
865
- isValidCSSUnit(color.b)
866
- ) {
867
- rgb = rgbToRgb(color.r, color.g, color.b);
868
- ok = true;
869
- format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
870
- } else if (
871
- isValidCSSUnit(color.h) &&
872
- isValidCSSUnit(color.s) &&
873
- isValidCSSUnit(color.v)
874
- ) {
875
- s = convertToPercentage(color.s);
876
- v = convertToPercentage(color.v);
877
- rgb = hsvToRgb(color.h, s, v);
878
- ok = true;
879
- format = "hsv";
880
- } else if (
881
- isValidCSSUnit(color.h) &&
882
- isValidCSSUnit(color.s) &&
883
- isValidCSSUnit(color.l)
884
- ) {
885
- s = convertToPercentage(color.s);
886
- l = convertToPercentage(color.l);
887
- rgb = hslToRgb(color.h, s, l);
888
- ok = true;
889
- format = "hsl";
890
- }
891
-
892
- if (color.hasOwnProperty("a")) {
893
- a = color.a;
894
- }
546
+ const trimmed = color.trim().toLowerCase();
547
+ // Hex format
548
+ if (trimmed.startsWith('#')) {
549
+ return TinyColorPolyfill.parseHex(trimmed);
550
+ }
551
+ // RGB/RGBA format
552
+ if (trimmed.startsWith('rgb')) {
553
+ return TinyColorPolyfill.parseRgbString(trimmed);
554
+ }
555
+ // Fallback to black for unsupported formats
556
+ return { r: 0, g: 0, b: 0, a: 1 };
557
+ }
558
+ /* eslint-disable spellcheck/spell-checker */
559
+ /**
560
+ * Parse a hex color string into RGBA values.
561
+ *
562
+ * @param {string} hex - The hex color string (e.g., "#fff", "#ffffff", "#ffffffff").
563
+ * @returns {RgbaValue} The parsed RGBA value.
564
+ */
565
+ static parseHex(hex) {
566
+ /* eslint-enable spellcheck/spell-checker */
567
+ // Remove the # prefix
568
+ let hexValue = hex.slice(1);
569
+ // Expand shorthand format (#RGB -> #RRGGBB)
570
+ if (hexValue.length === 3) {
571
+ hexValue = hexValue
572
+ .split('')
573
+ .map((c) => c + c)
574
+ .join('');
575
+ }
576
+ // Handle #RGBA shorthand
577
+ if (hexValue.length === 4) {
578
+ hexValue = hexValue
579
+ .split('')
580
+ .map((c) => c + c)
581
+ .join('');
582
+ }
583
+ const r = parseInt(hexValue.slice(0, 2), 16);
584
+ const g = parseInt(hexValue.slice(2, 4), 16);
585
+ const b = parseInt(hexValue.slice(4, 6), 16);
586
+ let a = 1;
587
+ // Handle #RRGGBBAA format
588
+ if (hexValue.length === 8) {
589
+ a = parseInt(hexValue.slice(6, 8), 16) / 255;
895
590
  }
896
-
897
- a = boundAlpha(a);
898
-
899
591
  return {
900
- ok: ok,
901
- format: color.format || format,
902
- r: Math.min(255, Math.max(rgb.r, 0)),
903
- g: Math.min(255, Math.max(rgb.g, 0)),
904
- b: Math.min(255, Math.max(rgb.b, 0)),
905
- a: a,
592
+ r: Number.isNaN(r) ? 0 : r,
593
+ g: Number.isNaN(g) ? 0 : g,
594
+ b: Number.isNaN(b) ? 0 : b,
595
+ a: Number.isNaN(a) ? 1 : a,
906
596
  };
907
597
  }
908
-
909
- // Conversion Functions
910
- // --------------------
911
-
912
- // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
913
- // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
914
-
915
- // `rgbToRgb`
916
- // Handle bounds / percentage checking to conform to CSS color spec
917
- // <http://www.w3.org/TR/css3-color/>
918
- // *Assumes:* r, g, b in [0, 255] or [0, 1]
919
- // *Returns:* { r, g, b } in [0, 255]
920
- function rgbToRgb(r, g, b) {
598
+ /**
599
+ * Parse an RGB or RGBA string into RGBA values.
600
+ *
601
+ * @param {string} rgbString - The RGB/RGBA string (e.g., "rgb(255, 128, 0)" or "rgba(255, 128, 0, 0.5)").
602
+ * @returns {RgbaValue} The parsed RGBA value.
603
+ */
604
+ static parseRgbString(rgbString) {
605
+ // Match rgb(r, g, b) or rgba(r, g, b, a) with comma-separated integer values.
606
+ // Note: Does NOT support percentage values (e.g., rgb(100%, 50%, 0%)) or
607
+ // modern CSS space-separated syntax (e.g., rgb(255 128 0 / 0.5)).
608
+ const match = rgbString.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+\.?\d*))?\s*\)/);
609
+ if (!match) {
610
+ return { r: 0, g: 0, b: 0, a: 1 };
611
+ }
921
612
  return {
922
- r: bound01(r, 255) * 255,
923
- g: bound01(g, 255) * 255,
924
- b: bound01(b, 255) * 255,
613
+ r: TinyColorPolyfill.clamp(parseInt(match[1], 10), 0, 255),
614
+ g: TinyColorPolyfill.clamp(parseInt(match[2], 10), 0, 255),
615
+ b: TinyColorPolyfill.clamp(parseInt(match[3], 10), 0, 255),
616
+ a: match[4] !== undefined ? TinyColorPolyfill.clamp(parseFloat(match[4]), 0, 1) : 1,
925
617
  };
926
618
  }
927
-
928
- // `rgbToHsl`
929
- // Converts an RGB color value to HSL.
930
- // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
931
- // *Returns:* { h, s, l } in [0,1]
932
- function rgbToHsl(r, g, b) {
933
- r = bound01(r, 255);
934
- g = bound01(g, 255);
935
- b = bound01(b, 255);
936
-
937
- var max = Math.max(r, g, b),
938
- min = Math.min(r, g, b);
939
- var h,
940
- s,
941
- l = (max + min) / 2;
942
-
943
- if (max == min) {
944
- h = s = 0; // achromatic
945
- } else {
946
- var d = max - min;
619
+ /**
620
+ * Convert RGB to HSL.
621
+ *
622
+ * @param {number} r - Red (0-255).
623
+ * @param {number} g - Green (0-255).
624
+ * @param {number} b - Blue (0-255).
625
+ * @returns {HslValue} The HSL values (h: 0-360, s: 0-1, l: 0-1).
626
+ */
627
+ static rgbToHsl(r, g, b) {
628
+ r /= 255;
629
+ g /= 255;
630
+ b /= 255;
631
+ const max = Math.max(r, g, b);
632
+ const min = Math.min(r, g, b);
633
+ const l = (max + min) / 2;
634
+ let h = 0;
635
+ let s = 0;
636
+ if (max !== min) {
637
+ const d = max - min;
947
638
  s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
948
639
  switch (max) {
949
640
  case r:
950
- h = (g - b) / d + (g < b ? 6 : 0);
641
+ h = ((g - b) / d + (g < b ? 6 : 0)) / 6;
951
642
  break;
952
643
  case g:
953
- h = (b - r) / d + 2;
644
+ h = ((b - r) / d + 2) / 6;
954
645
  break;
955
646
  case b:
956
- h = (r - g) / d + 4;
647
+ h = ((r - g) / d + 4) / 6;
957
648
  break;
958
649
  }
959
-
960
- h /= 6;
961
650
  }
962
-
963
- return { h: h, s: s, l: l };
651
+ return { h: h * 360, s, l };
964
652
  }
965
-
966
- // `hslToRgb`
967
- // Converts an HSL color value to RGB.
968
- // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
969
- // *Returns:* { r, g, b } in the set [0, 255]
970
- function hslToRgb(h, s, l) {
971
- var r, g, b;
972
-
973
- h = bound01(h, 360);
974
- s = bound01(s, 100);
975
- l = bound01(l, 100);
976
-
977
- function hue2rgb(p, q, t) {
978
- if (t < 0) t += 1;
979
- if (t > 1) t -= 1;
980
- if (t < 1 / 6) return p + (q - p) * 6 * t;
981
- if (t < 1 / 2) return q;
982
- if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
983
- return p;
984
- }
985
-
653
+ /**
654
+ * Convert HSL to RGB.
655
+ *
656
+ * @param {number} h - Hue (0-360).
657
+ * @param {number} s - Saturation (0-1).
658
+ * @param {number} l - Lightness (0-1).
659
+ * @returns {RgbValue} The RGB values (0-255).
660
+ */
661
+ static hslToRgb(h, s, l) {
662
+ h /= 360;
663
+ let r;
664
+ let g;
665
+ let b;
986
666
  if (s === 0) {
987
- r = g = b = l; // achromatic
988
- } else {
989
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
990
- var p = 2 * l - q;
667
+ r = g = b = l;
668
+ }
669
+ else {
670
+ /**
671
+ * Helper function to convert hue to RGB component.
672
+ *
673
+ * @param {number} p - First intermediate value.
674
+ * @param {number} q - Second intermediate value.
675
+ * @param {number} t - Hue offset value.
676
+ * @returns {number} RGB component value (0-1).
677
+ */
678
+ const hue2rgb = (p, q, t) => {
679
+ if (t < 0)
680
+ t += 1;
681
+ if (t > 1)
682
+ t -= 1;
683
+ if (t < 1 / 6)
684
+ return p + (q - p) * 6 * t;
685
+ if (t < 1 / 2)
686
+ return q;
687
+ if (t < 2 / 3)
688
+ return p + (q - p) * (2 / 3 - t) * 6;
689
+ return p;
690
+ };
691
+ const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
692
+ const p = 2 * l - q;
991
693
  r = hue2rgb(p, q, h + 1 / 3);
992
694
  g = hue2rgb(p, q, h);
993
695
  b = hue2rgb(p, q, h - 1 / 3);
994
696
  }
995
-
996
- return { r: r * 255, g: g * 255, b: b * 255 };
997
- }
998
-
999
- // `rgbToHsv`
1000
- // Converts an RGB color value to HSV
1001
- // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
1002
- // *Returns:* { h, s, v } in [0,1]
1003
- function rgbToHsv(r, g, b) {
1004
- r = bound01(r, 255);
1005
- g = bound01(g, 255);
1006
- b = bound01(b, 255);
1007
-
1008
- var max = Math.max(r, g, b),
1009
- min = Math.min(r, g, b);
1010
- var h,
1011
- s,
1012
- v = max;
1013
-
1014
- var d = max - min;
1015
- s = max === 0 ? 0 : d / max;
1016
-
1017
- if (max == min) {
1018
- h = 0; // achromatic
1019
- } else {
1020
- switch (max) {
1021
- case r:
1022
- h = (g - b) / d + (g < b ? 6 : 0);
1023
- break;
1024
- case g:
1025
- h = (b - r) / d + 2;
1026
- break;
1027
- case b:
1028
- h = (r - g) / d + 4;
1029
- break;
1030
- }
1031
- h /= 6;
1032
- }
1033
- return { h: h, s: s, v: v };
1034
- }
1035
-
1036
- // `hsvToRgb`
1037
- // Converts an HSV color value to RGB.
1038
- // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
1039
- // *Returns:* { r, g, b } in the set [0, 255]
1040
- function hsvToRgb(h, s, v) {
1041
- h = bound01(h, 360) * 6;
1042
- s = bound01(s, 100);
1043
- v = bound01(v, 100);
1044
-
1045
- var i = Math.floor(h),
1046
- f = h - i,
1047
- p = v * (1 - s),
1048
- q = v * (1 - f * s),
1049
- t = v * (1 - (1 - f) * s),
1050
- mod = i % 6,
1051
- r = [v, q, p, p, t, v][mod],
1052
- g = [t, v, v, q, p, p][mod],
1053
- b = [p, p, t, v, v, q][mod];
1054
-
1055
- return { r: r * 255, g: g * 255, b: b * 255 };
1056
- }
1057
-
1058
- // `rgbToHex`
1059
- // Converts an RGB color to hex
1060
- // Assumes r, g, and b are contained in the set [0, 255]
1061
- // Returns a 3 or 6 character hex
1062
- function rgbToHex(r, g, b, allow3Char) {
1063
- var hex = [
1064
- pad2(Math.round(r).toString(16)),
1065
- pad2(Math.round(g).toString(16)),
1066
- pad2(Math.round(b).toString(16)),
1067
- ];
1068
-
1069
- // Return a 3 character hex if possible
1070
- if (
1071
- allow3Char &&
1072
- hex[0].charAt(0) == hex[0].charAt(1) &&
1073
- hex[1].charAt(0) == hex[1].charAt(1) &&
1074
- hex[2].charAt(0) == hex[2].charAt(1)
1075
- ) {
1076
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
1077
- }
1078
-
1079
- return hex.join("");
1080
- }
1081
-
1082
- // `rgbaToHex`
1083
- // Converts an RGBA color plus alpha transparency to hex
1084
- // Assumes r, g, b are contained in the set [0, 255] and
1085
- // a in [0, 1]. Returns a 4 or 8 character rgba hex
1086
- function rgbaToHex(r, g, b, a, allow4Char) {
1087
- var hex = [
1088
- pad2(Math.round(r).toString(16)),
1089
- pad2(Math.round(g).toString(16)),
1090
- pad2(Math.round(b).toString(16)),
1091
- pad2(convertDecimalToHex(a)),
1092
- ];
1093
-
1094
- // Return a 4 character hex if possible
1095
- if (
1096
- allow4Char &&
1097
- hex[0].charAt(0) == hex[0].charAt(1) &&
1098
- hex[1].charAt(0) == hex[1].charAt(1) &&
1099
- hex[2].charAt(0) == hex[2].charAt(1) &&
1100
- hex[3].charAt(0) == hex[3].charAt(1)
1101
- ) {
1102
- return (
1103
- hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0)
1104
- );
1105
- }
1106
-
1107
- return hex.join("");
1108
- }
1109
-
1110
- // `rgbaToArgbHex`
1111
- // Converts an RGBA color to an ARGB Hex8 string
1112
- // Rarely used, but required for "toFilter()"
1113
- function rgbaToArgbHex(r, g, b, a) {
1114
- var hex = [
1115
- pad2(convertDecimalToHex(a)),
1116
- pad2(Math.round(r).toString(16)),
1117
- pad2(Math.round(g).toString(16)),
1118
- pad2(Math.round(b).toString(16)),
1119
- ];
1120
-
1121
- return hex.join("");
1122
- }
1123
-
1124
- // `equals`
1125
- // Can be called with any tinycolor input
1126
- tinycolor.equals = function (color1, color2) {
1127
- if (!color1 || !color2) return false;
1128
- return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
1129
- };
1130
-
1131
- tinycolor.random = function () {
1132
- return tinycolor.fromRatio({
1133
- r: Math.random(),
1134
- g: Math.random(),
1135
- b: Math.random(),
1136
- });
1137
- };
1138
-
1139
- // Modification Functions
1140
- // ----------------------
1141
- // Thanks to less.js for some of the basics here
1142
- // <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
1143
-
1144
- function desaturate(color, amount) {
1145
- amount = amount === 0 ? 0 : amount || 10;
1146
- var hsl = tinycolor(color).toHsl();
1147
- hsl.s -= amount / 100;
1148
- hsl.s = clamp01(hsl.s);
1149
- return tinycolor(hsl);
1150
- }
1151
-
1152
- function saturate(color, amount) {
1153
- amount = amount === 0 ? 0 : amount || 10;
1154
- var hsl = tinycolor(color).toHsl();
1155
- hsl.s += amount / 100;
1156
- hsl.s = clamp01(hsl.s);
1157
- return tinycolor(hsl);
1158
- }
1159
-
1160
- function greyscale(color) {
1161
- return tinycolor(color).desaturate(100);
1162
- }
1163
-
1164
- function lighten(color, amount) {
1165
- amount = amount === 0 ? 0 : amount || 10;
1166
- var hsl = tinycolor(color).toHsl();
1167
- hsl.l += amount / 100;
1168
- hsl.l = clamp01(hsl.l);
1169
- return tinycolor(hsl);
1170
- }
1171
-
1172
- function brighten(color, amount) {
1173
- amount = amount === 0 ? 0 : amount || 10;
1174
- var rgb = tinycolor(color).toRgb();
1175
- rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
1176
- rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
1177
- rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
1178
- return tinycolor(rgb);
1179
- }
1180
-
1181
- function darken(color, amount) {
1182
- amount = amount === 0 ? 0 : amount || 10;
1183
- var hsl = tinycolor(color).toHsl();
1184
- hsl.l -= amount / 100;
1185
- hsl.l = clamp01(hsl.l);
1186
- return tinycolor(hsl);
1187
- }
1188
-
1189
- // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
1190
- // Values outside of this range will be wrapped into this range.
1191
- function spin(color, amount) {
1192
- var hsl = tinycolor(color).toHsl();
1193
- var hue = (hsl.h + amount) % 360;
1194
- hsl.h = hue < 0 ? 360 + hue : hue;
1195
- return tinycolor(hsl);
1196
- }
1197
-
1198
- // Combination Functions
1199
- // ---------------------
1200
- // Thanks to jQuery xColor for some of the ideas behind these
1201
- // <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
1202
-
1203
- function complement(color) {
1204
- var hsl = tinycolor(color).toHsl();
1205
- hsl.h = (hsl.h + 180) % 360;
1206
- return tinycolor(hsl);
1207
- }
1208
-
1209
- function polyad(color, number) {
1210
- if (isNaN(number) || number <= 0) {
1211
- throw new Error("Argument to polyad must be a positive number");
1212
- }
1213
- var hsl = tinycolor(color).toHsl();
1214
- var result = [tinycolor(color)];
1215
- var step = 360 / number;
1216
- for (var i = 1; i < number; i++) {
1217
- result.push(tinycolor({ h: (hsl.h + i * step) % 360, s: hsl.s, l: hsl.l }));
1218
- }
1219
-
1220
- return result;
1221
- }
1222
-
1223
- function splitcomplement(color) {
1224
- var hsl = tinycolor(color).toHsl();
1225
- var h = hsl.h;
1226
- return [
1227
- tinycolor(color),
1228
- tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }),
1229
- tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l }),
1230
- ];
1231
- }
1232
-
1233
- function analogous(color, results, slices) {
1234
- results = results || 6;
1235
- slices = slices || 30;
1236
-
1237
- var hsl = tinycolor(color).toHsl();
1238
- var part = 360 / slices;
1239
- var ret = [tinycolor(color)];
1240
-
1241
- for (hsl.h = (hsl.h - ((part * results) >> 1) + 720) % 360; --results; ) {
1242
- hsl.h = (hsl.h + part) % 360;
1243
- ret.push(tinycolor(hsl));
1244
- }
1245
- return ret;
1246
- }
1247
-
1248
- function monochromatic(color, results) {
1249
- results = results || 6;
1250
- var hsv = tinycolor(color).toHsv();
1251
- var h = hsv.h,
1252
- s = hsv.s,
1253
- v = hsv.v;
1254
- var ret = [];
1255
- var modification = 1 / results;
1256
-
1257
- while (results--) {
1258
- ret.push(tinycolor({ h: h, s: s, v: v }));
1259
- v = (v + modification) % 1;
1260
- }
1261
-
1262
- return ret;
1263
- }
1264
-
1265
- // Utility Functions
1266
- // ---------------------
1267
-
1268
- tinycolor.mix = function (color1, color2, amount) {
1269
- amount = amount === 0 ? 0 : amount || 50;
1270
-
1271
- var rgb1 = tinycolor(color1).toRgb();
1272
- var rgb2 = tinycolor(color2).toRgb();
1273
-
1274
- var p = amount / 100;
1275
-
1276
- var rgba = {
1277
- r: (rgb2.r - rgb1.r) * p + rgb1.r,
1278
- g: (rgb2.g - rgb1.g) * p + rgb1.g,
1279
- b: (rgb2.b - rgb1.b) * p + rgb1.b,
1280
- a: (rgb2.a - rgb1.a) * p + rgb1.a,
697
+ return {
698
+ r: Math.round(r * 255),
699
+ g: Math.round(g * 255),
700
+ b: Math.round(b * 255),
1281
701
  };
1282
-
1283
- return tinycolor(rgba);
1284
- };
1285
-
1286
- // Readability Functions
1287
- // ---------------------
1288
- // <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
1289
-
1290
- // `contrast`
1291
- // Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
1292
- tinycolor.readability = function (color1, color2) {
1293
- var c1 = tinycolor(color1);
1294
- var c2 = tinycolor(color2);
1295
- return (
1296
- (Math.max(c1.getLuminance(), c2.getLuminance()) + 0.05) /
1297
- (Math.min(c1.getLuminance(), c2.getLuminance()) + 0.05)
1298
- );
1299
- };
1300
-
1301
- // `isReadable`
1302
- // Ensure that foreground and background color combinations meet WCAG2 guidelines.
1303
- // The third argument is an optional Object.
1304
- // the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
1305
- // the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
1306
- // If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
1307
-
1308
- // *Example*
1309
- // tinycolor.isReadable("#000", "#111") => false
1310
- // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
1311
- tinycolor.isReadable = function (color1, color2, wcag2) {
1312
- var readability = tinycolor.readability(color1, color2);
1313
- var wcag2Parms, out;
1314
-
1315
- out = false;
1316
-
1317
- wcag2Parms = validateWCAG2Parms(wcag2);
1318
- switch (wcag2Parms.level + wcag2Parms.size) {
1319
- case "AAsmall":
1320
- case "AAAlarge":
1321
- out = readability >= 4.5;
1322
- break;
1323
- case "AAlarge":
1324
- out = readability >= 3;
1325
- break;
1326
- case "AAAsmall":
1327
- out = readability >= 7;
1328
- break;
1329
- }
1330
- return out;
1331
- };
1332
-
1333
- // `mostReadable`
1334
- // Given a base color and a list of possible foreground or background
1335
- // colors for that base, returns the most readable color.
1336
- // Optionally returns Black or White if the most readable color is unreadable.
1337
- // *Example*
1338
- // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
1339
- // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
1340
- // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
1341
- // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
1342
- tinycolor.mostReadable = function (baseColor, colorList, args) {
1343
- var bestColor = null;
1344
- var bestScore = 0;
1345
- var readability;
1346
- var includeFallbackColors, level, size;
1347
- args = args || {};
1348
- includeFallbackColors = args.includeFallbackColors;
1349
- level = args.level;
1350
- size = args.size;
1351
-
1352
- for (var i = 0; i < colorList.length; i++) {
1353
- readability = tinycolor.readability(baseColor, colorList[i]);
1354
- if (readability > bestScore) {
1355
- bestScore = readability;
1356
- bestColor = tinycolor(colorList[i]);
1357
- }
1358
- }
1359
-
1360
- if (
1361
- tinycolor.isReadable(baseColor, bestColor, {
1362
- level: level,
1363
- size: size,
1364
- }) ||
1365
- !includeFallbackColors
1366
- ) {
1367
- return bestColor;
1368
- } else {
1369
- args.includeFallbackColors = false;
1370
- return tinycolor.mostReadable(baseColor, ["#fff", "#000"], args);
1371
- }
1372
- };
1373
-
1374
- // Big List of Colors
1375
- // ------------------
1376
- // <https://www.w3.org/TR/css-color-4/#named-colors>
1377
- var names = (tinycolor.names = {
1378
- aliceblue: "f0f8ff",
1379
- antiquewhite: "faebd7",
1380
- aqua: "0ff",
1381
- aquamarine: "7fffd4",
1382
- azure: "f0ffff",
1383
- beige: "f5f5dc",
1384
- bisque: "ffe4c4",
1385
- black: "000",
1386
- blanchedalmond: "ffebcd",
1387
- blue: "00f",
1388
- blueviolet: "8a2be2",
1389
- brown: "a52a2a",
1390
- burlywood: "deb887",
1391
- burntsienna: "ea7e5d",
1392
- cadetblue: "5f9ea0",
1393
- chartreuse: "7fff00",
1394
- chocolate: "d2691e",
1395
- coral: "ff7f50",
1396
- cornflowerblue: "6495ed",
1397
- cornsilk: "fff8dc",
1398
- crimson: "dc143c",
1399
- cyan: "0ff",
1400
- darkblue: "00008b",
1401
- darkcyan: "008b8b",
1402
- darkgoldenrod: "b8860b",
1403
- darkgray: "a9a9a9",
1404
- darkgreen: "006400",
1405
- darkgrey: "a9a9a9",
1406
- darkkhaki: "bdb76b",
1407
- darkmagenta: "8b008b",
1408
- darkolivegreen: "556b2f",
1409
- darkorange: "ff8c00",
1410
- darkorchid: "9932cc",
1411
- darkred: "8b0000",
1412
- darksalmon: "e9967a",
1413
- darkseagreen: "8fbc8f",
1414
- darkslateblue: "483d8b",
1415
- darkslategray: "2f4f4f",
1416
- darkslategrey: "2f4f4f",
1417
- darkturquoise: "00ced1",
1418
- darkviolet: "9400d3",
1419
- deeppink: "ff1493",
1420
- deepskyblue: "00bfff",
1421
- dimgray: "696969",
1422
- dimgrey: "696969",
1423
- dodgerblue: "1e90ff",
1424
- firebrick: "b22222",
1425
- floralwhite: "fffaf0",
1426
- forestgreen: "228b22",
1427
- fuchsia: "f0f",
1428
- gainsboro: "dcdcdc",
1429
- ghostwhite: "f8f8ff",
1430
- gold: "ffd700",
1431
- goldenrod: "daa520",
1432
- gray: "808080",
1433
- green: "008000",
1434
- greenyellow: "adff2f",
1435
- grey: "808080",
1436
- honeydew: "f0fff0",
1437
- hotpink: "ff69b4",
1438
- indianred: "cd5c5c",
1439
- indigo: "4b0082",
1440
- ivory: "fffff0",
1441
- khaki: "f0e68c",
1442
- lavender: "e6e6fa",
1443
- lavenderblush: "fff0f5",
1444
- lawngreen: "7cfc00",
1445
- lemonchiffon: "fffacd",
1446
- lightblue: "add8e6",
1447
- lightcoral: "f08080",
1448
- lightcyan: "e0ffff",
1449
- lightgoldenrodyellow: "fafad2",
1450
- lightgray: "d3d3d3",
1451
- lightgreen: "90ee90",
1452
- lightgrey: "d3d3d3",
1453
- lightpink: "ffb6c1",
1454
- lightsalmon: "ffa07a",
1455
- lightseagreen: "20b2aa",
1456
- lightskyblue: "87cefa",
1457
- lightslategray: "789",
1458
- lightslategrey: "789",
1459
- lightsteelblue: "b0c4de",
1460
- lightyellow: "ffffe0",
1461
- lime: "0f0",
1462
- limegreen: "32cd32",
1463
- linen: "faf0e6",
1464
- magenta: "f0f",
1465
- maroon: "800000",
1466
- mediumaquamarine: "66cdaa",
1467
- mediumblue: "0000cd",
1468
- mediumorchid: "ba55d3",
1469
- mediumpurple: "9370db",
1470
- mediumseagreen: "3cb371",
1471
- mediumslateblue: "7b68ee",
1472
- mediumspringgreen: "00fa9a",
1473
- mediumturquoise: "48d1cc",
1474
- mediumvioletred: "c71585",
1475
- midnightblue: "191970",
1476
- mintcream: "f5fffa",
1477
- mistyrose: "ffe4e1",
1478
- moccasin: "ffe4b5",
1479
- navajowhite: "ffdead",
1480
- navy: "000080",
1481
- oldlace: "fdf5e6",
1482
- olive: "808000",
1483
- olivedrab: "6b8e23",
1484
- orange: "ffa500",
1485
- orangered: "ff4500",
1486
- orchid: "da70d6",
1487
- palegoldenrod: "eee8aa",
1488
- palegreen: "98fb98",
1489
- paleturquoise: "afeeee",
1490
- palevioletred: "db7093",
1491
- papayawhip: "ffefd5",
1492
- peachpuff: "ffdab9",
1493
- peru: "cd853f",
1494
- pink: "ffc0cb",
1495
- plum: "dda0dd",
1496
- powderblue: "b0e0e6",
1497
- purple: "800080",
1498
- rebeccapurple: "663399",
1499
- red: "f00",
1500
- rosybrown: "bc8f8f",
1501
- royalblue: "4169e1",
1502
- saddlebrown: "8b4513",
1503
- salmon: "fa8072",
1504
- sandybrown: "f4a460",
1505
- seagreen: "2e8b57",
1506
- seashell: "fff5ee",
1507
- sienna: "a0522d",
1508
- silver: "c0c0c0",
1509
- skyblue: "87ceeb",
1510
- slateblue: "6a5acd",
1511
- slategray: "708090",
1512
- slategrey: "708090",
1513
- snow: "fffafa",
1514
- springgreen: "00ff7f",
1515
- steelblue: "4682b4",
1516
- tan: "d2b48c",
1517
- teal: "008080",
1518
- thistle: "d8bfd8",
1519
- tomato: "ff6347",
1520
- turquoise: "40e0d0",
1521
- violet: "ee82ee",
1522
- wheat: "f5deb3",
1523
- white: "fff",
1524
- whitesmoke: "f5f5f5",
1525
- yellow: "ff0",
1526
- yellowgreen: "9acd32",
1527
- });
1528
-
1529
- // Make it easy to access colors via `hexNames[hex]`
1530
- var hexNames = (tinycolor.hexNames = flip(names));
1531
-
1532
- // Utilities
1533
- // ---------
1534
-
1535
- // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
1536
- function flip(o) {
1537
- var flipped = {};
1538
- for (var i in o) {
1539
- if (o.hasOwnProperty(i)) {
1540
- flipped[o[i]] = i;
1541
- }
1542
- }
1543
- return flipped;
1544
702
  }
1545
-
1546
- // Return a valid alpha value [0,1] with all invalid values being set to 1
1547
- function boundAlpha(a) {
1548
- a = parseFloat(a);
1549
-
1550
- if (isNaN(a) || a < 0 || a > 1) {
1551
- a = 1;
1552
- }
1553
-
1554
- return a;
1555
- }
1556
-
1557
- // Take input from [0, n] and return it as [0, 1]
1558
- function bound01(n, max) {
1559
- if (isOnePointZero(n)) n = "100%";
1560
-
1561
- var processPercent = isPercentage(n);
1562
- n = Math.min(max, Math.max(0, parseFloat(n)));
1563
-
1564
- // Automatically convert percentage into number
1565
- if (processPercent) {
1566
- n = parseInt(n * max, 10) / 100;
1567
- }
1568
-
1569
- // Handle floating point rounding errors
1570
- if (Math.abs(n - max) < 0.000001) {
1571
- return 1;
1572
- }
1573
-
1574
- // Convert into [0, 1] range if it isn't already
1575
- return (n % max) / parseFloat(max);
1576
- }
1577
-
1578
- // Force a number between 0 and 1
1579
- function clamp01(val) {
1580
- return Math.min(1, Math.max(0, val));
1581
- }
1582
-
1583
- // Parse a base-16 hex value into a base-10 integer
1584
- function parseIntFromHex(val) {
1585
- return parseInt(val, 16);
703
+ /**
704
+ * Calculate the perceived brightness of a color using the YIQ formula.
705
+ * This matches tinycolor2's brightness calculation.
706
+ *
707
+ * @param {number} r - Red (0-255).
708
+ * @param {number} g - Green (0-255).
709
+ * @param {number} b - Blue (0-255).
710
+ * @returns {number} Brightness value (0-255).
711
+ */
712
+ static getBrightness(r, g, b) {
713
+ return (r * 299 + g * 587 + b * 114) / 1000;
1586
714
  }
1587
-
1588
- // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
1589
- // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
1590
- function isOnePointZero(n) {
1591
- return typeof n == "string" && n.indexOf(".") != -1 && parseFloat(n) === 1;
715
+ // ==================== Public Instance Methods ====================
716
+ /**
717
+ * Check if the color is dark (brightness < 128).
718
+ *
719
+ * @returns {boolean} True if the color is considered dark.
720
+ */
721
+ isDark() {
722
+ return TinyColorPolyfill.getBrightness(this._r, this._g, this._b) < 128;
1592
723
  }
1593
-
1594
- // Check to see if string passed in is a percentage
1595
- function isPercentage(n) {
1596
- return typeof n === "string" && n.indexOf("%") != -1;
724
+ /**
725
+ * Check if the color is light (brightness >= 128).
726
+ *
727
+ * @returns {boolean} True if the color is considered light.
728
+ */
729
+ isLight() {
730
+ return !this.isDark();
1597
731
  }
1598
-
1599
- // Force a hex value to have 2 characters
1600
- function pad2(c) {
1601
- return c.length == 1 ? "0" + c : "" + c;
732
+ /**
733
+ * Create a copy of this color.
734
+ *
735
+ * @returns {TinyColorPolyfill} A new TinyColorPolyfill instance with the same values.
736
+ */
737
+ clone() {
738
+ const cloned = new TinyColorPolyfill({
739
+ r: this._r,
740
+ g: this._g,
741
+ b: this._b,
742
+ a: this._a,
743
+ });
744
+ return cloned;
1602
745
  }
1603
-
1604
- // Replace a decimal with it's percentage value
1605
- function convertToPercentage(n) {
1606
- if (n <= 1) {
1607
- n = n * 100 + "%";
1608
- }
1609
-
1610
- return n;
746
+ /**
747
+ * Lighten the color by a given amount.
748
+ * Note: tinycolor2 accepts negative values to darken.
749
+ *
750
+ * @param {number} amount - The amount to lighten (0-100). Negative values darken.
751
+ * @returns {TinyColorPolyfill} This instance for chaining.
752
+ */
753
+ lighten(amount = 10) {
754
+ const hsl = TinyColorPolyfill.rgbToHsl(this._r, this._g, this._b);
755
+ hsl.l = TinyColorPolyfill.clamp(hsl.l + amount / 100, 0, 1);
756
+ const rgb = TinyColorPolyfill.hslToRgb(hsl.h, hsl.s, hsl.l);
757
+ this._r = rgb.r;
758
+ this._g = rgb.g;
759
+ this._b = rgb.b;
760
+ return this;
1611
761
  }
1612
-
1613
- // Converts a decimal to a hex value
1614
- function convertDecimalToHex(d) {
1615
- return Math.round(parseFloat(d) * 255).toString(16);
762
+ /**
763
+ * Darken the color by a given amount.
764
+ *
765
+ * @param {number} amount - The amount to darken (0-100).
766
+ * @returns {TinyColorPolyfill} This instance for chaining.
767
+ */
768
+ darken(amount = 10) {
769
+ return this.lighten(-amount);
1616
770
  }
1617
- // Converts a hex value to a decimal
1618
- function convertHexToDecimal(h) {
1619
- return parseIntFromHex(h) / 255;
771
+ /**
772
+ * Set the alpha (opacity) of the color.
773
+ *
774
+ * @param {number} alpha - The alpha value (0-1).
775
+ * @returns {TinyColorPolyfill} This instance for chaining.
776
+ */
777
+ setAlpha(alpha) {
778
+ this._a = TinyColorPolyfill.clamp(alpha, 0, 1);
779
+ return this;
1620
780
  }
1621
-
1622
- var matchers = (function () {
1623
- // <http://www.w3.org/TR/css3-values/#integers>
1624
- var CSS_INTEGER = "[-\\+]?\\d+%?";
1625
-
1626
- // <http://www.w3.org/TR/css3-values/#number-value>
1627
- var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
1628
-
1629
- // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
1630
- var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
1631
-
1632
- // Actual matching.
1633
- // Parentheses and commas are optional, but not required.
1634
- // Whitespace can take the place of commas or opening paren
1635
- var PERMISSIVE_MATCH3 =
1636
- "[\\s|\\(]+(" +
1637
- CSS_UNIT +
1638
- ")[,|\\s]+(" +
1639
- CSS_UNIT +
1640
- ")[,|\\s]+(" +
1641
- CSS_UNIT +
1642
- ")\\s*\\)?";
1643
- var PERMISSIVE_MATCH4 =
1644
- "[\\s|\\(]+(" +
1645
- CSS_UNIT +
1646
- ")[,|\\s]+(" +
1647
- CSS_UNIT +
1648
- ")[,|\\s]+(" +
1649
- CSS_UNIT +
1650
- ")[,|\\s]+(" +
1651
- CSS_UNIT +
1652
- ")\\s*\\)?";
1653
-
781
+ /**
782
+ * Get the RGBA representation of the color.
783
+ *
784
+ * @returns {RgbaValue} The RGBA values.
785
+ */
786
+ toRgb() {
1654
787
  return {
1655
- CSS_UNIT: new RegExp(CSS_UNIT),
1656
- rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
1657
- rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
1658
- hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
1659
- hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
1660
- hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
1661
- hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
1662
- hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
1663
- hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
1664
- hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
1665
- hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
788
+ r: this._r,
789
+ g: this._g,
790
+ b: this._b,
791
+ a: this._a,
1666
792
  };
1667
- })();
1668
-
1669
- // `isValidCSSUnit`
1670
- // Take in a single string / number and check to see if it looks like a CSS unit
1671
- // (see `matchers` above for definition).
1672
- function isValidCSSUnit(color) {
1673
- return !!matchers.CSS_UNIT.exec(color);
1674
793
  }
1675
-
1676
- // `stringInputToObject`
1677
- // Permissive string parsing. Take in a number of formats, and output an object
1678
- // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
1679
- function stringInputToObject(color) {
1680
- color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase();
1681
- var named = false;
1682
- if (names[color]) {
1683
- color = names[color];
1684
- named = true;
1685
- } else if (color == "transparent") {
1686
- return { r: 0, g: 0, b: 0, a: 0, format: "name" };
1687
- }
1688
-
1689
- // Try to match string input using regular expressions.
1690
- // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
1691
- // Just return an object and let the conversion functions handle that.
1692
- // This way the result will be the same whether the tinycolor is initialized with string or object.
1693
- var match;
1694
- if ((match = matchers.rgb.exec(color))) {
1695
- return { r: match[1], g: match[2], b: match[3] };
1696
- }
1697
- if ((match = matchers.rgba.exec(color))) {
1698
- return { r: match[1], g: match[2], b: match[3], a: match[4] };
1699
- }
1700
- if ((match = matchers.hsl.exec(color))) {
1701
- return { h: match[1], s: match[2], l: match[3] };
1702
- }
1703
- if ((match = matchers.hsla.exec(color))) {
1704
- return { h: match[1], s: match[2], l: match[3], a: match[4] };
1705
- }
1706
- if ((match = matchers.hsv.exec(color))) {
1707
- return { h: match[1], s: match[2], v: match[3] };
1708
- }
1709
- if ((match = matchers.hsva.exec(color))) {
1710
- return { h: match[1], s: match[2], v: match[3], a: match[4] };
1711
- }
1712
- if ((match = matchers.hex8.exec(color))) {
1713
- return {
1714
- r: parseIntFromHex(match[1]),
1715
- g: parseIntFromHex(match[2]),
1716
- b: parseIntFromHex(match[3]),
1717
- a: convertHexToDecimal(match[4]),
1718
- format: named ? "name" : "hex8",
1719
- };
1720
- }
1721
- if ((match = matchers.hex6.exec(color))) {
1722
- return {
1723
- r: parseIntFromHex(match[1]),
1724
- g: parseIntFromHex(match[2]),
1725
- b: parseIntFromHex(match[3]),
1726
- format: named ? "name" : "hex",
1727
- };
1728
- }
1729
- if ((match = matchers.hex4.exec(color))) {
1730
- return {
1731
- r: parseIntFromHex(match[1] + "" + match[1]),
1732
- g: parseIntFromHex(match[2] + "" + match[2]),
1733
- b: parseIntFromHex(match[3] + "" + match[3]),
1734
- a: convertHexToDecimal(match[4] + "" + match[4]),
1735
- format: named ? "name" : "hex8",
1736
- };
1737
- }
1738
- if ((match = matchers.hex3.exec(color))) {
1739
- return {
1740
- r: parseIntFromHex(match[1] + "" + match[1]),
1741
- g: parseIntFromHex(match[2] + "" + match[2]),
1742
- b: parseIntFromHex(match[3] + "" + match[3]),
1743
- format: named ? "name" : "hex",
1744
- };
1745
- }
1746
-
1747
- return false;
1748
- }
1749
-
1750
- function validateWCAG2Parms(parms) {
1751
- // return valid WCAG2 parms for isReadable.
1752
- // If input parms are invalid, return {"level":"AA", "size":"small"}
1753
- var level, size;
1754
- parms = parms || { level: "AA", size: "small" };
1755
- level = (parms.level || "AA").toUpperCase();
1756
- size = (parms.size || "small").toLowerCase();
1757
- if (level !== "AA" && level !== "AAA") {
1758
- level = "AA";
1759
- }
1760
- if (size !== "small" && size !== "large") {
1761
- size = "small";
1762
- }
1763
- return { level: level, size: size };
1764
- }
1765
-
1766
- return tinycolor;
1767
-
1768
- }));
1769
- });
794
+ }
795
+ /**
796
+ * Factory function to create a TinyColorPolyfill instance.
797
+ * This provides API compatibility with tinycolor2's default export.
798
+ *
799
+ * @param {string | RgbaValue} color - The color to parse.
800
+ * @returns {TinyColorPolyfill} A new TinyColorPolyfill instance.
801
+ */
802
+ function tinycolor(color) {
803
+ return new TinyColorPolyfill(color);
804
+ }
1770
805
 
1771
806
  const formatValue$2 = (tinyColor) => {
1772
807
  if (!tinyColor) {
@@ -2984,16 +2019,17 @@ class ColorSchemaOverridingController {
2984
2019
  * @param {OverrideColor[]} overrideThemes Parsed custom override colors
2985
2020
  */
2986
2021
  applyTheme(overrideThemes) {
2987
- this.getOverrideThemeContainer().innerHTML = `
2988
- :root {
2989
- \t\t${overrideThemes
2022
+ const styleString = `
2023
+ :root {
2024
+ \t\t${overrideThemes
2990
2025
  .filter((item) => {
2991
2026
  return !!item.value;
2992
2027
  })
2993
2028
  .map((item) => `--v-${item.name}: ${item.value};`)
2994
2029
  .join('\n\t\t')}
2995
- }
2996
- `;
2030
+ }
2031
+ `;
2032
+ this.getOverrideThemeContainer().innerHTML = htmlSanitizer.sanitize(styleString, styleSanitizeStrategy);
2997
2033
  }
2998
2034
  /* eslint-disable no-restricted-globals */
2999
2035
  /**
@@ -3333,9 +2369,10 @@ class BrandStyleController extends StyleControllerAbstract {
3333
2369
  generateThemeStyle() {
3334
2370
  this.tokens = Object.assign(LightModeColorTokens, LightModeBorderTokens, LightModeShadowTokens);
3335
2371
  const keys = Object.keys(this.tokens);
3336
- this.getStyleContainer(this.themeStyleContainerKey).innerHTML = `
2372
+ const styleString = `
3337
2373
  :root {
3338
2374
  \t\t${keys.map((key) => `--v-${key}: ${this.tokens[key]};`).join('\n\t\t')}}`;
2375
+ this.getStyleContainer(this.themeStyleContainerKey).innerHTML = htmlSanitizer.sanitize(styleString, styleSanitizeStrategy);
3339
2376
  }
3340
2377
  /**
3341
2378
  * Determines whether the observer should accept changes.
@@ -3368,7 +2405,7 @@ class InternalThemeManager {
3368
2405
  * It removes all the custom override theme styles from the DOM
3369
2406
  */
3370
2407
  reset() {
3371
- VegaColorSchemaOverridingController.getOverrideThemeContainer().innerHTML = '';
2408
+ VegaColorSchemaOverridingController.getOverrideThemeContainer().innerHTML = htmlSanitizer.sanitize('', emptySanitizeStrategy);
3372
2409
  }
3373
2410
  /* eslint-disable no-restricted-globals */
3374
2411
  /**
@@ -3464,9 +2501,10 @@ class DarkModeStyleController extends StyleControllerAbstract {
3464
2501
  const oldTokens = Object.assign(DarkModeColorTokens, DarkModeBorderTokens, DarkModeRingTokens, DarkModeShadowTokens);
3465
2502
  this.darkModeColorAllTokens = Object.assign(VegaInternalThemeManager.getBranding() === 'heartland' ? oldTokens : newBrandTokens, CustomDarkModeColorTokens, this.dynamicCustomDarkModeColor);
3466
2503
  const keys = Object.keys(this.darkModeColorAllTokens);
3467
- this.getStyleContainer(this.themeStyleContainerKey).innerHTML = `
2504
+ const styleString = `
3468
2505
  html.dark {
3469
2506
  \t\t${keys.map((key) => `--v-${key}: ${this.darkModeColorAllTokens[key]};`).join('\n\t\t')}}`;
2507
+ this.getStyleContainer(this.themeStyleContainerKey).innerHTML = htmlSanitizer.sanitize(styleString, styleSanitizeStrategy);
3470
2508
  }
3471
2509
  /**
3472
2510
  * Determines whether the observer should accept changes.