@luzmo/lucero 0.0.3 → 0.0.4

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 (179) hide show
  1. package/lib/accordion/index.cjs +43 -0
  2. package/lib/accordion/index.js +182 -0
  3. package/lib/action-bar/index.cjs +39 -0
  4. package/lib/action-bar/index.js +108 -0
  5. package/lib/action-button/index.cjs +24 -0
  6. package/lib/action-button/index.js +162 -0
  7. package/lib/action-group/index.cjs +18 -0
  8. package/lib/action-group/index.js +29 -0
  9. package/lib/action-group-BoIH8s8R.js +259 -0
  10. package/lib/action-group-D4MxBrq8.cjs +20 -0
  11. package/lib/action-menu/index.cjs +56 -0
  12. package/lib/action-menu/index.js +127 -0
  13. package/lib/async-directive-CV2MII86.cjs +22 -0
  14. package/lib/async-directive-FGzMycjH.js +82 -0
  15. package/lib/avatar/index.cjs +24 -0
  16. package/lib/avatar/index.js +82 -0
  17. package/lib/base-BCmA9Wxv.cjs +30 -0
  18. package/lib/base-BjTwmyRF.cjs +22 -0
  19. package/lib/base-D76d76ww.js +26 -0
  20. package/lib/base-nYalvNMy.js +390 -0
  21. package/lib/button/index.cjs +20 -0
  22. package/lib/button/index.js +128 -0
  23. package/lib/button-base-B0iB_JTv.cjs +25 -0
  24. package/lib/button-base-DgtT6sU5.js +143 -0
  25. package/lib/button-group/index.cjs +18 -0
  26. package/lib/button-group/index.js +60 -0
  27. package/lib/checkbox/index.cjs +25 -0
  28. package/lib/checkbox/index.js +97 -0
  29. package/lib/checkbox-mixin-DegQlk5C.js +71 -0
  30. package/lib/checkbox-mixin-H0Hm-VLk.cjs +27 -0
  31. package/lib/clear-button-Ap5H3UyH.js +54 -0
  32. package/lib/clear-button-D0djuaLb.cjs +18 -0
  33. package/lib/close-button-BrfeZvjk.cjs +18 -0
  34. package/lib/close-button-CGISEF33.js +52 -0
  35. package/lib/color-Bg3tYsAQ.js +178 -0
  36. package/lib/color-DphK4hwx.cjs +18 -0
  37. package/lib/color-area/index.cjs +80 -0
  38. package/lib/color-area/index.js +373 -0
  39. package/lib/color-field/index.cjs +23 -0
  40. package/lib/color-field/index.js +81 -0
  41. package/lib/color-handle/index.cjs +24 -0
  42. package/lib/color-handle/index.js +74 -0
  43. package/lib/color-loupe/index.cjs +18 -0
  44. package/lib/color-loupe/index.js +29 -0
  45. package/lib/color-loupe-BICpNqFs.cjs +56 -0
  46. package/lib/color-loupe-DBEApMDT.js +82 -0
  47. package/lib/color-menu/index.cjs +86 -0
  48. package/lib/color-menu/index.js +204 -0
  49. package/lib/color-picker/index.cjs +48 -0
  50. package/lib/color-picker/index.js +142 -0
  51. package/lib/color-slider/index.cjs +57 -0
  52. package/lib/color-slider/index.js +318 -0
  53. package/lib/condition-attribute-with-id-DrQYZzFS.cjs +18 -0
  54. package/lib/condition-attribute-with-id-Dv4lSRbe.js +31 -0
  55. package/lib/dependency-manger-C5HCkMMB.cjs +18 -0
  56. package/lib/dependency-manger-CEXvGQUV.js +54 -0
  57. package/lib/directive-C7oCP5Bh.cjs +22 -0
  58. package/lib/directive-helpers-BLDZnGQv.js +28 -0
  59. package/lib/directive-helpers-C2vOfhFx.cjs +22 -0
  60. package/lib/directive-oAbCiebi.js +44 -0
  61. package/lib/divider/index.cjs +18 -0
  62. package/lib/divider/index.js +62 -0
  63. package/lib/divider.module-CXMNveQc.cjs +18 -0
  64. package/lib/divider.module-DwOuLGU3.js +21 -0
  65. package/lib/element-resolution-BvRLGqIU.cjs +18 -0
  66. package/lib/element-resolution-FCUT-wql.js +91 -0
  67. package/lib/field-group/index.cjs +18 -0
  68. package/lib/field-group/index.js +29 -0
  69. package/lib/field-group-CBWafIUV.js +67 -0
  70. package/lib/field-group-TUFvhJkk.cjs +23 -0
  71. package/lib/field-label/index.cjs +18 -0
  72. package/lib/field-label/index.js +29 -0
  73. package/lib/field-label-BK_tk8vP.js +107 -0
  74. package/lib/field-label-BrJaeORz.cjs +25 -0
  75. package/lib/focus-group-DHeTq18L.js +218 -0
  76. package/lib/focus-group-DnxZUBhQ.cjs +18 -0
  77. package/lib/focus-visible-B0P9aY_G.cjs +18 -0
  78. package/lib/focus-visible-DBlJGoEW.js +74 -0
  79. package/lib/focusable-DbUg-3Vp.js +153 -0
  80. package/lib/focusable-Dv_6CFaY.cjs +18 -0
  81. package/lib/focusable-selectors-B4YgbghQ.js +31 -0
  82. package/lib/focusable-selectors-BgFlyFcY.cjs +18 -0
  83. package/lib/icon/index.cjs +18 -0
  84. package/lib/icon/index.js +89 -0
  85. package/lib/if-defined-CYpcjGCb.js +27 -0
  86. package/lib/if-defined-Cv6xanXh.cjs +22 -0
  87. package/lib/index-C1chwzNp.js +727 -0
  88. package/lib/index-DCKCHDTt.cjs +18 -0
  89. package/lib/index-ovT-qVzf.js +928 -0
  90. package/lib/index-yNcLzjhM.cjs +77 -0
  91. package/lib/index.cjs +18 -0
  92. package/lib/index.js +133 -0
  93. package/lib/infield-button/index.cjs +22 -0
  94. package/lib/infield-button/index.js +65 -0
  95. package/lib/label/index.cjs +18 -0
  96. package/lib/label/index.js +52 -0
  97. package/lib/legend-position/index.cjs +27 -0
  98. package/lib/legend-position/index.js +85 -0
  99. package/lib/like-anchor-K8W0QYwC.cjs +32 -0
  100. package/lib/like-anchor-cDeGGeHh.js +70 -0
  101. package/lib/lit-html-B3ugcwD9.js +248 -0
  102. package/lib/lit-html-p4Oxv2-5.cjs +24 -0
  103. package/lib/manage-help-text-2mSEy-AD.js +92 -0
  104. package/lib/manage-help-text-iOk-zmy8.cjs +30 -0
  105. package/lib/menu/index.cjs +18 -0
  106. package/lib/menu/index.js +32 -0
  107. package/lib/multi-language-field/index.cjs +39 -0
  108. package/lib/multi-language-field/index.js +149 -0
  109. package/lib/mutation-controller-DH7YOCyj.js +52 -0
  110. package/lib/mutation-controller-DkOMCW-c.cjs +22 -0
  111. package/lib/number-field/index.cjs +57 -0
  112. package/lib/number-field/index.js +736 -0
  113. package/lib/observe-slot-text-BmsCNJig.cjs +18 -0
  114. package/lib/observe-slot-text-BoFRF-VI.js +87 -0
  115. package/lib/overlay/index.cjs +73 -0
  116. package/lib/overlay/index.js +325 -0
  117. package/lib/overlay-C7QKFqRc.js +2702 -0
  118. package/lib/overlay-DScraBAi.cjs +47 -0
  119. package/lib/pending-state-D5KTK4_1.js +61 -0
  120. package/lib/pending-state-Dbc2HIM2.cjs +26 -0
  121. package/lib/picker/index.cjs +18 -0
  122. package/lib/picker/index.js +32 -0
  123. package/lib/picker--2OCYWnV.js +657 -0
  124. package/lib/picker-B9W7Haf4.cjs +127 -0
  125. package/lib/platform-CQzYNWKq.cjs +18 -0
  126. package/lib/platform-DQYMG7JI.js +54 -0
  127. package/lib/popover/index.cjs +18 -0
  128. package/lib/popover/index.js +29 -0
  129. package/lib/popover-CVbjhSnx.cjs +30 -0
  130. package/lib/popover-ZRVxogyp.js +68 -0
  131. package/lib/progress-circle/index.cjs +18 -0
  132. package/lib/progress-circle/index.js +29 -0
  133. package/lib/progress-circle-CiJoS8J7.cjs +33 -0
  134. package/lib/progress-circle-DpXiqW6a.js +98 -0
  135. package/lib/query-BL-TJj7K.cjs +22 -0
  136. package/lib/query-D_KR_GUc.js +51 -0
  137. package/lib/query-assigned-elements-DjfhL1cl.js +36 -0
  138. package/lib/query-assigned-elements-DsKsfk7G.cjs +22 -0
  139. package/lib/query-assigned-nodes-BcKWmGzy.cjs +22 -0
  140. package/lib/query-assigned-nodes-C76XVPWY.js +36 -0
  141. package/lib/radio/index.cjs +22 -0
  142. package/lib/radio/index.js +192 -0
  143. package/lib/random-id-ByCz1xaq.js +26 -0
  144. package/lib/random-id-CqvckpWe.cjs +18 -0
  145. package/lib/roving-tabindex-By_fCy_e.cjs +18 -0
  146. package/lib/roving-tabindex-DOg4z6ZU.js +66 -0
  147. package/lib/search/index.cjs +45 -0
  148. package/lib/search/index.js +132 -0
  149. package/lib/sized-mixin-BSYHt8nT.cjs +18 -0
  150. package/lib/sized-mixin-Dl0KoEcV.js +63 -0
  151. package/lib/slider/index.cjs +18 -0
  152. package/lib/slider/index.js +1159 -0
  153. package/lib/slottable-request-event-BfUUt1Mh.cjs +18 -0
  154. package/lib/slottable-request-event-DggLA4Rx.js +31 -0
  155. package/lib/state-BAO-13Bs.js +29 -0
  156. package/lib/state-DReJ3hB6.cjs +22 -0
  157. package/lib/streaming-listener-Bw4jE33f.cjs +18 -0
  158. package/lib/streaming-listener-DLo0wkMc.js +125 -0
  159. package/lib/style-map-BjBGQ_u3.cjs +22 -0
  160. package/lib/style-map-BqvQDFJt.js +53 -0
  161. package/lib/swatch/index.cjs +49 -0
  162. package/lib/swatch/index.js +343 -0
  163. package/lib/switch/index.cjs +22 -0
  164. package/lib/switch/index.js +74 -0
  165. package/lib/tags/index.cjs +32 -0
  166. package/lib/tags/index.js +174 -0
  167. package/lib/text-field/index.cjs +21 -0
  168. package/lib/text-field/index.js +62 -0
  169. package/lib/text-field-C6Aa7XOb.cjs +85 -0
  170. package/lib/text-field-DPk332j9.js +315 -0
  171. package/lib/toast/index.cjs +51 -0
  172. package/lib/toast/index.js +154 -0
  173. package/lib/tooltip/index.cjs +45 -0
  174. package/lib/tooltip/index.js +221 -0
  175. package/lib/unit-input/index.cjs +43 -0
  176. package/lib/unit-input/index.js +184 -0
  177. package/lib/when-CDK1Tt5Y.js +28 -0
  178. package/lib/when-CDZyJPvd.cjs +22 -0
  179. package/package.json +2 -2
