@stoker-platform/node-client 0.5.1 → 0.5.2
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/bundle.cjs +6 -6
- package/dist/bundle.js +684 -672
- package/dist/types/initializeStoker.d.ts +2 -2
- package/dist/types/main.d.ts +1 -1
- package/package.json +3 -3
package/dist/bundle.js
CHANGED
|
@@ -1,52 +1,20 @@
|
|
|
1
|
-
import { spawn as Uo } from "node:child_process";
|
|
2
|
-
import { getApp as ei, initializeApp as ti, applicationDefault as ni } from "firebase-admin/app";
|
|
3
1
|
import ze from "lodash/isEqual.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import Uo from "lodash/merge.js";
|
|
3
|
+
import Wo from "lodash/set.js";
|
|
6
4
|
import ye from "lodash/cloneDeep.js";
|
|
5
|
+
import { getApp as ti, initializeApp as ni, applicationDefault as si } from "firebase-admin/app";
|
|
7
6
|
import { getFirestore as ue, Timestamp as lt, FieldValue as me } from "firebase-admin/firestore";
|
|
8
|
-
import {
|
|
7
|
+
import { spawn as jo } from "node:child_process";
|
|
8
|
+
import { getDatabase as ri } from "firebase-admin/database";
|
|
9
9
|
import { getAuth as gt } from "firebase-admin/auth";
|
|
10
|
-
const
|
|
11
|
-
const o = Uo(n, e, { cwd: t || process.cwd(), env: { ...process.env, ...s } });
|
|
12
|
-
let a = "";
|
|
13
|
-
const l = () => {
|
|
14
|
-
o.kill("SIGINT");
|
|
15
|
-
}, c = () => {
|
|
16
|
-
o.kill("SIGTERM");
|
|
17
|
-
}, u = () => {
|
|
18
|
-
process.removeListener("SIGINT", l), process.removeListener("SIGTERM", c);
|
|
19
|
-
};
|
|
20
|
-
o.stdout.on("data", (h) => {
|
|
21
|
-
a += h.toString(), console.log(h.toString());
|
|
22
|
-
}), o.stderr.on("data", (h) => {
|
|
23
|
-
console.log(h.toString());
|
|
24
|
-
}), o.on("exit", (h) => {
|
|
25
|
-
u(), h === 0 ? r(a) : i();
|
|
26
|
-
}), process.on("SIGINT", l), process.on("SIGTERM", c);
|
|
27
|
-
}), ru = async () => {
|
|
28
|
-
const n = process.env.STOKER_FB_WEB_APP_CONFIG;
|
|
29
|
-
if (!n)
|
|
30
|
-
throw new Error("Firebase web app config not found");
|
|
31
|
-
const e = JSON.parse(n);
|
|
32
|
-
try {
|
|
33
|
-
return ei();
|
|
34
|
-
} catch {
|
|
35
|
-
return ti({
|
|
36
|
-
credential: ni(),
|
|
37
|
-
databaseURL: e.databaseURL,
|
|
38
|
-
storageBucket: e.storageBucket,
|
|
39
|
-
projectId: e.projectId
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}, Wn = (n) => !!n.auth, Te = (n, e) => {
|
|
10
|
+
const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
43
11
|
if (e?.operations)
|
|
44
12
|
return e.operations.includes(n);
|
|
45
|
-
},
|
|
13
|
+
}, Zn = (n, e) => e ? e.Role ? n.access?.includes(e.Role) : !1 : !0, Zo = (n, e) => n.restrictCreate === !0 ? !1 : e && typeof n.restrictCreate == "object" ? e.Role ? n.restrictCreate?.includes(e.Role) : !1 : !0, ii = (n, e) => n.restrictUpdate === !0 ? !1 : e && typeof n.restrictUpdate == "object" ? e.Role ? n.restrictUpdate?.includes(e.Role) : !1 : !0, rr = (n, e, t) => {
|
|
46
14
|
const { labels: s } = n;
|
|
47
15
|
return t.collections && // eslint-disable-next-line security/detect-object-injection
|
|
48
|
-
Te("Update", t.collections[s.collection]) && (!e.access ||
|
|
49
|
-
}, W = (n, e) => n.filter((t) => t.name === e)[0], K = (n) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(n.type),
|
|
16
|
+
Te("Update", t.collections[s.collection]) && (!e.access || Zn(e, t)) && ii(e, t) && !(n.auth && !t.collections?.[s.collection].auth && ["Enabled", "Role", "Name", "Email", "Photo_URL"].includes(e.name));
|
|
17
|
+
}, W = (n, e) => n.filter((t) => t.name === e)[0], K = (n) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(n.type), oi = (n, e) => {
|
|
50
18
|
const t = {
|
|
51
19
|
Record_Owner: "recordOwner",
|
|
52
20
|
Record_User: "recordUser",
|
|
@@ -58,14 +26,14 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
58
26
|
c.role === e.Role && (!c.assignable || u?.active) && s.push(l);
|
|
59
27
|
});
|
|
60
28
|
}), s;
|
|
61
|
-
},
|
|
29
|
+
}, Ls = (n, e) => {
|
|
62
30
|
const t = [], { labels: s, access: r } = n, { entityRestrictions: i } = r, o = e.collections?.[s.collection];
|
|
63
31
|
return i?.restrictions?.forEach((a) => {
|
|
64
32
|
"roles" in a && a.roles.forEach((l) => {
|
|
65
33
|
l.role === e.Role && (!i.assignable?.includes(e.Role) || o?.restrictEntities) && t.push(a);
|
|
66
34
|
});
|
|
67
35
|
}), t;
|
|
68
|
-
},
|
|
36
|
+
}, ai = (n, e, t) => {
|
|
69
37
|
const s = [], { access: r } = n, { entityRestrictions: i } = r;
|
|
70
38
|
return i?.parentFilters?.forEach((o) => {
|
|
71
39
|
if (!o.roles.some((d) => d.role === t.Role))
|
|
@@ -83,12 +51,12 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
83
51
|
d.role === t.Role && (!h.assignable?.includes(t.Role) || c?.restrictEntities) && s.push({ parentFilter: o, parentRestriction: f });
|
|
84
52
|
});
|
|
85
53
|
}), s;
|
|
86
|
-
},
|
|
54
|
+
}, li = (n, e, t) => {
|
|
87
55
|
const s = Object.values(e.collections), { labels: r } = n, i = [];
|
|
88
56
|
for (const o of s) {
|
|
89
57
|
const { fields: a } = o;
|
|
90
58
|
for (const l of a)
|
|
91
|
-
if (!(l.access && !
|
|
59
|
+
if (!(l.access && !Zn(l, t)) && t.Role && K(l) && l.collection === r.collection && l.dependencyFields)
|
|
92
60
|
for (const c of l.dependencyFields)
|
|
93
61
|
!i.find((h) => h.field === c.field) && c.roles.includes(t.Role) && i.push(c);
|
|
94
62
|
}
|
|
@@ -100,7 +68,7 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
100
68
|
l = !1;
|
|
101
69
|
return;
|
|
102
70
|
}
|
|
103
|
-
const c =
|
|
71
|
+
const c = oi(e, r), u = Ls(e, r), h = ai(e, t, r);
|
|
104
72
|
c?.filter((p) => p.type === "Record_Owner").forEach((p) => {
|
|
105
73
|
"operations" in p && p.operations && !p.operations.includes(n) || i.Created_By !== s && (l = !1);
|
|
106
74
|
}), c?.filter((p) => p.type === "Record_User").forEach((p) => {
|
|
@@ -185,9 +153,9 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
185
153
|
if (!a || !r.Role)
|
|
186
154
|
return l = !1, l;
|
|
187
155
|
Te(n, a) || (l = !1);
|
|
188
|
-
const u =
|
|
156
|
+
const u = Ls(e, r)?.filter((h) => h.type === "Individual").length > 0;
|
|
189
157
|
return n === "Create" && u && (l = !1), zo(n, e, t, s, r, i) || (l = !1), l;
|
|
190
|
-
},
|
|
158
|
+
}, ci = (n, e, t) => {
|
|
191
159
|
const { labels: s } = n, r = [];
|
|
192
160
|
for (const i of Object.values(e.collections))
|
|
193
161
|
;
|
|
@@ -414,7 +382,7 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
414
382
|
let r = !0, i = "";
|
|
415
383
|
return Object.values(n.collections).forEach((o) => {
|
|
416
384
|
const a = t.collections?.[o.labels.collection], l = s?.collections?.[o.labels.collection], c = e?.collections?.[o.labels.collection];
|
|
417
|
-
if (a?.auth && !l?.auth && !
|
|
385
|
+
if (a?.auth && !l?.auth && !jn(c)) {
|
|
418
386
|
i = `User does not have auth access to collection ${o.labels.collection}`, r = !1;
|
|
419
387
|
return;
|
|
420
388
|
}
|
|
@@ -440,7 +408,7 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
440
408
|
return;
|
|
441
409
|
}
|
|
442
410
|
}), i && console.error(`PERMISSION_DENIED: ${i}`), r;
|
|
443
|
-
},
|
|
411
|
+
}, Vs = (n, e, t, s, r, i, o, a, l, c, u) => {
|
|
444
412
|
const { labels: h } = s;
|
|
445
413
|
let f = !0, d = "";
|
|
446
414
|
if (!e.Role)
|
|
@@ -462,23 +430,23 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
462
430
|
return d = "User cannot delete their own record", f = !1, f;
|
|
463
431
|
}
|
|
464
432
|
return n === "delete" || u === "delete" || !a ? f : a.Role ? (qo(r, a) || (f = !1), a.Collection && a.Collection !== h.collection ? (d = "Permissions collection does not match record collection", f = !1, f) : a.Role !== e.Role ? (d = "Permissions role does not match record role", f = !1, f) : a.Enabled !== void 0 && !!a.Enabled != !!e.Enabled ? (d = "Permissions enabled state does not match record enabled state", f = !1, f) : a.Doc_ID && a.Doc_ID !== t ? (d = "Permissions doc ID does not match record doc ID", f = !1, f) : !Bo(r, a, a.Role) || i && o && l && !Go(r, o, a, l) ? (f = !1, f) : (d && console.error(`PERMISSION_DENIED: ${d}`), f)) : (d = "Permissions do not have a role", f = !1, f);
|
|
465
|
-
},
|
|
433
|
+
}, ir = (n, e, t, s, r, i, o) => {
|
|
466
434
|
const { labels: a, fields: l } = t, c = i?.collections?.[a.collection];
|
|
467
435
|
let u = !0;
|
|
468
436
|
if (r && !c)
|
|
469
437
|
throw new Error("PERMISSION_DENIED");
|
|
470
438
|
r && !Te("Create", c) && (u = !1), r && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
471
|
-
!it("Create", t, s, r, i, n) && (u = !1), t.auth && o && (r && !
|
|
439
|
+
!it("Create", t, s, r, i, n) && (u = !1), t.auth && o && (r && !jn(c) && (u = !1), Vs("create", n, e, t, s, r, i, o) || (u = !1));
|
|
472
440
|
for (const h of l) {
|
|
473
441
|
const f = n[h.name];
|
|
474
|
-
h.access && !
|
|
442
|
+
h.access && !Zn(h, i) && f !== void 0 && (u = !1), f !== void 0 && !Zo(h, i) && (u = !1);
|
|
475
443
|
}
|
|
476
444
|
if (!u)
|
|
477
445
|
throw new Error("PERMISSION_DENIED");
|
|
478
446
|
}, Me = (n) => n && (n._methodName === "deleteField" || n.constructor.name === "DeleteTransform"), nt = (n) => {
|
|
479
447
|
for (const e in n)
|
|
480
448
|
Object.prototype.hasOwnProperty.call(n, e) && (Me(n[e]) ? delete n[e] : typeof n[e] == "object" && n[e] !== null && nt(n[e]));
|
|
481
|
-
},
|
|
449
|
+
}, or = (n, e, t, s, r, i, o, a, l, c) => {
|
|
482
450
|
const { labels: u, fields: h } = s, f = o?.collections?.[u.collection], d = { ...e, ...n };
|
|
483
451
|
nt(d);
|
|
484
452
|
let m = !0, O = "";
|
|
@@ -486,10 +454,10 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
486
454
|
throw new Error("PERMISSION_DENIED");
|
|
487
455
|
i && !Te("Update", f) && (m = !1, O = "Authenticated user does not have Update access to this collection"), i && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
488
456
|
(!it("Update", s, r, i, o, e) || // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
489
|
-
!it("Update", s, r, i, o, d)) && (m = !1, O = "Authenticated user does not have Update access to this document"), a && (i && !
|
|
457
|
+
!it("Update", s, r, i, o, d)) && (m = !1, O = "Authenticated user does not have Update access to this document"), a && (i && !jn(f) && (m = !1, O = "Authenticated user does not have Auth access for this collection"), Vs("update", d, t, s, r, i, o, l, c, e, a) || (O = "Authenticated user does not have sufficient write access for this record", m = !1));
|
|
490
458
|
for (const y of h) {
|
|
491
459
|
const w = n[y.name];
|
|
492
|
-
y.access && !
|
|
460
|
+
y.access && !Zn(y, o) && w !== void 0 && (O = `Authenticated user does not have access to field ${y.name}`, m = !1), w !== void 0 && !ii(y, o) && (O = `Authenticated user does not have Update access to field ${y.name}`, m = !1);
|
|
493
461
|
}
|
|
494
462
|
if (!m)
|
|
495
463
|
throw O && console.error(`PERMISSION_DENIED: ${O}`), new Error("PERMISSION_DENIED");
|
|
@@ -498,7 +466,7 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
498
466
|
let l = !0;
|
|
499
467
|
if (!a)
|
|
500
468
|
throw new Error("PERMISSION_DENIED");
|
|
501
|
-
if (Te("Delete", a) || (l = !1), it("Delete", t, s, r, i, n) || (l = !1), t.auth && n.User_ID && (
|
|
469
|
+
if (Te("Delete", a) || (l = !1), it("Delete", t, s, r, i, n) || (l = !1), t.auth && n.User_ID && (jn(a) || (l = !1), Vs("delete", n, e, t, s, r, i) || (l = !1)), !l)
|
|
502
470
|
throw new Error("PERMISSION_DENIED");
|
|
503
471
|
}, Jo = async (n, e, t, s, r) => {
|
|
504
472
|
const { labels: i } = e, o = r.collections?.[i.collection];
|
|
@@ -559,17 +527,17 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
559
527
|
i[o] = l;
|
|
560
528
|
}
|
|
561
529
|
return i;
|
|
562
|
-
}, Ie = (n, e) => e.fields.filter((t) => t.name === n.name)[0],
|
|
530
|
+
}, Ie = (n, e) => e.fields.filter((t) => t.name === n.name)[0], Xn = {
|
|
563
531
|
global: {},
|
|
564
532
|
collections: {}
|
|
565
533
|
}, qt = (n, e) => n && typeof n == "function" ? e ? n(...e) : n() : n, ie = async (n, e) => {
|
|
566
534
|
let t = n;
|
|
567
535
|
return n && (typeof n == "function" || typeof n.then == "function") && (e ? t = await n(...e) : t = await n()), t;
|
|
568
|
-
},
|
|
536
|
+
}, su = async (n, e, t, s) => {
|
|
569
537
|
for (const u of e)
|
|
570
538
|
if (u === "__proto__" || u === "constructor" || u === "prototype")
|
|
571
539
|
throw new Error("Invalid config path: prototype pollution keys are not allowed");
|
|
572
|
-
let r =
|
|
540
|
+
let r = Xn, i = !0;
|
|
573
541
|
for (const u of e) {
|
|
574
542
|
if (u === void 0 || r[u] === void 0) {
|
|
575
543
|
i = !1;
|
|
@@ -590,17 +558,17 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
590
558
|
}
|
|
591
559
|
let c;
|
|
592
560
|
if (l && (c = await ie(a, t)), c) {
|
|
593
|
-
let u =
|
|
561
|
+
let u = Xn;
|
|
594
562
|
const h = {};
|
|
595
563
|
for (let f = 0; f < e.length; f++) {
|
|
596
564
|
const d = e[f];
|
|
597
565
|
if (d !== void 0) {
|
|
598
566
|
if (d === "__proto__" || d === "constructor" || d === "prototype")
|
|
599
567
|
throw new Error("Invalid config path: prototype pollution keys are not allowed");
|
|
600
|
-
f === e.length - 1 ?
|
|
568
|
+
f === e.length - 1 ? Wo(h, e.join("."), c) : (u[d] ||= {}, u = u[d]);
|
|
601
569
|
}
|
|
602
570
|
}
|
|
603
|
-
|
|
571
|
+
Uo(Xn, h);
|
|
604
572
|
}
|
|
605
573
|
return c;
|
|
606
574
|
}, ct = (n, e, t) => {
|
|
@@ -614,7 +582,7 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
614
582
|
c.field == n.name && (i = !0);
|
|
615
583
|
}
|
|
616
584
|
return i;
|
|
617
|
-
},
|
|
585
|
+
}, ui = (n, e) => {
|
|
618
586
|
const t = Object.values(e.collections), { labels: s } = n, r = {};
|
|
619
587
|
return t.forEach((i) => {
|
|
620
588
|
const { labels: o, fields: a } = i;
|
|
@@ -626,7 +594,7 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
626
594
|
});
|
|
627
595
|
});
|
|
628
596
|
}), r;
|
|
629
|
-
},
|
|
597
|
+
}, es = (n) => JSON.stringify(n.map((e) => e.name)), pt = [
|
|
630
598
|
"id",
|
|
631
599
|
"Collection_Path",
|
|
632
600
|
"Last_Write_At",
|
|
@@ -638,7 +606,7 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
638
606
|
"Created_At",
|
|
639
607
|
"Saved_At",
|
|
640
608
|
"Created_By"
|
|
641
|
-
],
|
|
609
|
+
], zn = () => pt.map((n) => {
|
|
642
610
|
let e = "", t;
|
|
643
611
|
switch (n) {
|
|
644
612
|
case "id":
|
|
@@ -681,8 +649,8 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
681
649
|
required: !0
|
|
682
650
|
};
|
|
683
651
|
return t && (s.values = t), s;
|
|
684
|
-
}),
|
|
685
|
-
const t = [], { access: s, fields: r } = n, { attributeRestrictions: i, entityRestrictions: o } = s, a =
|
|
652
|
+
}), di = (n, e) => {
|
|
653
|
+
const t = [], { access: s, fields: r } = n, { attributeRestrictions: i, entityRestrictions: o } = s, a = zn();
|
|
686
654
|
return i && i.forEach((l) => {
|
|
687
655
|
if (l.roles.some((c) => c.role === e))
|
|
688
656
|
switch (l.type) {
|
|
@@ -724,7 +692,7 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
724
692
|
}
|
|
725
693
|
})), [...new Set(t)];
|
|
726
694
|
}, ta = (n, e) => {
|
|
727
|
-
const t = [], { fields: s, roleSystemFields: r, preloadCache: i, queries: o } = n, a =
|
|
695
|
+
const t = [], { fields: s, roleSystemFields: r, preloadCache: i, queries: o } = n, a = zn();
|
|
728
696
|
return t.push({
|
|
729
697
|
name: "Collection_Path",
|
|
730
698
|
type: "Array",
|
|
@@ -738,15 +706,15 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
738
706
|
}), o?.forEach((c) => {
|
|
739
707
|
const u = W(s.concat(a), c.field);
|
|
740
708
|
(!c.roles || c.roles.includes(e)) && u && (!u.access || u.access?.includes(e)) && pt.includes(c.field) && t.push(W(a, c.field));
|
|
741
|
-
}),
|
|
709
|
+
}), di(n, e).forEach((c) => {
|
|
742
710
|
pt.includes(c.name) && t.push(W(a, c.name));
|
|
743
711
|
}), [...new Set(t)];
|
|
744
712
|
}, na = (n, e, t) => {
|
|
745
|
-
const s = [], { fields: r, preloadCache: i } = e, o =
|
|
713
|
+
const s = [], { fields: r, preloadCache: i } = e, o = zn();
|
|
746
714
|
i?.range && i.range.fields.forEach((c) => {
|
|
747
715
|
pt.includes(c) ? s.push(W(o, c)) : s.push(W(r, c));
|
|
748
716
|
});
|
|
749
|
-
const a = /* @__PURE__ */ new Set(), l =
|
|
717
|
+
const a = /* @__PURE__ */ new Set(), l = ui(e, t);
|
|
750
718
|
return Object.entries(l).map(([c, u]) => {
|
|
751
719
|
n.name === c && Object.values(u).forEach((h) => {
|
|
752
720
|
h.forEach((f) => {
|
|
@@ -754,7 +722,7 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
754
722
|
});
|
|
755
723
|
});
|
|
756
724
|
}), a.forEach((c) => {
|
|
757
|
-
s.push(...
|
|
725
|
+
s.push(...di(e, c));
|
|
758
726
|
}), [...new Set(s)];
|
|
759
727
|
}, dn = (n, e, t) => {
|
|
760
728
|
const s = [], { fields: r, softDelete: i } = e;
|
|
@@ -767,7 +735,7 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
767
735
|
type: "String",
|
|
768
736
|
required: !0
|
|
769
737
|
});
|
|
770
|
-
const o = [], a =
|
|
738
|
+
const o = [], a = ui(e, t);
|
|
771
739
|
if (Object.values(a).forEach((l) => {
|
|
772
740
|
Object.keys(l).forEach((c) => {
|
|
773
741
|
t.collections[c].fields.forEach((h) => {
|
|
@@ -783,7 +751,7 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
783
751
|
l && s.push(l);
|
|
784
752
|
}
|
|
785
753
|
return s.push(...na(n, e, t)), [...new Set(s)];
|
|
786
|
-
},
|
|
754
|
+
}, fi = (n, e) => {
|
|
787
755
|
const { preloadCache: t } = n, s = /* @__PURE__ */ new Set();
|
|
788
756
|
for (const r of e.config.roles) {
|
|
789
757
|
if (!Ko(n, r, "read"))
|
|
@@ -798,31 +766,31 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
798
766
|
o || s.add({ key: (s.size + 1).toString(), roles: [r], fields: i });
|
|
799
767
|
}
|
|
800
768
|
return s;
|
|
801
|
-
},
|
|
802
|
-
const s =
|
|
769
|
+
}, hi = (n, e, t) => {
|
|
770
|
+
const s = fi(e, t);
|
|
803
771
|
for (const r of s.values())
|
|
804
772
|
if (r.roles.includes(n))
|
|
805
773
|
return r;
|
|
806
774
|
}, sa = (n, e) => {
|
|
807
|
-
const { fields: t } = e, s =
|
|
775
|
+
const { fields: t } = e, s = zn(), r = [];
|
|
808
776
|
return [...t, ...s.filter((o) => o.name !== "id")].forEach((o) => {
|
|
809
777
|
n?.fields.some((a) => a.name === o.name) || r.push(o);
|
|
810
778
|
}), r;
|
|
811
|
-
},
|
|
779
|
+
}, Us = (n, e, t) => {
|
|
812
780
|
const s = {};
|
|
813
781
|
return Object.values(n.collections).forEach((r) => {
|
|
814
|
-
const i =
|
|
782
|
+
const i = fi(r, n), o = Array.from(i);
|
|
815
783
|
o.map((a) => (a.fields.forEach((l) => {
|
|
816
784
|
}), a)), s[r.labels.collection] = new Set(o);
|
|
817
785
|
}), s;
|
|
818
|
-
},
|
|
786
|
+
}, Sn = (n) => ({
|
|
819
787
|
Last_Write_At: n.Last_Write_At,
|
|
820
788
|
Last_Write_By: n.Last_Write_By,
|
|
821
789
|
Last_Write_Connection_Status: n.Last_Write_Connection_Status,
|
|
822
790
|
Last_Write_Version: n.Last_Write_Version,
|
|
823
791
|
Last_Write_App: n.Last_Write_App,
|
|
824
792
|
Last_Save_At: n.Last_Save_At
|
|
825
|
-
}),
|
|
793
|
+
}), ts = async (n, e, t) => {
|
|
826
794
|
if (e) {
|
|
827
795
|
const s = await ie(e, t);
|
|
828
796
|
if (s === !1)
|
|
@@ -831,13 +799,13 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
831
799
|
}
|
|
832
800
|
};
|
|
833
801
|
async function ae(n, e, t, s) {
|
|
834
|
-
const r = await
|
|
802
|
+
const r = await ts(n, t.custom?.[n], s);
|
|
835
803
|
for (const i of t.fields)
|
|
836
|
-
await
|
|
837
|
-
if (n !== "setEmbedding" && (await
|
|
804
|
+
await ts(n, i.custom?.[n], s);
|
|
805
|
+
if (n !== "setEmbedding" && (await ts(n, e?.[n], s), n === "postWriteError"))
|
|
838
806
|
return r;
|
|
839
807
|
}
|
|
840
|
-
const
|
|
808
|
+
const Ws = (n, e, t, s, r, i, o, a, l, c) => (n == "create" && (t.Collection_Path = e, t.Created_At = a, t.Saved_At = l, t.Created_By = o || "System"), t.Last_Write_App = r, t.Last_Write_At = a, t.Last_Save_At = l, t.Last_Write_By = o || "System", t.Last_Write_Connection_Status = i, t.Last_Write_Version = s.version, t), ft = (n, e) => {
|
|
841
809
|
const { access: t, queries: s } = n, { serverReadOnly: r } = t, i = /* @__PURE__ */ new Set();
|
|
842
810
|
if (s)
|
|
843
811
|
for (const o of s) {
|
|
@@ -852,7 +820,7 @@ const Us = (n, e, t, s, r, i, o, a, l, c) => (n == "create" && (t.Collection_Pat
|
|
|
852
820
|
return e.forEach((o) => {
|
|
853
821
|
(s === o.name || o.sorting && (typeof o.sorting == "boolean" || !o.sorting.roles?.every((a) => r?.includes(a)))) && o.type === "String" && i.add(o);
|
|
854
822
|
}), i;
|
|
855
|
-
},
|
|
823
|
+
}, Tn = (n, e, t) => {
|
|
856
824
|
const { fields: s } = n;
|
|
857
825
|
s.forEach((i) => {
|
|
858
826
|
if (K(i))
|
|
@@ -880,7 +848,7 @@ const Us = (n, e, t, s, r, i, o, a, l, c) => (n == "create" && (t.Collection_Pat
|
|
|
880
848
|
}
|
|
881
849
|
}
|
|
882
850
|
});
|
|
883
|
-
},
|
|
851
|
+
}, Rn = (n, e) => {
|
|
884
852
|
wt(n, n.fields).forEach((s) => {
|
|
885
853
|
e[s.name] ? e[`${s.name}_Lowercase`] = e[s.name].toLowerCase() : delete e[`${s.name}_Lowercase`];
|
|
886
854
|
});
|
|
@@ -930,14 +898,14 @@ var te;
|
|
|
930
898
|
}
|
|
931
899
|
n.joinValues = s, n.jsonStringifyReplacer = (r, i) => typeof i == "bigint" ? i.toString() : i;
|
|
932
900
|
})(te || (te = {}));
|
|
933
|
-
var
|
|
901
|
+
var ar;
|
|
934
902
|
(function(n) {
|
|
935
903
|
n.mergeShapes = (e, t) => ({
|
|
936
904
|
...e,
|
|
937
905
|
...t
|
|
938
906
|
// second overwrites first
|
|
939
907
|
});
|
|
940
|
-
})(
|
|
908
|
+
})(ar || (ar = {}));
|
|
941
909
|
const U = te.arrayToEnum([
|
|
942
910
|
"string",
|
|
943
911
|
"nan",
|
|
@@ -1062,7 +1030,7 @@ class Be extends Error {
|
|
|
1062
1030
|
}
|
|
1063
1031
|
}
|
|
1064
1032
|
Be.create = (n) => new Be(n);
|
|
1065
|
-
const
|
|
1033
|
+
const ws = (n, e) => {
|
|
1066
1034
|
let t;
|
|
1067
1035
|
switch (n.code) {
|
|
1068
1036
|
case I.invalid_type:
|
|
@@ -1118,7 +1086,7 @@ const gs = (n, e) => {
|
|
|
1118
1086
|
}
|
|
1119
1087
|
return { message: t };
|
|
1120
1088
|
};
|
|
1121
|
-
let ia =
|
|
1089
|
+
let ia = ws;
|
|
1122
1090
|
function oa() {
|
|
1123
1091
|
return ia;
|
|
1124
1092
|
}
|
|
@@ -1155,7 +1123,7 @@ function L(n, e) {
|
|
|
1155
1123
|
// then schema-bound map if available
|
|
1156
1124
|
t,
|
|
1157
1125
|
// then global override map
|
|
1158
|
-
t ===
|
|
1126
|
+
t === ws ? void 0 : ws
|
|
1159
1127
|
// then global default map
|
|
1160
1128
|
].filter((r) => !!r)
|
|
1161
1129
|
});
|
|
@@ -1204,7 +1172,7 @@ class ve {
|
|
|
1204
1172
|
}
|
|
1205
1173
|
const Y = Object.freeze({
|
|
1206
1174
|
status: "aborted"
|
|
1207
|
-
}), Bt = (n) => ({ status: "dirty", value: n }), Ae = (n) => ({ status: "valid", value: n }),
|
|
1175
|
+
}), Bt = (n) => ({ status: "dirty", value: n }), Ae = (n) => ({ status: "valid", value: n }), lr = (n) => n.status === "aborted", cr = (n) => n.status === "dirty", xt = (n) => n.status === "valid", Nn = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
1208
1176
|
var z;
|
|
1209
1177
|
(function(n) {
|
|
1210
1178
|
n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
@@ -1217,7 +1185,7 @@ class je {
|
|
|
1217
1185
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
1218
1186
|
}
|
|
1219
1187
|
}
|
|
1220
|
-
const
|
|
1188
|
+
const ur = (n, e) => {
|
|
1221
1189
|
if (xt(e))
|
|
1222
1190
|
return { success: !0, data: e.value };
|
|
1223
1191
|
if (!n.common.issues.length)
|
|
@@ -1275,7 +1243,7 @@ class X {
|
|
|
1275
1243
|
}
|
|
1276
1244
|
_parseSync(e) {
|
|
1277
1245
|
const t = this._parse(e);
|
|
1278
|
-
if (
|
|
1246
|
+
if (Nn(t))
|
|
1279
1247
|
throw new Error("Synchronous parse encountered promise.");
|
|
1280
1248
|
return t;
|
|
1281
1249
|
}
|
|
@@ -1302,7 +1270,7 @@ class X {
|
|
|
1302
1270
|
data: e,
|
|
1303
1271
|
parsedType: Xe(e)
|
|
1304
1272
|
}, r = this._parseSync({ data: e, path: s.path, parent: s });
|
|
1305
|
-
return
|
|
1273
|
+
return ur(s, r);
|
|
1306
1274
|
}
|
|
1307
1275
|
"~validate"(e) {
|
|
1308
1276
|
const t = {
|
|
@@ -1354,8 +1322,8 @@ class X {
|
|
|
1354
1322
|
parent: null,
|
|
1355
1323
|
data: e,
|
|
1356
1324
|
parsedType: Xe(e)
|
|
1357
|
-
}, r = this._parse({ data: e, path: s.path, parent: s }), i = await (
|
|
1358
|
-
return
|
|
1325
|
+
}, r = this._parse({ data: e, path: s.path, parent: s }), i = await (Nn(r) ? r : Promise.resolve(r));
|
|
1326
|
+
return ur(s, i);
|
|
1359
1327
|
}
|
|
1360
1328
|
refine(e, t) {
|
|
1361
1329
|
const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
@@ -1400,13 +1368,13 @@ class X {
|
|
|
1400
1368
|
return Ue.create(this);
|
|
1401
1369
|
}
|
|
1402
1370
|
promise() {
|
|
1403
|
-
return
|
|
1371
|
+
return Cn.create(this, this._def);
|
|
1404
1372
|
}
|
|
1405
1373
|
or(e) {
|
|
1406
|
-
return
|
|
1374
|
+
return In.create([this, e], this._def);
|
|
1407
1375
|
}
|
|
1408
1376
|
and(e) {
|
|
1409
|
-
return
|
|
1377
|
+
return Dn.create(this, e, this._def);
|
|
1410
1378
|
}
|
|
1411
1379
|
transform(e) {
|
|
1412
1380
|
return new At({
|
|
@@ -1418,7 +1386,7 @@ class X {
|
|
|
1418
1386
|
}
|
|
1419
1387
|
default(e) {
|
|
1420
1388
|
const t = typeof e == "function" ? e : () => e;
|
|
1421
|
-
return new
|
|
1389
|
+
return new bs({
|
|
1422
1390
|
...J(this._def),
|
|
1423
1391
|
innerType: this,
|
|
1424
1392
|
defaultValue: t,
|
|
@@ -1434,7 +1402,7 @@ class X {
|
|
|
1434
1402
|
}
|
|
1435
1403
|
catch(e) {
|
|
1436
1404
|
const t = typeof e == "function" ? e : () => e;
|
|
1437
|
-
return new
|
|
1405
|
+
return new Ss({
|
|
1438
1406
|
...J(this._def),
|
|
1439
1407
|
innerType: this,
|
|
1440
1408
|
catchValue: t,
|
|
@@ -1449,10 +1417,10 @@ class X {
|
|
|
1449
1417
|
});
|
|
1450
1418
|
}
|
|
1451
1419
|
pipe(e) {
|
|
1452
|
-
return
|
|
1420
|
+
return js.create(this, e);
|
|
1453
1421
|
}
|
|
1454
1422
|
readonly() {
|
|
1455
|
-
return
|
|
1423
|
+
return Ts.create(this);
|
|
1456
1424
|
}
|
|
1457
1425
|
isOptional() {
|
|
1458
1426
|
return this.safeParse(void 0).success;
|
|
@@ -1462,19 +1430,19 @@ class X {
|
|
|
1462
1430
|
}
|
|
1463
1431
|
}
|
|
1464
1432
|
const la = /^c[^\s-]{8,}$/i, ca = /^[0-9a-z]+$/, ua = /^[0-9A-HJKMNP-TV-Z]{26}$/i, da = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, fa = /^[a-z0-9_-]{21}$/i, ha = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, ma = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, pa = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ya = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1465
|
-
let
|
|
1466
|
-
const ga = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, wa = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, _a = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Ea = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, va = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Oa = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
|
|
1467
|
-
function
|
|
1433
|
+
let ns;
|
|
1434
|
+
const ga = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, wa = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, _a = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Ea = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, va = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Oa = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, mi = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", ka = new RegExp(`^${mi}$`);
|
|
1435
|
+
function pi(n) {
|
|
1468
1436
|
let e = "[0-5]\\d";
|
|
1469
1437
|
n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
1470
1438
|
const t = n.precision ? "+" : "?";
|
|
1471
1439
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
|
|
1472
1440
|
}
|
|
1473
1441
|
function ba(n) {
|
|
1474
|
-
return new RegExp(`^${
|
|
1442
|
+
return new RegExp(`^${pi(n)}$`);
|
|
1475
1443
|
}
|
|
1476
1444
|
function Sa(n) {
|
|
1477
|
-
let e = `${
|
|
1445
|
+
let e = `${mi}T${pi(n)}`;
|
|
1478
1446
|
const t = [];
|
|
1479
1447
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
1480
1448
|
}
|
|
@@ -1552,7 +1520,7 @@ class qe extends X {
|
|
|
1552
1520
|
message: i.message
|
|
1553
1521
|
}), s.dirty());
|
|
1554
1522
|
else if (i.kind === "emoji")
|
|
1555
|
-
|
|
1523
|
+
ns || (ns = new RegExp(ya, "u")), ns.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1556
1524
|
validation: "emoji",
|
|
1557
1525
|
code: I.invalid_string,
|
|
1558
1526
|
message: i.message
|
|
@@ -2189,7 +2157,7 @@ en.create = (n) => new en({
|
|
|
2189
2157
|
coerce: n?.coerce ?? !1,
|
|
2190
2158
|
...J(n)
|
|
2191
2159
|
});
|
|
2192
|
-
class
|
|
2160
|
+
class _s extends X {
|
|
2193
2161
|
_parse(e) {
|
|
2194
2162
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== U.boolean) {
|
|
2195
2163
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2202,12 +2170,12 @@ class ws extends X {
|
|
|
2202
2170
|
return Ae(e.data);
|
|
2203
2171
|
}
|
|
2204
2172
|
}
|
|
2205
|
-
|
|
2173
|
+
_s.create = (n) => new _s({
|
|
2206
2174
|
typeName: G.ZodBoolean,
|
|
2207
2175
|
coerce: n?.coerce || !1,
|
|
2208
2176
|
...J(n)
|
|
2209
2177
|
});
|
|
2210
|
-
class
|
|
2178
|
+
class xn extends X {
|
|
2211
2179
|
_parse(e) {
|
|
2212
2180
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== U.date) {
|
|
2213
2181
|
const i = this._getOrReturnCtx(e);
|
|
@@ -2247,7 +2215,7 @@ class Nn extends X {
|
|
|
2247
2215
|
};
|
|
2248
2216
|
}
|
|
2249
2217
|
_addCheck(e) {
|
|
2250
|
-
return new
|
|
2218
|
+
return new xn({
|
|
2251
2219
|
...this._def,
|
|
2252
2220
|
checks: [...this._def.checks, e]
|
|
2253
2221
|
});
|
|
@@ -2279,13 +2247,13 @@ class Nn extends X {
|
|
|
2279
2247
|
return e != null ? new Date(e) : null;
|
|
2280
2248
|
}
|
|
2281
2249
|
}
|
|
2282
|
-
|
|
2250
|
+
xn.create = (n) => new xn({
|
|
2283
2251
|
checks: [],
|
|
2284
2252
|
coerce: n?.coerce || !1,
|
|
2285
2253
|
typeName: G.ZodDate,
|
|
2286
2254
|
...J(n)
|
|
2287
2255
|
});
|
|
2288
|
-
class
|
|
2256
|
+
class dr extends X {
|
|
2289
2257
|
_parse(e) {
|
|
2290
2258
|
if (this._getType(e) !== U.symbol) {
|
|
2291
2259
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2298,11 +2266,11 @@ class ur extends X {
|
|
|
2298
2266
|
return Ae(e.data);
|
|
2299
2267
|
}
|
|
2300
2268
|
}
|
|
2301
|
-
|
|
2269
|
+
dr.create = (n) => new dr({
|
|
2302
2270
|
typeName: G.ZodSymbol,
|
|
2303
2271
|
...J(n)
|
|
2304
2272
|
});
|
|
2305
|
-
class
|
|
2273
|
+
class Es extends X {
|
|
2306
2274
|
_parse(e) {
|
|
2307
2275
|
if (this._getType(e) !== U.undefined) {
|
|
2308
2276
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2315,11 +2283,11 @@ class _s extends X {
|
|
|
2315
2283
|
return Ae(e.data);
|
|
2316
2284
|
}
|
|
2317
2285
|
}
|
|
2318
|
-
|
|
2286
|
+
Es.create = (n) => new Es({
|
|
2319
2287
|
typeName: G.ZodUndefined,
|
|
2320
2288
|
...J(n)
|
|
2321
2289
|
});
|
|
2322
|
-
class
|
|
2290
|
+
class fr extends X {
|
|
2323
2291
|
_parse(e) {
|
|
2324
2292
|
if (this._getType(e) !== U.null) {
|
|
2325
2293
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2332,11 +2300,11 @@ class dr extends X {
|
|
|
2332
2300
|
return Ae(e.data);
|
|
2333
2301
|
}
|
|
2334
2302
|
}
|
|
2335
|
-
|
|
2303
|
+
fr.create = (n) => new fr({
|
|
2336
2304
|
typeName: G.ZodNull,
|
|
2337
2305
|
...J(n)
|
|
2338
2306
|
});
|
|
2339
|
-
class
|
|
2307
|
+
class vs extends X {
|
|
2340
2308
|
constructor() {
|
|
2341
2309
|
super(...arguments), this._any = !0;
|
|
2342
2310
|
}
|
|
@@ -2344,11 +2312,11 @@ class Es extends X {
|
|
|
2344
2312
|
return Ae(e.data);
|
|
2345
2313
|
}
|
|
2346
2314
|
}
|
|
2347
|
-
|
|
2315
|
+
vs.create = (n) => new vs({
|
|
2348
2316
|
typeName: G.ZodAny,
|
|
2349
2317
|
...J(n)
|
|
2350
2318
|
});
|
|
2351
|
-
class
|
|
2319
|
+
class hr extends X {
|
|
2352
2320
|
constructor() {
|
|
2353
2321
|
super(...arguments), this._unknown = !0;
|
|
2354
2322
|
}
|
|
@@ -2356,7 +2324,7 @@ class fr extends X {
|
|
|
2356
2324
|
return Ae(e.data);
|
|
2357
2325
|
}
|
|
2358
2326
|
}
|
|
2359
|
-
|
|
2327
|
+
hr.create = (n) => new hr({
|
|
2360
2328
|
typeName: G.ZodUnknown,
|
|
2361
2329
|
...J(n)
|
|
2362
2330
|
});
|
|
@@ -2374,7 +2342,7 @@ ot.create = (n) => new ot({
|
|
|
2374
2342
|
typeName: G.ZodNever,
|
|
2375
2343
|
...J(n)
|
|
2376
2344
|
});
|
|
2377
|
-
class
|
|
2345
|
+
class mr extends X {
|
|
2378
2346
|
_parse(e) {
|
|
2379
2347
|
if (this._getType(e) !== U.undefined) {
|
|
2380
2348
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2387,7 +2355,7 @@ class hr extends X {
|
|
|
2387
2355
|
return Ae(e.data);
|
|
2388
2356
|
}
|
|
2389
2357
|
}
|
|
2390
|
-
|
|
2358
|
+
mr.create = (n) => new mr({
|
|
2391
2359
|
typeName: G.ZodVoid,
|
|
2392
2360
|
...J(n)
|
|
2393
2361
|
});
|
|
@@ -2743,7 +2711,7 @@ class fe extends X {
|
|
|
2743
2711
|
});
|
|
2744
2712
|
}
|
|
2745
2713
|
keyof() {
|
|
2746
|
-
return
|
|
2714
|
+
return yi(te.objectKeys(this.shape));
|
|
2747
2715
|
}
|
|
2748
2716
|
}
|
|
2749
2717
|
fe.create = (n, e) => new fe({
|
|
@@ -2767,7 +2735,7 @@ fe.lazycreate = (n, e) => new fe({
|
|
|
2767
2735
|
typeName: G.ZodObject,
|
|
2768
2736
|
...J(e)
|
|
2769
2737
|
});
|
|
2770
|
-
class
|
|
2738
|
+
class In extends X {
|
|
2771
2739
|
_parse(e) {
|
|
2772
2740
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
2773
2741
|
function r(i) {
|
|
@@ -2835,19 +2803,19 @@ class xn extends X {
|
|
|
2835
2803
|
return this._def.options;
|
|
2836
2804
|
}
|
|
2837
2805
|
}
|
|
2838
|
-
|
|
2806
|
+
In.create = (n, e) => new In({
|
|
2839
2807
|
options: n,
|
|
2840
2808
|
typeName: G.ZodUnion,
|
|
2841
2809
|
...J(e)
|
|
2842
2810
|
});
|
|
2843
|
-
function
|
|
2811
|
+
function Os(n, e) {
|
|
2844
2812
|
const t = Xe(n), s = Xe(e);
|
|
2845
2813
|
if (n === e)
|
|
2846
2814
|
return { valid: !0, data: n };
|
|
2847
2815
|
if (t === U.object && s === U.object) {
|
|
2848
2816
|
const r = te.objectKeys(e), i = te.objectKeys(n).filter((a) => r.indexOf(a) !== -1), o = { ...n, ...e };
|
|
2849
2817
|
for (const a of i) {
|
|
2850
|
-
const l =
|
|
2818
|
+
const l = Os(n[a], e[a]);
|
|
2851
2819
|
if (!l.valid)
|
|
2852
2820
|
return { valid: !1 };
|
|
2853
2821
|
o[a] = l.data;
|
|
@@ -2858,7 +2826,7 @@ function vs(n, e) {
|
|
|
2858
2826
|
return { valid: !1 };
|
|
2859
2827
|
const r = [];
|
|
2860
2828
|
for (let i = 0; i < n.length; i++) {
|
|
2861
|
-
const o = n[i], a = e[i], l =
|
|
2829
|
+
const o = n[i], a = e[i], l = Os(o, a);
|
|
2862
2830
|
if (!l.valid)
|
|
2863
2831
|
return { valid: !1 };
|
|
2864
2832
|
r.push(l.data);
|
|
@@ -2866,13 +2834,13 @@ function vs(n, e) {
|
|
|
2866
2834
|
return { valid: !0, data: r };
|
|
2867
2835
|
} else return t === U.date && s === U.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
|
|
2868
2836
|
}
|
|
2869
|
-
class
|
|
2837
|
+
class Dn extends X {
|
|
2870
2838
|
_parse(e) {
|
|
2871
2839
|
const { status: t, ctx: s } = this._processInputParams(e), r = (i, o) => {
|
|
2872
|
-
if (
|
|
2840
|
+
if (lr(i) || lr(o))
|
|
2873
2841
|
return Y;
|
|
2874
|
-
const a =
|
|
2875
|
-
return a.valid ? ((
|
|
2842
|
+
const a = Os(i.value, o.value);
|
|
2843
|
+
return a.valid ? ((cr(i) || cr(o)) && t.dirty(), { status: t.value, value: a.data }) : (L(s, {
|
|
2876
2844
|
code: I.invalid_intersection_types
|
|
2877
2845
|
}), Y);
|
|
2878
2846
|
};
|
|
@@ -2898,7 +2866,7 @@ class In extends X {
|
|
|
2898
2866
|
}));
|
|
2899
2867
|
}
|
|
2900
2868
|
}
|
|
2901
|
-
|
|
2869
|
+
Dn.create = (n, e, t) => new Dn({
|
|
2902
2870
|
left: n,
|
|
2903
2871
|
right: e,
|
|
2904
2872
|
typeName: G.ZodIntersection,
|
|
@@ -2954,7 +2922,7 @@ yt.create = (n, e) => {
|
|
|
2954
2922
|
...J(e)
|
|
2955
2923
|
});
|
|
2956
2924
|
};
|
|
2957
|
-
class
|
|
2925
|
+
class An extends X {
|
|
2958
2926
|
get keySchema() {
|
|
2959
2927
|
return this._def.keyType;
|
|
2960
2928
|
}
|
|
@@ -2982,12 +2950,12 @@ class Dn extends X {
|
|
|
2982
2950
|
return this._def.valueType;
|
|
2983
2951
|
}
|
|
2984
2952
|
static create(e, t, s) {
|
|
2985
|
-
return t instanceof X ? new
|
|
2953
|
+
return t instanceof X ? new An({
|
|
2986
2954
|
keyType: e,
|
|
2987
2955
|
valueType: t,
|
|
2988
2956
|
typeName: G.ZodRecord,
|
|
2989
2957
|
...J(s)
|
|
2990
|
-
}) : new
|
|
2958
|
+
}) : new An({
|
|
2991
2959
|
keyType: qe.create(),
|
|
2992
2960
|
valueType: e,
|
|
2993
2961
|
typeName: G.ZodRecord,
|
|
@@ -2995,7 +2963,7 @@ class Dn extends X {
|
|
|
2995
2963
|
});
|
|
2996
2964
|
}
|
|
2997
2965
|
}
|
|
2998
|
-
class
|
|
2966
|
+
class pr extends X {
|
|
2999
2967
|
get keySchema() {
|
|
3000
2968
|
return this._def.keyType;
|
|
3001
2969
|
}
|
|
@@ -3037,7 +3005,7 @@ class mr extends X {
|
|
|
3037
3005
|
}
|
|
3038
3006
|
}
|
|
3039
3007
|
}
|
|
3040
|
-
|
|
3008
|
+
pr.create = (n, e, t) => new pr({
|
|
3041
3009
|
valueType: e,
|
|
3042
3010
|
keyType: n,
|
|
3043
3011
|
typeName: G.ZodMap,
|
|
@@ -3107,7 +3075,7 @@ tn.create = (n, e) => new tn({
|
|
|
3107
3075
|
typeName: G.ZodSet,
|
|
3108
3076
|
...J(e)
|
|
3109
3077
|
});
|
|
3110
|
-
class
|
|
3078
|
+
class yr extends X {
|
|
3111
3079
|
get schema() {
|
|
3112
3080
|
return this._def.getter();
|
|
3113
3081
|
}
|
|
@@ -3116,12 +3084,12 @@ class pr extends X {
|
|
|
3116
3084
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
3117
3085
|
}
|
|
3118
3086
|
}
|
|
3119
|
-
|
|
3087
|
+
yr.create = (n, e) => new yr({
|
|
3120
3088
|
getter: n,
|
|
3121
3089
|
typeName: G.ZodLazy,
|
|
3122
3090
|
...J(e)
|
|
3123
3091
|
});
|
|
3124
|
-
class
|
|
3092
|
+
class ks extends X {
|
|
3125
3093
|
_parse(e) {
|
|
3126
3094
|
if (e.data !== this._def.value) {
|
|
3127
3095
|
const t = this._getOrReturnCtx(e);
|
|
@@ -3137,12 +3105,12 @@ class Os extends X {
|
|
|
3137
3105
|
return this._def.value;
|
|
3138
3106
|
}
|
|
3139
3107
|
}
|
|
3140
|
-
|
|
3108
|
+
ks.create = (n, e) => new ks({
|
|
3141
3109
|
value: n,
|
|
3142
3110
|
typeName: G.ZodLiteral,
|
|
3143
3111
|
...J(e)
|
|
3144
3112
|
});
|
|
3145
|
-
function
|
|
3113
|
+
function yi(n, e) {
|
|
3146
3114
|
return new Dt({
|
|
3147
3115
|
values: n,
|
|
3148
3116
|
typeName: G.ZodEnum,
|
|
@@ -3203,8 +3171,8 @@ class Dt extends X {
|
|
|
3203
3171
|
});
|
|
3204
3172
|
}
|
|
3205
3173
|
}
|
|
3206
|
-
Dt.create =
|
|
3207
|
-
class
|
|
3174
|
+
Dt.create = yi;
|
|
3175
|
+
class gr extends X {
|
|
3208
3176
|
_parse(e) {
|
|
3209
3177
|
const t = te.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
3210
3178
|
if (s.parsedType !== U.string && s.parsedType !== U.number) {
|
|
@@ -3229,12 +3197,12 @@ class yr extends X {
|
|
|
3229
3197
|
return this._def.values;
|
|
3230
3198
|
}
|
|
3231
3199
|
}
|
|
3232
|
-
|
|
3200
|
+
gr.create = (n, e) => new gr({
|
|
3233
3201
|
values: n,
|
|
3234
3202
|
typeName: G.ZodNativeEnum,
|
|
3235
3203
|
...J(e)
|
|
3236
3204
|
});
|
|
3237
|
-
class
|
|
3205
|
+
class Cn extends X {
|
|
3238
3206
|
unwrap() {
|
|
3239
3207
|
return this._def.type;
|
|
3240
3208
|
}
|
|
@@ -3253,7 +3221,7 @@ class An extends X {
|
|
|
3253
3221
|
})));
|
|
3254
3222
|
}
|
|
3255
3223
|
}
|
|
3256
|
-
|
|
3224
|
+
Cn.create = (n, e) => new Cn({
|
|
3257
3225
|
type: n,
|
|
3258
3226
|
typeName: G.ZodPromise,
|
|
3259
3227
|
...J(e)
|
|
@@ -3376,7 +3344,7 @@ Ct.create = (n, e) => new Ct({
|
|
|
3376
3344
|
typeName: G.ZodNullable,
|
|
3377
3345
|
...J(e)
|
|
3378
3346
|
});
|
|
3379
|
-
class
|
|
3347
|
+
class bs extends X {
|
|
3380
3348
|
_parse(e) {
|
|
3381
3349
|
const { ctx: t } = this._processInputParams(e);
|
|
3382
3350
|
let s = t.data;
|
|
@@ -3390,13 +3358,13 @@ class ks extends X {
|
|
|
3390
3358
|
return this._def.innerType;
|
|
3391
3359
|
}
|
|
3392
3360
|
}
|
|
3393
|
-
|
|
3361
|
+
bs.create = (n, e) => new bs({
|
|
3394
3362
|
innerType: n,
|
|
3395
3363
|
typeName: G.ZodDefault,
|
|
3396
3364
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
3397
3365
|
...J(e)
|
|
3398
3366
|
});
|
|
3399
|
-
class
|
|
3367
|
+
class Ss extends X {
|
|
3400
3368
|
_parse(e) {
|
|
3401
3369
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
3402
3370
|
...t,
|
|
@@ -3411,7 +3379,7 @@ class bs extends X {
|
|
|
3411
3379
|
...s
|
|
3412
3380
|
}
|
|
3413
3381
|
});
|
|
3414
|
-
return
|
|
3382
|
+
return Nn(r) ? r.then((i) => ({
|
|
3415
3383
|
status: "valid",
|
|
3416
3384
|
value: i.status === "valid" ? i.value : this._def.catchValue({
|
|
3417
3385
|
get error() {
|
|
@@ -3433,13 +3401,13 @@ class bs extends X {
|
|
|
3433
3401
|
return this._def.innerType;
|
|
3434
3402
|
}
|
|
3435
3403
|
}
|
|
3436
|
-
|
|
3404
|
+
Ss.create = (n, e) => new Ss({
|
|
3437
3405
|
innerType: n,
|
|
3438
3406
|
typeName: G.ZodCatch,
|
|
3439
3407
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
3440
3408
|
...J(e)
|
|
3441
3409
|
});
|
|
3442
|
-
class
|
|
3410
|
+
class wr extends X {
|
|
3443
3411
|
_parse(e) {
|
|
3444
3412
|
if (this._getType(e) !== U.nan) {
|
|
3445
3413
|
const s = this._getOrReturnCtx(e);
|
|
@@ -3452,7 +3420,7 @@ class gr extends X {
|
|
|
3452
3420
|
return { status: "valid", value: e.data };
|
|
3453
3421
|
}
|
|
3454
3422
|
}
|
|
3455
|
-
|
|
3423
|
+
wr.create = (n) => new wr({
|
|
3456
3424
|
typeName: G.ZodNaN,
|
|
3457
3425
|
...J(n)
|
|
3458
3426
|
});
|
|
@@ -3469,7 +3437,7 @@ class Ia extends X {
|
|
|
3469
3437
|
return this._def.type;
|
|
3470
3438
|
}
|
|
3471
3439
|
}
|
|
3472
|
-
class
|
|
3440
|
+
class js extends X {
|
|
3473
3441
|
_parse(e) {
|
|
3474
3442
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
3475
3443
|
if (s.common.async)
|
|
@@ -3502,23 +3470,23 @@ class Ws extends X {
|
|
|
3502
3470
|
}
|
|
3503
3471
|
}
|
|
3504
3472
|
static create(e, t) {
|
|
3505
|
-
return new
|
|
3473
|
+
return new js({
|
|
3506
3474
|
in: e,
|
|
3507
3475
|
out: t,
|
|
3508
3476
|
typeName: G.ZodPipeline
|
|
3509
3477
|
});
|
|
3510
3478
|
}
|
|
3511
3479
|
}
|
|
3512
|
-
class
|
|
3480
|
+
class Ts extends X {
|
|
3513
3481
|
_parse(e) {
|
|
3514
3482
|
const t = this._def.innerType._parse(e), s = (r) => (xt(r) && (r.value = Object.freeze(r.value)), r);
|
|
3515
|
-
return
|
|
3483
|
+
return Nn(t) ? t.then((r) => s(r)) : s(t);
|
|
3516
3484
|
}
|
|
3517
3485
|
unwrap() {
|
|
3518
3486
|
return this._def.innerType;
|
|
3519
3487
|
}
|
|
3520
3488
|
}
|
|
3521
|
-
|
|
3489
|
+
Ts.create = (n, e) => new Ts({
|
|
3522
3490
|
innerType: n,
|
|
3523
3491
|
typeName: G.ZodReadonly,
|
|
3524
3492
|
...J(e)
|
|
@@ -3527,20 +3495,20 @@ var G;
|
|
|
3527
3495
|
(function(n) {
|
|
3528
3496
|
n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
|
|
3529
3497
|
})(G || (G = {}));
|
|
3530
|
-
const be = qe.create, ht = It.create, Kt =
|
|
3498
|
+
const be = qe.create, ht = It.create, Kt = _s.create, ss = Es.create, ge = vs.create;
|
|
3531
3499
|
ot.create;
|
|
3532
|
-
const _t = Ue.create, We = fe.create, Oe =
|
|
3533
|
-
|
|
3500
|
+
const _t = Ue.create, We = fe.create, Oe = In.create;
|
|
3501
|
+
Dn.create;
|
|
3534
3502
|
yt.create;
|
|
3535
|
-
const rn =
|
|
3536
|
-
|
|
3503
|
+
const rn = An.create, ke = ks.create, $n = Dt.create;
|
|
3504
|
+
Cn.create;
|
|
3537
3505
|
st.create;
|
|
3538
3506
|
Ct.create;
|
|
3539
3507
|
const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds !== void 0 || n._seconds !== void 0 && n._nanoseconds !== void 0), {
|
|
3540
3508
|
message: "Value is not a valid timestamp"
|
|
3541
|
-
}),
|
|
3509
|
+
}), _r = () => ge().refine((n) => n && (n._methodName === "serverTimestamp" || n.constructor.name === "ServerTimestampTransform"), {
|
|
3542
3510
|
message: "Value is not a valid server timestamp"
|
|
3543
|
-
}),
|
|
3511
|
+
}), gi = (n, e) => {
|
|
3544
3512
|
const t = {};
|
|
3545
3513
|
if (n.includeFields) {
|
|
3546
3514
|
const s = e.collections[n.collection];
|
|
@@ -3550,7 +3518,7 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3550
3518
|
const i = s.fields.find((a) => a.name === r);
|
|
3551
3519
|
if (!i)
|
|
3552
3520
|
throw new Error(`Field ${r} not found in collection ${n.collection}`);
|
|
3553
|
-
t[r] =
|
|
3521
|
+
t[r] = Mn(s, i), wt(s, [i]).size === 1 && (t[`${r}_Lowercase`] = Mn(s, i, !0));
|
|
3554
3522
|
});
|
|
3555
3523
|
}
|
|
3556
3524
|
return We({
|
|
@@ -3558,12 +3526,12 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3558
3526
|
...t
|
|
3559
3527
|
});
|
|
3560
3528
|
}, Da = (n, e) => {
|
|
3561
|
-
let t = rn(
|
|
3529
|
+
let t = rn(gi(n, e));
|
|
3562
3530
|
return n.required || (t = t.optional()), t;
|
|
3563
3531
|
}, Aa = (n) => {
|
|
3564
3532
|
let e = _t(Oe([be().length(20), be().length(28)]));
|
|
3565
3533
|
return ["OneToOne", "OneToMany"].includes(n.type) ? e = e.max(1) : (n.min && (e = e.min(n.min)), n.max && (e = e.max(n.max)), n.length && (e = e.length(n.length))), n.required ? e = e.nonempty() : e = e.optional(), e;
|
|
3566
|
-
},
|
|
3534
|
+
}, Mn = (n, e, t) => {
|
|
3567
3535
|
const { softDelete: s } = n, r = s?.timestampField;
|
|
3568
3536
|
let i;
|
|
3569
3537
|
switch (e.type) {
|
|
@@ -3571,9 +3539,9 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3571
3539
|
if (i = be(), e.length && (i = i.length(e.length)), e.minlength && (i = i.min(e.minlength)), e.maxlength && (i = i.max(e.maxlength)), e.email && (i = i.email()), e.uuid && (i = i.uuid()), e.url && (i = i.url()), e.emoji && (i = i.emoji()), e.ip && (i = i.ip()), e.pattern && (i = i.regex(new RegExp(e.pattern))), t && (i = i.toLowerCase()), e.values)
|
|
3572
3540
|
if (t) {
|
|
3573
3541
|
const o = e.values.map((a) => a.toLowerCase());
|
|
3574
|
-
i =
|
|
3542
|
+
i = $n(o);
|
|
3575
3543
|
} else
|
|
3576
|
-
i =
|
|
3544
|
+
i = $n(e.values);
|
|
3577
3545
|
break;
|
|
3578
3546
|
case "Boolean":
|
|
3579
3547
|
i = Kt();
|
|
@@ -3617,26 +3585,26 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3617
3585
|
Collection_Path: _t(be()),
|
|
3618
3586
|
Last_Write_App: be(),
|
|
3619
3587
|
Last_Write_At: wn(),
|
|
3620
|
-
Last_Save_At:
|
|
3588
|
+
Last_Save_At: _r(),
|
|
3621
3589
|
Last_Write_By: Oe([be().length(28), ke("System")]),
|
|
3622
|
-
Last_Write_Connection_Status:
|
|
3590
|
+
Last_Write_Connection_Status: $n(["Online", "Offline"]),
|
|
3623
3591
|
Last_Write_Version: ht().int(),
|
|
3624
3592
|
id: be().regex(new RegExp("^[a-zA-Z0-9]+$")).length(20),
|
|
3625
3593
|
Created_At: wn(),
|
|
3626
3594
|
Created_By: Oe([be().length(28), ke("System")])
|
|
3627
3595
|
};
|
|
3628
|
-
n === "create" && (s.Saved_At =
|
|
3596
|
+
n === "create" && (s.Saved_At = _r()), n === "update" && (s.Saved_At = wn(), s.Collection_Path = s.Collection_Path.optional(), s.id = s.id.optional(), s.Created_At = s.Created_At.optional(), s.Saved_At = s.Saved_At.optional(), s.Created_By = s.Created_By.optional());
|
|
3629
3597
|
const r = ft(e, e.fields), i = Array.from(r).map((l) => l.name);
|
|
3630
3598
|
e.fields.forEach((l) => {
|
|
3631
|
-
K(l) ? (s[l.name] = Da(l, t), s[`${l.name}_Array`] = Aa(l), i.includes(l.name) && (s[`${l.name}_Single`] =
|
|
3599
|
+
K(l) ? (s[l.name] = Da(l, t), s[`${l.name}_Array`] = Aa(l), i.includes(l.name) && (s[`${l.name}_Single`] = gi(l, t), l.required || (s[`${l.name}_Single`] = s[`${l.name}_Single`].optional())), l.length && (s[l.name] = s[l.name].refine((c) => l.length && c && Object.keys(c).length === l.length, {
|
|
3632
3600
|
message: `Value must contain ${l.length} item(s)`
|
|
3633
3601
|
})), l.min && (s[l.name] = s[l.name].refine((c) => l.min && c && Object.keys(c).length >= l.min, {
|
|
3634
3602
|
message: `Value must contain at least ${l.min} item(s)`
|
|
3635
3603
|
})), l.max && (s[l.name] = s[l.name].refine((c) => l.max && (!c || Object.keys(c).length <= l.max), {
|
|
3636
3604
|
message: `Value must contain at most ${l.max} item(s)`
|
|
3637
|
-
}))) : l.type !== "Computed" && (s[l.name] =
|
|
3605
|
+
}))) : l.type !== "Computed" && (s[l.name] = Mn(e, l));
|
|
3638
3606
|
}), wt(e, e.fields).forEach((l) => {
|
|
3639
|
-
s[l.name] && (s[`${l.name}_Lowercase`] =
|
|
3607
|
+
s[l.name] && (s[`${l.name}_Lowercase`] = Mn(e, l, !0));
|
|
3640
3608
|
});
|
|
3641
3609
|
const a = We(s);
|
|
3642
3610
|
return e.allowSchemalessFields ? a.passthrough() : a.strict();
|
|
@@ -3660,7 +3628,7 @@ class Fa extends Et {
|
|
|
3660
3628
|
}
|
|
3661
3629
|
class St extends Et {
|
|
3662
3630
|
}
|
|
3663
|
-
class
|
|
3631
|
+
class wi extends Et {
|
|
3664
3632
|
constructor(e) {
|
|
3665
3633
|
super(`Invalid unit ${e}`);
|
|
3666
3634
|
}
|
|
@@ -3672,11 +3640,11 @@ class Ke extends Et {
|
|
|
3672
3640
|
super("Zone is an abstract class");
|
|
3673
3641
|
}
|
|
3674
3642
|
}
|
|
3675
|
-
const $ = "numeric", Pe = "short", Se = "long",
|
|
3643
|
+
const $ = "numeric", Pe = "short", Se = "long", Fn = {
|
|
3676
3644
|
year: $,
|
|
3677
3645
|
month: $,
|
|
3678
3646
|
day: $
|
|
3679
|
-
},
|
|
3647
|
+
}, _i = {
|
|
3680
3648
|
year: $,
|
|
3681
3649
|
month: Pe,
|
|
3682
3650
|
day: $
|
|
@@ -3685,73 +3653,73 @@ const $ = "numeric", Pe = "short", Se = "long", Mn = {
|
|
|
3685
3653
|
month: Pe,
|
|
3686
3654
|
day: $,
|
|
3687
3655
|
weekday: Pe
|
|
3688
|
-
},
|
|
3656
|
+
}, Ei = {
|
|
3689
3657
|
year: $,
|
|
3690
3658
|
month: Se,
|
|
3691
3659
|
day: $
|
|
3692
|
-
},
|
|
3660
|
+
}, vi = {
|
|
3693
3661
|
year: $,
|
|
3694
3662
|
month: Se,
|
|
3695
3663
|
day: $,
|
|
3696
3664
|
weekday: Se
|
|
3697
|
-
},
|
|
3665
|
+
}, Oi = {
|
|
3698
3666
|
hour: $,
|
|
3699
3667
|
minute: $
|
|
3700
|
-
},
|
|
3668
|
+
}, ki = {
|
|
3701
3669
|
hour: $,
|
|
3702
3670
|
minute: $,
|
|
3703
3671
|
second: $
|
|
3704
|
-
},
|
|
3672
|
+
}, bi = {
|
|
3705
3673
|
hour: $,
|
|
3706
3674
|
minute: $,
|
|
3707
3675
|
second: $,
|
|
3708
3676
|
timeZoneName: Pe
|
|
3709
|
-
},
|
|
3677
|
+
}, Si = {
|
|
3710
3678
|
hour: $,
|
|
3711
3679
|
minute: $,
|
|
3712
3680
|
second: $,
|
|
3713
3681
|
timeZoneName: Se
|
|
3714
|
-
},
|
|
3682
|
+
}, Ti = {
|
|
3715
3683
|
hour: $,
|
|
3716
3684
|
minute: $,
|
|
3717
3685
|
hourCycle: "h23"
|
|
3718
|
-
},
|
|
3686
|
+
}, Ri = {
|
|
3719
3687
|
hour: $,
|
|
3720
3688
|
minute: $,
|
|
3721
3689
|
second: $,
|
|
3722
3690
|
hourCycle: "h23"
|
|
3723
|
-
},
|
|
3691
|
+
}, Ni = {
|
|
3724
3692
|
hour: $,
|
|
3725
3693
|
minute: $,
|
|
3726
3694
|
second: $,
|
|
3727
3695
|
hourCycle: "h23",
|
|
3728
3696
|
timeZoneName: Pe
|
|
3729
|
-
},
|
|
3697
|
+
}, xi = {
|
|
3730
3698
|
hour: $,
|
|
3731
3699
|
minute: $,
|
|
3732
3700
|
second: $,
|
|
3733
3701
|
hourCycle: "h23",
|
|
3734
3702
|
timeZoneName: Se
|
|
3735
|
-
},
|
|
3703
|
+
}, Ii = {
|
|
3736
3704
|
year: $,
|
|
3737
3705
|
month: $,
|
|
3738
3706
|
day: $,
|
|
3739
3707
|
hour: $,
|
|
3740
3708
|
minute: $
|
|
3741
|
-
},
|
|
3709
|
+
}, Di = {
|
|
3742
3710
|
year: $,
|
|
3743
3711
|
month: $,
|
|
3744
3712
|
day: $,
|
|
3745
3713
|
hour: $,
|
|
3746
3714
|
minute: $,
|
|
3747
3715
|
second: $
|
|
3748
|
-
},
|
|
3716
|
+
}, Ai = {
|
|
3749
3717
|
year: $,
|
|
3750
3718
|
month: Pe,
|
|
3751
3719
|
day: $,
|
|
3752
3720
|
hour: $,
|
|
3753
3721
|
minute: $
|
|
3754
|
-
},
|
|
3722
|
+
}, Ci = {
|
|
3755
3723
|
year: $,
|
|
3756
3724
|
month: Pe,
|
|
3757
3725
|
day: $,
|
|
@@ -3765,14 +3733,14 @@ const $ = "numeric", Pe = "short", Se = "long", Mn = {
|
|
|
3765
3733
|
weekday: Pe,
|
|
3766
3734
|
hour: $,
|
|
3767
3735
|
minute: $
|
|
3768
|
-
},
|
|
3736
|
+
}, $i = {
|
|
3769
3737
|
year: $,
|
|
3770
3738
|
month: Se,
|
|
3771
3739
|
day: $,
|
|
3772
3740
|
hour: $,
|
|
3773
3741
|
minute: $,
|
|
3774
3742
|
timeZoneName: Pe
|
|
3775
|
-
},
|
|
3743
|
+
}, Mi = {
|
|
3776
3744
|
year: $,
|
|
3777
3745
|
month: Se,
|
|
3778
3746
|
day: $,
|
|
@@ -3780,7 +3748,7 @@ const $ = "numeric", Pe = "short", Se = "long", Mn = {
|
|
|
3780
3748
|
minute: $,
|
|
3781
3749
|
second: $,
|
|
3782
3750
|
timeZoneName: Pe
|
|
3783
|
-
},
|
|
3751
|
+
}, Fi = {
|
|
3784
3752
|
year: $,
|
|
3785
3753
|
month: Se,
|
|
3786
3754
|
day: $,
|
|
@@ -3788,7 +3756,7 @@ const $ = "numeric", Pe = "short", Se = "long", Mn = {
|
|
|
3788
3756
|
hour: $,
|
|
3789
3757
|
minute: $,
|
|
3790
3758
|
timeZoneName: Se
|
|
3791
|
-
},
|
|
3759
|
+
}, Pi = {
|
|
3792
3760
|
year: $,
|
|
3793
3761
|
month: Se,
|
|
3794
3762
|
day: $,
|
|
@@ -3882,14 +3850,14 @@ class on {
|
|
|
3882
3850
|
throw new Ke();
|
|
3883
3851
|
}
|
|
3884
3852
|
}
|
|
3885
|
-
let
|
|
3886
|
-
class
|
|
3853
|
+
let rs = null;
|
|
3854
|
+
class qn extends on {
|
|
3887
3855
|
/**
|
|
3888
3856
|
* Get a singleton instance of the local zone
|
|
3889
3857
|
* @return {SystemZone}
|
|
3890
3858
|
*/
|
|
3891
3859
|
static get instance() {
|
|
3892
|
-
return
|
|
3860
|
+
return rs === null && (rs = new qn()), rs;
|
|
3893
3861
|
}
|
|
3894
3862
|
/** @override **/
|
|
3895
3863
|
get type() {
|
|
@@ -3905,7 +3873,7 @@ class zn extends on {
|
|
|
3905
3873
|
}
|
|
3906
3874
|
/** @override **/
|
|
3907
3875
|
offsetName(e, { format: t, locale: s }) {
|
|
3908
|
-
return
|
|
3876
|
+
return Gi(e, t, s);
|
|
3909
3877
|
}
|
|
3910
3878
|
/** @override **/
|
|
3911
3879
|
formatOffset(e, t) {
|
|
@@ -3924,9 +3892,9 @@ class zn extends on {
|
|
|
3924
3892
|
return !0;
|
|
3925
3893
|
}
|
|
3926
3894
|
}
|
|
3927
|
-
const
|
|
3895
|
+
const Rs = /* @__PURE__ */ new Map();
|
|
3928
3896
|
function Va(n) {
|
|
3929
|
-
let e =
|
|
3897
|
+
let e = Rs.get(n);
|
|
3930
3898
|
return e === void 0 && (e = new Intl.DateTimeFormat("en-US", {
|
|
3931
3899
|
hour12: !1,
|
|
3932
3900
|
timeZone: n,
|
|
@@ -3937,7 +3905,7 @@ function Va(n) {
|
|
|
3937
3905
|
minute: "2-digit",
|
|
3938
3906
|
second: "2-digit",
|
|
3939
3907
|
era: "short"
|
|
3940
|
-
}),
|
|
3908
|
+
}), Rs.set(n, e)), e;
|
|
3941
3909
|
}
|
|
3942
3910
|
const Ua = {
|
|
3943
3911
|
year: 0,
|
|
@@ -3960,22 +3928,22 @@ function ja(n, e) {
|
|
|
3960
3928
|
}
|
|
3961
3929
|
return s;
|
|
3962
3930
|
}
|
|
3963
|
-
const
|
|
3931
|
+
const is = /* @__PURE__ */ new Map();
|
|
3964
3932
|
class He extends on {
|
|
3965
3933
|
/**
|
|
3966
3934
|
* @param {string} name - Zone name
|
|
3967
3935
|
* @return {IANAZone}
|
|
3968
3936
|
*/
|
|
3969
3937
|
static create(e) {
|
|
3970
|
-
let t =
|
|
3971
|
-
return t === void 0 &&
|
|
3938
|
+
let t = is.get(e);
|
|
3939
|
+
return t === void 0 && is.set(e, t = new He(e)), t;
|
|
3972
3940
|
}
|
|
3973
3941
|
/**
|
|
3974
3942
|
* Reset local caches. Should only be necessary in testing scenarios.
|
|
3975
3943
|
* @return {void}
|
|
3976
3944
|
*/
|
|
3977
3945
|
static resetCache() {
|
|
3978
|
-
|
|
3946
|
+
is.clear(), Rs.clear();
|
|
3979
3947
|
}
|
|
3980
3948
|
/**
|
|
3981
3949
|
* Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.
|
|
@@ -4043,7 +4011,7 @@ class He extends on {
|
|
|
4043
4011
|
* @return {string}
|
|
4044
4012
|
*/
|
|
4045
4013
|
offsetName(e, { format: t, locale: s }) {
|
|
4046
|
-
return
|
|
4014
|
+
return Gi(e, t, s, this.name);
|
|
4047
4015
|
}
|
|
4048
4016
|
/**
|
|
4049
4017
|
* Returns the offset's value as a string
|
|
@@ -4069,7 +4037,7 @@ class He extends on {
|
|
|
4069
4037
|
const s = Va(this.name);
|
|
4070
4038
|
let [r, i, o, a, l, c, u] = s.formatToParts ? ja(s, t) : Wa(s, t);
|
|
4071
4039
|
a === "BC" && (r = -Math.abs(r) + 1);
|
|
4072
|
-
const f =
|
|
4040
|
+
const f = Hn({
|
|
4073
4041
|
year: r,
|
|
4074
4042
|
month: i,
|
|
4075
4043
|
day: o,
|
|
@@ -4100,45 +4068,45 @@ class He extends on {
|
|
|
4100
4068
|
return this.valid;
|
|
4101
4069
|
}
|
|
4102
4070
|
}
|
|
4103
|
-
let
|
|
4071
|
+
let Er = {};
|
|
4104
4072
|
function Za(n, e = {}) {
|
|
4105
4073
|
const t = JSON.stringify([n, e]);
|
|
4106
|
-
let s =
|
|
4107
|
-
return s || (s = new Intl.ListFormat(n, e),
|
|
4074
|
+
let s = Er[t];
|
|
4075
|
+
return s || (s = new Intl.ListFormat(n, e), Er[t] = s), s;
|
|
4108
4076
|
}
|
|
4109
|
-
const
|
|
4110
|
-
function
|
|
4077
|
+
const Ns = /* @__PURE__ */ new Map();
|
|
4078
|
+
function xs(n, e = {}) {
|
|
4111
4079
|
const t = JSON.stringify([n, e]);
|
|
4112
|
-
let s =
|
|
4113
|
-
return s === void 0 && (s = new Intl.DateTimeFormat(n, e),
|
|
4080
|
+
let s = Ns.get(t);
|
|
4081
|
+
return s === void 0 && (s = new Intl.DateTimeFormat(n, e), Ns.set(t, s)), s;
|
|
4114
4082
|
}
|
|
4115
|
-
const
|
|
4083
|
+
const Is = /* @__PURE__ */ new Map();
|
|
4116
4084
|
function za(n, e = {}) {
|
|
4117
4085
|
const t = JSON.stringify([n, e]);
|
|
4118
|
-
let s =
|
|
4119
|
-
return s === void 0 && (s = new Intl.NumberFormat(n, e),
|
|
4086
|
+
let s = Is.get(t);
|
|
4087
|
+
return s === void 0 && (s = new Intl.NumberFormat(n, e), Is.set(t, s)), s;
|
|
4120
4088
|
}
|
|
4121
|
-
const
|
|
4089
|
+
const Ds = /* @__PURE__ */ new Map();
|
|
4122
4090
|
function qa(n, e = {}) {
|
|
4123
4091
|
const { base: t, ...s } = e, r = JSON.stringify([n, s]);
|
|
4124
|
-
let i =
|
|
4125
|
-
return i === void 0 && (i = new Intl.RelativeTimeFormat(n, e),
|
|
4092
|
+
let i = Ds.get(r);
|
|
4093
|
+
return i === void 0 && (i = new Intl.RelativeTimeFormat(n, e), Ds.set(r, i)), i;
|
|
4126
4094
|
}
|
|
4127
4095
|
let Ht = null;
|
|
4128
4096
|
function Ba() {
|
|
4129
4097
|
return Ht || (Ht = new Intl.DateTimeFormat().resolvedOptions().locale, Ht);
|
|
4130
4098
|
}
|
|
4131
|
-
const Ds = /* @__PURE__ */ new Map();
|
|
4132
|
-
function Pi(n) {
|
|
4133
|
-
let e = Ds.get(n);
|
|
4134
|
-
return e === void 0 && (e = new Intl.DateTimeFormat(n).resolvedOptions(), Ds.set(n, e)), e;
|
|
4135
|
-
}
|
|
4136
4099
|
const As = /* @__PURE__ */ new Map();
|
|
4137
|
-
function
|
|
4100
|
+
function Li(n) {
|
|
4138
4101
|
let e = As.get(n);
|
|
4102
|
+
return e === void 0 && (e = new Intl.DateTimeFormat(n).resolvedOptions(), As.set(n, e)), e;
|
|
4103
|
+
}
|
|
4104
|
+
const Cs = /* @__PURE__ */ new Map();
|
|
4105
|
+
function Ha(n) {
|
|
4106
|
+
let e = Cs.get(n);
|
|
4139
4107
|
if (!e) {
|
|
4140
4108
|
const t = new Intl.Locale(n);
|
|
4141
|
-
e = "getWeekInfo" in t ? t.getWeekInfo() : t.weekInfo, "minimalDays" in e || (e = { ...
|
|
4109
|
+
e = "getWeekInfo" in t ? t.getWeekInfo() : t.weekInfo, "minimalDays" in e || (e = { ...Vi, ...e }), Cs.set(n, e);
|
|
4142
4110
|
}
|
|
4143
4111
|
return e;
|
|
4144
4112
|
}
|
|
@@ -4151,10 +4119,10 @@ function Ga(n) {
|
|
|
4151
4119
|
{
|
|
4152
4120
|
let s, r;
|
|
4153
4121
|
try {
|
|
4154
|
-
s =
|
|
4122
|
+
s = xs(n).resolvedOptions(), r = n;
|
|
4155
4123
|
} catch {
|
|
4156
4124
|
const l = n.substring(0, t);
|
|
4157
|
-
s =
|
|
4125
|
+
s = xs(l).resolvedOptions(), r = l;
|
|
4158
4126
|
}
|
|
4159
4127
|
const { numberingSystem: i, calendar: o } = s;
|
|
4160
4128
|
return [r, i, o];
|
|
@@ -4184,7 +4152,7 @@ function fn(n, e, t, s) {
|
|
|
4184
4152
|
return r === "error" ? null : r === "en" ? t(e) : s(e);
|
|
4185
4153
|
}
|
|
4186
4154
|
function Ka(n) {
|
|
4187
|
-
return n.numberingSystem && n.numberingSystem !== "latn" ? !1 : n.numberingSystem === "latn" || !n.locale || n.locale.startsWith("en") ||
|
|
4155
|
+
return n.numberingSystem && n.numberingSystem !== "latn" ? !1 : n.numberingSystem === "latn" || !n.locale || n.locale.startsWith("en") || Li(n.locale).numberingSystem === "latn";
|
|
4188
4156
|
}
|
|
4189
4157
|
class Xa {
|
|
4190
4158
|
constructor(e, t, s) {
|
|
@@ -4200,7 +4168,7 @@ class Xa {
|
|
|
4200
4168
|
const t = this.floor ? Math.floor(e) : e;
|
|
4201
4169
|
return this.inf.format(t);
|
|
4202
4170
|
} else {
|
|
4203
|
-
const t = this.floor ? Math.floor(e) :
|
|
4171
|
+
const t = this.floor ? Math.floor(e) : Hs(e, 3);
|
|
4204
4172
|
return he(t, this.padTo);
|
|
4205
4173
|
}
|
|
4206
4174
|
}
|
|
@@ -4216,7 +4184,7 @@ class el {
|
|
|
4216
4184
|
e.offset !== 0 && He.create(a).valid ? (r = a, this.dt = e) : (r = "UTC", this.dt = e.offset === 0 ? e : e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
|
|
4217
4185
|
} else e.zone.type === "system" ? this.dt = e : e.zone.type === "iana" ? (this.dt = e, r = e.zone.name) : (r = "UTC", this.dt = e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
|
|
4218
4186
|
const i = { ...this.opts };
|
|
4219
|
-
i.timeZone = i.timeZone || r, this.dtf =
|
|
4187
|
+
i.timeZone = i.timeZone || r, this.dtf = xs(t, i);
|
|
4220
4188
|
}
|
|
4221
4189
|
format() {
|
|
4222
4190
|
return this.originalZone ? this.formatToParts().map(({ value: e }) => e).join("") : this.dtf.format(this.dt.toJSDate());
|
|
@@ -4243,7 +4211,7 @@ class el {
|
|
|
4243
4211
|
}
|
|
4244
4212
|
class tl {
|
|
4245
4213
|
constructor(e, t, s) {
|
|
4246
|
-
this.opts = { style: "long", ...s }, !t &&
|
|
4214
|
+
this.opts = { style: "long", ...s }, !t && Bi() && (this.rtf = qa(e, s));
|
|
4247
4215
|
}
|
|
4248
4216
|
format(e, t) {
|
|
4249
4217
|
return this.rtf ? this.rtf.format(e, t) : kl(t, e, this.opts.numeric, this.opts.style !== "long");
|
|
@@ -4252,7 +4220,7 @@ class tl {
|
|
|
4252
4220
|
return this.rtf ? this.rtf.formatToParts(e, t) : [];
|
|
4253
4221
|
}
|
|
4254
4222
|
}
|
|
4255
|
-
const
|
|
4223
|
+
const Vi = {
|
|
4256
4224
|
firstDay: 1,
|
|
4257
4225
|
minimalDays: 4,
|
|
4258
4226
|
weekend: [6, 7]
|
|
@@ -4268,11 +4236,11 @@ class se {
|
|
|
4268
4236
|
);
|
|
4269
4237
|
}
|
|
4270
4238
|
static create(e, t, s, r, i = !1) {
|
|
4271
|
-
const o = e || ce.defaultLocale, a = o || (i ? "en-US" : Ba()), l = t || ce.defaultNumberingSystem, c = s || ce.defaultOutputCalendar, u =
|
|
4239
|
+
const o = e || ce.defaultLocale, a = o || (i ? "en-US" : Ba()), l = t || ce.defaultNumberingSystem, c = s || ce.defaultOutputCalendar, u = Ms(r) || ce.defaultWeekSettings;
|
|
4272
4240
|
return new se(a, l, c, u, o);
|
|
4273
4241
|
}
|
|
4274
4242
|
static resetCache() {
|
|
4275
|
-
Ht = null,
|
|
4243
|
+
Ht = null, Ns.clear(), Is.clear(), Ds.clear(), As.clear(), Cs.clear();
|
|
4276
4244
|
}
|
|
4277
4245
|
static fromObject({ locale: e, numberingSystem: t, outputCalendar: s, weekSettings: r } = {}) {
|
|
4278
4246
|
return se.create(e, t, s, r);
|
|
@@ -4293,7 +4261,7 @@ class se {
|
|
|
4293
4261
|
e.locale || this.specifiedLocale,
|
|
4294
4262
|
e.numberingSystem || this.numberingSystem,
|
|
4295
4263
|
e.outputCalendar || this.outputCalendar,
|
|
4296
|
-
|
|
4264
|
+
Ms(e.weekSettings) || this.weekSettings,
|
|
4297
4265
|
e.defaultToEN || !1
|
|
4298
4266
|
);
|
|
4299
4267
|
}
|
|
@@ -4304,7 +4272,7 @@ class se {
|
|
|
4304
4272
|
return this.clone({ ...e, defaultToEN: !1 });
|
|
4305
4273
|
}
|
|
4306
4274
|
months(e, t = !1) {
|
|
4307
|
-
return fn(this, e,
|
|
4275
|
+
return fn(this, e, Qi, () => {
|
|
4308
4276
|
const s = this.intl === "ja" || this.intl.startsWith("ja-");
|
|
4309
4277
|
t &= !s;
|
|
4310
4278
|
const r = t ? { month: e, day: "numeric" } : { month: e }, i = t ? "format" : "standalone";
|
|
@@ -4316,7 +4284,7 @@ class se {
|
|
|
4316
4284
|
});
|
|
4317
4285
|
}
|
|
4318
4286
|
weekdays(e, t = !1) {
|
|
4319
|
-
return fn(this, e,
|
|
4287
|
+
return fn(this, e, eo, () => {
|
|
4320
4288
|
const s = t ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, r = t ? "format" : "standalone";
|
|
4321
4289
|
return this.weekdaysCache[r][e] || (this.weekdaysCache[r][e] = Qa(
|
|
4322
4290
|
(i) => this.extract(i, s, "weekday")
|
|
@@ -4327,7 +4295,7 @@ class se {
|
|
|
4327
4295
|
return fn(
|
|
4328
4296
|
this,
|
|
4329
4297
|
void 0,
|
|
4330
|
-
() =>
|
|
4298
|
+
() => to,
|
|
4331
4299
|
() => {
|
|
4332
4300
|
if (!this.meridiemCache) {
|
|
4333
4301
|
const e = { hour: "numeric", hourCycle: "h12" };
|
|
@@ -4340,7 +4308,7 @@ class se {
|
|
|
4340
4308
|
);
|
|
4341
4309
|
}
|
|
4342
4310
|
eras(e) {
|
|
4343
|
-
return fn(this, e,
|
|
4311
|
+
return fn(this, e, no, () => {
|
|
4344
4312
|
const t = { era: e };
|
|
4345
4313
|
return this.eraCache[e] || (this.eraCache[e] = [V.utc(-40, 1, 1), V.utc(2017, 1, 1)].map(
|
|
4346
4314
|
(s) => this.extract(s, t, "era")
|
|
@@ -4364,10 +4332,10 @@ class se {
|
|
|
4364
4332
|
return Za(this.intl, e);
|
|
4365
4333
|
}
|
|
4366
4334
|
isEnglish() {
|
|
4367
|
-
return this.locale === "en" || this.locale.toLowerCase() === "en-us" ||
|
|
4335
|
+
return this.locale === "en" || this.locale.toLowerCase() === "en-us" || Li(this.intl).locale.startsWith("en-us");
|
|
4368
4336
|
}
|
|
4369
4337
|
getWeekSettings() {
|
|
4370
|
-
return this.weekSettings ? this.weekSettings :
|
|
4338
|
+
return this.weekSettings ? this.weekSettings : Hi() ? Ha(this.locale) : Vi;
|
|
4371
4339
|
}
|
|
4372
4340
|
getStartOfWeek() {
|
|
4373
4341
|
return this.getWeekSettings().firstDay;
|
|
@@ -4385,14 +4353,14 @@ class se {
|
|
|
4385
4353
|
return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;
|
|
4386
4354
|
}
|
|
4387
4355
|
}
|
|
4388
|
-
let
|
|
4356
|
+
let os = null;
|
|
4389
4357
|
class Ee extends on {
|
|
4390
4358
|
/**
|
|
4391
4359
|
* Get a singleton instance of UTC
|
|
4392
4360
|
* @return {FixedOffsetZone}
|
|
4393
4361
|
*/
|
|
4394
4362
|
static get utcInstance() {
|
|
4395
|
-
return
|
|
4363
|
+
return os === null && (os = new Ee(0)), os;
|
|
4396
4364
|
}
|
|
4397
4365
|
/**
|
|
4398
4366
|
* Get an instance with a specified offset
|
|
@@ -4414,7 +4382,7 @@ class Ee extends on {
|
|
|
4414
4382
|
if (e) {
|
|
4415
4383
|
const t = e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);
|
|
4416
4384
|
if (t)
|
|
4417
|
-
return new Ee(
|
|
4385
|
+
return new Ee(Gn(t[1], t[2]));
|
|
4418
4386
|
}
|
|
4419
4387
|
return null;
|
|
4420
4388
|
}
|
|
@@ -4549,10 +4517,10 @@ function tt(n, e) {
|
|
|
4549
4517
|
return n;
|
|
4550
4518
|
if (ll(n)) {
|
|
4551
4519
|
const t = n.toLowerCase();
|
|
4552
|
-
return t === "default" ? e : t === "local" || t === "system" ?
|
|
4520
|
+
return t === "default" ? e : t === "local" || t === "system" ? qn.instance : t === "utc" || t === "gmt" ? Ee.utcInstance : Ee.parseSpecifier(t) || He.create(n);
|
|
4553
4521
|
} else return rt(n) ? Ee.instance(n) : typeof n == "object" && "offset" in n && typeof n.offset == "function" ? n : new nl(n);
|
|
4554
4522
|
}
|
|
4555
|
-
const
|
|
4523
|
+
const Zs = {
|
|
4556
4524
|
arab: "[٠-٩]",
|
|
4557
4525
|
arabext: "[۰-۹]",
|
|
4558
4526
|
bali: "[᭐-᭙]",
|
|
@@ -4574,7 +4542,7 @@ const js = {
|
|
|
4574
4542
|
thai: "[๐-๙]",
|
|
4575
4543
|
tibt: "[༠-༩]",
|
|
4576
4544
|
latn: "\\d"
|
|
4577
|
-
},
|
|
4545
|
+
}, vr = {
|
|
4578
4546
|
arab: [1632, 1641],
|
|
4579
4547
|
arabext: [1776, 1785],
|
|
4580
4548
|
bali: [6992, 7001],
|
|
@@ -4594,18 +4562,18 @@ const js = {
|
|
|
4594
4562
|
telu: [3174, 3183],
|
|
4595
4563
|
thai: [3664, 3673],
|
|
4596
4564
|
tibt: [3872, 3881]
|
|
4597
|
-
}, sl =
|
|
4565
|
+
}, sl = Zs.hanidec.replace(/[\[|\]]/g, "").split("");
|
|
4598
4566
|
function rl(n) {
|
|
4599
4567
|
let e = parseInt(n, 10);
|
|
4600
4568
|
if (isNaN(e)) {
|
|
4601
4569
|
e = "";
|
|
4602
4570
|
for (let t = 0; t < n.length; t++) {
|
|
4603
4571
|
const s = n.charCodeAt(t);
|
|
4604
|
-
if (n[t].search(
|
|
4572
|
+
if (n[t].search(Zs.hanidec) !== -1)
|
|
4605
4573
|
e += sl.indexOf(n[t]);
|
|
4606
4574
|
else
|
|
4607
|
-
for (const r in
|
|
4608
|
-
const [i, o] =
|
|
4575
|
+
for (const r in vr) {
|
|
4576
|
+
const [i, o] = vr[r];
|
|
4609
4577
|
s >= i && s <= o && (e += s - i);
|
|
4610
4578
|
}
|
|
4611
4579
|
}
|
|
@@ -4613,25 +4581,25 @@ function rl(n) {
|
|
|
4613
4581
|
} else
|
|
4614
4582
|
return e;
|
|
4615
4583
|
}
|
|
4616
|
-
const
|
|
4584
|
+
const $s = /* @__PURE__ */ new Map();
|
|
4617
4585
|
function il() {
|
|
4618
|
-
|
|
4586
|
+
$s.clear();
|
|
4619
4587
|
}
|
|
4620
4588
|
function Ce({ numberingSystem: n }, e = "") {
|
|
4621
4589
|
const t = n || "latn";
|
|
4622
|
-
let s =
|
|
4623
|
-
s === void 0 && (s = /* @__PURE__ */ new Map(),
|
|
4590
|
+
let s = $s.get(t);
|
|
4591
|
+
s === void 0 && (s = /* @__PURE__ */ new Map(), $s.set(t, s));
|
|
4624
4592
|
let r = s.get(e);
|
|
4625
|
-
return r === void 0 && (r = new RegExp(`${
|
|
4593
|
+
return r === void 0 && (r = new RegExp(`${Zs[t]}${e}`), s.set(e, r)), r;
|
|
4626
4594
|
}
|
|
4627
|
-
let
|
|
4595
|
+
let Or = () => Date.now(), kr = "system", br = null, Sr = null, Tr = null, Rr = 60, Nr, xr = null;
|
|
4628
4596
|
class ce {
|
|
4629
4597
|
/**
|
|
4630
4598
|
* Get the callback for returning the current timestamp.
|
|
4631
4599
|
* @type {function}
|
|
4632
4600
|
*/
|
|
4633
4601
|
static get now() {
|
|
4634
|
-
return
|
|
4602
|
+
return Or;
|
|
4635
4603
|
}
|
|
4636
4604
|
/**
|
|
4637
4605
|
* Set the callback for returning the current timestamp.
|
|
@@ -4641,7 +4609,7 @@ class ce {
|
|
|
4641
4609
|
* @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time
|
|
4642
4610
|
*/
|
|
4643
4611
|
static set now(e) {
|
|
4644
|
-
|
|
4612
|
+
Or = e;
|
|
4645
4613
|
}
|
|
4646
4614
|
/**
|
|
4647
4615
|
* Set the default time zone to create DateTimes in. Does not affect existing instances.
|
|
@@ -4649,7 +4617,7 @@ class ce {
|
|
|
4649
4617
|
* @type {string}
|
|
4650
4618
|
*/
|
|
4651
4619
|
static set defaultZone(e) {
|
|
4652
|
-
|
|
4620
|
+
kr = e;
|
|
4653
4621
|
}
|
|
4654
4622
|
/**
|
|
4655
4623
|
* Get the default time zone object currently used to create DateTimes. Does not affect existing instances.
|
|
@@ -4657,49 +4625,49 @@ class ce {
|
|
|
4657
4625
|
* @type {Zone}
|
|
4658
4626
|
*/
|
|
4659
4627
|
static get defaultZone() {
|
|
4660
|
-
return tt(
|
|
4628
|
+
return tt(kr, qn.instance);
|
|
4661
4629
|
}
|
|
4662
4630
|
/**
|
|
4663
4631
|
* Get the default locale to create DateTimes with. Does not affect existing instances.
|
|
4664
4632
|
* @type {string}
|
|
4665
4633
|
*/
|
|
4666
4634
|
static get defaultLocale() {
|
|
4667
|
-
return
|
|
4635
|
+
return br;
|
|
4668
4636
|
}
|
|
4669
4637
|
/**
|
|
4670
4638
|
* Set the default locale to create DateTimes with. Does not affect existing instances.
|
|
4671
4639
|
* @type {string}
|
|
4672
4640
|
*/
|
|
4673
4641
|
static set defaultLocale(e) {
|
|
4674
|
-
|
|
4642
|
+
br = e;
|
|
4675
4643
|
}
|
|
4676
4644
|
/**
|
|
4677
4645
|
* Get the default numbering system to create DateTimes with. Does not affect existing instances.
|
|
4678
4646
|
* @type {string}
|
|
4679
4647
|
*/
|
|
4680
4648
|
static get defaultNumberingSystem() {
|
|
4681
|
-
return
|
|
4649
|
+
return Sr;
|
|
4682
4650
|
}
|
|
4683
4651
|
/**
|
|
4684
4652
|
* Set the default numbering system to create DateTimes with. Does not affect existing instances.
|
|
4685
4653
|
* @type {string}
|
|
4686
4654
|
*/
|
|
4687
4655
|
static set defaultNumberingSystem(e) {
|
|
4688
|
-
|
|
4656
|
+
Sr = e;
|
|
4689
4657
|
}
|
|
4690
4658
|
/**
|
|
4691
4659
|
* Get the default output calendar to create DateTimes with. Does not affect existing instances.
|
|
4692
4660
|
* @type {string}
|
|
4693
4661
|
*/
|
|
4694
4662
|
static get defaultOutputCalendar() {
|
|
4695
|
-
return
|
|
4663
|
+
return Tr;
|
|
4696
4664
|
}
|
|
4697
4665
|
/**
|
|
4698
4666
|
* Set the default output calendar to create DateTimes with. Does not affect existing instances.
|
|
4699
4667
|
* @type {string}
|
|
4700
4668
|
*/
|
|
4701
4669
|
static set defaultOutputCalendar(e) {
|
|
4702
|
-
|
|
4670
|
+
Tr = e;
|
|
4703
4671
|
}
|
|
4704
4672
|
/**
|
|
4705
4673
|
* @typedef {Object} WeekSettings
|
|
@@ -4711,7 +4679,7 @@ class ce {
|
|
|
4711
4679
|
* @return {WeekSettings|null}
|
|
4712
4680
|
*/
|
|
4713
4681
|
static get defaultWeekSettings() {
|
|
4714
|
-
return
|
|
4682
|
+
return xr;
|
|
4715
4683
|
}
|
|
4716
4684
|
/**
|
|
4717
4685
|
* Allows overriding the default locale week settings, i.e. the start of the week, the weekend and
|
|
@@ -4721,14 +4689,14 @@ class ce {
|
|
|
4721
4689
|
* @param {WeekSettings|null} weekSettings
|
|
4722
4690
|
*/
|
|
4723
4691
|
static set defaultWeekSettings(e) {
|
|
4724
|
-
|
|
4692
|
+
xr = Ms(e);
|
|
4725
4693
|
}
|
|
4726
4694
|
/**
|
|
4727
4695
|
* Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.
|
|
4728
4696
|
* @type {number}
|
|
4729
4697
|
*/
|
|
4730
4698
|
static get twoDigitCutoffYear() {
|
|
4731
|
-
return
|
|
4699
|
+
return Rr;
|
|
4732
4700
|
}
|
|
4733
4701
|
/**
|
|
4734
4702
|
* Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.
|
|
@@ -4740,21 +4708,21 @@ class ce {
|
|
|
4740
4708
|
* @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50
|
|
4741
4709
|
*/
|
|
4742
4710
|
static set twoDigitCutoffYear(e) {
|
|
4743
|
-
|
|
4711
|
+
Rr = e % 100;
|
|
4744
4712
|
}
|
|
4745
4713
|
/**
|
|
4746
4714
|
* Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
|
|
4747
4715
|
* @type {boolean}
|
|
4748
4716
|
*/
|
|
4749
4717
|
static get throwOnInvalid() {
|
|
4750
|
-
return
|
|
4718
|
+
return Nr;
|
|
4751
4719
|
}
|
|
4752
4720
|
/**
|
|
4753
4721
|
* Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
|
|
4754
4722
|
* @type {boolean}
|
|
4755
4723
|
*/
|
|
4756
4724
|
static set throwOnInvalid(e) {
|
|
4757
|
-
|
|
4725
|
+
Nr = e;
|
|
4758
4726
|
}
|
|
4759
4727
|
/**
|
|
4760
4728
|
* Reset Luxon's global caches. Should only be necessary in testing scenarios.
|
|
@@ -4772,50 +4740,50 @@ class Fe {
|
|
|
4772
4740
|
return this.explanation ? `${this.reason}: ${this.explanation}` : this.reason;
|
|
4773
4741
|
}
|
|
4774
4742
|
}
|
|
4775
|
-
const
|
|
4743
|
+
const Ui = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Wi = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
|
|
4776
4744
|
function Ne(n, e) {
|
|
4777
4745
|
return new Fe(
|
|
4778
4746
|
"unit out of range",
|
|
4779
4747
|
`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`
|
|
4780
4748
|
);
|
|
4781
4749
|
}
|
|
4782
|
-
function
|
|
4750
|
+
function zs(n, e, t) {
|
|
4783
4751
|
const s = new Date(Date.UTC(n, e - 1, t));
|
|
4784
4752
|
n < 100 && n >= 0 && s.setUTCFullYear(s.getUTCFullYear() - 1900);
|
|
4785
4753
|
const r = s.getUTCDay();
|
|
4786
4754
|
return r === 0 ? 7 : r;
|
|
4787
4755
|
}
|
|
4788
|
-
function
|
|
4789
|
-
return t + (an(n) ?
|
|
4756
|
+
function ji(n, e, t) {
|
|
4757
|
+
return t + (an(n) ? Wi : Ui)[e - 1];
|
|
4790
4758
|
}
|
|
4791
|
-
function
|
|
4792
|
-
const t = an(n) ?
|
|
4759
|
+
function Zi(n, e) {
|
|
4760
|
+
const t = an(n) ? Wi : Ui, s = t.findIndex((i) => i < e), r = e - t[s];
|
|
4793
4761
|
return { month: s + 1, day: r };
|
|
4794
4762
|
}
|
|
4795
|
-
function
|
|
4763
|
+
function qs(n, e) {
|
|
4796
4764
|
return (n - e + 7) % 7 + 1;
|
|
4797
4765
|
}
|
|
4798
|
-
function
|
|
4799
|
-
const { year: s, month: r, day: i } = n, o =
|
|
4766
|
+
function Pn(n, e = 4, t = 1) {
|
|
4767
|
+
const { year: s, month: r, day: i } = n, o = ji(s, r, i), a = qs(zs(s, r, i), t);
|
|
4800
4768
|
let l = Math.floor((o - a + 14 - e) / 7), c;
|
|
4801
|
-
return l < 1 ? (c = s - 1, l = nn(c, e, t)) : l > nn(s, e, t) ? (c = s + 1, l = 1) : c = s, { weekYear: c, weekNumber: l, weekday: a, ...
|
|
4769
|
+
return l < 1 ? (c = s - 1, l = nn(c, e, t)) : l > nn(s, e, t) ? (c = s + 1, l = 1) : c = s, { weekYear: c, weekNumber: l, weekday: a, ...Yn(n) };
|
|
4802
4770
|
}
|
|
4803
|
-
function
|
|
4804
|
-
const { weekYear: s, weekNumber: r, weekday: i } = n, o = zs(
|
|
4771
|
+
function Ir(n, e = 4, t = 1) {
|
|
4772
|
+
const { weekYear: s, weekNumber: r, weekday: i } = n, o = qs(zs(s, 1, e), t), a = Rt(s);
|
|
4805
4773
|
let l = r * 7 + i - o - 7 + e, c;
|
|
4806
4774
|
l < 1 ? (c = s - 1, l += Rt(c)) : l > a ? (c = s + 1, l -= Rt(s)) : c = s;
|
|
4807
|
-
const { month: u, day: h } =
|
|
4808
|
-
return { year: c, month: u, day: h, ...
|
|
4775
|
+
const { month: u, day: h } = Zi(c, l);
|
|
4776
|
+
return { year: c, month: u, day: h, ...Yn(n) };
|
|
4809
4777
|
}
|
|
4810
|
-
function
|
|
4811
|
-
const { year: e, month: t, day: s } = n, r =
|
|
4812
|
-
return { year: e, ordinal: r, ...
|
|
4778
|
+
function as(n) {
|
|
4779
|
+
const { year: e, month: t, day: s } = n, r = ji(e, t, s);
|
|
4780
|
+
return { year: e, ordinal: r, ...Yn(n) };
|
|
4813
4781
|
}
|
|
4814
|
-
function
|
|
4815
|
-
const { year: e, ordinal: t } = n, { month: s, day: r } =
|
|
4816
|
-
return { year: e, month: s, day: r, ...
|
|
4782
|
+
function Dr(n) {
|
|
4783
|
+
const { year: e, ordinal: t } = n, { month: s, day: r } = Zi(e, t);
|
|
4784
|
+
return { year: e, month: s, day: r, ...Yn(n) };
|
|
4817
4785
|
}
|
|
4818
|
-
function
|
|
4786
|
+
function Ar(n, e) {
|
|
4819
4787
|
if (!H(n.localWeekday) || !H(n.localWeekNumber) || !H(n.localWeekYear)) {
|
|
4820
4788
|
if (!H(n.weekday) || !H(n.weekNumber) || !H(n.weekYear))
|
|
4821
4789
|
throw new St(
|
|
@@ -4829,7 +4797,7 @@ function Dr(n, e) {
|
|
|
4829
4797
|
return { minDaysInFirstWeek: 4, startOfWeek: 1 };
|
|
4830
4798
|
}
|
|
4831
4799
|
function ol(n, e = 4, t = 1) {
|
|
4832
|
-
const s =
|
|
4800
|
+
const s = Bn(n.weekYear), r = xe(
|
|
4833
4801
|
n.weekNumber,
|
|
4834
4802
|
1,
|
|
4835
4803
|
nn(n.weekYear, e, t)
|
|
@@ -4837,14 +4805,14 @@ function ol(n, e = 4, t = 1) {
|
|
|
4837
4805
|
return s ? r ? i ? !1 : Ne("weekday", n.weekday) : Ne("week", n.weekNumber) : Ne("weekYear", n.weekYear);
|
|
4838
4806
|
}
|
|
4839
4807
|
function al(n) {
|
|
4840
|
-
const e =
|
|
4808
|
+
const e = Bn(n.year), t = xe(n.ordinal, 1, Rt(n.year));
|
|
4841
4809
|
return e ? t ? !1 : Ne("ordinal", n.ordinal) : Ne("year", n.year);
|
|
4842
4810
|
}
|
|
4843
|
-
function
|
|
4844
|
-
const e =
|
|
4811
|
+
function zi(n) {
|
|
4812
|
+
const e = Bn(n.year), t = xe(n.month, 1, 12), s = xe(n.day, 1, Ln(n.year, n.month));
|
|
4845
4813
|
return e ? t ? s ? !1 : Ne("day", n.day) : Ne("month", n.month) : Ne("year", n.year);
|
|
4846
4814
|
}
|
|
4847
|
-
function
|
|
4815
|
+
function qi(n) {
|
|
4848
4816
|
const { hour: e, minute: t, second: s, millisecond: r } = n, i = xe(e, 0, 23) || e === 24 && t === 0 && s === 0 && r === 0, o = xe(t, 0, 59), a = xe(s, 0, 59), l = xe(r, 0, 999);
|
|
4849
4817
|
return i ? o ? a ? l ? !1 : Ne("millisecond", r) : Ne("second", s) : Ne("minute", t) : Ne("hour", e);
|
|
4850
4818
|
}
|
|
@@ -4854,7 +4822,7 @@ function H(n) {
|
|
|
4854
4822
|
function rt(n) {
|
|
4855
4823
|
return typeof n == "number";
|
|
4856
4824
|
}
|
|
4857
|
-
function
|
|
4825
|
+
function Bn(n) {
|
|
4858
4826
|
return typeof n == "number" && n % 1 === 0;
|
|
4859
4827
|
}
|
|
4860
4828
|
function ll(n) {
|
|
@@ -4863,14 +4831,14 @@ function ll(n) {
|
|
|
4863
4831
|
function cl(n) {
|
|
4864
4832
|
return Object.prototype.toString.call(n) === "[object Date]";
|
|
4865
4833
|
}
|
|
4866
|
-
function
|
|
4834
|
+
function Bi() {
|
|
4867
4835
|
try {
|
|
4868
4836
|
return typeof Intl < "u" && !!Intl.RelativeTimeFormat;
|
|
4869
4837
|
} catch {
|
|
4870
4838
|
return !1;
|
|
4871
4839
|
}
|
|
4872
4840
|
}
|
|
4873
|
-
function
|
|
4841
|
+
function Hi() {
|
|
4874
4842
|
try {
|
|
4875
4843
|
return typeof Intl < "u" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype);
|
|
4876
4844
|
} catch {
|
|
@@ -4880,7 +4848,7 @@ function Bi() {
|
|
|
4880
4848
|
function ul(n) {
|
|
4881
4849
|
return Array.isArray(n) ? n : [n];
|
|
4882
4850
|
}
|
|
4883
|
-
function
|
|
4851
|
+
function Cr(n, e, t) {
|
|
4884
4852
|
if (n.length !== 0)
|
|
4885
4853
|
return n.reduce((s, r) => {
|
|
4886
4854
|
const i = [e(r), r];
|
|
@@ -4893,7 +4861,7 @@ function dl(n, e) {
|
|
|
4893
4861
|
function $t(n, e) {
|
|
4894
4862
|
return Object.prototype.hasOwnProperty.call(n, e);
|
|
4895
4863
|
}
|
|
4896
|
-
function
|
|
4864
|
+
function Ms(n) {
|
|
4897
4865
|
if (n == null)
|
|
4898
4866
|
return null;
|
|
4899
4867
|
if (typeof n != "object")
|
|
@@ -4907,7 +4875,7 @@ function $s(n) {
|
|
|
4907
4875
|
};
|
|
4908
4876
|
}
|
|
4909
4877
|
function xe(n, e, t) {
|
|
4910
|
-
return
|
|
4878
|
+
return Bn(n) && n >= e && n <= t;
|
|
4911
4879
|
}
|
|
4912
4880
|
function fl(n, e) {
|
|
4913
4881
|
return n - e * Math.floor(n / e);
|
|
@@ -4925,13 +4893,13 @@ function ut(n) {
|
|
|
4925
4893
|
if (!(H(n) || n === null || n === ""))
|
|
4926
4894
|
return parseFloat(n);
|
|
4927
4895
|
}
|
|
4928
|
-
function
|
|
4896
|
+
function Bs(n) {
|
|
4929
4897
|
if (!(H(n) || n === null || n === "")) {
|
|
4930
4898
|
const e = parseFloat("0." + n) * 1e3;
|
|
4931
4899
|
return Math.floor(e);
|
|
4932
4900
|
}
|
|
4933
4901
|
}
|
|
4934
|
-
function
|
|
4902
|
+
function Hs(n, e, t = "round") {
|
|
4935
4903
|
const s = 10 ** e;
|
|
4936
4904
|
switch (t) {
|
|
4937
4905
|
case "expand":
|
|
@@ -4954,11 +4922,11 @@ function an(n) {
|
|
|
4954
4922
|
function Rt(n) {
|
|
4955
4923
|
return an(n) ? 366 : 365;
|
|
4956
4924
|
}
|
|
4957
|
-
function
|
|
4925
|
+
function Ln(n, e) {
|
|
4958
4926
|
const t = fl(e - 1, 12) + 1, s = n + (e - t) / 12;
|
|
4959
4927
|
return t === 2 ? an(s) ? 29 : 28 : [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][t - 1];
|
|
4960
4928
|
}
|
|
4961
|
-
function
|
|
4929
|
+
function Hn(n) {
|
|
4962
4930
|
let e = Date.UTC(
|
|
4963
4931
|
n.year,
|
|
4964
4932
|
n.month - 1,
|
|
@@ -4970,17 +4938,17 @@ function Bn(n) {
|
|
|
4970
4938
|
);
|
|
4971
4939
|
return n.year < 100 && n.year >= 0 && (e = new Date(e), e.setUTCFullYear(n.year, n.month - 1, n.day)), +e;
|
|
4972
4940
|
}
|
|
4973
|
-
function
|
|
4974
|
-
return -zs(
|
|
4941
|
+
function $r(n, e, t) {
|
|
4942
|
+
return -qs(zs(n, 1, e), t) + e - 1;
|
|
4975
4943
|
}
|
|
4976
4944
|
function nn(n, e = 4, t = 1) {
|
|
4977
|
-
const s =
|
|
4945
|
+
const s = $r(n, e, t), r = $r(n + 1, e, t);
|
|
4978
4946
|
return (Rt(n) - s + r) / 7;
|
|
4979
4947
|
}
|
|
4980
|
-
function
|
|
4948
|
+
function Fs(n) {
|
|
4981
4949
|
return n > 99 ? n : n > ce.twoDigitCutoffYear ? 1900 + n : 2e3 + n;
|
|
4982
4950
|
}
|
|
4983
|
-
function
|
|
4951
|
+
function Gi(n, e, t, s = null) {
|
|
4984
4952
|
const r = new Date(n), i = {
|
|
4985
4953
|
hourCycle: "h23",
|
|
4986
4954
|
year: "numeric",
|
|
@@ -4993,25 +4961,25 @@ function Hi(n, e, t, s = null) {
|
|
|
4993
4961
|
const o = { timeZoneName: e, ...i }, a = new Intl.DateTimeFormat(t, o).formatToParts(r).find((l) => l.type.toLowerCase() === "timezonename");
|
|
4994
4962
|
return a ? a.value : null;
|
|
4995
4963
|
}
|
|
4996
|
-
function
|
|
4964
|
+
function Gn(n, e) {
|
|
4997
4965
|
let t = parseInt(n, 10);
|
|
4998
4966
|
Number.isNaN(t) && (t = 0);
|
|
4999
4967
|
const s = parseInt(e, 10) || 0, r = t < 0 || Object.is(t, -0) ? -s : s;
|
|
5000
4968
|
return t * 60 + r;
|
|
5001
4969
|
}
|
|
5002
|
-
function
|
|
4970
|
+
function Yi(n) {
|
|
5003
4971
|
const e = Number(n);
|
|
5004
4972
|
if (typeof n == "boolean" || n === "" || !Number.isFinite(e))
|
|
5005
4973
|
throw new we(`Invalid unit value ${n}`);
|
|
5006
4974
|
return e;
|
|
5007
4975
|
}
|
|
5008
|
-
function
|
|
4976
|
+
function Vn(n, e) {
|
|
5009
4977
|
const t = {};
|
|
5010
4978
|
for (const s in n)
|
|
5011
4979
|
if ($t(n, s)) {
|
|
5012
4980
|
const r = n[s];
|
|
5013
4981
|
if (r == null) continue;
|
|
5014
|
-
t[e(s)] =
|
|
4982
|
+
t[e(s)] = Yi(r);
|
|
5015
4983
|
}
|
|
5016
4984
|
return t;
|
|
5017
4985
|
}
|
|
@@ -5028,7 +4996,7 @@ function Xt(n, e) {
|
|
|
5028
4996
|
throw new RangeError(`Value format ${e} is out of range for property format`);
|
|
5029
4997
|
}
|
|
5030
4998
|
}
|
|
5031
|
-
function
|
|
4999
|
+
function Yn(n) {
|
|
5032
5000
|
return dl(n, ["hour", "minute", "second", "millisecond"]);
|
|
5033
5001
|
}
|
|
5034
5002
|
const hl = [
|
|
@@ -5044,7 +5012,7 @@ const hl = [
|
|
|
5044
5012
|
"October",
|
|
5045
5013
|
"November",
|
|
5046
5014
|
"December"
|
|
5047
|
-
],
|
|
5015
|
+
], Ji = [
|
|
5048
5016
|
"Jan",
|
|
5049
5017
|
"Feb",
|
|
5050
5018
|
"Mar",
|
|
@@ -5058,12 +5026,12 @@ const hl = [
|
|
|
5058
5026
|
"Nov",
|
|
5059
5027
|
"Dec"
|
|
5060
5028
|
], ml = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
|
|
5061
|
-
function
|
|
5029
|
+
function Qi(n) {
|
|
5062
5030
|
switch (n) {
|
|
5063
5031
|
case "narrow":
|
|
5064
5032
|
return [...ml];
|
|
5065
5033
|
case "short":
|
|
5066
|
-
return [...
|
|
5034
|
+
return [...Ji];
|
|
5067
5035
|
case "long":
|
|
5068
5036
|
return [...hl];
|
|
5069
5037
|
case "numeric":
|
|
@@ -5074,7 +5042,7 @@ function Ji(n) {
|
|
|
5074
5042
|
return null;
|
|
5075
5043
|
}
|
|
5076
5044
|
}
|
|
5077
|
-
const
|
|
5045
|
+
const Ki = [
|
|
5078
5046
|
"Monday",
|
|
5079
5047
|
"Tuesday",
|
|
5080
5048
|
"Wednesday",
|
|
@@ -5082,23 +5050,23 @@ const Qi = [
|
|
|
5082
5050
|
"Friday",
|
|
5083
5051
|
"Saturday",
|
|
5084
5052
|
"Sunday"
|
|
5085
|
-
],
|
|
5086
|
-
function
|
|
5053
|
+
], Xi = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], pl = ["M", "T", "W", "T", "F", "S", "S"];
|
|
5054
|
+
function eo(n) {
|
|
5087
5055
|
switch (n) {
|
|
5088
5056
|
case "narrow":
|
|
5089
5057
|
return [...pl];
|
|
5090
5058
|
case "short":
|
|
5091
|
-
return [...
|
|
5059
|
+
return [...Xi];
|
|
5092
5060
|
case "long":
|
|
5093
|
-
return [...
|
|
5061
|
+
return [...Ki];
|
|
5094
5062
|
case "numeric":
|
|
5095
5063
|
return ["1", "2", "3", "4", "5", "6", "7"];
|
|
5096
5064
|
default:
|
|
5097
5065
|
return null;
|
|
5098
5066
|
}
|
|
5099
5067
|
}
|
|
5100
|
-
const
|
|
5101
|
-
function
|
|
5068
|
+
const to = ["AM", "PM"], yl = ["Before Christ", "Anno Domini"], gl = ["BC", "AD"], wl = ["B", "A"];
|
|
5069
|
+
function no(n) {
|
|
5102
5070
|
switch (n) {
|
|
5103
5071
|
case "narrow":
|
|
5104
5072
|
return [...wl];
|
|
@@ -5111,16 +5079,16 @@ function to(n) {
|
|
|
5111
5079
|
}
|
|
5112
5080
|
}
|
|
5113
5081
|
function _l(n) {
|
|
5114
|
-
return
|
|
5082
|
+
return to[n.hour < 12 ? 0 : 1];
|
|
5115
5083
|
}
|
|
5116
5084
|
function El(n, e) {
|
|
5117
|
-
return
|
|
5085
|
+
return eo(e)[n.weekday - 1];
|
|
5118
5086
|
}
|
|
5119
5087
|
function vl(n, e) {
|
|
5120
|
-
return
|
|
5088
|
+
return Qi(e)[n.month - 1];
|
|
5121
5089
|
}
|
|
5122
5090
|
function Ol(n, e) {
|
|
5123
|
-
return
|
|
5091
|
+
return no(e)[n.year < 0 ? 0 : 1];
|
|
5124
5092
|
}
|
|
5125
5093
|
function kl(n, e, t = "always", s = !1) {
|
|
5126
5094
|
const r = {
|
|
@@ -5147,33 +5115,33 @@ function kl(n, e, t = "always", s = !1) {
|
|
|
5147
5115
|
const o = Object.is(e, -0) || e < 0, a = Math.abs(e), l = a === 1, c = r[n], u = s ? l ? c[1] : c[2] || c[1] : l ? r[n][0] : n;
|
|
5148
5116
|
return o ? `${a} ${u} ago` : `in ${a} ${u}`;
|
|
5149
5117
|
}
|
|
5150
|
-
function
|
|
5118
|
+
function Mr(n, e) {
|
|
5151
5119
|
let t = "";
|
|
5152
5120
|
for (const s of n)
|
|
5153
5121
|
s.literal ? t += s.val : t += e(s.val);
|
|
5154
5122
|
return t;
|
|
5155
5123
|
}
|
|
5156
5124
|
const bl = {
|
|
5157
|
-
D:
|
|
5158
|
-
DD:
|
|
5159
|
-
DDD:
|
|
5160
|
-
DDDD:
|
|
5161
|
-
t:
|
|
5162
|
-
tt:
|
|
5163
|
-
ttt:
|
|
5164
|
-
tttt:
|
|
5165
|
-
T:
|
|
5166
|
-
TT:
|
|
5167
|
-
TTT:
|
|
5168
|
-
TTTT:
|
|
5169
|
-
f:
|
|
5170
|
-
ff:
|
|
5171
|
-
fff:
|
|
5172
|
-
ffff:
|
|
5173
|
-
F:
|
|
5174
|
-
FF:
|
|
5175
|
-
FFF:
|
|
5176
|
-
FFFF:
|
|
5125
|
+
D: Fn,
|
|
5126
|
+
DD: _i,
|
|
5127
|
+
DDD: Ei,
|
|
5128
|
+
DDDD: vi,
|
|
5129
|
+
t: Oi,
|
|
5130
|
+
tt: ki,
|
|
5131
|
+
ttt: bi,
|
|
5132
|
+
tttt: Si,
|
|
5133
|
+
T: Ti,
|
|
5134
|
+
TT: Ri,
|
|
5135
|
+
TTT: Ni,
|
|
5136
|
+
TTTT: xi,
|
|
5137
|
+
f: Ii,
|
|
5138
|
+
ff: Ai,
|
|
5139
|
+
fff: $i,
|
|
5140
|
+
ffff: Fi,
|
|
5141
|
+
F: Di,
|
|
5142
|
+
FF: Ci,
|
|
5143
|
+
FFF: Mi,
|
|
5144
|
+
FFFF: Pi
|
|
5177
5145
|
};
|
|
5178
5146
|
class _e {
|
|
5179
5147
|
static create(e, t = {}) {
|
|
@@ -5371,7 +5339,7 @@ class _e {
|
|
|
5371
5339
|
return u(d);
|
|
5372
5340
|
}
|
|
5373
5341
|
};
|
|
5374
|
-
return
|
|
5342
|
+
return Mr(_e.parseFormat(t), f);
|
|
5375
5343
|
}
|
|
5376
5344
|
formatDurationFromString(e, t) {
|
|
5377
5345
|
const s = this.opts.signMode === "negativeLargestOnly" ? -1 : 1, r = (u) => {
|
|
@@ -5412,10 +5380,10 @@ class _e {
|
|
|
5412
5380
|
// in order
|
|
5413
5381
|
largestUnit: Object.keys(l.values)[0]
|
|
5414
5382
|
};
|
|
5415
|
-
return
|
|
5383
|
+
return Mr(o, i(l, c));
|
|
5416
5384
|
}
|
|
5417
5385
|
}
|
|
5418
|
-
const
|
|
5386
|
+
const so = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
|
|
5419
5387
|
function Ft(...n) {
|
|
5420
5388
|
const e = n.reduce((t, s) => t + s.source, "");
|
|
5421
5389
|
return RegExp(`^${e}$`);
|
|
@@ -5439,7 +5407,7 @@ function Lt(n, ...e) {
|
|
|
5439
5407
|
}
|
|
5440
5408
|
return [null, null];
|
|
5441
5409
|
}
|
|
5442
|
-
function
|
|
5410
|
+
function ro(...n) {
|
|
5443
5411
|
return (e, t) => {
|
|
5444
5412
|
const s = {};
|
|
5445
5413
|
let r;
|
|
@@ -5448,9 +5416,9 @@ function so(...n) {
|
|
|
5448
5416
|
return [s, null, t + r];
|
|
5449
5417
|
};
|
|
5450
5418
|
}
|
|
5451
|
-
const
|
|
5452
|
-
`${
|
|
5453
|
-
), Al = RegExp(`(?: ${
|
|
5419
|
+
const io = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, Sl = `(?:${io.source}?(?:\\[(${so.source})\\])?)?`, Gs = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, oo = RegExp(`${Gs.source}${Sl}`), Ys = RegExp(`(?:[Tt]${oo.source})?`), Tl = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, Rl = /(\d{4})-?W(\d\d)(?:-?(\d))?/, Nl = /(\d{4})-?(\d{3})/, xl = ro("weekYear", "weekNumber", "weekDay"), Il = ro("year", "ordinal"), Dl = /(\d{4})-(\d\d)-(\d\d)/, ao = RegExp(
|
|
5420
|
+
`${Gs.source} ?(?:${io.source}|(${so.source}))?`
|
|
5421
|
+
), Al = RegExp(`(?: ${ao.source})?`);
|
|
5454
5422
|
function Nt(n, e, t) {
|
|
5455
5423
|
const s = n[e];
|
|
5456
5424
|
return H(s) ? t : et(s);
|
|
@@ -5467,18 +5435,18 @@ function Vt(n, e) {
|
|
|
5467
5435
|
hours: Nt(n, e, 0),
|
|
5468
5436
|
minutes: Nt(n, e + 1, 0),
|
|
5469
5437
|
seconds: Nt(n, e + 2, 0),
|
|
5470
|
-
milliseconds:
|
|
5438
|
+
milliseconds: Bs(n[e + 3])
|
|
5471
5439
|
}, null, e + 4];
|
|
5472
5440
|
}
|
|
5473
5441
|
function ln(n, e) {
|
|
5474
|
-
const t = !n[e] && !n[e + 1], s =
|
|
5442
|
+
const t = !n[e] && !n[e + 1], s = Gn(n[e + 1], n[e + 2]), r = t ? null : Ee.instance(s);
|
|
5475
5443
|
return [{}, r, e + 3];
|
|
5476
5444
|
}
|
|
5477
5445
|
function cn(n, e) {
|
|
5478
5446
|
const t = n[e] ? He.create(n[e]) : null;
|
|
5479
5447
|
return [{}, t, e + 1];
|
|
5480
5448
|
}
|
|
5481
|
-
const $l = RegExp(`^T?${
|
|
5449
|
+
const $l = RegExp(`^T?${Gs.source}$`), Ml = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;
|
|
5482
5450
|
function Fl(n) {
|
|
5483
5451
|
const [e, t, s, r, i, o, a, l, c] = n, u = e[0] === "-", h = l && l[0] === "-", f = (d, m = !1) => d !== void 0 && (m || d && u) ? -d : d;
|
|
5484
5452
|
return [
|
|
@@ -5490,7 +5458,7 @@ function Fl(n) {
|
|
|
5490
5458
|
hours: f(ut(o)),
|
|
5491
5459
|
minutes: f(ut(a)),
|
|
5492
5460
|
seconds: f(ut(l), l === "-0"),
|
|
5493
|
-
milliseconds: f(
|
|
5461
|
+
milliseconds: f(Bs(c), h)
|
|
5494
5462
|
}
|
|
5495
5463
|
];
|
|
5496
5464
|
}
|
|
@@ -5505,15 +5473,15 @@ const Pl = {
|
|
|
5505
5473
|
PDT: -420,
|
|
5506
5474
|
PST: -480
|
|
5507
5475
|
};
|
|
5508
|
-
function
|
|
5476
|
+
function Js(n, e, t, s, r, i, o) {
|
|
5509
5477
|
const a = {
|
|
5510
|
-
year: e.length === 2 ?
|
|
5511
|
-
month:
|
|
5478
|
+
year: e.length === 2 ? Fs(et(e)) : et(e),
|
|
5479
|
+
month: Ji.indexOf(t) + 1,
|
|
5512
5480
|
day: et(s),
|
|
5513
5481
|
hour: et(r),
|
|
5514
5482
|
minute: et(i)
|
|
5515
5483
|
};
|
|
5516
|
-
return o && (a.second = et(o)), n && (a.weekday = n.length > 3 ?
|
|
5484
|
+
return o && (a.second = et(o)), n && (a.weekday = n.length > 3 ? Ki.indexOf(n) + 1 : Xi.indexOf(n) + 1), a;
|
|
5517
5485
|
}
|
|
5518
5486
|
const Ll = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;
|
|
5519
5487
|
function Vl(n) {
|
|
@@ -5530,23 +5498,23 @@ function Vl(n) {
|
|
|
5530
5498
|
c,
|
|
5531
5499
|
u,
|
|
5532
5500
|
h
|
|
5533
|
-
] = n, f =
|
|
5501
|
+
] = n, f = Js(e, r, s, t, i, o, a);
|
|
5534
5502
|
let d;
|
|
5535
|
-
return l ? d = Pl[l] : c ? d = 0 : d =
|
|
5503
|
+
return l ? d = Pl[l] : c ? d = 0 : d = Gn(u, h), [f, new Ee(d)];
|
|
5536
5504
|
}
|
|
5537
5505
|
function Ul(n) {
|
|
5538
5506
|
return n.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
|
|
5539
5507
|
}
|
|
5540
5508
|
const Wl = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, jl = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, Zl = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;
|
|
5541
|
-
function
|
|
5509
|
+
function Fr(n) {
|
|
5542
5510
|
const [, e, t, s, r, i, o, a] = n;
|
|
5543
|
-
return [
|
|
5511
|
+
return [Js(e, r, s, t, i, o, a), Ee.utcInstance];
|
|
5544
5512
|
}
|
|
5545
5513
|
function zl(n) {
|
|
5546
5514
|
const [, e, t, s, r, i, o, a] = n;
|
|
5547
|
-
return [
|
|
5515
|
+
return [Js(e, a, t, s, r, i, o), Ee.utcInstance];
|
|
5548
5516
|
}
|
|
5549
|
-
const ql = Ft(Tl,
|
|
5517
|
+
const ql = Ft(Tl, Ys), Bl = Ft(Rl, Ys), Hl = Ft(Nl, Ys), Gl = Ft(oo), lo = Pt(
|
|
5550
5518
|
Cl,
|
|
5551
5519
|
Vt,
|
|
5552
5520
|
ln,
|
|
@@ -5569,7 +5537,7 @@ const ql = Ft(Tl, Gs), Bl = Ft(Rl, Gs), Hl = Ft(Nl, Gs), Gl = Ft(io), ao = Pt(
|
|
|
5569
5537
|
function Kl(n) {
|
|
5570
5538
|
return Lt(
|
|
5571
5539
|
n,
|
|
5572
|
-
[ql,
|
|
5540
|
+
[ql, lo],
|
|
5573
5541
|
[Bl, Yl],
|
|
5574
5542
|
[Hl, Jl],
|
|
5575
5543
|
[Gl, Ql]
|
|
@@ -5581,8 +5549,8 @@ function Xl(n) {
|
|
|
5581
5549
|
function ec(n) {
|
|
5582
5550
|
return Lt(
|
|
5583
5551
|
n,
|
|
5584
|
-
[Wl,
|
|
5585
|
-
[jl,
|
|
5552
|
+
[Wl, Fr],
|
|
5553
|
+
[jl, Fr],
|
|
5586
5554
|
[Zl, zl]
|
|
5587
5555
|
);
|
|
5588
5556
|
}
|
|
@@ -5593,7 +5561,7 @@ const nc = Pt(Vt);
|
|
|
5593
5561
|
function sc(n) {
|
|
5594
5562
|
return Lt(n, [$l, nc]);
|
|
5595
5563
|
}
|
|
5596
|
-
const rc = Ft(Dl, Al), ic = Ft(
|
|
5564
|
+
const rc = Ft(Dl, Al), ic = Ft(ao), oc = Pt(
|
|
5597
5565
|
Vt,
|
|
5598
5566
|
ln,
|
|
5599
5567
|
cn
|
|
@@ -5601,11 +5569,11 @@ const rc = Ft(Dl, Al), ic = Ft(oo), oc = Pt(
|
|
|
5601
5569
|
function ac(n) {
|
|
5602
5570
|
return Lt(
|
|
5603
5571
|
n,
|
|
5604
|
-
[rc,
|
|
5572
|
+
[rc, lo],
|
|
5605
5573
|
[ic, oc]
|
|
5606
5574
|
);
|
|
5607
5575
|
}
|
|
5608
|
-
const
|
|
5576
|
+
const Pr = "Invalid Duration", co = {
|
|
5609
5577
|
weeks: {
|
|
5610
5578
|
days: 7,
|
|
5611
5579
|
hours: 168,
|
|
@@ -5650,7 +5618,7 @@ const Fr = "Invalid Duration", lo = {
|
|
|
5650
5618
|
seconds: 720 * 60 * 60,
|
|
5651
5619
|
milliseconds: 720 * 60 * 60 * 1e3
|
|
5652
5620
|
},
|
|
5653
|
-
...
|
|
5621
|
+
...co
|
|
5654
5622
|
}, Re = 146097 / 400, vt = 146097 / 4800, cc = {
|
|
5655
5623
|
years: {
|
|
5656
5624
|
quarters: 4,
|
|
@@ -5679,7 +5647,7 @@ const Fr = "Invalid Duration", lo = {
|
|
|
5679
5647
|
seconds: vt * 24 * 60 * 60,
|
|
5680
5648
|
milliseconds: vt * 24 * 60 * 60 * 1e3
|
|
5681
5649
|
},
|
|
5682
|
-
...
|
|
5650
|
+
...co
|
|
5683
5651
|
}, mt = [
|
|
5684
5652
|
"years",
|
|
5685
5653
|
"quarters",
|
|
@@ -5700,14 +5668,14 @@ function Ze(n, e, t = !1) {
|
|
|
5700
5668
|
};
|
|
5701
5669
|
return new ee(s);
|
|
5702
5670
|
}
|
|
5703
|
-
function
|
|
5671
|
+
function uo(n, e) {
|
|
5704
5672
|
let t = e.milliseconds ?? 0;
|
|
5705
5673
|
for (const s of uc.slice(1))
|
|
5706
5674
|
e[s] && (t += e[s] * n[s].milliseconds);
|
|
5707
5675
|
return t;
|
|
5708
5676
|
}
|
|
5709
|
-
function
|
|
5710
|
-
const t =
|
|
5677
|
+
function Lr(n, e) {
|
|
5678
|
+
const t = uo(n, e) < 0 ? -1 : 1;
|
|
5711
5679
|
mt.reduceRight((s, r) => {
|
|
5712
5680
|
if (H(e[r]))
|
|
5713
5681
|
return s;
|
|
@@ -5726,7 +5694,7 @@ function Pr(n, e) {
|
|
|
5726
5694
|
return r;
|
|
5727
5695
|
}, null);
|
|
5728
5696
|
}
|
|
5729
|
-
function
|
|
5697
|
+
function Vr(n) {
|
|
5730
5698
|
const e = {};
|
|
5731
5699
|
for (const [t, s] of Object.entries(n))
|
|
5732
5700
|
s !== 0 && (e[t] = s);
|
|
@@ -5779,7 +5747,7 @@ class ee {
|
|
|
5779
5747
|
`Duration.fromObject: argument expected to be an object, got ${e === null ? "null" : typeof e}`
|
|
5780
5748
|
);
|
|
5781
5749
|
return new ee({
|
|
5782
|
-
values:
|
|
5750
|
+
values: Vn(e, ee.normalizeUnit),
|
|
5783
5751
|
loc: se.fromObject(t),
|
|
5784
5752
|
conversionAccuracy: t.conversionAccuracy,
|
|
5785
5753
|
matrix: t.matrix
|
|
@@ -5882,7 +5850,7 @@ class ee {
|
|
|
5882
5850
|
millisecond: "milliseconds",
|
|
5883
5851
|
milliseconds: "milliseconds"
|
|
5884
5852
|
}[e && e.toLowerCase()];
|
|
5885
|
-
if (!t) throw new
|
|
5853
|
+
if (!t) throw new wi(e);
|
|
5886
5854
|
return t;
|
|
5887
5855
|
}
|
|
5888
5856
|
/**
|
|
@@ -5939,7 +5907,7 @@ class ee {
|
|
|
5939
5907
|
...t,
|
|
5940
5908
|
floor: t.round !== !1 && t.floor !== !1
|
|
5941
5909
|
};
|
|
5942
|
-
return this.isValid ? _e.create(this.loc, s).formatDurationFromString(this, e) :
|
|
5910
|
+
return this.isValid ? _e.create(this.loc, s).formatDurationFromString(this, e) : Pr;
|
|
5943
5911
|
}
|
|
5944
5912
|
/**
|
|
5945
5913
|
* Returns a string representation of a Duration with all units included.
|
|
@@ -5958,7 +5926,7 @@ class ee {
|
|
|
5958
5926
|
* ```
|
|
5959
5927
|
*/
|
|
5960
5928
|
toHuman(e = {}) {
|
|
5961
|
-
if (!this.isValid) return
|
|
5929
|
+
if (!this.isValid) return Pr;
|
|
5962
5930
|
const t = e.showZeros !== !1, s = mt.map((r) => {
|
|
5963
5931
|
const i = this.values[r];
|
|
5964
5932
|
return H(i) || i === 0 && !t ? null : this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...e, unit: r.slice(0, -1) }).format(i);
|
|
@@ -5986,7 +5954,7 @@ class ee {
|
|
|
5986
5954
|
toISO() {
|
|
5987
5955
|
if (!this.isValid) return null;
|
|
5988
5956
|
let e = "P";
|
|
5989
|
-
return this.years !== 0 && (e += this.years + "Y"), (this.months !== 0 || this.quarters !== 0) && (e += this.months + this.quarters * 3 + "M"), this.weeks !== 0 && (e += this.weeks + "W"), this.days !== 0 && (e += this.days + "D"), (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) && (e += "T"), this.hours !== 0 && (e += this.hours + "H"), this.minutes !== 0 && (e += this.minutes + "M"), (this.seconds !== 0 || this.milliseconds !== 0) && (e +=
|
|
5957
|
+
return this.years !== 0 && (e += this.years + "Y"), (this.months !== 0 || this.quarters !== 0) && (e += this.months + this.quarters * 3 + "M"), this.weeks !== 0 && (e += this.weeks + "W"), this.days !== 0 && (e += this.days + "D"), (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) && (e += "T"), this.hours !== 0 && (e += this.hours + "H"), this.minutes !== 0 && (e += this.minutes + "M"), (this.seconds !== 0 || this.milliseconds !== 0) && (e += Hs(this.seconds + this.milliseconds / 1e3, 3) + "S"), e === "P" && (e += "T0S"), e;
|
|
5990
5958
|
}
|
|
5991
5959
|
/**
|
|
5992
5960
|
* Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.
|
|
@@ -6042,7 +6010,7 @@ class ee {
|
|
|
6042
6010
|
* @return {number}
|
|
6043
6011
|
*/
|
|
6044
6012
|
toMillis() {
|
|
6045
|
-
return this.isValid ?
|
|
6013
|
+
return this.isValid ? uo(this.matrix, this.values) : NaN;
|
|
6046
6014
|
}
|
|
6047
6015
|
/**
|
|
6048
6016
|
* Returns an milliseconds value of this Duration. Alias of {@link toMillis}
|
|
@@ -6084,7 +6052,7 @@ class ee {
|
|
|
6084
6052
|
if (!this.isValid) return this;
|
|
6085
6053
|
const t = {};
|
|
6086
6054
|
for (const s of Object.keys(this.values))
|
|
6087
|
-
t[s] =
|
|
6055
|
+
t[s] = Yi(e(this.values[s], s));
|
|
6088
6056
|
return Ze(this, { values: t }, !0);
|
|
6089
6057
|
}
|
|
6090
6058
|
/**
|
|
@@ -6107,7 +6075,7 @@ class ee {
|
|
|
6107
6075
|
*/
|
|
6108
6076
|
set(e) {
|
|
6109
6077
|
if (!this.isValid) return this;
|
|
6110
|
-
const t = { ...this.values, ...
|
|
6078
|
+
const t = { ...this.values, ...Vn(e, ee.normalizeUnit) };
|
|
6111
6079
|
return Ze(this, { values: t });
|
|
6112
6080
|
}
|
|
6113
6081
|
/**
|
|
@@ -6148,7 +6116,7 @@ class ee {
|
|
|
6148
6116
|
normalize() {
|
|
6149
6117
|
if (!this.isValid) return this;
|
|
6150
6118
|
const e = this.toObject();
|
|
6151
|
-
return
|
|
6119
|
+
return Lr(this.matrix, e), Ze(this, { values: e }, !0);
|
|
6152
6120
|
}
|
|
6153
6121
|
/**
|
|
6154
6122
|
* Rescale units to its largest representation
|
|
@@ -6157,7 +6125,7 @@ class ee {
|
|
|
6157
6125
|
*/
|
|
6158
6126
|
rescale() {
|
|
6159
6127
|
if (!this.isValid) return this;
|
|
6160
|
-
const e =
|
|
6128
|
+
const e = Vr(this.normalize().shiftToAll().toObject());
|
|
6161
6129
|
return Ze(this, { values: e }, !0);
|
|
6162
6130
|
}
|
|
6163
6131
|
/**
|
|
@@ -6184,7 +6152,7 @@ class ee {
|
|
|
6184
6152
|
} else rt(r[o]) && (s[o] = r[o]);
|
|
6185
6153
|
for (const o in s)
|
|
6186
6154
|
s[o] !== 0 && (t[i] += o === i ? s[o] : s[o] / this.matrix[i][o]);
|
|
6187
|
-
return
|
|
6155
|
+
return Lr(this.matrix, t), Ze(this, { values: t }, !0);
|
|
6188
6156
|
}
|
|
6189
6157
|
/**
|
|
6190
6158
|
* Shift this Duration to all available units.
|
|
@@ -6222,7 +6190,7 @@ class ee {
|
|
|
6222
6190
|
*/
|
|
6223
6191
|
removeZeros() {
|
|
6224
6192
|
if (!this.isValid) return this;
|
|
6225
|
-
const e =
|
|
6193
|
+
const e = Vr(this.values);
|
|
6226
6194
|
return Ze(this, { values: e }, !0);
|
|
6227
6195
|
}
|
|
6228
6196
|
/**
|
|
@@ -6724,7 +6692,7 @@ class le {
|
|
|
6724
6692
|
* @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p
|
|
6725
6693
|
* @return {string}
|
|
6726
6694
|
*/
|
|
6727
|
-
toLocaleString(e =
|
|
6695
|
+
toLocaleString(e = Fn, t = {}) {
|
|
6728
6696
|
return this.isValid ? _e.create(this.s.loc.clone(t), e).formatInterval(this) : Ot;
|
|
6729
6697
|
}
|
|
6730
6698
|
/**
|
|
@@ -6963,10 +6931,10 @@ class hn {
|
|
|
6963
6931
|
* @return {Object}
|
|
6964
6932
|
*/
|
|
6965
6933
|
static features() {
|
|
6966
|
-
return { relative:
|
|
6934
|
+
return { relative: Bi(), localeWeek: Hi() };
|
|
6967
6935
|
}
|
|
6968
6936
|
}
|
|
6969
|
-
function
|
|
6937
|
+
function Ur(n, e) {
|
|
6970
6938
|
const t = (r) => r.toUTC(0, { keepLocalTime: !0 }).startOf("day").valueOf(), s = t(e) - t(n);
|
|
6971
6939
|
return Math.floor(ee.fromMillis(s).as("days"));
|
|
6972
6940
|
}
|
|
@@ -6978,11 +6946,11 @@ function fc(n, e, t) {
|
|
|
6978
6946
|
[
|
|
6979
6947
|
"weeks",
|
|
6980
6948
|
(l, c) => {
|
|
6981
|
-
const u =
|
|
6949
|
+
const u = Ur(l, c);
|
|
6982
6950
|
return (u - u % 7) / 7;
|
|
6983
6951
|
}
|
|
6984
6952
|
],
|
|
6985
|
-
["days",
|
|
6953
|
+
["days", Ur]
|
|
6986
6954
|
], r = {}, i = n;
|
|
6987
6955
|
let o, a;
|
|
6988
6956
|
for (const [l, c] of s)
|
|
@@ -7002,21 +6970,21 @@ const mc = "missing Intl.DateTimeFormat.formatToParts support";
|
|
|
7002
6970
|
function ne(n, e = (t) => t) {
|
|
7003
6971
|
return { regex: n, deser: ([t]) => e(rl(t)) };
|
|
7004
6972
|
}
|
|
7005
|
-
const pc = " ",
|
|
6973
|
+
const pc = " ", fo = `[ ${pc}]`, ho = new RegExp(fo, "g");
|
|
7006
6974
|
function yc(n) {
|
|
7007
|
-
return n.replace(/\./g, "\\.?").replace(
|
|
6975
|
+
return n.replace(/\./g, "\\.?").replace(ho, fo);
|
|
7008
6976
|
}
|
|
7009
|
-
function
|
|
7010
|
-
return n.replace(/\./g, "").replace(
|
|
6977
|
+
function Wr(n) {
|
|
6978
|
+
return n.replace(/\./g, "").replace(ho, " ").toLowerCase();
|
|
7011
6979
|
}
|
|
7012
6980
|
function $e(n, e) {
|
|
7013
6981
|
return n === null ? null : {
|
|
7014
6982
|
regex: RegExp(n.map(yc).join("|")),
|
|
7015
|
-
deser: ([t]) => n.findIndex((s) =>
|
|
6983
|
+
deser: ([t]) => n.findIndex((s) => Wr(t) === Wr(s)) + e
|
|
7016
6984
|
};
|
|
7017
6985
|
}
|
|
7018
|
-
function
|
|
7019
|
-
return { regex: n, deser: ([, t, s]) =>
|
|
6986
|
+
function jr(n, e) {
|
|
6987
|
+
return { regex: n, deser: ([, t, s]) => Gn(t, s), groups: e };
|
|
7020
6988
|
}
|
|
7021
6989
|
function mn(n) {
|
|
7022
6990
|
return { regex: n, deser: ([e]) => e };
|
|
@@ -7038,7 +7006,7 @@ function wc(n, e) {
|
|
|
7038
7006
|
case "y":
|
|
7039
7007
|
return ne(c);
|
|
7040
7008
|
case "yy":
|
|
7041
|
-
return ne(h,
|
|
7009
|
+
return ne(h, Fs);
|
|
7042
7010
|
case "yyyy":
|
|
7043
7011
|
return ne(i);
|
|
7044
7012
|
case "yyyyy":
|
|
@@ -7110,7 +7078,7 @@ function wc(n, e) {
|
|
|
7110
7078
|
case "kkkk":
|
|
7111
7079
|
return ne(i);
|
|
7112
7080
|
case "kk":
|
|
7113
|
-
return ne(h,
|
|
7081
|
+
return ne(h, Fs);
|
|
7114
7082
|
// weekNumber (W)
|
|
7115
7083
|
case "W":
|
|
7116
7084
|
return ne(a);
|
|
@@ -7131,9 +7099,9 @@ function wc(n, e) {
|
|
|
7131
7099
|
// offset/zone
|
|
7132
7100
|
case "Z":
|
|
7133
7101
|
case "ZZ":
|
|
7134
|
-
return
|
|
7102
|
+
return jr(new RegExp(`([+-]${a.source})(?::(${s.source}))?`), 2);
|
|
7135
7103
|
case "ZZZ":
|
|
7136
|
-
return
|
|
7104
|
+
return jr(new RegExp(`([+-]${a.source})(${s.source})?`), 2);
|
|
7137
7105
|
// we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing
|
|
7138
7106
|
// because we don't have any way to figure out what they are
|
|
7139
7107
|
case "z":
|
|
@@ -7263,27 +7231,27 @@ function kc(n) {
|
|
|
7263
7231
|
}
|
|
7264
7232
|
};
|
|
7265
7233
|
let t = null, s;
|
|
7266
|
-
return H(n.z) || (t = He.create(n.z)), H(n.Z) || (t || (t = new Ee(n.Z)), s = n.Z), H(n.q) || (n.M = (n.q - 1) * 3 + 1), H(n.h) || (n.h < 12 && n.a === 1 ? n.h += 12 : n.h === 12 && n.a === 0 && (n.h = 0)), n.G === 0 && n.y && (n.y = -n.y), H(n.u) || (n.S =
|
|
7234
|
+
return H(n.z) || (t = He.create(n.z)), H(n.Z) || (t || (t = new Ee(n.Z)), s = n.Z), H(n.q) || (n.M = (n.q - 1) * 3 + 1), H(n.h) || (n.h < 12 && n.a === 1 ? n.h += 12 : n.h === 12 && n.a === 0 && (n.h = 0)), n.G === 0 && n.y && (n.y = -n.y), H(n.u) || (n.S = Bs(n.u)), [Object.keys(n).reduce((i, o) => {
|
|
7267
7235
|
const a = e(o);
|
|
7268
7236
|
return a && (i[a] = n[o]), i;
|
|
7269
7237
|
}, {}), t, s];
|
|
7270
7238
|
}
|
|
7271
|
-
let
|
|
7239
|
+
let ls = null;
|
|
7272
7240
|
function bc() {
|
|
7273
|
-
return
|
|
7241
|
+
return ls || (ls = V.fromMillis(1555555555555)), ls;
|
|
7274
7242
|
}
|
|
7275
7243
|
function Sc(n, e) {
|
|
7276
7244
|
if (n.literal)
|
|
7277
7245
|
return n;
|
|
7278
|
-
const t = _e.macroTokenToFormatOpts(n.val), s =
|
|
7246
|
+
const t = _e.macroTokenToFormatOpts(n.val), s = go(t, e);
|
|
7279
7247
|
return s == null || s.includes(void 0) ? n : s;
|
|
7280
7248
|
}
|
|
7281
|
-
function
|
|
7249
|
+
function mo(n, e) {
|
|
7282
7250
|
return Array.prototype.concat(...n.map((t) => Sc(t, e)));
|
|
7283
7251
|
}
|
|
7284
|
-
class
|
|
7252
|
+
class po {
|
|
7285
7253
|
constructor(e, t) {
|
|
7286
|
-
if (this.locale = e, this.format = t, this.tokens =
|
|
7254
|
+
if (this.locale = e, this.format = t, this.tokens = mo(_e.parseFormat(t), e), this.units = this.tokens.map((s) => wc(s, e)), this.disqualifyingUnit = this.units.find((s) => s.invalidReason), !this.disqualifyingUnit) {
|
|
7287
7255
|
const [s, r] = vc(this.units);
|
|
7288
7256
|
this.regex = RegExp(s, "i"), this.handlers = r;
|
|
7289
7257
|
}
|
|
@@ -7315,28 +7283,28 @@ class mo {
|
|
|
7315
7283
|
return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;
|
|
7316
7284
|
}
|
|
7317
7285
|
}
|
|
7318
|
-
function
|
|
7319
|
-
return new
|
|
7286
|
+
function yo(n, e, t) {
|
|
7287
|
+
return new po(n, t).explainFromTokens(e);
|
|
7320
7288
|
}
|
|
7321
7289
|
function Tc(n, e, t) {
|
|
7322
|
-
const { result: s, zone: r, specificOffset: i, invalidReason: o } =
|
|
7290
|
+
const { result: s, zone: r, specificOffset: i, invalidReason: o } = yo(n, e, t);
|
|
7323
7291
|
return [s, r, i, o];
|
|
7324
7292
|
}
|
|
7325
|
-
function
|
|
7293
|
+
function go(n, e) {
|
|
7326
7294
|
if (!n)
|
|
7327
7295
|
return null;
|
|
7328
7296
|
const s = _e.create(e, n).dtFormatter(bc()), r = s.formatToParts(), i = s.resolvedOptions();
|
|
7329
7297
|
return r.map((o) => Ec(o, n, i));
|
|
7330
7298
|
}
|
|
7331
|
-
const
|
|
7299
|
+
const cs = "Invalid DateTime", Zr = 864e13;
|
|
7332
7300
|
function Gt(n) {
|
|
7333
7301
|
return new Fe("unsupported zone", `the zone "${n.name}" is not supported`);
|
|
7334
7302
|
}
|
|
7335
|
-
function cs(n) {
|
|
7336
|
-
return n.weekData === null && (n.weekData = Fn(n.c)), n.weekData;
|
|
7337
|
-
}
|
|
7338
7303
|
function us(n) {
|
|
7339
|
-
return n.
|
|
7304
|
+
return n.weekData === null && (n.weekData = Pn(n.c)), n.weekData;
|
|
7305
|
+
}
|
|
7306
|
+
function ds(n) {
|
|
7307
|
+
return n.localWeekData === null && (n.localWeekData = Pn(
|
|
7340
7308
|
n.c,
|
|
7341
7309
|
n.loc.getMinDaysInFirstWeek(),
|
|
7342
7310
|
n.loc.getStartOfWeek()
|
|
@@ -7353,7 +7321,7 @@ function dt(n, e) {
|
|
|
7353
7321
|
};
|
|
7354
7322
|
return new V({ ...t, ...e, old: t });
|
|
7355
7323
|
}
|
|
7356
|
-
function
|
|
7324
|
+
function wo(n, e, t) {
|
|
7357
7325
|
let s = n - e * 60 * 1e3;
|
|
7358
7326
|
const r = t.offset(s);
|
|
7359
7327
|
if (e === r)
|
|
@@ -7376,14 +7344,14 @@ function pn(n, e) {
|
|
|
7376
7344
|
};
|
|
7377
7345
|
}
|
|
7378
7346
|
function _n(n, e, t) {
|
|
7379
|
-
return
|
|
7347
|
+
return wo(Hn(n), e, t);
|
|
7380
7348
|
}
|
|
7381
|
-
function
|
|
7349
|
+
function zr(n, e) {
|
|
7382
7350
|
const t = n.o, s = n.c.year + Math.trunc(e.years), r = n.c.month + Math.trunc(e.months) + Math.trunc(e.quarters) * 3, i = {
|
|
7383
7351
|
...n.c,
|
|
7384
7352
|
year: s,
|
|
7385
7353
|
month: r,
|
|
7386
|
-
day: Math.min(n.c.day,
|
|
7354
|
+
day: Math.min(n.c.day, Ln(s, r)) + Math.trunc(e.days) + Math.trunc(e.weeks) * 7
|
|
7387
7355
|
}, o = ee.fromObject({
|
|
7388
7356
|
years: e.years - Math.trunc(e.years),
|
|
7389
7357
|
quarters: e.quarters - Math.trunc(e.quarters),
|
|
@@ -7394,8 +7362,8 @@ function Zr(n, e) {
|
|
|
7394
7362
|
minutes: e.minutes,
|
|
7395
7363
|
seconds: e.seconds,
|
|
7396
7364
|
milliseconds: e.milliseconds
|
|
7397
|
-
}).as("milliseconds"), a =
|
|
7398
|
-
let [l, c] =
|
|
7365
|
+
}).as("milliseconds"), a = Hn(i);
|
|
7366
|
+
let [l, c] = wo(a, t, n.zone);
|
|
7399
7367
|
return o !== 0 && (l += o, c = n.zone.offset(l)), { ts: l, o: c };
|
|
7400
7368
|
}
|
|
7401
7369
|
function kt(n, e, t, s, r, i) {
|
|
@@ -7418,7 +7386,7 @@ function yn(n, e, t = !0) {
|
|
|
7418
7386
|
forceSimple: !0
|
|
7419
7387
|
}).formatDateTimeFromString(n, e) : null;
|
|
7420
7388
|
}
|
|
7421
|
-
function
|
|
7389
|
+
function fs(n, e, t) {
|
|
7422
7390
|
const s = n.c.year > 9999 || n.c.year < 0;
|
|
7423
7391
|
let r = "";
|
|
7424
7392
|
if (s && n.c.year >= 0 && (r += "+"), r += he(n.c.year, s ? 6 : 4), t === "year") return r;
|
|
@@ -7428,7 +7396,7 @@ function ds(n, e, t) {
|
|
|
7428
7396
|
} else if (r += he(n.c.month), t === "month") return r;
|
|
7429
7397
|
return r += he(n.c.day), r;
|
|
7430
7398
|
}
|
|
7431
|
-
function
|
|
7399
|
+
function qr(n, e, t, s, r, i, o) {
|
|
7432
7400
|
let a = !t || n.c.millisecond !== 0 || n.c.second !== 0, l = "";
|
|
7433
7401
|
switch (o) {
|
|
7434
7402
|
case "day":
|
|
@@ -7449,7 +7417,7 @@ function zr(n, e, t, s, r, i, o) {
|
|
|
7449
7417
|
}
|
|
7450
7418
|
return r && (n.isOffsetFixed && n.offset === 0 && !i ? l += "Z" : n.o < 0 ? (l += "-", l += he(Math.trunc(-n.o / 60)), l += ":", l += he(Math.trunc(-n.o % 60))) : (l += "+", l += he(Math.trunc(n.o / 60)), l += ":", l += he(Math.trunc(n.o % 60)))), i && (l += "[" + n.zone.ianaName + "]"), l;
|
|
7451
7419
|
}
|
|
7452
|
-
const
|
|
7420
|
+
const _o = {
|
|
7453
7421
|
month: 1,
|
|
7454
7422
|
day: 1,
|
|
7455
7423
|
hour: 0,
|
|
@@ -7505,10 +7473,10 @@ function vn(n) {
|
|
|
7505
7473
|
weekyears: "weekYear",
|
|
7506
7474
|
ordinal: "ordinal"
|
|
7507
7475
|
}[n.toLowerCase()];
|
|
7508
|
-
if (!e) throw new
|
|
7476
|
+
if (!e) throw new wi(n);
|
|
7509
7477
|
return e;
|
|
7510
7478
|
}
|
|
7511
|
-
function
|
|
7479
|
+
function Br(n) {
|
|
7512
7480
|
switch (n.toLowerCase()) {
|
|
7513
7481
|
case "localweekday":
|
|
7514
7482
|
case "localweekdays":
|
|
@@ -7527,10 +7495,10 @@ function Dc(n) {
|
|
|
7527
7495
|
if (Yt === void 0 && (Yt = ce.now()), n.type !== "iana")
|
|
7528
7496
|
return n.offset(Yt);
|
|
7529
7497
|
const e = n.name;
|
|
7530
|
-
let t =
|
|
7531
|
-
return t === void 0 && (t = n.offset(Yt),
|
|
7498
|
+
let t = Ps.get(e);
|
|
7499
|
+
return t === void 0 && (t = n.offset(Yt), Ps.set(e, t)), t;
|
|
7532
7500
|
}
|
|
7533
|
-
function
|
|
7501
|
+
function Hr(n, e) {
|
|
7534
7502
|
const t = tt(e.zone, ce.defaultZone);
|
|
7535
7503
|
if (!t.isValid)
|
|
7536
7504
|
return V.invalid(Gt(t));
|
|
@@ -7540,8 +7508,8 @@ function Br(n, e) {
|
|
|
7540
7508
|
r = ce.now();
|
|
7541
7509
|
else {
|
|
7542
7510
|
for (const l of En)
|
|
7543
|
-
H(n[l]) && (n[l] =
|
|
7544
|
-
const o =
|
|
7511
|
+
H(n[l]) && (n[l] = _o[l]);
|
|
7512
|
+
const o = zi(n) || qi(n);
|
|
7545
7513
|
if (o)
|
|
7546
7514
|
return V.invalid(o);
|
|
7547
7515
|
const a = Dc(t);
|
|
@@ -7549,8 +7517,8 @@ function Br(n, e) {
|
|
|
7549
7517
|
}
|
|
7550
7518
|
return new V({ ts: r, zone: t, loc: s, o: i });
|
|
7551
7519
|
}
|
|
7552
|
-
function
|
|
7553
|
-
const s = H(t.round) ? !0 : t.round, r = H(t.rounding) ? "trunc" : t.rounding, i = (a, l) => (a =
|
|
7520
|
+
function Gr(n, e, t) {
|
|
7521
|
+
const s = H(t.round) ? !0 : t.round, r = H(t.rounding) ? "trunc" : t.rounding, i = (a, l) => (a = Hs(a, s || t.calendary ? 0 : 2, t.calendary ? "round" : r), e.loc.clone(t).relFormatter(t).format(a, l)), o = (a) => t.calendary ? e.hasSame(n, a) ? 0 : e.startOf(a).diff(n.startOf(a), a).get(a) : e.diff(n, a).get(a);
|
|
7554
7522
|
if (t.unit)
|
|
7555
7523
|
return i(o(t.unit), t.unit);
|
|
7556
7524
|
for (const a of t.units) {
|
|
@@ -7560,12 +7528,12 @@ function Hr(n, e, t) {
|
|
|
7560
7528
|
}
|
|
7561
7529
|
return i(n > e ? -0 : 0, t.units[t.units.length - 1]);
|
|
7562
7530
|
}
|
|
7563
|
-
function
|
|
7531
|
+
function Yr(n) {
|
|
7564
7532
|
let e = {}, t;
|
|
7565
7533
|
return n.length > 0 && typeof n[n.length - 1] == "object" ? (e = n[n.length - 1], t = Array.from(n).slice(0, n.length - 1)) : t = Array.from(n), [e, t];
|
|
7566
7534
|
}
|
|
7567
7535
|
let Yt;
|
|
7568
|
-
const
|
|
7536
|
+
const Ps = /* @__PURE__ */ new Map();
|
|
7569
7537
|
class V {
|
|
7570
7538
|
/**
|
|
7571
7539
|
* @access private
|
|
@@ -7617,8 +7585,8 @@ class V {
|
|
|
7617
7585
|
* @return {DateTime}
|
|
7618
7586
|
*/
|
|
7619
7587
|
static local() {
|
|
7620
|
-
const [e, t] =
|
|
7621
|
-
return
|
|
7588
|
+
const [e, t] = Yr(arguments), [s, r, i, o, a, l, c] = t;
|
|
7589
|
+
return Hr({ year: s, month: r, day: i, hour: o, minute: a, second: l, millisecond: c }, e);
|
|
7622
7590
|
}
|
|
7623
7591
|
/**
|
|
7624
7592
|
* Create a DateTime in UTC
|
|
@@ -7646,8 +7614,8 @@ class V {
|
|
|
7646
7614
|
* @return {DateTime}
|
|
7647
7615
|
*/
|
|
7648
7616
|
static utc() {
|
|
7649
|
-
const [e, t] =
|
|
7650
|
-
return e.zone = Ee.utcInstance,
|
|
7617
|
+
const [e, t] = Yr(arguments), [s, r, i, o, a, l, c] = t;
|
|
7618
|
+
return e.zone = Ee.utcInstance, Hr({ year: s, month: r, day: i, hour: o, minute: a, second: l, millisecond: c }, e);
|
|
7651
7619
|
}
|
|
7652
7620
|
/**
|
|
7653
7621
|
* Create a DateTime from a JavaScript Date object. Uses the default zone.
|
|
@@ -7680,7 +7648,7 @@ class V {
|
|
|
7680
7648
|
*/
|
|
7681
7649
|
static fromMillis(e, t = {}) {
|
|
7682
7650
|
if (rt(e))
|
|
7683
|
-
return e < -
|
|
7651
|
+
return e < -Zr || e > Zr ? V.invalid("Timestamp out of range") : new V({
|
|
7684
7652
|
ts: e,
|
|
7685
7653
|
zone: tt(t.zone, ce.defaultZone),
|
|
7686
7654
|
loc: se.fromObject(t)
|
|
@@ -7747,7 +7715,7 @@ class V {
|
|
|
7747
7715
|
const s = tt(t.zone, ce.defaultZone);
|
|
7748
7716
|
if (!s.isValid)
|
|
7749
7717
|
return V.invalid(Gt(s));
|
|
7750
|
-
const r = se.fromObject(t), i =
|
|
7718
|
+
const r = se.fromObject(t), i = Vn(e, Br), { minDaysInFirstWeek: o, startOfWeek: a } = Ar(i, r), l = ce.now(), c = H(t.specificOffset) ? s.offset(l) : t.specificOffset, u = !H(i.ordinal), h = !H(i.year), f = !H(i.month) || !H(i.day), d = h || f, m = i.weekYear || i.weekNumber;
|
|
7751
7719
|
if ((d || u) && m)
|
|
7752
7720
|
throw new St(
|
|
7753
7721
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
@@ -7756,16 +7724,16 @@ class V {
|
|
|
7756
7724
|
throw new St("Can't mix ordinal dates with month/day");
|
|
7757
7725
|
const O = m || i.weekday && !d;
|
|
7758
7726
|
let y, w, b = pn(l, c);
|
|
7759
|
-
O ? (y = xc, w = Rc, b =
|
|
7727
|
+
O ? (y = xc, w = Rc, b = Pn(b, o, a)) : u ? (y = Ic, w = Nc, b = as(b)) : (y = En, w = _o);
|
|
7760
7728
|
let N = !1;
|
|
7761
7729
|
for (const g of y) {
|
|
7762
7730
|
const k = i[g];
|
|
7763
7731
|
H(k) ? N ? i[g] = w[g] : i[g] = b[g] : N = !0;
|
|
7764
7732
|
}
|
|
7765
|
-
const p = O ? ol(i, o, a) : u ? al(i) :
|
|
7733
|
+
const p = O ? ol(i, o, a) : u ? al(i) : zi(i), T = p || qi(i);
|
|
7766
7734
|
if (T)
|
|
7767
7735
|
return V.invalid(T);
|
|
7768
|
-
const C = O ?
|
|
7736
|
+
const C = O ? Ir(i, o, a) : u ? Dr(i) : i, [v, Z] = _n(C, c, s), x = new V({
|
|
7769
7737
|
ts: v,
|
|
7770
7738
|
zone: s,
|
|
7771
7739
|
o: Z,
|
|
@@ -7920,7 +7888,7 @@ class V {
|
|
|
7920
7888
|
* @returns {string}
|
|
7921
7889
|
*/
|
|
7922
7890
|
static parseFormatForOpts(e, t = {}) {
|
|
7923
|
-
const s =
|
|
7891
|
+
const s = go(e, se.fromObject(t));
|
|
7924
7892
|
return s ? s.map((r) => r ? r.val : null).join("") : null;
|
|
7925
7893
|
}
|
|
7926
7894
|
/**
|
|
@@ -7931,10 +7899,10 @@ class V {
|
|
|
7931
7899
|
* @returns {string}
|
|
7932
7900
|
*/
|
|
7933
7901
|
static expandFormat(e, t = {}) {
|
|
7934
|
-
return
|
|
7902
|
+
return mo(_e.parseFormat(e), se.fromObject(t)).map((r) => r.val).join("");
|
|
7935
7903
|
}
|
|
7936
7904
|
static resetCache() {
|
|
7937
|
-
Yt = void 0,
|
|
7905
|
+
Yt = void 0, Ps.clear();
|
|
7938
7906
|
}
|
|
7939
7907
|
// INFO
|
|
7940
7908
|
/**
|
|
@@ -8079,7 +8047,7 @@ class V {
|
|
|
8079
8047
|
* @type {number}
|
|
8080
8048
|
*/
|
|
8081
8049
|
get weekYear() {
|
|
8082
|
-
return this.isValid ?
|
|
8050
|
+
return this.isValid ? us(this).weekYear : NaN;
|
|
8083
8051
|
}
|
|
8084
8052
|
/**
|
|
8085
8053
|
* Get the week number of the week year (1-52ish).
|
|
@@ -8088,7 +8056,7 @@ class V {
|
|
|
8088
8056
|
* @type {number}
|
|
8089
8057
|
*/
|
|
8090
8058
|
get weekNumber() {
|
|
8091
|
-
return this.isValid ?
|
|
8059
|
+
return this.isValid ? us(this).weekNumber : NaN;
|
|
8092
8060
|
}
|
|
8093
8061
|
/**
|
|
8094
8062
|
* Get the day of the week.
|
|
@@ -8098,7 +8066,7 @@ class V {
|
|
|
8098
8066
|
* @type {number}
|
|
8099
8067
|
*/
|
|
8100
8068
|
get weekday() {
|
|
8101
|
-
return this.isValid ?
|
|
8069
|
+
return this.isValid ? us(this).weekday : NaN;
|
|
8102
8070
|
}
|
|
8103
8071
|
/**
|
|
8104
8072
|
* Returns true if this date is on a weekend according to the locale, false otherwise
|
|
@@ -8114,7 +8082,7 @@ class V {
|
|
|
8114
8082
|
* @returns {number}
|
|
8115
8083
|
*/
|
|
8116
8084
|
get localWeekday() {
|
|
8117
|
-
return this.isValid ?
|
|
8085
|
+
return this.isValid ? ds(this).weekday : NaN;
|
|
8118
8086
|
}
|
|
8119
8087
|
/**
|
|
8120
8088
|
* Get the week number of the week year according to the locale. Different locales assign week numbers differently,
|
|
@@ -8123,7 +8091,7 @@ class V {
|
|
|
8123
8091
|
* @returns {number}
|
|
8124
8092
|
*/
|
|
8125
8093
|
get localWeekNumber() {
|
|
8126
|
-
return this.isValid ?
|
|
8094
|
+
return this.isValid ? ds(this).weekNumber : NaN;
|
|
8127
8095
|
}
|
|
8128
8096
|
/**
|
|
8129
8097
|
* Get the week year according to the locale. Different locales assign week numbers (and therefor week years)
|
|
@@ -8131,7 +8099,7 @@ class V {
|
|
|
8131
8099
|
* @returns {number}
|
|
8132
8100
|
*/
|
|
8133
8101
|
get localWeekYear() {
|
|
8134
|
-
return this.isValid ?
|
|
8102
|
+
return this.isValid ? ds(this).weekYear : NaN;
|
|
8135
8103
|
}
|
|
8136
8104
|
/**
|
|
8137
8105
|
* Get the ordinal (meaning the day of the year)
|
|
@@ -8139,7 +8107,7 @@ class V {
|
|
|
8139
8107
|
* @type {number|DateTime}
|
|
8140
8108
|
*/
|
|
8141
8109
|
get ordinal() {
|
|
8142
|
-
return this.isValid ?
|
|
8110
|
+
return this.isValid ? as(this.c).ordinal : NaN;
|
|
8143
8111
|
}
|
|
8144
8112
|
/**
|
|
8145
8113
|
* Get the human readable short month name, such as 'Oct'.
|
|
@@ -8232,7 +8200,7 @@ class V {
|
|
|
8232
8200
|
getPossibleOffsets() {
|
|
8233
8201
|
if (!this.isValid || this.isOffsetFixed)
|
|
8234
8202
|
return [this];
|
|
8235
|
-
const e = 864e5, t = 6e4, s =
|
|
8203
|
+
const e = 864e5, t = 6e4, s = Hn(this.c), r = this.zone.offset(s - e), i = this.zone.offset(s + e), o = this.zone.offset(s - r * t), a = this.zone.offset(s - i * t);
|
|
8236
8204
|
if (o === a)
|
|
8237
8205
|
return [this];
|
|
8238
8206
|
const l = s - o * t, c = s - a * t, u = pn(l, o), h = pn(c, a);
|
|
@@ -8254,7 +8222,7 @@ class V {
|
|
|
8254
8222
|
* @type {number}
|
|
8255
8223
|
*/
|
|
8256
8224
|
get daysInMonth() {
|
|
8257
|
-
return
|
|
8225
|
+
return Ln(this.year, this.month);
|
|
8258
8226
|
}
|
|
8259
8227
|
/**
|
|
8260
8228
|
* Returns the number of days in this DateTime's year
|
|
@@ -8378,7 +8346,7 @@ class V {
|
|
|
8378
8346
|
*/
|
|
8379
8347
|
set(e) {
|
|
8380
8348
|
if (!this.isValid) return this;
|
|
8381
|
-
const t =
|
|
8349
|
+
const t = Vn(e, Br), { minDaysInFirstWeek: s, startOfWeek: r } = Ar(t, this.loc), i = !H(t.weekYear) || !H(t.weekNumber) || !H(t.weekday), o = !H(t.ordinal), a = !H(t.year), l = !H(t.month) || !H(t.day), c = a || l, u = t.weekYear || t.weekNumber;
|
|
8382
8350
|
if ((c || o) && u)
|
|
8383
8351
|
throw new St(
|
|
8384
8352
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
@@ -8386,11 +8354,11 @@ class V {
|
|
|
8386
8354
|
if (l && o)
|
|
8387
8355
|
throw new St("Can't mix ordinal dates with month/day");
|
|
8388
8356
|
let h;
|
|
8389
|
-
i ? h =
|
|
8390
|
-
{ ...
|
|
8357
|
+
i ? h = Ir(
|
|
8358
|
+
{ ...Pn(this.c, s, r), ...t },
|
|
8391
8359
|
s,
|
|
8392
8360
|
r
|
|
8393
|
-
) : H(t.ordinal) ? (h = { ...this.toObject(), ...t }, H(t.day) && (h.day = Math.min(
|
|
8361
|
+
) : H(t.ordinal) ? (h = { ...this.toObject(), ...t }, H(t.day) && (h.day = Math.min(Ln(h.year, h.month), h.day))) : h = Dr({ ...as(this.c), ...t });
|
|
8394
8362
|
const [f, d] = _n(h, this.o, this.zone);
|
|
8395
8363
|
return dt(this, { ts: f, o: d });
|
|
8396
8364
|
}
|
|
@@ -8410,7 +8378,7 @@ class V {
|
|
|
8410
8378
|
plus(e) {
|
|
8411
8379
|
if (!this.isValid) return this;
|
|
8412
8380
|
const t = ee.fromDurationLike(e);
|
|
8413
|
-
return dt(this,
|
|
8381
|
+
return dt(this, zr(this, t));
|
|
8414
8382
|
}
|
|
8415
8383
|
/**
|
|
8416
8384
|
* Subtract a period of time to this DateTime and return the resulting DateTime
|
|
@@ -8421,7 +8389,7 @@ class V {
|
|
|
8421
8389
|
minus(e) {
|
|
8422
8390
|
if (!this.isValid) return this;
|
|
8423
8391
|
const t = ee.fromDurationLike(e).negate();
|
|
8424
|
-
return dt(this,
|
|
8392
|
+
return dt(this, zr(this, t));
|
|
8425
8393
|
}
|
|
8426
8394
|
/**
|
|
8427
8395
|
* "Set" this DateTime to the beginning of a unit of time.
|
|
@@ -8501,7 +8469,7 @@ class V {
|
|
|
8501
8469
|
* @return {string}
|
|
8502
8470
|
*/
|
|
8503
8471
|
toFormat(e, t = {}) {
|
|
8504
|
-
return this.isValid ? _e.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this, e) :
|
|
8472
|
+
return this.isValid ? _e.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this, e) : cs;
|
|
8505
8473
|
}
|
|
8506
8474
|
/**
|
|
8507
8475
|
* Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.
|
|
@@ -8522,8 +8490,8 @@ class V {
|
|
|
8522
8490
|
* @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'
|
|
8523
8491
|
* @return {string}
|
|
8524
8492
|
*/
|
|
8525
|
-
toLocaleString(e =
|
|
8526
|
-
return this.isValid ? _e.create(this.loc.clone(t), e).formatDateTime(this) :
|
|
8493
|
+
toLocaleString(e = Fn, t = {}) {
|
|
8494
|
+
return this.isValid ? _e.create(this.loc.clone(t), e).formatDateTime(this) : cs;
|
|
8527
8495
|
}
|
|
8528
8496
|
/**
|
|
8529
8497
|
* Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.
|
|
@@ -8570,8 +8538,8 @@ class V {
|
|
|
8570
8538
|
return null;
|
|
8571
8539
|
o = vn(o);
|
|
8572
8540
|
const a = e === "extended";
|
|
8573
|
-
let l =
|
|
8574
|
-
return En.indexOf(o) >= 3 && (l += "T"), l +=
|
|
8541
|
+
let l = fs(this, a, o);
|
|
8542
|
+
return En.indexOf(o) >= 3 && (l += "T"), l += qr(
|
|
8575
8543
|
this,
|
|
8576
8544
|
a,
|
|
8577
8545
|
t,
|
|
@@ -8592,7 +8560,7 @@ class V {
|
|
|
8592
8560
|
* @return {string|null}
|
|
8593
8561
|
*/
|
|
8594
8562
|
toISODate({ format: e = "extended", precision: t = "day" } = {}) {
|
|
8595
|
-
return this.isValid ?
|
|
8563
|
+
return this.isValid ? fs(this, e === "extended", vn(t)) : null;
|
|
8596
8564
|
}
|
|
8597
8565
|
/**
|
|
8598
8566
|
* Returns an ISO 8601-compliant string representation of this DateTime's week date
|
|
@@ -8628,7 +8596,7 @@ class V {
|
|
|
8628
8596
|
format: o = "extended",
|
|
8629
8597
|
precision: a = "milliseconds"
|
|
8630
8598
|
} = {}) {
|
|
8631
|
-
return this.isValid ? (a = vn(a), (r && En.indexOf(a) >= 3 ? "T" : "") +
|
|
8599
|
+
return this.isValid ? (a = vn(a), (r && En.indexOf(a) >= 3 ? "T" : "") + qr(
|
|
8632
8600
|
this,
|
|
8633
8601
|
o === "extended",
|
|
8634
8602
|
t,
|
|
@@ -8664,7 +8632,7 @@ class V {
|
|
|
8664
8632
|
* @return {string|null}
|
|
8665
8633
|
*/
|
|
8666
8634
|
toSQLDate() {
|
|
8667
|
-
return this.isValid ?
|
|
8635
|
+
return this.isValid ? fs(this, !0) : null;
|
|
8668
8636
|
}
|
|
8669
8637
|
/**
|
|
8670
8638
|
* Returns a string representation of this DateTime appropriate for use in SQL Time
|
|
@@ -8702,7 +8670,7 @@ class V {
|
|
|
8702
8670
|
* @return {string}
|
|
8703
8671
|
*/
|
|
8704
8672
|
toString() {
|
|
8705
|
-
return this.isValid ? this.toISO() :
|
|
8673
|
+
return this.isValid ? this.toISO() : cs;
|
|
8706
8674
|
}
|
|
8707
8675
|
/**
|
|
8708
8676
|
* Returns a string representation of this DateTime appropriate for the REPL.
|
|
@@ -8862,7 +8830,7 @@ class V {
|
|
|
8862
8830
|
if (!this.isValid) return null;
|
|
8863
8831
|
const t = e.base || V.fromObject({}, { zone: this.zone }), s = e.padding ? this < t ? -e.padding : e.padding : 0;
|
|
8864
8832
|
let r = ["years", "months", "days", "hours", "minutes", "seconds"], i = e.unit;
|
|
8865
|
-
return Array.isArray(e.unit) && (r = e.unit, i = void 0),
|
|
8833
|
+
return Array.isArray(e.unit) && (r = e.unit, i = void 0), Gr(t, this.plus(s), {
|
|
8866
8834
|
...e,
|
|
8867
8835
|
numeric: "always",
|
|
8868
8836
|
units: r,
|
|
@@ -8883,7 +8851,7 @@ class V {
|
|
|
8883
8851
|
* @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago"
|
|
8884
8852
|
*/
|
|
8885
8853
|
toRelativeCalendar(e = {}) {
|
|
8886
|
-
return this.isValid ?
|
|
8854
|
+
return this.isValid ? Gr(e.base || V.fromObject({}, { zone: this.zone }), this, {
|
|
8887
8855
|
...e,
|
|
8888
8856
|
numeric: "auto",
|
|
8889
8857
|
units: ["years", "months", "days"],
|
|
@@ -8898,7 +8866,7 @@ class V {
|
|
|
8898
8866
|
static min(...e) {
|
|
8899
8867
|
if (!e.every(V.isDateTime))
|
|
8900
8868
|
throw new we("min requires all arguments be DateTimes");
|
|
8901
|
-
return
|
|
8869
|
+
return Cr(e, (t) => t.valueOf(), Math.min);
|
|
8902
8870
|
}
|
|
8903
8871
|
/**
|
|
8904
8872
|
* Return the max of several date times
|
|
@@ -8908,7 +8876,7 @@ class V {
|
|
|
8908
8876
|
static max(...e) {
|
|
8909
8877
|
if (!e.every(V.isDateTime))
|
|
8910
8878
|
throw new we("max requires all arguments be DateTimes");
|
|
8911
|
-
return
|
|
8879
|
+
return Cr(e, (t) => t.valueOf(), Math.max);
|
|
8912
8880
|
}
|
|
8913
8881
|
// MISC
|
|
8914
8882
|
/**
|
|
@@ -8924,7 +8892,7 @@ class V {
|
|
|
8924
8892
|
numberingSystem: i,
|
|
8925
8893
|
defaultToEN: !0
|
|
8926
8894
|
});
|
|
8927
|
-
return
|
|
8895
|
+
return yo(o, e, t);
|
|
8928
8896
|
}
|
|
8929
8897
|
/**
|
|
8930
8898
|
* @deprecated use fromFormatExplain instead
|
|
@@ -8950,7 +8918,7 @@ class V {
|
|
|
8950
8918
|
numberingSystem: r,
|
|
8951
8919
|
defaultToEN: !0
|
|
8952
8920
|
});
|
|
8953
|
-
return new
|
|
8921
|
+
return new po(i, e);
|
|
8954
8922
|
}
|
|
8955
8923
|
/**
|
|
8956
8924
|
* Create a DateTime from an input string and format parser.
|
|
@@ -8992,14 +8960,14 @@ class V {
|
|
|
8992
8960
|
* @type {Object}
|
|
8993
8961
|
*/
|
|
8994
8962
|
static get DATE_SHORT() {
|
|
8995
|
-
return
|
|
8963
|
+
return Fn;
|
|
8996
8964
|
}
|
|
8997
8965
|
/**
|
|
8998
8966
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983'
|
|
8999
8967
|
* @type {Object}
|
|
9000
8968
|
*/
|
|
9001
8969
|
static get DATE_MED() {
|
|
9002
|
-
return
|
|
8970
|
+
return _i;
|
|
9003
8971
|
}
|
|
9004
8972
|
/**
|
|
9005
8973
|
* {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'
|
|
@@ -9013,98 +8981,98 @@ class V {
|
|
|
9013
8981
|
* @type {Object}
|
|
9014
8982
|
*/
|
|
9015
8983
|
static get DATE_FULL() {
|
|
9016
|
-
return
|
|
8984
|
+
return Ei;
|
|
9017
8985
|
}
|
|
9018
8986
|
/**
|
|
9019
8987
|
* {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'
|
|
9020
8988
|
* @type {Object}
|
|
9021
8989
|
*/
|
|
9022
8990
|
static get DATE_HUGE() {
|
|
9023
|
-
return
|
|
8991
|
+
return vi;
|
|
9024
8992
|
}
|
|
9025
8993
|
/**
|
|
9026
8994
|
* {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.
|
|
9027
8995
|
* @type {Object}
|
|
9028
8996
|
*/
|
|
9029
8997
|
static get TIME_SIMPLE() {
|
|
9030
|
-
return
|
|
8998
|
+
return Oi;
|
|
9031
8999
|
}
|
|
9032
9000
|
/**
|
|
9033
9001
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.
|
|
9034
9002
|
* @type {Object}
|
|
9035
9003
|
*/
|
|
9036
9004
|
static get TIME_WITH_SECONDS() {
|
|
9037
|
-
return
|
|
9005
|
+
return ki;
|
|
9038
9006
|
}
|
|
9039
9007
|
/**
|
|
9040
9008
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.
|
|
9041
9009
|
* @type {Object}
|
|
9042
9010
|
*/
|
|
9043
9011
|
static get TIME_WITH_SHORT_OFFSET() {
|
|
9044
|
-
return
|
|
9012
|
+
return bi;
|
|
9045
9013
|
}
|
|
9046
9014
|
/**
|
|
9047
9015
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
9048
9016
|
* @type {Object}
|
|
9049
9017
|
*/
|
|
9050
9018
|
static get TIME_WITH_LONG_OFFSET() {
|
|
9051
|
-
return
|
|
9019
|
+
return Si;
|
|
9052
9020
|
}
|
|
9053
9021
|
/**
|
|
9054
9022
|
* {@link DateTime#toLocaleString} format like '09:30', always 24-hour.
|
|
9055
9023
|
* @type {Object}
|
|
9056
9024
|
*/
|
|
9057
9025
|
static get TIME_24_SIMPLE() {
|
|
9058
|
-
return
|
|
9026
|
+
return Ti;
|
|
9059
9027
|
}
|
|
9060
9028
|
/**
|
|
9061
9029
|
* {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.
|
|
9062
9030
|
* @type {Object}
|
|
9063
9031
|
*/
|
|
9064
9032
|
static get TIME_24_WITH_SECONDS() {
|
|
9065
|
-
return
|
|
9033
|
+
return Ri;
|
|
9066
9034
|
}
|
|
9067
9035
|
/**
|
|
9068
9036
|
* {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.
|
|
9069
9037
|
* @type {Object}
|
|
9070
9038
|
*/
|
|
9071
9039
|
static get TIME_24_WITH_SHORT_OFFSET() {
|
|
9072
|
-
return
|
|
9040
|
+
return Ni;
|
|
9073
9041
|
}
|
|
9074
9042
|
/**
|
|
9075
9043
|
* {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.
|
|
9076
9044
|
* @type {Object}
|
|
9077
9045
|
*/
|
|
9078
9046
|
static get TIME_24_WITH_LONG_OFFSET() {
|
|
9079
|
-
return
|
|
9047
|
+
return xi;
|
|
9080
9048
|
}
|
|
9081
9049
|
/**
|
|
9082
9050
|
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
9083
9051
|
* @type {Object}
|
|
9084
9052
|
*/
|
|
9085
9053
|
static get DATETIME_SHORT() {
|
|
9086
|
-
return
|
|
9054
|
+
return Ii;
|
|
9087
9055
|
}
|
|
9088
9056
|
/**
|
|
9089
9057
|
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
9090
9058
|
* @type {Object}
|
|
9091
9059
|
*/
|
|
9092
9060
|
static get DATETIME_SHORT_WITH_SECONDS() {
|
|
9093
|
-
return
|
|
9061
|
+
return Di;
|
|
9094
9062
|
}
|
|
9095
9063
|
/**
|
|
9096
9064
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
9097
9065
|
* @type {Object}
|
|
9098
9066
|
*/
|
|
9099
9067
|
static get DATETIME_MED() {
|
|
9100
|
-
return
|
|
9068
|
+
return Ai;
|
|
9101
9069
|
}
|
|
9102
9070
|
/**
|
|
9103
9071
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
9104
9072
|
* @type {Object}
|
|
9105
9073
|
*/
|
|
9106
9074
|
static get DATETIME_MED_WITH_SECONDS() {
|
|
9107
|
-
return
|
|
9075
|
+
return Ci;
|
|
9108
9076
|
}
|
|
9109
9077
|
/**
|
|
9110
9078
|
* {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
@@ -9118,28 +9086,28 @@ class V {
|
|
|
9118
9086
|
* @type {Object}
|
|
9119
9087
|
*/
|
|
9120
9088
|
static get DATETIME_FULL() {
|
|
9121
|
-
return
|
|
9089
|
+
return $i;
|
|
9122
9090
|
}
|
|
9123
9091
|
/**
|
|
9124
9092
|
* {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.
|
|
9125
9093
|
* @type {Object}
|
|
9126
9094
|
*/
|
|
9127
9095
|
static get DATETIME_FULL_WITH_SECONDS() {
|
|
9128
|
-
return
|
|
9096
|
+
return Mi;
|
|
9129
9097
|
}
|
|
9130
9098
|
/**
|
|
9131
9099
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
9132
9100
|
* @type {Object}
|
|
9133
9101
|
*/
|
|
9134
9102
|
static get DATETIME_HUGE() {
|
|
9135
|
-
return
|
|
9103
|
+
return Fi;
|
|
9136
9104
|
}
|
|
9137
9105
|
/**
|
|
9138
9106
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
9139
9107
|
* @type {Object}
|
|
9140
9108
|
*/
|
|
9141
9109
|
static get DATETIME_HUGE_WITH_SECONDS() {
|
|
9142
|
-
return
|
|
9110
|
+
return Pi;
|
|
9143
9111
|
}
|
|
9144
9112
|
}
|
|
9145
9113
|
function zt(n) {
|
|
@@ -9161,7 +9129,7 @@ const Ac = (n, e) => {
|
|
|
9161
9129
|
return rn(ge());
|
|
9162
9130
|
n.includeFields.forEach((r) => {
|
|
9163
9131
|
const i = s.fields.find((o) => o.name === r);
|
|
9164
|
-
i ? t[r] =
|
|
9132
|
+
i ? t[r] = Eo(i)?.nullable() : t[r] = ge();
|
|
9165
9133
|
});
|
|
9166
9134
|
}
|
|
9167
9135
|
return We({
|
|
@@ -9177,7 +9145,7 @@ const Ac = (n, e) => {
|
|
|
9177
9145
|
return (!n.required || i) && (r = r.optional()), r;
|
|
9178
9146
|
}, $c = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds !== void 0 || n._seconds !== void 0 && n._nanoseconds !== void 0), {
|
|
9179
9147
|
message: "Must be a valid date"
|
|
9180
|
-
}),
|
|
9148
|
+
}), Eo = (n, e, t) => {
|
|
9181
9149
|
let s;
|
|
9182
9150
|
const r = `${qt(n.description)}
|
|
9183
9151
|
|
|
@@ -9192,17 +9160,17 @@ const Ac = (n, e) => {
|
|
|
9192
9160
|
s = be(), n.length && (s = s.length(n.length, `Must be ${n.length} character(s) long`)), n.minlength && (s = s.min(n.minlength, `Must contain at least ${n.minlength} character(s)`)), n.maxlength && (s = s.max(n.maxlength, `Must contain at most ${n.maxlength} character(s)`)), n.email ? s = s.email("Must be a valid email address") : n.uuid ? s = Oe([s.uuid("Must be a valid UUID"), ke("")]) : n.url ? s = Oe([s.url("Must be a valid URL"), ke("")]) : n.emoji ? s = Oe([s.emoji("Must be a valid emoji"), ke("")]) : n.ip ? s = Oe([s.ip("Must be a valid IP address"), ke("")]) : n.pattern && (!t && a ? s = Oe([s.regex(new RegExp(n.pattern)), s.regex(/^blob:/)], {
|
|
9193
9161
|
message: "Must be a valid value"
|
|
9194
9162
|
}) : s = s.regex(new RegExp(n.pattern), "Must be a valid value")), n.values && (s = Oe([
|
|
9195
|
-
|
|
9163
|
+
$n(n.values, {
|
|
9196
9164
|
message: `Must be one of the following values: ${n.values.join(", ")}`
|
|
9197
9165
|
}),
|
|
9198
|
-
|
|
9166
|
+
ss()
|
|
9199
9167
|
])), r && (s = s.describe(r.trim()));
|
|
9200
9168
|
break;
|
|
9201
9169
|
case "Boolean":
|
|
9202
9170
|
s = Kt(), r && (s = s.describe(r.trim()));
|
|
9203
9171
|
break;
|
|
9204
9172
|
case "Number":
|
|
9205
|
-
n.autoIncrement ? s = Oe([
|
|
9173
|
+
n.autoIncrement ? s = Oe([ss(), ht().int()], {
|
|
9206
9174
|
message: "Must be a valid number"
|
|
9207
9175
|
}) : (s = ht(), n.min && (s = s.min(n.min, `Must be greater than or equal to ${n.min}`)), n.max && (s = s.max(n.max, `Must be less than or equal to ${n.max}`)), n.decimal ? t ? s = s.describe(`${r}Must have ${n.decimal} decimal places`) : s = s.refine((l) => n.decimal ? (l.toString().split(".")[1]?.length || 0) <= n.decimal : !1, {
|
|
9208
9176
|
message: `Must have ${n.decimal} or fewer decimal places`
|
|
@@ -9210,7 +9178,7 @@ const Ac = (n, e) => {
|
|
|
9210
9178
|
s.refine((l) => n.values?.includes(l), {
|
|
9211
9179
|
message: `Must be one of the following values: ${n.values.join(", ")}`
|
|
9212
9180
|
}),
|
|
9213
|
-
|
|
9181
|
+
ss()
|
|
9214
9182
|
])), s = s.describe(`${r}Must be one of the following values: ${n.values.join(", ")}`)) : r && (s = s.describe(r.trim())));
|
|
9215
9183
|
break;
|
|
9216
9184
|
case "Timestamp":
|
|
@@ -9240,7 +9208,7 @@ const Ac = (n, e) => {
|
|
|
9240
9208
|
s = ge();
|
|
9241
9209
|
}
|
|
9242
9210
|
return (!n.required || i || o) && (s = s.optional()), s;
|
|
9243
|
-
},
|
|
9211
|
+
}, ru = (n, e, t, s, r) => {
|
|
9244
9212
|
const { auth: i, softDelete: o } = n, a = {};
|
|
9245
9213
|
n.fields.forEach((c) => {
|
|
9246
9214
|
c.type === "Embedding" || s && c.type === "Computed" || s && (c.name === o?.archivedField || c.name === o?.timestampField) || (K(c) ? (a[c.name] = Cc(c, e, t, s), s ? (c.length && (a[c.name] = a[c.name].describe(`Must contain ${c.length} item(s)`)), c.min && (a[c.name] = a[c.name].describe(`Must contain at least ${c.min} item(s)`)), c.max && (a[c.name] = a[c.name].describe(`Must contain at most ${c.max} item(s)`))) : (c.length && (a[c.name] = a[c.name].refine((u) => c.length && u && Object.keys(u).length === c.length, {
|
|
@@ -9249,7 +9217,7 @@ const Ac = (n, e) => {
|
|
|
9249
9217
|
message: `Must contain at least ${c.min} item(s)`
|
|
9250
9218
|
})), c.max && (a[c.name] = a[c.name].refine((u) => c.max && (!u || Object.keys(u).length <= c.max), {
|
|
9251
9219
|
message: `Must contain at most ${c.max} item(s)`
|
|
9252
|
-
})))) : a[c.name] =
|
|
9220
|
+
})))) : a[c.name] = Eo(c, t, s), r && (a[c.name] = a[c.name].optional()));
|
|
9253
9221
|
}), !s && i && (a.operation = Oe([ke("create"), ke("update"), ke("delete")]).optional(), a.password = be().optional(), a.passwordConfirm = be().optional(), Object.values(e.collections).forEach((c) => {
|
|
9254
9222
|
a[`auth-${c.labels.collection}`] = Kt().optional(), a[`operations-${c.labels.collection}`] = _t(Oe([ke("Read"), ke("Create"), ke("Update"), ke("Delete")])).optional(), a[`restrict-${c.labels.collection}`] = Kt().optional(), c.access.attributeRestrictions?.forEach((u) => {
|
|
9255
9223
|
a[`attribute-${c.labels.collection}-${u.type}`] = Kt().optional();
|
|
@@ -9262,18 +9230,18 @@ const Ac = (n, e) => {
|
|
|
9262
9230
|
}));
|
|
9263
9231
|
const l = We(a);
|
|
9264
9232
|
return n.allowSchemalessFields ? l.passthrough() : l.strict();
|
|
9265
|
-
},
|
|
9233
|
+
}, Jr = async (n, e) => {
|
|
9266
9234
|
if (n) {
|
|
9267
9235
|
const t = await ie(n, e);
|
|
9268
9236
|
if (!t.valid)
|
|
9269
9237
|
throw new Error(`VALIDATION_ERROR: ${t.message}`);
|
|
9270
9238
|
}
|
|
9271
9239
|
}, sn = async (n, e, t, s, r, i) => {
|
|
9272
|
-
await
|
|
9240
|
+
await Jr(s.custom?.preValidate, r);
|
|
9273
9241
|
for (const a of s.fields)
|
|
9274
|
-
await
|
|
9242
|
+
await Jr(a.custom?.preValidate, r);
|
|
9275
9243
|
return Ca(n, t, i).parse(e), e;
|
|
9276
|
-
},
|
|
9244
|
+
}, Qs = (n, e, t, s, r, i, o, a, l, c, u, h, f, d, m, O, y, w, b, N, p) => {
|
|
9277
9245
|
const { fields: T } = o;
|
|
9278
9246
|
T.filter((g) => "unique" in g && g.unique).forEach((g) => {
|
|
9279
9247
|
n !== "delete" && (typeof r[g.name] == "string" || typeof r[g.name] == "number") && (e.set(d(g, r[g.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||")), {
|
|
@@ -9298,7 +9266,7 @@ const Ac = (n, e) => {
|
|
|
9298
9266
|
const v = (g, k) => {
|
|
9299
9267
|
let _ = 1;
|
|
9300
9268
|
ct(k, g, i) && _++, g.fields.forEach((E) => {
|
|
9301
|
-
ct(E, g, i) && JSON.parse(
|
|
9269
|
+
ct(E, g, i) && JSON.parse(es(dn(E, g, i))).includes(k.name) && _++;
|
|
9302
9270
|
});
|
|
9303
9271
|
const A = l[g.labels.collection];
|
|
9304
9272
|
for (const E of A)
|
|
@@ -9310,7 +9278,7 @@ const Ac = (n, e) => {
|
|
|
9310
9278
|
[`${_.name}.${s}`]: h(),
|
|
9311
9279
|
[`${_.name}_Array`]: u(s)
|
|
9312
9280
|
}), k.fields.forEach((F) => {
|
|
9313
|
-
ct(F, k, i) && JSON.parse(
|
|
9281
|
+
ct(F, k, i) && JSON.parse(es(dn(F, k, i))).includes(_.name) && e.update(y(g, F.name, A), {
|
|
9314
9282
|
[`${_.name}_Array`]: u(s)
|
|
9315
9283
|
});
|
|
9316
9284
|
});
|
|
@@ -9354,7 +9322,7 @@ const Ac = (n, e) => {
|
|
|
9354
9322
|
Collection_Path: t,
|
|
9355
9323
|
...M
|
|
9356
9324
|
});
|
|
9357
|
-
const j =
|
|
9325
|
+
const j = Sn(r);
|
|
9358
9326
|
e.update(O(R.Collection_Path, D), {
|
|
9359
9327
|
...P,
|
|
9360
9328
|
...j
|
|
@@ -9366,7 +9334,7 @@ const Ac = (n, e) => {
|
|
|
9366
9334
|
[`${_.name}_Array`]: c(s)
|
|
9367
9335
|
}), p.size++), k.fields.forEach((S) => {
|
|
9368
9336
|
if (ct(S, k, i)) {
|
|
9369
|
-
const q = JSON.parse(
|
|
9337
|
+
const q = JSON.parse(es(dn(S, k, i))), B = {};
|
|
9370
9338
|
q.includes(_.name) && (B[`${g.twoWay}_Array`] = c(s)), Object.keys(j).forEach((re) => {
|
|
9371
9339
|
q.includes(re) && (B[re] = j[re]);
|
|
9372
9340
|
}), Object.keys(B).length > 0 && (e.update(y(g, S.name, D), B), p.size++);
|
|
@@ -9416,7 +9384,7 @@ const Ac = (n, e) => {
|
|
|
9416
9384
|
}, Ve = (n) => {
|
|
9417
9385
|
for (const e in n)
|
|
9418
9386
|
Object.prototype.hasOwnProperty.call(n, e) && (n[e] === void 0 ? delete n[e] : typeof n[e] == "object" && n[e] !== null && Ve(n[e]));
|
|
9419
|
-
},
|
|
9387
|
+
}, Ks = (n) => {
|
|
9420
9388
|
if (n = n.toString(), /[/]|^\.+$|^__.*__$/.test(n))
|
|
9421
9389
|
return !1;
|
|
9422
9390
|
try {
|
|
@@ -9427,7 +9395,7 @@ const Ac = (n, e) => {
|
|
|
9427
9395
|
return !1;
|
|
9428
9396
|
}
|
|
9429
9397
|
return !(new Blob([n]).size > 1500);
|
|
9430
|
-
},
|
|
9398
|
+
}, Qr = async (n, e, t, s = 1e3) => {
|
|
9431
9399
|
let r = 5;
|
|
9432
9400
|
for (; r > 0; )
|
|
9433
9401
|
try {
|
|
@@ -9438,21 +9406,21 @@ const Ac = (n, e) => {
|
|
|
9438
9406
|
throw i;
|
|
9439
9407
|
await new Promise((o) => setTimeout(o, s)), s *= 2;
|
|
9440
9408
|
}
|
|
9441
|
-
},
|
|
9409
|
+
}, Un = (n) => {
|
|
9442
9410
|
if (!n || typeof n != "string")
|
|
9443
9411
|
return "";
|
|
9444
9412
|
let e = n.replace(/[\r\n]/g, "");
|
|
9445
9413
|
if (e = e.replace(/\0/g, ""), e = e.replace(/[\x00-\x08\x0B-\x1F\x7F]/g, ""), e = e.trim(), e.length > 254)
|
|
9446
9414
|
throw new Error("Email address is too long");
|
|
9447
9415
|
return e;
|
|
9448
|
-
},
|
|
9416
|
+
}, hs = (n) => n ? Array.isArray(n) ? n.map((s) => Un(s)).filter((s) => s.length > 0) : Un(n) || "" : "", Mc = (n) => {
|
|
9449
9417
|
if (!n || typeof n != "string")
|
|
9450
9418
|
return "";
|
|
9451
9419
|
let e = n.replace(/[\r\n]/g, " ");
|
|
9452
9420
|
if (e = e.replace(/\0/g, ""), e = e.replace(/[\x00-\x08\x0B-\x1F\x7F]/g, ""), e = e.trim(), e.length > 998)
|
|
9453
9421
|
throw new Error("Email subject is too long");
|
|
9454
9422
|
return e;
|
|
9455
|
-
},
|
|
9423
|
+
}, Kr = (n) => {
|
|
9456
9424
|
if (!n || typeof n != "string")
|
|
9457
9425
|
return "";
|
|
9458
9426
|
let e = n.replace(/\0/g, "");
|
|
@@ -9471,13 +9439,18 @@ const Ac = (n, e) => {
|
|
|
9471
9439
|
);
|
|
9472
9440
|
return t;
|
|
9473
9441
|
};
|
|
9474
|
-
let
|
|
9442
|
+
let ms, vo, On, Oo, Jt, ko, kn, bn, ps = 0;
|
|
9475
9443
|
const Tt = {
|
|
9476
9444
|
getTenant() {
|
|
9477
|
-
|
|
9445
|
+
if (!On)
|
|
9446
|
+
throw new Error("Tenant not provided");
|
|
9447
|
+
return On;
|
|
9448
|
+
},
|
|
9449
|
+
setTenant(n) {
|
|
9450
|
+
On = n;
|
|
9478
9451
|
},
|
|
9479
9452
|
getMode() {
|
|
9480
|
-
return
|
|
9453
|
+
return vo;
|
|
9481
9454
|
},
|
|
9482
9455
|
getTimezone() {
|
|
9483
9456
|
return Oo;
|
|
@@ -9492,50 +9465,81 @@ const Tt = {
|
|
|
9492
9465
|
return ye(t?.[n]);
|
|
9493
9466
|
},
|
|
9494
9467
|
getVersionInfo() {
|
|
9495
|
-
return
|
|
9468
|
+
return kn;
|
|
9496
9469
|
},
|
|
9497
9470
|
getMaintenanceInfo() {
|
|
9498
|
-
return
|
|
9471
|
+
return bn;
|
|
9499
9472
|
}
|
|
9500
|
-
},
|
|
9501
|
-
if (
|
|
9473
|
+
}, iu = async (n, e, t, s, r) => {
|
|
9474
|
+
if (e && (On = e), vo = n, ms && !r)
|
|
9502
9475
|
return Tt;
|
|
9503
9476
|
if (!process.env.STOKER_FB_WEB_APP_CONFIG)
|
|
9504
9477
|
throw new Error("STOKER_FB_WEB_APP_CONFIG not set.");
|
|
9505
|
-
const i = process.env.STOKER_FB_WEB_APP_CONFIG, o = JSON.parse(i)
|
|
9506
|
-
vo = e, Eo = n;
|
|
9507
|
-
const l = (await import(
|
|
9478
|
+
const i = process.env.STOKER_FB_WEB_APP_CONFIG, o = JSON.parse(i), l = (await import(
|
|
9508
9479
|
/* @vite-ignore */
|
|
9509
9480
|
t
|
|
9510
9481
|
)).default;
|
|
9511
9482
|
Jt = l("node", Tt), !r && n === "development" && (process.env.FIREBASE_AUTH_EMULATOR_HOST = "127.0.0.1:9099", process.env.FIREBASE_DATABASE_EMULATOR_HOST = "127.0.0.1:9000", process.env.FIRESTORE_EMULATOR_HOST = "127.0.0.1:8080", process.env.FIREBASE_STORAGE_EMULATOR_HOST = "127.0.0.1:9199");
|
|
9483
|
+
let c = !1;
|
|
9512
9484
|
try {
|
|
9513
|
-
|
|
9485
|
+
ms = ti(), c = !0;
|
|
9514
9486
|
} catch {
|
|
9515
|
-
|
|
9516
|
-
credential:
|
|
9487
|
+
ms = ni({
|
|
9488
|
+
credential: si(),
|
|
9517
9489
|
databaseURL: o.databaseURL,
|
|
9518
9490
|
storageBucket: o.storageBucket,
|
|
9519
9491
|
projectId: o.projectId
|
|
9520
9492
|
});
|
|
9521
9493
|
}
|
|
9522
|
-
const
|
|
9523
|
-
return ko = await Fc(s, Object.keys(
|
|
9524
|
-
|
|
9525
|
-
}, (
|
|
9526
|
-
console.error(
|
|
9527
|
-
}), ue().collection("system_deployment").doc("latest_deploy").onSnapshot((
|
|
9528
|
-
|
|
9529
|
-
}, (
|
|
9530
|
-
console.error(
|
|
9531
|
-
}), await new Promise((
|
|
9532
|
-
const
|
|
9533
|
-
|
|
9494
|
+
const u = await Ge();
|
|
9495
|
+
return ko = await Fc(s, Object.keys(u.collections)), Oo = await ie(Jt.timezone), c || ue().collection("system_deployment").doc("maintenance_mode").onSnapshot((h) => {
|
|
9496
|
+
h.exists ? (bn = h.data(), ie(Jt.onMaintenanceUpdate, ["node", bn.active ? "on" : "off"])) : console.error("Maintenance status not found");
|
|
9497
|
+
}, (h) => {
|
|
9498
|
+
console.error(h.message);
|
|
9499
|
+
}), c || ue().collection("system_deployment").doc("latest_deploy").onSnapshot((h) => {
|
|
9500
|
+
h.exists ? (kn = h.data(), ps++, ps > 1 && ie(Jt.onVersionUpdate, ["node", kn, ps])) : console.error("Version info not found");
|
|
9501
|
+
}, (h) => {
|
|
9502
|
+
console.error(h.message);
|
|
9503
|
+
}), await new Promise((h) => {
|
|
9504
|
+
const f = () => {
|
|
9505
|
+
bn && kn ? h(Tt) : setTimeout(f, 100);
|
|
9534
9506
|
};
|
|
9535
|
-
|
|
9507
|
+
f();
|
|
9536
9508
|
}), Tt;
|
|
9537
|
-
}, { getTenant: Ye, getMode: bo, getTimezone: So, getGlobalConfigModule: Ut, getCustomizationFile: Je, getVersionInfo:
|
|
9538
|
-
const
|
|
9509
|
+
}, { getTenant: Ye, setTenant: ou, getMode: bo, getTimezone: So, getGlobalConfigModule: Ut, getCustomizationFile: Je, getVersionInfo: au, getMaintenanceInfo: lu } = Tt, cu = async (n, e, t, s) => new Promise((r, i) => {
|
|
9510
|
+
const o = jo(n, e, { cwd: t || process.cwd(), env: { ...process.env, ...s } });
|
|
9511
|
+
let a = "";
|
|
9512
|
+
const l = () => {
|
|
9513
|
+
o.kill("SIGINT");
|
|
9514
|
+
}, c = () => {
|
|
9515
|
+
o.kill("SIGTERM");
|
|
9516
|
+
}, u = () => {
|
|
9517
|
+
process.removeListener("SIGINT", l), process.removeListener("SIGTERM", c);
|
|
9518
|
+
};
|
|
9519
|
+
o.stdout.on("data", (h) => {
|
|
9520
|
+
a += h.toString(), console.log(h.toString());
|
|
9521
|
+
}), o.stderr.on("data", (h) => {
|
|
9522
|
+
console.log(h.toString());
|
|
9523
|
+
}), o.on("exit", (h) => {
|
|
9524
|
+
u(), h === 0 ? r(a) : i();
|
|
9525
|
+
}), process.on("SIGINT", l), process.on("SIGTERM", c);
|
|
9526
|
+
}), uu = async () => {
|
|
9527
|
+
const n = process.env.STOKER_FB_WEB_APP_CONFIG;
|
|
9528
|
+
if (!n)
|
|
9529
|
+
throw new Error("Firebase web app config not found");
|
|
9530
|
+
const e = JSON.parse(n);
|
|
9531
|
+
try {
|
|
9532
|
+
return ti();
|
|
9533
|
+
} catch {
|
|
9534
|
+
return ni({
|
|
9535
|
+
credential: si(),
|
|
9536
|
+
databaseURL: e.databaseURL,
|
|
9537
|
+
storageBucket: e.storageBucket,
|
|
9538
|
+
projectId: e.projectId
|
|
9539
|
+
});
|
|
9540
|
+
}
|
|
9541
|
+
}, Ge = async (n = !1) => {
|
|
9542
|
+
const s = await ri().ref("schema").orderByChild("published_time").limitToLast(1).get(), r = Object.values(s.val())[0];
|
|
9539
9543
|
if (n) {
|
|
9540
9544
|
for (const i of Object.values(r.collections))
|
|
9541
9545
|
for (const o of i.fields)
|
|
@@ -9547,8 +9551,8 @@ const Tt = {
|
|
|
9547
9551
|
for (const i of Object.values(r.collections))
|
|
9548
9552
|
i.fields = i.fields.filter((o) => o.type !== "Computed");
|
|
9549
9553
|
return r;
|
|
9550
|
-
},
|
|
9551
|
-
const t = await
|
|
9554
|
+
}, du = async () => {
|
|
9555
|
+
const t = await ri().ref("schema").orderByChild("published_time").limitToLast(2).get();
|
|
9552
9556
|
if (!(t.numChildren() < 2))
|
|
9553
9557
|
return Object.values(t.val())[0];
|
|
9554
9558
|
}, De = (n, e, t) => {
|
|
@@ -9566,8 +9570,8 @@ const Tt = {
|
|
|
9566
9570
|
const d = r.collections?.[l.collection];
|
|
9567
9571
|
if (!r.Role)
|
|
9568
9572
|
throw new Error("PERMISSION_DENIED");
|
|
9569
|
-
const m = d && Te("Read", d), O =
|
|
9570
|
-
const D = [], R =
|
|
9573
|
+
const m = d && Te("Read", d), O = li(a, t, r), y = oi(a, r), w = Ls(a, r), b = ai(a, t, r), N = (E = []) => {
|
|
9574
|
+
const D = [], R = hi(r.Role, a, t);
|
|
9571
9575
|
if (!R)
|
|
9572
9576
|
throw new Error("PERMISSION_DENIED");
|
|
9573
9577
|
if (m) {
|
|
@@ -9790,7 +9794,7 @@ const Tt = {
|
|
|
9790
9794
|
const u = r.collections?.[l.collection];
|
|
9791
9795
|
if (!r.Role)
|
|
9792
9796
|
throw new Error("PERMISSION_DENIED");
|
|
9793
|
-
const h = u && Te("Read", u), f =
|
|
9797
|
+
const h = u && Te("Read", u), f = li(a, s, r), d = [], m = hi(r.Role, a, s);
|
|
9794
9798
|
if (!m)
|
|
9795
9799
|
throw new Error("PERMISSION_DENIED");
|
|
9796
9800
|
if (h)
|
|
@@ -9802,7 +9806,7 @@ const Tt = {
|
|
|
9802
9806
|
} else
|
|
9803
9807
|
return [c.doc(t)];
|
|
9804
9808
|
}, Ro = async (n, e, t, s, r, i, o, a, l, c) => {
|
|
9805
|
-
const u = t.at(-2), h =
|
|
9809
|
+
const u = t.at(-2), h = ci(r.collections[u], r).map((m) => m.labels.collection);
|
|
9806
9810
|
s.collections ? s.collections.forEach((m) => {
|
|
9807
9811
|
if (!h.includes(m))
|
|
9808
9812
|
throw new Error(`SCHEMA_ERROR: Collection ${m} not found in subcollections of ${u}`);
|
|
@@ -9818,14 +9822,14 @@ const Tt = {
|
|
|
9818
9822
|
});
|
|
9819
9823
|
e[m] = O.docs, i && await Promise.all(
|
|
9820
9824
|
// eslint-disable-next-line security/detect-object-injection
|
|
9821
|
-
e[m].map((y) =>
|
|
9825
|
+
e[m].map((y) => Xs(n, y, [...t, m, y.id], i, r, void 0, a, l, c))
|
|
9822
9826
|
), f > 0 && await Promise.all(
|
|
9823
9827
|
// eslint-disable-next-line security/detect-object-injection
|
|
9824
9828
|
e[m].map((y) => Ro(n, y, [...t, m, y.id], { depth: f }, r, i, o, a, l, c))
|
|
9825
9829
|
);
|
|
9826
9830
|
});
|
|
9827
9831
|
await Promise.all(d);
|
|
9828
|
-
},
|
|
9832
|
+
}, Xs = async (n, e, t, s, r, i, o, a, l) => {
|
|
9829
9833
|
const c = t.at(-2);
|
|
9830
9834
|
s.fields ||= r.collections[c].fields.filter((f) => K(f));
|
|
9831
9835
|
const u = s.depth - 1, h = [];
|
|
@@ -9842,7 +9846,7 @@ const Tt = {
|
|
|
9842
9846
|
noEmbeddingFields: l
|
|
9843
9847
|
}).then((b) => {
|
|
9844
9848
|
if (d[O] = b, u > 0)
|
|
9845
|
-
return
|
|
9849
|
+
return Xs(
|
|
9846
9850
|
n,
|
|
9847
9851
|
// eslint-disable-next-line security/detect-object-injection
|
|
9848
9852
|
d[O],
|
|
@@ -9963,7 +9967,7 @@ const Tt = {
|
|
|
9963
9967
|
throw new Error(`SCHEMA_ERROR: Field ${M} not found in collection ${w}`);
|
|
9964
9968
|
}
|
|
9965
9969
|
return M;
|
|
9966
|
-
})), E.push(
|
|
9970
|
+
})), E.push(Xs(
|
|
9967
9971
|
s,
|
|
9968
9972
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9969
9973
|
a.get(A.id),
|
|
@@ -10005,7 +10009,7 @@ const Tt = {
|
|
|
10005
10009
|
await l(c);
|
|
10006
10010
|
}, { readOnly: !0 }), { cursor: o, pages: i, docs: Array.from(a.values()) };
|
|
10007
10011
|
}, xo = async (n, e, t, s, r, i, o, a) => {
|
|
10008
|
-
const l = s.at(-2), c =
|
|
10012
|
+
const l = s.at(-2), c = ci(i.collections[l], i).map((f) => f.labels.collection);
|
|
10009
10013
|
r.collections ? r.collections.forEach((f) => {
|
|
10010
10014
|
if (!c.includes(f))
|
|
10011
10015
|
throw new Error(`SCHEMA_ERROR: Collection ${f} not found in subcollections of ${l}`);
|
|
@@ -10160,7 +10164,7 @@ const Tt = {
|
|
|
10160
10164
|
return;
|
|
10161
10165
|
Ie(d, c);
|
|
10162
10166
|
const m = s[d.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||");
|
|
10163
|
-
if (!
|
|
10167
|
+
if (!Ks(m))
|
|
10164
10168
|
f.push(`${d.name} "${s[d.name]}" is invalid`);
|
|
10165
10169
|
else {
|
|
10166
10170
|
const O = await l.collection("tenants").doc(e).collection("system_unique").doc(u).collection(`Unique-${u}-${d.name}`).doc(m).get();
|
|
@@ -10222,7 +10226,7 @@ ${i}`);
|
|
|
10222
10226
|
n = h;
|
|
10223
10227
|
else
|
|
10224
10228
|
throw new Error("Admin email not set");
|
|
10225
|
-
const f =
|
|
10229
|
+
const f = hs(n), d = Mc(e), m = t ? Kr(t) : void 0, O = s ? Kr(s) : void 0, y = r ? hs(r) : void 0, w = i ? hs(i) : void 0, b = o ? Un(o) : void 0, N = l ? Un(l) : void 0, p = Array.isArray(f) ? f : [f];
|
|
10226
10230
|
if (p.length === 0 || p.length === 1 && !p[0])
|
|
10227
10231
|
throw new Error("No valid email addresses provided");
|
|
10228
10232
|
const T = { to: f, message: { subject: d } };
|
|
@@ -10302,7 +10306,7 @@ ${i}`);
|
|
|
10302
10306
|
}
|
|
10303
10307
|
}
|
|
10304
10308
|
return h.uid;
|
|
10305
|
-
},
|
|
10309
|
+
}, er = async (n, e) => {
|
|
10306
10310
|
const { labels: t, parentCollection: s } = e;
|
|
10307
10311
|
if (s) {
|
|
10308
10312
|
const r = n.at(-2);
|
|
@@ -10315,24 +10319,24 @@ ${i}`);
|
|
|
10315
10319
|
throw new Error("PERMISSION_DENIED");
|
|
10316
10320
|
} else if (n.length > 1)
|
|
10317
10321
|
throw new Error("PERMISSION_DENIED");
|
|
10318
|
-
},
|
|
10322
|
+
}, Wn = (n) => n !== null && typeof n == "object" && !Array.isArray(n), fu = (n) => {
|
|
10319
10323
|
const e = (t) => {
|
|
10320
10324
|
Object.entries(t).forEach(([s, r]) => {
|
|
10321
|
-
|
|
10325
|
+
Wn(r) && Object.keys(r).length === 2 && typeof r.seconds == "number" && typeof r.nanoseconds == "number" ? t[s] = new lt(r.seconds, r.nanoseconds) : Wn(r) && e(r);
|
|
10322
10326
|
});
|
|
10323
10327
|
};
|
|
10324
10328
|
e(n);
|
|
10325
10329
|
}, $o = (n) => {
|
|
10326
10330
|
const e = (t) => {
|
|
10327
10331
|
Object.entries(t).forEach(([s, r]) => {
|
|
10328
|
-
|
|
10332
|
+
Wn(r) && Object.keys(r).length === 2 && typeof r._seconds == "number" && typeof r._nanoseconds == "number" ? t[s] = new lt(r._seconds, r._nanoseconds) : Wn(r) && e(r);
|
|
10329
10333
|
});
|
|
10330
10334
|
};
|
|
10331
10335
|
e(n);
|
|
10332
|
-
},
|
|
10336
|
+
}, tr = (n) => {
|
|
10333
10337
|
if (typeof n == "object")
|
|
10334
10338
|
for (const e in n)
|
|
10335
|
-
Object.prototype.hasOwnProperty.call(n, e) && (n[e] === "_DELETE_FIELD" ? n[e] = me.delete() :
|
|
10339
|
+
Object.prototype.hasOwnProperty.call(n, e) && (n[e] === "_DELETE_FIELD" ? n[e] = me.delete() : tr(n[e]));
|
|
10336
10340
|
}, Lc = (n, e, t) => {
|
|
10337
10341
|
if (K(t) && t.includeFields) {
|
|
10338
10342
|
const s = {};
|
|
@@ -10345,7 +10349,7 @@ ${i}`);
|
|
|
10345
10349
|
}), s;
|
|
10346
10350
|
}
|
|
10347
10351
|
return {};
|
|
10348
|
-
},
|
|
10352
|
+
}, Xr = async (n, e, t, s, r, i, o) => {
|
|
10349
10353
|
if (!K(t) || !t.enforceHierarchy)
|
|
10350
10354
|
return;
|
|
10351
10355
|
const { fields: a } = e, l = ue(), c = Object.entries(s[t.name]);
|
|
@@ -10365,7 +10369,7 @@ ${i}`);
|
|
|
10365
10369
|
throw new Error("VALIDATION_ERROR: Invalid relation hierarchy");
|
|
10366
10370
|
}, gn = async (n, e, t) => {
|
|
10367
10371
|
delete e[n.name][t], e[`${n.name}_Array`] = e[`${n.name}_Array`]?.filter((s) => s !== t), delete e[`${n.name}_Single`];
|
|
10368
|
-
},
|
|
10372
|
+
}, ys = async (n, e, t, s, r) => {
|
|
10369
10373
|
e[n.name] ||= {}, e[n.name][s] = t, e[`${n.name}_Array`] ||= [], e[`${n.name}_Array`].push(s), r && (e[`${n.name}_Single`] = t);
|
|
10370
10374
|
}, Vc = (n, e, t, s, r, i) => {
|
|
10371
10375
|
const o = [], a = [];
|
|
@@ -10375,7 +10379,7 @@ ${i}`);
|
|
|
10375
10379
|
}, Mo = async (n, e, t, s, r, i, o, a, l, c, u, h) => {
|
|
10376
10380
|
const { fields: f } = i, d = ue(), m = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map();
|
|
10377
10381
|
for (const w of f)
|
|
10378
|
-
K(w) && ["OneToOne", "OneToMany"].includes(w.type) && w.enforceHierarchy && s[w.name] && (n === "Create" || n === "Update" && !ze(h?.[w.name], s[w.name])) && await
|
|
10382
|
+
K(w) && ["OneToOne", "OneToMany"].includes(w.type) && w.enforceHierarchy && s[w.name] && (n === "Create" || n === "Update" && !ze(h?.[w.name], s[w.name])) && await Xr(e, i, w, s, a, l);
|
|
10379
10383
|
for (const w of f)
|
|
10380
10384
|
if (K(w) && w.twoWay) {
|
|
10381
10385
|
const b = o.collections[w.collection], N = W(b.fields, w.twoWay), p = ft(b, [N]);
|
|
@@ -10400,7 +10404,7 @@ ${i}`);
|
|
|
10400
10404
|
O.set(w.collection, {
|
|
10401
10405
|
...O.get(w.collection) || {},
|
|
10402
10406
|
[v]: E
|
|
10403
|
-
}), x = ye({ ...E, ...
|
|
10407
|
+
}), x = ye({ ...E, ...Sn(s) });
|
|
10404
10408
|
}
|
|
10405
10409
|
const k = {
|
|
10406
10410
|
...x[N.name],
|
|
@@ -10437,7 +10441,7 @@ ${i}`);
|
|
|
10437
10441
|
O.set(w.collection, {
|
|
10438
10442
|
...O.get(w.collection) || {},
|
|
10439
10443
|
[v]: A
|
|
10440
|
-
}), x = ye({ ...A, ...
|
|
10444
|
+
}), x = ye({ ...A, ...Sn(s) });
|
|
10441
10445
|
}
|
|
10442
10446
|
x[N.name][t] && delete x[N.name][t], Array.isArray(x[`${N.name}_Array`]) && (x[`${N.name}_Array`] = x[`${N.name}_Array`].filter((k) => k !== t)), p.size === 1 && delete x[`${N.name}_Single`], y.set(w.collection, {
|
|
10443
10447
|
...y.get(w.collection) || {},
|
|
@@ -10454,15 +10458,15 @@ ${i}`);
|
|
|
10454
10458
|
if (c && u) {
|
|
10455
10459
|
for (const x of v) {
|
|
10456
10460
|
const g = W(N.fields, x.twoWay);
|
|
10457
|
-
if (!
|
|
10461
|
+
if (!rr(N, g, u)) {
|
|
10458
10462
|
gn(x, r, T);
|
|
10459
10463
|
continue;
|
|
10460
10464
|
}
|
|
10461
10465
|
}
|
|
10462
10466
|
for (const x of Z) {
|
|
10463
10467
|
const g = W(N.fields, x.twoWay), k = ft(N, [g]);
|
|
10464
|
-
if (!
|
|
10465
|
-
|
|
10468
|
+
if (!rr(N, g, u)) {
|
|
10469
|
+
ys(
|
|
10466
10470
|
x,
|
|
10467
10471
|
r,
|
|
10468
10472
|
// eslint-disable-next-line security/detect-object-injection
|
|
@@ -10486,7 +10490,7 @@ ${i}`);
|
|
|
10486
10490
|
gn(x, r, T);
|
|
10487
10491
|
for (const x of Z) {
|
|
10488
10492
|
const g = W(N.fields, x.twoWay), k = ft(N, [g]);
|
|
10489
|
-
|
|
10493
|
+
ys(
|
|
10490
10494
|
x,
|
|
10491
10495
|
r,
|
|
10492
10496
|
// eslint-disable-next-line security/detect-object-injection
|
|
@@ -10501,7 +10505,7 @@ ${i}`);
|
|
|
10501
10505
|
gn(x, r, T);
|
|
10502
10506
|
for (const x of Z) {
|
|
10503
10507
|
const g = W(N.fields, x.twoWay), k = ft(N, [g]);
|
|
10504
|
-
|
|
10508
|
+
ys(
|
|
10505
10509
|
x,
|
|
10506
10510
|
r,
|
|
10507
10511
|
// eslint-disable-next-line security/detect-object-injection
|
|
@@ -10519,7 +10523,7 @@ ${i}`);
|
|
|
10519
10523
|
}
|
|
10520
10524
|
for (const x of v) {
|
|
10521
10525
|
const g = W(N.fields, x.twoWay);
|
|
10522
|
-
["OneToOne", "OneToMany"].includes(g.type) && K(g) && g.enforceHierarchy && await
|
|
10526
|
+
["OneToOne", "OneToMany"].includes(g.type) && K(g) && g.enforceHierarchy && await Xr(e, N, g, C, a, l, !0);
|
|
10523
10527
|
}
|
|
10524
10528
|
}
|
|
10525
10529
|
}
|
|
@@ -10551,7 +10555,7 @@ ${i}`);
|
|
|
10551
10555
|
else if (t[o] && t[o]?.valueOf() !== s[o]?.valueOf())
|
|
10552
10556
|
throw new Error("Soft delete timestamp cannot be changed");
|
|
10553
10557
|
}
|
|
10554
|
-
},
|
|
10558
|
+
}, gs = async (n, e, t, s, r) => {
|
|
10555
10559
|
if (!Te("Read", r.collections?.[e.labels.collection]))
|
|
10556
10560
|
return !1;
|
|
10557
10561
|
try {
|
|
@@ -10585,7 +10589,7 @@ ${i}`);
|
|
|
10585
10589
|
if (o && o.size++, o && o.size > 500)
|
|
10586
10590
|
throw new Error("VALIDATION_ERROR: The number of operations in the Firestore transaction has exceeded the limit of 500. This is likely due to a large number of unique field checks or entity restrictions (in permissions when dealing with user collections).");
|
|
10587
10591
|
d.push(async () => {
|
|
10588
|
-
if (!await
|
|
10592
|
+
if (!await gs(n, u, w, t, s))
|
|
10589
10593
|
throw new Error("PERMISSION_DENIED");
|
|
10590
10594
|
});
|
|
10591
10595
|
}
|
|
@@ -10599,7 +10603,7 @@ ${i}`);
|
|
|
10599
10603
|
if (o && o.size++, o && o.size > 500)
|
|
10600
10604
|
throw new Error("VALIDATION_ERROR: The number of operations in the Firestore transaction has exceeded the limit of 500. This is likely due to a large number of unique field checks or entity restrictions (in permissions when dealing with user collections).");
|
|
10601
10605
|
d.push(async () => {
|
|
10602
|
-
if (!await
|
|
10606
|
+
if (!await gs(n, y, p, t, s))
|
|
10603
10607
|
throw new Error("PERMISSION_DENIED");
|
|
10604
10608
|
});
|
|
10605
10609
|
}
|
|
@@ -10615,7 +10619,7 @@ ${i}`);
|
|
|
10615
10619
|
if (o && o.size++, o && o.size > 500)
|
|
10616
10620
|
throw new Error("VALIDATION_ERROR: The number of operations in the Firestore transaction has exceeded the limit of 500. This is likely due to a large number of unique field checks or entity restrictions (in permissions when dealing with user collections).");
|
|
10617
10621
|
d.push(async () => {
|
|
10618
|
-
if (!await
|
|
10622
|
+
if (!await gs(n, y, v, t, s))
|
|
10619
10623
|
throw new Error("PERMISSION_DENIED");
|
|
10620
10624
|
});
|
|
10621
10625
|
}
|
|
@@ -10624,7 +10628,7 @@ ${i}`);
|
|
|
10624
10628
|
await Wc(d, Uc);
|
|
10625
10629
|
}
|
|
10626
10630
|
}
|
|
10627
|
-
},
|
|
10631
|
+
}, hu = async (n, e, t, s, r, i, o) => {
|
|
10628
10632
|
const a = Ye(), l = Ut();
|
|
10629
10633
|
let c = await Ge();
|
|
10630
10634
|
if (n.length === 0)
|
|
@@ -10634,11 +10638,11 @@ ${i}`);
|
|
|
10634
10638
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
10635
10639
|
const d = c.collections[u], { labels: m, fields: O, enableWriteLog: y, softDelete: w } = d, b = Je(m.collection, c), N = await ie(l.appName), p = ue(), T = gt(), v = (s ? await T.getUser(s) : void 0)?.customClaims?.role;
|
|
10636
10640
|
let Z;
|
|
10637
|
-
s && await
|
|
10641
|
+
s && await er(n, d);
|
|
10638
10642
|
const x = De(p, n, a), g = o || x.doc().id;
|
|
10639
|
-
i = i || {}, i.collection = m.collection, e.id = g, $o(e),
|
|
10640
|
-
const k =
|
|
10641
|
-
w && (k[w.archivedField] = !1), Ve(e), y && await Mt("create", "started", k, a, n, g, d), await ae("preOperation", l, b, ["create", k, g, i]), await ae("preWrite", l, b, ["create", k, g, i]),
|
|
10643
|
+
i = i || {}, i.collection = m.collection, e.id = g, $o(e), tr(e);
|
|
10644
|
+
const k = Ws("create", n, e, c, N, "Online", s || "System", lt.now(), me.serverTimestamp()), _ = ye(k);
|
|
10645
|
+
w && (k[w.archivedField] = !1), Ve(e), y && await Mt("create", "started", k, a, n, g, d), await ae("preOperation", l, b, ["create", k, g, i]), await ae("preWrite", l, b, ["create", k, g, i]), Tn(d, k, c), Rn(d, k), await ra(k, d, b, v), Ve(k);
|
|
10642
10646
|
try {
|
|
10643
10647
|
if (d.auth && t && !t.password)
|
|
10644
10648
|
throw new Error("Password is required");
|
|
@@ -10646,7 +10650,7 @@ ${i}`);
|
|
|
10646
10650
|
} catch (P) {
|
|
10647
10651
|
throw new Error(`VALIDATION_ERROR: ${P.message}`);
|
|
10648
10652
|
}
|
|
10649
|
-
Ve(k), e.id = g, w && (k[w.archivedField] = !1),
|
|
10653
|
+
Ve(k), e.id = g, w && (k[w.archivedField] = !1), Tn(d, k, c), Rn(d, k);
|
|
10650
10654
|
try {
|
|
10651
10655
|
Fo("create", k, _), Po("create", d, k), await sn("create", k, d, b, ["create", k, i], c);
|
|
10652
10656
|
} catch (P) {
|
|
@@ -10701,17 +10705,17 @@ ${i}`);
|
|
|
10701
10705
|
k
|
|
10702
10706
|
]) : !0))
|
|
10703
10707
|
throw new Error("PERMISSION_DENIED");
|
|
10704
|
-
const
|
|
10705
|
-
if (
|
|
10708
|
+
const Jn = e[oe.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||");
|
|
10709
|
+
if (Ks(Jn)) {
|
|
10706
10710
|
if (j && j.size++, j && j.size > 500)
|
|
10707
10711
|
throw new Error("VALIDATION_ERROR: The number of operations in the Firestore transaction has exceeded the limit of 500. This is likely due to a large number of unique field checks.");
|
|
10708
|
-
if ((await P.get(p.collection("tenants").doc(a).collection("system_unique").doc(m.collection).collection(`Unique-${m.collection}-${oe.name}`).doc(
|
|
10712
|
+
if ((await P.get(p.collection("tenants").doc(a).collection("system_unique").doc(m.collection).collection(`Unique-${m.collection}-${oe.name}`).doc(Jn)))?.exists)
|
|
10709
10713
|
throw new Error(`VALIDATION_ERROR: ${oe.name} "${k[oe.name]}" already exists`);
|
|
10710
10714
|
} else
|
|
10711
10715
|
throw new Error(`VALIDATION_ERROR: ${oe.name} "${k[oe.name]}" is invalid`);
|
|
10712
10716
|
}
|
|
10713
10717
|
});
|
|
10714
|
-
await Promise.all(pe),
|
|
10718
|
+
await Promise.all(pe), ir(k, g, d, c, s, Z, t?.permissions), t?.permissions && s && Z && await Lo(P, t.permissions, s, Z, c), ir(k, g, d, c, s, Z, t?.permissions);
|
|
10715
10719
|
};
|
|
10716
10720
|
if (d.auth && t) {
|
|
10717
10721
|
await p.runTransaction(async (j) => {
|
|
@@ -10733,8 +10737,8 @@ ${i}`);
|
|
|
10733
10737
|
const P = { size: 1 };
|
|
10734
10738
|
await p.runTransaction(async (j) => {
|
|
10735
10739
|
await D(j, P), r?.noTwoWay || await Mo("Create", a, g, k, k, d, c, j, P, s, Z);
|
|
10736
|
-
const Q =
|
|
10737
|
-
|
|
10740
|
+
const Q = Us(c);
|
|
10741
|
+
Qs("create", j, n, g, k, c, d, r, Q, me.arrayUnion, me.arrayRemove, me.delete, (S) => p.collection("tenants").doc(a).collection("system_fields").doc(m.collection).collection(`${m.collection}-${S.name}`).doc(g), (S, q) => p.collection("tenants").doc(a).collection("system_unique").doc(m.collection).collection(`Unique-${m.collection}-${S.name}`).doc(q), (S) => p.collection("tenants").doc(a).collection("system_fields").doc(m.collection).collection(`${m.collection}-${S}`).doc(g), (S, q) => De(p, S, a).doc(q), (S, q, B) => p.collection("tenants").doc(a).collection("system_fields").doc(S.collection).collection(`${S.collection}-${q}`).doc(B), (S, q, B) => p.collection("tenants").doc(a).collection("system_fields").doc(S.collection).collection(`${S.collection}-${q.replaceAll(" ", "-")}`).doc(B), void 0, void 0, P), j.set(x.doc(g), k);
|
|
10738
10742
|
}, { maxAttempts: 10 });
|
|
10739
10743
|
} catch (P) {
|
|
10740
10744
|
const Q = await ae("postWriteError", l, b, ["create", k, g, i, P]);
|
|
@@ -10865,7 +10869,7 @@ ${i}`);
|
|
|
10865
10869
|
}
|
|
10866
10870
|
for (const a of o)
|
|
10867
10871
|
n.set(a, { locked: !0 });
|
|
10868
|
-
},
|
|
10872
|
+
}, ei = async (n, e) => {
|
|
10869
10873
|
const t = Ye(), s = ue(), r = [n];
|
|
10870
10874
|
e && e.trim() !== "" && r.push(e), r.sort();
|
|
10871
10875
|
const i = s.batch();
|
|
@@ -10884,7 +10888,7 @@ ${i}`);
|
|
|
10884
10888
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
10885
10889
|
const d = c.collections[u], { labels: m, fields: O, enableWriteLog: y } = d, w = Je(m.collection, c), b = await ie(l.appName), N = gt(), p = ue();
|
|
10886
10890
|
let T;
|
|
10887
|
-
r && await
|
|
10891
|
+
r && await er(n, d);
|
|
10888
10892
|
const C = De(p, n, a);
|
|
10889
10893
|
o = o || {}, o.collection = m.collection;
|
|
10890
10894
|
let v = await at(n, e, {
|
|
@@ -10910,8 +10914,8 @@ ${i}`);
|
|
|
10910
10914
|
if (s?.operation === "delete" && s.permissions)
|
|
10911
10915
|
throw new Error("VALIDATION_ERROR: Permissions are not allowed for delete operations");
|
|
10912
10916
|
const Z = d.auth && s?.operation === "create", x = d.auth && s?.operation === "delete", g = d.auth && !Z && !x && (s?.operation === "update" || t.Role || t.Enabled !== void 0 || t.Name || t.Email || t.Photo_URL), k = (S) => S.User_ID && (d.auth && !Z && !x && s?.operation === "update" || t.Role && t.Role !== S.Role || t.Enabled !== void 0 && t.Enabled !== S.Enabled || t.Name && t.Name !== S.Name || t.Email && t.Email !== S.Email || t.Photo_URL && t.Photo_URL !== S.Photo_URL);
|
|
10913
|
-
delete t.id, $o(t),
|
|
10914
|
-
const _ =
|
|
10917
|
+
delete t.id, $o(t), tr(t);
|
|
10918
|
+
const _ = Ws("update", n, t, c, b, "Online", r || "System", lt.now(), me.serverTimestamp()), A = ye(_);
|
|
10915
10919
|
for (const S of O)
|
|
10916
10920
|
!K(S) && Me(_[S.name]) && S.nullable && (_[S.name] = null);
|
|
10917
10921
|
Ve(_), Ve(v), y && await Mt("update", "started", _, a, n, e, d, void 0, v);
|
|
@@ -10925,7 +10929,7 @@ ${i}`);
|
|
|
10925
10929
|
];
|
|
10926
10930
|
await ae("preOperation", l, w, E);
|
|
10927
10931
|
const D = ["update", _, e, o, void 0, ye(v)];
|
|
10928
|
-
await ae("preWrite", l, w, D),
|
|
10932
|
+
await ae("preWrite", l, w, D), Tn(d, _, c), Rn(d, _), Ve(_);
|
|
10929
10933
|
try {
|
|
10930
10934
|
if (Z && !s.password)
|
|
10931
10935
|
throw new Error("Password is required");
|
|
@@ -10934,7 +10938,7 @@ ${i}`);
|
|
|
10934
10938
|
} catch (S) {
|
|
10935
10939
|
throw new Error(`VALIDATION_ERROR: ${S.message}`);
|
|
10936
10940
|
}
|
|
10937
|
-
Ve(_), delete t.id,
|
|
10941
|
+
Ve(_), delete t.id, Tn(d, _, c), Rn(d, _);
|
|
10938
10942
|
for (const S of O)
|
|
10939
10943
|
!K(S) && Me(_[S.name]) && S.nullable && (_[S.name] = null);
|
|
10940
10944
|
try {
|
|
@@ -10989,34 +10993,34 @@ ${i}`);
|
|
|
10989
10993
|
throw new Error("VALIDATION_ERROR: Enabled field is required");
|
|
10990
10994
|
}
|
|
10991
10995
|
}
|
|
10992
|
-
const
|
|
10996
|
+
const nr = O.filter((de) => "unique" in de && de.unique).map(async (de) => {
|
|
10993
10997
|
if (!r || !de.access || de.access.includes(T.Role)) {
|
|
10994
10998
|
if (_[de.name] === void 0 || Me(_[de.name]))
|
|
10995
10999
|
return;
|
|
10996
|
-
const jt = Ie(de, w),
|
|
11000
|
+
const jt = Ie(de, w), sr = { ...v, ..._ };
|
|
10997
11001
|
if (!(r && jt?.custom?.serverAccess?.read !== void 0 ? await ie(jt.custom.serverAccess.read, [
|
|
10998
11002
|
T?.Role,
|
|
10999
|
-
|
|
11003
|
+
sr
|
|
11000
11004
|
]) : !0))
|
|
11001
11005
|
throw new Error("PERMISSION_DENIED");
|
|
11002
11006
|
const Zt = _[de.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||");
|
|
11003
|
-
if (
|
|
11007
|
+
if (Ks(Zt)) {
|
|
11004
11008
|
if (B && B.size++, B && B.size > 500)
|
|
11005
11009
|
throw new Error("VALIDATION_ERROR: The number of operations in the Firestore transaction has exceeded the limit of 500. This is likely due to a large number of unique field checks.");
|
|
11006
|
-
const
|
|
11007
|
-
if (
|
|
11010
|
+
const Kn = await S.get(p.collection("tenants").doc(a).collection("system_unique").doc(m.collection).collection(`Unique-${m.collection}-${de.name}`).doc(Zt));
|
|
11011
|
+
if (Kn.exists && Kn.data().id !== e)
|
|
11008
11012
|
throw new Error(`VALIDATION_ERROR: ${de.name} "${_[de.name]}" already exists`);
|
|
11009
11013
|
} else
|
|
11010
11014
|
throw new Error(`VALIDATION_ERROR: ${de.name} "${_[de.name]}" is invalid`);
|
|
11011
11015
|
}
|
|
11012
11016
|
});
|
|
11013
|
-
if (await Promise.all(
|
|
11017
|
+
if (await Promise.all(nr), r && T?.Role) {
|
|
11014
11018
|
const de = T.Role, jt = { ...v, ..._ };
|
|
11015
11019
|
if (!(w.custom?.serverAccess?.update !== void 0 ? await ie(w.custom.serverAccess.update, [de, jt, v]) : !0))
|
|
11016
11020
|
throw new Error("PERMISSION_DENIED");
|
|
11017
|
-
for (const
|
|
11018
|
-
const Zt = Ie(
|
|
11019
|
-
if (Object.prototype.hasOwnProperty.call(_,
|
|
11021
|
+
for (const Qn of d.fields) {
|
|
11022
|
+
const Zt = Ie(Qn, w);
|
|
11023
|
+
if (Object.prototype.hasOwnProperty.call(_, Qn.name) && Zt?.custom?.serverAccess?.update !== void 0 && !await ie(Zt.custom.serverAccess.update, [
|
|
11020
11024
|
de,
|
|
11021
11025
|
jt,
|
|
11022
11026
|
v
|
|
@@ -11024,7 +11028,7 @@ ${i}`);
|
|
|
11024
11028
|
throw new Error("PERMISSION_DENIED");
|
|
11025
11029
|
}
|
|
11026
11030
|
}
|
|
11027
|
-
|
|
11031
|
+
or(_, v, e, d, c, r, T, s?.operation ? s.operation : g ? "update" : void 0, s?.permissions, R), s?.permissions && r && T && await Lo(S, s.permissions, r, T, c, R, B), or(_, v, e, d, c, r, T, s?.operation ? s.operation : g ? "update" : void 0, s?.permissions, R), q && (Z || k(v) || x) && await Zc(S, e, v.User_ID);
|
|
11028
11032
|
};
|
|
11029
11033
|
(Z || g || x) && await p.runTransaction(async (S) => {
|
|
11030
11034
|
await F(S, !0);
|
|
@@ -11050,8 +11054,8 @@ ${i}`);
|
|
|
11050
11054
|
await F(B, !1, q);
|
|
11051
11055
|
let Qe;
|
|
11052
11056
|
i?.noTwoWay || (Qe = await Mo("Update", a, e, re, _, d, c, B, q, r, T, v));
|
|
11053
|
-
const Wt =
|
|
11054
|
-
|
|
11057
|
+
const Wt = Us(c);
|
|
11058
|
+
Qs("update", B, n, e, _, c, d, i, Wt, me.arrayUnion, me.arrayRemove, me.delete, (pe) => p.collection("tenants").doc(a).collection("system_fields").doc(m.collection).collection(`${m.collection}-${pe.name}`).doc(e), (pe, oe) => p.collection("tenants").doc(a).collection("system_unique").doc(m.collection).collection(`Unique-${m.collection}-${pe.name}`).doc(oe), (pe) => p.collection("tenants").doc(a).collection("system_fields").doc(m.collection).collection(`${m.collection}-${pe}`).doc(e), (pe, oe) => De(p, pe, a).doc(oe), (pe, oe, Le) => p.collection("tenants").doc(a).collection("system_fields").doc(pe.collection).collection(`${pe.collection}-${oe}`).doc(Le), (pe, oe, Le) => p.collection("tenants").doc(a).collection("system_fields").doc(pe.collection).collection(`${pe.collection}-${oe.replaceAll(" ", "-")}`).doc(Le), v, Qe, q), B.update(C.doc(e), _);
|
|
11055
11059
|
}, { maxAttempts: 10 });
|
|
11056
11060
|
} catch (q) {
|
|
11057
11061
|
const B = [
|
|
@@ -11069,11 +11073,11 @@ ${i}`);
|
|
|
11069
11073
|
}), await Mt("update", re?.resolved ? "success" : "failed", _, a, n, e, d, re?.resolved ? void 0 : q, v)), !re?.resolved)
|
|
11070
11074
|
throw Z && await un(v), k(v) && await Qt(v.User_ID, S, R, "USER_ERROR"), x && await p.collection("tenants").doc(a).collection(m.collection).doc(e).update({ User_ID: me.delete() }), q;
|
|
11071
11075
|
}
|
|
11072
|
-
(Z || k(v) || x) && await
|
|
11076
|
+
(Z || k(v) || x) && await Qr(ei, [e, v.User_ID]).catch(() => {
|
|
11073
11077
|
throw new Error("USER_ERROR");
|
|
11074
11078
|
});
|
|
11075
11079
|
} catch (S) {
|
|
11076
|
-
throw (Z || k(v) || x) && await
|
|
11080
|
+
throw (Z || k(v) || x) && await Qr(ei, [e, v.User_ID]).catch(() => {
|
|
11077
11081
|
throw new Error("USER_ERROR");
|
|
11078
11082
|
}), S;
|
|
11079
11083
|
}
|
|
@@ -11081,7 +11085,7 @@ ${i}`);
|
|
|
11081
11085
|
await ae("postWrite", l, w, M), await ae("postOperation", l, w, P);
|
|
11082
11086
|
const j = { ...v, ..._ };
|
|
11083
11087
|
return nt(j), { id: e, ...j };
|
|
11084
|
-
},
|
|
11088
|
+
}, mu = async (n, e, t, s, r) => {
|
|
11085
11089
|
const i = Ye(), o = Ut();
|
|
11086
11090
|
let a = await Ge();
|
|
11087
11091
|
if (n.length === 0)
|
|
@@ -11094,12 +11098,12 @@ ${i}`);
|
|
|
11094
11098
|
return await zc(n, e, { [O.archivedField]: !0, [O.timestampField]: me.serverTimestamp() }, void 0, t);
|
|
11095
11099
|
const b = ue();
|
|
11096
11100
|
let N;
|
|
11097
|
-
t && await
|
|
11101
|
+
t && await er(n, h);
|
|
11098
11102
|
const p = De(b, n, i);
|
|
11099
11103
|
r = r || {}, r.collection = f.collection;
|
|
11100
11104
|
const T = await at(n, e, { user: t });
|
|
11101
|
-
let C =
|
|
11102
|
-
const v =
|
|
11105
|
+
let C = Ws("delete", n, T, a, w, "Online", t || "System", lt.now(), me.serverTimestamp());
|
|
11106
|
+
const v = Sn(C);
|
|
11103
11107
|
Ve(C), m && await Mt("delete", "started", C, i, n, e, h), await ae("preOperation", o, y, ["delete", C, e, r]), await ae("preWrite", o, y, ["delete", C, e, r]), Ve(C);
|
|
11104
11108
|
const g = async (E) => {
|
|
11105
11109
|
const [D, R, F, M] = await Promise.all([
|
|
@@ -11135,8 +11139,8 @@ ${i}`);
|
|
|
11135
11139
|
try {
|
|
11136
11140
|
await b.runTransaction(async (E) => {
|
|
11137
11141
|
await g(E);
|
|
11138
|
-
const D =
|
|
11139
|
-
|
|
11142
|
+
const D = Us(a);
|
|
11143
|
+
Qs("delete", E, n, e, C, a, h, s, D, me.arrayUnion, me.arrayRemove, me.delete, (R) => b.collection("tenants").doc(i).collection("system_fields").doc(f.collection).collection(`${f.collection}-${R.name}`).doc(e), (R, F) => b.collection("tenants").doc(i).collection("system_unique").doc(f.collection).collection(`Unique-${f.collection}-${R.name}`).doc(F), (R) => b.collection("tenants").doc(i).collection("system_fields").doc(f.collection).collection(`${f.collection}-${R}`).doc(e), (R, F) => De(b, R, i).doc(F), (R, F, M) => b.collection("tenants").doc(i).collection("system_fields").doc(R.collection).collection(`${R.collection}-${F}`).doc(M), (R, F, M) => b.collection("tenants").doc(i).collection("system_fields").doc(R.collection).collection(`${R.collection}-${F.replaceAll(" ", "-")}`).doc(M)), E.delete(p.doc(e));
|
|
11140
11144
|
}, { maxAttempts: 10 });
|
|
11141
11145
|
} catch (E) {
|
|
11142
11146
|
const R = await ae("postWriteError", o, y, ["delete", C, e, r, E]);
|
|
@@ -11147,7 +11151,7 @@ ${i}`);
|
|
|
11147
11151
|
}
|
|
11148
11152
|
const k = ["delete", C, e, r], _ = [...k];
|
|
11149
11153
|
return await ae("postWrite", o, y, k), await ae("postOperation", o, y, _), { id: e, ...C };
|
|
11150
|
-
},
|
|
11154
|
+
}, pu = async (n, e) => {
|
|
11151
11155
|
const t = ue(), s = bo(), r = process.env.ADMIN_SMS;
|
|
11152
11156
|
if (s === "development")
|
|
11153
11157
|
if (r)
|
|
@@ -11156,7 +11160,7 @@ ${i}`);
|
|
|
11156
11160
|
throw new Error("Admin phone not set");
|
|
11157
11161
|
const i = { to: n, body: e };
|
|
11158
11162
|
await t.collection("system_messages").add(i);
|
|
11159
|
-
}, qc = (n) => n !== null && typeof n == "object",
|
|
11163
|
+
}, qc = (n) => n !== null && typeof n == "object", yu = (n) => {
|
|
11160
11164
|
const e = (t) => {
|
|
11161
11165
|
Object.entries(t).forEach(([s, r]) => {
|
|
11162
11166
|
r instanceof lt ? t[s] = {
|
|
@@ -11166,51 +11170,59 @@ ${i}`);
|
|
|
11166
11170
|
});
|
|
11167
11171
|
};
|
|
11168
11172
|
e(n);
|
|
11169
|
-
},
|
|
11173
|
+
}, gu = async (n) => await gt().getUser(n), wu = (n) => {
|
|
11170
11174
|
const e = So();
|
|
11171
11175
|
return V.fromJSDate(n).setZone(e);
|
|
11172
11176
|
}, Bc = (n) => {
|
|
11173
11177
|
const e = So();
|
|
11174
11178
|
return V.fromJSDate(n.toDate()).setZone(e);
|
|
11175
|
-
},
|
|
11179
|
+
}, _u = (n, e) => {
|
|
11176
11180
|
const s = V.fromJSDate(n, { zone: e }).offset, i = V.fromJSDate(n).offset, o = s - i;
|
|
11177
11181
|
return V.fromJSDate(n).plus({ minutes: o }).toJSDate();
|
|
11178
|
-
},
|
|
11182
|
+
}, Eu = (n, e) => {
|
|
11179
11183
|
const s = V.fromJSDate(n, { zone: e }).offset, i = V.fromJSDate(n).offset, o = s - i;
|
|
11180
11184
|
return V.fromJSDate(n).minus({ minutes: o }).toJSDate();
|
|
11181
|
-
},
|
|
11185
|
+
}, vu = (n) => "seconds" in n && "nanoseconds" in n ? Bc(new lt(n.seconds, n.nanoseconds)).toFormat("MMMM d, yyyy '@' h:mm a") : "";
|
|
11182
11186
|
export {
|
|
11183
|
-
|
|
11187
|
+
hu as addRecord,
|
|
11184
11188
|
Co as addUser,
|
|
11185
|
-
|
|
11189
|
+
wu as convertDateToTimezone,
|
|
11186
11190
|
Bc as convertTimestampToTimezone,
|
|
11187
|
-
|
|
11191
|
+
mu as deleteRecord,
|
|
11188
11192
|
un as deleteUser,
|
|
11189
|
-
|
|
11193
|
+
tr as deserializeDeleteSentinels,
|
|
11190
11194
|
$o as deserializeTimestamps,
|
|
11191
|
-
|
|
11192
|
-
|
|
11195
|
+
fu as deserializeTimestampsWithoutUnderscores,
|
|
11196
|
+
vu as displayDate,
|
|
11193
11197
|
Ge as fetchCurrentSchema,
|
|
11194
|
-
|
|
11195
|
-
|
|
11198
|
+
du as fetchLastSchema,
|
|
11199
|
+
su as getCachedConfigValue,
|
|
11196
11200
|
Pc as getCollectionRefs,
|
|
11201
|
+
Je as getCustomizationFile,
|
|
11197
11202
|
Fc as getCustomizationFiles,
|
|
11198
11203
|
To as getDocumentRefs,
|
|
11199
11204
|
De as getFirestorePathRef,
|
|
11200
|
-
|
|
11205
|
+
Ut as getGlobalConfigModule,
|
|
11206
|
+
ru as getInputSchema,
|
|
11207
|
+
lu as getMaintenanceInfo,
|
|
11208
|
+
bo as getMode,
|
|
11201
11209
|
at as getOne,
|
|
11202
11210
|
No as getSome,
|
|
11203
|
-
|
|
11211
|
+
Ye as getTenant,
|
|
11212
|
+
So as getTimezone,
|
|
11213
|
+
gu as getUser,
|
|
11214
|
+
au as getVersionInfo,
|
|
11204
11215
|
Ca as getZodSchema,
|
|
11205
|
-
|
|
11206
|
-
|
|
11216
|
+
uu as initializeFirebase,
|
|
11217
|
+
iu as initializeStoker,
|
|
11207
11218
|
Me as isDeleteSentinel,
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11219
|
+
_u as keepTimezone,
|
|
11220
|
+
Eu as removeTimezone,
|
|
11221
|
+
cu as runChildProcess,
|
|
11211
11222
|
Ao as sendMail,
|
|
11212
|
-
|
|
11213
|
-
|
|
11223
|
+
pu as sendMessage,
|
|
11224
|
+
yu as serializeTimestamps,
|
|
11225
|
+
ou as setTenant,
|
|
11214
11226
|
ie as tryPromise,
|
|
11215
11227
|
zc as updateRecord,
|
|
11216
11228
|
jc as updateUser,
|