@stoker-platform/node-client 0.5.7 → 0.5.9
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 +550 -550
- package/package.json +3 -1
package/dist/bundle.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import ze from "lodash/isEqual.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import jo from "lodash/merge.js";
|
|
3
|
+
import Zo from "lodash/set.js";
|
|
4
4
|
import ye from "lodash/cloneDeep.js";
|
|
5
5
|
import { getApp as ni, initializeApp as si, applicationDefault as ri } from "firebase-admin/app";
|
|
6
6
|
import { getFirestore as ue, Timestamp as lt, FieldValue as me } from "firebase-admin/firestore";
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
7
|
+
import { pathToFileURL as ii } from "node:url";
|
|
8
|
+
import zo from "cross-spawn";
|
|
9
|
+
import { getDatabase as oi } from "firebase-admin/database";
|
|
9
10
|
import { getAuth as gt } from "firebase-admin/auth";
|
|
10
11
|
const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
11
12
|
if (e?.operations)
|
|
12
13
|
return e.operations.includes(n);
|
|
13
|
-
}, Zn = (n, e) => e ? e.Role ? n.access?.includes(e.Role) : !1 : !0,
|
|
14
|
+
}, Zn = (n, e) => e ? e.Role ? n.access?.includes(e.Role) : !1 : !0, qo = (n, e) => n.restrictCreate === !0 ? !1 : e && typeof n.restrictCreate == "object" ? e.Role ? n.restrictCreate?.includes(e.Role) : !1 : !0, ai = (n, e) => n.restrictUpdate === !0 ? !1 : e && typeof n.restrictUpdate == "object" ? e.Role ? n.restrictUpdate?.includes(e.Role) : !1 : !0, rr = (n, e, t) => {
|
|
14
15
|
const { labels: s } = n;
|
|
15
16
|
return t.collections && // eslint-disable-next-line security/detect-object-injection
|
|
16
|
-
Te("Update", t.collections[s.collection]) && (!e.access || Zn(e, t)) &&
|
|
17
|
-
}, W = (n, e) => n.filter((t) => t.name === e)[0], K = (n) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(n.type),
|
|
17
|
+
Te("Update", t.collections[s.collection]) && (!e.access || Zn(e, t)) && ai(e, t) && !(n.auth && !t.collections?.[s.collection].auth && ["Enabled", "Role", "Name", "Email", "Photo_URL"].includes(e.name));
|
|
18
|
+
}, W = (n, e) => n.filter((t) => t.name === e)[0], K = (n) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(n.type), li = (n, e) => {
|
|
18
19
|
const t = {
|
|
19
20
|
Record_Owner: "recordOwner",
|
|
20
21
|
Record_User: "recordUser",
|
|
@@ -33,7 +34,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
33
34
|
l.role === e.Role && (!i.assignable?.includes(e.Role) || o?.restrictEntities) && t.push(a);
|
|
34
35
|
});
|
|
35
36
|
}), t;
|
|
36
|
-
},
|
|
37
|
+
}, ci = (n, e, t) => {
|
|
37
38
|
const s = [], { access: r } = n, { entityRestrictions: i } = r;
|
|
38
39
|
return i?.parentFilters?.forEach((o) => {
|
|
39
40
|
if (!o.roles.some((d) => d.role === t.Role))
|
|
@@ -51,7 +52,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
51
52
|
d.role === t.Role && (!h.assignable?.includes(t.Role) || c?.restrictEntities) && s.push({ parentFilter: o, parentRestriction: f });
|
|
52
53
|
});
|
|
53
54
|
}), s;
|
|
54
|
-
},
|
|
55
|
+
}, ui = (n, e, t) => {
|
|
55
56
|
const s = Object.values(e.collections), { labels: r } = n, i = [];
|
|
56
57
|
for (const o of s) {
|
|
57
58
|
const { fields: a } = o;
|
|
@@ -61,14 +62,14 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
61
62
|
!i.find((h) => h.field === c.field) && c.roles.includes(t.Role) && i.push(c);
|
|
62
63
|
}
|
|
63
64
|
return i;
|
|
64
|
-
},
|
|
65
|
+
}, Bo = (n, e, t, s, r, i) => {
|
|
65
66
|
const { fields: o } = e, a = r.collections?.[e.labels.collection];
|
|
66
67
|
let l = !0;
|
|
67
68
|
if (!a) {
|
|
68
69
|
l = !1;
|
|
69
70
|
return;
|
|
70
71
|
}
|
|
71
|
-
const c =
|
|
72
|
+
const c = li(e, r), u = Ls(e, r), h = ci(e, t, r);
|
|
72
73
|
c?.filter((p) => p.type === "Record_Owner").forEach((p) => {
|
|
73
74
|
"operations" in p && p.operations && !p.operations.includes(n) || i.Created_By !== s && (l = !1);
|
|
74
75
|
}), c?.filter((p) => p.type === "Record_User").forEach((p) => {
|
|
@@ -154,13 +155,13 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
154
155
|
return l = !1, l;
|
|
155
156
|
Te(n, a) || (l = !1);
|
|
156
157
|
const u = Ls(e, r)?.filter((h) => h.type === "Individual").length > 0;
|
|
157
|
-
return n === "Create" && u && (l = !1),
|
|
158
|
-
},
|
|
158
|
+
return n === "Create" && u && (l = !1), Bo(n, e, t, s, r, i) || (l = !1), l;
|
|
159
|
+
}, di = (n, e, t) => {
|
|
159
160
|
const { labels: s } = n, r = [];
|
|
160
161
|
for (const i of Object.values(e.collections))
|
|
161
162
|
;
|
|
162
163
|
return r;
|
|
163
|
-
},
|
|
164
|
+
}, Ho = (n, e) => {
|
|
164
165
|
let t = !0, s = "";
|
|
165
166
|
return Object.keys(e).forEach((r) => {
|
|
166
167
|
if (!["Doc_ID", "Role", "Collection", "Enabled", "collections"].includes(r)) {
|
|
@@ -247,7 +248,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
247
248
|
});
|
|
248
249
|
}
|
|
249
250
|
}), s && console.error(`PERMISSION_DENIED: ${s}`)), t;
|
|
250
|
-
},
|
|
251
|
+
}, Go = (n, e, t) => {
|
|
251
252
|
let s = !0, r = "";
|
|
252
253
|
Object.values(n.collections).filter((i) => i.auth).forEach((i) => {
|
|
253
254
|
if (e.collections?.[i.labels.collection]?.auth && !i.access.auth?.includes(e.Role)) {
|
|
@@ -334,7 +335,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
334
335
|
}
|
|
335
336
|
}
|
|
336
337
|
return r && console.error(`PERMISSION_DENIED: ${r}`), s;
|
|
337
|
-
},
|
|
338
|
+
}, Yo = (n, e, t, s, r, i, o, a, l) => {
|
|
338
339
|
const { access: c } = e, { permissionWriteRestrictions: u } = c;
|
|
339
340
|
let h = !0, f = "";
|
|
340
341
|
const d = u?.filter((m) => s === m.userRole);
|
|
@@ -378,7 +379,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
378
379
|
}
|
|
379
380
|
});
|
|
380
381
|
}), f && console.error(`PERMISSION_DENIED: ${f}`), h);
|
|
381
|
-
},
|
|
382
|
+
}, Jo = (n, e, t, s) => {
|
|
382
383
|
let r = !0, i = "";
|
|
383
384
|
return Object.values(n.collections).forEach((o) => {
|
|
384
385
|
const a = t.collections?.[o.labels.collection], l = s?.collections?.[o.labels.collection], c = e?.collections?.[o.labels.collection];
|
|
@@ -420,7 +421,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
420
421
|
if (i) {
|
|
421
422
|
if (!o?.Role)
|
|
422
423
|
return d = "Current user does not have a role", f = !1, f;
|
|
423
|
-
if (!
|
|
424
|
+
if (!Yo(n, s, r, o.Role, e.Role, a, c, c?.Role, l))
|
|
424
425
|
return f = !1, f;
|
|
425
426
|
if (n === "update" && u !== "delete" && c?.User_ID && e.User_ID !== c.User_ID)
|
|
426
427
|
return d = "User ID does not match original user ID", f = !1, f;
|
|
@@ -429,7 +430,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
429
430
|
if (n === "delete" && i === e.User_ID)
|
|
430
431
|
return d = "User cannot delete their own record", f = !1, f;
|
|
431
432
|
}
|
|
432
|
-
return n === "delete" || u === "delete" || !a ? f : a.Role ? (
|
|
433
|
+
return n === "delete" || u === "delete" || !a ? f : a.Role ? (Ho(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) : !Go(r, a, a.Role) || i && o && l && !Jo(r, o, a, l) ? (f = !1, f) : (d && console.error(`PERMISSION_DENIED: ${d}`), f)) : (d = "Permissions do not have a role", f = !1, f);
|
|
433
434
|
}, ir = (n, e, t, s, r, i, o) => {
|
|
434
435
|
const { labels: a, fields: l } = t, c = i?.collections?.[a.collection];
|
|
435
436
|
let u = !0;
|
|
@@ -439,7 +440,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
439
440
|
!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));
|
|
440
441
|
for (const h of l) {
|
|
441
442
|
const f = n[h.name];
|
|
442
|
-
h.access && !Zn(h, i) && f !== void 0 && (u = !1), f !== void 0 && !
|
|
443
|
+
h.access && !Zn(h, i) && f !== void 0 && (u = !1), f !== void 0 && !qo(h, i) && (u = !1);
|
|
443
444
|
}
|
|
444
445
|
if (!u)
|
|
445
446
|
throw new Error("PERMISSION_DENIED");
|
|
@@ -457,18 +458,18 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
457
458
|
!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));
|
|
458
459
|
for (const y of h) {
|
|
459
460
|
const w = n[y.name];
|
|
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 && !
|
|
461
|
+
y.access && !Zn(y, o) && w !== void 0 && (O = `Authenticated user does not have access to field ${y.name}`, m = !1), w !== void 0 && !ai(y, o) && (O = `Authenticated user does not have Update access to field ${y.name}`, m = !1);
|
|
461
462
|
}
|
|
462
463
|
if (!m)
|
|
463
464
|
throw O && console.error(`PERMISSION_DENIED: ${O}`), new Error("PERMISSION_DENIED");
|
|
464
|
-
},
|
|
465
|
+
}, Qo = (n, e, t, s, r, i) => {
|
|
465
466
|
const { labels: o } = t, a = i.collections?.[o.collection];
|
|
466
467
|
let l = !0;
|
|
467
468
|
if (!a)
|
|
468
469
|
throw new Error("PERMISSION_DENIED");
|
|
469
470
|
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)
|
|
470
471
|
throw new Error("PERMISSION_DENIED");
|
|
471
|
-
},
|
|
472
|
+
}, Ko = async (n, e, t, s, r) => {
|
|
472
473
|
const { labels: i } = e, o = r.collections?.[i.collection];
|
|
473
474
|
let a = !0;
|
|
474
475
|
if (!o) {
|
|
@@ -477,7 +478,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
477
478
|
}
|
|
478
479
|
if (Te("Read", o) || (a = !1), it("Read", e, t, s, r, n) || (a = !1), !a)
|
|
479
480
|
throw new Error("PERMISSION_DENIED");
|
|
480
|
-
},
|
|
481
|
+
}, Xo = async (n, e, t, s, r) => {
|
|
481
482
|
const { labels: i } = e, o = r.collections?.[i.collection];
|
|
482
483
|
let a = !0;
|
|
483
484
|
if (!o) {
|
|
@@ -488,11 +489,11 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
488
489
|
it("Read", e, t, s, r, l) || (a = !1);
|
|
489
490
|
}), !a)
|
|
490
491
|
throw new Error("PERMISSION_DENIED");
|
|
491
|
-
},
|
|
492
|
+
}, ea = (n, e, t) => {
|
|
492
493
|
const { access: s } = n;
|
|
493
494
|
return s.operations.assignable === !0 || typeof s.operations.assignable == "object" && s.operations.assignable.includes(e) || // eslint-disable-next-line security/detect-object-injection
|
|
494
495
|
s.operations[t]?.includes(e);
|
|
495
|
-
},
|
|
496
|
+
}, ta = (n, e, t) => {
|
|
496
497
|
const { access: s } = e, { entityRestrictions: r } = s;
|
|
497
498
|
if (r?.restrictions) {
|
|
498
499
|
for (const i of r.restrictions)
|
|
@@ -515,7 +516,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
515
516
|
return `${i.type} parent filter`;
|
|
516
517
|
}
|
|
517
518
|
return !0;
|
|
518
|
-
},
|
|
519
|
+
}, na = (n, e, t, s, r) => {
|
|
519
520
|
const i = {};
|
|
520
521
|
for (const o of n) {
|
|
521
522
|
const l = e[o].default(t, s, r);
|
|
@@ -533,7 +534,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
533
534
|
}, qt = (n, e) => n && typeof n == "function" ? e ? n(...e) : n() : n, ie = async (n, e) => {
|
|
534
535
|
let t = n;
|
|
535
536
|
return n && (typeof n == "function" || typeof n.then == "function") && (e ? t = await n(...e) : t = await n()), t;
|
|
536
|
-
},
|
|
537
|
+
}, ou = async (n, e, t, s) => {
|
|
537
538
|
for (const u of e)
|
|
538
539
|
if (u === "__proto__" || u === "constructor" || u === "prototype")
|
|
539
540
|
throw new Error("Invalid config path: prototype pollution keys are not allowed");
|
|
@@ -565,10 +566,10 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
565
566
|
if (d !== void 0) {
|
|
566
567
|
if (d === "__proto__" || d === "constructor" || d === "prototype")
|
|
567
568
|
throw new Error("Invalid config path: prototype pollution keys are not allowed");
|
|
568
|
-
f === e.length - 1 ?
|
|
569
|
+
f === e.length - 1 ? Zo(h, e.join("."), c) : (u[d] ||= {}, u = u[d]);
|
|
569
570
|
}
|
|
570
571
|
}
|
|
571
|
-
|
|
572
|
+
jo(Xn, h);
|
|
572
573
|
}
|
|
573
574
|
return c;
|
|
574
575
|
}, ct = (n, e, t) => {
|
|
@@ -582,7 +583,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
582
583
|
c.field == n.name && (i = !0);
|
|
583
584
|
}
|
|
584
585
|
return i;
|
|
585
|
-
},
|
|
586
|
+
}, fi = (n, e) => {
|
|
586
587
|
const t = Object.values(e.collections), { labels: s } = n, r = {};
|
|
587
588
|
return t.forEach((i) => {
|
|
588
589
|
const { labels: o, fields: a } = i;
|
|
@@ -649,7 +650,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
649
650
|
required: !0
|
|
650
651
|
};
|
|
651
652
|
return t && (s.values = t), s;
|
|
652
|
-
}),
|
|
653
|
+
}), hi = (n, e) => {
|
|
653
654
|
const t = [], { access: s, fields: r } = n, { attributeRestrictions: i, entityRestrictions: o } = s, a = zn();
|
|
654
655
|
return i && i.forEach((l) => {
|
|
655
656
|
if (l.roles.some((c) => c.role === e))
|
|
@@ -691,7 +692,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
691
692
|
break;
|
|
692
693
|
}
|
|
693
694
|
})), [...new Set(t)];
|
|
694
|
-
},
|
|
695
|
+
}, sa = (n, e) => {
|
|
695
696
|
const t = [], { fields: s, roleSystemFields: r, preloadCache: i, queries: o } = n, a = zn();
|
|
696
697
|
return t.push({
|
|
697
698
|
name: "Collection_Path",
|
|
@@ -706,15 +707,15 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
706
707
|
}), o?.forEach((c) => {
|
|
707
708
|
const u = W(s.concat(a), c.field);
|
|
708
709
|
(!c.roles || c.roles.includes(e)) && u && (!u.access || u.access?.includes(e)) && pt.includes(c.field) && t.push(W(a, c.field));
|
|
709
|
-
}),
|
|
710
|
+
}), hi(n, e).forEach((c) => {
|
|
710
711
|
pt.includes(c.name) && t.push(W(a, c.name));
|
|
711
712
|
}), [...new Set(t)];
|
|
712
|
-
},
|
|
713
|
+
}, ra = (n, e, t) => {
|
|
713
714
|
const s = [], { fields: r, preloadCache: i } = e, o = zn();
|
|
714
715
|
i?.range && i.range.fields.forEach((c) => {
|
|
715
716
|
pt.includes(c) ? s.push(W(o, c)) : s.push(W(r, c));
|
|
716
717
|
});
|
|
717
|
-
const a = /* @__PURE__ */ new Set(), l =
|
|
718
|
+
const a = /* @__PURE__ */ new Set(), l = fi(e, t);
|
|
718
719
|
return Object.entries(l).map(([c, u]) => {
|
|
719
720
|
n.name === c && Object.values(u).forEach((h) => {
|
|
720
721
|
h.forEach((f) => {
|
|
@@ -722,7 +723,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
722
723
|
});
|
|
723
724
|
});
|
|
724
725
|
}), a.forEach((c) => {
|
|
725
|
-
s.push(...
|
|
726
|
+
s.push(...hi(e, c));
|
|
726
727
|
}), [...new Set(s)];
|
|
727
728
|
}, dn = (n, e, t) => {
|
|
728
729
|
const s = [], { fields: r, softDelete: i } = e;
|
|
@@ -735,7 +736,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
735
736
|
type: "String",
|
|
736
737
|
required: !0
|
|
737
738
|
});
|
|
738
|
-
const o = [], a =
|
|
739
|
+
const o = [], a = fi(e, t);
|
|
739
740
|
if (Object.values(a).forEach((l) => {
|
|
740
741
|
Object.keys(l).forEach((c) => {
|
|
741
742
|
t.collections[c].fields.forEach((h) => {
|
|
@@ -750,13 +751,13 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
750
751
|
const l = W(r, i.archivedField);
|
|
751
752
|
l && s.push(l);
|
|
752
753
|
}
|
|
753
|
-
return s.push(...
|
|
754
|
-
},
|
|
754
|
+
return s.push(...ra(n, e, t)), [...new Set(s)];
|
|
755
|
+
}, mi = (n, e) => {
|
|
755
756
|
const { preloadCache: t } = n, s = /* @__PURE__ */ new Set();
|
|
756
757
|
for (const r of e.config.roles) {
|
|
757
|
-
if (!
|
|
758
|
+
if (!ea(n, r, "read"))
|
|
758
759
|
continue;
|
|
759
|
-
const i =
|
|
760
|
+
const i = sa(n, r);
|
|
760
761
|
let o = !1;
|
|
761
762
|
if (s.size === 0)
|
|
762
763
|
s.add({ key: "1", roles: [r], fields: i }), o = !0;
|
|
@@ -766,12 +767,12 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
766
767
|
o || s.add({ key: (s.size + 1).toString(), roles: [r], fields: i });
|
|
767
768
|
}
|
|
768
769
|
return s;
|
|
769
|
-
},
|
|
770
|
-
const s =
|
|
770
|
+
}, pi = (n, e, t) => {
|
|
771
|
+
const s = mi(e, t);
|
|
771
772
|
for (const r of s.values())
|
|
772
773
|
if (r.roles.includes(n))
|
|
773
774
|
return r;
|
|
774
|
-
},
|
|
775
|
+
}, ia = (n, e) => {
|
|
775
776
|
const { fields: t } = e, s = zn(), r = [];
|
|
776
777
|
return [...t, ...s.filter((o) => o.name !== "id")].forEach((o) => {
|
|
777
778
|
n?.fields.some((a) => a.name === o.name) || r.push(o);
|
|
@@ -779,7 +780,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
|
|
|
779
780
|
}, Us = (n, e, t) => {
|
|
780
781
|
const s = {};
|
|
781
782
|
return Object.values(n.collections).forEach((r) => {
|
|
782
|
-
const i =
|
|
783
|
+
const i = mi(r, n), o = Array.from(i);
|
|
783
784
|
o.map((a) => (a.fields.forEach((l) => {
|
|
784
785
|
}), a)), s[r.labels.collection] = new Set(o);
|
|
785
786
|
}), s;
|
|
@@ -852,7 +853,7 @@ const Ws = (n, e, t, s, r, i, o, a, l, c) => (n == "create" && (t.Collection_Pat
|
|
|
852
853
|
wt(n, n.fields).forEach((s) => {
|
|
853
854
|
e[s.name] ? e[`${s.name}_Lowercase`] = e[s.name].toLowerCase() : delete e[`${s.name}_Lowercase`];
|
|
854
855
|
});
|
|
855
|
-
},
|
|
856
|
+
}, oa = async (n, e, t, s) => {
|
|
856
857
|
const { fields: r } = e;
|
|
857
858
|
for (const i of t.fields) {
|
|
858
859
|
const o = W(r, i.name);
|
|
@@ -1086,11 +1087,11 @@ const ws = (n, e) => {
|
|
|
1086
1087
|
}
|
|
1087
1088
|
return { message: t };
|
|
1088
1089
|
};
|
|
1089
|
-
let
|
|
1090
|
-
function
|
|
1091
|
-
return
|
|
1090
|
+
let aa = ws;
|
|
1091
|
+
function la() {
|
|
1092
|
+
return aa;
|
|
1092
1093
|
}
|
|
1093
|
-
const
|
|
1094
|
+
const ca = (n) => {
|
|
1094
1095
|
const { data: e, path: t, errorMaps: s, issueData: r } = n, i = [...t, ...r.path || []], o = {
|
|
1095
1096
|
...r,
|
|
1096
1097
|
path: i
|
|
@@ -1112,7 +1113,7 @@ const la = (n) => {
|
|
|
1112
1113
|
};
|
|
1113
1114
|
};
|
|
1114
1115
|
function L(n, e) {
|
|
1115
|
-
const t =
|
|
1116
|
+
const t = la(), s = ca({
|
|
1116
1117
|
issueData: e,
|
|
1117
1118
|
data: n.data,
|
|
1118
1119
|
path: n.path,
|
|
@@ -1394,7 +1395,7 @@ class X {
|
|
|
1394
1395
|
});
|
|
1395
1396
|
}
|
|
1396
1397
|
brand() {
|
|
1397
|
-
return new
|
|
1398
|
+
return new Aa({
|
|
1398
1399
|
typeName: G.ZodBranded,
|
|
1399
1400
|
type: this,
|
|
1400
1401
|
...J(this._def)
|
|
@@ -1429,28 +1430,28 @@ class X {
|
|
|
1429
1430
|
return this.safeParse(null).success;
|
|
1430
1431
|
}
|
|
1431
1432
|
}
|
|
1432
|
-
const
|
|
1433
|
+
const ua = /^c[^\s-]{8,}$/i, da = /^[0-9a-z]+$/, fa = /^[0-9A-HJKMNP-TV-Z]{26}$/i, ha = /^[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, ma = /^[a-z0-9_-]{21}$/i, pa = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, ya = /^[-+]?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)?)??$/, ga = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, wa = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1433
1434
|
let ns;
|
|
1434
|
-
const
|
|
1435
|
-
function
|
|
1435
|
+
const _a = /^(?:(?: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])$/, Ea = /^(?:(?: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])$/, va = /^(([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]))$/, Oa = /^(([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])$/, ka = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ba = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, yi = "((\\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])))", Sa = new RegExp(`^${yi}$`);
|
|
1436
|
+
function gi(n) {
|
|
1436
1437
|
let e = "[0-5]\\d";
|
|
1437
1438
|
n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
1438
1439
|
const t = n.precision ? "+" : "?";
|
|
1439
1440
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
|
|
1440
1441
|
}
|
|
1441
|
-
function Sa(n) {
|
|
1442
|
-
return new RegExp(`^${yi(n)}$`);
|
|
1443
|
-
}
|
|
1444
1442
|
function Ta(n) {
|
|
1445
|
-
|
|
1443
|
+
return new RegExp(`^${gi(n)}$`);
|
|
1444
|
+
}
|
|
1445
|
+
function Ra(n) {
|
|
1446
|
+
let e = `${yi}T${gi(n)}`;
|
|
1446
1447
|
const t = [];
|
|
1447
1448
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
1448
1449
|
}
|
|
1449
|
-
function Ra(n, e) {
|
|
1450
|
-
return !!((e === "v4" || !e) && wa.test(n) || (e === "v6" || !e) && Ea.test(n));
|
|
1451
|
-
}
|
|
1452
1450
|
function Na(n, e) {
|
|
1453
|
-
|
|
1451
|
+
return !!((e === "v4" || !e) && _a.test(n) || (e === "v6" || !e) && va.test(n));
|
|
1452
|
+
}
|
|
1453
|
+
function xa(n, e) {
|
|
1454
|
+
if (!pa.test(n))
|
|
1454
1455
|
return !1;
|
|
1455
1456
|
try {
|
|
1456
1457
|
const [t] = n.split(".");
|
|
@@ -1462,8 +1463,8 @@ function Na(n, e) {
|
|
|
1462
1463
|
return !1;
|
|
1463
1464
|
}
|
|
1464
1465
|
}
|
|
1465
|
-
function
|
|
1466
|
-
return !!((e === "v4" || !e) &&
|
|
1466
|
+
function Ia(n, e) {
|
|
1467
|
+
return !!((e === "v4" || !e) && Ea.test(n) || (e === "v6" || !e) && Oa.test(n));
|
|
1467
1468
|
}
|
|
1468
1469
|
class qe extends X {
|
|
1469
1470
|
_parse(e) {
|
|
@@ -1514,43 +1515,43 @@ class qe extends X {
|
|
|
1514
1515
|
message: i.message
|
|
1515
1516
|
}), s.dirty());
|
|
1516
1517
|
} else if (i.kind === "email")
|
|
1517
|
-
|
|
1518
|
+
ga.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1518
1519
|
validation: "email",
|
|
1519
1520
|
code: I.invalid_string,
|
|
1520
1521
|
message: i.message
|
|
1521
1522
|
}), s.dirty());
|
|
1522
1523
|
else if (i.kind === "emoji")
|
|
1523
|
-
ns || (ns = new RegExp(
|
|
1524
|
+
ns || (ns = new RegExp(wa, "u")), ns.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1524
1525
|
validation: "emoji",
|
|
1525
1526
|
code: I.invalid_string,
|
|
1526
1527
|
message: i.message
|
|
1527
1528
|
}), s.dirty());
|
|
1528
1529
|
else if (i.kind === "uuid")
|
|
1529
|
-
|
|
1530
|
+
ha.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1530
1531
|
validation: "uuid",
|
|
1531
1532
|
code: I.invalid_string,
|
|
1532
1533
|
message: i.message
|
|
1533
1534
|
}), s.dirty());
|
|
1534
1535
|
else if (i.kind === "nanoid")
|
|
1535
|
-
|
|
1536
|
+
ma.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1536
1537
|
validation: "nanoid",
|
|
1537
1538
|
code: I.invalid_string,
|
|
1538
1539
|
message: i.message
|
|
1539
1540
|
}), s.dirty());
|
|
1540
1541
|
else if (i.kind === "cuid")
|
|
1541
|
-
|
|
1542
|
+
ua.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1542
1543
|
validation: "cuid",
|
|
1543
1544
|
code: I.invalid_string,
|
|
1544
1545
|
message: i.message
|
|
1545
1546
|
}), s.dirty());
|
|
1546
1547
|
else if (i.kind === "cuid2")
|
|
1547
|
-
|
|
1548
|
+
da.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1548
1549
|
validation: "cuid2",
|
|
1549
1550
|
code: I.invalid_string,
|
|
1550
1551
|
message: i.message
|
|
1551
1552
|
}), s.dirty());
|
|
1552
1553
|
else if (i.kind === "ulid")
|
|
1553
|
-
|
|
1554
|
+
fa.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1554
1555
|
validation: "ulid",
|
|
1555
1556
|
code: I.invalid_string,
|
|
1556
1557
|
message: i.message
|
|
@@ -1581,39 +1582,39 @@ class qe extends X {
|
|
|
1581
1582
|
code: I.invalid_string,
|
|
1582
1583
|
validation: { endsWith: i.value },
|
|
1583
1584
|
message: i.message
|
|
1584
|
-
}), s.dirty()) : i.kind === "datetime" ?
|
|
1585
|
+
}), s.dirty()) : i.kind === "datetime" ? Ra(i).test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1585
1586
|
code: I.invalid_string,
|
|
1586
1587
|
validation: "datetime",
|
|
1587
1588
|
message: i.message
|
|
1588
|
-
}), s.dirty()) : i.kind === "date" ?
|
|
1589
|
+
}), s.dirty()) : i.kind === "date" ? Sa.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1589
1590
|
code: I.invalid_string,
|
|
1590
1591
|
validation: "date",
|
|
1591
1592
|
message: i.message
|
|
1592
|
-
}), s.dirty()) : i.kind === "time" ?
|
|
1593
|
+
}), s.dirty()) : i.kind === "time" ? Ta(i).test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1593
1594
|
code: I.invalid_string,
|
|
1594
1595
|
validation: "time",
|
|
1595
1596
|
message: i.message
|
|
1596
|
-
}), s.dirty()) : i.kind === "duration" ?
|
|
1597
|
+
}), s.dirty()) : i.kind === "duration" ? ya.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1597
1598
|
validation: "duration",
|
|
1598
1599
|
code: I.invalid_string,
|
|
1599
1600
|
message: i.message
|
|
1600
|
-
}), s.dirty()) : i.kind === "ip" ?
|
|
1601
|
+
}), s.dirty()) : i.kind === "ip" ? Na(e.data, i.version) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1601
1602
|
validation: "ip",
|
|
1602
1603
|
code: I.invalid_string,
|
|
1603
1604
|
message: i.message
|
|
1604
|
-
}), s.dirty()) : i.kind === "jwt" ?
|
|
1605
|
+
}), s.dirty()) : i.kind === "jwt" ? xa(e.data, i.alg) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1605
1606
|
validation: "jwt",
|
|
1606
1607
|
code: I.invalid_string,
|
|
1607
1608
|
message: i.message
|
|
1608
|
-
}), s.dirty()) : i.kind === "cidr" ?
|
|
1609
|
+
}), s.dirty()) : i.kind === "cidr" ? Ia(e.data, i.version) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1609
1610
|
validation: "cidr",
|
|
1610
1611
|
code: I.invalid_string,
|
|
1611
1612
|
message: i.message
|
|
1612
|
-
}), s.dirty()) : i.kind === "base64" ?
|
|
1613
|
+
}), s.dirty()) : i.kind === "base64" ? ka.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1613
1614
|
validation: "base64",
|
|
1614
1615
|
code: I.invalid_string,
|
|
1615
1616
|
message: i.message
|
|
1616
|
-
}), s.dirty()) : i.kind === "base64url" ?
|
|
1617
|
+
}), s.dirty()) : i.kind === "base64url" ? ba.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
|
|
1617
1618
|
validation: "base64url",
|
|
1618
1619
|
code: I.invalid_string,
|
|
1619
1620
|
message: i.message
|
|
@@ -1848,7 +1849,7 @@ qe.create = (n) => new qe({
|
|
|
1848
1849
|
coerce: n?.coerce ?? !1,
|
|
1849
1850
|
...J(n)
|
|
1850
1851
|
});
|
|
1851
|
-
function
|
|
1852
|
+
function Da(n, e) {
|
|
1852
1853
|
const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, i = Number.parseInt(n.toFixed(r).replace(".", "")), o = Number.parseInt(e.toFixed(r).replace(".", ""));
|
|
1853
1854
|
return i % o / 10 ** r;
|
|
1854
1855
|
}
|
|
@@ -1887,7 +1888,7 @@ class It extends X {
|
|
|
1887
1888
|
inclusive: i.inclusive,
|
|
1888
1889
|
exact: !1,
|
|
1889
1890
|
message: i.message
|
|
1890
|
-
}), r.dirty()) : i.kind === "multipleOf" ?
|
|
1891
|
+
}), r.dirty()) : i.kind === "multipleOf" ? Da(e.data, i.value) !== 0 && (s = this._getOrReturnCtx(e, s), L(s, {
|
|
1891
1892
|
code: I.not_multiple_of,
|
|
1892
1893
|
multipleOf: i.value,
|
|
1893
1894
|
message: i.message
|
|
@@ -2711,7 +2712,7 @@ class fe extends X {
|
|
|
2711
2712
|
});
|
|
2712
2713
|
}
|
|
2713
2714
|
keyof() {
|
|
2714
|
-
return
|
|
2715
|
+
return wi(te.objectKeys(this.shape));
|
|
2715
2716
|
}
|
|
2716
2717
|
}
|
|
2717
2718
|
fe.create = (n, e) => new fe({
|
|
@@ -3110,7 +3111,7 @@ ks.create = (n, e) => new ks({
|
|
|
3110
3111
|
typeName: G.ZodLiteral,
|
|
3111
3112
|
...J(e)
|
|
3112
3113
|
});
|
|
3113
|
-
function
|
|
3114
|
+
function wi(n, e) {
|
|
3114
3115
|
return new Dt({
|
|
3115
3116
|
values: n,
|
|
3116
3117
|
typeName: G.ZodEnum,
|
|
@@ -3171,7 +3172,7 @@ class Dt extends X {
|
|
|
3171
3172
|
});
|
|
3172
3173
|
}
|
|
3173
3174
|
}
|
|
3174
|
-
Dt.create =
|
|
3175
|
+
Dt.create = wi;
|
|
3175
3176
|
class gr extends X {
|
|
3176
3177
|
_parse(e) {
|
|
3177
3178
|
const t = te.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
@@ -3424,7 +3425,7 @@ wr.create = (n) => new wr({
|
|
|
3424
3425
|
typeName: G.ZodNaN,
|
|
3425
3426
|
...J(n)
|
|
3426
3427
|
});
|
|
3427
|
-
class
|
|
3428
|
+
class Aa extends X {
|
|
3428
3429
|
_parse(e) {
|
|
3429
3430
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
3430
3431
|
return this._def.type._parse({
|
|
@@ -3508,7 +3509,7 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3508
3509
|
message: "Value is not a valid timestamp"
|
|
3509
3510
|
}), _r = () => ge().refine((n) => n && (n._methodName === "serverTimestamp" || n.constructor.name === "ServerTimestampTransform"), {
|
|
3510
3511
|
message: "Value is not a valid server timestamp"
|
|
3511
|
-
}),
|
|
3512
|
+
}), _i = (n, e) => {
|
|
3512
3513
|
const t = {};
|
|
3513
3514
|
if (n.includeFields) {
|
|
3514
3515
|
const s = e.collections[n.collection];
|
|
@@ -3525,10 +3526,10 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3525
3526
|
Collection_Path: _t(be()),
|
|
3526
3527
|
...t
|
|
3527
3528
|
});
|
|
3528
|
-
},
|
|
3529
|
-
let t = rn(
|
|
3529
|
+
}, Ca = (n, e) => {
|
|
3530
|
+
let t = rn(_i(n, e));
|
|
3530
3531
|
return n.required || (t = t.optional()), t;
|
|
3531
|
-
},
|
|
3532
|
+
}, $a = (n) => {
|
|
3532
3533
|
let e = _t(Oe([be().length(20), be().length(28)]));
|
|
3533
3534
|
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;
|
|
3534
3535
|
}, Mn = (n, e, t) => {
|
|
@@ -3580,7 +3581,7 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3580
3581
|
break;
|
|
3581
3582
|
}
|
|
3582
3583
|
return !K(e) && e.nullable && (i = i.nullable()), e.required || (i = i.optional()), i;
|
|
3583
|
-
},
|
|
3584
|
+
}, Ma = (n, e, t) => {
|
|
3584
3585
|
const s = {
|
|
3585
3586
|
Collection_Path: _t(be()),
|
|
3586
3587
|
Last_Write_App: be(),
|
|
@@ -3596,7 +3597,7 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3596
3597
|
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());
|
|
3597
3598
|
const r = ft(e, e.fields), i = Array.from(r).map((l) => l.name);
|
|
3598
3599
|
e.fields.forEach((l) => {
|
|
3599
|
-
K(l) ? (s[l.name] =
|
|
3600
|
+
K(l) ? (s[l.name] = Ca(l, t), s[`${l.name}_Array`] = $a(l), i.includes(l.name) && (s[`${l.name}_Single`] = _i(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, {
|
|
3600
3601
|
message: `Value must contain ${l.length} item(s)`
|
|
3601
3602
|
})), l.min && (s[l.name] = s[l.name].refine((c) => l.min && c && Object.keys(c).length >= l.min, {
|
|
3602
3603
|
message: `Value must contain at least ${l.min} item(s)`
|
|
@@ -3611,24 +3612,24 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3611
3612
|
};
|
|
3612
3613
|
class Et extends Error {
|
|
3613
3614
|
}
|
|
3614
|
-
class
|
|
3615
|
+
class Fa extends Et {
|
|
3615
3616
|
constructor(e) {
|
|
3616
3617
|
super(`Invalid DateTime: ${e.toMessage()}`);
|
|
3617
3618
|
}
|
|
3618
3619
|
}
|
|
3619
|
-
class
|
|
3620
|
+
class Pa extends Et {
|
|
3620
3621
|
constructor(e) {
|
|
3621
3622
|
super(`Invalid Interval: ${e.toMessage()}`);
|
|
3622
3623
|
}
|
|
3623
3624
|
}
|
|
3624
|
-
class
|
|
3625
|
+
class La extends Et {
|
|
3625
3626
|
constructor(e) {
|
|
3626
3627
|
super(`Invalid Duration: ${e.toMessage()}`);
|
|
3627
3628
|
}
|
|
3628
3629
|
}
|
|
3629
3630
|
class St extends Et {
|
|
3630
3631
|
}
|
|
3631
|
-
class
|
|
3632
|
+
class Ei extends Et {
|
|
3632
3633
|
constructor(e) {
|
|
3633
3634
|
super(`Invalid unit ${e}`);
|
|
3634
3635
|
}
|
|
@@ -3644,103 +3645,103 @@ const $ = "numeric", Pe = "short", Se = "long", Fn = {
|
|
|
3644
3645
|
year: $,
|
|
3645
3646
|
month: $,
|
|
3646
3647
|
day: $
|
|
3647
|
-
},
|
|
3648
|
+
}, vi = {
|
|
3648
3649
|
year: $,
|
|
3649
3650
|
month: Pe,
|
|
3650
3651
|
day: $
|
|
3651
|
-
},
|
|
3652
|
+
}, Va = {
|
|
3652
3653
|
year: $,
|
|
3653
3654
|
month: Pe,
|
|
3654
3655
|
day: $,
|
|
3655
3656
|
weekday: Pe
|
|
3656
|
-
},
|
|
3657
|
+
}, Oi = {
|
|
3657
3658
|
year: $,
|
|
3658
3659
|
month: Se,
|
|
3659
3660
|
day: $
|
|
3660
|
-
},
|
|
3661
|
+
}, ki = {
|
|
3661
3662
|
year: $,
|
|
3662
3663
|
month: Se,
|
|
3663
3664
|
day: $,
|
|
3664
3665
|
weekday: Se
|
|
3665
|
-
},
|
|
3666
|
+
}, bi = {
|
|
3666
3667
|
hour: $,
|
|
3667
3668
|
minute: $
|
|
3668
|
-
},
|
|
3669
|
+
}, Si = {
|
|
3669
3670
|
hour: $,
|
|
3670
3671
|
minute: $,
|
|
3671
3672
|
second: $
|
|
3672
|
-
},
|
|
3673
|
+
}, Ti = {
|
|
3673
3674
|
hour: $,
|
|
3674
3675
|
minute: $,
|
|
3675
3676
|
second: $,
|
|
3676
3677
|
timeZoneName: Pe
|
|
3677
|
-
},
|
|
3678
|
+
}, Ri = {
|
|
3678
3679
|
hour: $,
|
|
3679
3680
|
minute: $,
|
|
3680
3681
|
second: $,
|
|
3681
3682
|
timeZoneName: Se
|
|
3682
|
-
},
|
|
3683
|
+
}, Ni = {
|
|
3683
3684
|
hour: $,
|
|
3684
3685
|
minute: $,
|
|
3685
3686
|
hourCycle: "h23"
|
|
3686
|
-
},
|
|
3687
|
+
}, xi = {
|
|
3687
3688
|
hour: $,
|
|
3688
3689
|
minute: $,
|
|
3689
3690
|
second: $,
|
|
3690
3691
|
hourCycle: "h23"
|
|
3691
|
-
},
|
|
3692
|
+
}, Ii = {
|
|
3692
3693
|
hour: $,
|
|
3693
3694
|
minute: $,
|
|
3694
3695
|
second: $,
|
|
3695
3696
|
hourCycle: "h23",
|
|
3696
3697
|
timeZoneName: Pe
|
|
3697
|
-
},
|
|
3698
|
+
}, Di = {
|
|
3698
3699
|
hour: $,
|
|
3699
3700
|
minute: $,
|
|
3700
3701
|
second: $,
|
|
3701
3702
|
hourCycle: "h23",
|
|
3702
3703
|
timeZoneName: Se
|
|
3703
|
-
},
|
|
3704
|
+
}, Ai = {
|
|
3704
3705
|
year: $,
|
|
3705
3706
|
month: $,
|
|
3706
3707
|
day: $,
|
|
3707
3708
|
hour: $,
|
|
3708
3709
|
minute: $
|
|
3709
|
-
},
|
|
3710
|
+
}, Ci = {
|
|
3710
3711
|
year: $,
|
|
3711
3712
|
month: $,
|
|
3712
3713
|
day: $,
|
|
3713
3714
|
hour: $,
|
|
3714
3715
|
minute: $,
|
|
3715
3716
|
second: $
|
|
3716
|
-
},
|
|
3717
|
+
}, $i = {
|
|
3717
3718
|
year: $,
|
|
3718
3719
|
month: Pe,
|
|
3719
3720
|
day: $,
|
|
3720
3721
|
hour: $,
|
|
3721
3722
|
minute: $
|
|
3722
|
-
},
|
|
3723
|
+
}, Mi = {
|
|
3723
3724
|
year: $,
|
|
3724
3725
|
month: Pe,
|
|
3725
3726
|
day: $,
|
|
3726
3727
|
hour: $,
|
|
3727
3728
|
minute: $,
|
|
3728
3729
|
second: $
|
|
3729
|
-
},
|
|
3730
|
+
}, Ua = {
|
|
3730
3731
|
year: $,
|
|
3731
3732
|
month: Pe,
|
|
3732
3733
|
day: $,
|
|
3733
3734
|
weekday: Pe,
|
|
3734
3735
|
hour: $,
|
|
3735
3736
|
minute: $
|
|
3736
|
-
},
|
|
3737
|
+
}, Fi = {
|
|
3737
3738
|
year: $,
|
|
3738
3739
|
month: Se,
|
|
3739
3740
|
day: $,
|
|
3740
3741
|
hour: $,
|
|
3741
3742
|
minute: $,
|
|
3742
3743
|
timeZoneName: Pe
|
|
3743
|
-
},
|
|
3744
|
+
}, Pi = {
|
|
3744
3745
|
year: $,
|
|
3745
3746
|
month: Se,
|
|
3746
3747
|
day: $,
|
|
@@ -3748,7 +3749,7 @@ const $ = "numeric", Pe = "short", Se = "long", Fn = {
|
|
|
3748
3749
|
minute: $,
|
|
3749
3750
|
second: $,
|
|
3750
3751
|
timeZoneName: Pe
|
|
3751
|
-
},
|
|
3752
|
+
}, Li = {
|
|
3752
3753
|
year: $,
|
|
3753
3754
|
month: Se,
|
|
3754
3755
|
day: $,
|
|
@@ -3756,7 +3757,7 @@ const $ = "numeric", Pe = "short", Se = "long", Fn = {
|
|
|
3756
3757
|
hour: $,
|
|
3757
3758
|
minute: $,
|
|
3758
3759
|
timeZoneName: Se
|
|
3759
|
-
},
|
|
3760
|
+
}, Vi = {
|
|
3760
3761
|
year: $,
|
|
3761
3762
|
month: Se,
|
|
3762
3763
|
day: $,
|
|
@@ -3873,7 +3874,7 @@ class qn extends on {
|
|
|
3873
3874
|
}
|
|
3874
3875
|
/** @override **/
|
|
3875
3876
|
offsetName(e, { format: t, locale: s }) {
|
|
3876
|
-
return
|
|
3877
|
+
return Ji(e, t, s);
|
|
3877
3878
|
}
|
|
3878
3879
|
/** @override **/
|
|
3879
3880
|
formatOffset(e, t) {
|
|
@@ -3893,7 +3894,7 @@ class qn extends on {
|
|
|
3893
3894
|
}
|
|
3894
3895
|
}
|
|
3895
3896
|
const Rs = /* @__PURE__ */ new Map();
|
|
3896
|
-
function
|
|
3897
|
+
function Wa(n) {
|
|
3897
3898
|
let e = Rs.get(n);
|
|
3898
3899
|
return e === void 0 && (e = new Intl.DateTimeFormat("en-US", {
|
|
3899
3900
|
hour12: !1,
|
|
@@ -3907,7 +3908,7 @@ function Ua(n) {
|
|
|
3907
3908
|
era: "short"
|
|
3908
3909
|
}), Rs.set(n, e)), e;
|
|
3909
3910
|
}
|
|
3910
|
-
const
|
|
3911
|
+
const ja = {
|
|
3911
3912
|
year: 0,
|
|
3912
3913
|
month: 1,
|
|
3913
3914
|
day: 2,
|
|
@@ -3916,14 +3917,14 @@ const Wa = {
|
|
|
3916
3917
|
minute: 5,
|
|
3917
3918
|
second: 6
|
|
3918
3919
|
};
|
|
3919
|
-
function
|
|
3920
|
+
function Za(n, e) {
|
|
3920
3921
|
const t = n.format(e).replace(/\u200E/g, ""), s = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t), [, r, i, o, a, l, c, u] = s;
|
|
3921
3922
|
return [o, r, i, a, l, c, u];
|
|
3922
3923
|
}
|
|
3923
|
-
function
|
|
3924
|
+
function za(n, e) {
|
|
3924
3925
|
const t = n.formatToParts(e), s = [];
|
|
3925
3926
|
for (let r = 0; r < t.length; r++) {
|
|
3926
|
-
const { type: i, value: o } = t[r], a =
|
|
3927
|
+
const { type: i, value: o } = t[r], a = ja[i];
|
|
3927
3928
|
i === "era" ? s[a] = o : H(a) || (s[a] = parseInt(o, 10));
|
|
3928
3929
|
}
|
|
3929
3930
|
return s;
|
|
@@ -4011,7 +4012,7 @@ class He extends on {
|
|
|
4011
4012
|
* @return {string}
|
|
4012
4013
|
*/
|
|
4013
4014
|
offsetName(e, { format: t, locale: s }) {
|
|
4014
|
-
return
|
|
4015
|
+
return Ji(e, t, s, this.name);
|
|
4015
4016
|
}
|
|
4016
4017
|
/**
|
|
4017
4018
|
* Returns the offset's value as a string
|
|
@@ -4034,8 +4035,8 @@ class He extends on {
|
|
|
4034
4035
|
if (!this.valid) return NaN;
|
|
4035
4036
|
const t = new Date(e);
|
|
4036
4037
|
if (isNaN(t)) return NaN;
|
|
4037
|
-
const s =
|
|
4038
|
-
let [r, i, o, a, l, c, u] = s.formatToParts ?
|
|
4038
|
+
const s = Wa(this.name);
|
|
4039
|
+
let [r, i, o, a, l, c, u] = s.formatToParts ? za(s, t) : Za(s, t);
|
|
4039
4040
|
a === "BC" && (r = -Math.abs(r) + 1);
|
|
4040
4041
|
const f = Hn({
|
|
4041
4042
|
year: r,
|
|
@@ -4069,7 +4070,7 @@ class He extends on {
|
|
|
4069
4070
|
}
|
|
4070
4071
|
}
|
|
4071
4072
|
let Er = {};
|
|
4072
|
-
function
|
|
4073
|
+
function qa(n, e = {}) {
|
|
4073
4074
|
const t = JSON.stringify([n, e]);
|
|
4074
4075
|
let s = Er[t];
|
|
4075
4076
|
return s || (s = new Intl.ListFormat(n, e), Er[t] = s), s;
|
|
@@ -4081,36 +4082,36 @@ function xs(n, e = {}) {
|
|
|
4081
4082
|
return s === void 0 && (s = new Intl.DateTimeFormat(n, e), Ns.set(t, s)), s;
|
|
4082
4083
|
}
|
|
4083
4084
|
const Is = /* @__PURE__ */ new Map();
|
|
4084
|
-
function
|
|
4085
|
+
function Ba(n, e = {}) {
|
|
4085
4086
|
const t = JSON.stringify([n, e]);
|
|
4086
4087
|
let s = Is.get(t);
|
|
4087
4088
|
return s === void 0 && (s = new Intl.NumberFormat(n, e), Is.set(t, s)), s;
|
|
4088
4089
|
}
|
|
4089
4090
|
const Ds = /* @__PURE__ */ new Map();
|
|
4090
|
-
function
|
|
4091
|
+
function Ha(n, e = {}) {
|
|
4091
4092
|
const { base: t, ...s } = e, r = JSON.stringify([n, s]);
|
|
4092
4093
|
let i = Ds.get(r);
|
|
4093
4094
|
return i === void 0 && (i = new Intl.RelativeTimeFormat(n, e), Ds.set(r, i)), i;
|
|
4094
4095
|
}
|
|
4095
4096
|
let Ht = null;
|
|
4096
|
-
function
|
|
4097
|
+
function Ga() {
|
|
4097
4098
|
return Ht || (Ht = new Intl.DateTimeFormat().resolvedOptions().locale, Ht);
|
|
4098
4099
|
}
|
|
4099
4100
|
const As = /* @__PURE__ */ new Map();
|
|
4100
|
-
function
|
|
4101
|
+
function Ui(n) {
|
|
4101
4102
|
let e = As.get(n);
|
|
4102
4103
|
return e === void 0 && (e = new Intl.DateTimeFormat(n).resolvedOptions(), As.set(n, e)), e;
|
|
4103
4104
|
}
|
|
4104
4105
|
const Cs = /* @__PURE__ */ new Map();
|
|
4105
|
-
function
|
|
4106
|
+
function Ya(n) {
|
|
4106
4107
|
let e = Cs.get(n);
|
|
4107
4108
|
if (!e) {
|
|
4108
4109
|
const t = new Intl.Locale(n);
|
|
4109
|
-
e = "getWeekInfo" in t ? t.getWeekInfo() : t.weekInfo, "minimalDays" in e || (e = { ...
|
|
4110
|
+
e = "getWeekInfo" in t ? t.getWeekInfo() : t.weekInfo, "minimalDays" in e || (e = { ...Wi, ...e }), Cs.set(n, e);
|
|
4110
4111
|
}
|
|
4111
4112
|
return e;
|
|
4112
4113
|
}
|
|
4113
|
-
function
|
|
4114
|
+
function Ja(n) {
|
|
4114
4115
|
const e = n.indexOf("-x-");
|
|
4115
4116
|
e !== -1 && (n = n.substring(0, e));
|
|
4116
4117
|
const t = n.indexOf("-u-");
|
|
@@ -4128,10 +4129,10 @@ function Ya(n) {
|
|
|
4128
4129
|
return [r, i, o];
|
|
4129
4130
|
}
|
|
4130
4131
|
}
|
|
4131
|
-
function
|
|
4132
|
+
function Qa(n, e, t) {
|
|
4132
4133
|
return (t || e) && (n.includes("-u-") || (n += "-u"), t && (n += `-ca-${t}`), e && (n += `-nu-${e}`)), n;
|
|
4133
4134
|
}
|
|
4134
|
-
function
|
|
4135
|
+
function Ka(n) {
|
|
4135
4136
|
const e = [];
|
|
4136
4137
|
for (let t = 1; t <= 12; t++) {
|
|
4137
4138
|
const s = V.utc(2009, t, 1);
|
|
@@ -4139,7 +4140,7 @@ function Qa(n) {
|
|
|
4139
4140
|
}
|
|
4140
4141
|
return e;
|
|
4141
4142
|
}
|
|
4142
|
-
function
|
|
4143
|
+
function Xa(n) {
|
|
4143
4144
|
const e = [];
|
|
4144
4145
|
for (let t = 1; t <= 7; t++) {
|
|
4145
4146
|
const s = V.utc(2016, 11, 13 + t);
|
|
@@ -4151,16 +4152,16 @@ function fn(n, e, t, s) {
|
|
|
4151
4152
|
const r = n.listingMode();
|
|
4152
4153
|
return r === "error" ? null : r === "en" ? t(e) : s(e);
|
|
4153
4154
|
}
|
|
4154
|
-
function
|
|
4155
|
-
return n.numberingSystem && n.numberingSystem !== "latn" ? !1 : n.numberingSystem === "latn" || !n.locale || n.locale.startsWith("en") ||
|
|
4155
|
+
function el(n) {
|
|
4156
|
+
return n.numberingSystem && n.numberingSystem !== "latn" ? !1 : n.numberingSystem === "latn" || !n.locale || n.locale.startsWith("en") || Ui(n.locale).numberingSystem === "latn";
|
|
4156
4157
|
}
|
|
4157
|
-
class
|
|
4158
|
+
class tl {
|
|
4158
4159
|
constructor(e, t, s) {
|
|
4159
4160
|
this.padTo = s.padTo || 0, this.floor = s.floor || !1;
|
|
4160
4161
|
const { padTo: r, floor: i, ...o } = s;
|
|
4161
4162
|
if (!t || Object.keys(o).length > 0) {
|
|
4162
4163
|
const a = { useGrouping: !1, ...s };
|
|
4163
|
-
s.padTo > 0 && (a.minimumIntegerDigits = s.padTo), this.inf =
|
|
4164
|
+
s.padTo > 0 && (a.minimumIntegerDigits = s.padTo), this.inf = Ba(e, a);
|
|
4164
4165
|
}
|
|
4165
4166
|
}
|
|
4166
4167
|
format(e) {
|
|
@@ -4173,7 +4174,7 @@ class el {
|
|
|
4173
4174
|
}
|
|
4174
4175
|
}
|
|
4175
4176
|
}
|
|
4176
|
-
class
|
|
4177
|
+
class nl {
|
|
4177
4178
|
constructor(e, t, s) {
|
|
4178
4179
|
this.opts = s, this.originalZone = void 0;
|
|
4179
4180
|
let r;
|
|
@@ -4209,18 +4210,18 @@ class tl {
|
|
|
4209
4210
|
return this.dtf.resolvedOptions();
|
|
4210
4211
|
}
|
|
4211
4212
|
}
|
|
4212
|
-
class
|
|
4213
|
+
class sl {
|
|
4213
4214
|
constructor(e, t, s) {
|
|
4214
|
-
this.opts = { style: "long", ...s }, !t &&
|
|
4215
|
+
this.opts = { style: "long", ...s }, !t && Gi() && (this.rtf = Ha(e, s));
|
|
4215
4216
|
}
|
|
4216
4217
|
format(e, t) {
|
|
4217
|
-
return this.rtf ? this.rtf.format(e, t) :
|
|
4218
|
+
return this.rtf ? this.rtf.format(e, t) : Sl(t, e, this.opts.numeric, this.opts.style !== "long");
|
|
4218
4219
|
}
|
|
4219
4220
|
formatToParts(e, t) {
|
|
4220
4221
|
return this.rtf ? this.rtf.formatToParts(e, t) : [];
|
|
4221
4222
|
}
|
|
4222
4223
|
}
|
|
4223
|
-
const
|
|
4224
|
+
const Wi = {
|
|
4224
4225
|
firstDay: 1,
|
|
4225
4226
|
minimalDays: 4,
|
|
4226
4227
|
weekend: [6, 7]
|
|
@@ -4236,7 +4237,7 @@ class se {
|
|
|
4236
4237
|
);
|
|
4237
4238
|
}
|
|
4238
4239
|
static create(e, t, s, r, i = !1) {
|
|
4239
|
-
const o = e || ce.defaultLocale, a = o || (i ? "en-US" :
|
|
4240
|
+
const o = e || ce.defaultLocale, a = o || (i ? "en-US" : Ga()), l = t || ce.defaultNumberingSystem, c = s || ce.defaultOutputCalendar, u = Ms(r) || ce.defaultWeekSettings;
|
|
4240
4241
|
return new se(a, l, c, u, o);
|
|
4241
4242
|
}
|
|
4242
4243
|
static resetCache() {
|
|
@@ -4246,11 +4247,11 @@ class se {
|
|
|
4246
4247
|
return se.create(e, t, s, r);
|
|
4247
4248
|
}
|
|
4248
4249
|
constructor(e, t, s, r, i) {
|
|
4249
|
-
const [o, a, l] =
|
|
4250
|
-
this.locale = o, this.numberingSystem = t || a || null, this.outputCalendar = s || l || null, this.weekSettings = r, this.intl =
|
|
4250
|
+
const [o, a, l] = Ja(e);
|
|
4251
|
+
this.locale = o, this.numberingSystem = t || a || null, this.outputCalendar = s || l || null, this.weekSettings = r, this.intl = Qa(this.locale, this.numberingSystem, this.outputCalendar), this.weekdaysCache = { format: {}, standalone: {} }, this.monthsCache = { format: {}, standalone: {} }, this.meridiemCache = null, this.eraCache = {}, this.specifiedLocale = i, this.fastNumbersCached = null;
|
|
4251
4252
|
}
|
|
4252
4253
|
get fastNumbers() {
|
|
4253
|
-
return this.fastNumbersCached == null && (this.fastNumbersCached =
|
|
4254
|
+
return this.fastNumbersCached == null && (this.fastNumbersCached = el(this)), this.fastNumbersCached;
|
|
4254
4255
|
}
|
|
4255
4256
|
listingMode() {
|
|
4256
4257
|
const e = this.isEnglish(), t = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory");
|
|
@@ -4272,21 +4273,21 @@ class se {
|
|
|
4272
4273
|
return this.clone({ ...e, defaultToEN: !1 });
|
|
4273
4274
|
}
|
|
4274
4275
|
months(e, t = !1) {
|
|
4275
|
-
return fn(this, e,
|
|
4276
|
+
return fn(this, e, Xi, () => {
|
|
4276
4277
|
const s = this.intl === "ja" || this.intl.startsWith("ja-");
|
|
4277
4278
|
t &= !s;
|
|
4278
4279
|
const r = t ? { month: e, day: "numeric" } : { month: e }, i = t ? "format" : "standalone";
|
|
4279
4280
|
if (!this.monthsCache[i][e]) {
|
|
4280
4281
|
const o = s ? (a) => this.dtFormatter(a, r).format() : (a) => this.extract(a, r, "month");
|
|
4281
|
-
this.monthsCache[i][e] =
|
|
4282
|
+
this.monthsCache[i][e] = Ka(o);
|
|
4282
4283
|
}
|
|
4283
4284
|
return this.monthsCache[i][e];
|
|
4284
4285
|
});
|
|
4285
4286
|
}
|
|
4286
4287
|
weekdays(e, t = !1) {
|
|
4287
|
-
return fn(this, e,
|
|
4288
|
+
return fn(this, e, no, () => {
|
|
4288
4289
|
const s = t ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, r = t ? "format" : "standalone";
|
|
4289
|
-
return this.weekdaysCache[r][e] || (this.weekdaysCache[r][e] =
|
|
4290
|
+
return this.weekdaysCache[r][e] || (this.weekdaysCache[r][e] = Xa(
|
|
4290
4291
|
(i) => this.extract(i, s, "weekday")
|
|
4291
4292
|
)), this.weekdaysCache[r][e];
|
|
4292
4293
|
});
|
|
@@ -4295,7 +4296,7 @@ class se {
|
|
|
4295
4296
|
return fn(
|
|
4296
4297
|
this,
|
|
4297
4298
|
void 0,
|
|
4298
|
-
() =>
|
|
4299
|
+
() => so,
|
|
4299
4300
|
() => {
|
|
4300
4301
|
if (!this.meridiemCache) {
|
|
4301
4302
|
const e = { hour: "numeric", hourCycle: "h12" };
|
|
@@ -4308,7 +4309,7 @@ class se {
|
|
|
4308
4309
|
);
|
|
4309
4310
|
}
|
|
4310
4311
|
eras(e) {
|
|
4311
|
-
return fn(this, e,
|
|
4312
|
+
return fn(this, e, ro, () => {
|
|
4312
4313
|
const t = { era: e };
|
|
4313
4314
|
return this.eraCache[e] || (this.eraCache[e] = [V.utc(-40, 1, 1), V.utc(2017, 1, 1)].map(
|
|
4314
4315
|
(s) => this.extract(s, t, "era")
|
|
@@ -4320,22 +4321,22 @@ class se {
|
|
|
4320
4321
|
return o ? o.value : null;
|
|
4321
4322
|
}
|
|
4322
4323
|
numberFormatter(e = {}) {
|
|
4323
|
-
return new
|
|
4324
|
+
return new tl(this.intl, e.forceSimple || this.fastNumbers, e);
|
|
4324
4325
|
}
|
|
4325
4326
|
dtFormatter(e, t = {}) {
|
|
4326
|
-
return new
|
|
4327
|
+
return new nl(e, this.intl, t);
|
|
4327
4328
|
}
|
|
4328
4329
|
relFormatter(e = {}) {
|
|
4329
|
-
return new
|
|
4330
|
+
return new sl(this.intl, this.isEnglish(), e);
|
|
4330
4331
|
}
|
|
4331
4332
|
listFormatter(e = {}) {
|
|
4332
|
-
return
|
|
4333
|
+
return qa(this.intl, e);
|
|
4333
4334
|
}
|
|
4334
4335
|
isEnglish() {
|
|
4335
|
-
return this.locale === "en" || this.locale.toLowerCase() === "en-us" ||
|
|
4336
|
+
return this.locale === "en" || this.locale.toLowerCase() === "en-us" || Ui(this.intl).locale.startsWith("en-us");
|
|
4336
4337
|
}
|
|
4337
4338
|
getWeekSettings() {
|
|
4338
|
-
return this.weekSettings ? this.weekSettings :
|
|
4339
|
+
return this.weekSettings ? this.weekSettings : Yi() ? Ya(this.locale) : Wi;
|
|
4339
4340
|
}
|
|
4340
4341
|
getStartOfWeek() {
|
|
4341
4342
|
return this.getWeekSettings().firstDay;
|
|
@@ -4473,7 +4474,7 @@ class Ee extends on {
|
|
|
4473
4474
|
return !0;
|
|
4474
4475
|
}
|
|
4475
4476
|
}
|
|
4476
|
-
class
|
|
4477
|
+
class rl extends on {
|
|
4477
4478
|
constructor(e) {
|
|
4478
4479
|
super(), this.zoneName = e;
|
|
4479
4480
|
}
|
|
@@ -4515,10 +4516,10 @@ function tt(n, e) {
|
|
|
4515
4516
|
return e;
|
|
4516
4517
|
if (n instanceof on)
|
|
4517
4518
|
return n;
|
|
4518
|
-
if (
|
|
4519
|
+
if (ul(n)) {
|
|
4519
4520
|
const t = n.toLowerCase();
|
|
4520
4521
|
return t === "default" ? e : t === "local" || t === "system" ? qn.instance : t === "utc" || t === "gmt" ? Ee.utcInstance : Ee.parseSpecifier(t) || He.create(n);
|
|
4521
|
-
} else return rt(n) ? Ee.instance(n) : typeof n == "object" && "offset" in n && typeof n.offset == "function" ? n : new
|
|
4522
|
+
} else return rt(n) ? Ee.instance(n) : typeof n == "object" && "offset" in n && typeof n.offset == "function" ? n : new rl(n);
|
|
4522
4523
|
}
|
|
4523
4524
|
const Zs = {
|
|
4524
4525
|
arab: "[٠-٩]",
|
|
@@ -4562,15 +4563,15 @@ const Zs = {
|
|
|
4562
4563
|
telu: [3174, 3183],
|
|
4563
4564
|
thai: [3664, 3673],
|
|
4564
4565
|
tibt: [3872, 3881]
|
|
4565
|
-
},
|
|
4566
|
-
function
|
|
4566
|
+
}, il = Zs.hanidec.replace(/[\[|\]]/g, "").split("");
|
|
4567
|
+
function ol(n) {
|
|
4567
4568
|
let e = parseInt(n, 10);
|
|
4568
4569
|
if (isNaN(e)) {
|
|
4569
4570
|
e = "";
|
|
4570
4571
|
for (let t = 0; t < n.length; t++) {
|
|
4571
4572
|
const s = n.charCodeAt(t);
|
|
4572
4573
|
if (n[t].search(Zs.hanidec) !== -1)
|
|
4573
|
-
e +=
|
|
4574
|
+
e += il.indexOf(n[t]);
|
|
4574
4575
|
else
|
|
4575
4576
|
for (const r in vr) {
|
|
4576
4577
|
const [i, o] = vr[r];
|
|
@@ -4582,7 +4583,7 @@ function il(n) {
|
|
|
4582
4583
|
return e;
|
|
4583
4584
|
}
|
|
4584
4585
|
const $s = /* @__PURE__ */ new Map();
|
|
4585
|
-
function
|
|
4586
|
+
function al() {
|
|
4586
4587
|
$s.clear();
|
|
4587
4588
|
}
|
|
4588
4589
|
function Ce({ numberingSystem: n }, e = "") {
|
|
@@ -4729,7 +4730,7 @@ class ce {
|
|
|
4729
4730
|
* @return {void}
|
|
4730
4731
|
*/
|
|
4731
4732
|
static resetCaches() {
|
|
4732
|
-
se.resetCache(), He.resetCache(), V.resetCache(),
|
|
4733
|
+
se.resetCache(), He.resetCache(), V.resetCache(), al();
|
|
4733
4734
|
}
|
|
4734
4735
|
}
|
|
4735
4736
|
class Fe {
|
|
@@ -4740,7 +4741,7 @@ class Fe {
|
|
|
4740
4741
|
return this.explanation ? `${this.reason}: ${this.explanation}` : this.reason;
|
|
4741
4742
|
}
|
|
4742
4743
|
}
|
|
4743
|
-
const
|
|
4744
|
+
const ji = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Zi = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
|
|
4744
4745
|
function Ne(n, e) {
|
|
4745
4746
|
return new Fe(
|
|
4746
4747
|
"unit out of range",
|
|
@@ -4753,18 +4754,18 @@ function zs(n, e, t) {
|
|
|
4753
4754
|
const r = s.getUTCDay();
|
|
4754
4755
|
return r === 0 ? 7 : r;
|
|
4755
4756
|
}
|
|
4756
|
-
function
|
|
4757
|
-
return t + (an(n) ?
|
|
4757
|
+
function zi(n, e, t) {
|
|
4758
|
+
return t + (an(n) ? Zi : ji)[e - 1];
|
|
4758
4759
|
}
|
|
4759
|
-
function
|
|
4760
|
-
const t = an(n) ?
|
|
4760
|
+
function qi(n, e) {
|
|
4761
|
+
const t = an(n) ? Zi : ji, s = t.findIndex((i) => i < e), r = e - t[s];
|
|
4761
4762
|
return { month: s + 1, day: r };
|
|
4762
4763
|
}
|
|
4763
4764
|
function qs(n, e) {
|
|
4764
4765
|
return (n - e + 7) % 7 + 1;
|
|
4765
4766
|
}
|
|
4766
4767
|
function Pn(n, e = 4, t = 1) {
|
|
4767
|
-
const { year: s, month: r, day: i } = n, o =
|
|
4768
|
+
const { year: s, month: r, day: i } = n, o = zi(s, r, i), a = qs(zs(s, r, i), t);
|
|
4768
4769
|
let l = Math.floor((o - a + 14 - e) / 7), c;
|
|
4769
4770
|
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) };
|
|
4770
4771
|
}
|
|
@@ -4772,15 +4773,15 @@ function Ir(n, e = 4, t = 1) {
|
|
|
4772
4773
|
const { weekYear: s, weekNumber: r, weekday: i } = n, o = qs(zs(s, 1, e), t), a = Rt(s);
|
|
4773
4774
|
let l = r * 7 + i - o - 7 + e, c;
|
|
4774
4775
|
l < 1 ? (c = s - 1, l += Rt(c)) : l > a ? (c = s + 1, l -= Rt(s)) : c = s;
|
|
4775
|
-
const { month: u, day: h } =
|
|
4776
|
+
const { month: u, day: h } = qi(c, l);
|
|
4776
4777
|
return { year: c, month: u, day: h, ...Yn(n) };
|
|
4777
4778
|
}
|
|
4778
4779
|
function as(n) {
|
|
4779
|
-
const { year: e, month: t, day: s } = n, r =
|
|
4780
|
+
const { year: e, month: t, day: s } = n, r = zi(e, t, s);
|
|
4780
4781
|
return { year: e, ordinal: r, ...Yn(n) };
|
|
4781
4782
|
}
|
|
4782
4783
|
function Dr(n) {
|
|
4783
|
-
const { year: e, ordinal: t } = n, { month: s, day: r } =
|
|
4784
|
+
const { year: e, ordinal: t } = n, { month: s, day: r } = qi(e, t);
|
|
4784
4785
|
return { year: e, month: s, day: r, ...Yn(n) };
|
|
4785
4786
|
}
|
|
4786
4787
|
function Ar(n, e) {
|
|
@@ -4796,7 +4797,7 @@ function Ar(n, e) {
|
|
|
4796
4797
|
} else
|
|
4797
4798
|
return { minDaysInFirstWeek: 4, startOfWeek: 1 };
|
|
4798
4799
|
}
|
|
4799
|
-
function
|
|
4800
|
+
function ll(n, e = 4, t = 1) {
|
|
4800
4801
|
const s = Bn(n.weekYear), r = xe(
|
|
4801
4802
|
n.weekNumber,
|
|
4802
4803
|
1,
|
|
@@ -4804,15 +4805,15 @@ function al(n, e = 4, t = 1) {
|
|
|
4804
4805
|
), i = xe(n.weekday, 1, 7);
|
|
4805
4806
|
return s ? r ? i ? !1 : Ne("weekday", n.weekday) : Ne("week", n.weekNumber) : Ne("weekYear", n.weekYear);
|
|
4806
4807
|
}
|
|
4807
|
-
function
|
|
4808
|
+
function cl(n) {
|
|
4808
4809
|
const e = Bn(n.year), t = xe(n.ordinal, 1, Rt(n.year));
|
|
4809
4810
|
return e ? t ? !1 : Ne("ordinal", n.ordinal) : Ne("year", n.year);
|
|
4810
4811
|
}
|
|
4811
|
-
function
|
|
4812
|
+
function Bi(n) {
|
|
4812
4813
|
const e = Bn(n.year), t = xe(n.month, 1, 12), s = xe(n.day, 1, Ln(n.year, n.month));
|
|
4813
4814
|
return e ? t ? s ? !1 : Ne("day", n.day) : Ne("month", n.month) : Ne("year", n.year);
|
|
4814
4815
|
}
|
|
4815
|
-
function
|
|
4816
|
+
function Hi(n) {
|
|
4816
4817
|
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);
|
|
4817
4818
|
return i ? o ? a ? l ? !1 : Ne("millisecond", r) : Ne("second", s) : Ne("minute", t) : Ne("hour", e);
|
|
4818
4819
|
}
|
|
@@ -4825,27 +4826,27 @@ function rt(n) {
|
|
|
4825
4826
|
function Bn(n) {
|
|
4826
4827
|
return typeof n == "number" && n % 1 === 0;
|
|
4827
4828
|
}
|
|
4828
|
-
function
|
|
4829
|
+
function ul(n) {
|
|
4829
4830
|
return typeof n == "string";
|
|
4830
4831
|
}
|
|
4831
|
-
function
|
|
4832
|
+
function dl(n) {
|
|
4832
4833
|
return Object.prototype.toString.call(n) === "[object Date]";
|
|
4833
4834
|
}
|
|
4834
|
-
function
|
|
4835
|
+
function Gi() {
|
|
4835
4836
|
try {
|
|
4836
4837
|
return typeof Intl < "u" && !!Intl.RelativeTimeFormat;
|
|
4837
4838
|
} catch {
|
|
4838
4839
|
return !1;
|
|
4839
4840
|
}
|
|
4840
4841
|
}
|
|
4841
|
-
function
|
|
4842
|
+
function Yi() {
|
|
4842
4843
|
try {
|
|
4843
4844
|
return typeof Intl < "u" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype);
|
|
4844
4845
|
} catch {
|
|
4845
4846
|
return !1;
|
|
4846
4847
|
}
|
|
4847
4848
|
}
|
|
4848
|
-
function
|
|
4849
|
+
function fl(n) {
|
|
4849
4850
|
return Array.isArray(n) ? n : [n];
|
|
4850
4851
|
}
|
|
4851
4852
|
function Cr(n, e, t) {
|
|
@@ -4855,7 +4856,7 @@ function Cr(n, e, t) {
|
|
|
4855
4856
|
return s && t(s[0], i[0]) === s[0] ? s : i;
|
|
4856
4857
|
}, null)[1];
|
|
4857
4858
|
}
|
|
4858
|
-
function
|
|
4859
|
+
function hl(n, e) {
|
|
4859
4860
|
return e.reduce((t, s) => (t[s] = n[s], t), {});
|
|
4860
4861
|
}
|
|
4861
4862
|
function $t(n, e) {
|
|
@@ -4877,7 +4878,7 @@ function Ms(n) {
|
|
|
4877
4878
|
function xe(n, e, t) {
|
|
4878
4879
|
return Bn(n) && n >= e && n <= t;
|
|
4879
4880
|
}
|
|
4880
|
-
function
|
|
4881
|
+
function ml(n, e) {
|
|
4881
4882
|
return n - e * Math.floor(n / e);
|
|
4882
4883
|
}
|
|
4883
4884
|
function he(n, e = 2) {
|
|
@@ -4923,7 +4924,7 @@ function Rt(n) {
|
|
|
4923
4924
|
return an(n) ? 366 : 365;
|
|
4924
4925
|
}
|
|
4925
4926
|
function Ln(n, e) {
|
|
4926
|
-
const t =
|
|
4927
|
+
const t = ml(e - 1, 12) + 1, s = n + (e - t) / 12;
|
|
4927
4928
|
return t === 2 ? an(s) ? 29 : 28 : [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][t - 1];
|
|
4928
4929
|
}
|
|
4929
4930
|
function Hn(n) {
|
|
@@ -4948,7 +4949,7 @@ function nn(n, e = 4, t = 1) {
|
|
|
4948
4949
|
function Fs(n) {
|
|
4949
4950
|
return n > 99 ? n : n > ce.twoDigitCutoffYear ? 1900 + n : 2e3 + n;
|
|
4950
4951
|
}
|
|
4951
|
-
function
|
|
4952
|
+
function Ji(n, e, t, s = null) {
|
|
4952
4953
|
const r = new Date(n), i = {
|
|
4953
4954
|
hourCycle: "h23",
|
|
4954
4955
|
year: "numeric",
|
|
@@ -4967,7 +4968,7 @@ function Gn(n, e) {
|
|
|
4967
4968
|
const s = parseInt(e, 10) || 0, r = t < 0 || Object.is(t, -0) ? -s : s;
|
|
4968
4969
|
return t * 60 + r;
|
|
4969
4970
|
}
|
|
4970
|
-
function
|
|
4971
|
+
function Qi(n) {
|
|
4971
4972
|
const e = Number(n);
|
|
4972
4973
|
if (typeof n == "boolean" || n === "" || !Number.isFinite(e))
|
|
4973
4974
|
throw new we(`Invalid unit value ${n}`);
|
|
@@ -4979,7 +4980,7 @@ function Vn(n, e) {
|
|
|
4979
4980
|
if ($t(n, s)) {
|
|
4980
4981
|
const r = n[s];
|
|
4981
4982
|
if (r == null) continue;
|
|
4982
|
-
t[e(s)] =
|
|
4983
|
+
t[e(s)] = Qi(r);
|
|
4983
4984
|
}
|
|
4984
4985
|
return t;
|
|
4985
4986
|
}
|
|
@@ -4997,9 +4998,9 @@ function Xt(n, e) {
|
|
|
4997
4998
|
}
|
|
4998
4999
|
}
|
|
4999
5000
|
function Yn(n) {
|
|
5000
|
-
return
|
|
5001
|
+
return hl(n, ["hour", "minute", "second", "millisecond"]);
|
|
5001
5002
|
}
|
|
5002
|
-
const
|
|
5003
|
+
const pl = [
|
|
5003
5004
|
"January",
|
|
5004
5005
|
"February",
|
|
5005
5006
|
"March",
|
|
@@ -5012,7 +5013,7 @@ const ml = [
|
|
|
5012
5013
|
"October",
|
|
5013
5014
|
"November",
|
|
5014
5015
|
"December"
|
|
5015
|
-
],
|
|
5016
|
+
], Ki = [
|
|
5016
5017
|
"Jan",
|
|
5017
5018
|
"Feb",
|
|
5018
5019
|
"Mar",
|
|
@@ -5025,15 +5026,15 @@ const ml = [
|
|
|
5025
5026
|
"Oct",
|
|
5026
5027
|
"Nov",
|
|
5027
5028
|
"Dec"
|
|
5028
|
-
],
|
|
5029
|
-
function
|
|
5029
|
+
], yl = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
|
|
5030
|
+
function Xi(n) {
|
|
5030
5031
|
switch (n) {
|
|
5031
5032
|
case "narrow":
|
|
5032
|
-
return [...
|
|
5033
|
+
return [...yl];
|
|
5033
5034
|
case "short":
|
|
5034
|
-
return [...
|
|
5035
|
+
return [...Ki];
|
|
5035
5036
|
case "long":
|
|
5036
|
-
return [...
|
|
5037
|
+
return [...pl];
|
|
5037
5038
|
case "numeric":
|
|
5038
5039
|
return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
|
|
5039
5040
|
case "2-digit":
|
|
@@ -5042,7 +5043,7 @@ function Ki(n) {
|
|
|
5042
5043
|
return null;
|
|
5043
5044
|
}
|
|
5044
5045
|
}
|
|
5045
|
-
const
|
|
5046
|
+
const eo = [
|
|
5046
5047
|
"Monday",
|
|
5047
5048
|
"Tuesday",
|
|
5048
5049
|
"Wednesday",
|
|
@@ -5050,47 +5051,47 @@ const Xi = [
|
|
|
5050
5051
|
"Friday",
|
|
5051
5052
|
"Saturday",
|
|
5052
5053
|
"Sunday"
|
|
5053
|
-
],
|
|
5054
|
-
function
|
|
5054
|
+
], to = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], gl = ["M", "T", "W", "T", "F", "S", "S"];
|
|
5055
|
+
function no(n) {
|
|
5055
5056
|
switch (n) {
|
|
5056
5057
|
case "narrow":
|
|
5057
|
-
return [...
|
|
5058
|
+
return [...gl];
|
|
5058
5059
|
case "short":
|
|
5059
|
-
return [...
|
|
5060
|
+
return [...to];
|
|
5060
5061
|
case "long":
|
|
5061
|
-
return [...
|
|
5062
|
+
return [...eo];
|
|
5062
5063
|
case "numeric":
|
|
5063
5064
|
return ["1", "2", "3", "4", "5", "6", "7"];
|
|
5064
5065
|
default:
|
|
5065
5066
|
return null;
|
|
5066
5067
|
}
|
|
5067
5068
|
}
|
|
5068
|
-
const
|
|
5069
|
-
function
|
|
5069
|
+
const so = ["AM", "PM"], wl = ["Before Christ", "Anno Domini"], _l = ["BC", "AD"], El = ["B", "A"];
|
|
5070
|
+
function ro(n) {
|
|
5070
5071
|
switch (n) {
|
|
5071
5072
|
case "narrow":
|
|
5072
|
-
return [...
|
|
5073
|
+
return [...El];
|
|
5073
5074
|
case "short":
|
|
5074
|
-
return [...
|
|
5075
|
+
return [..._l];
|
|
5075
5076
|
case "long":
|
|
5076
|
-
return [...
|
|
5077
|
+
return [...wl];
|
|
5077
5078
|
default:
|
|
5078
5079
|
return null;
|
|
5079
5080
|
}
|
|
5080
5081
|
}
|
|
5081
|
-
function
|
|
5082
|
-
return
|
|
5083
|
-
}
|
|
5084
|
-
function vl(n, e) {
|
|
5085
|
-
return to(e)[n.weekday - 1];
|
|
5082
|
+
function vl(n) {
|
|
5083
|
+
return so[n.hour < 12 ? 0 : 1];
|
|
5086
5084
|
}
|
|
5087
5085
|
function Ol(n, e) {
|
|
5088
|
-
return
|
|
5086
|
+
return no(e)[n.weekday - 1];
|
|
5089
5087
|
}
|
|
5090
5088
|
function kl(n, e) {
|
|
5091
|
-
return
|
|
5089
|
+
return Xi(e)[n.month - 1];
|
|
5092
5090
|
}
|
|
5093
|
-
function bl(n, e
|
|
5091
|
+
function bl(n, e) {
|
|
5092
|
+
return ro(e)[n.year < 0 ? 0 : 1];
|
|
5093
|
+
}
|
|
5094
|
+
function Sl(n, e, t = "always", s = !1) {
|
|
5094
5095
|
const r = {
|
|
5095
5096
|
years: ["year", "yr."],
|
|
5096
5097
|
quarters: ["quarter", "qtr."],
|
|
@@ -5121,27 +5122,27 @@ function Mr(n, e) {
|
|
|
5121
5122
|
s.literal ? t += s.val : t += e(s.val);
|
|
5122
5123
|
return t;
|
|
5123
5124
|
}
|
|
5124
|
-
const
|
|
5125
|
+
const Tl = {
|
|
5125
5126
|
D: Fn,
|
|
5126
|
-
DD:
|
|
5127
|
-
DDD:
|
|
5128
|
-
DDDD:
|
|
5129
|
-
t:
|
|
5130
|
-
tt:
|
|
5131
|
-
ttt:
|
|
5132
|
-
tttt:
|
|
5133
|
-
T:
|
|
5134
|
-
TT:
|
|
5135
|
-
TTT:
|
|
5136
|
-
TTTT:
|
|
5137
|
-
f:
|
|
5138
|
-
ff:
|
|
5139
|
-
fff:
|
|
5140
|
-
ffff:
|
|
5141
|
-
F:
|
|
5142
|
-
FF:
|
|
5143
|
-
FFF:
|
|
5144
|
-
FFFF:
|
|
5127
|
+
DD: vi,
|
|
5128
|
+
DDD: Oi,
|
|
5129
|
+
DDDD: ki,
|
|
5130
|
+
t: bi,
|
|
5131
|
+
tt: Si,
|
|
5132
|
+
ttt: Ti,
|
|
5133
|
+
tttt: Ri,
|
|
5134
|
+
T: Ni,
|
|
5135
|
+
TT: xi,
|
|
5136
|
+
TTT: Ii,
|
|
5137
|
+
TTTT: Di,
|
|
5138
|
+
f: Ai,
|
|
5139
|
+
ff: $i,
|
|
5140
|
+
fff: Fi,
|
|
5141
|
+
ffff: Li,
|
|
5142
|
+
F: Ci,
|
|
5143
|
+
FF: Mi,
|
|
5144
|
+
FFF: Pi,
|
|
5145
|
+
FFFF: Vi
|
|
5145
5146
|
};
|
|
5146
5147
|
class _e {
|
|
5147
5148
|
static create(e, t = {}) {
|
|
@@ -5160,7 +5161,7 @@ class _e {
|
|
|
5160
5161
|
return s.length > 0 && i.push({ literal: r || /^\s+$/.test(s), val: s }), i;
|
|
5161
5162
|
}
|
|
5162
5163
|
static macroTokenToFormatOpts(e) {
|
|
5163
|
-
return
|
|
5164
|
+
return Tl[e];
|
|
5164
5165
|
}
|
|
5165
5166
|
constructor(e, t) {
|
|
5166
5167
|
this.opts = t, this.loc = e, this.systemLoc = null;
|
|
@@ -5190,13 +5191,13 @@ class _e {
|
|
|
5190
5191
|
return t > 0 && (r.padTo = t), s && (r.signDisplay = s), this.loc.numberFormatter(r).format(e);
|
|
5191
5192
|
}
|
|
5192
5193
|
formatDateTimeFromString(e, t) {
|
|
5193
|
-
const s = this.loc.listingMode() === "en", r = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", i = (d, m) => this.loc.extract(e, d, m), o = (d) => e.isOffsetFixed && e.offset === 0 && d.allowZ ? "Z" : e.isValid ? e.zone.formatOffset(e.ts, d.format) : "", a = () => s ?
|
|
5194
|
+
const s = this.loc.listingMode() === "en", r = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", i = (d, m) => this.loc.extract(e, d, m), o = (d) => e.isOffsetFixed && e.offset === 0 && d.allowZ ? "Z" : e.isValid ? e.zone.formatOffset(e.ts, d.format) : "", a = () => s ? vl(e) : i({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), l = (d, m) => s ? kl(e, d) : i(m ? { month: d } : { month: d, day: "numeric" }, "month"), c = (d, m) => s ? Ol(e, d) : i(
|
|
5194
5195
|
m ? { weekday: d } : { weekday: d, month: "long", day: "numeric" },
|
|
5195
5196
|
"weekday"
|
|
5196
5197
|
), u = (d) => {
|
|
5197
5198
|
const m = _e.macroTokenToFormatOpts(d);
|
|
5198
5199
|
return m ? this.formatWithSystemDefault(e, m) : d;
|
|
5199
|
-
}, h = (d) => s ?
|
|
5200
|
+
}, h = (d) => s ? bl(e, d) : i({ era: d }, "era"), f = (d) => {
|
|
5200
5201
|
switch (d) {
|
|
5201
5202
|
// ms
|
|
5202
5203
|
case "S":
|
|
@@ -5383,7 +5384,7 @@ class _e {
|
|
|
5383
5384
|
return Mr(o, i(l, c));
|
|
5384
5385
|
}
|
|
5385
5386
|
}
|
|
5386
|
-
const
|
|
5387
|
+
const io = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
|
|
5387
5388
|
function Ft(...n) {
|
|
5388
5389
|
const e = n.reduce((t, s) => t + s.source, "");
|
|
5389
5390
|
return RegExp(`^${e}$`);
|
|
@@ -5407,7 +5408,7 @@ function Lt(n, ...e) {
|
|
|
5407
5408
|
}
|
|
5408
5409
|
return [null, null];
|
|
5409
5410
|
}
|
|
5410
|
-
function
|
|
5411
|
+
function oo(...n) {
|
|
5411
5412
|
return (e, t) => {
|
|
5412
5413
|
const s = {};
|
|
5413
5414
|
let r;
|
|
@@ -5416,14 +5417,14 @@ function io(...n) {
|
|
|
5416
5417
|
return [s, null, t + r];
|
|
5417
5418
|
};
|
|
5418
5419
|
}
|
|
5419
|
-
const
|
|
5420
|
-
`${Gs.source} ?(?:${
|
|
5421
|
-
),
|
|
5420
|
+
const ao = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, Rl = `(?:${ao.source}?(?:\\[(${io.source})\\])?)?`, Gs = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, lo = RegExp(`${Gs.source}${Rl}`), Ys = RegExp(`(?:[Tt]${lo.source})?`), Nl = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, xl = /(\d{4})-?W(\d\d)(?:-?(\d))?/, Il = /(\d{4})-?(\d{3})/, Dl = oo("weekYear", "weekNumber", "weekDay"), Al = oo("year", "ordinal"), Cl = /(\d{4})-(\d\d)-(\d\d)/, co = RegExp(
|
|
5421
|
+
`${Gs.source} ?(?:${ao.source}|(${io.source}))?`
|
|
5422
|
+
), $l = RegExp(`(?: ${co.source})?`);
|
|
5422
5423
|
function Nt(n, e, t) {
|
|
5423
5424
|
const s = n[e];
|
|
5424
5425
|
return H(s) ? t : et(s);
|
|
5425
5426
|
}
|
|
5426
|
-
function
|
|
5427
|
+
function Ml(n, e) {
|
|
5427
5428
|
return [{
|
|
5428
5429
|
year: Nt(n, e),
|
|
5429
5430
|
month: Nt(n, e + 1, 1),
|
|
@@ -5446,8 +5447,8 @@ function cn(n, e) {
|
|
|
5446
5447
|
const t = n[e] ? He.create(n[e]) : null;
|
|
5447
5448
|
return [{}, t, e + 1];
|
|
5448
5449
|
}
|
|
5449
|
-
const
|
|
5450
|
-
function
|
|
5450
|
+
const Fl = RegExp(`^T?${Gs.source}$`), Pl = /^-?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)?)?)$/;
|
|
5451
|
+
function Ll(n) {
|
|
5451
5452
|
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;
|
|
5452
5453
|
return [
|
|
5453
5454
|
{
|
|
@@ -5462,7 +5463,7 @@ function Pl(n) {
|
|
|
5462
5463
|
}
|
|
5463
5464
|
];
|
|
5464
5465
|
}
|
|
5465
|
-
const
|
|
5466
|
+
const Vl = {
|
|
5466
5467
|
GMT: 0,
|
|
5467
5468
|
EDT: -240,
|
|
5468
5469
|
EST: -300,
|
|
@@ -5476,15 +5477,15 @@ const Ll = {
|
|
|
5476
5477
|
function Js(n, e, t, s, r, i, o) {
|
|
5477
5478
|
const a = {
|
|
5478
5479
|
year: e.length === 2 ? Fs(et(e)) : et(e),
|
|
5479
|
-
month:
|
|
5480
|
+
month: Ki.indexOf(t) + 1,
|
|
5480
5481
|
day: et(s),
|
|
5481
5482
|
hour: et(r),
|
|
5482
5483
|
minute: et(i)
|
|
5483
5484
|
};
|
|
5484
|
-
return o && (a.second = et(o)), n && (a.weekday = n.length > 3 ?
|
|
5485
|
+
return o && (a.second = et(o)), n && (a.weekday = n.length > 3 ? eo.indexOf(n) + 1 : to.indexOf(n) + 1), a;
|
|
5485
5486
|
}
|
|
5486
|
-
const
|
|
5487
|
-
function
|
|
5487
|
+
const Ul = /^(?:(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)))$/;
|
|
5488
|
+
function Wl(n) {
|
|
5488
5489
|
const [
|
|
5489
5490
|
,
|
|
5490
5491
|
e,
|
|
@@ -5500,27 +5501,22 @@ function Ul(n) {
|
|
|
5500
5501
|
h
|
|
5501
5502
|
] = n, f = Js(e, r, s, t, i, o, a);
|
|
5502
5503
|
let d;
|
|
5503
|
-
return l ? d =
|
|
5504
|
+
return l ? d = Vl[l] : c ? d = 0 : d = Gn(u, h), [f, new Ee(d)];
|
|
5504
5505
|
}
|
|
5505
|
-
function
|
|
5506
|
+
function jl(n) {
|
|
5506
5507
|
return n.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
|
|
5507
5508
|
}
|
|
5508
|
-
const
|
|
5509
|
+
const Zl = /^(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$/, zl = /^(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$/, ql = /^(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})$/;
|
|
5509
5510
|
function Fr(n) {
|
|
5510
5511
|
const [, e, t, s, r, i, o, a] = n;
|
|
5511
5512
|
return [Js(e, r, s, t, i, o, a), Ee.utcInstance];
|
|
5512
5513
|
}
|
|
5513
|
-
function
|
|
5514
|
+
function Bl(n) {
|
|
5514
5515
|
const [, e, t, s, r, i, o, a] = n;
|
|
5515
5516
|
return [Js(e, a, t, s, r, i, o), Ee.utcInstance];
|
|
5516
5517
|
}
|
|
5517
|
-
const
|
|
5518
|
-
|
|
5519
|
-
Vt,
|
|
5520
|
-
ln,
|
|
5521
|
-
cn
|
|
5522
|
-
), Jl = Pt(
|
|
5523
|
-
Il,
|
|
5518
|
+
const Hl = Ft(Nl, Ys), Gl = Ft(xl, Ys), Yl = Ft(Il, Ys), Jl = Ft(lo), uo = Pt(
|
|
5519
|
+
Ml,
|
|
5524
5520
|
Vt,
|
|
5525
5521
|
ln,
|
|
5526
5522
|
cn
|
|
@@ -5530,50 +5526,55 @@ const Bl = Ft(Rl, Ys), Hl = Ft(Nl, Ys), Gl = Ft(xl, Ys), Yl = Ft(ao), co = Pt(
|
|
|
5530
5526
|
ln,
|
|
5531
5527
|
cn
|
|
5532
5528
|
), Kl = Pt(
|
|
5529
|
+
Al,
|
|
5530
|
+
Vt,
|
|
5531
|
+
ln,
|
|
5532
|
+
cn
|
|
5533
|
+
), Xl = Pt(
|
|
5533
5534
|
Vt,
|
|
5534
5535
|
ln,
|
|
5535
5536
|
cn
|
|
5536
5537
|
);
|
|
5537
|
-
function
|
|
5538
|
+
function ec(n) {
|
|
5538
5539
|
return Lt(
|
|
5539
5540
|
n,
|
|
5540
|
-
[
|
|
5541
|
-
[Hl, Jl],
|
|
5541
|
+
[Hl, uo],
|
|
5542
5542
|
[Gl, Ql],
|
|
5543
|
-
[Yl, Kl]
|
|
5543
|
+
[Yl, Kl],
|
|
5544
|
+
[Jl, Xl]
|
|
5544
5545
|
);
|
|
5545
5546
|
}
|
|
5546
|
-
function ec(n) {
|
|
5547
|
-
return Lt(Wl(n), [Vl, Ul]);
|
|
5548
|
-
}
|
|
5549
5547
|
function tc(n) {
|
|
5548
|
+
return Lt(jl(n), [Ul, Wl]);
|
|
5549
|
+
}
|
|
5550
|
+
function nc(n) {
|
|
5550
5551
|
return Lt(
|
|
5551
5552
|
n,
|
|
5552
|
-
[jl, Fr],
|
|
5553
5553
|
[Zl, Fr],
|
|
5554
|
-
[zl,
|
|
5554
|
+
[zl, Fr],
|
|
5555
|
+
[ql, Bl]
|
|
5555
5556
|
);
|
|
5556
5557
|
}
|
|
5557
|
-
function
|
|
5558
|
-
return Lt(n, [
|
|
5558
|
+
function sc(n) {
|
|
5559
|
+
return Lt(n, [Pl, Ll]);
|
|
5559
5560
|
}
|
|
5560
|
-
const
|
|
5561
|
-
function
|
|
5562
|
-
return Lt(n, [
|
|
5561
|
+
const rc = Pt(Vt);
|
|
5562
|
+
function ic(n) {
|
|
5563
|
+
return Lt(n, [Fl, rc]);
|
|
5563
5564
|
}
|
|
5564
|
-
const
|
|
5565
|
+
const oc = Ft(Cl, $l), ac = Ft(co), lc = Pt(
|
|
5565
5566
|
Vt,
|
|
5566
5567
|
ln,
|
|
5567
5568
|
cn
|
|
5568
5569
|
);
|
|
5569
|
-
function
|
|
5570
|
+
function cc(n) {
|
|
5570
5571
|
return Lt(
|
|
5571
5572
|
n,
|
|
5572
|
-
[
|
|
5573
|
-
[
|
|
5573
|
+
[oc, uo],
|
|
5574
|
+
[ac, lc]
|
|
5574
5575
|
);
|
|
5575
5576
|
}
|
|
5576
|
-
const Pr = "Invalid Duration",
|
|
5577
|
+
const Pr = "Invalid Duration", fo = {
|
|
5577
5578
|
weeks: {
|
|
5578
5579
|
days: 7,
|
|
5579
5580
|
hours: 168,
|
|
@@ -5590,7 +5591,7 @@ const Pr = "Invalid Duration", uo = {
|
|
|
5590
5591
|
hours: { minutes: 60, seconds: 3600, milliseconds: 3600 * 1e3 },
|
|
5591
5592
|
minutes: { seconds: 60, milliseconds: 60 * 1e3 },
|
|
5592
5593
|
seconds: { milliseconds: 1e3 }
|
|
5593
|
-
},
|
|
5594
|
+
}, uc = {
|
|
5594
5595
|
years: {
|
|
5595
5596
|
quarters: 4,
|
|
5596
5597
|
months: 12,
|
|
@@ -5618,8 +5619,8 @@ const Pr = "Invalid Duration", uo = {
|
|
|
5618
5619
|
seconds: 720 * 60 * 60,
|
|
5619
5620
|
milliseconds: 720 * 60 * 60 * 1e3
|
|
5620
5621
|
},
|
|
5621
|
-
...
|
|
5622
|
-
}, Re = 146097 / 400, vt = 146097 / 4800,
|
|
5622
|
+
...fo
|
|
5623
|
+
}, Re = 146097 / 400, vt = 146097 / 4800, dc = {
|
|
5623
5624
|
years: {
|
|
5624
5625
|
quarters: 4,
|
|
5625
5626
|
months: 12,
|
|
@@ -5647,7 +5648,7 @@ const Pr = "Invalid Duration", uo = {
|
|
|
5647
5648
|
seconds: vt * 24 * 60 * 60,
|
|
5648
5649
|
milliseconds: vt * 24 * 60 * 60 * 1e3
|
|
5649
5650
|
},
|
|
5650
|
-
...
|
|
5651
|
+
...fo
|
|
5651
5652
|
}, mt = [
|
|
5652
5653
|
"years",
|
|
5653
5654
|
"quarters",
|
|
@@ -5658,7 +5659,7 @@ const Pr = "Invalid Duration", uo = {
|
|
|
5658
5659
|
"minutes",
|
|
5659
5660
|
"seconds",
|
|
5660
5661
|
"milliseconds"
|
|
5661
|
-
],
|
|
5662
|
+
], fc = mt.slice(0).reverse();
|
|
5662
5663
|
function Ze(n, e, t = !1) {
|
|
5663
5664
|
const s = {
|
|
5664
5665
|
values: t ? e.values : { ...n.values, ...e.values || {} },
|
|
@@ -5668,14 +5669,14 @@ function Ze(n, e, t = !1) {
|
|
|
5668
5669
|
};
|
|
5669
5670
|
return new ee(s);
|
|
5670
5671
|
}
|
|
5671
|
-
function
|
|
5672
|
+
function ho(n, e) {
|
|
5672
5673
|
let t = e.milliseconds ?? 0;
|
|
5673
|
-
for (const s of
|
|
5674
|
+
for (const s of fc.slice(1))
|
|
5674
5675
|
e[s] && (t += e[s] * n[s].milliseconds);
|
|
5675
5676
|
return t;
|
|
5676
5677
|
}
|
|
5677
5678
|
function Lr(n, e) {
|
|
5678
|
-
const t =
|
|
5679
|
+
const t = ho(n, e) < 0 ? -1 : 1;
|
|
5679
5680
|
mt.reduceRight((s, r) => {
|
|
5680
5681
|
if (H(e[r]))
|
|
5681
5682
|
return s;
|
|
@@ -5706,7 +5707,7 @@ class ee {
|
|
|
5706
5707
|
*/
|
|
5707
5708
|
constructor(e) {
|
|
5708
5709
|
const t = e.conversionAccuracy === "longterm" || !1;
|
|
5709
|
-
let s = t ?
|
|
5710
|
+
let s = t ? dc : uc;
|
|
5710
5711
|
e.matrix && (s = e.matrix), this.values = e.values, this.loc = e.loc || se.create(), this.conversionAccuracy = t ? "longterm" : "casual", this.invalid = e.invalid || null, this.matrix = s, this.isLuxonDuration = !0;
|
|
5711
5712
|
}
|
|
5712
5713
|
/**
|
|
@@ -5789,7 +5790,7 @@ class ee {
|
|
|
5789
5790
|
* @return {Duration}
|
|
5790
5791
|
*/
|
|
5791
5792
|
static fromISO(e, t) {
|
|
5792
|
-
const [s] =
|
|
5793
|
+
const [s] = sc(e);
|
|
5793
5794
|
return s ? ee.fromObject(s, t) : ee.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
|
|
5794
5795
|
}
|
|
5795
5796
|
/**
|
|
@@ -5809,7 +5810,7 @@ class ee {
|
|
|
5809
5810
|
* @return {Duration}
|
|
5810
5811
|
*/
|
|
5811
5812
|
static fromISOTime(e, t) {
|
|
5812
|
-
const [s] =
|
|
5813
|
+
const [s] = ic(e);
|
|
5813
5814
|
return s ? ee.fromObject(s, t) : ee.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
|
|
5814
5815
|
}
|
|
5815
5816
|
/**
|
|
@@ -5823,7 +5824,7 @@ class ee {
|
|
|
5823
5824
|
throw new we("need to specify a reason the Duration is invalid");
|
|
5824
5825
|
const s = e instanceof Fe ? e : new Fe(e, t);
|
|
5825
5826
|
if (ce.throwOnInvalid)
|
|
5826
|
-
throw new
|
|
5827
|
+
throw new La(s);
|
|
5827
5828
|
return new ee({ invalid: s });
|
|
5828
5829
|
}
|
|
5829
5830
|
/**
|
|
@@ -5850,7 +5851,7 @@ class ee {
|
|
|
5850
5851
|
millisecond: "milliseconds",
|
|
5851
5852
|
milliseconds: "milliseconds"
|
|
5852
5853
|
}[e && e.toLowerCase()];
|
|
5853
|
-
if (!t) throw new
|
|
5854
|
+
if (!t) throw new Ei(e);
|
|
5854
5855
|
return t;
|
|
5855
5856
|
}
|
|
5856
5857
|
/**
|
|
@@ -6010,7 +6011,7 @@ class ee {
|
|
|
6010
6011
|
* @return {number}
|
|
6011
6012
|
*/
|
|
6012
6013
|
toMillis() {
|
|
6013
|
-
return this.isValid ?
|
|
6014
|
+
return this.isValid ? ho(this.matrix, this.values) : NaN;
|
|
6014
6015
|
}
|
|
6015
6016
|
/**
|
|
6016
6017
|
* Returns an milliseconds value of this Duration. Alias of {@link toMillis}
|
|
@@ -6052,7 +6053,7 @@ class ee {
|
|
|
6052
6053
|
if (!this.isValid) return this;
|
|
6053
6054
|
const t = {};
|
|
6054
6055
|
for (const s of Object.keys(this.values))
|
|
6055
|
-
t[s] =
|
|
6056
|
+
t[s] = Qi(e(this.values[s], s));
|
|
6056
6057
|
return Ze(this, { values: t }, !0);
|
|
6057
6058
|
}
|
|
6058
6059
|
/**
|
|
@@ -6297,7 +6298,7 @@ class ee {
|
|
|
6297
6298
|
}
|
|
6298
6299
|
}
|
|
6299
6300
|
const Ot = "Invalid Interval";
|
|
6300
|
-
function
|
|
6301
|
+
function hc(n, e) {
|
|
6301
6302
|
return !n || !n.isValid ? le.invalid("missing or invalid start") : !e || !e.isValid ? le.invalid("missing or invalid end") : e < n ? le.invalid(
|
|
6302
6303
|
"end before start",
|
|
6303
6304
|
`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${e.toISO()}`
|
|
@@ -6321,7 +6322,7 @@ class le {
|
|
|
6321
6322
|
throw new we("need to specify a reason the Interval is invalid");
|
|
6322
6323
|
const s = e instanceof Fe ? e : new Fe(e, t);
|
|
6323
6324
|
if (ce.throwOnInvalid)
|
|
6324
|
-
throw new
|
|
6325
|
+
throw new Pa(s);
|
|
6325
6326
|
return new le({ invalid: s });
|
|
6326
6327
|
}
|
|
6327
6328
|
/**
|
|
@@ -6331,7 +6332,7 @@ class le {
|
|
|
6331
6332
|
* @return {Interval}
|
|
6332
6333
|
*/
|
|
6333
6334
|
static fromDateTimes(e, t) {
|
|
6334
|
-
const s = zt(e), r = zt(t), i =
|
|
6335
|
+
const s = zt(e), r = zt(t), i = hc(s, r);
|
|
6335
6336
|
return i ?? new le({
|
|
6336
6337
|
start: s,
|
|
6337
6338
|
end: r
|
|
@@ -6931,14 +6932,14 @@ class hn {
|
|
|
6931
6932
|
* @return {Object}
|
|
6932
6933
|
*/
|
|
6933
6934
|
static features() {
|
|
6934
|
-
return { relative:
|
|
6935
|
+
return { relative: Gi(), localeWeek: Yi() };
|
|
6935
6936
|
}
|
|
6936
6937
|
}
|
|
6937
6938
|
function Ur(n, e) {
|
|
6938
6939
|
const t = (r) => r.toUTC(0, { keepLocalTime: !0 }).startOf("day").valueOf(), s = t(e) - t(n);
|
|
6939
6940
|
return Math.floor(ee.fromMillis(s).as("days"));
|
|
6940
6941
|
}
|
|
6941
|
-
function
|
|
6942
|
+
function mc(n, e, t) {
|
|
6942
6943
|
const s = [
|
|
6943
6944
|
["years", (l, c) => c.year - l.year],
|
|
6944
6945
|
["quarters", (l, c) => c.quarter - l.quarter + (c.year - l.year) * 4],
|
|
@@ -6957,8 +6958,8 @@ function hc(n, e, t) {
|
|
|
6957
6958
|
t.indexOf(l) >= 0 && (o = l, r[l] = c(n, e), a = i.plus(r), a > e ? (r[l]--, n = i.plus(r), n > e && (a = n, r[l]--, n = i.plus(r))) : n = a);
|
|
6958
6959
|
return [n, r, a, o];
|
|
6959
6960
|
}
|
|
6960
|
-
function
|
|
6961
|
-
let [r, i, o, a] =
|
|
6961
|
+
function pc(n, e, t, s) {
|
|
6962
|
+
let [r, i, o, a] = mc(n, e, t);
|
|
6962
6963
|
const l = e - r, c = t.filter(
|
|
6963
6964
|
(h) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(h) >= 0
|
|
6964
6965
|
);
|
|
@@ -6966,20 +6967,20 @@ function mc(n, e, t, s) {
|
|
|
6966
6967
|
const u = ee.fromObject(i, s);
|
|
6967
6968
|
return c.length > 0 ? ee.fromMillis(l, s).shiftTo(...c).plus(u) : u;
|
|
6968
6969
|
}
|
|
6969
|
-
const
|
|
6970
|
+
const yc = "missing Intl.DateTimeFormat.formatToParts support";
|
|
6970
6971
|
function ne(n, e = (t) => t) {
|
|
6971
|
-
return { regex: n, deser: ([t]) => e(
|
|
6972
|
+
return { regex: n, deser: ([t]) => e(ol(t)) };
|
|
6972
6973
|
}
|
|
6973
|
-
const
|
|
6974
|
-
function
|
|
6975
|
-
return n.replace(/\./g, "\\.?").replace(
|
|
6974
|
+
const gc = " ", mo = `[ ${gc}]`, po = new RegExp(mo, "g");
|
|
6975
|
+
function wc(n) {
|
|
6976
|
+
return n.replace(/\./g, "\\.?").replace(po, mo);
|
|
6976
6977
|
}
|
|
6977
6978
|
function Wr(n) {
|
|
6978
|
-
return n.replace(/\./g, "").replace(
|
|
6979
|
+
return n.replace(/\./g, "").replace(po, " ").toLowerCase();
|
|
6979
6980
|
}
|
|
6980
6981
|
function $e(n, e) {
|
|
6981
6982
|
return n === null ? null : {
|
|
6982
|
-
regex: RegExp(n.map(
|
|
6983
|
+
regex: RegExp(n.map(wc).join("|")),
|
|
6983
6984
|
deser: ([t]) => n.findIndex((s) => Wr(t) === Wr(s)) + e
|
|
6984
6985
|
};
|
|
6985
6986
|
}
|
|
@@ -6989,11 +6990,11 @@ function jr(n, e) {
|
|
|
6989
6990
|
function mn(n) {
|
|
6990
6991
|
return { regex: n, deser: ([e]) => e };
|
|
6991
6992
|
}
|
|
6992
|
-
function
|
|
6993
|
+
function _c(n) {
|
|
6993
6994
|
return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
6994
6995
|
}
|
|
6995
|
-
function
|
|
6996
|
-
const t = Ce(e), s = Ce(e, "{2}"), r = Ce(e, "{3}"), i = Ce(e, "{4}"), o = Ce(e, "{6}"), a = Ce(e, "{1,2}"), l = Ce(e, "{1,3}"), c = Ce(e, "{1,6}"), u = Ce(e, "{1,9}"), h = Ce(e, "{2,4}"), f = Ce(e, "{4,6}"), d = (y) => ({ regex: RegExp(
|
|
6996
|
+
function Ec(n, e) {
|
|
6997
|
+
const t = Ce(e), s = Ce(e, "{2}"), r = Ce(e, "{3}"), i = Ce(e, "{4}"), o = Ce(e, "{6}"), a = Ce(e, "{1,2}"), l = Ce(e, "{1,3}"), c = Ce(e, "{1,6}"), u = Ce(e, "{1,9}"), h = Ce(e, "{2,4}"), f = Ce(e, "{4,6}"), d = (y) => ({ regex: RegExp(_c(y.val)), deser: ([w]) => w, literal: !0 }), O = ((y) => {
|
|
6997
6998
|
if (n.literal)
|
|
6998
6999
|
return d(y);
|
|
6999
7000
|
switch (y.val) {
|
|
@@ -7114,11 +7115,11 @@ function _c(n, e) {
|
|
|
7114
7115
|
return d(y);
|
|
7115
7116
|
}
|
|
7116
7117
|
})(n) || {
|
|
7117
|
-
invalidReason:
|
|
7118
|
+
invalidReason: yc
|
|
7118
7119
|
};
|
|
7119
7120
|
return O.token = n, O;
|
|
7120
7121
|
}
|
|
7121
|
-
const
|
|
7122
|
+
const vc = {
|
|
7122
7123
|
year: {
|
|
7123
7124
|
"2-digit": "yy",
|
|
7124
7125
|
numeric: "yyyyy"
|
|
@@ -7160,7 +7161,7 @@ const Ec = {
|
|
|
7160
7161
|
short: "ZZZ"
|
|
7161
7162
|
}
|
|
7162
7163
|
};
|
|
7163
|
-
function
|
|
7164
|
+
function Oc(n, e, t) {
|
|
7164
7165
|
const { type: s, value: r } = n;
|
|
7165
7166
|
if (s === "literal") {
|
|
7166
7167
|
const l = /^\s+$/.test(r);
|
|
@@ -7172,17 +7173,17 @@ function vc(n, e, t) {
|
|
|
7172
7173
|
const i = e[s];
|
|
7173
7174
|
let o = s;
|
|
7174
7175
|
s === "hour" && (e.hour12 != null ? o = e.hour12 ? "hour12" : "hour24" : e.hourCycle != null ? e.hourCycle === "h11" || e.hourCycle === "h12" ? o = "hour12" : o = "hour24" : o = t.hour12 ? "hour12" : "hour24");
|
|
7175
|
-
let a =
|
|
7176
|
+
let a = vc[o];
|
|
7176
7177
|
if (typeof a == "object" && (a = a[i]), a)
|
|
7177
7178
|
return {
|
|
7178
7179
|
literal: !1,
|
|
7179
7180
|
val: a
|
|
7180
7181
|
};
|
|
7181
7182
|
}
|
|
7182
|
-
function
|
|
7183
|
+
function kc(n) {
|
|
7183
7184
|
return [`^${n.map((t) => t.regex).reduce((t, s) => `${t}(${s.source})`, "")}$`, n];
|
|
7184
7185
|
}
|
|
7185
|
-
function
|
|
7186
|
+
function bc(n, e, t) {
|
|
7186
7187
|
const s = n.match(e);
|
|
7187
7188
|
if (s) {
|
|
7188
7189
|
const r = {};
|
|
@@ -7196,7 +7197,7 @@ function kc(n, e, t) {
|
|
|
7196
7197
|
} else
|
|
7197
7198
|
return [s, {}];
|
|
7198
7199
|
}
|
|
7199
|
-
function
|
|
7200
|
+
function Sc(n) {
|
|
7200
7201
|
const e = (i) => {
|
|
7201
7202
|
switch (i) {
|
|
7202
7203
|
case "S":
|
|
@@ -7237,28 +7238,28 @@ function bc(n) {
|
|
|
7237
7238
|
}, {}), t, s];
|
|
7238
7239
|
}
|
|
7239
7240
|
let ls = null;
|
|
7240
|
-
function
|
|
7241
|
+
function Tc() {
|
|
7241
7242
|
return ls || (ls = V.fromMillis(1555555555555)), ls;
|
|
7242
7243
|
}
|
|
7243
|
-
function
|
|
7244
|
+
function Rc(n, e) {
|
|
7244
7245
|
if (n.literal)
|
|
7245
7246
|
return n;
|
|
7246
|
-
const t = _e.macroTokenToFormatOpts(n.val), s =
|
|
7247
|
+
const t = _e.macroTokenToFormatOpts(n.val), s = _o(t, e);
|
|
7247
7248
|
return s == null || s.includes(void 0) ? n : s;
|
|
7248
7249
|
}
|
|
7249
|
-
function
|
|
7250
|
-
return Array.prototype.concat(...n.map((t) =>
|
|
7250
|
+
function yo(n, e) {
|
|
7251
|
+
return Array.prototype.concat(...n.map((t) => Rc(t, e)));
|
|
7251
7252
|
}
|
|
7252
|
-
class
|
|
7253
|
+
class go {
|
|
7253
7254
|
constructor(e, t) {
|
|
7254
|
-
if (this.locale = e, this.format = t, this.tokens =
|
|
7255
|
-
const [s, r] =
|
|
7255
|
+
if (this.locale = e, this.format = t, this.tokens = yo(_e.parseFormat(t), e), this.units = this.tokens.map((s) => Ec(s, e)), this.disqualifyingUnit = this.units.find((s) => s.invalidReason), !this.disqualifyingUnit) {
|
|
7256
|
+
const [s, r] = kc(this.units);
|
|
7256
7257
|
this.regex = RegExp(s, "i"), this.handlers = r;
|
|
7257
7258
|
}
|
|
7258
7259
|
}
|
|
7259
7260
|
explainFromTokens(e) {
|
|
7260
7261
|
if (this.isValid) {
|
|
7261
|
-
const [t, s] =
|
|
7262
|
+
const [t, s] = bc(e, this.regex, this.handlers), [r, i, o] = s ? Sc(s) : [null, null, void 0];
|
|
7262
7263
|
if ($t(s, "a") && $t(s, "H"))
|
|
7263
7264
|
throw new St(
|
|
7264
7265
|
"Can't include meridiem when specifying 24-hour format"
|
|
@@ -7283,18 +7284,18 @@ class yo {
|
|
|
7283
7284
|
return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;
|
|
7284
7285
|
}
|
|
7285
7286
|
}
|
|
7286
|
-
function
|
|
7287
|
-
return new
|
|
7287
|
+
function wo(n, e, t) {
|
|
7288
|
+
return new go(n, t).explainFromTokens(e);
|
|
7288
7289
|
}
|
|
7289
|
-
function
|
|
7290
|
-
const { result: s, zone: r, specificOffset: i, invalidReason: o } =
|
|
7290
|
+
function Nc(n, e, t) {
|
|
7291
|
+
const { result: s, zone: r, specificOffset: i, invalidReason: o } = wo(n, e, t);
|
|
7291
7292
|
return [s, r, i, o];
|
|
7292
7293
|
}
|
|
7293
|
-
function
|
|
7294
|
+
function _o(n, e) {
|
|
7294
7295
|
if (!n)
|
|
7295
7296
|
return null;
|
|
7296
|
-
const s = _e.create(e, n).dtFormatter(
|
|
7297
|
-
return r.map((o) =>
|
|
7297
|
+
const s = _e.create(e, n).dtFormatter(Tc()), r = s.formatToParts(), i = s.resolvedOptions();
|
|
7298
|
+
return r.map((o) => Oc(o, n, i));
|
|
7298
7299
|
}
|
|
7299
7300
|
const cs = "Invalid DateTime", Zr = 864e13;
|
|
7300
7301
|
function Gt(n) {
|
|
@@ -7321,7 +7322,7 @@ function dt(n, e) {
|
|
|
7321
7322
|
};
|
|
7322
7323
|
return new V({ ...t, ...e, old: t });
|
|
7323
7324
|
}
|
|
7324
|
-
function
|
|
7325
|
+
function Eo(n, e, t) {
|
|
7325
7326
|
let s = n - e * 60 * 1e3;
|
|
7326
7327
|
const r = t.offset(s);
|
|
7327
7328
|
if (e === r)
|
|
@@ -7344,7 +7345,7 @@ function pn(n, e) {
|
|
|
7344
7345
|
};
|
|
7345
7346
|
}
|
|
7346
7347
|
function _n(n, e, t) {
|
|
7347
|
-
return
|
|
7348
|
+
return Eo(Hn(n), e, t);
|
|
7348
7349
|
}
|
|
7349
7350
|
function zr(n, e) {
|
|
7350
7351
|
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 = {
|
|
@@ -7363,7 +7364,7 @@ function zr(n, e) {
|
|
|
7363
7364
|
seconds: e.seconds,
|
|
7364
7365
|
milliseconds: e.milliseconds
|
|
7365
7366
|
}).as("milliseconds"), a = Hn(i);
|
|
7366
|
-
let [l, c] =
|
|
7367
|
+
let [l, c] = Eo(a, t, n.zone);
|
|
7367
7368
|
return o !== 0 && (l += o, c = n.zone.offset(l)), { ts: l, o: c };
|
|
7368
7369
|
}
|
|
7369
7370
|
function kt(n, e, t, s, r, i) {
|
|
@@ -7417,27 +7418,27 @@ function qr(n, e, t, s, r, i, o) {
|
|
|
7417
7418
|
}
|
|
7418
7419
|
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;
|
|
7419
7420
|
}
|
|
7420
|
-
const
|
|
7421
|
+
const vo = {
|
|
7421
7422
|
month: 1,
|
|
7422
7423
|
day: 1,
|
|
7423
7424
|
hour: 0,
|
|
7424
7425
|
minute: 0,
|
|
7425
7426
|
second: 0,
|
|
7426
7427
|
millisecond: 0
|
|
7427
|
-
},
|
|
7428
|
+
}, xc = {
|
|
7428
7429
|
weekNumber: 1,
|
|
7429
7430
|
weekday: 1,
|
|
7430
7431
|
hour: 0,
|
|
7431
7432
|
minute: 0,
|
|
7432
7433
|
second: 0,
|
|
7433
7434
|
millisecond: 0
|
|
7434
|
-
},
|
|
7435
|
+
}, Ic = {
|
|
7435
7436
|
ordinal: 1,
|
|
7436
7437
|
hour: 0,
|
|
7437
7438
|
minute: 0,
|
|
7438
7439
|
second: 0,
|
|
7439
7440
|
millisecond: 0
|
|
7440
|
-
}, En = ["year", "month", "day", "hour", "minute", "second", "millisecond"],
|
|
7441
|
+
}, En = ["year", "month", "day", "hour", "minute", "second", "millisecond"], Dc = [
|
|
7441
7442
|
"weekYear",
|
|
7442
7443
|
"weekNumber",
|
|
7443
7444
|
"weekday",
|
|
@@ -7445,7 +7446,7 @@ const Eo = {
|
|
|
7445
7446
|
"minute",
|
|
7446
7447
|
"second",
|
|
7447
7448
|
"millisecond"
|
|
7448
|
-
],
|
|
7449
|
+
], Ac = ["year", "ordinal", "hour", "minute", "second", "millisecond"];
|
|
7449
7450
|
function vn(n) {
|
|
7450
7451
|
const e = {
|
|
7451
7452
|
year: "year",
|
|
@@ -7473,7 +7474,7 @@ function vn(n) {
|
|
|
7473
7474
|
weekyears: "weekYear",
|
|
7474
7475
|
ordinal: "ordinal"
|
|
7475
7476
|
}[n.toLowerCase()];
|
|
7476
|
-
if (!e) throw new
|
|
7477
|
+
if (!e) throw new Ei(n);
|
|
7477
7478
|
return e;
|
|
7478
7479
|
}
|
|
7479
7480
|
function Br(n) {
|
|
@@ -7491,7 +7492,7 @@ function Br(n) {
|
|
|
7491
7492
|
return vn(n);
|
|
7492
7493
|
}
|
|
7493
7494
|
}
|
|
7494
|
-
function
|
|
7495
|
+
function Cc(n) {
|
|
7495
7496
|
if (Yt === void 0 && (Yt = ce.now()), n.type !== "iana")
|
|
7496
7497
|
return n.offset(Yt);
|
|
7497
7498
|
const e = n.name;
|
|
@@ -7508,11 +7509,11 @@ function Hr(n, e) {
|
|
|
7508
7509
|
r = ce.now();
|
|
7509
7510
|
else {
|
|
7510
7511
|
for (const l of En)
|
|
7511
|
-
H(n[l]) && (n[l] =
|
|
7512
|
-
const o =
|
|
7512
|
+
H(n[l]) && (n[l] = vo[l]);
|
|
7513
|
+
const o = Bi(n) || Hi(n);
|
|
7513
7514
|
if (o)
|
|
7514
7515
|
return V.invalid(o);
|
|
7515
|
-
const a =
|
|
7516
|
+
const a = Cc(t);
|
|
7516
7517
|
[r, i] = _n(n, a, t);
|
|
7517
7518
|
}
|
|
7518
7519
|
return new V({ ts: r, zone: t, loc: s, o: i });
|
|
@@ -7625,7 +7626,7 @@ class V {
|
|
|
7625
7626
|
* @return {DateTime}
|
|
7626
7627
|
*/
|
|
7627
7628
|
static fromJSDate(e, t = {}) {
|
|
7628
|
-
const s =
|
|
7629
|
+
const s = dl(e) ? e.valueOf() : NaN;
|
|
7629
7630
|
if (Number.isNaN(s))
|
|
7630
7631
|
return V.invalid("invalid input");
|
|
7631
7632
|
const r = tt(t.zone, ce.defaultZone);
|
|
@@ -7724,13 +7725,13 @@ class V {
|
|
|
7724
7725
|
throw new St("Can't mix ordinal dates with month/day");
|
|
7725
7726
|
const O = m || i.weekday && !d;
|
|
7726
7727
|
let y, w, b = pn(l, c);
|
|
7727
|
-
O ? (y =
|
|
7728
|
+
O ? (y = Dc, w = xc, b = Pn(b, o, a)) : u ? (y = Ac, w = Ic, b = as(b)) : (y = En, w = vo);
|
|
7728
7729
|
let N = !1;
|
|
7729
7730
|
for (const g of y) {
|
|
7730
7731
|
const k = i[g];
|
|
7731
7732
|
H(k) ? N ? i[g] = w[g] : i[g] = b[g] : N = !0;
|
|
7732
7733
|
}
|
|
7733
|
-
const p = O ?
|
|
7734
|
+
const p = O ? ll(i, o, a) : u ? cl(i) : Bi(i), T = p || Hi(i);
|
|
7734
7735
|
if (T)
|
|
7735
7736
|
return V.invalid(T);
|
|
7736
7737
|
const C = O ? Ir(i, o, a) : u ? Dr(i) : i, [v, Z] = _n(C, c, s), x = new V({
|
|
@@ -7762,7 +7763,7 @@ class V {
|
|
|
7762
7763
|
* @return {DateTime}
|
|
7763
7764
|
*/
|
|
7764
7765
|
static fromISO(e, t = {}) {
|
|
7765
|
-
const [s, r] =
|
|
7766
|
+
const [s, r] = ec(e);
|
|
7766
7767
|
return kt(s, r, t, "ISO 8601", e);
|
|
7767
7768
|
}
|
|
7768
7769
|
/**
|
|
@@ -7781,7 +7782,7 @@ class V {
|
|
|
7781
7782
|
* @return {DateTime}
|
|
7782
7783
|
*/
|
|
7783
7784
|
static fromRFC2822(e, t = {}) {
|
|
7784
|
-
const [s, r] =
|
|
7785
|
+
const [s, r] = tc(e);
|
|
7785
7786
|
return kt(s, r, t, "RFC 2822", e);
|
|
7786
7787
|
}
|
|
7787
7788
|
/**
|
|
@@ -7801,7 +7802,7 @@ class V {
|
|
|
7801
7802
|
* @return {DateTime}
|
|
7802
7803
|
*/
|
|
7803
7804
|
static fromHTTP(e, t = {}) {
|
|
7804
|
-
const [s, r] =
|
|
7805
|
+
const [s, r] = nc(e);
|
|
7805
7806
|
return kt(s, r, t, "HTTP", t);
|
|
7806
7807
|
}
|
|
7807
7808
|
/**
|
|
@@ -7825,7 +7826,7 @@ class V {
|
|
|
7825
7826
|
locale: r,
|
|
7826
7827
|
numberingSystem: i,
|
|
7827
7828
|
defaultToEN: !0
|
|
7828
|
-
}), [a, l, c, u] =
|
|
7829
|
+
}), [a, l, c, u] = Nc(o, e, t);
|
|
7829
7830
|
return u ? V.invalid(u) : kt(a, l, s, `format ${t}`, e, c);
|
|
7830
7831
|
}
|
|
7831
7832
|
/**
|
|
@@ -7856,7 +7857,7 @@ class V {
|
|
|
7856
7857
|
* @return {DateTime}
|
|
7857
7858
|
*/
|
|
7858
7859
|
static fromSQL(e, t = {}) {
|
|
7859
|
-
const [s, r] =
|
|
7860
|
+
const [s, r] = cc(e);
|
|
7860
7861
|
return kt(s, r, t, "SQL", e);
|
|
7861
7862
|
}
|
|
7862
7863
|
/**
|
|
@@ -7870,7 +7871,7 @@ class V {
|
|
|
7870
7871
|
throw new we("need to specify a reason the DateTime is invalid");
|
|
7871
7872
|
const s = e instanceof Fe ? e : new Fe(e, t);
|
|
7872
7873
|
if (ce.throwOnInvalid)
|
|
7873
|
-
throw new
|
|
7874
|
+
throw new Fa(s);
|
|
7874
7875
|
return new V({ invalid: s });
|
|
7875
7876
|
}
|
|
7876
7877
|
/**
|
|
@@ -7888,7 +7889,7 @@ class V {
|
|
|
7888
7889
|
* @returns {string}
|
|
7889
7890
|
*/
|
|
7890
7891
|
static parseFormatForOpts(e, t = {}) {
|
|
7891
|
-
const s =
|
|
7892
|
+
const s = _o(e, se.fromObject(t));
|
|
7892
7893
|
return s ? s.map((r) => r ? r.val : null).join("") : null;
|
|
7893
7894
|
}
|
|
7894
7895
|
/**
|
|
@@ -7899,7 +7900,7 @@ class V {
|
|
|
7899
7900
|
* @returns {string}
|
|
7900
7901
|
*/
|
|
7901
7902
|
static expandFormat(e, t = {}) {
|
|
7902
|
-
return
|
|
7903
|
+
return yo(_e.parseFormat(e), se.fromObject(t)).map((r) => r.val).join("");
|
|
7903
7904
|
}
|
|
7904
7905
|
static resetCache() {
|
|
7905
7906
|
Yt = void 0, Ps.clear();
|
|
@@ -8759,7 +8760,7 @@ class V {
|
|
|
8759
8760
|
diff(e, t = "milliseconds", s = {}) {
|
|
8760
8761
|
if (!this.isValid || !e.isValid)
|
|
8761
8762
|
return ee.invalid("created by diffing an invalid DateTime");
|
|
8762
|
-
const r = { locale: this.locale, numberingSystem: this.numberingSystem, ...s }, i =
|
|
8763
|
+
const r = { locale: this.locale, numberingSystem: this.numberingSystem, ...s }, i = fl(t).map(ee.normalizeUnit), o = e.valueOf() > this.valueOf(), a = o ? this : e, l = o ? e : this, c = pc(a, l, i, r);
|
|
8763
8764
|
return o ? c.negate() : c;
|
|
8764
8765
|
}
|
|
8765
8766
|
/**
|
|
@@ -8892,7 +8893,7 @@ class V {
|
|
|
8892
8893
|
numberingSystem: i,
|
|
8893
8894
|
defaultToEN: !0
|
|
8894
8895
|
});
|
|
8895
|
-
return
|
|
8896
|
+
return wo(o, e, t);
|
|
8896
8897
|
}
|
|
8897
8898
|
/**
|
|
8898
8899
|
* @deprecated use fromFormatExplain instead
|
|
@@ -8918,7 +8919,7 @@ class V {
|
|
|
8918
8919
|
numberingSystem: r,
|
|
8919
8920
|
defaultToEN: !0
|
|
8920
8921
|
});
|
|
8921
|
-
return new
|
|
8922
|
+
return new go(i, e);
|
|
8922
8923
|
}
|
|
8923
8924
|
/**
|
|
8924
8925
|
* Create a DateTime from an input string and format parser.
|
|
@@ -8967,147 +8968,147 @@ class V {
|
|
|
8967
8968
|
* @type {Object}
|
|
8968
8969
|
*/
|
|
8969
8970
|
static get DATE_MED() {
|
|
8970
|
-
return
|
|
8971
|
+
return vi;
|
|
8971
8972
|
}
|
|
8972
8973
|
/**
|
|
8973
8974
|
* {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'
|
|
8974
8975
|
* @type {Object}
|
|
8975
8976
|
*/
|
|
8976
8977
|
static get DATE_MED_WITH_WEEKDAY() {
|
|
8977
|
-
return
|
|
8978
|
+
return Va;
|
|
8978
8979
|
}
|
|
8979
8980
|
/**
|
|
8980
8981
|
* {@link DateTime#toLocaleString} format like 'October 14, 1983'
|
|
8981
8982
|
* @type {Object}
|
|
8982
8983
|
*/
|
|
8983
8984
|
static get DATE_FULL() {
|
|
8984
|
-
return
|
|
8985
|
+
return Oi;
|
|
8985
8986
|
}
|
|
8986
8987
|
/**
|
|
8987
8988
|
* {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'
|
|
8988
8989
|
* @type {Object}
|
|
8989
8990
|
*/
|
|
8990
8991
|
static get DATE_HUGE() {
|
|
8991
|
-
return
|
|
8992
|
+
return ki;
|
|
8992
8993
|
}
|
|
8993
8994
|
/**
|
|
8994
8995
|
* {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.
|
|
8995
8996
|
* @type {Object}
|
|
8996
8997
|
*/
|
|
8997
8998
|
static get TIME_SIMPLE() {
|
|
8998
|
-
return
|
|
8999
|
+
return bi;
|
|
8999
9000
|
}
|
|
9000
9001
|
/**
|
|
9001
9002
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.
|
|
9002
9003
|
* @type {Object}
|
|
9003
9004
|
*/
|
|
9004
9005
|
static get TIME_WITH_SECONDS() {
|
|
9005
|
-
return
|
|
9006
|
+
return Si;
|
|
9006
9007
|
}
|
|
9007
9008
|
/**
|
|
9008
9009
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.
|
|
9009
9010
|
* @type {Object}
|
|
9010
9011
|
*/
|
|
9011
9012
|
static get TIME_WITH_SHORT_OFFSET() {
|
|
9012
|
-
return
|
|
9013
|
+
return Ti;
|
|
9013
9014
|
}
|
|
9014
9015
|
/**
|
|
9015
9016
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
9016
9017
|
* @type {Object}
|
|
9017
9018
|
*/
|
|
9018
9019
|
static get TIME_WITH_LONG_OFFSET() {
|
|
9019
|
-
return
|
|
9020
|
+
return Ri;
|
|
9020
9021
|
}
|
|
9021
9022
|
/**
|
|
9022
9023
|
* {@link DateTime#toLocaleString} format like '09:30', always 24-hour.
|
|
9023
9024
|
* @type {Object}
|
|
9024
9025
|
*/
|
|
9025
9026
|
static get TIME_24_SIMPLE() {
|
|
9026
|
-
return
|
|
9027
|
+
return Ni;
|
|
9027
9028
|
}
|
|
9028
9029
|
/**
|
|
9029
9030
|
* {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.
|
|
9030
9031
|
* @type {Object}
|
|
9031
9032
|
*/
|
|
9032
9033
|
static get TIME_24_WITH_SECONDS() {
|
|
9033
|
-
return
|
|
9034
|
+
return xi;
|
|
9034
9035
|
}
|
|
9035
9036
|
/**
|
|
9036
9037
|
* {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.
|
|
9037
9038
|
* @type {Object}
|
|
9038
9039
|
*/
|
|
9039
9040
|
static get TIME_24_WITH_SHORT_OFFSET() {
|
|
9040
|
-
return
|
|
9041
|
+
return Ii;
|
|
9041
9042
|
}
|
|
9042
9043
|
/**
|
|
9043
9044
|
* {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.
|
|
9044
9045
|
* @type {Object}
|
|
9045
9046
|
*/
|
|
9046
9047
|
static get TIME_24_WITH_LONG_OFFSET() {
|
|
9047
|
-
return
|
|
9048
|
+
return Di;
|
|
9048
9049
|
}
|
|
9049
9050
|
/**
|
|
9050
9051
|
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
9051
9052
|
* @type {Object}
|
|
9052
9053
|
*/
|
|
9053
9054
|
static get DATETIME_SHORT() {
|
|
9054
|
-
return
|
|
9055
|
+
return Ai;
|
|
9055
9056
|
}
|
|
9056
9057
|
/**
|
|
9057
9058
|
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
9058
9059
|
* @type {Object}
|
|
9059
9060
|
*/
|
|
9060
9061
|
static get DATETIME_SHORT_WITH_SECONDS() {
|
|
9061
|
-
return
|
|
9062
|
+
return Ci;
|
|
9062
9063
|
}
|
|
9063
9064
|
/**
|
|
9064
9065
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
9065
9066
|
* @type {Object}
|
|
9066
9067
|
*/
|
|
9067
9068
|
static get DATETIME_MED() {
|
|
9068
|
-
return
|
|
9069
|
+
return $i;
|
|
9069
9070
|
}
|
|
9070
9071
|
/**
|
|
9071
9072
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
9072
9073
|
* @type {Object}
|
|
9073
9074
|
*/
|
|
9074
9075
|
static get DATETIME_MED_WITH_SECONDS() {
|
|
9075
|
-
return
|
|
9076
|
+
return Mi;
|
|
9076
9077
|
}
|
|
9077
9078
|
/**
|
|
9078
9079
|
* {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
9079
9080
|
* @type {Object}
|
|
9080
9081
|
*/
|
|
9081
9082
|
static get DATETIME_MED_WITH_WEEKDAY() {
|
|
9082
|
-
return
|
|
9083
|
+
return Ua;
|
|
9083
9084
|
}
|
|
9084
9085
|
/**
|
|
9085
9086
|
* {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.
|
|
9086
9087
|
* @type {Object}
|
|
9087
9088
|
*/
|
|
9088
9089
|
static get DATETIME_FULL() {
|
|
9089
|
-
return
|
|
9090
|
+
return Fi;
|
|
9090
9091
|
}
|
|
9091
9092
|
/**
|
|
9092
9093
|
* {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.
|
|
9093
9094
|
* @type {Object}
|
|
9094
9095
|
*/
|
|
9095
9096
|
static get DATETIME_FULL_WITH_SECONDS() {
|
|
9096
|
-
return
|
|
9097
|
+
return Pi;
|
|
9097
9098
|
}
|
|
9098
9099
|
/**
|
|
9099
9100
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
9100
9101
|
* @type {Object}
|
|
9101
9102
|
*/
|
|
9102
9103
|
static get DATETIME_HUGE() {
|
|
9103
|
-
return
|
|
9104
|
+
return Li;
|
|
9104
9105
|
}
|
|
9105
9106
|
/**
|
|
9106
9107
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
9107
9108
|
* @type {Object}
|
|
9108
9109
|
*/
|
|
9109
9110
|
static get DATETIME_HUGE_WITH_SECONDS() {
|
|
9110
|
-
return
|
|
9111
|
+
return Vi;
|
|
9111
9112
|
}
|
|
9112
9113
|
}
|
|
9113
9114
|
function zt(n) {
|
|
@@ -9121,7 +9122,7 @@ function zt(n) {
|
|
|
9121
9122
|
`Unknown datetime argument: ${n}, of type ${typeof n}`
|
|
9122
9123
|
);
|
|
9123
9124
|
}
|
|
9124
|
-
const
|
|
9125
|
+
const $c = (n, e) => {
|
|
9125
9126
|
const t = {};
|
|
9126
9127
|
if (n.includeFields) {
|
|
9127
9128
|
const s = e.collections[n.collection];
|
|
@@ -9129,23 +9130,23 @@ const Cc = (n, e) => {
|
|
|
9129
9130
|
return rn(ge());
|
|
9130
9131
|
n.includeFields.forEach((r) => {
|
|
9131
9132
|
const i = s.fields.find((o) => o.name === r);
|
|
9132
|
-
i ? t[r] =
|
|
9133
|
+
i ? t[r] = Oo(i)?.nullable() : t[r] = ge();
|
|
9133
9134
|
});
|
|
9134
9135
|
}
|
|
9135
9136
|
return We({
|
|
9136
9137
|
Collection_Path: _t(be()),
|
|
9137
9138
|
...t
|
|
9138
9139
|
});
|
|
9139
|
-
},
|
|
9140
|
-
let r = We({}).catchall(
|
|
9140
|
+
}, Mc = (n, e, t, s) => {
|
|
9141
|
+
let r = We({}).catchall($c(n, e)), i;
|
|
9141
9142
|
if (!s && t) {
|
|
9142
9143
|
const o = Ie(n, t);
|
|
9143
9144
|
i = qt(o.admin?.skipFormRequiredValidation);
|
|
9144
9145
|
}
|
|
9145
9146
|
return (!n.required || i) && (r = r.optional()), r;
|
|
9146
|
-
},
|
|
9147
|
+
}, Fc = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds !== void 0 || n._seconds !== void 0 && n._nanoseconds !== void 0), {
|
|
9147
9148
|
message: "Must be a valid date"
|
|
9148
|
-
}),
|
|
9149
|
+
}), Oo = (n, e, t) => {
|
|
9149
9150
|
let s;
|
|
9150
9151
|
const r = `${qt(n.description)}
|
|
9151
9152
|
|
|
@@ -9185,7 +9186,7 @@ const Cc = (n, e) => {
|
|
|
9185
9186
|
t ? (s = We({
|
|
9186
9187
|
seconds: ht(),
|
|
9187
9188
|
nanoseconds: ht()
|
|
9188
|
-
}), n.min && n.max ? s = s.describe(`${r}Must be between ${V.fromMillis(n.min).toLocaleString(V.DATE_MED)} and ${V.fromMillis(n.max).toLocaleString(V.DATE_MED)}`) : n.min ? s = s.describe(`${r}Must be greater than or equal to ${V.fromMillis(n.min).toLocaleString(V.DATE_MED)}`) : n.max ? s = s.describe(`${r}Must be less than or equal to ${V.fromMillis(n.max).toLocaleString(V.DATE_MED)}`) : r && (s = s.describe(r.trim()))) : (s =
|
|
9189
|
+
}), n.min && n.max ? s = s.describe(`${r}Must be between ${V.fromMillis(n.min).toLocaleString(V.DATE_MED)} and ${V.fromMillis(n.max).toLocaleString(V.DATE_MED)}`) : n.min ? s = s.describe(`${r}Must be greater than or equal to ${V.fromMillis(n.min).toLocaleString(V.DATE_MED)}`) : n.max ? s = s.describe(`${r}Must be less than or equal to ${V.fromMillis(n.max).toLocaleString(V.DATE_MED)}`) : r && (s = s.describe(r.trim()))) : (s = Fc(), n.min && (s = s.refine((l) => l.toMillis() >= n.min, {
|
|
9189
9190
|
message: `Must be greater than or equal to ${V.fromMillis(n.min).toLocaleString(V.DATE_MED)}`
|
|
9190
9191
|
})), n.max && (s = s.refine((l) => l.toMillis() <= n.max, {
|
|
9191
9192
|
message: `Must be less than or equal to ${V.fromMillis(n.max).toLocaleString(V.DATE_MED)}`
|
|
@@ -9208,16 +9209,16 @@ const Cc = (n, e) => {
|
|
|
9208
9209
|
s = ge();
|
|
9209
9210
|
}
|
|
9210
9211
|
return (!n.required || i || o) && (s = s.optional()), s;
|
|
9211
|
-
},
|
|
9212
|
+
}, au = (n, e, t, s, r) => {
|
|
9212
9213
|
const { auth: i, softDelete: o } = n, a = {};
|
|
9213
9214
|
n.fields.forEach((c) => {
|
|
9214
|
-
c.type === "Embedding" || s && c.type === "Computed" || s && (c.name === o?.archivedField || c.name === o?.timestampField) || (K(c) ? (a[c.name] =
|
|
9215
|
+
c.type === "Embedding" || s && c.type === "Computed" || s && (c.name === o?.archivedField || c.name === o?.timestampField) || (K(c) ? (a[c.name] = Mc(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, {
|
|
9215
9216
|
message: `Must contain ${c.length} item(s)`
|
|
9216
9217
|
})), c.min && (a[c.name] = a[c.name].refine((u) => c.min && u && Object.keys(u).length >= c.min, {
|
|
9217
9218
|
message: `Must contain at least ${c.min} item(s)`
|
|
9218
9219
|
})), c.max && (a[c.name] = a[c.name].refine((u) => c.max && (!u || Object.keys(u).length <= c.max), {
|
|
9219
9220
|
message: `Must contain at most ${c.max} item(s)`
|
|
9220
|
-
})))) : a[c.name] =
|
|
9221
|
+
})))) : a[c.name] = Oo(c, t, s), r && (a[c.name] = a[c.name].optional()));
|
|
9221
9222
|
}), !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) => {
|
|
9222
9223
|
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) => {
|
|
9223
9224
|
a[`attribute-${c.labels.collection}-${u.type}`] = Kt().optional();
|
|
@@ -9240,7 +9241,7 @@ const Cc = (n, e) => {
|
|
|
9240
9241
|
await Jr(s.custom?.preValidate, r);
|
|
9241
9242
|
for (const a of s.fields)
|
|
9242
9243
|
await Jr(a.custom?.preValidate, r);
|
|
9243
|
-
return
|
|
9244
|
+
return Ma(n, t, i).parse(e), e;
|
|
9244
9245
|
}, Qs = (n, e, t, s, r, i, o, a, l, c, u, h, f, d, m, O, y, w, b, N, p) => {
|
|
9245
9246
|
const { fields: T } = o;
|
|
9246
9247
|
T.filter((g) => "unique" in g && g.unique).forEach((g) => {
|
|
@@ -9258,7 +9259,7 @@ const Cc = (n, e) => {
|
|
|
9258
9259
|
});
|
|
9259
9260
|
const C = l[o.labels.collection];
|
|
9260
9261
|
for (const g of C) {
|
|
9261
|
-
const k =
|
|
9262
|
+
const k = ia(g, o), _ = { ...r };
|
|
9262
9263
|
k.forEach((A) => {
|
|
9263
9264
|
delete _[A.name], delete _[`${A.name}_Array`], delete _[`${A.name}_Single`], delete _[`${A.name}_Lowercase`];
|
|
9264
9265
|
}), Object.keys(_).length > 0 && (n === "create" && (_.Collection_Path ||= t, _.Collection_Path_String = t.join("/"), e.set(m(g.key), _)), n === "update" && e.update(m(g.key), _), n === "delete" && e.delete(m(g.key)), p && p.size++);
|
|
@@ -9412,7 +9413,7 @@ const Cc = (n, e) => {
|
|
|
9412
9413
|
if (e = e.replace(/\0/g, ""), e = e.replace(/[\x00-\x08\x0B-\x1F\x7F]/g, ""), e = e.trim(), e.length > 254)
|
|
9413
9414
|
throw new Error("Email address is too long");
|
|
9414
9415
|
return e;
|
|
9415
|
-
}, hs = (n) => n ? Array.isArray(n) ? n.map((s) => Un(s)).filter((s) => s.length > 0) : Un(n) || "" : "",
|
|
9416
|
+
}, hs = (n) => n ? Array.isArray(n) ? n.map((s) => Un(s)).filter((s) => s.length > 0) : Un(n) || "" : "", Pc = (n) => {
|
|
9416
9417
|
if (!n || typeof n != "string")
|
|
9417
9418
|
return "";
|
|
9418
9419
|
let e = n.replace(/[\r\n]/g, " ");
|
|
@@ -9429,16 +9430,18 @@ const Cc = (n, e) => {
|
|
|
9429
9430
|
`), e.length > 5e6)
|
|
9430
9431
|
throw new Error("Email body is too long");
|
|
9431
9432
|
return e;
|
|
9432
|
-
},
|
|
9433
|
+
}, Lc = async (n, e) => {
|
|
9433
9434
|
const t = {};
|
|
9434
|
-
for (const s of e)
|
|
9435
|
+
for (const s of e) {
|
|
9436
|
+
const r = `${n}/${s}.js`, i = ii(r).href;
|
|
9435
9437
|
t[s] = await import(
|
|
9436
9438
|
/* @vite-ignore */
|
|
9437
|
-
|
|
9439
|
+
i
|
|
9438
9440
|
);
|
|
9441
|
+
}
|
|
9439
9442
|
return t;
|
|
9440
9443
|
};
|
|
9441
|
-
let ms,
|
|
9444
|
+
let ms, ko, On, bo, Jt, So, kn, bn, ps = 0, Xr = !1;
|
|
9442
9445
|
const Tt = {
|
|
9443
9446
|
getTenant() {
|
|
9444
9447
|
if (!On)
|
|
@@ -9449,10 +9452,10 @@ const Tt = {
|
|
|
9449
9452
|
On = n;
|
|
9450
9453
|
},
|
|
9451
9454
|
getMode() {
|
|
9452
|
-
return
|
|
9455
|
+
return ko;
|
|
9453
9456
|
},
|
|
9454
9457
|
getTimezone() {
|
|
9455
|
-
return
|
|
9458
|
+
return bo;
|
|
9456
9459
|
},
|
|
9457
9460
|
getGlobalConfigModule() {
|
|
9458
9461
|
return ye(Jt);
|
|
@@ -9460,7 +9463,7 @@ const Tt = {
|
|
|
9460
9463
|
getCustomizationFile(n, e) {
|
|
9461
9464
|
if (!Object.keys(e.collections).includes(n))
|
|
9462
9465
|
throw new Error("PERMISSION_DENIED");
|
|
9463
|
-
const t =
|
|
9466
|
+
const t = na([n], So, "node", Tt);
|
|
9464
9467
|
return ye(t?.[n]);
|
|
9465
9468
|
},
|
|
9466
9469
|
getVersionInfo() {
|
|
@@ -9469,17 +9472,14 @@ const Tt = {
|
|
|
9469
9472
|
getMaintenanceInfo() {
|
|
9470
9473
|
return bn;
|
|
9471
9474
|
}
|
|
9472
|
-
},
|
|
9475
|
+
}, lu = async (n, e, t, s, r) => {
|
|
9473
9476
|
const i = !!Xr;
|
|
9474
|
-
if (Xr = !0, e && (On = e),
|
|
9477
|
+
if (Xr = !0, e && (On = e), ko = n, ms && !r)
|
|
9475
9478
|
return Tt;
|
|
9476
9479
|
if (!process.env.STOKER_FB_WEB_APP_CONFIG)
|
|
9477
9480
|
throw new Error("STOKER_FB_WEB_APP_CONFIG not set.");
|
|
9478
|
-
const o = process.env.STOKER_FB_WEB_APP_CONFIG, a = JSON.parse(o),
|
|
9479
|
-
|
|
9480
|
-
t
|
|
9481
|
-
)).default;
|
|
9482
|
-
Jt = c("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");
|
|
9481
|
+
const o = process.env.STOKER_FB_WEB_APP_CONFIG, a = JSON.parse(o), u = (await import(ii(t).href)).default;
|
|
9482
|
+
Jt = u("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
9483
|
try {
|
|
9484
9484
|
ms = ni();
|
|
9485
9485
|
} catch {
|
|
@@ -9490,23 +9490,23 @@ const Tt = {
|
|
|
9490
9490
|
projectId: a.projectId
|
|
9491
9491
|
});
|
|
9492
9492
|
}
|
|
9493
|
-
const
|
|
9494
|
-
return
|
|
9495
|
-
|
|
9496
|
-
}, (
|
|
9497
|
-
console.error(
|
|
9498
|
-
}), i || ue().collection("system_deployment").doc("latest_deploy").onSnapshot((
|
|
9499
|
-
|
|
9500
|
-
}, (
|
|
9501
|
-
console.error(
|
|
9502
|
-
}), await new Promise((
|
|
9503
|
-
const
|
|
9504
|
-
bn && kn ?
|
|
9493
|
+
const h = await Ge();
|
|
9494
|
+
return So = await Lc(s, Object.keys(h.collections)), bo = await ie(Jt.timezone), i || ue().collection("system_deployment").doc("maintenance_mode").onSnapshot((f) => {
|
|
9495
|
+
f.exists ? (bn = f.data(), ie(Jt.onMaintenanceUpdate, ["node", bn.active ? "on" : "off"])) : console.error("Maintenance status not found");
|
|
9496
|
+
}, (f) => {
|
|
9497
|
+
console.error(f.message);
|
|
9498
|
+
}), i || ue().collection("system_deployment").doc("latest_deploy").onSnapshot((f) => {
|
|
9499
|
+
f.exists ? (kn = f.data(), ps++, ps > 1 && ie(Jt.onVersionUpdate, ["node", kn, ps])) : console.error("Version info not found");
|
|
9500
|
+
}, (f) => {
|
|
9501
|
+
console.error(f.message);
|
|
9502
|
+
}), await new Promise((f) => {
|
|
9503
|
+
const d = () => {
|
|
9504
|
+
bn && kn ? f(Tt) : setTimeout(d, 100);
|
|
9505
9505
|
};
|
|
9506
|
-
|
|
9506
|
+
d();
|
|
9507
9507
|
}), Tt;
|
|
9508
|
-
}, { getTenant: Ye, setTenant:
|
|
9509
|
-
const o =
|
|
9508
|
+
}, { getTenant: Ye, setTenant: cu, getMode: To, getTimezone: Ro, getGlobalConfigModule: Ut, getCustomizationFile: Je, getVersionInfo: uu, getMaintenanceInfo: du } = Tt, fu = async (n, e, t, s) => new Promise((r, i) => {
|
|
9509
|
+
const o = zo(n, e, { cwd: t || process.cwd(), env: { ...process.env, ...s } });
|
|
9510
9510
|
let a = "";
|
|
9511
9511
|
const l = () => {
|
|
9512
9512
|
o.kill("SIGINT");
|
|
@@ -9515,14 +9515,14 @@ const Tt = {
|
|
|
9515
9515
|
}, u = () => {
|
|
9516
9516
|
process.removeListener("SIGINT", l), process.removeListener("SIGTERM", c);
|
|
9517
9517
|
};
|
|
9518
|
-
o.stdout
|
|
9518
|
+
o.stdout?.on("data", (h) => {
|
|
9519
9519
|
a += h.toString(), console.log(h.toString());
|
|
9520
|
-
}), o.stderr
|
|
9520
|
+
}), o.stderr?.on("data", (h) => {
|
|
9521
9521
|
console.log(h.toString());
|
|
9522
9522
|
}), o.on("exit", (h) => {
|
|
9523
9523
|
u(), h === 0 ? r(a) : i();
|
|
9524
9524
|
}), process.on("SIGINT", l), process.on("SIGTERM", c);
|
|
9525
|
-
}),
|
|
9525
|
+
}), hu = async () => {
|
|
9526
9526
|
const n = process.env.STOKER_FB_WEB_APP_CONFIG;
|
|
9527
9527
|
if (!n)
|
|
9528
9528
|
throw new Error("Firebase web app config not found");
|
|
@@ -9538,7 +9538,7 @@ const Tt = {
|
|
|
9538
9538
|
});
|
|
9539
9539
|
}
|
|
9540
9540
|
}, Ge = async (n = !1) => {
|
|
9541
|
-
const s = await
|
|
9541
|
+
const s = await oi().ref("schema").orderByChild("published_time").limitToLast(1).get(), r = Object.values(s.val())[0];
|
|
9542
9542
|
if (n) {
|
|
9543
9543
|
for (const i of Object.values(r.collections))
|
|
9544
9544
|
for (const o of i.fields)
|
|
@@ -9550,8 +9550,8 @@ const Tt = {
|
|
|
9550
9550
|
for (const i of Object.values(r.collections))
|
|
9551
9551
|
i.fields = i.fields.filter((o) => o.type !== "Computed");
|
|
9552
9552
|
return r;
|
|
9553
|
-
},
|
|
9554
|
-
const t = await
|
|
9553
|
+
}, mu = async () => {
|
|
9554
|
+
const t = await oi().ref("schema").orderByChild("published_time").limitToLast(2).get();
|
|
9555
9555
|
if (!(t.numChildren() < 2))
|
|
9556
9556
|
return Object.values(t.val())[0];
|
|
9557
9557
|
}, De = (n, e, t) => {
|
|
@@ -9559,7 +9559,7 @@ const Tt = {
|
|
|
9559
9559
|
for (let r = 0; r < e.length; r++)
|
|
9560
9560
|
r % 2 === 0 ? s = s.collection(e[r]) : s = s.doc(e[r]);
|
|
9561
9561
|
return s;
|
|
9562
|
-
},
|
|
9562
|
+
}, Vc = (n, e, t, s, r) => {
|
|
9563
9563
|
const i = ue(), o = e.at(-1);
|
|
9564
9564
|
if (!o)
|
|
9565
9565
|
throw new Error("EMPTY_PATH");
|
|
@@ -9569,8 +9569,8 @@ const Tt = {
|
|
|
9569
9569
|
const d = r.collections?.[l.collection];
|
|
9570
9570
|
if (!r.Role)
|
|
9571
9571
|
throw new Error("PERMISSION_DENIED");
|
|
9572
|
-
const m = d && Te("Read", d), O =
|
|
9573
|
-
const D = [], R =
|
|
9572
|
+
const m = d && Te("Read", d), O = ui(a, t, r), y = li(a, r), w = Ls(a, r), b = ci(a, t, r), N = (E = []) => {
|
|
9573
|
+
const D = [], R = pi(r.Role, a, t);
|
|
9574
9574
|
if (!R)
|
|
9575
9575
|
throw new Error("PERMISSION_DENIED");
|
|
9576
9576
|
if (m) {
|
|
@@ -9784,7 +9784,7 @@ const Tt = {
|
|
|
9784
9784
|
} else
|
|
9785
9785
|
throw new Error("PERMISSION_DENIED");
|
|
9786
9786
|
else return [f];
|
|
9787
|
-
},
|
|
9787
|
+
}, No = (n, e, t, s, r) => {
|
|
9788
9788
|
const i = ue(), o = e.at(-1);
|
|
9789
9789
|
if (!o)
|
|
9790
9790
|
throw new Error("EMPTY_PATH");
|
|
@@ -9793,7 +9793,7 @@ const Tt = {
|
|
|
9793
9793
|
const u = r.collections?.[l.collection];
|
|
9794
9794
|
if (!r.Role)
|
|
9795
9795
|
throw new Error("PERMISSION_DENIED");
|
|
9796
|
-
const h = u && Te("Read", u), f =
|
|
9796
|
+
const h = u && Te("Read", u), f = ui(a, s, r), d = [], m = pi(r.Role, a, s);
|
|
9797
9797
|
if (!m)
|
|
9798
9798
|
throw new Error("PERMISSION_DENIED");
|
|
9799
9799
|
if (h)
|
|
@@ -9804,14 +9804,14 @@ const Tt = {
|
|
|
9804
9804
|
return d;
|
|
9805
9805
|
} else
|
|
9806
9806
|
return [c.doc(t)];
|
|
9807
|
-
},
|
|
9808
|
-
const u = t.at(-2), h =
|
|
9807
|
+
}, xo = async (n, e, t, s, r, i, o, a, l, c) => {
|
|
9808
|
+
const u = t.at(-2), h = di(r.collections[u], r).map((m) => m.labels.collection);
|
|
9809
9809
|
s.collections ? s.collections.forEach((m) => {
|
|
9810
9810
|
if (!h.includes(m))
|
|
9811
9811
|
throw new Error(`SCHEMA_ERROR: Collection ${m} not found in subcollections of ${u}`);
|
|
9812
9812
|
}) : s.collections = h;
|
|
9813
9813
|
const f = s.depth - 1, d = s.collections.map(async (m) => {
|
|
9814
|
-
const O = await
|
|
9814
|
+
const O = await Io([...t, m], s.constraints, {
|
|
9815
9815
|
user: a,
|
|
9816
9816
|
pagination: s.limit,
|
|
9817
9817
|
providedTransaction: l,
|
|
@@ -9824,7 +9824,7 @@ const Tt = {
|
|
|
9824
9824
|
e[m].map((y) => Xs(n, y, [...t, m, y.id], i, r, void 0, a, l, c))
|
|
9825
9825
|
), f > 0 && await Promise.all(
|
|
9826
9826
|
// eslint-disable-next-line security/detect-object-injection
|
|
9827
|
-
e[m].map((y) =>
|
|
9827
|
+
e[m].map((y) => xo(n, y, [...t, m, y.id], { depth: f }, r, i, o, a, l, c))
|
|
9828
9828
|
);
|
|
9829
9829
|
});
|
|
9830
9830
|
await Promise.all(d);
|
|
@@ -9867,7 +9867,7 @@ const Tt = {
|
|
|
9867
9867
|
}
|
|
9868
9868
|
}
|
|
9869
9869
|
await Promise.all(h);
|
|
9870
|
-
},
|
|
9870
|
+
}, Io = async (n, e, t) => {
|
|
9871
9871
|
if (t?.subcollections?.depth && t.subcollections.depth > 10)
|
|
9872
9872
|
throw new Error("INPUT_ERROR: Subcollections depth cannot exceed 10");
|
|
9873
9873
|
if (t?.relations?.depth && t.relations.depth > 10)
|
|
@@ -9906,7 +9906,7 @@ const Tt = {
|
|
|
9906
9906
|
if (!O.Enabled)
|
|
9907
9907
|
throw new Error("PERMISSION_DENIED");
|
|
9908
9908
|
}
|
|
9909
|
-
let v =
|
|
9909
|
+
let v = Vc(s, n, m, t?.user, O);
|
|
9910
9910
|
if (v.length === 0)
|
|
9911
9911
|
return { cursor: {}, pages: 0, docs: [] };
|
|
9912
9912
|
if (e && (v = v.map((A) => (e.forEach(([E, D, R]) => {
|
|
@@ -9919,7 +9919,7 @@ const Tt = {
|
|
|
9919
9919
|
throw new Error("INPUT_ERROR: startAfter and endBefore cannot be provided together");
|
|
9920
9920
|
const A = t.pagination.startAfter || t.pagination.endBefore;
|
|
9921
9921
|
if (t?.user) {
|
|
9922
|
-
const E =
|
|
9922
|
+
const E = ta(O.Role, p, m);
|
|
9923
9923
|
if (A && E !== !0)
|
|
9924
9924
|
throw new Error("INPUT_ERROR: Pagination is not allowed when using " + E);
|
|
9925
9925
|
}
|
|
@@ -9946,7 +9946,7 @@ const Tt = {
|
|
|
9946
9946
|
}
|
|
9947
9947
|
for (const A of a.values()) {
|
|
9948
9948
|
const E = [], D = [...A.Collection_Path, A.id];
|
|
9949
|
-
t?.subcollections && E.push(
|
|
9949
|
+
t?.subcollections && E.push(xo(
|
|
9950
9950
|
s,
|
|
9951
9951
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9952
9952
|
a.get(A.id),
|
|
@@ -10002,19 +10002,19 @@ const Tt = {
|
|
|
10002
10002
|
const R = ["read", A, A.id, Z];
|
|
10003
10003
|
await ae("postOperation", y, C, R), await ae("postRead", y, C, [Z, v, A, !1]);
|
|
10004
10004
|
}
|
|
10005
|
-
t?.user && await
|
|
10005
|
+
t?.user && await Xo(Array.from(a.values()), p, m, t.user, O);
|
|
10006
10006
|
};
|
|
10007
10007
|
return t?.providedTransaction ? await l(t.providedTransaction) : await r.runTransaction(async (c) => {
|
|
10008
10008
|
await l(c);
|
|
10009
10009
|
}, { readOnly: !0 }), { cursor: o, pages: i, docs: Array.from(a.values()) };
|
|
10010
|
-
},
|
|
10011
|
-
const l = s.at(-2), c =
|
|
10010
|
+
}, Do = async (n, e, t, s, r, i, o, a) => {
|
|
10011
|
+
const l = s.at(-2), c = di(i.collections[l], i).map((f) => f.labels.collection);
|
|
10012
10012
|
r.collections ? r.collections.forEach((f) => {
|
|
10013
10013
|
if (!c.includes(f))
|
|
10014
10014
|
throw new Error(`SCHEMA_ERROR: Collection ${f} not found in subcollections of ${l}`);
|
|
10015
10015
|
}) : r.collections = c;
|
|
10016
10016
|
const u = r.depth - 1, h = r.collections.map(async (f) => {
|
|
10017
|
-
const d = await
|
|
10017
|
+
const d = await Io([...s, f], r.constraints || [], {
|
|
10018
10018
|
user: a,
|
|
10019
10019
|
relations: o,
|
|
10020
10020
|
pagination: r.limit,
|
|
@@ -10025,12 +10025,12 @@ const Tt = {
|
|
|
10025
10025
|
t[f] = d.docs, u > 0 && await Promise.all(
|
|
10026
10026
|
// eslint-disable-next-line security/detect-object-injection
|
|
10027
10027
|
t[f].map(async (m) => {
|
|
10028
|
-
await
|
|
10028
|
+
await Do(n, e, m, [...s, f, m.id], { depth: u }, i, o, a);
|
|
10029
10029
|
})
|
|
10030
10030
|
);
|
|
10031
10031
|
});
|
|
10032
10032
|
await Promise.all(h);
|
|
10033
|
-
},
|
|
10033
|
+
}, Ao = async (n, e, t, s, r, i, o, a, l) => {
|
|
10034
10034
|
const c = s.at(-2);
|
|
10035
10035
|
i.fields ||= r.collections[c].fields.filter((f) => K(f));
|
|
10036
10036
|
const u = i.depth - 1, h = [];
|
|
@@ -10047,7 +10047,7 @@ const Tt = {
|
|
|
10047
10047
|
noEmbeddingFields: l
|
|
10048
10048
|
}).then((w) => {
|
|
10049
10049
|
if (d[m] = w, u > 0)
|
|
10050
|
-
return
|
|
10050
|
+
return Ao(
|
|
10051
10051
|
n,
|
|
10052
10052
|
e,
|
|
10053
10053
|
// eslint-disable-next-line security/detect-object-injection
|
|
@@ -10108,7 +10108,7 @@ const Tt = {
|
|
|
10108
10108
|
}
|
|
10109
10109
|
if (t?.user && (!T || !Te("Read", T)))
|
|
10110
10110
|
throw new Error("PERMISSION_DENIED");
|
|
10111
|
-
const C =
|
|
10111
|
+
const C = No(s, n, e, f, d);
|
|
10112
10112
|
if (C.length === 0)
|
|
10113
10113
|
throw new Error("PERMISSION_DENIED");
|
|
10114
10114
|
const v = {};
|
|
@@ -10121,7 +10121,7 @@ const Tt = {
|
|
|
10121
10121
|
} else
|
|
10122
10122
|
throw new Error(`NOT_FOUND: Document with ID ${e} does not exist at location ${n?.join("/") || N.collection}`);
|
|
10123
10123
|
const _ = [], A = n ? [...n, e] : [N.collection, e];
|
|
10124
|
-
if (t?.subcollections && _.push(
|
|
10124
|
+
if (t?.subcollections && _.push(Do(s, a, i, A, t.subcollections, f, void 0, t.user)), t?.relations && (t.relations.fields && (t.relations.fields = t.relations.fields.map((R) => {
|
|
10125
10125
|
if (typeof R == "string") {
|
|
10126
10126
|
const F = b.fields.find((M) => M.name === R);
|
|
10127
10127
|
if (F)
|
|
@@ -10129,7 +10129,7 @@ const Tt = {
|
|
|
10129
10129
|
throw new Error(`SCHEMA_ERROR: Field ${R} not found in collection ${O}`);
|
|
10130
10130
|
}
|
|
10131
10131
|
return R;
|
|
10132
|
-
})), _.push(
|
|
10132
|
+
})), _.push(Ao(s, a, i, A, f, t.relations, t.user, t.noComputedFields, t.noEmbeddingFields))), await Promise.all(_), !t?.noComputedFields) {
|
|
10133
10133
|
for (const R of b.fields)
|
|
10134
10134
|
if (R.type === "Computed") {
|
|
10135
10135
|
const F = Ie(R, p);
|
|
@@ -10150,12 +10150,12 @@ const Tt = {
|
|
|
10150
10150
|
(!P || !Q) && (K(M) ? (delete i[M.name], delete i[`${M.name}_Array`], delete i[`${M.name}_Single`]) : delete i[M.name]);
|
|
10151
10151
|
}
|
|
10152
10152
|
}
|
|
10153
|
-
await ae("postOperation", m, p, ["read", i, e, v]), await ae("postRead", m, p, [v, C, i, !1]), t?.user && await
|
|
10153
|
+
await ae("postOperation", m, p, ["read", i, e, v]), await ae("postRead", m, p, [v, C, i, !1]), t?.user && await Ko(i, b, f, t.user, d);
|
|
10154
10154
|
};
|
|
10155
10155
|
return t?.providedTransaction ? await o(t.providedTransaction) : await r.runTransaction(async (a) => {
|
|
10156
10156
|
await o(a);
|
|
10157
10157
|
}, { readOnly: !0 }), i;
|
|
10158
|
-
},
|
|
10158
|
+
}, Co = async (n, e, t, s, r, i, o, a) => {
|
|
10159
10159
|
const l = ue(), c = Je(r.labels.collection, i), u = r.labels.collection, h = r.fields.filter((d) => "unique" in d && d.unique), f = [];
|
|
10160
10160
|
if (await Promise.all(h.map(async (d) => {
|
|
10161
10161
|
{
|
|
@@ -10218,14 +10218,14 @@ ${i}`);
|
|
|
10218
10218
|
})()
|
|
10219
10219
|
]), r.length > 0)
|
|
10220
10220
|
throw new Error(r.join(", "));
|
|
10221
|
-
},
|
|
10222
|
-
const c = ue(), u =
|
|
10221
|
+
}, $o = async (n, e, t, s, r, i, o, a, l) => {
|
|
10222
|
+
const c = ue(), u = To(), h = process.env.ADMIN_EMAIL;
|
|
10223
10223
|
if (u === "development" || process.env.FIRESTORE_EMULATOR_HOST)
|
|
10224
10224
|
if (h)
|
|
10225
10225
|
n = h;
|
|
10226
10226
|
else
|
|
10227
10227
|
throw new Error("Admin email not set");
|
|
10228
|
-
const f = hs(n), d =
|
|
10228
|
+
const f = hs(n), d = Pc(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];
|
|
10229
10229
|
if (p.length === 0 || p.length === 1 && !p[0])
|
|
10230
10230
|
throw new Error("No valid email addresses provided");
|
|
10231
10231
|
const T = { to: f, message: { subject: d } };
|
|
@@ -10238,7 +10238,7 @@ ${i}`);
|
|
|
10238
10238
|
C.length > 0 && C[0] && (T.bcc = w);
|
|
10239
10239
|
}
|
|
10240
10240
|
b && (T.replyTo = b), a && (T.message.attachments = a), N && (T.from = N), await c.collection("system_mail").add(T);
|
|
10241
|
-
},
|
|
10241
|
+
}, Mo = async (n, e, t, s, r, i, o) => {
|
|
10242
10242
|
const a = gt(), l = ue(), c = "USER_ERROR", u = async (d, m) => {
|
|
10243
10243
|
try {
|
|
10244
10244
|
await un(d);
|
|
@@ -10295,7 +10295,7 @@ ${i}`);
|
|
|
10295
10295
|
if (d) {
|
|
10296
10296
|
const m = `https://${a.app.options.projectId}.firebaseapp.com/__/auth/action${d}`, O = await ie(t.appName), y = t?.mail?.emailVerification && t.mail.emailVerification(m, O);
|
|
10297
10297
|
try {
|
|
10298
|
-
await
|
|
10298
|
+
await $o(r.Email, y?.subject || "Please verify your email address", void 0, y?.html || `Please verify your email address by clicking the link:
|
|
10299
10299
|
</br>
|
|
10300
10300
|
</br>
|
|
10301
10301
|
<a href="${m}">${m}</a>`);
|
|
@@ -10318,14 +10318,14 @@ ${i}`);
|
|
|
10318
10318
|
throw new Error("PERMISSION_DENIED");
|
|
10319
10319
|
} else if (n.length > 1)
|
|
10320
10320
|
throw new Error("PERMISSION_DENIED");
|
|
10321
|
-
}, Wn = (n) => n !== null && typeof n == "object" && !Array.isArray(n),
|
|
10321
|
+
}, Wn = (n) => n !== null && typeof n == "object" && !Array.isArray(n), pu = (n) => {
|
|
10322
10322
|
const e = (t) => {
|
|
10323
10323
|
Object.entries(t).forEach(([s, r]) => {
|
|
10324
10324
|
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);
|
|
10325
10325
|
});
|
|
10326
10326
|
};
|
|
10327
10327
|
e(n);
|
|
10328
|
-
},
|
|
10328
|
+
}, Fo = (n) => {
|
|
10329
10329
|
const e = (t) => {
|
|
10330
10330
|
Object.entries(t).forEach(([s, r]) => {
|
|
10331
10331
|
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);
|
|
@@ -10336,7 +10336,7 @@ ${i}`);
|
|
|
10336
10336
|
if (typeof n == "object")
|
|
10337
10337
|
for (const e in n)
|
|
10338
10338
|
Object.prototype.hasOwnProperty.call(n, e) && (n[e] === "_DELETE_FIELD" ? n[e] = me.delete() : tr(n[e]));
|
|
10339
|
-
},
|
|
10339
|
+
}, Uc = (n, e, t) => {
|
|
10340
10340
|
if (K(t) && t.includeFields) {
|
|
10341
10341
|
const s = {};
|
|
10342
10342
|
return t.includeFields.forEach((r) => {
|
|
@@ -10370,12 +10370,12 @@ ${i}`);
|
|
|
10370
10370
|
delete e[n.name][t], e[`${n.name}_Array`] = e[`${n.name}_Array`]?.filter((s) => s !== t), delete e[`${n.name}_Single`];
|
|
10371
10371
|
}, ys = async (n, e, t, s, r) => {
|
|
10372
10372
|
e[n.name] ||= {}, e[n.name][s] = t, e[`${n.name}_Array`] ||= [], e[`${n.name}_Array`].push(s), r && (e[`${n.name}_Single`] = t);
|
|
10373
|
-
},
|
|
10373
|
+
}, Wc = (n, e, t, s, r, i) => {
|
|
10374
10374
|
const o = [], a = [];
|
|
10375
10375
|
for (const l of s.fields)
|
|
10376
10376
|
K(l) && l.twoWay && l.collection === t && ((n === "Create" || !i?.[l.name]?.[e]) && r[l.name]?.[e] && o.push(l), n === "Update" && i?.[l.name]?.[e] && !r[l.name]?.[e] && a.push(l));
|
|
10377
10377
|
return { addedFields: o, removedFields: a };
|
|
10378
|
-
},
|
|
10378
|
+
}, Po = async (n, e, t, s, r, i, o, a, l, c, u, h) => {
|
|
10379
10379
|
const { fields: f } = i, d = ue(), m = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map();
|
|
10380
10380
|
for (const w of f)
|
|
10381
10381
|
K(w) && ["OneToOne", "OneToMany"].includes(w.type) && w.enforceHierarchy && s[w.name] && (n === "Create" || n === "Update" && !ze(h?.[w.name], s[w.name])) && await ei(e, i, w, s, a, l);
|
|
@@ -10409,7 +10409,7 @@ ${i}`);
|
|
|
10409
10409
|
...x[N.name],
|
|
10410
10410
|
[t]: {
|
|
10411
10411
|
Collection_Path: s.Collection_Path,
|
|
10412
|
-
...
|
|
10412
|
+
...Uc(i, s, N)
|
|
10413
10413
|
}
|
|
10414
10414
|
};
|
|
10415
10415
|
x[N.name] = k, x[`${N.name}_Array`] ||= [], x[`${N.name}_Array`].push(t), p.size === 1 && (x[`${N.name}_Single`] = k), y.set(w.collection, {
|
|
@@ -10453,7 +10453,7 @@ ${i}`);
|
|
|
10453
10453
|
for (const [w, b] of y.entries()) {
|
|
10454
10454
|
const N = o.collections[w], p = Je(w, o);
|
|
10455
10455
|
for (const [T, C] of Object.entries(b)) {
|
|
10456
|
-
const { addedFields: v, removedFields: Z } =
|
|
10456
|
+
const { addedFields: v, removedFields: Z } = Wc(n, T, w, i, s, h);
|
|
10457
10457
|
if (c && u) {
|
|
10458
10458
|
for (const x of v) {
|
|
10459
10459
|
const g = W(N.fields, x.twoWay);
|
|
@@ -10527,7 +10527,7 @@ ${i}`);
|
|
|
10527
10527
|
}
|
|
10528
10528
|
}
|
|
10529
10529
|
return m;
|
|
10530
|
-
},
|
|
10530
|
+
}, Lo = (n, e, t) => {
|
|
10531
10531
|
n === "create" && pt.forEach((s) => {
|
|
10532
10532
|
if (!ze(e[s], t[s]))
|
|
10533
10533
|
throw new Error(`Updating system fields in hooks is not allowed: ${s}`);
|
|
@@ -10538,7 +10538,7 @@ ${i}`);
|
|
|
10538
10538
|
if (!["id", "Collection_Path", "Created_At", "Saved_At", "Created_By"].includes(s) && !ze(e[s], t[s]))
|
|
10539
10539
|
throw new Error(`Updating system fields in hooks is not allowed: ${s}`);
|
|
10540
10540
|
}));
|
|
10541
|
-
},
|
|
10541
|
+
}, Vo = (n, e, t, s) => {
|
|
10542
10542
|
const { softDelete: r } = e;
|
|
10543
10543
|
if (!r)
|
|
10544
10544
|
return;
|
|
@@ -10563,7 +10563,7 @@ ${i}`);
|
|
|
10563
10563
|
return !1;
|
|
10564
10564
|
}
|
|
10565
10565
|
return !0;
|
|
10566
|
-
},
|
|
10566
|
+
}, jc = 10, Zc = async (n, e) => {
|
|
10567
10567
|
if (n.length === 0)
|
|
10568
10568
|
return;
|
|
10569
10569
|
const t = Math.min(e, n.length);
|
|
@@ -10575,7 +10575,7 @@ ${i}`);
|
|
|
10575
10575
|
}
|
|
10576
10576
|
};
|
|
10577
10577
|
await Promise.all(Array.from({ length: t }, r));
|
|
10578
|
-
},
|
|
10578
|
+
}, Uo = async (n, e, t, s, r, i, o) => {
|
|
10579
10579
|
for (const [a, l] of Object.entries(e?.collections || {})) {
|
|
10580
10580
|
if (!r.collections[a])
|
|
10581
10581
|
throw new Error("PERMISSION_DENIED");
|
|
@@ -10624,10 +10624,10 @@ ${i}`);
|
|
|
10624
10624
|
}
|
|
10625
10625
|
}
|
|
10626
10626
|
}
|
|
10627
|
-
await
|
|
10627
|
+
await Zc(d, jc);
|
|
10628
10628
|
}
|
|
10629
10629
|
}
|
|
10630
|
-
},
|
|
10630
|
+
}, yu = async (n, e, t, s, r, i, o) => {
|
|
10631
10631
|
const a = Ye(), l = Ut();
|
|
10632
10632
|
let c = await Ge();
|
|
10633
10633
|
if (n.length === 0)
|
|
@@ -10639,19 +10639,19 @@ ${i}`);
|
|
|
10639
10639
|
let Z;
|
|
10640
10640
|
s && await er(n, d);
|
|
10641
10641
|
const x = De(p, n, a), g = o || x.doc().id;
|
|
10642
|
-
i = i || {}, i.collection = m.collection, e.id = g,
|
|
10642
|
+
i = i || {}, i.collection = m.collection, e.id = g, Fo(e), tr(e);
|
|
10643
10643
|
const k = Ws("create", n, e, c, N, "Online", s || "System", lt.now(), me.serverTimestamp()), _ = ye(k);
|
|
10644
|
-
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
|
|
10644
|
+
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 oa(k, d, b, v), Ve(k);
|
|
10645
10645
|
try {
|
|
10646
10646
|
if (d.auth && t && !t.password)
|
|
10647
10647
|
throw new Error("Password is required");
|
|
10648
|
-
await
|
|
10648
|
+
await Co("create", a, g, k, d, c), await sn("create", k, d, b, ["create", k, i], c);
|
|
10649
10649
|
} catch (P) {
|
|
10650
10650
|
throw new Error(`VALIDATION_ERROR: ${P.message}`);
|
|
10651
10651
|
}
|
|
10652
10652
|
Ve(k), e.id = g, w && (k[w.archivedField] = !1), Tn(d, k, c), Rn(d, k);
|
|
10653
10653
|
try {
|
|
10654
|
-
|
|
10654
|
+
Lo("create", k, _), Vo("create", d, k), await sn("create", k, d, b, ["create", k, i], c);
|
|
10655
10655
|
} catch (P) {
|
|
10656
10656
|
throw new Error(`VALIDATION_ERROR: ${P.message}`);
|
|
10657
10657
|
}
|
|
@@ -10714,13 +10714,13 @@ ${i}`);
|
|
|
10714
10714
|
throw new Error(`VALIDATION_ERROR: ${oe.name} "${k[oe.name]}" is invalid`);
|
|
10715
10715
|
}
|
|
10716
10716
|
});
|
|
10717
|
-
await Promise.all(pe), ir(k, g, d, c, s, Z, t?.permissions), t?.permissions && s && Z && await
|
|
10717
|
+
await Promise.all(pe), ir(k, g, d, c, s, Z, t?.permissions), t?.permissions && s && Z && await Uo(P, t.permissions, s, Z, c), ir(k, g, d, c, s, Z, t?.permissions);
|
|
10718
10718
|
};
|
|
10719
10719
|
if (d.auth && t) {
|
|
10720
10720
|
await p.runTransaction(async (j) => {
|
|
10721
10721
|
await D(j);
|
|
10722
10722
|
}, { maxAttempts: 10 });
|
|
10723
|
-
const P = await
|
|
10723
|
+
const P = await Mo(
|
|
10724
10724
|
a,
|
|
10725
10725
|
g,
|
|
10726
10726
|
l,
|
|
@@ -10735,7 +10735,7 @@ ${i}`);
|
|
|
10735
10735
|
try {
|
|
10736
10736
|
const P = { size: 1 };
|
|
10737
10737
|
await p.runTransaction(async (j) => {
|
|
10738
|
-
await D(j, P), r?.noTwoWay || await
|
|
10738
|
+
await D(j, P), r?.noTwoWay || await Po("Create", a, g, k, k, d, c, j, P, s, Z);
|
|
10739
10739
|
const Q = Us(c);
|
|
10740
10740
|
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);
|
|
10741
10741
|
}, { maxAttempts: 10 });
|
|
@@ -10782,7 +10782,7 @@ ${i}`);
|
|
|
10782
10782
|
}
|
|
10783
10783
|
if (l)
|
|
10784
10784
|
throw new Error(`ROLLBACK_FAILED: ${s}`);
|
|
10785
|
-
},
|
|
10785
|
+
}, zc = async (n, e, t, s, r, i, o, a, l, c, u) => {
|
|
10786
10786
|
const h = gt(), f = ue(), d = a?.customClaims || {}, m = "USER_ERROR";
|
|
10787
10787
|
let O = "";
|
|
10788
10788
|
if (n === "create") {
|
|
@@ -10791,7 +10791,7 @@ ${i}`);
|
|
|
10791
10791
|
if (!l)
|
|
10792
10792
|
throw new Error("VALIDATION_ERROR: Permissions are required");
|
|
10793
10793
|
try {
|
|
10794
|
-
O = await
|
|
10794
|
+
O = await Mo(e, t, s, r, i, l, u);
|
|
10795
10795
|
} catch (y) {
|
|
10796
10796
|
throw new Error(y.message);
|
|
10797
10797
|
}
|
|
@@ -10838,7 +10838,7 @@ ${i}`);
|
|
|
10838
10838
|
if (b) {
|
|
10839
10839
|
const N = `https://${h.app.options.projectId}.firebaseapp.com/__/auth/action${b}`, p = await ie(s.appName), T = s?.mail?.emailVerification && s.mail.emailVerification(N, p);
|
|
10840
10840
|
try {
|
|
10841
|
-
await
|
|
10841
|
+
await $o(i.Email, T?.subject || "Please verify your email address", void 0, T?.html || `Please verify your email address by clicking the link:
|
|
10842
10842
|
</br>
|
|
10843
10843
|
</br>
|
|
10844
10844
|
<a href="${N}">${N}</a>`);
|
|
@@ -10856,7 +10856,7 @@ ${i}`);
|
|
|
10856
10856
|
}
|
|
10857
10857
|
if (O)
|
|
10858
10858
|
return O;
|
|
10859
|
-
},
|
|
10859
|
+
}, qc = async (n, e, t) => {
|
|
10860
10860
|
const s = Ye(), r = ue(), i = [e];
|
|
10861
10861
|
t && t.trim() !== "" && i.push(t), i.sort();
|
|
10862
10862
|
const o = [];
|
|
@@ -10877,7 +10877,7 @@ ${i}`);
|
|
|
10877
10877
|
i.delete(a);
|
|
10878
10878
|
}
|
|
10879
10879
|
await i.commit();
|
|
10880
|
-
},
|
|
10880
|
+
}, Bc = async (n, e, t, s, r, i, o) => {
|
|
10881
10881
|
const a = Ye(), l = Ut();
|
|
10882
10882
|
let c = await Ge(!0);
|
|
10883
10883
|
if (n.length === 0)
|
|
@@ -10913,7 +10913,7 @@ ${i}`);
|
|
|
10913
10913
|
if (s?.operation === "delete" && s.permissions)
|
|
10914
10914
|
throw new Error("VALIDATION_ERROR: Permissions are not allowed for delete operations");
|
|
10915
10915
|
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);
|
|
10916
|
-
delete t.id,
|
|
10916
|
+
delete t.id, Fo(t), tr(t);
|
|
10917
10917
|
const _ = Ws("update", n, t, c, b, "Online", r || "System", lt.now(), me.serverTimestamp()), A = ye(_);
|
|
10918
10918
|
for (const S of O)
|
|
10919
10919
|
!K(S) && Me(_[S.name]) && S.nullable && (_[S.name] = null);
|
|
@@ -10933,7 +10933,7 @@ ${i}`);
|
|
|
10933
10933
|
if (Z && !s.password)
|
|
10934
10934
|
throw new Error("Password is required");
|
|
10935
10935
|
const S = { ...v, ..._ };
|
|
10936
|
-
await
|
|
10936
|
+
await Co("update", a, e, S, d, c), nt(S), await sn("update", S, d, w, ["update", _, o, void 0, ye(v)], c);
|
|
10937
10937
|
} catch (S) {
|
|
10938
10938
|
throw new Error(`VALIDATION_ERROR: ${S.message}`);
|
|
10939
10939
|
}
|
|
@@ -10942,7 +10942,7 @@ ${i}`);
|
|
|
10942
10942
|
!K(S) && Me(_[S.name]) && S.nullable && (_[S.name] = null);
|
|
10943
10943
|
try {
|
|
10944
10944
|
const S = { ...v, ..._ };
|
|
10945
|
-
nt(S),
|
|
10945
|
+
nt(S), Vo("update", d, _, v), Lo("update", _, A), await sn("update", S, d, w, ["update", _, o, void 0, v], c);
|
|
10946
10946
|
} catch (S) {
|
|
10947
10947
|
throw new Error(`VALIDATION_ERROR: ${S.message}`);
|
|
10948
10948
|
}
|
|
@@ -10979,7 +10979,7 @@ ${i}`);
|
|
|
10979
10979
|
if (!T.Enabled)
|
|
10980
10980
|
throw new Error("PERMISSION_DENIED");
|
|
10981
10981
|
}
|
|
10982
|
-
if (B && (B.size +=
|
|
10982
|
+
if (B && (B.size += No(a, n, e, c, T).length), Z && v.User_ID || x && !v.User_ID)
|
|
10983
10983
|
throw new Error("USER_ERROR");
|
|
10984
10984
|
if (k(v)) {
|
|
10985
10985
|
const de = await S.get(p.collection("tenants").doc(a).collection("system_user_permissions").doc(v.User_ID));
|
|
@@ -11027,7 +11027,7 @@ ${i}`);
|
|
|
11027
11027
|
throw new Error("PERMISSION_DENIED");
|
|
11028
11028
|
}
|
|
11029
11029
|
}
|
|
11030
|
-
or(_, v, e, d, c, r, T, s?.operation ? s.operation : g ? "update" : void 0, s?.permissions, R), s?.permissions && r && T && await
|
|
11030
|
+
or(_, v, e, d, c, r, T, s?.operation ? s.operation : g ? "update" : void 0, s?.permissions, R), s?.permissions && r && T && await Uo(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 qc(S, e, v.User_ID);
|
|
11031
11031
|
};
|
|
11032
11032
|
(Z || g || x) && await p.runTransaction(async (S) => {
|
|
11033
11033
|
await F(S, !0);
|
|
@@ -11043,7 +11043,7 @@ ${i}`);
|
|
|
11043
11043
|
}
|
|
11044
11044
|
const q = { ...v, ..._ };
|
|
11045
11045
|
nt(q);
|
|
11046
|
-
const B = await
|
|
11046
|
+
const B = await zc(s?.operation || "update", a, e, l, m.collection, q, v, S, s?.permissions, R, s?.password);
|
|
11047
11047
|
Z && (_.User_ID = B), x && (_.User_ID = me.delete());
|
|
11048
11048
|
}
|
|
11049
11049
|
try {
|
|
@@ -11052,7 +11052,7 @@ ${i}`);
|
|
|
11052
11052
|
const re = { ...v, ..._ };
|
|
11053
11053
|
await F(B, !1, q);
|
|
11054
11054
|
let Qe;
|
|
11055
|
-
i?.noTwoWay || (Qe = await
|
|
11055
|
+
i?.noTwoWay || (Qe = await Po("Update", a, e, re, _, d, c, B, q, r, T, v));
|
|
11056
11056
|
const Wt = Us(c);
|
|
11057
11057
|
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), _);
|
|
11058
11058
|
}, { maxAttempts: 10 });
|
|
@@ -11084,7 +11084,7 @@ ${i}`);
|
|
|
11084
11084
|
await ae("postWrite", l, w, M), await ae("postOperation", l, w, P);
|
|
11085
11085
|
const j = { ...v, ..._ };
|
|
11086
11086
|
return nt(j), { id: e, ...j };
|
|
11087
|
-
},
|
|
11087
|
+
}, gu = async (n, e, t, s, r) => {
|
|
11088
11088
|
const i = Ye(), o = Ut();
|
|
11089
11089
|
let a = await Ge();
|
|
11090
11090
|
if (n.length === 0)
|
|
@@ -11094,7 +11094,7 @@ ${i}`);
|
|
|
11094
11094
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11095
11095
|
const h = a.collections[l], { labels: f, auth: d, enableWriteLog: m, softDelete: O } = h, y = Je(f.collection, a), w = await ie(o.appName);
|
|
11096
11096
|
if (O && !d && !s?.force)
|
|
11097
|
-
return await
|
|
11097
|
+
return await Bc(n, e, { [O.archivedField]: !0, [O.timestampField]: me.serverTimestamp() }, void 0, t);
|
|
11098
11098
|
const b = ue();
|
|
11099
11099
|
let N;
|
|
11100
11100
|
t && await er(n, h);
|
|
@@ -11124,7 +11124,7 @@ ${i}`);
|
|
|
11124
11124
|
throw new Error("USER_ERROR");
|
|
11125
11125
|
if (!N.Enabled)
|
|
11126
11126
|
throw new Error("PERMISSION_DENIED");
|
|
11127
|
-
|
|
11127
|
+
Qo(C, e, h, a, t, N);
|
|
11128
11128
|
}
|
|
11129
11129
|
if (t && N?.Role) {
|
|
11130
11130
|
const j = N.Role;
|
|
@@ -11150,8 +11150,8 @@ ${i}`);
|
|
|
11150
11150
|
}
|
|
11151
11151
|
const k = ["delete", C, e, r], _ = [...k];
|
|
11152
11152
|
return await ae("postWrite", o, y, k), await ae("postOperation", o, y, _), { id: e, ...C };
|
|
11153
|
-
},
|
|
11154
|
-
const t = ue(), s =
|
|
11153
|
+
}, wu = async (n, e) => {
|
|
11154
|
+
const t = ue(), s = To(), r = process.env.ADMIN_SMS;
|
|
11155
11155
|
if (s === "development")
|
|
11156
11156
|
if (r)
|
|
11157
11157
|
n = r;
|
|
@@ -11159,73 +11159,73 @@ ${i}`);
|
|
|
11159
11159
|
throw new Error("Admin phone not set");
|
|
11160
11160
|
const i = { to: n, body: e };
|
|
11161
11161
|
await t.collection("system_messages").add(i);
|
|
11162
|
-
},
|
|
11162
|
+
}, Hc = (n) => n !== null && typeof n == "object", _u = (n) => {
|
|
11163
11163
|
const e = (t) => {
|
|
11164
11164
|
Object.entries(t).forEach(([s, r]) => {
|
|
11165
11165
|
r instanceof lt ? t[s] = {
|
|
11166
11166
|
_seconds: r.seconds,
|
|
11167
11167
|
_nanoseconds: r.nanoseconds
|
|
11168
|
-
} :
|
|
11168
|
+
} : Hc(r) && e(r);
|
|
11169
11169
|
});
|
|
11170
11170
|
};
|
|
11171
11171
|
e(n);
|
|
11172
|
-
},
|
|
11173
|
-
const e =
|
|
11172
|
+
}, Eu = async (n) => await gt().getUser(n), vu = (n) => {
|
|
11173
|
+
const e = Ro();
|
|
11174
11174
|
return V.fromJSDate(n).setZone(e);
|
|
11175
|
-
},
|
|
11176
|
-
const e =
|
|
11175
|
+
}, Gc = (n) => {
|
|
11176
|
+
const e = Ro();
|
|
11177
11177
|
return V.fromJSDate(n.toDate()).setZone(e);
|
|
11178
|
-
},
|
|
11178
|
+
}, Ou = (n, e) => {
|
|
11179
11179
|
const s = V.fromJSDate(n, { zone: e }).offset, i = V.fromJSDate(n).offset, o = s - i;
|
|
11180
11180
|
return V.fromJSDate(n).plus({ minutes: o }).toJSDate();
|
|
11181
|
-
},
|
|
11181
|
+
}, ku = (n, e) => {
|
|
11182
11182
|
const s = V.fromJSDate(n, { zone: e }).offset, i = V.fromJSDate(n).offset, o = s - i;
|
|
11183
11183
|
return V.fromJSDate(n).minus({ minutes: o }).toJSDate();
|
|
11184
|
-
},
|
|
11184
|
+
}, bu = (n) => "seconds" in n && "nanoseconds" in n ? Gc(new lt(n.seconds, n.nanoseconds)).toFormat("MMMM d, yyyy '@' h:mm a") : "";
|
|
11185
11185
|
export {
|
|
11186
|
-
|
|
11187
|
-
|
|
11188
|
-
|
|
11189
|
-
|
|
11190
|
-
|
|
11186
|
+
yu as addRecord,
|
|
11187
|
+
Mo as addUser,
|
|
11188
|
+
vu as convertDateToTimezone,
|
|
11189
|
+
Gc as convertTimestampToTimezone,
|
|
11190
|
+
gu as deleteRecord,
|
|
11191
11191
|
un as deleteUser,
|
|
11192
11192
|
tr as deserializeDeleteSentinels,
|
|
11193
|
-
|
|
11194
|
-
|
|
11195
|
-
|
|
11193
|
+
Fo as deserializeTimestamps,
|
|
11194
|
+
pu as deserializeTimestampsWithoutUnderscores,
|
|
11195
|
+
bu as displayDate,
|
|
11196
11196
|
Ge as fetchCurrentSchema,
|
|
11197
|
-
|
|
11198
|
-
|
|
11199
|
-
|
|
11197
|
+
mu as fetchLastSchema,
|
|
11198
|
+
ou as getCachedConfigValue,
|
|
11199
|
+
Vc as getCollectionRefs,
|
|
11200
11200
|
Je as getCustomizationFile,
|
|
11201
|
-
|
|
11202
|
-
|
|
11201
|
+
Lc as getCustomizationFiles,
|
|
11202
|
+
No as getDocumentRefs,
|
|
11203
11203
|
De as getFirestorePathRef,
|
|
11204
11204
|
Ut as getGlobalConfigModule,
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11205
|
+
au as getInputSchema,
|
|
11206
|
+
du as getMaintenanceInfo,
|
|
11207
|
+
To as getMode,
|
|
11208
11208
|
at as getOne,
|
|
11209
|
-
|
|
11209
|
+
Io as getSome,
|
|
11210
11210
|
Ye as getTenant,
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11211
|
+
Ro as getTimezone,
|
|
11212
|
+
Eu as getUser,
|
|
11213
|
+
uu as getVersionInfo,
|
|
11214
|
+
Ma as getZodSchema,
|
|
11215
|
+
hu as initializeFirebase,
|
|
11216
|
+
lu as initializeStoker,
|
|
11217
11217
|
Me as isDeleteSentinel,
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
|
|
11218
|
+
Ou as keepTimezone,
|
|
11219
|
+
ku as removeTimezone,
|
|
11220
|
+
fu as runChildProcess,
|
|
11221
|
+
$o as sendMail,
|
|
11222
|
+
wu as sendMessage,
|
|
11223
|
+
_u as serializeTimestamps,
|
|
11224
|
+
cu as setTenant,
|
|
11225
11225
|
ie as tryPromise,
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11226
|
+
Bc as updateRecord,
|
|
11227
|
+
zc as updateUser,
|
|
11228
|
+
Po as validateRelations,
|
|
11229
|
+
Vo as validateSoftDelete,
|
|
11230
11230
|
Mt as writeLog
|
|
11231
11231
|
};
|