@stoker-platform/web-client 0.2.7 → 0.2.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.js +692 -688
- package/package.json +4 -4
package/dist/bundle.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { getApp as nt, registerVersion as
|
|
2
|
-
import { isSupported as
|
|
3
|
-
import { getAuth as fr, validatePassword as pd, initializeAuth as vc, indexedDBLocalPersistence as
|
|
4
|
-
import { getDatabase as gd, onValue as
|
|
5
|
-
import { getFirestore as je, where as ge, query as pe, collection as Mr, and as Jr, or as Ec, onSnapshot as dr, doc as Ae, Timestamp as zt, setDoc as
|
|
1
|
+
import { getApp as nt, registerVersion as km, initializeApp as Vn, setLogLevel as Yr, onLog as Im } from "firebase/app";
|
|
2
|
+
import { isSupported as xm, initializeAnalytics as Nm, setConsent as Fm } from "firebase/analytics";
|
|
3
|
+
import { getAuth as fr, validatePassword as pd, initializeAuth as vc, indexedDBLocalPersistence as Dm, browserLocalPersistence as Mm, browserSessionPersistence as wc, inMemoryPersistence as bc, beforeAuthStateChanged as Pm, connectAuthEmulator as qm, onAuthStateChanged as Wn, getIdTokenResult as Lm, signOut as yd, signInWithEmailAndPassword as $m, getMultiFactorResolver as jm, TotpMultiFactorGenerator as Ja, signInWithCustomToken as Um, multiFactor as Oc } from "firebase/auth";
|
|
4
|
+
import { getDatabase as gd, onValue as Vm, ref as Wm, connectDatabaseEmulator as zm } from "firebase/database";
|
|
5
|
+
import { getFirestore as je, where as ge, query as pe, collection as Mr, and as Jr, or as Ec, onSnapshot as dr, doc as Ae, Timestamp as zt, setDoc as Bm, getDoc as _d, orderBy as et, limit as Xt, startAfter as Qa, endBefore as Xa, limitToLast as Ir, getDocsFromCache as vd, getDocsFromServer as Zm, getDocs as Gm, getCountFromServer as wd, getDocFromCache as Hm, getDocFromServer as Km, writeBatch as Ro, serverTimestamp as Pr, deleteField as Tn, arrayRemove as Ao, arrayUnion as Co, collectionGroup as Ym, connectFirestoreEmulator as Sc, persistentLocalCache as Tc, persistentSingleTabManager as Rc, persistentMultipleTabManager as Ac, memoryEagerGarbageCollector as Jm, memoryLruGarbageCollector as Qm, memoryLocalCache as Xm, initializeFirestore as zn, getPersistentCacheIndexManager as ep, enablePersistentCacheIndexAutoCreation as tp, terminate as rp, clearIndexedDbPersistence as Cc, waitForPendingWrites as np, onSnapshotsInSync as bd, startAt as sp, endAt as ip, addDoc as Od } from "firebase/firestore";
|
|
6
6
|
import { connectStorageEmulator as ap, getStorage as op } from "firebase/storage";
|
|
7
7
|
import { getFunctions as $e, httpsCallable as Ke, connectFunctionsEmulator as cp } from "firebase/functions";
|
|
8
8
|
import { ReCaptchaEnterpriseProvider as lp, initializeAppCheck as Bn, onTokenChanged as Zn } from "firebase/app-check";
|
|
9
9
|
import { getPerformance as up } from "firebase/performance";
|
|
10
10
|
import { getRemoteConfig as fp, fetchAndActivate as dp } from "firebase/remote-config";
|
|
11
|
-
const hp = "0.2.
|
|
11
|
+
const hp = "0.2.9", mp = (r) => !!r.auth, _t = (r, e) => {
|
|
12
12
|
if (e?.operations)
|
|
13
13
|
return e.operations.includes(r);
|
|
14
|
-
}, Rn = (r, e) => e ? e.Role ? r.access?.includes(e.Role) : !1 : !0, pp = (r, e) => r.restrictCreate === !0 ? !1 : e && typeof r.restrictCreate == "object" ? e.Role ? r.restrictCreate?.includes(e.Role) : !1 : !0, yp = (r, e) => r.restrictUpdate === !0 ? !1 : e && typeof r.restrictUpdate == "object" ? e.Role ? r.restrictUpdate?.includes(e.Role) : !1 : !0, re = (r, e) => r.filter((t) => t.name === e)[0], _e = (r) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(r.type),
|
|
14
|
+
}, Rn = (r, e) => e ? e.Role ? r.access?.includes(e.Role) : !1 : !0, pp = (r, e) => r.restrictCreate === !0 ? !1 : e && typeof r.restrictCreate == "object" ? e.Role ? r.restrictCreate?.includes(e.Role) : !1 : !0, yp = (r, e) => r.restrictUpdate === !0 ? !1 : e && typeof r.restrictUpdate == "object" ? e.Role ? r.restrictUpdate?.includes(e.Role) : !1 : !0, re = (r, e) => r.filter((t) => t.name === e)[0], _e = (r) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(r.type), Ed = (r, e) => {
|
|
15
15
|
const t = {
|
|
16
16
|
Record_Owner: "recordOwner",
|
|
17
17
|
Record_User: "recordUser",
|
|
@@ -30,7 +30,7 @@ const hp = "0.2.7", mp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
30
30
|
c.role === e.Role && (!i.assignable?.includes(e.Role) || a?.restrictEntities) && t.push(o);
|
|
31
31
|
});
|
|
32
32
|
}), t;
|
|
33
|
-
},
|
|
33
|
+
}, Sd = (r, e, t) => {
|
|
34
34
|
const n = [], { access: s } = r, { entityRestrictions: i } = s;
|
|
35
35
|
return i?.parentFilters?.forEach((a) => {
|
|
36
36
|
if (!a.roles.some((h) => h.role === t.Role))
|
|
@@ -65,7 +65,7 @@ const hp = "0.2.7", mp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
65
65
|
c = !1;
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
const l =
|
|
68
|
+
const l = Ed(e, s), u = ko(e, s), f = Sd(e, t, s);
|
|
69
69
|
l?.filter((w) => w.type === "Record_Owner").forEach((w) => {
|
|
70
70
|
"operations" in w && w.operations && !w.operations.includes(r) || i.Created_By !== n && (c = !1);
|
|
71
71
|
}), l?.filter((w) => w.type === "Record_User").forEach((w) => {
|
|
@@ -92,8 +92,8 @@ const hp = "0.2.7", mp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
92
92
|
v = !0;
|
|
93
93
|
const E = re(a, w.collectionField), I = re(a, w.propertyField);
|
|
94
94
|
Object.entries(o.parentPropertyEntities || {}).some((T) => {
|
|
95
|
-
const [
|
|
96
|
-
return
|
|
95
|
+
const [g, N] = T;
|
|
96
|
+
return g === i[I.name] && i[`${E.name}_Array`].some((_) => N.includes(_));
|
|
97
97
|
}) || (p = !1);
|
|
98
98
|
}), h && v) {
|
|
99
99
|
if (!(d || p)) {
|
|
@@ -104,7 +104,7 @@ const hp = "0.2.7", mp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
104
104
|
c = !1;
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
|
-
let
|
|
107
|
+
let y = !0, O = !1;
|
|
108
108
|
f?.filter((w) => w.parentFilter.type === "Individual").forEach((w) => {
|
|
109
109
|
O = !0;
|
|
110
110
|
const { parentFilter: E } = w, I = re(a, E.collectionField), T = s.collections?.[I.collection];
|
|
@@ -112,34 +112,34 @@ const hp = "0.2.7", mp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
112
112
|
c = !1;
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
T.individualEntities?.some((
|
|
115
|
+
T.individualEntities?.some((g) => i[`${I.name}_Array`].includes(g)) || (y = !1);
|
|
116
116
|
});
|
|
117
117
|
let R = !0, C = !1;
|
|
118
118
|
if (f?.filter((w) => w.parentFilter.type === "Parent").forEach((w) => {
|
|
119
119
|
C = !0;
|
|
120
|
-
const { parentFilter: E } = w, I = re(a, E.collectionField), T = re(a, E.parentCollectionField),
|
|
121
|
-
if (!
|
|
120
|
+
const { parentFilter: E } = w, I = re(a, E.collectionField), T = re(a, E.parentCollectionField), g = s.collections?.[I.collection];
|
|
121
|
+
if (!g) {
|
|
122
122
|
c = !1;
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
-
|
|
125
|
+
g.parentEntities?.some((N) => i[`${T.name}_Array`].includes(N)) || (R = !1);
|
|
126
126
|
}), f?.filter((w) => w.parentFilter.type === "Parent_Property").forEach((w) => {
|
|
127
127
|
C = !0;
|
|
128
|
-
const { parentFilter: E } = w, I = re(a, E.collectionField), T = re(a, E.parentPropertyField),
|
|
128
|
+
const { parentFilter: E } = w, I = re(a, E.collectionField), T = re(a, E.parentPropertyField), g = re(a, E.parentCollectionField), N = s.collections?.[I.collection];
|
|
129
129
|
if (!N) {
|
|
130
130
|
c = !1;
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
|
-
Object.entries(N.parentPropertyEntities || {}).some((
|
|
134
|
-
const [A, b] =
|
|
135
|
-
return A === i[T.name] && i[`${
|
|
133
|
+
Object.entries(N.parentPropertyEntities || {}).some((_) => {
|
|
134
|
+
const [A, b] = _;
|
|
135
|
+
return A === i[T.name] && i[`${g.name}_Array`].some((m) => b.includes(m));
|
|
136
136
|
}) || (R = !1);
|
|
137
137
|
}), O && C) {
|
|
138
|
-
if (!(
|
|
138
|
+
if (!(y || R)) {
|
|
139
139
|
c = !1;
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
|
-
} else if (!
|
|
142
|
+
} else if (!y || !R) {
|
|
143
143
|
c = !1;
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
@@ -164,7 +164,7 @@ const hp = "0.2.7", mp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
164
164
|
(!t || _t("Read", a) || An(r, e, t)) && n.push(s.collection);
|
|
165
165
|
}
|
|
166
166
|
return Array.from(new Set(n));
|
|
167
|
-
},
|
|
167
|
+
}, Td = (r, e, t) => {
|
|
168
168
|
const { labels: n } = r, s = [];
|
|
169
169
|
for (const i of Object.values(e.collections)) {
|
|
170
170
|
const a = t?.collections?.[i.labels.collection];
|
|
@@ -306,7 +306,7 @@ function Rp() {
|
|
|
306
306
|
return ss = r, ss;
|
|
307
307
|
}
|
|
308
308
|
var is, Uc;
|
|
309
|
-
function
|
|
309
|
+
function Rd() {
|
|
310
310
|
if (Uc) return is;
|
|
311
311
|
Uc = 1;
|
|
312
312
|
var r = typeof Qr == "object" && Qr && Qr.Object === Object && Qr;
|
|
@@ -316,7 +316,7 @@ var as, Vc;
|
|
|
316
316
|
function ct() {
|
|
317
317
|
if (Vc) return as;
|
|
318
318
|
Vc = 1;
|
|
319
|
-
var r =
|
|
319
|
+
var r = Rd(), e = typeof self == "object" && self && self.Object === Object && self, t = r || e || Function("return this")();
|
|
320
320
|
return as = t, as;
|
|
321
321
|
}
|
|
322
322
|
var os, Wc;
|
|
@@ -407,7 +407,7 @@ function Ip() {
|
|
|
407
407
|
return ms = t, ms;
|
|
408
408
|
}
|
|
409
409
|
var ps, Jc;
|
|
410
|
-
function
|
|
410
|
+
function Ad() {
|
|
411
411
|
if (Jc) return ps;
|
|
412
412
|
Jc = 1;
|
|
413
413
|
var r = Function.prototype, e = r.toString;
|
|
@@ -430,7 +430,7 @@ var ys, Qc;
|
|
|
430
430
|
function xp() {
|
|
431
431
|
if (Qc) return ys;
|
|
432
432
|
Qc = 1;
|
|
433
|
-
var r = Io(), e = Ip(), t = vt(), n =
|
|
433
|
+
var r = Io(), e = Ip(), t = vt(), n = Ad(), s = /[\\^$.*+?()[\]{}|]/g, i = /^\[object .+?Constructor\]$/, a = Function.prototype, o = Object.prototype, c = a.toString, l = o.hasOwnProperty, u = RegExp(
|
|
434
434
|
"^" + c.call(l).replace(s, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
435
435
|
);
|
|
436
436
|
function f(d) {
|
|
@@ -718,7 +718,7 @@ function Yp() {
|
|
|
718
718
|
return Us = r, Us;
|
|
719
719
|
}
|
|
720
720
|
var Vs, Sl;
|
|
721
|
-
function
|
|
721
|
+
function Cd() {
|
|
722
722
|
if (Sl) return Vs;
|
|
723
723
|
Sl = 1;
|
|
724
724
|
var r = Hp(), e = Kp(), t = Yp(), n = 1, s = 2;
|
|
@@ -726,9 +726,9 @@ function Id() {
|
|
|
726
726
|
var d = c & n, h = a.length, p = o.length;
|
|
727
727
|
if (h != p && !(d && p > h))
|
|
728
728
|
return !1;
|
|
729
|
-
var v = f.get(a),
|
|
730
|
-
if (v &&
|
|
731
|
-
return v == o &&
|
|
729
|
+
var v = f.get(a), y = f.get(o);
|
|
730
|
+
if (v && y)
|
|
731
|
+
return v == o && y == a;
|
|
732
732
|
var O = -1, R = !0, C = c & s ? new r() : void 0;
|
|
733
733
|
for (f.set(a, o), f.set(o, a); ++O < h; ) {
|
|
734
734
|
var w = a[O], E = o[O];
|
|
@@ -741,9 +741,9 @@ function Id() {
|
|
|
741
741
|
break;
|
|
742
742
|
}
|
|
743
743
|
if (C) {
|
|
744
|
-
if (!e(o, function(T,
|
|
745
|
-
if (!t(C,
|
|
746
|
-
return C.push(
|
|
744
|
+
if (!e(o, function(T, g) {
|
|
745
|
+
if (!t(C, g) && (w === T || u(w, T, c, l, f)))
|
|
746
|
+
return C.push(g);
|
|
747
747
|
})) {
|
|
748
748
|
R = !1;
|
|
749
749
|
break;
|
|
@@ -758,7 +758,7 @@ function Id() {
|
|
|
758
758
|
return Vs = i, Vs;
|
|
759
759
|
}
|
|
760
760
|
var Ws, Tl;
|
|
761
|
-
function
|
|
761
|
+
function kd() {
|
|
762
762
|
if (Tl) return Ws;
|
|
763
763
|
Tl = 1;
|
|
764
764
|
var r = ct(), e = r.Uint8Array;
|
|
@@ -792,9 +792,9 @@ var Zs, Cl;
|
|
|
792
792
|
function Xp() {
|
|
793
793
|
if (Cl) return Zs;
|
|
794
794
|
Cl = 1;
|
|
795
|
-
var r = Ur(), e =
|
|
796
|
-
function E(I, T,
|
|
797
|
-
switch (
|
|
795
|
+
var r = Ur(), e = kd(), t = jr(), n = Cd(), s = Jp(), i = Qp(), a = 1, o = 2, c = "[object Boolean]", l = "[object Date]", u = "[object Error]", f = "[object Map]", d = "[object Number]", h = "[object RegExp]", p = "[object Set]", v = "[object String]", y = "[object Symbol]", O = "[object ArrayBuffer]", R = "[object DataView]", C = r ? r.prototype : void 0, w = C ? C.valueOf : void 0;
|
|
796
|
+
function E(I, T, g, N, _, A, b) {
|
|
797
|
+
switch (g) {
|
|
798
798
|
case R:
|
|
799
799
|
if (I.byteLength != T.byteLength || I.byteOffset != T.byteOffset)
|
|
800
800
|
return !1;
|
|
@@ -820,9 +820,9 @@ function Xp() {
|
|
|
820
820
|
if (k)
|
|
821
821
|
return k == T;
|
|
822
822
|
N |= o, b.set(I, T);
|
|
823
|
-
var D = n(m(I), m(T), N,
|
|
823
|
+
var D = n(m(I), m(T), N, _, A, b);
|
|
824
824
|
return b.delete(I), D;
|
|
825
|
-
case
|
|
825
|
+
case y:
|
|
826
826
|
if (w)
|
|
827
827
|
return w.call(I) == w.call(T);
|
|
828
828
|
}
|
|
@@ -831,7 +831,7 @@ function Xp() {
|
|
|
831
831
|
return Zs = E, Zs;
|
|
832
832
|
}
|
|
833
833
|
var Gs, kl;
|
|
834
|
-
function
|
|
834
|
+
function Id() {
|
|
835
835
|
if (kl) return Gs;
|
|
836
836
|
kl = 1;
|
|
837
837
|
function r(e, t) {
|
|
@@ -849,10 +849,10 @@ function Dt() {
|
|
|
849
849
|
return Hs = r, Hs;
|
|
850
850
|
}
|
|
851
851
|
var Ks, xl;
|
|
852
|
-
function
|
|
852
|
+
function xd() {
|
|
853
853
|
if (xl) return Ks;
|
|
854
854
|
xl = 1;
|
|
855
|
-
var r =
|
|
855
|
+
var r = Id(), e = Dt();
|
|
856
856
|
function t(n, s, i) {
|
|
857
857
|
var a = s(n);
|
|
858
858
|
return e(n) ? a : r(a, i(n));
|
|
@@ -873,7 +873,7 @@ function ey() {
|
|
|
873
873
|
return Ys = r, Ys;
|
|
874
874
|
}
|
|
875
875
|
var Js, Fl;
|
|
876
|
-
function
|
|
876
|
+
function Nd() {
|
|
877
877
|
if (Fl) return Js;
|
|
878
878
|
Fl = 1;
|
|
879
879
|
function r() {
|
|
@@ -885,7 +885,7 @@ var Qs, Dl;
|
|
|
885
885
|
function Do() {
|
|
886
886
|
if (Dl) return Qs;
|
|
887
887
|
Dl = 1;
|
|
888
|
-
var r = ey(), e =
|
|
888
|
+
var r = ey(), e = Nd(), t = Object.prototype, n = t.propertyIsEnumerable, s = Object.getOwnPropertySymbols, i = s ? function(a) {
|
|
889
889
|
return a == null ? [] : (a = Object(a), r(s(a), function(o) {
|
|
890
890
|
return n.call(a, o);
|
|
891
891
|
}));
|
|
@@ -923,7 +923,7 @@ function ry() {
|
|
|
923
923
|
return ti = n, ti;
|
|
924
924
|
}
|
|
925
925
|
var ri, Ll;
|
|
926
|
-
function
|
|
926
|
+
function Fd() {
|
|
927
927
|
if (Ll) return ri;
|
|
928
928
|
Ll = 1;
|
|
929
929
|
var r = ry(), e = wt(), t = Object.prototype, n = t.hasOwnProperty, s = t.propertyIsEnumerable, i = r(/* @__PURE__ */ (function() {
|
|
@@ -962,7 +962,7 @@ function Mo() {
|
|
|
962
962
|
return si = t, si;
|
|
963
963
|
}
|
|
964
964
|
var ii, Vl;
|
|
965
|
-
function
|
|
965
|
+
function Dd() {
|
|
966
966
|
if (Vl) return ii;
|
|
967
967
|
Vl = 1;
|
|
968
968
|
var r = 9007199254740991;
|
|
@@ -975,8 +975,8 @@ var ai, Wl;
|
|
|
975
975
|
function sy() {
|
|
976
976
|
if (Wl) return ai;
|
|
977
977
|
Wl = 1;
|
|
978
|
-
var r = hr(), e =
|
|
979
|
-
A[R] = A[C] = A[w] = A[E] = A[I] = A[T] = A[
|
|
978
|
+
var r = hr(), e = Dd(), t = wt(), n = "[object Arguments]", s = "[object Array]", i = "[object Boolean]", a = "[object Date]", o = "[object Error]", c = "[object Function]", l = "[object Map]", u = "[object Number]", f = "[object Object]", d = "[object RegExp]", h = "[object Set]", p = "[object String]", v = "[object WeakMap]", y = "[object ArrayBuffer]", O = "[object DataView]", R = "[object Float32Array]", C = "[object Float64Array]", w = "[object Int8Array]", E = "[object Int16Array]", I = "[object Int32Array]", T = "[object Uint8Array]", g = "[object Uint8ClampedArray]", N = "[object Uint16Array]", _ = "[object Uint32Array]", A = {};
|
|
979
|
+
A[R] = A[C] = A[w] = A[E] = A[I] = A[T] = A[g] = A[N] = A[_] = !0, A[n] = A[s] = A[y] = A[i] = A[O] = A[a] = A[o] = A[c] = A[l] = A[u] = A[f] = A[d] = A[h] = A[p] = A[v] = !1;
|
|
980
980
|
function b(m) {
|
|
981
981
|
return t(m) && e(m.length) && !!A[r(m)];
|
|
982
982
|
}
|
|
@@ -998,7 +998,7 @@ Or.exports;
|
|
|
998
998
|
var Bl;
|
|
999
999
|
function qo() {
|
|
1000
1000
|
return Bl || (Bl = 1, (function(r, e) {
|
|
1001
|
-
var t =
|
|
1001
|
+
var t = Rd(), n = e && !e.nodeType && e, s = n && !0 && r && !r.nodeType && r, i = s && s.exports === n, a = i && t.process, o = (function() {
|
|
1002
1002
|
try {
|
|
1003
1003
|
var c = s && s.require && s.require("util").types;
|
|
1004
1004
|
return c || a && a.binding && a.binding("util");
|
|
@@ -1016,19 +1016,19 @@ function Lo() {
|
|
|
1016
1016
|
return ci = s, ci;
|
|
1017
1017
|
}
|
|
1018
1018
|
var li, Gl;
|
|
1019
|
-
function
|
|
1019
|
+
function Md() {
|
|
1020
1020
|
if (Gl) return li;
|
|
1021
1021
|
Gl = 1;
|
|
1022
|
-
var r = ty(), e =
|
|
1022
|
+
var r = ty(), e = Fd(), t = Dt(), n = Fn(), s = Mo(), i = Lo(), a = Object.prototype, o = a.hasOwnProperty;
|
|
1023
1023
|
function c(l, u) {
|
|
1024
|
-
var f = t(l), d = !f && e(l), h = !f && !d && n(l), p = !f && !d && !h && i(l), v = f || d || h || p,
|
|
1024
|
+
var f = t(l), d = !f && e(l), h = !f && !d && n(l), p = !f && !d && !h && i(l), v = f || d || h || p, y = v ? r(l.length, String) : [], O = y.length;
|
|
1025
1025
|
for (var R in l)
|
|
1026
1026
|
(u || o.call(l, R)) && !(v && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1027
1027
|
(R == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1028
1028
|
h && (R == "offset" || R == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1029
1029
|
p && (R == "buffer" || R == "byteLength" || R == "byteOffset") || // Skip index properties.
|
|
1030
|
-
s(R, O))) &&
|
|
1031
|
-
return
|
|
1030
|
+
s(R, O))) && y.push(R);
|
|
1031
|
+
return y;
|
|
1032
1032
|
}
|
|
1033
1033
|
return li = c, li;
|
|
1034
1034
|
}
|
|
@@ -1044,7 +1044,7 @@ function $o() {
|
|
|
1044
1044
|
return ui = e, ui;
|
|
1045
1045
|
}
|
|
1046
1046
|
var fi, Kl;
|
|
1047
|
-
function
|
|
1047
|
+
function Pd() {
|
|
1048
1048
|
if (Kl) return fi;
|
|
1049
1049
|
Kl = 1;
|
|
1050
1050
|
function r(e, t) {
|
|
@@ -1058,7 +1058,7 @@ var di, Yl;
|
|
|
1058
1058
|
function iy() {
|
|
1059
1059
|
if (Yl) return di;
|
|
1060
1060
|
Yl = 1;
|
|
1061
|
-
var r =
|
|
1061
|
+
var r = Pd(), e = r(Object.keys, Object);
|
|
1062
1062
|
return di = e, di;
|
|
1063
1063
|
}
|
|
1064
1064
|
var hi, Jl;
|
|
@@ -1080,7 +1080,7 @@ var mi, Ql;
|
|
|
1080
1080
|
function Dn() {
|
|
1081
1081
|
if (Ql) return mi;
|
|
1082
1082
|
Ql = 1;
|
|
1083
|
-
var r = Io(), e =
|
|
1083
|
+
var r = Io(), e = Dd();
|
|
1084
1084
|
function t(n) {
|
|
1085
1085
|
return n != null && e(n.length) && !r(n);
|
|
1086
1086
|
}
|
|
@@ -1090,17 +1090,17 @@ var pi, Xl;
|
|
|
1090
1090
|
function jo() {
|
|
1091
1091
|
if (Xl) return pi;
|
|
1092
1092
|
Xl = 1;
|
|
1093
|
-
var r =
|
|
1093
|
+
var r = Md(), e = ay(), t = Dn();
|
|
1094
1094
|
function n(s) {
|
|
1095
1095
|
return t(s) ? r(s) : e(s);
|
|
1096
1096
|
}
|
|
1097
1097
|
return pi = n, pi;
|
|
1098
1098
|
}
|
|
1099
1099
|
var yi, eu;
|
|
1100
|
-
function
|
|
1100
|
+
function qd() {
|
|
1101
1101
|
if (eu) return yi;
|
|
1102
1102
|
eu = 1;
|
|
1103
|
-
var r =
|
|
1103
|
+
var r = xd(), e = Do(), t = jo();
|
|
1104
1104
|
function n(s) {
|
|
1105
1105
|
return r(s, t, e);
|
|
1106
1106
|
}
|
|
@@ -1110,13 +1110,13 @@ var gi, tu;
|
|
|
1110
1110
|
function oy() {
|
|
1111
1111
|
if (tu) return gi;
|
|
1112
1112
|
tu = 1;
|
|
1113
|
-
var r =
|
|
1113
|
+
var r = qd(), e = 1, t = Object.prototype, n = t.hasOwnProperty;
|
|
1114
1114
|
function s(i, a, o, c, l, u) {
|
|
1115
1115
|
var f = o & e, d = r(i), h = d.length, p = r(a), v = p.length;
|
|
1116
1116
|
if (h != v && !f)
|
|
1117
1117
|
return !1;
|
|
1118
|
-
for (var
|
|
1119
|
-
var O = d[
|
|
1118
|
+
for (var y = h; y--; ) {
|
|
1119
|
+
var O = d[y];
|
|
1120
1120
|
if (!(f ? O in a : n.call(a, O)))
|
|
1121
1121
|
return !1;
|
|
1122
1122
|
}
|
|
@@ -1125,20 +1125,20 @@ function oy() {
|
|
|
1125
1125
|
return R == a && C == i;
|
|
1126
1126
|
var w = !0;
|
|
1127
1127
|
u.set(i, a), u.set(a, i);
|
|
1128
|
-
for (var E = f; ++
|
|
1129
|
-
O = d[
|
|
1128
|
+
for (var E = f; ++y < h; ) {
|
|
1129
|
+
O = d[y];
|
|
1130
1130
|
var I = i[O], T = a[O];
|
|
1131
1131
|
if (c)
|
|
1132
|
-
var
|
|
1133
|
-
if (!(
|
|
1132
|
+
var g = f ? c(T, I, O, a, i, u) : c(I, T, O, i, a, u);
|
|
1133
|
+
if (!(g === void 0 ? I === T || l(I, T, o, c, u) : g)) {
|
|
1134
1134
|
w = !1;
|
|
1135
1135
|
break;
|
|
1136
1136
|
}
|
|
1137
1137
|
E || (E = O == "constructor");
|
|
1138
1138
|
}
|
|
1139
1139
|
if (w && !E) {
|
|
1140
|
-
var N = i.constructor,
|
|
1141
|
-
N !=
|
|
1140
|
+
var N = i.constructor, _ = a.constructor;
|
|
1141
|
+
N != _ && "constructor" in i && "constructor" in a && !(typeof N == "function" && N instanceof N && typeof _ == "function" && _ instanceof _) && (w = !1);
|
|
1142
1142
|
}
|
|
1143
1143
|
return u.delete(i), u.delete(a), w;
|
|
1144
1144
|
}
|
|
@@ -1176,7 +1176,7 @@ var Oi, au;
|
|
|
1176
1176
|
function Mn() {
|
|
1177
1177
|
if (au) return Oi;
|
|
1178
1178
|
au = 1;
|
|
1179
|
-
var r = cy(), e = xo(), t = ly(), n = uy(), s = fy(), i = hr(), a =
|
|
1179
|
+
var r = cy(), e = xo(), t = ly(), n = uy(), s = fy(), i = hr(), a = Ad(), o = "[object Map]", c = "[object Object]", l = "[object Promise]", u = "[object Set]", f = "[object WeakMap]", d = "[object DataView]", h = a(r), p = a(e), v = a(t), y = a(n), O = a(s), R = i;
|
|
1180
1180
|
return (r && R(new r(new ArrayBuffer(1))) != d || e && R(new e()) != o || t && R(t.resolve()) != l || n && R(new n()) != u || s && R(new s()) != f) && (R = function(C) {
|
|
1181
1181
|
var w = i(C), E = w == c ? C.constructor : void 0, I = E ? a(E) : "";
|
|
1182
1182
|
if (I)
|
|
@@ -1187,7 +1187,7 @@ function Mn() {
|
|
|
1187
1187
|
return o;
|
|
1188
1188
|
case v:
|
|
1189
1189
|
return l;
|
|
1190
|
-
case
|
|
1190
|
+
case y:
|
|
1191
1191
|
return u;
|
|
1192
1192
|
case O:
|
|
1193
1193
|
return f;
|
|
@@ -1199,26 +1199,26 @@ var Ei, ou;
|
|
|
1199
1199
|
function dy() {
|
|
1200
1200
|
if (ou) return Ei;
|
|
1201
1201
|
ou = 1;
|
|
1202
|
-
var r = Fo(), e =
|
|
1203
|
-
function p(v,
|
|
1204
|
-
var E = i(v), I = i(
|
|
1205
|
-
T = T == l ? f : T,
|
|
1206
|
-
var N = T == f,
|
|
1202
|
+
var r = Fo(), e = Cd(), t = Xp(), n = oy(), s = Mn(), i = Dt(), a = Fn(), o = Lo(), c = 1, l = "[object Arguments]", u = "[object Array]", f = "[object Object]", d = Object.prototype, h = d.hasOwnProperty;
|
|
1203
|
+
function p(v, y, O, R, C, w) {
|
|
1204
|
+
var E = i(v), I = i(y), T = E ? u : s(v), g = I ? u : s(y);
|
|
1205
|
+
T = T == l ? f : T, g = g == l ? f : g;
|
|
1206
|
+
var N = T == f, _ = g == f, A = T == g;
|
|
1207
1207
|
if (A && a(v)) {
|
|
1208
|
-
if (!a(
|
|
1208
|
+
if (!a(y))
|
|
1209
1209
|
return !1;
|
|
1210
1210
|
E = !0, N = !1;
|
|
1211
1211
|
}
|
|
1212
1212
|
if (A && !N)
|
|
1213
|
-
return w || (w = new r()), E || o(v) ? e(v,
|
|
1213
|
+
return w || (w = new r()), E || o(v) ? e(v, y, O, R, C, w) : t(v, y, T, O, R, C, w);
|
|
1214
1214
|
if (!(O & c)) {
|
|
1215
|
-
var b = N && h.call(v, "__wrapped__"), m =
|
|
1215
|
+
var b = N && h.call(v, "__wrapped__"), m = _ && h.call(y, "__wrapped__");
|
|
1216
1216
|
if (b || m) {
|
|
1217
|
-
var S = b ? v.value() : v, k = m ?
|
|
1217
|
+
var S = b ? v.value() : v, k = m ? y.value() : y;
|
|
1218
1218
|
return w || (w = new r()), C(S, k, O, R, w);
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
|
-
return A ? (w || (w = new r()), n(v,
|
|
1221
|
+
return A ? (w || (w = new r()), n(v, y, O, R, C, w)) : !1;
|
|
1222
1222
|
}
|
|
1223
1223
|
return Ei = p, Ei;
|
|
1224
1224
|
}
|
|
@@ -1279,9 +1279,9 @@ const yy = /* @__PURE__ */ Cn(py), gy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1279
1279
|
i && !_t("Update", d) && (p = !1, v = "Authenticated user does not have Update access to this collection"), i && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1280
1280
|
(!un("Update", n, s, i, a, e) || // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1281
1281
|
!un("Update", n, s, i, a, h)) && (p = !1, v = "Authenticated user does not have Update access to this document");
|
|
1282
|
-
for (const
|
|
1283
|
-
const O = r[
|
|
1284
|
-
|
|
1282
|
+
for (const y of f) {
|
|
1283
|
+
const O = r[y.name];
|
|
1284
|
+
y.access && !Rn(y, a) && O !== void 0 && (v = `Authenticated user does not have access to field ${y.name}`, p = !1), O !== void 0 && !yp(y, a) && (v = `Authenticated user does not have Update access to field ${y.name}`, p = !1);
|
|
1285
1285
|
}
|
|
1286
1286
|
if (!p)
|
|
1287
1287
|
throw v && console.error(`PERMISSION_DENIED: ${v}`), new Error("PERMISSION_DENIED");
|
|
@@ -1292,7 +1292,7 @@ const yy = /* @__PURE__ */ Cn(py), gy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1292
1292
|
throw new Error("PERMISSION_DENIED");
|
|
1293
1293
|
if (_t("Delete", o) || (c = !1), un("Delete", t, n, s, i, r) || (c = !1), t.auth && r.User_ID && (mp(o) || (c = !1), _y("delete", r, e, t, n, s, i) || (c = !1)), !c)
|
|
1294
1294
|
throw new Error("PERMISSION_DENIED");
|
|
1295
|
-
},
|
|
1295
|
+
}, Ld = (r, e, t) => {
|
|
1296
1296
|
const { access: n } = e, { entityRestrictions: s } = n;
|
|
1297
1297
|
if (s?.restrictions) {
|
|
1298
1298
|
for (const i of s.restrictions)
|
|
@@ -1329,7 +1329,7 @@ const yy = /* @__PURE__ */ Cn(py), gy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1329
1329
|
return i;
|
|
1330
1330
|
}, Ey = (r, e) => e.fields.filter((t) => t.name === r.name)[0];
|
|
1331
1331
|
var Ri, uu;
|
|
1332
|
-
function
|
|
1332
|
+
function $d() {
|
|
1333
1333
|
if (uu) return Ri;
|
|
1334
1334
|
uu = 1;
|
|
1335
1335
|
var r = Bt(), e = (function() {
|
|
@@ -1345,7 +1345,7 @@ var Ai, fu;
|
|
|
1345
1345
|
function Uo() {
|
|
1346
1346
|
if (fu) return Ai;
|
|
1347
1347
|
fu = 1;
|
|
1348
|
-
var r =
|
|
1348
|
+
var r = $d();
|
|
1349
1349
|
function e(t, n, s) {
|
|
1350
1350
|
n == "__proto__" && r ? r(t, n, {
|
|
1351
1351
|
configurable: !0,
|
|
@@ -1357,7 +1357,7 @@ function Uo() {
|
|
|
1357
1357
|
return Ai = e, Ai;
|
|
1358
1358
|
}
|
|
1359
1359
|
var Ci, du;
|
|
1360
|
-
function
|
|
1360
|
+
function jd() {
|
|
1361
1361
|
if (du) return Ci;
|
|
1362
1362
|
du = 1;
|
|
1363
1363
|
var r = Uo(), e = jr();
|
|
@@ -1392,7 +1392,7 @@ function Ty() {
|
|
|
1392
1392
|
var Er = { exports: {} };
|
|
1393
1393
|
Er.exports;
|
|
1394
1394
|
var pu;
|
|
1395
|
-
function
|
|
1395
|
+
function Ud() {
|
|
1396
1396
|
return pu || (pu = 1, (function(r, e) {
|
|
1397
1397
|
var t = ct(), n = e && !e.nodeType && e, s = n && !0 && r && !r.nodeType && r, i = s && s.exports === n, a = i ? t.Buffer : void 0, o = a ? a.allocUnsafe : void 0;
|
|
1398
1398
|
function c(l, u) {
|
|
@@ -1408,7 +1408,7 @@ var xi, yu;
|
|
|
1408
1408
|
function Vo() {
|
|
1409
1409
|
if (yu) return xi;
|
|
1410
1410
|
yu = 1;
|
|
1411
|
-
var r =
|
|
1411
|
+
var r = kd();
|
|
1412
1412
|
function e(t) {
|
|
1413
1413
|
var n = new t.constructor(t.byteLength);
|
|
1414
1414
|
return new r(n).set(new r(t)), n;
|
|
@@ -1416,7 +1416,7 @@ function Vo() {
|
|
|
1416
1416
|
return xi = e, xi;
|
|
1417
1417
|
}
|
|
1418
1418
|
var Ni, gu;
|
|
1419
|
-
function
|
|
1419
|
+
function Vd() {
|
|
1420
1420
|
if (gu) return Ni;
|
|
1421
1421
|
gu = 1;
|
|
1422
1422
|
var r = Vo();
|
|
@@ -1427,7 +1427,7 @@ function zd() {
|
|
|
1427
1427
|
return Ni = e, Ni;
|
|
1428
1428
|
}
|
|
1429
1429
|
var Fi, _u;
|
|
1430
|
-
function
|
|
1430
|
+
function Wd() {
|
|
1431
1431
|
if (_u) return Fi;
|
|
1432
1432
|
_u = 1;
|
|
1433
1433
|
function r(e, t) {
|
|
@@ -1461,11 +1461,11 @@ var Mi, wu;
|
|
|
1461
1461
|
function Wo() {
|
|
1462
1462
|
if (wu) return Mi;
|
|
1463
1463
|
wu = 1;
|
|
1464
|
-
var r =
|
|
1464
|
+
var r = Pd(), e = r(Object.getPrototypeOf, Object);
|
|
1465
1465
|
return Mi = e, Mi;
|
|
1466
1466
|
}
|
|
1467
1467
|
var Pi, bu;
|
|
1468
|
-
function
|
|
1468
|
+
function zd() {
|
|
1469
1469
|
if (bu) return Pi;
|
|
1470
1470
|
bu = 1;
|
|
1471
1471
|
var r = Ry(), e = Wo(), t = $o();
|
|
@@ -1501,7 +1501,7 @@ function Cy() {
|
|
|
1501
1501
|
return Li = l, Li;
|
|
1502
1502
|
}
|
|
1503
1503
|
var $i, Su;
|
|
1504
|
-
function
|
|
1504
|
+
function Bd() {
|
|
1505
1505
|
if (Su) return $i;
|
|
1506
1506
|
Su = 1;
|
|
1507
1507
|
function r(e, t) {
|
|
@@ -1569,7 +1569,7 @@ var zi, ku;
|
|
|
1569
1569
|
function Wr() {
|
|
1570
1570
|
if (ku) return zi;
|
|
1571
1571
|
ku = 1;
|
|
1572
|
-
var r =
|
|
1572
|
+
var r = Md(), e = Iy(), t = Dn();
|
|
1573
1573
|
function n(s) {
|
|
1574
1574
|
return t(s) ? r(s, !0) : e(s);
|
|
1575
1575
|
}
|
|
@@ -1589,19 +1589,19 @@ var Zi, xu;
|
|
|
1589
1589
|
function Ny() {
|
|
1590
1590
|
if (xu) return Zi;
|
|
1591
1591
|
xu = 1;
|
|
1592
|
-
var r =
|
|
1593
|
-
function v(
|
|
1594
|
-
var T = h(
|
|
1592
|
+
var r = jd(), e = Ud(), t = Vd(), n = Wd(), s = zd(), i = Fd(), a = Dt(), o = Ay(), c = Fn(), l = Io(), u = vt(), f = Cy(), d = Lo(), h = Bd(), p = xy();
|
|
1593
|
+
function v(y, O, R, C, w, E, I) {
|
|
1594
|
+
var T = h(y, R), g = h(O, R), N = I.get(g);
|
|
1595
1595
|
if (N) {
|
|
1596
|
-
r(
|
|
1596
|
+
r(y, R, N);
|
|
1597
1597
|
return;
|
|
1598
1598
|
}
|
|
1599
|
-
var
|
|
1599
|
+
var _ = E ? E(T, g, R + "", y, O, I) : void 0, A = _ === void 0;
|
|
1600
1600
|
if (A) {
|
|
1601
|
-
var b = a(
|
|
1602
|
-
|
|
1601
|
+
var b = a(g), m = !b && c(g), S = !b && !m && d(g);
|
|
1602
|
+
_ = g, b || m || S ? a(T) ? _ = T : o(T) ? _ = n(T) : m ? (A = !1, _ = e(g, !0)) : S ? (A = !1, _ = t(g, !0)) : _ = [] : f(g) || i(g) ? (_ = T, i(T) ? _ = p(T) : (!u(T) || l(T)) && (_ = s(g))) : A = !1;
|
|
1603
1603
|
}
|
|
1604
|
-
A && (I.set(
|
|
1604
|
+
A && (I.set(g, _), w(_, g, C, E, I), I.delete(g)), r(y, R, _);
|
|
1605
1605
|
}
|
|
1606
1606
|
return Zi = v, Zi;
|
|
1607
1607
|
}
|
|
@@ -1609,7 +1609,7 @@ var Gi, Nu;
|
|
|
1609
1609
|
function Fy() {
|
|
1610
1610
|
if (Nu) return Gi;
|
|
1611
1611
|
Nu = 1;
|
|
1612
|
-
var r = Fo(), e =
|
|
1612
|
+
var r = Fo(), e = jd(), t = Ty(), n = Ny(), s = vt(), i = Wr(), a = Bd();
|
|
1613
1613
|
function o(c, l, u, f, d) {
|
|
1614
1614
|
c !== l && t(l, function(h, p) {
|
|
1615
1615
|
if (d || (d = new r()), s(h))
|
|
@@ -1623,7 +1623,7 @@ function Fy() {
|
|
|
1623
1623
|
return Gi = o, Gi;
|
|
1624
1624
|
}
|
|
1625
1625
|
var Hi, Fu;
|
|
1626
|
-
function
|
|
1626
|
+
function Zd() {
|
|
1627
1627
|
if (Fu) return Hi;
|
|
1628
1628
|
Fu = 1;
|
|
1629
1629
|
function r(e) {
|
|
@@ -1682,7 +1682,7 @@ var Qi, qu;
|
|
|
1682
1682
|
function qy() {
|
|
1683
1683
|
if (qu) return Qi;
|
|
1684
1684
|
qu = 1;
|
|
1685
|
-
var r = Py(), e =
|
|
1685
|
+
var r = Py(), e = $d(), t = Zd(), n = e ? function(s, i) {
|
|
1686
1686
|
return e(s, "toString", {
|
|
1687
1687
|
configurable: !0,
|
|
1688
1688
|
enumerable: !1,
|
|
@@ -1722,7 +1722,7 @@ var ta, ju;
|
|
|
1722
1722
|
function jy() {
|
|
1723
1723
|
if (ju) return ta;
|
|
1724
1724
|
ju = 1;
|
|
1725
|
-
var r =
|
|
1725
|
+
var r = Zd(), e = My(), t = $y();
|
|
1726
1726
|
function n(s, i) {
|
|
1727
1727
|
return t(e(s, i, r), s + "");
|
|
1728
1728
|
}
|
|
@@ -1911,8 +1911,8 @@ function tg() {
|
|
|
1911
1911
|
if (p === "__proto__" || p === "constructor" || p === "prototype")
|
|
1912
1912
|
return a;
|
|
1913
1913
|
if (u != d) {
|
|
1914
|
-
var
|
|
1915
|
-
v = l ? l(
|
|
1914
|
+
var y = h[p];
|
|
1915
|
+
v = l ? l(y, p, h) : void 0, v === void 0 && (v = n(y) ? y : t(o[u + 1]) ? [] : {});
|
|
1916
1916
|
}
|
|
1917
1917
|
r(h, p, v), h = h[p];
|
|
1918
1918
|
}
|
|
@@ -1988,7 +1988,7 @@ const sg = /* @__PURE__ */ Cn(ng), xr = {
|
|
|
1988
1988
|
l.field == r.name && (i = !0);
|
|
1989
1989
|
}
|
|
1990
1990
|
return i;
|
|
1991
|
-
},
|
|
1991
|
+
}, Gd = (r, e) => {
|
|
1992
1992
|
const t = Object.values(e.collections), { labels: n } = r, s = {};
|
|
1993
1993
|
return t.forEach((i) => {
|
|
1994
1994
|
const { labels: a, fields: o } = i;
|
|
@@ -2000,7 +2000,7 @@ const sg = /* @__PURE__ */ Cn(ng), xr = {
|
|
|
2000
2000
|
});
|
|
2001
2001
|
});
|
|
2002
2002
|
}), s;
|
|
2003
|
-
},
|
|
2003
|
+
}, Hd = [
|
|
2004
2004
|
"id",
|
|
2005
2005
|
"Collection_Path",
|
|
2006
2006
|
"Last_Write_At",
|
|
@@ -2012,7 +2012,7 @@ const sg = /* @__PURE__ */ Cn(ng), xr = {
|
|
|
2012
2012
|
"Created_At",
|
|
2013
2013
|
"Saved_At",
|
|
2014
2014
|
"Created_By"
|
|
2015
|
-
], Zo = () =>
|
|
2015
|
+
], Zo = () => Hd.map((r) => {
|
|
2016
2016
|
let e = "", t;
|
|
2017
2017
|
switch (r) {
|
|
2018
2018
|
case "id":
|
|
@@ -2100,9 +2100,9 @@ const sg = /* @__PURE__ */ Cn(ng), xr = {
|
|
|
2100
2100
|
}, cg = (r, e, t) => {
|
|
2101
2101
|
const n = [], { fields: s, preloadCache: i } = e, a = Zo();
|
|
2102
2102
|
i?.range && i.range.fields.forEach((l) => {
|
|
2103
|
-
|
|
2103
|
+
Hd.includes(l) ? n.push(re(a, l)) : n.push(re(s, l));
|
|
2104
2104
|
});
|
|
2105
|
-
const o = /* @__PURE__ */ new Set(), c =
|
|
2105
|
+
const o = /* @__PURE__ */ new Set(), c = Gd(e, t);
|
|
2106
2106
|
return Object.entries(c).map(([l, u]) => {
|
|
2107
2107
|
r.name === l && Object.values(u).forEach((f) => {
|
|
2108
2108
|
f.forEach((d) => {
|
|
@@ -2123,7 +2123,7 @@ const sg = /* @__PURE__ */ Cn(ng), xr = {
|
|
|
2123
2123
|
type: "String",
|
|
2124
2124
|
required: !0
|
|
2125
2125
|
});
|
|
2126
|
-
const a = [], o =
|
|
2126
|
+
const a = [], o = Gd(e, t);
|
|
2127
2127
|
if (Object.values(o).forEach((c) => {
|
|
2128
2128
|
Object.keys(c).forEach((l) => {
|
|
2129
2129
|
t.collections[l].fields.forEach((f) => {
|
|
@@ -2159,7 +2159,7 @@ async function oe(r, e, t, n) {
|
|
|
2159
2159
|
if (r !== "setEmbedding" && (await ga(r, e?.[r], n), r === "postWriteError"))
|
|
2160
2160
|
return s;
|
|
2161
2161
|
}
|
|
2162
|
-
const Go = (r, e, t, n, s, i, a, o, c, l) => (r == "create" && (t.Collection_Path = e, l || (t.Created_At = o), t.Saved_At = c, t.Created_By = a || "System"), t.Last_Write_App = s, l || (t.Last_Write_At = o), t.Last_Save_At = c, t.Last_Write_By = a || "System", t.Last_Write_Connection_Status = i, t.Last_Write_Version = n.version, t),
|
|
2162
|
+
const Go = (r, e, t, n, s, i, a, o, c, l) => (r == "create" && (t.Collection_Path = e, l || (t.Created_At = o), t.Saved_At = c, t.Created_By = a || "System"), t.Last_Write_App = s, l || (t.Last_Write_At = o), t.Last_Save_At = c, t.Last_Write_By = a || "System", t.Last_Write_Connection_Status = i, t.Last_Write_Version = n.version, t), Kd = (r, e) => {
|
|
2163
2163
|
const { access: t, queries: n } = r, { serverReadOnly: s } = t, i = /* @__PURE__ */ new Set();
|
|
2164
2164
|
if (n)
|
|
2165
2165
|
for (const a of n) {
|
|
@@ -2174,7 +2174,7 @@ const Go = (r, e, t, n, s, i, a, o, c, l) => (r == "create" && (t.Collection_Pat
|
|
|
2174
2174
|
return e.forEach((a) => {
|
|
2175
2175
|
(n === a.name || a.sorting && (typeof a.sorting == "boolean" || !a.sorting.roles?.every((o) => s?.includes(o)))) && a.type === "String" && i.add(a);
|
|
2176
2176
|
}), i;
|
|
2177
|
-
},
|
|
2177
|
+
}, Yd = (r, e, t) => {
|
|
2178
2178
|
const { fields: n } = r;
|
|
2179
2179
|
n.forEach((i) => {
|
|
2180
2180
|
if (_e(i))
|
|
@@ -2190,7 +2190,7 @@ const Go = (r, e, t, n, s, i, a, o, c, l) => (r == "create" && (t.Collection_Pat
|
|
|
2190
2190
|
}
|
|
2191
2191
|
} else
|
|
2192
2192
|
delete e[`${i.name}_Array`], delete e[`${i.name}_Single`];
|
|
2193
|
-
}),
|
|
2193
|
+
}), Kd(r, n).forEach((i) => {
|
|
2194
2194
|
if (e[i.name])
|
|
2195
2195
|
if (sr(e[i.name]))
|
|
2196
2196
|
e[`${i.name}_Single`] = e[i.name];
|
|
@@ -2202,7 +2202,7 @@ const Go = (r, e, t, n, s, i, a, o, c, l) => (r == "create" && (t.Collection_Pat
|
|
|
2202
2202
|
}
|
|
2203
2203
|
}
|
|
2204
2204
|
});
|
|
2205
|
-
},
|
|
2205
|
+
}, Jd = (r, e) => {
|
|
2206
2206
|
zr(r, r.fields).forEach((n) => {
|
|
2207
2207
|
e[n.name] ? e[`${n.name}_Lowercase`] = e[n.name].toLowerCase() : delete e[`${n.name}_Lowercase`];
|
|
2208
2208
|
});
|
|
@@ -2785,18 +2785,18 @@ class ce {
|
|
|
2785
2785
|
}
|
|
2786
2786
|
const pg = /^c[^\s-]{8,}$/i, yg = /^[0-9a-z]+$/, gg = /^[0-9A-HJKMNP-TV-Z]{26}$/i, _g = /^[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, vg = /^[a-z0-9_-]{21}$/i, wg = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, bg = /^[-+]?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)?)??$/, Og = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Eg = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
2787
2787
|
let _a;
|
|
2788
|
-
const Sg = /^(?:(?: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])$/, Tg = /^(?:(?: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])$/, Rg = /^(([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]))$/, Ag = /^(([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])$/, Cg = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, kg = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
|
|
2789
|
-
function
|
|
2788
|
+
const Sg = /^(?:(?: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])$/, Tg = /^(?:(?: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])$/, Rg = /^(([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]))$/, Ag = /^(([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])$/, Cg = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, kg = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Qd = "((\\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])))", Ig = new RegExp(`^${Qd}$`);
|
|
2789
|
+
function Xd(r) {
|
|
2790
2790
|
let e = "[0-5]\\d";
|
|
2791
2791
|
r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
2792
2792
|
const t = r.precision ? "+" : "?";
|
|
2793
2793
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
|
|
2794
2794
|
}
|
|
2795
2795
|
function xg(r) {
|
|
2796
|
-
return new RegExp(`^${
|
|
2796
|
+
return new RegExp(`^${Xd(r)}$`);
|
|
2797
2797
|
}
|
|
2798
2798
|
function Ng(r) {
|
|
2799
|
-
let e = `${
|
|
2799
|
+
let e = `${Qd}T${Xd(r)}`;
|
|
2800
2800
|
const t = [];
|
|
2801
2801
|
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
2802
2802
|
}
|
|
@@ -4065,7 +4065,7 @@ class Te extends ce {
|
|
|
4065
4065
|
});
|
|
4066
4066
|
}
|
|
4067
4067
|
keyof() {
|
|
4068
|
-
return
|
|
4068
|
+
return eh(ue.objectKeys(this.shape));
|
|
4069
4069
|
}
|
|
4070
4070
|
}
|
|
4071
4071
|
Te.create = (r, e) => new Te({
|
|
@@ -4464,7 +4464,7 @@ so.create = (r, e) => new so({
|
|
|
4464
4464
|
typeName: Q.ZodLiteral,
|
|
4465
4465
|
...ie(e)
|
|
4466
4466
|
});
|
|
4467
|
-
function
|
|
4467
|
+
function eh(r, e) {
|
|
4468
4468
|
return new or({
|
|
4469
4469
|
values: r,
|
|
4470
4470
|
typeName: Q.ZodEnum,
|
|
@@ -4525,7 +4525,7 @@ class or extends ce {
|
|
|
4525
4525
|
});
|
|
4526
4526
|
}
|
|
4527
4527
|
}
|
|
4528
|
-
or.create =
|
|
4528
|
+
or.create = eh;
|
|
4529
4529
|
class mf extends ce {
|
|
4530
4530
|
_parse(e) {
|
|
4531
4531
|
const t = ue.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -4851,7 +4851,7 @@ var Q;
|
|
|
4851
4851
|
})(Q || (Q = {}));
|
|
4852
4852
|
const mt = pt.create, co = ar.create, Lg = to.create, jt = ro.create;
|
|
4853
4853
|
Ft.create;
|
|
4854
|
-
const Pn = at.create,
|
|
4854
|
+
const Pn = at.create, th = Te.create, gn = hn.create;
|
|
4855
4855
|
mn.create;
|
|
4856
4856
|
Vt.create;
|
|
4857
4857
|
const Ko = pn.create, lo = so.create, uo = or.create;
|
|
@@ -4862,7 +4862,7 @@ const sn = () => jt().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4862
4862
|
message: "Value is not a valid timestamp"
|
|
4863
4863
|
}), yf = () => jt().refine((r) => r && (r._methodName === "serverTimestamp" || r.constructor.name === "ServerTimestampTransform"), {
|
|
4864
4864
|
message: "Value is not a valid server timestamp"
|
|
4865
|
-
}),
|
|
4865
|
+
}), rh = (r, e) => {
|
|
4866
4866
|
const t = {};
|
|
4867
4867
|
if (r.includeFields) {
|
|
4868
4868
|
const n = e.collections[r.collection];
|
|
@@ -4875,12 +4875,12 @@ const sn = () => jt().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4875
4875
|
t[s] = _n(n, i), zr(n, [i]).size === 1 && (t[`${s}_Lowercase`] = _n(n, i, !0));
|
|
4876
4876
|
});
|
|
4877
4877
|
}
|
|
4878
|
-
return
|
|
4878
|
+
return th({
|
|
4879
4879
|
Collection_Path: Pn(mt()),
|
|
4880
4880
|
...t
|
|
4881
4881
|
});
|
|
4882
4882
|
}, $g = (r, e) => {
|
|
4883
|
-
let t = Ko(
|
|
4883
|
+
let t = Ko(rh(r, e));
|
|
4884
4884
|
return r.required || (t = t.optional()), t;
|
|
4885
4885
|
}, jg = (r) => {
|
|
4886
4886
|
let e = Pn(gn([mt().length(20), mt().length(28)]));
|
|
@@ -4948,9 +4948,9 @@ const sn = () => jt().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4948
4948
|
Created_By: gn([mt().length(28), lo("System")])
|
|
4949
4949
|
};
|
|
4950
4950
|
r === "create" && (n.Saved_At = yf()), r === "update" && (n.Saved_At = sn(), n.Collection_Path = n.Collection_Path.optional(), n.id = n.id.optional(), n.Created_At = n.Created_At.optional(), n.Saved_At = n.Saved_At.optional(), n.Created_By = n.Created_By.optional());
|
|
4951
|
-
const s =
|
|
4951
|
+
const s = Kd(e, e.fields), i = Array.from(s).map((c) => c.name);
|
|
4952
4952
|
e.fields.forEach((c) => {
|
|
4953
|
-
_e(c) ? (n[c.name] = $g(c, t), n[`${c.name}_Array`] = jg(c), i.includes(c.name) && (n[`${c.name}_Single`] =
|
|
4953
|
+
_e(c) ? (n[c.name] = $g(c, t), n[`${c.name}_Array`] = jg(c), i.includes(c.name) && (n[`${c.name}_Single`] = rh(c, t), c.required || (n[`${c.name}_Single`] = n[`${c.name}_Single`].optional())), c.length && (n[c.name] = n[c.name].refine((l) => c.length && l && Object.keys(l).length === c.length, {
|
|
4954
4954
|
message: `Value must contain ${c.length} item(s)`
|
|
4955
4955
|
})), c.min && (n[c.name] = n[c.name].refine((l) => c.min && l && Object.keys(l).length >= c.min, {
|
|
4956
4956
|
message: `Value must contain at least ${c.min} item(s)`
|
|
@@ -4960,7 +4960,7 @@ const sn = () => jt().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4960
4960
|
}), zr(e, e.fields).forEach((c) => {
|
|
4961
4961
|
n[c.name] && (n[`${c.name}_Lowercase`] = _n(e, c, !0));
|
|
4962
4962
|
});
|
|
4963
|
-
const o =
|
|
4963
|
+
const o = th(n);
|
|
4964
4964
|
return e.allowSchemalessFields ? o.passthrough() : o.strict();
|
|
4965
4965
|
};
|
|
4966
4966
|
class Zt extends Error {
|
|
@@ -4982,7 +4982,7 @@ class zg extends Zt {
|
|
|
4982
4982
|
}
|
|
4983
4983
|
class er extends Zt {
|
|
4984
4984
|
}
|
|
4985
|
-
class
|
|
4985
|
+
class nh extends Zt {
|
|
4986
4986
|
constructor(e) {
|
|
4987
4987
|
super(`Invalid unit ${e}`);
|
|
4988
4988
|
}
|
|
@@ -4998,7 +4998,7 @@ const q = "numeric", rt = "short", Le = "long", vn = {
|
|
|
4998
4998
|
year: q,
|
|
4999
4999
|
month: q,
|
|
5000
5000
|
day: q
|
|
5001
|
-
},
|
|
5001
|
+
}, sh = {
|
|
5002
5002
|
year: q,
|
|
5003
5003
|
month: rt,
|
|
5004
5004
|
day: q
|
|
@@ -5007,73 +5007,73 @@ const q = "numeric", rt = "short", Le = "long", vn = {
|
|
|
5007
5007
|
month: rt,
|
|
5008
5008
|
day: q,
|
|
5009
5009
|
weekday: rt
|
|
5010
|
-
},
|
|
5010
|
+
}, ih = {
|
|
5011
5011
|
year: q,
|
|
5012
5012
|
month: Le,
|
|
5013
5013
|
day: q
|
|
5014
|
-
},
|
|
5014
|
+
}, ah = {
|
|
5015
5015
|
year: q,
|
|
5016
5016
|
month: Le,
|
|
5017
5017
|
day: q,
|
|
5018
5018
|
weekday: Le
|
|
5019
|
-
},
|
|
5019
|
+
}, oh = {
|
|
5020
5020
|
hour: q,
|
|
5021
5021
|
minute: q
|
|
5022
|
-
},
|
|
5022
|
+
}, ch = {
|
|
5023
5023
|
hour: q,
|
|
5024
5024
|
minute: q,
|
|
5025
5025
|
second: q
|
|
5026
|
-
},
|
|
5026
|
+
}, lh = {
|
|
5027
5027
|
hour: q,
|
|
5028
5028
|
minute: q,
|
|
5029
5029
|
second: q,
|
|
5030
5030
|
timeZoneName: rt
|
|
5031
|
-
},
|
|
5031
|
+
}, uh = {
|
|
5032
5032
|
hour: q,
|
|
5033
5033
|
minute: q,
|
|
5034
5034
|
second: q,
|
|
5035
5035
|
timeZoneName: Le
|
|
5036
|
-
},
|
|
5036
|
+
}, fh = {
|
|
5037
5037
|
hour: q,
|
|
5038
5038
|
minute: q,
|
|
5039
5039
|
hourCycle: "h23"
|
|
5040
|
-
},
|
|
5040
|
+
}, dh = {
|
|
5041
5041
|
hour: q,
|
|
5042
5042
|
minute: q,
|
|
5043
5043
|
second: q,
|
|
5044
5044
|
hourCycle: "h23"
|
|
5045
|
-
},
|
|
5045
|
+
}, hh = {
|
|
5046
5046
|
hour: q,
|
|
5047
5047
|
minute: q,
|
|
5048
5048
|
second: q,
|
|
5049
5049
|
hourCycle: "h23",
|
|
5050
5050
|
timeZoneName: rt
|
|
5051
|
-
},
|
|
5051
|
+
}, mh = {
|
|
5052
5052
|
hour: q,
|
|
5053
5053
|
minute: q,
|
|
5054
5054
|
second: q,
|
|
5055
5055
|
hourCycle: "h23",
|
|
5056
5056
|
timeZoneName: Le
|
|
5057
|
-
},
|
|
5057
|
+
}, ph = {
|
|
5058
5058
|
year: q,
|
|
5059
5059
|
month: q,
|
|
5060
5060
|
day: q,
|
|
5061
5061
|
hour: q,
|
|
5062
5062
|
minute: q
|
|
5063
|
-
},
|
|
5063
|
+
}, yh = {
|
|
5064
5064
|
year: q,
|
|
5065
5065
|
month: q,
|
|
5066
5066
|
day: q,
|
|
5067
5067
|
hour: q,
|
|
5068
5068
|
minute: q,
|
|
5069
5069
|
second: q
|
|
5070
|
-
},
|
|
5070
|
+
}, gh = {
|
|
5071
5071
|
year: q,
|
|
5072
5072
|
month: rt,
|
|
5073
5073
|
day: q,
|
|
5074
5074
|
hour: q,
|
|
5075
5075
|
minute: q
|
|
5076
|
-
},
|
|
5076
|
+
}, _h = {
|
|
5077
5077
|
year: q,
|
|
5078
5078
|
month: rt,
|
|
5079
5079
|
day: q,
|
|
@@ -5087,14 +5087,14 @@ const q = "numeric", rt = "short", Le = "long", vn = {
|
|
|
5087
5087
|
weekday: rt,
|
|
5088
5088
|
hour: q,
|
|
5089
5089
|
minute: q
|
|
5090
|
-
},
|
|
5090
|
+
}, vh = {
|
|
5091
5091
|
year: q,
|
|
5092
5092
|
month: Le,
|
|
5093
5093
|
day: q,
|
|
5094
5094
|
hour: q,
|
|
5095
5095
|
minute: q,
|
|
5096
5096
|
timeZoneName: rt
|
|
5097
|
-
},
|
|
5097
|
+
}, wh = {
|
|
5098
5098
|
year: q,
|
|
5099
5099
|
month: Le,
|
|
5100
5100
|
day: q,
|
|
@@ -5102,7 +5102,7 @@ const q = "numeric", rt = "short", Le = "long", vn = {
|
|
|
5102
5102
|
minute: q,
|
|
5103
5103
|
second: q,
|
|
5104
5104
|
timeZoneName: rt
|
|
5105
|
-
},
|
|
5105
|
+
}, bh = {
|
|
5106
5106
|
year: q,
|
|
5107
5107
|
month: Le,
|
|
5108
5108
|
day: q,
|
|
@@ -5110,7 +5110,7 @@ const q = "numeric", rt = "short", Le = "long", vn = {
|
|
|
5110
5110
|
hour: q,
|
|
5111
5111
|
minute: q,
|
|
5112
5112
|
timeZoneName: Le
|
|
5113
|
-
},
|
|
5113
|
+
}, Oh = {
|
|
5114
5114
|
year: q,
|
|
5115
5115
|
month: Le,
|
|
5116
5116
|
day: q,
|
|
@@ -5227,7 +5227,7 @@ class qn extends Br {
|
|
|
5227
5227
|
}
|
|
5228
5228
|
/** @override **/
|
|
5229
5229
|
offsetName(e, { format: t, locale: n }) {
|
|
5230
|
-
return
|
|
5230
|
+
return Fh(e, t, n);
|
|
5231
5231
|
}
|
|
5232
5232
|
/** @override **/
|
|
5233
5233
|
formatOffset(e, t) {
|
|
@@ -5365,7 +5365,7 @@ class gt extends Br {
|
|
|
5365
5365
|
* @return {string}
|
|
5366
5366
|
*/
|
|
5367
5367
|
offsetName(e, { format: t, locale: n }) {
|
|
5368
|
-
return
|
|
5368
|
+
return Fh(e, t, n, this.name);
|
|
5369
5369
|
}
|
|
5370
5370
|
/**
|
|
5371
5371
|
* Returns the offset's value as a string
|
|
@@ -5451,7 +5451,7 @@ function e_() {
|
|
|
5451
5451
|
return Tr || (Tr = new Intl.DateTimeFormat().resolvedOptions().locale, Tr);
|
|
5452
5452
|
}
|
|
5453
5453
|
const go = /* @__PURE__ */ new Map();
|
|
5454
|
-
function
|
|
5454
|
+
function Eh(r) {
|
|
5455
5455
|
let e = go.get(r);
|
|
5456
5456
|
return e === void 0 && (e = new Intl.DateTimeFormat(r).resolvedOptions(), go.set(r, e)), e;
|
|
5457
5457
|
}
|
|
@@ -5460,7 +5460,7 @@ function t_(r) {
|
|
|
5460
5460
|
let e = _o.get(r);
|
|
5461
5461
|
if (!e) {
|
|
5462
5462
|
const t = new Intl.Locale(r);
|
|
5463
|
-
e = "getWeekInfo" in t ? t.getWeekInfo() : t.weekInfo, "minimalDays" in e || (e = { ...
|
|
5463
|
+
e = "getWeekInfo" in t ? t.getWeekInfo() : t.weekInfo, "minimalDays" in e || (e = { ...Sh, ...e }), _o.set(r, e);
|
|
5464
5464
|
}
|
|
5465
5465
|
return e;
|
|
5466
5466
|
}
|
|
@@ -5506,7 +5506,7 @@ function Xr(r, e, t, n) {
|
|
|
5506
5506
|
return s === "error" ? null : s === "en" ? t(e) : n(e);
|
|
5507
5507
|
}
|
|
5508
5508
|
function a_(r) {
|
|
5509
|
-
return r.numberingSystem && r.numberingSystem !== "latn" ? !1 : r.numberingSystem === "latn" || !r.locale || r.locale.startsWith("en") ||
|
|
5509
|
+
return r.numberingSystem && r.numberingSystem !== "latn" ? !1 : r.numberingSystem === "latn" || !r.locale || r.locale.startsWith("en") || Eh(r.locale).numberingSystem === "latn";
|
|
5510
5510
|
}
|
|
5511
5511
|
class o_ {
|
|
5512
5512
|
constructor(e, t, n) {
|
|
@@ -5565,7 +5565,7 @@ class c_ {
|
|
|
5565
5565
|
}
|
|
5566
5566
|
class l_ {
|
|
5567
5567
|
constructor(e, t, n) {
|
|
5568
|
-
this.opts = { style: "long", ...n }, !t &&
|
|
5568
|
+
this.opts = { style: "long", ...n }, !t && xh() && (this.rtf = Xg(e, n));
|
|
5569
5569
|
}
|
|
5570
5570
|
format(e, t) {
|
|
5571
5571
|
return this.rtf ? this.rtf.format(e, t) : x_(t, e, this.opts.numeric, this.opts.style !== "long");
|
|
@@ -5574,7 +5574,7 @@ class l_ {
|
|
|
5574
5574
|
return this.rtf ? this.rtf.formatToParts(e, t) : [];
|
|
5575
5575
|
}
|
|
5576
5576
|
}
|
|
5577
|
-
const
|
|
5577
|
+
const Sh = {
|
|
5578
5578
|
firstDay: 1,
|
|
5579
5579
|
minimalDays: 4,
|
|
5580
5580
|
weekend: [6, 7]
|
|
@@ -5626,7 +5626,7 @@ class he {
|
|
|
5626
5626
|
return this.clone({ ...e, defaultToEN: !1 });
|
|
5627
5627
|
}
|
|
5628
5628
|
months(e, t = !1) {
|
|
5629
|
-
return Xr(this, e,
|
|
5629
|
+
return Xr(this, e, Ph, () => {
|
|
5630
5630
|
const n = this.intl === "ja" || this.intl.startsWith("ja-");
|
|
5631
5631
|
t &= !n;
|
|
5632
5632
|
const s = t ? { month: e, day: "numeric" } : { month: e }, i = t ? "format" : "standalone";
|
|
@@ -5638,7 +5638,7 @@ class he {
|
|
|
5638
5638
|
});
|
|
5639
5639
|
}
|
|
5640
5640
|
weekdays(e, t = !1) {
|
|
5641
|
-
return Xr(this, e,
|
|
5641
|
+
return Xr(this, e, $h, () => {
|
|
5642
5642
|
const n = t ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, s = t ? "format" : "standalone";
|
|
5643
5643
|
return this.weekdaysCache[s][e] || (this.weekdaysCache[s][e] = i_(
|
|
5644
5644
|
(i) => this.extract(i, n, "weekday")
|
|
@@ -5649,7 +5649,7 @@ class he {
|
|
|
5649
5649
|
return Xr(
|
|
5650
5650
|
this,
|
|
5651
5651
|
void 0,
|
|
5652
|
-
() =>
|
|
5652
|
+
() => jh,
|
|
5653
5653
|
() => {
|
|
5654
5654
|
if (!this.meridiemCache) {
|
|
5655
5655
|
const e = { hour: "numeric", hourCycle: "h12" };
|
|
@@ -5662,7 +5662,7 @@ class he {
|
|
|
5662
5662
|
);
|
|
5663
5663
|
}
|
|
5664
5664
|
eras(e) {
|
|
5665
|
-
return Xr(this, e,
|
|
5665
|
+
return Xr(this, e, Uh, () => {
|
|
5666
5666
|
const t = { era: e };
|
|
5667
5667
|
return this.eraCache[e] || (this.eraCache[e] = [z.utc(-40, 1, 1), z.utc(2017, 1, 1)].map(
|
|
5668
5668
|
(n) => this.extract(n, t, "era")
|
|
@@ -5686,10 +5686,10 @@ class he {
|
|
|
5686
5686
|
return Jg(this.intl, e);
|
|
5687
5687
|
}
|
|
5688
5688
|
isEnglish() {
|
|
5689
|
-
return this.locale === "en" || this.locale.toLowerCase() === "en-us" ||
|
|
5689
|
+
return this.locale === "en" || this.locale.toLowerCase() === "en-us" || Eh(this.intl).locale.startsWith("en-us");
|
|
5690
5690
|
}
|
|
5691
5691
|
getWeekSettings() {
|
|
5692
|
-
return this.weekSettings ? this.weekSettings :
|
|
5692
|
+
return this.weekSettings ? this.weekSettings : Nh() ? t_(this.locale) : Sh;
|
|
5693
5693
|
}
|
|
5694
5694
|
getStartOfWeek() {
|
|
5695
5695
|
return this.getWeekSettings().firstDay;
|
|
@@ -6094,7 +6094,7 @@ class tt {
|
|
|
6094
6094
|
return this.explanation ? `${this.reason}: ${this.explanation}` : this.reason;
|
|
6095
6095
|
}
|
|
6096
6096
|
}
|
|
6097
|
-
const
|
|
6097
|
+
const Th = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Rh = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
|
|
6098
6098
|
function Be(r, e) {
|
|
6099
6099
|
return new tt(
|
|
6100
6100
|
"unit out of range",
|
|
@@ -6107,18 +6107,18 @@ function Jo(r, e, t) {
|
|
|
6107
6107
|
const s = n.getUTCDay();
|
|
6108
6108
|
return s === 0 ? 7 : s;
|
|
6109
6109
|
}
|
|
6110
|
-
function
|
|
6111
|
-
return t + (Zr(r) ?
|
|
6110
|
+
function Ah(r, e, t) {
|
|
6111
|
+
return t + (Zr(r) ? Rh : Th)[e - 1];
|
|
6112
6112
|
}
|
|
6113
|
-
function
|
|
6114
|
-
const t = Zr(r) ?
|
|
6113
|
+
function Ch(r, e) {
|
|
6114
|
+
const t = Zr(r) ? Rh : Th, n = t.findIndex((i) => i < e), s = e - t[n];
|
|
6115
6115
|
return { month: n + 1, day: s };
|
|
6116
6116
|
}
|
|
6117
6117
|
function Qo(r, e) {
|
|
6118
6118
|
return (r - e + 7) % 7 + 1;
|
|
6119
6119
|
}
|
|
6120
6120
|
function wn(r, e = 4, t = 1) {
|
|
6121
|
-
const { year: n, month: s, day: i } = r, a =
|
|
6121
|
+
const { year: n, month: s, day: i } = r, a = Ah(n, s, i), o = Qo(Jo(n, s, i), t);
|
|
6122
6122
|
let c = Math.floor((a - o + 14 - e) / 7), l;
|
|
6123
6123
|
return c < 1 ? (l = n - 1, c = $r(l, e, t)) : c > $r(n, e, t) ? (l = n + 1, c = 1) : l = n, { weekYear: l, weekNumber: c, weekday: o, ...Un(r) };
|
|
6124
6124
|
}
|
|
@@ -6126,15 +6126,15 @@ function Af(r, e = 4, t = 1) {
|
|
|
6126
6126
|
const { weekYear: n, weekNumber: s, weekday: i } = r, a = Qo(Jo(n, 1, e), t), o = rr(n);
|
|
6127
6127
|
let c = s * 7 + i - a - 7 + e, l;
|
|
6128
6128
|
c < 1 ? (l = n - 1, c += rr(l)) : c > o ? (l = n + 1, c -= rr(n)) : l = n;
|
|
6129
|
-
const { month: u, day: f } =
|
|
6129
|
+
const { month: u, day: f } = Ch(l, c);
|
|
6130
6130
|
return { year: l, month: u, day: f, ...Un(r) };
|
|
6131
6131
|
}
|
|
6132
6132
|
function Oa(r) {
|
|
6133
|
-
const { year: e, month: t, day: n } = r, s =
|
|
6133
|
+
const { year: e, month: t, day: n } = r, s = Ah(e, t, n);
|
|
6134
6134
|
return { year: e, ordinal: s, ...Un(r) };
|
|
6135
6135
|
}
|
|
6136
6136
|
function Cf(r) {
|
|
6137
|
-
const { year: e, ordinal: t } = r, { month: n, day: s } =
|
|
6137
|
+
const { year: e, ordinal: t } = r, { month: n, day: s } = Ch(e, t);
|
|
6138
6138
|
return { year: e, month: n, day: s, ...Un(r) };
|
|
6139
6139
|
}
|
|
6140
6140
|
function kf(r, e) {
|
|
@@ -6162,11 +6162,11 @@ function p_(r) {
|
|
|
6162
6162
|
const e = Ln(r.year), t = Ze(r.ordinal, 1, rr(r.year));
|
|
6163
6163
|
return e ? t ? !1 : Be("ordinal", r.ordinal) : Be("year", r.year);
|
|
6164
6164
|
}
|
|
6165
|
-
function
|
|
6165
|
+
function kh(r) {
|
|
6166
6166
|
const e = Ln(r.year), t = Ze(r.month, 1, 12), n = Ze(r.day, 1, bn(r.year, r.month));
|
|
6167
6167
|
return e ? t ? n ? !1 : Be("day", r.day) : Be("month", r.month) : Be("year", r.year);
|
|
6168
6168
|
}
|
|
6169
|
-
function
|
|
6169
|
+
function Ih(r) {
|
|
6170
6170
|
const { hour: e, minute: t, second: n, millisecond: s } = r, i = Ze(e, 0, 23) || e === 24 && t === 0 && n === 0 && s === 0, a = Ze(t, 0, 59), o = Ze(n, 0, 59), c = Ze(s, 0, 999);
|
|
6171
6171
|
return i ? a ? o ? c ? !1 : Be("millisecond", s) : Be("second", n) : Be("minute", t) : Be("hour", e);
|
|
6172
6172
|
}
|
|
@@ -6185,14 +6185,14 @@ function y_(r) {
|
|
|
6185
6185
|
function g_(r) {
|
|
6186
6186
|
return Object.prototype.toString.call(r) === "[object Date]";
|
|
6187
6187
|
}
|
|
6188
|
-
function
|
|
6188
|
+
function xh() {
|
|
6189
6189
|
try {
|
|
6190
6190
|
return typeof Intl < "u" && !!Intl.RelativeTimeFormat;
|
|
6191
6191
|
} catch {
|
|
6192
6192
|
return !1;
|
|
6193
6193
|
}
|
|
6194
6194
|
}
|
|
6195
|
-
function
|
|
6195
|
+
function Nh() {
|
|
6196
6196
|
try {
|
|
6197
6197
|
return typeof Intl < "u" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype);
|
|
6198
6198
|
} catch {
|
|
@@ -6302,7 +6302,7 @@ function $r(r, e = 4, t = 1) {
|
|
|
6302
6302
|
function bo(r) {
|
|
6303
6303
|
return r > 99 ? r : r > be.twoDigitCutoffYear ? 1900 + r : 2e3 + r;
|
|
6304
6304
|
}
|
|
6305
|
-
function
|
|
6305
|
+
function Fh(r, e, t, n = null) {
|
|
6306
6306
|
const s = new Date(r), i = {
|
|
6307
6307
|
hourCycle: "h23",
|
|
6308
6308
|
year: "numeric",
|
|
@@ -6321,7 +6321,7 @@ function jn(r, e) {
|
|
|
6321
6321
|
const n = parseInt(e, 10) || 0, s = t < 0 || Object.is(t, -0) ? -n : n;
|
|
6322
6322
|
return t * 60 + s;
|
|
6323
6323
|
}
|
|
6324
|
-
function
|
|
6324
|
+
function Dh(r) {
|
|
6325
6325
|
const e = Number(r);
|
|
6326
6326
|
if (typeof r == "boolean" || r === "" || !Number.isFinite(e))
|
|
6327
6327
|
throw new xe(`Invalid unit value ${r}`);
|
|
@@ -6333,7 +6333,7 @@ function On(r, e) {
|
|
|
6333
6333
|
if (ur(r, n)) {
|
|
6334
6334
|
const s = r[n];
|
|
6335
6335
|
if (s == null) continue;
|
|
6336
|
-
t[e(n)] =
|
|
6336
|
+
t[e(n)] = Dh(s);
|
|
6337
6337
|
}
|
|
6338
6338
|
return t;
|
|
6339
6339
|
}
|
|
@@ -6366,7 +6366,7 @@ const b_ = [
|
|
|
6366
6366
|
"October",
|
|
6367
6367
|
"November",
|
|
6368
6368
|
"December"
|
|
6369
|
-
],
|
|
6369
|
+
], Mh = [
|
|
6370
6370
|
"Jan",
|
|
6371
6371
|
"Feb",
|
|
6372
6372
|
"Mar",
|
|
@@ -6380,12 +6380,12 @@ const b_ = [
|
|
|
6380
6380
|
"Nov",
|
|
6381
6381
|
"Dec"
|
|
6382
6382
|
], O_ = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
|
|
6383
|
-
function
|
|
6383
|
+
function Ph(r) {
|
|
6384
6384
|
switch (r) {
|
|
6385
6385
|
case "narrow":
|
|
6386
6386
|
return [...O_];
|
|
6387
6387
|
case "short":
|
|
6388
|
-
return [...
|
|
6388
|
+
return [...Mh];
|
|
6389
6389
|
case "long":
|
|
6390
6390
|
return [...b_];
|
|
6391
6391
|
case "numeric":
|
|
@@ -6396,7 +6396,7 @@ function Lh(r) {
|
|
|
6396
6396
|
return null;
|
|
6397
6397
|
}
|
|
6398
6398
|
}
|
|
6399
|
-
const
|
|
6399
|
+
const qh = [
|
|
6400
6400
|
"Monday",
|
|
6401
6401
|
"Tuesday",
|
|
6402
6402
|
"Wednesday",
|
|
@@ -6404,23 +6404,23 @@ const $h = [
|
|
|
6404
6404
|
"Friday",
|
|
6405
6405
|
"Saturday",
|
|
6406
6406
|
"Sunday"
|
|
6407
|
-
],
|
|
6408
|
-
function
|
|
6407
|
+
], Lh = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], E_ = ["M", "T", "W", "T", "F", "S", "S"];
|
|
6408
|
+
function $h(r) {
|
|
6409
6409
|
switch (r) {
|
|
6410
6410
|
case "narrow":
|
|
6411
6411
|
return [...E_];
|
|
6412
6412
|
case "short":
|
|
6413
|
-
return [...
|
|
6413
|
+
return [...Lh];
|
|
6414
6414
|
case "long":
|
|
6415
|
-
return [
|
|
6415
|
+
return [...qh];
|
|
6416
6416
|
case "numeric":
|
|
6417
6417
|
return ["1", "2", "3", "4", "5", "6", "7"];
|
|
6418
6418
|
default:
|
|
6419
6419
|
return null;
|
|
6420
6420
|
}
|
|
6421
6421
|
}
|
|
6422
|
-
const
|
|
6423
|
-
function
|
|
6422
|
+
const jh = ["AM", "PM"], S_ = ["Before Christ", "Anno Domini"], T_ = ["BC", "AD"], R_ = ["B", "A"];
|
|
6423
|
+
function Uh(r) {
|
|
6424
6424
|
switch (r) {
|
|
6425
6425
|
case "narrow":
|
|
6426
6426
|
return [...R_];
|
|
@@ -6433,16 +6433,16 @@ function Wh(r) {
|
|
|
6433
6433
|
}
|
|
6434
6434
|
}
|
|
6435
6435
|
function A_(r) {
|
|
6436
|
-
return
|
|
6436
|
+
return jh[r.hour < 12 ? 0 : 1];
|
|
6437
6437
|
}
|
|
6438
6438
|
function C_(r, e) {
|
|
6439
|
-
return
|
|
6439
|
+
return $h(e)[r.weekday - 1];
|
|
6440
6440
|
}
|
|
6441
6441
|
function k_(r, e) {
|
|
6442
|
-
return
|
|
6442
|
+
return Ph(e)[r.month - 1];
|
|
6443
6443
|
}
|
|
6444
6444
|
function I_(r, e) {
|
|
6445
|
-
return
|
|
6445
|
+
return Uh(e)[r.year < 0 ? 0 : 1];
|
|
6446
6446
|
}
|
|
6447
6447
|
function x_(r, e, t = "always", n = !1) {
|
|
6448
6448
|
const s = {
|
|
@@ -6477,25 +6477,25 @@ function Nf(r, e) {
|
|
|
6477
6477
|
}
|
|
6478
6478
|
const N_ = {
|
|
6479
6479
|
D: vn,
|
|
6480
|
-
DD:
|
|
6481
|
-
DDD:
|
|
6482
|
-
DDDD:
|
|
6483
|
-
t:
|
|
6484
|
-
tt:
|
|
6485
|
-
ttt:
|
|
6486
|
-
tttt:
|
|
6487
|
-
T:
|
|
6488
|
-
TT:
|
|
6489
|
-
TTT:
|
|
6490
|
-
TTTT:
|
|
6491
|
-
f:
|
|
6492
|
-
ff:
|
|
6493
|
-
fff:
|
|
6494
|
-
ffff:
|
|
6495
|
-
F:
|
|
6496
|
-
FF:
|
|
6497
|
-
FFF:
|
|
6498
|
-
FFFF:
|
|
6480
|
+
DD: sh,
|
|
6481
|
+
DDD: ih,
|
|
6482
|
+
DDDD: ah,
|
|
6483
|
+
t: oh,
|
|
6484
|
+
tt: ch,
|
|
6485
|
+
ttt: lh,
|
|
6486
|
+
tttt: uh,
|
|
6487
|
+
T: fh,
|
|
6488
|
+
TT: dh,
|
|
6489
|
+
TTT: hh,
|
|
6490
|
+
TTTT: mh,
|
|
6491
|
+
f: ph,
|
|
6492
|
+
ff: gh,
|
|
6493
|
+
fff: vh,
|
|
6494
|
+
ffff: bh,
|
|
6495
|
+
F: yh,
|
|
6496
|
+
FF: _h,
|
|
6497
|
+
FFF: wh,
|
|
6498
|
+
FFFF: Oh
|
|
6499
6499
|
};
|
|
6500
6500
|
class Ne {
|
|
6501
6501
|
static create(e, t = {}) {
|
|
@@ -6737,7 +6737,7 @@ class Ne {
|
|
|
6737
6737
|
return Nf(a, i(c, l));
|
|
6738
6738
|
}
|
|
6739
6739
|
}
|
|
6740
|
-
const
|
|
6740
|
+
const Vh = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
|
|
6741
6741
|
function mr(...r) {
|
|
6742
6742
|
const e = r.reduce((t, n) => t + n.source, "");
|
|
6743
6743
|
return RegExp(`^${e}$`);
|
|
@@ -6761,7 +6761,7 @@ function yr(r, ...e) {
|
|
|
6761
6761
|
}
|
|
6762
6762
|
return [null, null];
|
|
6763
6763
|
}
|
|
6764
|
-
function
|
|
6764
|
+
function Wh(...r) {
|
|
6765
6765
|
return (e, t) => {
|
|
6766
6766
|
const n = {};
|
|
6767
6767
|
let s;
|
|
@@ -6770,9 +6770,9 @@ function Bh(...r) {
|
|
|
6770
6770
|
return [n, null, t + s];
|
|
6771
6771
|
};
|
|
6772
6772
|
}
|
|
6773
|
-
const
|
|
6774
|
-
`${tc.source} ?(?:${
|
|
6775
|
-
), j_ = RegExp(`(?: ${
|
|
6773
|
+
const zh = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, F_ = `(?:${zh.source}?(?:\\[(${Vh.source})\\])?)?`, tc = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, Bh = RegExp(`${tc.source}${F_}`), rc = RegExp(`(?:[Tt]${Bh.source})?`), D_ = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, M_ = /(\d{4})-?W(\d\d)(?:-?(\d))?/, P_ = /(\d{4})-?(\d{3})/, q_ = Wh("weekYear", "weekNumber", "weekDay"), L_ = Wh("year", "ordinal"), $_ = /(\d{4})-(\d\d)-(\d\d)/, Zh = RegExp(
|
|
6774
|
+
`${tc.source} ?(?:${zh.source}|(${Vh.source}))?`
|
|
6775
|
+
), j_ = RegExp(`(?: ${Zh.source})?`);
|
|
6776
6776
|
function nr(r, e, t) {
|
|
6777
6777
|
const n = r[e];
|
|
6778
6778
|
return J(n) ? t : At(n);
|
|
@@ -6830,12 +6830,12 @@ const B_ = {
|
|
|
6830
6830
|
function nc(r, e, t, n, s, i, a) {
|
|
6831
6831
|
const o = {
|
|
6832
6832
|
year: e.length === 2 ? bo(At(e)) : At(e),
|
|
6833
|
-
month:
|
|
6833
|
+
month: Mh.indexOf(t) + 1,
|
|
6834
6834
|
day: At(n),
|
|
6835
6835
|
hour: At(s),
|
|
6836
6836
|
minute: At(i)
|
|
6837
6837
|
};
|
|
6838
|
-
return a && (o.second = At(a)), r && (o.weekday = r.length > 3 ?
|
|
6838
|
+
return a && (o.second = At(a)), r && (o.weekday = r.length > 3 ? qh.indexOf(r) + 1 : Lh.indexOf(r) + 1), o;
|
|
6839
6839
|
}
|
|
6840
6840
|
const Z_ = /^(?:(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)))$/;
|
|
6841
6841
|
function G_(r) {
|
|
@@ -6868,7 +6868,7 @@ function Q_(r) {
|
|
|
6868
6868
|
const [, e, t, n, s, i, a, o] = r;
|
|
6869
6869
|
return [nc(e, o, t, n, s, i, a), Me.utcInstance];
|
|
6870
6870
|
}
|
|
6871
|
-
const X_ = mr(D_, rc), ev = mr(M_, rc), tv = mr(P_, rc), rv = mr(
|
|
6871
|
+
const X_ = mr(D_, rc), ev = mr(M_, rc), tv = mr(P_, rc), rv = mr(Bh), Gh = pr(
|
|
6872
6872
|
U_,
|
|
6873
6873
|
gr,
|
|
6874
6874
|
Gr,
|
|
@@ -6891,7 +6891,7 @@ const X_ = mr(D_, rc), ev = mr(M_, rc), tv = mr(P_, rc), rv = mr(Gh), Kh = pr(
|
|
|
6891
6891
|
function av(r) {
|
|
6892
6892
|
return yr(
|
|
6893
6893
|
r,
|
|
6894
|
-
[X_,
|
|
6894
|
+
[X_, Gh],
|
|
6895
6895
|
[ev, nv],
|
|
6896
6896
|
[tv, sv],
|
|
6897
6897
|
[rv, iv]
|
|
@@ -6915,7 +6915,7 @@ const uv = pr(gr);
|
|
|
6915
6915
|
function fv(r) {
|
|
6916
6916
|
return yr(r, [V_, uv]);
|
|
6917
6917
|
}
|
|
6918
|
-
const dv = mr($_, j_), hv = mr(
|
|
6918
|
+
const dv = mr($_, j_), hv = mr(Zh), mv = pr(
|
|
6919
6919
|
gr,
|
|
6920
6920
|
Gr,
|
|
6921
6921
|
Hr
|
|
@@ -6923,11 +6923,11 @@ const dv = mr($_, j_), hv = mr(Hh), mv = pr(
|
|
|
6923
6923
|
function pv(r) {
|
|
6924
6924
|
return yr(
|
|
6925
6925
|
r,
|
|
6926
|
-
[dv,
|
|
6926
|
+
[dv, Gh],
|
|
6927
6927
|
[hv, mv]
|
|
6928
6928
|
);
|
|
6929
6929
|
}
|
|
6930
|
-
const Df = "Invalid Duration",
|
|
6930
|
+
const Df = "Invalid Duration", Hh = {
|
|
6931
6931
|
weeks: {
|
|
6932
6932
|
days: 7,
|
|
6933
6933
|
hours: 168,
|
|
@@ -6972,7 +6972,7 @@ const Df = "Invalid Duration", Yh = {
|
|
|
6972
6972
|
seconds: 720 * 60 * 60,
|
|
6973
6973
|
milliseconds: 720 * 60 * 60 * 1e3
|
|
6974
6974
|
},
|
|
6975
|
-
...
|
|
6975
|
+
...Hh
|
|
6976
6976
|
}, We = 146097 / 400, Kt = 146097 / 4800, gv = {
|
|
6977
6977
|
years: {
|
|
6978
6978
|
quarters: 4,
|
|
@@ -7001,7 +7001,7 @@ const Df = "Invalid Duration", Yh = {
|
|
|
7001
7001
|
seconds: Kt * 24 * 60 * 60,
|
|
7002
7002
|
milliseconds: Kt * 24 * 60 * 60 * 1e3
|
|
7003
7003
|
},
|
|
7004
|
-
...
|
|
7004
|
+
...Hh
|
|
7005
7005
|
}, Ut = [
|
|
7006
7006
|
"years",
|
|
7007
7007
|
"quarters",
|
|
@@ -7022,14 +7022,14 @@ function ut(r, e, t = !1) {
|
|
|
7022
7022
|
};
|
|
7023
7023
|
return new le(n);
|
|
7024
7024
|
}
|
|
7025
|
-
function
|
|
7025
|
+
function Kh(r, e) {
|
|
7026
7026
|
let t = e.milliseconds ?? 0;
|
|
7027
7027
|
for (const n of _v.slice(1))
|
|
7028
7028
|
e[n] && (t += e[n] * r[n].milliseconds);
|
|
7029
7029
|
return t;
|
|
7030
7030
|
}
|
|
7031
7031
|
function Mf(r, e) {
|
|
7032
|
-
const t =
|
|
7032
|
+
const t = Kh(r, e) < 0 ? -1 : 1;
|
|
7033
7033
|
Ut.reduceRight((n, s) => {
|
|
7034
7034
|
if (J(e[s]))
|
|
7035
7035
|
return n;
|
|
@@ -7204,7 +7204,7 @@ class le {
|
|
|
7204
7204
|
millisecond: "milliseconds",
|
|
7205
7205
|
milliseconds: "milliseconds"
|
|
7206
7206
|
}[e && e.toLowerCase()];
|
|
7207
|
-
if (!t) throw new
|
|
7207
|
+
if (!t) throw new nh(e);
|
|
7208
7208
|
return t;
|
|
7209
7209
|
}
|
|
7210
7210
|
/**
|
|
@@ -7364,7 +7364,7 @@ class le {
|
|
|
7364
7364
|
* @return {number}
|
|
7365
7365
|
*/
|
|
7366
7366
|
toMillis() {
|
|
7367
|
-
return this.isValid ?
|
|
7367
|
+
return this.isValid ? Kh(this.matrix, this.values) : NaN;
|
|
7368
7368
|
}
|
|
7369
7369
|
/**
|
|
7370
7370
|
* Returns an milliseconds value of this Duration. Alias of {@link toMillis}
|
|
@@ -7406,7 +7406,7 @@ class le {
|
|
|
7406
7406
|
if (!this.isValid) return this;
|
|
7407
7407
|
const t = {};
|
|
7408
7408
|
for (const n of Object.keys(this.values))
|
|
7409
|
-
t[n] =
|
|
7409
|
+
t[n] = Dh(e(this.values[n], n));
|
|
7410
7410
|
return ut(this, { values: t }, !0);
|
|
7411
7411
|
}
|
|
7412
7412
|
/**
|
|
@@ -8285,7 +8285,7 @@ class en {
|
|
|
8285
8285
|
* @return {Object}
|
|
8286
8286
|
*/
|
|
8287
8287
|
static features() {
|
|
8288
|
-
return { relative:
|
|
8288
|
+
return { relative: xh(), localeWeek: Nh() };
|
|
8289
8289
|
}
|
|
8290
8290
|
}
|
|
8291
8291
|
function qf(r, e) {
|
|
@@ -8324,12 +8324,12 @@ const Ov = "missing Intl.DateTimeFormat.formatToParts support";
|
|
|
8324
8324
|
function fe(r, e = (t) => t) {
|
|
8325
8325
|
return { regex: r, deser: ([t]) => e(d_(t)) };
|
|
8326
8326
|
}
|
|
8327
|
-
const Ev = " ",
|
|
8327
|
+
const Ev = " ", Yh = `[ ${Ev}]`, Jh = new RegExp(Yh, "g");
|
|
8328
8328
|
function Sv(r) {
|
|
8329
|
-
return r.replace(/\./g, "\\.?").replace(
|
|
8329
|
+
return r.replace(/\./g, "\\.?").replace(Jh, Yh);
|
|
8330
8330
|
}
|
|
8331
8331
|
function Lf(r) {
|
|
8332
|
-
return r.replace(/\./g, "").replace(
|
|
8332
|
+
return r.replace(/\./g, "").replace(Jh, " ").toLowerCase();
|
|
8333
8333
|
}
|
|
8334
8334
|
function Xe(r, e) {
|
|
8335
8335
|
return r === null ? null : {
|
|
@@ -8347,10 +8347,10 @@ function Tv(r) {
|
|
|
8347
8347
|
return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
8348
8348
|
}
|
|
8349
8349
|
function Rv(r, e) {
|
|
8350
|
-
const t = Qe(e), n = Qe(e, "{2}"), s = Qe(e, "{3}"), i = Qe(e, "{4}"), a = Qe(e, "{6}"), o = Qe(e, "{1,2}"), c = Qe(e, "{1,3}"), l = Qe(e, "{1,6}"), u = Qe(e, "{1,9}"), f = Qe(e, "{2,4}"), d = Qe(e, "{4,6}"), h = (
|
|
8350
|
+
const t = Qe(e), n = Qe(e, "{2}"), s = Qe(e, "{3}"), i = Qe(e, "{4}"), a = Qe(e, "{6}"), o = Qe(e, "{1,2}"), c = Qe(e, "{1,3}"), l = Qe(e, "{1,6}"), u = Qe(e, "{1,9}"), f = Qe(e, "{2,4}"), d = Qe(e, "{4,6}"), h = (y) => ({ regex: RegExp(Tv(y.val)), deser: ([O]) => O, literal: !0 }), v = ((y) => {
|
|
8351
8351
|
if (r.literal)
|
|
8352
|
-
return h(
|
|
8353
|
-
switch (
|
|
8352
|
+
return h(y);
|
|
8353
|
+
switch (y.val) {
|
|
8354
8354
|
// era
|
|
8355
8355
|
case "G":
|
|
8356
8356
|
return Xe(e.eras("short"), 0);
|
|
@@ -8465,7 +8465,7 @@ function Rv(r, e) {
|
|
|
8465
8465
|
case " ":
|
|
8466
8466
|
return tn(/[^\S\n\r]/);
|
|
8467
8467
|
default:
|
|
8468
|
-
return h(
|
|
8468
|
+
return h(y);
|
|
8469
8469
|
}
|
|
8470
8470
|
})(r) || {
|
|
8471
8471
|
invalidReason: Ov
|
|
@@ -8597,15 +8597,15 @@ function Nv() {
|
|
|
8597
8597
|
function Fv(r, e) {
|
|
8598
8598
|
if (r.literal)
|
|
8599
8599
|
return r;
|
|
8600
|
-
const t = Ne.macroTokenToFormatOpts(r.val), n =
|
|
8600
|
+
const t = Ne.macroTokenToFormatOpts(r.val), n = tm(t, e);
|
|
8601
8601
|
return n == null || n.includes(void 0) ? r : n;
|
|
8602
8602
|
}
|
|
8603
|
-
function
|
|
8603
|
+
function Qh(r, e) {
|
|
8604
8604
|
return Array.prototype.concat(...r.map((t) => Fv(t, e)));
|
|
8605
8605
|
}
|
|
8606
|
-
class
|
|
8606
|
+
class Xh {
|
|
8607
8607
|
constructor(e, t) {
|
|
8608
|
-
if (this.locale = e, this.format = t, this.tokens =
|
|
8608
|
+
if (this.locale = e, this.format = t, this.tokens = Qh(Ne.parseFormat(t), e), this.units = this.tokens.map((n) => Rv(n, e)), this.disqualifyingUnit = this.units.find((n) => n.invalidReason), !this.disqualifyingUnit) {
|
|
8609
8609
|
const [n, s] = kv(this.units);
|
|
8610
8610
|
this.regex = RegExp(n, "i"), this.handlers = s;
|
|
8611
8611
|
}
|
|
@@ -8637,14 +8637,14 @@ class tm {
|
|
|
8637
8637
|
return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;
|
|
8638
8638
|
}
|
|
8639
8639
|
}
|
|
8640
|
-
function
|
|
8641
|
-
return new
|
|
8640
|
+
function em(r, e, t) {
|
|
8641
|
+
return new Xh(r, t).explainFromTokens(e);
|
|
8642
8642
|
}
|
|
8643
8643
|
function Dv(r, e, t) {
|
|
8644
|
-
const { result: n, zone: s, specificOffset: i, invalidReason: a } =
|
|
8644
|
+
const { result: n, zone: s, specificOffset: i, invalidReason: a } = em(r, e, t);
|
|
8645
8645
|
return [n, s, i, a];
|
|
8646
8646
|
}
|
|
8647
|
-
function
|
|
8647
|
+
function tm(r, e) {
|
|
8648
8648
|
if (!r)
|
|
8649
8649
|
return null;
|
|
8650
8650
|
const n = Ne.create(e, r).dtFormatter(Nv()), s = n.formatToParts(), i = n.resolvedOptions();
|
|
@@ -8675,7 +8675,7 @@ function qt(r, e) {
|
|
|
8675
8675
|
};
|
|
8676
8676
|
return new z({ ...t, ...e, old: t });
|
|
8677
8677
|
}
|
|
8678
|
-
function
|
|
8678
|
+
function rm(r, e, t) {
|
|
8679
8679
|
let n = r - e * 60 * 1e3;
|
|
8680
8680
|
const s = t.offset(n);
|
|
8681
8681
|
if (e === s)
|
|
@@ -8698,7 +8698,7 @@ function rn(r, e) {
|
|
|
8698
8698
|
};
|
|
8699
8699
|
}
|
|
8700
8700
|
function an(r, e, t) {
|
|
8701
|
-
return
|
|
8701
|
+
return rm($n(r), e, t);
|
|
8702
8702
|
}
|
|
8703
8703
|
function Uf(r, e) {
|
|
8704
8704
|
const t = r.o, n = r.c.year + Math.trunc(e.years), s = r.c.month + Math.trunc(e.months) + Math.trunc(e.quarters) * 3, i = {
|
|
@@ -8717,7 +8717,7 @@ function Uf(r, e) {
|
|
|
8717
8717
|
seconds: e.seconds,
|
|
8718
8718
|
milliseconds: e.milliseconds
|
|
8719
8719
|
}).as("milliseconds"), o = $n(i);
|
|
8720
|
-
let [c, l] =
|
|
8720
|
+
let [c, l] = rm(o, t, r.zone);
|
|
8721
8721
|
return a !== 0 && (c += a, l = r.zone.offset(c)), { ts: c, o: l };
|
|
8722
8722
|
}
|
|
8723
8723
|
function Jt(r, e, t, n, s, i) {
|
|
@@ -8771,7 +8771,7 @@ function Vf(r, e, t, n, s, i, a) {
|
|
|
8771
8771
|
}
|
|
8772
8772
|
return s && (r.isOffsetFixed && r.offset === 0 && !i ? c += "Z" : r.o < 0 ? (c += "-", c += Re(Math.trunc(-r.o / 60)), c += ":", c += Re(Math.trunc(-r.o % 60))) : (c += "+", c += Re(Math.trunc(r.o / 60)), c += ":", c += Re(Math.trunc(r.o % 60)))), i && (c += "[" + r.zone.ianaName + "]"), c;
|
|
8773
8773
|
}
|
|
8774
|
-
const
|
|
8774
|
+
const nm = {
|
|
8775
8775
|
month: 1,
|
|
8776
8776
|
day: 1,
|
|
8777
8777
|
hour: 0,
|
|
@@ -8827,7 +8827,7 @@ function cn(r) {
|
|
|
8827
8827
|
weekyears: "weekYear",
|
|
8828
8828
|
ordinal: "ordinal"
|
|
8829
8829
|
}[r.toLowerCase()];
|
|
8830
|
-
if (!e) throw new
|
|
8830
|
+
if (!e) throw new nh(r);
|
|
8831
8831
|
return e;
|
|
8832
8832
|
}
|
|
8833
8833
|
function Wf(r) {
|
|
@@ -8862,8 +8862,8 @@ function zf(r, e) {
|
|
|
8862
8862
|
s = be.now();
|
|
8863
8863
|
else {
|
|
8864
8864
|
for (const c of on)
|
|
8865
|
-
J(r[c]) && (r[c] =
|
|
8866
|
-
const a =
|
|
8865
|
+
J(r[c]) && (r[c] = nm[c]);
|
|
8866
|
+
const a = kh(r) || Ih(r);
|
|
8867
8867
|
if (a)
|
|
8868
8868
|
return z.invalid(a);
|
|
8869
8869
|
const o = $v(t);
|
|
@@ -9077,20 +9077,20 @@ class z {
|
|
|
9077
9077
|
if (d && u)
|
|
9078
9078
|
throw new er("Can't mix ordinal dates with month/day");
|
|
9079
9079
|
const v = p || i.weekday && !h;
|
|
9080
|
-
let
|
|
9081
|
-
v ? (
|
|
9080
|
+
let y, O, R = rn(c, l);
|
|
9081
|
+
v ? (y = qv, O = Mv, R = wn(R, a, o)) : u ? (y = Lv, O = Pv, R = Oa(R)) : (y = on, O = nm);
|
|
9082
9082
|
let C = !1;
|
|
9083
|
-
for (const
|
|
9084
|
-
const A = i[
|
|
9085
|
-
J(A) ? C ? i[
|
|
9083
|
+
for (const _ of y) {
|
|
9084
|
+
const A = i[_];
|
|
9085
|
+
J(A) ? C ? i[_] = O[_] : i[_] = R[_] : C = !0;
|
|
9086
9086
|
}
|
|
9087
|
-
const w = v ? m_(i, a, o) : u ? p_(i) :
|
|
9087
|
+
const w = v ? m_(i, a, o) : u ? p_(i) : kh(i), E = w || Ih(i);
|
|
9088
9088
|
if (E)
|
|
9089
9089
|
return z.invalid(E);
|
|
9090
|
-
const I = v ? Af(i, a, o) : u ? Cf(i) : i, [T,
|
|
9090
|
+
const I = v ? Af(i, a, o) : u ? Cf(i) : i, [T, g] = an(I, l, n), N = new z({
|
|
9091
9091
|
ts: T,
|
|
9092
9092
|
zone: n,
|
|
9093
|
-
o:
|
|
9093
|
+
o: g,
|
|
9094
9094
|
loc: s
|
|
9095
9095
|
});
|
|
9096
9096
|
return i.weekday && h && e.weekday !== N.weekday ? z.invalid(
|
|
@@ -9242,7 +9242,7 @@ class z {
|
|
|
9242
9242
|
* @returns {string}
|
|
9243
9243
|
*/
|
|
9244
9244
|
static parseFormatForOpts(e, t = {}) {
|
|
9245
|
-
const n =
|
|
9245
|
+
const n = tm(e, he.fromObject(t));
|
|
9246
9246
|
return n ? n.map((s) => s ? s.val : null).join("") : null;
|
|
9247
9247
|
}
|
|
9248
9248
|
/**
|
|
@@ -9253,7 +9253,7 @@ class z {
|
|
|
9253
9253
|
* @returns {string}
|
|
9254
9254
|
*/
|
|
9255
9255
|
static expandFormat(e, t = {}) {
|
|
9256
|
-
return
|
|
9256
|
+
return Qh(Ne.parseFormat(e), he.fromObject(t)).map((s) => s.val).join("");
|
|
9257
9257
|
}
|
|
9258
9258
|
static resetCache() {
|
|
9259
9259
|
Ar = void 0, Oo.clear();
|
|
@@ -10246,7 +10246,7 @@ class z {
|
|
|
10246
10246
|
numberingSystem: i,
|
|
10247
10247
|
defaultToEN: !0
|
|
10248
10248
|
});
|
|
10249
|
-
return
|
|
10249
|
+
return em(a, e, t);
|
|
10250
10250
|
}
|
|
10251
10251
|
/**
|
|
10252
10252
|
* @deprecated use fromFormatExplain instead
|
|
@@ -10272,7 +10272,7 @@ class z {
|
|
|
10272
10272
|
numberingSystem: s,
|
|
10273
10273
|
defaultToEN: !0
|
|
10274
10274
|
});
|
|
10275
|
-
return new
|
|
10275
|
+
return new Xh(i, e);
|
|
10276
10276
|
}
|
|
10277
10277
|
/**
|
|
10278
10278
|
* Create a DateTime from an input string and format parser.
|
|
@@ -10321,7 +10321,7 @@ class z {
|
|
|
10321
10321
|
* @type {Object}
|
|
10322
10322
|
*/
|
|
10323
10323
|
static get DATE_MED() {
|
|
10324
|
-
return
|
|
10324
|
+
return sh;
|
|
10325
10325
|
}
|
|
10326
10326
|
/**
|
|
10327
10327
|
* {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'
|
|
@@ -10335,98 +10335,98 @@ class z {
|
|
|
10335
10335
|
* @type {Object}
|
|
10336
10336
|
*/
|
|
10337
10337
|
static get DATE_FULL() {
|
|
10338
|
-
return
|
|
10338
|
+
return ih;
|
|
10339
10339
|
}
|
|
10340
10340
|
/**
|
|
10341
10341
|
* {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'
|
|
10342
10342
|
* @type {Object}
|
|
10343
10343
|
*/
|
|
10344
10344
|
static get DATE_HUGE() {
|
|
10345
|
-
return
|
|
10345
|
+
return ah;
|
|
10346
10346
|
}
|
|
10347
10347
|
/**
|
|
10348
10348
|
* {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.
|
|
10349
10349
|
* @type {Object}
|
|
10350
10350
|
*/
|
|
10351
10351
|
static get TIME_SIMPLE() {
|
|
10352
|
-
return
|
|
10352
|
+
return oh;
|
|
10353
10353
|
}
|
|
10354
10354
|
/**
|
|
10355
10355
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.
|
|
10356
10356
|
* @type {Object}
|
|
10357
10357
|
*/
|
|
10358
10358
|
static get TIME_WITH_SECONDS() {
|
|
10359
|
-
return
|
|
10359
|
+
return ch;
|
|
10360
10360
|
}
|
|
10361
10361
|
/**
|
|
10362
10362
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.
|
|
10363
10363
|
* @type {Object}
|
|
10364
10364
|
*/
|
|
10365
10365
|
static get TIME_WITH_SHORT_OFFSET() {
|
|
10366
|
-
return
|
|
10366
|
+
return lh;
|
|
10367
10367
|
}
|
|
10368
10368
|
/**
|
|
10369
10369
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
10370
10370
|
* @type {Object}
|
|
10371
10371
|
*/
|
|
10372
10372
|
static get TIME_WITH_LONG_OFFSET() {
|
|
10373
|
-
return
|
|
10373
|
+
return uh;
|
|
10374
10374
|
}
|
|
10375
10375
|
/**
|
|
10376
10376
|
* {@link DateTime#toLocaleString} format like '09:30', always 24-hour.
|
|
10377
10377
|
* @type {Object}
|
|
10378
10378
|
*/
|
|
10379
10379
|
static get TIME_24_SIMPLE() {
|
|
10380
|
-
return
|
|
10380
|
+
return fh;
|
|
10381
10381
|
}
|
|
10382
10382
|
/**
|
|
10383
10383
|
* {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.
|
|
10384
10384
|
* @type {Object}
|
|
10385
10385
|
*/
|
|
10386
10386
|
static get TIME_24_WITH_SECONDS() {
|
|
10387
|
-
return
|
|
10387
|
+
return dh;
|
|
10388
10388
|
}
|
|
10389
10389
|
/**
|
|
10390
10390
|
* {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.
|
|
10391
10391
|
* @type {Object}
|
|
10392
10392
|
*/
|
|
10393
10393
|
static get TIME_24_WITH_SHORT_OFFSET() {
|
|
10394
|
-
return
|
|
10394
|
+
return hh;
|
|
10395
10395
|
}
|
|
10396
10396
|
/**
|
|
10397
10397
|
* {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.
|
|
10398
10398
|
* @type {Object}
|
|
10399
10399
|
*/
|
|
10400
10400
|
static get TIME_24_WITH_LONG_OFFSET() {
|
|
10401
|
-
return
|
|
10401
|
+
return mh;
|
|
10402
10402
|
}
|
|
10403
10403
|
/**
|
|
10404
10404
|
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
10405
10405
|
* @type {Object}
|
|
10406
10406
|
*/
|
|
10407
10407
|
static get DATETIME_SHORT() {
|
|
10408
|
-
return
|
|
10408
|
+
return ph;
|
|
10409
10409
|
}
|
|
10410
10410
|
/**
|
|
10411
10411
|
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
10412
10412
|
* @type {Object}
|
|
10413
10413
|
*/
|
|
10414
10414
|
static get DATETIME_SHORT_WITH_SECONDS() {
|
|
10415
|
-
return
|
|
10415
|
+
return yh;
|
|
10416
10416
|
}
|
|
10417
10417
|
/**
|
|
10418
10418
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
10419
10419
|
* @type {Object}
|
|
10420
10420
|
*/
|
|
10421
10421
|
static get DATETIME_MED() {
|
|
10422
|
-
return
|
|
10422
|
+
return gh;
|
|
10423
10423
|
}
|
|
10424
10424
|
/**
|
|
10425
10425
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
10426
10426
|
* @type {Object}
|
|
10427
10427
|
*/
|
|
10428
10428
|
static get DATETIME_MED_WITH_SECONDS() {
|
|
10429
|
-
return
|
|
10429
|
+
return _h;
|
|
10430
10430
|
}
|
|
10431
10431
|
/**
|
|
10432
10432
|
* {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
@@ -10440,28 +10440,28 @@ class z {
|
|
|
10440
10440
|
* @type {Object}
|
|
10441
10441
|
*/
|
|
10442
10442
|
static get DATETIME_FULL() {
|
|
10443
|
-
return
|
|
10443
|
+
return vh;
|
|
10444
10444
|
}
|
|
10445
10445
|
/**
|
|
10446
10446
|
* {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.
|
|
10447
10447
|
* @type {Object}
|
|
10448
10448
|
*/
|
|
10449
10449
|
static get DATETIME_FULL_WITH_SECONDS() {
|
|
10450
|
-
return
|
|
10450
|
+
return wh;
|
|
10451
10451
|
}
|
|
10452
10452
|
/**
|
|
10453
10453
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
10454
10454
|
* @type {Object}
|
|
10455
10455
|
*/
|
|
10456
10456
|
static get DATETIME_HUGE() {
|
|
10457
|
-
return
|
|
10457
|
+
return bh;
|
|
10458
10458
|
}
|
|
10459
10459
|
/**
|
|
10460
10460
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
10461
10461
|
* @type {Object}
|
|
10462
10462
|
*/
|
|
10463
10463
|
static get DATETIME_HUGE_WITH_SECONDS() {
|
|
10464
|
-
return
|
|
10464
|
+
return Oh;
|
|
10465
10465
|
}
|
|
10466
10466
|
}
|
|
10467
10467
|
function vr(r) {
|
|
@@ -10481,42 +10481,42 @@ const Gf = async (r, e) => {
|
|
|
10481
10481
|
if (!t.valid)
|
|
10482
10482
|
throw new Error(`VALIDATION_ERROR: ${t.message}`);
|
|
10483
10483
|
}
|
|
10484
|
-
},
|
|
10484
|
+
}, sm = async (r, e, t, n, s, i) => {
|
|
10485
10485
|
await Gf(n.custom?.preValidate, s);
|
|
10486
10486
|
for (const o of n.fields)
|
|
10487
10487
|
await Gf(o.custom?.preValidate, s);
|
|
10488
10488
|
return Ug(r, t, i).parse(e), e;
|
|
10489
|
-
}, sc = (r, e, t, n, s, i, a, o, c, l, u, f, d, h, p, v,
|
|
10489
|
+
}, sc = (r, e, t, n, s, i, a, o, c, l, u, f, d, h, p, v, y, O, R, C, w) => {
|
|
10490
10490
|
const { fields: E } = a;
|
|
10491
|
-
E.filter((
|
|
10492
|
-
r !== "delete" && (typeof s[
|
|
10491
|
+
E.filter((g) => "unique" in g && g.unique).forEach((g) => {
|
|
10492
|
+
r !== "delete" && (typeof s[g.name] == "string" || typeof s[g.name] == "number") && e.set(h(g, s[g.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||")), {
|
|
10493
10493
|
id: n,
|
|
10494
10494
|
Collection_Path: t
|
|
10495
10495
|
});
|
|
10496
|
-
}), E.forEach((
|
|
10497
|
-
if (ag(
|
|
10498
|
-
const N = lg(
|
|
10499
|
-
s[
|
|
10500
|
-
s[A.name] !== void 0 && (_e(A) ?
|
|
10501
|
-
}), Object.keys(
|
|
10496
|
+
}), E.forEach((g) => {
|
|
10497
|
+
if (ag(g, a, i)) {
|
|
10498
|
+
const N = lg(g, a, i), _ = {};
|
|
10499
|
+
s[g.name] !== void 0 && (_[g.name] = s[g.name], _e(g) && (_[`${g.name}_Array`] = s[`${g.name}_Array`])), N.forEach((A) => {
|
|
10500
|
+
s[A.name] !== void 0 && (_e(A) ? _[`${A.name}_Array`] = s[`${A.name}_Array`] : _[A.name] = s[A.name]);
|
|
10501
|
+
}), Object.keys(_).length > 0 && (r === "create" && (_.Collection_Path = t, _.Collection_Path_String = t.join("/"), e.set(d(g), _)), r === "update" && e.update(d(g), _), r === "delete" && e.delete(d(g)));
|
|
10502
10502
|
}
|
|
10503
10503
|
});
|
|
10504
10504
|
const I = c[a.labels.collection];
|
|
10505
|
-
for (const
|
|
10506
|
-
const N = ug(
|
|
10505
|
+
for (const g of I) {
|
|
10506
|
+
const N = ug(g, a), _ = { ...s };
|
|
10507
10507
|
N.forEach((A) => {
|
|
10508
|
-
delete
|
|
10509
|
-
}), Object.keys(
|
|
10508
|
+
delete _[A.name], delete _[`${A.name}_Array`], delete _[`${A.name}_Single`], delete _[`${A.name}_Lowercase`];
|
|
10509
|
+
}), Object.keys(_).length > 0 && (r === "create" && (_.Collection_Path ||= t, _.Collection_Path_String = t.join("/"), e.set(p(g.key), _)), r === "update" && e.update(p(g.key), _), r === "delete" && e.delete(p(g.key)));
|
|
10510
10510
|
}
|
|
10511
10511
|
if (r === "delete")
|
|
10512
10512
|
return;
|
|
10513
|
-
const T = E.filter((
|
|
10513
|
+
const T = E.filter((g) => _e(g) && g.twoWay);
|
|
10514
10514
|
if (!o?.noTwoWay) {
|
|
10515
|
-
for (const
|
|
10515
|
+
for (const g of T)
|
|
10516
10516
|
throw new Error("VALIDATION_ERROR: batchSize is required");
|
|
10517
|
-
for (const
|
|
10517
|
+
for (const g of T)
|
|
10518
10518
|
throw new Error("VALIDATION_ERROR: batchSize is required");
|
|
10519
|
-
for (const
|
|
10519
|
+
for (const g of T)
|
|
10520
10520
|
throw new Error("VALIDATION_ERROR: batchSize is required");
|
|
10521
10521
|
}
|
|
10522
10522
|
};
|
|
@@ -10562,10 +10562,10 @@ function Wv() {
|
|
|
10562
10562
|
return xa = t, xa;
|
|
10563
10563
|
}
|
|
10564
10564
|
var Na, Qf;
|
|
10565
|
-
function
|
|
10565
|
+
function im() {
|
|
10566
10566
|
if (Qf) return Na;
|
|
10567
10567
|
Qf = 1;
|
|
10568
|
-
var r =
|
|
10568
|
+
var r = Id(), e = Wo(), t = Do(), n = Nd(), s = Object.getOwnPropertySymbols, i = s ? function(a) {
|
|
10569
10569
|
for (var o = []; a; )
|
|
10570
10570
|
r(o, t(a)), a = e(a);
|
|
10571
10571
|
return o;
|
|
@@ -10576,7 +10576,7 @@ var Fa, Xf;
|
|
|
10576
10576
|
function zv() {
|
|
10577
10577
|
if (Xf) return Fa;
|
|
10578
10578
|
Xf = 1;
|
|
10579
|
-
var r = Vr(), e =
|
|
10579
|
+
var r = Vr(), e = im();
|
|
10580
10580
|
function t(n, s) {
|
|
10581
10581
|
return r(n, e(n), s);
|
|
10582
10582
|
}
|
|
@@ -10586,7 +10586,7 @@ var Da, ed;
|
|
|
10586
10586
|
function Bv() {
|
|
10587
10587
|
if (ed) return Da;
|
|
10588
10588
|
ed = 1;
|
|
10589
|
-
var r =
|
|
10589
|
+
var r = xd(), e = im(), t = Wr();
|
|
10590
10590
|
function n(s) {
|
|
10591
10591
|
return r(s, t, e);
|
|
10592
10592
|
}
|
|
@@ -10639,10 +10639,10 @@ var $a, id;
|
|
|
10639
10639
|
function Yv() {
|
|
10640
10640
|
if (id) return $a;
|
|
10641
10641
|
id = 1;
|
|
10642
|
-
var r = Vo(), e = Gv(), t = Hv(), n = Kv(), s =
|
|
10643
|
-
function
|
|
10642
|
+
var r = Vo(), e = Gv(), t = Hv(), n = Kv(), s = Vd(), i = "[object Boolean]", a = "[object Date]", o = "[object Map]", c = "[object Number]", l = "[object RegExp]", u = "[object Set]", f = "[object String]", d = "[object Symbol]", h = "[object ArrayBuffer]", p = "[object DataView]", v = "[object Float32Array]", y = "[object Float64Array]", O = "[object Int8Array]", R = "[object Int16Array]", C = "[object Int32Array]", w = "[object Uint8Array]", E = "[object Uint8ClampedArray]", I = "[object Uint16Array]", T = "[object Uint32Array]";
|
|
10643
|
+
function g(N, _, A) {
|
|
10644
10644
|
var b = N.constructor;
|
|
10645
|
-
switch (
|
|
10645
|
+
switch (_) {
|
|
10646
10646
|
case h:
|
|
10647
10647
|
return r(N);
|
|
10648
10648
|
case i:
|
|
@@ -10651,7 +10651,7 @@ function Yv() {
|
|
|
10651
10651
|
case p:
|
|
10652
10652
|
return e(N, A);
|
|
10653
10653
|
case v:
|
|
10654
|
-
case
|
|
10654
|
+
case y:
|
|
10655
10655
|
case O:
|
|
10656
10656
|
case R:
|
|
10657
10657
|
case C:
|
|
@@ -10673,7 +10673,7 @@ function Yv() {
|
|
|
10673
10673
|
return n(N);
|
|
10674
10674
|
}
|
|
10675
10675
|
}
|
|
10676
|
-
return $a =
|
|
10676
|
+
return $a = g, $a;
|
|
10677
10677
|
}
|
|
10678
10678
|
var ja, ad;
|
|
10679
10679
|
function Jv() {
|
|
@@ -10713,10 +10713,10 @@ var za, ud;
|
|
|
10713
10713
|
function tw() {
|
|
10714
10714
|
if (ud) return za;
|
|
10715
10715
|
ud = 1;
|
|
10716
|
-
var r = Fo(), e = jv(), t = zo(), n = Uv(), s = Vv(), i =
|
|
10717
|
-
X[N] = X[
|
|
10716
|
+
var r = Fo(), e = jv(), t = zo(), n = Uv(), s = Vv(), i = Ud(), a = Wd(), o = Wv(), c = zv(), l = qd(), u = Bv(), f = Mn(), d = Zv(), h = Yv(), p = zd(), v = Dt(), y = Fn(), O = Qv(), R = vt(), C = ew(), w = jo(), E = Wr(), I = 1, T = 2, g = 4, N = "[object Arguments]", _ = "[object Array]", A = "[object Boolean]", b = "[object Date]", m = "[object Error]", S = "[object Function]", k = "[object GeneratorFunction]", D = "[object Map]", x = "[object Number]", M = "[object Object]", $ = "[object RegExp]", G = "[object Set]", ae = "[object String]", P = "[object Symbol]", B = "[object WeakMap]", te = "[object ArrayBuffer]", Je = "[object DataView]", Ve = "[object Float32Array]", Ce = "[object Float64Array]", st = "[object Int8Array]", Z = "[object Int16Array]", H = "[object Int32Array]", j = "[object Uint8Array]", Y = "[object Uint8ClampedArray]", W = "[object Uint16Array]", de = "[object Uint32Array]", X = {};
|
|
10717
|
+
X[N] = X[_] = X[te] = X[Je] = X[A] = X[b] = X[Ve] = X[Ce] = X[st] = X[Z] = X[H] = X[D] = X[x] = X[M] = X[$] = X[G] = X[ae] = X[P] = X[j] = X[Y] = X[W] = X[de] = !0, X[m] = X[S] = X[B] = !1;
|
|
10718
10718
|
function me(K, ne, Ie, Gt, bt, it) {
|
|
10719
|
-
var De, Se = ne & I, Ot = ne & T,
|
|
10719
|
+
var De, Se = ne & I, Ot = ne & T, Am = ne & g;
|
|
10720
10720
|
if (Ie && (De = bt ? Ie(K, Gt, bt, it) : Ie(K)), De !== void 0)
|
|
10721
10721
|
return De;
|
|
10722
10722
|
if (!R(K))
|
|
@@ -10727,7 +10727,7 @@ function tw() {
|
|
|
10727
10727
|
return a(K, De);
|
|
10728
10728
|
} else {
|
|
10729
10729
|
var Ht = f(K), yc = Ht == S || Ht == k;
|
|
10730
|
-
if (
|
|
10730
|
+
if (y(K))
|
|
10731
10731
|
return i(K, Se);
|
|
10732
10732
|
if (Ht == M || Ht == N || yc && !bt) {
|
|
10733
10733
|
if (De = Ot || yc ? {} : p(K), !Se)
|
|
@@ -10747,7 +10747,7 @@ function tw() {
|
|
|
10747
10747
|
}) : O(K) && K.forEach(function(Et, Mt) {
|
|
10748
10748
|
De.set(Mt, me(Et, ne, Ie, Mt, K, it));
|
|
10749
10749
|
});
|
|
10750
|
-
var
|
|
10750
|
+
var Cm = Am ? Ot ? u : l : Ot ? E : w, _c = pc ? void 0 : Cm(K);
|
|
10751
10751
|
return e(_c || K, function(Et, Mt) {
|
|
10752
10752
|
_c && (Mt = Et, Et = K[Mt]), t(De, Mt, me(Et, ne, Ie, Mt, K, it));
|
|
10753
10753
|
}), De;
|
|
@@ -10812,14 +10812,14 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10812
10812
|
return !1;
|
|
10813
10813
|
}
|
|
10814
10814
|
return !(new Blob([r]).size > 1500);
|
|
10815
|
-
},
|
|
10815
|
+
}, am = (r, e) => {
|
|
10816
10816
|
const t = Object.keys(r);
|
|
10817
10817
|
e.forEach((n) => {
|
|
10818
10818
|
n in t || e.delete(n);
|
|
10819
10819
|
}), t.forEach((n) => {
|
|
10820
10820
|
e.add(n);
|
|
10821
10821
|
}), e.has("id") || e.add("id");
|
|
10822
|
-
},
|
|
10822
|
+
}, om = (r, e) => {
|
|
10823
10823
|
Object.keys(r).forEach((t) => {
|
|
10824
10824
|
let n = !1;
|
|
10825
10825
|
e.forEach((s) => {
|
|
@@ -10857,7 +10857,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10857
10857
|
const o = s.collections[a], { labels: c, fields: l, preloadCache: u } = o, f = lt(a), d = i.collections?.[c.collection];
|
|
10858
10858
|
if (!i.Role)
|
|
10859
10859
|
throw new Error("PERMISSION_DENIED");
|
|
10860
|
-
const h = d && _t("Read", d), p = An(o, s, i), v =
|
|
10860
|
+
const h = d && _t("Read", d), p = An(o, s, i), v = Ed(o, i), y = ko(o, i), O = Sd(o, s, i), R = (m = []) => {
|
|
10861
10861
|
const S = [];
|
|
10862
10862
|
if (h)
|
|
10863
10863
|
S.push(pe(Mr(n, "system_fields", c.collection, `${c.collection}-${e.key}`), ge("Collection_Path_String", "==", r.join("/")), ...m));
|
|
@@ -10866,7 +10866,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10866
10866
|
S.push(pe(Mr(n, "system_fields", c.collection, `${c.collection}-${k.field}`), ge("Collection_Path_String", "==", r.join("/")), ...m));
|
|
10867
10867
|
return S;
|
|
10868
10868
|
}, C = v.filter((m) => "operations" in m && m.operations ? m.operations.includes("Read") : !0);
|
|
10869
|
-
if (t || C.length === 0 &&
|
|
10869
|
+
if (t || C.length === 0 && y.length === 0 && O.length === 0)
|
|
10870
10870
|
return R();
|
|
10871
10871
|
let w = 0;
|
|
10872
10872
|
const E = (m) => {
|
|
@@ -10884,11 +10884,11 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10884
10884
|
u?.roles.includes(i.Role) && u.range && E(u.range.fields.length);
|
|
10885
10885
|
const I = f.admin?.statusField;
|
|
10886
10886
|
I && !u?.roles.includes(i.Role) && E(Math.max(I.active?.length || 0, I.archived?.length || 0));
|
|
10887
|
-
const T = w === 0 ? 30 : Math.max(1, Math.floor(30 / w)),
|
|
10888
|
-
C.filter((m) => m.type === "Record_Owner").forEach(() =>
|
|
10887
|
+
const T = w === 0 ? 30 : Math.max(1, Math.floor(30 / w)), g = [];
|
|
10888
|
+
C.filter((m) => m.type === "Record_Owner").forEach(() => g.push(ge("Created_By", "==", i.User_ID))), C.filter((m) => m.type === "Record_User").forEach((m) => {
|
|
10889
10889
|
if ("collectionField" in m) {
|
|
10890
10890
|
const S = re(l, m.collectionField);
|
|
10891
|
-
|
|
10891
|
+
g.push(ge(`${S.name}_Array`, "array-contains", i.Doc_ID));
|
|
10892
10892
|
}
|
|
10893
10893
|
}), C.filter((m) => m.type === "Record_Property").forEach((m) => {
|
|
10894
10894
|
if ("propertyField" in m) {
|
|
@@ -10896,11 +10896,11 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10896
10896
|
if (!S)
|
|
10897
10897
|
throw new Error("PERMISSION_DENIED");
|
|
10898
10898
|
const k = re(l, m.propertyField);
|
|
10899
|
-
k.type === "Array" ?
|
|
10899
|
+
k.type === "Array" ? g.push(ge(k.name, "array-contains-any", S.values)) : g.push(ge(k.name, "in", S.values));
|
|
10900
10900
|
}
|
|
10901
10901
|
});
|
|
10902
10902
|
const N = [];
|
|
10903
|
-
|
|
10903
|
+
y.filter((m) => m.type === "Individual").forEach((m) => {
|
|
10904
10904
|
const S = d?.individualEntities, k = [];
|
|
10905
10905
|
if (S) {
|
|
10906
10906
|
const D = m.singleQuery ? m.singleQuery : T;
|
|
@@ -10910,12 +10910,12 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10910
10910
|
}
|
|
10911
10911
|
if (!m.singleQuery)
|
|
10912
10912
|
k.forEach((x) => {
|
|
10913
|
-
N.push(...R(
|
|
10913
|
+
N.push(...R(g.concat(ge("id", "in", x))));
|
|
10914
10914
|
});
|
|
10915
10915
|
else {
|
|
10916
10916
|
if (S.length > D)
|
|
10917
10917
|
throw new Error(`INPUT_ERROR: Individual entity restriction with singleQuery set to true must not have more than ${m.singleQuery} entities`);
|
|
10918
|
-
|
|
10918
|
+
g.push(ge("id", "in", S));
|
|
10919
10919
|
}
|
|
10920
10920
|
}
|
|
10921
10921
|
}), O.filter((m) => m.parentFilter.type === "Individual").forEach((m) => {
|
|
@@ -10935,19 +10935,19 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10935
10935
|
}
|
|
10936
10936
|
if (!k.singleQuery)
|
|
10937
10937
|
$.forEach((ae) => {
|
|
10938
|
-
N.push(...R(
|
|
10938
|
+
N.push(...R(g.concat(ge(`${D.name}_Array`, "array-contains-any", ae))));
|
|
10939
10939
|
});
|
|
10940
10940
|
else {
|
|
10941
10941
|
if (M.length > G)
|
|
10942
10942
|
throw new Error(`INPUT_ERROR: Individual entity parentFilter with singleQuery set to true must not have more than ${k.singleQuery} entities`);
|
|
10943
|
-
|
|
10943
|
+
g.push(ge(`${D.name}_Array`, "array-contains-any", M));
|
|
10944
10944
|
}
|
|
10945
10945
|
}
|
|
10946
10946
|
}
|
|
10947
10947
|
}
|
|
10948
10948
|
});
|
|
10949
|
-
const
|
|
10950
|
-
|
|
10949
|
+
const _ = [];
|
|
10950
|
+
y.filter((m) => m.type === "Parent").forEach((m) => {
|
|
10951
10951
|
if ("collectionField" in m) {
|
|
10952
10952
|
const S = re(l, m.collectionField);
|
|
10953
10953
|
if ("collection" in S) {
|
|
@@ -10960,12 +10960,12 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10960
10960
|
}
|
|
10961
10961
|
if (!m.singleQuery)
|
|
10962
10962
|
D.forEach((M) => {
|
|
10963
|
-
|
|
10963
|
+
_.push(...R(g.concat(ge(`${S.name}_Array`, "array-contains-any", M))));
|
|
10964
10964
|
});
|
|
10965
10965
|
else {
|
|
10966
10966
|
if (k && k.length > x)
|
|
10967
10967
|
throw new Error(`INPUT_ERROR: Parent entity restriction with singleQuery set to true must not have more than ${m.singleQuery} entities`);
|
|
10968
|
-
|
|
10968
|
+
g.push(ge(`${S.name}_Array`, "array-contains-any", k));
|
|
10969
10969
|
}
|
|
10970
10970
|
}
|
|
10971
10971
|
}
|
|
@@ -10987,19 +10987,19 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10987
10987
|
}
|
|
10988
10988
|
if (!k.singleQuery)
|
|
10989
10989
|
G.forEach((P) => {
|
|
10990
|
-
|
|
10990
|
+
_.push(...R(g.concat(ge(`${x.name}_Array`, "array-contains-any", P))));
|
|
10991
10991
|
});
|
|
10992
10992
|
else {
|
|
10993
10993
|
if ($ && $.length > ae)
|
|
10994
10994
|
throw new Error(`INPUT_ERROR: Parent entity parentFilter with singleQuery set to true must not have more than ${k.singleQuery} entities`);
|
|
10995
|
-
|
|
10995
|
+
g.push(ge(`${x.name}_Array`, "array-contains-any", $));
|
|
10996
10996
|
}
|
|
10997
10997
|
}
|
|
10998
10998
|
}
|
|
10999
10999
|
}
|
|
11000
11000
|
});
|
|
11001
11001
|
const A = [];
|
|
11002
|
-
|
|
11002
|
+
_.length === 0 && (y.filter((m) => m.type === "Parent_Property").forEach((m) => {
|
|
11003
11003
|
if ("collectionField" in m && "propertyField" in m) {
|
|
11004
11004
|
const S = re(l, m.collectionField), k = re(l, m.propertyField);
|
|
11005
11005
|
if ("collection" in S) {
|
|
@@ -11012,7 +11012,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
11012
11012
|
$.push(ae);
|
|
11013
11013
|
}
|
|
11014
11014
|
$.forEach((G) => {
|
|
11015
|
-
A.push(...R(
|
|
11015
|
+
A.push(...R(g.concat([
|
|
11016
11016
|
ge(`${S.name}_Array`, "array-contains-any", G),
|
|
11017
11017
|
ge(k.name, "==", x)
|
|
11018
11018
|
])));
|
|
@@ -11038,7 +11038,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
11038
11038
|
P.push(te);
|
|
11039
11039
|
}
|
|
11040
11040
|
P.forEach((B) => {
|
|
11041
|
-
A.push(...R(
|
|
11041
|
+
A.push(...R(g.concat([
|
|
11042
11042
|
ge(`${D.name}_Array`, "array-contains-any", B),
|
|
11043
11043
|
ge(x.name, "==", G)
|
|
11044
11044
|
])));
|
|
@@ -11048,13 +11048,13 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
11048
11048
|
}
|
|
11049
11049
|
}
|
|
11050
11050
|
}));
|
|
11051
|
-
const b = [...N, ...
|
|
11052
|
-
return !
|
|
11053
|
-
},
|
|
11051
|
+
const b = [...N, ..._, ...A];
|
|
11052
|
+
return !y.length && !O.length ? R(g) : b;
|
|
11053
|
+
}, cm = {}, Cr = {}, zw = async (r) => {
|
|
11054
11054
|
for (const s of Object.keys(Cr))
|
|
11055
11055
|
delete Cr[s];
|
|
11056
11056
|
for (const s of Object.keys(r || {}))
|
|
11057
|
-
Cr[s] = [], delete
|
|
11057
|
+
Cr[s] = [], delete cm[s];
|
|
11058
11058
|
const e = await ke(), t = await se(e, ["global", "preload", "sync"]), n = await se(e, ["global", "preload", "async"]);
|
|
11059
11059
|
if (n)
|
|
11060
11060
|
for (const s of n)
|
|
@@ -11065,7 +11065,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
11065
11065
|
for (const s of Object.keys(r || {}))
|
|
11066
11066
|
n.includes(s) || t.includes(s) || await Fr(s, r?.[s].constraints, r?.[s].range, r?.[s].orQueries);
|
|
11067
11067
|
return Cr;
|
|
11068
|
-
}, Eo = () =>
|
|
11068
|
+
}, Eo = () => cm, ow = () => Cr, cw = async (r, e, t, n) => {
|
|
11069
11069
|
const { labels: s, preloadCache: i } = r, o = Kr()[s.collection], c = ke(), l = lt(s.collection), u = Fe();
|
|
11070
11070
|
if (!u?.Role)
|
|
11071
11071
|
throw new Error("PERMISSION_DENIED");
|
|
@@ -11085,7 +11085,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
11085
11085
|
]), t ||= i.range;
|
|
11086
11086
|
const d = ic([s.collection], o).map((p) => {
|
|
11087
11087
|
if (t) {
|
|
11088
|
-
const { start: v, end:
|
|
11088
|
+
const { start: v, end: y } = sw(t), O = t.fields.filter((C) => !t.ranges?.some((w) => w.includes(C))).map((C) => Jr(ge(C, ">=", v), ge(C, "<=", y))), R = t.ranges?.map((C) => Jr(ge(C[0], "<=", y), ge(C[1], ">=", v)));
|
|
11089
11089
|
p = pe(p, Ec(...O, ...R || []));
|
|
11090
11090
|
}
|
|
11091
11091
|
return n && (p = pe(p, Jr(Ec(...n.map((v) => ge(...v)))))), e && (p = pe(p, Jr(...e.map((v) => ge(...v))))), p;
|
|
@@ -11095,10 +11095,10 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
11095
11095
|
p({});
|
|
11096
11096
|
return;
|
|
11097
11097
|
}
|
|
11098
|
-
d.forEach((
|
|
11098
|
+
d.forEach((y) => {
|
|
11099
11099
|
let O = !1;
|
|
11100
|
-
const R = dr(
|
|
11101
|
-
(!C.metadata.fromCache || O) && (O || (O = !0, h.set(
|
|
11100
|
+
const R = dr(y, { includeMetadataChanges: !0 }, (C) => {
|
|
11101
|
+
(!C.metadata.fromCache || O) && (O || (O = !0, h.set(y, !0), h.size === d.length && p({})));
|
|
11102
11102
|
}, (C) => {
|
|
11103
11103
|
console.error(C), v(C);
|
|
11104
11104
|
});
|
|
@@ -11153,7 +11153,7 @@ const lw = async (r, e) => {
|
|
|
11153
11153
|
else {
|
|
11154
11154
|
const d = new Event("stoker:permissionsChange");
|
|
11155
11155
|
if (document.dispatchEvent(d), s.auth.signOutOnPermissionsChange)
|
|
11156
|
-
|
|
11156
|
+
wm();
|
|
11157
11157
|
else {
|
|
11158
11158
|
const h = Lt.collections;
|
|
11159
11159
|
if (h)
|
|
@@ -11198,8 +11198,8 @@ const lw = async (r, e) => {
|
|
|
11198
11198
|
}
|
|
11199
11199
|
const p = Oe(t);
|
|
11200
11200
|
r !== "delete" && (h.data.data = p, e === "written" && ac(h.data.data)), r !== "delete" && e !== "written" && tr(p), r === "update" && (h.data.originalRecord = Oe(c)), r !== "delete" && ["started", "written"].includes(e) && (delete h.data.data.Saved_At, delete h.data.data.Last_Save_At), e === "failed" && (h.data.error = JSON.stringify(o));
|
|
11201
|
-
const v = t.Last_Write_At,
|
|
11202
|
-
|
|
11201
|
+
const v = t.Last_Write_At, y = Ae(f, n.join("/"), s, "system_write_log", `${a}-${v.valueOf()}`);
|
|
11202
|
+
Bm(y, h).catch((O) => {
|
|
11203
11203
|
console.error(`Error saving "${e}" ${r} log entry for record ${s} in ${l.collection} collection.`, { cause: O });
|
|
11204
11204
|
});
|
|
11205
11205
|
}, oc = async (r, e, t, n, s) => {
|
|
@@ -11221,7 +11221,7 @@ const lw = async (r, e) => {
|
|
|
11221
11221
|
}
|
|
11222
11222
|
})), c.length > 0)
|
|
11223
11223
|
throw new Error(c.join(", "));
|
|
11224
|
-
},
|
|
11224
|
+
}, lm = (r, e, t) => {
|
|
11225
11225
|
const n = je(), s = He(), i = Fe(), a = r.at(-1);
|
|
11226
11226
|
if (!a)
|
|
11227
11227
|
throw new Error("EMPTY_PATH");
|
|
@@ -11235,7 +11235,7 @@ const lw = async (r, e) => {
|
|
|
11235
11235
|
for (const h of f)
|
|
11236
11236
|
d.push(Ae(n, "system_fields", c.collection, `${c.collection}-${h.field}`, e));
|
|
11237
11237
|
return d;
|
|
11238
|
-
}, hd = (r) => r !== null && typeof r == "object" && !Array.isArray(r),
|
|
11238
|
+
}, hd = (r) => r !== null && typeof r == "object" && !Array.isArray(r), um = (r) => {
|
|
11239
11239
|
const e = (t) => {
|
|
11240
11240
|
Object.entries(t).forEach(([n, s]) => {
|
|
11241
11241
|
hd(s) && Object.keys(s).length === 2 && typeof s._seconds == "number" && typeof s._nanoseconds == "number" ? t[n] = new zt(s._seconds, s._nanoseconds) : hd(s) && e(s);
|
|
@@ -11265,19 +11265,19 @@ const lw = async (r, e) => {
|
|
|
11265
11265
|
}
|
|
11266
11266
|
const l = c.data;
|
|
11267
11267
|
for (const u of l.result.docs)
|
|
11268
|
-
|
|
11268
|
+
um(u);
|
|
11269
11269
|
return l?.result;
|
|
11270
|
-
},
|
|
11270
|
+
}, fm = async (r, e, t, n, s, i, a) => {
|
|
11271
11271
|
const o = Fe();
|
|
11272
11272
|
if (!o)
|
|
11273
11273
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11274
|
-
const c = e.at(-2), l =
|
|
11274
|
+
const c = e.at(-2), l = Td(n.collections[c], n, o).map((d) => d.labels.collection);
|
|
11275
11275
|
t.collections ? t.collections.forEach((d) => {
|
|
11276
11276
|
if (!l.includes(d))
|
|
11277
11277
|
throw new Error(`SCHEMA_ERROR: Collection ${d} not found in subcollections of ${c}`);
|
|
11278
11278
|
}) : t.collections = l;
|
|
11279
11279
|
const u = t.depth - 1, f = t.collections.map(async (d) => {
|
|
11280
|
-
const h = await
|
|
11280
|
+
const h = await dm([...e, d], t.constraints || [], {
|
|
11281
11281
|
only: i,
|
|
11282
11282
|
pagination: t.limit,
|
|
11283
11283
|
noEmbeddingFields: a
|
|
@@ -11289,7 +11289,7 @@ const lw = async (r, e) => {
|
|
|
11289
11289
|
r[d].map((p) => cc(p, [...e, d, p.id], s, n, i, a))
|
|
11290
11290
|
), u > 0 && await Promise.all(
|
|
11291
11291
|
// eslint-disable-next-line security/detect-object-injection
|
|
11292
|
-
r[d].map((p) =>
|
|
11292
|
+
r[d].map((p) => fm(p, [...e, d, p.id], { depth: u }, n, s, i, a))
|
|
11293
11293
|
);
|
|
11294
11294
|
});
|
|
11295
11295
|
await Promise.all(f);
|
|
@@ -11306,8 +11306,8 @@ const lw = async (r, e) => {
|
|
|
11306
11306
|
continue;
|
|
11307
11307
|
const d = Object.keys(f);
|
|
11308
11308
|
for (const h of d) {
|
|
11309
|
-
const p = f[h], v = _r(p.Collection_Path, h, { only: s, noEmbeddingFields: i }).then((
|
|
11310
|
-
if (f[h] =
|
|
11309
|
+
const p = f[h], v = _r(p.Collection_Path, h, { only: s, noEmbeddingFields: i }).then((y) => {
|
|
11310
|
+
if (f[h] = y, c > 0)
|
|
11311
11311
|
return cc(
|
|
11312
11312
|
// eslint-disable-next-line security/detect-object-injection
|
|
11313
11313
|
f[h],
|
|
@@ -11317,17 +11317,17 @@ const lw = async (r, e) => {
|
|
|
11317
11317
|
s,
|
|
11318
11318
|
i
|
|
11319
11319
|
);
|
|
11320
|
-
}).catch((
|
|
11321
|
-
if (
|
|
11320
|
+
}).catch((y) => {
|
|
11321
|
+
if (y.message.includes("NOT_FOUND") || y.code === "permission-denied")
|
|
11322
11322
|
delete f[h];
|
|
11323
11323
|
else
|
|
11324
|
-
throw
|
|
11324
|
+
throw y;
|
|
11325
11325
|
});
|
|
11326
11326
|
l.push(v);
|
|
11327
11327
|
}
|
|
11328
11328
|
}
|
|
11329
11329
|
await Promise.all(l);
|
|
11330
|
-
},
|
|
11330
|
+
}, dm = async (r, e, t) => {
|
|
11331
11331
|
if (t?.subcollections?.depth && t.subcollections.depth > 10)
|
|
11332
11332
|
throw new Error("INPUT_ERROR: Subcollections depth cannot exceed 10");
|
|
11333
11333
|
if (t?.relations?.depth && t.relations.depth > 10)
|
|
@@ -11343,7 +11343,7 @@ const lw = async (r, e) => {
|
|
|
11343
11343
|
const s = He(!0), a = Kr()[n], o = s.collections[n], { labels: c, access: l, preloadCache: u } = o, { serverReadOnly: f } = l, d = ke(), h = Object.keys(s.collections).includes(n), p = d.disabledCollections?.includes(n);
|
|
11344
11344
|
if (!h || p)
|
|
11345
11345
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11346
|
-
const v = await lt(c.collection),
|
|
11346
|
+
const v = await lt(c.collection), y = await se(d, [
|
|
11347
11347
|
"global",
|
|
11348
11348
|
"firebase",
|
|
11349
11349
|
"serverTimestampOptions"
|
|
@@ -11363,26 +11363,26 @@ const lw = async (r, e) => {
|
|
|
11363
11363
|
if (t?.pagination) {
|
|
11364
11364
|
if (t.pagination.startAfter && t.pagination.endBefore)
|
|
11365
11365
|
throw new Error("INPUT_ERROR: startAfter and endBefore cannot be provided together");
|
|
11366
|
-
const b = t.pagination.startAfter || t.pagination.endBefore, m =
|
|
11366
|
+
const b = t.pagination.startAfter || t.pagination.endBefore, m = Ld(O.Role, o, s);
|
|
11367
11367
|
if (b && m !== !0)
|
|
11368
11368
|
throw new Error("INPUT_ERROR: Pagination is not allowed when using " + m);
|
|
11369
11369
|
t.pagination.orderByField && t.pagination.orderByDirection ? t.pagination.startAfter || t.pagination.endBefore ? t.pagination.startAfter ? C = C.map((S, k) => pe(S, et(t.pagination.orderByField, t.pagination.orderByDirection), Qa(w.last.get(k)), Xt(t.pagination.number))) : C = C.map((S, k) => pe(S, et(t.pagination.orderByField, t.pagination.orderByDirection), Xa(w.first.get(k)), Ir(t.pagination.number))) : C = C.map((S) => pe(S, et(t.pagination.orderByField, t.pagination.orderByDirection), Xt(t.pagination.number))) : !t.pagination.startAfter && !t.pagination.endBefore ? C = C.map((S) => pe(S, Xt(t.pagination.number))) : t.pagination.startAfter ? C = C.map((S, k) => pe(S, Qa(w.last.get(k)), Xt(t.pagination.number))) : C = C.map((S, k) => pe(S, Xa(w.first.get(k)), Ir(t.pagination.number)));
|
|
11370
11370
|
}
|
|
11371
11371
|
const E = { collection: c.collection };
|
|
11372
11372
|
await oe("preOperation", d, v, ["read", void 0, void 0, E]), await oe("preRead", d, v, [E, C, !0, !1]);
|
|
11373
|
-
const
|
|
11373
|
+
const g = /* @__PURE__ */ new Map(), N = C.map(async (b) => {
|
|
11374
11374
|
let m;
|
|
11375
|
-
return t?.only === "cache" ? m = await vd(b) : t?.only === "server" ? m = await
|
|
11376
|
-
}),
|
|
11377
|
-
for (const b of
|
|
11375
|
+
return t?.only === "cache" ? m = await vd(b) : t?.only === "server" ? m = await Zm(b) : m = await Gm(b), m;
|
|
11376
|
+
}), _ = await Promise.all(N);
|
|
11377
|
+
for (const b of _) {
|
|
11378
11378
|
for (const m of b.docs) {
|
|
11379
|
-
|
|
11380
|
-
const S = m.data({ serverTimestamps:
|
|
11379
|
+
g.has(m.id) || g.set(m.id, {});
|
|
11380
|
+
const S = m.data({ serverTimestamps: y || "none" }), k = g.get(m.id);
|
|
11381
11381
|
k.id ||= m.id;
|
|
11382
11382
|
const D = { ...k, ...S };
|
|
11383
|
-
delete D.Collection_Path_String,
|
|
11383
|
+
delete D.Collection_Path_String, g.set(m.id, D);
|
|
11384
11384
|
}
|
|
11385
|
-
w.first.set(
|
|
11385
|
+
w.first.set(_.indexOf(b), b.docs[0]), w.last.set(_.indexOf(b), b.docs.at(-1) || b.docs[0]);
|
|
11386
11386
|
}
|
|
11387
11387
|
let A;
|
|
11388
11388
|
if (t?.pagination && !u?.roles.includes(O?.Role) && !f?.includes(O?.Role)) {
|
|
@@ -11395,11 +11395,11 @@ const lw = async (r, e) => {
|
|
|
11395
11395
|
A = k > 0 ? Math.floor(S / k) : 0;
|
|
11396
11396
|
}
|
|
11397
11397
|
}
|
|
11398
|
-
for (const b of
|
|
11398
|
+
for (const b of g.values()) {
|
|
11399
11399
|
const m = [], S = [...b.Collection_Path, b.id];
|
|
11400
|
-
t?.subcollections && m.push(
|
|
11400
|
+
t?.subcollections && m.push(fm(
|
|
11401
11401
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11402
|
-
|
|
11402
|
+
g.get(b.id),
|
|
11403
11403
|
S,
|
|
11404
11404
|
Oe(t.subcollections),
|
|
11405
11405
|
s,
|
|
@@ -11416,38 +11416,38 @@ const lw = async (r, e) => {
|
|
|
11416
11416
|
return x;
|
|
11417
11417
|
})), m.push(cc(
|
|
11418
11418
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11419
|
-
|
|
11419
|
+
g.get(b.id),
|
|
11420
11420
|
S,
|
|
11421
11421
|
Oe(t.relations),
|
|
11422
11422
|
s,
|
|
11423
11423
|
t?.only,
|
|
11424
11424
|
t?.noEmbeddingFields
|
|
11425
11425
|
))), await Promise.all(m);
|
|
11426
|
-
for (const x of
|
|
11426
|
+
for (const x of g.values())
|
|
11427
11427
|
for (const M of o.fields)
|
|
11428
11428
|
M.type === "Computed" && !t?.noComputedFields && (x[M.name] = await M.formula(x)), t?.noEmbeddingFields && M.type === "Embedding" && delete x[M.name];
|
|
11429
11429
|
const k = ["read", b, b.id, E];
|
|
11430
11430
|
await oe("postOperation", d, v, k), await oe("postRead", d, v, [E, R, b, !1]);
|
|
11431
11431
|
}
|
|
11432
|
-
return { cursor: w, pages: A, docs: Array.from(
|
|
11432
|
+
return { cursor: w, pages: A, docs: Array.from(g.values()) };
|
|
11433
11433
|
}, dw = async (r, e, t) => {
|
|
11434
11434
|
const n = nt(), s = Ue(), i = $e(n, s.STOKER_FB_FUNCTIONS_REGION), l = (await Ke(i, "stoker-readapi")({
|
|
11435
11435
|
path: r,
|
|
11436
11436
|
id: e,
|
|
11437
11437
|
options: t
|
|
11438
11438
|
})).data.result;
|
|
11439
|
-
return
|
|
11440
|
-
},
|
|
11439
|
+
return um(l), l;
|
|
11440
|
+
}, hm = async (r, e, t, n, s, i) => {
|
|
11441
11441
|
const a = Fe();
|
|
11442
11442
|
if (!a)
|
|
11443
11443
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11444
|
-
const o = e.at(-2), c =
|
|
11444
|
+
const o = e.at(-2), c = Td(n.collections[o], n, a).map((f) => f.labels.collection);
|
|
11445
11445
|
t.collections ? t.collections.forEach((f) => {
|
|
11446
11446
|
if (!c.includes(f))
|
|
11447
11447
|
throw new Error(`SCHEMA_ERROR: Collection ${f} not found in subcollections of ${o}`);
|
|
11448
11448
|
}) : t.collections = c;
|
|
11449
11449
|
const l = t.depth - 1, u = t.collections.map(async (f) => {
|
|
11450
|
-
const d = await
|
|
11450
|
+
const d = await dm([...e, f], t.constraints || [], {
|
|
11451
11451
|
only: i,
|
|
11452
11452
|
relations: s,
|
|
11453
11453
|
pagination: t.limit
|
|
@@ -11457,12 +11457,12 @@ const lw = async (r, e) => {
|
|
|
11457
11457
|
r[f] = d.docs, l > 0 && await Promise.all(
|
|
11458
11458
|
// eslint-disable-next-line security/detect-object-injection
|
|
11459
11459
|
r[f].map(async (h) => {
|
|
11460
|
-
await
|
|
11460
|
+
await hm(h, [...e, f, h.id], { depth: l }, n, s, i);
|
|
11461
11461
|
})
|
|
11462
11462
|
);
|
|
11463
11463
|
});
|
|
11464
11464
|
await Promise.all(u);
|
|
11465
|
-
},
|
|
11465
|
+
}, mm = async (r, e, t, n, s, i, a) => {
|
|
11466
11466
|
if (!Fe())
|
|
11467
11467
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11468
11468
|
const c = e.at(-2);
|
|
@@ -11478,9 +11478,9 @@ const lw = async (r, e) => {
|
|
|
11478
11478
|
only: s,
|
|
11479
11479
|
noComputedFields: i,
|
|
11480
11480
|
noEmbeddingFields: a
|
|
11481
|
-
}).then((
|
|
11482
|
-
if (d[h] =
|
|
11483
|
-
return
|
|
11481
|
+
}).then((y) => {
|
|
11482
|
+
if (d[h] = y, l > 0)
|
|
11483
|
+
return mm(
|
|
11484
11484
|
// eslint-disable-next-line security/detect-object-injection
|
|
11485
11485
|
d[h],
|
|
11486
11486
|
[...p.Collection_Path, h],
|
|
@@ -11490,11 +11490,11 @@ const lw = async (r, e) => {
|
|
|
11490
11490
|
i,
|
|
11491
11491
|
a
|
|
11492
11492
|
);
|
|
11493
|
-
}).catch((
|
|
11494
|
-
if (
|
|
11493
|
+
}).catch((y) => {
|
|
11494
|
+
if (y.message.includes("NOT_FOUND") || y.code === "permission-denied")
|
|
11495
11495
|
delete d[h];
|
|
11496
11496
|
else
|
|
11497
|
-
throw
|
|
11497
|
+
throw y;
|
|
11498
11498
|
});
|
|
11499
11499
|
u.push(v);
|
|
11500
11500
|
}
|
|
@@ -11515,12 +11515,12 @@ const lw = async (r, e) => {
|
|
|
11515
11515
|
"global",
|
|
11516
11516
|
"firebase",
|
|
11517
11517
|
"serverTimestampOptions"
|
|
11518
|
-
]), f = s.collections[n], { labels: d, access: h } = f, { serverReadOnly: p } = h, v = lt(d.collection),
|
|
11519
|
-
if (!
|
|
11518
|
+
]), f = s.collections[n], { labels: d, access: h } = f, { serverReadOnly: p } = h, v = lt(d.collection), y = Fe();
|
|
11519
|
+
if (!y?.Role)
|
|
11520
11520
|
throw new Error("PERMISSIONS_DENIED");
|
|
11521
|
-
if (p?.includes(
|
|
11521
|
+
if (p?.includes(y.Role))
|
|
11522
11522
|
return await dw(r, e, t);
|
|
11523
|
-
const O =
|
|
11523
|
+
const O = lm(r, e, a);
|
|
11524
11524
|
if (O.length === 0)
|
|
11525
11525
|
throw new Error("PERMISSION_DENIED");
|
|
11526
11526
|
const R = { collection: d.collection };
|
|
@@ -11528,14 +11528,14 @@ const lw = async (r, e) => {
|
|
|
11528
11528
|
let E = {};
|
|
11529
11529
|
const I = O.map(async (b) => {
|
|
11530
11530
|
let m;
|
|
11531
|
-
if (t?.only === "cache" ? m = await
|
|
11531
|
+
if (t?.only === "cache" ? m = await Hm(b) : t?.only === "server" ? m = await Km(b) : m = await _d(b), !m.exists())
|
|
11532
11532
|
throw new Error(`NOT_FOUND: Document with ID ${e} does not exist at location ${r?.join("/") || d.collection}`);
|
|
11533
11533
|
return { id: m.id, data: m.data({ serverTimestamps: u || "none" }) };
|
|
11534
11534
|
}), T = await Promise.all(I);
|
|
11535
11535
|
for (const b of T)
|
|
11536
11536
|
E.id ||= b.id, E = { ...E, ...b.data }, delete E.Collection_Path_String;
|
|
11537
|
-
const
|
|
11538
|
-
if (t?.subcollections &&
|
|
11537
|
+
const g = [], N = r ? [...r, e] : [d.collection, e];
|
|
11538
|
+
if (t?.subcollections && g.push(hm(E, N, Oe(t.subcollections), s, Oe(t?.relations), t?.only)), t?.relations && (t.relations.fields && (t.relations.fields = t.relations.fields.map((b) => {
|
|
11539
11539
|
if (typeof b == "string") {
|
|
11540
11540
|
const m = f.fields.find((S) => S.name === b);
|
|
11541
11541
|
if (m)
|
|
@@ -11543,14 +11543,14 @@ const lw = async (r, e) => {
|
|
|
11543
11543
|
throw new Error(`SCHEMA_ERROR: Field ${b} not found in collection ${n}`);
|
|
11544
11544
|
}
|
|
11545
11545
|
return b;
|
|
11546
|
-
})),
|
|
11546
|
+
})), g.push(mm(E, N, Oe(t.relations), s, t?.only, t?.noComputedFields, t?.noEmbeddingFields))), await Promise.all(g), !t?.noComputedFields)
|
|
11547
11547
|
for (const b of f.fields)
|
|
11548
11548
|
b.type === "Computed" && (E[b.name] = await b.formula(E));
|
|
11549
11549
|
if (t?.noEmbeddingFields)
|
|
11550
11550
|
for (const b of f.fields)
|
|
11551
11551
|
b.type === "Embedding" && delete E[b.name];
|
|
11552
11552
|
return await oe("postOperation", o, v, ["read", E, e, R]), await oe("postRead", o, v, [R, O, E, !1]), E;
|
|
11553
|
-
}, hw = (r) => r !== null && typeof r == "object",
|
|
11553
|
+
}, hw = (r) => r !== null && typeof r == "object", pm = (r) => {
|
|
11554
11554
|
const e = (t) => {
|
|
11555
11555
|
Object.entries(t).forEach(([n, s]) => {
|
|
11556
11556
|
s instanceof zt ? t[n] = {
|
|
@@ -11562,7 +11562,7 @@ const lw = async (r, e) => {
|
|
|
11562
11562
|
e(r);
|
|
11563
11563
|
}, mw = async (r, e, t, n) => {
|
|
11564
11564
|
const s = nt(), i = Ue(), a = $e(s, i.STOKER_FB_FUNCTIONS_REGION), o = Ke(a, "stoker-writeapi", { timeout: 540 * 1e3 });
|
|
11565
|
-
return
|
|
11565
|
+
return pm(t), ac(t), (await o({
|
|
11566
11566
|
operation: "update",
|
|
11567
11567
|
path: r,
|
|
11568
11568
|
id: e,
|
|
@@ -11576,23 +11576,23 @@ const lw = async (r, e) => {
|
|
|
11576
11576
|
const h = r.at(-1), p = Object.keys(a.collections).includes(h), v = l.disabledCollections?.includes(h);
|
|
11577
11577
|
if (!p || v)
|
|
11578
11578
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11579
|
-
const
|
|
11579
|
+
const y = a.collections[h], { labels: O, access: R, fields: C, enableWriteLog: w } = y, { serverWriteOnly: E } = R, I = lt(O.collection), T = await se(l, ["global", "appName"]), g = s?.retry, N = u.currentUser;
|
|
11580
11580
|
if (!N)
|
|
11581
11581
|
throw new Error("NOT_AUTHENTICATED");
|
|
11582
11582
|
if (!d)
|
|
11583
11583
|
throw new Error("PERMISSION_DENIED");
|
|
11584
|
-
if (
|
|
11584
|
+
if (_m(e))
|
|
11585
11585
|
throw new Error("RECORD_BUSY");
|
|
11586
|
-
i =
|
|
11586
|
+
i = g?.originalRecord || i || await _r([O.collection], e, { noComputedFields: !0, noEmbeddingFields: !0 });
|
|
11587
11587
|
for (const P of o.collections[h].fields)
|
|
11588
11588
|
P.type === "Computed" && (delete t[P.name], delete i[P.name]);
|
|
11589
|
-
const
|
|
11589
|
+
const _ = Ro(f), A = { collection: O.collection }, b = y.auth && n?.operation === "create", m = y.auth && n?.operation === "delete", S = y.auth && !b && !m && (n?.operation === "update" || t.Role || t.Enabled !== void 0 || t.Name || t.Email || t.Photo_URL), k = await se(I, [
|
|
11590
11590
|
"collections",
|
|
11591
11591
|
O.collection,
|
|
11592
11592
|
"custom",
|
|
11593
11593
|
"disableOfflineUpdate"
|
|
11594
11594
|
]), D = () => {
|
|
11595
|
-
if (Wt() === "Offline" && (k || E ||
|
|
11595
|
+
if (Wt() === "Offline" && (k || E || y.auth && (b || S || m)))
|
|
11596
11596
|
throw new Error("CLIENT_OFFLINE");
|
|
11597
11597
|
};
|
|
11598
11598
|
if (D(), E || b || S || m) {
|
|
@@ -11617,41 +11617,41 @@ const lw = async (r, e) => {
|
|
|
11617
11617
|
return await mw(r, e, t, n ? { operation: n.operation, permissions: n.permissions, password: n.password } : void 0);
|
|
11618
11618
|
}
|
|
11619
11619
|
delete t.id;
|
|
11620
|
-
const x = Go("update", r, t, a, T, Wt(), N.uid, zt.now(), Pr(), !!
|
|
11620
|
+
const x = Go("update", r, t, a, T, Wt(), N.uid, zt.now(), Pr(), !!g);
|
|
11621
11621
|
for (const P of C)
|
|
11622
11622
|
!_e(P) && sr(x[P.name]) && P.nullable && (x[P.name] = null);
|
|
11623
|
-
if (Nt(x), Nt(i), !
|
|
11623
|
+
if (Nt(x), Nt(i), !g && w && Ge("update", "started", x, r, e, y, N.uid, void 0, i), !g) {
|
|
11624
11624
|
const P = [
|
|
11625
11625
|
"update",
|
|
11626
11626
|
x,
|
|
11627
11627
|
e,
|
|
11628
11628
|
A,
|
|
11629
|
-
|
|
11629
|
+
_,
|
|
11630
11630
|
Oe(i)
|
|
11631
11631
|
];
|
|
11632
11632
|
await oe("preOperation", l, I, P);
|
|
11633
|
-
const B = ["update", x, e, A,
|
|
11633
|
+
const B = ["update", x, e, A, _, Oe(i)];
|
|
11634
11634
|
await oe("preWrite", l, I, B);
|
|
11635
11635
|
}
|
|
11636
|
-
if (
|
|
11636
|
+
if (Yd(y, x, a), Jd(y, x), !g)
|
|
11637
11637
|
try {
|
|
11638
11638
|
const P = { ...i, ...x };
|
|
11639
|
-
tr(P), await
|
|
11639
|
+
tr(P), await sm("update", P, y, I, ["update", P, A, _, Oe(i)], a), k && (D(), await oc("update", e, x, y, d));
|
|
11640
11640
|
} catch (P) {
|
|
11641
11641
|
throw new Error(`VALIDATION_ERROR: ${P.message}`);
|
|
11642
11642
|
}
|
|
11643
|
-
if (wy(x, i, e,
|
|
11643
|
+
if (wy(x, i, e, y, a, N.uid, d), Nt(x), sc("update", _, r, e, x, a, y, s, c, Co, Ao, Tn, (P) => Ae(f, "system_fields", O.collection, `${O.collection}-${P.name}`, e), (P, B) => Ae(f, "system_unique", O.collection, `Unique-${O.collection}-${P.name}`, B), (P) => Ae(f, "system_fields", O.collection, `${O.collection}-${P}`, e)), _.update(Ae(f, r.join("/"), e), x), !g && w && Ge("update", "written", x, r, e, y, N.uid, void 0, i), await uc("update", r, e, x, A, y, I, _, N.uid, w || !1, d, !!g, i), g?.type === "unique") {
|
|
11644
11644
|
const P = { ...i, ...x };
|
|
11645
11645
|
return tr(P), { id: e, ...P };
|
|
11646
11646
|
}
|
|
11647
|
-
w && Ge("update", "success", x, r, e,
|
|
11648
|
-
const M = ["update", x, e, A, !!
|
|
11647
|
+
w && Ge("update", "success", x, r, e, y, N.uid, void 0, i);
|
|
11648
|
+
const M = ["update", x, e, A, !!g, Oe(i)], $ = [...M];
|
|
11649
11649
|
await oe("postWrite", l, I, M), await oe("postOperation", l, I, $);
|
|
11650
11650
|
const G = { ...i, ...x };
|
|
11651
11651
|
return tr(G), { id: e, ...G };
|
|
11652
11652
|
}, uc = async (r, e, t, n, s, i, a, o, c, l, u, f, d) => {
|
|
11653
11653
|
const h = He(), p = ke(), { labels: v } = i;
|
|
11654
|
-
let
|
|
11654
|
+
let y = 0;
|
|
11655
11655
|
const O = async () => {
|
|
11656
11656
|
try {
|
|
11657
11657
|
await Oe(o).commit();
|
|
@@ -11668,15 +11668,15 @@ const lw = async (r, e) => {
|
|
|
11668
11668
|
try {
|
|
11669
11669
|
await oc(r, t, n, i, u);
|
|
11670
11670
|
} catch (N) {
|
|
11671
|
-
const
|
|
11671
|
+
const _ = N.message.split(", "), A = [], b = [];
|
|
11672
11672
|
let m = !1;
|
|
11673
|
-
for (const S of
|
|
11673
|
+
for (const S of _) {
|
|
11674
11674
|
const k = S.split(" ")[0], D = h.collections[v.collection].fields.find((x) => x.name === k);
|
|
11675
11675
|
if (!D)
|
|
11676
11676
|
throw new Error(`SCHEMA_ERROR: Field ${k} not found in ${v.collection} schema`);
|
|
11677
11677
|
D.type === "Number" && A.push(S), D.type === "String" && b.push(S);
|
|
11678
11678
|
}
|
|
11679
|
-
if ((!w || A.length > 0) && (C = new Error(`VALIDATION_ERROR: ${
|
|
11679
|
+
if ((!w || A.length > 0) && (C = new Error(`VALIDATION_ERROR: ${_.join(", ")}`)), w && b.length > 0) {
|
|
11680
11680
|
for (const S of b) {
|
|
11681
11681
|
const k = S.split(" ")[0];
|
|
11682
11682
|
if (h.collections[v.collection].fields.find((M) => M.name === k).type === "Number")
|
|
@@ -11686,10 +11686,10 @@ const lw = async (r, e) => {
|
|
|
11686
11686
|
// eslint-disable-next-line security/detect-object-injection
|
|
11687
11687
|
n[k].match(/ - DUPLICATE-\d+/)[0].split("-")[2]
|
|
11688
11688
|
), n[k] = // eslint-disable-next-line security/detect-object-injection
|
|
11689
|
-
n[k].replace(/ - DUPLICATE-\d+/g, "") + ` - DUPLICATE-${x + 1}`) : n[k] = n[k] + " - DUPLICATE-1", x < 10 ? m = !0 : C = new Error(
|
|
11689
|
+
n[k].replace(/ - DUPLICATE-\d+/g, "") + ` - DUPLICATE-${x + 1}`) : n[k] = n[k] + " - DUPLICATE-1", x < 10 ? m = !0 : C = new Error(_.map((M) => M.replace(/ - DUPLICATE-\d+/g, "")).join(", "));
|
|
11690
11690
|
}
|
|
11691
11691
|
if (m) {
|
|
11692
|
-
r === "create" && await
|
|
11692
|
+
r === "create" && await ym(e, n, void 0, { retry: { type: "unique", docId: t } }), r === "update" && await lc(e, t, n, void 0, {
|
|
11693
11693
|
retry: {
|
|
11694
11694
|
type: "unique",
|
|
11695
11695
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -11707,13 +11707,13 @@ const lw = async (r, e) => {
|
|
|
11707
11707
|
s,
|
|
11708
11708
|
E,
|
|
11709
11709
|
f,
|
|
11710
|
-
|
|
11710
|
+
y,
|
|
11711
11711
|
r === "update" ? d : void 0
|
|
11712
|
-
], T = R.code === "unavailable",
|
|
11713
|
-
if (
|
|
11712
|
+
], T = R.code === "unavailable", g = await oe("postWriteError", p, a, I);
|
|
11713
|
+
if (g?.resolved)
|
|
11714
11714
|
return;
|
|
11715
|
-
if (!T &&
|
|
11716
|
-
|
|
11715
|
+
if (!T && g?.retry) {
|
|
11716
|
+
y++, await O();
|
|
11717
11717
|
return;
|
|
11718
11718
|
} else
|
|
11719
11719
|
l && Ge(
|
|
@@ -11734,38 +11734,38 @@ const lw = async (r, e) => {
|
|
|
11734
11734
|
await O();
|
|
11735
11735
|
}, pw = async (r, e, t, n) => {
|
|
11736
11736
|
const s = nt(), i = Ue(), a = $e(s, i.STOKER_FB_FUNCTIONS_REGION), o = Ke(a, "stoker-writeapi", { timeout: 540 * 1e3 });
|
|
11737
|
-
return
|
|
11737
|
+
return pm(e), (await o({
|
|
11738
11738
|
operation: "create",
|
|
11739
11739
|
path: r,
|
|
11740
11740
|
record: e,
|
|
11741
11741
|
user: t,
|
|
11742
11742
|
id: n
|
|
11743
11743
|
})).data?.result;
|
|
11744
|
-
},
|
|
11744
|
+
}, ym = async (r, e, t, n, s, i) => {
|
|
11745
11745
|
const a = He(), o = hc(), c = ke(), l = fr(), u = je(), f = Fe();
|
|
11746
11746
|
if (r.length === 0)
|
|
11747
11747
|
throw new Error("EMPTY_PATH");
|
|
11748
11748
|
const d = r.at(-1), h = Object.keys(a.collections).includes(d), p = c.disabledCollections?.includes(d);
|
|
11749
11749
|
if (!h || p)
|
|
11750
11750
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11751
|
-
const v = a.collections[d], { labels:
|
|
11752
|
-
if (!
|
|
11751
|
+
const v = a.collections[d], { labels: y, access: O, enableWriteLog: R, softDelete: C } = v, { serverWriteOnly: w } = O, E = lt(y.collection), I = await se(c, ["global", "appName"]), T = n?.retry, g = l.currentUser;
|
|
11752
|
+
if (!g)
|
|
11753
11753
|
throw new Error("NOT_AUTHENTICATED");
|
|
11754
11754
|
if (!f)
|
|
11755
11755
|
throw new Error("PERMISSION_DENIED");
|
|
11756
11756
|
const N = await se(E, [
|
|
11757
11757
|
"collections",
|
|
11758
|
-
|
|
11758
|
+
y.collection,
|
|
11759
11759
|
"custom",
|
|
11760
11760
|
"disableOfflineCreate"
|
|
11761
|
-
]),
|
|
11761
|
+
]), _ = () => {
|
|
11762
11762
|
if (Wt() === "Offline" && (N || w || v.auth && t))
|
|
11763
11763
|
throw new Error("CLIENT_OFFLINE");
|
|
11764
11764
|
};
|
|
11765
|
-
|
|
11766
|
-
const A = Ro(u), b = T?.docId || s || Ae(Mr(u,
|
|
11765
|
+
_();
|
|
11766
|
+
const A = Ro(u), b = T?.docId || s || Ae(Mr(u, y.collection)).id, m = { collection: y.collection };
|
|
11767
11767
|
if (w || v.auth && t) {
|
|
11768
|
-
if (
|
|
11768
|
+
if (_(), v.auth && t) {
|
|
11769
11769
|
if (!t.password)
|
|
11770
11770
|
throw new Error("VALIDATION_ERROR: Password is required");
|
|
11771
11771
|
if (!t.passwordConfirm)
|
|
@@ -11773,7 +11773,7 @@ const lw = async (r, e) => {
|
|
|
11773
11773
|
if (t.password !== t.passwordConfirm)
|
|
11774
11774
|
throw new Error("VALIDATION_ERROR: Passwords do not match");
|
|
11775
11775
|
if (!await se(c, ["global", "firebase", "enableEmulators"])) {
|
|
11776
|
-
|
|
11776
|
+
_();
|
|
11777
11777
|
try {
|
|
11778
11778
|
const { isValid: G } = await pd(l, t.password);
|
|
11779
11779
|
if (!G)
|
|
@@ -11786,16 +11786,16 @@ const lw = async (r, e) => {
|
|
|
11786
11786
|
return i && i(), await pw(r, e, t ? { permissions: t.permissions, password: t.password } : void 0, b);
|
|
11787
11787
|
}
|
|
11788
11788
|
e.id = b;
|
|
11789
|
-
const S = Go("create", r, e, a, I, Wt(),
|
|
11790
|
-
if (C && (S[C.archivedField] = !1), Nt(S), !T && R && Ge("create", "started", S, r, b, v,
|
|
11789
|
+
const S = Go("create", r, e, a, I, Wt(), g.uid, zt.now(), Pr(), !!T);
|
|
11790
|
+
if (C && (S[C.archivedField] = !1), Nt(S), !T && R && Ge("create", "started", S, r, b, v, g.uid), T || (await oe("preOperation", c, E, ["create", S, b, m, A]), await oe("preWrite", c, E, ["create", S, b, m, A])), Yd(v, S, a), Jd(v, S), T || await fg(S, v, E, f.Role), !T)
|
|
11791
11791
|
try {
|
|
11792
|
-
await
|
|
11792
|
+
await sm("create", S, v, E, ["create", S, m, A], a), N && (_(), await oc("create", b, S, v, f));
|
|
11793
11793
|
} catch (M) {
|
|
11794
11794
|
throw new Error(`VALIDATION_ERROR: ${M.message}`);
|
|
11795
11795
|
}
|
|
11796
|
-
if (i && i(), Nt(S), vy(S, b, v, a,
|
|
11796
|
+
if (i && i(), Nt(S), vy(S, b, v, a, g.uid, f), sc("create", A, r, b, S, a, v, n, o, Co, Ao, Tn, (M) => Ae(u, "system_fields", y.collection, `${y.collection}-${M.name}`, b), (M, $) => Ae(u, "system_unique", y.collection, `Unique-${y.collection}-${M.name}`, $), (M) => Ae(u, "system_fields", y.collection, `${y.collection}-${M}`, b)), A.set(Ae(u, r.join("/"), b), S), !T && R && Ge("create", "written", S, r, b, v, g.uid), await uc("create", r, b, S, m, v, E, A, g.uid, R || !1, f, !!T), T?.type === "unique")
|
|
11797
11797
|
return { docId: b, record: S };
|
|
11798
|
-
R && Ge("create", "success", S, r, b, v,
|
|
11798
|
+
R && Ge("create", "success", S, r, b, v, g.uid);
|
|
11799
11799
|
const k = ["create", S, b, m, !!T], D = [...k];
|
|
11800
11800
|
return await oe("postWrite", c, E, k), await oe("postOperation", c, E, D), { id: b, ...S };
|
|
11801
11801
|
}, yw = async (r, e) => {
|
|
@@ -11812,15 +11812,15 @@ const lw = async (r, e) => {
|
|
|
11812
11812
|
const l = r.at(-1), u = Object.keys(n.collections).includes(l), f = o.disabledCollections?.includes(l);
|
|
11813
11813
|
if (!u || f)
|
|
11814
11814
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11815
|
-
const d = n.collections[l], { labels: h, access: p, enableWriteLog: v, softDelete:
|
|
11815
|
+
const d = n.collections[l], { labels: h, access: p, enableWriteLog: v, softDelete: y } = d, { serverWriteOnly: O } = p, R = lt(h.collection), C = await se(o, ["global", "appName"]), w = t?.retry, E = i.currentUser;
|
|
11816
11816
|
if (!E)
|
|
11817
11817
|
throw new Error("NOT_AUTHENTICATED");
|
|
11818
11818
|
if (!c)
|
|
11819
11819
|
throw new Error("PERMISSION_DENIED");
|
|
11820
|
-
if (
|
|
11820
|
+
if (y && !d.auth)
|
|
11821
11821
|
return await lc(r, e, {
|
|
11822
|
-
[
|
|
11823
|
-
[
|
|
11822
|
+
[y.archivedField]: !0,
|
|
11823
|
+
[y.timestampField]: Pr()
|
|
11824
11824
|
});
|
|
11825
11825
|
const I = await se(R, [
|
|
11826
11826
|
"collections",
|
|
@@ -11833,77 +11833,84 @@ const lw = async (r, e) => {
|
|
|
11833
11833
|
throw new Error("CLIENT_OFFLINE");
|
|
11834
11834
|
})(), O || d.auth)
|
|
11835
11835
|
return await yw(r, e);
|
|
11836
|
-
if (
|
|
11836
|
+
if (_m(e))
|
|
11837
11837
|
throw new Error("RECORD_BUSY");
|
|
11838
|
-
let
|
|
11838
|
+
let g;
|
|
11839
11839
|
try {
|
|
11840
|
-
|
|
11840
|
+
g = await _r([h.collection], e);
|
|
11841
11841
|
} catch (D) {
|
|
11842
11842
|
throw v && w?.record && D.message.indexOf("NOT_FOUND") !== -1 && await Ge("delete", "failed", w?.record, r, e, d, E.uid, D), D;
|
|
11843
11843
|
}
|
|
11844
|
-
delete
|
|
11845
|
-
const N = Ro(a),
|
|
11846
|
-
Nt(A), !w && v && Ge("delete", "started", A, r, e, d, E.uid), w || (await oe("preOperation", o, R, ["delete", A, e,
|
|
11847
|
-
const m = ["delete", A, e,
|
|
11844
|
+
delete g.id;
|
|
11845
|
+
const N = Ro(a), _ = { collection: h.collection }, A = Go("delete", r, g, n, C, Wt(), E.uid, zt.now(), Pr(), !!w);
|
|
11846
|
+
Nt(A), !w && v && Ge("delete", "started", A, r, e, d, E.uid), w || (await oe("preOperation", o, R, ["delete", A, e, _, N]), await oe("preWrite", o, R, ["delete", A, e, _, N])), Nt(A), by(A, e, d, n, E.uid, c), sc("delete", N, r, e, A, n, d, t, s, Co, Ao, Tn, (D) => Ae(a, "system_fields", h.collection, `${h.collection}-${D.name}`, e), (D, x) => Ae(a, "system_unique", h.collection, `Unique-${h.collection}-${D.name}`, x), (D) => Ae(a, "system_fields", h.collection, `${h.collection}-${D}`, e)), N.delete(Ae(a, r.join("/"), e)), !w && v && Ge("delete", "written", A, r, e, d, E.uid), await uc("delete", r, e, A, _, d, R, N, E.uid, v || !1, c, !!w), v && Ge("delete", "success", { ...A, ...w?.record || {} }, r, e, d, E.uid);
|
|
11847
|
+
const m = ["delete", A, e, _, !!w], S = [...m];
|
|
11848
11848
|
return await oe("postWrite", o, R, m), await oe("postOperation", o, R, S), { id: e, ...A };
|
|
11849
|
-
},
|
|
11849
|
+
}, gm = (r) => {
|
|
11850
11850
|
if (typeof r == "object")
|
|
11851
11851
|
for (const e in r)
|
|
11852
|
-
Object.prototype.hasOwnProperty.call(r, e) && (r[e] === "_DELETE_FIELD" ? r[e] = Tn() :
|
|
11852
|
+
Object.prototype.hasOwnProperty.call(r, e) && (r[e] === "_DELETE_FIELD" ? r[e] = Tn() : gm(r[e]));
|
|
11853
|
+
}, _w = async (r, e) => {
|
|
11854
|
+
const t = nt(), n = Ue(), s = $e(t, n.STOKER_FB_FUNCTIONS_REGION);
|
|
11855
|
+
return (await Ke(s, r)(e)).data;
|
|
11853
11856
|
};
|
|
11854
11857
|
let ht = {};
|
|
11855
|
-
const
|
|
11858
|
+
const vw = async (r, e) => {
|
|
11856
11859
|
const t = fr(), n = mc(), s = t.currentUser;
|
|
11857
11860
|
if (s?.uid !== e.uid)
|
|
11858
11861
|
return;
|
|
11859
|
-
const i = await vd(pe(
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
await Od(n);
|
|
11863
|
-
const a = bm();
|
|
11862
|
+
const i = await vd(pe(Ym(n, "system_write_log"), ge("status", "==", "written"), ge("user", "==", e.uid), et("Last_Write_At", "asc")));
|
|
11863
|
+
await new Promise((o) => setTimeout(o, 1e4));
|
|
11864
|
+
const a = vm();
|
|
11864
11865
|
if (a?.version)
|
|
11865
11866
|
for (const o of i.docs) {
|
|
11866
11867
|
ht[o.id] ??= 0;
|
|
11867
11868
|
const c = o.data(), { data: l, operation: u, docId: f, collection: d, Collection_Path: h, Last_Write_Version: p } = c;
|
|
11868
|
-
|
|
11869
|
+
await new Promise((O) => setTimeout(O, 1e3));
|
|
11870
|
+
const v = await _w("stoker-writelog", {
|
|
11871
|
+
path: h,
|
|
11872
|
+
id: f,
|
|
11873
|
+
log: o.id
|
|
11874
|
+
});
|
|
11875
|
+
if (!v || v.status !== "written")
|
|
11876
|
+
continue;
|
|
11877
|
+
if (s?.uid !== e.uid)
|
|
11869
11878
|
return;
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
|
|
11876
|
-
|
|
11877
|
-
|
|
11878
|
-
|
|
11879
|
-
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
}
|
|
11890
|
-
if (console.info(`Retrying pending ${u} operation: ${o.ref.path}`), u === "create" && (ht[f]++, await _m(h, l.data, void 0, {
|
|
11879
|
+
if (a.force && p !== a.version) {
|
|
11880
|
+
Ge(
|
|
11881
|
+
u,
|
|
11882
|
+
"failed",
|
|
11883
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11884
|
+
l.data,
|
|
11885
|
+
h,
|
|
11886
|
+
f,
|
|
11887
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
11888
|
+
r.collections[d],
|
|
11889
|
+
e.uid,
|
|
11890
|
+
`Version mismatch- write log version ${p} not compatible with forced version ${a.version}`,
|
|
11891
|
+
u === "update" ? l.originalRecord : void 0
|
|
11892
|
+
);
|
|
11893
|
+
continue;
|
|
11894
|
+
}
|
|
11895
|
+
const y = localStorage.getItem(`stoker-retry-${f}`);
|
|
11896
|
+
if (y !== "done" && !(y && Date.now() - parseInt(y) < 1e4)) {
|
|
11897
|
+
if (localStorage.setItem(`stoker-retry-${f}`, Date.now().toString()), console.info(`Retrying pending ${u} operation: ${o.ref.path}`), u === "create" && (ht[f]++, await ym(h, l.data, void 0, {
|
|
11891
11898
|
retry: {
|
|
11892
11899
|
type: "offline",
|
|
11893
11900
|
docId: f
|
|
11894
11901
|
}
|
|
11895
11902
|
}).catch((O) => {
|
|
11896
|
-
console.error(O)
|
|
11897
|
-
})), u === "update") {
|
|
11903
|
+
console.error(O);
|
|
11904
|
+
}), ht[f]--, localStorage.setItem(`stoker-retry-${f}`, "done")), u === "update") {
|
|
11898
11905
|
const O = r.collections[d], { softDelete: R } = O;
|
|
11899
|
-
R && l.data?.[R.archivedField] && l.data?.[R.archivedField] !== l.originalRecord?.[R.archivedField] && (l.data[R.timestampField] = Pr()), l.data &&
|
|
11906
|
+
R && l.data?.[R.archivedField] && l.data?.[R.archivedField] !== l.originalRecord?.[R.archivedField] && (l.data[R.timestampField] = Pr()), l.data && gm(l.data), ht[f]++, await lc(h, f, l.data, void 0, {
|
|
11900
11907
|
retry: {
|
|
11901
11908
|
type: "offline",
|
|
11902
11909
|
originalRecord: l.originalRecord
|
|
11903
11910
|
}
|
|
11904
11911
|
}).catch((C) => {
|
|
11905
|
-
console.error(C)
|
|
11906
|
-
});
|
|
11912
|
+
console.error(C);
|
|
11913
|
+
}), ht[f]--, localStorage.setItem(`stoker-retry-${f}`, "done");
|
|
11907
11914
|
}
|
|
11908
11915
|
u === "delete" && (ht[f]++, await gw(h, f, {
|
|
11909
11916
|
retry: {
|
|
@@ -11917,16 +11924,16 @@ const _w = async (r, e) => {
|
|
|
11917
11924
|
}
|
|
11918
11925
|
}
|
|
11919
11926
|
}).catch((O) => {
|
|
11920
|
-
console.error(O)
|
|
11921
|
-
}));
|
|
11927
|
+
console.error(O);
|
|
11928
|
+
}), ht[f]--, localStorage.setItem(`stoker-retry-${f}`, "done"));
|
|
11922
11929
|
}
|
|
11923
11930
|
}
|
|
11924
|
-
},
|
|
11931
|
+
}, _m = (r) => !!ht[r], ww = () => {
|
|
11925
11932
|
ht = {};
|
|
11926
11933
|
};
|
|
11927
11934
|
let ln, Ga = 0;
|
|
11928
|
-
const
|
|
11929
|
-
const r =
|
|
11935
|
+
const bw = async () => {
|
|
11936
|
+
const r = Tm(), e = ke();
|
|
11930
11937
|
return dr(Ae(r, "system_deployment", "latest_deploy"), (n) => {
|
|
11931
11938
|
if (n.exists())
|
|
11932
11939
|
ln = n.data(), Ga++, Ga > 1 && (ln.refresh ? window.location.reload() : Ee(e.onVersionUpdate, [ln, Ga]));
|
|
@@ -11935,10 +11942,10 @@ const ww = async () => {
|
|
|
11935
11942
|
}, (n) => {
|
|
11936
11943
|
throw new Error("Error getting version info", { cause: n.message });
|
|
11937
11944
|
});
|
|
11938
|
-
},
|
|
11945
|
+
}, vm = () => ln;
|
|
11939
11946
|
let So;
|
|
11940
|
-
const
|
|
11941
|
-
const r = ke(), e =
|
|
11947
|
+
const Ow = async () => {
|
|
11948
|
+
const r = ke(), e = Tm();
|
|
11942
11949
|
dr(Ae(e, "system_deployment", "maintenance_mode"), (t) => {
|
|
11943
11950
|
if (t.exists())
|
|
11944
11951
|
So = t.data(), Ee(r.onMaintenanceUpdate, [So.active ? "on" : "off"]);
|
|
@@ -11947,17 +11954,17 @@ const bw = async () => {
|
|
|
11947
11954
|
}, (t) => {
|
|
11948
11955
|
throw new Error("Error getting maintenance status", { cause: t.message });
|
|
11949
11956
|
});
|
|
11950
|
-
},
|
|
11957
|
+
}, Ew = () => So;
|
|
11951
11958
|
let kr, wr = null;
|
|
11952
|
-
const
|
|
11959
|
+
const Sw = () => {
|
|
11953
11960
|
const r = gd(), e = ke();
|
|
11954
11961
|
let t = !1;
|
|
11955
|
-
return
|
|
11962
|
+
return Vm(Wm(r, ".info/connected"), (s) => {
|
|
11956
11963
|
s.val() === !0 ? (wr && (clearTimeout(wr), wr = null), kr = "Online", Ee(e.onConnectionStatusChange, [kr, !t]), t || (t = !0)) : !wr && t && (wr = setTimeout(() => {
|
|
11957
11964
|
kr = "Offline", Ee(e.onConnectionStatusChange, [kr]);
|
|
11958
11965
|
}, 5e3));
|
|
11959
11966
|
});
|
|
11960
|
-
}, Wt = () => kr,
|
|
11967
|
+
}, Wt = () => kr, Tw = () => navigator.onLine ? "Online" : "Offline", wm = async () => {
|
|
11961
11968
|
const r = ke(), e = fr(), t = e.currentUser;
|
|
11962
11969
|
if (r.preLogout && await Ee(r.preLogout, [t]) === !1)
|
|
11963
11970
|
throw new Error("Operation cancelled by preLogout");
|
|
@@ -11968,9 +11975,9 @@ const Ew = () => {
|
|
|
11968
11975
|
const s = { error: !0, instances: [{ instance: "[DEFAULT]", code: "SIGN_OUT", error: n }] };
|
|
11969
11976
|
await Ee(r.postLogout, [s]);
|
|
11970
11977
|
}
|
|
11971
|
-
},
|
|
11978
|
+
}, Rw = (r) => {
|
|
11972
11979
|
const e = (t) => {
|
|
11973
|
-
typeof t == "string" && t.includes("Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.") && (console.warn("Slow Firestore Connection Detected"), Ee(r.onFirestoreSlowConnection)), typeof t == "string" && t.includes("Using maximum backoff delay to prevent overloading the backend.") && (console.warn("Firestore Load Failure Detected"), Ee(r.onFirestoreLoadFailure)), typeof t == "string" && t.includes("The user's credential is no longer valid. The user must sign in again.") && (console.warn("User Credential Expired"),
|
|
11980
|
+
typeof t == "string" && t.includes("Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.") && (console.warn("Slow Firestore Connection Detected"), Ee(r.onFirestoreSlowConnection)), typeof t == "string" && t.includes("Using maximum backoff delay to prevent overloading the backend.") && (console.warn("Firestore Load Failure Detected"), Ee(r.onFirestoreLoadFailure)), typeof t == "string" && t.includes("The user's credential is no longer valid. The user must sign in again.") && (console.warn("User Credential Expired"), wm()), typeof t == "string" && t.includes("Connection to Indexed Database server lost. Refresh the page to try again") && (console.warn("Indexed Database Connection Lost"), Ee(r.onIndexedDBConnectionLost));
|
|
11974
11981
|
};
|
|
11975
11982
|
window.addEventListener("error", (t) => {
|
|
11976
11983
|
e(t.message);
|
|
@@ -11979,7 +11986,7 @@ const Ew = () => {
|
|
|
11979
11986
|
e(n);
|
|
11980
11987
|
});
|
|
11981
11988
|
};
|
|
11982
|
-
let ft, Tt,
|
|
11989
|
+
let ft, Tt, bm, ye, Om, Dr, fc, dc, qe, Em, Sn = [], ve;
|
|
11983
11990
|
const Ha = {
|
|
11984
11991
|
firestoreWriteApp: {}
|
|
11985
11992
|
}, dt = {
|
|
@@ -11998,10 +12005,10 @@ const Ha = {
|
|
|
11998
12005
|
return ve;
|
|
11999
12006
|
},
|
|
12000
12007
|
getTimezone() {
|
|
12001
|
-
return
|
|
12008
|
+
return bm;
|
|
12002
12009
|
},
|
|
12003
12010
|
getConnectionStatus: Wt,
|
|
12004
|
-
getNetworkStatus:
|
|
12011
|
+
getNetworkStatus: Tw,
|
|
12005
12012
|
getSchema(r = !1) {
|
|
12006
12013
|
const e = Oe(Dr);
|
|
12007
12014
|
if (r) {
|
|
@@ -12017,7 +12024,7 @@ const Ha = {
|
|
|
12017
12024
|
return e;
|
|
12018
12025
|
},
|
|
12019
12026
|
getCurrentUser() {
|
|
12020
|
-
return
|
|
12027
|
+
return Em;
|
|
12021
12028
|
},
|
|
12022
12029
|
getCurrentUserRoleGroups() {
|
|
12023
12030
|
return Oe(dc);
|
|
@@ -12029,10 +12036,10 @@ const Ha = {
|
|
|
12029
12036
|
return Oe(ye);
|
|
12030
12037
|
},
|
|
12031
12038
|
getCollectionConfigModule(r) {
|
|
12032
|
-
return Oe(
|
|
12039
|
+
return Oe(Om[r]);
|
|
12033
12040
|
},
|
|
12034
|
-
getVersionInfo:
|
|
12035
|
-
getMaintenanceInfo:
|
|
12041
|
+
getVersionInfo: vm,
|
|
12042
|
+
getMaintenanceInfo: Ew,
|
|
12036
12043
|
getCurrentUserPermissions: Fe,
|
|
12037
12044
|
getLoadingState: Eo,
|
|
12038
12045
|
getAppCheck() {
|
|
@@ -12050,16 +12057,16 @@ const Ha = {
|
|
|
12050
12057
|
getFirestoreMaintenance() {
|
|
12051
12058
|
return ze.maintenance;
|
|
12052
12059
|
}
|
|
12053
|
-
},
|
|
12054
|
-
Dr = {}, fc = {}, dc = {}, qe = {}, ig(), uw(),
|
|
12055
|
-
},
|
|
12060
|
+
}, Aw = () => {
|
|
12061
|
+
Dr = {}, fc = {}, dc = {}, qe = {}, ig(), uw(), ww();
|
|
12062
|
+
}, Cw = () => Sn, kw = () => {
|
|
12056
12063
|
Sn = [];
|
|
12057
12064
|
};
|
|
12058
12065
|
let md = !1;
|
|
12059
|
-
const
|
|
12066
|
+
const Bw = async (r, e, t, n) => {
|
|
12060
12067
|
if (ve = t, ft)
|
|
12061
12068
|
return console.error("Stoker is already initialized."), !0;
|
|
12062
|
-
|
|
12069
|
+
km("stoker-client", hp, "web"), Tt = ve.MODE, ye = r.default("web", To, n), bm = await se(ye, ["global", "timezone"]), se(ye, ["global", "roles"]), se(ye, ["global", "appName"]), se(ye, ["global", "auth", "enableMultiFactorAuth"]);
|
|
12063
12070
|
const s = JSON.parse(ve.STOKER_FB_WEB_APP_CONFIG), i = await se(ye, ["global", "firebase", "GDPRSettings"]);
|
|
12064
12071
|
ft = Vn(s, {
|
|
12065
12072
|
automaticDataCollectionEnabled: i || !0
|
|
@@ -12067,18 +12074,18 @@ const zw = async (r, e, t, n) => {
|
|
|
12067
12074
|
const a = up(ft);
|
|
12068
12075
|
Tt === "development" && (a.instrumentationEnabled = !1, a.dataCollectionEnabled = !1);
|
|
12069
12076
|
const o = ["firestoreWrite"];
|
|
12070
|
-
for (const
|
|
12071
|
-
Ha[`${
|
|
12077
|
+
for (const _ of o)
|
|
12078
|
+
Ha[`${_}App`] = Vn(s, _);
|
|
12072
12079
|
const { firestoreWriteApp: c } = Ha, l = Vn(s, "maintenance");
|
|
12073
12080
|
ze.maintenance = je(l);
|
|
12074
12081
|
const u = fp();
|
|
12075
12082
|
if (u.settings.minimumFetchIntervalMillis = 36e5, await dp(u), ve.STOKER_FB_ENABLE_APP_CHECK === "true" && ve.STOKER_FB_APP_CHECK_KEY) {
|
|
12076
12083
|
(Tt === "development" || window.location.hostname === "localhost") && (globalThis.FIREBASE_APPCHECK_DEBUG_TOKEN = !0);
|
|
12077
|
-
const
|
|
12084
|
+
const _ = {
|
|
12078
12085
|
provider: new lp(ve.STOKER_FB_APP_CHECK_KEY),
|
|
12079
12086
|
isTokenAutoRefreshEnabled: !0
|
|
12080
12087
|
};
|
|
12081
|
-
Ct.main = Bn(ft,
|
|
12088
|
+
Ct.main = Bn(ft, _), Ct.firestoreWrite = Bn(c, _), Ct.maintenance = Bn(l, _);
|
|
12082
12089
|
let A = !1;
|
|
12083
12090
|
const b = (m, S) => {
|
|
12084
12091
|
if (console.log(`App Check token error detected for ${S}`), !A)
|
|
@@ -12110,7 +12117,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12110
12117
|
"global",
|
|
12111
12118
|
"firebase",
|
|
12112
12119
|
"enableEmulators"
|
|
12113
|
-
]), v = await se(ye, ["global", "enableUserIDLogging"]),
|
|
12120
|
+
]), v = await se(ye, ["global", "enableUserIDLogging"]), y = await se(ye, [
|
|
12114
12121
|
"global",
|
|
12115
12122
|
"firebase",
|
|
12116
12123
|
"logLevel",
|
|
@@ -12120,24 +12127,24 @@ const zw = async (r, e, t, n) => {
|
|
|
12120
12127
|
"firebase",
|
|
12121
12128
|
"logLevel",
|
|
12122
12129
|
"prod"
|
|
12123
|
-
]), R = await
|
|
12124
|
-
throw new Error("Error checking analytics support.", { cause:
|
|
12130
|
+
]), R = await xm().catch((_) => {
|
|
12131
|
+
throw new Error("Error checking analytics support.", { cause: _ });
|
|
12125
12132
|
});
|
|
12126
|
-
Tt === "production" && f && R &&
|
|
12133
|
+
Tt === "production" && f && R && Nm(ft, d || {}), h && Fm(h);
|
|
12127
12134
|
const C = await se(ye, [
|
|
12128
12135
|
"global",
|
|
12129
12136
|
"auth",
|
|
12130
12137
|
"authPersistenceType"
|
|
12131
12138
|
]), E = {
|
|
12132
12139
|
popupRedirectResolver: void 0,
|
|
12133
|
-
persistence: C === "LOCAL" ? [
|
|
12140
|
+
persistence: C === "LOCAL" ? [Dm, Mm, wc] : C === "SESSION" ? [wc, bc] : [bc]
|
|
12134
12141
|
};
|
|
12135
12142
|
dt.main = vc(ft, E);
|
|
12136
|
-
for (const
|
|
12137
|
-
dt[
|
|
12143
|
+
for (const _ of o)
|
|
12144
|
+
dt[_] = vc(Ha[`${_}App`], E);
|
|
12138
12145
|
const { main: I } = dt;
|
|
12139
|
-
|
|
12140
|
-
if (
|
|
12146
|
+
Pm(I, async (_) => {
|
|
12147
|
+
if (_ && await Ee(ye.preLogin, [_]) === !1)
|
|
12141
12148
|
throw new Error("Operation cancelled by preLogin");
|
|
12142
12149
|
});
|
|
12143
12150
|
const T = await se(ye, [
|
|
@@ -12147,50 +12154,50 @@ const zw = async (r, e, t, n) => {
|
|
|
12147
12154
|
]);
|
|
12148
12155
|
if (Tt === "development" && p) {
|
|
12149
12156
|
if (!T?.includes("Auth")) {
|
|
12150
|
-
const
|
|
12157
|
+
const _ = ve.STOKER_FB_EMULATOR_AUTH_PORT ? parseInt(ve.STOKER_FB_EMULATOR_AUTH_PORT) : 9099;
|
|
12151
12158
|
for (const A of Object.values(dt))
|
|
12152
|
-
|
|
12159
|
+
qm(A, `http://localhost:${_}`);
|
|
12153
12160
|
}
|
|
12154
12161
|
if (!T?.includes("Database")) {
|
|
12155
|
-
const
|
|
12156
|
-
|
|
12162
|
+
const _ = ve.STOKER_FB_EMULATOR_DATABASE_PORT ? parseInt(ve.STOKER_FB_EMULATOR_DATABASE_PORT) : 9e3;
|
|
12163
|
+
zm(gd(), "localhost", _);
|
|
12157
12164
|
}
|
|
12158
12165
|
if (!T?.includes("Firestore")) {
|
|
12159
|
-
const
|
|
12160
|
-
Sc(ze.maintenance, "localhost",
|
|
12166
|
+
const _ = ve.STOKER_FB_EMULATOR_FIRESTORE_PORT ? parseInt(ve.STOKER_FB_EMULATOR_FIRESTORE_PORT) : 8080;
|
|
12167
|
+
Sc(ze.maintenance, "localhost", _);
|
|
12161
12168
|
}
|
|
12162
12169
|
if (!T?.includes("Storage")) {
|
|
12163
|
-
const
|
|
12164
|
-
ap(op(), "localhost",
|
|
12170
|
+
const _ = ve.STOKER_FB_EMULATOR_STORAGE_PORT ? parseInt(ve.STOKER_FB_EMULATOR_STORAGE_PORT) : 9199;
|
|
12171
|
+
ap(op(), "localhost", _);
|
|
12165
12172
|
}
|
|
12166
12173
|
if (!T?.includes("Functions")) {
|
|
12167
|
-
const
|
|
12168
|
-
cp($e(ft, ve.STOKER_FB_FUNCTIONS_REGION), "localhost",
|
|
12174
|
+
const _ = ve.STOKER_FB_EMULATOR_FUNCTIONS_PORT ? parseInt(ve.STOKER_FB_EMULATOR_FUNCTIONS_PORT) : 5001;
|
|
12175
|
+
cp($e(ft, ve.STOKER_FB_FUNCTIONS_REGION), "localhost", _);
|
|
12169
12176
|
}
|
|
12170
12177
|
}
|
|
12171
|
-
if (
|
|
12172
|
-
const
|
|
12178
|
+
if (bw(), Ow(), Sw(), Tt === "development" && (y ? Yr(y) : Yr("debug")), Tt === "production" && (O ? Yr(O) : Yr("error")), v) {
|
|
12179
|
+
const _ = Wn(I, async (A) => {
|
|
12173
12180
|
if (A) {
|
|
12174
12181
|
const b = JSON.parse(ve.STOKER_FB_WEB_APP_CONFIG);
|
|
12175
|
-
|
|
12182
|
+
Im(() => {
|
|
12176
12183
|
console.log(`Tenant - ${b.projectId} - User - ${A.uid}`);
|
|
12177
12184
|
});
|
|
12178
12185
|
}
|
|
12179
12186
|
});
|
|
12180
|
-
Sn.push(
|
|
12187
|
+
Sn.push(_);
|
|
12181
12188
|
}
|
|
12182
|
-
await Promise.all(Object.values(dt).map((
|
|
12183
|
-
throw new Error(`Error waiting for auth state in ${
|
|
12189
|
+
await Promise.all(Object.values(dt).map((_) => _.authStateReady().catch((A) => {
|
|
12190
|
+
throw new Error(`Error waiting for auth state in ${_.app.name}.`, { cause: A });
|
|
12184
12191
|
})));
|
|
12185
|
-
let
|
|
12186
|
-
for (const
|
|
12187
|
-
|
|
12192
|
+
let g = !1;
|
|
12193
|
+
for (const _ of Object.values(dt))
|
|
12194
|
+
_.currentUser || (g = !0);
|
|
12188
12195
|
let N;
|
|
12189
|
-
return Wn(I, async (
|
|
12190
|
-
if (
|
|
12191
|
-
qe =
|
|
12192
|
-
const A = await
|
|
12193
|
-
|
|
12196
|
+
return Wn(I, async (_) => {
|
|
12197
|
+
if (_) {
|
|
12198
|
+
qe = _;
|
|
12199
|
+
const A = await Lm(qe), { claims: b } = A;
|
|
12200
|
+
Em = {
|
|
12194
12201
|
...qe,
|
|
12195
12202
|
token: {
|
|
12196
12203
|
claims: b
|
|
@@ -12203,7 +12210,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12203
12210
|
H && (Z(), st({}));
|
|
12204
12211
|
});
|
|
12205
12212
|
}));
|
|
12206
|
-
await Promise.all(m), md || (
|
|
12213
|
+
await Promise.all(m), md || (Rw(ye), md = !0), N = await se(ye, ["global", "auth", "offlinePersistenceType"], [qe, b]);
|
|
12207
12214
|
const S = await se(ye, ["global", "auth", "tabManager"], [qe, b]), k = await se(ye, ["global", "auth", "garbageCollectionStrategy"], [qe, b]), D = await se(ye, ["global", "auth", "maxCacheSize"], [qe, b]) || -1, x = await se(ye, ["global", "auth", "maxWriteCacheSize"], [qe, b]);
|
|
12208
12215
|
let M;
|
|
12209
12216
|
const $ = {
|
|
@@ -12218,8 +12225,8 @@ const zw = async (r, e, t, n) => {
|
|
|
12218
12225
|
})
|
|
12219
12226
|
};
|
|
12220
12227
|
let ae;
|
|
12221
|
-
if (k === "EAGER" ? ae =
|
|
12222
|
-
localCache:
|
|
12228
|
+
if (k === "EAGER" ? ae = Jm() : ae = Qm({ cacheSizeBytes: D }), N === "ALL" ? M = $ : M = {
|
|
12229
|
+
localCache: Xm({
|
|
12223
12230
|
garbageCollector: ae
|
|
12224
12231
|
})
|
|
12225
12232
|
}, ze.main = zn(ft, M), ["ALL", "WRITE"].includes(N) ? ze.firestoreWrite = zn(c, G) : ze.firestoreWrite = zn(c, M), Tt === "development" && p && !T?.includes("Firestore")) {
|
|
@@ -12228,23 +12235,23 @@ const zw = async (r, e, t, n) => {
|
|
|
12228
12235
|
st !== "maintenance" && Sc(Z, "localhost", Ce);
|
|
12229
12236
|
}
|
|
12230
12237
|
if (N === "ALL") {
|
|
12231
|
-
const Ce =
|
|
12232
|
-
Ce &&
|
|
12238
|
+
const Ce = ep(ze.main);
|
|
12239
|
+
Ce && tp(Ce);
|
|
12233
12240
|
}
|
|
12234
12241
|
const B = await Ke($e(ft, ve.STOKER_FB_FUNCTIONS_REGION), "stoker-schema")().catch((Ce) => {
|
|
12235
12242
|
throw new Error("Error fetching schema.", { cause: Ce });
|
|
12236
12243
|
});
|
|
12237
12244
|
Dr = B.data.schema;
|
|
12238
12245
|
const te = Object.entries(B.data.allRoleGroups).map(([Ce, st]) => [Ce, new Set(st)]);
|
|
12239
|
-
fc = Object.fromEntries(te), dc = B.data.currentUserRoleGroups,
|
|
12246
|
+
fc = Object.fromEntries(te), dc = B.data.currentUserRoleGroups, Om = Oy(Object.keys(Dr.collections), e, "web", To, n);
|
|
12240
12247
|
const Je = await lw(qe, A);
|
|
12241
|
-
Sn.push(...Je), N === "WRITE" &&
|
|
12248
|
+
Sn.push(...Je), N === "WRITE" && vw(Dr, qe), await Ee(ye.postLogin, [qe]);
|
|
12242
12249
|
const Ve = new Event("stoker:ready");
|
|
12243
12250
|
document.dispatchEvent(Ve);
|
|
12244
12251
|
} else if (qe) {
|
|
12245
|
-
|
|
12252
|
+
Aw(), Cw().forEach((k) => {
|
|
12246
12253
|
k();
|
|
12247
|
-
}),
|
|
12254
|
+
}), kw();
|
|
12248
12255
|
const b = new Event("stoker:signOut");
|
|
12249
12256
|
document.dispatchEvent(b);
|
|
12250
12257
|
const m = { error: !1, instances: [] };
|
|
@@ -12257,7 +12264,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12257
12264
|
}), console.error(`Error signing out of ${k.app.name}.`);
|
|
12258
12265
|
});
|
|
12259
12266
|
})), await Promise.all(Object.entries(ze).map(async ([k, D]) => {
|
|
12260
|
-
k !== "maintenance" && Object.keys(D).length !== 0 && await
|
|
12267
|
+
k !== "maintenance" && Object.keys(D).length !== 0 && await rp(D).catch((x) => {
|
|
12261
12268
|
console.error(`Error terminating ${D.app.name}.`), m.error = !0, m.instances.push({
|
|
12262
12269
|
instance: D.app.name,
|
|
12263
12270
|
code: "TERMINATE_APP",
|
|
@@ -12274,9 +12281,9 @@ const zw = async (r, e, t, n) => {
|
|
|
12274
12281
|
console.error('Error clearing indexedDB persistence in "firestoreWrite".'), m.error = !0, m.instances.push({ instance: "firestoreWrite", code: "CLEAR_CACHE", error: k });
|
|
12275
12282
|
})), m.error ? console.info("Sign out operation completed with errors.") : console.info("Sign out operation completed successfully."), await Ee(ye.postLogout, [m]);
|
|
12276
12283
|
}
|
|
12277
|
-
}),
|
|
12278
|
-
}, { getEnv: Ue, getTimezone:
|
|
12279
|
-
const [n, s] = [fr(),
|
|
12284
|
+
}), g ? !1 : I.currentUser ? (v && console.info(`${I.currentUser.uid} successfully logged in.`), !0) : !1;
|
|
12285
|
+
}, { getEnv: Ue, getTimezone: Sm, getSchema: He, getCurrentUser: Zw, getCurrentUserRoleGroups: Kr, getAllRoleGroups: hc, getGlobalConfigModule: ke, getCollectionConfigModule: lt, getAppCheck: Gw, getAppCheckFirestoreWrite: Hw, getFirestoreWriteAuth: Iw, getFirestoreWrite: mc, getFirestoreMaintenance: Tm } = To, Kw = async (r, e, t) => {
|
|
12286
|
+
const [n, s] = [fr(), Iw()], i = ke();
|
|
12280
12287
|
if (!r || !e)
|
|
12281
12288
|
throw new Error("Email and password are required.");
|
|
12282
12289
|
try {
|
|
@@ -12285,12 +12292,12 @@ const zw = async (r, e, t, n) => {
|
|
|
12285
12292
|
a = n.currentUser?.uid;
|
|
12286
12293
|
else
|
|
12287
12294
|
try {
|
|
12288
|
-
a = (await
|
|
12295
|
+
a = (await $m(n, r, e)).user.uid;
|
|
12289
12296
|
} catch (c) {
|
|
12290
12297
|
if (c.code === "auth/multi-factor-auth-required")
|
|
12291
12298
|
if (t) {
|
|
12292
12299
|
o ||= await t();
|
|
12293
|
-
const l =
|
|
12300
|
+
const l = jm(n, c), u = Ja.assertionForSignIn(l.hints[0].uid, o);
|
|
12294
12301
|
a = (await l.resolveSignIn(u)).user.uid;
|
|
12295
12302
|
} else
|
|
12296
12303
|
throw new Error("TOTP retrieval function not found.");
|
|
@@ -12303,7 +12310,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12303
12310
|
const h = (await f()).data.customToken;
|
|
12304
12311
|
if (!h)
|
|
12305
12312
|
throw new Error("The user is not authenticated.");
|
|
12306
|
-
await
|
|
12313
|
+
await Um(s, h);
|
|
12307
12314
|
} catch {
|
|
12308
12315
|
throw n && n.currentUser && await yd(n), new Error("The user is not authenticated.");
|
|
12309
12316
|
}
|
|
@@ -12312,13 +12319,13 @@ const zw = async (r, e, t, n) => {
|
|
|
12312
12319
|
} catch (a) {
|
|
12313
12320
|
throw await Ee(i.postLogin, [null, a]), a;
|
|
12314
12321
|
}
|
|
12315
|
-
},
|
|
12322
|
+
}, Yw = (r) => (document.addEventListener("stoker:ready", r), () => {
|
|
12316
12323
|
document.removeEventListener("stoker:ready", r);
|
|
12317
|
-
}),
|
|
12324
|
+
}), Jw = (r) => (document.addEventListener("stoker:signOut", r), () => {
|
|
12318
12325
|
document.removeEventListener("stoker:signOut", r);
|
|
12319
|
-
}),
|
|
12326
|
+
}), Qw = (r) => (document.addEventListener("stoker:permissionsChange", r), () => {
|
|
12320
12327
|
document.removeEventListener("stoker:permissionsChange", r);
|
|
12321
|
-
}),
|
|
12328
|
+
}), Xw = async (r, e) => {
|
|
12322
12329
|
if (r.email) {
|
|
12323
12330
|
const t = ke(), n = await se(t, ["global", "appName"]), s = await Oc(r).getSession().catch((u) => {
|
|
12324
12331
|
throw new Error("Error getting multi-factor session.", { cause: u });
|
|
@@ -12341,7 +12348,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12341
12348
|
});
|
|
12342
12349
|
} else
|
|
12343
12350
|
throw new Error("User must have an email address to enroll in multi-factor authentication.");
|
|
12344
|
-
},
|
|
12351
|
+
}, eb = async (r, e, t) => {
|
|
12345
12352
|
const n = nt(), s = Ue(), i = $e(n, s.STOKER_FB_FUNCTIONS_REGION);
|
|
12346
12353
|
await Ke(i, "stoker-deletefolder")({
|
|
12347
12354
|
path: r || "",
|
|
@@ -12349,13 +12356,13 @@ const zw = async (r, e, t, n) => {
|
|
|
12349
12356
|
collectionPath: e.Collection_Path,
|
|
12350
12357
|
folderName: t
|
|
12351
12358
|
});
|
|
12352
|
-
},
|
|
12359
|
+
}, tb = async () => {
|
|
12353
12360
|
const r = [je(), mc()];
|
|
12354
12361
|
for (const e of Object.values(r))
|
|
12355
|
-
await
|
|
12362
|
+
await np(e).catch((t) => {
|
|
12356
12363
|
throw new Error(`Error waiting for pending writes in ${e.app.name}.`, { cause: t });
|
|
12357
12364
|
});
|
|
12358
|
-
},
|
|
12365
|
+
}, Rm = async (r, e, t, n, s) => {
|
|
12359
12366
|
const i = r.at(-1);
|
|
12360
12367
|
if (!i)
|
|
12361
12368
|
throw new Error("EMPTY_PATH");
|
|
@@ -12365,20 +12372,20 @@ const zw = async (r, e, t, n) => {
|
|
|
12365
12372
|
const o = He(!0), l = Kr()[i], u = je(), f = o.collections[i];
|
|
12366
12373
|
if (!f)
|
|
12367
12374
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12368
|
-
const { labels: d, preloadCache: h } = f, p = ke(), v = Object.keys(o.collections).includes(i),
|
|
12369
|
-
if (!v ||
|
|
12375
|
+
const { labels: d, preloadCache: h } = f, p = ke(), v = Object.keys(o.collections).includes(i), y = p.disabledCollections?.includes(i);
|
|
12376
|
+
if (!v || y)
|
|
12370
12377
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12371
12378
|
const O = lt(d.collection), R = await se(p, [
|
|
12372
12379
|
"global",
|
|
12373
12380
|
"firebase",
|
|
12374
12381
|
"serverTimestampOptions"
|
|
12375
|
-
]), C =
|
|
12382
|
+
]), C = lm(r, e, l);
|
|
12376
12383
|
if (C.length === 0)
|
|
12377
12384
|
throw new Error("PERMISSION_DENIED");
|
|
12378
12385
|
const w = h?.roles?.includes(a.Role), E = { collection: d.collection };
|
|
12379
12386
|
await oe("preOperation", p, O, ["read", void 0, e, E]), await oe("preRead", p, O, [E, C, !1, !0]);
|
|
12380
|
-
const
|
|
12381
|
-
let
|
|
12387
|
+
const g = /* @__PURE__ */ new Map(), N = [];
|
|
12388
|
+
let _ = {};
|
|
12382
12389
|
const A = /* @__PURE__ */ new Map();
|
|
12383
12390
|
typeof s?.relations == "object" && (s.relations.fields = s.relations.fields.map((x) => {
|
|
12384
12391
|
if (typeof x == "string") {
|
|
@@ -12390,21 +12397,21 @@ const zw = async (r, e, t, n) => {
|
|
|
12390
12397
|
return x;
|
|
12391
12398
|
}));
|
|
12392
12399
|
const b = () => {
|
|
12393
|
-
const x =
|
|
12394
|
-
if (x(),
|
|
12395
|
-
if (
|
|
12400
|
+
const x = bd(u, async () => {
|
|
12401
|
+
if (x(), _) {
|
|
12402
|
+
if (om(_, A), !s?.noComputedFields) {
|
|
12396
12403
|
const M = [];
|
|
12397
12404
|
for (const $ of f.fields)
|
|
12398
|
-
$.type === "Computed" && M.push(Ee(() => $.formula(
|
|
12399
|
-
|
|
12405
|
+
$.type === "Computed" && M.push(Ee(() => $.formula(_)).then((G) => {
|
|
12406
|
+
_ && (_[$.name] = G);
|
|
12400
12407
|
}));
|
|
12401
12408
|
await Promise.all(M);
|
|
12402
12409
|
}
|
|
12403
12410
|
if (s?.noEmbeddingFields)
|
|
12404
12411
|
for (const M of f.fields)
|
|
12405
|
-
M.type === "Embedding" && delete
|
|
12412
|
+
M.type === "Embedding" && delete _[M.name];
|
|
12406
12413
|
}
|
|
12407
|
-
t(Oe(
|
|
12414
|
+
t(Oe(_));
|
|
12408
12415
|
});
|
|
12409
12416
|
}, m = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), k = (x) => typeof x == "object" ? x.fields.filter(($) => typeof $ == "object" && _e($) && $t(f, o, a).includes($.collection)) : f.fields.filter(($) => _e($) && $t(f, o, a).includes($.collection)), D = () => new Promise((x) => {
|
|
12410
12417
|
if (!s?.relations) {
|
|
@@ -12415,10 +12422,10 @@ const zw = async (r, e, t, n) => {
|
|
|
12415
12422
|
for (const P of ae)
|
|
12416
12423
|
for (const B of S.values())
|
|
12417
12424
|
B.type === P.type && B.field === P.name && // eslint-disable-next-line security/detect-object-injection
|
|
12418
|
-
!
|
|
12425
|
+
!_[P.name][B.id] && (B.listener(), m.delete(`${P.name}_${B.id}`));
|
|
12419
12426
|
for (const P of ae)
|
|
12420
12427
|
if ("collection" in P) {
|
|
12421
|
-
const B =
|
|
12428
|
+
const B = _[P.name];
|
|
12422
12429
|
if (!B)
|
|
12423
12430
|
continue;
|
|
12424
12431
|
for (const te of Object.keys(B))
|
|
@@ -12429,7 +12436,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12429
12436
|
else
|
|
12430
12437
|
for (const P of ae)
|
|
12431
12438
|
if ("collection" in P) {
|
|
12432
|
-
const B =
|
|
12439
|
+
const B = _[P.name];
|
|
12433
12440
|
if (!B)
|
|
12434
12441
|
continue;
|
|
12435
12442
|
for (const [te, Je] of Object.entries(B))
|
|
@@ -12454,20 +12461,20 @@ const zw = async (r, e, t, n) => {
|
|
|
12454
12461
|
}
|
|
12455
12462
|
B[te] = H, $.set(`${P.name}_${te}`, !0), Array.from($.values()).every((j) => j) && (x({}), b(), oe("postOperation", p, O, [
|
|
12456
12463
|
"read",
|
|
12457
|
-
|
|
12464
|
+
_,
|
|
12458
12465
|
e,
|
|
12459
12466
|
E
|
|
12460
12467
|
]), oe("postRead", p, O, [
|
|
12461
12468
|
E,
|
|
12462
12469
|
C,
|
|
12463
|
-
|
|
12470
|
+
_,
|
|
12464
12471
|
!0
|
|
12465
12472
|
]));
|
|
12466
12473
|
}).catch((H) => {
|
|
12467
12474
|
delete B[te], H.code !== "permission-denied" && n && n(new Error(`Error fetching relation document in collection ${P.collection} with ID ${e} at location ${Je.Collection_Path?.join("/")}`, {
|
|
12468
12475
|
cause: H
|
|
12469
12476
|
}));
|
|
12470
|
-
}) :
|
|
12477
|
+
}) : Rm(
|
|
12471
12478
|
[...Je.Collection_Path],
|
|
12472
12479
|
te,
|
|
12473
12480
|
(H) => {
|
|
@@ -12481,13 +12488,13 @@ const zw = async (r, e, t, n) => {
|
|
|
12481
12488
|
}
|
|
12482
12489
|
B[te] = H, $.set(`${P.name}_${te}`, !0), Array.from($.values()).every((j) => j) && (x({}), b(), oe("postOperation", p, O, [
|
|
12483
12490
|
"read",
|
|
12484
|
-
|
|
12491
|
+
_,
|
|
12485
12492
|
e,
|
|
12486
12493
|
E
|
|
12487
12494
|
]), oe("postRead", p, O, [
|
|
12488
12495
|
E,
|
|
12489
12496
|
C,
|
|
12490
|
-
|
|
12497
|
+
_,
|
|
12491
12498
|
!0
|
|
12492
12499
|
]));
|
|
12493
12500
|
},
|
|
@@ -12517,22 +12524,22 @@ const zw = async (r, e, t, n) => {
|
|
|
12517
12524
|
const M = dr(x, { source: s?.only || (w ? "cache" : "default") }, ($) => {
|
|
12518
12525
|
if ($.exists()) {
|
|
12519
12526
|
const G = $.data({ serverTimestamps: R || "none" });
|
|
12520
|
-
if (
|
|
12527
|
+
if (g.has(x.path) && s?.relations) {
|
|
12521
12528
|
const P = k(s?.relations);
|
|
12522
12529
|
for (const B of P)
|
|
12523
|
-
"collection" in B && G[B.name] && (G[B.name] =
|
|
12530
|
+
"collection" in B && G[B.name] && (G[B.name] = _?.[B.name]);
|
|
12524
12531
|
}
|
|
12525
|
-
|
|
12532
|
+
g.set(x.path, !0), _ ||= {}, _.id ||= $.id, _ = { ..._, ...G }, delete _.Collection_Path_String;
|
|
12526
12533
|
const ae = A.get(x) || /* @__PURE__ */ new Set();
|
|
12527
|
-
|
|
12534
|
+
am(G, ae), A.set(x, ae), g.size === C.length && D().then(() => {
|
|
12528
12535
|
b(), oe("postOperation", p, O, [
|
|
12529
12536
|
"read",
|
|
12530
|
-
|
|
12537
|
+
_,
|
|
12531
12538
|
e,
|
|
12532
12539
|
E
|
|
12533
|
-
]), oe("postRead", p, O, [E, C,
|
|
12540
|
+
]), oe("postRead", p, O, [E, C, _, !0]);
|
|
12534
12541
|
});
|
|
12535
|
-
} else
|
|
12542
|
+
} else _ && (_ = void 0, b(), oe("postOperation", p, O, ["read", void 0, e, E]), oe("postRead", p, O, [E, C, void 0, !0]));
|
|
12536
12543
|
}, ($) => {
|
|
12537
12544
|
n && n($), N.forEach((G) => G());
|
|
12538
12545
|
});
|
|
@@ -12557,17 +12564,17 @@ const zw = async (r, e, t, n) => {
|
|
|
12557
12564
|
if (t?.id !== e)
|
|
12558
12565
|
throw new Error("INPUT_ERROR: Mismatched last cursor IDs");
|
|
12559
12566
|
});
|
|
12560
|
-
},
|
|
12567
|
+
}, rb = async (r, e, t, n, s) => {
|
|
12561
12568
|
const i = r.at(-1);
|
|
12562
12569
|
if (!i)
|
|
12563
12570
|
throw new Error("EMPTY_PATH");
|
|
12564
12571
|
const a = Fe();
|
|
12565
12572
|
if (!a?.Role)
|
|
12566
12573
|
throw new Error("PERMISSION_DENIED");
|
|
12567
|
-
const o = He(!0), l = Kr()[i], u = je(), f = o.collections[i], { labels: d, preloadCache: h, access: p } = f, { serverReadOnly: v } = p,
|
|
12574
|
+
const o = He(!0), l = Kr()[i], u = je(), f = o.collections[i], { labels: d, preloadCache: h, access: p } = f, { serverReadOnly: v } = p, y = ke(), O = Object.keys(o.collections).includes(i), R = y.disabledCollections?.includes(i);
|
|
12568
12575
|
if (!O || R)
|
|
12569
12576
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12570
|
-
const C = lt(d.collection), w = await se(
|
|
12577
|
+
const C = lt(d.collection), w = await se(y, [
|
|
12571
12578
|
"global",
|
|
12572
12579
|
"firebase",
|
|
12573
12580
|
"serverTimestampOptions"
|
|
@@ -12582,35 +12589,35 @@ const zw = async (r, e, t, n) => {
|
|
|
12582
12589
|
return { pages: 0, count: 0, unsubscribe: () => {
|
|
12583
12590
|
} };
|
|
12584
12591
|
let T = I.map((Z) => pe(Z, ...e));
|
|
12585
|
-
const
|
|
12592
|
+
const g = s?.pagination?.startAfter || s?.pagination?.endBefore || s?.pagination?.startAt || s?.pagination?.endAt || {
|
|
12586
12593
|
first: /* @__PURE__ */ new Map(),
|
|
12587
12594
|
last: /* @__PURE__ */ new Map()
|
|
12588
12595
|
};
|
|
12589
12596
|
if (s?.pagination) {
|
|
12590
12597
|
if (s.pagination.startAfter && s.pagination.endBefore || s.pagination.startAfter && s.pagination.endAt || s.pagination.startAfter && s.pagination.startAt || s.pagination.startAt && s.pagination.endBefore || s.pagination.startAt && s.pagination.endAt || s.pagination.endBefore && s.pagination.endAt)
|
|
12591
12598
|
throw new Error("INPUT_ERROR: Only one of startAfter, startAt, endBefore, or endAt can be provided");
|
|
12592
|
-
const Z = s.pagination.startAfter || s.pagination.endBefore || s.pagination.startAt || s.pagination.endAt, H =
|
|
12599
|
+
const Z = s.pagination.startAfter || s.pagination.endBefore || s.pagination.startAt || s.pagination.endAt, H = Ld(a.Role, f, o);
|
|
12593
12600
|
if (Z && H !== !0)
|
|
12594
12601
|
throw new Error("INPUT_ERROR: Pagination is not allowed when using " + H);
|
|
12595
12602
|
s.pagination.startAfter || s.pagination.endBefore || s.pagination.startAt || s.pagination.endAt ? s.pagination.startAfter ? (Ya(s.pagination.startAfter), T = T.map((j, Y) => {
|
|
12596
12603
|
if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
|
|
12597
12604
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using startAfter");
|
|
12598
|
-
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection), Qa(
|
|
12605
|
+
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection), Qa(g.last.get(Y)));
|
|
12599
12606
|
return s.pagination.number && (W = pe(W, Xt(s.pagination.number))), W;
|
|
12600
12607
|
})) : s.pagination.endBefore ? (Ka(s.pagination.endBefore), T = T.map((j, Y) => {
|
|
12601
12608
|
if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
|
|
12602
12609
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using endBefore");
|
|
12603
|
-
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection), Xa(
|
|
12610
|
+
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection), Xa(g.first.get(Y)));
|
|
12604
12611
|
return s.pagination.number && (W = pe(W, Ir(s.pagination.number))), W;
|
|
12605
12612
|
})) : s.pagination.startAt ? (Ka(s.pagination.startAt), T = T.map((j, Y) => {
|
|
12606
12613
|
if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
|
|
12607
12614
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using startAt");
|
|
12608
|
-
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection), sp(
|
|
12615
|
+
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection), sp(g.first.get(Y)));
|
|
12609
12616
|
return s.pagination.number && (W = pe(W, Ir(s.pagination.number))), W;
|
|
12610
12617
|
})) : s.pagination.endAt && (Ya(s.pagination.endAt), T = T.map((j, Y) => {
|
|
12611
12618
|
if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
|
|
12612
12619
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using endAt");
|
|
12613
|
-
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection), ip(
|
|
12620
|
+
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection), ip(g.last.get(Y)));
|
|
12614
12621
|
return s.pagination.number && (W = pe(W, Ir(s.pagination.number))), W;
|
|
12615
12622
|
})) : T = T.map((j) => {
|
|
12616
12623
|
let Y = pe(j);
|
|
@@ -12618,7 +12625,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12618
12625
|
});
|
|
12619
12626
|
}
|
|
12620
12627
|
const N = { collection: d.collection };
|
|
12621
|
-
await oe("preOperation",
|
|
12628
|
+
await oe("preOperation", y, C, ["read", void 0, void 0, N]), await oe("preRead", y, C, [N, T, !0, !0]);
|
|
12622
12629
|
let b = !0;
|
|
12623
12630
|
const m = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), k = [], D = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), $ = (Z, H) => {
|
|
12624
12631
|
let j = !0;
|
|
@@ -12627,11 +12634,11 @@ const zw = async (r, e, t, n) => {
|
|
|
12627
12634
|
W === "loaded" || W === "deleted" || (j = !1);
|
|
12628
12635
|
}), m.size === T.length && j) {
|
|
12629
12636
|
b = !1;
|
|
12630
|
-
const Y =
|
|
12637
|
+
const Y = bd(u, () => {
|
|
12631
12638
|
Y();
|
|
12632
12639
|
const W = [];
|
|
12633
12640
|
D.forEach((de) => {
|
|
12634
|
-
|
|
12641
|
+
om(de, x.get(de.id));
|
|
12635
12642
|
for (const X of f.fields)
|
|
12636
12643
|
X.type === "Computed" && W.push(Ee(() => X.formula(de)).then((me) => {
|
|
12637
12644
|
de[X.name] = me;
|
|
@@ -12639,7 +12646,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12639
12646
|
}), Promise.all(W).then(() => {
|
|
12640
12647
|
t(Array.from(D.values()), Z, H), D.forEach((de) => {
|
|
12641
12648
|
const X = ["read", de, de.id, N];
|
|
12642
|
-
oe("postOperation",
|
|
12649
|
+
oe("postOperation", y, C, X), oe("postRead", y, C, [N, I, de, !0]);
|
|
12643
12650
|
});
|
|
12644
12651
|
});
|
|
12645
12652
|
});
|
|
@@ -12705,7 +12712,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12705
12712
|
delete K[ne], Se.code !== "permission-denied" && n && n(new Error(`Error fetching relation document in collection ${me.collection} with ID ${j} at location ${Ie.Collection_Path?.join("/")}`, {
|
|
12706
12713
|
cause: Se
|
|
12707
12714
|
}));
|
|
12708
|
-
}) :
|
|
12715
|
+
}) : Rm(
|
|
12709
12716
|
[...Ie.Collection_Path],
|
|
12710
12717
|
ne,
|
|
12711
12718
|
(Se) => {
|
|
@@ -12754,19 +12761,19 @@ const zw = async (r, e, t, n) => {
|
|
|
12754
12761
|
});
|
|
12755
12762
|
H.id ||= j.id, H = { ...H, ...Y }, delete H.Collection_Path_String;
|
|
12756
12763
|
const W = x.get(j.id) || /* @__PURE__ */ new Map(), de = W.get(Z) || /* @__PURE__ */ new Set();
|
|
12757
|
-
|
|
12764
|
+
am(Y, de), W.set(Z, de), x.set(j.id, W), D.set(j.id, H);
|
|
12758
12765
|
}, Je = s?.only === "cache" || E;
|
|
12759
12766
|
for (const Z of T) {
|
|
12760
12767
|
let H = !0;
|
|
12761
12768
|
const j = dr(Z, { source: Je ? "cache" : "default", includeMetadataChanges: !0 }, (Y) => {
|
|
12762
|
-
(Je || Y.metadata.fromCache === !1) && (m.set(Z, !0),
|
|
12769
|
+
(Je || Y.metadata.fromCache === !1) && (m.set(Z, !0), g.first.set(T.indexOf(Z), Y.docs[0]), g.last.set(T.indexOf(Z), Y.docs.at(-1) || Y.docs[0]), b && s?.relations || $(g, Y.metadata)), m.get(Z) === !0 && (H ? (Y.docs.forEach((W) => {
|
|
12763
12770
|
const de = D.get(W.id) || {}, X = M.get(W.id) || 0;
|
|
12764
12771
|
M.set(W.id, X + 1), te(Z, de, W);
|
|
12765
12772
|
}), H = !1) : Y.docChanges().forEach((W) => {
|
|
12766
12773
|
const de = D.get(W.doc.id) || {}, X = M.get(W.doc.id) || 0;
|
|
12767
12774
|
W.type === "added" && M.set(W.doc.id, X + 1), W.type === "added" || W.type === "modified" ? te(Z, de, W.doc) : W.type === "removed" && (M.set(W.doc.id, X - 1), M.get(W.doc.id) === 0 && (D.delete(W.doc.id), m.size === T.length && s?.relations && (S.set(W.doc.id, "deleted"), B(W.doc.id))));
|
|
12768
|
-
}), m.size === T.length && s?.relations && (D.size === 0 && $(
|
|
12769
|
-
P(W,
|
|
12775
|
+
}), m.size === T.length && s?.relations && (D.size === 0 && $(g, Y.metadata), D.forEach((W) => {
|
|
12776
|
+
P(W, g);
|
|
12770
12777
|
})));
|
|
12771
12778
|
}, (Y) => {
|
|
12772
12779
|
n && n(new Error(`Error fetching documents at location ${r.join("/")}`, { cause: Y })), k.forEach((W) => W());
|
|
@@ -12786,16 +12793,16 @@ const zw = async (r, e, t, n) => {
|
|
|
12786
12793
|
}
|
|
12787
12794
|
}
|
|
12788
12795
|
return { pages: Ce, count: Ve, unsubscribe: (Z) => {
|
|
12789
|
-
Z === "first" && Ka(
|
|
12796
|
+
Z === "first" && Ka(g), Z === "last" && Ya(g), k.forEach((H) => H());
|
|
12790
12797
|
} };
|
|
12791
|
-
},
|
|
12798
|
+
}, nb = async (r, e) => {
|
|
12792
12799
|
const t = nt(), n = Ue(), s = $e(t, n.STOKER_FB_FUNCTIONS_REGION);
|
|
12793
12800
|
return (await Ke(s, "stoker-getfiles")({
|
|
12794
12801
|
collectionPath: e.Collection_Path,
|
|
12795
12802
|
id: e.id,
|
|
12796
12803
|
path: r
|
|
12797
12804
|
})).data.result;
|
|
12798
|
-
},
|
|
12805
|
+
}, xw = async (r, e, t, n, s, i) => {
|
|
12799
12806
|
const a = nt(), o = Ue(), c = $e(a, o.STOKER_FB_FUNCTIONS_REGION);
|
|
12800
12807
|
await Ke(c, "stoker-adminemail")({
|
|
12801
12808
|
subject: r,
|
|
@@ -12805,12 +12812,12 @@ const zw = async (r, e, t, n) => {
|
|
|
12805
12812
|
bcc: s,
|
|
12806
12813
|
replyTo: i
|
|
12807
12814
|
});
|
|
12808
|
-
},
|
|
12815
|
+
}, sb = async (r, e, t, n, s, i, a, o, c) => {
|
|
12809
12816
|
if (Ue().MODE === "development") {
|
|
12810
|
-
await
|
|
12817
|
+
await xw(e, t, n, s, i, a);
|
|
12811
12818
|
return;
|
|
12812
12819
|
}
|
|
12813
|
-
const f = Za(r), d = aw(e), h = t ? dd(t) : void 0, p = n ? dd(n) : void 0, v = s ? Za(s) : void 0,
|
|
12820
|
+
const f = Za(r), d = aw(e), h = t ? dd(t) : void 0, p = n ? dd(n) : void 0, v = s ? Za(s) : void 0, y = i ? Za(i) : void 0, O = a ? En(a) : void 0, R = c ? En(c) : void 0, C = Array.isArray(f) ? f : [f];
|
|
12814
12821
|
if (C.length === 0 || C.length === 1 && !C[0])
|
|
12815
12822
|
throw new Error("No valid email addresses provided");
|
|
12816
12823
|
const w = je(), E = { to: f, message: { subject: d } };
|
|
@@ -12818,101 +12825,98 @@ const zw = async (r, e, t, n) => {
|
|
|
12818
12825
|
const I = Array.isArray(v) ? v : [v];
|
|
12819
12826
|
I.length > 0 && I[0] && (E.cc = v);
|
|
12820
12827
|
}
|
|
12821
|
-
if (
|
|
12822
|
-
const I = Array.isArray(
|
|
12823
|
-
I.length > 0 && I[0] && (E.bcc =
|
|
12828
|
+
if (y) {
|
|
12829
|
+
const I = Array.isArray(y) ? y : [y];
|
|
12830
|
+
I.length > 0 && I[0] && (E.bcc = y);
|
|
12824
12831
|
}
|
|
12825
|
-
O && (E.replyTo = O), o && (E.message.attachments = o), R && (E.from = R), await
|
|
12826
|
-
},
|
|
12832
|
+
O && (E.replyTo = O), o && (E.message.attachments = o), R && (E.from = R), await Od(Mr(w, "system_mail"), E);
|
|
12833
|
+
}, Nw = async (r) => {
|
|
12827
12834
|
const e = nt(), t = Ue(), n = $e(e, t.STOKER_FB_FUNCTIONS_REGION);
|
|
12828
12835
|
await Ke(n, "stoker-adminsms")({
|
|
12829
12836
|
body: r
|
|
12830
12837
|
});
|
|
12831
|
-
},
|
|
12838
|
+
}, ib = async (r, e) => {
|
|
12832
12839
|
if (Ue().MODE === "development") {
|
|
12833
|
-
await
|
|
12840
|
+
await Nw(e);
|
|
12834
12841
|
return;
|
|
12835
12842
|
}
|
|
12836
12843
|
const s = je(), i = { to: r, body: e };
|
|
12837
|
-
await
|
|
12838
|
-
},
|
|
12839
|
-
const e =
|
|
12844
|
+
await Od(Mr(s, "system_messages"), i);
|
|
12845
|
+
}, ab = (r) => {
|
|
12846
|
+
const e = Sm();
|
|
12840
12847
|
return z.fromJSDate(r).setZone(e);
|
|
12841
|
-
},
|
|
12842
|
-
const e =
|
|
12848
|
+
}, Fw = (r) => {
|
|
12849
|
+
const e = Sm();
|
|
12843
12850
|
return z.fromJSDate(r.toDate()).setZone(e);
|
|
12844
|
-
},
|
|
12851
|
+
}, ob = (r, e) => {
|
|
12845
12852
|
const n = z.fromJSDate(r, { zone: e }).offset, i = z.fromJSDate(r).offset, a = n - i;
|
|
12846
12853
|
return z.fromJSDate(r).plus({ minutes: a }).toJSDate();
|
|
12847
|
-
},
|
|
12854
|
+
}, cb = (r, e) => {
|
|
12848
12855
|
const n = z.fromJSDate(r, { zone: e }).offset, i = z.fromJSDate(r).offset, a = n - i;
|
|
12849
12856
|
return z.fromJSDate(r).minus({ minutes: a }).toJSDate();
|
|
12850
|
-
},
|
|
12851
|
-
const t = nt(), n = Ue(), s = $e(t, n.STOKER_FB_FUNCTIONS_REGION);
|
|
12852
|
-
return (await Ke(s, r)(e)).data;
|
|
12853
|
-
};
|
|
12857
|
+
}, lb = (r) => "seconds" in r && "nanoseconds" in r ? Fw(new zt(r.seconds, r.nanoseconds)).toFormat("MMMM d, yyyy '@' h:mm a") : "";
|
|
12854
12858
|
export {
|
|
12855
|
-
|
|
12859
|
+
ym as addRecord,
|
|
12856
12860
|
pw as addRecordServer,
|
|
12857
|
-
|
|
12858
|
-
|
|
12859
|
-
|
|
12860
|
-
|
|
12861
|
-
|
|
12862
|
-
|
|
12861
|
+
Kw as authenticateStoker,
|
|
12862
|
+
_w as callFunction,
|
|
12863
|
+
kw as clearUnsubscribes,
|
|
12864
|
+
ab as convertDateToTimezone,
|
|
12865
|
+
Fw as convertTimestampToTimezone,
|
|
12866
|
+
eb as deleteFolder,
|
|
12863
12867
|
gw as deleteRecord,
|
|
12864
12868
|
yw as deleteRecordServer,
|
|
12865
|
-
|
|
12866
|
-
|
|
12869
|
+
um as deserializeTimestamps,
|
|
12870
|
+
lb as displayDate,
|
|
12867
12871
|
hc as getAllRoleGroups,
|
|
12868
|
-
|
|
12869
|
-
|
|
12872
|
+
Gw as getAppCheck,
|
|
12873
|
+
Hw as getAppCheckFirestoreWrite,
|
|
12870
12874
|
se as getCachedConfigValue,
|
|
12871
12875
|
lt as getCollectionConfigModule,
|
|
12872
12876
|
ic as getCollectionRefs,
|
|
12873
12877
|
Wt as getConnectionStatus,
|
|
12874
|
-
|
|
12878
|
+
Zw as getCurrentUser,
|
|
12875
12879
|
Fe as getCurrentUserPermissions,
|
|
12876
12880
|
Kr as getCurrentUserRoleGroups,
|
|
12877
|
-
|
|
12881
|
+
lm as getDocumentRefs,
|
|
12878
12882
|
Ue as getEnv,
|
|
12879
|
-
|
|
12880
|
-
|
|
12883
|
+
nb as getFiles,
|
|
12884
|
+
Tm as getFirestoreMaintenance,
|
|
12881
12885
|
mc as getFirestoreWrite,
|
|
12882
|
-
|
|
12886
|
+
Iw as getFirestoreWriteAuth,
|
|
12883
12887
|
ke as getGlobalConfigModule,
|
|
12884
12888
|
Eo as getLoadingState,
|
|
12885
|
-
|
|
12886
|
-
|
|
12889
|
+
Ew as getMaintenanceInfo,
|
|
12890
|
+
Tw as getNetworkStatus,
|
|
12887
12891
|
_r as getOne,
|
|
12888
12892
|
dw as getOneServer,
|
|
12889
12893
|
He as getSchema,
|
|
12890
|
-
|
|
12894
|
+
dm as getSome,
|
|
12891
12895
|
fw as getSomeServer,
|
|
12892
|
-
|
|
12893
|
-
|
|
12894
|
-
|
|
12896
|
+
Sm as getTimezone,
|
|
12897
|
+
Cw as getUnsubscribes,
|
|
12898
|
+
vm as getVersionInfo,
|
|
12895
12899
|
Ug as getZodSchema,
|
|
12896
|
-
|
|
12900
|
+
Bw as initializeStoker,
|
|
12897
12901
|
sr as isDeleteSentinel,
|
|
12898
|
-
|
|
12899
|
-
|
|
12900
|
-
|
|
12901
|
-
|
|
12902
|
-
|
|
12903
|
-
|
|
12902
|
+
ob as keepTimezone,
|
|
12903
|
+
Xw as multiFactorEnroll,
|
|
12904
|
+
Qw as onStokerPermissionsChange,
|
|
12905
|
+
Yw as onStokerReady,
|
|
12906
|
+
Jw as onStokerSignOut,
|
|
12907
|
+
zw as preloadCache,
|
|
12904
12908
|
Fr as preloadCollection,
|
|
12905
|
-
|
|
12906
|
-
|
|
12907
|
-
|
|
12908
|
-
|
|
12909
|
-
|
|
12910
|
-
|
|
12911
|
-
|
|
12912
|
-
|
|
12913
|
-
|
|
12909
|
+
cb as removeTimezone,
|
|
12910
|
+
xw as sendAdminEmail,
|
|
12911
|
+
Nw as sendAdminSMS,
|
|
12912
|
+
sb as sendMail,
|
|
12913
|
+
ib as sendMessage,
|
|
12914
|
+
pm as serializeTimestamps,
|
|
12915
|
+
wm as signOut,
|
|
12916
|
+
rb as subscribeMany,
|
|
12917
|
+
Rm as subscribeOne,
|
|
12914
12918
|
Ee as tryPromise,
|
|
12915
12919
|
lc as updateRecord,
|
|
12916
12920
|
mw as updateRecordServer,
|
|
12917
|
-
|
|
12921
|
+
tb as waitForPendingWrites
|
|
12918
12922
|
};
|