smoothly 0.1.86 → 0.1.87

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 (46) hide show
  1. package/dist/cjs/{generate-a6821b82.js → generate-f9a36f25.js} +1 -1
  2. package/dist/cjs/index-328edd81.js +1599 -0
  3. package/dist/cjs/{index-fc82954f.js → index-ac32385c.js} +230 -184
  4. package/dist/cjs/smoothly-accordion_47.cjs.entry.js +1025 -19098
  5. package/dist/cjs/smoothly-calendar.cjs.entry.js +2 -2
  6. package/dist/cjs/smoothly-display-amount.cjs.entry.js +1 -1
  7. package/dist/cjs/smoothly-display.cjs.entry.js +2 -1
  8. package/dist/cjs/smoothly-input-date-range.cjs.entry.js +1 -1
  9. package/dist/cjs/smoothly-input-date.cjs.entry.js +1 -1
  10. package/dist/cjs/smoothly-input-month.cjs.entry.js +2 -2
  11. package/dist/cjs/smoothly-input.cjs.entry.js +17 -10
  12. package/dist/cjs/smoothly-select-demo.cjs.entry.js +2 -2
  13. package/dist/collection/components/display/index.js +1 -1
  14. package/dist/collection/components/input/index.js +17 -10
  15. package/dist/collection/components/select-demo/index.js +2 -2
  16. package/dist/custom-elements/index.js +1174 -19455
  17. package/dist/{smoothly/generate-776b3b0f.js → esm/generate-50b98474.js} +1 -1
  18. package/dist/esm/index-1be6d668.js +1597 -0
  19. package/dist/{smoothly/index-a28d88cf.js → esm/index-a5a08f46.js} +230 -184
  20. package/dist/esm/smoothly-accordion_47.entry.js +1025 -19098
  21. package/dist/esm/smoothly-calendar.entry.js +2 -2
  22. package/dist/esm/smoothly-display-amount.entry.js +1 -1
  23. package/dist/esm/smoothly-display.entry.js +2 -1
  24. package/dist/esm/smoothly-input-date-range.entry.js +1 -1
  25. package/dist/esm/smoothly-input-date.entry.js +1 -1
  26. package/dist/esm/smoothly-input-month.entry.js +2 -2
  27. package/dist/esm/smoothly-input.entry.js +17 -10
  28. package/dist/esm/smoothly-select-demo.entry.js +2 -2
  29. package/dist/{esm/generate-776b3b0f.js → smoothly/generate-50b98474.js} +1 -1
  30. package/dist/smoothly/index-1be6d668.js +1597 -0
  31. package/dist/{esm/index-a28d88cf.js → smoothly/index-a5a08f46.js} +230 -184
  32. package/dist/smoothly/p-7b43df84.entry.js +1 -0
  33. package/dist/smoothly/smoothly-calendar.entry.js +2 -2
  34. package/dist/smoothly/smoothly-display-amount.entry.js +1 -1
  35. package/dist/smoothly/smoothly-display.entry.js +2 -1
  36. package/dist/smoothly/smoothly-input-date-range.entry.js +1 -1
  37. package/dist/smoothly/smoothly-input-date.entry.js +1 -1
  38. package/dist/smoothly/smoothly-input-month.entry.js +2 -2
  39. package/dist/smoothly/smoothly-input.entry.js +17 -10
  40. package/dist/smoothly/smoothly-select-demo.entry.js +2 -2
  41. package/dist/types/components/input/index.d.ts +1 -0
  42. package/package.json +3 -3
  43. package/dist/cjs/index-42db74b3.js +0 -19931
  44. package/dist/esm/index-36a04e8c.js +0 -19929
  45. package/dist/smoothly/index-36a04e8c.js +0 -19929
  46. package/dist/smoothly/p-375a8d94.entry.js +0 -1
