@gradient-ui/core 0.2.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 (296) hide show
  1. package/README.md +272 -0
  2. package/dist/GLoading.vue_vue_type_style_index_0_lang-CqbeZChH.cjs +1 -0
  3. package/dist/GLoading.vue_vue_type_style_index_0_lang-DDqJEYGf.js +691 -0
  4. package/dist/GSwitch.vue_vue_type_script_setup_true_lang-Bufs8uqY.js +5633 -0
  5. package/dist/GSwitch.vue_vue_type_script_setup_true_lang-CH9jX5W1.cjs +4 -0
  6. package/dist/camelToKebabCase-BAESShJ1.cjs +1 -0
  7. package/dist/camelToKebabCase-KgkZ7-1F.js +28 -0
  8. package/dist/components.cjs +1 -0
  9. package/dist/components.mjs +68 -0
  10. package/dist/default-585QCoXx.js +3990 -0
  11. package/dist/default-BcPApP1Q.cjs +318 -0
  12. package/dist/defaults-BlTdRhHs.cjs +1 -0
  13. package/dist/defaults-DMi34V8q.js +51 -0
  14. package/dist/directives.cjs +1 -0
  15. package/dist/directives.mjs +9 -0
  16. package/dist/icon-0-mbYGMr.cjs +1 -0
  17. package/dist/icon-BrFRYYf3.js +66 -0
  18. package/dist/index-B3_n44N_.cjs +1 -0
  19. package/dist/index-BtCLucTD.js +66 -0
  20. package/dist/index-Cs3XQ3JB.js +97 -0
  21. package/dist/index-DN5ngVtp.cjs +1 -0
  22. package/dist/index.cjs +1 -0
  23. package/dist/index.mjs +134 -0
  24. package/dist/mask-BgaDaVWU.js +816 -0
  25. package/dist/mask-pzGv8apS.cjs +1 -0
  26. package/dist/services.cjs +1 -0
  27. package/dist/services.mjs +5 -0
  28. package/dist/style.css +1 -0
  29. package/dist/theme.cjs +1 -0
  30. package/dist/theme.mjs +11 -0
  31. package/dist/types/components/GGroup/GGroup.vue.d.ts +22 -0
  32. package/dist/types/components/GGroup/index.d.ts +1 -0
  33. package/dist/types/components/GGroup/types.d.ts +0 -0
  34. package/dist/types/components/index.d.ts +39 -0
  35. package/dist/types/components/transitions/GExpandTransition.vue.d.ts +240 -0
  36. package/dist/types/components/transitions/GTransition.vue.d.ts +240 -0
  37. package/dist/types/components/transitions/GTransitionGroup.vue.d.ts +224 -0
  38. package/dist/types/components/transitions/TransitionExpansion.vue.d.ts +24 -0
  39. package/dist/types/components/transitions/TransitionOverlay.vue.d.ts +21 -0
  40. package/dist/types/components/transitions/TransitionRotate.vue.d.ts +17 -0
  41. package/dist/types/components/transitions/TransitionScale.vue.d.ts +21 -0
  42. package/dist/types/components/transitions/TransitionStaggerTranslate.vue.d.ts +17 -0
  43. package/dist/types/components/transitions/index.d.ts +3 -0
  44. package/dist/types/components/ui/BaseFloating/BaseFloating.vue.d.ts +245 -0
  45. package/dist/types/components/ui/BaseFloating/index.d.ts +1 -0
  46. package/dist/types/components/ui/BaseFloating/types.d.ts +0 -0
  47. package/dist/types/components/ui/BaseOverlay/BaseOverlay.vue.d.ts +237 -0
  48. package/dist/types/components/ui/BaseOverlay/index.d.ts +1 -0
  49. package/dist/types/components/ui/BaseOverlay/types.d.ts +108 -0
  50. package/dist/types/components/ui/GAction/GAction.vue.d.ts +2 -0
  51. package/dist/types/components/ui/GAction/index.d.ts +1 -0
  52. package/dist/types/components/ui/GAction/types.d.ts +33 -0
  53. package/dist/types/components/ui/GAlert/GAlert.vue.d.ts +96 -0
  54. package/dist/types/components/ui/GAlert/index.d.ts +1 -0
  55. package/dist/types/components/ui/GAlert/types.d.ts +52 -0
  56. package/dist/types/components/ui/GAside/GAside.vue.d.ts +46 -0
  57. package/dist/types/components/ui/GAside/GAsideGroup.vue.d.ts +28 -0
  58. package/dist/types/components/ui/GAside/GAsideItem.vue.d.ts +35 -0
  59. package/dist/types/components/ui/GAside/context.d.ts +15 -0
  60. package/dist/types/components/ui/GAside/groupContext.d.ts +7 -0
  61. package/dist/types/components/ui/GAside/index.d.ts +4 -0
  62. package/dist/types/components/ui/GAside/types.d.ts +262 -0
  63. package/dist/types/components/ui/GBadge/GBadge.vue.d.ts +126 -0
  64. package/dist/types/components/ui/GBadge/index.d.ts +2 -0
  65. package/dist/types/components/ui/GBadge/types.d.ts +75 -0
  66. package/dist/types/components/ui/GButton/GButton.vue.d.ts +496 -0
  67. package/dist/types/components/ui/GButton/index.d.ts +2 -0
  68. package/dist/types/components/ui/GButton/types.d.ts +276 -0
  69. package/dist/types/components/ui/GCheckControl/GCheckControl.vue.d.ts +248 -0
  70. package/dist/types/components/ui/GCheckControl/GCheckGroup.vue.d.ts +190 -0
  71. package/dist/types/components/ui/GCheckControl/GCheckIndicator.vue.d.ts +21 -0
  72. package/dist/types/components/ui/GCheckControl/index.d.ts +3 -0
  73. package/dist/types/components/ui/GCheckbox/GCheckbox.vue.d.ts +228 -0
  74. package/dist/types/components/ui/GCheckbox/index.d.ts +2 -0
  75. package/dist/types/components/ui/GCheckbox/types.d.ts +1 -0
  76. package/dist/types/components/ui/GCheckboxGroup/GCheckboxGroup.vue.d.ts +24 -0
  77. package/dist/types/components/ui/GCheckboxGroup/index.d.ts +2 -0
  78. package/dist/types/components/ui/GCheckboxGroup/types.d.ts +12 -0
  79. package/dist/types/components/ui/GChip/GChip.vue.d.ts +463 -0
  80. package/dist/types/components/ui/GChip/index.d.ts +2 -0
  81. package/dist/types/components/ui/GChip/types.d.ts +257 -0
  82. package/dist/types/components/ui/GDrawer/GDrawer.vue.d.ts +435 -0
  83. package/dist/types/components/ui/GDrawer/index.d.ts +2 -0
  84. package/dist/types/components/ui/GDrawer/types.d.ts +205 -0
  85. package/dist/types/components/ui/GDropdown/GDropdown.vue.d.ts +426 -0
  86. package/dist/types/components/ui/GDropdown/index.d.ts +1 -0
  87. package/dist/types/components/ui/GDropdown/types.d.ts +208 -0
  88. package/dist/types/components/ui/GDropdownGroup/GDropdownGroup.vue.d.ts +29 -0
  89. package/dist/types/components/ui/GDropdownGroup/index.d.ts +2 -0
  90. package/dist/types/components/ui/GDropdownGroup/types.d.ts +10 -0
  91. package/dist/types/components/ui/GDropdownSelect/GDropdownSelect.vue.d.ts +17 -0
  92. package/dist/types/components/ui/GDropdownSelect/index.d.ts +0 -0
  93. package/dist/types/components/ui/GDropdownSelect/types.d.ts +14 -0
  94. package/dist/types/components/ui/GExpansion/GExpansion.vue.d.ts +74 -0
  95. package/dist/types/components/ui/GExpansion/index.d.ts +1 -0
  96. package/dist/types/components/ui/GExpansion/types.d.ts +217 -0
  97. package/dist/types/components/ui/GExpansionGroup/GExpansionGroup.vue.d.ts +32 -0
  98. package/dist/types/components/ui/GExpansionGroup/index.d.ts +1 -0
  99. package/dist/types/components/ui/GExpansionGroup/types.d.ts +58 -0
  100. package/dist/types/components/ui/GFAB/GFAB.vue.d.ts +208 -0
  101. package/dist/types/components/ui/GFAB/index.d.ts +1 -0
  102. package/dist/types/components/ui/GFAB/types.d.ts +128 -0
  103. package/dist/types/components/ui/GFieldBase/GFieldBase.vue.d.ts +243 -0
  104. package/dist/types/components/ui/GFieldBase/props.d.ts +187 -0
  105. package/dist/types/components/ui/GGradient/GGradient.vue.d.ts +269 -0
  106. package/dist/types/components/ui/GGradient/index.d.ts +1 -0
  107. package/dist/types/components/ui/GGradient/types.d.ts +14 -0
  108. package/dist/types/components/ui/GIcon/GIcon.vue.d.ts +31 -0
  109. package/dist/types/components/ui/GIcon/index.d.ts +2 -0
  110. package/dist/types/components/ui/GIcon/sets/MdiIconSet.vue.d.ts +3 -0
  111. package/dist/types/components/ui/GIcon/types.d.ts +24 -0
  112. package/dist/types/components/ui/GIcon.vue.d.ts +6 -0
  113. package/dist/types/components/ui/GInput/GInput.vue.d.ts +267 -0
  114. package/dist/types/components/ui/GInput/SwitchPassword.vue.d.ts +9 -0
  115. package/dist/types/components/ui/GInput/index.d.ts +2 -0
  116. package/dist/types/components/ui/GInput/types.d.ts +8 -0
  117. package/dist/types/components/ui/GLoading/GLoading.vue.d.ts +134 -0
  118. package/dist/types/components/ui/GLoading/types.d.ts +62 -0
  119. package/dist/types/components/ui/GMenu/GMenu.vue.d.ts +93 -0
  120. package/dist/types/components/ui/GMenu/GSubmenu.vue.d.ts +269 -0
  121. package/dist/types/components/ui/GMenu/index.d.ts +1 -0
  122. package/dist/types/components/ui/GMenu/types.d.ts +0 -0
  123. package/dist/types/components/ui/GMenuItem/GMenuItem.vue.d.ts +181 -0
  124. package/dist/types/components/ui/GMenuItem/index.d.ts +0 -0
  125. package/dist/types/components/ui/GMenuItem/types.d.ts +93 -0
  126. package/dist/types/components/ui/GModal/GModal.vue.d.ts +426 -0
  127. package/dist/types/components/ui/GModal/index.d.ts +2 -0
  128. package/dist/types/components/ui/GModal/types.d.ts +198 -0
  129. package/dist/types/components/ui/GNavList/GNavGroup.vue.d.ts +28 -0
  130. package/dist/types/components/ui/GNavList/GNavItem.vue.d.ts +35 -0
  131. package/dist/types/components/ui/GNavList/GNavList.vue.d.ts +38 -0
  132. package/dist/types/components/ui/GNavList/context.d.ts +15 -0
  133. package/dist/types/components/ui/GNavList/groupContext.d.ts +7 -0
  134. package/dist/types/components/ui/GNavList/index.d.ts +4 -0
  135. package/dist/types/components/ui/GNavList/types.d.ts +238 -0
  136. package/dist/types/components/ui/GNavbar/GNavbar.vue.d.ts +34 -0
  137. package/dist/types/components/ui/GNavbar/GNavbarItem.vue.d.ts +39 -0
  138. package/dist/types/components/ui/GNavbar/GNavbarMenu.vue.d.ts +41 -0
  139. package/dist/types/components/ui/GNavbar/GNavbarSubItem.vue.d.ts +40 -0
  140. package/dist/types/components/ui/GNavbar/context.d.ts +17 -0
  141. package/dist/types/components/ui/GNavbar/index.d.ts +5 -0
  142. package/dist/types/components/ui/GNavbar/menuContext.d.ts +9 -0
  143. package/dist/types/components/ui/GNavbar/types.d.ts +330 -0
  144. package/dist/types/components/ui/GProgress/GProgress.vue.d.ts +181 -0
  145. package/dist/types/components/ui/GProgress/index.d.ts +1 -0
  146. package/dist/types/components/ui/GProgress/types.d.ts +108 -0
  147. package/dist/types/components/ui/GQuickActions/GQuickActions.vue.d.ts +46 -0
  148. package/dist/types/components/ui/GQuickActions/index.d.ts +2 -0
  149. package/dist/types/components/ui/GQuickActions/types.d.ts +19 -0
  150. package/dist/types/components/ui/GRadio/GRadio.vue.d.ts +24 -0
  151. package/dist/types/components/ui/GRadio/GRadioItem.vue.d.ts +32 -0
  152. package/dist/types/components/ui/GRadio/index.d.ts +3 -0
  153. package/dist/types/components/ui/GRadio/types.d.ts +12 -0
  154. package/dist/types/components/ui/GSelect/GSelect.vue.d.ts +29 -0
  155. package/dist/types/components/ui/GSelect/index.d.ts +2 -0
  156. package/dist/types/components/ui/GSelect/types.d.ts +32 -0
  157. package/dist/types/components/ui/GSelectItem.vue.d.ts +47 -0
  158. package/dist/types/components/ui/GSnackbar/GSnackbar.vue.d.ts +326 -0
  159. package/dist/types/components/ui/GSnackbar/index.d.ts +2 -0
  160. package/dist/types/components/ui/GSnackbar/types.d.ts +168 -0
  161. package/dist/types/components/ui/GSquircle/GSquircle.vue.d.ts +25 -0
  162. package/dist/types/components/ui/GSquircle/index.d.ts +1 -0
  163. package/dist/types/components/ui/GSquircle/types.d.ts +14 -0
  164. package/dist/types/components/ui/GSwitch/GSwitch.vue.d.ts +228 -0
  165. package/dist/types/components/ui/GSwitch/index.d.ts +2 -0
  166. package/dist/types/components/ui/GSwitch/types.d.ts +1 -0
  167. package/dist/types/components/ui/GTabs/GTab.vue.d.ts +27 -0
  168. package/dist/types/components/ui/GTabs/GTabList.vue.d.ts +38 -0
  169. package/dist/types/components/ui/GTabs/GTabPanel.vue.d.ts +20 -0
  170. package/dist/types/components/ui/GTabs/GTabPanels.vue.d.ts +36 -0
  171. package/dist/types/components/ui/GTabs/GTabs.vue.d.ts +40 -0
  172. package/dist/types/components/ui/GTabs/context.d.ts +28 -0
  173. package/dist/types/components/ui/GTabs/index.d.ts +6 -0
  174. package/dist/types/components/ui/GTabs/types.d.ts +214 -0
  175. package/dist/types/components/ui/GText/GText.vue.d.ts +17 -0
  176. package/dist/types/components/ui/GText/index.d.ts +1 -0
  177. package/dist/types/components/ui/GText/types.d.ts +8 -0
  178. package/dist/types/components/ui/GTextarea/GTextarea.vue.d.ts +234 -0
  179. package/dist/types/components/ui/GTextarea/index.d.ts +2 -0
  180. package/dist/types/components/ui/GTextarea/types.d.ts +6 -0
  181. package/dist/types/components/ui/GToggleButton/GToggleButton.vue.d.ts +303 -0
  182. package/dist/types/components/ui/GToggleButton/index.d.ts +2 -0
  183. package/dist/types/components/ui/GToggleButton/types.d.ts +173 -0
  184. package/dist/types/components/ui/GTooltip/GTooltip.vue.d.ts +359 -0
  185. package/dist/types/components/ui/GTooltip/index.d.ts +1 -0
  186. package/dist/types/components/ui/GTooltip/types.d.ts +179 -0
  187. package/dist/types/directives/gradientIcon.d.ts +4 -0
  188. package/dist/types/directives/gradientText.d.ts +17 -0
  189. package/dist/types/directives/index.d.ts +11 -0
  190. package/dist/types/directives/loading.d.ts +19 -0
  191. package/dist/types/directives/mask.d.ts +13 -0
  192. package/dist/types/directives/ripple.d.ts +30 -0
  193. package/dist/types/directives/tooltip.d.ts +10 -0
  194. package/dist/types/index.d.ts +21 -0
  195. package/dist/types/services/index.d.ts +2 -0
  196. package/dist/types/services/useLoading.d.ts +8 -0
  197. package/dist/types/services/useSnackbar.d.ts +22 -0
  198. package/dist/types/theme/changeTone.d.ts +1 -0
  199. package/dist/types/theme/colorPallete.d.ts +2 -0
  200. package/dist/types/theme/colorSeeds.d.ts +21 -0
  201. package/dist/types/theme/default.d.ts +97 -0
  202. package/dist/types/theme/generateColors.d.ts +1 -0
  203. package/dist/types/theme/generateGradient.d.ts +9 -0
  204. package/dist/types/theme/getComplementaryColor.d.ts +1 -0
  205. package/dist/types/theme/index.d.ts +1 -0
  206. package/dist/types/types/Colors.d.ts +2 -0
  207. package/dist/types/types/CommonTypes.d.ts +26 -0
  208. package/dist/types/types/UtilityTypes.d.ts +2 -0
  209. package/dist/types/use/PLA.d.ts +101 -0
  210. package/dist/types/use/actionProps.d.ts +38 -0
  211. package/dist/types/use/actionSurface.d.ts +123 -0
  212. package/dist/types/use/appendTarget.d.ts +4 -0
  213. package/dist/types/use/bodyScrollLock.d.ts +2 -0
  214. package/dist/types/use/booleanProp.d.ts +2 -0
  215. package/dist/types/use/breakpoints/index.d.ts +27 -0
  216. package/dist/types/use/check/booleanControl.d.ts +61 -0
  217. package/dist/types/use/check/groupFocus.d.ts +17 -0
  218. package/dist/types/use/check/index.d.ts +6 -0
  219. package/dist/types/use/check/optionGroup.d.ts +34 -0
  220. package/dist/types/use/check/selection.d.ts +2 -0
  221. package/dist/types/use/check/types.d.ts +496 -0
  222. package/dist/types/use/color.d.ts +20 -0
  223. package/dist/types/use/colorResolver.d.ts +6 -0
  224. package/dist/types/use/controllableOpen.d.ts +10 -0
  225. package/dist/types/use/defaults.d.ts +12 -0
  226. package/dist/types/use/disabled.d.ts +12 -0
  227. package/dist/types/use/dropdownContext.d.ts +9 -0
  228. package/dist/types/use/expansion/controller.d.ts +12 -0
  229. package/dist/types/use/expansion/di.d.ts +5 -0
  230. package/dist/types/use/expansion/index.d.ts +3 -0
  231. package/dist/types/use/expansion/types.d.ts +11 -0
  232. package/dist/types/use/floating.d.ts +120 -0
  233. package/dist/types/use/floatingDismiss.d.ts +10 -0
  234. package/dist/types/use/floatingLayer.d.ts +12 -0
  235. package/dist/types/use/floatingTrigger.d.ts +27 -0
  236. package/dist/types/use/focused.d.ts +12 -0
  237. package/dist/types/use/form/control.d.ts +17 -0
  238. package/dist/types/use/form/props.d.ts +69 -0
  239. package/dist/types/use/form/textFieldComponent.d.ts +14 -0
  240. package/dist/types/use/form/textFieldControl.d.ts +63 -0
  241. package/dist/types/use/gradient.d.ts +224 -0
  242. package/dist/types/use/gradientGlow.d.ts +48 -0
  243. package/dist/types/use/gradientSurface.d.ts +23 -0
  244. package/dist/types/use/group/di.d.ts +5 -0
  245. package/dist/types/use/group/groupController.d.ts +10 -0
  246. package/dist/types/use/group/types.d.ts +9 -0
  247. package/dist/types/use/highlighted.d.ts +12 -0
  248. package/dist/types/use/icon.d.ts +22 -0
  249. package/dist/types/use/index.d.ts +4 -0
  250. package/dist/types/use/input/control.d.ts +10 -0
  251. package/dist/types/use/input/emits.d.ts +8 -0
  252. package/dist/types/use/input/index.d.ts +4 -0
  253. package/dist/types/use/input/props.d.ts +124 -0
  254. package/dist/types/use/items.d.ts +20 -0
  255. package/dist/types/use/layerStack.d.ts +15 -0
  256. package/dist/types/use/mask/index.d.ts +24 -0
  257. package/dist/types/use/menu.d.ts +49 -0
  258. package/dist/types/use/menuContext.d.ts +6 -0
  259. package/dist/types/use/open.d.ts +2 -0
  260. package/dist/types/use/overlay.d.ts +111 -0
  261. package/dist/types/use/placement.d.ts +16 -0
  262. package/dist/types/use/px.d.ts +4 -0
  263. package/dist/types/use/rounded.d.ts +12 -0
  264. package/dist/types/use/routerLink.d.ts +10 -0
  265. package/dist/types/use/select/controller.d.ts +18 -0
  266. package/dist/types/use/select/items.d.ts +14 -0
  267. package/dist/types/use/select/menuItems.d.ts +11 -0
  268. package/dist/types/use/select/menuSlot.d.ts +5 -0
  269. package/dist/types/use/select/selection.d.ts +12 -0
  270. package/dist/types/use/select/selectionController.d.ts +19 -0
  271. package/dist/types/use/select/selectionSummary.d.ts +7 -0
  272. package/dist/types/use/select/types.d.ts +24 -0
  273. package/dist/types/use/selected.d.ts +17 -0
  274. package/dist/types/use/selectionModel.d.ts +19 -0
  275. package/dist/types/use/size.d.ts +16 -0
  276. package/dist/types/use/slots.d.ts +15 -0
  277. package/dist/types/use/state.d.ts +13 -0
  278. package/dist/types/use/surface.d.ts +80 -0
  279. package/dist/types/use/surfaceColor.d.ts +18 -0
  280. package/dist/types/use/textarea/index.d.ts +2 -0
  281. package/dist/types/use/textarea/props.d.ts +105 -0
  282. package/dist/types/use/transition.d.ts +156 -0
  283. package/dist/types/use/variant.d.ts +16 -0
  284. package/dist/types/use/visibleProps.d.ts +1 -0
  285. package/dist/types/use/zIndex.d.ts +10 -0
  286. package/dist/types/utils/camelToKebabCase.d.ts +1 -0
  287. package/dist/types/utils/color.d.ts +3 -0
  288. package/dist/types/utils/colors/normaliseColor.d.ts +5 -0
  289. package/dist/types/utils/createComponentId.d.ts +1 -0
  290. package/dist/types/utils/createId.d.ts +1 -0
  291. package/dist/types/utils/propsFactory.d.ts +29 -0
  292. package/dist/use.cjs +1 -0
  293. package/dist/use.mjs +22 -0
  294. package/dist/useSnackbar-CFrWSpt4.cjs +1 -0
  295. package/dist/useSnackbar-lGrTDbl-.js +763 -0
  296. package/package.json +170 -0
