@livestore/devtools-vite 0.4.0-dev.21 → 0.4.0-dev.23

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.
@@ -1,10 +1,10 @@
1
- import { s as Te, R as X, r as T } from "./devtools-react-bundle-BwT8H7P1.js";
2
- const Be = /* @__PURE__ */ Te("div")({
1
+ import { s as Be, R as Y, r as O } from "./devtools-react-bundle-BD5WohSC.js";
2
+ const Fe = /* @__PURE__ */ Be("div")({
3
3
  name: "NumberOverlayEditorStyle",
4
4
  class: "gdg-n15fjm3e",
5
5
  propsAsIs: !1
6
6
  });
7
- function Se(e, t) {
7
+ function pe(e, t) {
8
8
  var r = {};
9
9
  for (var n in e)
10
10
  Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
@@ -13,13 +13,13 @@ function Se(e, t) {
13
13
  t.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[a]) && (r[n[a]] = e[n[a]]);
14
14
  return r;
15
15
  }
16
- var re;
16
+ var ee;
17
17
  (function(e) {
18
18
  e.event = "event", e.props = "prop";
19
- })(re || (re = {}));
19
+ })(ee || (ee = {}));
20
20
  function q() {
21
21
  }
22
- function Fe(e) {
22
+ function _e(e) {
23
23
  var t, r = void 0;
24
24
  return function() {
25
25
  for (var n = [], a = arguments.length; a--; ) n[a] = arguments[a];
@@ -31,43 +31,42 @@ function Fe(e) {
31
31
  function ae(e) {
32
32
  return !!(e || "").match(/\d/);
33
33
  }
34
- function Y(e) {
34
+ function z(e) {
35
35
  return e == null;
36
36
  }
37
- function _e(e) {
37
+ function je(e) {
38
38
  return typeof e == "number" && isNaN(e);
39
39
  }
40
- function pe(e) {
41
- return Y(e) || _e(e) || typeof e == "number" && !isFinite(e);
42
- }
43
40
  function xe(e) {
41
+ return z(e) || je(e) || typeof e == "number" && !isFinite(e);
42
+ }
43
+ function ye(e) {
44
44
  return e.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
45
45
  }
46
- function je(e) {
46
+ function Me(e) {
47
47
  switch (e) {
48
48
  case "lakh":
49
49
  return /(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;
50
50
  case "wan":
51
51
  return /(\d)(?=(\d{4})+(?!\d))/g;
52
- case "thousand":
53
52
  default:
54
53
  return /(\d)(?=(\d{3})+(?!\d))/g;
55
54
  }
56
55
  }
57
56
  function Le(e, t, r) {
58
- var n = je(r), a = e.search(/[1-9]/);
57
+ var n = Me(r), a = e.search(/[1-9]/);
59
58
  return a = a === -1 ? e.length : a, e.substring(0, a) + e.substring(a, e.length).replace(n, "$1" + t);
60
59
  }
61
- function Me(e) {
62
- var t = T.useRef(e);
60
+ function de(e) {
61
+ var t = O.useRef(e);
63
62
  t.current = e;
64
- var r = T.useRef(function() {
63
+ var r = O.useRef(function() {
65
64
  for (var n = [], a = arguments.length; a--; ) n[a] = arguments[a];
66
65
  return t.current.apply(t, n);
67
66
  });
68
67
  return r.current;
69
68
  }
70
- function se(e, t) {
69
+ function ce(e, t) {
71
70
  t === void 0 && (t = !0);
72
71
  var r = e[0] === "-", n = r && t;
73
72
  e = e.replace("-", "");
@@ -87,35 +86,35 @@ function ke(e) {
87
86
  var r = e.split("."), n = r[0].replace(/^0+/, "") || "0", a = r[1] || "";
88
87
  return (t ? "-" : "") + n + (a ? "." + a : "");
89
88
  }
90
- function ye(e, t, r) {
89
+ function be(e, t, r) {
91
90
  for (var n = "", a = r ? "0" : "", i = 0; i <= t - 1; i++)
92
91
  n += e[i] || a;
93
92
  return n;
94
93
  }
95
- function de(e, t) {
94
+ function ge(e, t) {
96
95
  return Array(t + 1).join(e);
97
96
  }
98
- function be(e) {
97
+ function Ve(e) {
99
98
  var t = e + "", r = t[0] === "-" ? "-" : "";
100
99
  r && (t = t.substring(1));
101
100
  var n = t.split(/[eE]/g), a = n[0], i = n[1];
102
101
  if (i = Number(i), !i)
103
102
  return r + a;
104
103
  a = a.replace(".", "");
105
- var f = 1 + i, m = a.length;
106
- return f < 0 ? a = "0." + de("0", Math.abs(f)) + a : f >= m ? a = a + de("0", f - m) : a = (a.substring(0, f) || "0") + "." + a.substring(f), r + a;
104
+ var f = 1 + i, S = a.length;
105
+ return f < 0 ? a = "0." + ge("0", Math.abs(f)) + a : f >= S ? a = a + ge("0", f - S) : a = (a.substring(0, f) || "0") + "." + a.substring(f), r + a;
107
106
  }
108
- function ge(e, t, r) {
107
+ function me(e, t, r) {
109
108
  if (["", "-"].indexOf(e) !== -1)
110
109
  return e;
111
- var n = (e.indexOf(".") !== -1 || r) && t, a = se(e), i = a.beforeDecimal, f = a.afterDecimal, m = a.hasNegation, S = parseFloat("0." + (f || "0")), p = f.length <= t ? "0." + f : S.toFixed(t), h = p.split("."), c = i;
110
+ var n = (e.indexOf(".") !== -1 || r) && t, a = ce(e), i = a.beforeDecimal, f = a.afterDecimal, S = a.hasNegation, m = parseFloat("0." + (f || "0")), p = f.length <= t ? "0." + f : m.toFixed(t), h = p.split("."), c = i;
112
111
  i && Number(h[0]) && (c = i.split("").reverse().reduce(function(I, C, g) {
113
112
  return I.length > g ? (Number(I[0]) + Number(C)).toString() + I.substring(1, I.length) : C + I;
114
113
  }, h[0]));
115
- var x = ye(h[1] || "", t, r), y = m ? "-" : "", s = n ? "." : "";
116
- return "" + y + c + s + x;
114
+ var x = be(h[1] || "", t, r), y = S ? "-" : "", l = n ? "." : "";
115
+ return "" + y + c + l + x;
117
116
  }
118
- function H(e, t) {
117
+ function J(e, t) {
119
118
  if (e.value = e.value, e !== null) {
120
119
  if (e.createTextRange) {
121
120
  var r = e.createTextRange();
@@ -124,7 +123,7 @@ function H(e, t) {
124
123
  return e.selectionStart || e.selectionStart === 0 ? (e.focus(), e.setSelectionRange(t, t), !0) : (e.focus(), !1);
125
124
  }
126
125
  }
127
- var Ve = Fe(function(e, t) {
126
+ var Ne = _e(function(e, t) {
128
127
  for (var r = 0, n = 0, a = e.length, i = t.length; e[r] === t[r] && r < a; )
129
128
  r++;
130
129
  for (; e[a - 1 - n] === t[i - 1 - n] && i - n > r && a - n > r; )
@@ -143,7 +142,7 @@ var Ve = Fe(function(e, t) {
143
142
  function Ke(e, t, r) {
144
143
  return Math.min(Math.max(e, t), r);
145
144
  }
146
- function ce(e) {
145
+ function se(e) {
147
146
  return Math.max(e.selectionStart, e.selectionEnd);
148
147
  }
149
148
  function We() {
@@ -168,22 +167,22 @@ function $e(e) {
168
167
  }
169
168
  function Ge(e, t, r, n, a, i, f) {
170
169
  f === void 0 && (f = $e);
171
- var m = a.findIndex(function(k) {
170
+ var S = a.findIndex(function(k) {
172
171
  return k;
173
- }), S = e.slice(0, m);
174
- !t && !r.startsWith(S) && (t = S, r = S + r, n = n + S.length);
172
+ }), m = e.slice(0, S);
173
+ !t && !r.startsWith(m) && (t = m, r = m + r, n = n + m.length);
175
174
  for (var p = r.length, h = e.length, c = {}, x = new Array(p), y = 0; y < p; y++) {
176
175
  x[y] = -1;
177
- for (var s = 0, I = h; s < I; s++) {
176
+ for (var l = 0, I = h; l < I; l++) {
178
177
  var C = f({
179
178
  currentValue: r,
180
179
  lastValue: t,
181
180
  formattedValue: e,
182
181
  currentValueIndex: y,
183
- formattedValueIndex: s
182
+ formattedValueIndex: l
184
183
  });
185
- if (C && c[s] !== !0) {
186
- x[y] = s, c[s] = !0;
184
+ if (C && c[l] !== !0) {
185
+ x[y] = l, c[l] = !0;
187
186
  break;
188
187
  }
189
188
  }
@@ -196,7 +195,7 @@ function Ge(e, t, r, n, a, i, f) {
196
195
  var F = g === -1 || x[g] === -1 ? 0 : x[g] + 1;
197
196
  return F > B ? B : n - F < B - n ? F : B;
198
197
  }
199
- function me(e, t, r, n) {
198
+ function he(e, t, r, n) {
200
199
  var a = e.length;
201
200
  if (t = Ke(t, 0, a), n === "left") {
202
201
  for (; t >= 0 && !r[t]; )
@@ -216,24 +215,33 @@ function Ze(e) {
216
215
  t[r] = !!(ae(e[r]) || ae(e[r - 1]));
217
216
  return t;
218
217
  }
219
- function Ne(e, t, r, n, a, i) {
218
+ function we(e, t, r, n, a, i) {
220
219
  i === void 0 && (i = q);
221
- var f = Me(function(s, I) {
220
+ var f = de(function(l, I) {
222
221
  var C, g;
223
- return pe(s) ? (g = "", C = "") : typeof s == "number" || I ? (g = typeof s == "number" ? be(s) : s, C = n(g)) : (g = a(s, void 0), C = n(g)), { formattedValue: C, numAsString: g };
224
- }), m = T.useState(function() {
225
- return f(Y(e) ? t : e, r);
226
- }), S = m[0], p = m[1], h = function(s, I) {
227
- s.formattedValue !== S.formattedValue && p({
228
- formattedValue: s.formattedValue,
229
- numAsString: s.value
230
- }), i(s, I);
231
- }, c = e, x = r;
232
- Y(e) && (c = S.numAsString, x = !0);
222
+ return xe(l) ? (g = "", C = "") : typeof l == "number" || I ? (g = typeof l == "number" ? Ve(l) : l, C = n(g)) : (g = a(l, void 0), C = n(g)), { formattedValue: C, numAsString: g };
223
+ }), S = O.useState(function() {
224
+ return f(z(e) ? t : e, r);
225
+ }), m = S[0], p = S[1], h = de(function(l, I) {
226
+ l.formattedValue !== m.formattedValue && p({
227
+ formattedValue: l.formattedValue,
228
+ numAsString: l.value
229
+ }), i(l, I);
230
+ }), c = e, x = r;
231
+ z(e) && (c = m.numAsString, x = !0);
233
232
  var y = f(c, x);
234
- return T.useMemo(function() {
233
+ return O.useMemo(function() {
235
234
  p(y);
236
- }, [y.formattedValue]), [S, h];
235
+ }, [y.formattedValue]), O.useEffect(function() {
236
+ if (!z(t) && z(e) && m.formattedValue !== "") {
237
+ var l = parseFloat(m.numAsString);
238
+ h({
239
+ formattedValue: m.formattedValue,
240
+ value: m.numAsString,
241
+ floatValue: isNaN(l) ? void 0 : l
242
+ }, { event: void 0, source: ee.props });
243
+ }
244
+ }, []), [m, h];
237
245
  }
238
246
  function qe(e) {
239
247
  return e.replace(/[^0-9]/g, "");
@@ -248,14 +256,14 @@ function He(e) {
248
256
  r === void 0 && (r = "input");
249
257
  var n = e.customInput, a = e.renderText, i = e.getInputRef, f = e.format;
250
258
  f === void 0 && (f = ze);
251
- var m = e.removeFormatting;
252
- m === void 0 && (m = qe);
253
- var S = e.defaultValue, p = e.valueIsNumericString, h = e.onValueChange, c = e.isAllowed, x = e.onChange;
259
+ var S = e.removeFormatting;
260
+ S === void 0 && (S = qe);
261
+ var m = e.defaultValue, p = e.valueIsNumericString, h = e.onValueChange, c = e.isAllowed, x = e.onChange;
254
262
  x === void 0 && (x = q);
255
263
  var y = e.onKeyDown;
256
264
  y === void 0 && (y = q);
257
- var s = e.onMouseUp;
258
- s === void 0 && (s = q);
265
+ var l = e.onMouseUp;
266
+ l === void 0 && (l = q);
259
267
  var I = e.onFocus;
260
268
  I === void 0 && (I = q);
261
269
  var C = e.onBlur;
@@ -264,13 +272,13 @@ function He(e) {
264
272
  B === void 0 && (B = Ze);
265
273
  var F = e.isValidInputCharacter;
266
274
  F === void 0 && (F = ae);
267
- var k = e.isCharacterSame, j = Se(e, ["type", "displayType", "customInput", "renderText", "getInputRef", "format", "removeFormatting", "defaultValue", "valueIsNumericString", "onValueChange", "isAllowed", "onChange", "onKeyDown", "onMouseUp", "onFocus", "onBlur", "value", "getCaretBoundary", "isValidInputCharacter", "isCharacterSame"]), z = Ne(g, S, !!p, f, m, h), P = z[0], V = P.formattedValue, L = P.numAsString, W = z[1], M = T.useRef(), U = T.useRef({ formattedValue: V, numAsString: L }), $ = function(o, u) {
275
+ var k = e.isCharacterSame, j = pe(e, ["type", "displayType", "customInput", "renderText", "getInputRef", "format", "removeFormatting", "defaultValue", "valueIsNumericString", "onValueChange", "isAllowed", "onChange", "onKeyDown", "onMouseUp", "onFocus", "onBlur", "value", "getCaretBoundary", "isValidInputCharacter", "isCharacterSame"]), H = we(g, m, !!p, f, S, h), P = H[0], V = P.formattedValue, M = P.numAsString, W = H[1], L = O.useRef(), U = O.useRef({ formattedValue: V, numAsString: M }), $ = function(o, u) {
268
276
  U.current = { formattedValue: o.formattedValue, numAsString: o.value }, W(o, u);
269
- }, J = T.useState(!1), ee = J[0], d = J[1], l = T.useRef(null), N = T.useRef({
277
+ }, Q = O.useState(!1), te = Q[0], d = Q[1], s = O.useRef(null), N = O.useRef({
270
278
  setCaretTimeout: null,
271
279
  focusTimeout: null
272
280
  });
273
- T.useEffect(function() {
281
+ O.useEffect(function() {
274
282
  return d(!0), function() {
275
283
  clearTimeout(N.current.setCaretTimeout), clearTimeout(N.current.focusTimeout);
276
284
  };
@@ -283,43 +291,43 @@ function He(e) {
283
291
  floatValue: isNaN(v) ? void 0 : v
284
292
  };
285
293
  }, E = function(o, u, v) {
286
- o.selectionStart === 0 && o.selectionEnd === o.value.length || (H(o, u), N.current.setCaretTimeout = setTimeout(function() {
287
- o.value === v && o.selectionStart !== u && H(o, u);
294
+ o.selectionStart === 0 && o.selectionEnd === o.value.length || (J(o, u), N.current.setCaretTimeout = setTimeout(function() {
295
+ o.value === v && o.selectionStart !== u && J(o, u);
288
296
  }, 0));
289
- }, O = function(o, u, v) {
290
- return me(o, u, B(o), v);
291
- }, Q = function(o, u, v) {
297
+ }, T = function(o, u, v) {
298
+ return he(o, u, B(o), v);
299
+ }, X = function(o, u, v) {
292
300
  var w = B(u), _ = Ge(u, V, o, v, w, F, k);
293
- return _ = me(u, _, w), _;
301
+ return _ = he(u, _, w), _;
294
302
  }, oe = function(o) {
295
303
  var u = o.formattedValue;
296
304
  u === void 0 && (u = "");
297
305
  var v = o.input, w = o.source, _ = o.event, D = o.numAsString, b;
298
306
  if (v) {
299
- var K = o.inputValue || v.value, G = ce(v);
300
- v.value = u, b = Q(K, u, G), b !== void 0 && E(v, b, u);
307
+ var K = o.inputValue || v.value, G = se(v);
308
+ v.value = u, b = X(K, u, G), b !== void 0 && E(v, b, u);
301
309
  }
302
310
  u !== V && $(A(u, D), { event: _, source: w });
303
311
  };
304
- T.useEffect(function() {
312
+ O.useEffect(function() {
305
313
  var o = U.current, u = o.formattedValue, v = o.numAsString;
306
- (V !== u || L !== v) && $(A(V, L), {
314
+ (V !== u || M !== v) && $(A(V, M), {
307
315
  event: void 0,
308
- source: re.props
316
+ source: ee.props
309
317
  });
310
- }, [V, L]);
311
- var te = l.current ? ce(l.current) : void 0, ne = typeof window < "u" ? T.useLayoutEffect : T.useEffect;
318
+ }, [V, M]);
319
+ var re = s.current ? se(s.current) : void 0, ne = typeof window < "u" ? O.useLayoutEffect : O.useEffect;
312
320
  ne(function() {
313
- var o = l.current;
321
+ var o = s.current;
314
322
  if (V !== U.current.formattedValue && o) {
315
- var u = Q(U.current.formattedValue, V, te);
323
+ var u = X(U.current.formattedValue, V, re);
316
324
  o.value = V, E(o, u, V);
317
325
  }
318
326
  }, [V]);
319
327
  var ue = function(o, u, v) {
320
- var w = u.target, _ = M.current ? Pe(M.current, w.selectionEnd) : Ve(V, o), D = Object.assign(Object.assign({}, _), { lastValue: V }), b = m(o, D), K = R(b);
321
- if (b = m(K, void 0), c && !c(A(K, b))) {
322
- var G = u.target, Z = ce(G), le = Q(o, V, Z);
328
+ var w = u.target, _ = L.current ? Pe(L.current, w.selectionEnd) : Ne(V, o), D = Object.assign(Object.assign({}, _), { lastValue: V }), b = S(o, D), K = R(b);
329
+ if (b = S(K, void 0), c && !c(A(K, b))) {
330
+ var G = u.target, Z = se(G), le = X(o, V, Z);
323
331
  return G.value = V, E(G, le, V), !1;
324
332
  }
325
333
  return oe({
@@ -333,11 +341,11 @@ function He(e) {
333
341
  }, fe = function(o, u) {
334
342
  u === void 0 && (u = 0);
335
343
  var v = o.selectionStart, w = o.selectionEnd;
336
- M.current = { selectionStart: v, selectionEnd: w + u };
337
- }, De = function(o) {
338
- var u = o.target, v = u.value, w = ue(v, o, re.event);
339
- w && x(o), M.current = void 0;
344
+ L.current = { selectionStart: v, selectionEnd: w + u };
340
345
  }, Ie = function(o) {
346
+ var u = o.target, v = u.value, w = ue(v, o, ee.event);
347
+ w && x(o), L.current = void 0;
348
+ }, Ce = function(o) {
341
349
  var u = o.target, v = o.key, w = u.selectionStart, _ = u.selectionEnd, D = u.value;
342
350
  D === void 0 && (D = "");
343
351
  var b;
@@ -352,58 +360,58 @@ function He(e) {
352
360
  var Z = b;
353
361
  if (G) {
354
362
  var le = v === "ArrowLeft" ? "left" : "right";
355
- Z = O(D, b, le), Z !== b && o.preventDefault();
356
- } else v === "Delete" && !F(D[b]) ? Z = O(D, b, "right") : v === "Backspace" && !F(D[b]) && (Z = O(D, b, "left"));
363
+ Z = T(D, b, le), Z !== b && o.preventDefault();
364
+ } else v === "Delete" && !F(D[b]) ? Z = T(D, b, "right") : v === "Backspace" && !F(D[b]) && (Z = T(D, b, "left"));
357
365
  Z !== b && E(u, Z, D), y(o), fe(u, K);
358
- }, Ce = function(o) {
366
+ }, Ee = function(o) {
359
367
  var u = o.target, v = function() {
360
368
  var w = u.selectionStart, _ = u.selectionEnd, D = u.value;
361
369
  if (D === void 0 && (D = ""), w === _) {
362
- var b = O(D, w);
370
+ var b = T(D, w);
363
371
  b !== w && E(u, b, D);
364
372
  }
365
373
  };
366
374
  v(), requestAnimationFrame(function() {
367
375
  v();
368
- }), s(o), fe(u);
369
- }, Ee = function(o) {
376
+ }), l(o), fe(u);
377
+ }, Re = function(o) {
370
378
  o.persist && o.persist();
371
379
  var u = o.target, v = o.currentTarget;
372
- l.current = u, N.current.focusTimeout = setTimeout(function() {
380
+ s.current = u, N.current.focusTimeout = setTimeout(function() {
373
381
  var w = u.selectionStart, _ = u.selectionEnd, D = u.value;
374
382
  D === void 0 && (D = "");
375
- var b = O(D, w);
383
+ var b = T(D, w);
376
384
  b !== w && !(w === 0 && _ === D.length) && E(u, b, D), I(Object.assign(Object.assign({}, o), { currentTarget: v }));
377
385
  }, 0);
378
- }, Re = function(o) {
379
- l.current = null, clearTimeout(N.current.focusTimeout), clearTimeout(N.current.setCaretTimeout), C(o);
380
- }, Ae = ee && We() ? "numeric" : void 0, ve = Object.assign({ inputMode: Ae }, j, {
386
+ }, Ae = function(o) {
387
+ s.current = null, clearTimeout(N.current.focusTimeout), clearTimeout(N.current.setCaretTimeout), C(o);
388
+ }, Oe = te && We() ? "numeric" : void 0, ve = Object.assign({ inputMode: Oe }, j, {
381
389
  type: t,
382
390
  value: V,
383
- onChange: De,
384
- onKeyDown: Ie,
385
- onMouseUp: Ce,
386
- onFocus: Ee,
387
- onBlur: Re
391
+ onChange: Ie,
392
+ onKeyDown: Ce,
393
+ onMouseUp: Ee,
394
+ onFocus: Re,
395
+ onBlur: Ae
388
396
  });
389
397
  if (r === "text")
390
- return a ? X.createElement(X.Fragment, null, a(V, j) || null) : X.createElement("span", Object.assign({}, j, { ref: i }), V);
398
+ return a ? Y.createElement(Y.Fragment, null, a(V, j) || null) : Y.createElement("span", Object.assign({}, j, { ref: i }), V);
391
399
  if (n) {
392
- var Oe = n;
393
- return X.createElement(Oe, Object.assign({}, ve, { ref: i }));
400
+ var Te = n;
401
+ return Y.createElement(Te, Object.assign({}, ve, { ref: i }));
394
402
  }
395
- return X.createElement("input", Object.assign({}, ve, { ref: i }));
403
+ return Y.createElement("input", Object.assign({}, ve, { ref: i }));
396
404
  }
397
- function he(e, t) {
405
+ function Se(e, t) {
398
406
  var r = t.decimalScale, n = t.fixedDecimalScale, a = t.prefix;
399
407
  a === void 0 && (a = "");
400
408
  var i = t.suffix;
401
409
  i === void 0 && (i = "");
402
- var f = t.allowNegative, m = t.thousandsGroupStyle;
403
- if (m === void 0 && (m = "thousand"), e === "" || e === "-")
410
+ var f = t.allowNegative, S = t.thousandsGroupStyle;
411
+ if (S === void 0 && (S = "thousand"), e === "" || e === "-")
404
412
  return e;
405
- var S = ie(t), p = S.thousandSeparator, h = S.decimalSeparator, c = r !== 0 && e.indexOf(".") !== -1 || r && n, x = se(e, f), y = x.beforeDecimal, s = x.afterDecimal, I = x.addNegation;
406
- return r !== void 0 && (s = ye(s, r, !!n)), p && (y = Le(y, p, m)), a && (y = a + y), i && (s = s + i), I && (y = "-" + y), e = y + (c && h || "") + s, e;
413
+ var m = ie(t), p = m.thousandSeparator, h = m.decimalSeparator, c = r !== 0 && e.indexOf(".") !== -1 || r && n, x = ce(e, f), y = x.beforeDecimal, l = x.afterDecimal, I = x.addNegation;
414
+ return r !== void 0 && (l = be(l, r, !!n)), p && (y = Le(y, p, S)), a && (y = a + y), i && (l = l + i), I && (y = "-" + y), e = y + (c && h || "") + l, e;
407
415
  }
408
416
  function ie(e) {
409
417
  var t = e.decimalSeparator;
@@ -421,7 +429,7 @@ function Je(e, t) {
421
429
  return e = e.replace(/-/g, ""), a && !i && t && (e = "-" + e), e;
422
430
  }
423
431
  function Qe(e, t) {
424
- return new RegExp("(^-)|[0-9]|" + xe(e), "g");
432
+ return new RegExp("(^-)|[0-9]|" + ye(e), "g");
425
433
  }
426
434
  function Xe(e, t, r) {
427
435
  return e === "" ? !0 : !t?.match(/\d/) && !r?.match(/\d/) && typeof e == "string" && !isNaN(Number(e));
@@ -433,32 +441,32 @@ function Ye(e, t, r) {
433
441
  i === void 0 && (i = "");
434
442
  var f = r.suffix;
435
443
  f === void 0 && (f = "");
436
- var m = r.decimalScale, S = t.from, p = t.to, h = p.start, c = p.end, x = ie(r), y = x.allowedDecimalSeparators, s = x.decimalSeparator, I = e[c] === s;
444
+ var S = r.decimalScale, m = t.from, p = t.to, h = p.start, c = p.end, x = ie(r), y = x.allowedDecimalSeparators, l = x.decimalSeparator, I = e[c] === l;
437
445
  if (ae(e) && (e === i || e === f) && t.lastValue === "")
438
446
  return e;
439
447
  if (c - h === 1 && y.indexOf(e[h]) !== -1) {
440
- var C = m === 0 ? "" : s;
448
+ var C = S === 0 ? "" : l;
441
449
  e = e.substring(0, h) + C + e.substring(h + 1, e.length);
442
450
  }
443
- var g = function(l, N, R) {
451
+ var g = function(s, N, R) {
444
452
  var A = !1, E = !1;
445
- i.startsWith("-") ? A = !1 : l.startsWith("--") ? (A = !1, E = !0) : f.startsWith("-") && l.length === f.length ? A = !1 : l[0] === "-" && (A = !0);
446
- var O = A ? 1 : 0;
447
- return E && (O = 2), O && (l = l.substring(O), N -= O, R -= O), { value: l, start: N, end: R, hasNegation: A };
453
+ i.startsWith("-") ? A = !1 : s.startsWith("--") ? (A = !1, E = !0) : f.startsWith("-") && s.length === f.length ? A = !1 : s[0] === "-" && (A = !0);
454
+ var T = A ? 1 : 0;
455
+ return E && (T = 2), T && (s = s.substring(T), N -= T, R -= T), { value: s, start: N, end: R, hasNegation: A };
448
456
  }, B = g(e, h, c), F = B.hasNegation;
449
457
  n = B, e = n.value, h = n.start, c = n.end;
450
- var k = g(t.lastValue, S.start, S.end), j = k.start, z = k.end, P = k.value, V = e.substring(h, c);
451
- e.length && P.length && (j > P.length - f.length || z < i.length) && !(V && f.startsWith(V)) && (e = P);
452
- var L = 0;
453
- e.startsWith(i) ? L += i.length : h < i.length && (L = h), e = e.substring(L), c -= L;
454
- var W = e.length, M = e.length - f.length;
455
- e.endsWith(f) ? W = M : (c > M || c > e.length - f.length) && (W = c), e = e.substring(0, W), e = Je(F ? "-" + e : e, a), e = (e.match(Qe(s)) || []).join("");
456
- var U = e.indexOf(s);
457
- e = e.replace(new RegExp(xe(s), "g"), function(l, N) {
458
+ var k = g(t.lastValue, m.start, m.end), j = k.start, H = k.end, P = k.value, V = e.substring(h, c);
459
+ e.length && P.length && (j > P.length - f.length || H < i.length) && !(V && f.startsWith(V)) && (e = P);
460
+ var M = 0;
461
+ e.startsWith(i) ? M += i.length : h < i.length && (M = h), e = e.substring(M), c -= M;
462
+ var W = e.length, L = e.length - f.length;
463
+ e.endsWith(f) ? W = L : (c > L || c > e.length - f.length) && (W = c), e = e.substring(0, W), e = Je(F ? "-" + e : e, a), e = (e.match(Qe(l)) || []).join("");
464
+ var U = e.indexOf(l);
465
+ e = e.replace(new RegExp(ye(l), "g"), function(s, N) {
458
466
  return N === U ? "." : "";
459
467
  });
460
- var $ = se(e, a), J = $.beforeDecimal, ee = $.afterDecimal, d = $.addNegation;
461
- return p.end - p.start < S.end - S.start && J === "" && I && !parseFloat(ee) && (e = d ? "-" : ""), e;
468
+ var $ = ce(e, a), Q = $.beforeDecimal, te = $.afterDecimal, d = $.addNegation;
469
+ return p.end - p.start < m.end - m.start && Q === "" && I && !parseFloat(te) && (e = d ? "-" : ""), e;
462
470
  }
463
471
  function et(e, t) {
464
472
  var r = t.prefix;
@@ -468,7 +476,7 @@ function et(e, t) {
468
476
  var a = Array.from({ length: e.length + 1 }).map(function() {
469
477
  return !0;
470
478
  }), i = e[0] === "-";
471
- a.fill(!1, 0, r.length + (i ? 1 : 0));
479
+ a.fill(!1, 0, Math.min(r.length + (i ? 1 : 0), e.length));
472
480
  var f = e.length;
473
481
  return a.fill(!1, f - n.length + 1, f + 1), a;
474
482
  }
@@ -494,19 +502,19 @@ function rt(e) {
494
502
  a === void 0 && (a = q);
495
503
  var i = e.onBlur;
496
504
  i === void 0 && (i = q);
497
- var f = e.thousandSeparator, m = e.decimalScale, S = e.fixedDecimalScale, p = e.prefix;
505
+ var f = e.thousandSeparator, S = e.decimalScale, m = e.fixedDecimalScale, p = e.prefix;
498
506
  p === void 0 && (p = "");
499
- var h = e.defaultValue, c = e.value, x = e.valueIsNumericString, y = e.onValueChange, s = Se(e, ["decimalSeparator", "allowedDecimalSeparators", "thousandsGroupStyle", "suffix", "allowNegative", "allowLeadingZeros", "onKeyDown", "onBlur", "thousandSeparator", "decimalScale", "fixedDecimalScale", "prefix", "defaultValue", "value", "valueIsNumericString", "onValueChange"]), I = ie(e), C = I.decimalSeparator, g = I.allowedDecimalSeparators, B = function(d) {
500
- return he(d, e);
501
- }, F = function(d, l) {
502
- return Ye(d, l, e);
503
- }, k = Y(c) ? h : c, j = x ?? Xe(k, p, t);
504
- Y(c) ? Y(h) || (j = j || typeof h == "number") : j = j || typeof c == "number";
505
- var z = function(d) {
506
- return pe(d) ? d : (typeof d == "number" && (d = be(d)), j && typeof m == "number" ? ge(d, m, !!S) : d);
507
- }, P = Ne(z(c), z(h), !!j, B, F, y), V = P[0], L = V.numAsString, W = V.formattedValue, M = P[1], U = function(d) {
508
- var l = d.target, N = d.key, R = l.selectionStart, A = l.selectionEnd, E = l.value;
509
- if (E === void 0 && (E = ""), (N === "Backspace" || N === "Delete") && A < p.length) {
507
+ var h = e.defaultValue, c = e.value, x = e.valueIsNumericString, y = e.onValueChange, l = pe(e, ["decimalSeparator", "allowedDecimalSeparators", "thousandsGroupStyle", "suffix", "allowNegative", "allowLeadingZeros", "onKeyDown", "onBlur", "thousandSeparator", "decimalScale", "fixedDecimalScale", "prefix", "defaultValue", "value", "valueIsNumericString", "onValueChange"]), I = ie(e), C = I.decimalSeparator, g = I.allowedDecimalSeparators, B = function(d) {
508
+ return Se(d, e);
509
+ }, F = function(d, s) {
510
+ return Ye(d, s, e);
511
+ }, k = z(c) ? h : c, j = x ?? Xe(k, p, t);
512
+ z(c) ? z(h) || (j = j || typeof h == "number") : j = j || typeof c == "number";
513
+ var H = function(d) {
514
+ return xe(d) ? d : (typeof d == "number" && (d = Ve(d)), j && typeof S == "number" ? me(d, S, !!m) : d);
515
+ }, P = we(H(c), H(h), !!j, B, F, y), V = P[0], M = V.numAsString, W = V.formattedValue, L = P[1], U = function(d) {
516
+ var s = d.target, N = d.key, R = s.selectionStart, A = s.selectionEnd, E = s.value;
517
+ if (E === void 0 && (E = ""), (N === "Backspace" || N === "Delete") && A < p.length && E !== "-") {
510
518
  d.preventDefault();
511
519
  return;
512
520
  }
@@ -514,37 +522,37 @@ function rt(e) {
514
522
  a(d);
515
523
  return;
516
524
  }
517
- N === "Backspace" && E[0] === "-" && R === p.length + 1 && r && H(l, 1), m && S && (N === "Backspace" && E[R - 1] === C ? (H(l, R - 1), d.preventDefault()) : N === "Delete" && E[R] === C && d.preventDefault()), g?.includes(N) && E[R] === C && H(l, R + 1);
518
- var O = f === !0 ? "," : f;
519
- N === "Backspace" && E[R - 1] === O && H(l, R - 1), N === "Delete" && E[R] === O && H(l, R + 1), a(d);
525
+ N === "Backspace" && E[0] === "-" && R === p.length + 1 && r && J(s, 1), S && m && (N === "Backspace" && E[R - 1] === C ? (J(s, R - 1), d.preventDefault()) : N === "Delete" && E[R] === C && d.preventDefault()), g?.includes(N) && E[R] === C && J(s, R + 1);
526
+ var T = f === !0 ? "," : f;
527
+ N === "Backspace" && E[R - 1] === T && J(s, R - 1), N === "Delete" && E[R] === T && J(s, R + 1), a(d);
520
528
  }, $ = function(d) {
521
- var l = L;
522
- if (l.match(/\d/g) || (l = ""), n || (l = ke(l)), S && m && (l = ge(l, m, S)), l !== L) {
523
- var N = he(l, e);
524
- M({
529
+ var s = M;
530
+ if (s.match(/\d/g) || (s = ""), n || (s = ke(s)), m && S && (s = me(s, S, m)), s !== M) {
531
+ var N = Se(s, e);
532
+ L({
525
533
  formattedValue: N,
526
- value: l,
527
- floatValue: parseFloat(l)
534
+ value: s,
535
+ floatValue: parseFloat(s)
528
536
  }, {
529
537
  event: d,
530
- source: re.event
538
+ source: ee.event
531
539
  });
532
540
  }
533
541
  i(d);
534
- }, J = function(d) {
542
+ }, Q = function(d) {
535
543
  return d === C ? !0 : ae(d);
536
- }, ee = function(d) {
537
- var l = d.currentValue, N = d.lastValue, R = d.formattedValue, A = d.currentValueIndex, E = d.formattedValueIndex, O = l[A], Q = R[E], oe = Ve(N, l), te = oe.to, ne = function(ue) {
544
+ }, te = function(d) {
545
+ var s = d.currentValue, N = d.lastValue, R = d.formattedValue, A = d.currentValueIndex, E = d.formattedValueIndex, T = s[A], X = R[E], oe = Ne(N, s), re = oe.to, ne = function(ue) {
538
546
  return F(ue).indexOf(".") + p.length;
539
547
  };
540
- return c === 0 && S && m && l[te.start] === C && ne(l) < A && ne(R) > E ? !1 : A >= te.start && A < te.end && g && g.includes(O) && Q === C ? !0 : O === Q;
548
+ return c === 0 && m && S && s[re.start] === C && ne(s) < A && ne(R) > E ? !1 : A >= re.start && A < re.end && g && g.includes(T) && X === C ? !0 : T === X;
541
549
  };
542
- return Object.assign(Object.assign({}, s), {
550
+ return Object.assign(Object.assign({}, l), {
543
551
  value: W,
544
552
  valueIsNumericString: !1,
545
- isValidInputCharacter: J,
546
- isCharacterSame: ee,
547
- onValueChange: M,
553
+ isValidInputCharacter: Q,
554
+ isCharacterSame: te,
555
+ onValueChange: L,
548
556
  format: B,
549
557
  removeFormatting: F,
550
558
  getCaretBoundary: function(d) {
@@ -556,34 +564,34 @@ function rt(e) {
556
564
  }
557
565
  function at(e) {
558
566
  var t = rt(e);
559
- return X.createElement(He, Object.assign({}, t));
567
+ return Y.createElement(He, Object.assign({}, t));
560
568
  }
561
- function we() {
569
+ function De() {
562
570
  return Intl.NumberFormat()?.formatToParts(1.1)?.find((r) => r.type === "decimal")?.value ?? ".";
563
571
  }
564
572
  function nt() {
565
- return we() === "." ? "," : ".";
573
+ return De() === "." ? "," : ".";
566
574
  }
567
575
  const ot = (e) => {
568
- const { value: t, onChange: r, disabled: n, highlight: a, validatedSelection: i, fixedDecimals: f, allowNegative: m, thousandSeparator: S, decimalSeparator: p } = e, h = T.useRef();
569
- return T.useLayoutEffect(() => {
576
+ const { value: t, onChange: r, disabled: n, highlight: a, validatedSelection: i, fixedDecimals: f, allowNegative: S, thousandSeparator: m, decimalSeparator: p } = e, h = O.useRef();
577
+ return O.useLayoutEffect(() => {
570
578
  if (i !== void 0) {
571
579
  const c = typeof i == "number" ? [i, null] : i;
572
580
  h.current?.setSelectionRange(c[0], c[1]);
573
581
  }
574
- }, [i]), T.createElement(
575
- Be,
582
+ }, [i]), O.createElement(
583
+ Fe,
576
584
  null,
577
- T.createElement(at, {
585
+ O.createElement(at, {
578
586
  autoFocus: !0,
579
587
  getInputRef: h,
580
588
  className: "gdg-input",
581
589
  onFocus: (c) => c.target.setSelectionRange(a ? 0 : c.target.value.length, c.target.value.length),
582
590
  disabled: n === !0,
583
591
  decimalScale: f,
584
- allowNegative: m,
585
- thousandSeparator: S ?? nt(),
586
- decimalSeparator: p ?? we(),
592
+ allowNegative: S,
593
+ thousandSeparator: m ?? nt(),
594
+ decimalSeparator: p ?? De(),
587
595
  value: Object.is(t, -0) ? "-" : t ?? "",
588
596
  // decimalScale={3}
589
597
  // prefix={"$"}