vue-spear-tip 0.2.14 → 0.2.16-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/.vite/manifest.json +32 -32
  2. package/dist/{Button-C-_LLCJ8.cjs → Button-CegdAQx1.cjs} +1 -1
  3. package/dist/{Button-D3wxk32n.js → Button-b6rBibUU.js} +1 -1
  4. package/dist/{CodeHighlight-BQkI0Qdb.cjs → CodeHighlight-D8u7i5q3.cjs} +1 -1
  5. package/dist/{CodeHighlight-hA59-wK0.js → CodeHighlight-DK_itct_.js} +1 -1
  6. package/dist/{DateField-CbD-7nJo.js → DateField-DzpU2RzG.js} +38 -7
  7. package/dist/DateField-TSP3qae_.cjs +31 -0
  8. package/dist/{FieldComponent.vue_vue_type_script_lang-BBV9PhxZ.cjs → FieldComponent.vue_vue_type_script_lang-CMmfE7TT.cjs} +1 -1
  9. package/dist/{FieldComponent.vue_vue_type_script_lang-D8oglWYI.js → FieldComponent.vue_vue_type_script_lang-CnnnJaoS.js} +1 -1
  10. package/dist/Interfaces/IBaseVueComponent.d.ts +1 -1
  11. package/dist/Interfaces/IFieldComponent.d.ts +2 -1
  12. package/dist/Interfaces/IGlobalVST.d.ts +1 -1
  13. package/dist/Interfaces/IVueClass.d.ts +15 -3
  14. package/dist/{SelectField-0sIO2oZ8.cjs → SelectField-Cos_iPFh.cjs} +1 -1
  15. package/dist/{SelectField-_DCw7asw.js → SelectField-Nf4hj-Jx.js} +2 -2
  16. package/dist/StringField-0X0z4bJq.js +2947 -0
  17. package/dist/StringField-EHq_XTp1.cjs +1 -0
  18. package/dist/SwitchField-Bys_uVdf.cjs +1 -0
  19. package/dist/SwitchField-DtXJEtoV.js +247 -0
  20. package/dist/{Tabs-Bdbmi4vp.js → Tabs-B0rOz5l4.js} +1 -1
  21. package/dist/{Tabs-Bs59wIyv.cjs → Tabs-zIXIin4o.cjs} +1 -1
  22. package/dist/{TextField-BiySwnpX.js → TextField-CEmB9He5.js} +2 -2
  23. package/dist/{TextField-D4LS0W8b.cjs → TextField-OQmwJdtJ.cjs} +1 -1
  24. package/dist/components/Elements/Button/ButtonInherited.d.ts +1 -1
  25. package/dist/components/Fields/DateField/IDateField.d.ts +1 -1
  26. package/dist/core/Props.d.ts +1 -1
  27. package/dist/core/VST.lib.d.ts +4 -0
  28. package/dist/core/VueClass.d.ts +10 -2
  29. package/dist/core/VueClassComponent.d.ts +2 -2
  30. package/dist/core/index.d.ts +2 -13
  31. package/dist/grid-style.css +1 -1
  32. package/dist/index-BN_QKlXx.cjs +1 -0
  33. package/dist/{index-Cb9JNh32.js → index-DtaxH9ox.js} +2089 -2050
  34. package/dist/replaceable/BaseComponent.vue +8 -80
  35. package/dist/replaceable/Elements/Button/ButtonInherited.d.ts +1 -1
  36. package/dist/replaceable/FieldComponent.vue +1 -1
  37. package/dist/vue-spear-tip.cjs.js +1 -1
  38. package/dist/vue-spear-tip.css +1 -1
  39. package/dist/vue-spear-tip.d.ts +3 -0
  40. package/dist/vue-spear-tip.es.js +1 -1
  41. package/docs/index.html +2 -2
  42. package/docs/static/{Button-DQufd156.js → Button-CeDK-PBR.js} +1 -1
  43. package/docs/static/{CodeHighlight-B3Ig4KDk.js → CodeHighlight-CwVuCJVt.js} +1 -1
  44. package/docs/static/DateField-D4RyJiyD.js +31 -0
  45. package/docs/static/{FieldComponent.vue_vue_type_script_lang-DvjF0ufQ.js → FieldComponent.vue_vue_type_script_lang-GFnG0VWx.js} +1 -1
  46. package/docs/static/{NoSymbolIcon-BcSCXTGD.js → NoSymbolIcon-Dq590q9t.js} +1 -1
  47. package/docs/static/{SelectField-CIZ_xg-o.js → SelectField-61XgjABZ.js} +1 -1
  48. package/docs/static/StringField-4jEXE2Iq.js +1 -0
  49. package/docs/static/StringField-DkTD1rGV.css +1 -0
  50. package/docs/static/SwitchField-BXh1DoSh.css +1 -0
  51. package/docs/static/SwitchField-CIYufM5H.js +1 -0
  52. package/docs/static/{Tabs-D191loy_.js → Tabs-DdDx4FlO.js} +1 -1
  53. package/docs/static/{TextField-o2QP_97x.js → TextField-BifW_QMR.js} +1 -1
  54. package/docs/static/index-DuaCcUUh.js +2 -0
  55. package/docs/static/main-BGO0apQg.js +119 -0
  56. package/docs/static/main-CPQng82-.css +1 -0
  57. package/package.json +2 -1
  58. package/dist/DateField--anXRYwD.cjs +0 -5
  59. package/dist/StringField-Dx9x3hG1.cjs +0 -1
  60. package/dist/StringField-Q6tdcgNE.js +0 -2949
  61. package/dist/SwitchField-D2CUl-83.js +0 -252
  62. package/dist/SwitchField-DF62AQwm.cjs +0 -1
  63. package/dist/index-C6zu8hmM.cjs +0 -1
  64. package/docs/static/DateField-C6BbToAd.js +0 -5
  65. package/docs/static/StringField-BJ5e1NcF.css +0 -1
  66. package/docs/static/StringField-DoqZ8gGA.js +0 -1
  67. package/docs/static/SwitchField-D1HrNcLY.css +0 -1
  68. package/docs/static/SwitchField-Db23H0Im.js +0 -1
  69. package/docs/static/index-F0CNC5Sw.js +0 -2
  70. package/docs/static/main-Bqckh-QL.css +0 -1
  71. package/docs/static/main-DkOCkEos.js +0 -95