@@ -0,0 +1,1599 @@
1
+ 'use strict';
2
+
3
+ const _commonjsHelpers = require('./_commonjsHelpers-10109b76.js');
4
+ const index$3 = require('./index-ac32385c.js');
5
+
6
+ var getAdjecentWordBreakIndex_1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
7
+ "use strict";
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.getAdjecentWordBreakIndex = void 0;
10
+ function getForwardWordBreakIndex(str, index, wordRegex) {
11
+ let result = 0;
12
+ while (wordRegex.exec(str) != null) {
13
+ result = wordRegex.lastIndex;
14
+ if (wordRegex.lastIndex > index)
15
+ break;
16
+ }
17
+ wordRegex.lastIndex <= index && (result = str.length);
18
+ return result;
19
+ }
20
+ function getBackwardWordBreakIndex(str, index, wordRegex) {
21
+ let result = 0;
22
+ let execArray;
23
+ while ((execArray = wordRegex.exec(str)) != null) {
24
+ if (wordRegex.lastIndex - execArray[0].length < index)
25
+ result = wordRegex.lastIndex - execArray[0].length;
26
+ else
27
+ break;
28
+ }
29
+ return result;
30
+ }
31
+ function getAdjecentWordBreakIndex(str, index, direction) {
32
+ const wordRegex = /([\wåäöüéáúíóßðœøæñµçþ_]+|[@-]+)/gi;
33
+ return direction == "backward"
34
+ ? getBackwardWordBreakIndex(str, index, wordRegex)
35
+ : getForwardWordBreakIndex(str, index, wordRegex);
36
+ }
37
+ exports.getAdjecentWordBreakIndex = getAdjecentWordBreakIndex;
38
+ //# sourceMappingURL=getAdjecentWordBreakIndex.js.map
39
+ });
40
+
41
+ const getAdjecentWordBreakIndex = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(getAdjecentWordBreakIndex_1);
42
+
43
+ var Selection_1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
44
+ "use strict";
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.Selection = void 0;
47
+ var Selection;
48
+ (function (Selection) {
49
+ function getCursor(selection) {
50
+ return selection.direction == "backward" ? selection.start : selection.end;
51
+ }
52
+ Selection.getCursor = getCursor;
53
+ function getStalker(selection) {
54
+ return selection.direction != "backward" ? selection.start : selection.end;
55
+ }
56
+ Selection.getStalker = getStalker;
57
+ })(Selection = exports.Selection || (exports.Selection = {}));
58
+ //# sourceMappingURL=Selection.js.map
59
+ });
60
+
61
+ const Selection = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(Selection_1);
62
+
63
+ var State_1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
64
+ "use strict";
65
+ Object.defineProperty(exports, "__esModule", { value: true });
66
+ exports.State = void 0;
67
+ var State;
68
+ (function (State) {
69
+ function copy(state) {
70
+ return {
71
+ value: state.value,
72
+ selection: { start: state.selection.start, end: state.selection.end, direction: state.selection.direction },
73
+ };
74
+ }
75
+ State.copy = copy;
76
+ })(State = exports.State || (exports.State = {}));
77
+ //# sourceMappingURL=State.js.map
78
+ });
79
+
80
+ const State = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(State_1);
81
+
82
+ var StateEditor_1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
83
+ "use strict";
84
+ Object.defineProperty(exports, "__esModule", { value: true });
85
+ exports.StateEditor = void 0;
86
+ class StateEditor {
87
+ constructor(state) {
88
+ this.value = state.value;
89
+ this.selection = { start: state.selection.start, end: state.selection.end, direction: state.selection.direction };
90
+ }
91
+ get(index, length = 1) {
92
+ return this.value.substr(index, length);
93
+ }
94
+ is(index, ...character) {
95
+ const c = this.get(index);
96
+ return character.some(d => c == d);
97
+ }
98
+ isDigit(index) {
99
+ const character = this.get(index);
100
+ return character >= "0" && character <= "9";
101
+ }
102
+ match(matcher) {
103
+ return this.value.match(matcher);
104
+ }
105
+ replace(start, end, value) {
106
+ let result;
107
+ if (typeof start == "string" && typeof end == "string") {
108
+ let s;
109
+ result = this;
110
+ while ((s = result.value.search(start)) > -1)
111
+ result = result.replace(s, s + start.length, end);
112
+ }
113
+ else if (typeof start == "number" && typeof end == "number") {
114
+ const state = {
115
+ value: this.value,
116
+ selection: { start: this.selection.start, end: this.selection.end, direction: this.selection.direction },
117
+ };
118
+ if (!value)
119
+ value = "";
120
+ state.value = this.value.slice(0, start) + value + this.value.slice(end, this.value.length);
121
+ if (this.selection.start >= end)
122
+ state.selection.start = this.selection.start + value.length - end + start;
123
+ else if (this.selection.start > start && this.selection.start < end)
124
+ state.selection.start = Math.min(this.selection.start, start + value.length);
125
+ if (this.selection.end >= end)
126
+ state.selection.end = this.selection.end + value.length - end + start;
127
+ else if (this.selection.end > start && this.selection.end < end)
128
+ state.selection.end = Math.min(this.selection.end, start + value.length);
129
+ result = new StateEditor(state);
130
+ }
131
+ return result || this;
132
+ }
133
+ insert(index, value) {
134
+ return this.replace(index, index, value);
135
+ }
136
+ append(value) {
137
+ return this.insert(this.value.length, value);
138
+ }
139
+ prepend(value) {
140
+ return this.insert(0, value);
141
+ }
142
+ suffix(value) {
143
+ return new StateEditor({ value: this.value + value, selection: this.selection });
144
+ }
145
+ delete(start, end) {
146
+ let result;
147
+ if (!this.value)
148
+ result = this;
149
+ else if (typeof start == "string") {
150
+ let s;
151
+ result = this;
152
+ while ((s = result.value.search(start)) > -1)
153
+ result = result.delete(s, s + start.length);
154
+ }
155
+ else
156
+ result = this.replace(start, end || start + 1, "");
157
+ return result;
158
+ }
159
+ truncate(end) {
160
+ return this.value.length >= end ? this.delete(end, this.value.length) : this;
161
+ }
162
+ pad(length, padding, index) {
163
+ let result = this;
164
+ while (length > result.value.length + padding.length)
165
+ result = result.insert(index, padding);
166
+ if (length > result.value.length)
167
+ result = result.insert(index, padding.substring(0, length - result.value.length));
168
+ return result;
169
+ }
170
+ padEnd(length, padding) {
171
+ return this.pad(length, padding, this.value.length);
172
+ }
173
+ padStart(length, padding) {
174
+ return this.pad(length, padding, 0);
175
+ }
176
+ map(mapping) {
177
+ let result = this;
178
+ let j = 0;
179
+ for (let i = 0; i < this.value.length; i++) {
180
+ const replacement = mapping(this.get(i), i);
181
+ result = result.replace(j, j + 1, replacement);
182
+ j += replacement.length;
183
+ }
184
+ return result;
185
+ }
186
+ static copy(state) {
187
+ return new StateEditor(Object.assign({}, state));
188
+ }
189
+ static create() {
190
+ return new StateEditor({ value: "", selection: { start: 0, end: 0 } });
191
+ }
192
+ static modify(state) {
193
+ return new StateEditor(typeof state == "string" ? { value: state, selection: { start: state.length, end: state.length } } : state);
194
+ }
195
+ }
196
+ exports.StateEditor = StateEditor;
197
+ //# sourceMappingURL=StateEditor.js.map
198
+ });
199
+
200
+ const StateEditor = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(StateEditor_1);
201
+
202
+ var Action_1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
203
+ "use strict";
204
+ Object.defineProperty(exports, "__esModule", { value: true });
205
+ exports.Action = void 0;
206
+
207
+
208
+
209
+
210
+ var Action;
211
+ (function (Action) {
212
+ function apply(formatter, state, action) {
213
+ var _a, _b;
214
+ let result = State_1.State.copy(formatter.unformat(StateEditor_1.StateEditor.copy(state)));
215
+ if (action) {
216
+ if (action.ctrlKey || action.metaKey) {
217
+ if (action.key == "a")
218
+ select(result, 0, result.value.length, "forward");
219
+ else if (["ArrowLeft", "ArrowRight"].includes(action.key) && ((_a = state) === null || _a === void 0 ? void 0 : _a.type) != "password")
220
+ result = ctrlArrow(formatter, state, action);
221
+ else if (["Delete", "Backspace"].includes(action.key) && ((_b = state) === null || _b === void 0 ? void 0 : _b.type) != "password")
222
+ result = ctrlBackspaceDelete(formatter, state, action);
223
+ }
224
+ else if (["ArrowLeft", "ArrowRight", "Home", "End"].includes(action.key))
225
+ arrowHomeEnd(result, action);
226
+ else if (["Delete", "Backspace"].includes(action.key)) {
227
+ result.selection.start == result.selection.end &&
228
+ select(result, result.selection.start + (action.key == "Backspace" ? -1 : 0), result.selection.end + (action.key == "Delete" ? 1 : 0));
229
+ erase(result);
230
+ }
231
+ else if (action.key != "Unidentified") {
232
+ erase(result);
233
+ formatter.allowed(action.key, result) && replace(result, action.key);
234
+ }
235
+ }
236
+ return formatter.format(StateEditor_1.StateEditor.copy(result));
237
+ }
238
+ Action.apply = apply;
239
+ function ctrlArrow(formatter, state, action) {
240
+ let cursorPosition = Selection_1.Selection.getCursor(state.selection);
241
+ let stalkPosition = Selection_1.Selection.getStalker(state.selection);
242
+ cursorPosition = getAdjecentWordBreakIndex_1.getAdjecentWordBreakIndex(state.value, cursorPosition, action.key == "ArrowLeft" ? "backward" : "forward");
243
+ stalkPosition = action.shiftKey ? stalkPosition : cursorPosition;
244
+ return State_1.State.copy(formatter.unformat(StateEditor_1.StateEditor.copy(Object.assign(Object.assign({}, state), { selection: {
245
+ start: Math.min(stalkPosition, cursorPosition),
246
+ end: Math.max(stalkPosition, cursorPosition),
247
+ direction: stalkPosition < cursorPosition ? "forward" : stalkPosition > cursorPosition ? "backward" : "none",
248
+ } }))));
249
+ }
250
+ function ctrlBackspaceDelete(formatter, state, action) {
251
+ const cursorPosition = Selection_1.Selection.getCursor(state.selection);
252
+ const adjecentIndex = getAdjecentWordBreakIndex_1.getAdjecentWordBreakIndex(state.value, cursorPosition, action.key == "Backspace" ? "backward" : "forward");
253
+ const result = State_1.State.copy(formatter.unformat(StateEditor_1.StateEditor.copy(Object.assign(Object.assign({}, state), { selection: {
254
+ start: Math.min(cursorPosition, adjecentIndex),
255
+ end: Math.max(cursorPosition, adjecentIndex),
256
+ direction: "none",
257
+ } }))));
258
+ result.value = result.value.substring(0, result.selection.start) + result.value.substring(result.selection.end);
259
+ result.selection.end = result.selection.start;
260
+ return result;
261
+ }
262
+ function arrowHomeEnd(state, action) {
263
+ let cursorPosition = Selection_1.Selection.getCursor(state.selection);
264
+ let stalkPosition = Selection_1.Selection.getStalker(state.selection);
265
+ cursorPosition =
266
+ action.key == "Home"
267
+ ? 0
268
+ : action.key == "End"
269
+ ? state.value.length
270
+ : state.selection.start == state.selection.end || action.shiftKey
271
+ ? Math.min(Math.max(cursorPosition + (action.key == "ArrowLeft" ? -1 : 1), 0), state.value.length)
272
+ : action.key == "ArrowLeft"
273
+ ? state.selection.start
274
+ : state.selection.end;
275
+ stalkPosition = action.shiftKey ? stalkPosition : cursorPosition;
276
+ state.selection.direction =
277
+ stalkPosition < cursorPosition ? "forward" : stalkPosition > cursorPosition ? "backward" : "none";
278
+ state.selection.start = Math.min(stalkPosition, cursorPosition);
279
+ state.selection.end = Math.max(stalkPosition, cursorPosition);
280
+ }
281
+ function select(state, from, to, direction) {
282
+ state.selection.start = from;
283
+ state.selection.end = to;
284
+ direction && (state.selection.direction = direction);
285
+ }
286
+ function erase(state) {
287
+ replace(state, "");
288
+ }
289
+ function replace(state, insertString) {
290
+ state.value =
291
+ state.value.substring(0, state.selection.start) + insertString + state.value.substring(state.selection.end);
292
+ state.selection.start = state.selection.start + insertString.length;
293
+ state.selection.end = state.selection.start;
294
+ }
295
+ })(Action = exports.Action || (exports.Action = {}));
296
+ //# sourceMappingURL=Action.js.map
297
+ });
298
+
299
+ const Action = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(Action_1);
300
+
301
+ var base = _commonjsHelpers.createCommonjsModule(function (module, exports) {
302
+ "use strict";
303
+ Object.defineProperty(exports, "__esModule", { value: true });
304
+ exports.parse = exports.format = exports.get = exports.add = void 0;
305
+
306
+ const handlers = {};
307
+ function add(type, create) {
308
+ handlers[type] = create;
309
+ }
310
+ exports.add = add;
311
+ function get(type, ...argument) {
312
+ const create = handlers[type];
313
+ return create && create(argument);
314
+ }
315
+ exports.get = get;
316
+ function format(data, type, ...argument) {
317
+ const handler = get(type, argument);
318
+ return handler
319
+ ? handler.format(StateEditor_1.StateEditor.modify(handler.toString(typeof data == "string" ? parse(data, type, argument) : data)))
320
+ .value
321
+ : "";
322
+ }
323
+ exports.format = format;
324
+ function parse(value, type, ...argument) {
325
+ const handler = get(type, argument);
326
+ return handler ? handler.fromString(handler.unformat(StateEditor_1.StateEditor.modify(value)).value) : undefined;
327
+ }
328
+ exports.parse = parse;
329
+ //# sourceMappingURL=base.js.map
330
+ });
331
+
332
+ const base$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(base);
333
+
334
+ var cardCsc = _commonjsHelpers.createCommonjsModule(function (module, exports) {
335
+ "use strict";
336
+ Object.defineProperty(exports, "__esModule", { value: true });
337
+
338
+ class Handler {
339
+ toString(data) {
340
+ return typeof data == "string" ? data : "";
341
+ }
342
+ fromString(value) {
343
+ return typeof value == "string" ? value : undefined;
344
+ }
345
+ format(unformated) {
346
+ return Object.assign(Object.assign({}, unformated), { type: "text", autocomplete: "cc-csc", length: [3, 3], pattern: /^\d{3}$/ });
347
+ }
348
+ unformat(formated) {
349
+ return formated;
350
+ }
351
+ allowed(symbol, state) {
352
+ return state.value.length < 3 && symbol >= "0" && symbol <= "9";
353
+ }
354
+ }
355
+ base.add("card-csc", () => new Handler());
356
+ //# sourceMappingURL=card-csc.js.map
357
+ });
358
+
359
+ const cardCsc$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(cardCsc);
360
+
361
+ var cardExpires = _commonjsHelpers.createCommonjsModule(function (module, exports) {
362
+ "use strict";
363
+ Object.defineProperty(exports, "__esModule", { value: true });
364
+
365
+ class Handler {
366
+ toString(data) {
367
+ return Array.isArray(data) && data.length == 2 && typeof data[0] == "number" && typeof data[1] == "number"
368
+ ? data[0].toString().padStart(2, "0") + data[1].toString().padStart(2, "0")
369
+ : "";
370
+ }
371
+ fromString(value) {
372
+ return typeof value == "string" && value.length == 4
373
+ ? [Number.parseInt(value.slice(0, 2)), Number.parseInt(value.slice(2))]
374
+ : undefined;
375
+ }
376
+ format(unformated) {
377
+ let result = unformated;
378
+ if (unformated.value.length > 0 && !unformated.is(0, "0", "1"))
379
+ result = result.prepend("0");
380
+ if (result.value.length > 1)
381
+ result = result.insert(2, " / ");
382
+ return Object.assign(Object.assign({}, result), { type: "text", autocomplete: "cc-exp", length: [7, 7], pattern: /^(0[1-9]|1[012]) \/ \d\d$/ });
383
+ }
384
+ unformat(formated) {
385
+ return formated.delete(" / ");
386
+ }
387
+ allowed(symbol, state) {
388
+ return state.value.length < 4 && symbol >= "0" && symbol <= "9";
389
+ }
390
+ }
391
+ base.add("card-expires", () => new Handler());
392
+ //# sourceMappingURL=card-expires.js.map
393
+ });
394
+
395
+ const cardExpires$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(cardExpires);
396
+
397
+ var cardNumber = _commonjsHelpers.createCommonjsModule(function (module, exports) {
398
+ "use strict";
399
+ Object.defineProperty(exports, "__esModule", { value: true });
400
+
401
+ class Handler {
402
+ toString(data) {
403
+ return typeof data == "string" ? data : "";
404
+ }
405
+ fromString(value) {
406
+ return typeof value == "string" ? value : undefined;
407
+ }
408
+ format(unformated) {
409
+ const issuer = getIssuer(unformated.value);
410
+ const result = unformated.map((symbol, index) => symbol + (index % 4 == 3 && index + 1 < issuer.length[0] ? " " : ""));
411
+ return Object.assign(Object.assign({}, result), { type: "text", autocomplete: "cc-number", length: issuer.length.slice(1), pattern: issuer.verification, classes: ["issuer-" + issuer.icon] });
412
+ }
413
+ unformat(formated) {
414
+ return formated.delete(" ");
415
+ }
416
+ allowed(symbol, state) {
417
+ const issuer = getIssuer(state.value);
418
+ return symbol >= "0" && symbol <= "9" && state.value.length < issuer.length[0];
419
+ }
420
+ }
421
+ base.add("card-number", () => new Handler());
422
+ function getIssuer(value) {
423
+ let result = defaultIssuer;
424
+ for (const key in issuers)
425
+ if (Object.prototype.hasOwnProperty.call(issuers, key) && issuers[key].identification.test(value)) {
426
+ result = Object.assign(Object.assign(Object.assign({}, defaultIssuer), { name: key }), issuers[key]);
427
+ break;
428
+ }
429
+ return result;
430
+ }
431
+ const defaultIssuer = {
432
+ name: "unknown",
433
+ verification: /^\d{19}$/,
434
+ identification: /^\d/,
435
+ length: [16, 16, 19],
436
+ icon: "generic",
437
+ };
438
+ const issuers = {
439
+ amex: {
440
+ verification: /^3[47][0-9]{2}\s[0-9]{4}\s[0-9]{4}\s[0-9]{3}$/,
441
+ identification: /^3[47]/,
442
+ length: [15, 18, 18],
443
+ icon: "amex",
444
+ },
445
+ dankort: {
446
+ verification: /^(5019)\s[0-9]{4}\s[0-9]{4}\s[0-9]{4}$/,
447
+ identification: /^(5019)\d+/,
448
+ length: [16, 19, 19],
449
+ icon: "generic",
450
+ },
451
+ diners: {
452
+ verification: /^3(?:0[0-5]|[68][0-9])[0-9]\s[0-9]{4}\s[0-9]{4}\s[0-9]{2}$/,
453
+ identification: /^3(?:0[0-5]|[68][0-9])/,
454
+ length: [14, 17, 17],
455
+ icon: "diners",
456
+ },
457
+ discover: {
458
+ verification: /^6(?:011|5[0-9]{2})\s[0-9]{4}\s[0-9]{4}\s[0-9]{4}$/,
459
+ identification: /^6(?:011|5[0-9]{2})/,
460
+ length: [16, 19, 19],
461
+ icon: "generic",
462
+ },
463
+ electron: {
464
+ verification: /^((4026|4405|4508|4844|4913|4917)\s[0-9]{4}\s[0-9]{4}\s[0-9]{4})|((4175)\s(00)[0-9]{2}\s[0-9]{4}\s[0-9]{4})$/,
465
+ identification: /^(4026|417500|4405|4508|4844|4913|4917)/,
466
+ length: [16, 19, 19],
467
+ icon: "generic",
468
+ },
469
+ interpayment: {
470
+ verification: /^(636)[0-9]\s[0-9]{4}\s[0-9]{4}\s[0-9]{4}$/,
471
+ identification: /^(636)/,
472
+ length: [16, 19, 19],
473
+ icon: "generic",
474
+ },
475
+ jcb: {
476
+ verification: /^((?:2131|1800)\s[0-9]{4}\s[0-9]{4}\s[0-9]{4})|(35[0-9]{2}\s[0-9]{4}\s[0-9]{4}\s[0-9]{4})$/,
477
+ identification: /^(?:2131|1800|35\d{3})/,
478
+ length: [16, 19, 19],
479
+ icon: "generic",
480
+ },
481
+ unionpay: {
482
+ verification: /^(62|88)[0-9]{2}\s[0-9]{4}\s[0-9]{4}\s[0-9]{4}$/,
483
+ identification: /^(62|88)/,
484
+ length: [16, 19, 19],
485
+ icon: "generic",
486
+ },
487
+ maestro: {
488
+ verification: /^(5018|5020|5038|5612|5893|6304|6759|6761|6762|6763|0604|6390)\s[0-9]{4}\s[0-9]{4}\s[0-9]{4}$/,
489
+ identification: /^(5018|5020|5038|5612|5893|6304|6759|6761|6762|6763|0604|6390)/,
490
+ length: [16, 19, 19],
491
+ icon: "maestro",
492
+ },
493
+ mastercard: {
494
+ verification: /^5[1-5][0-9]{2}\s[0-9]{4}\s[0-9]{4}\s[0-9]{4}$/,
495
+ identification: /^5[1-5][0-9]/,
496
+ length: [16, 19, 19],
497
+ icon: "mastercard",
498
+ },
499
+ visa: {
500
+ verification: /^4[0-9]{3}\s[0-9]{4}\s[0-9]{4}\s[0-9](?:[0-9]{3})?$/,
501
+ identification: /^4[0-9]/,
502
+ length: [16, 16, 19],
503
+ icon: "visa",
504
+ },
505
+ };
506
+ //# sourceMappingURL=card-number.js.map
507
+ });
508
+
509
+ const cardNumber$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(cardNumber);
510
+
511
+ var DateFormat_1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
512
+ "use strict";
513
+ Object.defineProperty(exports, "__esModule", { value: true });
514
+ exports.DateFormat = void 0;
515
+ var DateFormat;
516
+ (function (DateFormat) {
517
+ function fromLocale(locale) {
518
+ let result;
519
+ switch (locale) {
520
+ case "en-GB":
521
+ result = "dd/mm/YYYY";
522
+ break;
523
+ case "en-US":
524
+ result = "mm/dd/YYYY";
525
+ break;
526
+ case "de-DE":
527
+ case "pl-PL":
528
+ case "ru-RU":
529
+ result = "dd.mm.YYYY";
530
+ break;
531
+ default:
532
+ result = "YYYY-mm-dd";
533
+ break;
534
+ }
535
+ return result;
536
+ }
537
+ DateFormat.fromLocale = fromLocale;
538
+ function toLocale(format) {
539
+ let result;
540
+ switch (format) {
541
+ case "dd/mm/YYYY":
542
+ result = "en-GB";
543
+ break;
544
+ case "mm/dd/YYYY":
545
+ result = "en-US";
546
+ break;
547
+ case "dd.mm.YYYY":
548
+ result = "de-DE";
549
+ break;
550
+ default:
551
+ result = "sv-SE";
552
+ break;
553
+ }
554
+ return result;
555
+ }
556
+ DateFormat.toLocale = toLocale;
557
+ function is(value) {
558
+ return (typeof value == "string" &&
559
+ (value == "YYYY-mm-dd" || value == "dd/mm/YYYY" || value == "dd.mm.YYYY" || value == "mm/dd/YYYY"));
560
+ }
561
+ DateFormat.is = is;
562
+ })(DateFormat = exports.DateFormat || (exports.DateFormat = {}));
563
+ //# sourceMappingURL=DateFormat.js.map
564
+ });
565
+
566
+ const DateFormat = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(DateFormat_1);
567
+
568
+ var helper = _commonjsHelpers.createCommonjsModule(function (module, exports) {
569
+ "use strict";
570
+ Object.defineProperty(exports, "__esModule", { value: true });
571
+ exports.validFormat = exports.validSymbol = exports.validYear = exports.validMonth = exports.validDay = void 0;
572
+ function validDay(symbol, state, startIndex, endIndex) {
573
+ let result = false;
574
+ if (state.value.length == startIndex)
575
+ result = symbol <= "3" && symbol >= "0";
576
+ else if (state.value.length == endIndex) {
577
+ if (state.value.substring(startIndex, startIndex + 1) == "2" ||
578
+ state.value.substring(startIndex, startIndex + 1) == "1")
579
+ result = symbol <= "9" && symbol >= "0";
580
+ else if (state.value.substring(startIndex, startIndex + 1) == "0")
581
+ result = symbol <= "9" && symbol >= "1";
582
+ else
583
+ result = symbol == "1" || symbol == "0";
584
+ }
585
+ return result;
586
+ }
587
+ exports.validDay = validDay;
588
+ function validMonth(symbol, state, startIndex, endIndex) {
589
+ let result = false;
590
+ if (state.value.length == startIndex)
591
+ result = symbol == "1" || symbol == "0";
592
+ else if (state.value.length == endIndex) {
593
+ if (state.value.substring(startIndex, startIndex + 1) != "1")
594
+ result = symbol <= "9" && symbol >= "1";
595
+ else
596
+ result = symbol < "3" && symbol >= "0";
597
+ }
598
+ return result;
599
+ }
600
+ exports.validMonth = validMonth;
601
+ function validYear(symbol, state, startIndex, endIndex) {
602
+ return state.value.length < endIndex && state.value.length >= startIndex && symbol >= "0" && symbol <= "9";
603
+ }
604
+ exports.validYear = validYear;
605
+ function validSymbol(symbol, state, firstSplitter, lastSplitter, character) {
606
+ return (state.value.length == firstSplitter || state.value.length == lastSplitter) && symbol == character;
607
+ }
608
+ exports.validSymbol = validSymbol;
609
+ function validFormat(symbol, state, format) {
610
+ let result;
611
+ switch (format) {
612
+ case "dd/mm/YYYY":
613
+ result =
614
+ validDay(symbol, state, 0, 1) ||
615
+ validSymbol(symbol, state, 2, 5, "/") ||
616
+ validMonth(symbol, state, 3, 4) ||
617
+ validYear(symbol, state, 6, 10);
618
+ break;
619
+ case "dd.mm.YYYY":
620
+ result =
621
+ validDay(symbol, state, 0, 1) ||
622
+ validSymbol(symbol, state, 2, 5, ".") ||
623
+ validMonth(symbol, state, 3, 4) ||
624
+ validYear(symbol, state, 6, 10);
625
+ break;
626
+ case "mm/dd/YYYY":
627
+ result =
628
+ validDay(symbol, state, 3, 4) ||
629
+ validSymbol(symbol, state, 2, 5, "/") ||
630
+ validMonth(symbol, state, 0, 1) ||
631
+ validYear(symbol, state, 6, 10);
632
+ break;
633
+ default:
634
+ result =
635
+ validDay(symbol, state, 8, 9) ||
636
+ validSymbol(symbol, state, 4, 7, "-") ||
637
+ validMonth(symbol, state, 5, 6) ||
638
+ validYear(symbol, state, 0, 4);
639
+ break;
640
+ }
641
+ return result;
642
+ }
643
+ exports.validFormat = validFormat;
644
+ //# sourceMappingURL=helper.js.map
645
+ });
646
+
647
+ const helper$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(helper);
648
+
649
+ var date = _commonjsHelpers.createCommonjsModule(function (module, exports) {
650
+ "use strict";
651
+ Object.defineProperty(exports, "__esModule", { value: true });
652
+ exports.formatDate = void 0;
653
+
654
+
655
+
656
+
657
+ class Handler {
658
+ constructor(formatting) {
659
+ this.formatting = DateFormat_1.DateFormat.is(formatting) ? formatting : DateFormat_1.DateFormat.fromLocale(formatting);
660
+ this.locale = index$3.dist.Locale.is(formatting)
661
+ ? formatting
662
+ : DateFormat_1.DateFormat.is(formatting)
663
+ ? DateFormat_1.DateFormat.toLocale(formatting)
664
+ : undefined;
665
+ }
666
+ toString(data) {
667
+ return typeof data != "string" ? "" : index$3.dist.Date.is(data) ? index$3.dist.Date.localize(data, this.locale) : data;
668
+ }
669
+ fromString(value) {
670
+ let result;
671
+ switch (this.formatting) {
672
+ case "dd/mm/YYYY":
673
+ case "dd.mm.YYYY":
674
+ result = `${value.substring(6, 10)}-${value.substring(3, 5)}-${value.substring(0, 2)}`;
675
+ break;
676
+ case "mm/dd/YYYY":
677
+ result = `${value.substring(6, 10)}-${value.substring(0, 2)}-${value.substring(3, 5)}`;
678
+ break;
679
+ default:
680
+ result = value;
681
+ break;
682
+ }
683
+ return index$3.dist.Date.is(result) ? result : undefined;
684
+ }
685
+ format(unformated) {
686
+ let result;
687
+ switch (this.formatting) {
688
+ case "dd/mm/YYYY":
689
+ result = Object.assign(Object.assign({}, formatDate(unformated, "dd/mm/YYYY")), { type: "text", length: [0, 10], pattern: /^([0-2][0-9]|(3)[0-1])(\/)(((0)[0-9])|((1)[0-2]))(\/)\d{4}$/ });
690
+ break;
691
+ case "dd.mm.YYYY":
692
+ result = Object.assign(Object.assign({}, formatDate(unformated, "dd.mm.YYYY")), { type: "text", length: [0, 10], pattern: /^([0-2][0-9]|(3)[0-1])(\.)(((0)[0-9])|((1)[0-2]))(\.)\d{4}$/ });
693
+ break;
694
+ case "mm/dd/YYYY":
695
+ result = Object.assign(Object.assign({}, formatDate(unformated, "mm/dd/YYYY")), { type: "text", length: [0, 10], pattern: /^(((0)[0-9])|((1)[0-2]))(\/)([0-2][0-9]|(3)[0-1])(\/)\d{4}$/ });
696
+ break;
697
+ default:
698
+ result = Object.assign(Object.assign({}, formatDate(unformated)), { type: "text", length: [0, 10], pattern: /^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/ });
699
+ break;
700
+ }
701
+ return result;
702
+ }
703
+ unformat(formated) {
704
+ return formated;
705
+ }
706
+ allowed(symbol, state) {
707
+ var _a;
708
+ return helper.validFormat(symbol, state, (_a = this.formatting) !== null && _a !== void 0 ? _a : "YYYY-mm-dd");
709
+ }
710
+ }
711
+ base.add("date", (argument) => new Handler(argument && argument.length > 0 ? argument[0] : undefined));
712
+ function formatDate(unformated, format) {
713
+ let result = unformated;
714
+ switch (format) {
715
+ case "dd/mm/YYYY":
716
+ case "dd.mm.YYYY":
717
+ if (!validDate(result.value, format))
718
+ result = result.replace(0, 10, validDate("31" + result.value.substring(2, 10), format)
719
+ ? "31" + result.value.substring(2, 10)
720
+ : validDate("30" + result.value.substring(2, 10), format)
721
+ ? "30" + result.value.substring(2, 10)
722
+ : validDate("29" + result.value.substring(2, 10), format)
723
+ ? "29" + result.value.substring(2, 10)
724
+ : validDate("28" + result.value.substring(2, 10), format)
725
+ ? "28" + result.value.substring(2, 10)
726
+ : result.value);
727
+ break;
728
+ case "mm/dd/YYYY":
729
+ if (!validDate(result.value, format))
730
+ result = result.replace(0, 10, validDate(result.value.substring(0, 3) + "31" + result.value.substring(5, 10), format)
731
+ ? result.value.substring(0, 3) + "31" + result.value.substring(5, 10)
732
+ : validDate(result.value.substring(0, 3) + "30" + result.value.substring(5, 10), format)
733
+ ? result.value.substring(0, 3) + "30" + result.value.substring(5, 10)
734
+ : validDate(result.value.substring(0, 3) + "29" + result.value.substring(5, 10), format)
735
+ ? result.value.substring(0, 3) + "29" + result.value.substring(5, 10)
736
+ : validDate(result.value.substring(0, 3) + "28" + result.value.substring(5, 10), format)
737
+ ? result.value.substring(0, 3) + "28" + result.value.substring(5, 10)
738
+ : result.value);
739
+ break;
740
+ default:
741
+ if (unformated.value.length == 10) {
742
+ if (!validDate(result.value))
743
+ result = result.replace(0, 10, validDate(result.value.substring(0, 8) + "31")
744
+ ? result.value.substring(0, 8) + "31"
745
+ : validDate(result.value.substring(0, 8) + "30")
746
+ ? result.value.substring(0, 8) + "30"
747
+ : validDate(result.value.substring(0, 8) + "29")
748
+ ? result.value.substring(0, 8) + "29"
749
+ : validDate(result.value.substring(0, 8) + "28")
750
+ ? result.value.substring(0, 8) + "28"
751
+ : result.value);
752
+ break;
753
+ }
754
+ }
755
+ return result;
756
+ }
757
+ exports.formatDate = formatDate;
758
+ function validDate(date, format) {
759
+ let year;
760
+ let month;
761
+ let day;
762
+ let result;
763
+ switch (format) {
764
+ case "dd/mm/YYYY":
765
+ case "dd.mm.YYYY":
766
+ year = parseInt(date.substring(6, 10));
767
+ month = parseInt(date.substring(3, 5));
768
+ day = parseInt(date.substring(0, 2));
769
+ result = year && month && day ? day > 0 && daysPerMonth(year, month) >= day : false;
770
+ break;
771
+ case "mm/dd/YYYY":
772
+ year = parseInt(date.substring(6, 10));
773
+ month = parseInt(date.substring(0, 2));
774
+ day = parseInt(date.substring(3, 5));
775
+ result = year && month && day ? day > 0 && daysPerMonth(year, month) >= day : false;
776
+ break;
777
+ default:
778
+ year = parseInt(date.substring(0, 4));
779
+ month = parseInt(date.substring(5, 7));
780
+ day = parseInt(date.substring(8, 10));
781
+ result = year && month && day ? day > 0 && daysPerMonth(year, month) >= day : false;
782
+ break;
783
+ }
784
+ return result;
785
+ }
786
+ function daysPerMonth(year, month) {
787
+ let result;
788
+ switch (month) {
789
+ case 1:
790
+ case 3:
791
+ case 5:
792
+ case 7:
793
+ case 8:
794
+ case 10:
795
+ case 12:
796
+ default:
797
+ result = 31;
798
+ break;
799
+ case 4:
800
+ case 6:
801
+ case 9:
802
+ case 11:
803
+ result = 30;
804
+ break;
805
+ case 2:
806
+ result = 28;
807
+ break;
808
+ }
809
+ return result;
810
+ }
811
+ //# sourceMappingURL=index.js.map
812
+ });
813
+
814
+ const index$2 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(date);
815
+
816
+ var dateTime = _commonjsHelpers.createCommonjsModule(function (module, exports) {
817
+ "use strict";
818
+ Object.defineProperty(exports, "__esModule", { value: true });
819
+
820
+
821
+
822
+ class Handler {
823
+ toString(data) {
824
+ return typeof data == "string" ? data : "";
825
+ }
826
+ fromString(value) {
827
+ let result = value.replace(" ", "T");
828
+ const fillerDate = "0000-01-01T00:00:00.000Z";
829
+ if (result === null || result === void 0 ? void 0 : result.match(/-\d$/))
830
+ result = result.substring(0, result.length - 1) + "0" + result.substring(result.length - 1, result.length);
831
+ result = !result.match(/^\d{4}-(0[1-9]|1[012])/)
832
+ ? undefined
833
+ : result + fillerDate.substring(result.length, fillerDate.length);
834
+ return index$3.dist.DateTime.is(result) ? result : undefined;
835
+ }
836
+ format(unformated) {
837
+ let result = date.formatDate(unformated);
838
+ if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[\d:.-]$/))
839
+ result = result.insert(10, " ");
840
+ if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) 3$/))
841
+ result = result.replace(11, 12, "23:");
842
+ if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) [45]$/))
843
+ result = result.insert(11, "23:");
844
+ if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) [6-9]$/))
845
+ result = result.insert(11, "23:5");
846
+ if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) 24$/))
847
+ result = result.replace(10, 13, "00:");
848
+ if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) 25$/))
849
+ result = result.insert(12, "3:");
850
+ if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) 2[6-9]$/))
851
+ result = result.insert(12, "3:5").append(":");
852
+ if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3])\d[\s\S]$/))
853
+ result = result.insert(13, ":");
854
+ if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3]):[6-9]$/))
855
+ result = result.insert(14, "5");
856
+ if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3]):[0-5]\d\d$/))
857
+ result = result.insert(16, ":");
858
+ if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3]):[0-5]\d:[6-9]$/))
859
+ result = result.insert(17, "5");
860
+ return Object.assign(Object.assign({}, result), { type: "text", length: [0, 19], pattern: /^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3])(:[0-5]\d){2}$/ });
861
+ }
862
+ unformat(formated) {
863
+ return formated;
864
+ }
865
+ allowed(symbol, state) {
866
+ return (state.value.length < 19 &&
867
+ ((symbol >= "0" && symbol <= "9") || symbol == "-" || symbol == ":" || symbol == "." || symbol == " "));
868
+ }
869
+ }
870
+ base.add("date-time", () => new Handler());
871
+ //# sourceMappingURL=date-time.js.map
872
+ });
873
+
874
+ const dateTime$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(dateTime);
875
+
876
+ var divisor = _commonjsHelpers.createCommonjsModule(function (module, exports) {
877
+ "use strict";
878
+ Object.defineProperty(exports, "__esModule", { value: true });
879
+
880
+ class Handler {
881
+ toString(data) {
882
+ return Array.isArray(data) && data.length == 2 && typeof data[0] == "number" && typeof data[1] == "number"
883
+ ? data[0].toString() + " / " + data[1].toString()
884
+ : typeof data == "number"
885
+ ? data.toString()
886
+ : "";
887
+ }
888
+ fromString(value) {
889
+ return typeof value == "string" && value.match(/^\d{1,2}\s+\/\s+\d{1,2}$/)
890
+ ? [Number.parseInt(value.slice(0, 2)), Number.parseInt(value.slice(value.length - 2))]
891
+ : typeof value == "string" && value.match(/\d{1,2}/)
892
+ ? Number.parseInt(value)
893
+ : undefined;
894
+ }
895
+ format(unformated) {
896
+ let result = unformated;
897
+ if (unformated.match(/^\d\/$/))
898
+ result = unformated.replace(1, 2, " / ");
899
+ else if (unformated.match(/^\d{1,2}\s$/))
900
+ result = unformated.replace(unformated.value.length - 1, unformated.value.length, " / ");
901
+ else if (unformated.match(/^[\D.]+\/[\D.]+$/))
902
+ result = unformated.delete(0, unformated.value.length);
903
+ else if (unformated.match(/^[\D.]+\/[\D.]+\d$/))
904
+ result = unformated.delete(0, unformated.value.length - 1);
905
+ else if (unformated.match(/^[\D.]+\/[\D.]+\d\d$/))
906
+ result = unformated.delete(0, unformated.value.length - 2);
907
+ else if (unformated.match(/^[\D.]+\//))
908
+ result = unformated.delete(0, unformated.value.search("/") + 1);
909
+ else if (unformated.match(/^\d\d\/$/))
910
+ result = unformated.replace(2, 3, " / ");
911
+ else if (unformated.match(/^\d\d\s+\/$/))
912
+ result = unformated.delete(2, unformated.value.length);
913
+ else if (unformated.match(/^\d\s+\/$/))
914
+ result = unformated.delete(1, unformated.value.length);
915
+ else if (unformated.match(/^\d\d\s\s+\/\s*$/))
916
+ result = unformated.replace(2, unformated.value.length, " / ");
917
+ else if (unformated.match(/^\d\s\s+(\/\s*)?$/))
918
+ result = unformated.replace(1, unformated.value.length, " / ");
919
+ else if (unformated.match(/^\d\s\/\s\d\d.+$/))
920
+ result = unformated.delete(6, unformated.value.length);
921
+ else if (unformated.value.length > 1 && unformated.value.indexOf("/") < 1)
922
+ result = unformated.insert(2, " / ");
923
+ else if (unformated.value.length > 1 && unformated.value.split("/").length > 2)
924
+ result = unformated.delete(unformated.value.lastIndexOf("/"));
925
+ else if (unformated.value.length == 1 && !unformated.isDigit(0))
926
+ result = unformated.delete(0);
927
+ return Object.assign(Object.assign({}, result), { type: "text", length: [1, 7], pattern: /^(\d{1,2}|\d{1,2} \/ \d{1,2})$/ });
928
+ }
929
+ unformat(formated) {
930
+ return formated;
931
+ }
932
+ allowed(symbol, state) {
933
+ return state.value.length < 7 && ((symbol >= "0" && symbol <= "9") || symbol == "/" || symbol == " ");
934
+ }
935
+ }
936
+ base.add("divisor", () => new Handler());
937
+ //# sourceMappingURL=divisor.js.map
938
+ });
939
+
940
+ const divisor$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(divisor);
941
+
942
+ var identityNumber = _commonjsHelpers.createCommonjsModule(function (module, exports) {
943
+ "use strict";
944
+ Object.defineProperty(exports, "__esModule", { value: true });
945
+
946
+ class Handler {
947
+ constructor(country) {
948
+ this.country = country;
949
+ }
950
+ toString(data) {
951
+ return typeof data == "string" ? data : "";
952
+ }
953
+ fromString(value) {
954
+ return typeof value == "string" ? value : undefined;
955
+ }
956
+ format(unformated) {
957
+ let result = unformated;
958
+ const year = new Date().getFullYear().toString();
959
+ if (unformated.value.length > 1 && unformated.get(0, 2) != "19" && unformated.get(0, 2) != "20")
960
+ result = result.prepend(unformated.get(0, 2) > year.substr(2, 2) ? "19" : "20");
961
+ if (result.value.length >= 8)
962
+ result = result.insert(8, "-");
963
+ return Object.assign(Object.assign({}, result.truncate(13)), { type: "text", length: [11, 13], pattern: /^\d{6,8}-\d{4}$/ });
964
+ }
965
+ unformat(formated) {
966
+ return formated.delete("-");
967
+ }
968
+ allowed(symbol, state) {
969
+ return state.value.length < 13 && symbol >= "0" && symbol <= "9";
970
+ }
971
+ }
972
+ base.add("identity-number", (argument) => new Handler(argument && argument.length > 0 ? argument[0] : undefined));
973
+ //# sourceMappingURL=identity-number.js.map
974
+ });
975
+
976
+ const identityNumber$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(identityNumber);
977
+
978
+ var password = _commonjsHelpers.createCommonjsModule(function (module, exports) {
979
+ "use strict";
980
+ Object.defineProperty(exports, "__esModule", { value: true });
981
+
982
+ class Handler {
983
+ toString(data) {
984
+ return typeof data == "string" ? data : "";
985
+ }
986
+ fromString(value) {
987
+ return typeof value == "string" ? value : undefined;
988
+ }
989
+ format(unformated) {
990
+ return Object.assign(Object.assign({}, unformated), { type: "password", autocomplete: "current-password" });
991
+ }
992
+ unformat(formated) {
993
+ return formated;
994
+ }
995
+ allowed(symbol, state) {
996
+ return true;
997
+ }
998
+ }
999
+ base.add("password", () => new Handler());
1000
+ //# sourceMappingURL=password.js.map
1001
+ });
1002
+
1003
+ const password$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(password);
1004
+
1005
+ var percent = _commonjsHelpers.createCommonjsModule(function (module, exports) {
1006
+ "use strict";
1007
+ Object.defineProperty(exports, "__esModule", { value: true });
1008
+
1009
+ class Handler {
1010
+ toString(data) {
1011
+ return data && typeof data == "number" ? (data * 100).toString() : "";
1012
+ }
1013
+ fromString(value) {
1014
+ return typeof value != "string" || !Number.parseFloat(value) ? undefined : Number.parseFloat(value) / 100;
1015
+ }
1016
+ format(unformated) {
1017
+ return Object.assign(Object.assign({}, (unformated.value ? unformated.suffix(" %") : unformated)), { type: "text", length: [3, undefined], pattern: /^\d+(.\d)? %+$/ });
1018
+ }
1019
+ unformat(formated) {
1020
+ return formated.delete(" %");
1021
+ }
1022
+ allowed(symbol, state) {
1023
+ return (symbol >= "0" && symbol <= "9") || (symbol == "." && !state.value.includes("."));
1024
+ }
1025
+ }
1026
+ base.add("percent", () => new Handler());
1027
+ //# sourceMappingURL=percent.js.map
1028
+ });
1029
+
1030
+ const percent$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(percent);
1031
+
1032
+ var phonePrefix = _commonjsHelpers.createCommonjsModule(function (module, exports) {
1033
+ "use strict";
1034
+ Object.defineProperty(exports, "__esModule", { value: true });
1035
+ exports.phonePrefix = void 0;
1036
+ exports.phonePrefix = [
1037
+ {
1038
+ countryCode: "+46",
1039
+ areaCodes: [
1040
+ "011",
1041
+ "0120",
1042
+ "0121",
1043
+ "0122",
1044
+ "0123",
1045
+ "0125",
1046
+ "013",
1047
+ "0140",
1048
+ "0141",
1049
+ "0142",
1050
+ "0143",
1051
+ "0144",
1052
+ "0150",
1053
+ "0151",
1054
+ "0152",
1055
+ "0155",
1056
+ "0156",
1057
+ "0157",
1058
+ "0158",
1059
+ "0159",
1060
+ "016",
1061
+ "0171",
1062
+ "0173",
1063
+ "0174",
1064
+ "0175",
1065
+ "0176",
1066
+ "018",
1067
+ "019",
1068
+ "021",
1069
+ "0220",
1070
+ "0221",
1071
+ "0222",
1072
+ "0223",
1073
+ "0224",
1074
+ "0225",
1075
+ "0226",
1076
+ "0227",
1077
+ "023",
1078
+ "0240",
1079
+ "0241",
1080
+ "0243",
1081
+ "0246",
1082
+ "0247",
1083
+ "0248",
1084
+ "0250",
1085
+ "0251",
1086
+ "0253",
1087
+ "0258",
1088
+ "026",
1089
+ "0270",
1090
+ "0271",
1091
+ "0278",
1092
+ "0280",
1093
+ "0281",
1094
+ "0290",
1095
+ "0291",
1096
+ "0292",
1097
+ "0293",
1098
+ "0294",
1099
+ "0295",
1100
+ "0297",
1101
+ "0300",
1102
+ "0301",
1103
+ "0302",
1104
+ "0303",
1105
+ "0304",
1106
+ "031",
1107
+ "0320",
1108
+ "0321",
1109
+ "0322",
1110
+ "0325",
1111
+ "033",
1112
+ "0340",
1113
+ "0345",
1114
+ "0346",
1115
+ "035",
1116
+ "036",
1117
+ "0370",
1118
+ "0371",
1119
+ "0372",
1120
+ "0380",
1121
+ "0381",
1122
+ "0382",
1123
+ "0383",
1124
+ "0390",
1125
+ "0392",
1126
+ "0393",
1127
+ "040",
1128
+ "0410",
1129
+ "0411",
1130
+ "0413",
1131
+ "0414",
1132
+ "0415",
1133
+ "0416",
1134
+ "0417",
1135
+ "0418",
1136
+ "042",
1137
+ "0430",
1138
+ "0431",
1139
+ "0433",
1140
+ "0435",
1141
+ "044",
1142
+ "0451",
1143
+ "0454",
1144
+ "0455",
1145
+ "0456",
1146
+ "0457",
1147
+ "0459",
1148
+ "046",
1149
+ "0470",
1150
+ "0471",
1151
+ "0472",
1152
+ "0474",
1153
+ "0476",
1154
+ "0477",
1155
+ "0478",
1156
+ "0479",
1157
+ "0480",
1158
+ "0481",
1159
+ "0485",
1160
+ "0486",
1161
+ "0490",
1162
+ "0491",
1163
+ "0492",
1164
+ "0493",
1165
+ "0494",
1166
+ "0495",
1167
+ "0496",
1168
+ "0498",
1169
+ "0499",
1170
+ "0500",
1171
+ "0501",
1172
+ "0502",
1173
+ "0503",
1174
+ "0504",
1175
+ "0505",
1176
+ "0506",
1177
+ "0510",
1178
+ "0511",
1179
+ "0512",
1180
+ "0513",
1181
+ "0514",
1182
+ "0515",
1183
+ "0520",
1184
+ "0521",
1185
+ "0522",
1186
+ "0523",
1187
+ "0524",
1188
+ "0525",
1189
+ "0526",
1190
+ "0528",
1191
+ "0530",
1192
+ "0531",
1193
+ "0532",
1194
+ "0533",
1195
+ "0534",
1196
+ "054",
1197
+ "0550",
1198
+ "0551",
1199
+ "0552",
1200
+ "0553",
1201
+ "0554",
1202
+ "0555",
1203
+ "0560",
1204
+ "0563",
1205
+ "0564",
1206
+ "0565",
1207
+ "0570",
1208
+ "0571",
1209
+ "0573",
1210
+ "0580",
1211
+ "0581",
1212
+ "0582",
1213
+ "0583",
1214
+ "0584",
1215
+ "0585",
1216
+ "0586",
1217
+ "0587",
1218
+ "0589",
1219
+ "0590",
1220
+ "0591",
1221
+ "060",
1222
+ "0611",
1223
+ "0612",
1224
+ "0613",
1225
+ "0620",
1226
+ "0621",
1227
+ "0622",
1228
+ "0623",
1229
+ "0624",
1230
+ "063",
1231
+ "0640",
1232
+ "0642",
1233
+ "0643",
1234
+ "0644",
1235
+ "0645",
1236
+ "0647",
1237
+ "0650",
1238
+ "0651",
1239
+ "0652",
1240
+ "0653",
1241
+ "0657",
1242
+ "0660",
1243
+ "0661",
1244
+ "0662",
1245
+ "0663",
1246
+ "0670",
1247
+ "0671",
1248
+ "0672",
1249
+ "0680",
1250
+ "0682",
1251
+ "0684",
1252
+ "0687",
1253
+ "0690",
1254
+ "0691",
1255
+ "0692",
1256
+ "0693",
1257
+ "0695",
1258
+ "0696",
1259
+ "08",
1260
+ "090",
1261
+ "0910",
1262
+ "0911",
1263
+ "0912",
1264
+ "0913",
1265
+ "0914",
1266
+ "0915",
1267
+ "0916",
1268
+ "0918",
1269
+ "0920",
1270
+ "0921",
1271
+ "0922",
1272
+ "0923",
1273
+ "0924",
1274
+ "0925",
1275
+ "0926",
1276
+ "0927",
1277
+ "0928",
1278
+ "0929",
1279
+ "0930",
1280
+ "0932",
1281
+ "0933",
1282
+ "0934",
1283
+ "0935",
1284
+ "0940",
1285
+ "0941",
1286
+ "0942",
1287
+ "0943",
1288
+ "0950",
1289
+ "0951",
1290
+ "0952",
1291
+ "0953",
1292
+ "0954",
1293
+ "0960",
1294
+ "0961",
1295
+ "0970",
1296
+ "0971",
1297
+ "0973",
1298
+ "0975",
1299
+ "0976",
1300
+ "0977",
1301
+ "0978",
1302
+ "0980",
1303
+ "0981",
1304
+ "010",
1305
+ "020",
1306
+ "0378",
1307
+ "070",
1308
+ "072",
1309
+ "073",
1310
+ "076",
1311
+ "079",
1312
+ "0710",
1313
+ "0740",
1314
+ "0746",
1315
+ "0749",
1316
+ "0741",
1317
+ "0742",
1318
+ "0743",
1319
+ "0744",
1320
+ "0745",
1321
+ "0747",
1322
+ "075",
1323
+ "077",
1324
+ "078",
1325
+ "0900",
1326
+ "0939",
1327
+ "0944",
1328
+ "0969",
1329
+ "099",
1330
+ ],
1331
+ },
1332
+ ];
1333
+ //# sourceMappingURL=phonePrefix.js.map
1334
+ });
1335
+
1336
+ const phonePrefix$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(phonePrefix);
1337
+
1338
+ var phone = _commonjsHelpers.createCommonjsModule(function (module, exports) {
1339
+ "use strict";
1340
+ Object.defineProperty(exports, "__esModule", { value: true });
1341
+
1342
+
1343
+ class Handler {
1344
+ toString(data) {
1345
+ return typeof data == "string" ? data : "";
1346
+ }
1347
+ fromString(value) {
1348
+ return typeof value == "string" ? value : undefined;
1349
+ }
1350
+ format(unformated) {
1351
+ let result = unformated;
1352
+ if (result.value.startsWith("+")) {
1353
+ for (const country of phonePrefix.phonePrefix)
1354
+ if (result.value.startsWith(country.countryCode))
1355
+ for (let prefix of country.areaCodes) {
1356
+ prefix = prefix.substring(1);
1357
+ if (result.value.startsWith(country.countryCode + prefix) && !result.value.includes("-"))
1358
+ result = result
1359
+ .insert(country.countryCode.length, "-")
1360
+ .insert(country.countryCode.length + 1 + prefix.length, "-");
1361
+ }
1362
+ }
1363
+ else {
1364
+ const first = phonePrefix.phonePrefix[0];
1365
+ for (const prefix of first.areaCodes)
1366
+ if (result.value.startsWith(prefix) && !result.value.includes("-")) {
1367
+ result = result.insert(prefix.length, "-");
1368
+ result = result.delete(0);
1369
+ result = result.insert(0, "-").insert(0, first.countryCode);
1370
+ }
1371
+ }
1372
+ if (result.value.includes("-")) {
1373
+ const digitIndex = result.value.indexOf("-", result.value.indexOf("-") + 1) + 1;
1374
+ const digitCount = result.value.substring(digitIndex, result.value.length + 1).length;
1375
+ switch (digitCount) {
1376
+ case 4:
1377
+ result = result.insert(digitIndex + 2, " ");
1378
+ break;
1379
+ case 5:
1380
+ result = result.insert(digitIndex + 3, " ");
1381
+ break;
1382
+ case 6:
1383
+ result = result.insert(digitIndex + 2, " ");
1384
+ result = result.insert(digitIndex + 5, " ");
1385
+ break;
1386
+ case 7:
1387
+ result = result.insert(digitIndex + 3, " ");
1388
+ result = result.insert(digitIndex + 6, " ");
1389
+ break;
1390
+ case 8:
1391
+ case 9:
1392
+ result = result.insert(digitIndex + 3, " ");
1393
+ result = result.insert(digitIndex + 7, " ");
1394
+ break;
1395
+ default:
1396
+ break;
1397
+ }
1398
+ if (digitCount > 9) {
1399
+ const spaces = Math.ceil(digitCount / 3) - 1;
1400
+ if (spaces > 0) {
1401
+ for (let i = 0; i < spaces; i++) {
1402
+ const position = i * 3 + 3 + i;
1403
+ result = result.insert(position + digitIndex, " ");
1404
+ }
1405
+ }
1406
+ }
1407
+ }
1408
+ return Object.assign(Object.assign({}, result), { type: "text", autocomplete: "tel" });
1409
+ }
1410
+ unformat(formated) {
1411
+ return formated.delete(" ").delete("-");
1412
+ }
1413
+ allowed(symbol, state) {
1414
+ return ((symbol >= "0" && symbol <= "9") || (state.selection.start == 0 && symbol == "+" && !state.value.includes("+")));
1415
+ }
1416
+ }
1417
+ base.add("phone", () => new Handler());
1418
+ //# sourceMappingURL=phone.js.map
1419
+ });
1420
+
1421
+ const phone$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(phone);
1422
+
1423
+ var postalCode = _commonjsHelpers.createCommonjsModule(function (module, exports) {
1424
+ "use strict";
1425
+ Object.defineProperty(exports, "__esModule", { value: true });
1426
+
1427
+ class Handler {
1428
+ constructor(country) {
1429
+ this.country = country;
1430
+ }
1431
+ toString(data) {
1432
+ return typeof data == "string" ? data : "";
1433
+ }
1434
+ fromString(value) {
1435
+ return typeof value == "string" ? value : undefined;
1436
+ }
1437
+ format(unformated) {
1438
+ const result = !unformated.value.includes(" ") && unformated.value.length >= 4 ? unformated.insert(3, " ") : unformated;
1439
+ return Object.assign(Object.assign({}, result.truncate(6)), { type: "text", autocomplete: "postal-code", length: [6, 6], pattern: /^\d{3} \d{2}$/ });
1440
+ }
1441
+ unformat(formated) {
1442
+ return formated.delete(" ");
1443
+ }
1444
+ allowed(symbol, state) {
1445
+ return state.value.length <= 5 && symbol >= "0" && symbol <= "9";
1446
+ }
1447
+ }
1448
+ base.add("postal-code", (argument) => new Handler(argument && argument.length > 0 ? argument[0] : undefined));
1449
+ //# sourceMappingURL=postal-code.js.map
1450
+ });
1451
+
1452
+ const postalCode$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(postalCode);
1453
+
1454
+ var price = _commonjsHelpers.createCommonjsModule(function (module, exports) {
1455
+ "use strict";
1456
+ Object.defineProperty(exports, "__esModule", { value: true });
1457
+
1458
+
1459
+
1460
+ class Handler {
1461
+ constructor(currency) {
1462
+ this.currency = currency;
1463
+ }
1464
+ toString(data) {
1465
+ return typeof data == "number" ? (isNaN(data) ? "" : data.toString()) : "";
1466
+ }
1467
+ fromString(value) {
1468
+ const result = typeof value == "string" ? Number.parseFloat(value) : undefined;
1469
+ return result && !isNaN(result) ? result : undefined;
1470
+ }
1471
+ format(unformated) {
1472
+ var _a;
1473
+ let separator = unformated.value && unformated.value.includes(".") ? unformated.value.indexOf(".") : undefined;
1474
+ let result = unformated.value == "NaN" ? unformated.replace(0, unformated.value.length, "") : StateEditor_1.StateEditor.copy(unformated);
1475
+ if (separator == 0) {
1476
+ result = result.prepend("0");
1477
+ separator++;
1478
+ }
1479
+ if (separator != undefined) {
1480
+ const adjust = separator +
1481
+ 1 +
1482
+ (!this.currency || index$3.dist.Currency.decimalDigits(this.currency) == undefined
1483
+ ? 2
1484
+ : (_a = index$3.dist.Currency.decimalDigits(this.currency)) !== null && _a !== void 0 ? _a : 2) -
1485
+ result.value.length;
1486
+ result = adjust < 0 ? result.truncate(result.value.length + adjust) : result.suffix("0".repeat(adjust));
1487
+ }
1488
+ else
1489
+ separator = result.value.length;
1490
+ const spaces = separator <= 0 ? 0 : Math.ceil(separator / 3) - 1;
1491
+ for (let i = 0; i < spaces; i++) {
1492
+ const position = separator - (spaces - i) * 3;
1493
+ result = result.insert(position, " ");
1494
+ separator++;
1495
+ }
1496
+ if (result.match(/^[0\s]{2,}$/))
1497
+ result = result.replace(0, result.value.length, "0");
1498
+ else if (result.match(/^[0\s]{2,}(\s\w{3}){1}$/))
1499
+ result = result.replace(0, result.value.length - 4, "0");
1500
+ result =
1501
+ this.currency && (result.value.length > 1 || (result.value.length == 1 && result.value.charAt(0) != "."))
1502
+ ? result.suffix(" " + this.currency)
1503
+ : result;
1504
+ return Object.assign(Object.assign({}, result), { type: "text", length: [3, undefined], pattern: new RegExp("^(\\d{0,3})( \\d{3})*(\\.\\d+)?" + (this.currency ? " " + this.currency : "") + "$") });
1505
+ }
1506
+ unformat(formated) {
1507
+ return this.currency ? formated.delete(" ").delete("" + this.currency) : formated.delete(" ");
1508
+ }
1509
+ allowed(symbol, state) {
1510
+ return (symbol >= "0" && symbol <= "9") || (symbol == "." && !state.value.includes("."));
1511
+ }
1512
+ }
1513
+ base.add("price", (argument) => new Handler(argument && argument.length > 0 ? argument[0] : undefined));
1514
+ //# sourceMappingURL=price.js.map
1515
+ });
1516
+
1517
+ const price$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(price);
1518
+
1519
+ var text = _commonjsHelpers.createCommonjsModule(function (module, exports) {
1520
+ "use strict";
1521
+ Object.defineProperty(exports, "__esModule", { value: true });
1522
+
1523
+ class Handler {
1524
+ constructor(settings) {
1525
+ this.settings = settings;
1526
+ }
1527
+ toString(data) {
1528
+ return typeof data == "string" ? data : "";
1529
+ }
1530
+ fromString(value) {
1531
+ return typeof value == "string" ? value : undefined;
1532
+ }
1533
+ format(unformated) {
1534
+ return Object.assign(Object.assign(Object.assign({}, unformated), { type: "text" }), this.settings);
1535
+ }
1536
+ unformat(formated) {
1537
+ return formated;
1538
+ }
1539
+ allowed(symbol, state) {
1540
+ return (this.settings.length == undefined ||
1541
+ this.settings.length[1] == undefined ||
1542
+ state.value.length < this.settings.length[1]);
1543
+ }
1544
+ }
1545
+ base.add("text", (settings) => new Handler(settings || {}));
1546
+ base.add("email", (settings) => new Handler(settings || {}));
1547
+ //# sourceMappingURL=text.js.map
1548
+ });
1549
+
1550
+ const text$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(text);
1551
+
1552
+ var Handler = _commonjsHelpers.createCommonjsModule(function (module, exports) {
1553
+ "use strict";
1554
+ Object.defineProperty(exports, "__esModule", { value: true });
1555
+ exports.parse = exports.format = exports.get = void 0;
1556
+
1557
+
1558
+
1559
+
1560
+
1561
+
1562
+
1563
+
1564
+
1565
+
1566
+
1567
+
1568
+
1569
+
1570
+ Object.defineProperty(exports, "format", { enumerable: true, get: function () { return base.format; } });
1571
+ Object.defineProperty(exports, "get", { enumerable: true, get: function () { return base.get; } });
1572
+ Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return base.parse; } });
1573
+ //# sourceMappingURL=index.js.map
1574
+ });
1575
+
1576
+ const index$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(Handler);
1577
+
1578
+ var dist = _commonjsHelpers.createCommonjsModule(function (module, exports) {
1579
+ "use strict";
1580
+ Object.defineProperty(exports, "__esModule", { value: true });
1581
+ exports.parse = exports.format = exports.get = exports.StateEditor = exports.State = exports.Selection = exports.Action = void 0;
1582
+
1583
+ Object.defineProperty(exports, "Action", { enumerable: true, get: function () { return Action_1.Action; } });
1584
+
1585
+ Object.defineProperty(exports, "format", { enumerable: true, get: function () { return Handler.format; } });
1586
+ Object.defineProperty(exports, "get", { enumerable: true, get: function () { return Handler.get; } });
1587
+ Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return Handler.parse; } });
1588
+
1589
+ Object.defineProperty(exports, "Selection", { enumerable: true, get: function () { return Selection_1.Selection; } });
1590
+
1591
+ Object.defineProperty(exports, "State", { enumerable: true, get: function () { return State_1.State; } });
1592
+
1593
+ Object.defineProperty(exports, "StateEditor", { enumerable: true, get: function () { return StateEditor_1.StateEditor; } });
1594
+ //# sourceMappingURL=index.js.map
1595
+ });
1596
+
1597
+ const index = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(dist);
1598
+
1599
+ exports.dist = dist;