numora 3.0.0 → 3.0.1

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.
package/dist/index.mjs CHANGED
@@ -1,195 +1,195 @@
1
- var Q = Object.defineProperty;
2
- var X = (e, t, n) => t in e ? Q(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var $ = (e, t, n) => X(e, typeof t != "symbol" ? t + "" : t, n);
4
- var v = /* @__PURE__ */ ((e) => (e.Blur = "blur", e.Change = "change", e))(v || {}), S = /* @__PURE__ */ ((e) => (e.None = "none", e.Thousand = "thousand", e.Lakh = "lakh", e.Wan = "wan", e))(S || {});
5
- const I = 2, O = 0, R = v.Blur, _ = ",", B = S.None, m = ".", Y = !1, P = !1, W = !1, k = !1;
6
- function A(e) {
1
+ var re = Object.defineProperty;
2
+ var ie = (e, t, n) => t in e ? re(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var v = (e, t, n) => ie(e, typeof t != "symbol" ? t + "" : t, n);
4
+ var $ = /* @__PURE__ */ ((e) => (e.Blur = "blur", e.Change = "change", e))($ || {}), S = /* @__PURE__ */ ((e) => (e.None = "none", e.Thousand = "thousand", e.Lakh = "lakh", e.Wan = "wan", e))(S || {});
5
+ const _ = 2, z = 0, Z = $.Blur, B = ",", W = S.None, N = ".", oe = !1, k = !1, U = !1, G = !1;
6
+ function T(e) {
7
7
  return {
8
- decimalSeparator: (e == null ? void 0 : e.decimalSeparator) ?? m,
8
+ decimalSeparator: (e == null ? void 0 : e.decimalSeparator) ?? N,
9
9
  thousandSeparator: e == null ? void 0 : e.thousandSeparator
10
10
  };
11
11
  }
12
- function U(e, t) {
13
- const n = e.startsWith("-"), r = n ? e.slice(1) : e, [s = "", i = ""] = r.split(t);
12
+ function K(e, t) {
13
+ const n = e.startsWith("-"), s = n ? e.slice(1) : e, [o = "", r = ""] = s.split(t);
14
14
  return {
15
15
  sign: n ? "-" : "",
16
- integer: s,
17
- decimal: i
16
+ integer: o,
17
+ decimal: r
18
18
  };
19
19
  }
20
- function V(e, t) {
20
+ function ae(e, t) {
21
21
  if (!e.value.includes(t)) return !1;
22
- const { selectionStart: n, selectionEnd: r, value: s } = e;
23
- return !s.slice(n ?? 0, r ?? 0).includes(t);
22
+ const { selectionStart: n, selectionEnd: s, value: o } = e;
23
+ return !o.slice(n ?? 0, s ?? 0).includes(t);
24
24
  }
25
- function F(e, t, n, r) {
25
+ function ce(e, t, n) {
26
26
  const { key: s } = e;
27
27
  if (s !== "," && s !== ".") return !1;
28
- if (V(t, r))
28
+ if (ae(t, n))
29
29
  return !0;
30
- if (s !== r) {
31
- const { selectionStart: i, selectionEnd: a, value: o } = t, c = i ?? 0, l = a ?? c;
32
- t.value = o.slice(0, c) + r + o.slice(l);
33
- const h = c + 1;
34
- return t.setSelectionRange(h, h), !0;
30
+ if (s !== n) {
31
+ const { selectionStart: o, selectionEnd: r, value: i } = t, a = o ?? 0, c = r ?? a;
32
+ t.value = i.slice(0, a) + n + i.slice(c);
33
+ const l = a + 1;
34
+ return t.setSelectionRange(l, l), !0;
35
35
  }
36
36
  return !1;
37
37
  }
38
- const ee = (e, t, n = m) => {
39
- const { sign: r, integer: s, decimal: i } = U(e, n);
38
+ const le = (e, t, n = N) => {
39
+ const { sign: s, integer: o, decimal: r } = K(e, n);
40
40
  if (!e.includes(n)) return e;
41
- const o = i.slice(0, t);
42
- return `${r}${s}${n}${o}`;
43
- }, te = (e, t = m) => {
41
+ const a = r.slice(0, t);
42
+ return `${s}${o}${n}${a}`;
43
+ }, he = (e, t = N) => {
44
44
  const n = e.indexOf(t);
45
45
  if (n === -1) return e;
46
- const r = e.slice(0, n + 1), i = e.slice(n + 1).split(",").join("").split(".").join("").split(t).join("");
47
- return r + i;
48
- }, ne = (e, t = 0, n = m) => {
46
+ const s = e.slice(0, n + 1), r = e.slice(n + 1).split(",").join("").split(".").join("").split(t).join("");
47
+ return s + r;
48
+ }, ue = (e, t = 0, n = N) => {
49
49
  if (t <= 0) return e;
50
- const { sign: r, integer: s, decimal: i } = U(e, n);
51
- if (i.length >= t)
52
- return e.includes(n) ? e : `${r}${s}${n}${i}`;
53
- const a = i.padEnd(t, "0");
54
- return `${r}${s}${n}${a}`;
55
- }, N = {
50
+ const { sign: s, integer: o, decimal: r } = K(e, n);
51
+ if (r.length >= t)
52
+ return e.includes(n) ? e : `${s}${o}${n}${r}`;
53
+ const i = r.padEnd(t, "0");
54
+ return `${s}${o}${n}${i}`;
55
+ }, L = {
56
56
  thousand: { size: 3 },
57
57
  lakh: { firstGroup: 3, restGroup: 2 },
58
58
  wan: { size: 4 }
59
59
  };
60
- function j(e, t, n = S.Thousand, r = !1, s = ".") {
61
- if (!e || e === "0" || e === s || e === "-" || e === `-${s}`)
60
+ function y(e, t, n = S.Thousand, s = !1, o = ".") {
61
+ if (!e || e === "0" || e === o || e === "-" || e === `-${o}`)
62
62
  return e;
63
- const i = e.includes(s), a = e.startsWith("-"), o = a ? e.slice(1) : e, [c, l] = o.split(s);
63
+ const r = e.includes(o), i = e.startsWith("-"), a = i ? e.slice(1) : e, [c, l] = a.split(o);
64
64
  if (!c) {
65
- const u = l ? `${s}${l}` : o;
66
- return a ? `-${u}` : u;
65
+ const f = l ? `${o}${l}` : a;
66
+ return i ? `-${f}` : f;
67
67
  }
68
- if (r && c.startsWith("0") && c.length > 1) {
69
- const u = c.match(/^(0+)/);
70
- if (u) {
71
- const g = u[1], f = c.slice(g.length);
72
- if (f) {
73
- const p = Z(f, t, n), E = g + p, w = a ? "-" : "";
74
- return i ? l ? `${w}${E}${s}${l}` : `${w}${E}${s}` : `${w}${E}`;
68
+ if (s && c.startsWith("0") && c.length > 1) {
69
+ const f = c.match(/^(0+)/);
70
+ if (f) {
71
+ const d = f[1], g = c.slice(d.length);
72
+ if (g) {
73
+ const p = j(g, t, n), m = d + p, D = i ? "-" : "";
74
+ return r ? l ? `${D}${m}${o}${l}` : `${D}${m}${o}` : `${D}${m}`;
75
75
  }
76
76
  }
77
77
  }
78
- const h = Z(c, t, n), d = a ? "-" : "";
79
- return i ? l ? `${d}${h}${s}${l}` : `${d}${h}${s}` : `${d}${h}`;
78
+ const h = j(c, t, n), u = i ? "-" : "";
79
+ return r ? l ? `${u}${h}${o}${l}` : `${u}${h}${o}` : `${u}${h}`;
80
80
  }
81
- function Z(e, t, n) {
81
+ function j(e, t, n) {
82
82
  if (e === "0" || e === "")
83
83
  return e;
84
84
  switch (n) {
85
85
  case S.None:
86
86
  return e;
87
87
  case S.Thousand:
88
- return re(e, t);
88
+ return fe(e, t);
89
89
  case S.Lakh:
90
- return ie(e, t);
90
+ return de(e, t);
91
91
  case S.Wan:
92
- return se(e, t);
92
+ return ge(e, t);
93
93
  default:
94
94
  return e;
95
95
  }
96
96
  }
97
- function re(e, t) {
98
- return z(e, t, N.thousand.size);
97
+ function fe(e, t) {
98
+ return q(e, t, L.thousand.size);
99
99
  }
100
- function ie(e, t) {
101
- if (e.length <= N.lakh.firstGroup)
100
+ function de(e, t) {
101
+ if (e.length <= L.lakh.firstGroup)
102
102
  return e;
103
- const n = e.split("").reverse(), r = [], s = n.slice(0, N.lakh.firstGroup).reverse().join("");
104
- r.push(s);
105
- for (let i = N.lakh.firstGroup; i < n.length; i += N.lakh.restGroup)
106
- r.push(n.slice(i, i + N.lakh.restGroup).reverse().join(""));
107
- return r.reverse().join(t);
108
- }
109
- function se(e, t) {
110
- return z(e, t, N.wan.size);
111
- }
112
- function z(e, t, n) {
113
- const r = e.split("").reverse(), s = [];
114
- for (let i = 0; i < r.length; i += n)
115
- s.push(r.slice(i, i + n).reverse().join(""));
103
+ const n = e.split("").reverse(), s = [], o = n.slice(0, L.lakh.firstGroup).reverse().join("");
104
+ s.push(o);
105
+ for (let r = L.lakh.firstGroup; r < n.length; r += L.lakh.restGroup)
106
+ s.push(n.slice(r, r + L.lakh.restGroup).reverse().join(""));
116
107
  return s.reverse().join(t);
117
108
  }
118
- function ae(e, t, n) {
119
- return (t == null ? void 0 : t.formatOn) === "change" && t.thousandSeparator ? j(
109
+ function ge(e, t) {
110
+ return q(e, t, L.wan.size);
111
+ }
112
+ function q(e, t, n) {
113
+ const s = e.split("").reverse(), o = [];
114
+ for (let r = 0; r < s.length; r += n)
115
+ o.push(s.slice(r, r + n).reverse().join(""));
116
+ return o.reverse().join(t);
117
+ }
118
+ function pe(e, t, n) {
119
+ return (t == null ? void 0 : t.formatOn) === $.Change && t.thousandSeparator ? y(
120
120
  e,
121
121
  t.thousandSeparator,
122
122
  t.ThousandStyle ?? S.None,
123
123
  t.enableLeadingZeros,
124
- (n == null ? void 0 : n.decimalSeparator) ?? m
124
+ (n == null ? void 0 : n.decimalSeparator) ?? N
125
125
  ) : e;
126
126
  }
127
- function b(e, t, n, r = ".") {
128
- let s = 0;
129
- for (let i = 0; i < t && i < e.length; i++)
130
- e[i] !== n && s++;
131
- return s;
127
+ function b(e, t, n, s = ".") {
128
+ let o = 0;
129
+ for (let r = 0; r < t && r < e.length; r++)
130
+ e[r] !== n && o++;
131
+ return o;
132
132
  }
133
- function oe(e, t, n, r = ".") {
133
+ function Se(e, t, n, s = ".") {
134
134
  if (t === 0)
135
135
  return 0;
136
- let s = 0;
137
- for (let i = 0; i < e.length; i++)
138
- if (e[i] !== n) {
139
- if (s === t - 1)
140
- return i + 1;
141
- s++;
136
+ let o = 0;
137
+ for (let r = 0; r < e.length; r++)
138
+ if (e[r] !== n) {
139
+ if (o === t - 1)
140
+ return r + 1;
141
+ o++;
142
142
  }
143
143
  return e.length;
144
144
  }
145
- function C(e, t, n, r = ".") {
145
+ function A(e, t, n, s = ".") {
146
146
  if (t === 0)
147
147
  return 0;
148
- let s = 0;
149
- for (let i = 0; i < e.length; i++)
150
- if (e[i] !== n) {
151
- if (s++, s === t)
152
- return i + 1;
153
- if (s > t)
154
- return i;
148
+ let o = 0;
149
+ for (let r = 0; r < e.length; r++)
150
+ if (e[r] !== n) {
151
+ if (o++, o === t)
152
+ return r + 1;
153
+ if (o > t)
154
+ return r;
155
155
  }
156
156
  return e.length;
157
157
  }
158
- function J(e, t, n) {
158
+ function Q(e, t, n) {
159
159
  return t < 0 || t >= e.length ? !1 : e[t] === n;
160
160
  }
161
- function ce(e, t = {}) {
161
+ function me(e, t = {}) {
162
162
  const {
163
163
  thousandSeparator: n,
164
- decimalSeparator: r = ".",
165
- prefix: s = "",
166
- suffix: i = ""
167
- } = t, a = Array.from({ length: e.length + 1 }).map(() => !0);
168
- if (s && a.fill(!1, 0, s.length), i) {
169
- const o = e.length - i.length;
170
- a.fill(!1, o + 1, e.length + 1);
164
+ decimalSeparator: s = ".",
165
+ prefix: o = "",
166
+ suffix: r = ""
167
+ } = t, i = Array.from({ length: e.length + 1 }).map(() => !0);
168
+ if (o && i.fill(!1, 0, o.length), r) {
169
+ const a = e.length - r.length;
170
+ i.fill(!1, a + 1, e.length + 1);
171
171
  }
172
- for (let o = 0; o < e.length; o++) {
173
- const c = e[o];
174
- (n && c === n || c === r) && (a[o] = !1, o + 1 < e.length && !/\d/.test(e[o + 1]) && (a[o + 1] = !1));
172
+ for (let a = 0; a < e.length; a++) {
173
+ const c = e[a];
174
+ (n && c === n || c === s) && (i[a] = !1, a + 1 < e.length && !/\d/.test(e[a + 1]) && (i[a + 1] = !1));
175
175
  }
176
- return a.some((o) => o) || a.fill(!0), a;
176
+ return i.some((a) => a) || i.fill(!0), i;
177
177
  }
178
- function T(e, t, n, r) {
179
- const s = e.length;
180
- if (t = Math.max(0, Math.min(t, s)), !n[t]) {
178
+ function I(e, t, n, s) {
179
+ const o = e.length;
180
+ if (t = Math.max(0, Math.min(t, o)), !n[t]) {
181
+ let r = t;
182
+ for (; r <= o && !n[r]; )
183
+ r++;
181
184
  let i = t;
182
- for (; i <= s && !n[i]; )
183
- i++;
184
- let a = t;
185
- for (; a >= 0 && !n[a]; )
186
- a--;
187
- i <= s && a >= 0 ? t = t - a < i - t ? a : i : i <= s ? t = i : a >= 0 && (t = a);
185
+ for (; i >= 0 && !n[i]; )
186
+ i--;
187
+ r <= o && i >= 0 ? t = t - i < r - t ? i : r : r <= o ? t = r : i >= 0 && (t = i);
188
188
  }
189
- return (t === -1 || t > s) && (t = s), t;
189
+ return (t === -1 || t > o) && (t = o), t;
190
190
  }
191
- const K = (e, t) => e === t;
192
- function le(e, t, n, r, s, i, a = ".", o = {}) {
191
+ const H = (e, t) => e === t;
192
+ function $e(e, t, n, s, o, r, i = ".", a = {}) {
193
193
  if (n < 0)
194
194
  return 0;
195
195
  if (n > e.length || e === "" || t === "")
@@ -197,285 +197,285 @@ function le(e, t, n, r, s, i, a = ".", o = {}) {
197
197
  const c = /(\d+\.?\d*)\s*[kmbMTOQaqiSxsxSpOoNn]$/i;
198
198
  if (c.test(e) && !c.test(t) && t.length > e.length && n >= e.length - 1)
199
199
  return t.length;
200
- const l = t.length < e.length, h = J(
200
+ const l = t.length < e.length, h = Q(
201
201
  e,
202
202
  n,
203
- r
204
- ), d = e.indexOf(a), u = t.indexOf(a);
205
- if (o.isCharacterEquivalent && e !== t) {
206
- const p = he(
203
+ s
204
+ ), u = e.indexOf(i), f = t.indexOf(i);
205
+ if (a.isCharacterEquivalent && e !== t) {
206
+ const p = be(
207
207
  e,
208
208
  t,
209
209
  n,
210
- o.isCharacterEquivalent || K,
211
- i,
212
- o
210
+ a.isCharacterEquivalent || H,
211
+ r,
212
+ a
213
213
  );
214
214
  if (p !== void 0)
215
215
  return p;
216
216
  }
217
217
  if (l)
218
- return ue(
218
+ return Ne(
219
219
  e,
220
220
  t,
221
221
  n,
222
- r,
222
+ s,
223
223
  h,
224
- d,
225
224
  u,
225
+ f,
226
+ r,
226
227
  i,
227
- a,
228
- o
228
+ a
229
229
  );
230
- const f = pe(
230
+ const g = ve(
231
231
  e,
232
232
  t,
233
233
  n,
234
- r,
234
+ s,
235
235
  h,
236
- a
236
+ i
237
237
  );
238
- return o.boundary ? T(t, f, o.boundary) : f;
238
+ return a.boundary ? I(t, g, a.boundary) : g;
239
239
  }
240
- function he(e, t, n, r, s, i) {
241
- const a = e.length, o = t.length, c = {}, l = new Array(a);
242
- for (let f = 0; f < a; f++) {
243
- l[f] = -1;
244
- for (let p = 0; p < o; p++) {
240
+ function be(e, t, n, s, o, r) {
241
+ const i = e.length, a = t.length, c = {}, l = new Array(i);
242
+ for (let g = 0; g < i; g++) {
243
+ l[g] = -1;
244
+ for (let p = 0; p < a; p++) {
245
245
  if (c[p]) continue;
246
- if (r(
247
- e[f],
246
+ if (s(
247
+ e[g],
248
248
  t[p],
249
249
  {
250
250
  oldValue: e,
251
251
  newValue: t,
252
- typedRange: s,
253
- oldIndex: f,
252
+ typedRange: o,
253
+ oldIndex: g,
254
254
  newIndex: p
255
255
  }
256
256
  )) {
257
- l[f] = p, c[p] = !0;
257
+ l[g] = p, c[p] = !0;
258
258
  break;
259
259
  }
260
260
  }
261
261
  }
262
262
  let h = n;
263
- for (; h < a && (l[h] === -1 || !/\d/.test(e[h])); )
263
+ for (; h < i && (l[h] === -1 || !/\d/.test(e[h])); )
264
264
  h++;
265
- const d = h === a || l[h] === -1 ? o : l[h];
265
+ const u = h === i || l[h] === -1 ? a : l[h];
266
266
  for (h = n - 1; h >= 0 && l[h] === -1; ) h--;
267
- const u = h === -1 || l[h] === -1 ? 0 : l[h] + 1;
268
- if (u > d) return d;
269
- const g = n - u < d - n ? u : d;
270
- return i.boundary ? T(t, g, i.boundary) : g;
271
- }
272
- function ue(e, t, n, r, s, i, a, o, c, l = {}) {
273
- if (s)
274
- return de(
267
+ const f = h === -1 || l[h] === -1 ? 0 : l[h] + 1;
268
+ if (f > u) return u;
269
+ const d = n - f < u - n ? f : u;
270
+ return r.boundary ? I(t, d, r.boundary) : d;
271
+ }
272
+ function Ne(e, t, n, s, o, r, i, a, c, l = {}) {
273
+ if (o)
274
+ return De(
275
275
  e,
276
276
  t,
277
277
  n,
278
- r,
279
- a,
278
+ s,
279
+ i,
280
280
  c
281
281
  );
282
282
  const h = b(
283
283
  e,
284
284
  n,
285
- r,
285
+ s,
286
286
  c
287
- ), d = b(
287
+ ), u = b(
288
288
  e,
289
289
  e.length,
290
- r,
290
+ s,
291
291
  c
292
- ), u = b(
292
+ ), f = b(
293
293
  t,
294
294
  t.length,
295
- r,
295
+ s,
296
296
  c
297
- ), g = d - u, f = fe(
297
+ ), d = u - f, g = Ee(
298
298
  e,
299
299
  n,
300
- r,
300
+ s,
301
301
  h,
302
- g,
303
- i,
304
- o,
302
+ d,
303
+ r,
304
+ a,
305
305
  c
306
- ), p = i === -1 || n <= i, E = ge(
306
+ ), p = r === -1 || n <= r, m = Le(
307
307
  t,
308
- f,
309
- r,
310
308
  g,
311
- o,
309
+ s,
310
+ d,
311
+ a,
312
312
  c,
313
313
  p,
314
- a
314
+ i
315
315
  );
316
- return l.boundary ? T(t, E, l.boundary) : E;
316
+ return l.boundary ? I(t, m, l.boundary) : m;
317
317
  }
318
- function de(e, t, n, r, s, i) {
319
- const a = n + 1;
320
- if (a < e.length) {
321
- const o = b(
318
+ function De(e, t, n, s, o, r) {
319
+ const i = n + 1;
320
+ if (i < e.length) {
321
+ const a = b(
322
322
  e,
323
- a,
324
- r,
325
- i
326
- ), c = oe(
323
+ i,
324
+ s,
325
+ r
326
+ ), c = Se(
327
327
  t,
328
- o,
329
- r,
330
- i
328
+ a,
329
+ s,
330
+ r
331
331
  );
332
- return c < t.length && t[c] !== r ? c + 1 : c;
332
+ return c < t.length && t[c] !== s ? c + 1 : c;
333
333
  }
334
334
  return n;
335
335
  }
336
- function fe(e, t, n, r, s, i, a, o) {
337
- if (a) {
338
- const { start: l, isDelete: h } = a;
336
+ function Ee(e, t, n, s, o, r, i, a) {
337
+ if (i) {
338
+ const { start: l, isDelete: h } = i;
339
339
  return h ? b(
340
340
  e,
341
341
  l,
342
342
  n,
343
- o
343
+ a
344
344
  ) : Math.max(0, b(
345
345
  e,
346
346
  l,
347
347
  n,
348
- o
348
+ a
349
349
  ));
350
350
  }
351
- return t > 0 && e[t - 1] === n && s > 0 ? r + 1 : r;
351
+ return t > 0 && e[t - 1] === n && o > 0 ? s + 1 : s;
352
352
  }
353
- function ge(e, t, n, r, s, i, a, o) {
354
- if (a && o !== -1) {
355
- const l = e.substring(0, o), h = b(
353
+ function Le(e, t, n, s, o, r, i, a) {
354
+ if (i && a !== -1) {
355
+ const l = e.substring(0, a), h = b(
356
356
  l,
357
357
  l.length,
358
358
  n,
359
- i
359
+ r
360
360
  );
361
361
  if (t <= h) {
362
- const d = C(
362
+ const u = A(
363
363
  l,
364
364
  t,
365
365
  n,
366
- i
366
+ r
367
367
  );
368
- if (d > 0 && d < l.length && b(
368
+ if (u > 0 && u < l.length && b(
369
369
  l,
370
- d,
370
+ u,
371
371
  n,
372
- i
372
+ r
373
373
  ) === t) {
374
- if (l[d] === n && s && r > 0 && d < l.length - 1)
375
- return d + 1;
376
- if (!s && r > 0 && d < l.length - 1)
377
- return Math.min(d + 1, l.length);
374
+ if (l[u] === n && o && s > 0 && u < l.length - 1)
375
+ return u + 1;
376
+ if (!o && s > 0 && u < l.length - 1)
377
+ return Math.min(u + 1, l.length);
378
378
  }
379
- return d;
379
+ return u;
380
380
  }
381
381
  }
382
- const c = C(
382
+ const c = A(
383
383
  e,
384
384
  t,
385
385
  n,
386
- i
386
+ r
387
387
  );
388
388
  if (c > 0 && c < e.length && b(
389
389
  e,
390
390
  c,
391
391
  n,
392
- i
392
+ r
393
393
  ) === t) {
394
- if (e[c] === n && s && r > 0 && c < e.length - 1)
394
+ if (e[c] === n && o && s > 0 && c < e.length - 1)
395
395
  return c + 1;
396
- if (!s && r > 0 && c < e.length - 1)
396
+ if (!o && s > 0 && c < e.length - 1)
397
397
  return Math.min(c + 1, e.length);
398
398
  }
399
399
  return c;
400
400
  }
401
- function pe(e, t, n, r, s, i) {
402
- const a = n >= e.length, o = b(
401
+ function ve(e, t, n, s, o, r) {
402
+ const i = n >= e.length, a = b(
403
403
  e,
404
404
  n,
405
- r,
406
- i
405
+ s,
406
+ r
407
407
  ), c = b(
408
408
  e,
409
409
  e.length,
410
- r,
411
- i
410
+ s,
411
+ r
412
412
  ), l = b(
413
413
  t,
414
414
  t.length,
415
- r,
416
- i
415
+ s,
416
+ r
417
417
  );
418
- if (a || o === c)
418
+ if (i || a === c)
419
419
  return t.length;
420
420
  const h = l - c;
421
- let d = o;
422
- h > 0 && !a && o < c && (d = o + 1);
423
- const u = C(
421
+ let u = a;
422
+ h > 0 && !i && a < c && (u = a + 1);
423
+ const f = A(
424
424
  t,
425
- d,
426
- r,
427
- i
425
+ u,
426
+ s,
427
+ r
428
428
  );
429
- return s && !J(t, u, r) ? Math.max(0, u - 1) : u;
429
+ return o && !Q(t, f, s) ? Math.max(0, f - 1) : f;
430
430
  }
431
- function Se(e, t, n) {
432
- const { selectionStart: r, selectionEnd: s, endOffset: i = 0 } = e;
433
- if (r !== s) {
434
- const h = s - r;
431
+ function we(e, t, n) {
432
+ const { selectionStart: s, selectionEnd: o, endOffset: r = 0 } = e;
433
+ if (s !== o) {
434
+ const h = o - s;
435
435
  return {
436
- start: r,
437
- end: s,
436
+ start: s,
437
+ end: o,
438
438
  deletedLength: h,
439
439
  isDelete: !1
440
440
  };
441
441
  }
442
- if (i > 0) {
443
- const h = i;
442
+ if (r > 0) {
443
+ const h = r;
444
444
  return {
445
- start: r,
446
- end: r + h,
445
+ start: s,
446
+ end: s + h,
447
447
  deletedLength: h,
448
448
  isDelete: !0
449
449
  };
450
450
  }
451
- const o = t.length, c = n.length, l = o - c;
451
+ const a = t.length, c = n.length, l = a - c;
452
452
  if (!(l <= 0))
453
453
  return {
454
- start: r,
455
- end: r + l,
454
+ start: s,
455
+ end: s + l,
456
456
  deletedLength: l,
457
457
  isDelete: !1
458
458
  };
459
459
  }
460
- function be(e, t) {
460
+ function ye(e, t) {
461
461
  if (e === t)
462
462
  return;
463
463
  let n = 0;
464
464
  for (; n < e.length && n < t.length && e[n] === t[n]; )
465
465
  n++;
466
- let r = e.length - 1, s = t.length - 1;
467
- for (; r >= n && s >= n && e[r] === t[s]; )
468
- r--, s--;
469
- const i = r - n + 1, a = s - n + 1;
470
- if (!(i === 0 && a === 0))
466
+ let s = e.length - 1, o = t.length - 1;
467
+ for (; s >= n && o >= n && e[s] === t[o]; )
468
+ s--, o--;
469
+ const r = s - n + 1, i = o - n + 1;
470
+ if (!(r === 0 && i === 0))
471
471
  return {
472
472
  start: n,
473
- end: r + 1,
474
- deletedLength: i,
475
- isDelete: i > a
473
+ end: s + 1,
474
+ deletedLength: r,
475
+ isDelete: r > i
476
476
  };
477
477
  }
478
- function G(e, t) {
478
+ function J(e, t) {
479
479
  if (e.value = e.value, e === null)
480
480
  return !1;
481
481
  if (e.createTextRange) {
@@ -484,114 +484,348 @@ function G(e, t) {
484
484
  }
485
485
  return e.selectionStart !== null || e.selectionStart === 0 ? (e.focus(), e.setSelectionRange(t, t), !0) : (e.focus(), !1);
486
486
  }
487
- function ve(e, t, n) {
488
- return e.selectionStart === 0 && e.selectionEnd === e.value.length ? null : (G(e, t), setTimeout(() => {
489
- e.value === n && e.selectionStart !== t && G(e, t);
487
+ function Me(e, t, n) {
488
+ return e.selectionStart === 0 && e.selectionEnd === e.value.length ? null : (J(e, t), setTimeout(() => {
489
+ e.value === n && e.selectionStart !== t && J(e, t);
490
490
  }, 0));
491
491
  }
492
- function Ee(e) {
492
+ function xe(e) {
493
493
  return Math.max(e.selectionStart, e.selectionEnd);
494
494
  }
495
- function me(e, t, n) {
496
- if ((n == null ? void 0 : n.formatOn) !== v.Change || !n.thousandSeparator)
495
+ function Ce(e, t, n) {
496
+ if ((n == null ? void 0 : n.formatOn) !== $.Change || !n.thousandSeparator)
497
497
  return;
498
- const { selectionStart: r, selectionEnd: s, value: i } = t;
499
- if (r === null || s === null || r !== s)
498
+ const { selectionStart: s, selectionEnd: o, value: r } = t;
499
+ if (s === null || o === null || s !== o)
500
500
  return;
501
- const { key: a } = e, o = n.thousandSeparator;
502
- a === "Backspace" && r > 0 && i[r - 1] === o && t.setSelectionRange(r - 1, r - 1), a === "Delete" && i[r] === o && t.setSelectionRange(r + 1, r + 1);
503
- }
504
- function Ne(e, t, n, r, s, i, a) {
505
- if (!s) return;
506
- const { selectionStart: o = 0, selectionEnd: c = 0, endOffset: l = 0 } = s;
507
- let h = Se(
508
- { selectionStart: o, selectionEnd: c, endOffset: l },
501
+ const { key: i } = e, a = n.thousandSeparator;
502
+ i === "Backspace" && s > 0 && r[s - 1] === a && t.setSelectionRange(s - 1, s - 1), i === "Delete" && r[s] === a && t.setSelectionRange(s + 1, s + 1);
503
+ }
504
+ function Ae(e, t, n, s, o, r, i) {
505
+ if (!o) return;
506
+ const { selectionStart: a = 0, selectionEnd: c = 0, endOffset: l = 0 } = o;
507
+ let h = we(
508
+ { selectionStart: a, selectionEnd: c, endOffset: l },
509
509
  t,
510
510
  n
511
511
  );
512
- if (h || (h = be(t, n)), !h) return;
513
- const d = ce(n, {
514
- thousandSeparator: (a == null ? void 0 : a.thousandSeparator) ?? i.thousandSeparator,
515
- decimalSeparator: i.decimalSeparator
516
- }), u = {
517
- thousandSeparator: (a == null ? void 0 : a.thousandSeparator) ?? i.thousandSeparator,
518
- isCharacterEquivalent: K,
519
- boundary: d
520
- }, g = (a == null ? void 0 : a.thousandSeparator) ?? i.thousandSeparator ?? ",", f = (a == null ? void 0 : a.ThousandStyle) ?? S.None, p = le(
512
+ if (h || (h = ye(t, n)), !h) return;
513
+ const u = me(n, {
514
+ thousandSeparator: (i == null ? void 0 : i.thousandSeparator) ?? r.thousandSeparator,
515
+ decimalSeparator: r.decimalSeparator
516
+ }), f = {
517
+ thousandSeparator: (i == null ? void 0 : i.thousandSeparator) ?? r.thousandSeparator,
518
+ isCharacterEquivalent: H,
519
+ boundary: u
520
+ }, d = (i == null ? void 0 : i.thousandSeparator) ?? r.thousandSeparator ?? ",", g = (i == null ? void 0 : i.ThousandStyle) ?? S.None, p = $e(
521
521
  t,
522
522
  n,
523
- r,
523
+ s,
524
+ d,
524
525
  g,
526
+ h,
527
+ r.decimalSeparator,
528
+ f
529
+ );
530
+ Me(e, p, n);
531
+ }
532
+ function V(e) {
533
+ const [t, n = ""] = e.split(".");
534
+ return t.length + n.length > 30;
535
+ }
536
+ function X(e, t) {
537
+ const n = e.replace(".", ""), s = t.replace(".", ""), o = Math.max(n.length, s.length), r = n.padStart(o, "0"), i = s.padStart(o, "0");
538
+ for (let a = 0; a < o; a++) {
539
+ const c = parseInt(r[a], 10), l = parseInt(i[a], 10);
540
+ if (c !== l)
541
+ return c - l;
542
+ }
543
+ return 0;
544
+ }
545
+ const Te = [
546
+ { suffix: "N", zeros: 30 },
547
+ // Nonillion
548
+ { suffix: "O", zeros: 27 },
549
+ // Octillion
550
+ { suffix: "Sp", zeros: 24 },
551
+ // Septillion
552
+ { suffix: "Sx", zeros: 21 },
553
+ // Sextillion
554
+ { suffix: "Qi", zeros: 18 },
555
+ // Quintillion
556
+ { suffix: "Qa", zeros: 15 },
557
+ // Quadrillion
558
+ { suffix: "T", zeros: 12 },
559
+ // Trillion
560
+ { suffix: "B", zeros: 9 },
561
+ // Billion
562
+ { suffix: "M", zeros: 6 },
563
+ // Million
564
+ { suffix: "k", zeros: 3 }
565
+ // Thousand
566
+ ];
567
+ function Y(e, t, n = 0) {
568
+ const [s, o = ""] = e.split(t), r = s.replace(/^0+/, "") || "0";
569
+ for (const i of Te)
570
+ if (i.zeros >= n && (r.length > i.zeros || r.length === i.zeros && o.length > 0)) {
571
+ const a = i.zeros;
572
+ if (r.length > a) {
573
+ const c = r.slice(0, -a), u = (r.slice(-a) + o).replace(/0+$/, "");
574
+ return { scaledValue: u ? `${c}${t}${u}` : c, scaleSuffix: i.suffix };
575
+ } else {
576
+ const c = a - r.length, l = "0", u = ("0".repeat(c) + r + o).replace(/0+$/, "");
577
+ return { scaledValue: u ? `${l}${t}${u}` : l, scaleSuffix: i.suffix };
578
+ }
579
+ }
580
+ return { scaledValue: e, scaleSuffix: "" };
581
+ }
582
+ function P(e, t, n, s, o = !1, r = !1) {
583
+ if (r && o && n > 0)
584
+ return `0${s}${"0".repeat(n)}`;
585
+ const [i, a = ""] = e.split(s);
586
+ let c;
587
+ if (t === 0)
588
+ c = i;
589
+ else if (a.length === 0) {
590
+ const l = "0".repeat(Math.max(t, n));
591
+ c = `${i}${s}${l}`;
592
+ } else if (a.length < t) {
593
+ const l = Math.max(t - a.length, n - a.length);
594
+ c = `${i}${s}${a}${"0".repeat(l)}`;
595
+ } else
596
+ c = `${i}${s}${a.slice(0, t)}`;
597
+ if (n > 0) {
598
+ const [l, h = ""] = c.split(s);
599
+ if (h.length < n) {
600
+ const u = n - h.length;
601
+ c = `${l}${s}${h}${"0".repeat(u)}`;
602
+ }
603
+ }
604
+ if (n === 0)
605
+ c = c.replace(/(\.[0-9]*?)0+$/, "$1").replace(/\.$/, "");
606
+ else {
607
+ const [l, h = ""] = c.split(s);
608
+ if (h) {
609
+ const u = h.replace(/0+$/, ""), f = u.length >= n ? u : h.slice(0, n);
610
+ c = f ? `${l}${s}${f}` : l;
611
+ }
612
+ }
613
+ return c;
614
+ }
615
+ function F(e, t) {
616
+ return !e || e === "0" || e === t || e === "-" || e === `-${t}`;
617
+ }
618
+ function ee(e) {
619
+ const t = e.startsWith("-");
620
+ return { isNegative: t, absoluteValue: t ? e.slice(1) : e };
621
+ }
622
+ function te(e, t) {
623
+ if (!e || e === "0")
624
+ return "0";
625
+ const n = e.includes(t), [s, o = ""] = n ? e.split(t) : [e, ""];
626
+ let r;
627
+ if (o.length <= 2) {
628
+ const a = 2 - o.length;
629
+ r = s + o + "0".repeat(a);
630
+ } else
631
+ r = s + o.slice(0, 2) + t + o.slice(2);
632
+ let i = r.replace(/^0+/, "") || "0";
633
+ if (i.startsWith(t) && (i = "0" + i), i.includes(t)) {
634
+ const [a, c] = i.split(t);
635
+ return a === "0" && !c ? "0" : i;
636
+ }
637
+ return i;
638
+ }
639
+ function Ie(e, t) {
640
+ const { decimals: n, decimalSeparator: s, thousandSeparator: o, thousandStyle: r, decimalsMin: i = 0 } = t;
641
+ if (F(e, s))
642
+ return "0";
643
+ const { isNegative: a, absoluteValue: c } = ee(e), l = te(c, s);
644
+ let h = l;
645
+ o && r !== S.None && (h = y(l, o, r, !1, s));
646
+ const u = P(
647
+ h,
648
+ n,
649
+ i,
650
+ s,
651
+ !1,
652
+ e === "0"
653
+ );
654
+ return `${a ? "-" : ""}${u}`;
655
+ }
656
+ function ot(e, t = 2, n = N, s, o = S.None) {
657
+ const r = Ie(e, {
658
+ decimals: t,
659
+ decimalSeparator: n,
660
+ thousandSeparator: s,
661
+ thousandStyle: o,
662
+ decimalsMin: t
663
+ // Use decimals as decimalsMin to ensure trailing zeros are shown
664
+ });
665
+ return r === "0" ? "0%" : `${r}%`;
666
+ }
667
+ function at(e, t = 2, n = {}) {
668
+ const {
669
+ missingPlaceholder: s = "?",
670
+ veryLargePlaceholder: o = "🔥",
671
+ decimalsUnder: r = 1e3,
672
+ decimalSeparator: i = N,
673
+ thousandSeparator: a,
674
+ thousandStyle: c = S.None
675
+ } = n;
676
+ if (e == null || e === "")
677
+ return s;
678
+ if (F(e, i))
679
+ return "0%";
680
+ const { isNegative: l, absoluteValue: h } = ee(e), u = te(h, i);
681
+ if (V(u))
682
+ return o;
683
+ const { scaledValue: f, scaleSuffix: d } = Y(u, i), p = X(f, r.toString()) < 0 ? t : 0;
684
+ let m = f;
685
+ a && c !== S.None && (m = y(f, a, c, !1, i));
686
+ const D = P(
687
+ m,
688
+ p,
689
+ p,
690
+ i,
691
+ !1,
692
+ !1
693
+ );
694
+ return `${l ? "-" : ""}${D}${d}%`;
695
+ }
696
+ function Pe(e) {
697
+ const t = "₀₁₂₃₄₅₆₇₈₉";
698
+ return e.replace(/[0-9]/g, (n) => t[+n]);
699
+ }
700
+ function ct(e, t = 8, n = N) {
701
+ if (!e || !e.includes(n))
702
+ return e;
703
+ const s = e.startsWith("-"), o = s ? e.slice(1) : e, [r, i] = o.split(n);
704
+ if (!i || !i.length)
705
+ return e;
706
+ const a = i.match(/^(0{3,})/);
707
+ if (!a)
708
+ return e;
709
+ const l = a[1].length, h = i.slice(l), u = r === "0" && l >= 5 ? l + 1 : l, f = Pe(u.toString());
710
+ let d = `0${f}${h}`;
711
+ const g = f.length, p = Math.max(0, t - g - 1);
712
+ h.length > p && (d = `0${f}${h.slice(0, p)}`), d = d.replace(/0+$/, "");
713
+ const m = r === "0" ? d : `${r}${d}`;
714
+ return s ? `-${m}` : m;
715
+ }
716
+ const E = {
717
+ minScale: 0,
718
+ decimalsUnder: 1e3,
719
+ decimals: 2,
720
+ decimalsMin: 0,
721
+ decimalsMinAppliesToZero: !1,
722
+ veryLargePlaceholder: "🔥",
723
+ decimalSeparator: N
724
+ };
725
+ function lt(e, t = {}) {
726
+ const {
727
+ minScale: n = E.minScale,
728
+ decimalsUnder: s = E.decimalsUnder,
729
+ decimals: o = E.decimals,
730
+ decimalsMin: r = E.decimalsMin,
731
+ decimalsMinAppliesToZero: i = E.decimalsMinAppliesToZero,
732
+ veryLargePlaceholder: a = E.veryLargePlaceholder,
733
+ decimalSeparator: c = E.decimalSeparator,
734
+ thousandSeparator: l,
735
+ thousandStyle: h = S.None
736
+ } = t;
737
+ if (!e || e === "0" || e === c || e === "-" || e === `-${c}`)
738
+ return i && r > 0 ? `0${c}${"0".repeat(r)}` : "0";
739
+ const u = e.startsWith("-"), f = u ? e.slice(1) : e;
740
+ if (V(f))
741
+ return a;
742
+ const { scaledValue: d, scaleSuffix: g } = Y(
525
743
  f,
744
+ c,
745
+ n
746
+ ), m = X(d, s.toString()) < 0 ? o : 0;
747
+ let D = d;
748
+ l && h !== S.None && (D = y(
749
+ d,
750
+ l,
526
751
  h,
527
- i.decimalSeparator,
528
- u
752
+ !1,
753
+ c
754
+ ));
755
+ const R = P(
756
+ D,
757
+ m,
758
+ r,
759
+ c,
760
+ i,
761
+ e === "0"
762
+ // Pass whether the original value is '0'
529
763
  );
530
- ve(e, p, n);
764
+ return `${u ? "-" : ""}${R}${g}`;
531
765
  }
532
- function M(e) {
766
+ function x(e) {
533
767
  return e.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
534
768
  }
535
- const $e = (e, t = !1, n = ".") => {
536
- const r = M(n), s = new RegExp(`[^0-9${r}]`, "g");
769
+ const Oe = (e, t = !1, n = ".") => {
770
+ const s = x(n), o = new RegExp(`[^0-9${s}]`, "g");
537
771
  if (!t)
538
- return e.replace(s, "");
539
- const i = e.startsWith("-"), a = e.replace(s, "");
540
- if (i) {
541
- if (a.length > 0)
542
- return "-" + a;
772
+ return e.replace(o, "");
773
+ const r = e.startsWith("-"), i = e.replace(o, "");
774
+ if (r) {
775
+ if (i.length > 0)
776
+ return "-" + i;
543
777
  if (e === "-")
544
778
  return "-";
545
779
  }
546
- return a;
780
+ return i;
547
781
  };
548
- function Le(e) {
782
+ function Re(e) {
549
783
  const t = /([+-]?\d+\.?\d*)[eE]([+-]?\d+)/g;
550
- let n = e, r;
551
- const s = [];
552
- for (; (r = t.exec(e)) !== null; ) {
553
- const i = r[0], a = r[1], o = parseInt(r[2], 10);
784
+ let n = e, s;
785
+ const o = [];
786
+ for (; (s = t.exec(e)) !== null; ) {
787
+ const r = s[0], i = s[1], a = parseInt(s[2], 10);
554
788
  let c;
555
- if (o === 0)
556
- c = a;
789
+ if (a === 0)
790
+ c = i;
557
791
  else {
558
- const l = a.startsWith("-"), h = l ? a.slice(1) : a, [d, u = ""] = h.split(".");
559
- o > 0 ? c = we(d, u, o) : c = De(d, u, Math.abs(o)), l && (c = "-" + c);
792
+ const l = i.startsWith("-"), h = l ? i.slice(1) : i, [u, f = ""] = h.split(".");
793
+ a > 0 ? c = _e(u, f, a) : c = ze(u, f, Math.abs(a)), l && (c = "-" + c);
560
794
  }
561
- s.push({ full: i, expanded: c });
795
+ o.push({ full: r, expanded: c });
562
796
  }
563
- for (const { full: i, expanded: a } of s)
564
- n = n.replace(i, a);
797
+ for (const { full: r, expanded: i } of o)
798
+ n = n.replace(r, i);
565
799
  return n;
566
800
  }
567
- function we(e, t, n) {
568
- const r = e + t;
569
- if (r === "0" || r.match(/^0+$/))
801
+ function _e(e, t, n) {
802
+ const s = e + t;
803
+ if (s === "0" || s.match(/^0+$/))
570
804
  return "0";
571
- const s = t.length;
572
- if (n <= s) {
573
- const a = r.slice(0, e.length + n), o = r.slice(e.length + n);
574
- return o ? `${a}.${o}` : a;
805
+ const o = t.length;
806
+ if (n <= o) {
807
+ const i = s.slice(0, e.length + n), a = s.slice(e.length + n);
808
+ return a ? `${i}.${a}` : i;
575
809
  }
576
- const i = n - s;
577
- return r + "0".repeat(i);
810
+ const r = n - o;
811
+ return s + "0".repeat(r);
578
812
  }
579
- function De(e, t, n) {
580
- const r = e + t;
581
- if (r === "0" || r.match(/^0+$/))
813
+ function ze(e, t, n) {
814
+ const s = e + t;
815
+ if (s === "0" || s.match(/^0+$/))
582
816
  return "0";
583
- const a = e.length - n;
584
- if (a <= 0) {
585
- const o = Math.abs(a), c = `0.${"0".repeat(o)}${r}`;
586
- return y(c);
817
+ const i = e.length - n;
818
+ if (i <= 0) {
819
+ const a = Math.abs(i), c = `0.${"0".repeat(a)}${s}`;
820
+ return C(c);
587
821
  }
588
- if (a < e.length) {
589
- const o = r.slice(0, a), c = r.slice(a), l = `${o}.${c}`;
590
- return y(l);
822
+ if (i < e.length) {
823
+ const a = s.slice(0, i), c = s.slice(i), l = `${a}.${c}`;
824
+ return C(l);
591
825
  }
592
- return y(r);
826
+ return C(s);
593
827
  }
594
- function y(e) {
828
+ function C(e) {
595
829
  if (!e.includes("."))
596
830
  return e;
597
831
  if (e === "0" || e === "0.")
@@ -606,10 +840,10 @@ function y(e) {
606
840
  }
607
841
  return e.replace(/\.?0+$/, "") || e;
608
842
  }
609
- function Me(e) {
843
+ function Ze(e) {
610
844
  const t = /(\d+\.?\d*)\s*(Qa|Qi|Sx|Sp|[kmbMTO]|N)/gi;
611
- return e.replace(t, (n, r, s) => {
612
- const i = {
845
+ return e.replace(t, (n, s, o) => {
846
+ const r = {
613
847
  k: 3,
614
848
  // Thousand
615
849
  K: 3,
@@ -627,66 +861,66 @@ function Me(e) {
627
861
  t: 12
628
862
  // Trillion
629
863
  };
630
- let a;
631
- if (s.length > 1) {
632
- const g = s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();
633
- a = i[s] || i[g];
864
+ let i;
865
+ if (o.length > 1) {
866
+ const d = o.charAt(0).toUpperCase() + o.slice(1).toLowerCase();
867
+ i = r[o] || r[d];
634
868
  } else {
635
- const g = s.toLowerCase();
636
- a = i[s] || i[g];
869
+ const d = o.toLowerCase();
870
+ i = r[o] || r[d];
637
871
  }
638
- if (!a)
872
+ if (!i)
639
873
  return n;
640
- const o = r.startsWith("-"), c = o ? r.slice(1) : r, [l, h = ""] = c.split("."), d = l.replace(/^0+/, "") || "0";
641
- let u;
874
+ const a = s.startsWith("-"), c = a ? s.slice(1) : s, [l, h = ""] = c.split("."), u = l.replace(/^0+/, "") || "0";
875
+ let f;
642
876
  if (h.length === 0)
643
- u = d + "0".repeat(a);
644
- else if (h.length <= a) {
645
- const g = a - h.length;
646
- u = d + h + "0".repeat(g);
877
+ f = u + "0".repeat(i);
878
+ else if (h.length <= i) {
879
+ const d = i - h.length;
880
+ f = u + h + "0".repeat(d);
647
881
  } else {
648
- const g = h.slice(0, a), f = h.slice(a);
649
- u = d + g + "." + f;
882
+ const d = h.slice(0, i), g = h.slice(i);
883
+ f = u + d + "." + g;
650
884
  }
651
- return u = u.replace(/^(-?)0+([1-9])/, "$1$2"), u.match(/^-?0+$/) && (u = o ? "-0" : "0"), u.includes(".") && (u = u.replace(/\.?0+$/, "")), o && !u.startsWith("-") ? "-" + u : u;
885
+ return f = f.replace(/^(-?)0+([1-9])/, "$1$2"), f.match(/^-?0+$/) && (f = a ? "-0" : "0"), f.includes(".") && (f = f.replace(/\.?0+$/, "")), a && !f.startsWith("-") ? "-" + f : f;
652
886
  });
653
887
  }
654
- function ye(e) {
888
+ function Be(e) {
655
889
  if (!e || e === "0" || e === "-0" || e === "-" || e === ".")
656
890
  return e;
657
891
  const t = e.startsWith("-"), n = t ? e.slice(1) : e;
658
892
  if (!n || n === "0" || n === ".")
659
893
  return e;
660
894
  if (n.includes(".")) {
661
- const [s, i] = n.split(".");
662
- if (s && s.length > 0) {
663
- const o = (s.replace(/^0+/, "") || "0") + "." + i;
664
- return t ? "-" + o : o;
895
+ const [o, r] = n.split(".");
896
+ if (o && o.length > 0) {
897
+ const a = (o.replace(/^0+/, "") || "0") + "." + r;
898
+ return t ? "-" + a : a;
665
899
  }
666
900
  return e;
667
901
  }
668
902
  if (n.startsWith("0") && n.length > 1) {
669
- const s = n.replace(/^0+/, "") || "0";
670
- return t ? "-" + s : s;
903
+ const o = n.replace(/^0+/, "") || "0";
904
+ return t ? "-" + o : o;
671
905
  }
672
906
  return e;
673
907
  }
674
- function Ce(e) {
908
+ function We(e) {
675
909
  return e.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000]/g, " ").replace(/\s/g, "");
676
910
  }
677
- function L(e, t) {
678
- const n = M(t);
911
+ function w(e, t) {
912
+ const n = x(t);
679
913
  return e.replace(new RegExp(n, "g"), "");
680
914
  }
681
- const Ae = (e, t) => {
682
- let n = Ce(e);
683
- return t != null && t.thousandSeparator && (n = L(n, t.thousandSeparator)), t != null && t.enableCompactNotation && (n = Me(n)), n = Le(n), n = $e(
915
+ const ke = (e, t) => {
916
+ let n = We(e);
917
+ return t != null && t.thousandSeparator && (n = w(n, t.thousandSeparator)), t != null && t.enableCompactNotation && (n = Ze(n)), n = Re(n), n = Oe(
684
918
  n,
685
919
  t == null ? void 0 : t.enableNegative,
686
920
  t == null ? void 0 : t.decimalSeparator
687
- ), n = te(n, (t == null ? void 0 : t.decimalSeparator) || m), t != null && t.enableLeadingZeros || (n = ye(n)), n;
921
+ ), n = he(n, (t == null ? void 0 : t.decimalSeparator) || N), t != null && t.enableLeadingZeros || (n = Be(n)), n;
688
922
  };
689
- function Te(e, t, n) {
923
+ function Ue(e, t, n) {
690
924
  return {
691
925
  enableCompactNotation: e == null ? void 0 : e.enableCompactNotation,
692
926
  enableNegative: e == null ? void 0 : e.enableNegative,
@@ -695,31 +929,31 @@ function Te(e, t, n) {
695
929
  thousandSeparator: n ? t.thousandSeparator : void 0
696
930
  };
697
931
  }
698
- function x(e, t, n, r) {
699
- const s = A(n), i = r ?? (n == null ? void 0 : n.formatOn) === v.Change, a = Ae(
932
+ function O(e, t, n, s) {
933
+ const o = T(n), r = s ?? (n == null ? void 0 : n.formatOn) === $.Change, i = ke(
700
934
  e,
701
- Te(n, s, i)
702
- ), o = ee(
703
- a,
935
+ Ue(n, o, r)
936
+ ), a = le(
937
+ i,
704
938
  t,
705
- s.decimalSeparator
706
- ), c = (n == null ? void 0 : n.decimalMinLength) ?? 0, l = ne(
707
- o,
939
+ o.decimalSeparator
940
+ ), c = (n == null ? void 0 : n.decimalMinLength) ?? 0, l = ue(
941
+ a,
708
942
  c,
709
- s.decimalSeparator
943
+ o.decimalSeparator
710
944
  ), h = l;
711
- return { formatted: ae(l, n, s), raw: h };
945
+ return { formatted: pe(l, n, o), raw: h };
712
946
  }
713
- function Qe(e, t, n) {
714
- const r = !!(n != null && n.thousandSeparator);
715
- return x(
947
+ function ht(e, t, n) {
948
+ const s = !!(n != null && n.thousandSeparator);
949
+ return O(
716
950
  e,
717
951
  t,
718
952
  n,
719
- r
953
+ s
720
954
  );
721
955
  }
722
- function xe(e, t, n) {
956
+ function Ge(e, t, n) {
723
957
  if (e === "Backspace" || e === "Delete")
724
958
  return e === "Delete" && t === n ? {
725
959
  endOffset: 1
@@ -727,61 +961,61 @@ function xe(e, t, n) {
727
961
  endOffset: 0
728
962
  };
729
963
  }
730
- function Ie(e, t) {
731
- const { decimalSeparator: n } = A(t), r = e.target;
732
- if (F(e, r, t, n)) {
964
+ function je(e, t) {
965
+ const { decimalSeparator: n } = T(t), s = e.target;
966
+ if (ce(e, s, n)) {
733
967
  e.preventDefault();
734
968
  return;
735
969
  }
736
- return me(e, r, t), xe(e.key, r.selectionStart, r.selectionEnd);
970
+ return Ce(e, s, t), Ge(e.key, s.selectionStart, s.selectionEnd);
737
971
  }
738
- function Oe(e, t, n, r) {
739
- const s = e.target, i = s.value, a = Ee(s), o = A(r), c = (r == null ? void 0 : r.formatOn) === v.Change, { formatted: l, raw: h } = x(
740
- i,
741
- t,
972
+ function Je(e, t, n, s) {
973
+ const o = e.target, r = o.value, i = xe(o), a = T(s), c = (s == null ? void 0 : s.formatOn) === $.Change, { formatted: l, raw: h } = O(
742
974
  r,
975
+ t,
976
+ s,
743
977
  c
744
978
  );
745
- return s.value = l, i !== l && Ne(
746
- s,
747
- i,
979
+ return o.value = l, r !== l && Ae(
980
+ o,
981
+ r,
748
982
  l,
749
- a,
983
+ i,
750
984
  n,
751
- o,
752
- r
985
+ a,
986
+ s
753
987
  ), { formatted: l, raw: h };
754
988
  }
755
- function Re(e, t, n, r) {
756
- const s = r - n;
757
- return e + t + s;
989
+ function Ke(e, t, n, s) {
990
+ const o = s - n;
991
+ return e + t + o;
758
992
  }
759
- function _e(e, t, n) {
760
- var u;
993
+ function qe(e, t, n) {
994
+ var f;
761
995
  e.preventDefault();
762
- const r = e.target, { value: s, selectionStart: i, selectionEnd: a } = r, o = ((u = e.clipboardData) == null ? void 0 : u.getData("text/plain")) || "", c = s.slice(0, i || 0) + o + s.slice(a || 0), { formatted: l, raw: h } = x(
996
+ const s = e.target, { value: o, selectionStart: r, selectionEnd: i } = s, a = ((f = e.clipboardData) == null ? void 0 : f.getData("text/plain")) || "", c = o.slice(0, r || 0) + a + o.slice(i || 0), { formatted: l, raw: h } = O(
763
997
  c,
764
998
  t,
765
999
  n,
766
1000
  !0
767
1001
  );
768
- r.value = l;
769
- const d = Re(
770
- i || 0,
771
- o.length,
1002
+ s.value = l;
1003
+ const u = Ke(
1004
+ r || 0,
1005
+ a.length,
772
1006
  c.length,
773
1007
  l.length
774
1008
  );
775
- return r.setSelectionRange(d, d), { formatted: l, raw: h };
1009
+ return s.setSelectionRange(u, u), { formatted: l, raw: h };
776
1010
  }
777
- function Be(e, t) {
778
- const n = M(e);
1011
+ function Qe(e, t) {
1012
+ const n = x(e);
779
1013
  return t ? `^-?[0-9]*[${n}]?[0-9]*$` : `^[0-9]*[${n}]?[0-9]*$`;
780
1014
  }
781
- function Pe(e) {
782
- We(e.decimalMaxLength), ke(e.decimalMinLength), Ze(e.decimalMinLength, e.decimalMaxLength), Ge(e.formatOn), Ue(e.thousandSeparator), je(e.thousandStyle), ze(e.decimalSeparator), Je(e.thousandSeparator, e.decimalSeparator), D("enableCompactNotation", e.enableCompactNotation), D("enableNegative", e.enableNegative), D("enableLeadingZeros", e.enableLeadingZeros), D("rawValueMode", e.rawValueMode), Ke(e.onChange);
1015
+ function He(e) {
1016
+ Ve(e.decimalMaxLength), Xe(e.decimalMinLength), Ye(e.decimalMinLength, e.decimalMaxLength), Fe(e.formatOn), et(e.thousandSeparator), tt(e.thousandStyle), nt(e.decimalSeparator), st(e.thousandSeparator, e.decimalSeparator), M("enableCompactNotation", e.enableCompactNotation), M("enableNegative", e.enableNegative), M("enableLeadingZeros", e.enableLeadingZeros), M("rawValueMode", e.rawValueMode), rt(e.onChange);
783
1017
  }
784
- function We(e) {
1018
+ function Ve(e) {
785
1019
  if (e !== void 0) {
786
1020
  if (typeof e != "number")
787
1021
  throw new Error(
@@ -797,7 +1031,7 @@ function We(e) {
797
1031
  );
798
1032
  }
799
1033
  }
800
- function ke(e) {
1034
+ function Xe(e) {
801
1035
  if (e !== void 0) {
802
1036
  if (typeof e != "number")
803
1037
  throw new Error(
@@ -813,19 +1047,19 @@ function ke(e) {
813
1047
  );
814
1048
  }
815
1049
  }
816
- function Ze(e, t) {
1050
+ function Ye(e, t) {
817
1051
  if (!(e === void 0 || t === void 0) && e > t)
818
1052
  throw new Error(
819
1053
  `decimalMinLength (${e}) cannot be greater than decimalMaxLength (${t}).`
820
1054
  );
821
1055
  }
822
- function Ge(e) {
823
- if (e !== void 0 && e !== v.Blur && e !== v.Change)
1056
+ function Fe(e) {
1057
+ if (e !== void 0 && e !== $.Blur && e !== $.Change)
824
1058
  throw new Error(
825
- `formatOn must be either ${v.Blur} or ${v.Change}. Received: ${JSON.stringify(e)}`
1059
+ `formatOn must be either ${$.Blur} or ${$.Change}. Received: ${JSON.stringify(e)}`
826
1060
  );
827
1061
  }
828
- function Ue(e) {
1062
+ function et(e) {
829
1063
  if (e !== void 0) {
830
1064
  if (typeof e != "string")
831
1065
  throw new Error(
@@ -841,13 +1075,13 @@ function Ue(e) {
841
1075
  );
842
1076
  }
843
1077
  }
844
- function je(e) {
1078
+ function tt(e) {
845
1079
  if (e !== void 0 && !Object.values(S).includes(e))
846
1080
  throw new Error(
847
1081
  `ThousandStyle must be one of: ${Object.values(S).map((t) => `'${t}'`).join(", ")}. Received: ${JSON.stringify(e)}`
848
1082
  );
849
1083
  }
850
- function ze(e) {
1084
+ function nt(e) {
851
1085
  if (e !== void 0) {
852
1086
  if (typeof e != "string")
853
1087
  throw new Error(
@@ -863,119 +1097,119 @@ function ze(e) {
863
1097
  );
864
1098
  }
865
1099
  }
866
- function Je(e, t) {
1100
+ function st(e, t) {
867
1101
  if (!(e === void 0 || t === void 0) && e === t)
868
1102
  throw new Error(
869
1103
  `Decimal separator can't be same as thousand separator. thousandSeparator: ${e}, decimalSeparator: ${t}`
870
1104
  );
871
1105
  }
872
- function D(e, t) {
1106
+ function M(e, t) {
873
1107
  if (t !== void 0 && typeof t != "boolean")
874
1108
  throw new Error(
875
1109
  `${e} must be a boolean. Received: ${typeof t} (${JSON.stringify(t)})`
876
1110
  );
877
1111
  }
878
- function Ke(e) {
1112
+ function rt(e) {
879
1113
  if (e !== void 0 && typeof e != "function")
880
1114
  throw new Error(
881
1115
  `onChange must be a function or undefined. Received: ${typeof e} (${JSON.stringify(e)})`
882
1116
  );
883
1117
  }
884
- class Xe {
1118
+ class ut {
885
1119
  constructor(t, {
886
- decimalMaxLength: n = I,
887
- decimalMinLength: r = O,
888
- formatOn: s = R,
889
- thousandSeparator: i = _,
890
- thousandStyle: a = B,
891
- decimalSeparator: o = m,
1120
+ decimalMaxLength: n = _,
1121
+ decimalMinLength: s = z,
1122
+ formatOn: o = Z,
1123
+ thousandSeparator: r = B,
1124
+ thousandStyle: i = W,
1125
+ decimalSeparator: a = N,
892
1126
  enableCompactNotation: c = !0,
893
- enableNegative: l = P,
894
- enableLeadingZeros: h = W,
895
- rawValueMode: d = k,
896
- onChange: u,
897
- ...g
1127
+ enableNegative: l = k,
1128
+ enableLeadingZeros: h = U,
1129
+ rawValueMode: u = G,
1130
+ onChange: f,
1131
+ ...d
898
1132
  }) {
899
- $(this, "element");
900
- $(this, "options");
901
- $(this, "resolvedOptions");
902
- $(this, "rawValue", "");
903
- $(this, "caretPositionBeforeChange");
904
- if (Pe({
1133
+ v(this, "element");
1134
+ v(this, "options");
1135
+ v(this, "resolvedOptions");
1136
+ v(this, "rawValue", "");
1137
+ v(this, "caretPositionBeforeChange");
1138
+ if (He({
905
1139
  decimalMaxLength: n,
906
- decimalMinLength: r,
907
- formatOn: s,
908
- thousandSeparator: i,
909
- thousandStyle: a,
910
- decimalSeparator: o,
1140
+ decimalMinLength: s,
1141
+ formatOn: o,
1142
+ thousandSeparator: r,
1143
+ thousandStyle: i,
1144
+ decimalSeparator: a,
911
1145
  enableCompactNotation: c,
912
1146
  enableNegative: l,
913
1147
  enableLeadingZeros: h,
914
- rawValueMode: d,
915
- onChange: u
1148
+ rawValueMode: u,
1149
+ onChange: f
916
1150
  }), this.options = {
917
1151
  decimalMaxLength: n,
918
- decimalMinLength: r,
919
- onChange: u,
920
- formatOn: s,
921
- thousandSeparator: i,
922
- thousandStyle: a,
923
- decimalSeparator: o,
1152
+ decimalMinLength: s,
1153
+ onChange: f,
1154
+ formatOn: o,
1155
+ thousandSeparator: r,
1156
+ thousandStyle: i,
1157
+ decimalSeparator: a,
924
1158
  enableCompactNotation: c,
925
1159
  enableNegative: l,
926
1160
  enableLeadingZeros: h,
927
- rawValueMode: d,
928
- ...g
1161
+ rawValueMode: u,
1162
+ ...d
929
1163
  }, this.resolvedOptions = this.getResolvedOptions(), this.createInputElement(t), this.setupEventListeners(), this.resolvedOptions.rawValueMode && this.element.value) {
930
- const f = this.element.value, p = this.resolvedOptions.thousandSeparator ? L(f, this.resolvedOptions.thousandSeparator) : f;
1164
+ const g = this.element.value, p = this.resolvedOptions.thousandSeparator ? w(g, this.resolvedOptions.thousandSeparator) : g;
931
1165
  this.rawValue = p, this.element.value = this.formatValueForDisplay(p);
932
1166
  } else if (this.element.value) {
933
- const f = this.element.value;
934
- this.element.value = this.formatValueForDisplay(f);
1167
+ const g = this.element.value;
1168
+ this.element.value = this.formatValueForDisplay(g);
935
1169
  }
936
1170
  }
937
1171
  createInputElement(t) {
938
1172
  if (this.element = document.createElement("input"), this.element.setAttribute("type", "text"), this.element.setAttribute("inputmode", "decimal"), this.element.setAttribute("spellcheck", "false"), this.element.setAttribute("autocomplete", "off"), this.resolvedOptions.decimalSeparator !== void 0 && this.resolvedOptions.enableNegative !== void 0) {
939
- const H = Be(this.resolvedOptions.decimalSeparator, this.resolvedOptions.enableNegative);
940
- this.element.setAttribute("pattern", H);
1173
+ const se = Qe(this.resolvedOptions.decimalSeparator, this.resolvedOptions.enableNegative);
1174
+ this.element.setAttribute("pattern", se);
941
1175
  }
942
1176
  const {
943
1177
  decimalMaxLength: n,
944
- decimalMinLength: r,
945
- formatOn: s,
946
- thousandSeparator: i,
947
- thousandStyle: a,
948
- decimalSeparator: o,
1178
+ decimalMinLength: s,
1179
+ formatOn: o,
1180
+ thousandSeparator: r,
1181
+ thousandStyle: i,
1182
+ decimalSeparator: a,
949
1183
  enableCompactNotation: c,
950
1184
  enableNegative: l,
951
1185
  enableLeadingZeros: h,
952
- rawValueMode: d,
953
- onChange: u,
954
- value: g,
955
- defaultValue: f,
1186
+ rawValueMode: u,
1187
+ onChange: f,
1188
+ value: d,
1189
+ defaultValue: g,
956
1190
  type: p,
957
- inputMode: E,
958
- spellcheck: w,
959
- autocomplete: qe,
960
- ...q
1191
+ inputMode: m,
1192
+ spellcheck: D,
1193
+ autocomplete: R,
1194
+ ...ne
961
1195
  } = this.options;
962
- Object.assign(this.element, q), g !== void 0 ? this.element.value = g : f !== void 0 && (this.element.defaultValue = f, this.element.value = f), t.appendChild(this.element);
1196
+ Object.assign(this.element, ne), d !== void 0 ? this.element.value = d : g !== void 0 && (this.element.defaultValue = g, this.element.value = g), t.appendChild(this.element);
963
1197
  }
964
1198
  setupEventListeners() {
965
- this.element.addEventListener("input", this.handleChange.bind(this)), this.element.addEventListener("keydown", this.handleKeyDown.bind(this)), this.element.addEventListener("paste", this.handlePaste.bind(this)), this.resolvedOptions.formatOn === v.Blur && this.resolvedOptions.thousandSeparator && (this.element.addEventListener("focus", this.handleFocus.bind(this)), this.element.addEventListener("blur", this.handleBlur.bind(this)));
1199
+ this.element.addEventListener("input", this.handleChange.bind(this)), this.element.addEventListener("keydown", this.handleKeyDown.bind(this)), this.element.addEventListener("paste", this.handlePaste.bind(this)), this.resolvedOptions.formatOn === $.Blur && this.resolvedOptions.thousandSeparator && (this.element.addEventListener("focus", this.handleFocus.bind(this)), this.element.addEventListener("blur", this.handleBlur.bind(this)));
966
1200
  }
967
1201
  getResolvedOptions() {
968
1202
  return {
969
- decimalMaxLength: this.options.decimalMaxLength ?? I,
970
- decimalMinLength: this.options.decimalMinLength ?? O,
971
- formatOn: this.options.formatOn ?? R,
972
- thousandSeparator: this.options.thousandSeparator ?? _,
973
- thousandStyle: this.options.thousandStyle ?? B,
974
- decimalSeparator: this.options.decimalSeparator ?? m,
975
- enableCompactNotation: this.options.enableCompactNotation ?? Y,
976
- enableNegative: this.options.enableNegative ?? P,
977
- enableLeadingZeros: this.options.enableLeadingZeros ?? W,
978
- rawValueMode: this.options.rawValueMode ?? k,
1203
+ decimalMaxLength: this.options.decimalMaxLength ?? _,
1204
+ decimalMinLength: this.options.decimalMinLength ?? z,
1205
+ formatOn: this.options.formatOn ?? Z,
1206
+ thousandSeparator: this.options.thousandSeparator ?? B,
1207
+ thousandStyle: this.options.thousandStyle ?? W,
1208
+ decimalSeparator: this.options.decimalSeparator ?? N,
1209
+ enableCompactNotation: this.options.enableCompactNotation ?? oe,
1210
+ enableNegative: this.options.enableNegative ?? k,
1211
+ enableLeadingZeros: this.options.enableLeadingZeros ?? U,
1212
+ rawValueMode: this.options.rawValueMode ?? G,
979
1213
  onChange: this.options.onChange
980
1214
  };
981
1215
  }
@@ -994,66 +1228,66 @@ class Xe {
994
1228
  }
995
1229
  handleValueChange(t, n) {
996
1230
  if (this.resolvedOptions.rawValueMode && n !== void 0 && (this.rawValue = n), this.resolvedOptions.onChange) {
997
- const r = this.resolvedOptions.rawValueMode ? this.rawValue : t;
998
- this.resolvedOptions.onChange(r);
1231
+ const s = this.resolvedOptions.rawValueMode ? this.rawValue : t;
1232
+ this.resolvedOptions.onChange(s);
999
1233
  }
1000
1234
  }
1001
1235
  formatValueForDisplay(t) {
1002
1236
  if (!t)
1003
1237
  return t;
1004
- const { thousandSeparator: n, thousandStyle: r, enableLeadingZeros: s, decimalSeparator: i } = this.resolvedOptions;
1005
- return n && r !== S.None ? j(
1238
+ const { thousandSeparator: n, thousandStyle: s, enableLeadingZeros: o, decimalSeparator: r } = this.resolvedOptions;
1239
+ return n && s !== S.None ? y(
1006
1240
  t,
1007
1241
  n,
1008
- r,
1009
1242
  s,
1010
- i
1243
+ o,
1244
+ r
1011
1245
  ) : t;
1012
1246
  }
1013
1247
  handleChange(t) {
1014
- const { formatted: n, raw: r } = Oe(
1248
+ const { formatted: n, raw: s } = Je(
1015
1249
  t,
1016
1250
  this.resolvedOptions.decimalMaxLength,
1017
1251
  this.caretPositionBeforeChange,
1018
1252
  this.buildFormattingOptions()
1019
1253
  );
1020
- this.caretPositionBeforeChange = void 0, this.handleValueChange(n, r);
1254
+ this.caretPositionBeforeChange = void 0, this.handleValueChange(n, s);
1021
1255
  }
1022
1256
  handleKeyDown(t) {
1023
- const n = t.target, { selectionStart: r, selectionEnd: s } = n, i = this.buildFormattingOptions(), a = Ie(t, {
1024
- formatOn: i.formatOn,
1025
- thousandSeparator: i.thousandSeparator,
1026
- ThousandStyle: i.ThousandStyle,
1027
- decimalSeparator: i.decimalSeparator
1257
+ const n = t.target, { selectionStart: s, selectionEnd: o } = n, r = this.buildFormattingOptions(), i = je(t, {
1258
+ formatOn: r.formatOn,
1259
+ thousandSeparator: r.thousandSeparator,
1260
+ ThousandStyle: r.ThousandStyle,
1261
+ decimalSeparator: r.decimalSeparator
1028
1262
  });
1029
- a ? this.caretPositionBeforeChange = {
1030
- selectionStart: r ?? 0,
1031
- selectionEnd: s ?? 0,
1032
- endOffset: a.endOffset
1263
+ i ? this.caretPositionBeforeChange = {
1264
+ selectionStart: s ?? 0,
1265
+ selectionEnd: o ?? 0,
1266
+ endOffset: i.endOffset
1033
1267
  } : this.caretPositionBeforeChange = {
1034
- selectionStart: r ?? 0,
1035
- selectionEnd: s ?? 0
1268
+ selectionStart: s ?? 0,
1269
+ selectionEnd: o ?? 0
1036
1270
  };
1037
1271
  }
1038
1272
  handlePaste(t) {
1039
- const { formatted: n, raw: r } = _e(t, this.resolvedOptions.decimalMaxLength, this.buildFormattingOptions());
1040
- this.handleValueChange(n, r);
1041
- const s = new Event("input", { bubbles: !0, cancelable: !0 });
1042
- this.element.dispatchEvent(s);
1273
+ const { formatted: n, raw: s } = qe(t, this.resolvedOptions.decimalMaxLength, this.buildFormattingOptions());
1274
+ this.handleValueChange(n, s);
1275
+ const o = new Event("input", { bubbles: !0, cancelable: !0 });
1276
+ this.element.dispatchEvent(o);
1043
1277
  }
1044
1278
  handleFocus(t) {
1045
- if (this.resolvedOptions.formatOn === v.Blur && this.resolvedOptions.thousandSeparator) {
1279
+ if (this.resolvedOptions.formatOn === $.Blur && this.resolvedOptions.thousandSeparator) {
1046
1280
  const n = t.target;
1047
- n.value = L(n.value, this.resolvedOptions.thousandSeparator);
1281
+ n.value = w(n.value, this.resolvedOptions.thousandSeparator);
1048
1282
  }
1049
1283
  }
1050
1284
  handleBlur(t) {
1051
- const n = t.target, { thousandSeparator: r, thousandStyle: s } = this.resolvedOptions;
1052
- if (r && s !== S.None && n.value) {
1053
- const i = n.value, a = this.formatValueForDisplay(n.value);
1054
- n.value = a;
1055
- const o = this.resolvedOptions.rawValueMode ? L(a, r) : void 0;
1056
- if (this.handleValueChange(a, o), i !== a) {
1285
+ const n = t.target, { thousandSeparator: s, thousandStyle: o } = this.resolvedOptions;
1286
+ if (s && o !== S.None && n.value) {
1287
+ const r = n.value, i = this.formatValueForDisplay(n.value);
1288
+ n.value = i;
1289
+ const a = this.resolvedOptions.rawValueMode ? w(i, s) : void 0;
1290
+ if (this.handleValueChange(i, a), r !== i) {
1057
1291
  const c = new Event("input", { bubbles: !0, cancelable: !0 });
1058
1292
  this.element.dispatchEvent(c);
1059
1293
  const l = new Event("change", { bubbles: !0, cancelable: !0 });
@@ -1066,7 +1300,7 @@ class Xe {
1066
1300
  }
1067
1301
  setValue(t) {
1068
1302
  if (this.resolvedOptions.rawValueMode) {
1069
- const n = this.resolvedOptions.thousandSeparator ? L(t, this.resolvedOptions.thousandSeparator) : t;
1303
+ const n = this.resolvedOptions.thousandSeparator ? w(t, this.resolvedOptions.thousandSeparator) : t;
1070
1304
  this.rawValue = n, this.element.value = this.formatValueForDisplay(n);
1071
1305
  } else
1072
1306
  this.element.value = t;
@@ -1114,8 +1348,8 @@ class Xe {
1114
1348
  const t = this.getValue();
1115
1349
  if (!t)
1116
1350
  return NaN;
1117
- const n = this.resolvedOptions.thousandSeparator ? L(t, this.resolvedOptions.thousandSeparator) : t, r = this.resolvedOptions.decimalSeparator && this.resolvedOptions.decimalSeparator !== "." ? n.replace(new RegExp(M(this.resolvedOptions.decimalSeparator), "g"), ".") : n;
1118
- return parseFloat(r);
1351
+ const n = this.resolvedOptions.thousandSeparator ? w(t, this.resolvedOptions.thousandSeparator) : t, s = this.resolvedOptions.decimalSeparator && this.resolvedOptions.decimalSeparator !== "." ? n.replace(new RegExp(x(this.resolvedOptions.decimalSeparator), "g"), ".") : n;
1352
+ return parseFloat(s);
1119
1353
  }
1120
1354
  /**
1121
1355
  * Sets the value from a number, similar to HTMLInputElement.valueAsNumber.
@@ -1130,12 +1364,16 @@ class Xe {
1130
1364
  }
1131
1365
  }
1132
1366
  export {
1133
- v as FormatOn,
1134
- Xe as NumoraInput,
1367
+ $ as FormatOn,
1368
+ ut as NumoraInput,
1135
1369
  S as ThousandStyle,
1136
- x as formatInputValue,
1137
- Qe as formatValueForDisplay,
1138
- Oe as handleOnChangeNumoraInput,
1139
- Ie as handleOnKeyDownNumoraInput,
1140
- _e as handleOnPasteNumoraInput
1370
+ ct as condenseDecimalZeros,
1371
+ O as formatInputValue,
1372
+ lt as formatLargeNumber,
1373
+ at as formatLargePercent,
1374
+ ot as formatPercent,
1375
+ ht as formatValueForDisplay,
1376
+ Je as handleOnChangeNumoraInput,
1377
+ je as handleOnKeyDownNumoraInput,
1378
+ qe as handleOnPasteNumoraInput
1141
1379
  };