@@ -0,0 +1,2947 @@
1
+ var Lt = Object.defineProperty;
2
+ var p = (r, t) => Lt(r, "name", { value: t, configurable: !0 });
3
+ import { P as C, C as ft, V as Nt } from "./index-DtaxH9ox.js";
4
+ import { F as Pt } from "./FieldComponent.vue_vue_type_script_lang-CnnnJaoS.js";
5
+ import { r as Ut } from "./NoSymbolIcon-aoAIVIx7.js";
6
+ import { createElementBlock as V, openBlock as A, createElementVNode as x, resolveComponent as st, normalizeClass as it, createCommentVNode as Y, createBlock as K, withKeys as $t, normalizeStyle as Yt, toDisplayString as at, resolveDynamicComponent as Kt, withCtx as zt, createTextVNode as jt } from "vue";
7
+ import { _ as Ht } from "./_plugin-vue_export-helper-B9nE8o7z.js";
8
+ function B(r) {
9
+ return typeof r == "string" || r instanceof String;
10
+ }
11
+ p(B, "isString");
12
+ function bt(r) {
13
+ var t;
14
+ return typeof r == "object" && r != null && (r == null || (t = r.constructor) == null ? void 0 : t.name) === "Object";
15
+ }
16
+ p(bt, "isObject");
17
+ function Dt(r, t) {
18
+ return Array.isArray(t) ? Dt(r, (e, s) => t.includes(s)) : Object.entries(r).reduce((e, s) => {
19
+ let [i, a] = s;
20
+ return t(a, i) && (e[i] = a), e;
21
+ }, {});
22
+ }
23
+ p(Dt, "pick");
24
+ const o = {
25
+ NONE: "NONE",
26
+ LEFT: "LEFT",
27
+ FORCE_LEFT: "FORCE_LEFT",
28
+ RIGHT: "RIGHT",
29
+ FORCE_RIGHT: "FORCE_RIGHT"
30
+ };
31
+ function Gt(r) {
32
+ switch (r) {
33
+ case o.LEFT:
34
+ return o.FORCE_LEFT;
35
+ case o.RIGHT:
36
+ return o.FORCE_RIGHT;
37
+ default:
38
+ return r;
39
+ }
40
+ }
41
+ p(Gt, "forceDirection");
42
+ function nt(r) {
43
+ return r.replace(/([.*+?^=!:${}()|[\]/\\])/g, "\\$1");
44
+ }
45
+ p(nt, "escapeRegExp");
46
+ function z(r, t) {
47
+ if (t === r) return !0;
48
+ const e = Array.isArray(t), s = Array.isArray(r);
49
+ let i;
50
+ if (e && s) {
51
+ if (t.length != r.length) return !1;
52
+ for (i = 0; i < t.length; i++) if (!z(t[i], r[i])) return !1;
53
+ return !0;
54
+ }
55
+ if (e != s) return !1;
56
+ if (t && r && typeof t == "object" && typeof r == "object") {
57
+ const a = t instanceof Date, n = r instanceof Date;
58
+ if (a && n) return t.getTime() == r.getTime();
59
+ if (a != n) return !1;
60
+ const u = t instanceof RegExp, h = r instanceof RegExp;
61
+ if (u && h) return t.toString() == r.toString();
62
+ if (u != h) return !1;
63
+ const l = Object.keys(t);
64
+ for (i = 0; i < l.length; i++) if (!Object.prototype.hasOwnProperty.call(r, l[i])) return !1;
65
+ for (i = 0; i < l.length; i++) if (!z(r[l[i]], t[l[i]])) return !1;
66
+ return !0;
67
+ } else if (t && r && typeof t == "function" && typeof r == "function")
68
+ return t.toString() === r.toString();
69
+ return !1;
70
+ }
71
+ p(z, "objectIncludes");
72
+ const mt = class mt {
73
+ /** Current input value */
74
+ /** Current cursor position */
75
+ /** Old input value */
76
+ /** Old selection */
77
+ constructor(t) {
78
+ for (Object.assign(this, t); this.value.slice(0, this.startChangePos) !== this.oldValue.slice(0, this.startChangePos); )
79
+ --this.oldSelection.start;
80
+ if (this.insertedCount)
81
+ for (; this.value.slice(this.cursorPos) !== this.oldValue.slice(this.oldSelection.end); )
82
+ this.value.length - this.cursorPos < this.oldValue.length - this.oldSelection.end ? ++this.oldSelection.end : ++this.cursorPos;
83
+ }
84
+ /** Start changing position */
85
+ get startChangePos() {
86
+ return Math.min(this.cursorPos, this.oldSelection.start);
87
+ }
88
+ /** Inserted symbols count */
89
+ get insertedCount() {
90
+ return this.cursorPos - this.startChangePos;
91
+ }
92
+ /** Inserted symbols */
93
+ get inserted() {
94
+ return this.value.substr(this.startChangePos, this.insertedCount);
95
+ }
96
+ /** Removed symbols count */
97
+ get removedCount() {
98
+ return Math.max(this.oldSelection.end - this.startChangePos || // for Delete
99
+ this.oldValue.length - this.value.length, 0);
100
+ }
101
+ /** Removed symbols */
102
+ get removed() {
103
+ return this.oldValue.substr(this.startChangePos, this.removedCount);
104
+ }
105
+ /** Unchanged head symbols */
106
+ get head() {
107
+ return this.value.substring(0, this.startChangePos);
108
+ }
109
+ /** Unchanged tail symbols */
110
+ get tail() {
111
+ return this.value.substring(this.startChangePos + this.insertedCount);
112
+ }
113
+ /** Remove direction */
114
+ get removeDirection() {
115
+ return !this.removedCount || this.insertedCount ? o.NONE : (this.oldSelection.end === this.cursorPos || this.oldSelection.start === this.cursorPos) && // if not range removed (event with backspace)
116
+ this.oldSelection.end === this.oldSelection.start ? o.RIGHT : o.LEFT;
117
+ }
118
+ };
119
+ p(mt, "ActionDetails");
120
+ let rt = mt;
121
+ function d(r, t) {
122
+ return new d.InputMask(r, t);
123
+ }
124
+ p(d, "IMask");
125
+ function Mt(r) {
126
+ if (r == null) throw new Error("mask property should be defined");
127
+ return r instanceof RegExp ? d.MaskedRegExp : B(r) ? d.MaskedPattern : r === Date ? d.MaskedDate : r === Number ? d.MaskedNumber : Array.isArray(r) || r === Array ? d.MaskedDynamic : d.Masked && r.prototype instanceof d.Masked ? r : d.Masked && r instanceof d.Masked ? r.constructor : r instanceof Function ? d.MaskedFunction : (console.warn("Mask not found for mask", r), d.Masked);
128
+ }
129
+ p(Mt, "maskedClass");
130
+ function N(r) {
131
+ if (!r) throw new Error("Options in not defined");
132
+ if (d.Masked) {
133
+ if (r.prototype instanceof d.Masked) return {
134
+ mask: r
135
+ };
136
+ const {
137
+ mask: t = void 0,
138
+ ...e
139
+ } = r instanceof d.Masked ? {
140
+ mask: r
141
+ } : bt(r) && r.mask instanceof d.Masked ? r : {};
142
+ if (t) {
143
+ const s = t.mask;
144
+ return {
145
+ ...Dt(t, (i, a) => !a.startsWith("_")),
146
+ mask: t.constructor,
147
+ _mask: s,
148
+ ...e
149
+ };
150
+ }
151
+ }
152
+ return bt(r) ? {
153
+ ...r
154
+ } : {
155
+ mask: r
156
+ };
157
+ }
158
+ p(N, "normalizeOpts");
159
+ function y(r) {
160
+ if (d.Masked && r instanceof d.Masked) return r;
161
+ const t = N(r), e = Mt(t.mask);
162
+ if (!e) throw new Error("Masked class is not found for provided mask " + t.mask + ", appropriate module needs to be imported manually before creating mask.");
163
+ return t.mask === e && delete t.mask, t._mask && (t.mask = t._mask, delete t._mask), new e(t);
164
+ }
165
+ p(y, "createMask");
166
+ d.createMask = y;
167
+ const kt = class kt {
168
+ /** */
169
+ /** */
170
+ /** */
171
+ /** Safely returns selection start */
172
+ get selectionStart() {
173
+ let t;
174
+ try {
175
+ t = this._unsafeSelectionStart;
176
+ } catch {
177
+ }
178
+ return t ?? this.value.length;
179
+ }
180
+ /** Safely returns selection end */
181
+ get selectionEnd() {
182
+ let t;
183
+ try {
184
+ t = this._unsafeSelectionEnd;
185
+ } catch {
186
+ }
187
+ return t ?? this.value.length;
188
+ }
189
+ /** Safely sets element selection */
190
+ select(t, e) {
191
+ if (!(t == null || e == null || t === this.selectionStart && e === this.selectionEnd))
192
+ try {
193
+ this._unsafeSelect(t, e);
194
+ } catch {
195
+ }
196
+ }
197
+ /** */
198
+ get isActive() {
199
+ return !1;
200
+ }
201
+ /** */
202
+ /** */
203
+ /** */
204
+ };
205
+ p(kt, "MaskElement");
206
+ let P = kt;
207
+ d.MaskElement = P;
208
+ const wt = 90, qt = 89, gt = class gt extends P {
209
+ /** HTMLElement to use mask on */
210
+ constructor(t) {
211
+ super(), this.input = t, this._onKeydown = this._onKeydown.bind(this), this._onInput = this._onInput.bind(this), this._onBeforeinput = this._onBeforeinput.bind(this), this._onCompositionEnd = this._onCompositionEnd.bind(this);
212
+ }
213
+ get rootElement() {
214
+ var t, e, s;
215
+ return (t = (e = (s = this.input).getRootNode) == null ? void 0 : e.call(s)) != null ? t : document;
216
+ }
217
+ /** Is element in focus */
218
+ get isActive() {
219
+ return this.input === this.rootElement.activeElement;
220
+ }
221
+ /** Binds HTMLElement events to mask internal events */
222
+ bindEvents(t) {
223
+ this.input.addEventListener("keydown", this._onKeydown), this.input.addEventListener("input", this._onInput), this.input.addEventListener("beforeinput", this._onBeforeinput), this.input.addEventListener("compositionend", this._onCompositionEnd), this.input.addEventListener("drop", t.drop), this.input.addEventListener("click", t.click), this.input.addEventListener("focus", t.focus), this.input.addEventListener("blur", t.commit), this._handlers = t;
224
+ }
225
+ _onKeydown(t) {
226
+ if (this._handlers.redo && (t.keyCode === wt && t.shiftKey && (t.metaKey || t.ctrlKey) || t.keyCode === qt && t.ctrlKey))
227
+ return t.preventDefault(), this._handlers.redo(t);
228
+ if (this._handlers.undo && t.keyCode === wt && (t.metaKey || t.ctrlKey))
229
+ return t.preventDefault(), this._handlers.undo(t);
230
+ t.isComposing || this._handlers.selectionChange(t);
231
+ }
232
+ _onBeforeinput(t) {
233
+ if (t.inputType === "historyUndo" && this._handlers.undo)
234
+ return t.preventDefault(), this._handlers.undo(t);
235
+ if (t.inputType === "historyRedo" && this._handlers.redo)
236
+ return t.preventDefault(), this._handlers.redo(t);
237
+ }
238
+ _onCompositionEnd(t) {
239
+ this._handlers.input(t);
240
+ }
241
+ _onInput(t) {
242
+ t.isComposing || this._handlers.input(t);
243
+ }
244
+ /** Unbinds HTMLElement events to mask internal events */
245
+ unbindEvents() {
246
+ this.input.removeEventListener("keydown", this._onKeydown), this.input.removeEventListener("input", this._onInput), this.input.removeEventListener("beforeinput", this._onBeforeinput), this.input.removeEventListener("compositionend", this._onCompositionEnd), this.input.removeEventListener("drop", this._handlers.drop), this.input.removeEventListener("click", this._handlers.click), this.input.removeEventListener("focus", this._handlers.focus), this.input.removeEventListener("blur", this._handlers.commit), this._handlers = {};
247
+ }
248
+ };
249
+ p(gt, "HTMLMaskElement");
250
+ let O = gt;
251
+ d.HTMLMaskElement = O;
252
+ const _t = class _t extends O {
253
+ /** InputElement to use mask on */
254
+ constructor(t) {
255
+ super(t), this.input = t;
256
+ }
257
+ /** Returns InputElement selection start */
258
+ get _unsafeSelectionStart() {
259
+ return this.input.selectionStart != null ? this.input.selectionStart : this.value.length;
260
+ }
261
+ /** Returns InputElement selection end */
262
+ get _unsafeSelectionEnd() {
263
+ return this.input.selectionEnd;
264
+ }
265
+ /** Sets InputElement selection */
266
+ _unsafeSelect(t, e) {
267
+ this.input.setSelectionRange(t, e);
268
+ }
269
+ get value() {
270
+ return this.input.value;
271
+ }
272
+ set value(t) {
273
+ this.input.value = t;
274
+ }
275
+ };
276
+ p(_t, "HTMLInputMaskElement");
277
+ let ut = _t;
278
+ d.HTMLMaskElement = O;
279
+ const vt = class vt extends O {
280
+ /** Returns HTMLElement selection start */
281
+ get _unsafeSelectionStart() {
282
+ const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset, i = e && e.focusOffset;
283
+ return i == null || s == null || s < i ? s : i;
284
+ }
285
+ /** Returns HTMLElement selection end */
286
+ get _unsafeSelectionEnd() {
287
+ const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset, i = e && e.focusOffset;
288
+ return i == null || s == null || s > i ? s : i;
289
+ }
290
+ /** Sets HTMLElement selection */
291
+ _unsafeSelect(t, e) {
292
+ if (!this.rootElement.createRange) return;
293
+ const s = this.rootElement.createRange();
294
+ s.setStart(this.input.firstChild || this.input, t), s.setEnd(this.input.lastChild || this.input, e);
295
+ const i = this.rootElement, a = i.getSelection && i.getSelection();
296
+ a && (a.removeAllRanges(), a.addRange(s));
297
+ }
298
+ /** HTMLElement value */
299
+ get value() {
300
+ return this.input.textContent || "";
301
+ }
302
+ set value(t) {
303
+ this.input.textContent = t;
304
+ }
305
+ };
306
+ p(vt, "HTMLContenteditableMaskElement");
307
+ let j = vt;
308
+ d.HTMLContenteditableMaskElement = j;
309
+ const X = class X {
310
+ constructor() {
311
+ this.states = [], this.currentIndex = 0;
312
+ }
313
+ get currentState() {
314
+ return this.states[this.currentIndex];
315
+ }
316
+ get isEmpty() {
317
+ return this.states.length === 0;
318
+ }
319
+ push(t) {
320
+ this.currentIndex < this.states.length - 1 && (this.states.length = this.currentIndex + 1), this.states.push(t), this.states.length > X.MAX_LENGTH && this.states.shift(), this.currentIndex = this.states.length - 1;
321
+ }
322
+ go(t) {
323
+ return this.currentIndex = Math.min(Math.max(this.currentIndex + t, 0), this.states.length - 1), this.currentState;
324
+ }
325
+ undo() {
326
+ return this.go(-1);
327
+ }
328
+ redo() {
329
+ return this.go(1);
330
+ }
331
+ clear() {
332
+ this.states.length = 0, this.currentIndex = 0;
333
+ }
334
+ };
335
+ p(X, "InputHistory");
336
+ let H = X;
337
+ H.MAX_LENGTH = 100;
338
+ const Ct = class Ct {
339
+ /**
340
+ View element
341
+ */
342
+ /** Internal {@link Masked} model */
343
+ constructor(t, e) {
344
+ this.el = t instanceof P ? t : t.isContentEditable && t.tagName !== "INPUT" && t.tagName !== "TEXTAREA" ? new j(t) : new ut(t), this.masked = y(e), this._listeners = {}, this._value = "", this._unmaskedValue = "", this._rawInputValue = "", this.history = new H(), this._saveSelection = this._saveSelection.bind(this), this._onInput = this._onInput.bind(this), this._onChange = this._onChange.bind(this), this._onDrop = this._onDrop.bind(this), this._onFocus = this._onFocus.bind(this), this._onClick = this._onClick.bind(this), this._onUndo = this._onUndo.bind(this), this._onRedo = this._onRedo.bind(this), this.alignCursor = this.alignCursor.bind(this), this.alignCursorFriendly = this.alignCursorFriendly.bind(this), this._bindEvents(), this.updateValue(), this._onChange();
345
+ }
346
+ maskEquals(t) {
347
+ var e;
348
+ return t == null || ((e = this.masked) == null ? void 0 : e.maskEquals(t));
349
+ }
350
+ /** Masked */
351
+ get mask() {
352
+ return this.masked.mask;
353
+ }
354
+ set mask(t) {
355
+ if (this.maskEquals(t)) return;
356
+ if (!(t instanceof d.Masked) && this.masked.constructor === Mt(t)) {
357
+ this.masked.updateOptions({
358
+ mask: t
359
+ });
360
+ return;
361
+ }
362
+ const e = t instanceof d.Masked ? t : y({
363
+ mask: t
364
+ });
365
+ e.unmaskedValue = this.masked.unmaskedValue, this.masked = e;
366
+ }
367
+ /** Raw value */
368
+ get value() {
369
+ return this._value;
370
+ }
371
+ set value(t) {
372
+ this.value !== t && (this.masked.value = t, this.updateControl("auto"));
373
+ }
374
+ /** Unmasked value */
375
+ get unmaskedValue() {
376
+ return this._unmaskedValue;
377
+ }
378
+ set unmaskedValue(t) {
379
+ this.unmaskedValue !== t && (this.masked.unmaskedValue = t, this.updateControl("auto"));
380
+ }
381
+ /** Raw input value */
382
+ get rawInputValue() {
383
+ return this._rawInputValue;
384
+ }
385
+ set rawInputValue(t) {
386
+ this.rawInputValue !== t && (this.masked.rawInputValue = t, this.updateControl(), this.alignCursor());
387
+ }
388
+ /** Typed unmasked value */
389
+ get typedValue() {
390
+ return this.masked.typedValue;
391
+ }
392
+ set typedValue(t) {
393
+ this.masked.typedValueEquals(t) || (this.masked.typedValue = t, this.updateControl("auto"));
394
+ }
395
+ /** Display value */
396
+ get displayValue() {
397
+ return this.masked.displayValue;
398
+ }
399
+ /** Starts listening to element events */
400
+ _bindEvents() {
401
+ this.el.bindEvents({
402
+ selectionChange: this._saveSelection,
403
+ input: this._onInput,
404
+ drop: this._onDrop,
405
+ click: this._onClick,
406
+ focus: this._onFocus,
407
+ commit: this._onChange,
408
+ undo: this._onUndo,
409
+ redo: this._onRedo
410
+ });
411
+ }
412
+ /** Stops listening to element events */
413
+ _unbindEvents() {
414
+ this.el && this.el.unbindEvents();
415
+ }
416
+ /** Fires custom event */
417
+ _fireEvent(t, e) {
418
+ const s = this._listeners[t];
419
+ s && s.forEach((i) => i(e));
420
+ }
421
+ /** Current selection start */
422
+ get selectionStart() {
423
+ return this._cursorChanging ? this._changingCursorPos : this.el.selectionStart;
424
+ }
425
+ /** Current cursor position */
426
+ get cursorPos() {
427
+ return this._cursorChanging ? this._changingCursorPos : this.el.selectionEnd;
428
+ }
429
+ set cursorPos(t) {
430
+ !this.el || !this.el.isActive || (this.el.select(t, t), this._saveSelection());
431
+ }
432
+ /** Stores current selection */
433
+ _saveSelection() {
434
+ this.displayValue !== this.el.value && console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."), this._selection = {
435
+ start: this.selectionStart,
436
+ end: this.cursorPos
437
+ };
438
+ }
439
+ /** Syncronizes model value from view */
440
+ updateValue() {
441
+ this.masked.value = this.el.value, this._value = this.masked.value, this._unmaskedValue = this.masked.unmaskedValue, this._rawInputValue = this.masked.rawInputValue;
442
+ }
443
+ /** Syncronizes view from model value, fires change events */
444
+ updateControl(t) {
445
+ const e = this.masked.unmaskedValue, s = this.masked.value, i = this.masked.rawInputValue, a = this.displayValue, n = this.unmaskedValue !== e || this.value !== s || this._rawInputValue !== i;
446
+ this._unmaskedValue = e, this._value = s, this._rawInputValue = i, this.el.value !== a && (this.el.value = a), t === "auto" ? this.alignCursor() : t != null && (this.cursorPos = t), n && this._fireChangeEvents(), !this._historyChanging && (n || this.history.isEmpty) && this.history.push({
447
+ unmaskedValue: e,
448
+ selection: {
449
+ start: this.selectionStart,
450
+ end: this.cursorPos
451
+ }
452
+ });
453
+ }
454
+ /** Updates options with deep equal check, recreates {@link Masked} model if mask type changes */
455
+ updateOptions(t) {
456
+ const {
457
+ mask: e,
458
+ ...s
459
+ } = t, i = !this.maskEquals(e), a = this.masked.optionsIsChanged(s);
460
+ i && (this.mask = e), a && this.masked.updateOptions(s), (i || a) && this.updateControl();
461
+ }
462
+ /** Updates cursor */
463
+ updateCursor(t) {
464
+ t != null && (this.cursorPos = t, this._delayUpdateCursor(t));
465
+ }
466
+ /** Delays cursor update to support mobile browsers */
467
+ _delayUpdateCursor(t) {
468
+ this._abortUpdateCursor(), this._changingCursorPos = t, this._cursorChanging = setTimeout(() => {
469
+ this.el && (this.cursorPos = this._changingCursorPos, this._abortUpdateCursor());
470
+ }, 10);
471
+ }
472
+ /** Fires custom events */
473
+ _fireChangeEvents() {
474
+ this._fireEvent("accept", this._inputEvent), this.masked.isComplete && this._fireEvent("complete", this._inputEvent);
475
+ }
476
+ /** Aborts delayed cursor update */
477
+ _abortUpdateCursor() {
478
+ this._cursorChanging && (clearTimeout(this._cursorChanging), delete this._cursorChanging);
479
+ }
480
+ /** Aligns cursor to nearest available position */
481
+ alignCursor() {
482
+ this.cursorPos = this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos, o.LEFT));
483
+ }
484
+ /** Aligns cursor only if selection is empty */
485
+ alignCursorFriendly() {
486
+ this.selectionStart === this.cursorPos && this.alignCursor();
487
+ }
488
+ /** Adds listener on custom event */
489
+ on(t, e) {
490
+ return this._listeners[t] || (this._listeners[t] = []), this._listeners[t].push(e), this;
491
+ }
492
+ /** Removes custom event listener */
493
+ off(t, e) {
494
+ if (!this._listeners[t]) return this;
495
+ if (!e)
496
+ return delete this._listeners[t], this;
497
+ const s = this._listeners[t].indexOf(e);
498
+ return s >= 0 && this._listeners[t].splice(s, 1), this;
499
+ }
500
+ /** Handles view input event */
501
+ _onInput(t) {
502
+ this._inputEvent = t, this._abortUpdateCursor();
503
+ const e = new rt({
504
+ // new state
505
+ value: this.el.value,
506
+ cursorPos: this.cursorPos,
507
+ // old state
508
+ oldValue: this.displayValue,
509
+ oldSelection: this._selection
510
+ }), s = this.masked.rawInputValue, i = this.masked.splice(e.startChangePos, e.removed.length, e.inserted, e.removeDirection, {
511
+ input: !0,
512
+ raw: !0
513
+ }).offset, a = s === this.masked.rawInputValue ? e.removeDirection : o.NONE;
514
+ let n = this.masked.nearestInputPos(e.startChangePos + i, a);
515
+ a !== o.NONE && (n = this.masked.nearestInputPos(n, o.NONE)), this.updateControl(n), delete this._inputEvent;
516
+ }
517
+ /** Handles view change event and commits model value */
518
+ _onChange() {
519
+ this.displayValue !== this.el.value && this.updateValue(), this.masked.doCommit(), this.updateControl(), this._saveSelection();
520
+ }
521
+ /** Handles view drop event, prevents by default */
522
+ _onDrop(t) {
523
+ t.preventDefault(), t.stopPropagation();
524
+ }
525
+ /** Restore last selection on focus */
526
+ _onFocus(t) {
527
+ this.alignCursorFriendly();
528
+ }
529
+ /** Restore last selection on focus */
530
+ _onClick(t) {
531
+ this.alignCursorFriendly();
532
+ }
533
+ _onUndo() {
534
+ this._applyHistoryState(this.history.undo());
535
+ }
536
+ _onRedo() {
537
+ this._applyHistoryState(this.history.redo());
538
+ }
539
+ _applyHistoryState(t) {
540
+ t && (this._historyChanging = !0, this.unmaskedValue = t.unmaskedValue, this.el.select(t.selection.start, t.selection.end), this._saveSelection(), this._historyChanging = !1);
541
+ }
542
+ /** Unbind view events and removes element reference */
543
+ destroy() {
544
+ this._unbindEvents(), this._listeners.length = 0, delete this.el;
545
+ }
546
+ };
547
+ p(Ct, "InputMask");
548
+ let ht = Ct;
549
+ d.InputMask = ht;
550
+ const J = class J {
551
+ /** Inserted symbols */
552
+ /** Additional offset if any changes occurred before tail */
553
+ /** Raw inserted is used by dynamic mask */
554
+ /** Can skip chars */
555
+ static normalize(t) {
556
+ return Array.isArray(t) ? t : [t, new J()];
557
+ }
558
+ constructor(t) {
559
+ Object.assign(this, {
560
+ inserted: "",
561
+ rawInserted: "",
562
+ tailShift: 0,
563
+ skip: !1
564
+ }, t);
565
+ }
566
+ /** Aggregate changes */
567
+ aggregate(t) {
568
+ return this.inserted += t.inserted, this.rawInserted += t.rawInserted, this.tailShift += t.tailShift, this.skip = this.skip || t.skip, this;
569
+ }
570
+ /** Total offset considering all changes */
571
+ get offset() {
572
+ return this.tailShift + this.inserted.length;
573
+ }
574
+ get consumed() {
575
+ return !!this.rawInserted || this.skip;
576
+ }
577
+ equals(t) {
578
+ return this.inserted === t.inserted && this.tailShift === t.tailShift && this.rawInserted === t.rawInserted && this.skip === t.skip;
579
+ }
580
+ };
581
+ p(J, "ChangeDetails");
582
+ let c = J;
583
+ d.ChangeDetails = c;
584
+ const Et = class Et {
585
+ /** Tail value as string */
586
+ /** Tail start position */
587
+ /** Start position */
588
+ constructor(t, e, s) {
589
+ t === void 0 && (t = ""), e === void 0 && (e = 0), this.value = t, this.from = e, this.stop = s;
590
+ }
591
+ toString() {
592
+ return this.value;
593
+ }
594
+ extend(t) {
595
+ this.value += String(t);
596
+ }
597
+ appendTo(t) {
598
+ return t.append(this.toString(), {
599
+ tail: !0
600
+ }).aggregate(t._appendPlaceholder());
601
+ }
602
+ get state() {
603
+ return {
604
+ value: this.value,
605
+ from: this.from,
606
+ stop: this.stop
607
+ };
608
+ }
609
+ set state(t) {
610
+ Object.assign(this, t);
611
+ }
612
+ unshift(t) {
613
+ if (!this.value.length || t != null && this.from >= t) return "";
614
+ const e = this.value[0];
615
+ return this.value = this.value.slice(1), e;
616
+ }
617
+ shift() {
618
+ if (!this.value.length) return "";
619
+ const t = this.value[this.value.length - 1];
620
+ return this.value = this.value.slice(0, -1), t;
621
+ }
622
+ };
623
+ p(Et, "ContinuousTailDetails");
624
+ let F = Et;
625
+ const D = class D {
626
+ /** */
627
+ /** */
628
+ /** Transforms value before mask processing */
629
+ /** Transforms each char before mask processing */
630
+ /** Validates if value is acceptable */
631
+ /** Does additional processing at the end of editing */
632
+ /** Format typed value to string */
633
+ /** Parse string to get typed value */
634
+ /** Enable characters overwriting */
635
+ /** */
636
+ /** */
637
+ /** */
638
+ /** */
639
+ constructor(t) {
640
+ this._value = "", this._update({
641
+ ...D.DEFAULTS,
642
+ ...t
643
+ }), this._initialized = !0;
644
+ }
645
+ /** Sets and applies new options */
646
+ updateOptions(t) {
647
+ this.optionsIsChanged(t) && this.withValueRefresh(this._update.bind(this, t));
648
+ }
649
+ /** Sets new options */
650
+ _update(t) {
651
+ Object.assign(this, t);
652
+ }
653
+ /** Mask state */
654
+ get state() {
655
+ return {
656
+ _value: this.value,
657
+ _rawInputValue: this.rawInputValue
658
+ };
659
+ }
660
+ set state(t) {
661
+ this._value = t._value;
662
+ }
663
+ /** Resets value */
664
+ reset() {
665
+ this._value = "";
666
+ }
667
+ get value() {
668
+ return this._value;
669
+ }
670
+ set value(t) {
671
+ this.resolve(t, {
672
+ input: !0
673
+ });
674
+ }
675
+ /** Resolve new value */
676
+ resolve(t, e) {
677
+ e === void 0 && (e = {
678
+ input: !0
679
+ }), this.reset(), this.append(t, e, ""), this.doCommit();
680
+ }
681
+ get unmaskedValue() {
682
+ return this.value;
683
+ }
684
+ set unmaskedValue(t) {
685
+ this.resolve(t, {});
686
+ }
687
+ get typedValue() {
688
+ return this.parse ? this.parse(this.value, this) : this.unmaskedValue;
689
+ }
690
+ set typedValue(t) {
691
+ this.format ? this.value = this.format(t, this) : this.unmaskedValue = String(t);
692
+ }
693
+ /** Value that includes raw user input */
694
+ get rawInputValue() {
695
+ return this.extractInput(0, this.displayValue.length, {
696
+ raw: !0
697
+ });
698
+ }
699
+ set rawInputValue(t) {
700
+ this.resolve(t, {
701
+ raw: !0
702
+ });
703
+ }
704
+ get displayValue() {
705
+ return this.value;
706
+ }
707
+ get isComplete() {
708
+ return !0;
709
+ }
710
+ get isFilled() {
711
+ return this.isComplete;
712
+ }
713
+ /** Finds nearest input position in direction */
714
+ nearestInputPos(t, e) {
715
+ return t;
716
+ }
717
+ totalInputPositions(t, e) {
718
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), Math.min(this.displayValue.length, e - t);
719
+ }
720
+ /** Extracts value in range considering flags */
721
+ extractInput(t, e, s) {
722
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), this.displayValue.slice(t, e);
723
+ }
724
+ /** Extracts tail in range */
725
+ extractTail(t, e) {
726
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), new F(this.extractInput(t, e), t);
727
+ }
728
+ /** Appends tail */
729
+ appendTail(t) {
730
+ return B(t) && (t = new F(String(t))), t.appendTo(this);
731
+ }
732
+ /** Appends char */
733
+ _appendCharRaw(t, e) {
734
+ return t ? (this._value += t, new c({
735
+ inserted: t,
736
+ rawInserted: t
737
+ })) : new c();
738
+ }
739
+ /** Appends char */
740
+ _appendChar(t, e, s) {
741
+ e === void 0 && (e = {});
742
+ const i = this.state;
743
+ let a;
744
+ if ([t, a] = this.doPrepareChar(t, e), t && (a = a.aggregate(this._appendCharRaw(t, e)), !a.rawInserted && this.autofix === "pad")) {
745
+ const n = this.state;
746
+ this.state = i;
747
+ let u = this.pad(e);
748
+ const h = this._appendCharRaw(t, e);
749
+ u = u.aggregate(h), h.rawInserted || u.equals(a) ? a = u : this.state = n;
750
+ }
751
+ if (a.inserted) {
752
+ let n, u = this.doValidate(e) !== !1;
753
+ if (u && s != null) {
754
+ const h = this.state;
755
+ if (this.overwrite === !0) {
756
+ n = s.state;
757
+ for (let f = 0; f < a.rawInserted.length; ++f)
758
+ s.unshift(this.displayValue.length - a.tailShift);
759
+ }
760
+ let l = this.appendTail(s);
761
+ if (u = l.rawInserted.length === s.toString().length, !(u && l.inserted) && this.overwrite === "shift") {
762
+ this.state = h, n = s.state;
763
+ for (let f = 0; f < a.rawInserted.length; ++f)
764
+ s.shift();
765
+ l = this.appendTail(s), u = l.rawInserted.length === s.toString().length;
766
+ }
767
+ u && l.inserted && (this.state = h);
768
+ }
769
+ u || (a = new c(), this.state = i, s && n && (s.state = n));
770
+ }
771
+ return a;
772
+ }
773
+ /** Appends optional placeholder at the end */
774
+ _appendPlaceholder() {
775
+ return new c();
776
+ }
777
+ /** Appends optional eager placeholder at the end */
778
+ _appendEager() {
779
+ return new c();
780
+ }
781
+ /** Appends symbols considering flags */
782
+ append(t, e, s) {
783
+ if (!B(t)) throw new Error("value should be string");
784
+ const i = B(s) ? new F(String(s)) : s;
785
+ e != null && e.tail && (e._beforeTailState = this.state);
786
+ let a;
787
+ [t, a] = this.doPrepare(t, e);
788
+ for (let n = 0; n < t.length; ++n) {
789
+ const u = this._appendChar(t[n], e, i);
790
+ if (!u.rawInserted && !this.doSkipInvalid(t[n], e, i)) break;
791
+ a.aggregate(u);
792
+ }
793
+ return (this.eager === !0 || this.eager === "append") && e != null && e.input && t && a.aggregate(this._appendEager()), i != null && (a.tailShift += this.appendTail(i).tailShift), a;
794
+ }
795
+ remove(t, e) {
796
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), this._value = this.displayValue.slice(0, t) + this.displayValue.slice(e), new c();
797
+ }
798
+ /** Calls function and reapplies current value */
799
+ withValueRefresh(t) {
800
+ if (this._refreshing || !this._initialized) return t();
801
+ this._refreshing = !0;
802
+ const e = this.rawInputValue, s = this.value, i = t();
803
+ return this.rawInputValue = e, this.value && this.value !== s && s.indexOf(this.value) === 0 && (this.append(s.slice(this.displayValue.length), {}, ""), this.doCommit()), delete this._refreshing, i;
804
+ }
805
+ runIsolated(t) {
806
+ if (this._isolated || !this._initialized) return t(this);
807
+ this._isolated = !0;
808
+ const e = this.state, s = t(this);
809
+ return this.state = e, delete this._isolated, s;
810
+ }
811
+ doSkipInvalid(t, e, s) {
812
+ return !!this.skipInvalid;
813
+ }
814
+ /** Prepares string before mask processing */
815
+ doPrepare(t, e) {
816
+ return e === void 0 && (e = {}), c.normalize(this.prepare ? this.prepare(t, this, e) : t);
817
+ }
818
+ /** Prepares each char before mask processing */
819
+ doPrepareChar(t, e) {
820
+ return e === void 0 && (e = {}), c.normalize(this.prepareChar ? this.prepareChar(t, this, e) : t);
821
+ }
822
+ /** Validates if value is acceptable */
823
+ doValidate(t) {
824
+ return (!this.validate || this.validate(this.value, this, t)) && (!this.parent || this.parent.doValidate(t));
825
+ }
826
+ /** Does additional processing at the end of editing */
827
+ doCommit() {
828
+ this.commit && this.commit(this.value, this);
829
+ }
830
+ splice(t, e, s, i, a) {
831
+ s === void 0 && (s = ""), i === void 0 && (i = o.NONE), a === void 0 && (a = {
832
+ input: !0
833
+ });
834
+ const n = t + e, u = this.extractTail(n), h = this.eager === !0 || this.eager === "remove";
835
+ let l;
836
+ h && (i = Gt(i), l = this.extractInput(0, n, {
837
+ raw: !0
838
+ }));
839
+ let f = t;
840
+ const g = new c();
841
+ if (i !== o.NONE && (f = this.nearestInputPos(t, e > 1 && t !== 0 && !h ? o.NONE : i), g.tailShift = f - t), g.aggregate(this.remove(f)), h && i !== o.NONE && l === this.rawInputValue)
842
+ if (i === o.FORCE_LEFT) {
843
+ let E;
844
+ for (; l === this.rawInputValue && (E = this.displayValue.length); )
845
+ g.aggregate(new c({
846
+ tailShift: -1
847
+ })).aggregate(this.remove(E - 1));
848
+ } else i === o.FORCE_RIGHT && u.unshift();
849
+ return g.aggregate(this.append(s, a, u));
850
+ }
851
+ maskEquals(t) {
852
+ return this.mask === t;
853
+ }
854
+ optionsIsChanged(t) {
855
+ return !z(this, t);
856
+ }
857
+ typedValueEquals(t) {
858
+ const e = this.typedValue;
859
+ return t === e || D.EMPTY_VALUES.includes(t) && D.EMPTY_VALUES.includes(e) || (this.format ? this.format(t, this) === this.format(this.typedValue, this) : !1);
860
+ }
861
+ pad(t) {
862
+ return new c();
863
+ }
864
+ };
865
+ p(D, "Masked");
866
+ let _ = D;
867
+ _.DEFAULTS = {
868
+ skipInvalid: !0
869
+ };
870
+ _.EMPTY_VALUES = [void 0, null, ""];
871
+ d.Masked = _;
872
+ const b = class b {
873
+ /** */
874
+ constructor(t, e) {
875
+ t === void 0 && (t = []), e === void 0 && (e = 0), this.chunks = t, this.from = e;
876
+ }
877
+ toString() {
878
+ return this.chunks.map(String).join("");
879
+ }
880
+ extend(t) {
881
+ if (!String(t)) return;
882
+ t = B(t) ? new F(String(t)) : t;
883
+ const e = this.chunks[this.chunks.length - 1], s = e && // if stops are same or tail has no stop
884
+ (e.stop === t.stop || t.stop == null) && // if tail chunk goes just after last chunk
885
+ t.from === e.from + e.toString().length;
886
+ if (t instanceof F)
887
+ s ? e.extend(t.toString()) : this.chunks.push(t);
888
+ else if (t instanceof b) {
889
+ if (t.stop == null) {
890
+ let i;
891
+ for (; t.chunks.length && t.chunks[0].stop == null; )
892
+ i = t.chunks.shift(), i.from += t.from, this.extend(i);
893
+ }
894
+ t.toString() && (t.stop = t.blockIndex, this.chunks.push(t));
895
+ }
896
+ }
897
+ appendTo(t) {
898
+ if (!(t instanceof d.MaskedPattern))
899
+ return new F(this.toString()).appendTo(t);
900
+ const e = new c();
901
+ for (let s = 0; s < this.chunks.length; ++s) {
902
+ const i = this.chunks[s], a = t._mapPosToBlock(t.displayValue.length), n = i.stop;
903
+ let u;
904
+ if (n != null && // if block not found or stop is behind lastBlock
905
+ (!a || a.index <= n) && ((i instanceof b || // for continuous block also check if stop is exist
906
+ t._stops.indexOf(n) >= 0) && e.aggregate(t._appendPlaceholder(n)), u = i instanceof b && t._blocks[n]), u) {
907
+ const h = u.appendTail(i);
908
+ e.aggregate(h);
909
+ const l = i.toString().slice(h.rawInserted.length);
910
+ l && e.aggregate(t.append(l, {
911
+ tail: !0
912
+ }));
913
+ } else
914
+ e.aggregate(t.append(i.toString(), {
915
+ tail: !0
916
+ }));
917
+ }
918
+ return e;
919
+ }
920
+ get state() {
921
+ return {
922
+ chunks: this.chunks.map((t) => t.state),
923
+ from: this.from,
924
+ stop: this.stop,
925
+ blockIndex: this.blockIndex
926
+ };
927
+ }
928
+ set state(t) {
929
+ const {
930
+ chunks: e,
931
+ ...s
932
+ } = t;
933
+ Object.assign(this, s), this.chunks = e.map((i) => {
934
+ const a = "chunks" in i ? new b() : new F();
935
+ return a.state = i, a;
936
+ });
937
+ }
938
+ unshift(t) {
939
+ if (!this.chunks.length || t != null && this.from >= t) return "";
940
+ const e = t != null ? t - this.from : t;
941
+ let s = 0;
942
+ for (; s < this.chunks.length; ) {
943
+ const i = this.chunks[s], a = i.unshift(e);
944
+ if (i.toString()) {
945
+ if (!a) break;
946
+ ++s;
947
+ } else
948
+ this.chunks.splice(s, 1);
949
+ if (a) return a;
950
+ }
951
+ return "";
952
+ }
953
+ shift() {
954
+ if (!this.chunks.length) return "";
955
+ let t = this.chunks.length - 1;
956
+ for (; 0 <= t; ) {
957
+ const e = this.chunks[t], s = e.shift();
958
+ if (e.toString()) {
959
+ if (!s) break;
960
+ --t;
961
+ } else
962
+ this.chunks.splice(t, 1);
963
+ if (s) return s;
964
+ }
965
+ return "";
966
+ }
967
+ };
968
+ p(b, "ChunksTailDetails");
969
+ let G = b;
970
+ const Ft = class Ft {
971
+ constructor(t, e) {
972
+ this.masked = t, this._log = [];
973
+ const {
974
+ offset: s,
975
+ index: i
976
+ } = t._mapPosToBlock(e) || (e < 0 ? (
977
+ // first
978
+ {
979
+ index: 0,
980
+ offset: 0
981
+ }
982
+ ) : (
983
+ // last
984
+ {
985
+ index: this.masked._blocks.length,
986
+ offset: 0
987
+ }
988
+ ));
989
+ this.offset = s, this.index = i, this.ok = !1;
990
+ }
991
+ get block() {
992
+ return this.masked._blocks[this.index];
993
+ }
994
+ get pos() {
995
+ return this.masked._blockStartPos(this.index) + this.offset;
996
+ }
997
+ get state() {
998
+ return {
999
+ index: this.index,
1000
+ offset: this.offset,
1001
+ ok: this.ok
1002
+ };
1003
+ }
1004
+ set state(t) {
1005
+ Object.assign(this, t);
1006
+ }
1007
+ pushState() {
1008
+ this._log.push(this.state);
1009
+ }
1010
+ popState() {
1011
+ const t = this._log.pop();
1012
+ return t && (this.state = t), t;
1013
+ }
1014
+ bindBlock() {
1015
+ this.block || (this.index < 0 && (this.index = 0, this.offset = 0), this.index >= this.masked._blocks.length && (this.index = this.masked._blocks.length - 1, this.offset = this.block.displayValue.length));
1016
+ }
1017
+ _pushLeft(t) {
1018
+ for (this.pushState(), this.bindBlock(); 0 <= this.index; --this.index, this.offset = ((e = this.block) == null ? void 0 : e.displayValue.length) || 0) {
1019
+ var e;
1020
+ if (t()) return this.ok = !0;
1021
+ }
1022
+ return this.ok = !1;
1023
+ }
1024
+ _pushRight(t) {
1025
+ for (this.pushState(), this.bindBlock(); this.index < this.masked._blocks.length; ++this.index, this.offset = 0)
1026
+ if (t()) return this.ok = !0;
1027
+ return this.ok = !1;
1028
+ }
1029
+ pushLeftBeforeFilled() {
1030
+ return this._pushLeft(() => {
1031
+ if (!(this.block.isFixed || !this.block.value) && (this.offset = this.block.nearestInputPos(this.offset, o.FORCE_LEFT), this.offset !== 0))
1032
+ return !0;
1033
+ });
1034
+ }
1035
+ pushLeftBeforeInput() {
1036
+ return this._pushLeft(() => {
1037
+ if (!this.block.isFixed)
1038
+ return this.offset = this.block.nearestInputPos(this.offset, o.LEFT), !0;
1039
+ });
1040
+ }
1041
+ pushLeftBeforeRequired() {
1042
+ return this._pushLeft(() => {
1043
+ if (!(this.block.isFixed || this.block.isOptional && !this.block.value))
1044
+ return this.offset = this.block.nearestInputPos(this.offset, o.LEFT), !0;
1045
+ });
1046
+ }
1047
+ pushRightBeforeFilled() {
1048
+ return this._pushRight(() => {
1049
+ if (!(this.block.isFixed || !this.block.value) && (this.offset = this.block.nearestInputPos(this.offset, o.FORCE_RIGHT), this.offset !== this.block.value.length))
1050
+ return !0;
1051
+ });
1052
+ }
1053
+ pushRightBeforeInput() {
1054
+ return this._pushRight(() => {
1055
+ if (!this.block.isFixed)
1056
+ return this.offset = this.block.nearestInputPos(this.offset, o.NONE), !0;
1057
+ });
1058
+ }
1059
+ pushRightBeforeRequired() {
1060
+ return this._pushRight(() => {
1061
+ if (!(this.block.isFixed || this.block.isOptional && !this.block.value))
1062
+ return this.offset = this.block.nearestInputPos(this.offset, o.NONE), !0;
1063
+ });
1064
+ }
1065
+ };
1066
+ p(Ft, "PatternCursor");
1067
+ let lt = Ft;
1068
+ const At = class At {
1069
+ /** */
1070
+ /** */
1071
+ /** */
1072
+ /** */
1073
+ /** */
1074
+ /** */
1075
+ constructor(t) {
1076
+ Object.assign(this, t), this._value = "", this.isFixed = !0;
1077
+ }
1078
+ get value() {
1079
+ return this._value;
1080
+ }
1081
+ get unmaskedValue() {
1082
+ return this.isUnmasking ? this.value : "";
1083
+ }
1084
+ get rawInputValue() {
1085
+ return this._isRawInput ? this.value : "";
1086
+ }
1087
+ get displayValue() {
1088
+ return this.value;
1089
+ }
1090
+ reset() {
1091
+ this._isRawInput = !1, this._value = "";
1092
+ }
1093
+ remove(t, e) {
1094
+ return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), this._value = this._value.slice(0, t) + this._value.slice(e), this._value || (this._isRawInput = !1), new c();
1095
+ }
1096
+ nearestInputPos(t, e) {
1097
+ e === void 0 && (e = o.NONE);
1098
+ const s = 0, i = this._value.length;
1099
+ switch (e) {
1100
+ case o.LEFT:
1101
+ case o.FORCE_LEFT:
1102
+ return s;
1103
+ case o.NONE:
1104
+ case o.RIGHT:
1105
+ case o.FORCE_RIGHT:
1106
+ default:
1107
+ return i;
1108
+ }
1109
+ }
1110
+ totalInputPositions(t, e) {
1111
+ return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), this._isRawInput ? e - t : 0;
1112
+ }
1113
+ extractInput(t, e, s) {
1114
+ return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), s === void 0 && (s = {}), s.raw && this._isRawInput && this._value.slice(t, e) || "";
1115
+ }
1116
+ get isComplete() {
1117
+ return !0;
1118
+ }
1119
+ get isFilled() {
1120
+ return !!this._value;
1121
+ }
1122
+ _appendChar(t, e) {
1123
+ if (e === void 0 && (e = {}), this.isFilled) return new c();
1124
+ const s = this.eager === !0 || this.eager === "append", a = this.char === t && (this.isUnmasking || e.input || e.raw) && (!e.raw || !s) && !e.tail, n = new c({
1125
+ inserted: this.char,
1126
+ rawInserted: a ? this.char : ""
1127
+ });
1128
+ return this._value = this.char, this._isRawInput = a && (e.raw || e.input), n;
1129
+ }
1130
+ _appendEager() {
1131
+ return this._appendChar(this.char, {
1132
+ tail: !0
1133
+ });
1134
+ }
1135
+ _appendPlaceholder() {
1136
+ const t = new c();
1137
+ return this.isFilled || (this._value = t.inserted = this.char), t;
1138
+ }
1139
+ extractTail() {
1140
+ return new F("");
1141
+ }
1142
+ appendTail(t) {
1143
+ return B(t) && (t = new F(String(t))), t.appendTo(this);
1144
+ }
1145
+ append(t, e, s) {
1146
+ const i = this._appendChar(t[0], e);
1147
+ return s != null && (i.tailShift += this.appendTail(s).tailShift), i;
1148
+ }
1149
+ doCommit() {
1150
+ }
1151
+ get state() {
1152
+ return {
1153
+ _value: this._value,
1154
+ _rawInputValue: this.rawInputValue
1155
+ };
1156
+ }
1157
+ set state(t) {
1158
+ this._value = t._value, this._isRawInput = !!t._rawInputValue;
1159
+ }
1160
+ pad(t) {
1161
+ return this._appendPlaceholder();
1162
+ }
1163
+ };
1164
+ p(At, "PatternFixedDefinition");
1165
+ let q = At;
1166
+ const It = class It {
1167
+ /** */
1168
+ /** */
1169
+ /** */
1170
+ /** */
1171
+ /** */
1172
+ /** */
1173
+ /** */
1174
+ /** */
1175
+ constructor(t) {
1176
+ const {
1177
+ parent: e,
1178
+ isOptional: s,
1179
+ placeholderChar: i,
1180
+ displayChar: a,
1181
+ lazy: n,
1182
+ eager: u,
1183
+ ...h
1184
+ } = t;
1185
+ this.masked = y(h), Object.assign(this, {
1186
+ parent: e,
1187
+ isOptional: s,
1188
+ placeholderChar: i,
1189
+ displayChar: a,
1190
+ lazy: n,
1191
+ eager: u
1192
+ });
1193
+ }
1194
+ reset() {
1195
+ this.isFilled = !1, this.masked.reset();
1196
+ }
1197
+ remove(t, e) {
1198
+ return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), t === 0 && e >= 1 ? (this.isFilled = !1, this.masked.remove(t, e)) : new c();
1199
+ }
1200
+ get value() {
1201
+ return this.masked.value || (this.isFilled && !this.isOptional ? this.placeholderChar : "");
1202
+ }
1203
+ get unmaskedValue() {
1204
+ return this.masked.unmaskedValue;
1205
+ }
1206
+ get rawInputValue() {
1207
+ return this.masked.rawInputValue;
1208
+ }
1209
+ get displayValue() {
1210
+ return this.masked.value && this.displayChar || this.value;
1211
+ }
1212
+ get isComplete() {
1213
+ return !!this.masked.value || this.isOptional;
1214
+ }
1215
+ _appendChar(t, e) {
1216
+ if (e === void 0 && (e = {}), this.isFilled) return new c();
1217
+ const s = this.masked.state;
1218
+ let i = this.masked._appendChar(t, this.currentMaskFlags(e));
1219
+ return i.inserted && this.doValidate(e) === !1 && (i = new c(), this.masked.state = s), !i.inserted && !this.isOptional && !this.lazy && !e.input && (i.inserted = this.placeholderChar), i.skip = !i.inserted && !this.isOptional, this.isFilled = !!i.inserted, i;
1220
+ }
1221
+ append(t, e, s) {
1222
+ return this.masked.append(t, this.currentMaskFlags(e), s);
1223
+ }
1224
+ _appendPlaceholder() {
1225
+ return this.isFilled || this.isOptional ? new c() : (this.isFilled = !0, new c({
1226
+ inserted: this.placeholderChar
1227
+ }));
1228
+ }
1229
+ _appendEager() {
1230
+ return new c();
1231
+ }
1232
+ extractTail(t, e) {
1233
+ return this.masked.extractTail(t, e);
1234
+ }
1235
+ appendTail(t) {
1236
+ return this.masked.appendTail(t);
1237
+ }
1238
+ extractInput(t, e, s) {
1239
+ return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), this.masked.extractInput(t, e, s);
1240
+ }
1241
+ nearestInputPos(t, e) {
1242
+ e === void 0 && (e = o.NONE);
1243
+ const s = 0, i = this.value.length, a = Math.min(Math.max(t, s), i);
1244
+ switch (e) {
1245
+ case o.LEFT:
1246
+ case o.FORCE_LEFT:
1247
+ return this.isComplete ? a : s;
1248
+ case o.RIGHT:
1249
+ case o.FORCE_RIGHT:
1250
+ return this.isComplete ? a : i;
1251
+ case o.NONE:
1252
+ default:
1253
+ return a;
1254
+ }
1255
+ }
1256
+ totalInputPositions(t, e) {
1257
+ return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), this.value.slice(t, e).length;
1258
+ }
1259
+ doValidate(t) {
1260
+ return this.masked.doValidate(this.currentMaskFlags(t)) && (!this.parent || this.parent.doValidate(this.currentMaskFlags(t)));
1261
+ }
1262
+ doCommit() {
1263
+ this.masked.doCommit();
1264
+ }
1265
+ get state() {
1266
+ return {
1267
+ _value: this.value,
1268
+ _rawInputValue: this.rawInputValue,
1269
+ masked: this.masked.state,
1270
+ isFilled: this.isFilled
1271
+ };
1272
+ }
1273
+ set state(t) {
1274
+ this.masked.state = t.masked, this.isFilled = t.isFilled;
1275
+ }
1276
+ currentMaskFlags(t) {
1277
+ var e;
1278
+ return {
1279
+ ...t,
1280
+ _beforeTailState: (t == null || (e = t._beforeTailState) == null ? void 0 : e.masked) || t?._beforeTailState
1281
+ };
1282
+ }
1283
+ pad(t) {
1284
+ return new c();
1285
+ }
1286
+ };
1287
+ p(It, "PatternInputDefinition");
1288
+ let L = It;
1289
+ L.DEFAULT_DEFINITIONS = {
1290
+ 0: /\d/,
1291
+ a: /[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
1292
+ // http://stackoverflow.com/a/22075070
1293
+ "*": /./
1294
+ };
1295
+ const yt = class yt extends _ {
1296
+ /** */
1297
+ /** Enable characters overwriting */
1298
+ /** */
1299
+ /** */
1300
+ /** */
1301
+ updateOptions(t) {
1302
+ super.updateOptions(t);
1303
+ }
1304
+ _update(t) {
1305
+ const e = t.mask;
1306
+ e && (t.validate = (s) => s.search(e) >= 0), super._update(t);
1307
+ }
1308
+ };
1309
+ p(yt, "MaskedRegExp");
1310
+ let ot = yt;
1311
+ d.MaskedRegExp = ot;
1312
+ const M = class M extends _ {
1313
+ /** */
1314
+ /** */
1315
+ /** Single char for empty input */
1316
+ /** Single char for filled input */
1317
+ /** Show placeholder only when needed */
1318
+ /** Enable characters overwriting */
1319
+ /** */
1320
+ /** */
1321
+ /** */
1322
+ constructor(t) {
1323
+ super({
1324
+ ...M.DEFAULTS,
1325
+ ...t,
1326
+ definitions: Object.assign({}, L.DEFAULT_DEFINITIONS, t?.definitions)
1327
+ });
1328
+ }
1329
+ updateOptions(t) {
1330
+ super.updateOptions(t);
1331
+ }
1332
+ _update(t) {
1333
+ t.definitions = Object.assign({}, this.definitions, t.definitions), super._update(t), this._rebuildMask();
1334
+ }
1335
+ _rebuildMask() {
1336
+ const t = this.definitions;
1337
+ this._blocks = [], this.exposeBlock = void 0, this._stops = [], this._maskedBlocks = {};
1338
+ const e = this.mask;
1339
+ if (!e || !t) return;
1340
+ let s = !1, i = !1;
1341
+ for (let a = 0; a < e.length; ++a) {
1342
+ if (this.blocks) {
1343
+ const l = e.slice(a), f = Object.keys(this.blocks).filter((E) => l.indexOf(E) === 0);
1344
+ f.sort((E, $) => $.length - E.length);
1345
+ const g = f[0];
1346
+ if (g) {
1347
+ const {
1348
+ expose: E,
1349
+ repeat: $,
1350
+ ...Ot
1351
+ } = N(this.blocks[g]), Vt = {
1352
+ lazy: this.lazy,
1353
+ eager: this.eager,
1354
+ placeholderChar: this.placeholderChar,
1355
+ displayChar: this.displayChar,
1356
+ overwrite: this.overwrite,
1357
+ autofix: this.autofix,
1358
+ ...Ot,
1359
+ repeat: $,
1360
+ parent: this
1361
+ }, et = $ != null ? new d.RepeatBlock(
1362
+ Vt
1363
+ /* TODO */
1364
+ ) : y(Vt);
1365
+ et && (this._blocks.push(et), E && (this.exposeBlock = et), this._maskedBlocks[g] || (this._maskedBlocks[g] = []), this._maskedBlocks[g].push(this._blocks.length - 1)), a += g.length - 1;
1366
+ continue;
1367
+ }
1368
+ }
1369
+ let n = e[a], u = n in t;
1370
+ if (n === M.STOP_CHAR) {
1371
+ this._stops.push(this._blocks.length);
1372
+ continue;
1373
+ }
1374
+ if (n === "{" || n === "}") {
1375
+ s = !s;
1376
+ continue;
1377
+ }
1378
+ if (n === "[" || n === "]") {
1379
+ i = !i;
1380
+ continue;
1381
+ }
1382
+ if (n === M.ESCAPE_CHAR) {
1383
+ if (++a, n = e[a], !n) break;
1384
+ u = !1;
1385
+ }
1386
+ const h = u ? new L({
1387
+ isOptional: i,
1388
+ lazy: this.lazy,
1389
+ eager: this.eager,
1390
+ placeholderChar: this.placeholderChar,
1391
+ displayChar: this.displayChar,
1392
+ ...N(t[n]),
1393
+ parent: this
1394
+ }) : new q({
1395
+ char: n,
1396
+ eager: this.eager,
1397
+ isUnmasking: s
1398
+ });
1399
+ this._blocks.push(h);
1400
+ }
1401
+ }
1402
+ get state() {
1403
+ return {
1404
+ ...super.state,
1405
+ _blocks: this._blocks.map((t) => t.state)
1406
+ };
1407
+ }
1408
+ set state(t) {
1409
+ if (!t) {
1410
+ this.reset();
1411
+ return;
1412
+ }
1413
+ const {
1414
+ _blocks: e,
1415
+ ...s
1416
+ } = t;
1417
+ this._blocks.forEach((i, a) => i.state = e[a]), super.state = s;
1418
+ }
1419
+ reset() {
1420
+ super.reset(), this._blocks.forEach((t) => t.reset());
1421
+ }
1422
+ get isComplete() {
1423
+ return this.exposeBlock ? this.exposeBlock.isComplete : this._blocks.every((t) => t.isComplete);
1424
+ }
1425
+ get isFilled() {
1426
+ return this._blocks.every((t) => t.isFilled);
1427
+ }
1428
+ get isFixed() {
1429
+ return this._blocks.every((t) => t.isFixed);
1430
+ }
1431
+ get isOptional() {
1432
+ return this._blocks.every((t) => t.isOptional);
1433
+ }
1434
+ doCommit() {
1435
+ this._blocks.forEach((t) => t.doCommit()), super.doCommit();
1436
+ }
1437
+ get unmaskedValue() {
1438
+ return this.exposeBlock ? this.exposeBlock.unmaskedValue : this._blocks.reduce((t, e) => t += e.unmaskedValue, "");
1439
+ }
1440
+ set unmaskedValue(t) {
1441
+ if (this.exposeBlock) {
1442
+ const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1443
+ this.exposeBlock.unmaskedValue = t, this.appendTail(e), this.doCommit();
1444
+ } else super.unmaskedValue = t;
1445
+ }
1446
+ get value() {
1447
+ return this.exposeBlock ? this.exposeBlock.value : (
1448
+ // TODO return _value when not in change?
1449
+ this._blocks.reduce((t, e) => t += e.value, "")
1450
+ );
1451
+ }
1452
+ set value(t) {
1453
+ if (this.exposeBlock) {
1454
+ const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1455
+ this.exposeBlock.value = t, this.appendTail(e), this.doCommit();
1456
+ } else super.value = t;
1457
+ }
1458
+ get typedValue() {
1459
+ return this.exposeBlock ? this.exposeBlock.typedValue : super.typedValue;
1460
+ }
1461
+ set typedValue(t) {
1462
+ if (this.exposeBlock) {
1463
+ const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1464
+ this.exposeBlock.typedValue = t, this.appendTail(e), this.doCommit();
1465
+ } else super.typedValue = t;
1466
+ }
1467
+ get displayValue() {
1468
+ return this._blocks.reduce((t, e) => t += e.displayValue, "");
1469
+ }
1470
+ appendTail(t) {
1471
+ return super.appendTail(t).aggregate(this._appendPlaceholder());
1472
+ }
1473
+ _appendEager() {
1474
+ var t;
1475
+ const e = new c();
1476
+ let s = (t = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : t.index;
1477
+ if (s == null) return e;
1478
+ this._blocks[s].isFilled && ++s;
1479
+ for (let i = s; i < this._blocks.length; ++i) {
1480
+ const a = this._blocks[i]._appendEager();
1481
+ if (!a.inserted) break;
1482
+ e.aggregate(a);
1483
+ }
1484
+ return e;
1485
+ }
1486
+ _appendCharRaw(t, e) {
1487
+ e === void 0 && (e = {});
1488
+ const s = this._mapPosToBlock(this.displayValue.length), i = new c();
1489
+ if (!s) return i;
1490
+ for (let n = s.index, u; u = this._blocks[n]; ++n) {
1491
+ var a;
1492
+ const h = u._appendChar(t, {
1493
+ ...e,
1494
+ _beforeTailState: (a = e._beforeTailState) == null || (a = a._blocks) == null ? void 0 : a[n]
1495
+ });
1496
+ if (i.aggregate(h), h.consumed) break;
1497
+ }
1498
+ return i;
1499
+ }
1500
+ extractTail(t, e) {
1501
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1502
+ const s = new G();
1503
+ return t === e || this._forEachBlocksInRange(t, e, (i, a, n, u) => {
1504
+ const h = i.extractTail(n, u);
1505
+ h.stop = this._findStopBefore(a), h.from = this._blockStartPos(a), h instanceof G && (h.blockIndex = a), s.extend(h);
1506
+ }), s;
1507
+ }
1508
+ extractInput(t, e, s) {
1509
+ if (t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), s === void 0 && (s = {}), t === e) return "";
1510
+ let i = "";
1511
+ return this._forEachBlocksInRange(t, e, (a, n, u, h) => {
1512
+ i += a.extractInput(u, h, s);
1513
+ }), i;
1514
+ }
1515
+ _findStopBefore(t) {
1516
+ let e;
1517
+ for (let s = 0; s < this._stops.length; ++s) {
1518
+ const i = this._stops[s];
1519
+ if (i <= t) e = i;
1520
+ else break;
1521
+ }
1522
+ return e;
1523
+ }
1524
+ /** Appends placeholder depending on laziness */
1525
+ _appendPlaceholder(t) {
1526
+ const e = new c();
1527
+ if (this.lazy && t == null) return e;
1528
+ const s = this._mapPosToBlock(this.displayValue.length);
1529
+ if (!s) return e;
1530
+ const i = s.index, a = t ?? this._blocks.length;
1531
+ return this._blocks.slice(i, a).forEach((n) => {
1532
+ if (!n.lazy || t != null) {
1533
+ var u;
1534
+ e.aggregate(n._appendPlaceholder((u = n._blocks) == null ? void 0 : u.length));
1535
+ }
1536
+ }), e;
1537
+ }
1538
+ /** Finds block in pos */
1539
+ _mapPosToBlock(t) {
1540
+ let e = "";
1541
+ for (let s = 0; s < this._blocks.length; ++s) {
1542
+ const i = this._blocks[s], a = e.length;
1543
+ if (e += i.displayValue, t <= e.length)
1544
+ return {
1545
+ index: s,
1546
+ offset: t - a
1547
+ };
1548
+ }
1549
+ }
1550
+ _blockStartPos(t) {
1551
+ return this._blocks.slice(0, t).reduce((e, s) => e += s.displayValue.length, 0);
1552
+ }
1553
+ _forEachBlocksInRange(t, e, s) {
1554
+ e === void 0 && (e = this.displayValue.length);
1555
+ const i = this._mapPosToBlock(t);
1556
+ if (i) {
1557
+ const a = this._mapPosToBlock(e), n = a && i.index === a.index, u = i.offset, h = a && n ? a.offset : this._blocks[i.index].displayValue.length;
1558
+ if (s(this._blocks[i.index], i.index, u, h), a && !n) {
1559
+ for (let l = i.index + 1; l < a.index; ++l)
1560
+ s(this._blocks[l], l, 0, this._blocks[l].displayValue.length);
1561
+ s(this._blocks[a.index], a.index, 0, a.offset);
1562
+ }
1563
+ }
1564
+ }
1565
+ remove(t, e) {
1566
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1567
+ const s = super.remove(t, e);
1568
+ return this._forEachBlocksInRange(t, e, (i, a, n, u) => {
1569
+ s.aggregate(i.remove(n, u));
1570
+ }), s;
1571
+ }
1572
+ nearestInputPos(t, e) {
1573
+ if (e === void 0 && (e = o.NONE), !this._blocks.length) return 0;
1574
+ const s = new lt(this, t);
1575
+ if (e === o.NONE)
1576
+ return s.pushRightBeforeInput() || (s.popState(), s.pushLeftBeforeInput()) ? s.pos : this.displayValue.length;
1577
+ if (e === o.LEFT || e === o.FORCE_LEFT) {
1578
+ if (e === o.LEFT) {
1579
+ if (s.pushRightBeforeFilled(), s.ok && s.pos === t) return t;
1580
+ s.popState();
1581
+ }
1582
+ if (s.pushLeftBeforeInput(), s.pushLeftBeforeRequired(), s.pushLeftBeforeFilled(), e === o.LEFT) {
1583
+ if (s.pushRightBeforeInput(), s.pushRightBeforeRequired(), s.ok && s.pos <= t || (s.popState(), s.ok && s.pos <= t)) return s.pos;
1584
+ s.popState();
1585
+ }
1586
+ return s.ok ? s.pos : e === o.FORCE_LEFT ? 0 : (s.popState(), s.ok || (s.popState(), s.ok) ? s.pos : 0);
1587
+ }
1588
+ return e === o.RIGHT || e === o.FORCE_RIGHT ? (s.pushRightBeforeInput(), s.pushRightBeforeRequired(), s.pushRightBeforeFilled() ? s.pos : e === o.FORCE_RIGHT ? this.displayValue.length : (s.popState(), s.ok || (s.popState(), s.ok) ? s.pos : this.nearestInputPos(t, o.LEFT))) : t;
1589
+ }
1590
+ totalInputPositions(t, e) {
1591
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1592
+ let s = 0;
1593
+ return this._forEachBlocksInRange(t, e, (i, a, n, u) => {
1594
+ s += i.totalInputPositions(n, u);
1595
+ }), s;
1596
+ }
1597
+ /** Get block by name */
1598
+ maskedBlock(t) {
1599
+ return this.maskedBlocks(t)[0];
1600
+ }
1601
+ /** Get all blocks by name */
1602
+ maskedBlocks(t) {
1603
+ const e = this._maskedBlocks[t];
1604
+ return e ? e.map((s) => this._blocks[s]) : [];
1605
+ }
1606
+ pad(t) {
1607
+ const e = new c();
1608
+ return this._forEachBlocksInRange(0, this.displayValue.length, (s) => e.aggregate(s.pad(t))), e;
1609
+ }
1610
+ };
1611
+ p(M, "MaskedPattern");
1612
+ let v = M;
1613
+ v.DEFAULTS = {
1614
+ ..._.DEFAULTS,
1615
+ lazy: !0,
1616
+ placeholderChar: "_"
1617
+ };
1618
+ v.STOP_CHAR = "`";
1619
+ v.ESCAPE_CHAR = "\\";
1620
+ v.InputDefinition = L;
1621
+ v.FixedDefinition = q;
1622
+ d.MaskedPattern = v;
1623
+ const St = class St extends v {
1624
+ /**
1625
+ Optionally sets max length of pattern.
1626
+ Used when pattern length is longer then `to` param length. Pads zeros at start in this case.
1627
+ */
1628
+ /** Min bound */
1629
+ /** Max bound */
1630
+ get _matchFrom() {
1631
+ return this.maxLength - String(this.from).length;
1632
+ }
1633
+ constructor(t) {
1634
+ super(t);
1635
+ }
1636
+ updateOptions(t) {
1637
+ super.updateOptions(t);
1638
+ }
1639
+ _update(t) {
1640
+ const {
1641
+ to: e = this.to || 0,
1642
+ from: s = this.from || 0,
1643
+ maxLength: i = this.maxLength || 0,
1644
+ autofix: a = this.autofix,
1645
+ ...n
1646
+ } = t;
1647
+ this.to = e, this.from = s, this.maxLength = Math.max(String(e).length, i), this.autofix = a;
1648
+ const u = String(this.from).padStart(this.maxLength, "0"), h = String(this.to).padStart(this.maxLength, "0");
1649
+ let l = 0;
1650
+ for (; l < h.length && h[l] === u[l]; ) ++l;
1651
+ n.mask = h.slice(0, l).replace(/0/g, "\\0") + "0".repeat(this.maxLength - l), super._update(n);
1652
+ }
1653
+ get isComplete() {
1654
+ return super.isComplete && !!this.value;
1655
+ }
1656
+ boundaries(t) {
1657
+ let e = "", s = "";
1658
+ const [, i, a] = t.match(/^(\D*)(\d*)(\D*)/) || [];
1659
+ return a && (e = "0".repeat(i.length) + a, s = "9".repeat(i.length) + a), e = e.padEnd(this.maxLength, "0"), s = s.padEnd(this.maxLength, "9"), [e, s];
1660
+ }
1661
+ doPrepareChar(t, e) {
1662
+ e === void 0 && (e = {});
1663
+ let s;
1664
+ return [t, s] = super.doPrepareChar(t.replace(/\D/g, ""), e), t || (s.skip = !this.isComplete), [t, s];
1665
+ }
1666
+ _appendCharRaw(t, e) {
1667
+ if (e === void 0 && (e = {}), !this.autofix || this.value.length + 1 > this.maxLength) return super._appendCharRaw(t, e);
1668
+ const s = String(this.from).padStart(this.maxLength, "0"), i = String(this.to).padStart(this.maxLength, "0"), [a, n] = this.boundaries(this.value + t);
1669
+ return Number(n) < this.from ? super._appendCharRaw(s[this.value.length], e) : Number(a) > this.to ? !e.tail && this.autofix === "pad" && this.value.length + 1 < this.maxLength ? super._appendCharRaw(s[this.value.length], e).aggregate(this._appendCharRaw(t, e)) : super._appendCharRaw(i[this.value.length], e) : super._appendCharRaw(t, e);
1670
+ }
1671
+ doValidate(t) {
1672
+ const e = this.value;
1673
+ if (e.search(/[^0]/) === -1 && e.length <= this._matchFrom) return !0;
1674
+ const [i, a] = this.boundaries(e);
1675
+ return this.from <= Number(a) && Number(i) <= this.to && super.doValidate(t);
1676
+ }
1677
+ pad(t) {
1678
+ const e = new c();
1679
+ if (this.value.length === this.maxLength) return e;
1680
+ const s = this.value, i = this.maxLength - this.value.length;
1681
+ if (i) {
1682
+ this.reset();
1683
+ for (let a = 0; a < i; ++a)
1684
+ e.aggregate(super._appendCharRaw("0", t));
1685
+ s.split("").forEach((a) => this._appendCharRaw(a));
1686
+ }
1687
+ return e;
1688
+ }
1689
+ };
1690
+ p(St, "MaskedRange");
1691
+ let T = St;
1692
+ d.MaskedRange = T;
1693
+ const Zt = "d{.}`m{.}`Y", S = class S extends v {
1694
+ static extractPatternOptions(t) {
1695
+ const {
1696
+ mask: e,
1697
+ pattern: s,
1698
+ ...i
1699
+ } = t;
1700
+ return {
1701
+ ...i,
1702
+ mask: B(e) ? e : s
1703
+ };
1704
+ }
1705
+ /** Pattern mask for date according to {@link MaskedDate#format} */
1706
+ /** Start date */
1707
+ /** End date */
1708
+ /** Format typed value to string */
1709
+ /** Parse string to get typed value */
1710
+ constructor(t) {
1711
+ super(S.extractPatternOptions({
1712
+ ...S.DEFAULTS,
1713
+ ...t
1714
+ }));
1715
+ }
1716
+ updateOptions(t) {
1717
+ super.updateOptions(t);
1718
+ }
1719
+ _update(t) {
1720
+ const {
1721
+ mask: e,
1722
+ pattern: s,
1723
+ blocks: i,
1724
+ ...a
1725
+ } = {
1726
+ ...S.DEFAULTS,
1727
+ ...t
1728
+ }, n = Object.assign({}, S.GET_DEFAULT_BLOCKS());
1729
+ t.min && (n.Y.from = t.min.getFullYear()), t.max && (n.Y.to = t.max.getFullYear()), t.min && t.max && n.Y.from === n.Y.to && (n.m.from = t.min.getMonth() + 1, n.m.to = t.max.getMonth() + 1, n.m.from === n.m.to && (n.d.from = t.min.getDate(), n.d.to = t.max.getDate())), Object.assign(n, this.blocks, i), super._update({
1730
+ ...a,
1731
+ mask: B(e) ? e : s,
1732
+ blocks: n
1733
+ });
1734
+ }
1735
+ doValidate(t) {
1736
+ const e = this.date;
1737
+ return super.doValidate(t) && (!this.isComplete || this.isDateExist(this.value) && e != null && (this.min == null || this.min <= e) && (this.max == null || e <= this.max));
1738
+ }
1739
+ /** Checks if date is exists */
1740
+ isDateExist(t) {
1741
+ return this.format(this.parse(t, this), this).indexOf(t) >= 0;
1742
+ }
1743
+ /** Parsed Date */
1744
+ get date() {
1745
+ return this.typedValue;
1746
+ }
1747
+ set date(t) {
1748
+ this.typedValue = t;
1749
+ }
1750
+ get typedValue() {
1751
+ return this.isComplete ? super.typedValue : null;
1752
+ }
1753
+ set typedValue(t) {
1754
+ super.typedValue = t;
1755
+ }
1756
+ maskEquals(t) {
1757
+ return t === Date || super.maskEquals(t);
1758
+ }
1759
+ optionsIsChanged(t) {
1760
+ return super.optionsIsChanged(S.extractPatternOptions(t));
1761
+ }
1762
+ };
1763
+ p(S, "MaskedDate");
1764
+ let U = S;
1765
+ U.GET_DEFAULT_BLOCKS = () => ({
1766
+ d: {
1767
+ mask: T,
1768
+ from: 1,
1769
+ to: 31,
1770
+ maxLength: 2
1771
+ },
1772
+ m: {
1773
+ mask: T,
1774
+ from: 1,
1775
+ to: 12,
1776
+ maxLength: 2
1777
+ },
1778
+ Y: {
1779
+ mask: T,
1780
+ from: 1900,
1781
+ to: 9999
1782
+ }
1783
+ });
1784
+ U.DEFAULTS = {
1785
+ ...v.DEFAULTS,
1786
+ mask: Date,
1787
+ pattern: Zt,
1788
+ format: /* @__PURE__ */ p((r, t) => {
1789
+ if (!r) return "";
1790
+ const e = String(r.getDate()).padStart(2, "0"), s = String(r.getMonth() + 1).padStart(2, "0"), i = r.getFullYear();
1791
+ return [e, s, i].join(".");
1792
+ }, "format"),
1793
+ parse: /* @__PURE__ */ p((r, t) => {
1794
+ const [e, s, i] = r.split(".").map(Number);
1795
+ return new Date(i, s - 1, e);
1796
+ }, "parse")
1797
+ };
1798
+ d.MaskedDate = U;
1799
+ const Q = class Q extends _ {
1800
+ constructor(t) {
1801
+ super({
1802
+ ...Q.DEFAULTS,
1803
+ ...t
1804
+ }), this.currentMask = void 0;
1805
+ }
1806
+ updateOptions(t) {
1807
+ super.updateOptions(t);
1808
+ }
1809
+ _update(t) {
1810
+ super._update(t), "mask" in t && (this.exposeMask = void 0, this.compiledMasks = Array.isArray(t.mask) ? t.mask.map((e) => {
1811
+ const {
1812
+ expose: s,
1813
+ ...i
1814
+ } = N(e), a = y({
1815
+ overwrite: this._overwrite,
1816
+ eager: this._eager,
1817
+ skipInvalid: this._skipInvalid,
1818
+ ...i
1819
+ });
1820
+ return s && (this.exposeMask = a), a;
1821
+ }) : []);
1822
+ }
1823
+ _appendCharRaw(t, e) {
1824
+ e === void 0 && (e = {});
1825
+ const s = this._applyDispatch(t, e);
1826
+ return this.currentMask && s.aggregate(this.currentMask._appendChar(t, this.currentMaskFlags(e))), s;
1827
+ }
1828
+ _applyDispatch(t, e, s) {
1829
+ t === void 0 && (t = ""), e === void 0 && (e = {}), s === void 0 && (s = "");
1830
+ const i = e.tail && e._beforeTailState != null ? e._beforeTailState._value : this.value, a = this.rawInputValue, n = e.tail && e._beforeTailState != null ? e._beforeTailState._rawInputValue : a, u = a.slice(n.length), h = this.currentMask, l = new c(), f = h?.state;
1831
+ return this.currentMask = this.doDispatch(t, {
1832
+ ...e
1833
+ }, s), this.currentMask && (this.currentMask !== h ? (this.currentMask.reset(), n && (this.currentMask.append(n, {
1834
+ raw: !0
1835
+ }), l.tailShift = this.currentMask.value.length - i.length), u && (l.tailShift += this.currentMask.append(u, {
1836
+ raw: !0,
1837
+ tail: !0
1838
+ }).tailShift)) : f && (this.currentMask.state = f)), l;
1839
+ }
1840
+ _appendPlaceholder() {
1841
+ const t = this._applyDispatch();
1842
+ return this.currentMask && t.aggregate(this.currentMask._appendPlaceholder()), t;
1843
+ }
1844
+ _appendEager() {
1845
+ const t = this._applyDispatch();
1846
+ return this.currentMask && t.aggregate(this.currentMask._appendEager()), t;
1847
+ }
1848
+ appendTail(t) {
1849
+ const e = new c();
1850
+ return t && e.aggregate(this._applyDispatch("", {}, t)), e.aggregate(this.currentMask ? this.currentMask.appendTail(t) : super.appendTail(t));
1851
+ }
1852
+ currentMaskFlags(t) {
1853
+ var e, s;
1854
+ return {
1855
+ ...t,
1856
+ _beforeTailState: ((e = t._beforeTailState) == null ? void 0 : e.currentMaskRef) === this.currentMask && ((s = t._beforeTailState) == null ? void 0 : s.currentMask) || t._beforeTailState
1857
+ };
1858
+ }
1859
+ doDispatch(t, e, s) {
1860
+ return e === void 0 && (e = {}), s === void 0 && (s = ""), this.dispatch(t, this, e, s);
1861
+ }
1862
+ doValidate(t) {
1863
+ return super.doValidate(t) && (!this.currentMask || this.currentMask.doValidate(this.currentMaskFlags(t)));
1864
+ }
1865
+ doPrepare(t, e) {
1866
+ e === void 0 && (e = {});
1867
+ let [s, i] = super.doPrepare(t, e);
1868
+ if (this.currentMask) {
1869
+ let a;
1870
+ [s, a] = super.doPrepare(s, this.currentMaskFlags(e)), i = i.aggregate(a);
1871
+ }
1872
+ return [s, i];
1873
+ }
1874
+ doPrepareChar(t, e) {
1875
+ e === void 0 && (e = {});
1876
+ let [s, i] = super.doPrepareChar(t, e);
1877
+ if (this.currentMask) {
1878
+ let a;
1879
+ [s, a] = super.doPrepareChar(s, this.currentMaskFlags(e)), i = i.aggregate(a);
1880
+ }
1881
+ return [s, i];
1882
+ }
1883
+ reset() {
1884
+ var t;
1885
+ (t = this.currentMask) == null || t.reset(), this.compiledMasks.forEach((e) => e.reset());
1886
+ }
1887
+ get value() {
1888
+ return this.exposeMask ? this.exposeMask.value : this.currentMask ? this.currentMask.value : "";
1889
+ }
1890
+ set value(t) {
1891
+ this.exposeMask ? (this.exposeMask.value = t, this.currentMask = this.exposeMask, this._applyDispatch()) : super.value = t;
1892
+ }
1893
+ get unmaskedValue() {
1894
+ return this.exposeMask ? this.exposeMask.unmaskedValue : this.currentMask ? this.currentMask.unmaskedValue : "";
1895
+ }
1896
+ set unmaskedValue(t) {
1897
+ this.exposeMask ? (this.exposeMask.unmaskedValue = t, this.currentMask = this.exposeMask, this._applyDispatch()) : super.unmaskedValue = t;
1898
+ }
1899
+ get typedValue() {
1900
+ return this.exposeMask ? this.exposeMask.typedValue : this.currentMask ? this.currentMask.typedValue : "";
1901
+ }
1902
+ set typedValue(t) {
1903
+ if (this.exposeMask) {
1904
+ this.exposeMask.typedValue = t, this.currentMask = this.exposeMask, this._applyDispatch();
1905
+ return;
1906
+ }
1907
+ let e = String(t);
1908
+ this.currentMask && (this.currentMask.typedValue = t, e = this.currentMask.unmaskedValue), this.unmaskedValue = e;
1909
+ }
1910
+ get displayValue() {
1911
+ return this.currentMask ? this.currentMask.displayValue : "";
1912
+ }
1913
+ get isComplete() {
1914
+ var t;
1915
+ return !!((t = this.currentMask) != null && t.isComplete);
1916
+ }
1917
+ get isFilled() {
1918
+ var t;
1919
+ return !!((t = this.currentMask) != null && t.isFilled);
1920
+ }
1921
+ remove(t, e) {
1922
+ const s = new c();
1923
+ return this.currentMask && s.aggregate(this.currentMask.remove(t, e)).aggregate(this._applyDispatch()), s;
1924
+ }
1925
+ get state() {
1926
+ var t;
1927
+ return {
1928
+ ...super.state,
1929
+ _rawInputValue: this.rawInputValue,
1930
+ compiledMasks: this.compiledMasks.map((e) => e.state),
1931
+ currentMaskRef: this.currentMask,
1932
+ currentMask: (t = this.currentMask) == null ? void 0 : t.state
1933
+ };
1934
+ }
1935
+ set state(t) {
1936
+ const {
1937
+ compiledMasks: e,
1938
+ currentMaskRef: s,
1939
+ currentMask: i,
1940
+ ...a
1941
+ } = t;
1942
+ e && this.compiledMasks.forEach((n, u) => n.state = e[u]), s != null && (this.currentMask = s, this.currentMask.state = i), super.state = a;
1943
+ }
1944
+ extractInput(t, e, s) {
1945
+ return this.currentMask ? this.currentMask.extractInput(t, e, s) : "";
1946
+ }
1947
+ extractTail(t, e) {
1948
+ return this.currentMask ? this.currentMask.extractTail(t, e) : super.extractTail(t, e);
1949
+ }
1950
+ doCommit() {
1951
+ this.currentMask && this.currentMask.doCommit(), super.doCommit();
1952
+ }
1953
+ nearestInputPos(t, e) {
1954
+ return this.currentMask ? this.currentMask.nearestInputPos(t, e) : super.nearestInputPos(t, e);
1955
+ }
1956
+ get overwrite() {
1957
+ return this.currentMask ? this.currentMask.overwrite : this._overwrite;
1958
+ }
1959
+ set overwrite(t) {
1960
+ this._overwrite = t;
1961
+ }
1962
+ get eager() {
1963
+ return this.currentMask ? this.currentMask.eager : this._eager;
1964
+ }
1965
+ set eager(t) {
1966
+ this._eager = t;
1967
+ }
1968
+ get skipInvalid() {
1969
+ return this.currentMask ? this.currentMask.skipInvalid : this._skipInvalid;
1970
+ }
1971
+ set skipInvalid(t) {
1972
+ this._skipInvalid = t;
1973
+ }
1974
+ get autofix() {
1975
+ return this.currentMask ? this.currentMask.autofix : this._autofix;
1976
+ }
1977
+ set autofix(t) {
1978
+ this._autofix = t;
1979
+ }
1980
+ maskEquals(t) {
1981
+ return Array.isArray(t) ? this.compiledMasks.every((e, s) => {
1982
+ if (!t[s]) return;
1983
+ const {
1984
+ mask: i,
1985
+ ...a
1986
+ } = t[s];
1987
+ return z(e, a) && e.maskEquals(i);
1988
+ }) : super.maskEquals(t);
1989
+ }
1990
+ typedValueEquals(t) {
1991
+ var e;
1992
+ return !!((e = this.currentMask) != null && e.typedValueEquals(t));
1993
+ }
1994
+ };
1995
+ p(Q, "MaskedDynamic");
1996
+ let Z = Q;
1997
+ Z.DEFAULTS = {
1998
+ ..._.DEFAULTS,
1999
+ dispatch: /* @__PURE__ */ p((r, t, e, s) => {
2000
+ if (!t.compiledMasks.length) return;
2001
+ const i = t.rawInputValue, a = t.compiledMasks.map((n, u) => {
2002
+ const h = t.currentMask === n, l = h ? n.displayValue.length : n.nearestInputPos(n.displayValue.length, o.FORCE_LEFT);
2003
+ return n.rawInputValue !== i ? (n.reset(), n.append(i, {
2004
+ raw: !0
2005
+ })) : h || n.remove(l), n.append(r, t.currentMaskFlags(e)), n.appendTail(s), {
2006
+ index: u,
2007
+ weight: n.rawInputValue.length,
2008
+ totalInputPositions: n.totalInputPositions(0, Math.max(l, n.nearestInputPos(n.displayValue.length, o.FORCE_LEFT)))
2009
+ };
2010
+ });
2011
+ return a.sort((n, u) => u.weight - n.weight || u.totalInputPositions - n.totalInputPositions), t.compiledMasks[a[0].index];
2012
+ }, "dispatch")
2013
+ };
2014
+ d.MaskedDynamic = Z;
2015
+ const tt = class tt extends v {
2016
+ constructor(t) {
2017
+ super({
2018
+ ...tt.DEFAULTS,
2019
+ ...t
2020
+ });
2021
+ }
2022
+ updateOptions(t) {
2023
+ super.updateOptions(t);
2024
+ }
2025
+ _update(t) {
2026
+ const {
2027
+ enum: e,
2028
+ ...s
2029
+ } = t;
2030
+ if (e) {
2031
+ const i = e.map((u) => u.length), a = Math.min(...i), n = Math.max(...i) - a;
2032
+ s.mask = "*".repeat(a), n && (s.mask += "[" + "*".repeat(n) + "]"), this.enum = e;
2033
+ }
2034
+ super._update(s);
2035
+ }
2036
+ _appendCharRaw(t, e) {
2037
+ e === void 0 && (e = {});
2038
+ const s = Math.min(this.nearestInputPos(0, o.FORCE_RIGHT), this.value.length), i = this.enum.filter((a) => this.matchValue(a, this.unmaskedValue + t, s));
2039
+ if (i.length) {
2040
+ i.length === 1 && this._forEachBlocksInRange(0, this.value.length, (n, u) => {
2041
+ const h = i[0][u];
2042
+ u >= this.value.length || h === n.value || (n.reset(), n._appendChar(h, e));
2043
+ });
2044
+ const a = super._appendCharRaw(i[0][this.value.length], e);
2045
+ return i.length === 1 && i[0].slice(this.unmaskedValue.length).split("").forEach((n) => a.aggregate(super._appendCharRaw(n))), a;
2046
+ }
2047
+ return new c({
2048
+ skip: !this.isComplete
2049
+ });
2050
+ }
2051
+ extractTail(t, e) {
2052
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), new F("", t);
2053
+ }
2054
+ remove(t, e) {
2055
+ if (t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), t === e) return new c();
2056
+ const s = Math.min(super.nearestInputPos(0, o.FORCE_RIGHT), this.value.length);
2057
+ let i;
2058
+ for (i = t; i >= 0 && !(this.enum.filter((u) => this.matchValue(u, this.value.slice(s, i), s)).length > 1); --i)
2059
+ ;
2060
+ const a = super.remove(i, e);
2061
+ return a.tailShift += i - t, a;
2062
+ }
2063
+ get isComplete() {
2064
+ return this.enum.indexOf(this.value) >= 0;
2065
+ }
2066
+ };
2067
+ p(tt, "MaskedEnum");
2068
+ let W = tt;
2069
+ W.DEFAULTS = {
2070
+ ...v.DEFAULTS,
2071
+ matchValue: /* @__PURE__ */ p((r, t, e) => r.indexOf(t, e) === e, "matchValue")
2072
+ };
2073
+ d.MaskedEnum = W;
2074
+ const xt = class xt extends _ {
2075
+ /** */
2076
+ /** Enable characters overwriting */
2077
+ /** */
2078
+ /** */
2079
+ /** */
2080
+ updateOptions(t) {
2081
+ super.updateOptions(t);
2082
+ }
2083
+ _update(t) {
2084
+ super._update({
2085
+ ...t,
2086
+ validate: t.mask
2087
+ });
2088
+ }
2089
+ };
2090
+ p(xt, "MaskedFunction");
2091
+ let pt = xt;
2092
+ d.MaskedFunction = pt;
2093
+ var Tt;
2094
+ const I = class I extends _ {
2095
+ /** Single char */
2096
+ /** Single char */
2097
+ /** Array of single chars */
2098
+ /** */
2099
+ /** */
2100
+ /** Digits after point */
2101
+ /** Flag to remove leading and trailing zeros in the end of editing */
2102
+ /** Flag to pad trailing zeros after point in the end of editing */
2103
+ /** Enable characters overwriting */
2104
+ /** */
2105
+ /** */
2106
+ /** */
2107
+ /** Format typed value to string */
2108
+ /** Parse string to get typed value */
2109
+ constructor(t) {
2110
+ super({
2111
+ ...I.DEFAULTS,
2112
+ ...t
2113
+ });
2114
+ }
2115
+ updateOptions(t) {
2116
+ super.updateOptions(t);
2117
+ }
2118
+ _update(t) {
2119
+ super._update(t), this._updateRegExps();
2120
+ }
2121
+ _updateRegExps() {
2122
+ const t = "^" + (this.allowNegative ? "[+|\\-]?" : ""), e = "\\d*", s = (this.scale ? "(" + nt(this.radix) + "\\d{0," + this.scale + "})?" : "") + "$";
2123
+ this._numberRegExp = new RegExp(t + e + s), this._mapToRadixRegExp = new RegExp("[" + this.mapToRadix.map(nt).join("") + "]", "g"), this._thousandsSeparatorRegExp = new RegExp(nt(this.thousandsSeparator), "g");
2124
+ }
2125
+ _removeThousandsSeparators(t) {
2126
+ return t.replace(this._thousandsSeparatorRegExp, "");
2127
+ }
2128
+ _insertThousandsSeparators(t) {
2129
+ const e = t.split(this.radix);
2130
+ return e[0] = e[0].replace(/\B(?=(\d{3})+(?!\d))/g, this.thousandsSeparator), e.join(this.radix);
2131
+ }
2132
+ doPrepareChar(t, e) {
2133
+ e === void 0 && (e = {});
2134
+ const [s, i] = super.doPrepareChar(this._removeThousandsSeparators(this.scale && this.mapToRadix.length && /*
2135
+ radix should be mapped when
2136
+ 1) input is done from keyboard = flags.input && flags.raw
2137
+ 2) unmasked value is set = !flags.input && !flags.raw
2138
+ and should not be mapped when
2139
+ 1) value is set = flags.input && !flags.raw
2140
+ 2) raw value is set = !flags.input && flags.raw
2141
+ */
2142
+ (e.input && e.raw || !e.input && !e.raw) ? t.replace(this._mapToRadixRegExp, this.radix) : t), e);
2143
+ return t && !s && (i.skip = !0), s && !this.allowPositive && !this.value && s !== "-" && i.aggregate(this._appendChar("-")), [s, i];
2144
+ }
2145
+ _separatorsCount(t, e) {
2146
+ e === void 0 && (e = !1);
2147
+ let s = 0;
2148
+ for (let i = 0; i < t; ++i)
2149
+ this._value.indexOf(this.thousandsSeparator, i) === i && (++s, e && (t += this.thousandsSeparator.length));
2150
+ return s;
2151
+ }
2152
+ _separatorsCountFromSlice(t) {
2153
+ return t === void 0 && (t = this._value), this._separatorsCount(this._removeThousandsSeparators(t).length, !0);
2154
+ }
2155
+ extractInput(t, e, s) {
2156
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), [t, e] = this._adjustRangeWithSeparators(t, e), this._removeThousandsSeparators(super.extractInput(t, e, s));
2157
+ }
2158
+ _appendCharRaw(t, e) {
2159
+ e === void 0 && (e = {});
2160
+ const s = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value, i = this._separatorsCountFromSlice(s);
2161
+ this._value = this._removeThousandsSeparators(this.value);
2162
+ const a = this._value;
2163
+ this._value += t;
2164
+ const n = this.number;
2165
+ let u = !isNaN(n), h = !1;
2166
+ if (u) {
2167
+ let E;
2168
+ this.min != null && this.min < 0 && this.number < this.min && (E = this.min), this.max != null && this.max > 0 && this.number > this.max && (E = this.max), E != null && (this.autofix ? (this._value = this.format(E, this).replace(I.UNMASKED_RADIX, this.radix), h || (h = a === this._value && !e.tail)) : u = !1), u && (u = !!this._value.match(this._numberRegExp));
2169
+ }
2170
+ let l;
2171
+ u ? l = new c({
2172
+ inserted: this._value.slice(a.length),
2173
+ rawInserted: h ? "" : t,
2174
+ skip: h
2175
+ }) : (this._value = a, l = new c()), this._value = this._insertThousandsSeparators(this._value);
2176
+ const f = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value, g = this._separatorsCountFromSlice(f);
2177
+ return l.tailShift += (g - i) * this.thousandsSeparator.length, l;
2178
+ }
2179
+ _findSeparatorAround(t) {
2180
+ if (this.thousandsSeparator) {
2181
+ const e = t - this.thousandsSeparator.length + 1, s = this.value.indexOf(this.thousandsSeparator, e);
2182
+ if (s <= t) return s;
2183
+ }
2184
+ return -1;
2185
+ }
2186
+ _adjustRangeWithSeparators(t, e) {
2187
+ const s = this._findSeparatorAround(t);
2188
+ s >= 0 && (t = s);
2189
+ const i = this._findSeparatorAround(e);
2190
+ return i >= 0 && (e = i + this.thousandsSeparator.length), [t, e];
2191
+ }
2192
+ remove(t, e) {
2193
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), [t, e] = this._adjustRangeWithSeparators(t, e);
2194
+ const s = this.value.slice(0, t), i = this.value.slice(e), a = this._separatorsCount(s.length);
2195
+ this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(s + i));
2196
+ const n = this._separatorsCountFromSlice(s);
2197
+ return new c({
2198
+ tailShift: (n - a) * this.thousandsSeparator.length
2199
+ });
2200
+ }
2201
+ nearestInputPos(t, e) {
2202
+ if (!this.thousandsSeparator) return t;
2203
+ switch (e) {
2204
+ case o.NONE:
2205
+ case o.LEFT:
2206
+ case o.FORCE_LEFT: {
2207
+ const s = this._findSeparatorAround(t - 1);
2208
+ if (s >= 0) {
2209
+ const i = s + this.thousandsSeparator.length;
2210
+ if (t < i || this.value.length <= i || e === o.FORCE_LEFT)
2211
+ return s;
2212
+ }
2213
+ break;
2214
+ }
2215
+ case o.RIGHT:
2216
+ case o.FORCE_RIGHT: {
2217
+ const s = this._findSeparatorAround(t);
2218
+ if (s >= 0)
2219
+ return s + this.thousandsSeparator.length;
2220
+ }
2221
+ }
2222
+ return t;
2223
+ }
2224
+ doCommit() {
2225
+ if (this.value) {
2226
+ const t = this.number;
2227
+ let e = t;
2228
+ this.min != null && (e = Math.max(e, this.min)), this.max != null && (e = Math.min(e, this.max)), e !== t && (this.unmaskedValue = this.format(e, this));
2229
+ let s = this.value;
2230
+ this.normalizeZeros && (s = this._normalizeZeros(s)), this.padFractionalZeros && this.scale > 0 && (s = this._padFractionalZeros(s)), this._value = s;
2231
+ }
2232
+ super.doCommit();
2233
+ }
2234
+ _normalizeZeros(t) {
2235
+ const e = this._removeThousandsSeparators(t).split(this.radix);
2236
+ return e[0] = e[0].replace(/^(\D*)(0*)(\d*)/, (s, i, a, n) => i + n), t.length && !/\d$/.test(e[0]) && (e[0] = e[0] + "0"), e.length > 1 && (e[1] = e[1].replace(/0*$/, ""), e[1].length || (e.length = 1)), this._insertThousandsSeparators(e.join(this.radix));
2237
+ }
2238
+ _padFractionalZeros(t) {
2239
+ if (!t) return t;
2240
+ const e = t.split(this.radix);
2241
+ return e.length < 2 && e.push(""), e[1] = e[1].padEnd(this.scale, "0"), e.join(this.radix);
2242
+ }
2243
+ doSkipInvalid(t, e, s) {
2244
+ e === void 0 && (e = {});
2245
+ const i = this.scale === 0 && t !== this.thousandsSeparator && (t === this.radix || t === I.UNMASKED_RADIX || this.mapToRadix.includes(t));
2246
+ return super.doSkipInvalid(t, e, s) && !i;
2247
+ }
2248
+ get unmaskedValue() {
2249
+ return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix, I.UNMASKED_RADIX);
2250
+ }
2251
+ set unmaskedValue(t) {
2252
+ super.unmaskedValue = t;
2253
+ }
2254
+ get typedValue() {
2255
+ return this.parse(this.unmaskedValue, this);
2256
+ }
2257
+ set typedValue(t) {
2258
+ this.rawInputValue = this.format(t, this).replace(I.UNMASKED_RADIX, this.radix);
2259
+ }
2260
+ /** Parsed Number */
2261
+ get number() {
2262
+ return this.typedValue;
2263
+ }
2264
+ set number(t) {
2265
+ this.typedValue = t;
2266
+ }
2267
+ get allowNegative() {
2268
+ return this.min != null && this.min < 0 || this.max != null && this.max < 0;
2269
+ }
2270
+ get allowPositive() {
2271
+ return this.min != null && this.min > 0 || this.max != null && this.max > 0;
2272
+ }
2273
+ typedValueEquals(t) {
2274
+ return (super.typedValueEquals(t) || I.EMPTY_VALUES.includes(t) && I.EMPTY_VALUES.includes(this.typedValue)) && !(t === 0 && this.value === "");
2275
+ }
2276
+ };
2277
+ p(I, "MaskedNumber");
2278
+ let w = I;
2279
+ Tt = w;
2280
+ w.UNMASKED_RADIX = ".";
2281
+ w.EMPTY_VALUES = [..._.EMPTY_VALUES, 0];
2282
+ w.DEFAULTS = {
2283
+ ..._.DEFAULTS,
2284
+ mask: Number,
2285
+ radix: ",",
2286
+ thousandsSeparator: "",
2287
+ mapToRadix: [Tt.UNMASKED_RADIX],
2288
+ min: Number.MIN_SAFE_INTEGER,
2289
+ max: Number.MAX_SAFE_INTEGER,
2290
+ scale: 2,
2291
+ normalizeZeros: !0,
2292
+ padFractionalZeros: !1,
2293
+ parse: Number,
2294
+ format: /* @__PURE__ */ p((r) => r.toLocaleString("en-US", {
2295
+ useGrouping: !1,
2296
+ maximumFractionDigits: 20
2297
+ }), "format")
2298
+ };
2299
+ d.MaskedNumber = w;
2300
+ const dt = {
2301
+ MASKED: "value",
2302
+ UNMASKED: "unmaskedValue",
2303
+ TYPED: "typedValue"
2304
+ };
2305
+ function Rt(r, t, e) {
2306
+ t === void 0 && (t = dt.MASKED), e === void 0 && (e = dt.MASKED);
2307
+ const s = y(r);
2308
+ return (i) => s.runIsolated((a) => (a[t] = i, a[e]));
2309
+ }
2310
+ p(Rt, "createPipe");
2311
+ function Wt(r, t, e, s) {
2312
+ return Rt(t, e, s)(r);
2313
+ }
2314
+ p(Wt, "pipe");
2315
+ d.PIPE_TYPE = dt;
2316
+ d.createPipe = Rt;
2317
+ d.pipe = Wt;
2318
+ const Bt = class Bt extends v {
2319
+ get repeatFrom() {
2320
+ var t;
2321
+ return (t = Array.isArray(this.repeat) ? this.repeat[0] : this.repeat === 1 / 0 ? 0 : this.repeat) != null ? t : 0;
2322
+ }
2323
+ get repeatTo() {
2324
+ var t;
2325
+ return (t = Array.isArray(this.repeat) ? this.repeat[1] : this.repeat) != null ? t : 1 / 0;
2326
+ }
2327
+ constructor(t) {
2328
+ super(t);
2329
+ }
2330
+ updateOptions(t) {
2331
+ super.updateOptions(t);
2332
+ }
2333
+ _update(t) {
2334
+ var e, s, i;
2335
+ const {
2336
+ repeat: a,
2337
+ ...n
2338
+ } = N(t);
2339
+ this._blockOpts = Object.assign({}, this._blockOpts, n);
2340
+ const u = y(this._blockOpts);
2341
+ this.repeat = (e = (s = a ?? u.repeat) != null ? s : this.repeat) != null ? e : 1 / 0, super._update({
2342
+ mask: "m".repeat(Math.max(this.repeatTo === 1 / 0 && ((i = this._blocks) == null ? void 0 : i.length) || 0, this.repeatFrom)),
2343
+ blocks: {
2344
+ m: u
2345
+ },
2346
+ eager: u.eager,
2347
+ overwrite: u.overwrite,
2348
+ skipInvalid: u.skipInvalid,
2349
+ lazy: u.lazy,
2350
+ placeholderChar: u.placeholderChar,
2351
+ displayChar: u.displayChar
2352
+ });
2353
+ }
2354
+ _allocateBlock(t) {
2355
+ if (t < this._blocks.length) return this._blocks[t];
2356
+ if (this.repeatTo === 1 / 0 || this._blocks.length < this.repeatTo)
2357
+ return this._blocks.push(y(this._blockOpts)), this.mask += "m", this._blocks[this._blocks.length - 1];
2358
+ }
2359
+ _appendCharRaw(t, e) {
2360
+ e === void 0 && (e = {});
2361
+ const s = new c();
2362
+ for (
2363
+ let h = (i = (a = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : a.index) != null ? i : Math.max(this._blocks.length - 1, 0), l, f;
2364
+ // try to get a block or
2365
+ // try to allocate a new block if not allocated already
2366
+ l = (n = this._blocks[h]) != null ? n : f = !f && this._allocateBlock(h);
2367
+ ++h
2368
+ ) {
2369
+ var i, a, n, u;
2370
+ const g = l._appendChar(t, {
2371
+ ...e,
2372
+ _beforeTailState: (u = e._beforeTailState) == null || (u = u._blocks) == null ? void 0 : u[h]
2373
+ });
2374
+ if (g.skip && f) {
2375
+ this._blocks.pop(), this.mask = this.mask.slice(1);
2376
+ break;
2377
+ }
2378
+ if (s.aggregate(g), g.consumed) break;
2379
+ }
2380
+ return s;
2381
+ }
2382
+ _trimEmptyTail(t, e) {
2383
+ var s, i;
2384
+ t === void 0 && (t = 0);
2385
+ const a = Math.max(((s = this._mapPosToBlock(t)) == null ? void 0 : s.index) || 0, this.repeatFrom, 0);
2386
+ let n;
2387
+ e != null && (n = (i = this._mapPosToBlock(e)) == null ? void 0 : i.index), n == null && (n = this._blocks.length - 1);
2388
+ let u = 0;
2389
+ for (let h = n; a <= h && !this._blocks[h].unmaskedValue; --h, ++u)
2390
+ ;
2391
+ u && (this._blocks.splice(n - u + 1, u), this.mask = this.mask.slice(u));
2392
+ }
2393
+ reset() {
2394
+ super.reset(), this._trimEmptyTail();
2395
+ }
2396
+ remove(t, e) {
2397
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
2398
+ const s = super.remove(t, e);
2399
+ return this._trimEmptyTail(t, e), s;
2400
+ }
2401
+ totalInputPositions(t, e) {
2402
+ return t === void 0 && (t = 0), e == null && this.repeatTo === 1 / 0 ? 1 / 0 : super.totalInputPositions(t, e);
2403
+ }
2404
+ get state() {
2405
+ return super.state;
2406
+ }
2407
+ set state(t) {
2408
+ this._blocks.length = t._blocks.length, this.mask = this.mask.slice(0, this._blocks.length), super.state = t;
2409
+ }
2410
+ };
2411
+ p(Bt, "RepeatBlock");
2412
+ let ct = Bt;
2413
+ d.RepeatBlock = ct;
2414
+ try {
2415
+ globalThis.IMask = d;
2416
+ } catch {
2417
+ }
2418
+ function Xt(r, t) {
2419
+ return A(), V("svg", {
2420
+ xmlns: "http://www.w3.org/2000/svg",
2421
+ viewBox: "0 0 24 24",
2422
+ fill: "currentColor",
2423
+ "aria-hidden": "true",
2424
+ "data-slot": "icon"
2425
+ }, [
2426
+ x("path", {
2427
+ "fill-rule": "evenodd",
2428
+ d: "M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Zm7.007 6.387a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",
2429
+ "clip-rule": "evenodd"
2430
+ })
2431
+ ]);
2432
+ }
2433
+ p(Xt, "render$2");
2434
+ function Jt(r, t) {
2435
+ return A(), V("svg", {
2436
+ xmlns: "http://www.w3.org/2000/svg",
2437
+ viewBox: "0 0 24 24",
2438
+ fill: "currentColor",
2439
+ "aria-hidden": "true",
2440
+ "data-slot": "icon"
2441
+ }, [
2442
+ x("path", {
2443
+ "fill-rule": "evenodd",
2444
+ d: "M7.502 6h7.128A3.375 3.375 0 0 1 18 9.375v9.375a3 3 0 0 0 3-3V6.108c0-1.505-1.125-2.811-2.664-2.94a48.972 48.972 0 0 0-.673-.05A3 3 0 0 0 15 1.5h-1.5a3 3 0 0 0-2.663 1.618c-.225.015-.45.032-.673.05C8.662 3.295 7.554 4.542 7.502 6ZM13.5 3A1.5 1.5 0 0 0 12 4.5h4.5A1.5 1.5 0 0 0 15 3h-1.5Z",
2445
+ "clip-rule": "evenodd"
2446
+ }),
2447
+ x("path", {
2448
+ "fill-rule": "evenodd",
2449
+ d: "M3 9.375C3 8.339 3.84 7.5 4.875 7.5h9.75c1.036 0 1.875.84 1.875 1.875v11.25c0 1.035-.84 1.875-1.875 1.875h-9.75A1.875 1.875 0 0 1 3 20.625V9.375ZM6 12a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75H6.75a.75.75 0 0 1-.75-.75V12Zm2.25 0a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H9a.75.75 0 0 1-.75-.75ZM6 15a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75H6.75a.75.75 0 0 1-.75-.75V15Zm2.25 0a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H9a.75.75 0 0 1-.75-.75ZM6 18a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75H6.75a.75.75 0 0 1-.75-.75V18Zm2.25 0a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H9a.75.75 0 0 1-.75-.75Z",
2450
+ "clip-rule": "evenodd"
2451
+ })
2452
+ ]);
2453
+ }
2454
+ p(Jt, "render$1");
2455
+ var Qt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, k = /* @__PURE__ */ p((r, t, e, s) => {
2456
+ for (var i = s > 1 ? void 0 : s ? te(t, e) : t, a = r.length - 1, n; a >= 0; a--)
2457
+ (n = r[a]) && (i = (s ? n(t, e, i) : n(i)) || i);
2458
+ return s && i && Qt(t, e, i), i;
2459
+ }, "__decorateClass"), R;
2460
+ let m = (R = class extends Pt {
2461
+ maskPreset = null;
2462
+ force12hours = !1;
2463
+ alwaysCopyIcon = !1;
2464
+ disabled = !1;
2465
+ asNumber = !1;
2466
+ radix = ",";
2467
+ mask = null;
2468
+ mapToRadix = [".", ";", "/"];
2469
+ dtPresetLocale = "";
2470
+ thousandsSeparator = " ";
2471
+ step = 1;
2472
+ min = 0;
2473
+ max = null;
2474
+ emitsParent = ["input", "change", "focus", "blur", "update:modelValue", "dateMaskChange", "keypress.enter", "reset"];
2475
+ componentsParent = { ClipboardDocumentListIcon: Jt, CheckBadgeIcon: Xt, NoSymbolIcon: Ut };
2476
+ maskInner = null;
2477
+ maskBlocks = {};
2478
+ utc = "UTC";
2479
+ _numVal = 0;
2480
+ _asNum = !1;
2481
+ _iMaskInput(t) {
2482
+ console.log(
2483
+ t?.srcElement?.value.replaceAll(this.thousandsSeparator, "").replace(new RegExp(`^[W\\${this.radix}]+$`, "g"), ""),
2484
+ parseInt(t?.srcElement?.value)
2485
+ ), this._asNum || (this.value = t?.srcElement?.value || "");
2486
+ }
2487
+ placeholder = "Введите текст";
2488
+ is12hours = !1;
2489
+ _randKey = "";
2490
+ _iMaskedInst;
2491
+ setup(t, e, s) {
2492
+ let i = null;
2493
+ return {
2494
+ initIMask: /* @__PURE__ */ p((l) => {
2495
+ if (l)
2496
+ return console.log("self.maskInner", s.maskInner), i = d(l, {
2497
+ mask: s.maskInner || String
2498
+ }), i.on("accept", () => {
2499
+ }), i.on("complete", () => {
2500
+ }), i;
2501
+ }, "initIMask"),
2502
+ updateIMaskOptions: /* @__PURE__ */ p((l) => {
2503
+ i && i.updateOptions(l);
2504
+ }, "updateIMaskOptions"),
2505
+ setIMaskValue: /* @__PURE__ */ p((l) => {
2506
+ i && (i.value = l);
2507
+ }, "setIMaskValue"),
2508
+ getUnmaskedValue: /* @__PURE__ */ p(() => i ? i.unmaskedValue : "", "getUnmaskedValue"),
2509
+ imaskInstance: /* @__PURE__ */ p(() => i, "imaskInstance")
2510
+ // Геттер для доступа к инстансу
2511
+ };
2512
+ }
2513
+ // const {el, masked} = useIMask({
2514
+ // // mask: this.maskInner as any,
2515
+ // // scale: typeof this._asNum == 'number' ? this._asNum : 0,
2516
+ // // autofix: true,
2517
+ // // min: this.min,
2518
+ // // max: this.max,
2519
+ // // radix: this.radix,
2520
+ // // mapToRadix: this.mapToRadix,
2521
+ // // placeholder: this.placeholder,
2522
+ // // thousandsSeparator: ' ',
2523
+ // // padFractionalZeros: true,
2524
+ // // overwrite: true,
2525
+ // // lazy: false,
2526
+ // // autocomplete: this.maskPreset == 'email' ? 'email' : 'off',
2527
+ // // blocks: this.maskBlocks,
2528
+ // }, {
2529
+ // onAccept: (e?: InputEvent) => {
2530
+ // this.onAccept((e?.target as HTMLInputElement)?.value || '')
2531
+ // }, // @ts-ignore
2532
+ // onAcceptUnmasked: (((e?: InputEvent) => {
2533
+ // this.onAcceptUnmasked((e?.target as HTMLInputElement)?.value ?? '')
2534
+ // }) as any),
2535
+ // // onAcceptUnmasked: this.onAcceptUnmasked.bind(this),
2536
+ // // onCompleteTyped: this.onCompleteTyped.bind(this),
2537
+ // })
2538
+ // // this._iMaskedInst = masked
2539
+ // console.log('masked', el.updateOptions)
2540
+ // // el.value = element
2541
+ //
2542
+ // return {
2543
+ // imaskEl: el,
2544
+ // imaskMasked: masked,
2545
+ // }
2546
+ // }
2547
+ createdParent() {
2548
+ if (!this.is12hours && this.isDateTime)
2549
+ try {
2550
+ const t = new Intl.DateTimeFormat(
2551
+ this.dtPresetLocale || this.VST.$r.locale,
2552
+ { hour: "numeric" }
2553
+ ).resolvedOptions();
2554
+ this.is12hours = t.hourCycle === "h11" || t.hourCycle === "h12";
2555
+ } catch {
2556
+ this.is12hours = !1;
2557
+ }
2558
+ else this.force12hours && (this.is12hours = !0);
2559
+ this._asNum && (this.maskInner = Number);
2560
+ }
2561
+ beforeMountParent() {
2562
+ let t = this.modelValue || this.inputValue || "";
2563
+ if (typeof t != "string" && (t = ""), this._preResetValue = "", this.value = t, this.isDateTime) {
2564
+ const e = new Intl.DateTimeFormat(this.dtPresetLocale || this.VST.$r.locale, {
2565
+ year: "numeric",
2566
+ month: "2-digit",
2567
+ day: "2-digit",
2568
+ hour: this.maskPreset == "datetime" || this.maskPreset == "datetimeSec" ? "2-digit" : void 0,
2569
+ minute: this.maskPreset == "datetime" || this.maskPreset == "datetimeSec" ? "2-digit" : void 0,
2570
+ second: this.maskPreset == "datetimeSec" ? "2-digit" : void 0,
2571
+ timeZoneName: "longOffset"
2572
+ }).formatToParts(new Date($VST.DT().epochMilliseconds));
2573
+ if (this.maskInner = e.map((s) => {
2574
+ switch (s.type) {
2575
+ case "year":
2576
+ return "YYYY";
2577
+ case "month":
2578
+ return "MM";
2579
+ case "day":
2580
+ return "DD";
2581
+ case "hour":
2582
+ return "hh";
2583
+ case "second":
2584
+ return "ss";
2585
+ case "minute":
2586
+ return "mm";
2587
+ case "literal":
2588
+ return s.value;
2589
+ case "timeZoneName":
2590
+ return this.utc = s.value, "";
2591
+ default:
2592
+ return "";
2593
+ }
2594
+ }).join(""), this.is12hours && this.maskPreset !== "date")
2595
+ this.maskInner += "!";
2596
+ else if (this.maskPreset === "date") {
2597
+ const s = this._extractDateOnly(this.maskInner);
2598
+ s && (this.maskInner = s);
2599
+ }
2600
+ this.maskInner = this.maskInner.replace(/\s+/g, " "), this.maskBlocks = {
2601
+ YYYY: {
2602
+ mask: d.MaskedRange,
2603
+ from: 1e3,
2604
+ to: 2300,
2605
+ validate: /* @__PURE__ */ p((s, i) => this.dateMaskValidateWithReplaceDays(i), "validate"),
2606
+ overwrite: !0
2607
+ },
2608
+ MM: {
2609
+ mask: d.MaskedRange,
2610
+ from: 1,
2611
+ to: 12,
2612
+ validate: /* @__PURE__ */ p((s, i) => this.dateMaskValidateWithReplaceDays(i), "validate"),
2613
+ overwrite: !0
2614
+ },
2615
+ DD: {
2616
+ mask: d.MaskedRange,
2617
+ from: 1,
2618
+ to: 31,
2619
+ validate: /* @__PURE__ */ p((s, i) => this.dateMaskValidateWithReplaceDays(i), "validate"),
2620
+ overwrite: !0
2621
+ },
2622
+ // todo определять 12 часовой формат
2623
+ hh: {
2624
+ mask: d.MaskedRange,
2625
+ from: this.is12hours ? 1 : 0,
2626
+ to: this.is12hours ? 12 : 23,
2627
+ overwrite: !0
2628
+ },
2629
+ mm: {
2630
+ mask: d.MaskedRange,
2631
+ from: 0,
2632
+ to: 59,
2633
+ overwrite: !0
2634
+ },
2635
+ ss: {
2636
+ mask: d.MaskedRange,
2637
+ from: 0,
2638
+ to: 59,
2639
+ overwrite: !0
2640
+ },
2641
+ "!": {
2642
+ mask: d.MaskedEnum,
2643
+ enum: ["AM", "PM", "am", "pm"],
2644
+ overwrite: !0
2645
+ }
2646
+ };
2647
+ } else this.mask && (this.maskInner = this.mask);
2648
+ this._asNum = this.asNumber, this._randKey = $VST.generateRandomKey(), console.log("_asNum", this._asNum, this.asNumber);
2649
+ }
2650
+ mountedParent() {
2651
+ console.log("_asNum", this._asNum, this.asNumber), this._asNum = this.asNumber, this.nextTick(() => {
2652
+ this.selectInput && (this.selectInput.addEventListener("focus", this._onFocus), this.selectInput.addEventListener("blur", this._onBlur), this.selectInput.addEventListener("wheel", this._onWheel.bind(this)), this.isDateTime || (this.selectInput.addEventListener("input", this._onInput), this.selectInput.addEventListener("keydown", this._onKeydown)));
2653
+ }, 5);
2654
+ }
2655
+ beforeUnmountParent() {
2656
+ this.selectInput && (this.selectInput.removeEventListener("focus", this._onFocus), this.selectInput.removeEventListener("blur", this._onBlur), this.selectInput.removeEventListener("wheel", this._onWheel.bind(this)), this.isDateTime || (this.selectInput.removeEventListener("input", this._onInput), this.selectInput.removeEventListener("keydown", this._onKeydown)));
2657
+ }
2658
+ onAcceptUnmasked(t) {
2659
+ }
2660
+ onAccept(t) {
2661
+ const e = this.getFromMask(this.maskInner, t, "MM"), s = this.getFromMask(this.maskInner, t, "YYYY"), i = this.getFromMask(this.maskInner, t, "DD");
2662
+ let a = this.getFromMask(this.maskInner, t, "hh");
2663
+ const n = this.getFromMask(this.maskInner, t, "mm"), u = this.getFromMask(this.maskInner, t, "ss"), h = this.is12hours ? t.toLowerCase().includes("am") ? "am" : "pm" : "";
2664
+ this.$emit("dateMaskChange", {
2665
+ month: e,
2666
+ year: s,
2667
+ day: i,
2668
+ hour: a,
2669
+ minute: n,
2670
+ seconds: u,
2671
+ AmPm: h
2672
+ });
2673
+ }
2674
+ focus(t = 0, e = 0) {
2675
+ const s = this.$el.querySelector("input.inputMask");
2676
+ s?.focus?.(), s?.setSelectionRange && s?.value?.trim?.() && s?.setSelectionRange?.(
2677
+ t,
2678
+ e > t ? e || t : e
2679
+ );
2680
+ }
2681
+ blur() {
2682
+ this.$el.querySelector("input.inputMask")?.blur?.();
2683
+ }
2684
+ _preResetValue = "";
2685
+ _onReset() {
2686
+ this._preResetValue = this.value, this.$emit("reset"), this._onInput("", !0), this.selectInput?.focus?.();
2687
+ }
2688
+ restore() {
2689
+ this._preResetValue && (this.setValue(this._preResetValue), this.nextTick(() => {
2690
+ ["string", "number"].includes(typeof this.value) && (this.$emit("input", this.value), this.$emit("change", this.value), this.$emit("update:modelValue", this.value)), this._preResetValue = "", this.selectInput?.focus?.();
2691
+ }));
2692
+ }
2693
+ selectInput;
2694
+ _setupIMask(t) {
2695
+ const e = !!this.selectInput;
2696
+ this.selectInput = t, t && (e && this.updateIMaskOptions({
2697
+ mask: this.maskInner || String,
2698
+ scale: typeof this.asNumber == "number" ? this._asNum : 0,
2699
+ autofix: !0,
2700
+ min: this.min,
2701
+ max: this.max,
2702
+ radix: this.radix,
2703
+ placeholder: this.placeholder,
2704
+ thousandsSeparator: " ",
2705
+ padFractionalZeros: !0,
2706
+ overwrite: !0,
2707
+ lazy: !1,
2708
+ autocomplete: this.maskPreset === "email" ? "email" : "off",
2709
+ blocks: this.maskBlocks
2710
+ }), !this.maskInner && this.mask && (this.maskInner = this.mask), this.initIMask(t));
2711
+ }
2712
+ _onFocus() {
2713
+ this.$emit("focus");
2714
+ }
2715
+ _onBlur() {
2716
+ this.nextTick(() => this.$emit("blur", this.selectInput?.value));
2717
+ }
2718
+ _onWheel = /* @__PURE__ */ p((t) => {
2719
+ if (console.log("wheel", this._asNum, this.asNumber), this.disabled || !this._asNum)
2720
+ return;
2721
+ t.preventDefault();
2722
+ let e = parseFloat(this.value.replace(this.radix, "."));
2723
+ isNaN(e) && (e = 0);
2724
+ const s = this.step || 1;
2725
+ t.deltaY < 0 ? e += s : e -= s, this.min !== void 0 && e < this.min && (e = this.min), this.max !== void 0 && e > this.max && (e = this.max), this.step && (e = parseFloat(e.toFixed(this.step))), this.setValue(e), this.$emit("input", e), this.$emit("update:modelValue", e), this.$emit("change", e);
2726
+ }, "_onWheel");
2727
+ _onKeydown(t) {
2728
+ const e = t?.ctrlKey || t?.metaKey;
2729
+ this._preResetValue && e && t.key === "z" && this.restore();
2730
+ }
2731
+ _onInput(t, e = !1) {
2732
+ const s = t?.target?.value?.trim?.() || t;
2733
+ if (typeof s != "string") {
2734
+ this.isDateTime || (this.$emit("input", this.value = "", e), this.$emit("change", "", e), this.$emit("update:modelValue", ""));
2735
+ return;
2736
+ } else s && (this._preResetValue = "");
2737
+ ["string", "number"].includes(typeof (this.value = s)) && (this.$emit("input", this.value, e), this.$emit("change", this.value, e), this.$emit("update:modelValue", this.value));
2738
+ }
2739
+ _extractDateOnly(t) {
2740
+ const e = /([\d\w]{2,4}[./_-][\d\w]{2,4}[./_-][\d\w]{2,4})/, s = t.match(e);
2741
+ return s ? s?.[0] ?? null : null;
2742
+ }
2743
+ getFromMask(t, e, s = "MM") {
2744
+ const i = t?.toString().indexOf(s);
2745
+ if (i === -1)
2746
+ return 0;
2747
+ const a = e.slice(i, i + s.length), n = parseInt(a, 10);
2748
+ return isNaN(n) ? 0 : n;
2749
+ }
2750
+ setValue(t) {
2751
+ this.selectInput?.maskRef && (this.selectInput.maskRef.unmaskedValue = t), super.setValue(t);
2752
+ }
2753
+ getValue() {
2754
+ return this._asNum ? parseInt(this.value) : this.value;
2755
+ }
2756
+ _prepareIMask(t) {
2757
+ if (this.isDateTime)
2758
+ return t.toUpperCase();
2759
+ }
2760
+ replaceInMask(t, e, s, i = "MM") {
2761
+ const a = t.indexOf(i);
2762
+ if (a === -1) return e;
2763
+ const n = s.toString().padStart(2, "0");
2764
+ return e.slice(0, a) + n + e.slice(a + i.length);
2765
+ }
2766
+ /**
2767
+ * Автоматическая корректировка дней дат по маске DT
2768
+ * @param masked
2769
+ */
2770
+ dateMaskValidateWithReplaceDays(t) {
2771
+ const e = this.getFromMask(t.parent.mask, t.parent.displayValue, "MM"), s = this.getFromMask(t.parent.mask, t.parent.displayValue, "YYYY"), i = this.getFromMask(t.parent.mask, t.parent.displayValue, "DD");
2772
+ let a = i;
2773
+ return e && (e == 2 && (!s || s && s % 4 == 0) ? a = 29 : e == 2 && s && s.toString().length == 4 && s % 4 != 0 ? a = 28 : [1, 3, 5, 7, 8, 10, 12].includes(e) ? a = 31 : a = 30, a < i && this.nextTick(() => {
2774
+ this.selectInput && (this.selectInput.value = this.replaceInMask(
2775
+ t.parent.mask,
2776
+ t.parent.displayValue,
2777
+ a.toString(),
2778
+ "DD"
2779
+ ), this.selectInput.blur(), this.nextTick(() => {
2780
+ this.selectInput?.focus();
2781
+ }));
2782
+ })), !0;
2783
+ }
2784
+ _isOnlyValueCopied = !1;
2785
+ _copyValueToClipboard() {
2786
+ this.value && $VST.copyToClipboard(this.value), this._isOnlyValueCopied = !0, setTimeout(() => this._isOnlyValueCopied = !1, 500);
2787
+ }
2788
+ _canIncrementComputed() {
2789
+ if (!this._asNum || this.disabled) return !1;
2790
+ const t = parseFloat(this.value);
2791
+ return !this.max || t < this.max;
2792
+ }
2793
+ _canDecrementComputed() {
2794
+ if (!this._asNum || this.disabled) return !1;
2795
+ const t = parseFloat(this.value);
2796
+ return !this.min || t > this.min;
2797
+ }
2798
+ _valueComputed() {
2799
+ return ["date", "datetime", "datetimeSec"].includes(this.maskPreset ?? "");
2800
+ }
2801
+ }, p(R, "StringField"), R);
2802
+ k([
2803
+ C(String)
2804
+ ], m.prototype, "maskPreset", 2);
2805
+ k([
2806
+ C(Boolean)
2807
+ ], m.prototype, "force12hours", 2);
2808
+ k([
2809
+ C(Boolean)
2810
+ ], m.prototype, "alwaysCopyIcon", 2);
2811
+ k([
2812
+ C(Boolean)
2813
+ ], m.prototype, "disabled", 2);
2814
+ k([
2815
+ C(Boolean, Number)
2816
+ ], m.prototype, "asNumber", 2);
2817
+ k([
2818
+ C(String)
2819
+ ], m.prototype, "radix", 2);
2820
+ k([
2821
+ C(String)
2822
+ ], m.prototype, "mask", 2);
2823
+ k([
2824
+ C(Array)
2825
+ ], m.prototype, "mapToRadix", 2);
2826
+ k([
2827
+ C(String)
2828
+ ], m.prototype, "dtPresetLocale", 2);
2829
+ k([
2830
+ C(String)
2831
+ ], m.prototype, "thousandsSeparator", 2);
2832
+ k([
2833
+ C(Number)
2834
+ ], m.prototype, "step", 2);
2835
+ k([
2836
+ C(Number)
2837
+ ], m.prototype, "min", 2);
2838
+ k([
2839
+ C(Number)
2840
+ ], m.prototype, "max", 2);
2841
+ k([
2842
+ C(String)
2843
+ ], m.prototype, "placeholder", 2);
2844
+ k([
2845
+ ft("canIncrement")
2846
+ ], m.prototype, "_canIncrementComputed", 1);
2847
+ k([
2848
+ ft("canDecrement")
2849
+ ], m.prototype, "_canDecrementComputed", 1);
2850
+ k([
2851
+ ft("isDateTime")
2852
+ ], m.prototype, "_valueComputed", 1);
2853
+ m = k([
2854
+ Nt
2855
+ ], m);
2856
+ const ee = { class: "relative w100%" }, se = ["value", "disabled", "placeholder", "prepare", "autocomplete"], ie = {
2857
+ key: 0,
2858
+ class: "w22px h22px text-stone absolute t-11px l-12px z4 cursor-pointer hover:scale-130"
2859
+ };
2860
+ function ae(r, t, e, s, i, a) {
2861
+ const n = st("ClipboardDocumentListIcon"), u = st("CheckBadgeIcon"), h = st("NoSymbolIcon");
2862
+ return A(), V("div", {
2863
+ class: it(["d-inline-block my2px w100% relative", {
2864
+ ["sf" + r._randKey]: !0
2865
+ }])
2866
+ }, [
2867
+ x("div", ee, [
2868
+ x("input", {
2869
+ class: it(["w100% inputMask", {
2870
+ "hover:bg-white": !r.disabled,
2871
+ "user-select-none!": r.disabled
2872
+ }]),
2873
+ value: r.value,
2874
+ disabled: r.disabled,
2875
+ placeholder: r.placeholder,
2876
+ prepare: r._prepareIMask,
2877
+ ref: r._setupIMask,
2878
+ onInput: t[0] || (t[0] = (l) => r._iMaskInput(l)),
2879
+ onKeypress: t[1] || (t[1] = $t((l) => r.$emit("keypress.enter"), ["enter"])),
2880
+ autocomplete: r.maskPreset == "email" ? "email" : "off",
2881
+ onsubmit: "return false",
2882
+ autocorrect: "off",
2883
+ autocapitalize: "off"
2884
+ }, null, 42, se),
2885
+ r.maskPreset == "datetime" || r.maskPreset == "datetimeSec" ? (A(), V("div", {
2886
+ key: 0,
2887
+ class: "absolute! r-15px! t-2 fs-0.7rem text-stone-500 hover:scale-110 hover:fw-bold",
2888
+ style: Yt({
2889
+ pointerEvents: r.disabled ? "none !important" : void 0
2890
+ })
2891
+ }, at(r.utc), 5)) : Y("", !0)
2892
+ ]),
2893
+ (r.disabled || r.alwaysCopyIcon) && r.value?.toString?.()?.trim?.() ? (A(), V("div", ie, [
2894
+ r._isOnlyValueCopied ? (A(), K(u, {
2895
+ key: 1,
2896
+ class: "text-emerald-500"
2897
+ })) : (A(), K(n, {
2898
+ key: 0,
2899
+ onClick: t[2] || (t[2] = (l) => r._copyValueToClipboard())
2900
+ }))
2901
+ ])) : Y("", !0),
2902
+ !r.disabled && (r.value || r._preResetValue) ? (A(), V("div", {
2903
+ key: 1,
2904
+ class: it(["w25px h25px text-stone absolute r-12px z4 cursor-pointer hover:scale-130", {
2905
+ "t-15px": r.maskPreset == "datetime" || r.maskPreset == "datetimeSec",
2906
+ "t-9px": r.maskPreset != "datetime" && r.maskPreset != "datetimeSec"
2907
+ }])
2908
+ }, [
2909
+ r._preResetValue ? (A(), V("svg", {
2910
+ key: 0,
2911
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-arrow-back-up text-teal-500",
2912
+ xmlns: "http://www.w3.org/2000/svg",
2913
+ width: "24",
2914
+ height: "24",
2915
+ viewBox: "0 0 24 24",
2916
+ fill: "none",
2917
+ stroke: "currentColor",
2918
+ "stroke-width": "2",
2919
+ "stroke-linecap": "round",
2920
+ "stroke-linejoin": "round",
2921
+ onClick: t[3] || (t[3] = (...l) => r.restore && r.restore(...l))
2922
+ }, [...t[5] || (t[5] = [
2923
+ x("path", {
2924
+ stroke: "none",
2925
+ d: "M0 0h24v24H0z",
2926
+ fill: "none"
2927
+ }, null, -1),
2928
+ x("path", { d: "M9 14l-4 -4l4 -4" }, null, -1),
2929
+ x("path", { d: "M5 10h11a4 4 0 1 1 0 8h-1" }, null, -1)
2930
+ ])])) : (A(), K(h, {
2931
+ key: 1,
2932
+ onClick: t[4] || (t[4] = (l) => r._onReset())
2933
+ }))
2934
+ ], 2)) : Y("", !0),
2935
+ (r.disabled || r.alwaysCopyIcon) && r.value?.toString?.()?.trim?.() ? (A(), K(Kt("style"), { key: 2 }, {
2936
+ default: zt(() => [
2937
+ jt(".sf" + at(r._randKey) + "[" + at(r.$options.__scopeId) + "] input { padding-left: 40px !important; }", 1)
2938
+ ]),
2939
+ _: 1
2940
+ })) : Y("", !0)
2941
+ ], 2);
2942
+ }
2943
+ p(ae, "render");
2944
+ const pe = /* @__PURE__ */ Ht(m, [["render", ae], ["__scopeId", "data-v-ce56a62a"]]);
2945
+ export {
2946
+ pe as default
2947
+ };