@@ -0,0 +1,3990 @@
1
+ import { M as Ee, c as yt } from "./camelToKebabCase-KgkZ7-1F.js";
2
+ import { ref as je, shallowRef as Pt, provide as kt, inject as bt } from "vue";
3
+ /**
4
+ * @license
5
+ * Copyright 2021 Google LLC
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ function j(r) {
20
+ return r < 0 ? -1 : r === 0 ? 0 : 1;
21
+ }
22
+ function fe(r, e, t) {
23
+ return (1 - t) * r + t * e;
24
+ }
25
+ function St(r, e, t) {
26
+ return t < r ? r : t > e ? e : t;
27
+ }
28
+ function U(r, e, t) {
29
+ return t < r ? r : t > e ? e : t;
30
+ }
31
+ function be(r) {
32
+ return r = r % 360, r < 0 && (r = r + 360), r;
33
+ }
34
+ function Ct(r, e) {
35
+ return be(e - r) <= 180 ? 1 : -1;
36
+ }
37
+ function Tt(r, e) {
38
+ return 180 - Math.abs(Math.abs(r - e) - 180);
39
+ }
40
+ function Le(r, e) {
41
+ const t = r[0] * e[0][0] + r[1] * e[0][1] + r[2] * e[0][2], n = r[0] * e[1][0] + r[1] * e[1][1] + r[2] * e[1][2], a = r[0] * e[2][0] + r[1] * e[2][1] + r[2] * e[2][2];
42
+ return [t, n, a];
43
+ }
44
+ /**
45
+ * @license
46
+ * Copyright 2021 Google LLC
47
+ *
48
+ * Licensed under the Apache License, Version 2.0 (the "License");
49
+ * you may not use this file except in compliance with the License.
50
+ * You may obtain a copy of the License at
51
+ *
52
+ * http://www.apache.org/licenses/LICENSE-2.0
53
+ *
54
+ * Unless required by applicable law or agreed to in writing, software
55
+ * distributed under the License is distributed on an "AS IS" BASIS,
56
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
57
+ * See the License for the specific language governing permissions and
58
+ * limitations under the License.
59
+ */
60
+ const vt = [
61
+ [0.41233895, 0.35762064, 0.18051042],
62
+ [0.2126, 0.7152, 0.0722],
63
+ [0.01932141, 0.11916382, 0.95034478]
64
+ ], Dt = [
65
+ [
66
+ 3.2413774792388685,
67
+ -1.5376652402851851,
68
+ -0.49885366846268053
69
+ ],
70
+ [
71
+ -0.9691452513005321,
72
+ 1.8758853451067872,
73
+ 0.04156585616912061
74
+ ],
75
+ [
76
+ 0.05562093689691305,
77
+ -0.20395524564742123,
78
+ 1.0571799111220335
79
+ ]
80
+ ], wt = [95.047, 100, 108.883];
81
+ function Se(r, e, t) {
82
+ return (255 << 24 | (r & 255) << 16 | (e & 255) << 8 | t & 255) >>> 0;
83
+ }
84
+ function Ke(r) {
85
+ const e = ie(r[0]), t = ie(r[1]), n = ie(r[2]);
86
+ return Se(e, t, n);
87
+ }
88
+ function at(r) {
89
+ return r >> 16 & 255;
90
+ }
91
+ function ot(r) {
92
+ return r >> 8 & 255;
93
+ }
94
+ function it(r) {
95
+ return r & 255;
96
+ }
97
+ function Ft(r, e, t) {
98
+ const n = Dt, a = n[0][0] * r + n[0][1] * e + n[0][2] * t, o = n[1][0] * r + n[1][1] * e + n[1][2] * t, i = n[2][0] * r + n[2][1] * e + n[2][2] * t, u = ie(a), l = ie(o), h = ie(i);
99
+ return Se(u, l, h);
100
+ }
101
+ function xt(r) {
102
+ const e = le(at(r)), t = le(ot(r)), n = le(it(r));
103
+ return Le([e, t, n], vt);
104
+ }
105
+ function Mt(r) {
106
+ const e = ae(r), t = ie(e);
107
+ return Se(t, t, t);
108
+ }
109
+ function Oe(r) {
110
+ const e = xt(r)[1];
111
+ return 116 * st(e / 100) - 16;
112
+ }
113
+ function ae(r) {
114
+ return 100 * At((r + 16) / 116);
115
+ }
116
+ function Re(r) {
117
+ return st(r / 100) * 116 - 16;
118
+ }
119
+ function le(r) {
120
+ const e = r / 255;
121
+ return e <= 0.040449936 ? e / 12.92 * 100 : Math.pow((e + 0.055) / 1.055, 2.4) * 100;
122
+ }
123
+ function ie(r) {
124
+ const e = r / 100;
125
+ let t = 0;
126
+ return e <= 31308e-7 ? t = e * 12.92 : t = 1.055 * Math.pow(e, 1 / 2.4) - 0.055, St(0, 255, Math.round(t * 255));
127
+ }
128
+ function Bt() {
129
+ return wt;
130
+ }
131
+ function st(r) {
132
+ const e = 0.008856451679035631, t = 24389 / 27;
133
+ return r > e ? Math.pow(r, 1 / 3) : (t * r + 16) / 116;
134
+ }
135
+ function At(r) {
136
+ const e = 0.008856451679035631, t = 24389 / 27, n = r * r * r;
137
+ return n > e ? n : (116 * r - 16) / t;
138
+ }
139
+ /**
140
+ * @license
141
+ * Copyright 2021 Google LLC
142
+ *
143
+ * Licensed under the Apache License, Version 2.0 (the "License");
144
+ * you may not use this file except in compliance with the License.
145
+ * You may obtain a copy of the License at
146
+ *
147
+ * http://www.apache.org/licenses/LICENSE-2.0
148
+ *
149
+ * Unless required by applicable law or agreed to in writing, software
150
+ * distributed under the License is distributed on an "AS IS" BASIS,
151
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
152
+ * See the License for the specific language governing permissions and
153
+ * limitations under the License.
154
+ */
155
+ class J {
156
+ /**
157
+ * Create ViewingConditions from a simple, physically relevant, set of
158
+ * parameters.
159
+ *
160
+ * @param whitePoint White point, measured in the XYZ color space.
161
+ * default = D65, or sunny day afternoon
162
+ * @param adaptingLuminance The luminance of the adapting field. Informally,
163
+ * how bright it is in the room where the color is viewed. Can be
164
+ * calculated from lux by multiplying lux by 0.0586. default = 11.72,
165
+ * or 200 lux.
166
+ * @param backgroundLstar The lightness of the area surrounding the color.
167
+ * measured by L* in L*a*b*. default = 50.0
168
+ * @param surround A general description of the lighting surrounding the
169
+ * color. 0 is pitch dark, like watching a movie in a theater. 1.0 is a
170
+ * dimly light room, like watching TV at home at night. 2.0 means there
171
+ * is no difference between the lighting on the color and around it.
172
+ * default = 2.0
173
+ * @param discountingIlluminant Whether the eye accounts for the tint of the
174
+ * ambient lighting, such as knowing an apple is still red in green light.
175
+ * default = false, the eye does not perform this process on
176
+ * self-luminous objects like displays.
177
+ */
178
+ static make(e = Bt(), t = 200 / Math.PI * ae(50) / 100, n = 50, a = 2, o = !1) {
179
+ const i = e, u = i[0] * 0.401288 + i[1] * 0.650173 + i[2] * -0.051461, l = i[0] * -0.250268 + i[1] * 1.204414 + i[2] * 0.045854, h = i[0] * -2079e-6 + i[1] * 0.048952 + i[2] * 0.953127, f = 0.8 + a / 10, g = f >= 0.9 ? fe(0.59, 0.69, (f - 0.9) * 10) : fe(0.525, 0.59, (f - 0.8) * 10);
180
+ let p = o ? 1 : f * (1 - 1 / 3.6 * Math.exp((-t - 42) / 92));
181
+ p = p > 1 ? 1 : p < 0 ? 0 : p;
182
+ const v = f, m = [
183
+ p * (100 / u) + 1 - p,
184
+ p * (100 / l) + 1 - p,
185
+ p * (100 / h) + 1 - p
186
+ ], P = 1 / (5 * t + 1), k = P * P * P * P, B = 1 - k, x = k * t + 0.1 * B * B * Math.cbrt(5 * t), O = ae(n) / e[1], R = 1.48 + Math.sqrt(O), V = 0.725 / Math.pow(O, 0.2), I = V, F = [
187
+ Math.pow(x * m[0] * u / 100, 0.42),
188
+ Math.pow(x * m[1] * l / 100, 0.42),
189
+ Math.pow(x * m[2] * h / 100, 0.42)
190
+ ], L = [
191
+ 400 * F[0] / (F[0] + 27.13),
192
+ 400 * F[1] / (F[1] + 27.13),
193
+ 400 * F[2] / (F[2] + 27.13)
194
+ ], z = (2 * L[0] + L[1] + 0.05 * L[2]) * V;
195
+ return new J(O, z, V, I, g, v, m, x, Math.pow(x, 0.25), R);
196
+ }
197
+ /**
198
+ * Parameters are intermediate values of the CAM16 conversion process. Their
199
+ * names are shorthand for technical color science terminology, this class
200
+ * would not benefit from documenting them individually. A brief overview
201
+ * is available in the CAM16 specification, and a complete overview requires
202
+ * a color science textbook, such as Fairchild's Color Appearance Models.
203
+ */
204
+ constructor(e, t, n, a, o, i, u, l, h, f) {
205
+ this.n = e, this.aw = t, this.nbb = n, this.ncb = a, this.c = o, this.nc = i, this.rgbD = u, this.fl = l, this.fLRoot = h, this.z = f;
206
+ }
207
+ }
208
+ J.DEFAULT = J.make();
209
+ /**
210
+ * @license
211
+ * Copyright 2021 Google LLC
212
+ *
213
+ * Licensed under the Apache License, Version 2.0 (the "License");
214
+ * you may not use this file except in compliance with the License.
215
+ * You may obtain a copy of the License at
216
+ *
217
+ * http://www.apache.org/licenses/LICENSE-2.0
218
+ *
219
+ * Unless required by applicable law or agreed to in writing, software
220
+ * distributed under the License is distributed on an "AS IS" BASIS,
221
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
222
+ * See the License for the specific language governing permissions and
223
+ * limitations under the License.
224
+ */
225
+ class H {
226
+ /**
227
+ * All of the CAM16 dimensions can be calculated from 3 of the dimensions, in
228
+ * the following combinations:
229
+ * - {j or q} and {c, m, or s} and hue
230
+ * - jstar, astar, bstar
231
+ * Prefer using a static method that constructs from 3 of those dimensions.
232
+ * This constructor is intended for those methods to use to return all
233
+ * possible dimensions.
234
+ *
235
+ * @param hue
236
+ * @param chroma informally, colorfulness / color intensity. like saturation
237
+ * in HSL, except perceptually accurate.
238
+ * @param j lightness
239
+ * @param q brightness; ratio of lightness to white point's lightness
240
+ * @param m colorfulness
241
+ * @param s saturation; ratio of chroma to white point's chroma
242
+ * @param jstar CAM16-UCS J coordinate
243
+ * @param astar CAM16-UCS a coordinate
244
+ * @param bstar CAM16-UCS b coordinate
245
+ */
246
+ constructor(e, t, n, a, o, i, u, l, h) {
247
+ this.hue = e, this.chroma = t, this.j = n, this.q = a, this.m = o, this.s = i, this.jstar = u, this.astar = l, this.bstar = h;
248
+ }
249
+ /**
250
+ * CAM16 instances also have coordinates in the CAM16-UCS space, called J*,
251
+ * a*, b*, or jstar, astar, bstar in code. CAM16-UCS is included in the CAM16
252
+ * specification, and is used to measure distances between colors.
253
+ */
254
+ distance(e) {
255
+ const t = this.jstar - e.jstar, n = this.astar - e.astar, a = this.bstar - e.bstar, o = Math.sqrt(t * t + n * n + a * a);
256
+ return 1.41 * Math.pow(o, 0.63);
257
+ }
258
+ /**
259
+ * @param argb ARGB representation of a color.
260
+ * @return CAM16 color, assuming the color was viewed in default viewing
261
+ * conditions.
262
+ */
263
+ static fromInt(e) {
264
+ return H.fromIntInViewingConditions(e, J.DEFAULT);
265
+ }
266
+ /**
267
+ * @param argb ARGB representation of a color.
268
+ * @param viewingConditions Information about the environment where the color
269
+ * was observed.
270
+ * @return CAM16 color.
271
+ */
272
+ static fromIntInViewingConditions(e, t) {
273
+ const n = (e & 16711680) >> 16, a = (e & 65280) >> 8, o = e & 255, i = le(n), u = le(a), l = le(o), h = 0.41233895 * i + 0.35762064 * u + 0.18051042 * l, f = 0.2126 * i + 0.7152 * u + 0.0722 * l, g = 0.01932141 * i + 0.11916382 * u + 0.95034478 * l, p = 0.401288 * h + 0.650173 * f - 0.051461 * g, v = -0.250268 * h + 1.204414 * f + 0.045854 * g, m = -2079e-6 * h + 0.048952 * f + 0.953127 * g, P = t.rgbD[0] * p, k = t.rgbD[1] * v, B = t.rgbD[2] * m, x = Math.pow(t.fl * Math.abs(P) / 100, 0.42), O = Math.pow(t.fl * Math.abs(k) / 100, 0.42), R = Math.pow(t.fl * Math.abs(B) / 100, 0.42), V = j(P) * 400 * x / (x + 27.13), I = j(k) * 400 * O / (O + 27.13), F = j(B) * 400 * R / (R + 27.13), L = (11 * V + -12 * I + F) / 11, z = (V + I - 2 * F) / 9, E = (20 * V + 20 * I + 21 * F) / 20, W = (40 * V + 20 * I + F) / 20, ce = Math.atan2(z, L) * 180 / Math.PI, q = be(ce), me = q * Math.PI / 180, ge = W * t.nbb, re = 100 * Math.pow(ge / t.aw, t.c * t.z), ye = 4 / t.c * Math.sqrt(re / 100) * (t.aw + 4) * t.fLRoot, Te = q < 20.14 ? q + 360 : q, ve = 0.25 * (Math.cos(Te * Math.PI / 180 + 2) + 3.8), we = 5e4 / 13 * ve * t.nc * t.ncb * Math.sqrt(L * L + z * z) / (E + 0.305), Pe = Math.pow(we, 0.9) * Math.pow(1.64 - Math.pow(0.29, t.n), 0.73), Ue = Pe * Math.sqrt(re / 100), $e = Ue * t.fLRoot, dt = 50 * Math.sqrt(Pe * t.c / (t.aw + 4)), pt = (1 + 100 * 7e-3) * re / (1 + 7e-3 * re), Ye = 1 / 0.0228 * Math.log(1 + 0.0228 * $e), mt = Ye * Math.cos(me), gt = Ye * Math.sin(me);
274
+ return new H(q, Ue, re, ye, $e, dt, pt, mt, gt);
275
+ }
276
+ /**
277
+ * @param j CAM16 lightness
278
+ * @param c CAM16 chroma
279
+ * @param h CAM16 hue
280
+ */
281
+ static fromJch(e, t, n) {
282
+ return H.fromJchInViewingConditions(e, t, n, J.DEFAULT);
283
+ }
284
+ /**
285
+ * @param j CAM16 lightness
286
+ * @param c CAM16 chroma
287
+ * @param h CAM16 hue
288
+ * @param viewingConditions Information about the environment where the color
289
+ * was observed.
290
+ */
291
+ static fromJchInViewingConditions(e, t, n, a) {
292
+ const o = 4 / a.c * Math.sqrt(e / 100) * (a.aw + 4) * a.fLRoot, i = t * a.fLRoot, u = t / Math.sqrt(e / 100), l = 50 * Math.sqrt(u * a.c / (a.aw + 4)), h = n * Math.PI / 180, f = (1 + 100 * 7e-3) * e / (1 + 7e-3 * e), g = 1 / 0.0228 * Math.log(1 + 0.0228 * i), p = g * Math.cos(h), v = g * Math.sin(h);
293
+ return new H(n, t, e, o, i, l, f, p, v);
294
+ }
295
+ /**
296
+ * @param jstar CAM16-UCS lightness.
297
+ * @param astar CAM16-UCS a dimension. Like a* in L*a*b*, it is a Cartesian
298
+ * coordinate on the Y axis.
299
+ * @param bstar CAM16-UCS b dimension. Like a* in L*a*b*, it is a Cartesian
300
+ * coordinate on the X axis.
301
+ */
302
+ static fromUcs(e, t, n) {
303
+ return H.fromUcsInViewingConditions(e, t, n, J.DEFAULT);
304
+ }
305
+ /**
306
+ * @param jstar CAM16-UCS lightness.
307
+ * @param astar CAM16-UCS a dimension. Like a* in L*a*b*, it is a Cartesian
308
+ * coordinate on the Y axis.
309
+ * @param bstar CAM16-UCS b dimension. Like a* in L*a*b*, it is a Cartesian
310
+ * coordinate on the X axis.
311
+ * @param viewingConditions Information about the environment where the color
312
+ * was observed.
313
+ */
314
+ static fromUcsInViewingConditions(e, t, n, a) {
315
+ const o = t, i = n, u = Math.sqrt(o * o + i * i), h = (Math.exp(u * 0.0228) - 1) / 0.0228 / a.fLRoot;
316
+ let f = Math.atan2(i, o) * (180 / Math.PI);
317
+ f < 0 && (f += 360);
318
+ const g = e / (1 - (e - 100) * 7e-3);
319
+ return H.fromJchInViewingConditions(g, h, f, a);
320
+ }
321
+ /**
322
+ * @return ARGB representation of color, assuming the color was viewed in
323
+ * default viewing conditions, which are near-identical to the default
324
+ * viewing conditions for sRGB.
325
+ */
326
+ toInt() {
327
+ return this.viewed(J.DEFAULT);
328
+ }
329
+ /**
330
+ * @param viewingConditions Information about the environment where the color
331
+ * will be viewed.
332
+ * @return ARGB representation of color
333
+ */
334
+ viewed(e) {
335
+ const t = this.chroma === 0 || this.j === 0 ? 0 : this.chroma / Math.sqrt(this.j / 100), n = Math.pow(t / Math.pow(1.64 - Math.pow(0.29, e.n), 0.73), 1 / 0.9), a = this.hue * Math.PI / 180, o = 0.25 * (Math.cos(a + 2) + 3.8), i = e.aw * Math.pow(this.j / 100, 1 / e.c / e.z), u = o * (5e4 / 13) * e.nc * e.ncb, l = i / e.nbb, h = Math.sin(a), f = Math.cos(a), g = 23 * (l + 0.305) * n / (23 * u + 11 * n * f + 108 * n * h), p = g * f, v = g * h, m = (460 * l + 451 * p + 288 * v) / 1403, P = (460 * l - 891 * p - 261 * v) / 1403, k = (460 * l - 220 * p - 6300 * v) / 1403, B = Math.max(0, 27.13 * Math.abs(m) / (400 - Math.abs(m))), x = j(m) * (100 / e.fl) * Math.pow(B, 1 / 0.42), O = Math.max(0, 27.13 * Math.abs(P) / (400 - Math.abs(P))), R = j(P) * (100 / e.fl) * Math.pow(O, 1 / 0.42), V = Math.max(0, 27.13 * Math.abs(k) / (400 - Math.abs(k))), I = j(k) * (100 / e.fl) * Math.pow(V, 1 / 0.42), F = x / e.rgbD[0], L = R / e.rgbD[1], z = I / e.rgbD[2], E = 1.86206786 * F - 1.01125463 * L + 0.14918677 * z, W = 0.38752654 * F + 0.62144744 * L - 897398e-8 * z, te = -0.0158415 * F - 0.03412294 * L + 1.04996444 * z;
336
+ return Ft(E, W, te);
337
+ }
338
+ /// Given color expressed in XYZ and viewed in [viewingConditions], convert to
339
+ /// CAM16.
340
+ static fromXyzInViewingConditions(e, t, n, a) {
341
+ const o = 0.401288 * e + 0.650173 * t - 0.051461 * n, i = -0.250268 * e + 1.204414 * t + 0.045854 * n, u = -2079e-6 * e + 0.048952 * t + 0.953127 * n, l = a.rgbD[0] * o, h = a.rgbD[1] * i, f = a.rgbD[2] * u, g = Math.pow(a.fl * Math.abs(l) / 100, 0.42), p = Math.pow(a.fl * Math.abs(h) / 100, 0.42), v = Math.pow(a.fl * Math.abs(f) / 100, 0.42), m = j(l) * 400 * g / (g + 27.13), P = j(h) * 400 * p / (p + 27.13), k = j(f) * 400 * v / (v + 27.13), B = (11 * m + -12 * P + k) / 11, x = (m + P - 2 * k) / 9, O = (20 * m + 20 * P + 21 * k) / 20, R = (40 * m + 20 * P + k) / 20, I = Math.atan2(x, B) * 180 / Math.PI, F = I < 0 ? I + 360 : I >= 360 ? I - 360 : I, L = F * Math.PI / 180, z = R * a.nbb, E = 100 * Math.pow(z / a.aw, a.c * a.z), W = 4 / a.c * Math.sqrt(E / 100) * (a.aw + 4) * a.fLRoot, te = F < 20.14 ? F + 360 : F, ce = 1 / 4 * (Math.cos(te * Math.PI / 180 + 2) + 3.8), me = 5e4 / 13 * ce * a.nc * a.ncb * Math.sqrt(B * B + x * x) / (O + 0.305), ge = Math.pow(me, 0.9) * Math.pow(1.64 - Math.pow(0.29, a.n), 0.73), re = ge * Math.sqrt(E / 100), ye = re * a.fLRoot, Te = 50 * Math.sqrt(ge * a.c / (a.aw + 4)), ve = (1 + 100 * 7e-3) * E / (1 + 7e-3 * E), De = Math.log(1 + 0.0228 * ye) / 0.0228, we = De * Math.cos(L), Pe = De * Math.sin(L);
342
+ return new H(F, re, E, W, ye, Te, ve, we, Pe);
343
+ }
344
+ /// XYZ representation of CAM16 seen in [viewingConditions].
345
+ xyzInViewingConditions(e) {
346
+ const t = this.chroma === 0 || this.j === 0 ? 0 : this.chroma / Math.sqrt(this.j / 100), n = Math.pow(t / Math.pow(1.64 - Math.pow(0.29, e.n), 0.73), 1 / 0.9), a = this.hue * Math.PI / 180, o = 0.25 * (Math.cos(a + 2) + 3.8), i = e.aw * Math.pow(this.j / 100, 1 / e.c / e.z), u = o * (5e4 / 13) * e.nc * e.ncb, l = i / e.nbb, h = Math.sin(a), f = Math.cos(a), g = 23 * (l + 0.305) * n / (23 * u + 11 * n * f + 108 * n * h), p = g * f, v = g * h, m = (460 * l + 451 * p + 288 * v) / 1403, P = (460 * l - 891 * p - 261 * v) / 1403, k = (460 * l - 220 * p - 6300 * v) / 1403, B = Math.max(0, 27.13 * Math.abs(m) / (400 - Math.abs(m))), x = j(m) * (100 / e.fl) * Math.pow(B, 1 / 0.42), O = Math.max(0, 27.13 * Math.abs(P) / (400 - Math.abs(P))), R = j(P) * (100 / e.fl) * Math.pow(O, 1 / 0.42), V = Math.max(0, 27.13 * Math.abs(k) / (400 - Math.abs(k))), I = j(k) * (100 / e.fl) * Math.pow(V, 1 / 0.42), F = x / e.rgbD[0], L = R / e.rgbD[1], z = I / e.rgbD[2], E = 1.86206786 * F - 1.01125463 * L + 0.14918677 * z, W = 0.38752654 * F + 0.62144744 * L - 897398e-8 * z, te = -0.0158415 * F - 0.03412294 * L + 1.04996444 * z;
347
+ return [E, W, te];
348
+ }
349
+ }
350
+ /**
351
+ * @license
352
+ * Copyright 2021 Google LLC
353
+ *
354
+ * Licensed under the Apache License, Version 2.0 (the "License");
355
+ * you may not use this file except in compliance with the License.
356
+ * You may obtain a copy of the License at
357
+ *
358
+ * http://www.apache.org/licenses/LICENSE-2.0
359
+ *
360
+ * Unless required by applicable law or agreed to in writing, software
361
+ * distributed under the License is distributed on an "AS IS" BASIS,
362
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
363
+ * See the License for the specific language governing permissions and
364
+ * limitations under the License.
365
+ */
366
+ class S {
367
+ /**
368
+ * Sanitizes a small enough angle in radians.
369
+ *
370
+ * @param angle An angle in radians; must not deviate too much
371
+ * from 0.
372
+ * @return A coterminal angle between 0 and 2pi.
373
+ */
374
+ static sanitizeRadians(e) {
375
+ return (e + Math.PI * 8) % (Math.PI * 2);
376
+ }
377
+ /**
378
+ * Delinearizes an RGB component, returning a floating-point
379
+ * number.
380
+ *
381
+ * @param rgbComponent 0.0 <= rgb_component <= 100.0, represents
382
+ * linear R/G/B channel
383
+ * @return 0.0 <= output <= 255.0, color channel converted to
384
+ * regular RGB space
385
+ */
386
+ static trueDelinearized(e) {
387
+ const t = e / 100;
388
+ let n = 0;
389
+ return t <= 31308e-7 ? n = t * 12.92 : n = 1.055 * Math.pow(t, 1 / 2.4) - 0.055, n * 255;
390
+ }
391
+ static chromaticAdaptation(e) {
392
+ const t = Math.pow(Math.abs(e), 0.42);
393
+ return j(e) * 400 * t / (t + 27.13);
394
+ }
395
+ /**
396
+ * Returns the hue of a linear RGB color in CAM16.
397
+ *
398
+ * @param linrgb The linear RGB coordinates of a color.
399
+ * @return The hue of the color in CAM16, in radians.
400
+ */
401
+ static hueOf(e) {
402
+ const t = Le(e, S.SCALED_DISCOUNT_FROM_LINRGB), n = S.chromaticAdaptation(t[0]), a = S.chromaticAdaptation(t[1]), o = S.chromaticAdaptation(t[2]), i = (11 * n + -12 * a + o) / 11, u = (n + a - 2 * o) / 9;
403
+ return Math.atan2(u, i);
404
+ }
405
+ static areInCyclicOrder(e, t, n) {
406
+ const a = S.sanitizeRadians(t - e), o = S.sanitizeRadians(n - e);
407
+ return a < o;
408
+ }
409
+ /**
410
+ * Solves the lerp equation.
411
+ *
412
+ * @param source The starting number.
413
+ * @param mid The number in the middle.
414
+ * @param target The ending number.
415
+ * @return A number t such that lerp(source, target, t) = mid.
416
+ */
417
+ static intercept(e, t, n) {
418
+ return (t - e) / (n - e);
419
+ }
420
+ static lerpPoint(e, t, n) {
421
+ return [
422
+ e[0] + (n[0] - e[0]) * t,
423
+ e[1] + (n[1] - e[1]) * t,
424
+ e[2] + (n[2] - e[2]) * t
425
+ ];
426
+ }
427
+ /**
428
+ * Intersects a segment with a plane.
429
+ *
430
+ * @param source The coordinates of point A.
431
+ * @param coordinate The R-, G-, or B-coordinate of the plane.
432
+ * @param target The coordinates of point B.
433
+ * @param axis The axis the plane is perpendicular with. (0: R, 1:
434
+ * G, 2: B)
435
+ * @return The intersection point of the segment AB with the plane
436
+ * R=coordinate, G=coordinate, or B=coordinate
437
+ */
438
+ static setCoordinate(e, t, n, a) {
439
+ const o = S.intercept(e[a], t, n[a]);
440
+ return S.lerpPoint(e, o, n);
441
+ }
442
+ static isBounded(e) {
443
+ return 0 <= e && e <= 100;
444
+ }
445
+ /**
446
+ * Returns the nth possible vertex of the polygonal intersection.
447
+ *
448
+ * @param y The Y value of the plane.
449
+ * @param n The zero-based index of the point. 0 <= n <= 11.
450
+ * @return The nth possible vertex of the polygonal intersection
451
+ * of the y plane and the RGB cube, in linear RGB coordinates, if
452
+ * it exists. If this possible vertex lies outside of the cube,
453
+ * [-1.0, -1.0, -1.0] is returned.
454
+ */
455
+ static nthVertex(e, t) {
456
+ const n = S.Y_FROM_LINRGB[0], a = S.Y_FROM_LINRGB[1], o = S.Y_FROM_LINRGB[2], i = t % 4 <= 1 ? 0 : 100, u = t % 2 === 0 ? 0 : 100;
457
+ if (t < 4) {
458
+ const l = i, h = u, f = (e - l * a - h * o) / n;
459
+ return S.isBounded(f) ? [f, l, h] : [-1, -1, -1];
460
+ } else if (t < 8) {
461
+ const l = i, h = u, f = (e - h * n - l * o) / a;
462
+ return S.isBounded(f) ? [h, f, l] : [-1, -1, -1];
463
+ } else {
464
+ const l = i, h = u, f = (e - l * n - h * a) / o;
465
+ return S.isBounded(f) ? [l, h, f] : [-1, -1, -1];
466
+ }
467
+ }
468
+ /**
469
+ * Finds the segment containing the desired color.
470
+ *
471
+ * @param y The Y value of the color.
472
+ * @param targetHue The hue of the color.
473
+ * @return A list of two sets of linear RGB coordinates, each
474
+ * corresponding to an endpoint of the segment containing the
475
+ * desired color.
476
+ */
477
+ static bisectToSegment(e, t) {
478
+ let n = [-1, -1, -1], a = n, o = 0, i = 0, u = !1, l = !0;
479
+ for (let h = 0; h < 12; h++) {
480
+ const f = S.nthVertex(e, h);
481
+ if (f[0] < 0)
482
+ continue;
483
+ const g = S.hueOf(f);
484
+ if (!u) {
485
+ n = f, a = f, o = g, i = g, u = !0;
486
+ continue;
487
+ }
488
+ (l || S.areInCyclicOrder(o, g, i)) && (l = !1, S.areInCyclicOrder(o, t, g) ? (a = f, i = g) : (n = f, o = g));
489
+ }
490
+ return [n, a];
491
+ }
492
+ static midpoint(e, t) {
493
+ return [
494
+ (e[0] + t[0]) / 2,
495
+ (e[1] + t[1]) / 2,
496
+ (e[2] + t[2]) / 2
497
+ ];
498
+ }
499
+ static criticalPlaneBelow(e) {
500
+ return Math.floor(e - 0.5);
501
+ }
502
+ static criticalPlaneAbove(e) {
503
+ return Math.ceil(e - 0.5);
504
+ }
505
+ /**
506
+ * Finds a color with the given Y and hue on the boundary of the
507
+ * cube.
508
+ *
509
+ * @param y The Y value of the color.
510
+ * @param targetHue The hue of the color.
511
+ * @return The desired color, in linear RGB coordinates.
512
+ */
513
+ static bisectToLimit(e, t) {
514
+ const n = S.bisectToSegment(e, t);
515
+ let a = n[0], o = S.hueOf(a), i = n[1];
516
+ for (let u = 0; u < 3; u++)
517
+ if (a[u] !== i[u]) {
518
+ let l = -1, h = 255;
519
+ a[u] < i[u] ? (l = S.criticalPlaneBelow(S.trueDelinearized(a[u])), h = S.criticalPlaneAbove(S.trueDelinearized(i[u]))) : (l = S.criticalPlaneAbove(S.trueDelinearized(a[u])), h = S.criticalPlaneBelow(S.trueDelinearized(i[u])));
520
+ for (let f = 0; f < 8 && !(Math.abs(h - l) <= 1); f++) {
521
+ const g = Math.floor((l + h) / 2), p = S.CRITICAL_PLANES[g], v = S.setCoordinate(a, p, i, u), m = S.hueOf(v);
522
+ S.areInCyclicOrder(o, t, m) ? (i = v, h = g) : (a = v, o = m, l = g);
523
+ }
524
+ }
525
+ return S.midpoint(a, i);
526
+ }
527
+ static inverseChromaticAdaptation(e) {
528
+ const t = Math.abs(e), n = Math.max(0, 27.13 * t / (400 - t));
529
+ return j(e) * Math.pow(n, 1 / 0.42);
530
+ }
531
+ /**
532
+ * Finds a color with the given hue, chroma, and Y.
533
+ *
534
+ * @param hueRadians The desired hue in radians.
535
+ * @param chroma The desired chroma.
536
+ * @param y The desired Y.
537
+ * @return The desired color as a hexadecimal integer, if found; 0
538
+ * otherwise.
539
+ */
540
+ static findResultByJ(e, t, n) {
541
+ let a = Math.sqrt(n) * 11;
542
+ const o = J.DEFAULT, i = 1 / Math.pow(1.64 - Math.pow(0.29, o.n), 0.73), l = 0.25 * (Math.cos(e + 2) + 3.8) * (5e4 / 13) * o.nc * o.ncb, h = Math.sin(e), f = Math.cos(e);
543
+ for (let g = 0; g < 5; g++) {
544
+ const p = a / 100, v = t === 0 || a === 0 ? 0 : t / Math.sqrt(p), m = Math.pow(v * i, 1 / 0.9), k = o.aw * Math.pow(p, 1 / o.c / o.z) / o.nbb, B = 23 * (k + 0.305) * m / (23 * l + 11 * m * f + 108 * m * h), x = B * f, O = B * h, R = (460 * k + 451 * x + 288 * O) / 1403, V = (460 * k - 891 * x - 261 * O) / 1403, I = (460 * k - 220 * x - 6300 * O) / 1403, F = S.inverseChromaticAdaptation(R), L = S.inverseChromaticAdaptation(V), z = S.inverseChromaticAdaptation(I), E = Le([F, L, z], S.LINRGB_FROM_SCALED_DISCOUNT);
545
+ if (E[0] < 0 || E[1] < 0 || E[2] < 0)
546
+ return 0;
547
+ const W = S.Y_FROM_LINRGB[0], te = S.Y_FROM_LINRGB[1], ce = S.Y_FROM_LINRGB[2], q = W * E[0] + te * E[1] + ce * E[2];
548
+ if (q <= 0)
549
+ return 0;
550
+ if (g === 4 || Math.abs(q - n) < 2e-3)
551
+ return E[0] > 100.01 || E[1] > 100.01 || E[2] > 100.01 ? 0 : Ke(E);
552
+ a = a - (q - n) * a / (2 * q);
553
+ }
554
+ return 0;
555
+ }
556
+ /**
557
+ * Finds an sRGB color with the given hue, chroma, and L*, if
558
+ * possible.
559
+ *
560
+ * @param hueDegrees The desired hue, in degrees.
561
+ * @param chroma The desired chroma.
562
+ * @param lstar The desired L*.
563
+ * @return A hexadecimal representing the sRGB color. The color
564
+ * has sufficiently close hue, chroma, and L* to the desired
565
+ * values, if possible; otherwise, the hue and L* will be
566
+ * sufficiently close, and chroma will be maximized.
567
+ */
568
+ static solveToInt(e, t, n) {
569
+ if (t < 1e-4 || n < 1e-4 || n > 99.9999)
570
+ return Mt(n);
571
+ e = be(e);
572
+ const a = e / 180 * Math.PI, o = ae(n), i = S.findResultByJ(a, t, o);
573
+ if (i !== 0)
574
+ return i;
575
+ const u = S.bisectToLimit(o, a);
576
+ return Ke(u);
577
+ }
578
+ /**
579
+ * Finds an sRGB color with the given hue, chroma, and L*, if
580
+ * possible.
581
+ *
582
+ * @param hueDegrees The desired hue, in degrees.
583
+ * @param chroma The desired chroma.
584
+ * @param lstar The desired L*.
585
+ * @return An CAM16 object representing the sRGB color. The color
586
+ * has sufficiently close hue, chroma, and L* to the desired
587
+ * values, if possible; otherwise, the hue and L* will be
588
+ * sufficiently close, and chroma will be maximized.
589
+ */
590
+ static solveToCam(e, t, n) {
591
+ return H.fromInt(S.solveToInt(e, t, n));
592
+ }
593
+ }
594
+ S.SCALED_DISCOUNT_FROM_LINRGB = [
595
+ [
596
+ 0.001200833568784504,
597
+ 0.002389694492170889,
598
+ 2795742885861124e-19
599
+ ],
600
+ [
601
+ 5891086651375999e-19,
602
+ 0.0029785502573438758,
603
+ 3270666104008398e-19
604
+ ],
605
+ [
606
+ 10146692491640572e-20,
607
+ 5364214359186694e-19,
608
+ 0.0032979401770712076
609
+ ]
610
+ ];
611
+ S.LINRGB_FROM_SCALED_DISCOUNT = [
612
+ [
613
+ 1373.2198709594231,
614
+ -1100.4251190754821,
615
+ -7.278681089101213
616
+ ],
617
+ [
618
+ -271.815969077903,
619
+ 559.6580465940733,
620
+ -32.46047482791194
621
+ ],
622
+ [
623
+ 1.9622899599665666,
624
+ -57.173814538844006,
625
+ 308.7233197812385
626
+ ]
627
+ ];
628
+ S.Y_FROM_LINRGB = [0.2126, 0.7152, 0.0722];
629
+ S.CRITICAL_PLANES = [
630
+ 0.015176349177441876,
631
+ 0.045529047532325624,
632
+ 0.07588174588720938,
633
+ 0.10623444424209313,
634
+ 0.13658714259697685,
635
+ 0.16693984095186062,
636
+ 0.19729253930674434,
637
+ 0.2276452376616281,
638
+ 0.2579979360165119,
639
+ 0.28835063437139563,
640
+ 0.3188300904430532,
641
+ 0.350925934958123,
642
+ 0.3848314933096426,
643
+ 0.42057480301049466,
644
+ 0.458183274052838,
645
+ 0.4976837250274023,
646
+ 0.5391024159806381,
647
+ 0.5824650784040898,
648
+ 0.6277969426914107,
649
+ 0.6751227633498623,
650
+ 0.7244668422128921,
651
+ 0.775853049866786,
652
+ 0.829304845476233,
653
+ 0.8848452951698498,
654
+ 0.942497089126609,
655
+ 1.0022825574869039,
656
+ 1.0642236851973577,
657
+ 1.1283421258858297,
658
+ 1.1946592148522128,
659
+ 1.2631959812511864,
660
+ 1.3339731595349034,
661
+ 1.407011200216447,
662
+ 1.4823302800086415,
663
+ 1.5599503113873272,
664
+ 1.6398909516233677,
665
+ 1.7221716113234105,
666
+ 1.8068114625156377,
667
+ 1.8938294463134073,
668
+ 1.9832442801866852,
669
+ 2.075074464868551,
670
+ 2.1693382909216234,
671
+ 2.2660538449872063,
672
+ 2.36523901573795,
673
+ 2.4669114995532007,
674
+ 2.5710888059345764,
675
+ 2.6777882626779785,
676
+ 2.7870270208169257,
677
+ 2.898822059350997,
678
+ 3.0131901897720907,
679
+ 3.1301480604002863,
680
+ 3.2497121605402226,
681
+ 3.3718988244681087,
682
+ 3.4967242352587946,
683
+ 3.624204428461639,
684
+ 3.754355295633311,
685
+ 3.887192587735158,
686
+ 4.022731918402185,
687
+ 4.160988767090289,
688
+ 4.301978482107941,
689
+ 4.445716283538092,
690
+ 4.592217266055746,
691
+ 4.741496401646282,
692
+ 4.893568542229298,
693
+ 5.048448422192488,
694
+ 5.20615066083972,
695
+ 5.3666897647573375,
696
+ 5.5300801301023865,
697
+ 5.696336044816294,
698
+ 5.865471690767354,
699
+ 6.037501145825082,
700
+ 6.212438385869475,
701
+ 6.390297286737924,
702
+ 6.571091626112461,
703
+ 6.7548350853498045,
704
+ 6.941541251256611,
705
+ 7.131223617812143,
706
+ 7.323895587840543,
707
+ 7.5195704746346665,
708
+ 7.7182615035334345,
709
+ 7.919981813454504,
710
+ 8.124744458384042,
711
+ 8.332562408825165,
712
+ 8.543448553206703,
713
+ 8.757415699253682,
714
+ 8.974476575321063,
715
+ 9.194643831691977,
716
+ 9.417930041841839,
717
+ 9.644347703669503,
718
+ 9.873909240696694,
719
+ 10.106627003236781,
720
+ 10.342513269534024,
721
+ 10.58158024687427,
722
+ 10.8238400726681,
723
+ 11.069304815507364,
724
+ 11.317986476196008,
725
+ 11.569896988756009,
726
+ 11.825048221409341,
727
+ 12.083451977536606,
728
+ 12.345119996613247,
729
+ 12.610063955123938,
730
+ 12.878295467455942,
731
+ 13.149826086772048,
732
+ 13.42466730586372,
733
+ 13.702830557985108,
734
+ 13.984327217668513,
735
+ 14.269168601521828,
736
+ 14.55736596900856,
737
+ 14.848930523210871,
738
+ 15.143873411576273,
739
+ 15.44220572664832,
740
+ 15.743938506781891,
741
+ 16.04908273684337,
742
+ 16.35764934889634,
743
+ 16.66964922287304,
744
+ 16.985093187232053,
745
+ 17.30399201960269,
746
+ 17.62635644741625,
747
+ 17.95219714852476,
748
+ 18.281524751807332,
749
+ 18.614349837764564,
750
+ 18.95068293910138,
751
+ 19.290534541298456,
752
+ 19.633915083172692,
753
+ 19.98083495742689,
754
+ 20.331304511189067,
755
+ 20.685334046541502,
756
+ 21.042933821039977,
757
+ 21.404114048223256,
758
+ 21.76888489811322,
759
+ 22.137256497705877,
760
+ 22.50923893145328,
761
+ 22.884842241736916,
762
+ 23.264076429332462,
763
+ 23.6469514538663,
764
+ 24.033477234264016,
765
+ 24.42366364919083,
766
+ 24.817520537484558,
767
+ 25.21505769858089,
768
+ 25.61628489293138,
769
+ 26.021211842414342,
770
+ 26.429848230738664,
771
+ 26.842203703840827,
772
+ 27.258287870275353,
773
+ 27.678110301598522,
774
+ 28.10168053274597,
775
+ 28.529008062403893,
776
+ 28.96010235337422,
777
+ 29.39497283293396,
778
+ 29.83362889318845,
779
+ 30.276079891419332,
780
+ 30.722335150426627,
781
+ 31.172403958865512,
782
+ 31.62629557157785,
783
+ 32.08401920991837,
784
+ 32.54558406207592,
785
+ 33.010999283389665,
786
+ 33.4802739966603,
787
+ 33.953417292456834,
788
+ 34.430438229418264,
789
+ 34.911345834551085,
790
+ 35.39614910352207,
791
+ 35.88485700094671,
792
+ 36.37747846067349,
793
+ 36.87402238606382,
794
+ 37.37449765026789,
795
+ 37.87891309649659,
796
+ 38.38727753828926,
797
+ 38.89959975977785,
798
+ 39.41588851594697,
799
+ 39.93615253289054,
800
+ 40.460400508064545,
801
+ 40.98864111053629,
802
+ 41.520882981230194,
803
+ 42.05713473317016,
804
+ 42.597404951718396,
805
+ 43.141702194811224,
806
+ 43.6900349931913,
807
+ 44.24241185063697,
808
+ 44.798841244188324,
809
+ 45.35933162437017,
810
+ 45.92389141541209,
811
+ 46.49252901546552,
812
+ 47.065252796817916,
813
+ 47.64207110610409,
814
+ 48.22299226451468,
815
+ 48.808024568002054,
816
+ 49.3971762874833,
817
+ 49.9904556690408,
818
+ 50.587870934119984,
819
+ 51.189430279724725,
820
+ 51.79514187861014,
821
+ 52.40501387947288,
822
+ 53.0190544071392,
823
+ 53.637271562750364,
824
+ 54.259673423945976,
825
+ 54.88626804504493,
826
+ 55.517063457223934,
827
+ 56.15206766869424,
828
+ 56.79128866487574,
829
+ 57.43473440856916,
830
+ 58.08241284012621,
831
+ 58.734331877617365,
832
+ 59.39049941699807,
833
+ 60.05092333227251,
834
+ 60.715611475655585,
835
+ 61.38457167773311,
836
+ 62.057811747619894,
837
+ 62.7353394731159,
838
+ 63.417162620860914,
839
+ 64.10328893648692,
840
+ 64.79372614476921,
841
+ 65.48848194977529,
842
+ 66.18756403501224,
843
+ 66.89098006357258,
844
+ 67.59873767827808,
845
+ 68.31084450182222,
846
+ 69.02730813691093,
847
+ 69.74813616640164,
848
+ 70.47333615344107,
849
+ 71.20291564160104,
850
+ 71.93688215501312,
851
+ 72.67524319850172,
852
+ 73.41800625771542,
853
+ 74.16517879925733,
854
+ 74.9167682708136,
855
+ 75.67278210128072,
856
+ 76.43322770089146,
857
+ 77.1981124613393,
858
+ 77.96744375590167,
859
+ 78.74122893956174,
860
+ 79.51947534912904,
861
+ 80.30219030335869,
862
+ 81.08938110306934,
863
+ 81.88105503125999,
864
+ 82.67721935322541,
865
+ 83.4778813166706,
866
+ 84.28304815182372,
867
+ 85.09272707154808,
868
+ 85.90692527145302,
869
+ 86.72564993000343,
870
+ 87.54890820862819,
871
+ 88.3767072518277,
872
+ 89.2090541872801,
873
+ 90.04595612594655,
874
+ 90.88742016217518,
875
+ 91.73345337380438,
876
+ 92.58406282226491,
877
+ 93.43925555268066,
878
+ 94.29903859396902,
879
+ 95.16341895893969,
880
+ 96.03240364439274,
881
+ 96.9059996312159,
882
+ 97.78421388448044,
883
+ 98.6670533535366,
884
+ 99.55452497210776
885
+ ];
886
+ /**
887
+ * @license
888
+ * Copyright 2021 Google LLC
889
+ *
890
+ * Licensed under the Apache License, Version 2.0 (the "License");
891
+ * you may not use this file except in compliance with the License.
892
+ * You may obtain a copy of the License at
893
+ *
894
+ * http://www.apache.org/licenses/LICENSE-2.0
895
+ *
896
+ * Unless required by applicable law or agreed to in writing, software
897
+ * distributed under the License is distributed on an "AS IS" BASIS,
898
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
899
+ * See the License for the specific language governing permissions and
900
+ * limitations under the License.
901
+ */
902
+ class C {
903
+ static from(e, t, n) {
904
+ return new C(S.solveToInt(e, t, n));
905
+ }
906
+ /**
907
+ * @param argb ARGB representation of a color.
908
+ * @return HCT representation of a color in default viewing conditions
909
+ */
910
+ static fromInt(e) {
911
+ return new C(e);
912
+ }
913
+ toInt() {
914
+ return this.argb;
915
+ }
916
+ /**
917
+ * A number, in degrees, representing ex. red, orange, yellow, etc.
918
+ * Ranges from 0 <= hue < 360.
919
+ */
920
+ get hue() {
921
+ return this.internalHue;
922
+ }
923
+ /**
924
+ * @param newHue 0 <= newHue < 360; invalid values are corrected.
925
+ * Chroma may decrease because chroma has a different maximum for any given
926
+ * hue and tone.
927
+ */
928
+ set hue(e) {
929
+ this.setInternalState(S.solveToInt(e, this.internalChroma, this.internalTone));
930
+ }
931
+ get chroma() {
932
+ return this.internalChroma;
933
+ }
934
+ /**
935
+ * @param newChroma 0 <= newChroma < ?
936
+ * Chroma may decrease because chroma has a different maximum for any given
937
+ * hue and tone.
938
+ */
939
+ set chroma(e) {
940
+ this.setInternalState(S.solveToInt(this.internalHue, e, this.internalTone));
941
+ }
942
+ /** Lightness. Ranges from 0 to 100. */
943
+ get tone() {
944
+ return this.internalTone;
945
+ }
946
+ /**
947
+ * @param newTone 0 <= newTone <= 100; invalid valids are corrected.
948
+ * Chroma may decrease because chroma has a different maximum for any given
949
+ * hue and tone.
950
+ */
951
+ set tone(e) {
952
+ this.setInternalState(S.solveToInt(this.internalHue, this.internalChroma, e));
953
+ }
954
+ /** Sets a property of the Hct object. */
955
+ setValue(e, t) {
956
+ this[e] = t;
957
+ }
958
+ toString() {
959
+ return `HCT(${this.hue.toFixed(0)}, ${this.chroma.toFixed(0)}, ${this.tone.toFixed(0)})`;
960
+ }
961
+ static isBlue(e) {
962
+ return e >= 250 && e < 270;
963
+ }
964
+ static isYellow(e) {
965
+ return e >= 105 && e < 125;
966
+ }
967
+ static isCyan(e) {
968
+ return e >= 170 && e < 207;
969
+ }
970
+ constructor(e) {
971
+ this.argb = e;
972
+ const t = H.fromInt(e);
973
+ this.internalHue = t.hue, this.internalChroma = t.chroma, this.internalTone = Oe(e), this.argb = e;
974
+ }
975
+ setInternalState(e) {
976
+ const t = H.fromInt(e);
977
+ this.internalHue = t.hue, this.internalChroma = t.chroma, this.internalTone = Oe(e), this.argb = e;
978
+ }
979
+ /**
980
+ * Translates a color into different [ViewingConditions].
981
+ *
982
+ * Colors change appearance. They look different with lights on versus off,
983
+ * the same color, as in hex code, on white looks different when on black.
984
+ * This is called color relativity, most famously explicated by Josef Albers
985
+ * in Interaction of Color.
986
+ *
987
+ * In color science, color appearance models can account for this and
988
+ * calculate the appearance of a color in different settings. HCT is based on
989
+ * CAM16, a color appearance model, and uses it to make these calculations.
990
+ *
991
+ * See [ViewingConditions.make] for parameters affecting color appearance.
992
+ */
993
+ inViewingConditions(e) {
994
+ const n = H.fromInt(this.toInt()).xyzInViewingConditions(e), a = H.fromXyzInViewingConditions(n[0], n[1], n[2], J.make());
995
+ return C.from(a.hue, a.chroma, Re(n[1]));
996
+ }
997
+ }
998
+ /**
999
+ * @license
1000
+ * Copyright 2021 Google LLC
1001
+ *
1002
+ * Licensed under the Apache License, Version 2.0 (the "License");
1003
+ * you may not use this file except in compliance with the License.
1004
+ * You may obtain a copy of the License at
1005
+ *
1006
+ * http://www.apache.org/licenses/LICENSE-2.0
1007
+ *
1008
+ * Unless required by applicable law or agreed to in writing, software
1009
+ * distributed under the License is distributed on an "AS IS" BASIS,
1010
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1011
+ * See the License for the specific language governing permissions and
1012
+ * limitations under the License.
1013
+ */
1014
+ class Ve {
1015
+ /**
1016
+ * Blend the design color's HCT hue towards the key color's HCT
1017
+ * hue, in a way that leaves the original color recognizable and
1018
+ * recognizably shifted towards the key color.
1019
+ *
1020
+ * @param designColor ARGB representation of an arbitrary color.
1021
+ * @param sourceColor ARGB representation of the main theme color.
1022
+ * @return The design color with a hue shifted towards the
1023
+ * system's color, a slightly warmer/cooler variant of the design
1024
+ * color's hue.
1025
+ */
1026
+ static harmonize(e, t) {
1027
+ const n = C.fromInt(e), a = C.fromInt(t), o = Tt(n.hue, a.hue), i = Math.min(o * 0.5, 15), u = be(n.hue + i * Ct(n.hue, a.hue));
1028
+ return C.from(u, n.chroma, n.tone).toInt();
1029
+ }
1030
+ /**
1031
+ * Blends hue from one color into another. The chroma and tone of
1032
+ * the original color are maintained.
1033
+ *
1034
+ * @param from ARGB representation of color
1035
+ * @param to ARGB representation of color
1036
+ * @param amount how much blending to perform; 0.0 >= and <= 1.0
1037
+ * @return from, with a hue blended towards to. Chroma and tone
1038
+ * are constant.
1039
+ */
1040
+ static hctHue(e, t, n) {
1041
+ const a = Ve.cam16Ucs(e, t, n), o = H.fromInt(a), i = H.fromInt(e);
1042
+ return C.from(o.hue, i.chroma, Oe(e)).toInt();
1043
+ }
1044
+ /**
1045
+ * Blend in CAM16-UCS space.
1046
+ *
1047
+ * @param from ARGB representation of color
1048
+ * @param to ARGB representation of color
1049
+ * @param amount how much blending to perform; 0.0 >= and <= 1.0
1050
+ * @return from, blended towards to. Hue, chroma, and tone will
1051
+ * change.
1052
+ */
1053
+ static cam16Ucs(e, t, n) {
1054
+ const a = H.fromInt(e), o = H.fromInt(t), i = a.jstar, u = a.astar, l = a.bstar, h = o.jstar, f = o.astar, g = o.bstar, p = i + (h - i) * n, v = u + (f - u) * n, m = l + (g - l) * n;
1055
+ return H.fromUcs(p, v, m).toInt();
1056
+ }
1057
+ }
1058
+ /**
1059
+ * @license
1060
+ * Copyright 2022 Google LLC
1061
+ *
1062
+ * Licensed under the Apache License, Version 2.0 (the "License");
1063
+ * you may not use this file except in compliance with the License.
1064
+ * You may obtain a copy of the License at
1065
+ *
1066
+ * http://www.apache.org/licenses/LICENSE-2.0
1067
+ *
1068
+ * Unless required by applicable law or agreed to in writing, software
1069
+ * distributed under the License is distributed on an "AS IS" BASIS,
1070
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1071
+ * See the License for the specific language governing permissions and
1072
+ * limitations under the License.
1073
+ */
1074
+ class M {
1075
+ /**
1076
+ * Returns a contrast ratio, which ranges from 1 to 21.
1077
+ *
1078
+ * @param toneA Tone between 0 and 100. Values outside will be clamped.
1079
+ * @param toneB Tone between 0 and 100. Values outside will be clamped.
1080
+ */
1081
+ static ratioOfTones(e, t) {
1082
+ return e = U(0, 100, e), t = U(0, 100, t), M.ratioOfYs(ae(e), ae(t));
1083
+ }
1084
+ static ratioOfYs(e, t) {
1085
+ const n = e > t ? e : t, a = n === t ? e : t;
1086
+ return (n + 5) / (a + 5);
1087
+ }
1088
+ /**
1089
+ * Returns a tone >= tone parameter that ensures ratio parameter.
1090
+ * Return value is between 0 and 100.
1091
+ * Returns -1 if ratio cannot be achieved with tone parameter.
1092
+ *
1093
+ * @param tone Tone return value must contrast with.
1094
+ * Range is 0 to 100. Invalid values will result in -1 being returned.
1095
+ * @param ratio Contrast ratio of return value and tone.
1096
+ * Range is 1 to 21, invalid values have undefined behavior.
1097
+ */
1098
+ static lighter(e, t) {
1099
+ if (e < 0 || e > 100)
1100
+ return -1;
1101
+ const n = ae(e), a = t * (n + 5) - 5, o = M.ratioOfYs(a, n), i = Math.abs(o - t);
1102
+ if (o < t && i > 0.04)
1103
+ return -1;
1104
+ const u = Re(a) + 0.4;
1105
+ return u < 0 || u > 100 ? -1 : u;
1106
+ }
1107
+ /**
1108
+ * Returns a tone <= tone parameter that ensures ratio parameter.
1109
+ * Return value is between 0 and 100.
1110
+ * Returns -1 if ratio cannot be achieved with tone parameter.
1111
+ *
1112
+ * @param tone Tone return value must contrast with.
1113
+ * Range is 0 to 100. Invalid values will result in -1 being returned.
1114
+ * @param ratio Contrast ratio of return value and tone.
1115
+ * Range is 1 to 21, invalid values have undefined behavior.
1116
+ */
1117
+ static darker(e, t) {
1118
+ if (e < 0 || e > 100)
1119
+ return -1;
1120
+ const n = ae(e), a = (n + 5) / t - 5, o = M.ratioOfYs(n, a), i = Math.abs(o - t);
1121
+ if (o < t && i > 0.04)
1122
+ return -1;
1123
+ const u = Re(a) - 0.4;
1124
+ return u < 0 || u > 100 ? -1 : u;
1125
+ }
1126
+ /**
1127
+ * Returns a tone >= tone parameter that ensures ratio parameter.
1128
+ * Return value is between 0 and 100.
1129
+ * Returns 100 if ratio cannot be achieved with tone parameter.
1130
+ *
1131
+ * This method is unsafe because the returned value is guaranteed to be in
1132
+ * bounds for tone, i.e. between 0 and 100. However, that value may not reach
1133
+ * the ratio with tone. For example, there is no color lighter than T100.
1134
+ *
1135
+ * @param tone Tone return value must contrast with.
1136
+ * Range is 0 to 100. Invalid values will result in 100 being returned.
1137
+ * @param ratio Desired contrast ratio of return value and tone parameter.
1138
+ * Range is 1 to 21, invalid values have undefined behavior.
1139
+ */
1140
+ static lighterUnsafe(e, t) {
1141
+ const n = M.lighter(e, t);
1142
+ return n < 0 ? 100 : n;
1143
+ }
1144
+ /**
1145
+ * Returns a tone >= tone parameter that ensures ratio parameter.
1146
+ * Return value is between 0 and 100.
1147
+ * Returns 100 if ratio cannot be achieved with tone parameter.
1148
+ *
1149
+ * This method is unsafe because the returned value is guaranteed to be in
1150
+ * bounds for tone, i.e. between 0 and 100. However, that value may not reach
1151
+ * the [ratio with [tone]. For example, there is no color darker than T0.
1152
+ *
1153
+ * @param tone Tone return value must contrast with.
1154
+ * Range is 0 to 100. Invalid values will result in 0 being returned.
1155
+ * @param ratio Desired contrast ratio of return value and tone parameter.
1156
+ * Range is 1 to 21, invalid values have undefined behavior.
1157
+ */
1158
+ static darkerUnsafe(e, t) {
1159
+ const n = M.darker(e, t);
1160
+ return n < 0 ? 0 : n;
1161
+ }
1162
+ }
1163
+ /**
1164
+ * @license
1165
+ * Copyright 2023 Google LLC
1166
+ *
1167
+ * Licensed under the Apache License, Version 2.0 (the "License");
1168
+ * you may not use this file except in compliance with the License.
1169
+ * You may obtain a copy of the License at
1170
+ *
1171
+ * http://www.apache.org/licenses/LICENSE-2.0
1172
+ *
1173
+ * Unless required by applicable law or agreed to in writing, software
1174
+ * distributed under the License is distributed on an "AS IS" BASIS,
1175
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1176
+ * See the License for the specific language governing permissions and
1177
+ * limitations under the License.
1178
+ */
1179
+ class Ne {
1180
+ /**
1181
+ * Returns true if a color is disliked.
1182
+ *
1183
+ * @param hct A color to be judged.
1184
+ * @return Whether the color is disliked.
1185
+ *
1186
+ * Disliked is defined as a dark yellow-green that is not neutral.
1187
+ */
1188
+ static isDisliked(e) {
1189
+ const t = Math.round(e.hue) >= 90 && Math.round(e.hue) <= 111, n = Math.round(e.chroma) > 16, a = Math.round(e.tone) < 65;
1190
+ return t && n && a;
1191
+ }
1192
+ /**
1193
+ * If a color is disliked, lighten it to make it likable.
1194
+ *
1195
+ * @param hct A color to be judged.
1196
+ * @return A new color if the original color is disliked, or the original
1197
+ * color if it is acceptable.
1198
+ */
1199
+ static fixIfDisliked(e) {
1200
+ return Ne.isDisliked(e) ? C.from(e.hue, e.chroma, 70) : e;
1201
+ }
1202
+ }
1203
+ /**
1204
+ * @license
1205
+ * Copyright 2022 Google LLC
1206
+ *
1207
+ * Licensed under the Apache License, Version 2.0 (the "License");
1208
+ * you may not use this file except in compliance with the License.
1209
+ * You may obtain a copy of the License at
1210
+ *
1211
+ * http://www.apache.org/licenses/LICENSE-2.0
1212
+ *
1213
+ * Unless required by applicable law or agreed to in writing, software
1214
+ * distributed under the License is distributed on an "AS IS" BASIS,
1215
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1216
+ * See the License for the specific language governing permissions and
1217
+ * limitations under the License.
1218
+ */
1219
+ function It(r, e, t) {
1220
+ if (r.name !== t.name)
1221
+ throw new Error(`Attempting to extend color ${r.name} with color ${t.name} of different name for spec version ${e}.`);
1222
+ if (r.isBackground !== t.isBackground)
1223
+ throw new Error(`Attempting to extend color ${r.name} as a ${r.isBackground ? "background" : "foreground"} with color ${t.name} as a ${t.isBackground ? "background" : "foreground"} for spec version ${e}.`);
1224
+ }
1225
+ function T(r, e, t) {
1226
+ return It(r, e, t), c.fromPalette({
1227
+ name: r.name,
1228
+ palette: (n) => n.specVersion === e ? t.palette(n) : r.palette(n),
1229
+ tone: (n) => n.specVersion === e ? t.tone(n) : r.tone(n),
1230
+ isBackground: r.isBackground,
1231
+ chromaMultiplier: (n) => {
1232
+ const a = n.specVersion === e ? t.chromaMultiplier : r.chromaMultiplier;
1233
+ return a !== void 0 ? a(n) : 1;
1234
+ },
1235
+ background: (n) => {
1236
+ const a = n.specVersion === e ? t.background : r.background;
1237
+ return a !== void 0 ? a(n) : void 0;
1238
+ },
1239
+ secondBackground: (n) => {
1240
+ const a = n.specVersion === e ? t.secondBackground : r.secondBackground;
1241
+ return a !== void 0 ? a(n) : void 0;
1242
+ },
1243
+ contrastCurve: (n) => {
1244
+ const a = n.specVersion === e ? t.contrastCurve : r.contrastCurve;
1245
+ return a !== void 0 ? a(n) : void 0;
1246
+ },
1247
+ toneDeltaPair: (n) => {
1248
+ const a = n.specVersion === e ? t.toneDeltaPair : r.toneDeltaPair;
1249
+ return a !== void 0 ? a(n) : void 0;
1250
+ }
1251
+ });
1252
+ }
1253
+ class c {
1254
+ /**
1255
+ * Create a DynamicColor defined by a TonalPalette and HCT tone.
1256
+ *
1257
+ * @param args Functions with DynamicScheme as input. Must provide a palette
1258
+ * and tone. May provide a background DynamicColor and ToneDeltaPair.
1259
+ */
1260
+ static fromPalette(e) {
1261
+ return new c(e.name ?? "", e.palette, e.tone ?? c.getInitialToneFromBackground(e.background), e.isBackground ?? !1, e.chromaMultiplier, e.background, e.secondBackground, e.contrastCurve, e.toneDeltaPair);
1262
+ }
1263
+ static getInitialToneFromBackground(e) {
1264
+ return e === void 0 ? (t) => 50 : (t) => e(t) ? e(t).getTone(t) : 50;
1265
+ }
1266
+ /**
1267
+ * The base constructor for DynamicColor.
1268
+ *
1269
+ * _Strongly_ prefer using one of the convenience constructors. This class is
1270
+ * arguably too flexible to ensure it can support any scenario. Functional
1271
+ * arguments allow overriding without risks that come with subclasses.
1272
+ *
1273
+ * For example, the default behavior of adjust tone at max contrast
1274
+ * to be at a 7.0 ratio with its background is principled and
1275
+ * matches accessibility guidance. That does not mean it's the desired
1276
+ * approach for _every_ design system, and every color pairing,
1277
+ * always, in every case.
1278
+ *
1279
+ * @param name The name of the dynamic color. Defaults to empty.
1280
+ * @param palette Function that provides a TonalPalette given DynamicScheme. A
1281
+ * TonalPalette is defined by a hue and chroma, so this replaces the need
1282
+ * to specify hue/chroma. By providing a tonal palette, when contrast
1283
+ * adjustments are made, intended chroma can be preserved.
1284
+ * @param tone Function that provides a tone, given a DynamicScheme.
1285
+ * @param isBackground Whether this dynamic color is a background, with some
1286
+ * other color as the foreground. Defaults to false.
1287
+ * @param chromaMultiplier A factor that multiplies the chroma for this color.
1288
+ * @param background The background of the dynamic color (as a function of a
1289
+ * `DynamicScheme`), if it exists.
1290
+ * @param secondBackground A second background of the dynamic color (as a
1291
+ * function of a `DynamicScheme`), if it exists.
1292
+ * @param contrastCurve A `ContrastCurve` object specifying how its contrast
1293
+ * against its background should behave in various contrast levels
1294
+ * options.
1295
+ * @param toneDeltaPair A `ToneDeltaPair` object specifying a tone delta
1296
+ * constraint between two colors. One of them must be the color being
1297
+ * constructed.
1298
+ */
1299
+ constructor(e, t, n, a, o, i, u, l, h) {
1300
+ if (this.name = e, this.palette = t, this.tone = n, this.isBackground = a, this.chromaMultiplier = o, this.background = i, this.secondBackground = u, this.contrastCurve = l, this.toneDeltaPair = h, this.hctCache = /* @__PURE__ */ new Map(), !i && u)
1301
+ throw new Error(`Color ${e} has secondBackgrounddefined, but background is not defined.`);
1302
+ if (!i && l)
1303
+ throw new Error(`Color ${e} has contrastCurvedefined, but background is not defined.`);
1304
+ if (i && !l)
1305
+ throw new Error(`Color ${e} has backgrounddefined, but contrastCurve is not defined.`);
1306
+ }
1307
+ /**
1308
+ * Returns a deep copy of this DynamicColor.
1309
+ */
1310
+ clone() {
1311
+ return c.fromPalette({
1312
+ name: this.name,
1313
+ palette: this.palette,
1314
+ tone: this.tone,
1315
+ isBackground: this.isBackground,
1316
+ chromaMultiplier: this.chromaMultiplier,
1317
+ background: this.background,
1318
+ secondBackground: this.secondBackground,
1319
+ contrastCurve: this.contrastCurve,
1320
+ toneDeltaPair: this.toneDeltaPair
1321
+ });
1322
+ }
1323
+ /**
1324
+ * Clears the cache of HCT values for this color. For testing or debugging
1325
+ * purposes.
1326
+ */
1327
+ clearCache() {
1328
+ this.hctCache.clear();
1329
+ }
1330
+ /**
1331
+ * Returns a ARGB integer (i.e. a hex code).
1332
+ *
1333
+ * @param scheme Defines the conditions of the user interface, for example,
1334
+ * whether or not it is dark mode or light mode, and what the desired
1335
+ * contrast level is.
1336
+ */
1337
+ getArgb(e) {
1338
+ return this.getHct(e).toInt();
1339
+ }
1340
+ /**
1341
+ * Returns a color, expressed in the HCT color space, that this
1342
+ * DynamicColor is under the conditions in scheme.
1343
+ *
1344
+ * @param scheme Defines the conditions of the user interface, for example,
1345
+ * whether or not it is dark mode or light mode, and what the desired
1346
+ * contrast level is.
1347
+ */
1348
+ getHct(e) {
1349
+ const t = this.hctCache.get(e);
1350
+ if (t != null)
1351
+ return t;
1352
+ const n = qe(e.specVersion).getHct(e, this);
1353
+ return this.hctCache.size > 4 && this.hctCache.clear(), this.hctCache.set(e, n), n;
1354
+ }
1355
+ /**
1356
+ * Returns a tone, T in the HCT color space, that this DynamicColor is under
1357
+ * the conditions in scheme.
1358
+ *
1359
+ * @param scheme Defines the conditions of the user interface, for example,
1360
+ * whether or not it is dark mode or light mode, and what the desired
1361
+ * contrast level is.
1362
+ */
1363
+ getTone(e) {
1364
+ return qe(e.specVersion).getTone(e, this);
1365
+ }
1366
+ /**
1367
+ * Given a background tone, finds a foreground tone, while ensuring they reach
1368
+ * a contrast ratio that is as close to [ratio] as possible.
1369
+ *
1370
+ * @param bgTone Tone in HCT. Range is 0 to 100, undefined behavior when it
1371
+ * falls outside that range.
1372
+ * @param ratio The contrast ratio desired between bgTone and the return
1373
+ * value.
1374
+ */
1375
+ static foregroundTone(e, t) {
1376
+ const n = M.lighterUnsafe(e, t), a = M.darkerUnsafe(e, t), o = M.ratioOfTones(n, e), i = M.ratioOfTones(a, e);
1377
+ if (c.tonePrefersLightForeground(e)) {
1378
+ const l = Math.abs(o - i) < 0.1 && o < t && i < t;
1379
+ return o >= t || o >= i || l ? n : a;
1380
+ } else
1381
+ return i >= t || i >= o ? a : n;
1382
+ }
1383
+ /**
1384
+ * Returns whether [tone] prefers a light foreground.
1385
+ *
1386
+ * People prefer white foregrounds on ~T60-70. Observed over time, and also
1387
+ * by Andrew Somers during research for APCA.
1388
+ *
1389
+ * T60 used as to create the smallest discontinuity possible when skipping
1390
+ * down to T49 in order to ensure light foregrounds.
1391
+ * Since `tertiaryContainer` in dark monochrome scheme requires a tone of
1392
+ * 60, it should not be adjusted. Therefore, 60 is excluded here.
1393
+ */
1394
+ static tonePrefersLightForeground(e) {
1395
+ return Math.round(e) < 60;
1396
+ }
1397
+ /**
1398
+ * Returns whether [tone] can reach a contrast ratio of 4.5 with a lighter
1399
+ * color.
1400
+ */
1401
+ static toneAllowsLightForeground(e) {
1402
+ return Math.round(e) <= 49;
1403
+ }
1404
+ /**
1405
+ * Adjusts a tone such that white has 4.5 contrast, if the tone is
1406
+ * reasonably close to supporting it.
1407
+ */
1408
+ static enableLightForeground(e) {
1409
+ return c.tonePrefersLightForeground(e) && !c.toneAllowsLightForeground(e) ? 49 : e;
1410
+ }
1411
+ }
1412
+ class Et {
1413
+ getHct(e, t) {
1414
+ const n = t.getTone(e);
1415
+ return t.palette(e).getHct(n);
1416
+ }
1417
+ getTone(e, t) {
1418
+ const n = e.contrastLevel < 0, a = t.toneDeltaPair ? t.toneDeltaPair(e) : void 0;
1419
+ if (a) {
1420
+ const o = a.roleA, i = a.roleB, u = a.delta, l = a.polarity, h = a.stayTogether, f = l === "nearer" || l === "lighter" && !e.isDark || l === "darker" && e.isDark, g = f ? o : i, p = f ? i : o, v = t.name === g.name, m = e.isDark ? 1 : -1;
1421
+ let P = g.tone(e), k = p.tone(e);
1422
+ if (t.background && g.contrastCurve && p.contrastCurve) {
1423
+ const B = t.background(e), x = g.contrastCurve(e), O = p.contrastCurve(e);
1424
+ if (B && x && O) {
1425
+ const R = B.getTone(e), V = x.get(e.contrastLevel), I = O.get(e.contrastLevel);
1426
+ M.ratioOfTones(R, P) < V && (P = c.foregroundTone(R, V)), M.ratioOfTones(R, k) < I && (k = c.foregroundTone(R, I)), n && (P = c.foregroundTone(R, V), k = c.foregroundTone(R, I));
1427
+ }
1428
+ }
1429
+ return (k - P) * m < u && (k = U(0, 100, P + u * m), (k - P) * m >= u || (P = U(0, 100, k - u * m))), 50 <= P && P < 60 ? m > 0 ? (P = 60, k = Math.max(k, P + u * m)) : (P = 49, k = Math.min(k, P + u * m)) : 50 <= k && k < 60 && (h ? m > 0 ? (P = 60, k = Math.max(k, P + u * m)) : (P = 49, k = Math.min(k, P + u * m)) : m > 0 ? k = 60 : k = 49), v ? P : k;
1430
+ } else {
1431
+ let o = t.tone(e);
1432
+ if (t.background == null || t.background(e) === void 0 || t.contrastCurve == null || t.contrastCurve(e) === void 0)
1433
+ return o;
1434
+ const i = t.background(e).getTone(e), u = t.contrastCurve(e).get(e.contrastLevel);
1435
+ if (M.ratioOfTones(i, o) >= u || (o = c.foregroundTone(i, u)), n && (o = c.foregroundTone(i, u)), t.isBackground && 50 <= o && o < 60 && (M.ratioOfTones(49, i) >= u ? o = 49 : o = 60), t.secondBackground == null || t.secondBackground(e) === void 0)
1436
+ return o;
1437
+ const [l, h] = [t.background, t.secondBackground], [f, g] = [l(e).getTone(e), h(e).getTone(e)], [p, v] = [Math.max(f, g), Math.min(f, g)];
1438
+ if (M.ratioOfTones(p, o) >= u && M.ratioOfTones(v, o) >= u)
1439
+ return o;
1440
+ const m = M.lighter(p, u), P = M.darker(v, u), k = [];
1441
+ return m !== -1 && k.push(m), P !== -1 && k.push(P), c.tonePrefersLightForeground(f) || c.tonePrefersLightForeground(g) ? m < 0 ? 100 : m : k.length === 1 ? k[0] : P < 0 ? 0 : P;
1442
+ }
1443
+ }
1444
+ }
1445
+ class Lt {
1446
+ getHct(e, t) {
1447
+ const n = t.palette(e), a = t.getTone(e), o = n.hue, i = n.chroma * (t.chromaMultiplier ? t.chromaMultiplier(e) : 1);
1448
+ return C.from(o, i, a);
1449
+ }
1450
+ getTone(e, t) {
1451
+ const n = t.toneDeltaPair ? t.toneDeltaPair(e) : void 0;
1452
+ if (n) {
1453
+ const a = n.roleA, o = n.roleB, i = n.polarity, u = n.constraint, l = i === "darker" || i === "relative_lighter" && e.isDark || i === "relative_darker" && !e.isDark ? -n.delta : n.delta, h = t.name === a.name, f = h ? a : o, g = h ? o : a;
1454
+ let p = f.tone(e), v = g.getTone(e);
1455
+ const m = l * (h ? 1 : -1);
1456
+ if (u === "exact" ? p = U(0, 100, v + m) : u === "nearer" ? m > 0 ? p = U(0, 100, U(v, v + m, p)) : p = U(0, 100, U(v + m, v, p)) : u === "farther" && (m > 0 ? p = U(v + m, 100, p) : p = U(0, v + m, p)), t.background && t.contrastCurve) {
1457
+ const P = t.background(e), k = t.contrastCurve(e);
1458
+ if (P && k) {
1459
+ const B = P.getTone(e), x = k.get(e.contrastLevel);
1460
+ p = M.ratioOfTones(B, p) >= x && e.contrastLevel >= 0 ? p : c.foregroundTone(B, x);
1461
+ }
1462
+ }
1463
+ return t.isBackground && !t.name.endsWith("_fixed_dim") && (p >= 57 ? p = U(65, 100, p) : p = U(0, 49, p)), p;
1464
+ } else {
1465
+ let a = t.tone(e);
1466
+ if (t.background == null || t.background(e) === void 0 || t.contrastCurve == null || t.contrastCurve(e) === void 0)
1467
+ return a;
1468
+ const o = t.background(e).getTone(e), i = t.contrastCurve(e).get(e.contrastLevel);
1469
+ if (a = M.ratioOfTones(o, a) >= i && e.contrastLevel >= 0 ? a : c.foregroundTone(o, i), t.isBackground && !t.name.endsWith("_fixed_dim") && (a >= 57 ? a = U(65, 100, a) : a = U(0, 49, a)), t.secondBackground == null || t.secondBackground(e) === void 0)
1470
+ return a;
1471
+ const [u, l] = [t.background, t.secondBackground], [h, f] = [u(e).getTone(e), l(e).getTone(e)], [g, p] = [Math.max(h, f), Math.min(h, f)];
1472
+ if (M.ratioOfTones(g, a) >= i && M.ratioOfTones(p, a) >= i)
1473
+ return a;
1474
+ const v = M.lighter(g, i), m = M.darker(p, i), P = [];
1475
+ return v !== -1 && P.push(v), m !== -1 && P.push(m), c.tonePrefersLightForeground(h) || c.tonePrefersLightForeground(f) ? v < 0 ? 100 : v : P.length === 1 ? P[0] : m < 0 ? 0 : m;
1476
+ }
1477
+ }
1478
+ }
1479
+ const Ot = new Et(), Rt = new Lt();
1480
+ function qe(r) {
1481
+ return r === "2025" ? Rt : Ot;
1482
+ }
1483
+ /**
1484
+ * @license
1485
+ * Copyright 2021 Google LLC
1486
+ *
1487
+ * Licensed under the Apache License, Version 2.0 (the "License");
1488
+ * you may not use this file except in compliance with the License.
1489
+ * You may obtain a copy of the License at
1490
+ *
1491
+ * http://www.apache.org/licenses/LICENSE-2.0
1492
+ *
1493
+ * Unless required by applicable law or agreed to in writing, software
1494
+ * distributed under the License is distributed on an "AS IS" BASIS,
1495
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1496
+ * See the License for the specific language governing permissions and
1497
+ * limitations under the License.
1498
+ */
1499
+ class Y {
1500
+ /**
1501
+ * @param argb ARGB representation of a color
1502
+ * @return Tones matching that color's hue and chroma.
1503
+ */
1504
+ static fromInt(e) {
1505
+ const t = C.fromInt(e);
1506
+ return Y.fromHct(t);
1507
+ }
1508
+ /**
1509
+ * @param hct Hct
1510
+ * @return Tones matching that color's hue and chroma.
1511
+ */
1512
+ static fromHct(e) {
1513
+ return new Y(e.hue, e.chroma, e);
1514
+ }
1515
+ /**
1516
+ * @param hue HCT hue
1517
+ * @param chroma HCT chroma
1518
+ * @return Tones matching hue and chroma.
1519
+ */
1520
+ static fromHueAndChroma(e, t) {
1521
+ const n = new Vt(e, t).create();
1522
+ return new Y(e, t, n);
1523
+ }
1524
+ constructor(e, t, n) {
1525
+ this.hue = e, this.chroma = t, this.keyColor = n, this.cache = /* @__PURE__ */ new Map();
1526
+ }
1527
+ /**
1528
+ * @param tone HCT tone, measured from 0 to 100.
1529
+ * @return ARGB representation of a color with that tone.
1530
+ */
1531
+ tone(e) {
1532
+ let t = this.cache.get(e);
1533
+ return t === void 0 && (e == 99 && C.isYellow(this.hue) ? t = this.averageArgb(this.tone(98), this.tone(100)) : t = C.from(this.hue, this.chroma, e).toInt(), this.cache.set(e, t)), t;
1534
+ }
1535
+ /**
1536
+ * @param tone HCT tone.
1537
+ * @return HCT representation of a color with that tone.
1538
+ */
1539
+ getHct(e) {
1540
+ return C.fromInt(this.tone(e));
1541
+ }
1542
+ averageArgb(e, t) {
1543
+ const n = e >>> 16 & 255, a = e >>> 8 & 255, o = e & 255, i = t >>> 16 & 255, u = t >>> 8 & 255, l = t & 255, h = Math.round((n + i) / 2), f = Math.round((a + u) / 2), g = Math.round((o + l) / 2);
1544
+ return (255 << 24 | (h & 255) << 16 | (f & 255) << 8 | g & 255) >>> 0;
1545
+ }
1546
+ }
1547
+ class Vt {
1548
+ constructor(e, t) {
1549
+ this.hue = e, this.requestedChroma = t, this.chromaCache = /* @__PURE__ */ new Map(), this.maxChromaValue = 200;
1550
+ }
1551
+ /**
1552
+ * Creates a key color from a [hue] and a [chroma].
1553
+ * The key color is the first tone, starting from T50, matching the given hue
1554
+ * and chroma.
1555
+ *
1556
+ * @return Key color [Hct]
1557
+ */
1558
+ create() {
1559
+ let a = 0, o = 100;
1560
+ for (; a < o; ) {
1561
+ const i = Math.floor((a + o) / 2), u = this.maxChroma(i) < this.maxChroma(i + 1);
1562
+ if (this.maxChroma(i) >= this.requestedChroma - 0.01)
1563
+ if (Math.abs(a - 50) < Math.abs(o - 50))
1564
+ o = i;
1565
+ else {
1566
+ if (a === i)
1567
+ return C.from(this.hue, this.requestedChroma, a);
1568
+ a = i;
1569
+ }
1570
+ else
1571
+ u ? a = i + 1 : o = i;
1572
+ }
1573
+ return C.from(this.hue, this.requestedChroma, a);
1574
+ }
1575
+ // Find the maximum chroma for a given tone
1576
+ maxChroma(e) {
1577
+ if (this.chromaCache.has(e))
1578
+ return this.chromaCache.get(e);
1579
+ const t = C.from(this.hue, this.maxChromaValue, e).chroma;
1580
+ return this.chromaCache.set(e, t), t;
1581
+ }
1582
+ }
1583
+ /**
1584
+ * @license
1585
+ * Copyright 2023 Google LLC
1586
+ *
1587
+ * Licensed under the Apache License, Version 2.0 (the "License");
1588
+ * you may not use this file except in compliance with the License.
1589
+ * You may obtain a copy of the License at
1590
+ *
1591
+ * http://www.apache.org/licenses/LICENSE-2.0
1592
+ *
1593
+ * Unless required by applicable law or agreed to in writing, software
1594
+ * distributed under the License is distributed on an "AS IS" BASIS,
1595
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1596
+ * See the License for the specific language governing permissions and
1597
+ * limitations under the License.
1598
+ */
1599
+ class y {
1600
+ /**
1601
+ * Creates a `ContrastCurve` object.
1602
+ *
1603
+ * @param low Value for contrast level -1.0
1604
+ * @param normal Value for contrast level 0.0
1605
+ * @param medium Value for contrast level 0.5
1606
+ * @param high Value for contrast level 1.0
1607
+ */
1608
+ constructor(e, t, n, a) {
1609
+ this.low = e, this.normal = t, this.medium = n, this.high = a;
1610
+ }
1611
+ /**
1612
+ * Returns the value at a given contrast level.
1613
+ *
1614
+ * @param contrastLevel The contrast level. 0.0 is the default (normal); -1.0
1615
+ * is the lowest; 1.0 is the highest.
1616
+ * @return The value. For contrast ratios, a number between 1.0 and 21.0.
1617
+ */
1618
+ get(e) {
1619
+ return e <= -1 ? this.low : e < 0 ? fe(this.low, this.normal, (e - -1) / 1) : e < 0.5 ? fe(this.normal, this.medium, (e - 0) / 0.5) : e < 1 ? fe(this.medium, this.high, (e - 0.5) / 0.5) : this.high;
1620
+ }
1621
+ }
1622
+ /**
1623
+ * @license
1624
+ * Copyright 2023 Google LLC
1625
+ *
1626
+ * Licensed under the Apache License, Version 2.0 (the "License");
1627
+ * you may not use this file except in compliance with the License.
1628
+ * You may obtain a copy of the License at
1629
+ *
1630
+ * http://www.apache.org/licenses/LICENSE-2.0
1631
+ *
1632
+ * Unless required by applicable law or agreed to in writing, software
1633
+ * distributed under the License is distributed on an "AS IS" BASIS,
1634
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1635
+ * See the License for the specific language governing permissions and
1636
+ * limitations under the License.
1637
+ */
1638
+ class w {
1639
+ /**
1640
+ * Documents a constraint in tone distance between two DynamicColors.
1641
+ *
1642
+ * The polarity is an adjective that describes "A", compared to "B".
1643
+ *
1644
+ * For instance, ToneDeltaPair(A, B, 15, 'darker', 'exact') states that
1645
+ * A's tone should be exactly 15 darker than B's.
1646
+ *
1647
+ * 'relative_darker' and 'relative_lighter' describes the tone adjustment
1648
+ * relative to the surface color trend (white in light mode; black in dark
1649
+ * mode). For instance, ToneDeltaPair(A, B, 10, 'relative_lighter',
1650
+ * 'farther') states that A should be at least 10 lighter than B in light
1651
+ * mode, and at least 10 darker than B in dark mode.
1652
+ *
1653
+ * @param roleA The first role in a pair.
1654
+ * @param roleB The second role in a pair.
1655
+ * @param delta Required difference between tones. Absolute value, negative
1656
+ * values have undefined behavior.
1657
+ * @param polarity The relative relation between tones of roleA and roleB,
1658
+ * as described above.
1659
+ * @param constraint How to fulfill the tone delta pair constraint.
1660
+ * @param stayTogether Whether these two roles should stay on the same side
1661
+ * of the "awkward zone" (T50-59). This is necessary for certain cases where
1662
+ * one role has two backgrounds.
1663
+ */
1664
+ constructor(e, t, n, a, o, i) {
1665
+ this.roleA = e, this.roleB = t, this.delta = n, this.polarity = a, this.stayTogether = o, this.constraint = i, this.constraint = i ?? "exact";
1666
+ }
1667
+ }
1668
+ /**
1669
+ * @license
1670
+ * Copyright 2022 Google LLC
1671
+ *
1672
+ * Licensed under the Apache License, Version 2.0 (the "License");
1673
+ * you may not use this file except in compliance with the License.
1674
+ * You may obtain a copy of the License at
1675
+ *
1676
+ * http://www.apache.org/licenses/LICENSE-2.0
1677
+ *
1678
+ * Unless required by applicable law or agreed to in writing, software
1679
+ * distributed under the License is distributed on an "AS IS" BASIS,
1680
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1681
+ * See the License for the specific language governing permissions and
1682
+ * limitations under the License.
1683
+ */
1684
+ var d;
1685
+ (function(r) {
1686
+ r[r.MONOCHROME = 0] = "MONOCHROME", r[r.NEUTRAL = 1] = "NEUTRAL", r[r.TONAL_SPOT = 2] = "TONAL_SPOT", r[r.VIBRANT = 3] = "VIBRANT", r[r.EXPRESSIVE = 4] = "EXPRESSIVE", r[r.FIDELITY = 5] = "FIDELITY", r[r.CONTENT = 6] = "CONTENT", r[r.RAINBOW = 7] = "RAINBOW", r[r.FRUIT_SALAD = 8] = "FRUIT_SALAD";
1687
+ })(d || (d = {}));
1688
+ /**
1689
+ * @license
1690
+ * Copyright 2025 Google LLC
1691
+ *
1692
+ * Licensed under the Apache License, Version 2.0 (the "License");
1693
+ * you may not use this file except in compliance with the License.
1694
+ * You may obtain a copy of the License at
1695
+ *
1696
+ * http://www.apache.org/licenses/LICENSE-2.0
1697
+ *
1698
+ * Unless required by applicable law or agreed to in writing, software
1699
+ * distributed under the License is distributed on an "AS IS" BASIS,
1700
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1701
+ * See the License for the specific language governing permissions and
1702
+ * limitations under the License.
1703
+ */
1704
+ function ue(r) {
1705
+ return r.variant === d.FIDELITY || r.variant === d.CONTENT;
1706
+ }
1707
+ function A(r) {
1708
+ return r.variant === d.MONOCHROME;
1709
+ }
1710
+ function Nt(r, e, t, n) {
1711
+ let a = t, o = C.from(r, e, t);
1712
+ if (o.chroma < e) {
1713
+ let i = o.chroma;
1714
+ for (; o.chroma < e; ) {
1715
+ a += n ? -1 : 1;
1716
+ const u = C.from(r, e, a);
1717
+ if (i > u.chroma || Math.abs(u.chroma - e) < 0.4)
1718
+ break;
1719
+ const l = Math.abs(u.chroma - e), h = Math.abs(o.chroma - e);
1720
+ l < h && (o = u), i = Math.max(i, u.chroma);
1721
+ }
1722
+ }
1723
+ return a;
1724
+ }
1725
+ class _t {
1726
+ ////////////////////////////////////////////////////////////////
1727
+ // Main Palettes //
1728
+ ////////////////////////////////////////////////////////////////
1729
+ primaryPaletteKeyColor() {
1730
+ return c.fromPalette({
1731
+ name: "primary_palette_key_color",
1732
+ palette: (e) => e.primaryPalette,
1733
+ tone: (e) => e.primaryPalette.keyColor.tone
1734
+ });
1735
+ }
1736
+ secondaryPaletteKeyColor() {
1737
+ return c.fromPalette({
1738
+ name: "secondary_palette_key_color",
1739
+ palette: (e) => e.secondaryPalette,
1740
+ tone: (e) => e.secondaryPalette.keyColor.tone
1741
+ });
1742
+ }
1743
+ tertiaryPaletteKeyColor() {
1744
+ return c.fromPalette({
1745
+ name: "tertiary_palette_key_color",
1746
+ palette: (e) => e.tertiaryPalette,
1747
+ tone: (e) => e.tertiaryPalette.keyColor.tone
1748
+ });
1749
+ }
1750
+ neutralPaletteKeyColor() {
1751
+ return c.fromPalette({
1752
+ name: "neutral_palette_key_color",
1753
+ palette: (e) => e.neutralPalette,
1754
+ tone: (e) => e.neutralPalette.keyColor.tone
1755
+ });
1756
+ }
1757
+ neutralVariantPaletteKeyColor() {
1758
+ return c.fromPalette({
1759
+ name: "neutral_variant_palette_key_color",
1760
+ palette: (e) => e.neutralVariantPalette,
1761
+ tone: (e) => e.neutralVariantPalette.keyColor.tone
1762
+ });
1763
+ }
1764
+ errorPaletteKeyColor() {
1765
+ return c.fromPalette({
1766
+ name: "error_palette_key_color",
1767
+ palette: (e) => e.errorPalette,
1768
+ tone: (e) => e.errorPalette.keyColor.tone
1769
+ });
1770
+ }
1771
+ ////////////////////////////////////////////////////////////////
1772
+ // Surfaces [S] //
1773
+ ////////////////////////////////////////////////////////////////
1774
+ background() {
1775
+ return c.fromPalette({
1776
+ name: "background",
1777
+ palette: (e) => e.neutralPalette,
1778
+ tone: (e) => e.isDark ? 6 : 98,
1779
+ isBackground: !0
1780
+ });
1781
+ }
1782
+ onBackground() {
1783
+ return c.fromPalette({
1784
+ name: "on_background",
1785
+ palette: (e) => e.neutralPalette,
1786
+ tone: (e) => e.isDark ? 90 : 10,
1787
+ background: (e) => this.background(),
1788
+ contrastCurve: (e) => new y(3, 3, 4.5, 7)
1789
+ });
1790
+ }
1791
+ surface() {
1792
+ return c.fromPalette({
1793
+ name: "surface",
1794
+ palette: (e) => e.neutralPalette,
1795
+ tone: (e) => e.isDark ? 6 : 98,
1796
+ isBackground: !0
1797
+ });
1798
+ }
1799
+ surfaceDim() {
1800
+ return c.fromPalette({
1801
+ name: "surface_dim",
1802
+ palette: (e) => e.neutralPalette,
1803
+ tone: (e) => e.isDark ? 6 : new y(87, 87, 80, 75).get(e.contrastLevel),
1804
+ isBackground: !0
1805
+ });
1806
+ }
1807
+ surfaceBright() {
1808
+ return c.fromPalette({
1809
+ name: "surface_bright",
1810
+ palette: (e) => e.neutralPalette,
1811
+ tone: (e) => e.isDark ? new y(24, 24, 29, 34).get(e.contrastLevel) : 98,
1812
+ isBackground: !0
1813
+ });
1814
+ }
1815
+ surfaceContainerLowest() {
1816
+ return c.fromPalette({
1817
+ name: "surface_container_lowest",
1818
+ palette: (e) => e.neutralPalette,
1819
+ tone: (e) => e.isDark ? new y(4, 4, 2, 0).get(e.contrastLevel) : 100,
1820
+ isBackground: !0
1821
+ });
1822
+ }
1823
+ surfaceContainerLow() {
1824
+ return c.fromPalette({
1825
+ name: "surface_container_low",
1826
+ palette: (e) => e.neutralPalette,
1827
+ tone: (e) => e.isDark ? new y(10, 10, 11, 12).get(e.contrastLevel) : new y(96, 96, 96, 95).get(e.contrastLevel),
1828
+ isBackground: !0
1829
+ });
1830
+ }
1831
+ surfaceContainer() {
1832
+ return c.fromPalette({
1833
+ name: "surface_container",
1834
+ palette: (e) => e.neutralPalette,
1835
+ tone: (e) => e.isDark ? new y(12, 12, 16, 20).get(e.contrastLevel) : new y(94, 94, 92, 90).get(e.contrastLevel),
1836
+ isBackground: !0
1837
+ });
1838
+ }
1839
+ surfaceContainerHigh() {
1840
+ return c.fromPalette({
1841
+ name: "surface_container_high",
1842
+ palette: (e) => e.neutralPalette,
1843
+ tone: (e) => e.isDark ? new y(17, 17, 21, 25).get(e.contrastLevel) : new y(92, 92, 88, 85).get(e.contrastLevel),
1844
+ isBackground: !0
1845
+ });
1846
+ }
1847
+ surfaceContainerHighest() {
1848
+ return c.fromPalette({
1849
+ name: "surface_container_highest",
1850
+ palette: (e) => e.neutralPalette,
1851
+ tone: (e) => e.isDark ? new y(22, 22, 26, 30).get(e.contrastLevel) : new y(90, 90, 84, 80).get(e.contrastLevel),
1852
+ isBackground: !0
1853
+ });
1854
+ }
1855
+ onSurface() {
1856
+ return c.fromPalette({
1857
+ name: "on_surface",
1858
+ palette: (e) => e.neutralPalette,
1859
+ tone: (e) => e.isDark ? 90 : 10,
1860
+ background: (e) => this.highestSurface(e),
1861
+ contrastCurve: (e) => new y(4.5, 7, 11, 21)
1862
+ });
1863
+ }
1864
+ surfaceVariant() {
1865
+ return c.fromPalette({
1866
+ name: "surface_variant",
1867
+ palette: (e) => e.neutralVariantPalette,
1868
+ tone: (e) => e.isDark ? 30 : 90,
1869
+ isBackground: !0
1870
+ });
1871
+ }
1872
+ onSurfaceVariant() {
1873
+ return c.fromPalette({
1874
+ name: "on_surface_variant",
1875
+ palette: (e) => e.neutralVariantPalette,
1876
+ tone: (e) => e.isDark ? 80 : 30,
1877
+ background: (e) => this.highestSurface(e),
1878
+ contrastCurve: (e) => new y(3, 4.5, 7, 11)
1879
+ });
1880
+ }
1881
+ inverseSurface() {
1882
+ return c.fromPalette({
1883
+ name: "inverse_surface",
1884
+ palette: (e) => e.neutralPalette,
1885
+ tone: (e) => e.isDark ? 90 : 20,
1886
+ isBackground: !0
1887
+ });
1888
+ }
1889
+ inverseOnSurface() {
1890
+ return c.fromPalette({
1891
+ name: "inverse_on_surface",
1892
+ palette: (e) => e.neutralPalette,
1893
+ tone: (e) => e.isDark ? 20 : 95,
1894
+ background: (e) => this.inverseSurface(),
1895
+ contrastCurve: (e) => new y(4.5, 7, 11, 21)
1896
+ });
1897
+ }
1898
+ outline() {
1899
+ return c.fromPalette({
1900
+ name: "outline",
1901
+ palette: (e) => e.neutralVariantPalette,
1902
+ tone: (e) => e.isDark ? 60 : 50,
1903
+ background: (e) => this.highestSurface(e),
1904
+ contrastCurve: (e) => new y(1.5, 3, 4.5, 7)
1905
+ });
1906
+ }
1907
+ outlineVariant() {
1908
+ return c.fromPalette({
1909
+ name: "outline_variant",
1910
+ palette: (e) => e.neutralVariantPalette,
1911
+ tone: (e) => e.isDark ? 30 : 80,
1912
+ background: (e) => this.highestSurface(e),
1913
+ contrastCurve: (e) => new y(1, 1, 3, 4.5)
1914
+ });
1915
+ }
1916
+ shadow() {
1917
+ return c.fromPalette({
1918
+ name: "shadow",
1919
+ palette: (e) => e.neutralPalette,
1920
+ tone: (e) => 0
1921
+ });
1922
+ }
1923
+ scrim() {
1924
+ return c.fromPalette({
1925
+ name: "scrim",
1926
+ palette: (e) => e.neutralPalette,
1927
+ tone: (e) => 0
1928
+ });
1929
+ }
1930
+ surfaceTint() {
1931
+ return c.fromPalette({
1932
+ name: "surface_tint",
1933
+ palette: (e) => e.primaryPalette,
1934
+ tone: (e) => e.isDark ? 80 : 40,
1935
+ isBackground: !0
1936
+ });
1937
+ }
1938
+ ////////////////////////////////////////////////////////////////
1939
+ // Primary [P]. //
1940
+ ////////////////////////////////////////////////////////////////
1941
+ primary() {
1942
+ return c.fromPalette({
1943
+ name: "primary",
1944
+ palette: (e) => e.primaryPalette,
1945
+ tone: (e) => A(e) ? e.isDark ? 100 : 0 : e.isDark ? 80 : 40,
1946
+ isBackground: !0,
1947
+ background: (e) => this.highestSurface(e),
1948
+ contrastCurve: (e) => new y(3, 4.5, 7, 7),
1949
+ toneDeltaPair: (e) => new w(this.primaryContainer(), this.primary(), 10, "nearer", !1)
1950
+ });
1951
+ }
1952
+ primaryDim() {
1953
+ }
1954
+ onPrimary() {
1955
+ return c.fromPalette({
1956
+ name: "on_primary",
1957
+ palette: (e) => e.primaryPalette,
1958
+ tone: (e) => A(e) ? e.isDark ? 10 : 90 : e.isDark ? 20 : 100,
1959
+ background: (e) => this.primary(),
1960
+ contrastCurve: (e) => new y(4.5, 7, 11, 21)
1961
+ });
1962
+ }
1963
+ primaryContainer() {
1964
+ return c.fromPalette({
1965
+ name: "primary_container",
1966
+ palette: (e) => e.primaryPalette,
1967
+ tone: (e) => ue(e) ? e.sourceColorHct.tone : A(e) ? e.isDark ? 85 : 25 : e.isDark ? 30 : 90,
1968
+ isBackground: !0,
1969
+ background: (e) => this.highestSurface(e),
1970
+ contrastCurve: (e) => new y(1, 1, 3, 4.5),
1971
+ toneDeltaPair: (e) => new w(this.primaryContainer(), this.primary(), 10, "nearer", !1)
1972
+ });
1973
+ }
1974
+ onPrimaryContainer() {
1975
+ return c.fromPalette({
1976
+ name: "on_primary_container",
1977
+ palette: (e) => e.primaryPalette,
1978
+ tone: (e) => ue(e) ? c.foregroundTone(this.primaryContainer().tone(e), 4.5) : A(e) ? e.isDark ? 0 : 100 : e.isDark ? 90 : 30,
1979
+ background: (e) => this.primaryContainer(),
1980
+ contrastCurve: (e) => new y(3, 4.5, 7, 11)
1981
+ });
1982
+ }
1983
+ inversePrimary() {
1984
+ return c.fromPalette({
1985
+ name: "inverse_primary",
1986
+ palette: (e) => e.primaryPalette,
1987
+ tone: (e) => e.isDark ? 40 : 80,
1988
+ background: (e) => this.inverseSurface(),
1989
+ contrastCurve: (e) => new y(3, 4.5, 7, 7)
1990
+ });
1991
+ }
1992
+ /////////////////////////////////////////////////////////////////
1993
+ // Secondary [Q]. //
1994
+ /////////////////////////////////////////////////////////////////
1995
+ secondary() {
1996
+ return c.fromPalette({
1997
+ name: "secondary",
1998
+ palette: (e) => e.secondaryPalette,
1999
+ tone: (e) => e.isDark ? 80 : 40,
2000
+ isBackground: !0,
2001
+ background: (e) => this.highestSurface(e),
2002
+ contrastCurve: (e) => new y(3, 4.5, 7, 7),
2003
+ toneDeltaPair: (e) => new w(this.secondaryContainer(), this.secondary(), 10, "nearer", !1)
2004
+ });
2005
+ }
2006
+ secondaryDim() {
2007
+ }
2008
+ onSecondary() {
2009
+ return c.fromPalette({
2010
+ name: "on_secondary",
2011
+ palette: (e) => e.secondaryPalette,
2012
+ tone: (e) => A(e) ? e.isDark ? 10 : 100 : e.isDark ? 20 : 100,
2013
+ background: (e) => this.secondary(),
2014
+ contrastCurve: (e) => new y(4.5, 7, 11, 21)
2015
+ });
2016
+ }
2017
+ secondaryContainer() {
2018
+ return c.fromPalette({
2019
+ name: "secondary_container",
2020
+ palette: (e) => e.secondaryPalette,
2021
+ tone: (e) => {
2022
+ const t = e.isDark ? 30 : 90;
2023
+ return A(e) ? e.isDark ? 30 : 85 : ue(e) ? Nt(e.secondaryPalette.hue, e.secondaryPalette.chroma, t, !e.isDark) : t;
2024
+ },
2025
+ isBackground: !0,
2026
+ background: (e) => this.highestSurface(e),
2027
+ contrastCurve: (e) => new y(1, 1, 3, 4.5),
2028
+ toneDeltaPair: (e) => new w(this.secondaryContainer(), this.secondary(), 10, "nearer", !1)
2029
+ });
2030
+ }
2031
+ onSecondaryContainer() {
2032
+ return c.fromPalette({
2033
+ name: "on_secondary_container",
2034
+ palette: (e) => e.secondaryPalette,
2035
+ tone: (e) => A(e) ? e.isDark ? 90 : 10 : ue(e) ? c.foregroundTone(this.secondaryContainer().tone(e), 4.5) : e.isDark ? 90 : 30,
2036
+ background: (e) => this.secondaryContainer(),
2037
+ contrastCurve: (e) => new y(3, 4.5, 7, 11)
2038
+ });
2039
+ }
2040
+ /////////////////////////////////////////////////////////////////
2041
+ // Tertiary [T]. //
2042
+ /////////////////////////////////////////////////////////////////
2043
+ tertiary() {
2044
+ return c.fromPalette({
2045
+ name: "tertiary",
2046
+ palette: (e) => e.tertiaryPalette,
2047
+ tone: (e) => A(e) ? e.isDark ? 90 : 25 : e.isDark ? 80 : 40,
2048
+ isBackground: !0,
2049
+ background: (e) => this.highestSurface(e),
2050
+ contrastCurve: (e) => new y(3, 4.5, 7, 7),
2051
+ toneDeltaPair: (e) => new w(this.tertiaryContainer(), this.tertiary(), 10, "nearer", !1)
2052
+ });
2053
+ }
2054
+ tertiaryDim() {
2055
+ }
2056
+ onTertiary() {
2057
+ return c.fromPalette({
2058
+ name: "on_tertiary",
2059
+ palette: (e) => e.tertiaryPalette,
2060
+ tone: (e) => A(e) ? e.isDark ? 10 : 90 : e.isDark ? 20 : 100,
2061
+ background: (e) => this.tertiary(),
2062
+ contrastCurve: (e) => new y(4.5, 7, 11, 21)
2063
+ });
2064
+ }
2065
+ tertiaryContainer() {
2066
+ return c.fromPalette({
2067
+ name: "tertiary_container",
2068
+ palette: (e) => e.tertiaryPalette,
2069
+ tone: (e) => {
2070
+ if (A(e))
2071
+ return e.isDark ? 60 : 49;
2072
+ if (!ue(e))
2073
+ return e.isDark ? 30 : 90;
2074
+ const t = e.tertiaryPalette.getHct(e.sourceColorHct.tone);
2075
+ return Ne.fixIfDisliked(t).tone;
2076
+ },
2077
+ isBackground: !0,
2078
+ background: (e) => this.highestSurface(e),
2079
+ contrastCurve: (e) => new y(1, 1, 3, 4.5),
2080
+ toneDeltaPair: (e) => new w(this.tertiaryContainer(), this.tertiary(), 10, "nearer", !1)
2081
+ });
2082
+ }
2083
+ onTertiaryContainer() {
2084
+ return c.fromPalette({
2085
+ name: "on_tertiary_container",
2086
+ palette: (e) => e.tertiaryPalette,
2087
+ tone: (e) => A(e) ? e.isDark ? 0 : 100 : ue(e) ? c.foregroundTone(this.tertiaryContainer().tone(e), 4.5) : e.isDark ? 90 : 30,
2088
+ background: (e) => this.tertiaryContainer(),
2089
+ contrastCurve: (e) => new y(3, 4.5, 7, 11)
2090
+ });
2091
+ }
2092
+ //////////////////////////////////////////////////////////////////
2093
+ // Error [E]. //
2094
+ //////////////////////////////////////////////////////////////////
2095
+ error() {
2096
+ return c.fromPalette({
2097
+ name: "error",
2098
+ palette: (e) => e.errorPalette,
2099
+ tone: (e) => e.isDark ? 80 : 40,
2100
+ isBackground: !0,
2101
+ background: (e) => this.highestSurface(e),
2102
+ contrastCurve: (e) => new y(3, 4.5, 7, 7),
2103
+ toneDeltaPair: (e) => new w(this.errorContainer(), this.error(), 10, "nearer", !1)
2104
+ });
2105
+ }
2106
+ errorDim() {
2107
+ }
2108
+ onError() {
2109
+ return c.fromPalette({
2110
+ name: "on_error",
2111
+ palette: (e) => e.errorPalette,
2112
+ tone: (e) => e.isDark ? 20 : 100,
2113
+ background: (e) => this.error(),
2114
+ contrastCurve: (e) => new y(4.5, 7, 11, 21)
2115
+ });
2116
+ }
2117
+ errorContainer() {
2118
+ return c.fromPalette({
2119
+ name: "error_container",
2120
+ palette: (e) => e.errorPalette,
2121
+ tone: (e) => e.isDark ? 30 : 90,
2122
+ isBackground: !0,
2123
+ background: (e) => this.highestSurface(e),
2124
+ contrastCurve: (e) => new y(1, 1, 3, 4.5),
2125
+ toneDeltaPair: (e) => new w(this.errorContainer(), this.error(), 10, "nearer", !1)
2126
+ });
2127
+ }
2128
+ onErrorContainer() {
2129
+ return c.fromPalette({
2130
+ name: "on_error_container",
2131
+ palette: (e) => e.errorPalette,
2132
+ tone: (e) => A(e) ? e.isDark ? 90 : 10 : e.isDark ? 90 : 30,
2133
+ background: (e) => this.errorContainer(),
2134
+ contrastCurve: (e) => new y(3, 4.5, 7, 11)
2135
+ });
2136
+ }
2137
+ //////////////////////////////////////////////////////////////////
2138
+ // Primary Fixed [PF] //
2139
+ //////////////////////////////////////////////////////////////////
2140
+ primaryFixed() {
2141
+ return c.fromPalette({
2142
+ name: "primary_fixed",
2143
+ palette: (e) => e.primaryPalette,
2144
+ tone: (e) => A(e) ? 40 : 90,
2145
+ isBackground: !0,
2146
+ background: (e) => this.highestSurface(e),
2147
+ contrastCurve: (e) => new y(1, 1, 3, 4.5),
2148
+ toneDeltaPair: (e) => new w(this.primaryFixed(), this.primaryFixedDim(), 10, "lighter", !0)
2149
+ });
2150
+ }
2151
+ primaryFixedDim() {
2152
+ return c.fromPalette({
2153
+ name: "primary_fixed_dim",
2154
+ palette: (e) => e.primaryPalette,
2155
+ tone: (e) => A(e) ? 30 : 80,
2156
+ isBackground: !0,
2157
+ background: (e) => this.highestSurface(e),
2158
+ contrastCurve: (e) => new y(1, 1, 3, 4.5),
2159
+ toneDeltaPair: (e) => new w(this.primaryFixed(), this.primaryFixedDim(), 10, "lighter", !0)
2160
+ });
2161
+ }
2162
+ onPrimaryFixed() {
2163
+ return c.fromPalette({
2164
+ name: "on_primary_fixed",
2165
+ palette: (e) => e.primaryPalette,
2166
+ tone: (e) => A(e) ? 100 : 10,
2167
+ background: (e) => this.primaryFixedDim(),
2168
+ secondBackground: (e) => this.primaryFixed(),
2169
+ contrastCurve: (e) => new y(4.5, 7, 11, 21)
2170
+ });
2171
+ }
2172
+ onPrimaryFixedVariant() {
2173
+ return c.fromPalette({
2174
+ name: "on_primary_fixed_variant",
2175
+ palette: (e) => e.primaryPalette,
2176
+ tone: (e) => A(e) ? 90 : 30,
2177
+ background: (e) => this.primaryFixedDim(),
2178
+ secondBackground: (e) => this.primaryFixed(),
2179
+ contrastCurve: (e) => new y(3, 4.5, 7, 11)
2180
+ });
2181
+ }
2182
+ ///////////////////////////////////////////////////////////////////
2183
+ // Secondary Fixed [QF] //
2184
+ ///////////////////////////////////////////////////////////////////
2185
+ secondaryFixed() {
2186
+ return c.fromPalette({
2187
+ name: "secondary_fixed",
2188
+ palette: (e) => e.secondaryPalette,
2189
+ tone: (e) => A(e) ? 80 : 90,
2190
+ isBackground: !0,
2191
+ background: (e) => this.highestSurface(e),
2192
+ contrastCurve: (e) => new y(1, 1, 3, 4.5),
2193
+ toneDeltaPair: (e) => new w(this.secondaryFixed(), this.secondaryFixedDim(), 10, "lighter", !0)
2194
+ });
2195
+ }
2196
+ secondaryFixedDim() {
2197
+ return c.fromPalette({
2198
+ name: "secondary_fixed_dim",
2199
+ palette: (e) => e.secondaryPalette,
2200
+ tone: (e) => A(e) ? 70 : 80,
2201
+ isBackground: !0,
2202
+ background: (e) => this.highestSurface(e),
2203
+ contrastCurve: (e) => new y(1, 1, 3, 4.5),
2204
+ toneDeltaPair: (e) => new w(this.secondaryFixed(), this.secondaryFixedDim(), 10, "lighter", !0)
2205
+ });
2206
+ }
2207
+ onSecondaryFixed() {
2208
+ return c.fromPalette({
2209
+ name: "on_secondary_fixed",
2210
+ palette: (e) => e.secondaryPalette,
2211
+ tone: (e) => 10,
2212
+ background: (e) => this.secondaryFixedDim(),
2213
+ secondBackground: (e) => this.secondaryFixed(),
2214
+ contrastCurve: (e) => new y(4.5, 7, 11, 21)
2215
+ });
2216
+ }
2217
+ onSecondaryFixedVariant() {
2218
+ return c.fromPalette({
2219
+ name: "on_secondary_fixed_variant",
2220
+ palette: (e) => e.secondaryPalette,
2221
+ tone: (e) => A(e) ? 25 : 30,
2222
+ background: (e) => this.secondaryFixedDim(),
2223
+ secondBackground: (e) => this.secondaryFixed(),
2224
+ contrastCurve: (e) => new y(3, 4.5, 7, 11)
2225
+ });
2226
+ }
2227
+ /////////////////////////////////////////////////////////////////
2228
+ // Tertiary Fixed [TF] //
2229
+ /////////////////////////////////////////////////////////////////
2230
+ tertiaryFixed() {
2231
+ return c.fromPalette({
2232
+ name: "tertiary_fixed",
2233
+ palette: (e) => e.tertiaryPalette,
2234
+ tone: (e) => A(e) ? 40 : 90,
2235
+ isBackground: !0,
2236
+ background: (e) => this.highestSurface(e),
2237
+ contrastCurve: (e) => new y(1, 1, 3, 4.5),
2238
+ toneDeltaPair: (e) => new w(this.tertiaryFixed(), this.tertiaryFixedDim(), 10, "lighter", !0)
2239
+ });
2240
+ }
2241
+ tertiaryFixedDim() {
2242
+ return c.fromPalette({
2243
+ name: "tertiary_fixed_dim",
2244
+ palette: (e) => e.tertiaryPalette,
2245
+ tone: (e) => A(e) ? 30 : 80,
2246
+ isBackground: !0,
2247
+ background: (e) => this.highestSurface(e),
2248
+ contrastCurve: (e) => new y(1, 1, 3, 4.5),
2249
+ toneDeltaPair: (e) => new w(this.tertiaryFixed(), this.tertiaryFixedDim(), 10, "lighter", !0)
2250
+ });
2251
+ }
2252
+ onTertiaryFixed() {
2253
+ return c.fromPalette({
2254
+ name: "on_tertiary_fixed",
2255
+ palette: (e) => e.tertiaryPalette,
2256
+ tone: (e) => A(e) ? 100 : 10,
2257
+ background: (e) => this.tertiaryFixedDim(),
2258
+ secondBackground: (e) => this.tertiaryFixed(),
2259
+ contrastCurve: (e) => new y(4.5, 7, 11, 21)
2260
+ });
2261
+ }
2262
+ onTertiaryFixedVariant() {
2263
+ return c.fromPalette({
2264
+ name: "on_tertiary_fixed_variant",
2265
+ palette: (e) => e.tertiaryPalette,
2266
+ tone: (e) => A(e) ? 90 : 30,
2267
+ background: (e) => this.tertiaryFixedDim(),
2268
+ secondBackground: (e) => this.tertiaryFixed(),
2269
+ contrastCurve: (e) => new y(3, 4.5, 7, 11)
2270
+ });
2271
+ }
2272
+ ////////////////////////////////////////////////////////////////
2273
+ // Other //
2274
+ ////////////////////////////////////////////////////////////////
2275
+ highestSurface(e) {
2276
+ return e.isDark ? this.surfaceBright() : this.surfaceDim();
2277
+ }
2278
+ }
2279
+ /**
2280
+ * @license
2281
+ * Copyright 2025 Google LLC
2282
+ *
2283
+ * Licensed under the Apache License, Version 2.0 (the "License");
2284
+ * you may not use this file except in compliance with the License.
2285
+ * You may obtain a copy of the License at
2286
+ *
2287
+ * http://www.apache.org/licenses/LICENSE-2.0
2288
+ *
2289
+ * Unless required by applicable law or agreed to in writing, software
2290
+ * distributed under the License is distributed on an "AS IS" BASIS,
2291
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2292
+ * See the License for the specific language governing permissions and
2293
+ * limitations under the License.
2294
+ */
2295
+ function D(r, e = 0, t = 100, n = 1) {
2296
+ let a = ct(r.hue, r.chroma * n, 100, !0);
2297
+ return U(e, t, a);
2298
+ }
2299
+ function ne(r, e = 0, t = 100) {
2300
+ let n = ct(r.hue, r.chroma, 0, !1);
2301
+ return U(e, t, n);
2302
+ }
2303
+ function ct(r, e, t, n) {
2304
+ let a = t, o = C.from(r, e, a);
2305
+ for (; o.chroma < e && !(t < 0 || t > 100); ) {
2306
+ t += n ? -1 : 1;
2307
+ const i = C.from(r, e, t);
2308
+ o.chroma < i.chroma && (o = i, a = t);
2309
+ }
2310
+ return a;
2311
+ }
2312
+ function b(r) {
2313
+ return r === 1.5 ? new y(1.5, 1.5, 3, 5.5) : r === 3 ? new y(3, 3, 4.5, 7) : r === 4.5 ? new y(4.5, 4.5, 7, 11) : r === 6 ? new y(6, 6, 7, 11) : r === 7 ? new y(7, 7, 11, 21) : r === 9 ? new y(9, 9, 11, 21) : r === 11 ? new y(11, 11, 21, 21) : r === 21 ? new y(21, 21, 21, 21) : new y(r, r, 7, 21);
2314
+ }
2315
+ class Ht extends _t {
2316
+ ////////////////////////////////////////////////////////////////
2317
+ // Surfaces [S] //
2318
+ ////////////////////////////////////////////////////////////////
2319
+ surface() {
2320
+ const e = c.fromPalette({
2321
+ name: "surface",
2322
+ palette: (t) => t.neutralPalette,
2323
+ tone: (t) => (super.surface().tone(t), t.platform === "phone" ? t.isDark ? 4 : C.isYellow(t.neutralPalette.hue) ? 99 : t.variant === d.VIBRANT ? 97 : 98 : 0),
2324
+ isBackground: !0
2325
+ });
2326
+ return T(super.surface(), "2025", e);
2327
+ }
2328
+ surfaceDim() {
2329
+ const e = c.fromPalette({
2330
+ name: "surface_dim",
2331
+ palette: (t) => t.neutralPalette,
2332
+ tone: (t) => t.isDark ? 4 : C.isYellow(t.neutralPalette.hue) ? 90 : t.variant === d.VIBRANT ? 85 : 87,
2333
+ isBackground: !0,
2334
+ chromaMultiplier: (t) => {
2335
+ if (!t.isDark) {
2336
+ if (t.variant === d.NEUTRAL)
2337
+ return 2.5;
2338
+ if (t.variant === d.TONAL_SPOT)
2339
+ return 1.7;
2340
+ if (t.variant === d.EXPRESSIVE)
2341
+ return C.isYellow(t.neutralPalette.hue) ? 2.7 : 1.75;
2342
+ if (t.variant === d.VIBRANT)
2343
+ return 1.36;
2344
+ }
2345
+ return 1;
2346
+ }
2347
+ });
2348
+ return T(super.surfaceDim(), "2025", e);
2349
+ }
2350
+ surfaceBright() {
2351
+ const e = c.fromPalette({
2352
+ name: "surface_bright",
2353
+ palette: (t) => t.neutralPalette,
2354
+ tone: (t) => t.isDark ? 18 : C.isYellow(t.neutralPalette.hue) ? 99 : t.variant === d.VIBRANT ? 97 : 98,
2355
+ isBackground: !0,
2356
+ chromaMultiplier: (t) => {
2357
+ if (t.isDark) {
2358
+ if (t.variant === d.NEUTRAL)
2359
+ return 2.5;
2360
+ if (t.variant === d.TONAL_SPOT)
2361
+ return 1.7;
2362
+ if (t.variant === d.EXPRESSIVE)
2363
+ return C.isYellow(t.neutralPalette.hue) ? 2.7 : 1.75;
2364
+ if (t.variant === d.VIBRANT)
2365
+ return 1.36;
2366
+ }
2367
+ return 1;
2368
+ }
2369
+ });
2370
+ return T(super.surfaceBright(), "2025", e);
2371
+ }
2372
+ surfaceContainerLowest() {
2373
+ const e = c.fromPalette({
2374
+ name: "surface_container_lowest",
2375
+ palette: (t) => t.neutralPalette,
2376
+ tone: (t) => t.isDark ? 0 : 100,
2377
+ isBackground: !0
2378
+ });
2379
+ return T(super.surfaceContainerLowest(), "2025", e);
2380
+ }
2381
+ surfaceContainerLow() {
2382
+ const e = c.fromPalette({
2383
+ name: "surface_container_low",
2384
+ palette: (t) => t.neutralPalette,
2385
+ tone: (t) => t.platform === "phone" ? t.isDark ? 6 : C.isYellow(t.neutralPalette.hue) ? 98 : t.variant === d.VIBRANT ? 95 : 96 : 15,
2386
+ isBackground: !0,
2387
+ chromaMultiplier: (t) => {
2388
+ if (t.platform === "phone") {
2389
+ if (t.variant === d.NEUTRAL)
2390
+ return 1.3;
2391
+ if (t.variant === d.TONAL_SPOT)
2392
+ return 1.25;
2393
+ if (t.variant === d.EXPRESSIVE)
2394
+ return C.isYellow(t.neutralPalette.hue) ? 1.3 : 1.15;
2395
+ if (t.variant === d.VIBRANT)
2396
+ return 1.08;
2397
+ }
2398
+ return 1;
2399
+ }
2400
+ });
2401
+ return T(super.surfaceContainerLow(), "2025", e);
2402
+ }
2403
+ surfaceContainer() {
2404
+ const e = c.fromPalette({
2405
+ name: "surface_container",
2406
+ palette: (t) => t.neutralPalette,
2407
+ tone: (t) => t.platform === "phone" ? t.isDark ? 9 : C.isYellow(t.neutralPalette.hue) ? 96 : t.variant === d.VIBRANT ? 92 : 94 : 20,
2408
+ isBackground: !0,
2409
+ chromaMultiplier: (t) => {
2410
+ if (t.platform === "phone") {
2411
+ if (t.variant === d.NEUTRAL)
2412
+ return 1.6;
2413
+ if (t.variant === d.TONAL_SPOT)
2414
+ return 1.4;
2415
+ if (t.variant === d.EXPRESSIVE)
2416
+ return C.isYellow(t.neutralPalette.hue) ? 1.6 : 1.3;
2417
+ if (t.variant === d.VIBRANT)
2418
+ return 1.15;
2419
+ }
2420
+ return 1;
2421
+ }
2422
+ });
2423
+ return T(super.surfaceContainer(), "2025", e);
2424
+ }
2425
+ surfaceContainerHigh() {
2426
+ const e = c.fromPalette({
2427
+ name: "surface_container_high",
2428
+ palette: (t) => t.neutralPalette,
2429
+ tone: (t) => t.platform === "phone" ? t.isDark ? 12 : C.isYellow(t.neutralPalette.hue) ? 94 : t.variant === d.VIBRANT ? 90 : 92 : 25,
2430
+ isBackground: !0,
2431
+ chromaMultiplier: (t) => {
2432
+ if (t.platform === "phone") {
2433
+ if (t.variant === d.NEUTRAL)
2434
+ return 1.9;
2435
+ if (t.variant === d.TONAL_SPOT)
2436
+ return 1.5;
2437
+ if (t.variant === d.EXPRESSIVE)
2438
+ return C.isYellow(t.neutralPalette.hue) ? 1.95 : 1.45;
2439
+ if (t.variant === d.VIBRANT)
2440
+ return 1.22;
2441
+ }
2442
+ return 1;
2443
+ }
2444
+ });
2445
+ return T(super.surfaceContainerHigh(), "2025", e);
2446
+ }
2447
+ surfaceContainerHighest() {
2448
+ const e = c.fromPalette({
2449
+ name: "surface_container_highest",
2450
+ palette: (t) => t.neutralPalette,
2451
+ tone: (t) => t.isDark ? 15 : C.isYellow(t.neutralPalette.hue) ? 92 : t.variant === d.VIBRANT ? 88 : 90,
2452
+ isBackground: !0,
2453
+ chromaMultiplier: (t) => t.variant === d.NEUTRAL ? 2.2 : t.variant === d.TONAL_SPOT ? 1.7 : t.variant === d.EXPRESSIVE ? C.isYellow(t.neutralPalette.hue) ? 2.3 : 1.6 : t.variant === d.VIBRANT ? 1.29 : 1
2454
+ });
2455
+ return T(super.surfaceContainerHighest(), "2025", e);
2456
+ }
2457
+ onSurface() {
2458
+ const e = c.fromPalette({
2459
+ name: "on_surface",
2460
+ palette: (t) => t.neutralPalette,
2461
+ tone: (t) => t.variant === d.VIBRANT ? D(t.neutralPalette, 0, 100, 1.1) : c.getInitialToneFromBackground((n) => n.platform === "phone" ? this.highestSurface(n) : this.surfaceContainerHigh())(t),
2462
+ chromaMultiplier: (t) => {
2463
+ if (t.platform === "phone") {
2464
+ if (t.variant === d.NEUTRAL)
2465
+ return 2.2;
2466
+ if (t.variant === d.TONAL_SPOT)
2467
+ return 1.7;
2468
+ if (t.variant === d.EXPRESSIVE)
2469
+ return C.isYellow(t.neutralPalette.hue) ? t.isDark ? 3 : 2.3 : 1.6;
2470
+ }
2471
+ return 1;
2472
+ },
2473
+ background: (t) => t.platform === "phone" ? this.highestSurface(t) : this.surfaceContainerHigh(),
2474
+ contrastCurve: (t) => t.isDark && t.platform === "phone" ? b(11) : b(9)
2475
+ });
2476
+ return T(super.onSurface(), "2025", e);
2477
+ }
2478
+ onSurfaceVariant() {
2479
+ const e = c.fromPalette({
2480
+ name: "on_surface_variant",
2481
+ palette: (t) => t.neutralPalette,
2482
+ chromaMultiplier: (t) => {
2483
+ if (t.platform === "phone") {
2484
+ if (t.variant === d.NEUTRAL)
2485
+ return 2.2;
2486
+ if (t.variant === d.TONAL_SPOT)
2487
+ return 1.7;
2488
+ if (t.variant === d.EXPRESSIVE)
2489
+ return C.isYellow(t.neutralPalette.hue) ? t.isDark ? 3 : 2.3 : 1.6;
2490
+ }
2491
+ return 1;
2492
+ },
2493
+ background: (t) => t.platform === "phone" ? this.highestSurface(t) : this.surfaceContainerHigh(),
2494
+ contrastCurve: (t) => t.platform === "phone" ? t.isDark ? b(6) : b(4.5) : b(7)
2495
+ });
2496
+ return T(super.onSurfaceVariant(), "2025", e);
2497
+ }
2498
+ outline() {
2499
+ const e = c.fromPalette({
2500
+ name: "outline",
2501
+ palette: (t) => t.neutralPalette,
2502
+ chromaMultiplier: (t) => {
2503
+ if (t.platform === "phone") {
2504
+ if (t.variant === d.NEUTRAL)
2505
+ return 2.2;
2506
+ if (t.variant === d.TONAL_SPOT)
2507
+ return 1.7;
2508
+ if (t.variant === d.EXPRESSIVE)
2509
+ return C.isYellow(t.neutralPalette.hue) ? t.isDark ? 3 : 2.3 : 1.6;
2510
+ }
2511
+ return 1;
2512
+ },
2513
+ background: (t) => t.platform === "phone" ? this.highestSurface(t) : this.surfaceContainerHigh(),
2514
+ contrastCurve: (t) => t.platform === "phone" ? b(3) : b(4.5)
2515
+ });
2516
+ return T(super.outline(), "2025", e);
2517
+ }
2518
+ outlineVariant() {
2519
+ const e = c.fromPalette({
2520
+ name: "outline_variant",
2521
+ palette: (t) => t.neutralPalette,
2522
+ chromaMultiplier: (t) => {
2523
+ if (t.platform === "phone") {
2524
+ if (t.variant === d.NEUTRAL)
2525
+ return 2.2;
2526
+ if (t.variant === d.TONAL_SPOT)
2527
+ return 1.7;
2528
+ if (t.variant === d.EXPRESSIVE)
2529
+ return C.isYellow(t.neutralPalette.hue) ? t.isDark ? 3 : 2.3 : 1.6;
2530
+ }
2531
+ return 1;
2532
+ },
2533
+ background: (t) => t.platform === "phone" ? this.highestSurface(t) : this.surfaceContainerHigh(),
2534
+ contrastCurve: (t) => t.platform === "phone" ? b(1.5) : b(3)
2535
+ });
2536
+ return T(super.outlineVariant(), "2025", e);
2537
+ }
2538
+ inverseSurface() {
2539
+ const e = c.fromPalette({
2540
+ name: "inverse_surface",
2541
+ palette: (t) => t.neutralPalette,
2542
+ tone: (t) => t.isDark ? 98 : 4,
2543
+ isBackground: !0
2544
+ });
2545
+ return T(super.inverseSurface(), "2025", e);
2546
+ }
2547
+ inverseOnSurface() {
2548
+ const e = c.fromPalette({
2549
+ name: "inverse_on_surface",
2550
+ palette: (t) => t.neutralPalette,
2551
+ background: (t) => this.inverseSurface(),
2552
+ contrastCurve: (t) => b(7)
2553
+ });
2554
+ return T(super.inverseOnSurface(), "2025", e);
2555
+ }
2556
+ ////////////////////////////////////////////////////////////////
2557
+ // Primaries [P] //
2558
+ ////////////////////////////////////////////////////////////////
2559
+ primary() {
2560
+ const e = c.fromPalette({
2561
+ name: "primary",
2562
+ palette: (t) => t.primaryPalette,
2563
+ tone: (t) => t.variant === d.NEUTRAL ? t.platform === "phone" ? t.isDark ? 80 : 40 : 90 : t.variant === d.TONAL_SPOT ? t.platform === "phone" ? t.isDark ? 80 : D(t.primaryPalette) : D(t.primaryPalette, 0, 90) : t.variant === d.EXPRESSIVE ? t.platform === "phone" ? D(t.primaryPalette, 0, C.isYellow(t.primaryPalette.hue) ? 25 : C.isCyan(t.primaryPalette.hue) ? 88 : 98) : D(t.primaryPalette) : t.platform === "phone" ? D(t.primaryPalette, 0, C.isCyan(t.primaryPalette.hue) ? 88 : 98) : D(t.primaryPalette),
2564
+ isBackground: !0,
2565
+ background: (t) => t.platform === "phone" ? this.highestSurface(t) : this.surfaceContainerHigh(),
2566
+ contrastCurve: (t) => t.platform === "phone" ? b(4.5) : b(7),
2567
+ toneDeltaPair: (t) => t.platform === "phone" ? new w(this.primaryContainer(), this.primary(), 5, "relative_lighter", !0, "farther") : void 0
2568
+ });
2569
+ return T(super.primary(), "2025", e);
2570
+ }
2571
+ primaryDim() {
2572
+ return c.fromPalette({
2573
+ name: "primary_dim",
2574
+ palette: (e) => e.primaryPalette,
2575
+ tone: (e) => e.variant === d.NEUTRAL ? 85 : e.variant === d.TONAL_SPOT ? D(e.primaryPalette, 0, 90) : D(e.primaryPalette),
2576
+ isBackground: !0,
2577
+ background: (e) => this.surfaceContainerHigh(),
2578
+ contrastCurve: (e) => b(4.5),
2579
+ toneDeltaPair: (e) => new w(this.primaryDim(), this.primary(), 5, "darker", !0, "farther")
2580
+ });
2581
+ }
2582
+ onPrimary() {
2583
+ const e = c.fromPalette({
2584
+ name: "on_primary",
2585
+ palette: (t) => t.primaryPalette,
2586
+ background: (t) => t.platform === "phone" ? this.primary() : this.primaryDim(),
2587
+ contrastCurve: (t) => t.platform === "phone" ? b(6) : b(7)
2588
+ });
2589
+ return T(super.onPrimary(), "2025", e);
2590
+ }
2591
+ primaryContainer() {
2592
+ const e = c.fromPalette({
2593
+ name: "primary_container",
2594
+ palette: (t) => t.primaryPalette,
2595
+ tone: (t) => t.platform === "watch" ? 30 : t.variant === d.NEUTRAL ? t.isDark ? 30 : 90 : t.variant === d.TONAL_SPOT ? t.isDark ? ne(t.primaryPalette, 35, 93) : D(t.primaryPalette, 0, 90) : t.variant === d.EXPRESSIVE ? t.isDark ? D(t.primaryPalette, 30, 93) : D(t.primaryPalette, 78, C.isCyan(t.primaryPalette.hue) ? 88 : 90) : t.isDark ? ne(t.primaryPalette, 66, 93) : D(t.primaryPalette, 66, C.isCyan(t.primaryPalette.hue) ? 88 : 93),
2596
+ isBackground: !0,
2597
+ background: (t) => t.platform === "phone" ? this.highestSurface(t) : void 0,
2598
+ toneDeltaPair: (t) => t.platform === "phone" ? void 0 : new w(this.primaryContainer(), this.primaryDim(), 10, "darker", !0, "farther"),
2599
+ contrastCurve: (t) => t.platform === "phone" && t.contrastLevel > 0 ? b(1.5) : void 0
2600
+ });
2601
+ return T(super.primaryContainer(), "2025", e);
2602
+ }
2603
+ onPrimaryContainer() {
2604
+ const e = c.fromPalette({
2605
+ name: "on_primary_container",
2606
+ palette: (t) => t.primaryPalette,
2607
+ background: (t) => this.primaryContainer(),
2608
+ contrastCurve: (t) => t.platform === "phone" ? b(6) : b(7)
2609
+ });
2610
+ return T(super.onPrimaryContainer(), "2025", e);
2611
+ }
2612
+ primaryFixed() {
2613
+ const e = c.fromPalette({
2614
+ name: "primary_fixed",
2615
+ palette: (t) => t.primaryPalette,
2616
+ tone: (t) => {
2617
+ let n = Object.assign({}, t, { isDark: !1, contrastLevel: 0 });
2618
+ return this.primaryContainer().getTone(n);
2619
+ },
2620
+ isBackground: !0,
2621
+ background: (t) => t.platform === "phone" ? this.highestSurface(t) : void 0,
2622
+ contrastCurve: (t) => t.platform === "phone" && t.contrastLevel > 0 ? b(1.5) : void 0
2623
+ });
2624
+ return T(super.primaryFixed(), "2025", e);
2625
+ }
2626
+ primaryFixedDim() {
2627
+ const e = c.fromPalette({
2628
+ name: "primary_fixed_dim",
2629
+ palette: (t) => t.primaryPalette,
2630
+ tone: (t) => this.primaryFixed().getTone(t),
2631
+ isBackground: !0,
2632
+ toneDeltaPair: (t) => new w(this.primaryFixedDim(), this.primaryFixed(), 5, "darker", !0, "exact")
2633
+ });
2634
+ return T(super.primaryFixedDim(), "2025", e);
2635
+ }
2636
+ onPrimaryFixed() {
2637
+ const e = c.fromPalette({
2638
+ name: "on_primary_fixed",
2639
+ palette: (t) => t.primaryPalette,
2640
+ background: (t) => this.primaryFixedDim(),
2641
+ contrastCurve: (t) => b(7)
2642
+ });
2643
+ return T(super.onPrimaryFixed(), "2025", e);
2644
+ }
2645
+ onPrimaryFixedVariant() {
2646
+ const e = c.fromPalette({
2647
+ name: "on_primary_fixed_variant",
2648
+ palette: (t) => t.primaryPalette,
2649
+ background: (t) => this.primaryFixedDim(),
2650
+ contrastCurve: (t) => b(4.5)
2651
+ });
2652
+ return T(super.onPrimaryFixedVariant(), "2025", e);
2653
+ }
2654
+ inversePrimary() {
2655
+ const e = c.fromPalette({
2656
+ name: "inverse_primary",
2657
+ palette: (t) => t.primaryPalette,
2658
+ tone: (t) => D(t.primaryPalette),
2659
+ background: (t) => this.inverseSurface(),
2660
+ contrastCurve: (t) => t.platform === "phone" ? b(6) : b(7)
2661
+ });
2662
+ return T(super.inversePrimary(), "2025", e);
2663
+ }
2664
+ ////////////////////////////////////////////////////////////////
2665
+ // Secondaries [Q] //
2666
+ ////////////////////////////////////////////////////////////////
2667
+ secondary() {
2668
+ const e = c.fromPalette({
2669
+ name: "secondary",
2670
+ palette: (t) => t.secondaryPalette,
2671
+ tone: (t) => t.platform === "watch" ? t.variant === d.NEUTRAL ? 90 : D(t.secondaryPalette, 0, 90) : t.variant === d.NEUTRAL ? t.isDark ? ne(t.secondaryPalette, 0, 98) : D(t.secondaryPalette) : t.variant === d.VIBRANT ? D(t.secondaryPalette, 0, t.isDark ? 90 : 98) : t.isDark ? 80 : D(t.secondaryPalette),
2672
+ isBackground: !0,
2673
+ background: (t) => t.platform === "phone" ? this.highestSurface(t) : this.surfaceContainerHigh(),
2674
+ contrastCurve: (t) => t.platform === "phone" ? b(4.5) : b(7),
2675
+ toneDeltaPair: (t) => t.platform === "phone" ? new w(this.secondaryContainer(), this.secondary(), 5, "relative_lighter", !0, "farther") : void 0
2676
+ });
2677
+ return T(super.secondary(), "2025", e);
2678
+ }
2679
+ secondaryDim() {
2680
+ return c.fromPalette({
2681
+ name: "secondary_dim",
2682
+ palette: (e) => e.secondaryPalette,
2683
+ tone: (e) => e.variant === d.NEUTRAL ? 85 : D(e.secondaryPalette, 0, 90),
2684
+ isBackground: !0,
2685
+ background: (e) => this.surfaceContainerHigh(),
2686
+ contrastCurve: (e) => b(4.5),
2687
+ toneDeltaPair: (e) => new w(this.secondaryDim(), this.secondary(), 5, "darker", !0, "farther")
2688
+ });
2689
+ }
2690
+ onSecondary() {
2691
+ const e = c.fromPalette({
2692
+ name: "on_secondary",
2693
+ palette: (t) => t.secondaryPalette,
2694
+ background: (t) => t.platform === "phone" ? this.secondary() : this.secondaryDim(),
2695
+ contrastCurve: (t) => t.platform === "phone" ? b(6) : b(7)
2696
+ });
2697
+ return T(super.onSecondary(), "2025", e);
2698
+ }
2699
+ secondaryContainer() {
2700
+ const e = c.fromPalette({
2701
+ name: "secondary_container",
2702
+ palette: (t) => t.secondaryPalette,
2703
+ tone: (t) => t.platform === "watch" ? 30 : t.variant === d.VIBRANT ? t.isDark ? ne(t.secondaryPalette, 30, 40) : D(t.secondaryPalette, 84, 90) : t.variant === d.EXPRESSIVE ? t.isDark ? 15 : D(t.secondaryPalette, 90, 95) : t.isDark ? 25 : 90,
2704
+ isBackground: !0,
2705
+ background: (t) => t.platform === "phone" ? this.highestSurface(t) : void 0,
2706
+ toneDeltaPair: (t) => t.platform === "watch" ? new w(this.secondaryContainer(), this.secondaryDim(), 10, "darker", !0, "farther") : void 0,
2707
+ contrastCurve: (t) => t.platform === "phone" && t.contrastLevel > 0 ? b(1.5) : void 0
2708
+ });
2709
+ return T(super.secondaryContainer(), "2025", e);
2710
+ }
2711
+ onSecondaryContainer() {
2712
+ const e = c.fromPalette({
2713
+ name: "on_secondary_container",
2714
+ palette: (t) => t.secondaryPalette,
2715
+ background: (t) => this.secondaryContainer(),
2716
+ contrastCurve: (t) => t.platform === "phone" ? b(6) : b(7)
2717
+ });
2718
+ return T(super.onSecondaryContainer(), "2025", e);
2719
+ }
2720
+ secondaryFixed() {
2721
+ const e = c.fromPalette({
2722
+ name: "secondary_fixed",
2723
+ palette: (t) => t.secondaryPalette,
2724
+ tone: (t) => {
2725
+ let n = Object.assign({}, t, { isDark: !1, contrastLevel: 0 });
2726
+ return this.secondaryContainer().getTone(n);
2727
+ },
2728
+ isBackground: !0,
2729
+ background: (t) => t.platform === "phone" ? this.highestSurface(t) : void 0,
2730
+ contrastCurve: (t) => t.platform === "phone" && t.contrastLevel > 0 ? b(1.5) : void 0
2731
+ });
2732
+ return T(super.secondaryFixed(), "2025", e);
2733
+ }
2734
+ secondaryFixedDim() {
2735
+ const e = c.fromPalette({
2736
+ name: "secondary_fixed_dim",
2737
+ palette: (t) => t.secondaryPalette,
2738
+ tone: (t) => this.secondaryFixed().getTone(t),
2739
+ isBackground: !0,
2740
+ toneDeltaPair: (t) => new w(this.secondaryFixedDim(), this.secondaryFixed(), 5, "darker", !0, "exact")
2741
+ });
2742
+ return T(super.secondaryFixedDim(), "2025", e);
2743
+ }
2744
+ onSecondaryFixed() {
2745
+ const e = c.fromPalette({
2746
+ name: "on_secondary_fixed",
2747
+ palette: (t) => t.secondaryPalette,
2748
+ background: (t) => this.secondaryFixedDim(),
2749
+ contrastCurve: (t) => b(7)
2750
+ });
2751
+ return T(super.onSecondaryFixed(), "2025", e);
2752
+ }
2753
+ onSecondaryFixedVariant() {
2754
+ const e = c.fromPalette({
2755
+ name: "on_secondary_fixed_variant",
2756
+ palette: (t) => t.secondaryPalette,
2757
+ background: (t) => this.secondaryFixedDim(),
2758
+ contrastCurve: (t) => b(4.5)
2759
+ });
2760
+ return T(super.onSecondaryFixedVariant(), "2025", e);
2761
+ }
2762
+ ////////////////////////////////////////////////////////////////
2763
+ // Tertiaries [T] //
2764
+ ////////////////////////////////////////////////////////////////
2765
+ tertiary() {
2766
+ const e = c.fromPalette({
2767
+ name: "tertiary",
2768
+ palette: (t) => t.tertiaryPalette,
2769
+ tone: (t) => t.platform === "watch" ? t.variant === d.TONAL_SPOT ? D(t.tertiaryPalette, 0, 90) : D(t.tertiaryPalette) : t.variant === d.EXPRESSIVE || t.variant === d.VIBRANT ? D(t.tertiaryPalette, 0, C.isCyan(t.tertiaryPalette.hue) ? 88 : t.isDark ? 98 : 100) : t.isDark ? D(t.tertiaryPalette, 0, 98) : D(t.tertiaryPalette),
2770
+ isBackground: !0,
2771
+ background: (t) => t.platform === "phone" ? this.highestSurface(t) : this.surfaceContainerHigh(),
2772
+ contrastCurve: (t) => t.platform === "phone" ? b(4.5) : b(7),
2773
+ toneDeltaPair: (t) => t.platform === "phone" ? new w(this.tertiaryContainer(), this.tertiary(), 5, "relative_lighter", !0, "farther") : void 0
2774
+ });
2775
+ return T(super.tertiary(), "2025", e);
2776
+ }
2777
+ tertiaryDim() {
2778
+ return c.fromPalette({
2779
+ name: "tertiary_dim",
2780
+ palette: (e) => e.tertiaryPalette,
2781
+ tone: (e) => e.variant === d.TONAL_SPOT ? D(e.tertiaryPalette, 0, 90) : D(e.tertiaryPalette),
2782
+ isBackground: !0,
2783
+ background: (e) => this.surfaceContainerHigh(),
2784
+ contrastCurve: (e) => b(4.5),
2785
+ toneDeltaPair: (e) => new w(this.tertiaryDim(), this.tertiary(), 5, "darker", !0, "farther")
2786
+ });
2787
+ }
2788
+ onTertiary() {
2789
+ const e = c.fromPalette({
2790
+ name: "on_tertiary",
2791
+ palette: (t) => t.tertiaryPalette,
2792
+ background: (t) => t.platform === "phone" ? this.tertiary() : this.tertiaryDim(),
2793
+ contrastCurve: (t) => t.platform === "phone" ? b(6) : b(7)
2794
+ });
2795
+ return T(super.onTertiary(), "2025", e);
2796
+ }
2797
+ tertiaryContainer() {
2798
+ const e = c.fromPalette({
2799
+ name: "tertiary_container",
2800
+ palette: (t) => t.tertiaryPalette,
2801
+ tone: (t) => t.platform === "watch" ? t.variant === d.TONAL_SPOT ? D(t.tertiaryPalette, 0, 90) : D(t.tertiaryPalette) : t.variant === d.NEUTRAL ? t.isDark ? D(t.tertiaryPalette, 0, 93) : D(t.tertiaryPalette, 0, 96) : t.variant === d.TONAL_SPOT ? D(t.tertiaryPalette, 0, t.isDark ? 93 : 100) : t.variant === d.EXPRESSIVE ? D(t.tertiaryPalette, 75, C.isCyan(t.tertiaryPalette.hue) ? 88 : t.isDark ? 93 : 100) : t.isDark ? D(t.tertiaryPalette, 0, 93) : D(t.tertiaryPalette, 72, 100),
2802
+ isBackground: !0,
2803
+ background: (t) => t.platform === "phone" ? this.highestSurface(t) : void 0,
2804
+ toneDeltaPair: (t) => t.platform === "watch" ? new w(this.tertiaryContainer(), this.tertiaryDim(), 10, "darker", !0, "farther") : void 0,
2805
+ contrastCurve: (t) => t.platform === "phone" && t.contrastLevel > 0 ? b(1.5) : void 0
2806
+ });
2807
+ return T(super.tertiaryContainer(), "2025", e);
2808
+ }
2809
+ onTertiaryContainer() {
2810
+ const e = c.fromPalette({
2811
+ name: "on_tertiary_container",
2812
+ palette: (t) => t.tertiaryPalette,
2813
+ background: (t) => this.tertiaryContainer(),
2814
+ contrastCurve: (t) => t.platform === "phone" ? b(6) : b(7)
2815
+ });
2816
+ return T(super.onTertiaryContainer(), "2025", e);
2817
+ }
2818
+ tertiaryFixed() {
2819
+ const e = c.fromPalette({
2820
+ name: "tertiary_fixed",
2821
+ palette: (t) => t.tertiaryPalette,
2822
+ tone: (t) => {
2823
+ let n = Object.assign({}, t, { isDark: !1, contrastLevel: 0 });
2824
+ return this.tertiaryContainer().getTone(n);
2825
+ },
2826
+ isBackground: !0,
2827
+ background: (t) => t.platform === "phone" ? this.highestSurface(t) : void 0,
2828
+ contrastCurve: (t) => t.platform === "phone" && t.contrastLevel > 0 ? b(1.5) : void 0
2829
+ });
2830
+ return T(super.tertiaryFixed(), "2025", e);
2831
+ }
2832
+ tertiaryFixedDim() {
2833
+ const e = c.fromPalette({
2834
+ name: "tertiary_fixed_dim",
2835
+ palette: (t) => t.tertiaryPalette,
2836
+ tone: (t) => this.tertiaryFixed().getTone(t),
2837
+ isBackground: !0,
2838
+ toneDeltaPair: (t) => new w(this.tertiaryFixedDim(), this.tertiaryFixed(), 5, "darker", !0, "exact")
2839
+ });
2840
+ return T(super.tertiaryFixedDim(), "2025", e);
2841
+ }
2842
+ onTertiaryFixed() {
2843
+ const e = c.fromPalette({
2844
+ name: "on_tertiary_fixed",
2845
+ palette: (t) => t.tertiaryPalette,
2846
+ background: (t) => this.tertiaryFixedDim(),
2847
+ contrastCurve: (t) => b(7)
2848
+ });
2849
+ return T(super.onTertiaryFixed(), "2025", e);
2850
+ }
2851
+ onTertiaryFixedVariant() {
2852
+ const e = c.fromPalette({
2853
+ name: "on_tertiary_fixed_variant",
2854
+ palette: (t) => t.tertiaryPalette,
2855
+ background: (t) => this.tertiaryFixedDim(),
2856
+ contrastCurve: (t) => b(4.5)
2857
+ });
2858
+ return T(super.onTertiaryFixedVariant(), "2025", e);
2859
+ }
2860
+ ////////////////////////////////////////////////////////////////
2861
+ // Errors [E] //
2862
+ ////////////////////////////////////////////////////////////////
2863
+ error() {
2864
+ const e = c.fromPalette({
2865
+ name: "error",
2866
+ palette: (t) => t.errorPalette,
2867
+ tone: (t) => t.platform === "phone" ? t.isDark ? ne(t.errorPalette, 0, 98) : D(t.errorPalette) : ne(t.errorPalette),
2868
+ isBackground: !0,
2869
+ background: (t) => t.platform === "phone" ? this.highestSurface(t) : this.surfaceContainerHigh(),
2870
+ contrastCurve: (t) => t.platform === "phone" ? b(4.5) : b(7),
2871
+ toneDeltaPair: (t) => t.platform === "phone" ? new w(this.errorContainer(), this.error(), 5, "relative_lighter", !0, "farther") : void 0
2872
+ });
2873
+ return T(super.error(), "2025", e);
2874
+ }
2875
+ errorDim() {
2876
+ return c.fromPalette({
2877
+ name: "error_dim",
2878
+ palette: (e) => e.errorPalette,
2879
+ tone: (e) => ne(e.errorPalette),
2880
+ isBackground: !0,
2881
+ background: (e) => this.surfaceContainerHigh(),
2882
+ contrastCurve: (e) => b(4.5),
2883
+ toneDeltaPair: (e) => new w(this.errorDim(), this.error(), 5, "darker", !0, "farther")
2884
+ });
2885
+ }
2886
+ onError() {
2887
+ const e = c.fromPalette({
2888
+ name: "on_error",
2889
+ palette: (t) => t.errorPalette,
2890
+ background: (t) => t.platform === "phone" ? this.error() : this.errorDim(),
2891
+ contrastCurve: (t) => t.platform === "phone" ? b(6) : b(7)
2892
+ });
2893
+ return T(super.onError(), "2025", e);
2894
+ }
2895
+ errorContainer() {
2896
+ const e = c.fromPalette({
2897
+ name: "error_container",
2898
+ palette: (t) => t.errorPalette,
2899
+ tone: (t) => t.platform === "watch" ? 30 : t.isDark ? ne(t.errorPalette, 30, 93) : D(t.errorPalette, 0, 90),
2900
+ isBackground: !0,
2901
+ background: (t) => t.platform === "phone" ? this.highestSurface(t) : void 0,
2902
+ toneDeltaPair: (t) => t.platform === "watch" ? new w(this.errorContainer(), this.errorDim(), 10, "darker", !0, "farther") : void 0,
2903
+ contrastCurve: (t) => t.platform === "phone" && t.contrastLevel > 0 ? b(1.5) : void 0
2904
+ });
2905
+ return T(super.errorContainer(), "2025", e);
2906
+ }
2907
+ onErrorContainer() {
2908
+ const e = c.fromPalette({
2909
+ name: "on_error_container",
2910
+ palette: (t) => t.errorPalette,
2911
+ background: (t) => this.errorContainer(),
2912
+ contrastCurve: (t) => t.platform === "phone" ? b(4.5) : b(7)
2913
+ });
2914
+ return T(super.onErrorContainer(), "2025", e);
2915
+ }
2916
+ /////////////////////////////////////////////////////////////////
2917
+ // Remapped Colors //
2918
+ /////////////////////////////////////////////////////////////////
2919
+ surfaceVariant() {
2920
+ const e = Object.assign(this.surfaceContainerHighest().clone(), { name: "surface_variant" });
2921
+ return T(super.surfaceVariant(), "2025", e);
2922
+ }
2923
+ surfaceTint() {
2924
+ const e = Object.assign(this.primary().clone(), { name: "surface_tint" });
2925
+ return T(super.surfaceTint(), "2025", e);
2926
+ }
2927
+ background() {
2928
+ const e = Object.assign(this.surface().clone(), { name: "background" });
2929
+ return T(super.background(), "2025", e);
2930
+ }
2931
+ onBackground() {
2932
+ const e = Object.assign(this.onSurface().clone(), {
2933
+ name: "on_background",
2934
+ tone: (t) => t.platform === "watch" ? 100 : this.onSurface().getTone(t)
2935
+ });
2936
+ return T(super.onBackground(), "2025", e);
2937
+ }
2938
+ }
2939
+ /**
2940
+ * @license
2941
+ * Copyright 2022 Google LLC
2942
+ *
2943
+ * Licensed under the Apache License, Version 2.0 (the "License");
2944
+ * you may not use this file except in compliance with the License.
2945
+ * You may obtain a copy of the License at
2946
+ *
2947
+ * http://www.apache.org/licenses/LICENSE-2.0
2948
+ *
2949
+ * Unless required by applicable law or agreed to in writing, software
2950
+ * distributed under the License is distributed on an "AS IS" BASIS,
2951
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2952
+ * See the License for the specific language governing permissions and
2953
+ * limitations under the License.
2954
+ */
2955
+ class s {
2956
+ constructor() {
2957
+ this.allColors = [
2958
+ this.background(),
2959
+ this.onBackground(),
2960
+ this.surface(),
2961
+ this.surfaceDim(),
2962
+ this.surfaceBright(),
2963
+ this.surfaceContainerLowest(),
2964
+ this.surfaceContainerLow(),
2965
+ this.surfaceContainer(),
2966
+ this.surfaceContainerHigh(),
2967
+ this.surfaceContainerHighest(),
2968
+ this.onSurface(),
2969
+ this.onSurfaceVariant(),
2970
+ this.outline(),
2971
+ this.outlineVariant(),
2972
+ this.inverseSurface(),
2973
+ this.inverseOnSurface(),
2974
+ this.primary(),
2975
+ this.primaryDim(),
2976
+ this.onPrimary(),
2977
+ this.primaryContainer(),
2978
+ this.onPrimaryContainer(),
2979
+ this.primaryFixed(),
2980
+ this.primaryFixedDim(),
2981
+ this.onPrimaryFixed(),
2982
+ this.onPrimaryFixedVariant(),
2983
+ this.inversePrimary(),
2984
+ this.secondary(),
2985
+ this.secondaryDim(),
2986
+ this.onSecondary(),
2987
+ this.secondaryContainer(),
2988
+ this.onSecondaryContainer(),
2989
+ this.secondaryFixed(),
2990
+ this.secondaryFixedDim(),
2991
+ this.onSecondaryFixed(),
2992
+ this.onSecondaryFixedVariant(),
2993
+ this.tertiary(),
2994
+ this.tertiaryDim(),
2995
+ this.onTertiary(),
2996
+ this.tertiaryContainer(),
2997
+ this.onTertiaryContainer(),
2998
+ this.tertiaryFixed(),
2999
+ this.tertiaryFixedDim(),
3000
+ this.onTertiaryFixed(),
3001
+ this.onTertiaryFixedVariant(),
3002
+ this.error(),
3003
+ this.errorDim(),
3004
+ this.onError(),
3005
+ this.errorContainer(),
3006
+ this.onErrorContainer()
3007
+ ].filter((e) => e !== void 0);
3008
+ }
3009
+ highestSurface(e) {
3010
+ return s.colorSpec.highestSurface(e);
3011
+ }
3012
+ ////////////////////////////////////////////////////////////////
3013
+ // Main Palettes //
3014
+ ////////////////////////////////////////////////////////////////
3015
+ primaryPaletteKeyColor() {
3016
+ return s.colorSpec.primaryPaletteKeyColor();
3017
+ }
3018
+ secondaryPaletteKeyColor() {
3019
+ return s.colorSpec.secondaryPaletteKeyColor();
3020
+ }
3021
+ tertiaryPaletteKeyColor() {
3022
+ return s.colorSpec.tertiaryPaletteKeyColor();
3023
+ }
3024
+ neutralPaletteKeyColor() {
3025
+ return s.colorSpec.neutralPaletteKeyColor();
3026
+ }
3027
+ neutralVariantPaletteKeyColor() {
3028
+ return s.colorSpec.neutralVariantPaletteKeyColor();
3029
+ }
3030
+ errorPaletteKeyColor() {
3031
+ return s.colorSpec.errorPaletteKeyColor();
3032
+ }
3033
+ ////////////////////////////////////////////////////////////////
3034
+ // Surfaces [S] //
3035
+ ////////////////////////////////////////////////////////////////
3036
+ background() {
3037
+ return s.colorSpec.background();
3038
+ }
3039
+ onBackground() {
3040
+ return s.colorSpec.onBackground();
3041
+ }
3042
+ surface() {
3043
+ return s.colorSpec.surface();
3044
+ }
3045
+ surfaceDim() {
3046
+ return s.colorSpec.surfaceDim();
3047
+ }
3048
+ surfaceBright() {
3049
+ return s.colorSpec.surfaceBright();
3050
+ }
3051
+ surfaceContainerLowest() {
3052
+ return s.colorSpec.surfaceContainerLowest();
3053
+ }
3054
+ surfaceContainerLow() {
3055
+ return s.colorSpec.surfaceContainerLow();
3056
+ }
3057
+ surfaceContainer() {
3058
+ return s.colorSpec.surfaceContainer();
3059
+ }
3060
+ surfaceContainerHigh() {
3061
+ return s.colorSpec.surfaceContainerHigh();
3062
+ }
3063
+ surfaceContainerHighest() {
3064
+ return s.colorSpec.surfaceContainerHighest();
3065
+ }
3066
+ onSurface() {
3067
+ return s.colorSpec.onSurface();
3068
+ }
3069
+ surfaceVariant() {
3070
+ return s.colorSpec.surfaceVariant();
3071
+ }
3072
+ onSurfaceVariant() {
3073
+ return s.colorSpec.onSurfaceVariant();
3074
+ }
3075
+ outline() {
3076
+ return s.colorSpec.outline();
3077
+ }
3078
+ outlineVariant() {
3079
+ return s.colorSpec.outlineVariant();
3080
+ }
3081
+ inverseSurface() {
3082
+ return s.colorSpec.inverseSurface();
3083
+ }
3084
+ inverseOnSurface() {
3085
+ return s.colorSpec.inverseOnSurface();
3086
+ }
3087
+ shadow() {
3088
+ return s.colorSpec.shadow();
3089
+ }
3090
+ scrim() {
3091
+ return s.colorSpec.scrim();
3092
+ }
3093
+ surfaceTint() {
3094
+ return s.colorSpec.surfaceTint();
3095
+ }
3096
+ ////////////////////////////////////////////////////////////////
3097
+ // Primaries [P] //
3098
+ ////////////////////////////////////////////////////////////////
3099
+ primary() {
3100
+ return s.colorSpec.primary();
3101
+ }
3102
+ primaryDim() {
3103
+ return s.colorSpec.primaryDim();
3104
+ }
3105
+ onPrimary() {
3106
+ return s.colorSpec.onPrimary();
3107
+ }
3108
+ primaryContainer() {
3109
+ return s.colorSpec.primaryContainer();
3110
+ }
3111
+ onPrimaryContainer() {
3112
+ return s.colorSpec.onPrimaryContainer();
3113
+ }
3114
+ inversePrimary() {
3115
+ return s.colorSpec.inversePrimary();
3116
+ }
3117
+ /////////////////////////////////////////////////////////////////
3118
+ // Primary Fixed [PF] //
3119
+ /////////////////////////////////////////////////////////////////
3120
+ primaryFixed() {
3121
+ return s.colorSpec.primaryFixed();
3122
+ }
3123
+ primaryFixedDim() {
3124
+ return s.colorSpec.primaryFixedDim();
3125
+ }
3126
+ onPrimaryFixed() {
3127
+ return s.colorSpec.onPrimaryFixed();
3128
+ }
3129
+ onPrimaryFixedVariant() {
3130
+ return s.colorSpec.onPrimaryFixedVariant();
3131
+ }
3132
+ ////////////////////////////////////////////////////////////////
3133
+ // Secondaries [Q] //
3134
+ ////////////////////////////////////////////////////////////////
3135
+ secondary() {
3136
+ return s.colorSpec.secondary();
3137
+ }
3138
+ secondaryDim() {
3139
+ return s.colorSpec.secondaryDim();
3140
+ }
3141
+ onSecondary() {
3142
+ return s.colorSpec.onSecondary();
3143
+ }
3144
+ secondaryContainer() {
3145
+ return s.colorSpec.secondaryContainer();
3146
+ }
3147
+ onSecondaryContainer() {
3148
+ return s.colorSpec.onSecondaryContainer();
3149
+ }
3150
+ /////////////////////////////////////////////////////////////////
3151
+ // Secondary Fixed [QF] //
3152
+ /////////////////////////////////////////////////////////////////
3153
+ secondaryFixed() {
3154
+ return s.colorSpec.secondaryFixed();
3155
+ }
3156
+ secondaryFixedDim() {
3157
+ return s.colorSpec.secondaryFixedDim();
3158
+ }
3159
+ onSecondaryFixed() {
3160
+ return s.colorSpec.onSecondaryFixed();
3161
+ }
3162
+ onSecondaryFixedVariant() {
3163
+ return s.colorSpec.onSecondaryFixedVariant();
3164
+ }
3165
+ ////////////////////////////////////////////////////////////////
3166
+ // Tertiaries [T] //
3167
+ ////////////////////////////////////////////////////////////////
3168
+ tertiary() {
3169
+ return s.colorSpec.tertiary();
3170
+ }
3171
+ tertiaryDim() {
3172
+ return s.colorSpec.tertiaryDim();
3173
+ }
3174
+ onTertiary() {
3175
+ return s.colorSpec.onTertiary();
3176
+ }
3177
+ tertiaryContainer() {
3178
+ return s.colorSpec.tertiaryContainer();
3179
+ }
3180
+ onTertiaryContainer() {
3181
+ return s.colorSpec.onTertiaryContainer();
3182
+ }
3183
+ /////////////////////////////////////////////////////////////////
3184
+ // Tertiary Fixed [TF] //
3185
+ /////////////////////////////////////////////////////////////////
3186
+ tertiaryFixed() {
3187
+ return s.colorSpec.tertiaryFixed();
3188
+ }
3189
+ tertiaryFixedDim() {
3190
+ return s.colorSpec.tertiaryFixedDim();
3191
+ }
3192
+ onTertiaryFixed() {
3193
+ return s.colorSpec.onTertiaryFixed();
3194
+ }
3195
+ onTertiaryFixedVariant() {
3196
+ return s.colorSpec.onTertiaryFixedVariant();
3197
+ }
3198
+ ////////////////////////////////////////////////////////////////
3199
+ // Errors [E] //
3200
+ ////////////////////////////////////////////////////////////////
3201
+ error() {
3202
+ return s.colorSpec.error();
3203
+ }
3204
+ errorDim() {
3205
+ return s.colorSpec.errorDim();
3206
+ }
3207
+ onError() {
3208
+ return s.colorSpec.onError();
3209
+ }
3210
+ errorContainer() {
3211
+ return s.colorSpec.errorContainer();
3212
+ }
3213
+ onErrorContainer() {
3214
+ return s.colorSpec.onErrorContainer();
3215
+ }
3216
+ // Static variables are deprecated. Use the instance methods to get correct
3217
+ // specs based on request.
3218
+ /** @deprecated Use highestSurface() instead. */
3219
+ static highestSurface(e) {
3220
+ return s.colorSpec.highestSurface(e);
3221
+ }
3222
+ }
3223
+ s.contentAccentToneDelta = 15;
3224
+ s.colorSpec = new Ht();
3225
+ s.primaryPaletteKeyColor = s.colorSpec.primaryPaletteKeyColor();
3226
+ s.secondaryPaletteKeyColor = s.colorSpec.secondaryPaletteKeyColor();
3227
+ s.tertiaryPaletteKeyColor = s.colorSpec.tertiaryPaletteKeyColor();
3228
+ s.neutralPaletteKeyColor = s.colorSpec.neutralPaletteKeyColor();
3229
+ s.neutralVariantPaletteKeyColor = s.colorSpec.neutralVariantPaletteKeyColor();
3230
+ s.background = s.colorSpec.background();
3231
+ s.onBackground = s.colorSpec.onBackground();
3232
+ s.surface = s.colorSpec.surface();
3233
+ s.surfaceDim = s.colorSpec.surfaceDim();
3234
+ s.surfaceBright = s.colorSpec.surfaceBright();
3235
+ s.surfaceContainerLowest = s.colorSpec.surfaceContainerLowest();
3236
+ s.surfaceContainerLow = s.colorSpec.surfaceContainerLow();
3237
+ s.surfaceContainer = s.colorSpec.surfaceContainer();
3238
+ s.surfaceContainerHigh = s.colorSpec.surfaceContainerHigh();
3239
+ s.surfaceContainerHighest = s.colorSpec.surfaceContainerHighest();
3240
+ s.onSurface = s.colorSpec.onSurface();
3241
+ s.surfaceVariant = s.colorSpec.surfaceVariant();
3242
+ s.onSurfaceVariant = s.colorSpec.onSurfaceVariant();
3243
+ s.inverseSurface = s.colorSpec.inverseSurface();
3244
+ s.inverseOnSurface = s.colorSpec.inverseOnSurface();
3245
+ s.outline = s.colorSpec.outline();
3246
+ s.outlineVariant = s.colorSpec.outlineVariant();
3247
+ s.shadow = s.colorSpec.shadow();
3248
+ s.scrim = s.colorSpec.scrim();
3249
+ s.surfaceTint = s.colorSpec.surfaceTint();
3250
+ s.primary = s.colorSpec.primary();
3251
+ s.onPrimary = s.colorSpec.onPrimary();
3252
+ s.primaryContainer = s.colorSpec.primaryContainer();
3253
+ s.onPrimaryContainer = s.colorSpec.onPrimaryContainer();
3254
+ s.inversePrimary = s.colorSpec.inversePrimary();
3255
+ s.secondary = s.colorSpec.secondary();
3256
+ s.onSecondary = s.colorSpec.onSecondary();
3257
+ s.secondaryContainer = s.colorSpec.secondaryContainer();
3258
+ s.onSecondaryContainer = s.colorSpec.onSecondaryContainer();
3259
+ s.tertiary = s.colorSpec.tertiary();
3260
+ s.onTertiary = s.colorSpec.onTertiary();
3261
+ s.tertiaryContainer = s.colorSpec.tertiaryContainer();
3262
+ s.onTertiaryContainer = s.colorSpec.onTertiaryContainer();
3263
+ s.error = s.colorSpec.error();
3264
+ s.onError = s.colorSpec.onError();
3265
+ s.errorContainer = s.colorSpec.errorContainer();
3266
+ s.onErrorContainer = s.colorSpec.onErrorContainer();
3267
+ s.primaryFixed = s.colorSpec.primaryFixed();
3268
+ s.primaryFixedDim = s.colorSpec.primaryFixedDim();
3269
+ s.onPrimaryFixed = s.colorSpec.onPrimaryFixed();
3270
+ s.onPrimaryFixedVariant = s.colorSpec.onPrimaryFixedVariant();
3271
+ s.secondaryFixed = s.colorSpec.secondaryFixed();
3272
+ s.secondaryFixedDim = s.colorSpec.secondaryFixedDim();
3273
+ s.onSecondaryFixed = s.colorSpec.onSecondaryFixed();
3274
+ s.onSecondaryFixedVariant = s.colorSpec.onSecondaryFixedVariant();
3275
+ s.tertiaryFixed = s.colorSpec.tertiaryFixed();
3276
+ s.tertiaryFixedDim = s.colorSpec.tertiaryFixedDim();
3277
+ s.onTertiaryFixed = s.colorSpec.onTertiaryFixed();
3278
+ s.onTertiaryFixedVariant = s.colorSpec.onTertiaryFixedVariant();
3279
+ /**
3280
+ * @license
3281
+ * Copyright 2021 Google LLC
3282
+ *
3283
+ * Licensed under the Apache License, Version 2.0 (the "License");
3284
+ * you may not use this file except in compliance with the License.
3285
+ * You may obtain a copy of the License at
3286
+ *
3287
+ * http://www.apache.org/licenses/LICENSE-2.0
3288
+ *
3289
+ * Unless required by applicable law or agreed to in writing, software
3290
+ * distributed under the License is distributed on an "AS IS" BASIS,
3291
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3292
+ * See the License for the specific language governing permissions and
3293
+ * limitations under the License.
3294
+ */
3295
+ class $ {
3296
+ /**
3297
+ * @param argb ARGB representation of a color
3298
+ *
3299
+ * @deprecated Use {@link DynamicScheme} for color scheme generation.
3300
+ * Use {@link CorePalettes} for core palettes container class.
3301
+ */
3302
+ static of(e) {
3303
+ return new $(e, !1);
3304
+ }
3305
+ /**
3306
+ * @param argb ARGB representation of a color
3307
+ *
3308
+ * @deprecated Use {@link DynamicScheme} for color scheme generation.
3309
+ * Use {@link CorePalettes} for core palettes container class.
3310
+ */
3311
+ static contentOf(e) {
3312
+ return new $(e, !0);
3313
+ }
3314
+ /**
3315
+ * Create a [CorePalette] from a set of colors
3316
+ *
3317
+ * @deprecated Use {@link DynamicScheme} for color scheme generation.
3318
+ * Use {@link CorePalettes} for core palettes container class.
3319
+ */
3320
+ static fromColors(e) {
3321
+ return $.createPaletteFromColors(!1, e);
3322
+ }
3323
+ /**
3324
+ * Create a content [CorePalette] from a set of colors
3325
+ *
3326
+ * @deprecated Use {@link DynamicScheme} for color scheme generation.
3327
+ * Use {@link CorePalettes} for core palettes container class.
3328
+ */
3329
+ static contentFromColors(e) {
3330
+ return $.createPaletteFromColors(!0, e);
3331
+ }
3332
+ static createPaletteFromColors(e, t) {
3333
+ const n = new $(t.primary, e);
3334
+ if (t.secondary) {
3335
+ const a = new $(t.secondary, e);
3336
+ n.a2 = a.a1;
3337
+ }
3338
+ if (t.tertiary) {
3339
+ const a = new $(t.tertiary, e);
3340
+ n.a3 = a.a1;
3341
+ }
3342
+ if (t.error) {
3343
+ const a = new $(t.error, e);
3344
+ n.error = a.a1;
3345
+ }
3346
+ if (t.neutral) {
3347
+ const a = new $(t.neutral, e);
3348
+ n.n1 = a.n1;
3349
+ }
3350
+ if (t.neutralVariant) {
3351
+ const a = new $(t.neutralVariant, e);
3352
+ n.n2 = a.n2;
3353
+ }
3354
+ return n;
3355
+ }
3356
+ constructor(e, t) {
3357
+ const n = C.fromInt(e), a = n.hue, o = n.chroma;
3358
+ t ? (this.a1 = Y.fromHueAndChroma(a, o), this.a2 = Y.fromHueAndChroma(a, o / 3), this.a3 = Y.fromHueAndChroma(a + 60, o / 2), this.n1 = Y.fromHueAndChroma(a, Math.min(o / 12, 4)), this.n2 = Y.fromHueAndChroma(a, Math.min(o / 6, 8))) : (this.a1 = Y.fromHueAndChroma(a, Math.max(48, o)), this.a2 = Y.fromHueAndChroma(a, 16), this.a3 = Y.fromHueAndChroma(a + 60, 24), this.n1 = Y.fromHueAndChroma(a, 4), this.n2 = Y.fromHueAndChroma(a, 8)), this.error = Y.fromHueAndChroma(25, 84);
3359
+ }
3360
+ }
3361
+ /**
3362
+ * @license
3363
+ * Copyright 2021 Google LLC
3364
+ *
3365
+ * Licensed under the Apache License, Version 2.0 (the "License");
3366
+ * you may not use this file except in compliance with the License.
3367
+ * You may obtain a copy of the License at
3368
+ *
3369
+ * http://www.apache.org/licenses/LICENSE-2.0
3370
+ *
3371
+ * Unless required by applicable law or agreed to in writing, software
3372
+ * distributed under the License is distributed on an "AS IS" BASIS,
3373
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3374
+ * See the License for the specific language governing permissions and
3375
+ * limitations under the License.
3376
+ */
3377
+ class ee {
3378
+ get primary() {
3379
+ return this.props.primary;
3380
+ }
3381
+ get onPrimary() {
3382
+ return this.props.onPrimary;
3383
+ }
3384
+ get primaryContainer() {
3385
+ return this.props.primaryContainer;
3386
+ }
3387
+ get onPrimaryContainer() {
3388
+ return this.props.onPrimaryContainer;
3389
+ }
3390
+ get secondary() {
3391
+ return this.props.secondary;
3392
+ }
3393
+ get onSecondary() {
3394
+ return this.props.onSecondary;
3395
+ }
3396
+ get secondaryContainer() {
3397
+ return this.props.secondaryContainer;
3398
+ }
3399
+ get onSecondaryContainer() {
3400
+ return this.props.onSecondaryContainer;
3401
+ }
3402
+ get tertiary() {
3403
+ return this.props.tertiary;
3404
+ }
3405
+ get onTertiary() {
3406
+ return this.props.onTertiary;
3407
+ }
3408
+ get tertiaryContainer() {
3409
+ return this.props.tertiaryContainer;
3410
+ }
3411
+ get onTertiaryContainer() {
3412
+ return this.props.onTertiaryContainer;
3413
+ }
3414
+ get error() {
3415
+ return this.props.error;
3416
+ }
3417
+ get onError() {
3418
+ return this.props.onError;
3419
+ }
3420
+ get errorContainer() {
3421
+ return this.props.errorContainer;
3422
+ }
3423
+ get onErrorContainer() {
3424
+ return this.props.onErrorContainer;
3425
+ }
3426
+ get background() {
3427
+ return this.props.background;
3428
+ }
3429
+ get onBackground() {
3430
+ return this.props.onBackground;
3431
+ }
3432
+ get surface() {
3433
+ return this.props.surface;
3434
+ }
3435
+ get onSurface() {
3436
+ return this.props.onSurface;
3437
+ }
3438
+ get surfaceVariant() {
3439
+ return this.props.surfaceVariant;
3440
+ }
3441
+ get onSurfaceVariant() {
3442
+ return this.props.onSurfaceVariant;
3443
+ }
3444
+ get outline() {
3445
+ return this.props.outline;
3446
+ }
3447
+ get outlineVariant() {
3448
+ return this.props.outlineVariant;
3449
+ }
3450
+ get shadow() {
3451
+ return this.props.shadow;
3452
+ }
3453
+ get scrim() {
3454
+ return this.props.scrim;
3455
+ }
3456
+ get inverseSurface() {
3457
+ return this.props.inverseSurface;
3458
+ }
3459
+ get inverseOnSurface() {
3460
+ return this.props.inverseOnSurface;
3461
+ }
3462
+ get inversePrimary() {
3463
+ return this.props.inversePrimary;
3464
+ }
3465
+ /**
3466
+ * @param argb ARGB representation of a color.
3467
+ * @return Light Material color scheme, based on the color's hue.
3468
+ */
3469
+ static light(e) {
3470
+ return ee.lightFromCorePalette($.of(e));
3471
+ }
3472
+ /**
3473
+ * @param argb ARGB representation of a color.
3474
+ * @return Dark Material color scheme, based on the color's hue.
3475
+ */
3476
+ static dark(e) {
3477
+ return ee.darkFromCorePalette($.of(e));
3478
+ }
3479
+ /**
3480
+ * @param argb ARGB representation of a color.
3481
+ * @return Light Material content color scheme, based on the color's hue.
3482
+ */
3483
+ static lightContent(e) {
3484
+ return ee.lightFromCorePalette($.contentOf(e));
3485
+ }
3486
+ /**
3487
+ * @param argb ARGB representation of a color.
3488
+ * @return Dark Material content color scheme, based on the color's hue.
3489
+ */
3490
+ static darkContent(e) {
3491
+ return ee.darkFromCorePalette($.contentOf(e));
3492
+ }
3493
+ /**
3494
+ * Light scheme from core palette
3495
+ */
3496
+ static lightFromCorePalette(e) {
3497
+ return new ee({
3498
+ primary: e.a1.tone(40),
3499
+ onPrimary: e.a1.tone(100),
3500
+ primaryContainer: e.a1.tone(90),
3501
+ onPrimaryContainer: e.a1.tone(10),
3502
+ secondary: e.a2.tone(40),
3503
+ onSecondary: e.a2.tone(100),
3504
+ secondaryContainer: e.a2.tone(90),
3505
+ onSecondaryContainer: e.a2.tone(10),
3506
+ tertiary: e.a3.tone(40),
3507
+ onTertiary: e.a3.tone(100),
3508
+ tertiaryContainer: e.a3.tone(90),
3509
+ onTertiaryContainer: e.a3.tone(10),
3510
+ error: e.error.tone(40),
3511
+ onError: e.error.tone(100),
3512
+ errorContainer: e.error.tone(90),
3513
+ onErrorContainer: e.error.tone(10),
3514
+ background: e.n1.tone(99),
3515
+ onBackground: e.n1.tone(10),
3516
+ surface: e.n1.tone(99),
3517
+ onSurface: e.n1.tone(10),
3518
+ surfaceVariant: e.n2.tone(90),
3519
+ onSurfaceVariant: e.n2.tone(30),
3520
+ outline: e.n2.tone(50),
3521
+ outlineVariant: e.n2.tone(80),
3522
+ shadow: e.n1.tone(0),
3523
+ scrim: e.n1.tone(0),
3524
+ inverseSurface: e.n1.tone(20),
3525
+ inverseOnSurface: e.n1.tone(95),
3526
+ inversePrimary: e.a1.tone(80)
3527
+ });
3528
+ }
3529
+ /**
3530
+ * Dark scheme from core palette
3531
+ */
3532
+ static darkFromCorePalette(e) {
3533
+ return new ee({
3534
+ primary: e.a1.tone(80),
3535
+ onPrimary: e.a1.tone(20),
3536
+ primaryContainer: e.a1.tone(30),
3537
+ onPrimaryContainer: e.a1.tone(90),
3538
+ secondary: e.a2.tone(80),
3539
+ onSecondary: e.a2.tone(20),
3540
+ secondaryContainer: e.a2.tone(30),
3541
+ onSecondaryContainer: e.a2.tone(90),
3542
+ tertiary: e.a3.tone(80),
3543
+ onTertiary: e.a3.tone(20),
3544
+ tertiaryContainer: e.a3.tone(30),
3545
+ onTertiaryContainer: e.a3.tone(90),
3546
+ error: e.error.tone(80),
3547
+ onError: e.error.tone(20),
3548
+ errorContainer: e.error.tone(30),
3549
+ onErrorContainer: e.error.tone(80),
3550
+ background: e.n1.tone(10),
3551
+ onBackground: e.n1.tone(90),
3552
+ surface: e.n1.tone(10),
3553
+ onSurface: e.n1.tone(90),
3554
+ surfaceVariant: e.n2.tone(30),
3555
+ onSurfaceVariant: e.n2.tone(80),
3556
+ outline: e.n2.tone(60),
3557
+ outlineVariant: e.n2.tone(30),
3558
+ shadow: e.n1.tone(0),
3559
+ scrim: e.n1.tone(0),
3560
+ inverseSurface: e.n1.tone(90),
3561
+ inverseOnSurface: e.n1.tone(20),
3562
+ inversePrimary: e.a1.tone(40)
3563
+ });
3564
+ }
3565
+ constructor(e) {
3566
+ this.props = e;
3567
+ }
3568
+ toJSON() {
3569
+ return {
3570
+ ...this.props
3571
+ };
3572
+ }
3573
+ }
3574
+ /**
3575
+ * @license
3576
+ * Copyright 2021 Google LLC
3577
+ *
3578
+ * Licensed under the Apache License, Version 2.0 (the "License");
3579
+ * you may not use this file except in compliance with the License.
3580
+ * You may obtain a copy of the License at
3581
+ *
3582
+ * http://www.apache.org/licenses/LICENSE-2.0
3583
+ *
3584
+ * Unless required by applicable law or agreed to in writing, software
3585
+ * distributed under the License is distributed on an "AS IS" BASIS,
3586
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3587
+ * See the License for the specific language governing permissions and
3588
+ * limitations under the License.
3589
+ */
3590
+ function N(r) {
3591
+ const e = at(r), t = ot(r), n = it(r), a = [e.toString(16), t.toString(16), n.toString(16)];
3592
+ for (const [o, i] of a.entries())
3593
+ i.length === 1 && (a[o] = "0" + i);
3594
+ return "#" + a.join("");
3595
+ }
3596
+ function Ce(r) {
3597
+ r = r.replace("#", "");
3598
+ const e = r.length === 3, t = r.length === 6, n = r.length === 8;
3599
+ if (!e && !t && !n)
3600
+ throw new Error("unexpected hex " + r);
3601
+ let a = 0, o = 0, i = 0;
3602
+ return e ? (a = Z(r.slice(0, 1).repeat(2)), o = Z(r.slice(1, 2).repeat(2)), i = Z(r.slice(2, 3).repeat(2))) : t ? (a = Z(r.slice(0, 2)), o = Z(r.slice(2, 4)), i = Z(r.slice(4, 6))) : n && (a = Z(r.slice(2, 4)), o = Z(r.slice(4, 6)), i = Z(r.slice(6, 8))), (255 << 24 | (a & 255) << 16 | (o & 255) << 8 | i & 255) >>> 0;
3603
+ }
3604
+ function Z(r) {
3605
+ return parseInt(r, 16);
3606
+ }
3607
+ /**
3608
+ * @license
3609
+ * Copyright 2021 Google LLC
3610
+ *
3611
+ * Licensed under the Apache License, Version 2.0 (the "License");
3612
+ * you may not use this file except in compliance with the License.
3613
+ * You may obtain a copy of the License at
3614
+ *
3615
+ * http://www.apache.org/licenses/LICENSE-2.0
3616
+ *
3617
+ * Unless required by applicable law or agreed to in writing, software
3618
+ * distributed under the License is distributed on an "AS IS" BASIS,
3619
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3620
+ * See the License for the specific language governing permissions and
3621
+ * limitations under the License.
3622
+ */
3623
+ function oe(r, e = []) {
3624
+ const t = $.of(r);
3625
+ return {
3626
+ source: r,
3627
+ schemes: {
3628
+ light: ee.light(r),
3629
+ dark: ee.dark(r)
3630
+ },
3631
+ palettes: {
3632
+ primary: t.a1,
3633
+ secondary: t.a2,
3634
+ tertiary: t.a3,
3635
+ neutral: t.n1,
3636
+ neutralVariant: t.n2,
3637
+ error: t.error
3638
+ },
3639
+ customColors: e.map((n) => zt(r, n))
3640
+ };
3641
+ }
3642
+ function zt(r, e) {
3643
+ let t = e.value;
3644
+ const n = t, a = r;
3645
+ e.blend && (t = Ve.harmonize(n, a));
3646
+ const i = $.of(t).a1;
3647
+ return {
3648
+ color: e,
3649
+ value: t,
3650
+ light: {
3651
+ color: i.tone(40),
3652
+ onColor: i.tone(100),
3653
+ colorContainer: i.tone(90),
3654
+ onColorContainer: i.tone(10)
3655
+ },
3656
+ dark: {
3657
+ color: i.tone(80),
3658
+ onColor: i.tone(20),
3659
+ colorContainer: i.tone(30),
3660
+ onColorContainer: i.tone(90)
3661
+ }
3662
+ };
3663
+ }
3664
+ function Fe(r, e) {
3665
+ const t = C.fromInt(Ce(r)), n = C.from(t.hue, t.chroma, e);
3666
+ return N(n.toInt());
3667
+ }
3668
+ function Ut(r) {
3669
+ const e = C.fromInt(Ce(r)), t = (e.hue + 110) % 360, n = Math.min(e.chroma * 1.2, 100), a = e.tone < 50 ? 65 : Math.min(e.tone + 10, 75);
3670
+ return N(C.from(t, n, a).toInt());
3671
+ }
3672
+ function $t(r) {
3673
+ const e = Ut(r);
3674
+ return {
3675
+ 0: Fe(e, 95),
3676
+ 25: e,
3677
+ 50: r,
3678
+ 75: Fe(r, 80),
3679
+ 100: Fe(r, 20)
3680
+ };
3681
+ }
3682
+ function he(r, e) {
3683
+ const t = $t(r);
3684
+ let n = `linear-gradient(${e}deg, `;
3685
+ for (const a of Object.keys(t))
3686
+ n += `${t[a]} ${a}%, `;
3687
+ return n.slice(0, -2) + ")";
3688
+ }
3689
+ function Yt(r, e = 135) {
3690
+ const t = {};
3691
+ return Xe(t, "source", r, e), Object.entries(Ee).forEach(([n, a]) => {
3692
+ Xe(t, n, a, e);
3693
+ }), t;
3694
+ }
3695
+ function Xe(r, e, t, n) {
3696
+ const o = oe(Ce(t)).palettes.primary;
3697
+ for (let i = 10; i <= 100; i += 10) {
3698
+ const u = N(o.tone(i));
3699
+ r[`${e}${i}`] = he(u, n);
3700
+ }
3701
+ }
3702
+ function X(r) {
3703
+ const e = parseInt(r.slice(1, 3), 16), t = parseInt(r.slice(3, 5), 16), n = parseInt(r.slice(5, 7), 16);
3704
+ return `${e}, ${t}, ${n}`;
3705
+ }
3706
+ function jt(r) {
3707
+ const e = {};
3708
+ return Ge(e, "source", r), Object.entries(Ee).forEach(([t]) => {
3709
+ Ge(e, t, Ee[t]);
3710
+ }), e;
3711
+ }
3712
+ function Ge(r, e, t) {
3713
+ const a = oe(Ce(t)).palettes.primary;
3714
+ for (let o = 10; o <= 100; o += 10) {
3715
+ const i = N(a.tone(o)), u = o >= 60 ? 10 : 100, l = N(a.tone(u)), h = X(i), f = X(l);
3716
+ r[`${e}${o}`] = h, r[`on${Kt(e)}${o}`] = f;
3717
+ }
3718
+ }
3719
+ function Kt(r) {
3720
+ return r.charAt(0).toUpperCase() + r.slice(1);
3721
+ }
3722
+ var qt = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, Q = function(r) {
3723
+ return typeof r == "string" ? r.length > 0 : typeof r == "number";
3724
+ }, _ = function(r, e, t) {
3725
+ return e === void 0 && (e = 0), t === void 0 && (t = Math.pow(10, e)), Math.round(t * r) / t + 0;
3726
+ }, K = function(r, e, t) {
3727
+ return e === void 0 && (e = 0), t === void 0 && (t = 1), r > t ? t : r > e ? r : e;
3728
+ }, ut = function(r) {
3729
+ return (r = isFinite(r) ? r % 360 : 0) > 0 ? r : r + 360;
3730
+ }, Je = function(r) {
3731
+ return { r: K(r.r, 0, 255), g: K(r.g, 0, 255), b: K(r.b, 0, 255), a: K(r.a) };
3732
+ }, xe = function(r) {
3733
+ return { r: _(r.r), g: _(r.g), b: _(r.b), a: _(r.a, 3) };
3734
+ }, Xt = /^#([0-9a-f]{3,8})$/i, ke = function(r) {
3735
+ var e = r.toString(16);
3736
+ return e.length < 2 ? "0" + e : e;
3737
+ }, lt = function(r) {
3738
+ var e = r.r, t = r.g, n = r.b, a = r.a, o = Math.max(e, t, n), i = o - Math.min(e, t, n), u = i ? o === e ? (t - n) / i : o === t ? 2 + (n - e) / i : 4 + (e - t) / i : 0;
3739
+ return { h: 60 * (u < 0 ? u + 6 : u), s: o ? i / o * 100 : 0, v: o / 255 * 100, a };
3740
+ }, ht = function(r) {
3741
+ var e = r.h, t = r.s, n = r.v, a = r.a;
3742
+ e = e / 360 * 6, t /= 100, n /= 100;
3743
+ var o = Math.floor(e), i = n * (1 - t), u = n * (1 - (e - o) * t), l = n * (1 - (1 - e + o) * t), h = o % 6;
3744
+ return { r: 255 * [n, u, i, i, l, n][h], g: 255 * [l, n, n, u, i, i][h], b: 255 * [i, i, l, n, n, u][h], a };
3745
+ }, We = function(r) {
3746
+ return { h: ut(r.h), s: K(r.s, 0, 100), l: K(r.l, 0, 100), a: K(r.a) };
3747
+ }, Ze = function(r) {
3748
+ return { h: _(r.h), s: _(r.s), l: _(r.l), a: _(r.a, 3) };
3749
+ }, Qe = function(r) {
3750
+ return ht((t = (e = r).s, { h: e.h, s: (t *= ((n = e.l) < 50 ? n : 100 - n) / 100) > 0 ? 2 * t / (n + t) * 100 : 0, v: n + t, a: e.a }));
3751
+ var e, t, n;
3752
+ }, de = function(r) {
3753
+ return { h: (e = lt(r)).h, s: (a = (200 - (t = e.s)) * (n = e.v) / 100) > 0 && a < 200 ? t * n / 100 / (a <= 100 ? a : 200 - a) * 100 : 0, l: a / 2, a: e.a };
3754
+ var e, t, n, a;
3755
+ }, Gt = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, Jt = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, Wt = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, Zt = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, et = { string: [[function(r) {
3756
+ var e = Xt.exec(r);
3757
+ return e ? (r = e[1]).length <= 4 ? { r: parseInt(r[0] + r[0], 16), g: parseInt(r[1] + r[1], 16), b: parseInt(r[2] + r[2], 16), a: r.length === 4 ? _(parseInt(r[3] + r[3], 16) / 255, 2) : 1 } : r.length === 6 || r.length === 8 ? { r: parseInt(r.substr(0, 2), 16), g: parseInt(r.substr(2, 2), 16), b: parseInt(r.substr(4, 2), 16), a: r.length === 8 ? _(parseInt(r.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
3758
+ }, "hex"], [function(r) {
3759
+ var e = Wt.exec(r) || Zt.exec(r);
3760
+ return e ? e[2] !== e[4] || e[4] !== e[6] ? null : Je({ r: Number(e[1]) / (e[2] ? 100 / 255 : 1), g: Number(e[3]) / (e[4] ? 100 / 255 : 1), b: Number(e[5]) / (e[6] ? 100 / 255 : 1), a: e[7] === void 0 ? 1 : Number(e[7]) / (e[8] ? 100 : 1) }) : null;
3761
+ }, "rgb"], [function(r) {
3762
+ var e = Gt.exec(r) || Jt.exec(r);
3763
+ if (!e) return null;
3764
+ var t, n, a = We({ h: (t = e[1], n = e[2], n === void 0 && (n = "deg"), Number(t) * (qt[n] || 1)), s: Number(e[3]), l: Number(e[4]), a: e[5] === void 0 ? 1 : Number(e[5]) / (e[6] ? 100 : 1) });
3765
+ return Qe(a);
3766
+ }, "hsl"]], object: [[function(r) {
3767
+ var e = r.r, t = r.g, n = r.b, a = r.a, o = a === void 0 ? 1 : a;
3768
+ return Q(e) && Q(t) && Q(n) ? Je({ r: Number(e), g: Number(t), b: Number(n), a: Number(o) }) : null;
3769
+ }, "rgb"], [function(r) {
3770
+ var e = r.h, t = r.s, n = r.l, a = r.a, o = a === void 0 ? 1 : a;
3771
+ if (!Q(e) || !Q(t) || !Q(n)) return null;
3772
+ var i = We({ h: Number(e), s: Number(t), l: Number(n), a: Number(o) });
3773
+ return Qe(i);
3774
+ }, "hsl"], [function(r) {
3775
+ var e = r.h, t = r.s, n = r.v, a = r.a, o = a === void 0 ? 1 : a;
3776
+ if (!Q(e) || !Q(t) || !Q(n)) return null;
3777
+ var i = function(u) {
3778
+ return { h: ut(u.h), s: K(u.s, 0, 100), v: K(u.v, 0, 100), a: K(u.a) };
3779
+ }({ h: Number(e), s: Number(t), v: Number(n), a: Number(o) });
3780
+ return ht(i);
3781
+ }, "hsv"]] }, tt = function(r, e) {
3782
+ for (var t = 0; t < e.length; t++) {
3783
+ var n = e[t][0](r);
3784
+ if (n) return [n, e[t][1]];
3785
+ }
3786
+ return [null, void 0];
3787
+ }, Qt = function(r) {
3788
+ return typeof r == "string" ? tt(r.trim(), et.string) : typeof r == "object" && r !== null ? tt(r, et.object) : [null, void 0];
3789
+ }, Me = function(r, e) {
3790
+ var t = de(r);
3791
+ return { h: t.h, s: K(t.s + 100 * e, 0, 100), l: t.l, a: t.a };
3792
+ }, Be = function(r) {
3793
+ return (299 * r.r + 587 * r.g + 114 * r.b) / 1e3 / 255;
3794
+ }, rt = function(r, e) {
3795
+ var t = de(r);
3796
+ return { h: t.h, s: t.s, l: K(t.l + 100 * e, 0, 100), a: t.a };
3797
+ }, nt = function() {
3798
+ function r(e) {
3799
+ this.parsed = Qt(e)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
3800
+ }
3801
+ return r.prototype.isValid = function() {
3802
+ return this.parsed !== null;
3803
+ }, r.prototype.brightness = function() {
3804
+ return _(Be(this.rgba), 2);
3805
+ }, r.prototype.isDark = function() {
3806
+ return Be(this.rgba) < 0.5;
3807
+ }, r.prototype.isLight = function() {
3808
+ return Be(this.rgba) >= 0.5;
3809
+ }, r.prototype.toHex = function() {
3810
+ return e = xe(this.rgba), t = e.r, n = e.g, a = e.b, i = (o = e.a) < 1 ? ke(_(255 * o)) : "", "#" + ke(t) + ke(n) + ke(a) + i;
3811
+ var e, t, n, a, o, i;
3812
+ }, r.prototype.toRgb = function() {
3813
+ return xe(this.rgba);
3814
+ }, r.prototype.toRgbString = function() {
3815
+ return e = xe(this.rgba), t = e.r, n = e.g, a = e.b, (o = e.a) < 1 ? "rgba(" + t + ", " + n + ", " + a + ", " + o + ")" : "rgb(" + t + ", " + n + ", " + a + ")";
3816
+ var e, t, n, a, o;
3817
+ }, r.prototype.toHsl = function() {
3818
+ return Ze(de(this.rgba));
3819
+ }, r.prototype.toHslString = function() {
3820
+ return e = Ze(de(this.rgba)), t = e.h, n = e.s, a = e.l, (o = e.a) < 1 ? "hsla(" + t + ", " + n + "%, " + a + "%, " + o + ")" : "hsl(" + t + ", " + n + "%, " + a + "%)";
3821
+ var e, t, n, a, o;
3822
+ }, r.prototype.toHsv = function() {
3823
+ return e = lt(this.rgba), { h: _(e.h), s: _(e.s), v: _(e.v), a: _(e.a, 3) };
3824
+ var e;
3825
+ }, r.prototype.invert = function() {
3826
+ return G({ r: 255 - (e = this.rgba).r, g: 255 - e.g, b: 255 - e.b, a: e.a });
3827
+ var e;
3828
+ }, r.prototype.saturate = function(e) {
3829
+ return e === void 0 && (e = 0.1), G(Me(this.rgba, e));
3830
+ }, r.prototype.desaturate = function(e) {
3831
+ return e === void 0 && (e = 0.1), G(Me(this.rgba, -e));
3832
+ }, r.prototype.grayscale = function() {
3833
+ return G(Me(this.rgba, -1));
3834
+ }, r.prototype.lighten = function(e) {
3835
+ return e === void 0 && (e = 0.1), G(rt(this.rgba, e));
3836
+ }, r.prototype.darken = function(e) {
3837
+ return e === void 0 && (e = 0.1), G(rt(this.rgba, -e));
3838
+ }, r.prototype.rotate = function(e) {
3839
+ return e === void 0 && (e = 15), this.hue(this.hue() + e);
3840
+ }, r.prototype.alpha = function(e) {
3841
+ return typeof e == "number" ? G({ r: (t = this.rgba).r, g: t.g, b: t.b, a: e }) : _(this.rgba.a, 3);
3842
+ var t;
3843
+ }, r.prototype.hue = function(e) {
3844
+ var t = de(this.rgba);
3845
+ return typeof e == "number" ? G({ h: e, s: t.s, l: t.l, a: t.a }) : _(t.h);
3846
+ }, r.prototype.isEqual = function(e) {
3847
+ return this.toHex() === G(e).toHex();
3848
+ }, r;
3849
+ }(), G = function(r) {
3850
+ return r instanceof nt ? r : new nt(r);
3851
+ };
3852
+ function se(r, e) {
3853
+ if (typeof r == "number")
3854
+ return r > 16777215 ? r : 4278190080 | r;
3855
+ const t = r.trim();
3856
+ if (t === "currentColor")
3857
+ return null;
3858
+ if (t.startsWith("var("))
3859
+ return t.slice(4, -1).trim(), null;
3860
+ const n = G(t);
3861
+ if (n.isValid()) {
3862
+ const { r: a, g: o, b: i } = n.toRgb();
3863
+ return Se(a, o, i);
3864
+ }
3865
+ return null;
3866
+ }
3867
+ const pe = "#4e51ff", ft = "g-theme--material", Ae = "g-theme--", _e = Symbol("gradient-theme");
3868
+ function er(r) {
3869
+ const e = se("#FFC107"), t = se("#4CAF50");
3870
+ if (e == null || t == null)
3871
+ throw new Error("Failed to normalize semantic seed color.");
3872
+ const n = r === "dark" ? "dark" : "light", a = oe(e).schemes[n].toJSON(), o = oe(t).schemes[n].toJSON();
3873
+ return {
3874
+ warning: X(N(a.primary)),
3875
+ onWarning: X(N(a.onPrimary)),
3876
+ warningContainer: X(
3877
+ N(a.primaryContainer)
3878
+ ),
3879
+ onWarningContainer: X(
3880
+ N(a.onPrimaryContainer)
3881
+ ),
3882
+ success: X(N(o.primary)),
3883
+ onSuccess: X(N(o.onPrimary)),
3884
+ successContainer: X(
3885
+ N(o.primaryContainer)
3886
+ ),
3887
+ onSuccessContainer: X(
3888
+ N(o.onPrimaryContainer)
3889
+ )
3890
+ };
3891
+ }
3892
+ function tr(r, e) {
3893
+ const t = He(r), n = se(t);
3894
+ if (n == null)
3895
+ throw new Error("Failed to normalize seed color.");
3896
+ const a = oe(n), o = e === "dark" ? "dark" : "light", i = a.schemes[o].toJSON(), u = {};
3897
+ return Object.entries(i).forEach(([l, h]) => {
3898
+ const f = N(h), g = X(f);
3899
+ u[l] = g;
3900
+ }), {
3901
+ ...u,
3902
+ ...er(e)
3903
+ };
3904
+ }
3905
+ function rr(r) {
3906
+ const e = He(r), t = se(e), n = se("#FFC107"), a = se("#4CAF50");
3907
+ if (t == null || n == null || a == null)
3908
+ throw new Error("Failed to normalize gradient seed color.");
3909
+ const o = oe(t), i = oe(n), u = oe(a), l = o.schemes.light.toJSON(), h = i.schemes.light.toJSON(), f = u.schemes.light.toJSON(), g = N(l.error), p = N(h.primary), v = N(f.primary);
3910
+ return {
3911
+ ...Yt(e, 135),
3912
+ main: he(e, 135),
3913
+ error: he(g, 135),
3914
+ warning: he(p, 135),
3915
+ success: he(v, 135)
3916
+ };
3917
+ }
3918
+ function He(r) {
3919
+ const e = se(r);
3920
+ return e == null ? pe : N(e);
3921
+ }
3922
+ function Ie(r, e) {
3923
+ let t = `.${ft} {
3924
+ `;
3925
+ for (const [a, o] of Object.entries(r))
3926
+ t += ` --g-${e}-${yt(a)}: ${o};
3927
+ `;
3928
+ t += "}";
3929
+ let n = document.getElementById(
3930
+ `g-${e}-style`
3931
+ );
3932
+ return n || (n = document.createElement("style"), n.id = `g-${e}-style`, document.head.appendChild(n)), n.textContent = t, n;
3933
+ }
3934
+ function ir(r = pe) {
3935
+ return ze(r, "light");
3936
+ }
3937
+ function sr(r = pe) {
3938
+ return ze(r, "dark");
3939
+ }
3940
+ function ze(r = pe, e = "light") {
3941
+ const t = document.documentElement;
3942
+ t.classList.add(ft), t.classList.remove(
3943
+ `${Ae}light`,
3944
+ `${Ae}dark`
3945
+ ), t.classList.add(`${Ae}${e}`);
3946
+ const n = He(r), a = {
3947
+ theme: tr(n, e),
3948
+ colors: jt(n),
3949
+ gradient: rr(n)
3950
+ };
3951
+ return {
3952
+ tokens: a,
3953
+ themeCSS: Ie(a.theme, "theme"),
3954
+ colorsCSS: Ie(a.colors, "color"),
3955
+ gradientCSS: Ie(a.gradient, "gradient")
3956
+ };
3957
+ }
3958
+ function nr(r = {}) {
3959
+ const e = je(r.seed ?? pe), t = je(r.mode ?? "light"), n = Pt(
3960
+ null
3961
+ ), a = () => typeof window > "u" ? null : (n.value = ze(e.value, t.value), n.value), o = (l) => (e.value = l, a()), i = (l) => (t.value = l, a()), u = () => (t.value = t.value === "dark" ? "light" : "dark", a());
3962
+ return r.autoApply !== !1 && a(), {
3963
+ seed: e,
3964
+ mode: t,
3965
+ result: n,
3966
+ apply: a,
3967
+ setSeed: o,
3968
+ setMode: i,
3969
+ toggleMode: u
3970
+ };
3971
+ }
3972
+ function cr(r = nr()) {
3973
+ return kt(_e, r), r;
3974
+ }
3975
+ function ur(r, e) {
3976
+ r.provide(_e, e);
3977
+ }
3978
+ function lr() {
3979
+ return bt(_e, null);
3980
+ }
3981
+ export {
3982
+ pe as D,
3983
+ ir as a,
3984
+ ze as b,
3985
+ sr as c,
3986
+ nr as d,
3987
+ ur as i,
3988
+ cr as p,
3989
+ lr as u
3990
+ };