@luzmo/lucero 1.0.1-alpha.17 → 1.0.1-alpha.19

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 (277) hide show
  1. package/components/NumberFormatter-DewVDY5w.cjs +18 -0
  2. package/components/NumberFormatter-DgOUVrge.js +136 -0
  3. package/components/NumberParser-Dik4a0h-.cjs +18 -0
  4. package/components/NumberParser-ci9J5EKv.js +173 -0
  5. package/components/accordion/index.cjs +6 -183
  6. package/components/accordion/index.js +88 -136
  7. package/components/action-bar/index.cjs +4 -85
  8. package/components/action-bar/index.js +50 -72
  9. package/components/action-button/index.cjs +3 -205
  10. package/components/action-button/index.js +93 -167
  11. package/components/action-group/index.cjs +1 -7
  12. package/components/action-group/index.js +8 -12
  13. package/components/action-group-C54IxNZk.cjs +20 -0
  14. package/components/action-group-C9dsPJg-.js +258 -0
  15. package/components/action-menu/index.cjs +11 -91
  16. package/components/action-menu/index.js +47 -66
  17. package/components/async-directive-BwIAw5tB.js +82 -0
  18. package/components/async-directive-DLz6JB0v.cjs +22 -0
  19. package/components/avatar/index.cjs +3 -63
  20. package/components/avatar/index.js +42 -54
  21. package/components/{focusable-selectors-D0t_5P7C.cjs → base-BjTwmyRF.cjs} +5 -16
  22. package/components/base-CFWO09N1.js +684 -0
  23. package/components/base-Cy0MQrPT.cjs +40 -0
  24. package/components/base-D76d76ww.js +26 -0
  25. package/components/button/index.cjs +2 -134
  26. package/components/button/index.js +72 -106
  27. package/components/button-base-B8bWcklV.js +144 -0
  28. package/components/button-base-tf95Lyl4.cjs +25 -0
  29. package/components/button-group/index.cjs +1 -45
  30. package/components/button-group/index.js +25 -37
  31. package/components/calendar/index.cjs +1 -632
  32. package/components/calendar/index.js +7 -637
  33. package/components/checkbox/index.cjs +4 -111
  34. package/components/checkbox/index.js +53 -98
  35. package/components/checkbox-mixin-BOTvuPEu.js +70 -0
  36. package/components/checkbox-mixin-BVPpXtsq.cjs +27 -0
  37. package/components/class-map-CGfNk3Ee.js +51 -0
  38. package/components/class-map-D-Y-hsN5.cjs +22 -0
  39. package/components/clear-button-CuPbWwZY.cjs +18 -0
  40. package/components/clear-button-DzZ5ulBW.js +53 -0
  41. package/components/close-button-BTo4yrFR.cjs +18 -0
  42. package/components/close-button-CuQdsez5.js +51 -0
  43. package/components/color-area/index.cjs +13 -440
  44. package/components/color-area/index.js +187 -322
  45. package/components/color-controller-B0uX6Zso.js +3230 -0
  46. package/components/color-controller-CoUL5f9K.cjs +18 -0
  47. package/components/color-field/index.cjs +2 -95
  48. package/components/color-field/index.js +41 -77
  49. package/components/color-handle/index.cjs +3 -64
  50. package/components/color-handle/index.js +37 -58
  51. package/components/color-loupe/index.cjs +1 -7
  52. package/components/color-loupe/index.js +8 -12
  53. package/components/color-loupe-CrM2DVY3.cjs +56 -0
  54. package/components/color-loupe-DmQe3SpP.js +81 -0
  55. package/components/color-menu/index.cjs +12 -217
  56. package/components/color-menu/index.js +93 -187
  57. package/components/color-palette/index.cjs +1 -89
  58. package/components/color-palette/index.js +51 -78
  59. package/components/color-palette-group/index.cjs +3 -259
  60. package/components/color-palette-group/index.js +105 -193
  61. package/components/color-picker/index.cjs +6 -114
  62. package/components/color-picker/index.js +72 -92
  63. package/components/color-slider/index.cjs +1 -585
  64. package/components/color-slider/index.js +7 -590
  65. package/components/condition-attribute-with-id-DrQYZzFS.cjs +18 -0
  66. package/components/condition-attribute-with-id-Dv4lSRbe.js +31 -0
  67. package/components/date-time-picker/index.cjs +31 -1357
  68. package/components/date-time-picker/index.js +637 -951
  69. package/components/{dependency-manger-XHpQjFgK.js → dependency-manger-CO-VPlqq.js} +14 -24
  70. package/components/dependency-manger-uthev62E.cjs +18 -0
  71. package/components/directive-C7oCP5Bh.cjs +22 -0
  72. package/components/directive-helpers-D4KMv2dC.js +62 -0
  73. package/components/directive-helpers-t-TVum7J.cjs +22 -0
  74. package/components/{slottable-request-event-CANixJnR.cjs → directive-oAbCiebi.js} +25 -14
  75. package/components/divider/index.cjs +1 -54
  76. package/components/divider/index.js +30 -49
  77. package/components/divider.module-DDvBo9zo.cjs +18 -0
  78. package/components/divider.module-DoQWQEIJ.js +21 -0
  79. package/components/element-resolution-BvRLGqIU.cjs +18 -0
  80. package/components/element-resolution-FCUT-wql.js +91 -0
  81. package/components/field-group/index.cjs +1 -7
  82. package/components/field-group/index.js +8 -12
  83. package/components/field-group-5WQMBOk4.cjs +23 -0
  84. package/components/field-group-D4B0IOdA.js +66 -0
  85. package/components/field-label/index.cjs +1 -7
  86. package/components/field-label/index.js +8 -12
  87. package/components/field-label-DxmPiC5p.js +106 -0
  88. package/components/field-label-Dz9kisdW.cjs +25 -0
  89. package/components/flow-D-0MTYCm.js +527 -0
  90. package/components/flow-DM3dNAKs.cjs +30 -0
  91. package/components/focus-group-DHeTq18L.js +218 -0
  92. package/components/focus-group-DnxZUBhQ.cjs +18 -0
  93. package/components/focus-visible-BvScGDCE.js +74 -0
  94. package/components/focus-visible-D4BXb5RB.cjs +18 -0
  95. package/components/focusable-B_KwfEec.cjs +18 -0
  96. package/components/focusable-C5JjRZmT.js +153 -0
  97. package/components/{focusable-selectors-IltOAOd9.js → focusable-selectors-B4YgbghQ.js} +4 -7
  98. package/components/focusable-selectors-BgFlyFcY.cjs +18 -0
  99. package/components/icon/index.cjs +1 -90
  100. package/components/icon/index.js +46 -74
  101. package/components/if-defined-DULpqYwi.js +27 -0
  102. package/components/if-defined-DaXWqfzc.cjs +22 -0
  103. package/components/index-CNK8wHXu.cjs +57 -0
  104. package/components/index-Cf6G4q52.js +1490 -0
  105. package/components/index-D3ICqC7S.js +1174 -0
  106. package/components/index-hqVbNKYy.cjs +113 -0
  107. package/components/index.cjs +1 -174
  108. package/components/index.js +172 -174
  109. package/components/infield-button/index.cjs +2 -46
  110. package/components/infield-button/index.js +30 -41
  111. package/components/label/index.cjs +1 -37
  112. package/components/label/index.js +24 -36
  113. package/components/{language-resolution-BSGJAWiQ.js → language-resolution-B-wjV5bb.js} +17 -21
  114. package/components/language-resolution-EUER43cg.cjs +18 -0
  115. package/components/like-anchor-Bu3pXbjT.cjs +32 -0
  116. package/components/like-anchor-DCFJN0LV.js +69 -0
  117. package/components/luzmo-icons-CiSek5iM.js +229 -0
  118. package/components/luzmo-icons-CtA-TJPd.cjs +29 -0
  119. package/components/manage-help-text-CHfMLzSa.js +92 -0
  120. package/components/manage-help-text-DNqdEkTA.cjs +30 -0
  121. package/components/menu/index.cjs +29 -1297
  122. package/components/menu/index.js +499 -954
  123. package/components/multi-language-field/index.cjs +2 -132
  124. package/components/multi-language-field/index.js +88 -118
  125. package/components/mutation-controller-DH7YOCyj.js +52 -0
  126. package/components/mutation-controller-DkOMCW-c.cjs +22 -0
  127. package/components/number-field/index.cjs +10 -613
  128. package/components/number-field/index.js +243 -442
  129. package/components/observe-slot-presence-CmVi0zTc.js +68 -0
  130. package/components/observe-slot-presence-bc9chhsi.cjs +18 -0
  131. package/components/observe-slot-text-C3moTjwy.js +87 -0
  132. package/components/observe-slot-text-D2VAEFSd.cjs +18 -0
  133. package/components/options/index.cjs +60 -693
  134. package/components/options/index.js +953 -519
  135. package/components/overlay/index.cjs +21 -367
  136. package/components/overlay/index.js +189 -273
  137. package/components/overlay-B3ajDLLq.cjs +47 -0
  138. package/components/overlay-CUKs69yr.js +2745 -0
  139. package/components/{pending-state-CXbe-Xul.js → pending-state-B2wWssTo.js} +13 -28
  140. package/components/pending-state-bJr-nEJl.cjs +26 -0
  141. package/components/picker/index.cjs +1 -9
  142. package/components/picker/index.js +11 -15
  143. package/components/picker-C0LvseZe.cjs +123 -0
  144. package/components/picker-W1qNmtsh.js +461 -0
  145. package/components/picker-button/index.cjs +4 -56
  146. package/components/picker-button/index.js +34 -45
  147. package/components/{condition-attribute-with-id-Cn815e9W.js → platform-BM-uMWpX.js} +49 -24
  148. package/components/platform-BiXhwqk3.cjs +18 -0
  149. package/components/popover/index.cjs +1 -7
  150. package/components/popover/index.js +8 -12
  151. package/components/popover-fwJeZHMQ.cjs +30 -0
  152. package/components/popover-iD8f5Jkp.js +67 -0
  153. package/components/progress-circle/index.cjs +1 -7
  154. package/components/progress-circle/index.js +8 -12
  155. package/components/progress-circle-DZxaMe8L.cjs +33 -0
  156. package/components/progress-circle-USIIU1up.js +97 -0
  157. package/components/query-BL-TJj7K.cjs +22 -0
  158. package/components/query-D_KR_GUc.js +51 -0
  159. package/components/query-assigned-elements-DjfhL1cl.js +36 -0
  160. package/components/query-assigned-elements-DsKsfk7G.cjs +22 -0
  161. package/components/query-assigned-nodes-BcKWmGzy.cjs +22 -0
  162. package/components/query-assigned-nodes-C76XVPWY.js +36 -0
  163. package/components/radio/index.cjs +2 -244
  164. package/components/radio/index.js +110 -192
  165. package/components/{random-id-BEc6QIUL.js → random-id-ByCz1xaq.js} +3 -3
  166. package/components/random-id-CqvckpWe.cjs +18 -0
  167. package/components/roving-tabindex-By_fCy_e.cjs +18 -0
  168. package/components/roving-tabindex-DOg4z6ZU.js +66 -0
  169. package/components/search/index.cjs +8 -115
  170. package/components/search/index.js +66 -96
  171. package/components/select/index.cjs +51 -720
  172. package/components/select/index.js +347 -563
  173. package/components/sized-mixin-CJbBHWRQ.js +63 -0
  174. package/components/sized-mixin-WPHH0a_D.cjs +18 -0
  175. package/components/slider/index.cjs +1 -119
  176. package/components/slider/index.js +1113 -100
  177. package/components/slottable-request-event-BfUUt1Mh.cjs +18 -0
  178. package/components/{slottable-request-event-D9WzrdWv.js → slottable-request-event-DggLA4Rx.js} +9 -12
  179. package/components/state-DwIwYPvt.js +29 -0
  180. package/components/state-vf0PJN3_.cjs +22 -0
  181. package/components/strategies-C6HsQpU2.cjs +18 -0
  182. package/components/strategies-CUMLHtQI.js +195 -0
  183. package/components/streaming-listener-BQ68fKMa.js +91 -0
  184. package/components/streaming-listener-DeGQYM-9.cjs +18 -0
  185. package/components/style-map-Bnhf_mVZ.js +53 -0
  186. package/components/style-map-DuMd5xlY.cjs +22 -0
  187. package/components/swatch/index.cjs +7 -436
  188. package/components/swatch/index.js +205 -350
  189. package/components/switch/index.cjs +2 -61
  190. package/components/switch/index.js +34 -51
  191. package/components/tabs/index.cjs +26 -693
  192. package/components/tabs/index.js +388 -521
  193. package/components/tags/index.cjs +4 -201
  194. package/components/tags/index.js +87 -152
  195. package/components/text-field/index.cjs +3 -49
  196. package/components/text-field/index.js +30 -44
  197. package/components/text-field-BkFPYo7S.cjs +85 -0
  198. package/components/text-field-C2n3rzCK.js +314 -0
  199. package/components/text-field.module-C2KVUJcX.js +21 -0
  200. package/components/text-field.module-DXhFA9G-.cjs +18 -0
  201. package/components/toast/index.cjs +12 -177
  202. package/components/toast/index.js +73 -145
  203. package/components/tooltip/index.cjs +6 -221
  204. package/components/tooltip/index.js +131 -155
  205. package/components/tooltip/tooltip.d.ts +12 -1
  206. package/components/unit-input/index.cjs +8 -232
  207. package/components/unit-input/index.js +108 -201
  208. package/components/utils.cjs +1 -25
  209. package/components/utils.js +22 -22
  210. package/components/{random-id-BE6HA503.cjs → when-CDK1Tt5Y.js} +10 -7
  211. package/components/when-CDZyJPvd.cjs +22 -0
  212. package/custom-elements.json +1 -1
  213. package/package.json +1 -1
  214. package/components/action-group-DHp8RHDf.js +0 -392
  215. package/components/action-group-MPf19RPV.cjs +0 -391
  216. package/components/base-COw9n7UR.cjs +0 -119
  217. package/components/base-DmeVy0cq.js +0 -120
  218. package/components/button-base-7Ak55xFd.cjs +0 -206
  219. package/components/button-base-C3kf6BTK.js +0 -207
  220. package/components/checkbox-mixin-8cL-vfDy.js +0 -84
  221. package/components/checkbox-mixin-CE7dJj3J.cjs +0 -83
  222. package/components/clear-button-Co6oKSgl.js +0 -59
  223. package/components/clear-button-X_HDY2eH.cjs +0 -58
  224. package/components/close-button-DPBK6Kpu.cjs +0 -59
  225. package/components/close-button-Miw9ZjoJ.js +0 -60
  226. package/components/color-controller-BjDZaxhX.js +0 -491
  227. package/components/color-controller-C3c_vb2P.cjs +0 -490
  228. package/components/color-loupe-BQqNR8YD.cjs +0 -88
  229. package/components/color-loupe-B_DDFv8l.js +0 -89
  230. package/components/condition-attribute-with-id-DEc2Yjne.cjs +0 -43
  231. package/components/dependency-manger-CcIE1uvQ.cjs +0 -63
  232. package/components/divider.module-Cm5LcDRV.cjs +0 -20
  233. package/components/divider.module-DauH6k2_.js +0 -21
  234. package/components/element-resolution-DCsrhGZO.cjs +0 -112
  235. package/components/element-resolution-nMlmW4Jy.js +0 -113
  236. package/components/field-group-DNmY8W9v.cjs +0 -86
  237. package/components/field-group-DVdAWCQF.js +0 -87
  238. package/components/field-label-CKH9EXpR.cjs +0 -156
  239. package/components/field-label-Dpsecoc6.js +0 -157
  240. package/components/focus-group-BqDAk9Is.js +0 -337
  241. package/components/focus-group-DFzOlalL.cjs +0 -336
  242. package/components/focus-visible-B-B8-P9R.cjs +0 -104
  243. package/components/focus-visible-BUPRWlsh.js +0 -105
  244. package/components/focusable-BPrTcZPd.cjs +0 -262
  245. package/components/focusable-ChCLg1k4.js +0 -263
  246. package/components/language-resolution-iN9EImbb.cjs +0 -57
  247. package/components/like-anchor-D62faRNG.cjs +0 -79
  248. package/components/like-anchor-v3cJ9RWM.js +0 -80
  249. package/components/manage-help-text-BYx84zZR.cjs +0 -125
  250. package/components/manage-help-text-DOuMTGht.js +0 -126
  251. package/components/observe-slot-presence-9AwLGUQ_.cjs +0 -78
  252. package/components/observe-slot-presence-DcMdoumP.js +0 -79
  253. package/components/observe-slot-text-CSofZeeF.cjs +0 -104
  254. package/components/observe-slot-text-CjnkkBPn.js +0 -105
  255. package/components/overlay-CN8ISP1F.js +0 -2485
  256. package/components/overlay-LViy9VWM.cjs +0 -2484
  257. package/components/pending-state-e4RbXe9u.cjs +0 -75
  258. package/components/picker-DNde3awt.cjs +0 -672
  259. package/components/picker-PfUAF05y.js +0 -673
  260. package/components/platform-CxDar3Dn.cjs +0 -68
  261. package/components/platform-Cxn0WbyT.js +0 -69
  262. package/components/popover-BkbYhl3i.js +0 -74
  263. package/components/popover-BkgUf0kL.cjs +0 -74
  264. package/components/progress-circle-Hu_ivPHf.js +0 -133
  265. package/components/progress-circle-_Etqsj9f.cjs +0 -132
  266. package/components/roving-tabindex-AsmAh2In.cjs +0 -95
  267. package/components/roving-tabindex-DPF9NmrH.js +0 -96
  268. package/components/sized-mixin-DmkrNdWB.js +0 -80
  269. package/components/sized-mixin-UaTVa-AE.cjs +0 -79
  270. package/components/strategies-DlMlaSJR.cjs +0 -317
  271. package/components/strategies-DlPQoTFE.js +0 -318
  272. package/components/streaming-listener-D4sHaMub.cjs +0 -145
  273. package/components/streaming-listener-cAz5zJyk.js +0 -146
  274. package/components/text-field-11tcnftU.cjs +0 -338
  275. package/components/text-field-Chi9J2Cz.js +0 -339
  276. package/components/text-field.module-CMBS0jSL.js +0 -21
  277. package/components/text-field.module-DIJdV_sA.cjs +0 -20
