wj-elements 0.1.127 → 0.1.128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{infinite-scroll.element-DEQ-AqTB.js → infinite-scroll.element-DcO1E5Es.js} +1 -4
- package/dist/{list.element-BkOOqBtW.js → list.element-TZXMx1rt.js} +1 -4
- package/dist/{popup.element-DvPGL_NN.js → popup.element-l8v-dMoK.js} +4 -10
- package/dist/{router-links-F7MJWhZi.js → router-links-I2vcmVCs.js} +8 -16
- package/dist/wje-accordion-item.js +1 -4
- package/dist/wje-accordion.js +1 -4
- package/dist/wje-animation.js +1 -4
- package/dist/wje-aside.js +1 -4
- package/dist/wje-avatar.js +1 -4
- package/dist/wje-badge.js +1 -4
- package/dist/wje-breadcrumb.js +1 -4
- package/dist/wje-breadcrumbs.js +1 -4
- package/dist/wje-button-group.js +1 -4
- package/dist/wje-button.js +1 -4
- package/dist/wje-card-content.js +1 -4
- package/dist/wje-card-controls.js +1 -4
- package/dist/wje-card-header.js +1 -4
- package/dist/wje-card-subtitle.js +1 -4
- package/dist/wje-card-title.js +1 -4
- package/dist/wje-card.js +1 -4
- package/dist/wje-carousel-item.js +1 -4
- package/dist/wje-carousel.js +1 -4
- package/dist/wje-checkbox.js +1 -4
- package/dist/wje-chip.js +1 -4
- package/dist/wje-col.js +1 -4
- package/dist/wje-color-picker.js +18 -38
- package/dist/wje-container.js +1 -4
- package/dist/wje-copy-button.js +1 -4
- package/dist/wje-dialog.js +1 -4
- package/dist/wje-divider.js +1 -4
- package/dist/wje-dropdown.js +2 -5
- package/dist/wje-element.js +73 -33
- package/dist/wje-file-upload-item.js +4 -6
- package/dist/wje-file-upload.js +1 -4
- package/dist/wje-footer.js +1 -4
- package/dist/wje-form.js +1 -4
- package/dist/wje-format-digital.js +2 -6
- package/dist/wje-grid.js +1 -4
- package/dist/wje-header.js +1 -4
- package/dist/wje-icon-picker.js +14 -6
- package/dist/wje-icon.js +1 -4
- package/dist/wje-img-comparer.js +1 -4
- package/dist/wje-img.js +9 -4
- package/dist/wje-infinite-scroll.js +1 -1
- package/dist/wje-input-file.js +1 -4
- package/dist/wje-input.js +5 -4
- package/dist/wje-item.js +1 -4
- package/dist/wje-kanban.js +2 -6
- package/dist/wje-label.js +1 -4
- package/dist/wje-list.js +1 -1
- package/dist/wje-main.js +1 -4
- package/dist/wje-masonry.js +2 -6
- package/dist/wje-master.js +5 -8
- package/dist/wje-menu-button.js +1 -4
- package/dist/wje-menu-item.js +4 -9
- package/dist/wje-menu-label.js +1 -4
- package/dist/wje-menu.js +1 -4
- package/dist/wje-option.js +2 -6
- package/dist/wje-options.js +3 -6
- package/dist/wje-orgchart-group.js +1 -4
- package/dist/wje-orgchart-item.js +2 -6
- package/dist/wje-orgchart.js +1 -4
- package/dist/wje-popup.js +1 -1
- package/dist/wje-progress-bar.js +1 -4
- package/dist/wje-qr-code.js +1 -4
- package/dist/wje-radio-group.js +1 -4
- package/dist/wje-radio.js +1 -4
- package/dist/wje-rate.js +1 -4
- package/dist/wje-relative-time.js +1 -4
- package/dist/wje-reorder-dropzone.js +1 -4
- package/dist/wje-reorder-handle.js +7 -16
- package/dist/wje-reorder-item.js +1 -4
- package/dist/wje-reorder.js +5 -12
- package/dist/wje-route.js +1 -4
- package/dist/wje-router-link.js +2 -5
- package/dist/wje-router-outlet.js +3 -8
- package/dist/wje-routerx.js +29 -59
- package/dist/wje-row.js +1 -4
- package/dist/wje-select.js +5 -11
- package/dist/wje-slider.js +2 -5
- package/dist/wje-sliding-container.js +1 -4
- package/dist/wje-split-view.js +1 -4
- package/dist/wje-status.js +1 -4
- package/dist/wje-step.js +1 -4
- package/dist/wje-stepper.js +122 -222
- package/dist/wje-store.js +1 -4
- package/dist/wje-tab-group.js +1 -4
- package/dist/wje-tab-panel.js +1 -4
- package/dist/wje-tab.js +1 -4
- package/dist/wje-textarea.js +1 -4
- package/dist/wje-thumbnail.js +1 -4
- package/dist/wje-toast.js +91 -17
- package/dist/wje-toggle.js +1 -4
- package/dist/wje-toolbar-action.js +1 -4
- package/dist/wje-toolbar.js +2 -5
- package/dist/wje-tooltip.js +1 -4
- package/dist/wje-visually-hidden.js +1 -4
- package/package.json +13 -6
package/dist/wje-stepper.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) =>
|
|
4
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
4
|
import WJElement, { event } from "./wje-element.js";
|
|
8
5
|
import { Localizer } from "./localize.js";
|
|
9
6
|
const styles = ".container {\n display: flex;\n flex-direction: column;\n}\n\n.header {\n display: flex;\n justify-content: var(--wje-stepper-justify);\n margin-bottom: var(--wje-spacing-medium);\n}\n\n.step-header {\n display: flex;\n padding: var(--wje-spacing-medium);\n gap: var(--wje-spacing-x-small);\n color: var(--wje-color-contrast-5);\n flex-grow: var(--wje-stepper-grow);\n text-align: center;\n}\n\n.pointer {\n cursor: pointer;\n}\n\n[active] {\n color: var(--wje-color-contrast-11);\n}\n\n.content {\n margin-bottom: var(--wje-spacing-medium);\n}\n\n.arrow-icon {\n margin-top: var(--wje-stepper-margin);\n}\n\n.step {\n padding: var(--wje-spacing-medium);\n text-align: center;\n}\n\n[done] {\n color: var(--wje-color-contrast-11);\n}\n\n.nav-buttons {\n display: flex;\n justify-content: space-between;\n}";
|
|
@@ -151,8 +148,7 @@ var er$1 = { airline: n$F, animal: w$Q, app: B$Z, cell_phone: T$Q, color: R$P, c
|
|
|
151
148
|
var xe$4 = Object.defineProperty;
|
|
152
149
|
var sr = (s3, e2, r2) => e2 in s3 ? xe$4(s3, e2, { enumerable: true, configurable: true, writable: true, value: r2 }) : s3[e2] = r2;
|
|
153
150
|
var Gr = (s3, e2) => {
|
|
154
|
-
for (var r2 in e2)
|
|
155
|
-
xe$4(s3, r2, { get: e2[r2], enumerable: true });
|
|
151
|
+
for (var r2 in e2) xe$4(s3, r2, { get: e2[r2], enumerable: true });
|
|
156
152
|
};
|
|
157
153
|
var f$Y = (s3, e2, r2) => (sr(s3, typeof e2 != "symbol" ? e2 + "" : e2, r2), r2);
|
|
158
154
|
var p$_ = class p extends Error {
|
|
@@ -160,8 +156,7 @@ var p$_ = class p extends Error {
|
|
|
160
156
|
function Ae$2(s3) {
|
|
161
157
|
let e2 = Object.getPrototypeOf(s3);
|
|
162
158
|
do {
|
|
163
|
-
for (let r2 of Object.getOwnPropertyNames(e2))
|
|
164
|
-
typeof s3[r2] == "function" && r2 !== "constructor" && (s3[r2] = s3[r2].bind(s3));
|
|
159
|
+
for (let r2 of Object.getOwnPropertyNames(e2)) typeof s3[r2] == "function" && r2 !== "constructor" && (s3[r2] = s3[r2].bind(s3));
|
|
165
160
|
e2 = Object.getPrototypeOf(e2);
|
|
166
161
|
} while (e2 !== Object.prototype);
|
|
167
162
|
}
|
|
@@ -284,26 +279,22 @@ var _$S = class _ extends b$Y {
|
|
|
284
279
|
}
|
|
285
280
|
hsl(e2) {
|
|
286
281
|
let r2 = [this.faker.number.int(360)];
|
|
287
|
-
for (let t2 = 0; t2 < (e2 != null && e2.includeAlpha ? 3 : 2); t2++)
|
|
288
|
-
r2.push(this.faker.number.float({ precision: 0.01 }));
|
|
282
|
+
for (let t2 = 0; t2 < (e2 != null && e2.includeAlpha ? 3 : 2); t2++) r2.push(this.faker.number.float({ precision: 0.01 }));
|
|
289
283
|
return R$O(r2, (e2 == null ? void 0 : e2.format) || "decimal", e2 != null && e2.includeAlpha ? "hsla" : "hsl");
|
|
290
284
|
}
|
|
291
285
|
hwb(e2) {
|
|
292
286
|
let r2 = [this.faker.number.int(360)];
|
|
293
|
-
for (let t2 = 0; t2 < 2; t2++)
|
|
294
|
-
r2.push(this.faker.number.float({ precision: 0.01 }));
|
|
287
|
+
for (let t2 = 0; t2 < 2; t2++) r2.push(this.faker.number.float({ precision: 0.01 }));
|
|
295
288
|
return R$O(r2, (e2 == null ? void 0 : e2.format) || "decimal", "hwb");
|
|
296
289
|
}
|
|
297
290
|
lab(e2) {
|
|
298
291
|
let r2 = [this.faker.number.float({ precision: 1e-6 })];
|
|
299
|
-
for (let t2 = 0; t2 < 2; t2++)
|
|
300
|
-
r2.push(this.faker.number.float({ min: -100, max: 100, precision: 1e-4 }));
|
|
292
|
+
for (let t2 = 0; t2 < 2; t2++) r2.push(this.faker.number.float({ min: -100, max: 100, precision: 1e-4 }));
|
|
301
293
|
return R$O(r2, (e2 == null ? void 0 : e2.format) || "decimal", "lab");
|
|
302
294
|
}
|
|
303
295
|
lch(e2) {
|
|
304
296
|
let r2 = [this.faker.number.float({ precision: 1e-6 })];
|
|
305
|
-
for (let t2 = 0; t2 < 2; t2++)
|
|
306
|
-
r2.push(this.faker.number.float({ max: 230, precision: 0.1 }));
|
|
297
|
+
for (let t2 = 0; t2 < 2; t2++) r2.push(this.faker.number.float({ max: 230, precision: 0.1 }));
|
|
307
298
|
return R$O(r2, (e2 == null ? void 0 : e2.format) || "decimal", "lch");
|
|
308
299
|
}
|
|
309
300
|
colorByCSSColorSpace(e2) {
|
|
@@ -324,11 +315,9 @@ function Te$2(s3) {
|
|
|
324
315
|
}, set: G$N, deleteProperty: G$N });
|
|
325
316
|
}
|
|
326
317
|
function v$P(s3, ...e2) {
|
|
327
|
-
if (s3 === null)
|
|
328
|
-
throw new p$_(`The locale data for '${e2.join(".")}' aren't applicable to this locale.
|
|
318
|
+
if (s3 === null) throw new p$_(`The locale data for '${e2.join(".")}' aren't applicable to this locale.
|
|
329
319
|
If you think this is a bug, please report it at: https://github.com/faker-js/faker`);
|
|
330
|
-
if (s3 === void 0)
|
|
331
|
-
throw new p$_(`The locale data for '${e2.join(".")}' are missing in this locale.
|
|
320
|
+
if (s3 === void 0) throw new p$_(`The locale data for '${e2.join(".")}' are missing in this locale.
|
|
332
321
|
Please contribute the missing data to the project or use a locale/Faker instance that has these data.
|
|
333
322
|
For more information see https://fakerjs.dev/guide/localization.html`);
|
|
334
323
|
}
|
|
@@ -406,20 +395,17 @@ var U$D = class U extends b$Y {
|
|
|
406
395
|
}
|
|
407
396
|
jobDescriptor() {
|
|
408
397
|
let e2 = this.faker.definitions.person.title.descriptor;
|
|
409
|
-
if (e2 == null)
|
|
410
|
-
throw new p$_("No person.title.descriptor definitions available.");
|
|
398
|
+
if (e2 == null) throw new p$_("No person.title.descriptor definitions available.");
|
|
411
399
|
return this.faker.helpers.arrayElement(e2);
|
|
412
400
|
}
|
|
413
401
|
jobArea() {
|
|
414
402
|
let e2 = this.faker.definitions.person.title.level;
|
|
415
|
-
if (e2 == null)
|
|
416
|
-
throw new p$_("No person.title.area definitions available.");
|
|
403
|
+
if (e2 == null) throw new p$_("No person.title.area definitions available.");
|
|
417
404
|
return this.faker.helpers.arrayElement(e2);
|
|
418
405
|
}
|
|
419
406
|
jobType() {
|
|
420
407
|
let e2 = this.faker.definitions.person.title.job;
|
|
421
|
-
if (e2 == null)
|
|
422
|
-
throw new p$_("No person.title.job definitions available.");
|
|
408
|
+
if (e2 == null) throw new p$_("No person.title.job definitions available.");
|
|
423
409
|
return this.faker.helpers.arrayElement(e2);
|
|
424
410
|
}
|
|
425
411
|
zodiacSign() {
|
|
@@ -448,31 +434,25 @@ var be$6 = class be {
|
|
|
448
434
|
}
|
|
449
435
|
multiplication32(e2, r2) {
|
|
450
436
|
let t2 = 0;
|
|
451
|
-
for (let a2 = 0; a2 < 32; ++a2)
|
|
452
|
-
e2 >>> a2 & 1 && (t2 = this.addition32(t2, this.unsigned32(r2 << a2)));
|
|
437
|
+
for (let a2 = 0; a2 < 32; ++a2) e2 >>> a2 & 1 && (t2 = this.addition32(t2, this.unsigned32(r2 << a2)));
|
|
453
438
|
return t2;
|
|
454
439
|
}
|
|
455
440
|
initGenrand(e2) {
|
|
456
|
-
for (this.mt[0] = this.unsigned32(e2 & 4294967295), this.mti = 1; this.mti < this.N; this.mti++)
|
|
457
|
-
this.mt[this.mti] = this.addition32(this.multiplication32(1812433253, this.unsigned32(this.mt[this.mti - 1] ^ this.mt[this.mti - 1] >>> 30)), this.mti), this.mt[this.mti] = this.unsigned32(this.mt[this.mti] & 4294967295);
|
|
441
|
+
for (this.mt[0] = this.unsigned32(e2 & 4294967295), this.mti = 1; this.mti < this.N; this.mti++) this.mt[this.mti] = this.addition32(this.multiplication32(1812433253, this.unsigned32(this.mt[this.mti - 1] ^ this.mt[this.mti - 1] >>> 30)), this.mti), this.mt[this.mti] = this.unsigned32(this.mt[this.mti] & 4294967295);
|
|
458
442
|
}
|
|
459
443
|
initByArray(e2, r2) {
|
|
460
444
|
this.initGenrand(19650218);
|
|
461
445
|
let t2 = 1, a2 = 0, n2 = this.N > r2 ? this.N : r2;
|
|
462
|
-
for (; n2; n2--)
|
|
463
|
-
|
|
464
|
-
for (n2 = this.N - 1; n2; n2--)
|
|
465
|
-
this.mt[t2] = this.subtraction32(this.unsigned32(this.mt[t2] ^ this.multiplication32(this.unsigned32(this.mt[t2 - 1] ^ this.mt[t2 - 1] >>> 30), 1566083941)), t2), this.mt[t2] = this.unsigned32(this.mt[t2] & 4294967295), t2++, t2 >= this.N && (this.mt[0] = this.mt[this.N - 1], t2 = 1);
|
|
446
|
+
for (; n2; n2--) this.mt[t2] = this.addition32(this.addition32(this.unsigned32(this.mt[t2] ^ this.multiplication32(this.unsigned32(this.mt[t2 - 1] ^ this.mt[t2 - 1] >>> 30), 1664525)), e2[a2]), a2), this.mt[t2] = this.unsigned32(this.mt[t2] & 4294967295), t2++, a2++, t2 >= this.N && (this.mt[0] = this.mt[this.N - 1], t2 = 1), a2 >= r2 && (a2 = 0);
|
|
447
|
+
for (n2 = this.N - 1; n2; n2--) this.mt[t2] = this.subtraction32(this.unsigned32(this.mt[t2] ^ this.multiplication32(this.unsigned32(this.mt[t2 - 1] ^ this.mt[t2 - 1] >>> 30), 1566083941)), t2), this.mt[t2] = this.unsigned32(this.mt[t2] & 4294967295), t2++, t2 >= this.N && (this.mt[0] = this.mt[this.N - 1], t2 = 1);
|
|
466
448
|
this.mt[0] = 2147483648;
|
|
467
449
|
}
|
|
468
450
|
genrandInt32() {
|
|
469
451
|
let e2;
|
|
470
452
|
if (this.mti >= this.N) {
|
|
471
453
|
let r2;
|
|
472
|
-
for (this.mti === this.N + 1 && this.initGenrand(5489), r2 = 0; r2 < this.N - this.M; r2++)
|
|
473
|
-
|
|
474
|
-
for (; r2 < this.N - 1; r2++)
|
|
475
|
-
e2 = this.unsigned32(this.mt[r2] & this.UPPER_MASK | this.mt[r2 + 1] & this.LOWER_MASK), this.mt[r2] = this.unsigned32(this.mt[r2 + (this.M - this.N)] ^ e2 >>> 1 ^ this.mag01[e2 & 1]);
|
|
454
|
+
for (this.mti === this.N + 1 && this.initGenrand(5489), r2 = 0; r2 < this.N - this.M; r2++) e2 = this.unsigned32(this.mt[r2] & this.UPPER_MASK | this.mt[r2 + 1] & this.LOWER_MASK), this.mt[r2] = this.unsigned32(this.mt[r2 + this.M] ^ e2 >>> 1 ^ this.mag01[e2 & 1]);
|
|
455
|
+
for (; r2 < this.N - 1; r2++) e2 = this.unsigned32(this.mt[r2] & this.UPPER_MASK | this.mt[r2 + 1] & this.LOWER_MASK), this.mt[r2] = this.unsigned32(this.mt[r2 + (this.M - this.N)] ^ e2 >>> 1 ^ this.mag01[e2 & 1]);
|
|
476
456
|
e2 = this.unsigned32(this.mt[this.N - 1] & this.UPPER_MASK | this.mt[0] & this.LOWER_MASK), this.mt[this.N - 1] = this.unsigned32(this.mt[this.M - 1] ^ e2 >>> 1 ^ this.mag01[e2 & 1]), this.mti = 0;
|
|
477
457
|
}
|
|
478
458
|
return e2 = this.mt[this.mti++], e2 = this.unsigned32(e2 ^ e2 >>> 11), e2 = this.unsigned32(e2 ^ e2 << 7 & 2636928640), e2 = this.unsigned32(e2 ^ e2 << 15 & 4022730752), e2 = this.unsigned32(e2 ^ e2 >>> 18), e2;
|
|
@@ -541,8 +521,7 @@ var K$Q = class K extends S$V {
|
|
|
541
521
|
json() {
|
|
542
522
|
m$T({ deprecated: "faker.datatype.json()", proposed: "your own function to generate complex objects", since: "8.0", until: "9.0" });
|
|
543
523
|
let e2 = ["foo", "bar", "bike", "a", "b", "name", "prop"], r2 = {};
|
|
544
|
-
for (let t2 of e2)
|
|
545
|
-
r2[t2] = this.boolean() ? this.faker.string.sample() : this.faker.number.int();
|
|
524
|
+
for (let t2 of e2) r2[t2] = this.boolean() ? this.faker.string.sample() : this.faker.number.int();
|
|
546
525
|
return JSON.stringify(r2);
|
|
547
526
|
}
|
|
548
527
|
array(e2 = 10) {
|
|
@@ -563,16 +542,14 @@ var $$r = class $ extends S$V {
|
|
|
563
542
|
past(e2 = {}, r2) {
|
|
564
543
|
typeof e2 == "number" && (m$T({ deprecated: "faker.date.past(years, refDate)", proposed: "faker.date.past({ years, refDate })", since: "8.0", until: "9.0" }), e2 = { years: e2 });
|
|
565
544
|
let { years: t2 = 1, refDate: a2 = r2 } = e2;
|
|
566
|
-
if (t2 <= 0)
|
|
567
|
-
throw new p$_("Years must be greater than 0.");
|
|
545
|
+
if (t2 <= 0) throw new p$_("Years must be greater than 0.");
|
|
568
546
|
let n2 = N$V(a2, this.faker.defaultRefDate), i2 = { min: 1e3, max: t2 * 365 * 24 * 3600 * 1e3 }, o2 = n2.getTime();
|
|
569
547
|
return o2 -= this.faker.number.int(i2), n2.setTime(o2), n2;
|
|
570
548
|
}
|
|
571
549
|
future(e2 = {}, r2) {
|
|
572
550
|
typeof e2 == "number" && (m$T({ deprecated: "faker.date.future(years, refDate)", proposed: "faker.date.future({ years, refDate })", since: "8.0", until: "9.0" }), e2 = { years: e2 });
|
|
573
551
|
let { years: t2 = 1, refDate: a2 = r2 } = e2;
|
|
574
|
-
if (t2 <= 0)
|
|
575
|
-
throw new p$_("Years must be greater than 0.");
|
|
552
|
+
if (t2 <= 0) throw new p$_("Years must be greater than 0.");
|
|
576
553
|
let n2 = N$V(a2, this.faker.defaultRefDate), i2 = { min: 1e3, max: t2 * 365 * 24 * 3600 * 1e3 }, o2 = n2.getTime();
|
|
577
554
|
return o2 += this.faker.number.int(i2), n2.setTime(o2), n2;
|
|
578
555
|
}
|
|
@@ -589,24 +566,21 @@ var $$r = class $ extends S$V {
|
|
|
589
566
|
recent(e2 = {}, r2) {
|
|
590
567
|
typeof e2 == "number" && (m$T({ deprecated: "faker.date.recent(days, refDate)", proposed: "faker.date.recent({ days, refDate })", since: "8.0", until: "9.0" }), e2 = { days: e2 });
|
|
591
568
|
let { days: t2 = 1, refDate: a2 = r2 } = e2;
|
|
592
|
-
if (t2 <= 0)
|
|
593
|
-
throw new p$_("Days must be greater than 0.");
|
|
569
|
+
if (t2 <= 0) throw new p$_("Days must be greater than 0.");
|
|
594
570
|
let n2 = N$V(a2, this.faker.defaultRefDate), i2 = { min: 1e3, max: t2 * 24 * 3600 * 1e3 }, o2 = n2.getTime();
|
|
595
571
|
return o2 -= this.faker.number.int(i2), n2.setTime(o2), n2;
|
|
596
572
|
}
|
|
597
573
|
soon(e2 = {}, r2) {
|
|
598
574
|
typeof e2 == "number" && (m$T({ deprecated: "faker.date.soon(days, refDate)", proposed: "faker.date.soon({ days, refDate })", since: "8.0", until: "9.0" }), e2 = { days: e2 });
|
|
599
575
|
let { days: t2 = 1, refDate: a2 = r2 } = e2;
|
|
600
|
-
if (t2 <= 0)
|
|
601
|
-
throw new p$_("Days must be greater than 0.");
|
|
576
|
+
if (t2 <= 0) throw new p$_("Days must be greater than 0.");
|
|
602
577
|
let n2 = N$V(a2, this.faker.defaultRefDate), i2 = { min: 1e3, max: t2 * 24 * 3600 * 1e3 }, o2 = n2.getTime();
|
|
603
578
|
return o2 += this.faker.number.int(i2), n2.setTime(o2), n2;
|
|
604
579
|
}
|
|
605
580
|
birthdate(e2 = {}) {
|
|
606
581
|
var o2, l2, c2, u2;
|
|
607
582
|
let r2 = e2.mode === "age" ? "age" : "year", t2 = N$V(e2.refDate, this.faker.defaultRefDate), a2 = t2.getUTCFullYear(), n2, i2;
|
|
608
|
-
if (r2 === "age" ? (n2 = new Date(t2).setUTCFullYear(a2 - ((o2 = e2.max) != null ? o2 : 80) - 1), i2 = new Date(t2).setUTCFullYear(a2 - ((l2 = e2.min) != null ? l2 : 18))) : (n2 = new Date(Date.UTC(0, 0, 2)).setUTCFullYear((c2 = e2.min) != null ? c2 : a2 - 80), i2 = new Date(Date.UTC(0, 11, 30)).setUTCFullYear((u2 = e2.max) != null ? u2 : a2 - 19)), i2 < n2)
|
|
609
|
-
throw new p$_(`Max ${e2.max} should be larger than or equal to min ${e2.min}.`);
|
|
583
|
+
if (r2 === "age" ? (n2 = new Date(t2).setUTCFullYear(a2 - ((o2 = e2.max) != null ? o2 : 80) - 1), i2 = new Date(t2).setUTCFullYear(a2 - ((l2 = e2.min) != null ? l2 : 18))) : (n2 = new Date(Date.UTC(0, 0, 2)).setUTCFullYear((c2 = e2.min) != null ? c2 : a2 - 80), i2 = new Date(Date.UTC(0, 11, 30)).setUTCFullYear((u2 = e2.max) != null ? u2 : a2 - 19)), i2 < n2) throw new p$_(`Max ${e2.max} should be larger than or equal to min ${e2.min}.`);
|
|
610
584
|
return new Date(this.faker.number.int({ min: n2, max: i2 }));
|
|
611
585
|
}
|
|
612
586
|
}, j$L = class j extends $$r {
|
|
@@ -657,50 +631,41 @@ Try adjusting maxTime or maxRetries parameters for faker.helpers.unique().`);
|
|
|
657
631
|
}
|
|
658
632
|
function de$6(s3, e2, r2 = {}) {
|
|
659
633
|
let t2 = Date.now(), { startTime: a2 = Date.now(), maxTime: n2 = 50, maxRetries: i2 = 50, currentIterations: o2 = 0, compare: l2 = br, store: c2 = {} } = r2, { exclude: u2 = [] } = r2;
|
|
660
|
-
if (r2.currentIterations = o2, Array.isArray(u2) || (u2 = [u2]), t2 - a2 >= n2)
|
|
661
|
-
|
|
662
|
-
if (o2 >= i2)
|
|
663
|
-
return Re$2(a2, t2, `Exceeded maxRetries: ${i2}`, c2, o2);
|
|
634
|
+
if (r2.currentIterations = o2, Array.isArray(u2) || (u2 = [u2]), t2 - a2 >= n2) return Re$2(a2, t2, `Exceeded maxTime: ${n2}`, c2, o2);
|
|
635
|
+
if (o2 >= i2) return Re$2(a2, t2, `Exceeded maxRetries: ${i2}`, c2, o2);
|
|
664
636
|
let h2 = s3(...e2);
|
|
665
637
|
return l2(c2, h2) === -1 && !u2.includes(h2) ? (c2[h2] = h2, r2.currentIterations = 0, h2) : (r2.currentIterations++, de$6(s3, e2, { ...r2, startTime: a2, maxTime: n2, maxRetries: i2, compare: l2, exclude: u2 }));
|
|
666
638
|
}
|
|
667
639
|
function ve$4(s3, e2, r2, t2) {
|
|
668
640
|
let a2 = 1;
|
|
669
|
-
if (e2)
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
n2 *= 2;
|
|
686
|
-
a2 = s3.number.int({ min: 1, max: n2 });
|
|
687
|
-
break;
|
|
688
|
-
}
|
|
689
|
-
default:
|
|
690
|
-
throw new p$_("Unknown quantifier symbol provided.");
|
|
641
|
+
if (e2) switch (e2) {
|
|
642
|
+
case "?": {
|
|
643
|
+
a2 = s3.datatype.boolean() ? 0 : 1;
|
|
644
|
+
break;
|
|
645
|
+
}
|
|
646
|
+
case "*": {
|
|
647
|
+
let n2 = 1;
|
|
648
|
+
for (; s3.datatype.boolean(); ) n2 *= 2;
|
|
649
|
+
a2 = s3.number.int({ min: 0, max: n2 });
|
|
650
|
+
break;
|
|
651
|
+
}
|
|
652
|
+
case "+": {
|
|
653
|
+
let n2 = 1;
|
|
654
|
+
for (; s3.datatype.boolean(); ) n2 *= 2;
|
|
655
|
+
a2 = s3.number.int({ min: 1, max: n2 });
|
|
656
|
+
break;
|
|
691
657
|
}
|
|
692
|
-
|
|
693
|
-
|
|
658
|
+
default:
|
|
659
|
+
throw new p$_("Unknown quantifier symbol provided.");
|
|
660
|
+
}
|
|
661
|
+
else r2 != null && t2 != null ? a2 = s3.number.int({ min: Number.parseInt(r2), max: Number.parseInt(t2) }) : r2 != null && t2 == null && (a2 = Number.parseInt(r2));
|
|
694
662
|
return a2;
|
|
695
663
|
}
|
|
696
664
|
function Le$3(s3, e2 = "") {
|
|
697
665
|
let r2 = /(.)\{(\d+),(\d+)\}/, t2 = /(.)\{(\d+)\}/, a2 = /\[(\d+)-(\d+)\]/, n2, i2, o2, l2, c2 = r2.exec(e2);
|
|
698
|
-
for (; c2 != null; )
|
|
699
|
-
|
|
700
|
-
for (c2 =
|
|
701
|
-
l2 = Number.parseInt(c2[2]), e2 = e2.slice(0, c2.index) + c2[1].repeat(l2) + e2.slice(c2.index + c2[0].length), c2 = t2.exec(e2);
|
|
702
|
-
for (c2 = a2.exec(e2); c2 != null; )
|
|
703
|
-
n2 = Number.parseInt(c2[1]), i2 = Number.parseInt(c2[2]), n2 > i2 && (o2 = i2, i2 = n2, n2 = o2), e2 = e2.slice(0, c2.index) + s3.number.int({ min: n2, max: i2 }).toString() + e2.slice(c2.index + c2[0].length), c2 = a2.exec(e2);
|
|
666
|
+
for (; c2 != null; ) n2 = Number.parseInt(c2[2]), i2 = Number.parseInt(c2[3]), n2 > i2 && (o2 = i2, i2 = n2, n2 = o2), l2 = s3.number.int({ min: n2, max: i2 }), e2 = e2.slice(0, c2.index) + c2[1].repeat(l2) + e2.slice(c2.index + c2[0].length), c2 = r2.exec(e2);
|
|
667
|
+
for (c2 = t2.exec(e2); c2 != null; ) l2 = Number.parseInt(c2[2]), e2 = e2.slice(0, c2.index) + c2[1].repeat(l2) + e2.slice(c2.index + c2[0].length), c2 = t2.exec(e2);
|
|
668
|
+
for (c2 = a2.exec(e2); c2 != null; ) n2 = Number.parseInt(c2[1]), i2 = Number.parseInt(c2[2]), n2 > i2 && (o2 = i2, i2 = n2, n2 = o2), e2 = e2.slice(0, c2.index) + s3.number.int({ min: n2, max: i2 }).toString() + e2.slice(c2.index + c2[0].length), c2 = a2.exec(e2);
|
|
704
669
|
return e2;
|
|
705
670
|
}
|
|
706
671
|
var P$V = class P extends S$V {
|
|
@@ -713,14 +678,12 @@ var P$V = class P extends S$V {
|
|
|
713
678
|
}
|
|
714
679
|
replaceSymbolWithNumber(r2 = "", t2 = "#") {
|
|
715
680
|
let a2 = "";
|
|
716
|
-
for (let n2 = 0; n2 < r2.length; n2++)
|
|
717
|
-
r2.charAt(n2) === t2 ? a2 += this.faker.number.int(9) : r2.charAt(n2) === "!" ? a2 += this.faker.number.int({ min: 2, max: 9 }) : a2 += r2.charAt(n2);
|
|
681
|
+
for (let n2 = 0; n2 < r2.length; n2++) r2.charAt(n2) === t2 ? a2 += this.faker.number.int(9) : r2.charAt(n2) === "!" ? a2 += this.faker.number.int({ min: 2, max: 9 }) : a2 += r2.charAt(n2);
|
|
718
682
|
return a2;
|
|
719
683
|
}
|
|
720
684
|
replaceSymbols(r2 = "") {
|
|
721
685
|
let t2 = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"], a2 = "";
|
|
722
|
-
for (let n2 = 0; n2 < r2.length; n2++)
|
|
723
|
-
r2.charAt(n2) === "#" ? a2 += this.faker.number.int(9) : r2.charAt(n2) === "?" ? a2 += this.arrayElement(t2) : r2.charAt(n2) === "*" ? a2 += this.faker.datatype.boolean() ? this.arrayElement(t2) : this.faker.number.int(9) : a2 += r2.charAt(n2);
|
|
686
|
+
for (let n2 = 0; n2 < r2.length; n2++) r2.charAt(n2) === "#" ? a2 += this.faker.number.int(9) : r2.charAt(n2) === "?" ? a2 += this.arrayElement(t2) : r2.charAt(n2) === "*" ? a2 += this.faker.datatype.boolean() ? this.arrayElement(t2) : this.faker.number.int(9) : a2 += r2.charAt(n2);
|
|
724
687
|
return a2;
|
|
725
688
|
}
|
|
726
689
|
replaceCreditCardSymbols(r2 = "6453-####-####-####-###L", t2 = "#") {
|
|
@@ -746,16 +709,12 @@ var P$V = class P extends S$V {
|
|
|
746
709
|
for (x2 && E2.push(45); D2 != null; ) {
|
|
747
710
|
if (D2[0].includes("-")) {
|
|
748
711
|
let C2 = D2[0].split("-").map((k2) => k2.charCodeAt(0));
|
|
749
|
-
if (a2 = C2[0], n2 = C2[1], a2 > n2)
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
} else
|
|
756
|
-
E2.push(k2);
|
|
757
|
-
} else
|
|
758
|
-
t2 && Number.isNaN(Number(D2[0])) ? E2.push(D2[0].toUpperCase().charCodeAt(0), D2[0].toLowerCase().charCodeAt(0)) : E2.push(D2[0].charCodeAt(0));
|
|
712
|
+
if (a2 = C2[0], n2 = C2[1], a2 > n2) throw new p$_("Character range provided is out of order.");
|
|
713
|
+
for (let k2 = a2; k2 <= n2; k2++) if (t2 && Number.isNaN(Number(String.fromCharCode(k2)))) {
|
|
714
|
+
let ke2 = String.fromCharCode(k2);
|
|
715
|
+
E2.push(ke2.toUpperCase().charCodeAt(0), ke2.toLowerCase().charCodeAt(0));
|
|
716
|
+
} else E2.push(k2);
|
|
717
|
+
} else t2 && Number.isNaN(Number(D2[0])) ? E2.push(D2[0].toUpperCase().charCodeAt(0), D2[0].toLowerCase().charCodeAt(0)) : E2.push(D2[0].charCodeAt(0));
|
|
759
718
|
F2 = F2.substring(D2[0].length), D2 = c2.exec(F2);
|
|
760
719
|
}
|
|
761
720
|
if (i2 = ve$4(this.faker, nr, w2, ar), A2) {
|
|
@@ -787,13 +746,11 @@ var P$V = class P extends S$V {
|
|
|
787
746
|
}
|
|
788
747
|
let h2 = /(.)\{(\d+),(\d+)\}/;
|
|
789
748
|
for (l2 = h2.exec(r2); l2 != null; ) {
|
|
790
|
-
if (a2 = Number.parseInt(l2[2]), n2 = Number.parseInt(l2[3]), a2 > n2)
|
|
791
|
-
throw new p$_("Numbers out of order in {} quantifier.");
|
|
749
|
+
if (a2 = Number.parseInt(l2[2]), n2 = Number.parseInt(l2[3]), a2 > n2) throw new p$_("Numbers out of order in {} quantifier.");
|
|
792
750
|
i2 = this.faker.number.int({ min: a2, max: n2 }), r2 = r2.slice(0, l2.index) + l2[1].repeat(i2) + r2.slice(l2.index + l2[0].length), l2 = h2.exec(r2);
|
|
793
751
|
}
|
|
794
752
|
let d2 = /(.)\{(\d+)\}/;
|
|
795
|
-
for (l2 = d2.exec(r2); l2 != null; )
|
|
796
|
-
i2 = Number.parseInt(l2[2]), r2 = r2.slice(0, l2.index) + l2[1].repeat(i2) + r2.slice(l2.index + l2[0].length), l2 = d2.exec(r2);
|
|
753
|
+
for (l2 = d2.exec(r2); l2 != null; ) i2 = Number.parseInt(l2[2]), r2 = r2.slice(0, l2.index) + l2[1].repeat(i2) + r2.slice(l2.index + l2[0].length), l2 = d2.exec(r2);
|
|
797
754
|
return r2;
|
|
798
755
|
}
|
|
799
756
|
shuffle(r2, t2 = {}) {
|
|
@@ -814,16 +771,14 @@ var P$V = class P extends S$V {
|
|
|
814
771
|
try {
|
|
815
772
|
if (typeof r2 == "function") {
|
|
816
773
|
let n2 = 1e3 * t2, i2 = 0;
|
|
817
|
-
for (; a2.size < t2 && i2 < n2; )
|
|
818
|
-
a2.add(r2()), i2++;
|
|
774
|
+
for (; a2.size < t2 && i2 < n2; ) a2.add(r2()), i2++;
|
|
819
775
|
}
|
|
820
776
|
} catch {
|
|
821
777
|
}
|
|
822
778
|
return [...a2];
|
|
823
779
|
}
|
|
824
780
|
mustache(r2, t2) {
|
|
825
|
-
if (r2 == null)
|
|
826
|
-
return "";
|
|
781
|
+
if (r2 == null) return "";
|
|
827
782
|
for (let a2 in t2) {
|
|
828
783
|
let n2 = new RegExp(`{{${a2}}}`, "g"), i2 = t2[a2];
|
|
829
784
|
typeof i2 == "string" && (i2 = i2.replace(/\$/g, "$$$$")), r2 = r2.replace(n2, i2);
|
|
@@ -831,8 +786,7 @@ var P$V = class P extends S$V {
|
|
|
831
786
|
return r2;
|
|
832
787
|
}
|
|
833
788
|
maybe(r2, t2 = {}) {
|
|
834
|
-
if (this.faker.datatype.boolean(t2))
|
|
835
|
-
return r2();
|
|
789
|
+
if (this.faker.datatype.boolean(t2)) return r2();
|
|
836
790
|
}
|
|
837
791
|
objectKey(r2) {
|
|
838
792
|
let t2 = Object.keys(r2);
|
|
@@ -847,37 +801,26 @@ var P$V = class P extends S$V {
|
|
|
847
801
|
return [t2, r2[t2]];
|
|
848
802
|
}
|
|
849
803
|
arrayElement(r2) {
|
|
850
|
-
if (r2 == null)
|
|
851
|
-
|
|
852
|
-
if (r2.length === 0)
|
|
853
|
-
throw new p$_("Cannot get value from empty dataset.");
|
|
804
|
+
if (r2 == null) throw new p$_("Calling `faker.helpers.arrayElement()` without arguments is no longer supported.");
|
|
805
|
+
if (r2.length === 0) throw new p$_("Cannot get value from empty dataset.");
|
|
854
806
|
let t2 = r2.length > 1 ? this.faker.number.int({ max: r2.length - 1 }) : 0;
|
|
855
807
|
return r2[t2];
|
|
856
808
|
}
|
|
857
809
|
weightedArrayElement(r2) {
|
|
858
|
-
if (r2.length === 0)
|
|
859
|
-
|
|
860
|
-
if (!r2.every((i2) => i2.weight > 0))
|
|
861
|
-
throw new p$_("weightedArrayElement expects an array of { weight, value } objects where weight is a positive number");
|
|
810
|
+
if (r2.length === 0) throw new p$_("weightedArrayElement expects an array with at least one element");
|
|
811
|
+
if (!r2.every((i2) => i2.weight > 0)) throw new p$_("weightedArrayElement expects an array of { weight, value } objects where weight is a positive number");
|
|
862
812
|
let t2 = r2.reduce((i2, { weight: o2 }) => i2 + o2, 0), a2 = this.faker.number.float({ min: 0, max: t2, precision: 1e-9 }), n2 = 0;
|
|
863
|
-
for (let { weight: i2, value: o2 } of r2)
|
|
864
|
-
if (n2 += i2, a2 < n2)
|
|
865
|
-
return o2;
|
|
813
|
+
for (let { weight: i2, value: o2 } of r2) if (n2 += i2, a2 < n2) return o2;
|
|
866
814
|
return r2[r2.length - 1].value;
|
|
867
815
|
}
|
|
868
816
|
arrayElements(r2, t2) {
|
|
869
|
-
if (r2 == null)
|
|
870
|
-
|
|
871
|
-
if (r2.length === 0)
|
|
872
|
-
return [];
|
|
817
|
+
if (r2 == null) throw new p$_("Calling `faker.helpers.arrayElements()` without arguments is no longer supported.");
|
|
818
|
+
if (r2.length === 0) return [];
|
|
873
819
|
let a2 = this.rangeToNumber(t2 != null ? t2 : { min: 1, max: r2.length });
|
|
874
|
-
if (a2 >= r2.length)
|
|
875
|
-
|
|
876
|
-
if (a2 <= 0)
|
|
877
|
-
return [];
|
|
820
|
+
if (a2 >= r2.length) return this.shuffle(r2);
|
|
821
|
+
if (a2 <= 0) return [];
|
|
878
822
|
let n2 = [...r2], i2 = r2.length, o2 = i2 - a2, l2, c2;
|
|
879
|
-
for (; i2-- > o2; )
|
|
880
|
-
c2 = this.faker.number.int(i2), l2 = n2[c2], n2[c2] = n2[i2], n2[i2] = l2;
|
|
823
|
+
for (; i2-- > o2; ) c2 = this.faker.number.int(i2), l2 = n2[c2], n2[c2] = n2[i2], n2[i2] = l2;
|
|
881
824
|
return n2.slice(o2);
|
|
882
825
|
}
|
|
883
826
|
enumValue(r2) {
|
|
@@ -905,20 +848,15 @@ var P$V = class P extends S$V {
|
|
|
905
848
|
fake(r2) {
|
|
906
849
|
r2 = typeof r2 == "string" ? r2 : this.arrayElement(r2);
|
|
907
850
|
let t2 = r2.search(/{{[a-z]/), a2 = r2.indexOf("}}", t2);
|
|
908
|
-
if (t2 === -1 || a2 === -1)
|
|
909
|
-
return r2;
|
|
851
|
+
if (t2 === -1 || a2 === -1) return r2;
|
|
910
852
|
let i2 = r2.substring(t2 + 2, a2 + 2).replace("}}", "").replace("{{", ""), o2 = /\(([^)]*)\)/, l2 = o2.exec(i2), c2 = "";
|
|
911
853
|
l2 && (i2 = i2.replace(o2, ""), c2 = l2[1]);
|
|
912
854
|
let u2 = i2.split("."), h2 = this.faker, d2 = this.faker.rawDefinitions;
|
|
913
|
-
for (let w2 of u2)
|
|
914
|
-
h2 = h2 == null ? void 0 : h2[w2], d2 = d2 == null ? void 0 : d2[w2];
|
|
855
|
+
for (let w2 of u2) h2 = h2 == null ? void 0 : h2[w2], d2 = d2 == null ? void 0 : d2[w2];
|
|
915
856
|
let g2;
|
|
916
|
-
if (typeof h2 == "function")
|
|
917
|
-
|
|
918
|
-
else
|
|
919
|
-
g2 = () => this.faker.helpers.arrayElement(d2);
|
|
920
|
-
else
|
|
921
|
-
throw new p$_(`Invalid module method or definition: ${i2}
|
|
857
|
+
if (typeof h2 == "function") g2 = h2;
|
|
858
|
+
else if (Array.isArray(d2)) g2 = () => this.faker.helpers.arrayElement(d2);
|
|
859
|
+
else throw new p$_(`Invalid module method or definition: ${i2}
|
|
922
860
|
- faker.${i2} is not a function
|
|
923
861
|
- faker.definitions.${i2} is not an array`);
|
|
924
862
|
g2 = g2.bind(this);
|
|
@@ -936,23 +874,18 @@ var z$L = class z extends S$V {
|
|
|
936
874
|
int(e2 = {}) {
|
|
937
875
|
typeof e2 == "number" && (e2 = { max: e2 });
|
|
938
876
|
let { min: r2 = 0, max: t2 = Number.MAX_SAFE_INTEGER } = e2, a2 = Math.ceil(r2), n2 = Math.floor(t2);
|
|
939
|
-
if (a2 === n2)
|
|
940
|
-
|
|
941
|
-
if (n2 < a2)
|
|
942
|
-
throw t2 >= r2 ? new p$_(`No integer value between ${r2} and ${t2} found.`) : new p$_(`Max ${t2} should be greater than min ${r2}.`);
|
|
877
|
+
if (a2 === n2) return a2;
|
|
878
|
+
if (n2 < a2) throw t2 >= r2 ? new p$_(`No integer value between ${r2} and ${t2} found.`) : new p$_(`Max ${t2} should be greater than min ${r2}.`);
|
|
943
879
|
let o2 = this.faker._randomizer.next();
|
|
944
880
|
return Math.floor(o2 * (n2 + 1 - a2) + a2);
|
|
945
881
|
}
|
|
946
882
|
float(e2 = {}) {
|
|
947
883
|
typeof e2 == "number" && (e2 = { max: e2 });
|
|
948
884
|
let { min: r2 = 0, max: t2 = 1, precision: a2 } = e2;
|
|
949
|
-
if (t2 === r2)
|
|
950
|
-
|
|
951
|
-
if (t2 < r2)
|
|
952
|
-
throw new p$_(`Max ${t2} should be greater than min ${r2}.`);
|
|
885
|
+
if (t2 === r2) return r2;
|
|
886
|
+
if (t2 < r2) throw new p$_(`Max ${t2} should be greater than min ${r2}.`);
|
|
953
887
|
if (a2 !== void 0) {
|
|
954
|
-
if (a2 <= 0)
|
|
955
|
-
throw new p$_("Precision should be greater than 0.");
|
|
888
|
+
if (a2 <= 0) throw new p$_("Precision should be greater than 0.");
|
|
956
889
|
let o2 = 1 / a2;
|
|
957
890
|
return this.int({ min: r2 * o2, max: t2 * o2 }) / o2;
|
|
958
891
|
}
|
|
@@ -977,28 +910,23 @@ var z$L = class z extends S$V {
|
|
|
977
910
|
var i2, o2;
|
|
978
911
|
(typeof e2 == "bigint" || typeof e2 == "number" || typeof e2 == "string" || typeof e2 == "boolean") && (e2 = { max: e2 });
|
|
979
912
|
let r2 = BigInt((i2 = e2.min) != null ? i2 : 0), t2 = BigInt((o2 = e2.max) != null ? o2 : r2 + BigInt(999999999999999));
|
|
980
|
-
if (t2 === r2)
|
|
981
|
-
|
|
982
|
-
if (t2 < r2)
|
|
983
|
-
throw new p$_(`Max ${t2} should be larger then min ${r2}.`);
|
|
913
|
+
if (t2 === r2) return r2;
|
|
914
|
+
if (t2 < r2) throw new p$_(`Max ${t2} should be larger then min ${r2}.`);
|
|
984
915
|
let a2 = t2 - r2, n2 = BigInt(this.faker.string.numeric({ length: a2.toString(10).length, allowLeadingZeros: true })) % (a2 + BigInt(1));
|
|
985
916
|
return r2 + n2;
|
|
986
917
|
}
|
|
987
918
|
};
|
|
988
919
|
var H$N = [..."ABCDEFGHIJKLMNOPQRSTUVWXYZ"], V$F = [..."abcdefghijklmnopqrstuvwxyz"], $e$1 = [..."0123456789"], W$G = class W extends S$V {
|
|
989
920
|
fromCharacters(e2, r2 = 1) {
|
|
990
|
-
if (r2 = this.faker.helpers.rangeToNumber(r2), r2 <= 0)
|
|
991
|
-
|
|
992
|
-
if (typeof e2 == "string" && (e2 = [...e2]), e2.length === 0)
|
|
993
|
-
throw new p$_("Unable to generate string: No characters to select from.");
|
|
921
|
+
if (r2 = this.faker.helpers.rangeToNumber(r2), r2 <= 0) return "";
|
|
922
|
+
if (typeof e2 == "string" && (e2 = [...e2]), e2.length === 0) throw new p$_("Unable to generate string: No characters to select from.");
|
|
994
923
|
return this.faker.helpers.multiple(() => this.faker.helpers.arrayElement(e2), { count: r2 }).join("");
|
|
995
924
|
}
|
|
996
925
|
alpha(e2 = {}) {
|
|
997
926
|
var i2;
|
|
998
927
|
typeof e2 == "number" && (e2 = { length: e2 });
|
|
999
928
|
let r2 = this.faker.helpers.rangeToNumber((i2 = e2.length) != null ? i2 : 1);
|
|
1000
|
-
if (r2 <= 0)
|
|
1001
|
-
return "";
|
|
929
|
+
if (r2 <= 0) return "";
|
|
1002
930
|
let { casing: t2 = "mixed" } = e2, { exclude: a2 = [] } = e2;
|
|
1003
931
|
typeof a2 == "string" && (a2 = [...a2]);
|
|
1004
932
|
let n2;
|
|
@@ -1020,8 +948,7 @@ var H$N = [..."ABCDEFGHIJKLMNOPQRSTUVWXYZ"], V$F = [..."abcdefghijklmnopqrstuvwx
|
|
|
1020
948
|
var i2;
|
|
1021
949
|
typeof e2 == "number" && (e2 = { length: e2 });
|
|
1022
950
|
let r2 = this.faker.helpers.rangeToNumber((i2 = e2.length) != null ? i2 : 1);
|
|
1023
|
-
if (r2 <= 0)
|
|
1024
|
-
return "";
|
|
951
|
+
if (r2 <= 0) return "";
|
|
1025
952
|
let { casing: t2 = "mixed" } = e2, { exclude: a2 = [] } = e2;
|
|
1026
953
|
typeof a2 == "string" && (a2 = [...a2]);
|
|
1027
954
|
let n2 = [...$e$1];
|
|
@@ -1052,8 +979,7 @@ var H$N = [..."ABCDEFGHIJKLMNOPQRSTUVWXYZ"], V$F = [..."abcdefghijklmnopqrstuvwx
|
|
|
1052
979
|
hexadecimal(e2 = {}) {
|
|
1053
980
|
var i2;
|
|
1054
981
|
let { casing: r2 = "mixed", prefix: t2 = "0x" } = e2, a2 = this.faker.helpers.rangeToNumber((i2 = e2.length) != null ? i2 : 1);
|
|
1055
|
-
if (a2 <= 0)
|
|
1056
|
-
return t2;
|
|
982
|
+
if (a2 <= 0) return t2;
|
|
1057
983
|
let n2 = this.fromCharacters(["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "A", "B", "C", "D", "E", "F"], a2);
|
|
1058
984
|
return r2 === "upper" ? n2 = n2.toUpperCase() : r2 === "lower" && (n2 = n2.toLowerCase()), `${t2}${n2}`;
|
|
1059
985
|
}
|
|
@@ -1061,29 +987,25 @@ var H$N = [..."ABCDEFGHIJKLMNOPQRSTUVWXYZ"], V$F = [..."abcdefghijklmnopqrstuvwx
|
|
|
1061
987
|
var o2;
|
|
1062
988
|
typeof e2 == "number" && (e2 = { length: e2 });
|
|
1063
989
|
let r2 = this.faker.helpers.rangeToNumber((o2 = e2.length) != null ? o2 : 1);
|
|
1064
|
-
if (r2 <= 0)
|
|
1065
|
-
return "";
|
|
990
|
+
if (r2 <= 0) return "";
|
|
1066
991
|
let { allowLeadingZeros: t2 = true } = e2, { exclude: a2 = [] } = e2;
|
|
1067
992
|
typeof a2 == "string" && (a2 = [...a2]);
|
|
1068
993
|
let n2 = $e$1.filter((l2) => !a2.includes(l2));
|
|
1069
|
-
if (n2.length === 0 || n2.length === 1 && !t2 && n2[0] === "0")
|
|
1070
|
-
throw new p$_("Unable to generate numeric string, because all possible digits are excluded.");
|
|
994
|
+
if (n2.length === 0 || n2.length === 1 && !t2 && n2[0] === "0") throw new p$_("Unable to generate numeric string, because all possible digits are excluded.");
|
|
1071
995
|
let i2 = "";
|
|
1072
996
|
return !t2 && !a2.includes("0") && (i2 += this.faker.helpers.arrayElement(n2.filter((l2) => l2 !== "0"))), i2 += this.fromCharacters(n2, r2 - i2.length), i2;
|
|
1073
997
|
}
|
|
1074
998
|
sample(e2 = 10) {
|
|
1075
999
|
e2 = this.faker.helpers.rangeToNumber(e2);
|
|
1076
1000
|
let r2 = { min: 33, max: 125 }, t2 = "";
|
|
1077
|
-
for (; t2.length < e2; )
|
|
1078
|
-
t2 += String.fromCharCode(this.faker.number.int(r2));
|
|
1001
|
+
for (; t2.length < e2; ) t2 += String.fromCharCode(this.faker.number.int(r2));
|
|
1079
1002
|
return t2;
|
|
1080
1003
|
}
|
|
1081
1004
|
uuid() {
|
|
1082
1005
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/x/g, () => this.faker.number.hex({ min: 0, max: 15 })).replace(/y/g, () => this.faker.number.hex({ min: 8, max: 11 }));
|
|
1083
1006
|
}
|
|
1084
1007
|
nanoid(e2 = 21) {
|
|
1085
|
-
if (e2 = this.faker.helpers.rangeToNumber(e2), e2 <= 0)
|
|
1086
|
-
return "";
|
|
1008
|
+
if (e2 = this.faker.helpers.rangeToNumber(e2), e2 <= 0) return "";
|
|
1087
1009
|
let r2 = [{ value: () => this.alphanumeric(1), weight: 62 }, { value: () => this.faker.helpers.arrayElement(["_", "-"]), weight: 2 }], t2 = "";
|
|
1088
1010
|
for (; t2.length < e2; ) {
|
|
1089
1011
|
let a2 = this.faker.helpers.weightedArrayElement(r2);
|
|
@@ -1120,11 +1042,10 @@ var B$Y = class B {
|
|
|
1120
1042
|
new B$Y();
|
|
1121
1043
|
function Pe$3(s3) {
|
|
1122
1044
|
let e2 = {};
|
|
1123
|
-
for (let r2 of s3)
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
}
|
|
1045
|
+
for (let r2 of s3) for (let t2 in r2) {
|
|
1046
|
+
let a2 = r2[t2];
|
|
1047
|
+
e2[t2] === void 0 ? e2[t2] = { ...a2 } : e2[t2] = { ...a2, ...e2[t2] };
|
|
1048
|
+
}
|
|
1128
1049
|
return e2;
|
|
1129
1050
|
}
|
|
1130
1051
|
var Y$A = class Y extends b$Y {
|
|
@@ -1184,8 +1105,7 @@ var gr = { 0: [[1999999, 2], [2279999, 3], [2289999, 4], [3689999, 3], [3699999,
|
|
|
1184
1105
|
price(e2 = {}, r2 = 1e3, t2 = 2, a2 = "") {
|
|
1185
1106
|
typeof e2 == "number" && (m$T({ deprecated: "faker.commerce.price(min, max, dec, symbol)", proposed: "faker.commerce.price({ min, max, dec, symbol })", since: "8.0", until: "9.0" }), e2 = { min: e2, dec: t2, max: r2, symbol: a2 });
|
|
1186
1107
|
let { dec: n2 = 2, max: i2 = 1e3, min: o2 = 1, symbol: l2 = "" } = e2;
|
|
1187
|
-
if (o2 < 0 || i2 < 0)
|
|
1188
|
-
return `${l2}0`;
|
|
1108
|
+
if (o2 < 0 || i2 < 0) return `${l2}0`;
|
|
1189
1109
|
let c2 = this.faker.number.int({ min: o2, max: i2 });
|
|
1190
1110
|
return l2 + c2.toFixed(n2);
|
|
1191
1111
|
}
|
|
@@ -1205,8 +1125,7 @@ var gr = { 0: [[1999999, 2], [2279999, 3], [2289999, 4], [3689999, 3], [3699999,
|
|
|
1205
1125
|
var A2;
|
|
1206
1126
|
typeof e2 == "number" && (e2 = { variant: e2 });
|
|
1207
1127
|
let { variant: r2 = 13, separator: t2 = "-" } = e2, a2 = "978", [n2, i2] = this.faker.helpers.objectEntry(gr), o2 = this.faker.string.numeric(8), l2 = Number.parseInt(o2.slice(0, -1)), c2 = (A2 = i2.find(([x2]) => l2 <= x2)) == null ? void 0 : A2[1];
|
|
1208
|
-
if (!c2)
|
|
1209
|
-
throw new p$_(`Unable to find a registrant length for the group ${n2}`);
|
|
1128
|
+
if (!c2) throw new p$_(`Unable to find a registrant length for the group ${n2}`);
|
|
1210
1129
|
let u2 = o2.slice(0, c2), h2 = o2.slice(c2), d2 = [a2, n2, u2, h2];
|
|
1211
1130
|
r2 === 10 && d2.shift();
|
|
1212
1131
|
let g2 = d2.join(""), y2 = 0;
|
|
@@ -1283,14 +1202,12 @@ var X$x = class X extends b$Y {
|
|
|
1283
1202
|
};
|
|
1284
1203
|
var yr = { alpha: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"], formats: [{ country: "AL", total: 28, bban: [{ type: "n", count: 8 }, { type: "c", count: 16 }], format: "ALkk bbbs sssx cccc cccc cccc cccc" }, { country: "AD", total: 24, bban: [{ type: "n", count: 8 }, { type: "c", count: 12 }], format: "ADkk bbbb ssss cccc cccc cccc" }, { country: "AT", total: 20, bban: [{ type: "n", count: 5 }, { type: "n", count: 11 }], format: "ATkk bbbb bccc cccc cccc" }, { country: "AZ", total: 28, bban: [{ type: "a", count: 4 }, { type: "n", count: 20 }], format: "AZkk bbbb cccc cccc cccc cccc cccc" }, { country: "BH", total: 22, bban: [{ type: "a", count: 4 }, { type: "c", count: 14 }], format: "BHkk bbbb cccc cccc cccc cc" }, { country: "BE", total: 16, bban: [{ type: "n", count: 3 }, { type: "n", count: 9 }], format: "BEkk bbbc cccc ccxx" }, { country: "BA", total: 20, bban: [{ type: "n", count: 6 }, { type: "n", count: 10 }], format: "BAkk bbbs sscc cccc ccxx" }, { country: "BR", total: 29, bban: [{ type: "n", count: 13 }, { type: "n", count: 10 }, { type: "a", count: 1 }, { type: "c", count: 1 }], format: "BRkk bbbb bbbb ssss sccc cccc ccct n" }, { country: "BG", total: 22, bban: [{ type: "a", count: 4 }, { type: "n", count: 6 }, { type: "c", count: 8 }], format: "BGkk bbbb ssss ddcc cccc cc" }, { country: "CR", total: 22, bban: [{ type: "n", count: 1 }, { type: "n", count: 3 }, { type: "n", count: 14 }], format: "CRkk xbbb cccc cccc cccc cc" }, { country: "HR", total: 21, bban: [{ type: "n", count: 7 }, { type: "n", count: 10 }], format: "HRkk bbbb bbbc cccc cccc c" }, { country: "CY", total: 28, bban: [{ type: "n", count: 8 }, { type: "c", count: 16 }], format: "CYkk bbbs ssss cccc cccc cccc cccc" }, { country: "CZ", total: 24, bban: [{ type: "n", count: 10 }, { type: "n", count: 10 }], format: "CZkk bbbb ssss sscc cccc cccc" }, { country: "DK", total: 18, bban: [{ type: "n", count: 4 }, { type: "n", count: 10 }], format: "DKkk bbbb cccc cccc cc" }, { country: "DO", total: 28, bban: [{ type: "a", count: 4 }, { type: "n", count: 20 }], format: "DOkk bbbb cccc cccc cccc cccc cccc" }, { country: "TL", total: 23, bban: [{ type: "n", count: 3 }, { type: "n", count: 16 }], format: "TLkk bbbc cccc cccc cccc cxx" }, { country: "EE", total: 20, bban: [{ type: "n", count: 4 }, { type: "n", count: 12 }], format: "EEkk bbss cccc cccc cccx" }, { country: "FO", total: 18, bban: [{ type: "n", count: 4 }, { type: "n", count: 10 }], format: "FOkk bbbb cccc cccc cx" }, { country: "FI", total: 18, bban: [{ type: "n", count: 6 }, { type: "n", count: 8 }], format: "FIkk bbbb bbcc cccc cx" }, { country: "FR", total: 27, bban: [{ type: "n", count: 10 }, { type: "c", count: 11 }, { type: "n", count: 2 }], format: "FRkk bbbb bggg ggcc cccc cccc cxx" }, { country: "GE", total: 22, bban: [{ type: "a", count: 2 }, { type: "n", count: 16 }], format: "GEkk bbcc cccc cccc cccc cc" }, { country: "DE", total: 22, bban: [{ type: "n", count: 8 }, { type: "n", count: 10 }], format: "DEkk bbbb bbbb cccc cccc cc" }, { country: "GI", total: 23, bban: [{ type: "a", count: 4 }, { type: "c", count: 15 }], format: "GIkk bbbb cccc cccc cccc ccc" }, { country: "GR", total: 27, bban: [{ type: "n", count: 7 }, { type: "c", count: 16 }], format: "GRkk bbbs sssc cccc cccc cccc ccc" }, { country: "GL", total: 18, bban: [{ type: "n", count: 4 }, { type: "n", count: 10 }], format: "GLkk bbbb cccc cccc cc" }, { country: "GT", total: 28, bban: [{ type: "c", count: 4 }, { type: "c", count: 4 }, { type: "c", count: 16 }], format: "GTkk bbbb mmtt cccc cccc cccc cccc" }, { country: "HU", total: 28, bban: [{ type: "n", count: 8 }, { type: "n", count: 16 }], format: "HUkk bbbs sssk cccc cccc cccc cccx" }, { country: "IS", total: 26, bban: [{ type: "n", count: 6 }, { type: "n", count: 16 }], format: "ISkk bbbb sscc cccc iiii iiii ii" }, { country: "IE", total: 22, bban: [{ type: "c", count: 4 }, { type: "n", count: 6 }, { type: "n", count: 8 }], format: "IEkk aaaa bbbb bbcc cccc cc" }, { country: "IL", total: 23, bban: [{ type: "n", count: 6 }, { type: "n", count: 13 }], format: "ILkk bbbn nncc cccc cccc ccc" }, { country: "IT", total: 27, bban: [{ type: "a", count: 1 }, { type: "n", count: 10 }, { type: "c", count: 12 }], format: "ITkk xaaa aabb bbbc cccc cccc ccc" }, { country: "JO", total: 30, bban: [{ type: "a", count: 4 }, { type: "n", count: 4 }, { type: "n", count: 18 }], format: "JOkk bbbb nnnn cccc cccc cccc cccc cc" }, { country: "KZ", total: 20, bban: [{ type: "n", count: 3 }, { type: "c", count: 13 }], format: "KZkk bbbc cccc cccc cccc" }, { country: "XK", total: 20, bban: [{ type: "n", count: 4 }, { type: "n", count: 12 }], format: "XKkk bbbb cccc cccc cccc" }, { country: "KW", total: 30, bban: [{ type: "a", count: 4 }, { type: "c", count: 22 }], format: "KWkk bbbb cccc cccc cccc cccc cccc cc" }, { country: "LV", total: 21, bban: [{ type: "a", count: 4 }, { type: "c", count: 13 }], format: "LVkk bbbb cccc cccc cccc c" }, { country: "LB", total: 28, bban: [{ type: "n", count: 4 }, { type: "c", count: 20 }], format: "LBkk bbbb cccc cccc cccc cccc cccc" }, { country: "LI", total: 21, bban: [{ type: "n", count: 5 }, { type: "c", count: 12 }], format: "LIkk bbbb bccc cccc cccc c" }, { country: "LT", total: 20, bban: [{ type: "n", count: 5 }, { type: "n", count: 11 }], format: "LTkk bbbb bccc cccc cccc" }, { country: "LU", total: 20, bban: [{ type: "n", count: 3 }, { type: "c", count: 13 }], format: "LUkk bbbc cccc cccc cccc" }, { country: "MK", total: 19, bban: [{ type: "n", count: 3 }, { type: "c", count: 10 }, { type: "n", count: 2 }], format: "MKkk bbbc cccc cccc cxx" }, { country: "MT", total: 31, bban: [{ type: "a", count: 4 }, { type: "n", count: 5 }, { type: "c", count: 18 }], format: "MTkk bbbb ssss sccc cccc cccc cccc ccc" }, { country: "MR", total: 27, bban: [{ type: "n", count: 10 }, { type: "n", count: 13 }], format: "MRkk bbbb bsss sscc cccc cccc cxx" }, { country: "MU", total: 30, bban: [{ type: "a", count: 4 }, { type: "n", count: 4 }, { type: "n", count: 15 }, { type: "a", count: 3 }], format: "MUkk bbbb bbss cccc cccc cccc 000d dd" }, { country: "MC", total: 27, bban: [{ type: "n", count: 10 }, { type: "c", count: 11 }, { type: "n", count: 2 }], format: "MCkk bbbb bsss sscc cccc cccc cxx" }, { country: "MD", total: 24, bban: [{ type: "c", count: 2 }, { type: "c", count: 18 }], format: "MDkk bbcc cccc cccc cccc cccc" }, { country: "ME", total: 22, bban: [{ type: "n", count: 3 }, { type: "n", count: 15 }], format: "MEkk bbbc cccc cccc cccc xx" }, { country: "NL", total: 18, bban: [{ type: "a", count: 4 }, { type: "n", count: 10 }], format: "NLkk bbbb cccc cccc cc" }, { country: "NO", total: 15, bban: [{ type: "n", count: 4 }, { type: "n", count: 7 }], format: "NOkk bbbb cccc ccx" }, { country: "PK", total: 24, bban: [{ type: "a", count: 4 }, { type: "n", count: 16 }], format: "PKkk bbbb cccc cccc cccc cccc" }, { country: "PS", total: 29, bban: [{ type: "c", count: 4 }, { type: "n", count: 9 }, { type: "n", count: 12 }], format: "PSkk bbbb xxxx xxxx xccc cccc cccc c" }, { country: "PL", total: 28, bban: [{ type: "n", count: 8 }, { type: "n", count: 16 }], format: "PLkk bbbs sssx cccc cccc cccc cccc" }, { country: "PT", total: 25, bban: [{ type: "n", count: 8 }, { type: "n", count: 13 }], format: "PTkk bbbb ssss cccc cccc cccx x" }, { country: "QA", total: 29, bban: [{ type: "a", count: 4 }, { type: "c", count: 21 }], format: "QAkk bbbb cccc cccc cccc cccc cccc c" }, { country: "RO", total: 24, bban: [{ type: "a", count: 4 }, { type: "c", count: 16 }], format: "ROkk bbbb cccc cccc cccc cccc" }, { country: "SM", total: 27, bban: [{ type: "a", count: 1 }, { type: "n", count: 10 }, { type: "c", count: 12 }], format: "SMkk xaaa aabb bbbc cccc cccc ccc" }, { country: "SA", total: 24, bban: [{ type: "n", count: 2 }, { type: "c", count: 18 }], format: "SAkk bbcc cccc cccc cccc cccc" }, { country: "RS", total: 22, bban: [{ type: "n", count: 3 }, { type: "n", count: 15 }], format: "RSkk bbbc cccc cccc cccc xx" }, { country: "SK", total: 24, bban: [{ type: "n", count: 10 }, { type: "n", count: 10 }], format: "SKkk bbbb ssss sscc cccc cccc" }, { country: "SI", total: 19, bban: [{ type: "n", count: 5 }, { type: "n", count: 10 }], format: "SIkk bbss sccc cccc cxx" }, { country: "ES", total: 24, bban: [{ type: "n", count: 10 }, { type: "n", count: 10 }], format: "ESkk bbbb gggg xxcc cccc cccc" }, { country: "SE", total: 24, bban: [{ type: "n", count: 3 }, { type: "n", count: 17 }], format: "SEkk bbbc cccc cccc cccc cccc" }, { country: "CH", total: 21, bban: [{ type: "n", count: 5 }, { type: "c", count: 12 }], format: "CHkk bbbb bccc cccc cccc c" }, { country: "TN", total: 24, bban: [{ type: "n", count: 5 }, { type: "n", count: 15 }], format: "TNkk bbss sccc cccc cccc cccc" }, { country: "TR", total: 26, bban: [{ type: "n", count: 5 }, { type: "n", count: 1 }, { type: "n", count: 16 }], format: "TRkk bbbb bxcc cccc cccc cccc cc" }, { country: "AE", total: 23, bban: [{ type: "n", count: 3 }, { type: "n", count: 16 }], format: "AEkk bbbc cccc cccc cccc ccc" }, { country: "GB", total: 22, bban: [{ type: "a", count: 4 }, { type: "n", count: 6 }, { type: "n", count: 8 }], format: "GBkk bbbb ssss sscc cccc cc" }, { country: "VG", total: 24, bban: [{ type: "c", count: 4 }, { type: "n", count: 16 }], format: "VGkk bbbb cccc cccc cccc cccc" }], iso3166: ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"], mod97: (s3) => {
|
|
1285
1204
|
let e2 = 0;
|
|
1286
|
-
for (let r2 of s3)
|
|
1287
|
-
e2 = (e2 * 10 + +r2) % 97;
|
|
1205
|
+
for (let r2 of s3) e2 = (e2 * 10 + +r2) % 97;
|
|
1288
1206
|
return e2;
|
|
1289
1207
|
}, pattern10: ["01", "02", "03", "04", "05", "06", "07", "08", "09"], pattern100: ["001", "002", "003", "004", "005", "006", "007", "008", "009"], toDigitString: (s3) => s3.replace(/[A-Z]/gi, (e2) => String(e2.toUpperCase().charCodeAt(0) - 55)) }, T$P = yr;
|
|
1290
1208
|
function kr(s3) {
|
|
1291
1209
|
let e2 = "";
|
|
1292
|
-
for (let r2 = 0; r2 < s3.length; r2 += 4)
|
|
1293
|
-
e2 += `${s3.substring(r2, r2 + 4)} `;
|
|
1210
|
+
for (let r2 = 0; r2 < s3.length; r2 += 4) e2 += `${s3.substring(r2, r2 + 4)} `;
|
|
1294
1211
|
return e2.trimEnd();
|
|
1295
1212
|
}
|
|
1296
1213
|
var Q$A = class Q extends b$Y {
|
|
@@ -1307,8 +1224,7 @@ var Q$A = class Q extends b$Y {
|
|
|
1307
1224
|
}
|
|
1308
1225
|
routingNumber() {
|
|
1309
1226
|
let e2 = this.faker.string.numeric({ length: 8, allowLeadingZeros: true }), r2 = 0;
|
|
1310
|
-
for (let t2 = 0; t2 < e2.length; t2 += 3)
|
|
1311
|
-
r2 += Number(e2[t2]) * 3, r2 += Number(e2[t2 + 1]) * 7, r2 += Number(e2[t2 + 2]) || 0;
|
|
1227
|
+
for (let t2 = 0; t2 < e2.length; t2 += 3) r2 += Number(e2[t2]) * 3, r2 += Number(e2[t2 + 1]) * 7, r2 += Number(e2[t2 + 2]) || 0;
|
|
1312
1228
|
return `${e2}${Math.ceil(r2 / 10) * 10 - r2}`;
|
|
1313
1229
|
}
|
|
1314
1230
|
mask(e2, r2, t2) {
|
|
@@ -1354,10 +1270,8 @@ var Q$A = class Q extends b$Y {
|
|
|
1354
1270
|
creditCardNumber(e2 = {}) {
|
|
1355
1271
|
typeof e2 == "string" && (e2 = { issuer: e2 });
|
|
1356
1272
|
let { issuer: r2 = "" } = e2, t2, a2 = this.faker.definitions.finance.credit_card, n2 = r2.toLowerCase();
|
|
1357
|
-
if (n2 in a2)
|
|
1358
|
-
|
|
1359
|
-
else if (r2.includes("#"))
|
|
1360
|
-
t2 = r2;
|
|
1273
|
+
if (n2 in a2) t2 = this.faker.helpers.arrayElement(a2[n2]);
|
|
1274
|
+
else if (r2.includes("#")) t2 = r2;
|
|
1361
1275
|
else {
|
|
1362
1276
|
let i2 = this.faker.helpers.objectValue(a2);
|
|
1363
1277
|
t2 = this.faker.helpers.arrayElement(i2);
|
|
@@ -1373,8 +1287,7 @@ var Q$A = class Q extends b$Y {
|
|
|
1373
1287
|
pin(e2 = {}) {
|
|
1374
1288
|
typeof e2 == "number" && (e2 = { length: e2 });
|
|
1375
1289
|
let { length: r2 = 4 } = e2;
|
|
1376
|
-
if (r2 < 1)
|
|
1377
|
-
throw new p$_("minimum length is 1");
|
|
1290
|
+
if (r2 < 1) throw new p$_("minimum length is 1");
|
|
1378
1291
|
return this.faker.string.numeric({ length: r2, allowLeadingZeros: true });
|
|
1379
1292
|
}
|
|
1380
1293
|
ethereumAddress() {
|
|
@@ -1383,13 +1296,11 @@ var Q$A = class Q extends b$Y {
|
|
|
1383
1296
|
iban(e2 = {}, r2) {
|
|
1384
1297
|
typeof e2 == "boolean" && (e2 = { formatted: e2 });
|
|
1385
1298
|
let { countryCode: t2 = r2, formatted: a2 = false } = e2, n2 = t2 ? T$P.formats.find((u2) => u2.country === t2) : this.faker.helpers.arrayElement(T$P.formats);
|
|
1386
|
-
if (!n2)
|
|
1387
|
-
throw new p$_(`Country code ${t2} not supported.`);
|
|
1299
|
+
if (!n2) throw new p$_(`Country code ${t2} not supported.`);
|
|
1388
1300
|
let i2 = "", o2 = 0;
|
|
1389
1301
|
for (let u2 of n2.bban) {
|
|
1390
1302
|
let h2 = u2.count;
|
|
1391
|
-
for (o2 += u2.count; h2 > 0; )
|
|
1392
|
-
u2.type === "a" ? i2 += this.faker.helpers.arrayElement(T$P.alpha) : u2.type === "c" ? this.faker.datatype.boolean(0.8) ? i2 += this.faker.number.int(9) : i2 += this.faker.helpers.arrayElement(T$P.alpha) : h2 >= 3 && this.faker.datatype.boolean(0.3) ? this.faker.datatype.boolean() ? (i2 += this.faker.helpers.arrayElement(T$P.pattern100), h2 -= 2) : (i2 += this.faker.helpers.arrayElement(T$P.pattern10), h2--) : i2 += this.faker.number.int(9), h2--;
|
|
1303
|
+
for (o2 += u2.count; h2 > 0; ) u2.type === "a" ? i2 += this.faker.helpers.arrayElement(T$P.alpha) : u2.type === "c" ? this.faker.datatype.boolean(0.8) ? i2 += this.faker.number.int(9) : i2 += this.faker.helpers.arrayElement(T$P.alpha) : h2 >= 3 && this.faker.datatype.boolean(0.3) ? this.faker.datatype.boolean() ? (i2 += this.faker.helpers.arrayElement(T$P.pattern100), h2 -= 2) : (i2 += this.faker.helpers.arrayElement(T$P.pattern10), h2--) : i2 += this.faker.number.int(9), h2--;
|
|
1393
1304
|
i2 = i2.substring(0, o2);
|
|
1394
1305
|
}
|
|
1395
1306
|
let l2 = 98 - T$P.mod97(T$P.toDigitString(`${i2}${n2.country}00`));
|
|
@@ -1482,8 +1393,7 @@ var re$9 = class re {
|
|
|
1482
1393
|
var te$8 = class s {
|
|
1483
1394
|
constructor(e2) {
|
|
1484
1395
|
this.faker = e2;
|
|
1485
|
-
for (let r2 of Object.getOwnPropertyNames(s.prototype))
|
|
1486
|
-
r2 === "constructor" || typeof this[r2] != "function" || (this[r2] = this[r2].bind(this));
|
|
1396
|
+
for (let r2 of Object.getOwnPropertyNames(s.prototype)) r2 === "constructor" || typeof this[r2] != "function" || (this[r2] = this[r2].bind(this));
|
|
1487
1397
|
}
|
|
1488
1398
|
imageUrl(e2, r2, t2, a2, n2, i2) {
|
|
1489
1399
|
m$T({ deprecated: "faker.placeholder.imageUrl", proposed: "faker.image.urlPlaceholder", since: "8.0", until: "9.0" }), e2 = e2 || 640, r2 = r2 || e2;
|
|
@@ -1623,8 +1533,7 @@ function Be$2(s3) {
|
|
|
1623
1533
|
return [u2, h2];
|
|
1624
1534
|
}, t2 = (c2) => s3.helpers.arrayElement({ lin: ["i686", "x86_64"], mac: ["Intel", "PPC", "U; Intel", "U; PPC"], win: ["", "WOW64", "Win64; x64"] }[c2]), a2 = (c2) => {
|
|
1625
1535
|
let u2 = "";
|
|
1626
|
-
for (let h2 = 0; h2 < c2; h2++)
|
|
1627
|
-
u2 += `.${s3.string.numeric({ allowLeadingZeros: true })}`;
|
|
1536
|
+
for (let h2 = 0; h2 < c2; h2++) u2 += `.${s3.string.numeric({ allowLeadingZeros: true })}`;
|
|
1628
1537
|
return u2;
|
|
1629
1538
|
}, n2 = { net() {
|
|
1630
1539
|
return [s3.number.int({ min: 1, max: 4 }), s3.number.int(9), s3.number.int({ min: 1e4, max: 99999 }), s3.number.int(9)].join(".");
|
|
@@ -1764,14 +1673,12 @@ var ie$9 = class ie extends b$Y {
|
|
|
1764
1673
|
mac(e2 = {}) {
|
|
1765
1674
|
typeof e2 == "string" && (e2 = { separator: e2 });
|
|
1766
1675
|
let { separator: r2 = ":" } = e2, t2, a2 = "";
|
|
1767
|
-
for ([":", "-", ""].includes(r2) || (r2 = ":"), t2 = 0; t2 < 12; t2++)
|
|
1768
|
-
a2 += this.faker.number.hex(15), t2 % 2 === 1 && t2 !== 11 && (a2 += r2);
|
|
1676
|
+
for ([":", "-", ""].includes(r2) || (r2 = ":"), t2 = 0; t2 < 12; t2++) a2 += this.faker.number.hex(15), t2 % 2 === 1 && t2 !== 11 && (a2 += r2);
|
|
1769
1677
|
return a2;
|
|
1770
1678
|
}
|
|
1771
1679
|
password(e2 = {}, r2, t2, a2) {
|
|
1772
1680
|
let n2 = /[aeiouAEIOU]$/, i2 = /[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ]$/, o2 = (d2, g2, y2, A2) => {
|
|
1773
|
-
if (A2.length >= d2)
|
|
1774
|
-
return A2;
|
|
1681
|
+
if (A2.length >= d2) return A2;
|
|
1775
1682
|
g2 && (y2 = i2.test(A2) ? n2 : i2);
|
|
1776
1683
|
let x2 = this.faker.number.int(94) + 33, w2 = String.fromCharCode(x2);
|
|
1777
1684
|
return g2 && (w2 = w2.toLowerCase()), y2.test(w2) ? o2(d2, g2, y2, A2 + w2) : o2(d2, g2, y2, A2);
|
|
@@ -1791,8 +1698,7 @@ var se$7 = class se extends b$Y {
|
|
|
1791
1698
|
let { state: r2 } = e2;
|
|
1792
1699
|
if (r2) {
|
|
1793
1700
|
let a2 = this.faker.definitions.location.postcode_by_state[r2];
|
|
1794
|
-
if (a2)
|
|
1795
|
-
return this.faker.helpers.fake(a2);
|
|
1701
|
+
if (a2) return this.faker.helpers.fake(a2);
|
|
1796
1702
|
throw new p$_(`No zip code definition found for state "${r2}"`);
|
|
1797
1703
|
}
|
|
1798
1704
|
let { format: t2 = this.faker.definitions.location.postcode } = e2;
|
|
@@ -1882,8 +1788,7 @@ var se$7 = class se extends b$Y {
|
|
|
1882
1788
|
nearbyGPSCoordinate(e2 = {}, r2 = 10, t2 = false) {
|
|
1883
1789
|
Array.isArray(e2) && (m$T({ deprecated: "faker.location.nearbyGPSCoordinate(coordinate, radius, isMetric)", proposed: "faker.location.nearbyGPSCoordinate({ origin, radius, isMetric })", since: "8.0", until: "9.0" }), e2 = { origin: e2 });
|
|
1884
1790
|
let { origin: a2, radius: n2 = r2, isMetric: i2 = t2 } = e2;
|
|
1885
|
-
if (a2 == null)
|
|
1886
|
-
return [this.latitude(), this.longitude()];
|
|
1791
|
+
if (a2 == null) return [this.latitude(), this.longitude()];
|
|
1887
1792
|
let o2 = this.faker.number.float({ max: 2 * Math.PI, precision: 1e-5 }), l2 = i2 ? n2 : n2 * 1.60934, c2 = 0.995, u2 = this.faker.number.float({ max: l2, precision: 1e-3 }) * c2, h2 = 4e4 / 360, d2 = u2 / h2, g2 = [a2[0] + Math.sin(o2) * d2, a2[1] + Math.cos(o2) * d2];
|
|
1888
1793
|
return g2[0] = g2[0] % 180, (g2[0] < -90 || g2[0] > 90) && (g2[0] = Math.sign(g2[0]) * 180 - g2[0], g2[1] += 180), g2[1] = (g2[1] % 360 + 540) % 360 - 180, [g2[0], g2[1]];
|
|
1889
1794
|
}
|
|
@@ -1916,8 +1821,7 @@ function M$X(s3) {
|
|
|
1916
1821
|
if (r2) {
|
|
1917
1822
|
let a2 = typeof r2 == "number" ? (i2) => i2.length === r2 : (i2) => i2.length >= r2.min && i2.length <= r2.max, n2 = e2.filter(a2);
|
|
1918
1823
|
return n2.length > 0 ? n2 : typeof r2 == "number" ? ye$4[t2](e2, { min: r2, max: r2 }) : ye$4[t2](e2, r2);
|
|
1919
|
-
} else if (t2 === "shortest" || t2 === "longest")
|
|
1920
|
-
return ye$4[t2](e2);
|
|
1824
|
+
} else if (t2 === "shortest" || t2 === "longest") return ye$4[t2](e2);
|
|
1921
1825
|
return [...e2];
|
|
1922
1826
|
}
|
|
1923
1827
|
var oe$9 = class oe extends b$Y {
|
|
@@ -1980,8 +1884,7 @@ var me$7 = class me extends b$Y {
|
|
|
1980
1884
|
try {
|
|
1981
1885
|
t2 = n2();
|
|
1982
1886
|
} catch {
|
|
1983
|
-
if (a2++, a2 > 100)
|
|
1984
|
-
throw new p$_("No matching word data available for the current locale");
|
|
1887
|
+
if (a2++, a2 > 100) throw new p$_("No matching word data available for the current locale");
|
|
1985
1888
|
continue;
|
|
1986
1889
|
}
|
|
1987
1890
|
} while (!t2 || r2.some((n2) => t2.includes(n2)));
|
|
@@ -2035,8 +1938,7 @@ var Mr = ["video", "audio", "image", "text", "application"], Dr = ["application/
|
|
|
2035
1938
|
}
|
|
2036
1939
|
fileExt(e2) {
|
|
2037
1940
|
let r2 = this.faker.definitions.system.mimeTypes;
|
|
2038
|
-
if (typeof e2 == "string")
|
|
2039
|
-
return this.faker.helpers.arrayElement(r2[e2].extensions);
|
|
1941
|
+
if (typeof e2 == "string") return this.faker.helpers.arrayElement(r2[e2].extensions);
|
|
2040
1942
|
let t2 = new Set(Object.values(r2).flatMap(({ extensions: a2 }) => a2));
|
|
2041
1943
|
return this.faker.helpers.arrayElement([...t2]);
|
|
2042
1944
|
}
|
|
@@ -2137,12 +2039,11 @@ var fe$5 = class fe extends b$Y {
|
|
|
2137
2039
|
}
|
|
2138
2040
|
sample(e2 = {}) {
|
|
2139
2041
|
let r2 = this.faker.helpers.shuffle([this.adjective, this.adverb, this.conjunction, this.interjection, this.noun, this.preposition, this.verb]);
|
|
2140
|
-
for (let t2 of r2)
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
}
|
|
2042
|
+
for (let t2 of r2) try {
|
|
2043
|
+
return t2(e2);
|
|
2044
|
+
} catch {
|
|
2045
|
+
continue;
|
|
2046
|
+
}
|
|
2146
2047
|
throw new p$_("No matching word data available for the current locale");
|
|
2147
2048
|
}
|
|
2148
2049
|
words(e2 = {}) {
|
|
@@ -2187,8 +2088,7 @@ var _e$3 = class _e extends B$Y {
|
|
|
2187
2088
|
}
|
|
2188
2089
|
let { locale: a2 } = r2;
|
|
2189
2090
|
if (Array.isArray(a2)) {
|
|
2190
|
-
if (a2.length === 0)
|
|
2191
|
-
throw new p$_("The locale option must contain at least one locale definition.");
|
|
2091
|
+
if (a2.length === 0) throw new p$_("The locale option must contain at least one locale definition.");
|
|
2192
2092
|
a2 = Pe$3(a2);
|
|
2193
2093
|
}
|
|
2194
2094
|
this.rawDefinitions = a2, this.definitions = Te$2(this.rawDefinitions);
|