@@ -0,0 +1,736 @@
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 { luzmoIcon as C, luzmoAngleUp as K, luzmoAngleDown as W } from "@luzmo/icons";
19
+ import { a as N, b as Y, i as X } from "../platform-DQYMG7JI.js";
20
+ import { L as Z, s as J, l as Q } from "../streaming-listener-DLo0wkMc.js";
21
+ import { unsafeCSS as ee, nothing as te, html as _ } from "lit";
22
+ import { n as h } from "../base-nYalvNMy.js";
23
+ import { e as re } from "../query-D_KR_GUc.js";
24
+ import "../infield-button/index.js";
25
+ import { L as oe } from "../text-field-DPk332j9.js";
26
+ const G = () => {
27
+ if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
28
+ const s = document.createElement("style");
29
+ s.setAttribute("data-luzmo-vars", ""), s.textContent = 'html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-color-disabled);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-color-negative: #ca221c;--luzmo-color-negative-hover: #b3241f;--luzmo-color-negative-down: #9f231f;--luzmo-color-negative-focus: #b3241f;--luzmo-color-negative-rgb: 202, 34, 28;--luzmo-color-positive: rgb(20, 150, 101);--luzmo-color-positive-hover: rgb(17, 128, 86);--luzmo-color-positive-down: rgb(16, 105, 71);--luzmo-color-positive-focus: rgb(17, 128, 86);--luzmo-color-positive-rgb: 20, 150, 101;--luzmo-color-selected: rgb(110, 110, 110);--luzmo-color-selected-hover: rgb(70, 70, 70);--luzmo-color-selected-down: rgb(40, 40, 40);--luzmo-color-selected-focus: rgb(70, 70, 70);--luzmo-color-selected-hard: #1e1e1e;--luzmo-color-selected-hard-hover: rgb(0, 0, 0);--luzmo-color-selected-hard-down: rgb(0, 0, 0);--luzmo-color-selected-hard-focus: rgb(0, 0, 0);--luzmo-color-informative: #1a77e9;--luzmo-color-informative-rgb: 26, 119, 233;--luzmo-color-disabled: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}', document.head.appendChild(s);
30
+ }
31
+ };
32
+ G();
33
+ let w = /* @__PURE__ */ new Map(), F = !1;
34
+ try {
35
+ F = new Intl.NumberFormat("de-DE", {
36
+ signDisplay: "exceptZero"
37
+ }).resolvedOptions().signDisplay === "exceptZero";
38
+ } catch {
39
+ }
40
+ let z = !1;
41
+ try {
42
+ z = new Intl.NumberFormat("de-DE", {
43
+ style: "unit",
44
+ unit: "degree"
45
+ }).resolvedOptions().style === "unit";
46
+ } catch {
47
+ }
48
+ const q = {
49
+ degree: {
50
+ narrow: {
51
+ default: "°",
52
+ "ja-JP": " 度",
53
+ "zh-TW": "度",
54
+ "sl-SI": " °"
55
+ }
56
+ }
57
+ };
58
+ class g {
59
+ /** Formats a number value as a string, according to the locale and options provided to the constructor. */
60
+ format(e) {
61
+ let t = "";
62
+ if (!F && this.options.signDisplay != null ? t = se(this.numberFormatter, this.options.signDisplay, e) : t = this.numberFormatter.format(e), this.options.style === "unit" && !z) {
63
+ var r;
64
+ let { unit: o, unitDisplay: i = "short", locale: l } = this.resolvedOptions();
65
+ if (!o) return t;
66
+ let a = (r = q[o]) === null || r === void 0 ? void 0 : r[i];
67
+ t += a[l] || a.default;
68
+ }
69
+ return t;
70
+ }
71
+ /** Formats a number to an array of parts such as separators, digits, punctuation, and more. */
72
+ formatToParts(e) {
73
+ return this.numberFormatter.formatToParts(e);
74
+ }
75
+ /** Formats a number range as a string. */
76
+ formatRange(e, t) {
77
+ if (typeof this.numberFormatter.formatRange == "function") return this.numberFormatter.formatRange(e, t);
78
+ if (t < e) throw new RangeError("End date must be >= start date");
79
+ return `${this.format(e)} – ${this.format(t)}`;
80
+ }
81
+ /** Formats a number range as an array of parts. */
82
+ formatRangeToParts(e, t) {
83
+ if (typeof this.numberFormatter.formatRangeToParts == "function") return this.numberFormatter.formatRangeToParts(e, t);
84
+ if (t < e) throw new RangeError("End date must be >= start date");
85
+ let r = this.numberFormatter.formatToParts(e), o = this.numberFormatter.formatToParts(t);
86
+ return [
87
+ ...r.map((i) => ({
88
+ ...i,
89
+ source: "startRange"
90
+ })),
91
+ {
92
+ type: "literal",
93
+ value: " – ",
94
+ source: "shared"
95
+ },
96
+ ...o.map((i) => ({
97
+ ...i,
98
+ source: "endRange"
99
+ }))
100
+ ];
101
+ }
102
+ /** Returns the resolved formatting options based on the values passed to the constructor. */
103
+ resolvedOptions() {
104
+ let e = this.numberFormatter.resolvedOptions();
105
+ return !F && this.options.signDisplay != null && (e = {
106
+ ...e,
107
+ signDisplay: this.options.signDisplay
108
+ }), !z && this.options.style === "unit" && (e = {
109
+ ...e,
110
+ style: "unit",
111
+ unit: this.options.unit,
112
+ unitDisplay: this.options.unitDisplay
113
+ }), e;
114
+ }
115
+ constructor(e, t = {}) {
116
+ this.numberFormatter = ie(e, t), this.options = t;
117
+ }
118
+ }
119
+ function ie(s, e = {}) {
120
+ let { numberingSystem: t } = e;
121
+ if (t && s.includes("-nu-") && (s.includes("-u-") || (s += "-u-"), s += `-nu-${t}`), e.style === "unit" && !z) {
122
+ var r;
123
+ let { unit: l, unitDisplay: a = "short" } = e;
124
+ if (!l) throw new Error('unit option must be provided with style: "unit"');
125
+ if (!(!((r = q[l]) === null || r === void 0) && r[a])) throw new Error(`Unsupported unit ${l} with unitDisplay = ${a}`);
126
+ e = {
127
+ ...e,
128
+ style: "decimal"
129
+ };
130
+ }
131
+ let o = s + (e ? Object.entries(e).sort((l, a) => l[0] < a[0] ? -1 : 1).join() : "");
132
+ if (w.has(o)) return w.get(o);
133
+ let i = new Intl.NumberFormat(s, e);
134
+ return w.set(o, i), i;
135
+ }
136
+ function se(s, e, t) {
137
+ if (e === "auto") return s.format(t);
138
+ if (e === "never") return s.format(Math.abs(t));
139
+ {
140
+ let r = !1;
141
+ if (e === "always" ? r = t > 0 || Object.is(t, 0) : e === "exceptZero" && (Object.is(t, -0) || Object.is(t, 0) ? t = Math.abs(t) : r = t > 0), r) {
142
+ let o = s.format(-t), i = s.format(t), l = o.replace(i, "").replace(/\u200e|\u061C/, "");
143
+ return [
144
+ ...l
145
+ ].length !== 1 && console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"), o.replace(i, "!!!").replace(l, "+").replace("!!!", i);
146
+ } else return s.format(t);
147
+ }
148
+ }
149
+ const le = new RegExp("^.*\\(.*\\).*$"), ae = [
150
+ "latn",
151
+ "arab",
152
+ "hanidec",
153
+ "deva",
154
+ "beng"
155
+ ];
156
+ class $ {
157
+ /**
158
+ * Parses the given string to a number. Returns NaN if a valid number could not be parsed.
159
+ */
160
+ parse(e) {
161
+ return k(this.locale, this.options, e).parse(e);
162
+ }
163
+ /**
164
+ * Returns whether the given string could potentially be a valid number. This should be used to
165
+ * validate user input as the user types. If a `minValue` or `maxValue` is provided, the validity
166
+ * of the minus/plus sign characters can be checked.
167
+ */
168
+ isValidPartialNumber(e, t, r) {
169
+ return k(this.locale, this.options, e).isValidPartialNumber(e, t, r);
170
+ }
171
+ /**
172
+ * Returns a numbering system for which the given string is valid in the current locale.
173
+ * If no numbering system could be detected, the default numbering system for the current
174
+ * locale is returned.
175
+ */
176
+ getNumberingSystem(e) {
177
+ return k(this.locale, this.options, e).options.numberingSystem;
178
+ }
179
+ constructor(e, t = {}) {
180
+ this.locale = e, this.options = t;
181
+ }
182
+ }
183
+ const E = /* @__PURE__ */ new Map();
184
+ function k(s, e, t) {
185
+ let r = D(s, e);
186
+ if (!s.includes("-nu-") && !r.isValidPartialNumber(t)) {
187
+ for (let o of ae) if (o !== r.options.numberingSystem) {
188
+ let i = D(s + (s.includes("-u-") ? "-nu-" : "-u-nu-") + o, e);
189
+ if (i.isValidPartialNumber(t)) return i;
190
+ }
191
+ }
192
+ return r;
193
+ }
194
+ function D(s, e) {
195
+ let t = s + (e ? Object.entries(e).sort((o, i) => o[0] < i[0] ? -1 : 1).join() : ""), r = E.get(t);
196
+ return r || (r = new ne(s, e), E.set(t, r)), r;
197
+ }
198
+ class ne {
199
+ parse(e) {
200
+ let t = this.sanitize(e);
201
+ if (this.symbols.group && (t = f(t, this.symbols.group, "")), this.symbols.decimal && (t = t.replace(this.symbols.decimal, ".")), this.symbols.minusSign && (t = t.replace(this.symbols.minusSign, "-")), t = t.replace(this.symbols.numeral, this.symbols.index), this.options.style === "percent") {
202
+ let l = t.indexOf("-");
203
+ t = t.replace("-", "");
204
+ let a = t.indexOf(".");
205
+ a === -1 && (a = t.length), t = t.replace(".", ""), a - 2 === 0 ? t = `0.${t}` : a - 2 === -1 ? t = `0.0${t}` : a - 2 === -2 ? t = "0.00" : t = `${t.slice(0, a - 2)}.${t.slice(a - 2)}`, l > -1 && (t = `-${t}`);
206
+ }
207
+ let r = t ? +t : NaN;
208
+ if (isNaN(r)) return NaN;
209
+ if (this.options.style === "percent") {
210
+ var o, i;
211
+ let l = {
212
+ ...this.options,
213
+ style: "decimal",
214
+ minimumFractionDigits: Math.min(((o = this.options.minimumFractionDigits) !== null && o !== void 0 ? o : 0) + 2, 20),
215
+ maximumFractionDigits: Math.min(((i = this.options.maximumFractionDigits) !== null && i !== void 0 ? i : 0) + 2, 20)
216
+ };
217
+ return new $(this.locale, l).parse(new g(this.locale, l).format(r));
218
+ }
219
+ return this.options.currencySign === "accounting" && le.test(e) && (r = -1 * r), r;
220
+ }
221
+ sanitize(e) {
222
+ return e = e.replace(this.symbols.literals, ""), this.symbols.minusSign && (e = e.replace("-", this.symbols.minusSign)), this.options.numberingSystem === "arab" && (this.symbols.decimal && (e = e.replace(",", this.symbols.decimal), e = e.replace("،", this.symbols.decimal)), this.symbols.group && (e = f(e, ".", this.symbols.group))), this.options.locale === "fr-FR" && (e = f(e, ".", " ")), e;
223
+ }
224
+ isValidPartialNumber(e, t = -1 / 0, r = 1 / 0) {
225
+ return e = this.sanitize(e), this.symbols.minusSign && e.startsWith(this.symbols.minusSign) && t < 0 ? e = e.slice(this.symbols.minusSign.length) : this.symbols.plusSign && e.startsWith(this.symbols.plusSign) && r > 0 && (e = e.slice(this.symbols.plusSign.length)), this.symbols.group && e.startsWith(this.symbols.group) || this.symbols.decimal && e.indexOf(this.symbols.decimal) > -1 && this.options.maximumFractionDigits === 0 ? !1 : (this.symbols.group && (e = f(e, this.symbols.group, "")), e = e.replace(this.symbols.numeral, ""), this.symbols.decimal && (e = e.replace(this.symbols.decimal, "")), e.length === 0);
226
+ }
227
+ constructor(e, t = {}) {
228
+ this.locale = e, this.formatter = new Intl.NumberFormat(e, t), this.options = this.formatter.resolvedOptions(), this.symbols = ue(e, this.formatter, this.options, t);
229
+ var r, o;
230
+ this.options.style === "percent" && (((r = this.options.minimumFractionDigits) !== null && r !== void 0 ? r : 0) > 18 || ((o = this.options.maximumFractionDigits) !== null && o !== void 0 ? o : 0) > 18) && console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.");
231
+ }
232
+ }
233
+ const V = /* @__PURE__ */ new Set([
234
+ "decimal",
235
+ "fraction",
236
+ "integer",
237
+ "minusSign",
238
+ "plusSign",
239
+ "group"
240
+ ]), de = [
241
+ 0,
242
+ 4,
243
+ 2,
244
+ 1,
245
+ 11,
246
+ 20,
247
+ 3,
248
+ 7,
249
+ 100,
250
+ 21,
251
+ 0.1,
252
+ 1.1
253
+ ];
254
+ function ue(s, e, t, r) {
255
+ var o, i, l, a;
256
+ let d = new Intl.NumberFormat(s, {
257
+ ...t,
258
+ // Resets so we get the full range of symbols
259
+ minimumSignificantDigits: 1,
260
+ maximumSignificantDigits: 21,
261
+ roundingIncrement: 1,
262
+ roundingPriority: "auto",
263
+ roundingMode: "halfExpand"
264
+ }), u = d.formatToParts(-10000.111), b = d.formatToParts(10000.111), M = de.map((n) => d.formatToParts(n));
265
+ var y;
266
+ let O = (y = (o = u.find((n) => n.type === "minusSign")) === null || o === void 0 ? void 0 : o.value) !== null && y !== void 0 ? y : "-", x = (i = b.find((n) => n.type === "plusSign")) === null || i === void 0 ? void 0 : i.value;
267
+ !x && ((r == null ? void 0 : r.signDisplay) === "exceptZero" || (r == null ? void 0 : r.signDisplay) === "always") && (x = "+");
268
+ let A = (l = new Intl.NumberFormat(s, {
269
+ ...t,
270
+ minimumFractionDigits: 2,
271
+ maximumFractionDigits: 2
272
+ }).formatToParts(1e-3).find((n) => n.type === "decimal")) === null || l === void 0 ? void 0 : l.value, L = (a = u.find((n) => n.type === "group")) === null || a === void 0 ? void 0 : a.value, U = u.filter((n) => !V.has(n.type)).map((n) => R(n.value)), T = M.flatMap((n) => n.filter((m) => !V.has(m.type)).map((m) => R(m.value))), P = [
273
+ .../* @__PURE__ */ new Set([
274
+ ...U,
275
+ ...T
276
+ ])
277
+ ].sort((n, m) => m.length - n.length), B = P.length === 0 ? new RegExp("[\\p{White_Space}]", "gu") : new RegExp(`${P.join("|")}|[\\p{White_Space}]`, "gu"), S = [
278
+ ...new Intl.NumberFormat(t.locale, {
279
+ useGrouping: !1
280
+ }).format(9876543210)
281
+ ].reverse(), j = new Map(S.map((n, m) => [
282
+ n,
283
+ m
284
+ ])), H = new RegExp(`[${S.join("")}]`, "g");
285
+ return {
286
+ minusSign: O,
287
+ plusSign: x,
288
+ decimal: A,
289
+ group: L,
290
+ literals: B,
291
+ numeral: H,
292
+ index: (n) => String(j.get(n))
293
+ };
294
+ }
295
+ function f(s, e, t) {
296
+ return s.replaceAll ? s.replaceAll(e, t) : s.split(e).join(t);
297
+ }
298
+ function R(s) {
299
+ return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
300
+ }
301
+ const pe = '#text-field{--stepper-width: calc( var(--luzmo-stepper-height, var(--stepper-height)) * var( --luzmo-stepper-min-width-multiplier, var(--stepper-min-width-multiplier) ) + var(--luzmo-stepper-button-width, var(--stepper-button-width)) + var(--luzmo-stepper-border-width, var(--stepper-border-width)) * 2 );--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color, var( --luzmo-stepper-buttons-border-color, var(--stepper-buttons-border-color) ) );--luzmo-infield-button-border-width: var( --luzmo-stepper-button-border-width, var(--stepper-button-border-width) );--luzmo-infield-button-border-radius-reset: var( --stepper-button-border-radius-reset );--luzmo-text-field-border-width: var( --luzmo-stepper-border-width, var(--stepper-border-width) );inline-size:var(--luzmo-stepper-width, var(--stepper-width));block-size:var(--luzmo-stepper-height, var(--stepper-height));border-radius:var(--luzmo-stepper-border-radius, var(--stepper-border-radius));border-color:var(--highcontrast-stepper-border-color, var(--luzmo-stepper-border-color, var(--stepper-border-color)));flex-flow:row;display:inline-flex;position:relative}#text-field:after{content:"";inline-size:100%;block-size:var(--luzmo-stepper-focus-indicator-width, var(--stepper-focus-indicator-width));position:absolute;inset-block-end:calc((var(--luzmo-stepper-focus-indicator-gap, var(--stepper-focus-indicator-gap)) + var(--luzmo-stepper-focus-indicator-width, var(--stepper-focus-indicator-width))) * -1);inset-inline-start:0}:host([focused]) #text-field,#text-field:focus{--luzmo-stepper-border-color: var( --highcontrast-stepper-border-color-focus, var(--luzmo-stepper-border-color-focus, var(--stepper-border-color-focus)) );--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-focus, var( --luzmo-stepper-buttons-border-color-focus, var(--stepper-buttons-border-color-focus) ) )}:host([focused]:not([disabled])) #text-field .input,:host(:not([disabled])) #text-field:focus .input{outline:none}:host([focused]:not([disabled])) #text-field .buttons,:host([focused]:not([disabled])) #text-field .input,:host(:not([disabled])) #text-field:focus .buttons,:host(:not([disabled])) #text-field:focus .input{border-color:var(--highcontrast-stepper-border-color-focus, var(--luzmo-stepper-border-color-focus, var(--stepper-border-color-focus)))}:host([keyboard-focused]) #text-field,#text-field:focus-visible{--luzmo-stepper-border-color: var( --highcontrast-stepper-border-color-keyboard-focus, var( --luzmo-stepper-buttons-border-color-keyboard-focus, var(--stepper-buttons-border-color-keyboard-focus) ) );--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-keyboard-focus, var( --luzmo-stepper-buttons-border-color-keyboard-focus, var(--stepper-buttons-border-color-keyboard-focus) ) )}:host([keyboard-focused]:not([disabled])) #text-field,:host(:not([disabled])) #text-field:focus-visible{outline:var(--luzmo-stepper-focus-indicator-width, var(--stepper-focus-indicator-width)) solid;outline-color:var(--highcontrast-stepper-focus-indicator-color, var(--luzmo-stepper-focus-indicator-color, var(--stepper-focus-indicator-color)));outline-offset:var(--luzmo-stepper-focus-indicator-gap, var(--stepper-focus-indicator-gap))}:host([keyboard-focused]:not([disabled])) #text-field .input,:host(:not([disabled])) #text-field:focus-visible .input{outline:none}:host([keyboard-focused]:not([disabled])) #text-field .buttons,:host([keyboard-focused]:not([disabled])) #text-field .input,:host(:not([disabled])) #text-field:focus-visible .buttons,:host(:not([disabled])) #text-field:focus-visible .input{border-color:var(--highcontrast-stepper-border-color-keyboard-focus, var(--luzmo-stepper-border-color-keyboard-focus, var(--stepper-border-color-keyboard-focus)))}:host([invalid]:not([disabled])) #text-field{--luzmo-stepper-border-color: var( --luzmo-stepper-border-color-invalid, var(--stepper-border-color-invalid) );--luzmo-stepper-border-color-hover: var( --luzmo-stepper-border-color-hover-invalid, var(--stepper-border-color-hover-invalid) );--luzmo-stepper-border-color-focus: var( --luzmo-stepper-border-color-focus-invalid, var(--stepper-border-color-focus-invalid) );--luzmo-stepper-border-color-focus-hover: var( --luzmo-stepper-border-color-focus-hover-invalid, var(--stepper-border-color-focus-hover-invalid) );--luzmo-stepper-border-color-keyboard-focus: var( --luzmo-stepper-border-color-keyboard-focus-invalid, var(--stepper-border-color-keyboard-focus-invalid) );--luzmo-infield-button-border-color: var( --luzmo-stepper-border-color-invalid, var(--stepper-border-color-invalid) );--luzmo-text-field-icon-spacing-inline-start-invalid: 0}:host([invalid][focused]:not([disabled])) #text-field,:host([invalid]:not([disabled])) #text-field:focus{--luzmo-infield-button-border-color: var( --luzmo-stepper-border-color-focus-invalid, var(--stepper-border-color-focus-invalid) )}:host([invalid][keyboard-focused]:not([disabled])) #text-field,:host([invalid]:not([disabled])) #text-field:focus-visible{--luzmo-infield-button-border-color: var( --luzmo-stepper-border-color-keyboard-focus-invalid, var(--stepper-border-color-keyboard-focus-invalid) )}:host([disabled]) #text-field{--luzmo-stepper-border-color: var(--stepper-button-border-color-disabled);--luzmo-stepper-border-color-hover: var( --stepper-button-border-color-disabled );--luzmo-stepper-border-color-focus: var( --stepper-button-border-color-disabled );--luzmo-stepper-border-color-focus-hover: var( --stepper-button-border-color-disabled );--luzmo-stepper-border-color-keyboard-focus: var( --stepper-button-border-color-disabled );--luzmo-stepper-buttons-background-color: var( --stepper-buttons-background-color-disabled );--luzmo-infield-button-border-width: var( --stepper-button-border-width-disabled );--luzmo-infield-button-border-color: var( --stepper-button-border-color-disabled );--luzmo-text-field-border-color-disabled: var( --stepper-button-border-color-disabled )}#text-field .input{border-color:var(--highcontrast-stepper-border-color, var(--luzmo-stepper-border-color, var(--stepper-border-color)));border-inline-end-width:0;border-start-end-radius:0;border-end-end-radius:0}#text-field.hide-stepper .input{border-inline-end-width:var(--luzmo-stepper-border-width, var(--stepper-border-width));border-start-end-radius:var(--luzmo-stepper-border-radius, var(--stepper-border-radius));border-end-end-radius:var(--luzmo-stepper-border-radius, var(--stepper-border-radius))}#text-field .buttons{box-sizing:border-box;block-size:var(--luzmo-stepper-height, var(--stepper-height));inline-size:var(--luzmo-stepper-button-width, var(--stepper-button-width));border-color:var(--highcontrast-stepper-border-color, var(--luzmo-stepper-border-color, var(--stepper-border-color)));border-style:var(--luzmo-stepper-buttons-border-style, var(--stepper-buttons-border-style));border-width:var(--highcontrast-stepper-buttons-border-width, var(--luzmo-stepper-buttons-border-width, var(--stepper-buttons-border-width)));background-color:var(--highcontrast-stepper-buttons-background-color, var(--luzmo-stepper-buttons-background-color, var(--stepper-buttons-background-color)));transition:border-color var(--luzmo-stepper-animation-duration, var(--stepper-animation-duration)) ease-in-out;border-inline-start-width:0;border-start-end-radius:var(--luzmo-stepper-border-radius, var(--stepper-border-radius));border-end-end-radius:var(--luzmo-stepper-border-radius, var(--stepper-border-radius));flex-direction:column;justify-content:center;display:flex}:host([quiet]) #text-field{border-start-start-radius:0;border-start-end-radius:0;border-end-end-radius:0;border-end-start-radius:0}:host([quiet]) #text-field .input{--luzmo-text-field-focus-indicator-color: transparent}:host([quiet]) #text-field.hide-stepper .input{border-inline-end-width:0;border-end-end-radius:0}:host([quiet]) #text-field .buttons{--luzmo-infield-button-border-color: transparent;border-width:0;border-block-end-width:var(--luzmo-stepper-border-width, var(--stepper-border-width));border-block-end-color:var(--highcontrast-stepper-border-color, var(--luzmo-stepper-border-color, var(--stepper-border-color)));border-block-end-style:solid;border-end-end-radius:0}:host([quiet]) #text-field .button{--luzmo-infield-button-width-stacked: var( --luzmo-stepper-button-width-quiet, var(--stepper-button-width) );--luzmo-infield-button-border-color: var( --luzmo-stepper-border-color-quiet, var(--stepper-button-border-color-quiet) );--luzmo-infield-button-stacked-bottom-border-block-end-width: var( --luzmo-stepper-border-width, var(--stepper-border-width) );--luzmo-infield-button-stacked-bottom-border-radius-end-end: 0;--luzmo-infield-button-stacked-bottom-border-radius-end-start: 0;--luzmo-infield-button-fill-justify-content: flex-end;padding:0}:host([quiet]) #text-field .buttons,:host([quiet]) #text-field .input{background-color:initial}:host([quiet][focused]) #text-field,:host([quiet]) #text-field:focus{--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-focus, var(--luzmo-stepper-border-color-focus, var(--stepper-border-color-focus)) )}:host([quiet][keyboard-focused]:not([disabled])) #text-field{--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-keyboard-focus, var( --luzmo-stepper-border-color-keyboard-focus, var(--stepper-border-color-keyboard-focus) ) );outline:none}:host([quiet][keyboard-focused]:not([disabled])) #text-field:after{background-color:var(--highcontrast-stepper-focus-indicator-color, var(--luzmo-stepper-focus-indicator-color, var(--stepper-focus-indicator-color)))}@media (hover: hover){:host(:hover:not([disabled])) #text-field{--luzmo-stepper-border-color: var( --highcontrast-stepper-border-color-hover, var(--luzmo-stepper-border-color-hover, var(--stepper-border-color-hover)) );--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-hover, var( --luzmo-stepper-buttons-border-color-hover, var(--stepper-buttons-border-color-hover) ) )}:host([focused]:hover) #text-field,:host(:hover) #text-field:focus{--luzmo-stepper-border-color: var( --highcontrast-stepper-border-color-focus-hover, var( --luzmo-stepper-buttons-border-color-focus-hover, var(--stepper-buttons-border-color-focus-hover) ) );--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-focus-hover, var( --luzmo-stepper-buttons-border-color-focus-hover, var(--stepper-buttons-border-color-focus-hover) ) )}:host([focused]:hover) #text-field .buttons,:host([focused]:hover) #text-field .input,:host(:hover) #text-field:focus .buttons,:host(:hover) #text-field:focus .input{border-color:var(--highcontrast-stepper-border-color-focus-hover, var(--luzmo-stepper-border-color-focus-hover, var(--stepper-border-color-focus-hover)))}:host([invalid]:not([disabled]):hover) #text-field{--luzmo-infield-button-border-color: var( --luzmo-stepper-border-color-hover-invalid, var(--stepper-border-color-hover-invalid) )}:host([invalid][focused]:not([disabled]):hover) #text-field,:host([invalid]:not([disabled]):hover) #text-field:focus{--luzmo-infield-button-border-color: var( --luzmo-stepper-border-color-focus-hover-invalid, var(--stepper-border-color-focus-hover-invalid) )}:host([quiet]:not([disabled]):hover) #text-field{--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-hover, var(--luzmo-stepper-border-color-hover, var(--stepper-border-color-hover)) )}:host([quiet]:not([disabled]):hover) #text-field .buttons{background-color:initial}:host([quiet][focused]:hover) #text-field,:host([quiet]:hover) #text-field:focus{--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-focus-hover, var( --luzmo-stepper-border-color-focus-hover, var(--stepper-border-color-focus-hover) ) )}:host([quiet][keyboard-focused]:not([disabled]):hover) #text-field{--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-hover, var(--luzmo-stepper-border-color-hover, var(--stepper-border-color-hover)) )}}@media (forced-colors: active){:host{--highcontrast-stepper-border-color: CanvasText;--highcontrast-stepper-border-color-hover: Highlight;--highcontrast-stepper-border-color-focus: Highlight;--highcontrast-stepper-border-color-focus-hover: Highlight;--highcontrast-stepper-border-color-keyboard-focus: CanvasText;--highcontrast-stepper-button-background-color-default: Canvas;--highcontrast-stepper-button-background-color-hover: Canvas;--highcontrast-stepper-button-background-color-focus: Canvas;--highcontrast-stepper-button-background-color-keyboard-focus: Canvas;--highcontrast-stepper-focus-indicator-color: Highlight}:host([invalid]) #text-field{--highcontrast-stepper-border-color: Highlight;--highcontrast-stepper-border-color-hover: Highlight;--highcontrast-stepper-border-color-focus: Highlight;--highcontrast-stepper-border-color-focus-hover: Highlight;--highcontrast-stepper-border-color-keyboard-focus: Highlight;--highcontrast-infield-button-border-color: Highlight}:host([disabled]) #text-field{--highcontrast-stepper-border-color: GrayText;--highcontrast-infield-button-border-color: GrayText;--highcontrast-stepper-buttons-border-width: var( --luzmo-stepper-border-width, var(--stepper-border-width) )}}:host{--text-field-minimum-width-multiplier: 1.75;--stepper-border-width: var(--luzmo-border-width);--stepper-border-color: var(--luzmo-border-color);--stepper-border-color-hover: var(--luzmo-border-color-full-hover);--stepper-border-color-focus: var(--luzmo-border-color-full-focus);--stepper-border-color-focus-hover: var(--luzmo-border-color-full-focus);--stepper-border-color-keyboard-focus: var(--luzmo-border-color-full-focus);--stepper-border-radius: var(--luzmo-border-radius-s);--stepper-min-width-multiplier: 1.5;--stepper-animation-duration: var(--luzmo-animation-duration);--stepper-buttons-background-color: var(--luzmo-background-color);--stepper-buttons-border-style: none;--stepper-buttons-border-width: 0;--stepper-buttons-border-color: var(--luzmo-border-color);--stepper-buttons-border-color-hover: var(--luzmo-border-color-full-hover);--stepper-buttons-border-color-focus: var(--luzmo-border-color-full-focus);--stepper-buttons-border-color-keyboard-focus: var( --luzmo-border-color-focus );--stepper-button-padding: 0px;--stepper-button-border-radius-reset: 0;--stepper-button-border-width: var(--luzmo-border-width);--stepper-button-background-color-focus: var(--luzmo-background-color-focus);--stepper-button-background-color-keyboard-focus: var( --luzmo-background-color-focus );--stepper-border-color-invalid: var(--luzmo-color-negative);--stepper-border-color-hover-invalid: var(--luzmo-color-negative-hover);--stepper-border-color-focus-invalid: var(--luzmo-color-negative-focus);--stepper-border-color-focus-hover-invalid: var(--luzmo-color-negative-focus);--stepper-border-color-keyboard-focus-invalid: var( --luzmo-color-negative-focus );--stepper-focus-indicator-width: var(--luzmo-indicator-width);--stepper-focus-indicator-gap: calc(-1 * var(--luzmo-border-width));--stepper-focus-indicator-color: var(--luzmo-indicator-color);--stepper-button-border-color-quiet: transparent;--stepper-button-border-color-disabled: var(--luzmo-border-color-disabled);--stepper-button-border-width-disabled: var(--luzmo-border-width);--stepper-buttons-background-color-disabled: var( --luzmo-background-color-disabled );--stepper-button-width: 28px;--stepper-height: var(--luzmo-component-height)}:host([size=s]) #text-field{--stepper-button-width: 16px;--stepper-height: var(--luzmo-component-height-s)}:host([size=m]) #text-field{--stepper-button-width: 20px;--stepper-height: var(--luzmo-component-height)}:host([size=l]) #text-field{--stepper-button-width: 28px;--stepper-height: var(--luzmo-component-height-l)}:host([size=xl]) #text-field{--stepper-button-width: 36px;--stepper-height: var(--luzmo-component-height-xl)}:host{inline-size:var(--luzmo-stepper-width, var(--stepper-width));--swc-number-field-width: calc( var(--luzmo-stepper-height, var(--stepper-height)) * var( --luzmo-stepper-min-width-multiplier, var(--text-field-minimum-width-multiplier) ) + var(--luzmo-stepper-button-width, var(--stepper-button-width)) + var(--luzmo-stepper-border-width, var(--stepper-border-width)) * 2 );--luzmo-infield-button-border-width: var(--unset-value-resets-inheritance);--stepper-width: var(--swc-number-field-width)}:host([size=s]){--stepper-width: calc(var(--swc-number-field-width) / 5 * 4)}:host([size=l]){--stepper-width: calc(var(--swc-number-field-width) * 1.25)}:host([size=xl]){--stepper-width: calc(var(--swc-number-field-width) * 1.25 * 1.25)}#text-field{inline-size:100%}.input{font-variant-numeric:tabular-nums}:host([readonly]) .buttons{pointer-events:none;visibility:hidden}:host([readonly]:not([disabled],[invalid],[focused],[keyboard-focused])) #text-field:hover .input{border-color:transparent}:host([hide-stepper]:not([quiet])) #text-field input{border:var(--luzmo-text-field-border-width, var(--text-field-border-width)) solid var(--luzmo-text-field-border-color, var(--text-field-border-color));border-radius:var(--text-field-corner-radius)}:host([quiet]) #text-field .button{--luzmo-infield-button-border-color: var( --luzmo-infield-border-color-quiet, transparent );--luzmo-infield-button-edge-to-fill: 0;--luzmo-infield-button-border-width: var( --luzmo-infield-button-border-width-quiet, 0 )}';
302
+ var ce = Object.defineProperty, he = Object.getOwnPropertyDescriptor, c = (s, e, t, r) => {
303
+ for (var o = r > 1 ? void 0 : r ? he(e, t) : e, i = s.length - 1, l; i >= 0; i--)
304
+ (l = s[i]) && (o = (r ? l(e, t, o) : l(o)) || o);
305
+ return r && o && ce(e, t, o), o;
306
+ };
307
+ const me = 5, be = 100, v = "-", I = {
308
+ "1": "1",
309
+ "2": "2",
310
+ "3": "3",
311
+ "4": "4",
312
+ "5": "5",
313
+ "6": "6",
314
+ "7": "7",
315
+ "8": "8",
316
+ "9": "9",
317
+ "0": "0",
318
+ "、": ",",
319
+ ",": ",",
320
+ "。": ".",
321
+ ".": ".",
322
+ "%": "%",
323
+ "+": "+",
324
+ ー: "-",
325
+ 一: "1",
326
+ 二: "2",
327
+ 三: "3",
328
+ 四: "4",
329
+ 五: "5",
330
+ 六: "6",
331
+ 七: "7",
332
+ 八: "8",
333
+ 九: "9",
334
+ 零: "0"
335
+ };
336
+ class p extends oe {
337
+ constructor() {
338
+ super(...arguments), this.focused = !1, this._forcedUnit = "", this.formatOptions = {}, this.hideStepper = !1, this.indeterminate = !1, this.keyboardFocused = !1, this.managedInput = !1, this.stepModifier = 10, this._value = Number.NaN, this._trackingValue = "", this.decimalsChars = /* @__PURE__ */ new Set([".", ","]), this.valueBeforeFocus = "", this.isIntentDecimal = !1, this.changeCount = 0, this.languageResolver = new Z(this), this.wasIndeterminate = !1, this.hasRecentlyReceivedPointerDown = !1, this.applyFocusElementLabel = (e) => {
339
+ this.appliedLabel = e;
340
+ }, this.isComposing = !1;
341
+ }
342
+ static get styles() {
343
+ return [...super.styles, ee(pe)];
344
+ }
345
+ set value(e) {
346
+ const t = this.validateInput(e);
347
+ if (t === this.value)
348
+ return;
349
+ this.lastCommitedValue = t;
350
+ const r = this._value;
351
+ this._value = t, this.requestUpdate("value", r);
352
+ }
353
+ get value() {
354
+ return this._value;
355
+ }
356
+ get inputValue() {
357
+ return this.indeterminate ? this.formattedValue : this.inputElement.value;
358
+ }
359
+ setValue(e = this.value) {
360
+ const t = this.lastCommitedValue;
361
+ this.value = e, !(t === void 0 || t === this.value) && (this.lastCommitedValue = this.value, this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 })));
362
+ }
363
+ /**
364
+ * Retreive the value of the element parsed to a Number.
365
+ */
366
+ get valueAsString() {
367
+ return this._value.toString();
368
+ }
369
+ set valueAsString(e) {
370
+ this.value = this.numberParser.parse(e);
371
+ }
372
+ get formattedValue() {
373
+ return Number.isNaN(this.value) ? "" : this.numberFormatter.format(this.value) + (this.focused ? "" : this._forcedUnit);
374
+ }
375
+ convertValueToNumber(e) {
376
+ let t = [...e].map((i) => I[i] || i).join("");
377
+ const r = [...this.valueBeforeFocus].filter(
378
+ (i) => this.decimalsChars.has(i)
379
+ ), o = new Set(r);
380
+ if (N() && this.inputElement.inputMode === "decimal" && t !== this.valueBeforeFocus) {
381
+ const l = this.numberFormatter.formatToParts(1000.1).find(
382
+ (u) => u.type === "decimal"
383
+ ).value;
384
+ for (const u of o)
385
+ !(u === l) && !this.isIntentDecimal && (t = t.replaceAll(
386
+ new RegExp(u, "g"),
387
+ ""
388
+ ));
389
+ let a = !1;
390
+ const d = [...t];
391
+ for (let u = d.length - 1; u >= 0; u--) {
392
+ const b = d[u];
393
+ this.decimalsChars.has(b) && (a ? d[u] = "" : (d[u] = l, a = !0));
394
+ }
395
+ t = d.join("");
396
+ }
397
+ return this.numberParser.parse(t);
398
+ }
399
+ get _step() {
400
+ var e;
401
+ return this.step !== void 0 ? this.step : ((e = this.formatOptions) == null ? void 0 : e.style) === "percent" ? 0.01 : 1;
402
+ }
403
+ handlePointerdown(e) {
404
+ if (e.button !== 0) {
405
+ e.preventDefault();
406
+ return;
407
+ }
408
+ this.managedInput = !0, this.buttons.setPointerCapture(e.pointerId);
409
+ const t = this.buttons.children[0].getBoundingClientRect(), r = this.buttons.children[1].getBoundingClientRect();
410
+ this.findChange = (o) => {
411
+ o.clientX >= t.x && o.clientY >= t.y && o.clientX <= t.x + t.width && o.clientY <= t.y + t.height ? this.change = (i) => this.increment(i.shiftKey ? this.stepModifier : 1) : o.clientX >= r.x && o.clientY >= r.y && o.clientX <= r.x + r.width && o.clientY <= r.y + r.height && (this.change = (i) => this.decrement(i.shiftKey ? this.stepModifier : 1));
412
+ }, this.findChange(e), this.startChange(e);
413
+ }
414
+ startChange(e) {
415
+ this.changeCount = 0, this.doChange(e), this.safty = setTimeout(() => {
416
+ this.doNextChange(e);
417
+ }, 400);
418
+ }
419
+ doChange(e) {
420
+ this.change(e);
421
+ }
422
+ handlePointermove(e) {
423
+ this.findChange(e);
424
+ }
425
+ handlePointerup(e) {
426
+ this.buttons.releasePointerCapture(e.pointerId), cancelAnimationFrame(this.nextChange), clearTimeout(this.safty), this.managedInput = !1, this.setValue();
427
+ }
428
+ doNextChange(e) {
429
+ return this.changeCount += 1, this.changeCount % me === 0 && this.doChange(e), requestAnimationFrame(() => {
430
+ this.nextChange = this.doNextChange(e);
431
+ });
432
+ }
433
+ stepBy(e) {
434
+ if (this.disabled || this.readonly)
435
+ return;
436
+ const t = this.min === void 0 ? 0 : this.min;
437
+ let r = this.value;
438
+ r += e * this._step, Number.isNaN(this.value) && (r = t), r = this.valueWithLimits(r), this.requestUpdate(), this._value = this.validateInput(r), this.inputElement.value = this.numberFormatter.format(r), this.inputElement.dispatchEvent(
439
+ new Event("input", { bubbles: !0, composed: !0 })
440
+ ), this.indeterminate = !1, this.focus();
441
+ }
442
+ increment(e = 1) {
443
+ this.stepBy(1 * e);
444
+ }
445
+ decrement(e = 1) {
446
+ this.stepBy(-1 * e);
447
+ }
448
+ handleKeydown(e) {
449
+ if (!this.isComposing)
450
+ switch (e.code) {
451
+ case "ArrowUp": {
452
+ e.preventDefault(), this.increment(e.shiftKey ? this.stepModifier : 1), this.setValue();
453
+ break;
454
+ }
455
+ case "ArrowDown": {
456
+ e.preventDefault(), this.decrement(e.shiftKey ? this.stepModifier : 1), this.setValue();
457
+ break;
458
+ }
459
+ }
460
+ }
461
+ onScroll(e) {
462
+ e.preventDefault(), this.managedInput = !0;
463
+ const t = e.shiftKey ? e.deltaX / Math.abs(e.deltaX) : e.deltaY / Math.abs(e.deltaY);
464
+ t !== 0 && !Number.isNaN(t) && (this.stepBy(t * (e.shiftKey ? this.stepModifier : 1)), clearTimeout(this.queuedChangeEvent), this.queuedChangeEvent = setTimeout(() => {
465
+ this.setValue();
466
+ }, be)), this.managedInput = !1;
467
+ }
468
+ onFocus() {
469
+ super.onFocus(), this._trackingValue = this.inputValue, this.keyboardFocused = !this.readonly && !0, this.addEventListener("wheel", this.onScroll, { passive: !1 }), this.valueBeforeFocus = this.inputElement.value;
470
+ }
471
+ onBlur(e) {
472
+ super.onBlur(e), this.keyboardFocused = !this.readonly && !1, this.removeEventListener("wheel", this.onScroll), this.isIntentDecimal = !1;
473
+ }
474
+ handleFocusin() {
475
+ this.focused = !this.readonly && !0, this.keyboardFocused = !this.readonly && !0;
476
+ }
477
+ handleFocusout() {
478
+ this.focused = !this.readonly && !1, this.keyboardFocused = !this.readonly && !1;
479
+ }
480
+ handleChange() {
481
+ const e = this.convertValueToNumber(this.inputValue);
482
+ if (this.wasIndeterminate && (this.wasIndeterminate = !1, this.indeterminateValue = void 0, Number.isNaN(e))) {
483
+ this.indeterminate = !0;
484
+ return;
485
+ }
486
+ this.setValue(e), this.inputElement.value = this.formattedValue;
487
+ }
488
+ handleCompositionStart() {
489
+ this.isComposing = !0;
490
+ }
491
+ handleCompositionEnd() {
492
+ this.isComposing = !1, requestAnimationFrame(() => {
493
+ this.inputElement.dispatchEvent(
494
+ new Event("input", {
495
+ composed: !0,
496
+ bubbles: !0
497
+ })
498
+ );
499
+ });
500
+ }
501
+ handleInputElementPointerdown() {
502
+ this.hasRecentlyReceivedPointerDown = !0, this.updateComplete.then(() => {
503
+ requestAnimationFrame(() => {
504
+ this.hasRecentlyReceivedPointerDown = !1;
505
+ });
506
+ });
507
+ }
508
+ handleInput(e) {
509
+ if (this.isComposing) {
510
+ if (e.data) {
511
+ const d = this.convertValueToNumber(e.data);
512
+ Number.isNaN(d) && (this.inputElement.value = this.indeterminate ? v : this._trackingValue, this.isComposing = !1);
513
+ }
514
+ e.stopPropagation();
515
+ return;
516
+ }
517
+ this.indeterminate && (this.wasIndeterminate = !0, this.indeterminateValue = this.value, this.inputElement.value = this.inputElement.value.replace(
518
+ v,
519
+ ""
520
+ )), e.data && this.decimalsChars.has(e.data) && (this.isIntentDecimal = !0);
521
+ const { value: t, selectionStart: r } = this.inputElement, o = [...t].map((d) => I[d] || d).join("");
522
+ if (this.numberParser.isValidPartialNumber(o)) {
523
+ this.lastCommitedValue = this.lastCommitedValue ?? this.value;
524
+ const d = this.convertValueToNumber(o);
525
+ !o && this.indeterminateValue ? (this.indeterminate = !0, this._value = this.indeterminateValue) : (this.indeterminate = !1, this._value = this.validateInput(d)), this._trackingValue = o, this.inputElement.value = o, this.inputElement.setSelectionRange(r, r);
526
+ return;
527
+ }
528
+ this.inputElement.value = this.indeterminate ? v : this._trackingValue, e.stopPropagation();
529
+ const i = o.length, l = this._trackingValue.length, a = (r || i) - (i - l);
530
+ this.inputElement.setSelectionRange(a, a);
531
+ }
532
+ valueWithLimits(e) {
533
+ let t = e;
534
+ return this.min !== void 0 && (t = Math.max(this.min, t)), this.max !== void 0 && (t = Math.min(this.max, t)), t;
535
+ }
536
+ validateInput(e) {
537
+ e = this.valueWithLimits(e);
538
+ const t = e < 0 ? -1 : 1;
539
+ if (e *= t, this.step) {
540
+ const r = this.min === void 0 ? 0 : this.min, o = Number.parseFloat(
541
+ this.valueFormatter.format((e - r) % this.step)
542
+ );
543
+ if (o === 0 || (Math.round(o / this.step) === 1 ? e += this.step - o : e -= o), this.max !== void 0)
544
+ for (; e > this.max; )
545
+ e -= this.step;
546
+ e = Number.parseFloat(this.valueFormatter.format(e));
547
+ }
548
+ return e *= t, e;
549
+ }
550
+ get displayValue() {
551
+ const e = this.focused ? "" : v;
552
+ return this.indeterminate ? e : this.formattedValue;
553
+ }
554
+ clearNumberFormatterCache() {
555
+ this._numberFormatter = void 0, this._numberParser = void 0;
556
+ }
557
+ get numberFormatter() {
558
+ if (!this._numberFormatter || !this._numberFormatterFocused) {
559
+ const {
560
+ style: e,
561
+ unit: t,
562
+ unitDisplay: r,
563
+ ...o
564
+ } = this.formatOptions;
565
+ e !== "unit" && (o.style = e), this._numberFormatterFocused = new g(
566
+ this.languageResolver.language,
567
+ o
568
+ );
569
+ try {
570
+ this._numberFormatter = new g(
571
+ this.languageResolver.language,
572
+ this.formatOptions
573
+ ), this._forcedUnit = "", this._numberFormatter.format(1);
574
+ } catch {
575
+ e === "unit" && (this._forcedUnit = t), this._numberFormatter = this._numberFormatterFocused;
576
+ }
577
+ }
578
+ return this.focused ? this._numberFormatterFocused : this._numberFormatter;
579
+ }
580
+ clearValueFormatterCache() {
581
+ this._valueFormatter = void 0;
582
+ }
583
+ get valueFormatter() {
584
+ if (!this._valueFormatter) {
585
+ const e = this.step ? this.step === Math.floor(this.step) ? 0 : this.step.toString().split(".")[1].length : 0;
586
+ this._valueFormatter = new g("en", {
587
+ useGrouping: !1,
588
+ maximumFractionDigits: e
589
+ });
590
+ }
591
+ return this._valueFormatter;
592
+ }
593
+ get numberParser() {
594
+ if (!this._numberParser || !this._numberParserFocused) {
595
+ const {
596
+ style: e,
597
+ unit: t,
598
+ unitDisplay: r,
599
+ ...o
600
+ } = this.formatOptions;
601
+ e !== "unit" && (o.style = e), this._numberParserFocused = new $(
602
+ this.languageResolver.language,
603
+ o
604
+ );
605
+ try {
606
+ this._numberParser = new $(
607
+ this.languageResolver.language,
608
+ this.formatOptions
609
+ ), this._forcedUnit = "", this._numberParser.parse("0");
610
+ } catch {
611
+ e === "unit" && (this._forcedUnit = t), this._numberParser = this._numberParserFocused;
612
+ }
613
+ }
614
+ return this.focused ? this._numberParserFocused : this._numberParser;
615
+ }
616
+ renderField() {
617
+ return this.autocomplete = "off", _`
618
+ ${super.renderField()}
619
+ ${this.hideStepper ? te : _`
620
+ <span
621
+ class="buttons"
622
+ @focusin=${this.handleFocusin}
623
+ @focusout=${this.handleFocusout}
624
+ ${J({
625
+ start: ["pointerdown", this.handlePointerdown],
626
+ streamInside: [
627
+ [
628
+ "pointermove",
629
+ "pointerenter",
630
+ "pointerleave",
631
+ "pointerover",
632
+ "pointerout"
633
+ ],
634
+ this.handlePointermove
635
+ ],
636
+ end: [
637
+ ["pointerup", "pointercancel", "pointerleave"],
638
+ this.handlePointerup
639
+ ]
640
+ })}
641
+ >
642
+ <luzmo-infield-button
643
+ inline="end"
644
+ block="start"
645
+ class="button step-up"
646
+ aria-hidden="true"
647
+ label=${"Increase " + this.appliedLabel}
648
+ size=${this.size}
649
+ tabindex="-1"
650
+ ?focused=${this.focused}
651
+ ?disabled=${this.disabled || this.readonly || this.max !== void 0 && this.value === this.max}
652
+ ?quiet=${this.quiet}
653
+ >
654
+ ${C(K)}
655
+ </luzmo-infield-button>
656
+ <luzmo-infield-button
657
+ inline="end"
658
+ block="end"
659
+ class="button step-down"
660
+ aria-hidden="true"
661
+ label=${"Decrease " + this.appliedLabel}
662
+ size=${this.size}
663
+ tabindex="-1"
664
+ ?focused=${this.focused}
665
+ ?disabled=${this.disabled || this.readonly || this.min !== void 0 && this.value === this.min}
666
+ ?quiet=${this.quiet}
667
+ >
668
+ ${C(W)}
669
+ </luzmo-infield-button>
670
+ </span>
671
+ `}
672
+ `;
673
+ }
674
+ update(e) {
675
+ if ((e.has("formatOptions") || e.has("resolvedLanguage")) && this.clearNumberFormatterCache(), e.has("value") || e.has("max") || e.has("min") || e.has("step")) {
676
+ const t = this.numberParser.parse(
677
+ this.formattedValue.replace(this._forcedUnit, "")
678
+ );
679
+ this.value = t, this.clearValueFormatterCache();
680
+ }
681
+ super.update(e);
682
+ }
683
+ willUpdate(e) {
684
+ this.multiline = !1, e.has(Q) && this.clearNumberFormatterCache();
685
+ }
686
+ firstUpdated(e) {
687
+ super.firstUpdated(e), this.addEventListener("keydown", this.handleKeydown), this.addEventListener("compositionstart", this.handleCompositionStart), this.addEventListener("compositionend", this.handleCompositionEnd);
688
+ }
689
+ updated(e) {
690
+ if (!(!this.inputElement || !this.isConnected)) {
691
+ if (e.has("min") || e.has("formatOptions")) {
692
+ const t = this.min !== void 0 && this.min >= 0, { maximumFractionDigits: r } = this.numberFormatter.resolvedOptions(), o = r && r > 0;
693
+ let i = "numeric";
694
+ Y() && !t ? i = "text" : (N() && o || X() && o && t) && (i = "decimal"), this.inputElement.inputMode = i;
695
+ }
696
+ e.has("focused") && this.focused && !this.hasRecentlyReceivedPointerDown && this.formatOptions.unit && this.setSelectionRange(0, this.displayValue.length);
697
+ }
698
+ }
699
+ }
700
+ c([
701
+ re(".buttons")
702
+ ], p.prototype, "buttons", 2);
703
+ c([
704
+ h({ type: Boolean, reflect: !0 })
705
+ ], p.prototype, "focused", 2);
706
+ c([
707
+ h({ type: Object, attribute: "format-options" })
708
+ ], p.prototype, "formatOptions", 2);
709
+ c([
710
+ h({ type: Boolean, reflect: !0, attribute: "hide-stepper" })
711
+ ], p.prototype, "hideStepper", 2);
712
+ c([
713
+ h({ type: Boolean, reflect: !0 })
714
+ ], p.prototype, "indeterminate", 2);
715
+ c([
716
+ h({ type: Boolean, reflect: !0, attribute: "keyboard-focused" })
717
+ ], p.prototype, "keyboardFocused", 2);
718
+ c([
719
+ h({ type: Number })
720
+ ], p.prototype, "max", 2);
721
+ c([
722
+ h({ type: Number })
723
+ ], p.prototype, "min", 2);
724
+ c([
725
+ h({ type: Number })
726
+ ], p.prototype, "step", 2);
727
+ c([
728
+ h({ type: Number, reflect: !0, attribute: "step-modifier" })
729
+ ], p.prototype, "stepModifier", 2);
730
+ c([
731
+ h({ type: Number })
732
+ ], p.prototype, "value", 1);
733
+ customElements.get("luzmo-number-field") || customElements.define("luzmo-number-field", p);
734
+ export {
735
+ p as LuzmoNumberField
736
+ };