@@ -0,0 +1,1174 @@
1
+ /*! * Lucero - The design system for Luzmo.
2
+ *
3
+ * Copyright © 2025 Luzmo
4
+ * All rights reserved.
5
+ * Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
6
+ * This license allows users with a current active Luzmo account to use Lucero.
7
+ * This license terminates automatically if a user no longer has an active Luzmo account.
8
+ * Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
9
+ *
10
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
+ * SOFTWARE.
17
+ * */
18
+ import { r as W, x as j, n as v } from "./base-CFWO09N1.js";
19
+ import { e as T } from "./query-D_KR_GUc.js";
20
+ import { o as C } from "./if-defined-DULpqYwi.js";
21
+ import { o as q } from "./style-map-Bnhf_mVZ.js";
22
+ import "./color-handle/index.js";
23
+ import { F as U } from "./focusable-C5JjRZmT.js";
24
+ import { L as V } from "./language-resolution-B-wjV5bb.js";
25
+ import { s as G } from "./streaming-listener-BQ68fKMa.js";
26
+ function c(r, t) {
27
+ K(r) && (r = "100%");
28
+ const e = X(r);
29
+ return r = t === 360 ? r : Math.min(t, Math.max(0, parseFloat(r))), e && (r = parseInt(String(r * t), 10) / 100), Math.abs(r - t) < 1e-6 ? 1 : (t === 360 ? r = (r < 0 ? r % t + t : r % t) / parseFloat(String(t)) : r = r % t / parseFloat(String(t)), r);
30
+ }
31
+ function w(r) {
32
+ return Math.min(1, Math.max(0, r));
33
+ }
34
+ function K(r) {
35
+ return typeof r == "string" && r.indexOf(".") !== -1 && parseFloat(r) === 1;
36
+ }
37
+ function X(r) {
38
+ return typeof r == "string" && r.indexOf("%") !== -1;
39
+ }
40
+ function L(r) {
41
+ return r = parseFloat(r), (isNaN(r) || r < 0 || r > 1) && (r = 1), r;
42
+ }
43
+ function S(r) {
44
+ return Number(r) <= 1 ? `${Number(r) * 100}%` : r;
45
+ }
46
+ function k(r) {
47
+ return r.length === 1 ? "0" + r : String(r);
48
+ }
49
+ function Y(r, t, e) {
50
+ return {
51
+ r: c(r, 255) * 255,
52
+ g: c(t, 255) * 255,
53
+ b: c(e, 255) * 255
54
+ };
55
+ }
56
+ function A(r, t, e) {
57
+ r = c(r, 255), t = c(t, 255), e = c(e, 255);
58
+ const s = Math.max(r, t, e), o = Math.min(r, t, e);
59
+ let i = 0, n = 0;
60
+ const a = (s + o) / 2;
61
+ if (s === o)
62
+ n = 0, i = 0;
63
+ else {
64
+ const l = s - o;
65
+ switch (n = a > 0.5 ? l / (2 - s - o) : l / (s + o), s) {
66
+ case r:
67
+ i = (t - e) / l + (t < e ? 6 : 0);
68
+ break;
69
+ case t:
70
+ i = (e - r) / l + 2;
71
+ break;
72
+ case e:
73
+ i = (r - t) / l + 4;
74
+ break;
75
+ }
76
+ i /= 6;
77
+ }
78
+ return { h: i, s: n, l: a };
79
+ }
80
+ function R(r, t, e) {
81
+ return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? r + (t - r) * (6 * e) : e < 1 / 2 ? t : e < 2 / 3 ? r + (t - r) * (2 / 3 - e) * 6 : r;
82
+ }
83
+ function Z(r, t, e) {
84
+ let s, o, i;
85
+ if (r = c(r, 360), t = c(t, 100), e = c(e, 100), t === 0)
86
+ o = e, i = e, s = e;
87
+ else {
88
+ const n = e < 0.5 ? e * (1 + t) : e + t - e * t, a = 2 * e - n;
89
+ s = R(a, n, r + 1 / 3), o = R(a, n, r), i = R(a, n, r - 1 / 3);
90
+ }
91
+ return { r: s * 255, g: o * 255, b: i * 255 };
92
+ }
93
+ function F(r, t, e) {
94
+ r = c(r, 255), t = c(t, 255), e = c(e, 255);
95
+ const s = Math.max(r, t, e), o = Math.min(r, t, e);
96
+ let i = 0;
97
+ const n = s, a = s - o, l = s === 0 ? 0 : a / s;
98
+ if (s === o)
99
+ i = 0;
100
+ else {
101
+ switch (s) {
102
+ case r:
103
+ i = (t - e) / a + (t < e ? 6 : 0);
104
+ break;
105
+ case t:
106
+ i = (e - r) / a + 2;
107
+ break;
108
+ case e:
109
+ i = (r - t) / a + 4;
110
+ break;
111
+ }
112
+ i /= 6;
113
+ }
114
+ return { h: i, s: l, v: n };
115
+ }
116
+ function J(r, t, e) {
117
+ r = c(r, 360) * 6, t = c(t, 100), e = c(e, 100);
118
+ const s = Math.floor(r), o = r - s, i = e * (1 - t), n = e * (1 - o * t), a = e * (1 - (1 - o) * t), l = s % 6, m = [e, n, i, i, a, e][l], u = [a, e, e, n, i, i][l], y = [i, i, a, e, e, n][l];
119
+ return { r: m * 255, g: u * 255, b: y * 255 };
120
+ }
121
+ function E(r, t, e, s) {
122
+ const o = [
123
+ k(Math.round(r).toString(16)),
124
+ k(Math.round(t).toString(16)),
125
+ k(Math.round(e).toString(16))
126
+ ];
127
+ return s && o[0].startsWith(o[0].charAt(1)) && o[1].startsWith(o[1].charAt(1)) && o[2].startsWith(o[2].charAt(1)) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) : o.join("");
128
+ }
129
+ function Q(r, t, e, s, o) {
130
+ const i = [
131
+ k(Math.round(r).toString(16)),
132
+ k(Math.round(t).toString(16)),
133
+ k(Math.round(e).toString(16)),
134
+ k(et(s))
135
+ ];
136
+ return o && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) && i[3].startsWith(i[3].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) + i[3].charAt(0) : i.join("");
137
+ }
138
+ function tt(r, t, e, s) {
139
+ const o = r / 100, i = t / 100, n = e / 100, a = s / 100, l = 255 * (1 - o) * (1 - a), m = 255 * (1 - i) * (1 - a), u = 255 * (1 - n) * (1 - a);
140
+ return { r: l, g: m, b: u };
141
+ }
142
+ function _(r, t, e) {
143
+ let s = 1 - r / 255, o = 1 - t / 255, i = 1 - e / 255, n = Math.min(s, o, i);
144
+ return n === 1 ? (s = 0, o = 0, i = 0) : (s = (s - n) / (1 - n) * 100, o = (o - n) / (1 - n) * 100, i = (i - n) / (1 - n) * 100), n *= 100, {
145
+ c: Math.round(s),
146
+ m: Math.round(o),
147
+ y: Math.round(i),
148
+ k: Math.round(n)
149
+ };
150
+ }
151
+ function et(r) {
152
+ return Math.round(parseFloat(r) * 255).toString(16);
153
+ }
154
+ function I(r) {
155
+ return g(r) / 255;
156
+ }
157
+ function g(r) {
158
+ return parseInt(r, 16);
159
+ }
160
+ function rt(r) {
161
+ return {
162
+ r: r >> 16,
163
+ g: (r & 65280) >> 8,
164
+ b: r & 255
165
+ };
166
+ }
167
+ const P = {
168
+ aliceblue: "#f0f8ff",
169
+ antiquewhite: "#faebd7",
170
+ aqua: "#00ffff",
171
+ aquamarine: "#7fffd4",
172
+ azure: "#f0ffff",
173
+ beige: "#f5f5dc",
174
+ bisque: "#ffe4c4",
175
+ black: "#000000",
176
+ blanchedalmond: "#ffebcd",
177
+ blue: "#0000ff",
178
+ blueviolet: "#8a2be2",
179
+ brown: "#a52a2a",
180
+ burlywood: "#deb887",
181
+ cadetblue: "#5f9ea0",
182
+ chartreuse: "#7fff00",
183
+ chocolate: "#d2691e",
184
+ coral: "#ff7f50",
185
+ cornflowerblue: "#6495ed",
186
+ cornsilk: "#fff8dc",
187
+ crimson: "#dc143c",
188
+ cyan: "#00ffff",
189
+ darkblue: "#00008b",
190
+ darkcyan: "#008b8b",
191
+ darkgoldenrod: "#b8860b",
192
+ darkgray: "#a9a9a9",
193
+ darkgreen: "#006400",
194
+ darkgrey: "#a9a9a9",
195
+ darkkhaki: "#bdb76b",
196
+ darkmagenta: "#8b008b",
197
+ darkolivegreen: "#556b2f",
198
+ darkorange: "#ff8c00",
199
+ darkorchid: "#9932cc",
200
+ darkred: "#8b0000",
201
+ darksalmon: "#e9967a",
202
+ darkseagreen: "#8fbc8f",
203
+ darkslateblue: "#483d8b",
204
+ darkslategray: "#2f4f4f",
205
+ darkslategrey: "#2f4f4f",
206
+ darkturquoise: "#00ced1",
207
+ darkviolet: "#9400d3",
208
+ deeppink: "#ff1493",
209
+ deepskyblue: "#00bfff",
210
+ dimgray: "#696969",
211
+ dimgrey: "#696969",
212
+ dodgerblue: "#1e90ff",
213
+ firebrick: "#b22222",
214
+ floralwhite: "#fffaf0",
215
+ forestgreen: "#228b22",
216
+ fuchsia: "#ff00ff",
217
+ gainsboro: "#dcdcdc",
218
+ ghostwhite: "#f8f8ff",
219
+ goldenrod: "#daa520",
220
+ gold: "#ffd700",
221
+ gray: "#808080",
222
+ green: "#008000",
223
+ greenyellow: "#adff2f",
224
+ grey: "#808080",
225
+ honeydew: "#f0fff0",
226
+ hotpink: "#ff69b4",
227
+ indianred: "#cd5c5c",
228
+ indigo: "#4b0082",
229
+ ivory: "#fffff0",
230
+ khaki: "#f0e68c",
231
+ lavenderblush: "#fff0f5",
232
+ lavender: "#e6e6fa",
233
+ lawngreen: "#7cfc00",
234
+ lemonchiffon: "#fffacd",
235
+ lightblue: "#add8e6",
236
+ lightcoral: "#f08080",
237
+ lightcyan: "#e0ffff",
238
+ lightgoldenrodyellow: "#fafad2",
239
+ lightgray: "#d3d3d3",
240
+ lightgreen: "#90ee90",
241
+ lightgrey: "#d3d3d3",
242
+ lightpink: "#ffb6c1",
243
+ lightsalmon: "#ffa07a",
244
+ lightseagreen: "#20b2aa",
245
+ lightskyblue: "#87cefa",
246
+ lightslategray: "#778899",
247
+ lightslategrey: "#778899",
248
+ lightsteelblue: "#b0c4de",
249
+ lightyellow: "#ffffe0",
250
+ lime: "#00ff00",
251
+ limegreen: "#32cd32",
252
+ linen: "#faf0e6",
253
+ magenta: "#ff00ff",
254
+ maroon: "#800000",
255
+ mediumaquamarine: "#66cdaa",
256
+ mediumblue: "#0000cd",
257
+ mediumorchid: "#ba55d3",
258
+ mediumpurple: "#9370db",
259
+ mediumseagreen: "#3cb371",
260
+ mediumslateblue: "#7b68ee",
261
+ mediumspringgreen: "#00fa9a",
262
+ mediumturquoise: "#48d1cc",
263
+ mediumvioletred: "#c71585",
264
+ midnightblue: "#191970",
265
+ mintcream: "#f5fffa",
266
+ mistyrose: "#ffe4e1",
267
+ moccasin: "#ffe4b5",
268
+ navajowhite: "#ffdead",
269
+ navy: "#000080",
270
+ oldlace: "#fdf5e6",
271
+ olive: "#808000",
272
+ olivedrab: "#6b8e23",
273
+ orange: "#ffa500",
274
+ orangered: "#ff4500",
275
+ orchid: "#da70d6",
276
+ palegoldenrod: "#eee8aa",
277
+ palegreen: "#98fb98",
278
+ paleturquoise: "#afeeee",
279
+ palevioletred: "#db7093",
280
+ papayawhip: "#ffefd5",
281
+ peachpuff: "#ffdab9",
282
+ peru: "#cd853f",
283
+ pink: "#ffc0cb",
284
+ plum: "#dda0dd",
285
+ powderblue: "#b0e0e6",
286
+ purple: "#800080",
287
+ rebeccapurple: "#663399",
288
+ red: "#ff0000",
289
+ rosybrown: "#bc8f8f",
290
+ royalblue: "#4169e1",
291
+ saddlebrown: "#8b4513",
292
+ salmon: "#fa8072",
293
+ sandybrown: "#f4a460",
294
+ seagreen: "#2e8b57",
295
+ seashell: "#fff5ee",
296
+ sienna: "#a0522d",
297
+ silver: "#c0c0c0",
298
+ skyblue: "#87ceeb",
299
+ slateblue: "#6a5acd",
300
+ slategray: "#708090",
301
+ slategrey: "#708090",
302
+ snow: "#fffafa",
303
+ springgreen: "#00ff7f",
304
+ steelblue: "#4682b4",
305
+ tan: "#d2b48c",
306
+ teal: "#008080",
307
+ thistle: "#d8bfd8",
308
+ tomato: "#ff6347",
309
+ turquoise: "#40e0d0",
310
+ violet: "#ee82ee",
311
+ wheat: "#f5deb3",
312
+ white: "#ffffff",
313
+ whitesmoke: "#f5f5f5",
314
+ yellow: "#ffff00",
315
+ yellowgreen: "#9acd32"
316
+ };
317
+ function st(r) {
318
+ let t = { r: 0, g: 0, b: 0 }, e = 1, s = null, o = null, i = null, n = !1, a = !1;
319
+ return typeof r == "string" && (r = nt(r)), typeof r == "object" && (f(r.r) && f(r.g) && f(r.b) ? (t = Y(r.r, r.g, r.b), n = !0, a = String(r.r).substr(-1) === "%" ? "prgb" : "rgb") : f(r.h) && f(r.s) && f(r.v) ? (s = S(r.s), o = S(r.v), t = J(r.h, s, o), n = !0, a = "hsv") : f(r.h) && f(r.s) && f(r.l) ? (s = S(r.s), i = S(r.l), t = Z(r.h, s, i), n = !0, a = "hsl") : f(r.c) && f(r.m) && f(r.y) && f(r.k) && (t = tt(r.c, r.m, r.y, r.k), n = !0, a = "cmyk"), Object.prototype.hasOwnProperty.call(r, "a") && (e = r.a)), e = L(e), {
320
+ ok: n,
321
+ format: r.format || a,
322
+ r: Math.min(255, Math.max(t.r, 0)),
323
+ g: Math.min(255, Math.max(t.g, 0)),
324
+ b: Math.min(255, Math.max(t.b, 0)),
325
+ a: e
326
+ };
327
+ }
328
+ const it = "[-\\+]?\\d+%?", ot = "[-\\+]?\\d*\\.\\d+%?", x = "(?:" + ot + ")|(?:" + it + ")", z = "[\\s|\\(]+(" + x + ")[,|\\s]+(" + x + ")[,|\\s]+(" + x + ")\\s*\\)?", M = (
329
+ // eslint-disable-next-line prettier/prettier
330
+ "[\\s|\\(]+(" + x + ")[,|\\s]+(" + x + ")[,|\\s]+(" + x + ")[,|\\s]+(" + x + ")\\s*\\)?"
331
+ ), p = {
332
+ CSS_UNIT: new RegExp(x),
333
+ rgb: new RegExp("rgb" + z),
334
+ rgba: new RegExp("rgba" + M),
335
+ hsl: new RegExp("hsl" + z),
336
+ hsla: new RegExp("hsla" + M),
337
+ hsv: new RegExp("hsv" + z),
338
+ hsva: new RegExp("hsva" + M),
339
+ cmyk: new RegExp("cmyk" + M),
340
+ hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
341
+ hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
342
+ hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
343
+ hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
344
+ };
345
+ function nt(r) {
346
+ if (r = r.trim().toLowerCase(), r.length === 0)
347
+ return !1;
348
+ let t = !1;
349
+ if (P[r])
350
+ r = P[r], t = !0;
351
+ else if (r === "transparent")
352
+ return { r: 0, g: 0, b: 0, a: 0, format: "name" };
353
+ let e = p.rgb.exec(r);
354
+ return e ? { r: e[1], g: e[2], b: e[3] } : (e = p.rgba.exec(r), e ? { r: e[1], g: e[2], b: e[3], a: e[4] } : (e = p.hsl.exec(r), e ? { h: e[1], s: e[2], l: e[3] } : (e = p.hsla.exec(r), e ? { h: e[1], s: e[2], l: e[3], a: e[4] } : (e = p.hsv.exec(r), e ? { h: e[1], s: e[2], v: e[3] } : (e = p.hsva.exec(r), e ? { h: e[1], s: e[2], v: e[3], a: e[4] } : (e = p.cmyk.exec(r), e ? {
355
+ c: e[1],
356
+ m: e[2],
357
+ y: e[3],
358
+ k: e[4]
359
+ } : (e = p.hex8.exec(r), e ? {
360
+ r: g(e[1]),
361
+ g: g(e[2]),
362
+ b: g(e[3]),
363
+ a: I(e[4]),
364
+ format: t ? "name" : "hex8"
365
+ } : (e = p.hex6.exec(r), e ? {
366
+ r: g(e[1]),
367
+ g: g(e[2]),
368
+ b: g(e[3]),
369
+ format: t ? "name" : "hex"
370
+ } : (e = p.hex4.exec(r), e ? {
371
+ r: g(e[1] + e[1]),
372
+ g: g(e[2] + e[2]),
373
+ b: g(e[3] + e[3]),
374
+ a: I(e[4] + e[4]),
375
+ format: t ? "name" : "hex8"
376
+ } : (e = p.hex3.exec(r), e ? {
377
+ r: g(e[1] + e[1]),
378
+ g: g(e[2] + e[2]),
379
+ b: g(e[3] + e[3]),
380
+ format: t ? "name" : "hex"
381
+ } : !1))))))))));
382
+ }
383
+ function f(r) {
384
+ return typeof r == "number" ? !Number.isNaN(r) : p.CSS_UNIT.test(r);
385
+ }
386
+ class h {
387
+ constructor(t = "", e = {}) {
388
+ if (t instanceof h)
389
+ return t;
390
+ typeof t == "number" && (t = rt(t)), this.originalInput = t;
391
+ const s = st(t);
392
+ this.originalInput = t, this.r = s.r, this.g = s.g, this.b = s.b, this.a = s.a, this.roundA = Math.round(100 * this.a) / 100, this.format = e.format ?? s.format, this.gradientType = e.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = s.ok;
393
+ }
394
+ isDark() {
395
+ return this.getBrightness() < 128;
396
+ }
397
+ isLight() {
398
+ return !this.isDark();
399
+ }
400
+ /**
401
+ * Returns the perceived brightness of the color, from 0-255.
402
+ */
403
+ getBrightness() {
404
+ const t = this.toRgb();
405
+ return (t.r * 299 + t.g * 587 + t.b * 114) / 1e3;
406
+ }
407
+ /**
408
+ * Returns the perceived luminance of a color, from 0-1.
409
+ */
410
+ getLuminance() {
411
+ const t = this.toRgb();
412
+ let e, s, o;
413
+ const i = t.r / 255, n = t.g / 255, a = t.b / 255;
414
+ return i <= 0.03928 ? e = i / 12.92 : e = Math.pow((i + 0.055) / 1.055, 2.4), n <= 0.03928 ? s = n / 12.92 : s = Math.pow((n + 0.055) / 1.055, 2.4), a <= 0.03928 ? o = a / 12.92 : o = Math.pow((a + 0.055) / 1.055, 2.4), 0.2126 * e + 0.7152 * s + 0.0722 * o;
415
+ }
416
+ /**
417
+ * Returns the alpha value of a color, from 0-1.
418
+ */
419
+ getAlpha() {
420
+ return this.a;
421
+ }
422
+ /**
423
+ * Sets the alpha value on the current color.
424
+ *
425
+ * @param alpha - The new alpha value. The accepted range is 0-1.
426
+ */
427
+ setAlpha(t) {
428
+ return this.a = L(t), this.roundA = Math.round(100 * this.a) / 100, this;
429
+ }
430
+ /**
431
+ * Returns whether the color is monochrome.
432
+ */
433
+ isMonochrome() {
434
+ const { s: t } = this.toHsl();
435
+ return t === 0;
436
+ }
437
+ /**
438
+ * Returns the object as a HSVA object.
439
+ */
440
+ toHsv() {
441
+ const t = F(this.r, this.g, this.b);
442
+ return { h: t.h * 360, s: t.s, v: t.v, a: this.a };
443
+ }
444
+ /**
445
+ * Returns the hsva values interpolated into a string with the following format:
446
+ * "hsva(xxx, xxx, xxx, xx)".
447
+ */
448
+ toHsvString() {
449
+ const t = F(this.r, this.g, this.b), e = Math.round(t.h * 360), s = Math.round(t.s * 100), o = Math.round(t.v * 100);
450
+ return this.a === 1 ? `hsv(${e}, ${s}%, ${o}%)` : `hsva(${e}, ${s}%, ${o}%, ${this.roundA})`;
451
+ }
452
+ /**
453
+ * Returns the object as a HSLA object.
454
+ */
455
+ toHsl() {
456
+ const t = A(this.r, this.g, this.b);
457
+ return { h: t.h * 360, s: t.s, l: t.l, a: this.a };
458
+ }
459
+ /**
460
+ * Returns the hsla values interpolated into a string with the following format:
461
+ * "hsla(xxx, xxx, xxx, xx)".
462
+ */
463
+ toHslString() {
464
+ const t = A(this.r, this.g, this.b), e = Math.round(t.h * 360), s = Math.round(t.s * 100), o = Math.round(t.l * 100);
465
+ return this.a === 1 ? `hsl(${e}, ${s}%, ${o}%)` : `hsla(${e}, ${s}%, ${o}%, ${this.roundA})`;
466
+ }
467
+ /**
468
+ * Returns the hex value of the color.
469
+ * @param allow3Char will shorten hex value to 3 char if possible
470
+ */
471
+ toHex(t = !1) {
472
+ return E(this.r, this.g, this.b, t);
473
+ }
474
+ /**
475
+ * Returns the hex value of the color -with a # prefixed.
476
+ * @param allow3Char will shorten hex value to 3 char if possible
477
+ */
478
+ toHexString(t = !1) {
479
+ return "#" + this.toHex(t);
480
+ }
481
+ /**
482
+ * Returns the hex 8 value of the color.
483
+ * @param allow4Char will shorten hex value to 4 char if possible
484
+ */
485
+ toHex8(t = !1) {
486
+ return Q(this.r, this.g, this.b, this.a, t);
487
+ }
488
+ /**
489
+ * Returns the hex 8 value of the color -with a # prefixed.
490
+ * @param allow4Char will shorten hex value to 4 char if possible
491
+ */
492
+ toHex8String(t = !1) {
493
+ return "#" + this.toHex8(t);
494
+ }
495
+ /**
496
+ * Returns the shorter hex value of the color depends on its alpha -with a # prefixed.
497
+ * @param allowShortChar will shorten hex value to 3 or 4 char if possible
498
+ */
499
+ toHexShortString(t = !1) {
500
+ return this.a === 1 ? this.toHexString(t) : this.toHex8String(t);
501
+ }
502
+ /**
503
+ * Returns the object as a RGBA object.
504
+ */
505
+ toRgb() {
506
+ return {
507
+ r: Math.round(this.r),
508
+ g: Math.round(this.g),
509
+ b: Math.round(this.b),
510
+ a: this.a
511
+ };
512
+ }
513
+ /**
514
+ * Returns the RGBA values interpolated into a string with the following format:
515
+ * "RGBA(xxx, xxx, xxx, xx)".
516
+ */
517
+ toRgbString() {
518
+ const t = Math.round(this.r), e = Math.round(this.g), s = Math.round(this.b);
519
+ return this.a === 1 ? `rgb(${t}, ${e}, ${s})` : `rgba(${t}, ${e}, ${s}, ${this.roundA})`;
520
+ }
521
+ /**
522
+ * Returns the object as a RGBA object.
523
+ */
524
+ toPercentageRgb() {
525
+ const t = (e) => `${Math.round(c(e, 255) * 100)}%`;
526
+ return {
527
+ r: t(this.r),
528
+ g: t(this.g),
529
+ b: t(this.b),
530
+ a: this.a
531
+ };
532
+ }
533
+ /**
534
+ * Returns the RGBA relative values interpolated into a string
535
+ */
536
+ toPercentageRgbString() {
537
+ const t = (e) => Math.round(c(e, 255) * 100);
538
+ return this.a === 1 ? `rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)` : `rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`;
539
+ }
540
+ toCmyk() {
541
+ return {
542
+ ..._(this.r, this.g, this.b)
543
+ };
544
+ }
545
+ toCmykString() {
546
+ const { c: t, m: e, y: s, k: o } = _(this.r, this.g, this.b);
547
+ return `cmyk(${t}, ${e}, ${s}, ${o})`;
548
+ }
549
+ /**
550
+ * The 'real' name of the color -if there is one.
551
+ */
552
+ toName() {
553
+ if (this.a === 0)
554
+ return "transparent";
555
+ if (this.a < 1)
556
+ return !1;
557
+ const t = "#" + E(this.r, this.g, this.b, !1);
558
+ for (const [e, s] of Object.entries(P))
559
+ if (t === s)
560
+ return e;
561
+ return !1;
562
+ }
563
+ toString(t) {
564
+ const e = !!t;
565
+ t = t ?? this.format;
566
+ let s = !1;
567
+ const o = this.a < 1 && this.a >= 0;
568
+ return !e && o && (t.startsWith("hex") || t === "name") ? t === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (t === "rgb" && (s = this.toRgbString()), t === "prgb" && (s = this.toPercentageRgbString()), (t === "hex" || t === "hex6") && (s = this.toHexString()), t === "hex3" && (s = this.toHexString(!0)), t === "hex4" && (s = this.toHex8String(!0)), t === "hex8" && (s = this.toHex8String()), t === "name" && (s = this.toName()), t === "hsl" && (s = this.toHslString()), t === "hsv" && (s = this.toHsvString()), t === "cmyk" && (s = this.toCmykString()), s || this.toHexString());
569
+ }
570
+ toNumber() {
571
+ return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
572
+ }
573
+ clone() {
574
+ return new h(this.toString());
575
+ }
576
+ /**
577
+ * Lighten the color a given amount. Providing 100 will always return white.
578
+ * @param amount - valid between 1-100
579
+ */
580
+ lighten(t = 10) {
581
+ const e = this.toHsl();
582
+ return e.l += t / 100, e.l = w(e.l), new h(e);
583
+ }
584
+ /**
585
+ * Brighten the color a given amount, from 0 to 100.
586
+ * @param amount - valid between 1-100
587
+ */
588
+ brighten(t = 10) {
589
+ const e = this.toRgb();
590
+ return e.r = Math.max(0, Math.min(255, e.r - Math.round(255 * -(t / 100)))), e.g = Math.max(0, Math.min(255, e.g - Math.round(255 * -(t / 100)))), e.b = Math.max(0, Math.min(255, e.b - Math.round(255 * -(t / 100)))), new h(e);
591
+ }
592
+ /**
593
+ * Darken the color a given amount, from 0 to 100.
594
+ * Providing 100 will always return black.
595
+ * @param amount - valid between 1-100
596
+ */
597
+ darken(t = 10) {
598
+ const e = this.toHsl();
599
+ return e.l -= t / 100, e.l = w(e.l), new h(e);
600
+ }
601
+ /**
602
+ * Mix the color with pure white, from 0 to 100.
603
+ * Providing 0 will do nothing, providing 100 will always return white.
604
+ * @param amount - valid between 1-100
605
+ */
606
+ tint(t = 10) {
607
+ return this.mix("white", t);
608
+ }
609
+ /**
610
+ * Mix the color with pure black, from 0 to 100.
611
+ * Providing 0 will do nothing, providing 100 will always return black.
612
+ * @param amount - valid between 1-100
613
+ */
614
+ shade(t = 10) {
615
+ return this.mix("black", t);
616
+ }
617
+ /**
618
+ * Desaturate the color a given amount, from 0 to 100.
619
+ * Providing 100 will is the same as calling greyscale
620
+ * @param amount - valid between 1-100
621
+ */
622
+ desaturate(t = 10) {
623
+ const e = this.toHsl();
624
+ return e.s -= t / 100, e.s = w(e.s), new h(e);
625
+ }
626
+ /**
627
+ * Saturate the color a given amount, from 0 to 100.
628
+ * @param amount - valid between 1-100
629
+ */
630
+ saturate(t = 10) {
631
+ const e = this.toHsl();
632
+ return e.s += t / 100, e.s = w(e.s), new h(e);
633
+ }
634
+ /**
635
+ * Completely desaturates a color into greyscale.
636
+ * Same as calling `desaturate(100)`
637
+ */
638
+ greyscale() {
639
+ return this.desaturate(100);
640
+ }
641
+ /**
642
+ * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
643
+ * Values outside of this range will be wrapped into this range.
644
+ */
645
+ spin(t) {
646
+ const e = this.toHsl(), s = (e.h + t) % 360;
647
+ return e.h = s < 0 ? 360 + s : s, new h(e);
648
+ }
649
+ /**
650
+ * Mix the current color a given amount with another color, from 0 to 100.
651
+ * 0 means no mixing (return current color).
652
+ */
653
+ mix(t, e = 50) {
654
+ const s = this.toRgb(), o = new h(t).toRgb(), i = e / 100, n = {
655
+ r: (o.r - s.r) * i + s.r,
656
+ g: (o.g - s.g) * i + s.g,
657
+ b: (o.b - s.b) * i + s.b,
658
+ a: (o.a - s.a) * i + s.a
659
+ };
660
+ return new h(n);
661
+ }
662
+ analogous(t = 6, e = 30) {
663
+ const s = this.toHsl(), o = 360 / e, i = [this];
664
+ for (s.h = (s.h - (o * t >> 1) + 720) % 360; --t; )
665
+ s.h = (s.h + o) % 360, i.push(new h(s));
666
+ return i;
667
+ }
668
+ /**
669
+ * taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js
670
+ */
671
+ complement() {
672
+ const t = this.toHsl();
673
+ return t.h = (t.h + 180) % 360, new h(t);
674
+ }
675
+ monochromatic(t = 6) {
676
+ const e = this.toHsv(), { h: s } = e, { s: o } = e;
677
+ let { v: i } = e;
678
+ const n = [], a = 1 / t;
679
+ for (; t--; )
680
+ n.push(new h({ h: s, s: o, v: i })), i = (i + a) % 1;
681
+ return n;
682
+ }
683
+ splitcomplement() {
684
+ const t = this.toHsl(), { h: e } = t;
685
+ return [
686
+ this,
687
+ new h({ h: (e + 72) % 360, s: t.s, l: t.l }),
688
+ new h({ h: (e + 216) % 360, s: t.s, l: t.l })
689
+ ];
690
+ }
691
+ /**
692
+ * Compute how the color would appear on a background
693
+ */
694
+ onBackground(t) {
695
+ const e = this.toRgb(), s = new h(t).toRgb(), o = e.a + s.a * (1 - e.a);
696
+ return new h({
697
+ r: (e.r * e.a + s.r * s.a * (1 - e.a)) / o,
698
+ g: (e.g * e.a + s.g * s.a * (1 - e.a)) / o,
699
+ b: (e.b * e.a + s.b * s.a * (1 - e.a)) / o,
700
+ a: o
701
+ });
702
+ }
703
+ /**
704
+ * Alias for `polyad(3)`
705
+ */
706
+ triad() {
707
+ return this.polyad(3);
708
+ }
709
+ /**
710
+ * Alias for `polyad(4)`
711
+ */
712
+ tetrad() {
713
+ return this.polyad(4);
714
+ }
715
+ /**
716
+ * Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)
717
+ * monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...
718
+ */
719
+ polyad(t) {
720
+ const e = this.toHsl(), { h: s } = e, o = [this], i = 360 / t;
721
+ for (let n = 1; n < t; n++)
722
+ o.push(new h({ h: (s + n * i) % 360, s: e.s, l: e.l }));
723
+ return o;
724
+ }
725
+ /**
726
+ * compare color vs current color
727
+ */
728
+ equals(t) {
729
+ const e = new h(t);
730
+ return this.format === "cmyk" || e.format === "cmyk" ? this.toCmykString() === e.toCmykString() : this.toRgbString() === e.toRgbString();
731
+ }
732
+ }
733
+ const N = /^hs[v|l]a?\s?\((\d{1,3}\.?\d*?),?\s?(\d{1,3})/, B = /(^hs[v|l]a?\s?\()\d{1,3}\.?\d*?(,?\s?)\d{1,3}/, D = /(^hs[v|l]a?\()\d{1,3}/, H = (r, t) => t ? r.toHexString() : r.toHex();
734
+ class at {
735
+ constructor(t, {
736
+ applyColorToState: e,
737
+ extractColorFromState: s,
738
+ maintains: o
739
+ }) {
740
+ this.maintains = "hue", this._hue = 0, this._opacity = 1, this.getColorProcesses = {
741
+ rgb: (i, n) => n ? i.toRgbString() : i.toRgb(),
742
+ prgb: (i, n) => n ? i.toPercentageRgbString() : i.toPercentageRgb(),
743
+ hex8: (i, n) => n ? i.toHex8String() : i.toHex8(),
744
+ name: (i) => i.toName() || i.toRgbString(),
745
+ hsl: (i, n) => {
746
+ if (this.maintains === "hue") {
747
+ if (n)
748
+ return i.toHslString().replace(D, `$1${this.hue}`);
749
+ const { s: u, l: y, a: $ } = i.toHsl();
750
+ return { h: this.hue, s: u, l: y, a: $ };
751
+ }
752
+ if (n)
753
+ return i.toHslString().replace(
754
+ B,
755
+ `$1${this.hue}$2${this.saturation}`
756
+ );
757
+ const { s: a, l, a: m } = i.toHsl();
758
+ return { h: this.hue, s: a, l, a: m };
759
+ },
760
+ hsv: (i, n) => {
761
+ if (this.maintains === "hue") {
762
+ if (n)
763
+ return i.toHsvString().replace(D, `$1${this.hue}`);
764
+ const { s: u, v: y, a: $ } = i.toHsv();
765
+ return { h: this.hue, s: u, v: y, a: $ };
766
+ }
767
+ if (n)
768
+ return i.toHsvString().replace(
769
+ B,
770
+ `$1${this.hue}$2${this.saturation}`
771
+ );
772
+ const { s: a, v: l, a: m } = i.toHsv();
773
+ return { h: this.hue, s: a, v: l, a: m };
774
+ },
775
+ hex: H,
776
+ hex3: H,
777
+ hex4: H,
778
+ hex6: H
779
+ }, this._color = new h({ h: 0, s: 1, v: 1 }), this._previousColor = new h({ h: 0, s: 1, v: 1 }), this._format = {
780
+ format: "",
781
+ isString: !1
782
+ }, this.host = t, this.applyColorToState = e, this.extractColorFromState = s, this.maintains = o || this.maintains;
783
+ }
784
+ setColorProcess(t, e, s, o) {
785
+ this.maintains === "hue" ? this.setColorMaintainHue(t, e, s, o) : this.maintains === "saturation" && this.setColorMaintainSaturation(
786
+ t,
787
+ e,
788
+ s,
789
+ o
790
+ );
791
+ }
792
+ setColorMaintainHue(t, e, s, o) {
793
+ const { h: i, s: n, v: a, a: l } = this._color.toHsv();
794
+ let m;
795
+ if (o && s.startsWith("hs")) {
796
+ const u = N.exec(e);
797
+ if (u !== null) {
798
+ const [, y] = u;
799
+ m = Number(y);
800
+ }
801
+ } else if (!o && s.startsWith("hs")) {
802
+ const u = t.originalInput;
803
+ m = Object.values(u)[0];
804
+ }
805
+ this.hue = m || i, this.opacity = l ?? 1, this.applyColorToState({ h: i, s: n, v: a, a: l });
806
+ }
807
+ setColorMaintainSaturation(t, e, s, o) {
808
+ const { a: i } = this._color.toHsv();
809
+ if (o && s.startsWith("hs")) {
810
+ const n = N.exec(e);
811
+ if (n !== null) {
812
+ const [, a, l] = n;
813
+ this.hue = Number(a), this.saturation = Number(l);
814
+ }
815
+ } else if (!o && s.startsWith("hs")) {
816
+ const n = t.originalInput, a = Object.values(n);
817
+ this.hue = a[0], this.saturation = a[1];
818
+ } else {
819
+ const { h: n } = t.toHsv();
820
+ this.hue = n;
821
+ }
822
+ this.opacity = i ?? 1, this.applyColorToState(t.toHsv());
823
+ }
824
+ applyColorFromState() {
825
+ this._color = new h(this.extractColorFromState(this));
826
+ }
827
+ get hue() {
828
+ return this._hue;
829
+ }
830
+ set hue(t) {
831
+ const e = Math.min(360, Math.max(0, t));
832
+ if (e === this.hue)
833
+ return;
834
+ const s = this.hue, { s: o, v: i, a: n } = this._color.toHsv();
835
+ this._color = new h({ h: e, s: o, v: i, a: n }), this._hue = e, this.host.requestUpdate("hue", s);
836
+ }
837
+ get opacity() {
838
+ return this._opacity;
839
+ }
840
+ set opacity(t) {
841
+ const e = Math.min(1, Math.max(0, t));
842
+ if (e === this.opacity)
843
+ return;
844
+ const s = this.opacity, { h: o, s: i, v: n } = this._color.toHsv();
845
+ this._color = new h({ h: o, s: i, v: n, a: e }), this._opacity = e, this.host.requestUpdate("opacity", s);
846
+ }
847
+ /* c8 ignore next 3 */
848
+ get value() {
849
+ return this.color;
850
+ }
851
+ get color() {
852
+ return this.getColorProcesses[this._format.format || "hex"](
853
+ this._color,
854
+ this._format.isString
855
+ );
856
+ }
857
+ set color(t) {
858
+ if (t === this.color)
859
+ return;
860
+ const e = this._color;
861
+ this._color = new h(t);
862
+ const s = this._color.format;
863
+ let o = typeof t == "string" || t instanceof String;
864
+ s.startsWith("hex") && (o = t.startsWith("#")), this._format = {
865
+ format: s,
866
+ isString: o
867
+ }, this.setColorProcess(this._color, t, s, o), this.host.requestUpdate("color", e);
868
+ }
869
+ getColor(t) {
870
+ const e = {
871
+ hsl: "toHsl"
872
+ };
873
+ return this._color[e[t]]();
874
+ }
875
+ setColor(t) {
876
+ this._color = t;
877
+ const e = typeof this._color.originalInput == "string" || this._color.originalInput instanceof String;
878
+ this.setColorProcess(this._color, t, this._color.format, e);
879
+ }
880
+ getHslString() {
881
+ return this._color.toHslString();
882
+ }
883
+ savePreviousColor() {
884
+ this._previousColor = this._color.clone();
885
+ }
886
+ restorePreviousColor() {
887
+ this.setColor(this._previousColor);
888
+ }
889
+ }
890
+ const ht = '.opacity-checkerboard{position:absolute;block-size:100%;inline-size:100%;background:repeating-conic-gradient(var(--luzmo-color-loupe-checkerboard-light, rgb(255, 255, 255)) 0 25%,var(--luzmo-color-loupe-checkerboard-dark, rgb(230, 230, 230)) 0 50%) var(--luzmo-color-loupe-checkerboard-position, left top)/calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2) calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2)}:host{--luzmo-color-slider-gradient-fallback: rgb(255 0 0) 0%, rgb(255 255 0) 17%, rgb(0 255 0) 33%, rgb(0 255 255) 50%, rgb(0 0 255) 67%, rgb(255 0 255) 83%, rgb(255 0 0) 100%;touch-action:none}:host([vertical]) .handle{inset-block-start:unset;inset-block-end:0}:host([vertical]) .slider{-webkit-appearance:slider-vertical;-moz-appearance:slider-vertical;appearance:slider-vertical}:host(:focus){outline:none}.gradient{overflow:hidden}::slotted(*){width:100%;height:100%}@media (forced-colors: active){:host{--highcontrast-color-slider-border-color: CanvasText;--highcontrast-color-slider-border-color-disabled: GrayText;--highcontrast-color-slider-background-color-disabled: Canvas;forced-color-adjust:none}}:host{--luzmo-color-handle-hitarea-border-radius: var( --luzmo-color-slider-handle-hitarea-border-radius, 0px );min-inline-size:var(--luzmo-color-slider-minimum-length, 80px);inline-size:var(--luzmo-color-slider-length, 192px);block-size:var(--luzmo-color-slider-control-track-width, 24px);-webkit-user-select:none;user-select:none;cursor:default;display:block;position:relative}:host([focused]){z-index:2}:host([disabled]){pointer-events:none}:host([disabled]) .gradient{display:none}:host([vertical]){min-block-size:var(--luzmo-color-slider-vertical-minimum-height, var(--luzmo-color-slider-minimum-length, 80px));block-size:var(--luzmo-color-slider-vertical-height, var(--luzmo-color-slider-length, 192px));min-inline-size:0;inline-size:var(--luzmo-color-slider-vertical-control-track-width, var(--luzmo-color-slider-control-track-height, 24px));display:inline-block}:host([vertical]) .handle{inset-inline-start:50%}.handle{inset-block-start:50%;inset-inline-start:0}.checkerboard{--luzmo-color-slider-border-color-local: var( --highcontrast-color-slider-border-color, var(--luzmo-color-slider-border-color, var(--luzmo-border-color)) )}.checkerboard:before{content:"";z-index:1;box-shadow:inset 0 0 0 var(--luzmo-color-slider-border-width, var(--luzmo-border-width)) var(--luzmo-color-slider-border-color-local);border-radius:var(--luzmo-color-slider-border-rounding, var(--luzmo-border-radius-s));position:absolute;top:0;right:0;bottom:0;left:0}:host([disabled]) .checkerboard{--luzmo-color-slider-border-color-local: var( --highcontrast-color-slider-border-color-disabled, var(--luzmo-color-slider-border-color-disabled, var(--luzmo-dimmed-color)) );background:var(--highcontrast-color-slider-background-color-disabled, var(--luzmo-color-slider-background-color-disabled, var(--luzmo-dimmed-color)))}.checkerboard,.gradient{inline-size:100%;block-size:100%;border-radius:var(--luzmo-color-slider-border-rounding, var(--luzmo-border-radius-s))}.gradient:dir(rtl),:host([dir=rtl]) .gradient{transform:scaleX(-1)}.slider{opacity:0;inline-size:100%;block-size:100%;z-index:0;pointer-events:none;margin:0;position:absolute;inset-block-start:0;inset-inline-start:0}';
891
+ var lt = Object.defineProperty, ct = Object.getOwnPropertyDescriptor, b = (r, t, e, s) => {
892
+ for (var o = s > 1 ? void 0 : s ? ct(t, e) : t, i = r.length - 1, n; i >= 0; i--)
893
+ (n = r[i]) && (o = (s ? n(t, e, o) : n(o)) || o);
894
+ return s && o && lt(t, e, o), o;
895
+ };
896
+ class d extends U {
897
+ constructor() {
898
+ super(...arguments), this.disabled = !1, this.focused = !1, this.label = "hue", this.vertical = !1, this.languageResolver = new V(this), this.colorController = new at(this, {
899
+ /* c8 ignore next 3 */
900
+ applyColorToState: () => {
901
+ if (this.mode === "opacity") {
902
+ const t = new h(this.colorController.color);
903
+ this.sliderHandlePosition = 100 * t.getAlpha();
904
+ } else
905
+ this.sliderHandlePosition = 100 * (this.colorController.hue / 360);
906
+ },
907
+ extractColorFromState: (t) => this.mode === "opacity" ? {
908
+ ...t.getColor("hsl"),
909
+ a: this.value
910
+ } : {
911
+ ...t.getColor("hsl"),
912
+ h: this.value
913
+ },
914
+ maintains: "saturation"
915
+ }), this.sliderHandlePosition = 0, this.step = 1, this.isLTR = !0, this._altered = 0, this._pointerDown = !1;
916
+ }
917
+ static get styles() {
918
+ return [W(ht)];
919
+ }
920
+ get value() {
921
+ return this.mode === "opacity" ? this.colorController.opacity : this.colorController.hue;
922
+ }
923
+ set value(t) {
924
+ this.mode === "opacity" ? this.colorController.opacity = t : this.colorController.hue = t;
925
+ }
926
+ get color() {
927
+ return this.colorController.color;
928
+ }
929
+ set color(t) {
930
+ this.colorController.color = t;
931
+ }
932
+ get altered() {
933
+ return this._altered;
934
+ }
935
+ set altered(t) {
936
+ this._altered = t, this.step = Math.max(1, this.altered * 10);
937
+ }
938
+ get focusElement() {
939
+ return this.input;
940
+ }
941
+ handleKeydown(t) {
942
+ const { key: e } = t;
943
+ this.focused = !0, this.altered = [t.shiftKey, t.ctrlKey, t.altKey].filter(
944
+ (n) => !!n
945
+ ).length;
946
+ let s = 0;
947
+ switch (e) {
948
+ case "ArrowUp": {
949
+ s = this.step;
950
+ break;
951
+ }
952
+ case "ArrowDown": {
953
+ s = -this.step;
954
+ break;
955
+ }
956
+ case "ArrowLeft": {
957
+ s = this.step * (this.isLTR ? -1 : 1);
958
+ break;
959
+ }
960
+ case "ArrowRight": {
961
+ s = this.step * (this.isLTR ? 1 : -1);
962
+ break;
963
+ }
964
+ default:
965
+ return;
966
+ }
967
+ t.preventDefault();
968
+ const i = 100 / (this.mode === "opacity" ? 100 : 360);
969
+ this.sliderHandlePosition = Math.min(
970
+ 100,
971
+ Math.max(0, this.sliderHandlePosition + s * i)
972
+ ), this.value = this.mode === "opacity" ? Math.min(1, Math.max(0, this.value + s / 100)) : Math.min(360, Math.max(0, this.value + s)), this.colorController.applyColorFromState(), s !== 0 && (this.dispatchEvent(
973
+ new Event("input", {
974
+ bubbles: !0,
975
+ composed: !0
976
+ })
977
+ ), this.dispatchEvent(
978
+ new Event("change", {
979
+ bubbles: !0,
980
+ composed: !0
981
+ })
982
+ ));
983
+ }
984
+ handleInput(t) {
985
+ const { valueAsNumber: e } = t.target;
986
+ this.value = e, this.sliderHandlePosition = 100 * (this.mode === "opacity" ? this.value : this.value / 360), this.colorController.applyColorFromState();
987
+ }
988
+ handleChange(t) {
989
+ this.handleInput(t), this.dispatchEvent(
990
+ new Event("change", {
991
+ bubbles: !0,
992
+ composed: !0
993
+ })
994
+ );
995
+ }
996
+ focus(t = {}) {
997
+ super.focus(t), this.forwardFocus();
998
+ }
999
+ forwardFocus() {
1000
+ this.input.focus();
1001
+ }
1002
+ handleFocus() {
1003
+ this.focused = !0;
1004
+ }
1005
+ handleBlur() {
1006
+ this._pointerDown || (this.altered = 0, this.focused = !1);
1007
+ }
1008
+ handlePointerdown(t) {
1009
+ if (t.button !== 0) {
1010
+ t.preventDefault();
1011
+ return;
1012
+ }
1013
+ this._pointerDown = !0, this.colorController.savePreviousColor(), this.boundingClientRect = this.getBoundingClientRect(), t.target.setPointerCapture(t.pointerId), t.pointerType === "mouse" && (this.focused = !0);
1014
+ }
1015
+ handlePointermove(t) {
1016
+ this.sliderHandlePosition = this.calculateHandlePosition(t), this.value = (this.mode === "opacity" ? 1 : 360) * (this.sliderHandlePosition / 100), this.colorController.applyColorFromState(), this.dispatchEvent(
1017
+ new Event("input", {
1018
+ bubbles: !0,
1019
+ composed: !0,
1020
+ cancelable: !0
1021
+ })
1022
+ );
1023
+ }
1024
+ handlePointerup(t) {
1025
+ this._pointerDown = !1, t.target.releasePointerCapture(t.pointerId), this.dispatchEvent(
1026
+ new Event("change", {
1027
+ bubbles: !0,
1028
+ composed: !0,
1029
+ cancelable: !0
1030
+ })
1031
+ ) || this.colorController.restorePreviousColor(), this.focus(), t.pointerType === "mouse" && (this.focused = !1);
1032
+ }
1033
+ /**
1034
+ * Returns the value under the cursor
1035
+ * @param: PointerEvent on slider
1036
+ * @return: Slider value that correlates to the position under the pointer
1037
+ */
1038
+ calculateHandlePosition(t) {
1039
+ if (!this.boundingClientRect)
1040
+ return this.sliderHandlePosition;
1041
+ const e = this.boundingClientRect, s = this.vertical ? e.top : e.left, o = this.vertical ? t.clientY : t.clientX, i = this.vertical ? e.height : e.width, n = Math.max(0, Math.min(1, (o - s) / i));
1042
+ return this.vertical || !this.isLTR ? 100 - 100 * n : 100 * n;
1043
+ }
1044
+ handleGradientPointerdown(t) {
1045
+ t.button === 0 && (t.stopPropagation(), t.preventDefault(), this.handle.dispatchEvent(new PointerEvent("pointerdown", t)), this.handlePointermove(t));
1046
+ }
1047
+ get handlePositionStyles() {
1048
+ return `${this.vertical ? "inset-block-end" : "inset-inline-start"}: ${this.sliderHandlePosition}%`;
1049
+ }
1050
+ get getColorSliderStyle() {
1051
+ const t = this.vertical ? "top" : "right";
1052
+ if (this.mode === "opacity") {
1053
+ const e = new h(this.colorController.color).setAlpha(1).toRgbString();
1054
+ return {
1055
+ background: `linear-gradient(to ${t}, transparent, ${e})`
1056
+ };
1057
+ }
1058
+ return {
1059
+ background: `linear-gradient(to ${t}, var(--luzmo-color-slider-gradient, var(--luzmo-color-slider-gradient-fallback)))`
1060
+ };
1061
+ }
1062
+ render() {
1063
+ return j`
1064
+ <div
1065
+ class="opacity-checkerboard checkerboard"
1066
+ role="presentation"
1067
+ @pointerdown=${this.handleGradientPointerdown}
1068
+ >
1069
+ <div
1070
+ class="gradient"
1071
+ role="presentation"
1072
+ style=${q(this.getColorSliderStyle)}
1073
+ >
1074
+ <slot name="gradient"></slot>
1075
+ </div>
1076
+ </div>
1077
+ <luzmo-color-handle
1078
+ tabindex=${C(this.focused ? void 0 : "0")}
1079
+ @focus=${this.forwardFocus}
1080
+ ?focused=${this.focused}
1081
+ class="handle"
1082
+ color=${this.mode === "opacity" ? this.color : "hsl(" + this.value + ", 100%, 50%)"}
1083
+ ?disabled=${this.disabled}
1084
+ style=${this.handlePositionStyles}
1085
+ ${G({
1086
+ start: ["pointerdown", this.handlePointerdown],
1087
+ streamInside: ["pointermove", this.handlePointermove],
1088
+ end: [
1089
+ ["pointerup", "pointercancel", "pointerleave"],
1090
+ this.handlePointerup
1091
+ ]
1092
+ })}
1093
+ ></luzmo-color-handle>
1094
+ <input
1095
+ type="range"
1096
+ class="slider"
1097
+ min="0"
1098
+ max=${this.mode === "opacity" ? "100" : "360"}
1099
+ aria-orientation=${C(this.vertical ? "vertical" : void 0)}
1100
+ orient=${C(this.vertical ? "vertical" : void 0)}
1101
+ step=${this.step}
1102
+ aria-label=${this.label}
1103
+ .value=${String(
1104
+ this.mode === "opacity" ? this.value * 100 : this.value
1105
+ )}
1106
+ aria-valuetext=${`${new Intl.NumberFormat(
1107
+ this.languageResolver.language,
1108
+ {
1109
+ maximumFractionDigits: 0,
1110
+ minimumIntegerDigits: 1,
1111
+ style: "unit",
1112
+ unit: this.mode === "opacity" ? "percent" : "degree",
1113
+ unitDisplay: "narrow"
1114
+ }
1115
+ ).format(this.mode === "opacity" ? this.value * 100 : this.value)}`}
1116
+ @input=${this.handleInput}
1117
+ @change=${this.handleChange}
1118
+ @keydown=${this.handleKeydown}
1119
+ />
1120
+ `;
1121
+ }
1122
+ firstUpdated(t) {
1123
+ super.firstUpdated(t), this.boundingClientRect = this.getBoundingClientRect(), this.addEventListener("focus", this.handleFocus), this.addEventListener("blur", this.handleBlur);
1124
+ }
1125
+ updated(t) {
1126
+ t.has("mode") && (this.handle.style.insetInlineStart = "", this.handle.style.insetBlockEnd = "", this.mode === "opacity" && (this.colorController.color = new h(
1127
+ this.colorController.color
1128
+ ).toRgbString(), this.handle.style.insetInlineStart = 100 * this.colorController.opacity + "%"));
1129
+ }
1130
+ }
1131
+ b([
1132
+ v({ type: String, reflect: !0 })
1133
+ ], d.prototype, "dir", 2);
1134
+ b([
1135
+ v({ type: String, reflect: !0 })
1136
+ ], d.prototype, "mode", 2);
1137
+ b([
1138
+ v({ type: Boolean, reflect: !0 })
1139
+ ], d.prototype, "disabled", 2);
1140
+ b([
1141
+ v({ type: Boolean, reflect: !0 })
1142
+ ], d.prototype, "focused", 2);
1143
+ b([
1144
+ T(".handle")
1145
+ ], d.prototype, "handle", 2);
1146
+ b([
1147
+ v({ type: String })
1148
+ ], d.prototype, "label", 2);
1149
+ b([
1150
+ v({ type: Boolean, reflect: !0 })
1151
+ ], d.prototype, "vertical", 2);
1152
+ b([
1153
+ v({ type: Number })
1154
+ ], d.prototype, "value", 1);
1155
+ b([
1156
+ v({ type: Number, reflect: !0 })
1157
+ ], d.prototype, "sliderHandlePosition", 2);
1158
+ b([
1159
+ v({ type: String })
1160
+ ], d.prototype, "color", 1);
1161
+ b([
1162
+ v({ type: Number })
1163
+ ], d.prototype, "step", 2);
1164
+ b([
1165
+ v({ type: Boolean, attribute: "is-ltr" })
1166
+ ], d.prototype, "isLTR", 2);
1167
+ b([
1168
+ T("input")
1169
+ ], d.prototype, "input", 2);
1170
+ customElements.get("luzmo-color-slider") || customElements.define("luzmo-color-slider", d);
1171
+ export {
1172
+ d as L,
1173
+ h as T
1174
+ };