@stoker-platform/web-client 0.2.6 → 0.2.7
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 +512 -500
- package/package.json +2 -2
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
|
|
6
|
-
import { connectStorageEmulator as
|
|
7
|
-
import { getFunctions as $e, httpsCallable as Ke, connectFunctionsEmulator as
|
|
8
|
-
import { ReCaptchaEnterpriseProvider as
|
|
9
|
-
import { getPerformance as
|
|
10
|
-
import { getRemoteConfig as
|
|
11
|
-
const
|
|
1
|
+
import { getApp as nt, registerVersion as xm, initializeApp as Vn, setLogLevel as Yr, onLog as Nm } from "firebase/app";
|
|
2
|
+
import { isSupported as Fm, initializeAnalytics as Dm, setConsent as Mm } from "firebase/analytics";
|
|
3
|
+
import { getAuth as fr, validatePassword as pd, initializeAuth as vc, indexedDBLocalPersistence as Pm, browserLocalPersistence as qm, browserSessionPersistence as wc, inMemoryPersistence as bc, beforeAuthStateChanged as Lm, connectAuthEmulator as $m, onAuthStateChanged as Wn, getIdTokenResult as jm, signOut as yd, signInWithEmailAndPassword as Um, getMultiFactorResolver as Vm, TotpMultiFactorGenerator as Ja, signInWithCustomToken as Wm, multiFactor as Oc } from "firebase/auth";
|
|
4
|
+
import { getDatabase as gd, onValue as zm, ref as Bm, 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 Gm, getDoc as _d, orderBy as et, limit as Xt, startAfter as Qa, endBefore as Xa, limitToLast as Ir, getDocsFromCache as vd, getDocsFromServer as Hm, getDocs as Km, getCountFromServer as wd, getDocFromCache as Ym, getDocFromServer as bd, writeBatch as Ro, serverTimestamp as Pr, deleteField as Tn, arrayRemove as Ao, arrayUnion as Co, collectionGroup as Jm, waitForPendingWrites as Od, connectFirestoreEmulator as Sc, persistentLocalCache as Tc, persistentSingleTabManager as Rc, persistentMultipleTabManager as Ac, memoryEagerGarbageCollector as Qm, memoryLruGarbageCollector as Xm, memoryLocalCache as ep, initializeFirestore as zn, getPersistentCacheIndexManager as tp, enablePersistentCacheIndexAutoCreation as rp, terminate as np, clearIndexedDbPersistence as Cc, onSnapshotsInSync as Ed, startAt as sp, endAt as ip, addDoc as Sd } from "firebase/firestore";
|
|
6
|
+
import { connectStorageEmulator as ap, getStorage as op } from "firebase/storage";
|
|
7
|
+
import { getFunctions as $e, httpsCallable as Ke, connectFunctionsEmulator as cp } from "firebase/functions";
|
|
8
|
+
import { ReCaptchaEnterpriseProvider as lp, initializeAppCheck as Bn, onTokenChanged as Zn } from "firebase/app-check";
|
|
9
|
+
import { getPerformance as up } from "firebase/performance";
|
|
10
|
+
import { getRemoteConfig as fp, fetchAndActivate as dp } from "firebase/remote-config";
|
|
11
|
+
const hp = "0.2.7", 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,
|
|
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), Td = (r, e) => {
|
|
15
15
|
const t = {
|
|
16
16
|
Record_Owner: "recordOwner",
|
|
17
17
|
Record_User: "recordUser",
|
|
@@ -35,7 +35,7 @@ const dp = "0.2.6", hp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
35
35
|
return i?.parentFilters?.forEach((a) => {
|
|
36
36
|
if (!a.roles.some((h) => h.role === t.Role))
|
|
37
37
|
return;
|
|
38
|
-
const o = a.collectionField, c =
|
|
38
|
+
const o = a.collectionField, c = re(r.fields, o);
|
|
39
39
|
if (!_e(c))
|
|
40
40
|
throw new Error("PERMISSION_DENIED");
|
|
41
41
|
const l = t.collections?.[c.collection], f = e.collections[c.collection].access.entityRestrictions;
|
|
@@ -58,7 +58,7 @@ const dp = "0.2.6", hp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
58
58
|
!i.find((f) => f.field === l.field) && l.roles.includes(t.Role) && i.push(l);
|
|
59
59
|
}
|
|
60
60
|
return i;
|
|
61
|
-
},
|
|
61
|
+
}, gp = (r, e, t, n, s, i) => {
|
|
62
62
|
const { fields: a } = e, o = s.collections?.[e.labels.collection];
|
|
63
63
|
let c = !0;
|
|
64
64
|
if (!o) {
|
|
@@ -71,12 +71,12 @@ const dp = "0.2.6", hp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
71
71
|
}), l?.filter((w) => w.type === "Record_User").forEach((w) => {
|
|
72
72
|
if ("operations" in w && w.operations && !w.operations.includes(r))
|
|
73
73
|
return;
|
|
74
|
-
const E =
|
|
74
|
+
const E = re(a, w.collectionField);
|
|
75
75
|
i[`${E.name}_Array`]?.includes(s.Doc_ID) || (c = !1);
|
|
76
76
|
}), l?.filter((w) => w.type === "Record_Property").forEach((w) => {
|
|
77
77
|
if ("operations" in w && w.operations && !w.operations.includes(r))
|
|
78
78
|
return;
|
|
79
|
-
const E =
|
|
79
|
+
const E = re(a, w.propertyField), I = w.roles.find((T) => T.role === s.Role);
|
|
80
80
|
E.type === "Array" ? I.values?.some((T) => i[E.name].includes(T)) || (c = !1) : I.values?.includes(i[E.name]) || (c = !1);
|
|
81
81
|
});
|
|
82
82
|
let d = !0, h = !1;
|
|
@@ -86,11 +86,11 @@ const dp = "0.2.6", hp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
86
86
|
let p = !0, v = !1;
|
|
87
87
|
if (u?.filter((w) => w.type === "Parent").forEach((w) => {
|
|
88
88
|
v = !0;
|
|
89
|
-
const E =
|
|
89
|
+
const E = re(a, w.collectionField);
|
|
90
90
|
o.parentEntities?.some((I) => i[`${E.name}_Array`].includes(I)) || (p = !1);
|
|
91
91
|
}), u?.filter((w) => w.type === "Parent_Property").forEach((w) => {
|
|
92
92
|
v = !0;
|
|
93
|
-
const E =
|
|
93
|
+
const E = re(a, w.collectionField), I = re(a, w.propertyField);
|
|
94
94
|
Object.entries(o.parentPropertyEntities || {}).some((T) => {
|
|
95
95
|
const [y, N] = T;
|
|
96
96
|
return y === i[I.name] && i[`${E.name}_Array`].some((g) => N.includes(g));
|
|
@@ -107,7 +107,7 @@ const dp = "0.2.6", hp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
107
107
|
let _ = !0, O = !1;
|
|
108
108
|
f?.filter((w) => w.parentFilter.type === "Individual").forEach((w) => {
|
|
109
109
|
O = !0;
|
|
110
|
-
const { parentFilter: E } = w, I =
|
|
110
|
+
const { parentFilter: E } = w, I = re(a, E.collectionField), T = s.collections?.[I.collection];
|
|
111
111
|
if (!T) {
|
|
112
112
|
c = !1;
|
|
113
113
|
return;
|
|
@@ -117,7 +117,7 @@ const dp = "0.2.6", hp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
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 =
|
|
120
|
+
const { parentFilter: E } = w, I = re(a, E.collectionField), T = re(a, E.parentCollectionField), y = s.collections?.[I.collection];
|
|
121
121
|
if (!y) {
|
|
122
122
|
c = !1;
|
|
123
123
|
return;
|
|
@@ -125,7 +125,7 @@ const dp = "0.2.6", hp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
125
125
|
y.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 =
|
|
128
|
+
const { parentFilter: E } = w, I = re(a, E.collectionField), T = re(a, E.parentPropertyField), y = re(a, E.parentCollectionField), N = s.collections?.[I.collection];
|
|
129
129
|
if (!N) {
|
|
130
130
|
c = !1;
|
|
131
131
|
return;
|
|
@@ -151,7 +151,7 @@ const dp = "0.2.6", hp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
151
151
|
return c = !1, c;
|
|
152
152
|
_t(r, o) || (c = !1);
|
|
153
153
|
const u = ko(e, s)?.filter((f) => f.type === "Individual").length > 0;
|
|
154
|
-
return r === "Create" && u && (c = !1),
|
|
154
|
+
return r === "Create" && u && (c = !1), gp(r, e, t, n, s, i) || (c = !1), c;
|
|
155
155
|
}, $t = (r, e, t) => {
|
|
156
156
|
const n = [];
|
|
157
157
|
for (const s of r.fields)
|
|
@@ -177,7 +177,7 @@ function Cn(r) {
|
|
|
177
177
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
178
178
|
}
|
|
179
179
|
var Gn, kc;
|
|
180
|
-
function
|
|
180
|
+
function _p() {
|
|
181
181
|
if (kc) return Gn;
|
|
182
182
|
kc = 1;
|
|
183
183
|
function r() {
|
|
@@ -208,7 +208,7 @@ function kn() {
|
|
|
208
208
|
return Kn = e, Kn;
|
|
209
209
|
}
|
|
210
210
|
var Yn, Nc;
|
|
211
|
-
function
|
|
211
|
+
function vp() {
|
|
212
212
|
if (Nc) return Yn;
|
|
213
213
|
Nc = 1;
|
|
214
214
|
var r = kn(), e = Array.prototype, t = e.splice;
|
|
@@ -222,7 +222,7 @@ function _p() {
|
|
|
222
222
|
return Yn = n, Yn;
|
|
223
223
|
}
|
|
224
224
|
var Jn, Fc;
|
|
225
|
-
function
|
|
225
|
+
function wp() {
|
|
226
226
|
if (Fc) return Jn;
|
|
227
227
|
Fc = 1;
|
|
228
228
|
var r = kn();
|
|
@@ -233,7 +233,7 @@ function vp() {
|
|
|
233
233
|
return Jn = e, Jn;
|
|
234
234
|
}
|
|
235
235
|
var Qn, Dc;
|
|
236
|
-
function
|
|
236
|
+
function bp() {
|
|
237
237
|
if (Dc) return Qn;
|
|
238
238
|
Dc = 1;
|
|
239
239
|
var r = kn();
|
|
@@ -243,7 +243,7 @@ function wp() {
|
|
|
243
243
|
return Qn = e, Qn;
|
|
244
244
|
}
|
|
245
245
|
var Xn, Mc;
|
|
246
|
-
function
|
|
246
|
+
function Op() {
|
|
247
247
|
if (Mc) return Xn;
|
|
248
248
|
Mc = 1;
|
|
249
249
|
var r = kn();
|
|
@@ -257,7 +257,7 @@ var es, Pc;
|
|
|
257
257
|
function In() {
|
|
258
258
|
if (Pc) return es;
|
|
259
259
|
Pc = 1;
|
|
260
|
-
var r =
|
|
260
|
+
var r = _p(), e = vp(), t = wp(), n = bp(), s = Op();
|
|
261
261
|
function i(a) {
|
|
262
262
|
var o = -1, c = a == null ? 0 : a.length;
|
|
263
263
|
for (this.clear(); ++o < c; ) {
|
|
@@ -268,7 +268,7 @@ function In() {
|
|
|
268
268
|
return i.prototype.clear = r, i.prototype.delete = e, i.prototype.get = t, i.prototype.has = n, i.prototype.set = s, es = i, es;
|
|
269
269
|
}
|
|
270
270
|
var ts, qc;
|
|
271
|
-
function
|
|
271
|
+
function Ep() {
|
|
272
272
|
if (qc) return ts;
|
|
273
273
|
qc = 1;
|
|
274
274
|
var r = In();
|
|
@@ -278,7 +278,7 @@ function Op() {
|
|
|
278
278
|
return ts = e, ts;
|
|
279
279
|
}
|
|
280
280
|
var rs, Lc;
|
|
281
|
-
function
|
|
281
|
+
function Sp() {
|
|
282
282
|
if (Lc) return rs;
|
|
283
283
|
Lc = 1;
|
|
284
284
|
function r(e) {
|
|
@@ -288,7 +288,7 @@ function Ep() {
|
|
|
288
288
|
return rs = r, rs;
|
|
289
289
|
}
|
|
290
290
|
var ns, $c;
|
|
291
|
-
function
|
|
291
|
+
function Tp() {
|
|
292
292
|
if ($c) return ns;
|
|
293
293
|
$c = 1;
|
|
294
294
|
function r(e) {
|
|
@@ -297,7 +297,7 @@ function Sp() {
|
|
|
297
297
|
return ns = r, ns;
|
|
298
298
|
}
|
|
299
299
|
var ss, jc;
|
|
300
|
-
function
|
|
300
|
+
function Rp() {
|
|
301
301
|
if (jc) return ss;
|
|
302
302
|
jc = 1;
|
|
303
303
|
function r(e) {
|
|
@@ -327,7 +327,7 @@ function Ur() {
|
|
|
327
327
|
return os = e, os;
|
|
328
328
|
}
|
|
329
329
|
var cs, zc;
|
|
330
|
-
function
|
|
330
|
+
function Ap() {
|
|
331
331
|
if (zc) return cs;
|
|
332
332
|
zc = 1;
|
|
333
333
|
var r = Ur(), e = Object.prototype, t = e.hasOwnProperty, n = e.toString, s = r ? r.toStringTag : void 0;
|
|
@@ -344,7 +344,7 @@ function Rp() {
|
|
|
344
344
|
return cs = i, cs;
|
|
345
345
|
}
|
|
346
346
|
var ls, Bc;
|
|
347
|
-
function
|
|
347
|
+
function Cp() {
|
|
348
348
|
if (Bc) return ls;
|
|
349
349
|
Bc = 1;
|
|
350
350
|
var r = Object.prototype, e = r.toString;
|
|
@@ -357,7 +357,7 @@ var us, Zc;
|
|
|
357
357
|
function hr() {
|
|
358
358
|
if (Zc) return us;
|
|
359
359
|
Zc = 1;
|
|
360
|
-
var r = Ur(), e =
|
|
360
|
+
var r = Ur(), e = Ap(), t = Cp(), n = "[object Null]", s = "[object Undefined]", i = r ? r.toStringTag : void 0;
|
|
361
361
|
function a(o) {
|
|
362
362
|
return o == null ? o === void 0 ? s : n : i && i in Object(o) ? e(o) : t(o);
|
|
363
363
|
}
|
|
@@ -387,17 +387,17 @@ function Io() {
|
|
|
387
387
|
return ds = a, ds;
|
|
388
388
|
}
|
|
389
389
|
var hs, Kc;
|
|
390
|
-
function
|
|
390
|
+
function kp() {
|
|
391
391
|
if (Kc) return hs;
|
|
392
392
|
Kc = 1;
|
|
393
393
|
var r = ct(), e = r["__core-js_shared__"];
|
|
394
394
|
return hs = e, hs;
|
|
395
395
|
}
|
|
396
396
|
var ms, Yc;
|
|
397
|
-
function
|
|
397
|
+
function Ip() {
|
|
398
398
|
if (Yc) return ms;
|
|
399
399
|
Yc = 1;
|
|
400
|
-
var r =
|
|
400
|
+
var r = kp(), e = (function() {
|
|
401
401
|
var n = /[^.]+$/.exec(r && r.keys && r.keys.IE_PROTO || "");
|
|
402
402
|
return n ? "Symbol(src)_1." + n : "";
|
|
403
403
|
})();
|
|
@@ -427,10 +427,10 @@ function kd() {
|
|
|
427
427
|
return ps = t, ps;
|
|
428
428
|
}
|
|
429
429
|
var ys, Qc;
|
|
430
|
-
function
|
|
430
|
+
function xp() {
|
|
431
431
|
if (Qc) return ys;
|
|
432
432
|
Qc = 1;
|
|
433
|
-
var r = Io(), e =
|
|
433
|
+
var r = Io(), e = Ip(), t = vt(), n = kd(), 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) {
|
|
@@ -442,7 +442,7 @@ function Ip() {
|
|
|
442
442
|
return ys = f, ys;
|
|
443
443
|
}
|
|
444
444
|
var gs, Xc;
|
|
445
|
-
function
|
|
445
|
+
function Np() {
|
|
446
446
|
if (Xc) return gs;
|
|
447
447
|
Xc = 1;
|
|
448
448
|
function r(e, t) {
|
|
@@ -454,7 +454,7 @@ var _s, el;
|
|
|
454
454
|
function Bt() {
|
|
455
455
|
if (el) return _s;
|
|
456
456
|
el = 1;
|
|
457
|
-
var r =
|
|
457
|
+
var r = xp(), e = Np();
|
|
458
458
|
function t(n, s) {
|
|
459
459
|
var i = e(n, s);
|
|
460
460
|
return r(i) ? i : void 0;
|
|
@@ -476,7 +476,7 @@ function xn() {
|
|
|
476
476
|
return ws = e, ws;
|
|
477
477
|
}
|
|
478
478
|
var bs, nl;
|
|
479
|
-
function
|
|
479
|
+
function Fp() {
|
|
480
480
|
if (nl) return bs;
|
|
481
481
|
nl = 1;
|
|
482
482
|
var r = xn();
|
|
@@ -486,7 +486,7 @@ function Np() {
|
|
|
486
486
|
return bs = e, bs;
|
|
487
487
|
}
|
|
488
488
|
var Os, sl;
|
|
489
|
-
function
|
|
489
|
+
function Dp() {
|
|
490
490
|
if (sl) return Os;
|
|
491
491
|
sl = 1;
|
|
492
492
|
function r(e) {
|
|
@@ -496,7 +496,7 @@ function Fp() {
|
|
|
496
496
|
return Os = r, Os;
|
|
497
497
|
}
|
|
498
498
|
var Es, il;
|
|
499
|
-
function
|
|
499
|
+
function Mp() {
|
|
500
500
|
if (il) return Es;
|
|
501
501
|
il = 1;
|
|
502
502
|
var r = xn(), e = "__lodash_hash_undefined__", t = Object.prototype, n = t.hasOwnProperty;
|
|
@@ -511,7 +511,7 @@ function Dp() {
|
|
|
511
511
|
return Es = s, Es;
|
|
512
512
|
}
|
|
513
513
|
var Ss, al;
|
|
514
|
-
function
|
|
514
|
+
function Pp() {
|
|
515
515
|
if (al) return Ss;
|
|
516
516
|
al = 1;
|
|
517
517
|
var r = xn(), e = Object.prototype, t = e.hasOwnProperty;
|
|
@@ -522,7 +522,7 @@ function Mp() {
|
|
|
522
522
|
return Ss = n, Ss;
|
|
523
523
|
}
|
|
524
524
|
var Ts, ol;
|
|
525
|
-
function
|
|
525
|
+
function qp() {
|
|
526
526
|
if (ol) return Ts;
|
|
527
527
|
ol = 1;
|
|
528
528
|
var r = xn(), e = "__lodash_hash_undefined__";
|
|
@@ -533,10 +533,10 @@ function Pp() {
|
|
|
533
533
|
return Ts = t, Ts;
|
|
534
534
|
}
|
|
535
535
|
var Rs, cl;
|
|
536
|
-
function
|
|
536
|
+
function Lp() {
|
|
537
537
|
if (cl) return Rs;
|
|
538
538
|
cl = 1;
|
|
539
|
-
var r =
|
|
539
|
+
var r = Fp(), e = Dp(), t = Mp(), n = Pp(), s = qp();
|
|
540
540
|
function i(a) {
|
|
541
541
|
var o = -1, c = a == null ? 0 : a.length;
|
|
542
542
|
for (this.clear(); ++o < c; ) {
|
|
@@ -547,10 +547,10 @@ function qp() {
|
|
|
547
547
|
return i.prototype.clear = r, i.prototype.delete = e, i.prototype.get = t, i.prototype.has = n, i.prototype.set = s, Rs = i, Rs;
|
|
548
548
|
}
|
|
549
549
|
var As, ll;
|
|
550
|
-
function
|
|
550
|
+
function $p() {
|
|
551
551
|
if (ll) return As;
|
|
552
552
|
ll = 1;
|
|
553
|
-
var r =
|
|
553
|
+
var r = Lp(), e = In(), t = xo();
|
|
554
554
|
function n() {
|
|
555
555
|
this.size = 0, this.__data__ = {
|
|
556
556
|
hash: new r(),
|
|
@@ -561,7 +561,7 @@ function Lp() {
|
|
|
561
561
|
return As = n, As;
|
|
562
562
|
}
|
|
563
563
|
var Cs, ul;
|
|
564
|
-
function
|
|
564
|
+
function jp() {
|
|
565
565
|
if (ul) return Cs;
|
|
566
566
|
ul = 1;
|
|
567
567
|
function r(e) {
|
|
@@ -574,7 +574,7 @@ var ks, fl;
|
|
|
574
574
|
function Nn() {
|
|
575
575
|
if (fl) return ks;
|
|
576
576
|
fl = 1;
|
|
577
|
-
var r =
|
|
577
|
+
var r = jp();
|
|
578
578
|
function e(t, n) {
|
|
579
579
|
var s = t.__data__;
|
|
580
580
|
return r(n) ? s[typeof n == "string" ? "string" : "hash"] : s.map;
|
|
@@ -582,7 +582,7 @@ function Nn() {
|
|
|
582
582
|
return ks = e, ks;
|
|
583
583
|
}
|
|
584
584
|
var Is, dl;
|
|
585
|
-
function
|
|
585
|
+
function Up() {
|
|
586
586
|
if (dl) return Is;
|
|
587
587
|
dl = 1;
|
|
588
588
|
var r = Nn();
|
|
@@ -593,7 +593,7 @@ function jp() {
|
|
|
593
593
|
return Is = e, Is;
|
|
594
594
|
}
|
|
595
595
|
var xs, hl;
|
|
596
|
-
function
|
|
596
|
+
function Vp() {
|
|
597
597
|
if (hl) return xs;
|
|
598
598
|
hl = 1;
|
|
599
599
|
var r = Nn();
|
|
@@ -603,7 +603,7 @@ function Up() {
|
|
|
603
603
|
return xs = e, xs;
|
|
604
604
|
}
|
|
605
605
|
var Ns, ml;
|
|
606
|
-
function
|
|
606
|
+
function Wp() {
|
|
607
607
|
if (ml) return Ns;
|
|
608
608
|
ml = 1;
|
|
609
609
|
var r = Nn();
|
|
@@ -613,7 +613,7 @@ function Vp() {
|
|
|
613
613
|
return Ns = e, Ns;
|
|
614
614
|
}
|
|
615
615
|
var Fs, pl;
|
|
616
|
-
function
|
|
616
|
+
function zp() {
|
|
617
617
|
if (pl) return Fs;
|
|
618
618
|
pl = 1;
|
|
619
619
|
var r = Nn();
|
|
@@ -627,7 +627,7 @@ var Ds, yl;
|
|
|
627
627
|
function No() {
|
|
628
628
|
if (yl) return Ds;
|
|
629
629
|
yl = 1;
|
|
630
|
-
var r =
|
|
630
|
+
var r = $p(), e = Up(), t = Vp(), n = Wp(), s = zp();
|
|
631
631
|
function i(a) {
|
|
632
632
|
var o = -1, c = a == null ? 0 : a.length;
|
|
633
633
|
for (this.clear(); ++o < c; ) {
|
|
@@ -638,7 +638,7 @@ function No() {
|
|
|
638
638
|
return i.prototype.clear = r, i.prototype.delete = e, i.prototype.get = t, i.prototype.has = n, i.prototype.set = s, Ds = i, Ds;
|
|
639
639
|
}
|
|
640
640
|
var Ms, gl;
|
|
641
|
-
function
|
|
641
|
+
function Bp() {
|
|
642
642
|
if (gl) return Ms;
|
|
643
643
|
gl = 1;
|
|
644
644
|
var r = In(), e = xo(), t = No(), n = 200;
|
|
@@ -658,7 +658,7 @@ var Ps, _l;
|
|
|
658
658
|
function Fo() {
|
|
659
659
|
if (_l) return Ps;
|
|
660
660
|
_l = 1;
|
|
661
|
-
var r = In(), e =
|
|
661
|
+
var r = In(), e = Ep(), t = Sp(), n = Tp(), s = Rp(), i = Bp();
|
|
662
662
|
function a(o) {
|
|
663
663
|
var c = this.__data__ = new r(o);
|
|
664
664
|
this.size = c.size;
|
|
@@ -666,7 +666,7 @@ function Fo() {
|
|
|
666
666
|
return a.prototype.clear = e, a.prototype.delete = t, a.prototype.get = n, a.prototype.has = s, a.prototype.set = i, Ps = a, Ps;
|
|
667
667
|
}
|
|
668
668
|
var qs, vl;
|
|
669
|
-
function
|
|
669
|
+
function Zp() {
|
|
670
670
|
if (vl) return qs;
|
|
671
671
|
vl = 1;
|
|
672
672
|
var r = "__lodash_hash_undefined__";
|
|
@@ -676,7 +676,7 @@ function Bp() {
|
|
|
676
676
|
return qs = e, qs;
|
|
677
677
|
}
|
|
678
678
|
var Ls, wl;
|
|
679
|
-
function
|
|
679
|
+
function Gp() {
|
|
680
680
|
if (wl) return Ls;
|
|
681
681
|
wl = 1;
|
|
682
682
|
function r(e) {
|
|
@@ -685,10 +685,10 @@ function Zp() {
|
|
|
685
685
|
return Ls = r, Ls;
|
|
686
686
|
}
|
|
687
687
|
var $s, bl;
|
|
688
|
-
function
|
|
688
|
+
function Hp() {
|
|
689
689
|
if (bl) return $s;
|
|
690
690
|
bl = 1;
|
|
691
|
-
var r = No(), e =
|
|
691
|
+
var r = No(), e = Zp(), t = Gp();
|
|
692
692
|
function n(s) {
|
|
693
693
|
var i = -1, a = s == null ? 0 : s.length;
|
|
694
694
|
for (this.__data__ = new r(); ++i < a; )
|
|
@@ -697,7 +697,7 @@ function Gp() {
|
|
|
697
697
|
return n.prototype.add = n.prototype.push = e, n.prototype.has = t, $s = n, $s;
|
|
698
698
|
}
|
|
699
699
|
var js, Ol;
|
|
700
|
-
function
|
|
700
|
+
function Kp() {
|
|
701
701
|
if (Ol) return js;
|
|
702
702
|
Ol = 1;
|
|
703
703
|
function r(e, t) {
|
|
@@ -709,7 +709,7 @@ function Hp() {
|
|
|
709
709
|
return js = r, js;
|
|
710
710
|
}
|
|
711
711
|
var Us, El;
|
|
712
|
-
function
|
|
712
|
+
function Yp() {
|
|
713
713
|
if (El) return Us;
|
|
714
714
|
El = 1;
|
|
715
715
|
function r(e, t) {
|
|
@@ -721,7 +721,7 @@ var Vs, Sl;
|
|
|
721
721
|
function Id() {
|
|
722
722
|
if (Sl) return Vs;
|
|
723
723
|
Sl = 1;
|
|
724
|
-
var r =
|
|
724
|
+
var r = Hp(), e = Kp(), t = Yp(), n = 1, s = 2;
|
|
725
725
|
function i(a, o, c, l, u, f) {
|
|
726
726
|
var d = c & n, h = a.length, p = o.length;
|
|
727
727
|
if (h != p && !(d && p > h))
|
|
@@ -765,7 +765,7 @@ function xd() {
|
|
|
765
765
|
return Ws = e, Ws;
|
|
766
766
|
}
|
|
767
767
|
var zs, Rl;
|
|
768
|
-
function
|
|
768
|
+
function Jp() {
|
|
769
769
|
if (Rl) return zs;
|
|
770
770
|
Rl = 1;
|
|
771
771
|
function r(e) {
|
|
@@ -777,7 +777,7 @@ function Yp() {
|
|
|
777
777
|
return zs = r, zs;
|
|
778
778
|
}
|
|
779
779
|
var Bs, Al;
|
|
780
|
-
function
|
|
780
|
+
function Qp() {
|
|
781
781
|
if (Al) return Bs;
|
|
782
782
|
Al = 1;
|
|
783
783
|
function r(e) {
|
|
@@ -789,10 +789,10 @@ function Jp() {
|
|
|
789
789
|
return Bs = r, Bs;
|
|
790
790
|
}
|
|
791
791
|
var Zs, Cl;
|
|
792
|
-
function
|
|
792
|
+
function Xp() {
|
|
793
793
|
if (Cl) return Zs;
|
|
794
794
|
Cl = 1;
|
|
795
|
-
var r = Ur(), e = xd(), t = jr(), n = Id(), s =
|
|
795
|
+
var r = Ur(), e = xd(), t = jr(), n = Id(), 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]", _ = "[object Symbol]", O = "[object ArrayBuffer]", R = "[object DataView]", C = r ? r.prototype : void 0, w = C ? C.valueOf : void 0;
|
|
796
796
|
function E(I, T, y, N, g, A, b) {
|
|
797
797
|
switch (y) {
|
|
798
798
|
case R:
|
|
@@ -860,7 +860,7 @@ function Fd() {
|
|
|
860
860
|
return Ks = t, Ks;
|
|
861
861
|
}
|
|
862
862
|
var Ys, Nl;
|
|
863
|
-
function
|
|
863
|
+
function ey() {
|
|
864
864
|
if (Nl) return Ys;
|
|
865
865
|
Nl = 1;
|
|
866
866
|
function r(e, t) {
|
|
@@ -885,7 +885,7 @@ var Qs, Dl;
|
|
|
885
885
|
function Do() {
|
|
886
886
|
if (Dl) return Qs;
|
|
887
887
|
Dl = 1;
|
|
888
|
-
var r =
|
|
888
|
+
var r = ey(), e = Dd(), 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
|
}));
|
|
@@ -893,7 +893,7 @@ function Do() {
|
|
|
893
893
|
return Qs = i, Qs;
|
|
894
894
|
}
|
|
895
895
|
var Xs, Ml;
|
|
896
|
-
function
|
|
896
|
+
function ty() {
|
|
897
897
|
if (Ml) return Xs;
|
|
898
898
|
Ml = 1;
|
|
899
899
|
function r(e, t) {
|
|
@@ -913,7 +913,7 @@ function wt() {
|
|
|
913
913
|
return ei = r, ei;
|
|
914
914
|
}
|
|
915
915
|
var ti, ql;
|
|
916
|
-
function
|
|
916
|
+
function ry() {
|
|
917
917
|
if (ql) return ti;
|
|
918
918
|
ql = 1;
|
|
919
919
|
var r = hr(), e = wt(), t = "[object Arguments]";
|
|
@@ -926,7 +926,7 @@ var ri, Ll;
|
|
|
926
926
|
function Md() {
|
|
927
927
|
if (Ll) return ri;
|
|
928
928
|
Ll = 1;
|
|
929
|
-
var r =
|
|
929
|
+
var r = ry(), e = wt(), t = Object.prototype, n = t.hasOwnProperty, s = t.propertyIsEnumerable, i = r(/* @__PURE__ */ (function() {
|
|
930
930
|
return arguments;
|
|
931
931
|
})()) ? r : function(a) {
|
|
932
932
|
return e(a) && n.call(a, "callee") && !s.call(a, "callee");
|
|
@@ -934,7 +934,7 @@ function Md() {
|
|
|
934
934
|
return ri = i, ri;
|
|
935
935
|
}
|
|
936
936
|
var br = { exports: {} }, ni, $l;
|
|
937
|
-
function
|
|
937
|
+
function ny() {
|
|
938
938
|
if ($l) return ni;
|
|
939
939
|
$l = 1;
|
|
940
940
|
function r() {
|
|
@@ -946,7 +946,7 @@ br.exports;
|
|
|
946
946
|
var jl;
|
|
947
947
|
function Fn() {
|
|
948
948
|
return jl || (jl = 1, (function(r, e) {
|
|
949
|
-
var t = ct(), n =
|
|
949
|
+
var t = ct(), n = ny(), s = e && !e.nodeType && e, i = s && !0 && r && !r.nodeType && r, a = i && i.exports === s, o = a ? t.Buffer : void 0, c = o ? o.isBuffer : void 0, l = c || n;
|
|
950
950
|
r.exports = l;
|
|
951
951
|
})(br, br.exports)), br.exports;
|
|
952
952
|
}
|
|
@@ -972,7 +972,7 @@ function Pd() {
|
|
|
972
972
|
return ii = e, ii;
|
|
973
973
|
}
|
|
974
974
|
var ai, Wl;
|
|
975
|
-
function
|
|
975
|
+
function sy() {
|
|
976
976
|
if (Wl) return ai;
|
|
977
977
|
Wl = 1;
|
|
978
978
|
var r = hr(), e = Pd(), 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]", _ = "[object ArrayBuffer]", O = "[object DataView]", R = "[object Float32Array]", C = "[object Float64Array]", w = "[object Int8Array]", E = "[object Int16Array]", I = "[object Int32Array]", T = "[object Uint8Array]", y = "[object Uint8ClampedArray]", N = "[object Uint16Array]", g = "[object Uint32Array]", A = {};
|
|
@@ -1012,14 +1012,14 @@ var ci, Zl;
|
|
|
1012
1012
|
function Lo() {
|
|
1013
1013
|
if (Zl) return ci;
|
|
1014
1014
|
Zl = 1;
|
|
1015
|
-
var r =
|
|
1015
|
+
var r = sy(), e = Po(), t = qo(), n = t && t.isTypedArray, s = n ? e(n) : r;
|
|
1016
1016
|
return ci = s, ci;
|
|
1017
1017
|
}
|
|
1018
1018
|
var li, Gl;
|
|
1019
1019
|
function qd() {
|
|
1020
1020
|
if (Gl) return li;
|
|
1021
1021
|
Gl = 1;
|
|
1022
|
-
var r =
|
|
1022
|
+
var r = ty(), e = Md(), t = Dt(), n = Fn(), s = Mo(), i = Lo(), a = Object.prototype, o = a.hasOwnProperty;
|
|
1023
1023
|
function c(l, u) {
|
|
1024
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, _ = v ? r(l.length, String) : [], O = _.length;
|
|
1025
1025
|
for (var R in l)
|
|
@@ -1055,17 +1055,17 @@ function Ld() {
|
|
|
1055
1055
|
return fi = r, fi;
|
|
1056
1056
|
}
|
|
1057
1057
|
var di, Yl;
|
|
1058
|
-
function
|
|
1058
|
+
function iy() {
|
|
1059
1059
|
if (Yl) return di;
|
|
1060
1060
|
Yl = 1;
|
|
1061
1061
|
var r = Ld(), e = r(Object.keys, Object);
|
|
1062
1062
|
return di = e, di;
|
|
1063
1063
|
}
|
|
1064
1064
|
var hi, Jl;
|
|
1065
|
-
function
|
|
1065
|
+
function ay() {
|
|
1066
1066
|
if (Jl) return hi;
|
|
1067
1067
|
Jl = 1;
|
|
1068
|
-
var r = $o(), e =
|
|
1068
|
+
var r = $o(), e = iy(), t = Object.prototype, n = t.hasOwnProperty;
|
|
1069
1069
|
function s(i) {
|
|
1070
1070
|
if (!r(i))
|
|
1071
1071
|
return e(i);
|
|
@@ -1090,7 +1090,7 @@ var pi, Xl;
|
|
|
1090
1090
|
function jo() {
|
|
1091
1091
|
if (Xl) return pi;
|
|
1092
1092
|
Xl = 1;
|
|
1093
|
-
var r = qd(), e =
|
|
1093
|
+
var r = qd(), e = ay(), t = Dn();
|
|
1094
1094
|
function n(s) {
|
|
1095
1095
|
return t(s) ? r(s) : e(s);
|
|
1096
1096
|
}
|
|
@@ -1107,7 +1107,7 @@ function $d() {
|
|
|
1107
1107
|
return yi = n, yi;
|
|
1108
1108
|
}
|
|
1109
1109
|
var gi, tu;
|
|
1110
|
-
function
|
|
1110
|
+
function oy() {
|
|
1111
1111
|
if (tu) return gi;
|
|
1112
1112
|
tu = 1;
|
|
1113
1113
|
var r = $d(), e = 1, t = Object.prototype, n = t.hasOwnProperty;
|
|
@@ -1145,28 +1145,28 @@ function ay() {
|
|
|
1145
1145
|
return gi = s, gi;
|
|
1146
1146
|
}
|
|
1147
1147
|
var _i, ru;
|
|
1148
|
-
function
|
|
1148
|
+
function cy() {
|
|
1149
1149
|
if (ru) return _i;
|
|
1150
1150
|
ru = 1;
|
|
1151
1151
|
var r = Bt(), e = ct(), t = r(e, "DataView");
|
|
1152
1152
|
return _i = t, _i;
|
|
1153
1153
|
}
|
|
1154
1154
|
var vi, nu;
|
|
1155
|
-
function
|
|
1155
|
+
function ly() {
|
|
1156
1156
|
if (nu) return vi;
|
|
1157
1157
|
nu = 1;
|
|
1158
1158
|
var r = Bt(), e = ct(), t = r(e, "Promise");
|
|
1159
1159
|
return vi = t, vi;
|
|
1160
1160
|
}
|
|
1161
1161
|
var wi, su;
|
|
1162
|
-
function
|
|
1162
|
+
function uy() {
|
|
1163
1163
|
if (su) return wi;
|
|
1164
1164
|
su = 1;
|
|
1165
1165
|
var r = Bt(), e = ct(), t = r(e, "Set");
|
|
1166
1166
|
return wi = t, wi;
|
|
1167
1167
|
}
|
|
1168
1168
|
var bi, iu;
|
|
1169
|
-
function
|
|
1169
|
+
function fy() {
|
|
1170
1170
|
if (iu) return bi;
|
|
1171
1171
|
iu = 1;
|
|
1172
1172
|
var r = Bt(), e = ct(), t = r(e, "WeakMap");
|
|
@@ -1176,7 +1176,7 @@ var Oi, au;
|
|
|
1176
1176
|
function Mn() {
|
|
1177
1177
|
if (au) return Oi;
|
|
1178
1178
|
au = 1;
|
|
1179
|
-
var r =
|
|
1179
|
+
var r = cy(), e = xo(), t = ly(), n = uy(), s = fy(), i = hr(), a = kd(), 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), _ = 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)
|
|
@@ -1196,10 +1196,10 @@ function Mn() {
|
|
|
1196
1196
|
}), Oi = R, Oi;
|
|
1197
1197
|
}
|
|
1198
1198
|
var Ei, ou;
|
|
1199
|
-
function
|
|
1199
|
+
function dy() {
|
|
1200
1200
|
if (ou) return Ei;
|
|
1201
1201
|
ou = 1;
|
|
1202
|
-
var r = Fo(), e = Id(), t =
|
|
1202
|
+
var r = Fo(), e = Id(), 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
1203
|
function p(v, _, O, R, C, w) {
|
|
1204
1204
|
var E = i(v), I = i(_), T = E ? u : s(v), y = I ? u : s(_);
|
|
1205
1205
|
T = T == l ? f : T, y = y == l ? f : y;
|
|
@@ -1223,38 +1223,38 @@ function fy() {
|
|
|
1223
1223
|
return Ei = p, Ei;
|
|
1224
1224
|
}
|
|
1225
1225
|
var Si, cu;
|
|
1226
|
-
function
|
|
1226
|
+
function hy() {
|
|
1227
1227
|
if (cu) return Si;
|
|
1228
1228
|
cu = 1;
|
|
1229
|
-
var r =
|
|
1229
|
+
var r = dy(), e = wt();
|
|
1230
1230
|
function t(n, s, i, a, o) {
|
|
1231
1231
|
return n === s ? !0 : n == null || s == null || !e(n) && !e(s) ? n !== n && s !== s : r(n, s, i, a, t, o);
|
|
1232
1232
|
}
|
|
1233
1233
|
return Si = t, Si;
|
|
1234
1234
|
}
|
|
1235
1235
|
var Ti, lu;
|
|
1236
|
-
function
|
|
1236
|
+
function my() {
|
|
1237
1237
|
if (lu) return Ti;
|
|
1238
1238
|
lu = 1;
|
|
1239
|
-
var r =
|
|
1239
|
+
var r = hy();
|
|
1240
1240
|
function e(t, n) {
|
|
1241
1241
|
return r(t, n);
|
|
1242
1242
|
}
|
|
1243
1243
|
return Ti = e, Ti;
|
|
1244
1244
|
}
|
|
1245
|
-
var
|
|
1246
|
-
const
|
|
1245
|
+
var py = my();
|
|
1246
|
+
const yy = /* @__PURE__ */ Cn(py), gy = (r, e, t, n, s, i, a, o, c) => {
|
|
1247
1247
|
const { access: l } = e, { permissionWriteRestrictions: u } = l;
|
|
1248
1248
|
let f = !0, d = "";
|
|
1249
1249
|
const h = u?.filter((p) => n === p.userRole);
|
|
1250
1250
|
return h?.length && !h.some((p) => p.recordRole === s) ? (d = `User ${n} does not have write access to record with role ${s}`, f = !1, f) : (u?.forEach((p) => {
|
|
1251
1251
|
n === p.userRole && p.recordRole;
|
|
1252
1252
|
}), d && console.error(`PERMISSION_DENIED: ${d}`), f);
|
|
1253
|
-
},
|
|
1253
|
+
}, _y = (r, e, t, n, s, i, a, o, c, l, u) => {
|
|
1254
1254
|
const { labels: f } = n;
|
|
1255
1255
|
let d = !0;
|
|
1256
|
-
return (!e.Role || i && (!a?.Role || !
|
|
1257
|
-
},
|
|
1256
|
+
return (!e.Role || i && (!a?.Role || !gy(r, n, s, a.Role, e.Role) || i === e.User_ID)) && (d = !1), d;
|
|
1257
|
+
}, vy = (r, e, t, n, s, i, a) => {
|
|
1258
1258
|
const { labels: o, fields: c } = t, l = i?.collections?.[o.collection];
|
|
1259
1259
|
let u = !0;
|
|
1260
1260
|
if (s && !l)
|
|
@@ -1263,14 +1263,14 @@ const py = /* @__PURE__ */ Cn(my), yy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1263
1263
|
!un("Create", t, n, s, i, r) && (u = !1), t.auth;
|
|
1264
1264
|
for (const f of c) {
|
|
1265
1265
|
const d = r[f.name];
|
|
1266
|
-
f.access && !Rn(f, i) && d !== void 0 && (u = !1), d !== void 0 && !
|
|
1266
|
+
f.access && !Rn(f, i) && d !== void 0 && (u = !1), d !== void 0 && !pp(f, i) && (u = !1);
|
|
1267
1267
|
}
|
|
1268
1268
|
if (!u)
|
|
1269
1269
|
throw new Error("PERMISSION_DENIED");
|
|
1270
1270
|
}, sr = (r) => r && (r._methodName === "deleteField" || r.constructor.name === "DeleteTransform"), tr = (r) => {
|
|
1271
1271
|
for (const e in r)
|
|
1272
1272
|
Object.prototype.hasOwnProperty.call(r, e) && (sr(r[e]) ? delete r[e] : typeof r[e] == "object" && r[e] !== null && tr(r[e]));
|
|
1273
|
-
},
|
|
1273
|
+
}, wy = (r, e, t, n, s, i, a, o, c, l) => {
|
|
1274
1274
|
const { labels: u, fields: f } = n, d = a?.collections?.[u.collection], h = { ...e, ...r };
|
|
1275
1275
|
tr(h);
|
|
1276
1276
|
let p = !0, v = "";
|
|
@@ -1281,16 +1281,16 @@ const py = /* @__PURE__ */ Cn(my), yy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1281
1281
|
!un("Update", n, s, i, a, h)) && (p = !1, v = "Authenticated user does not have Update access to this document");
|
|
1282
1282
|
for (const _ of f) {
|
|
1283
1283
|
const O = r[_.name];
|
|
1284
|
-
_.access && !Rn(_, a) && O !== void 0 && (v = `Authenticated user does not have access to field ${_.name}`, p = !1), O !== void 0 && !
|
|
1284
|
+
_.access && !Rn(_, a) && O !== void 0 && (v = `Authenticated user does not have access to field ${_.name}`, p = !1), O !== void 0 && !yp(_, a) && (v = `Authenticated user does not have Update access to field ${_.name}`, p = !1);
|
|
1285
1285
|
}
|
|
1286
1286
|
if (!p)
|
|
1287
1287
|
throw v && console.error(`PERMISSION_DENIED: ${v}`), new Error("PERMISSION_DENIED");
|
|
1288
|
-
},
|
|
1288
|
+
}, by = (r, e, t, n, s, i) => {
|
|
1289
1289
|
const { labels: a } = t, o = i.collections?.[a.collection];
|
|
1290
1290
|
let c = !0;
|
|
1291
1291
|
if (!o)
|
|
1292
1292
|
throw new Error("PERMISSION_DENIED");
|
|
1293
|
-
if (_t("Delete", o) || (c = !1), un("Delete", t, n, s, i, r) || (c = !1), t.auth && r.User_ID && (
|
|
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
|
}, jd = (r, e, t) => {
|
|
1296
1296
|
const { access: n } = e, { entityRestrictions: s } = n;
|
|
@@ -1303,7 +1303,7 @@ const py = /* @__PURE__ */ Cn(my), yy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1303
1303
|
for (const i of s.parentFilters) {
|
|
1304
1304
|
if (!i.roles.some((l) => l.role === r))
|
|
1305
1305
|
continue;
|
|
1306
|
-
const a =
|
|
1306
|
+
const a = re(e.fields, i.collectionField);
|
|
1307
1307
|
if (!_e(a))
|
|
1308
1308
|
throw new Error("PERMISSION_DENIED");
|
|
1309
1309
|
const c = t.collections[a.collection].access.entityRestrictions?.restrictions?.find((l) => l.type === i.type && l.roles.some((u) => u.role === r));
|
|
@@ -1315,7 +1315,7 @@ const py = /* @__PURE__ */ Cn(my), yy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1315
1315
|
return `${i.type} parent filter`;
|
|
1316
1316
|
}
|
|
1317
1317
|
return !0;
|
|
1318
|
-
},
|
|
1318
|
+
}, Oy = (r, e, t, n, s) => {
|
|
1319
1319
|
const i = {};
|
|
1320
1320
|
for (const a of r) {
|
|
1321
1321
|
const c = e[a].default(t, n, s);
|
|
@@ -1327,7 +1327,7 @@ const py = /* @__PURE__ */ Cn(my), yy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1327
1327
|
i[a] = c;
|
|
1328
1328
|
}
|
|
1329
1329
|
return i;
|
|
1330
|
-
},
|
|
1330
|
+
}, Ey = (r, e) => e.fields.filter((t) => t.name === r.name)[0];
|
|
1331
1331
|
var Ri, uu;
|
|
1332
1332
|
function Ud() {
|
|
1333
1333
|
if (uu) return Ri;
|
|
@@ -1367,7 +1367,7 @@ function Vd() {
|
|
|
1367
1367
|
return Ci = t, Ci;
|
|
1368
1368
|
}
|
|
1369
1369
|
var ki, hu;
|
|
1370
|
-
function
|
|
1370
|
+
function Sy() {
|
|
1371
1371
|
if (hu) return ki;
|
|
1372
1372
|
hu = 1;
|
|
1373
1373
|
function r(e) {
|
|
@@ -1383,10 +1383,10 @@ function Ey() {
|
|
|
1383
1383
|
return ki = r, ki;
|
|
1384
1384
|
}
|
|
1385
1385
|
var Ii, mu;
|
|
1386
|
-
function
|
|
1386
|
+
function Ty() {
|
|
1387
1387
|
if (mu) return Ii;
|
|
1388
1388
|
mu = 1;
|
|
1389
|
-
var r =
|
|
1389
|
+
var r = Sy(), e = r();
|
|
1390
1390
|
return Ii = e, Ii;
|
|
1391
1391
|
}
|
|
1392
1392
|
var Er = { exports: {} };
|
|
@@ -1439,7 +1439,7 @@ function Bd() {
|
|
|
1439
1439
|
return Fi = r, Fi;
|
|
1440
1440
|
}
|
|
1441
1441
|
var Di, vu;
|
|
1442
|
-
function
|
|
1442
|
+
function Ry() {
|
|
1443
1443
|
if (vu) return Di;
|
|
1444
1444
|
vu = 1;
|
|
1445
1445
|
var r = vt(), e = Object.create, t = /* @__PURE__ */ (function() {
|
|
@@ -1468,14 +1468,14 @@ var Pi, bu;
|
|
|
1468
1468
|
function Zd() {
|
|
1469
1469
|
if (bu) return Pi;
|
|
1470
1470
|
bu = 1;
|
|
1471
|
-
var r =
|
|
1471
|
+
var r = Ry(), e = Wo(), t = $o();
|
|
1472
1472
|
function n(s) {
|
|
1473
1473
|
return typeof s.constructor == "function" && !t(s) ? r(e(s)) : {};
|
|
1474
1474
|
}
|
|
1475
1475
|
return Pi = n, Pi;
|
|
1476
1476
|
}
|
|
1477
1477
|
var qi, Ou;
|
|
1478
|
-
function
|
|
1478
|
+
function Ay() {
|
|
1479
1479
|
if (Ou) return qi;
|
|
1480
1480
|
Ou = 1;
|
|
1481
1481
|
var r = Dn(), e = wt();
|
|
@@ -1485,7 +1485,7 @@ function Ry() {
|
|
|
1485
1485
|
return qi = t, qi;
|
|
1486
1486
|
}
|
|
1487
1487
|
var Li, Eu;
|
|
1488
|
-
function
|
|
1488
|
+
function Cy() {
|
|
1489
1489
|
if (Eu) return Li;
|
|
1490
1490
|
Eu = 1;
|
|
1491
1491
|
var r = hr(), e = Wo(), t = wt(), n = "[object Object]", s = Function.prototype, i = Object.prototype, a = s.toString, o = i.hasOwnProperty, c = a.call(Object);
|
|
@@ -1538,7 +1538,7 @@ function Vr() {
|
|
|
1538
1538
|
return Ui = t, Ui;
|
|
1539
1539
|
}
|
|
1540
1540
|
var Vi, Au;
|
|
1541
|
-
function
|
|
1541
|
+
function ky() {
|
|
1542
1542
|
if (Au) return Vi;
|
|
1543
1543
|
Au = 1;
|
|
1544
1544
|
function r(e) {
|
|
@@ -1551,10 +1551,10 @@ function Cy() {
|
|
|
1551
1551
|
return Vi = r, Vi;
|
|
1552
1552
|
}
|
|
1553
1553
|
var Wi, Cu;
|
|
1554
|
-
function
|
|
1554
|
+
function Iy() {
|
|
1555
1555
|
if (Cu) return Wi;
|
|
1556
1556
|
Cu = 1;
|
|
1557
|
-
var r = vt(), e = $o(), t =
|
|
1557
|
+
var r = vt(), e = $o(), t = ky(), n = Object.prototype, s = n.hasOwnProperty;
|
|
1558
1558
|
function i(a) {
|
|
1559
1559
|
if (!r(a))
|
|
1560
1560
|
return t(a);
|
|
@@ -1569,14 +1569,14 @@ var zi, ku;
|
|
|
1569
1569
|
function Wr() {
|
|
1570
1570
|
if (ku) return zi;
|
|
1571
1571
|
ku = 1;
|
|
1572
|
-
var r = qd(), e =
|
|
1572
|
+
var r = qd(), e = Iy(), t = Dn();
|
|
1573
1573
|
function n(s) {
|
|
1574
1574
|
return t(s) ? r(s, !0) : e(s);
|
|
1575
1575
|
}
|
|
1576
1576
|
return zi = n, zi;
|
|
1577
1577
|
}
|
|
1578
1578
|
var Bi, Iu;
|
|
1579
|
-
function
|
|
1579
|
+
function xy() {
|
|
1580
1580
|
if (Iu) return Bi;
|
|
1581
1581
|
Iu = 1;
|
|
1582
1582
|
var r = Vr(), e = Wr();
|
|
@@ -1586,10 +1586,10 @@ function Iy() {
|
|
|
1586
1586
|
return Bi = t, Bi;
|
|
1587
1587
|
}
|
|
1588
1588
|
var Zi, xu;
|
|
1589
|
-
function
|
|
1589
|
+
function Ny() {
|
|
1590
1590
|
if (xu) return Zi;
|
|
1591
1591
|
xu = 1;
|
|
1592
|
-
var r = Vd(), e = Wd(), t = zd(), n = Bd(), s = Zd(), i = Md(), a = Dt(), o =
|
|
1592
|
+
var r = Vd(), e = Wd(), t = zd(), n = Bd(), s = Zd(), i = Md(), a = Dt(), o = Ay(), c = Fn(), l = Io(), u = vt(), f = Cy(), d = Lo(), h = Gd(), p = xy();
|
|
1593
1593
|
function v(_, O, R, C, w, E, I) {
|
|
1594
1594
|
var T = h(_, R), y = h(O, R), N = I.get(y);
|
|
1595
1595
|
if (N) {
|
|
@@ -1606,10 +1606,10 @@ function xy() {
|
|
|
1606
1606
|
return Zi = v, Zi;
|
|
1607
1607
|
}
|
|
1608
1608
|
var Gi, Nu;
|
|
1609
|
-
function
|
|
1609
|
+
function Fy() {
|
|
1610
1610
|
if (Nu) return Gi;
|
|
1611
1611
|
Nu = 1;
|
|
1612
|
-
var r = Fo(), e = Vd(), t =
|
|
1612
|
+
var r = Fo(), e = Vd(), t = Ty(), n = Ny(), s = vt(), i = Wr(), a = Gd();
|
|
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))
|
|
@@ -1632,7 +1632,7 @@ function Hd() {
|
|
|
1632
1632
|
return Hi = r, Hi;
|
|
1633
1633
|
}
|
|
1634
1634
|
var Ki, Du;
|
|
1635
|
-
function
|
|
1635
|
+
function Dy() {
|
|
1636
1636
|
if (Du) return Ki;
|
|
1637
1637
|
Du = 1;
|
|
1638
1638
|
function r(e, t, n) {
|
|
@@ -1651,10 +1651,10 @@ function Fy() {
|
|
|
1651
1651
|
return Ki = r, Ki;
|
|
1652
1652
|
}
|
|
1653
1653
|
var Yi, Mu;
|
|
1654
|
-
function
|
|
1654
|
+
function My() {
|
|
1655
1655
|
if (Mu) return Yi;
|
|
1656
1656
|
Mu = 1;
|
|
1657
|
-
var r =
|
|
1657
|
+
var r = Dy(), e = Math.max;
|
|
1658
1658
|
function t(n, s, i) {
|
|
1659
1659
|
return s = e(s === void 0 ? n.length - 1 : s, 0), function() {
|
|
1660
1660
|
for (var a = arguments, o = -1, c = e(a.length - s, 0), l = Array(c); ++o < c; )
|
|
@@ -1668,7 +1668,7 @@ function Dy() {
|
|
|
1668
1668
|
return Yi = t, Yi;
|
|
1669
1669
|
}
|
|
1670
1670
|
var Ji, Pu;
|
|
1671
|
-
function
|
|
1671
|
+
function Py() {
|
|
1672
1672
|
if (Pu) return Ji;
|
|
1673
1673
|
Pu = 1;
|
|
1674
1674
|
function r(e) {
|
|
@@ -1679,10 +1679,10 @@ function My() {
|
|
|
1679
1679
|
return Ji = r, Ji;
|
|
1680
1680
|
}
|
|
1681
1681
|
var Qi, qu;
|
|
1682
|
-
function
|
|
1682
|
+
function qy() {
|
|
1683
1683
|
if (qu) return Qi;
|
|
1684
1684
|
qu = 1;
|
|
1685
|
-
var r =
|
|
1685
|
+
var r = Py(), e = Ud(), t = Hd(), n = e ? function(s, i) {
|
|
1686
1686
|
return e(s, "toString", {
|
|
1687
1687
|
configurable: !0,
|
|
1688
1688
|
enumerable: !1,
|
|
@@ -1693,7 +1693,7 @@ function Py() {
|
|
|
1693
1693
|
return Qi = n, Qi;
|
|
1694
1694
|
}
|
|
1695
1695
|
var Xi, Lu;
|
|
1696
|
-
function
|
|
1696
|
+
function Ly() {
|
|
1697
1697
|
if (Lu) return Xi;
|
|
1698
1698
|
Lu = 1;
|
|
1699
1699
|
var r = 800, e = 16, t = Date.now;
|
|
@@ -1712,24 +1712,24 @@ function qy() {
|
|
|
1712
1712
|
return Xi = n, Xi;
|
|
1713
1713
|
}
|
|
1714
1714
|
var ea, $u;
|
|
1715
|
-
function
|
|
1715
|
+
function $y() {
|
|
1716
1716
|
if ($u) return ea;
|
|
1717
1717
|
$u = 1;
|
|
1718
|
-
var r =
|
|
1718
|
+
var r = qy(), e = Ly(), t = e(r);
|
|
1719
1719
|
return ea = t, ea;
|
|
1720
1720
|
}
|
|
1721
1721
|
var ta, ju;
|
|
1722
|
-
function
|
|
1722
|
+
function jy() {
|
|
1723
1723
|
if (ju) return ta;
|
|
1724
1724
|
ju = 1;
|
|
1725
|
-
var r = Hd(), e =
|
|
1725
|
+
var r = Hd(), e = My(), t = $y();
|
|
1726
1726
|
function n(s, i) {
|
|
1727
1727
|
return t(e(s, i, r), s + "");
|
|
1728
1728
|
}
|
|
1729
1729
|
return ta = n, ta;
|
|
1730
1730
|
}
|
|
1731
1731
|
var ra, Uu;
|
|
1732
|
-
function
|
|
1732
|
+
function Uy() {
|
|
1733
1733
|
if (Uu) return ra;
|
|
1734
1734
|
Uu = 1;
|
|
1735
1735
|
var r = jr(), e = Dn(), t = Mo(), n = vt();
|
|
@@ -1742,10 +1742,10 @@ function jy() {
|
|
|
1742
1742
|
return ra = s, ra;
|
|
1743
1743
|
}
|
|
1744
1744
|
var na, Vu;
|
|
1745
|
-
function
|
|
1745
|
+
function Vy() {
|
|
1746
1746
|
if (Vu) return na;
|
|
1747
1747
|
Vu = 1;
|
|
1748
|
-
var r =
|
|
1748
|
+
var r = jy(), e = Uy();
|
|
1749
1749
|
function t(n) {
|
|
1750
1750
|
return r(function(s, i) {
|
|
1751
1751
|
var a = -1, o = i.length, c = o > 1 ? i[o - 1] : void 0, l = o > 2 ? i[2] : void 0;
|
|
@@ -1759,16 +1759,16 @@ function Uy() {
|
|
|
1759
1759
|
return na = t, na;
|
|
1760
1760
|
}
|
|
1761
1761
|
var sa, Wu;
|
|
1762
|
-
function
|
|
1762
|
+
function Wy() {
|
|
1763
1763
|
if (Wu) return sa;
|
|
1764
1764
|
Wu = 1;
|
|
1765
|
-
var r =
|
|
1765
|
+
var r = Fy(), e = Vy(), t = e(function(n, s, i) {
|
|
1766
1766
|
r(n, s, i);
|
|
1767
1767
|
});
|
|
1768
1768
|
return sa = t, sa;
|
|
1769
1769
|
}
|
|
1770
|
-
var
|
|
1771
|
-
const
|
|
1770
|
+
var zy = Wy();
|
|
1771
|
+
const By = /* @__PURE__ */ Cn(zy);
|
|
1772
1772
|
var ia, zu;
|
|
1773
1773
|
function Bo() {
|
|
1774
1774
|
if (zu) return ia;
|
|
@@ -1780,7 +1780,7 @@ function Bo() {
|
|
|
1780
1780
|
return ia = n, ia;
|
|
1781
1781
|
}
|
|
1782
1782
|
var aa, Bu;
|
|
1783
|
-
function
|
|
1783
|
+
function Zy() {
|
|
1784
1784
|
if (Bu) return aa;
|
|
1785
1785
|
Bu = 1;
|
|
1786
1786
|
var r = Dt(), e = Bo(), t = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, n = /^\w*$/;
|
|
@@ -1793,7 +1793,7 @@ function By() {
|
|
|
1793
1793
|
return aa = s, aa;
|
|
1794
1794
|
}
|
|
1795
1795
|
var oa, Zu;
|
|
1796
|
-
function
|
|
1796
|
+
function Gy() {
|
|
1797
1797
|
if (Zu) return oa;
|
|
1798
1798
|
Zu = 1;
|
|
1799
1799
|
var r = No(), e = "Expected a function";
|
|
@@ -1812,10 +1812,10 @@ function Zy() {
|
|
|
1812
1812
|
return t.Cache = r, oa = t, oa;
|
|
1813
1813
|
}
|
|
1814
1814
|
var ca, Gu;
|
|
1815
|
-
function
|
|
1815
|
+
function Hy() {
|
|
1816
1816
|
if (Gu) return ca;
|
|
1817
1817
|
Gu = 1;
|
|
1818
|
-
var r =
|
|
1818
|
+
var r = Gy(), e = 500;
|
|
1819
1819
|
function t(n) {
|
|
1820
1820
|
var s = r(n, function(a) {
|
|
1821
1821
|
return i.size === e && i.clear(), a;
|
|
@@ -1825,10 +1825,10 @@ function Gy() {
|
|
|
1825
1825
|
return ca = t, ca;
|
|
1826
1826
|
}
|
|
1827
1827
|
var la, Hu;
|
|
1828
|
-
function
|
|
1828
|
+
function Ky() {
|
|
1829
1829
|
if (Hu) return la;
|
|
1830
1830
|
Hu = 1;
|
|
1831
|
-
var r =
|
|
1831
|
+
var r = Hy(), e = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, t = /\\(\\)?/g, n = r(function(s) {
|
|
1832
1832
|
var i = [];
|
|
1833
1833
|
return s.charCodeAt(0) === 46 && i.push(""), s.replace(e, function(a, o, c, l) {
|
|
1834
1834
|
i.push(c ? l.replace(t, "$1") : o || a);
|
|
@@ -1837,7 +1837,7 @@ function Hy() {
|
|
|
1837
1837
|
return la = n, la;
|
|
1838
1838
|
}
|
|
1839
1839
|
var ua, Ku;
|
|
1840
|
-
function
|
|
1840
|
+
function Yy() {
|
|
1841
1841
|
if (Ku) return ua;
|
|
1842
1842
|
Ku = 1;
|
|
1843
1843
|
function r(e, t) {
|
|
@@ -1848,10 +1848,10 @@ function Ky() {
|
|
|
1848
1848
|
return ua = r, ua;
|
|
1849
1849
|
}
|
|
1850
1850
|
var fa, Yu;
|
|
1851
|
-
function
|
|
1851
|
+
function Jy() {
|
|
1852
1852
|
if (Yu) return fa;
|
|
1853
1853
|
Yu = 1;
|
|
1854
|
-
var r = Ur(), e =
|
|
1854
|
+
var r = Ur(), e = Yy(), t = Dt(), n = Bo(), s = r ? r.prototype : void 0, i = s ? s.toString : void 0;
|
|
1855
1855
|
function a(o) {
|
|
1856
1856
|
if (typeof o == "string")
|
|
1857
1857
|
return o;
|
|
@@ -1865,27 +1865,27 @@ function Yy() {
|
|
|
1865
1865
|
return fa = a, fa;
|
|
1866
1866
|
}
|
|
1867
1867
|
var da, Ju;
|
|
1868
|
-
function
|
|
1868
|
+
function Qy() {
|
|
1869
1869
|
if (Ju) return da;
|
|
1870
1870
|
Ju = 1;
|
|
1871
|
-
var r =
|
|
1871
|
+
var r = Jy();
|
|
1872
1872
|
function e(t) {
|
|
1873
1873
|
return t == null ? "" : r(t);
|
|
1874
1874
|
}
|
|
1875
1875
|
return da = e, da;
|
|
1876
1876
|
}
|
|
1877
1877
|
var ha, Qu;
|
|
1878
|
-
function
|
|
1878
|
+
function Xy() {
|
|
1879
1879
|
if (Qu) return ha;
|
|
1880
1880
|
Qu = 1;
|
|
1881
|
-
var r = Dt(), e =
|
|
1881
|
+
var r = Dt(), e = Zy(), t = Ky(), n = Qy();
|
|
1882
1882
|
function s(i, a) {
|
|
1883
1883
|
return r(i) ? i : e(i, a) ? [i] : t(n(i));
|
|
1884
1884
|
}
|
|
1885
1885
|
return ha = s, ha;
|
|
1886
1886
|
}
|
|
1887
1887
|
var ma, Xu;
|
|
1888
|
-
function
|
|
1888
|
+
function eg() {
|
|
1889
1889
|
if (Xu) return ma;
|
|
1890
1890
|
Xu = 1;
|
|
1891
1891
|
var r = Bo();
|
|
@@ -1898,10 +1898,10 @@ function Xy() {
|
|
|
1898
1898
|
return ma = e, ma;
|
|
1899
1899
|
}
|
|
1900
1900
|
var pa, ef;
|
|
1901
|
-
function
|
|
1901
|
+
function tg() {
|
|
1902
1902
|
if (ef) return pa;
|
|
1903
1903
|
ef = 1;
|
|
1904
|
-
var r = zo(), e =
|
|
1904
|
+
var r = zo(), e = Xy(), t = Mo(), n = vt(), s = eg();
|
|
1905
1905
|
function i(a, o, c, l) {
|
|
1906
1906
|
if (!n(a))
|
|
1907
1907
|
return a;
|
|
@@ -1921,20 +1921,20 @@ function eg() {
|
|
|
1921
1921
|
return pa = i, pa;
|
|
1922
1922
|
}
|
|
1923
1923
|
var ya, tf;
|
|
1924
|
-
function
|
|
1924
|
+
function rg() {
|
|
1925
1925
|
if (tf) return ya;
|
|
1926
1926
|
tf = 1;
|
|
1927
|
-
var r =
|
|
1927
|
+
var r = tg();
|
|
1928
1928
|
function e(t, n, s) {
|
|
1929
1929
|
return t == null ? t : r(t, n, s);
|
|
1930
1930
|
}
|
|
1931
1931
|
return ya = e, ya;
|
|
1932
1932
|
}
|
|
1933
|
-
var
|
|
1934
|
-
const
|
|
1933
|
+
var ng = rg();
|
|
1934
|
+
const sg = /* @__PURE__ */ Cn(ng), xr = {
|
|
1935
1935
|
global: {},
|
|
1936
1936
|
collections: {}
|
|
1937
|
-
},
|
|
1937
|
+
}, ig = () => {
|
|
1938
1938
|
xr.global = {}, xr.collections = {};
|
|
1939
1939
|
}, Ee = async (r, e) => {
|
|
1940
1940
|
let t = r;
|
|
@@ -1971,13 +1971,13 @@ const ng = /* @__PURE__ */ Cn(rg), xr = {
|
|
|
1971
1971
|
if (h !== void 0) {
|
|
1972
1972
|
if (h === "__proto__" || h === "constructor" || h === "prototype")
|
|
1973
1973
|
throw new Error("Invalid config path: prototype pollution keys are not allowed");
|
|
1974
|
-
d === e.length - 1 ?
|
|
1974
|
+
d === e.length - 1 ? sg(f, e.join("."), l) : (u[h] ||= {}, u = u[h]);
|
|
1975
1975
|
}
|
|
1976
1976
|
}
|
|
1977
|
-
|
|
1977
|
+
By(xr, f);
|
|
1978
1978
|
}
|
|
1979
1979
|
return l;
|
|
1980
|
-
},
|
|
1980
|
+
}, ag = (r, e, t) => {
|
|
1981
1981
|
const n = Object.values(t.collections), { labels: s } = e;
|
|
1982
1982
|
let i = !1;
|
|
1983
1983
|
for (const a of n) {
|
|
@@ -1988,7 +1988,7 @@ const ng = /* @__PURE__ */ Cn(rg), xr = {
|
|
|
1988
1988
|
l.field == r.name && (i = !0);
|
|
1989
1989
|
}
|
|
1990
1990
|
return i;
|
|
1991
|
-
},
|
|
1991
|
+
}, Kd = (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 ng = /* @__PURE__ */ Cn(rg), xr = {
|
|
|
2000
2000
|
});
|
|
2001
2001
|
});
|
|
2002
2002
|
}), s;
|
|
2003
|
-
},
|
|
2003
|
+
}, Yd = [
|
|
2004
2004
|
"id",
|
|
2005
2005
|
"Collection_Path",
|
|
2006
2006
|
"Last_Write_At",
|
|
@@ -2012,7 +2012,7 @@ const ng = /* @__PURE__ */ Cn(rg), xr = {
|
|
|
2012
2012
|
"Created_At",
|
|
2013
2013
|
"Saved_At",
|
|
2014
2014
|
"Created_By"
|
|
2015
|
-
], Zo = () =>
|
|
2015
|
+
], Zo = () => Yd.map((r) => {
|
|
2016
2016
|
let e = "", t;
|
|
2017
2017
|
switch (r) {
|
|
2018
2018
|
case "id":
|
|
@@ -2061,48 +2061,48 @@ const ng = /* @__PURE__ */ Cn(rg), xr = {
|
|
|
2061
2061
|
if (c.roles.some((l) => l.role === e))
|
|
2062
2062
|
switch (c.type) {
|
|
2063
2063
|
case "Record_Owner":
|
|
2064
|
-
t.push(
|
|
2064
|
+
t.push(re(o, "Created_By"));
|
|
2065
2065
|
break;
|
|
2066
2066
|
case "Record_User":
|
|
2067
|
-
t.push(
|
|
2067
|
+
t.push(re(s, c.collectionField));
|
|
2068
2068
|
break;
|
|
2069
2069
|
case "Record_Property":
|
|
2070
|
-
t.push(
|
|
2070
|
+
t.push(re(s, c.propertyField));
|
|
2071
2071
|
break;
|
|
2072
2072
|
}
|
|
2073
2073
|
}), a && (a.restrictions?.forEach((c) => {
|
|
2074
2074
|
if (c.roles.some((l) => l.role === e))
|
|
2075
2075
|
switch (c.type) {
|
|
2076
2076
|
case "Individual":
|
|
2077
|
-
t.push(
|
|
2077
|
+
t.push(re(o, "id"));
|
|
2078
2078
|
break;
|
|
2079
2079
|
case "Parent":
|
|
2080
|
-
t.push(
|
|
2080
|
+
t.push(re(s, c.collectionField));
|
|
2081
2081
|
break;
|
|
2082
2082
|
case "Parent_Property":
|
|
2083
|
-
t.push(
|
|
2083
|
+
t.push(re(s, c.collectionField)), t.push(re(s, c.propertyField));
|
|
2084
2084
|
break;
|
|
2085
2085
|
}
|
|
2086
2086
|
}), a.parentFilters && a.parentFilters.forEach((c) => {
|
|
2087
2087
|
if (c.roles.some((l) => l.role === e))
|
|
2088
2088
|
switch (c.type) {
|
|
2089
2089
|
case "Individual":
|
|
2090
|
-
t.push(
|
|
2090
|
+
t.push(re(s, c.collectionField));
|
|
2091
2091
|
break;
|
|
2092
2092
|
case "Parent":
|
|
2093
|
-
t.push(
|
|
2093
|
+
t.push(re(s, c.parentCollectionField));
|
|
2094
2094
|
break;
|
|
2095
2095
|
case "Parent_Property":
|
|
2096
|
-
t.push(
|
|
2096
|
+
t.push(re(s, c.parentCollectionField)), t.push(re(s, c.parentPropertyField));
|
|
2097
2097
|
break;
|
|
2098
2098
|
}
|
|
2099
2099
|
})), [...new Set(t)];
|
|
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
|
+
Yd.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 = Kd(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) => {
|
|
@@ -2114,7 +2114,7 @@ const ng = /* @__PURE__ */ Cn(rg), xr = {
|
|
|
2114
2114
|
}), [...new Set(n)];
|
|
2115
2115
|
}, lg = (r, e, t) => {
|
|
2116
2116
|
const n = [], { fields: s, softDelete: i } = e;
|
|
2117
|
-
|
|
2117
|
+
n.push({
|
|
2118
2118
|
name: "Collection_Path",
|
|
2119
2119
|
type: "Array",
|
|
2120
2120
|
required: !0
|
|
@@ -2122,9 +2122,21 @@ const ng = /* @__PURE__ */ Cn(rg), xr = {
|
|
|
2122
2122
|
name: "id",
|
|
2123
2123
|
type: "String",
|
|
2124
2124
|
required: !0
|
|
2125
|
+
});
|
|
2126
|
+
const a = [], o = Kd(e, t);
|
|
2127
|
+
if (Object.values(o).forEach((c) => {
|
|
2128
|
+
Object.keys(c).forEach((l) => {
|
|
2129
|
+
t.collections[l].fields.forEach((f) => {
|
|
2130
|
+
_e(f) && f.collection === e.labels.collection && f.dependencyFields?.some((d) => d.field === r.name) && f.constraints && f.constraints.forEach((d) => {
|
|
2131
|
+
a.push(d[0]);
|
|
2132
|
+
});
|
|
2133
|
+
});
|
|
2134
|
+
});
|
|
2135
|
+
}), a.forEach((c) => {
|
|
2136
|
+
n.push(re(s, c));
|
|
2125
2137
|
}), i) {
|
|
2126
|
-
const
|
|
2127
|
-
|
|
2138
|
+
const c = re(s, i.archivedField);
|
|
2139
|
+
c && n.push(c);
|
|
2128
2140
|
}
|
|
2129
2141
|
return n.push(...cg(r, e, t)), [...new Set(n)];
|
|
2130
2142
|
}, ug = (r, e) => {
|
|
@@ -2147,11 +2159,11 @@ async function oe(r, e, t, n) {
|
|
|
2147
2159
|
if (r !== "setEmbedding" && (await ga(r, e?.[r], n), r === "postWriteError"))
|
|
2148
2160
|
return s;
|
|
2149
2161
|
}
|
|
2150
|
-
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), Jd = (r, e) => {
|
|
2151
2163
|
const { access: t, queries: n } = r, { serverReadOnly: s } = t, i = /* @__PURE__ */ new Set();
|
|
2152
2164
|
if (n)
|
|
2153
2165
|
for (const a of n) {
|
|
2154
|
-
const o =
|
|
2166
|
+
const o = re(e, a.field);
|
|
2155
2167
|
e.find((c) => c.name === a.field) && _e(o) && ["OneToOne", "OneToMany"].includes(o.type) && i.add(o);
|
|
2156
2168
|
}
|
|
2157
2169
|
return e.forEach((a) => {
|
|
@@ -2162,7 +2174,7 @@ const Go = (r, e, t, n, s, i, a, o, c, l) => (r == "create" && (t.Collection_Pat
|
|
|
2162
2174
|
return e.forEach((a) => {
|
|
2163
2175
|
(n === a.name || a.sorting && (typeof a.sorting == "boolean" || !a.sorting.roles?.every((o) => s?.includes(o)))) && a.type === "String" && i.add(a);
|
|
2164
2176
|
}), i;
|
|
2165
|
-
},
|
|
2177
|
+
}, Qd = (r, e, t) => {
|
|
2166
2178
|
const { fields: n } = r;
|
|
2167
2179
|
n.forEach((i) => {
|
|
2168
2180
|
if (_e(i))
|
|
@@ -2171,14 +2183,14 @@ const Go = (r, e, t, n, s, i, a, o, c, l) => (r == "create" && (t.Collection_Pat
|
|
|
2171
2183
|
e[`${i.name}_Array`] = e[i.name];
|
|
2172
2184
|
else if (e[`${i.name}_Array`] = Object.keys(e[i.name]), i.includeFields)
|
|
2173
2185
|
for (const a of i.includeFields) {
|
|
2174
|
-
const o = t.collections[i.collection], c =
|
|
2186
|
+
const o = t.collections[i.collection], c = re(o.fields, a);
|
|
2175
2187
|
zr(o, [c]).size === 1 && Object.keys(e[i.name]).forEach((u) => {
|
|
2176
2188
|
e[i.name][u][a] ? e[i.name][u][`${a}_Lowercase`] = e[i.name][u][a].toLowerCase() : delete e[i.name][u][`${a}_Lowercase`];
|
|
2177
2189
|
});
|
|
2178
2190
|
}
|
|
2179
2191
|
} else
|
|
2180
2192
|
delete e[`${i.name}_Array`], delete e[`${i.name}_Single`];
|
|
2181
|
-
}),
|
|
2193
|
+
}), Jd(r, n).forEach((i) => {
|
|
2182
2194
|
if (e[i.name])
|
|
2183
2195
|
if (sr(e[i.name]))
|
|
2184
2196
|
e[`${i.name}_Single`] = e[i.name];
|
|
@@ -2190,14 +2202,14 @@ const Go = (r, e, t, n, s, i, a, o, c, l) => (r == "create" && (t.Collection_Pat
|
|
|
2190
2202
|
}
|
|
2191
2203
|
}
|
|
2192
2204
|
});
|
|
2193
|
-
},
|
|
2205
|
+
}, Xd = (r, e) => {
|
|
2194
2206
|
zr(r, r.fields).forEach((n) => {
|
|
2195
2207
|
e[n.name] ? e[`${n.name}_Lowercase`] = e[n.name].toLowerCase() : delete e[`${n.name}_Lowercase`];
|
|
2196
2208
|
});
|
|
2197
2209
|
}, fg = async (r, e, t, n) => {
|
|
2198
2210
|
const { fields: s } = e;
|
|
2199
2211
|
for (const i of t.fields) {
|
|
2200
|
-
const a =
|
|
2212
|
+
const a = re(s, i.name);
|
|
2201
2213
|
i.custom?.initialValue && !(n && a.access && !a.access.includes(n)) && (r[i.name] = await Ee(i.custom.initialValue, [r]), zr(e, [a]).size === 1 && (r[`${i.name}_Lowercase`] = r[i.name].toLowerCase()));
|
|
2202
2214
|
}
|
|
2203
2215
|
for (const i of s)
|
|
@@ -2773,18 +2785,18 @@ class ce {
|
|
|
2773
2785
|
}
|
|
2774
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})+$";
|
|
2775
2787
|
let _a;
|
|
2776
|
-
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}(=)?))?$/,
|
|
2777
|
-
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}(=)?))?$/, eh = "((\\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(`^${eh}$`);
|
|
2789
|
+
function th(r) {
|
|
2778
2790
|
let e = "[0-5]\\d";
|
|
2779
2791
|
r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
2780
2792
|
const t = r.precision ? "+" : "?";
|
|
2781
2793
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
|
|
2782
2794
|
}
|
|
2783
2795
|
function xg(r) {
|
|
2784
|
-
return new RegExp(`^${
|
|
2796
|
+
return new RegExp(`^${th(r)}$`);
|
|
2785
2797
|
}
|
|
2786
2798
|
function Ng(r) {
|
|
2787
|
-
let e = `${
|
|
2799
|
+
let e = `${eh}T${th(r)}`;
|
|
2788
2800
|
const t = [];
|
|
2789
2801
|
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
2790
2802
|
}
|
|
@@ -4053,7 +4065,7 @@ class Te extends ce {
|
|
|
4053
4065
|
});
|
|
4054
4066
|
}
|
|
4055
4067
|
keyof() {
|
|
4056
|
-
return
|
|
4068
|
+
return rh(ue.objectKeys(this.shape));
|
|
4057
4069
|
}
|
|
4058
4070
|
}
|
|
4059
4071
|
Te.create = (r, e) => new Te({
|
|
@@ -4452,7 +4464,7 @@ so.create = (r, e) => new so({
|
|
|
4452
4464
|
typeName: Q.ZodLiteral,
|
|
4453
4465
|
...ie(e)
|
|
4454
4466
|
});
|
|
4455
|
-
function
|
|
4467
|
+
function rh(r, e) {
|
|
4456
4468
|
return new or({
|
|
4457
4469
|
values: r,
|
|
4458
4470
|
typeName: Q.ZodEnum,
|
|
@@ -4513,7 +4525,7 @@ class or extends ce {
|
|
|
4513
4525
|
});
|
|
4514
4526
|
}
|
|
4515
4527
|
}
|
|
4516
|
-
or.create =
|
|
4528
|
+
or.create = rh;
|
|
4517
4529
|
class mf extends ce {
|
|
4518
4530
|
_parse(e) {
|
|
4519
4531
|
const t = ue.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -4839,7 +4851,7 @@ var Q;
|
|
|
4839
4851
|
})(Q || (Q = {}));
|
|
4840
4852
|
const mt = pt.create, co = ar.create, Lg = to.create, jt = ro.create;
|
|
4841
4853
|
Ft.create;
|
|
4842
|
-
const Pn = at.create,
|
|
4854
|
+
const Pn = at.create, nh = Te.create, gn = hn.create;
|
|
4843
4855
|
mn.create;
|
|
4844
4856
|
Vt.create;
|
|
4845
4857
|
const Ko = pn.create, lo = so.create, uo = or.create;
|
|
@@ -4850,7 +4862,7 @@ const sn = () => jt().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4850
4862
|
message: "Value is not a valid timestamp"
|
|
4851
4863
|
}), yf = () => jt().refine((r) => r && (r._methodName === "serverTimestamp" || r.constructor.name === "ServerTimestampTransform"), {
|
|
4852
4864
|
message: "Value is not a valid server timestamp"
|
|
4853
|
-
}),
|
|
4865
|
+
}), sh = (r, e) => {
|
|
4854
4866
|
const t = {};
|
|
4855
4867
|
if (r.includeFields) {
|
|
4856
4868
|
const n = e.collections[r.collection];
|
|
@@ -4863,12 +4875,12 @@ const sn = () => jt().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4863
4875
|
t[s] = _n(n, i), zr(n, [i]).size === 1 && (t[`${s}_Lowercase`] = _n(n, i, !0));
|
|
4864
4876
|
});
|
|
4865
4877
|
}
|
|
4866
|
-
return
|
|
4878
|
+
return nh({
|
|
4867
4879
|
Collection_Path: Pn(mt()),
|
|
4868
4880
|
...t
|
|
4869
4881
|
});
|
|
4870
4882
|
}, $g = (r, e) => {
|
|
4871
|
-
let t = Ko(
|
|
4883
|
+
let t = Ko(sh(r, e));
|
|
4872
4884
|
return r.required || (t = t.optional()), t;
|
|
4873
4885
|
}, jg = (r) => {
|
|
4874
4886
|
let e = Pn(gn([mt().length(20), mt().length(28)]));
|
|
@@ -4936,9 +4948,9 @@ const sn = () => jt().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4936
4948
|
Created_By: gn([mt().length(28), lo("System")])
|
|
4937
4949
|
};
|
|
4938
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());
|
|
4939
|
-
const s =
|
|
4951
|
+
const s = Jd(e, e.fields), i = Array.from(s).map((c) => c.name);
|
|
4940
4952
|
e.fields.forEach((c) => {
|
|
4941
|
-
_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`] = sh(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, {
|
|
4942
4954
|
message: `Value must contain ${c.length} item(s)`
|
|
4943
4955
|
})), c.min && (n[c.name] = n[c.name].refine((l) => c.min && l && Object.keys(l).length >= c.min, {
|
|
4944
4956
|
message: `Value must contain at least ${c.min} item(s)`
|
|
@@ -4948,7 +4960,7 @@ const sn = () => jt().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4948
4960
|
}), zr(e, e.fields).forEach((c) => {
|
|
4949
4961
|
n[c.name] && (n[`${c.name}_Lowercase`] = _n(e, c, !0));
|
|
4950
4962
|
});
|
|
4951
|
-
const o =
|
|
4963
|
+
const o = nh(n);
|
|
4952
4964
|
return e.allowSchemalessFields ? o.passthrough() : o.strict();
|
|
4953
4965
|
};
|
|
4954
4966
|
class Zt extends Error {
|
|
@@ -4970,7 +4982,7 @@ class zg extends Zt {
|
|
|
4970
4982
|
}
|
|
4971
4983
|
class er extends Zt {
|
|
4972
4984
|
}
|
|
4973
|
-
class
|
|
4985
|
+
class ih extends Zt {
|
|
4974
4986
|
constructor(e) {
|
|
4975
4987
|
super(`Invalid unit ${e}`);
|
|
4976
4988
|
}
|
|
@@ -4986,7 +4998,7 @@ const q = "numeric", rt = "short", Le = "long", vn = {
|
|
|
4986
4998
|
year: q,
|
|
4987
4999
|
month: q,
|
|
4988
5000
|
day: q
|
|
4989
|
-
},
|
|
5001
|
+
}, ah = {
|
|
4990
5002
|
year: q,
|
|
4991
5003
|
month: rt,
|
|
4992
5004
|
day: q
|
|
@@ -4995,73 +5007,73 @@ const q = "numeric", rt = "short", Le = "long", vn = {
|
|
|
4995
5007
|
month: rt,
|
|
4996
5008
|
day: q,
|
|
4997
5009
|
weekday: rt
|
|
4998
|
-
},
|
|
5010
|
+
}, oh = {
|
|
4999
5011
|
year: q,
|
|
5000
5012
|
month: Le,
|
|
5001
5013
|
day: q
|
|
5002
|
-
},
|
|
5014
|
+
}, ch = {
|
|
5003
5015
|
year: q,
|
|
5004
5016
|
month: Le,
|
|
5005
5017
|
day: q,
|
|
5006
5018
|
weekday: Le
|
|
5007
|
-
},
|
|
5019
|
+
}, lh = {
|
|
5008
5020
|
hour: q,
|
|
5009
5021
|
minute: q
|
|
5010
|
-
},
|
|
5022
|
+
}, uh = {
|
|
5011
5023
|
hour: q,
|
|
5012
5024
|
minute: q,
|
|
5013
5025
|
second: q
|
|
5014
|
-
},
|
|
5026
|
+
}, fh = {
|
|
5015
5027
|
hour: q,
|
|
5016
5028
|
minute: q,
|
|
5017
5029
|
second: q,
|
|
5018
5030
|
timeZoneName: rt
|
|
5019
|
-
},
|
|
5031
|
+
}, dh = {
|
|
5020
5032
|
hour: q,
|
|
5021
5033
|
minute: q,
|
|
5022
5034
|
second: q,
|
|
5023
5035
|
timeZoneName: Le
|
|
5024
|
-
},
|
|
5036
|
+
}, hh = {
|
|
5025
5037
|
hour: q,
|
|
5026
5038
|
minute: q,
|
|
5027
5039
|
hourCycle: "h23"
|
|
5028
|
-
},
|
|
5040
|
+
}, mh = {
|
|
5029
5041
|
hour: q,
|
|
5030
5042
|
minute: q,
|
|
5031
5043
|
second: q,
|
|
5032
5044
|
hourCycle: "h23"
|
|
5033
|
-
},
|
|
5045
|
+
}, ph = {
|
|
5034
5046
|
hour: q,
|
|
5035
5047
|
minute: q,
|
|
5036
5048
|
second: q,
|
|
5037
5049
|
hourCycle: "h23",
|
|
5038
5050
|
timeZoneName: rt
|
|
5039
|
-
},
|
|
5051
|
+
}, yh = {
|
|
5040
5052
|
hour: q,
|
|
5041
5053
|
minute: q,
|
|
5042
5054
|
second: q,
|
|
5043
5055
|
hourCycle: "h23",
|
|
5044
5056
|
timeZoneName: Le
|
|
5045
|
-
},
|
|
5057
|
+
}, gh = {
|
|
5046
5058
|
year: q,
|
|
5047
5059
|
month: q,
|
|
5048
5060
|
day: q,
|
|
5049
5061
|
hour: q,
|
|
5050
5062
|
minute: q
|
|
5051
|
-
},
|
|
5063
|
+
}, _h = {
|
|
5052
5064
|
year: q,
|
|
5053
5065
|
month: q,
|
|
5054
5066
|
day: q,
|
|
5055
5067
|
hour: q,
|
|
5056
5068
|
minute: q,
|
|
5057
5069
|
second: q
|
|
5058
|
-
},
|
|
5070
|
+
}, vh = {
|
|
5059
5071
|
year: q,
|
|
5060
5072
|
month: rt,
|
|
5061
5073
|
day: q,
|
|
5062
5074
|
hour: q,
|
|
5063
5075
|
minute: q
|
|
5064
|
-
},
|
|
5076
|
+
}, wh = {
|
|
5065
5077
|
year: q,
|
|
5066
5078
|
month: rt,
|
|
5067
5079
|
day: q,
|
|
@@ -5075,14 +5087,14 @@ const q = "numeric", rt = "short", Le = "long", vn = {
|
|
|
5075
5087
|
weekday: rt,
|
|
5076
5088
|
hour: q,
|
|
5077
5089
|
minute: q
|
|
5078
|
-
},
|
|
5090
|
+
}, bh = {
|
|
5079
5091
|
year: q,
|
|
5080
5092
|
month: Le,
|
|
5081
5093
|
day: q,
|
|
5082
5094
|
hour: q,
|
|
5083
5095
|
minute: q,
|
|
5084
5096
|
timeZoneName: rt
|
|
5085
|
-
},
|
|
5097
|
+
}, Oh = {
|
|
5086
5098
|
year: q,
|
|
5087
5099
|
month: Le,
|
|
5088
5100
|
day: q,
|
|
@@ -5090,7 +5102,7 @@ const q = "numeric", rt = "short", Le = "long", vn = {
|
|
|
5090
5102
|
minute: q,
|
|
5091
5103
|
second: q,
|
|
5092
5104
|
timeZoneName: rt
|
|
5093
|
-
},
|
|
5105
|
+
}, Eh = {
|
|
5094
5106
|
year: q,
|
|
5095
5107
|
month: Le,
|
|
5096
5108
|
day: q,
|
|
@@ -5098,7 +5110,7 @@ const q = "numeric", rt = "short", Le = "long", vn = {
|
|
|
5098
5110
|
hour: q,
|
|
5099
5111
|
minute: q,
|
|
5100
5112
|
timeZoneName: Le
|
|
5101
|
-
},
|
|
5113
|
+
}, Sh = {
|
|
5102
5114
|
year: q,
|
|
5103
5115
|
month: Le,
|
|
5104
5116
|
day: q,
|
|
@@ -5215,7 +5227,7 @@ class qn extends Br {
|
|
|
5215
5227
|
}
|
|
5216
5228
|
/** @override **/
|
|
5217
5229
|
offsetName(e, { format: t, locale: n }) {
|
|
5218
|
-
return
|
|
5230
|
+
return Mh(e, t, n);
|
|
5219
5231
|
}
|
|
5220
5232
|
/** @override **/
|
|
5221
5233
|
formatOffset(e, t) {
|
|
@@ -5353,7 +5365,7 @@ class gt extends Br {
|
|
|
5353
5365
|
* @return {string}
|
|
5354
5366
|
*/
|
|
5355
5367
|
offsetName(e, { format: t, locale: n }) {
|
|
5356
|
-
return
|
|
5368
|
+
return Mh(e, t, n, this.name);
|
|
5357
5369
|
}
|
|
5358
5370
|
/**
|
|
5359
5371
|
* Returns the offset's value as a string
|
|
@@ -5439,7 +5451,7 @@ function e_() {
|
|
|
5439
5451
|
return Tr || (Tr = new Intl.DateTimeFormat().resolvedOptions().locale, Tr);
|
|
5440
5452
|
}
|
|
5441
5453
|
const go = /* @__PURE__ */ new Map();
|
|
5442
|
-
function
|
|
5454
|
+
function Th(r) {
|
|
5443
5455
|
let e = go.get(r);
|
|
5444
5456
|
return e === void 0 && (e = new Intl.DateTimeFormat(r).resolvedOptions(), go.set(r, e)), e;
|
|
5445
5457
|
}
|
|
@@ -5448,7 +5460,7 @@ function t_(r) {
|
|
|
5448
5460
|
let e = _o.get(r);
|
|
5449
5461
|
if (!e) {
|
|
5450
5462
|
const t = new Intl.Locale(r);
|
|
5451
|
-
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 = { ...Rh, ...e }), _o.set(r, e);
|
|
5452
5464
|
}
|
|
5453
5465
|
return e;
|
|
5454
5466
|
}
|
|
@@ -5494,7 +5506,7 @@ function Xr(r, e, t, n) {
|
|
|
5494
5506
|
return s === "error" ? null : s === "en" ? t(e) : n(e);
|
|
5495
5507
|
}
|
|
5496
5508
|
function a_(r) {
|
|
5497
|
-
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") || Th(r.locale).numberingSystem === "latn";
|
|
5498
5510
|
}
|
|
5499
5511
|
class o_ {
|
|
5500
5512
|
constructor(e, t, n) {
|
|
@@ -5553,7 +5565,7 @@ class c_ {
|
|
|
5553
5565
|
}
|
|
5554
5566
|
class l_ {
|
|
5555
5567
|
constructor(e, t, n) {
|
|
5556
|
-
this.opts = { style: "long", ...n }, !t &&
|
|
5568
|
+
this.opts = { style: "long", ...n }, !t && Fh() && (this.rtf = Xg(e, n));
|
|
5557
5569
|
}
|
|
5558
5570
|
format(e, t) {
|
|
5559
5571
|
return this.rtf ? this.rtf.format(e, t) : x_(t, e, this.opts.numeric, this.opts.style !== "long");
|
|
@@ -5562,7 +5574,7 @@ class l_ {
|
|
|
5562
5574
|
return this.rtf ? this.rtf.formatToParts(e, t) : [];
|
|
5563
5575
|
}
|
|
5564
5576
|
}
|
|
5565
|
-
const
|
|
5577
|
+
const Rh = {
|
|
5566
5578
|
firstDay: 1,
|
|
5567
5579
|
minimalDays: 4,
|
|
5568
5580
|
weekend: [6, 7]
|
|
@@ -5614,7 +5626,7 @@ class he {
|
|
|
5614
5626
|
return this.clone({ ...e, defaultToEN: !1 });
|
|
5615
5627
|
}
|
|
5616
5628
|
months(e, t = !1) {
|
|
5617
|
-
return Xr(this, e,
|
|
5629
|
+
return Xr(this, e, Lh, () => {
|
|
5618
5630
|
const n = this.intl === "ja" || this.intl.startsWith("ja-");
|
|
5619
5631
|
t &= !n;
|
|
5620
5632
|
const s = t ? { month: e, day: "numeric" } : { month: e }, i = t ? "format" : "standalone";
|
|
@@ -5626,7 +5638,7 @@ class he {
|
|
|
5626
5638
|
});
|
|
5627
5639
|
}
|
|
5628
5640
|
weekdays(e, t = !1) {
|
|
5629
|
-
return Xr(this, e,
|
|
5641
|
+
return Xr(this, e, Uh, () => {
|
|
5630
5642
|
const n = t ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, s = t ? "format" : "standalone";
|
|
5631
5643
|
return this.weekdaysCache[s][e] || (this.weekdaysCache[s][e] = i_(
|
|
5632
5644
|
(i) => this.extract(i, n, "weekday")
|
|
@@ -5637,7 +5649,7 @@ class he {
|
|
|
5637
5649
|
return Xr(
|
|
5638
5650
|
this,
|
|
5639
5651
|
void 0,
|
|
5640
|
-
() =>
|
|
5652
|
+
() => Vh,
|
|
5641
5653
|
() => {
|
|
5642
5654
|
if (!this.meridiemCache) {
|
|
5643
5655
|
const e = { hour: "numeric", hourCycle: "h12" };
|
|
@@ -5650,7 +5662,7 @@ class he {
|
|
|
5650
5662
|
);
|
|
5651
5663
|
}
|
|
5652
5664
|
eras(e) {
|
|
5653
|
-
return Xr(this, e,
|
|
5665
|
+
return Xr(this, e, Wh, () => {
|
|
5654
5666
|
const t = { era: e };
|
|
5655
5667
|
return this.eraCache[e] || (this.eraCache[e] = [z.utc(-40, 1, 1), z.utc(2017, 1, 1)].map(
|
|
5656
5668
|
(n) => this.extract(n, t, "era")
|
|
@@ -5674,10 +5686,10 @@ class he {
|
|
|
5674
5686
|
return Jg(this.intl, e);
|
|
5675
5687
|
}
|
|
5676
5688
|
isEnglish() {
|
|
5677
|
-
return this.locale === "en" || this.locale.toLowerCase() === "en-us" ||
|
|
5689
|
+
return this.locale === "en" || this.locale.toLowerCase() === "en-us" || Th(this.intl).locale.startsWith("en-us");
|
|
5678
5690
|
}
|
|
5679
5691
|
getWeekSettings() {
|
|
5680
|
-
return this.weekSettings ? this.weekSettings :
|
|
5692
|
+
return this.weekSettings ? this.weekSettings : Dh() ? t_(this.locale) : Rh;
|
|
5681
5693
|
}
|
|
5682
5694
|
getStartOfWeek() {
|
|
5683
5695
|
return this.getWeekSettings().firstDay;
|
|
@@ -6082,7 +6094,7 @@ class tt {
|
|
|
6082
6094
|
return this.explanation ? `${this.reason}: ${this.explanation}` : this.reason;
|
|
6083
6095
|
}
|
|
6084
6096
|
}
|
|
6085
|
-
const
|
|
6097
|
+
const Ah = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Ch = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
|
|
6086
6098
|
function Be(r, e) {
|
|
6087
6099
|
return new tt(
|
|
6088
6100
|
"unit out of range",
|
|
@@ -6095,18 +6107,18 @@ function Jo(r, e, t) {
|
|
|
6095
6107
|
const s = n.getUTCDay();
|
|
6096
6108
|
return s === 0 ? 7 : s;
|
|
6097
6109
|
}
|
|
6098
|
-
function
|
|
6099
|
-
return t + (Zr(r) ?
|
|
6110
|
+
function kh(r, e, t) {
|
|
6111
|
+
return t + (Zr(r) ? Ch : Ah)[e - 1];
|
|
6100
6112
|
}
|
|
6101
|
-
function
|
|
6102
|
-
const t = Zr(r) ?
|
|
6113
|
+
function Ih(r, e) {
|
|
6114
|
+
const t = Zr(r) ? Ch : Ah, n = t.findIndex((i) => i < e), s = e - t[n];
|
|
6103
6115
|
return { month: n + 1, day: s };
|
|
6104
6116
|
}
|
|
6105
6117
|
function Qo(r, e) {
|
|
6106
6118
|
return (r - e + 7) % 7 + 1;
|
|
6107
6119
|
}
|
|
6108
6120
|
function wn(r, e = 4, t = 1) {
|
|
6109
|
-
const { year: n, month: s, day: i } = r, a =
|
|
6121
|
+
const { year: n, month: s, day: i } = r, a = kh(n, s, i), o = Qo(Jo(n, s, i), t);
|
|
6110
6122
|
let c = Math.floor((a - o + 14 - e) / 7), l;
|
|
6111
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) };
|
|
6112
6124
|
}
|
|
@@ -6114,15 +6126,15 @@ function Af(r, e = 4, t = 1) {
|
|
|
6114
6126
|
const { weekYear: n, weekNumber: s, weekday: i } = r, a = Qo(Jo(n, 1, e), t), o = rr(n);
|
|
6115
6127
|
let c = s * 7 + i - a - 7 + e, l;
|
|
6116
6128
|
c < 1 ? (l = n - 1, c += rr(l)) : c > o ? (l = n + 1, c -= rr(n)) : l = n;
|
|
6117
|
-
const { month: u, day: f } =
|
|
6129
|
+
const { month: u, day: f } = Ih(l, c);
|
|
6118
6130
|
return { year: l, month: u, day: f, ...Un(r) };
|
|
6119
6131
|
}
|
|
6120
6132
|
function Oa(r) {
|
|
6121
|
-
const { year: e, month: t, day: n } = r, s =
|
|
6133
|
+
const { year: e, month: t, day: n } = r, s = kh(e, t, n);
|
|
6122
6134
|
return { year: e, ordinal: s, ...Un(r) };
|
|
6123
6135
|
}
|
|
6124
6136
|
function Cf(r) {
|
|
6125
|
-
const { year: e, ordinal: t } = r, { month: n, day: s } =
|
|
6137
|
+
const { year: e, ordinal: t } = r, { month: n, day: s } = Ih(e, t);
|
|
6126
6138
|
return { year: e, month: n, day: s, ...Un(r) };
|
|
6127
6139
|
}
|
|
6128
6140
|
function kf(r, e) {
|
|
@@ -6150,11 +6162,11 @@ function p_(r) {
|
|
|
6150
6162
|
const e = Ln(r.year), t = Ze(r.ordinal, 1, rr(r.year));
|
|
6151
6163
|
return e ? t ? !1 : Be("ordinal", r.ordinal) : Be("year", r.year);
|
|
6152
6164
|
}
|
|
6153
|
-
function
|
|
6165
|
+
function xh(r) {
|
|
6154
6166
|
const e = Ln(r.year), t = Ze(r.month, 1, 12), n = Ze(r.day, 1, bn(r.year, r.month));
|
|
6155
6167
|
return e ? t ? n ? !1 : Be("day", r.day) : Be("month", r.month) : Be("year", r.year);
|
|
6156
6168
|
}
|
|
6157
|
-
function
|
|
6169
|
+
function Nh(r) {
|
|
6158
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);
|
|
6159
6171
|
return i ? a ? o ? c ? !1 : Be("millisecond", s) : Be("second", n) : Be("minute", t) : Be("hour", e);
|
|
6160
6172
|
}
|
|
@@ -6173,14 +6185,14 @@ function y_(r) {
|
|
|
6173
6185
|
function g_(r) {
|
|
6174
6186
|
return Object.prototype.toString.call(r) === "[object Date]";
|
|
6175
6187
|
}
|
|
6176
|
-
function
|
|
6188
|
+
function Fh() {
|
|
6177
6189
|
try {
|
|
6178
6190
|
return typeof Intl < "u" && !!Intl.RelativeTimeFormat;
|
|
6179
6191
|
} catch {
|
|
6180
6192
|
return !1;
|
|
6181
6193
|
}
|
|
6182
6194
|
}
|
|
6183
|
-
function
|
|
6195
|
+
function Dh() {
|
|
6184
6196
|
try {
|
|
6185
6197
|
return typeof Intl < "u" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype);
|
|
6186
6198
|
} catch {
|
|
@@ -6290,7 +6302,7 @@ function $r(r, e = 4, t = 1) {
|
|
|
6290
6302
|
function bo(r) {
|
|
6291
6303
|
return r > 99 ? r : r > be.twoDigitCutoffYear ? 1900 + r : 2e3 + r;
|
|
6292
6304
|
}
|
|
6293
|
-
function
|
|
6305
|
+
function Mh(r, e, t, n = null) {
|
|
6294
6306
|
const s = new Date(r), i = {
|
|
6295
6307
|
hourCycle: "h23",
|
|
6296
6308
|
year: "numeric",
|
|
@@ -6309,7 +6321,7 @@ function jn(r, e) {
|
|
|
6309
6321
|
const n = parseInt(e, 10) || 0, s = t < 0 || Object.is(t, -0) ? -n : n;
|
|
6310
6322
|
return t * 60 + s;
|
|
6311
6323
|
}
|
|
6312
|
-
function
|
|
6324
|
+
function Ph(r) {
|
|
6313
6325
|
const e = Number(r);
|
|
6314
6326
|
if (typeof r == "boolean" || r === "" || !Number.isFinite(e))
|
|
6315
6327
|
throw new xe(`Invalid unit value ${r}`);
|
|
@@ -6321,7 +6333,7 @@ function On(r, e) {
|
|
|
6321
6333
|
if (ur(r, n)) {
|
|
6322
6334
|
const s = r[n];
|
|
6323
6335
|
if (s == null) continue;
|
|
6324
|
-
t[e(n)] =
|
|
6336
|
+
t[e(n)] = Ph(s);
|
|
6325
6337
|
}
|
|
6326
6338
|
return t;
|
|
6327
6339
|
}
|
|
@@ -6354,7 +6366,7 @@ const b_ = [
|
|
|
6354
6366
|
"October",
|
|
6355
6367
|
"November",
|
|
6356
6368
|
"December"
|
|
6357
|
-
],
|
|
6369
|
+
], qh = [
|
|
6358
6370
|
"Jan",
|
|
6359
6371
|
"Feb",
|
|
6360
6372
|
"Mar",
|
|
@@ -6368,12 +6380,12 @@ const b_ = [
|
|
|
6368
6380
|
"Nov",
|
|
6369
6381
|
"Dec"
|
|
6370
6382
|
], O_ = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
|
|
6371
|
-
function
|
|
6383
|
+
function Lh(r) {
|
|
6372
6384
|
switch (r) {
|
|
6373
6385
|
case "narrow":
|
|
6374
6386
|
return [...O_];
|
|
6375
6387
|
case "short":
|
|
6376
|
-
return [...
|
|
6388
|
+
return [...qh];
|
|
6377
6389
|
case "long":
|
|
6378
6390
|
return [...b_];
|
|
6379
6391
|
case "numeric":
|
|
@@ -6384,7 +6396,7 @@ function qh(r) {
|
|
|
6384
6396
|
return null;
|
|
6385
6397
|
}
|
|
6386
6398
|
}
|
|
6387
|
-
const
|
|
6399
|
+
const $h = [
|
|
6388
6400
|
"Monday",
|
|
6389
6401
|
"Tuesday",
|
|
6390
6402
|
"Wednesday",
|
|
@@ -6392,23 +6404,23 @@ const Lh = [
|
|
|
6392
6404
|
"Friday",
|
|
6393
6405
|
"Saturday",
|
|
6394
6406
|
"Sunday"
|
|
6395
|
-
],
|
|
6396
|
-
function
|
|
6407
|
+
], jh = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], E_ = ["M", "T", "W", "T", "F", "S", "S"];
|
|
6408
|
+
function Uh(r) {
|
|
6397
6409
|
switch (r) {
|
|
6398
6410
|
case "narrow":
|
|
6399
6411
|
return [...E_];
|
|
6400
6412
|
case "short":
|
|
6401
|
-
return [
|
|
6413
|
+
return [...jh];
|
|
6402
6414
|
case "long":
|
|
6403
|
-
return [
|
|
6415
|
+
return [...$h];
|
|
6404
6416
|
case "numeric":
|
|
6405
6417
|
return ["1", "2", "3", "4", "5", "6", "7"];
|
|
6406
6418
|
default:
|
|
6407
6419
|
return null;
|
|
6408
6420
|
}
|
|
6409
6421
|
}
|
|
6410
|
-
const
|
|
6411
|
-
function
|
|
6422
|
+
const Vh = ["AM", "PM"], S_ = ["Before Christ", "Anno Domini"], T_ = ["BC", "AD"], R_ = ["B", "A"];
|
|
6423
|
+
function Wh(r) {
|
|
6412
6424
|
switch (r) {
|
|
6413
6425
|
case "narrow":
|
|
6414
6426
|
return [...R_];
|
|
@@ -6421,16 +6433,16 @@ function Vh(r) {
|
|
|
6421
6433
|
}
|
|
6422
6434
|
}
|
|
6423
6435
|
function A_(r) {
|
|
6424
|
-
return
|
|
6436
|
+
return Vh[r.hour < 12 ? 0 : 1];
|
|
6425
6437
|
}
|
|
6426
6438
|
function C_(r, e) {
|
|
6427
|
-
return
|
|
6439
|
+
return Uh(e)[r.weekday - 1];
|
|
6428
6440
|
}
|
|
6429
6441
|
function k_(r, e) {
|
|
6430
|
-
return
|
|
6442
|
+
return Lh(e)[r.month - 1];
|
|
6431
6443
|
}
|
|
6432
6444
|
function I_(r, e) {
|
|
6433
|
-
return
|
|
6445
|
+
return Wh(e)[r.year < 0 ? 0 : 1];
|
|
6434
6446
|
}
|
|
6435
6447
|
function x_(r, e, t = "always", n = !1) {
|
|
6436
6448
|
const s = {
|
|
@@ -6465,25 +6477,25 @@ function Nf(r, e) {
|
|
|
6465
6477
|
}
|
|
6466
6478
|
const N_ = {
|
|
6467
6479
|
D: vn,
|
|
6468
|
-
DD:
|
|
6469
|
-
DDD:
|
|
6470
|
-
DDDD:
|
|
6471
|
-
t:
|
|
6472
|
-
tt:
|
|
6473
|
-
ttt:
|
|
6474
|
-
tttt:
|
|
6475
|
-
T:
|
|
6476
|
-
TT:
|
|
6477
|
-
TTT:
|
|
6478
|
-
TTTT:
|
|
6479
|
-
f:
|
|
6480
|
-
ff:
|
|
6481
|
-
fff:
|
|
6482
|
-
ffff:
|
|
6483
|
-
F:
|
|
6484
|
-
FF:
|
|
6485
|
-
FFF:
|
|
6486
|
-
FFFF:
|
|
6480
|
+
DD: ah,
|
|
6481
|
+
DDD: oh,
|
|
6482
|
+
DDDD: ch,
|
|
6483
|
+
t: lh,
|
|
6484
|
+
tt: uh,
|
|
6485
|
+
ttt: fh,
|
|
6486
|
+
tttt: dh,
|
|
6487
|
+
T: hh,
|
|
6488
|
+
TT: mh,
|
|
6489
|
+
TTT: ph,
|
|
6490
|
+
TTTT: yh,
|
|
6491
|
+
f: gh,
|
|
6492
|
+
ff: vh,
|
|
6493
|
+
fff: bh,
|
|
6494
|
+
ffff: Eh,
|
|
6495
|
+
F: _h,
|
|
6496
|
+
FF: wh,
|
|
6497
|
+
FFF: Oh,
|
|
6498
|
+
FFFF: Sh
|
|
6487
6499
|
};
|
|
6488
6500
|
class Ne {
|
|
6489
6501
|
static create(e, t = {}) {
|
|
@@ -6725,7 +6737,7 @@ class Ne {
|
|
|
6725
6737
|
return Nf(a, i(c, l));
|
|
6726
6738
|
}
|
|
6727
6739
|
}
|
|
6728
|
-
const
|
|
6740
|
+
const zh = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
|
|
6729
6741
|
function mr(...r) {
|
|
6730
6742
|
const e = r.reduce((t, n) => t + n.source, "");
|
|
6731
6743
|
return RegExp(`^${e}$`);
|
|
@@ -6749,7 +6761,7 @@ function yr(r, ...e) {
|
|
|
6749
6761
|
}
|
|
6750
6762
|
return [null, null];
|
|
6751
6763
|
}
|
|
6752
|
-
function
|
|
6764
|
+
function Bh(...r) {
|
|
6753
6765
|
return (e, t) => {
|
|
6754
6766
|
const n = {};
|
|
6755
6767
|
let s;
|
|
@@ -6758,9 +6770,9 @@ function zh(...r) {
|
|
|
6758
6770
|
return [n, null, t + s];
|
|
6759
6771
|
};
|
|
6760
6772
|
}
|
|
6761
|
-
const
|
|
6762
|
-
`${tc.source} ?(?:${
|
|
6763
|
-
), j_ = RegExp(`(?: ${
|
|
6773
|
+
const Zh = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, F_ = `(?:${Zh.source}?(?:\\[(${zh.source})\\])?)?`, tc = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, Gh = RegExp(`${tc.source}${F_}`), rc = RegExp(`(?:[Tt]${Gh.source})?`), D_ = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, M_ = /(\d{4})-?W(\d\d)(?:-?(\d))?/, P_ = /(\d{4})-?(\d{3})/, q_ = Bh("weekYear", "weekNumber", "weekDay"), L_ = Bh("year", "ordinal"), $_ = /(\d{4})-(\d\d)-(\d\d)/, Hh = RegExp(
|
|
6774
|
+
`${tc.source} ?(?:${Zh.source}|(${zh.source}))?`
|
|
6775
|
+
), j_ = RegExp(`(?: ${Hh.source})?`);
|
|
6764
6776
|
function nr(r, e, t) {
|
|
6765
6777
|
const n = r[e];
|
|
6766
6778
|
return J(n) ? t : At(n);
|
|
@@ -6818,12 +6830,12 @@ const B_ = {
|
|
|
6818
6830
|
function nc(r, e, t, n, s, i, a) {
|
|
6819
6831
|
const o = {
|
|
6820
6832
|
year: e.length === 2 ? bo(At(e)) : At(e),
|
|
6821
|
-
month:
|
|
6833
|
+
month: qh.indexOf(t) + 1,
|
|
6822
6834
|
day: At(n),
|
|
6823
6835
|
hour: At(s),
|
|
6824
6836
|
minute: At(i)
|
|
6825
6837
|
};
|
|
6826
|
-
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 ? $h.indexOf(r) + 1 : jh.indexOf(r) + 1), o;
|
|
6827
6839
|
}
|
|
6828
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)))$/;
|
|
6829
6841
|
function G_(r) {
|
|
@@ -6856,7 +6868,7 @@ function Q_(r) {
|
|
|
6856
6868
|
const [, e, t, n, s, i, a, o] = r;
|
|
6857
6869
|
return [nc(e, o, t, n, s, i, a), Me.utcInstance];
|
|
6858
6870
|
}
|
|
6859
|
-
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(Gh), Kh = pr(
|
|
6860
6872
|
U_,
|
|
6861
6873
|
gr,
|
|
6862
6874
|
Gr,
|
|
@@ -6879,7 +6891,7 @@ const X_ = mr(D_, rc), ev = mr(M_, rc), tv = mr(P_, rc), rv = mr(Zh), Hh = pr(
|
|
|
6879
6891
|
function av(r) {
|
|
6880
6892
|
return yr(
|
|
6881
6893
|
r,
|
|
6882
|
-
[X_,
|
|
6894
|
+
[X_, Kh],
|
|
6883
6895
|
[ev, nv],
|
|
6884
6896
|
[tv, sv],
|
|
6885
6897
|
[rv, iv]
|
|
@@ -6903,7 +6915,7 @@ const uv = pr(gr);
|
|
|
6903
6915
|
function fv(r) {
|
|
6904
6916
|
return yr(r, [V_, uv]);
|
|
6905
6917
|
}
|
|
6906
|
-
const dv = mr($_, j_), hv = mr(
|
|
6918
|
+
const dv = mr($_, j_), hv = mr(Hh), mv = pr(
|
|
6907
6919
|
gr,
|
|
6908
6920
|
Gr,
|
|
6909
6921
|
Hr
|
|
@@ -6911,11 +6923,11 @@ const dv = mr($_, j_), hv = mr(Gh), mv = pr(
|
|
|
6911
6923
|
function pv(r) {
|
|
6912
6924
|
return yr(
|
|
6913
6925
|
r,
|
|
6914
|
-
[dv,
|
|
6926
|
+
[dv, Kh],
|
|
6915
6927
|
[hv, mv]
|
|
6916
6928
|
);
|
|
6917
6929
|
}
|
|
6918
|
-
const Df = "Invalid Duration",
|
|
6930
|
+
const Df = "Invalid Duration", Yh = {
|
|
6919
6931
|
weeks: {
|
|
6920
6932
|
days: 7,
|
|
6921
6933
|
hours: 168,
|
|
@@ -6960,7 +6972,7 @@ const Df = "Invalid Duration", Kh = {
|
|
|
6960
6972
|
seconds: 720 * 60 * 60,
|
|
6961
6973
|
milliseconds: 720 * 60 * 60 * 1e3
|
|
6962
6974
|
},
|
|
6963
|
-
...
|
|
6975
|
+
...Yh
|
|
6964
6976
|
}, We = 146097 / 400, Kt = 146097 / 4800, gv = {
|
|
6965
6977
|
years: {
|
|
6966
6978
|
quarters: 4,
|
|
@@ -6989,7 +7001,7 @@ const Df = "Invalid Duration", Kh = {
|
|
|
6989
7001
|
seconds: Kt * 24 * 60 * 60,
|
|
6990
7002
|
milliseconds: Kt * 24 * 60 * 60 * 1e3
|
|
6991
7003
|
},
|
|
6992
|
-
...
|
|
7004
|
+
...Yh
|
|
6993
7005
|
}, Ut = [
|
|
6994
7006
|
"years",
|
|
6995
7007
|
"quarters",
|
|
@@ -7010,14 +7022,14 @@ function ut(r, e, t = !1) {
|
|
|
7010
7022
|
};
|
|
7011
7023
|
return new le(n);
|
|
7012
7024
|
}
|
|
7013
|
-
function
|
|
7025
|
+
function Jh(r, e) {
|
|
7014
7026
|
let t = e.milliseconds ?? 0;
|
|
7015
7027
|
for (const n of _v.slice(1))
|
|
7016
7028
|
e[n] && (t += e[n] * r[n].milliseconds);
|
|
7017
7029
|
return t;
|
|
7018
7030
|
}
|
|
7019
7031
|
function Mf(r, e) {
|
|
7020
|
-
const t =
|
|
7032
|
+
const t = Jh(r, e) < 0 ? -1 : 1;
|
|
7021
7033
|
Ut.reduceRight((n, s) => {
|
|
7022
7034
|
if (J(e[s]))
|
|
7023
7035
|
return n;
|
|
@@ -7192,7 +7204,7 @@ class le {
|
|
|
7192
7204
|
millisecond: "milliseconds",
|
|
7193
7205
|
milliseconds: "milliseconds"
|
|
7194
7206
|
}[e && e.toLowerCase()];
|
|
7195
|
-
if (!t) throw new
|
|
7207
|
+
if (!t) throw new ih(e);
|
|
7196
7208
|
return t;
|
|
7197
7209
|
}
|
|
7198
7210
|
/**
|
|
@@ -7352,7 +7364,7 @@ class le {
|
|
|
7352
7364
|
* @return {number}
|
|
7353
7365
|
*/
|
|
7354
7366
|
toMillis() {
|
|
7355
|
-
return this.isValid ?
|
|
7367
|
+
return this.isValid ? Jh(this.matrix, this.values) : NaN;
|
|
7356
7368
|
}
|
|
7357
7369
|
/**
|
|
7358
7370
|
* Returns an milliseconds value of this Duration. Alias of {@link toMillis}
|
|
@@ -7394,7 +7406,7 @@ class le {
|
|
|
7394
7406
|
if (!this.isValid) return this;
|
|
7395
7407
|
const t = {};
|
|
7396
7408
|
for (const n of Object.keys(this.values))
|
|
7397
|
-
t[n] =
|
|
7409
|
+
t[n] = Ph(e(this.values[n], n));
|
|
7398
7410
|
return ut(this, { values: t }, !0);
|
|
7399
7411
|
}
|
|
7400
7412
|
/**
|
|
@@ -8273,7 +8285,7 @@ class en {
|
|
|
8273
8285
|
* @return {Object}
|
|
8274
8286
|
*/
|
|
8275
8287
|
static features() {
|
|
8276
|
-
return { relative:
|
|
8288
|
+
return { relative: Fh(), localeWeek: Dh() };
|
|
8277
8289
|
}
|
|
8278
8290
|
}
|
|
8279
8291
|
function qf(r, e) {
|
|
@@ -8312,12 +8324,12 @@ const Ov = "missing Intl.DateTimeFormat.formatToParts support";
|
|
|
8312
8324
|
function fe(r, e = (t) => t) {
|
|
8313
8325
|
return { regex: r, deser: ([t]) => e(d_(t)) };
|
|
8314
8326
|
}
|
|
8315
|
-
const Ev = " ",
|
|
8327
|
+
const Ev = " ", Qh = `[ ${Ev}]`, Xh = new RegExp(Qh, "g");
|
|
8316
8328
|
function Sv(r) {
|
|
8317
|
-
return r.replace(/\./g, "\\.?").replace(
|
|
8329
|
+
return r.replace(/\./g, "\\.?").replace(Xh, Qh);
|
|
8318
8330
|
}
|
|
8319
8331
|
function Lf(r) {
|
|
8320
|
-
return r.replace(/\./g, "").replace(
|
|
8332
|
+
return r.replace(/\./g, "").replace(Xh, " ").toLowerCase();
|
|
8321
8333
|
}
|
|
8322
8334
|
function Xe(r, e) {
|
|
8323
8335
|
return r === null ? null : {
|
|
@@ -8585,15 +8597,15 @@ function Nv() {
|
|
|
8585
8597
|
function Fv(r, e) {
|
|
8586
8598
|
if (r.literal)
|
|
8587
8599
|
return r;
|
|
8588
|
-
const t = Ne.macroTokenToFormatOpts(r.val), n =
|
|
8600
|
+
const t = Ne.macroTokenToFormatOpts(r.val), n = nm(t, e);
|
|
8589
8601
|
return n == null || n.includes(void 0) ? r : n;
|
|
8590
8602
|
}
|
|
8591
|
-
function
|
|
8603
|
+
function em(r, e) {
|
|
8592
8604
|
return Array.prototype.concat(...r.map((t) => Fv(t, e)));
|
|
8593
8605
|
}
|
|
8594
|
-
class
|
|
8606
|
+
class tm {
|
|
8595
8607
|
constructor(e, t) {
|
|
8596
|
-
if (this.locale = e, this.format = t, this.tokens =
|
|
8608
|
+
if (this.locale = e, this.format = t, this.tokens = em(Ne.parseFormat(t), e), this.units = this.tokens.map((n) => Rv(n, e)), this.disqualifyingUnit = this.units.find((n) => n.invalidReason), !this.disqualifyingUnit) {
|
|
8597
8609
|
const [n, s] = kv(this.units);
|
|
8598
8610
|
this.regex = RegExp(n, "i"), this.handlers = s;
|
|
8599
8611
|
}
|
|
@@ -8625,14 +8637,14 @@ class em {
|
|
|
8625
8637
|
return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;
|
|
8626
8638
|
}
|
|
8627
8639
|
}
|
|
8628
|
-
function
|
|
8629
|
-
return new
|
|
8640
|
+
function rm(r, e, t) {
|
|
8641
|
+
return new tm(r, t).explainFromTokens(e);
|
|
8630
8642
|
}
|
|
8631
8643
|
function Dv(r, e, t) {
|
|
8632
|
-
const { result: n, zone: s, specificOffset: i, invalidReason: a } =
|
|
8644
|
+
const { result: n, zone: s, specificOffset: i, invalidReason: a } = rm(r, e, t);
|
|
8633
8645
|
return [n, s, i, a];
|
|
8634
8646
|
}
|
|
8635
|
-
function
|
|
8647
|
+
function nm(r, e) {
|
|
8636
8648
|
if (!r)
|
|
8637
8649
|
return null;
|
|
8638
8650
|
const n = Ne.create(e, r).dtFormatter(Nv()), s = n.formatToParts(), i = n.resolvedOptions();
|
|
@@ -8663,7 +8675,7 @@ function qt(r, e) {
|
|
|
8663
8675
|
};
|
|
8664
8676
|
return new z({ ...t, ...e, old: t });
|
|
8665
8677
|
}
|
|
8666
|
-
function
|
|
8678
|
+
function sm(r, e, t) {
|
|
8667
8679
|
let n = r - e * 60 * 1e3;
|
|
8668
8680
|
const s = t.offset(n);
|
|
8669
8681
|
if (e === s)
|
|
@@ -8686,7 +8698,7 @@ function rn(r, e) {
|
|
|
8686
8698
|
};
|
|
8687
8699
|
}
|
|
8688
8700
|
function an(r, e, t) {
|
|
8689
|
-
return
|
|
8701
|
+
return sm($n(r), e, t);
|
|
8690
8702
|
}
|
|
8691
8703
|
function Uf(r, e) {
|
|
8692
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 = {
|
|
@@ -8705,7 +8717,7 @@ function Uf(r, e) {
|
|
|
8705
8717
|
seconds: e.seconds,
|
|
8706
8718
|
milliseconds: e.milliseconds
|
|
8707
8719
|
}).as("milliseconds"), o = $n(i);
|
|
8708
|
-
let [c, l] =
|
|
8720
|
+
let [c, l] = sm(o, t, r.zone);
|
|
8709
8721
|
return a !== 0 && (c += a, l = r.zone.offset(c)), { ts: c, o: l };
|
|
8710
8722
|
}
|
|
8711
8723
|
function Jt(r, e, t, n, s, i) {
|
|
@@ -8759,7 +8771,7 @@ function Vf(r, e, t, n, s, i, a) {
|
|
|
8759
8771
|
}
|
|
8760
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;
|
|
8761
8773
|
}
|
|
8762
|
-
const
|
|
8774
|
+
const im = {
|
|
8763
8775
|
month: 1,
|
|
8764
8776
|
day: 1,
|
|
8765
8777
|
hour: 0,
|
|
@@ -8815,7 +8827,7 @@ function cn(r) {
|
|
|
8815
8827
|
weekyears: "weekYear",
|
|
8816
8828
|
ordinal: "ordinal"
|
|
8817
8829
|
}[r.toLowerCase()];
|
|
8818
|
-
if (!e) throw new
|
|
8830
|
+
if (!e) throw new ih(r);
|
|
8819
8831
|
return e;
|
|
8820
8832
|
}
|
|
8821
8833
|
function Wf(r) {
|
|
@@ -8850,8 +8862,8 @@ function zf(r, e) {
|
|
|
8850
8862
|
s = be.now();
|
|
8851
8863
|
else {
|
|
8852
8864
|
for (const c of on)
|
|
8853
|
-
J(r[c]) && (r[c] =
|
|
8854
|
-
const a =
|
|
8865
|
+
J(r[c]) && (r[c] = im[c]);
|
|
8866
|
+
const a = xh(r) || Nh(r);
|
|
8855
8867
|
if (a)
|
|
8856
8868
|
return z.invalid(a);
|
|
8857
8869
|
const o = $v(t);
|
|
@@ -9066,13 +9078,13 @@ class z {
|
|
|
9066
9078
|
throw new er("Can't mix ordinal dates with month/day");
|
|
9067
9079
|
const v = p || i.weekday && !h;
|
|
9068
9080
|
let _, O, R = rn(c, l);
|
|
9069
|
-
v ? (_ = qv, O = Mv, R = wn(R, a, o)) : u ? (_ = Lv, O = Pv, R = Oa(R)) : (_ = on, O =
|
|
9081
|
+
v ? (_ = qv, O = Mv, R = wn(R, a, o)) : u ? (_ = Lv, O = Pv, R = Oa(R)) : (_ = on, O = im);
|
|
9070
9082
|
let C = !1;
|
|
9071
9083
|
for (const g of _) {
|
|
9072
9084
|
const A = i[g];
|
|
9073
9085
|
J(A) ? C ? i[g] = O[g] : i[g] = R[g] : C = !0;
|
|
9074
9086
|
}
|
|
9075
|
-
const w = v ? m_(i, a, o) : u ? p_(i) :
|
|
9087
|
+
const w = v ? m_(i, a, o) : u ? p_(i) : xh(i), E = w || Nh(i);
|
|
9076
9088
|
if (E)
|
|
9077
9089
|
return z.invalid(E);
|
|
9078
9090
|
const I = v ? Af(i, a, o) : u ? Cf(i) : i, [T, y] = an(I, l, n), N = new z({
|
|
@@ -9230,7 +9242,7 @@ class z {
|
|
|
9230
9242
|
* @returns {string}
|
|
9231
9243
|
*/
|
|
9232
9244
|
static parseFormatForOpts(e, t = {}) {
|
|
9233
|
-
const n =
|
|
9245
|
+
const n = nm(e, he.fromObject(t));
|
|
9234
9246
|
return n ? n.map((s) => s ? s.val : null).join("") : null;
|
|
9235
9247
|
}
|
|
9236
9248
|
/**
|
|
@@ -9241,7 +9253,7 @@ class z {
|
|
|
9241
9253
|
* @returns {string}
|
|
9242
9254
|
*/
|
|
9243
9255
|
static expandFormat(e, t = {}) {
|
|
9244
|
-
return
|
|
9256
|
+
return em(Ne.parseFormat(e), he.fromObject(t)).map((s) => s.val).join("");
|
|
9245
9257
|
}
|
|
9246
9258
|
static resetCache() {
|
|
9247
9259
|
Ar = void 0, Oo.clear();
|
|
@@ -10234,7 +10246,7 @@ class z {
|
|
|
10234
10246
|
numberingSystem: i,
|
|
10235
10247
|
defaultToEN: !0
|
|
10236
10248
|
});
|
|
10237
|
-
return
|
|
10249
|
+
return rm(a, e, t);
|
|
10238
10250
|
}
|
|
10239
10251
|
/**
|
|
10240
10252
|
* @deprecated use fromFormatExplain instead
|
|
@@ -10260,7 +10272,7 @@ class z {
|
|
|
10260
10272
|
numberingSystem: s,
|
|
10261
10273
|
defaultToEN: !0
|
|
10262
10274
|
});
|
|
10263
|
-
return new
|
|
10275
|
+
return new tm(i, e);
|
|
10264
10276
|
}
|
|
10265
10277
|
/**
|
|
10266
10278
|
* Create a DateTime from an input string and format parser.
|
|
@@ -10309,7 +10321,7 @@ class z {
|
|
|
10309
10321
|
* @type {Object}
|
|
10310
10322
|
*/
|
|
10311
10323
|
static get DATE_MED() {
|
|
10312
|
-
return
|
|
10324
|
+
return ah;
|
|
10313
10325
|
}
|
|
10314
10326
|
/**
|
|
10315
10327
|
* {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'
|
|
@@ -10323,98 +10335,98 @@ class z {
|
|
|
10323
10335
|
* @type {Object}
|
|
10324
10336
|
*/
|
|
10325
10337
|
static get DATE_FULL() {
|
|
10326
|
-
return
|
|
10338
|
+
return oh;
|
|
10327
10339
|
}
|
|
10328
10340
|
/**
|
|
10329
10341
|
* {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'
|
|
10330
10342
|
* @type {Object}
|
|
10331
10343
|
*/
|
|
10332
10344
|
static get DATE_HUGE() {
|
|
10333
|
-
return
|
|
10345
|
+
return ch;
|
|
10334
10346
|
}
|
|
10335
10347
|
/**
|
|
10336
10348
|
* {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.
|
|
10337
10349
|
* @type {Object}
|
|
10338
10350
|
*/
|
|
10339
10351
|
static get TIME_SIMPLE() {
|
|
10340
|
-
return
|
|
10352
|
+
return lh;
|
|
10341
10353
|
}
|
|
10342
10354
|
/**
|
|
10343
10355
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.
|
|
10344
10356
|
* @type {Object}
|
|
10345
10357
|
*/
|
|
10346
10358
|
static get TIME_WITH_SECONDS() {
|
|
10347
|
-
return
|
|
10359
|
+
return uh;
|
|
10348
10360
|
}
|
|
10349
10361
|
/**
|
|
10350
10362
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.
|
|
10351
10363
|
* @type {Object}
|
|
10352
10364
|
*/
|
|
10353
10365
|
static get TIME_WITH_SHORT_OFFSET() {
|
|
10354
|
-
return
|
|
10366
|
+
return fh;
|
|
10355
10367
|
}
|
|
10356
10368
|
/**
|
|
10357
10369
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
10358
10370
|
* @type {Object}
|
|
10359
10371
|
*/
|
|
10360
10372
|
static get TIME_WITH_LONG_OFFSET() {
|
|
10361
|
-
return
|
|
10373
|
+
return dh;
|
|
10362
10374
|
}
|
|
10363
10375
|
/**
|
|
10364
10376
|
* {@link DateTime#toLocaleString} format like '09:30', always 24-hour.
|
|
10365
10377
|
* @type {Object}
|
|
10366
10378
|
*/
|
|
10367
10379
|
static get TIME_24_SIMPLE() {
|
|
10368
|
-
return
|
|
10380
|
+
return hh;
|
|
10369
10381
|
}
|
|
10370
10382
|
/**
|
|
10371
10383
|
* {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.
|
|
10372
10384
|
* @type {Object}
|
|
10373
10385
|
*/
|
|
10374
10386
|
static get TIME_24_WITH_SECONDS() {
|
|
10375
|
-
return
|
|
10387
|
+
return mh;
|
|
10376
10388
|
}
|
|
10377
10389
|
/**
|
|
10378
10390
|
* {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.
|
|
10379
10391
|
* @type {Object}
|
|
10380
10392
|
*/
|
|
10381
10393
|
static get TIME_24_WITH_SHORT_OFFSET() {
|
|
10382
|
-
return
|
|
10394
|
+
return ph;
|
|
10383
10395
|
}
|
|
10384
10396
|
/**
|
|
10385
10397
|
* {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.
|
|
10386
10398
|
* @type {Object}
|
|
10387
10399
|
*/
|
|
10388
10400
|
static get TIME_24_WITH_LONG_OFFSET() {
|
|
10389
|
-
return
|
|
10401
|
+
return yh;
|
|
10390
10402
|
}
|
|
10391
10403
|
/**
|
|
10392
10404
|
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
10393
10405
|
* @type {Object}
|
|
10394
10406
|
*/
|
|
10395
10407
|
static get DATETIME_SHORT() {
|
|
10396
|
-
return
|
|
10408
|
+
return gh;
|
|
10397
10409
|
}
|
|
10398
10410
|
/**
|
|
10399
10411
|
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
10400
10412
|
* @type {Object}
|
|
10401
10413
|
*/
|
|
10402
10414
|
static get DATETIME_SHORT_WITH_SECONDS() {
|
|
10403
|
-
return
|
|
10415
|
+
return _h;
|
|
10404
10416
|
}
|
|
10405
10417
|
/**
|
|
10406
10418
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
10407
10419
|
* @type {Object}
|
|
10408
10420
|
*/
|
|
10409
10421
|
static get DATETIME_MED() {
|
|
10410
|
-
return
|
|
10422
|
+
return vh;
|
|
10411
10423
|
}
|
|
10412
10424
|
/**
|
|
10413
10425
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
10414
10426
|
* @type {Object}
|
|
10415
10427
|
*/
|
|
10416
10428
|
static get DATETIME_MED_WITH_SECONDS() {
|
|
10417
|
-
return
|
|
10429
|
+
return wh;
|
|
10418
10430
|
}
|
|
10419
10431
|
/**
|
|
10420
10432
|
* {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
@@ -10428,28 +10440,28 @@ class z {
|
|
|
10428
10440
|
* @type {Object}
|
|
10429
10441
|
*/
|
|
10430
10442
|
static get DATETIME_FULL() {
|
|
10431
|
-
return
|
|
10443
|
+
return bh;
|
|
10432
10444
|
}
|
|
10433
10445
|
/**
|
|
10434
10446
|
* {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.
|
|
10435
10447
|
* @type {Object}
|
|
10436
10448
|
*/
|
|
10437
10449
|
static get DATETIME_FULL_WITH_SECONDS() {
|
|
10438
|
-
return
|
|
10450
|
+
return Oh;
|
|
10439
10451
|
}
|
|
10440
10452
|
/**
|
|
10441
10453
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
10442
10454
|
* @type {Object}
|
|
10443
10455
|
*/
|
|
10444
10456
|
static get DATETIME_HUGE() {
|
|
10445
|
-
return
|
|
10457
|
+
return Eh;
|
|
10446
10458
|
}
|
|
10447
10459
|
/**
|
|
10448
10460
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
10449
10461
|
* @type {Object}
|
|
10450
10462
|
*/
|
|
10451
10463
|
static get DATETIME_HUGE_WITH_SECONDS() {
|
|
10452
|
-
return
|
|
10464
|
+
return Sh;
|
|
10453
10465
|
}
|
|
10454
10466
|
}
|
|
10455
10467
|
function vr(r) {
|
|
@@ -10469,7 +10481,7 @@ const Gf = async (r, e) => {
|
|
|
10469
10481
|
if (!t.valid)
|
|
10470
10482
|
throw new Error(`VALIDATION_ERROR: ${t.message}`);
|
|
10471
10483
|
}
|
|
10472
|
-
},
|
|
10484
|
+
}, am = async (r, e, t, n, s, i) => {
|
|
10473
10485
|
await Gf(n.custom?.preValidate, s);
|
|
10474
10486
|
for (const o of n.fields)
|
|
10475
10487
|
await Gf(o.custom?.preValidate, s);
|
|
@@ -10482,7 +10494,7 @@ const Gf = async (r, e) => {
|
|
|
10482
10494
|
Collection_Path: t
|
|
10483
10495
|
});
|
|
10484
10496
|
}), E.forEach((y) => {
|
|
10485
|
-
if (
|
|
10497
|
+
if (ag(y, a, i)) {
|
|
10486
10498
|
const N = lg(y, a, i), g = {};
|
|
10487
10499
|
s[y.name] !== void 0 && (g[y.name] = s[y.name], _e(y) && (g[`${y.name}_Array`] = s[`${y.name}_Array`])), N.forEach((A) => {
|
|
10488
10500
|
s[A.name] !== void 0 && (_e(A) ? g[`${A.name}_Array`] = s[`${A.name}_Array`] : g[A.name] = s[A.name]);
|
|
@@ -10550,7 +10562,7 @@ function Wv() {
|
|
|
10550
10562
|
return xa = t, xa;
|
|
10551
10563
|
}
|
|
10552
10564
|
var Na, Qf;
|
|
10553
|
-
function
|
|
10565
|
+
function om() {
|
|
10554
10566
|
if (Qf) return Na;
|
|
10555
10567
|
Qf = 1;
|
|
10556
10568
|
var r = Nd(), e = Wo(), t = Do(), n = Dd(), s = Object.getOwnPropertySymbols, i = s ? function(a) {
|
|
@@ -10564,7 +10576,7 @@ var Fa, Xf;
|
|
|
10564
10576
|
function zv() {
|
|
10565
10577
|
if (Xf) return Fa;
|
|
10566
10578
|
Xf = 1;
|
|
10567
|
-
var r = Vr(), e =
|
|
10579
|
+
var r = Vr(), e = om();
|
|
10568
10580
|
function t(n, s) {
|
|
10569
10581
|
return r(n, e(n), s);
|
|
10570
10582
|
}
|
|
@@ -10574,7 +10586,7 @@ var Da, ed;
|
|
|
10574
10586
|
function Bv() {
|
|
10575
10587
|
if (ed) return Da;
|
|
10576
10588
|
ed = 1;
|
|
10577
|
-
var r = Fd(), e =
|
|
10589
|
+
var r = Fd(), e = om(), t = Wr();
|
|
10578
10590
|
function n(s) {
|
|
10579
10591
|
return r(s, t, e);
|
|
10580
10592
|
}
|
|
@@ -10703,8 +10715,8 @@ function tw() {
|
|
|
10703
10715
|
ud = 1;
|
|
10704
10716
|
var r = Fo(), e = jv(), t = zo(), n = Uv(), s = Vv(), i = Wd(), a = Bd(), o = Wv(), c = zv(), l = $d(), u = Bv(), f = Mn(), d = Zv(), h = Yv(), p = Zd(), v = Dt(), _ = Fn(), O = Qv(), R = vt(), C = ew(), w = jo(), E = Wr(), I = 1, T = 2, y = 4, N = "[object Arguments]", g = "[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 = {};
|
|
10705
10717
|
X[N] = X[g] = 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;
|
|
10706
|
-
function me(K,
|
|
10707
|
-
var De, Se =
|
|
10718
|
+
function me(K, ne, Ie, Gt, bt, it) {
|
|
10719
|
+
var De, Se = ne & I, Ot = ne & T, km = ne & y;
|
|
10708
10720
|
if (Ie && (De = bt ? Ie(K, Gt, bt, it) : Ie(K)), De !== void 0)
|
|
10709
10721
|
return De;
|
|
10710
10722
|
if (!R(K))
|
|
@@ -10731,13 +10743,13 @@ function tw() {
|
|
|
10731
10743
|
if (gc)
|
|
10732
10744
|
return gc;
|
|
10733
10745
|
it.set(K, De), C(K) ? K.forEach(function(Et) {
|
|
10734
|
-
De.add(me(Et,
|
|
10746
|
+
De.add(me(Et, ne, Ie, Et, K, it));
|
|
10735
10747
|
}) : O(K) && K.forEach(function(Et, Mt) {
|
|
10736
|
-
De.set(Mt, me(Et,
|
|
10748
|
+
De.set(Mt, me(Et, ne, Ie, Mt, K, it));
|
|
10737
10749
|
});
|
|
10738
|
-
var
|
|
10750
|
+
var Im = km ? Ot ? u : l : Ot ? E : w, _c = pc ? void 0 : Im(K);
|
|
10739
10751
|
return e(_c || K, function(Et, Mt) {
|
|
10740
|
-
_c && (Mt = Et, Et = K[Mt]), t(De, Mt, me(Et,
|
|
10752
|
+
_c && (Mt = Et, Et = K[Mt]), t(De, Mt, me(Et, ne, Ie, Mt, K, it));
|
|
10741
10753
|
}), De;
|
|
10742
10754
|
}
|
|
10743
10755
|
return za = me, za;
|
|
@@ -10800,14 +10812,14 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10800
10812
|
return !1;
|
|
10801
10813
|
}
|
|
10802
10814
|
return !(new Blob([r]).size > 1500);
|
|
10803
|
-
},
|
|
10815
|
+
}, cm = (r, e) => {
|
|
10804
10816
|
const t = Object.keys(r);
|
|
10805
10817
|
e.forEach((n) => {
|
|
10806
10818
|
n in t || e.delete(n);
|
|
10807
10819
|
}), t.forEach((n) => {
|
|
10808
10820
|
e.add(n);
|
|
10809
10821
|
}), e.has("id") || e.add("id");
|
|
10810
|
-
},
|
|
10822
|
+
}, lm = (r, e) => {
|
|
10811
10823
|
Object.keys(r).forEach((t) => {
|
|
10812
10824
|
let n = !1;
|
|
10813
10825
|
e.forEach((s) => {
|
|
@@ -10875,7 +10887,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10875
10887
|
const T = w === 0 ? 30 : Math.max(1, Math.floor(30 / w)), y = [];
|
|
10876
10888
|
C.filter((m) => m.type === "Record_Owner").forEach(() => y.push(ge("Created_By", "==", i.User_ID))), C.filter((m) => m.type === "Record_User").forEach((m) => {
|
|
10877
10889
|
if ("collectionField" in m) {
|
|
10878
|
-
const S =
|
|
10890
|
+
const S = re(l, m.collectionField);
|
|
10879
10891
|
y.push(ge(`${S.name}_Array`, "array-contains", i.Doc_ID));
|
|
10880
10892
|
}
|
|
10881
10893
|
}), C.filter((m) => m.type === "Record_Property").forEach((m) => {
|
|
@@ -10883,7 +10895,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10883
10895
|
const S = m.roles.find((D) => D.role === i.Role);
|
|
10884
10896
|
if (!S)
|
|
10885
10897
|
throw new Error("PERMISSION_DENIED");
|
|
10886
|
-
const k =
|
|
10898
|
+
const k = re(l, m.propertyField);
|
|
10887
10899
|
k.type === "Array" ? y.push(ge(k.name, "array-contains-any", S.values)) : y.push(ge(k.name, "in", S.values));
|
|
10888
10900
|
}
|
|
10889
10901
|
});
|
|
@@ -10909,7 +10921,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10909
10921
|
}), O.filter((m) => m.parentFilter.type === "Individual").forEach((m) => {
|
|
10910
10922
|
const { parentFilter: S, parentRestriction: k } = m;
|
|
10911
10923
|
if ("collectionField" in S) {
|
|
10912
|
-
const D =
|
|
10924
|
+
const D = re(l, S.collectionField);
|
|
10913
10925
|
if ("collection" in D) {
|
|
10914
10926
|
const x = i.collections?.[D.collection];
|
|
10915
10927
|
if (!x)
|
|
@@ -10937,7 +10949,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10937
10949
|
const g = [];
|
|
10938
10950
|
_.filter((m) => m.type === "Parent").forEach((m) => {
|
|
10939
10951
|
if ("collectionField" in m) {
|
|
10940
|
-
const S =
|
|
10952
|
+
const S = re(l, m.collectionField);
|
|
10941
10953
|
if ("collection" in S) {
|
|
10942
10954
|
const k = d?.parentEntities, D = [];
|
|
10943
10955
|
if (k) {
|
|
@@ -10961,7 +10973,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10961
10973
|
}), O.filter((m) => m.parentFilter.type === "Parent").forEach((m) => {
|
|
10962
10974
|
const { parentFilter: S, parentRestriction: k } = m;
|
|
10963
10975
|
if ("collectionField" in S && "parentCollectionField" in S) {
|
|
10964
|
-
const D =
|
|
10976
|
+
const D = re(l, S.collectionField), x = re(l, S.parentCollectionField);
|
|
10965
10977
|
if ("collection" in D && "collection" in x) {
|
|
10966
10978
|
const M = i.collections?.[D.collection];
|
|
10967
10979
|
if (!M)
|
|
@@ -10989,7 +11001,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10989
11001
|
const A = [];
|
|
10990
11002
|
g.length === 0 && (_.filter((m) => m.type === "Parent_Property").forEach((m) => {
|
|
10991
11003
|
if ("collectionField" in m && "propertyField" in m) {
|
|
10992
|
-
const S =
|
|
11004
|
+
const S = re(l, m.collectionField), k = re(l, m.propertyField);
|
|
10993
11005
|
if ("collection" in S) {
|
|
10994
11006
|
const D = d?.parentPropertyEntities || {};
|
|
10995
11007
|
Object.entries(D).forEach(([x, M]) => {
|
|
@@ -11012,7 +11024,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
11012
11024
|
}), O.filter((m) => m.parentFilter.type === "Parent_Property").forEach((m) => {
|
|
11013
11025
|
const { parentFilter: S } = m;
|
|
11014
11026
|
if ("collectionField" in S && "parentCollectionField" in S && "parentPropertyField" in S) {
|
|
11015
|
-
const k =
|
|
11027
|
+
const k = re(l, S.collectionField), D = re(l, S.parentCollectionField), x = re(l, S.parentPropertyField);
|
|
11016
11028
|
if ("collection" in k && "collection" in D) {
|
|
11017
11029
|
const M = i.collections?.[k.collection];
|
|
11018
11030
|
if (!M)
|
|
@@ -11038,11 +11050,11 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
11038
11050
|
}));
|
|
11039
11051
|
const b = [...N, ...g, ...A];
|
|
11040
11052
|
return !_.length && !O.length ? R(y) : b;
|
|
11041
|
-
},
|
|
11053
|
+
}, um = {}, Cr = {}, Ww = async (r) => {
|
|
11042
11054
|
for (const s of Object.keys(Cr))
|
|
11043
11055
|
delete Cr[s];
|
|
11044
11056
|
for (const s of Object.keys(r || {}))
|
|
11045
|
-
Cr[s] = [], delete
|
|
11057
|
+
Cr[s] = [], delete um[s];
|
|
11046
11058
|
const e = await ke(), t = await se(e, ["global", "preload", "sync"]), n = await se(e, ["global", "preload", "async"]);
|
|
11047
11059
|
if (n)
|
|
11048
11060
|
for (const s of n)
|
|
@@ -11053,7 +11065,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
11053
11065
|
for (const s of Object.keys(r || {}))
|
|
11054
11066
|
n.includes(s) || t.includes(s) || await Fr(s, r?.[s].constraints, r?.[s].range, r?.[s].orQueries);
|
|
11055
11067
|
return Cr;
|
|
11056
|
-
}, Eo = () =>
|
|
11068
|
+
}, Eo = () => um, ow = () => Cr, cw = async (r, e, t, n) => {
|
|
11057
11069
|
const { labels: s, preloadCache: i } = r, o = Kr()[s.collection], c = ke(), l = lt(s.collection), u = Fe();
|
|
11058
11070
|
if (!u?.Role)
|
|
11059
11071
|
throw new Error("PERMISSION_DENIED");
|
|
@@ -11141,14 +11153,14 @@ const lw = async (r, e) => {
|
|
|
11141
11153
|
else {
|
|
11142
11154
|
const d = new Event("stoker:permissionsChange");
|
|
11143
11155
|
if (document.dispatchEvent(d), s.auth.signOutOnPermissionsChange)
|
|
11144
|
-
|
|
11156
|
+
Om();
|
|
11145
11157
|
else {
|
|
11146
11158
|
const h = Lt.collections;
|
|
11147
11159
|
if (h)
|
|
11148
11160
|
for (const [p, v] of Object.entries(h))
|
|
11149
11161
|
a && // eslint-disable-next-line security/detect-object-injection
|
|
11150
11162
|
(!a.collections?.[p] || // eslint-disable-next-line security/detect-object-injection
|
|
11151
|
-
!
|
|
11163
|
+
!yy(v, a.collections[p])) && Fr(p);
|
|
11152
11164
|
}
|
|
11153
11165
|
}
|
|
11154
11166
|
a = Lt;
|
|
@@ -11187,7 +11199,7 @@ const lw = async (r, e) => {
|
|
|
11187
11199
|
const p = Oe(t);
|
|
11188
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));
|
|
11189
11201
|
const v = t.Last_Write_At, _ = Ae(f, n.join("/"), s, "system_write_log", `${a}-${v.valueOf()}`);
|
|
11190
|
-
|
|
11202
|
+
Gm(_, h).catch((O) => {
|
|
11191
11203
|
console.error(`Error saving "${e}" ${r} log entry for record ${s} in ${l.collection} collection.`, { cause: O });
|
|
11192
11204
|
});
|
|
11193
11205
|
}, oc = async (r, e, t, n, s) => {
|
|
@@ -11209,7 +11221,7 @@ const lw = async (r, e) => {
|
|
|
11209
11221
|
}
|
|
11210
11222
|
})), c.length > 0)
|
|
11211
11223
|
throw new Error(c.join(", "));
|
|
11212
|
-
},
|
|
11224
|
+
}, fm = (r, e, t) => {
|
|
11213
11225
|
const n = je(), s = He(), i = Fe(), a = r.at(-1);
|
|
11214
11226
|
if (!a)
|
|
11215
11227
|
throw new Error("EMPTY_PATH");
|
|
@@ -11223,7 +11235,7 @@ const lw = async (r, e) => {
|
|
|
11223
11235
|
for (const h of f)
|
|
11224
11236
|
d.push(Ae(n, "system_fields", c.collection, `${c.collection}-${h.field}`, e));
|
|
11225
11237
|
return d;
|
|
11226
|
-
}, hd = (r) => r !== null && typeof r == "object" && !Array.isArray(r),
|
|
11238
|
+
}, hd = (r) => r !== null && typeof r == "object" && !Array.isArray(r), dm = (r) => {
|
|
11227
11239
|
const e = (t) => {
|
|
11228
11240
|
Object.entries(t).forEach(([n, s]) => {
|
|
11229
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);
|
|
@@ -11253,9 +11265,9 @@ const lw = async (r, e) => {
|
|
|
11253
11265
|
}
|
|
11254
11266
|
const l = c.data;
|
|
11255
11267
|
for (const u of l.result.docs)
|
|
11256
|
-
|
|
11268
|
+
dm(u);
|
|
11257
11269
|
return l?.result;
|
|
11258
|
-
},
|
|
11270
|
+
}, hm = async (r, e, t, n, s, i, a) => {
|
|
11259
11271
|
const o = Fe();
|
|
11260
11272
|
if (!o)
|
|
11261
11273
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
@@ -11265,7 +11277,7 @@ const lw = async (r, e) => {
|
|
|
11265
11277
|
throw new Error(`SCHEMA_ERROR: Collection ${d} not found in subcollections of ${c}`);
|
|
11266
11278
|
}) : t.collections = l;
|
|
11267
11279
|
const u = t.depth - 1, f = t.collections.map(async (d) => {
|
|
11268
|
-
const h = await
|
|
11280
|
+
const h = await mm([...e, d], t.constraints || [], {
|
|
11269
11281
|
only: i,
|
|
11270
11282
|
pagination: t.limit,
|
|
11271
11283
|
noEmbeddingFields: a
|
|
@@ -11277,7 +11289,7 @@ const lw = async (r, e) => {
|
|
|
11277
11289
|
r[d].map((p) => cc(p, [...e, d, p.id], s, n, i, a))
|
|
11278
11290
|
), u > 0 && await Promise.all(
|
|
11279
11291
|
// eslint-disable-next-line security/detect-object-injection
|
|
11280
|
-
r[d].map((p) =>
|
|
11292
|
+
r[d].map((p) => hm(p, [...e, d, p.id], { depth: u }, n, s, i, a))
|
|
11281
11293
|
);
|
|
11282
11294
|
});
|
|
11283
11295
|
await Promise.all(f);
|
|
@@ -11315,7 +11327,7 @@ const lw = async (r, e) => {
|
|
|
11315
11327
|
}
|
|
11316
11328
|
}
|
|
11317
11329
|
await Promise.all(l);
|
|
11318
|
-
},
|
|
11330
|
+
}, mm = async (r, e, t) => {
|
|
11319
11331
|
if (t?.subcollections?.depth && t.subcollections.depth > 10)
|
|
11320
11332
|
throw new Error("INPUT_ERROR: Subcollections depth cannot exceed 10");
|
|
11321
11333
|
if (t?.relations?.depth && t.relations.depth > 10)
|
|
@@ -11360,7 +11372,7 @@ const lw = async (r, e) => {
|
|
|
11360
11372
|
await oe("preOperation", d, v, ["read", void 0, void 0, E]), await oe("preRead", d, v, [E, C, !0, !1]);
|
|
11361
11373
|
const y = /* @__PURE__ */ new Map(), N = C.map(async (b) => {
|
|
11362
11374
|
let m;
|
|
11363
|
-
return t?.only === "cache" ? m = await vd(b) : t?.only === "server" ? m = await
|
|
11375
|
+
return t?.only === "cache" ? m = await vd(b) : t?.only === "server" ? m = await Hm(b) : m = await Km(b), m;
|
|
11364
11376
|
}), g = await Promise.all(N);
|
|
11365
11377
|
for (const b of g) {
|
|
11366
11378
|
for (const m of b.docs) {
|
|
@@ -11385,7 +11397,7 @@ const lw = async (r, e) => {
|
|
|
11385
11397
|
}
|
|
11386
11398
|
for (const b of y.values()) {
|
|
11387
11399
|
const m = [], S = [...b.Collection_Path, b.id];
|
|
11388
|
-
t?.subcollections && m.push(
|
|
11400
|
+
t?.subcollections && m.push(hm(
|
|
11389
11401
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11390
11402
|
y.get(b.id),
|
|
11391
11403
|
S,
|
|
@@ -11424,8 +11436,8 @@ const lw = async (r, e) => {
|
|
|
11424
11436
|
id: e,
|
|
11425
11437
|
options: t
|
|
11426
11438
|
})).data.result;
|
|
11427
|
-
return
|
|
11428
|
-
},
|
|
11439
|
+
return dm(l), l;
|
|
11440
|
+
}, pm = async (r, e, t, n, s, i) => {
|
|
11429
11441
|
const a = Fe();
|
|
11430
11442
|
if (!a)
|
|
11431
11443
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
@@ -11435,7 +11447,7 @@ const lw = async (r, e) => {
|
|
|
11435
11447
|
throw new Error(`SCHEMA_ERROR: Collection ${f} not found in subcollections of ${o}`);
|
|
11436
11448
|
}) : t.collections = c;
|
|
11437
11449
|
const l = t.depth - 1, u = t.collections.map(async (f) => {
|
|
11438
|
-
const d = await
|
|
11450
|
+
const d = await mm([...e, f], t.constraints || [], {
|
|
11439
11451
|
only: i,
|
|
11440
11452
|
relations: s,
|
|
11441
11453
|
pagination: t.limit
|
|
@@ -11445,12 +11457,12 @@ const lw = async (r, e) => {
|
|
|
11445
11457
|
r[f] = d.docs, l > 0 && await Promise.all(
|
|
11446
11458
|
// eslint-disable-next-line security/detect-object-injection
|
|
11447
11459
|
r[f].map(async (h) => {
|
|
11448
|
-
await
|
|
11460
|
+
await pm(h, [...e, f, h.id], { depth: l }, n, s, i);
|
|
11449
11461
|
})
|
|
11450
11462
|
);
|
|
11451
11463
|
});
|
|
11452
11464
|
await Promise.all(u);
|
|
11453
|
-
},
|
|
11465
|
+
}, ym = async (r, e, t, n, s, i, a) => {
|
|
11454
11466
|
if (!Fe())
|
|
11455
11467
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11456
11468
|
const c = e.at(-2);
|
|
@@ -11468,7 +11480,7 @@ const lw = async (r, e) => {
|
|
|
11468
11480
|
noEmbeddingFields: a
|
|
11469
11481
|
}).then((_) => {
|
|
11470
11482
|
if (d[h] = _, l > 0)
|
|
11471
|
-
return
|
|
11483
|
+
return ym(
|
|
11472
11484
|
// eslint-disable-next-line security/detect-object-injection
|
|
11473
11485
|
d[h],
|
|
11474
11486
|
[...p.Collection_Path, h],
|
|
@@ -11508,7 +11520,7 @@ const lw = async (r, e) => {
|
|
|
11508
11520
|
throw new Error("PERMISSIONS_DENIED");
|
|
11509
11521
|
if (p?.includes(_.Role))
|
|
11510
11522
|
return await dw(r, e, t);
|
|
11511
|
-
const O =
|
|
11523
|
+
const O = fm(r, e, a);
|
|
11512
11524
|
if (O.length === 0)
|
|
11513
11525
|
throw new Error("PERMISSION_DENIED");
|
|
11514
11526
|
const R = { collection: d.collection };
|
|
@@ -11516,14 +11528,14 @@ const lw = async (r, e) => {
|
|
|
11516
11528
|
let E = {};
|
|
11517
11529
|
const I = O.map(async (b) => {
|
|
11518
11530
|
let m;
|
|
11519
|
-
if (t?.only === "cache" ? m = await
|
|
11531
|
+
if (t?.only === "cache" ? m = await Ym(b) : t?.only === "server" ? m = await bd(b) : m = await _d(b), !m.exists())
|
|
11520
11532
|
throw new Error(`NOT_FOUND: Document with ID ${e} does not exist at location ${r?.join("/") || d.collection}`);
|
|
11521
11533
|
return { id: m.id, data: m.data({ serverTimestamps: u || "none" }) };
|
|
11522
11534
|
}), T = await Promise.all(I);
|
|
11523
11535
|
for (const b of T)
|
|
11524
11536
|
E.id ||= b.id, E = { ...E, ...b.data }, delete E.Collection_Path_String;
|
|
11525
11537
|
const y = [], N = r ? [...r, e] : [d.collection, e];
|
|
11526
|
-
if (t?.subcollections && y.push(
|
|
11538
|
+
if (t?.subcollections && y.push(pm(E, N, Oe(t.subcollections), s, Oe(t?.relations), t?.only)), t?.relations && (t.relations.fields && (t.relations.fields = t.relations.fields.map((b) => {
|
|
11527
11539
|
if (typeof b == "string") {
|
|
11528
11540
|
const m = f.fields.find((S) => S.name === b);
|
|
11529
11541
|
if (m)
|
|
@@ -11531,14 +11543,14 @@ const lw = async (r, e) => {
|
|
|
11531
11543
|
throw new Error(`SCHEMA_ERROR: Field ${b} not found in collection ${n}`);
|
|
11532
11544
|
}
|
|
11533
11545
|
return b;
|
|
11534
|
-
})), y.push(
|
|
11546
|
+
})), y.push(ym(E, N, Oe(t.relations), s, t?.only, t?.noComputedFields, t?.noEmbeddingFields))), await Promise.all(y), !t?.noComputedFields)
|
|
11535
11547
|
for (const b of f.fields)
|
|
11536
11548
|
b.type === "Computed" && (E[b.name] = await b.formula(E));
|
|
11537
11549
|
if (t?.noEmbeddingFields)
|
|
11538
11550
|
for (const b of f.fields)
|
|
11539
11551
|
b.type === "Embedding" && delete E[b.name];
|
|
11540
11552
|
return await oe("postOperation", o, v, ["read", E, e, R]), await oe("postRead", o, v, [R, O, E, !1]), E;
|
|
11541
|
-
}, hw = (r) => r !== null && typeof r == "object",
|
|
11553
|
+
}, hw = (r) => r !== null && typeof r == "object", gm = (r) => {
|
|
11542
11554
|
const e = (t) => {
|
|
11543
11555
|
Object.entries(t).forEach(([n, s]) => {
|
|
11544
11556
|
s instanceof zt ? t[n] = {
|
|
@@ -11550,7 +11562,7 @@ const lw = async (r, e) => {
|
|
|
11550
11562
|
e(r);
|
|
11551
11563
|
}, mw = async (r, e, t, n) => {
|
|
11552
11564
|
const s = nt(), i = Ue(), a = $e(s, i.STOKER_FB_FUNCTIONS_REGION), o = Ke(a, "stoker-writeapi", { timeout: 540 * 1e3 });
|
|
11553
|
-
return
|
|
11565
|
+
return gm(t), ac(t), (await o({
|
|
11554
11566
|
operation: "update",
|
|
11555
11567
|
path: r,
|
|
11556
11568
|
id: e,
|
|
@@ -11569,7 +11581,7 @@ const lw = async (r, e) => {
|
|
|
11569
11581
|
throw new Error("NOT_AUTHENTICATED");
|
|
11570
11582
|
if (!d)
|
|
11571
11583
|
throw new Error("PERMISSION_DENIED");
|
|
11572
|
-
if (
|
|
11584
|
+
if (wm(e))
|
|
11573
11585
|
throw new Error("RECORD_BUSY");
|
|
11574
11586
|
i = y?.originalRecord || i || await _r([O.collection], e, { noComputedFields: !0, noEmbeddingFields: !0 });
|
|
11575
11587
|
for (const P of o.collections[h].fields)
|
|
@@ -11621,14 +11633,14 @@ const lw = async (r, e) => {
|
|
|
11621
11633
|
const B = ["update", x, e, A, g, Oe(i)];
|
|
11622
11634
|
await oe("preWrite", l, I, B);
|
|
11623
11635
|
}
|
|
11624
|
-
if (
|
|
11636
|
+
if (Qd(_, x, a), Xd(_, x), !y)
|
|
11625
11637
|
try {
|
|
11626
11638
|
const P = { ...i, ...x };
|
|
11627
|
-
tr(P), await
|
|
11639
|
+
tr(P), await am("update", P, _, I, ["update", P, A, g, Oe(i)], a), k && (D(), await oc("update", e, x, _, d));
|
|
11628
11640
|
} catch (P) {
|
|
11629
11641
|
throw new Error(`VALIDATION_ERROR: ${P.message}`);
|
|
11630
11642
|
}
|
|
11631
|
-
if (
|
|
11643
|
+
if (wy(x, i, e, _, a, N.uid, d), Nt(x), sc("update", g, r, e, x, a, _, 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)), g.update(Ae(f, r.join("/"), e), x), !y && w && Ge("update", "written", x, r, e, _, N.uid, void 0, i), await uc("update", r, e, x, A, _, I, g, N.uid, w || !1, d, !!y, i), y?.type === "unique") {
|
|
11632
11644
|
const P = { ...i, ...x };
|
|
11633
11645
|
return tr(P), { id: e, ...P };
|
|
11634
11646
|
}
|
|
@@ -11677,7 +11689,7 @@ const lw = async (r, e) => {
|
|
|
11677
11689
|
n[k].replace(/ - DUPLICATE-\d+/g, "") + ` - DUPLICATE-${x + 1}`) : n[k] = n[k] + " - DUPLICATE-1", x < 10 ? m = !0 : C = new Error(g.map((M) => M.replace(/ - DUPLICATE-\d+/g, "")).join(", "));
|
|
11678
11690
|
}
|
|
11679
11691
|
if (m) {
|
|
11680
|
-
r === "create" && await
|
|
11692
|
+
r === "create" && await _m(e, n, void 0, { retry: { type: "unique", docId: t } }), r === "update" && await lc(e, t, n, void 0, {
|
|
11681
11693
|
retry: {
|
|
11682
11694
|
type: "unique",
|
|
11683
11695
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -11722,14 +11734,14 @@ const lw = async (r, e) => {
|
|
|
11722
11734
|
await O();
|
|
11723
11735
|
}, pw = async (r, e, t, n) => {
|
|
11724
11736
|
const s = nt(), i = Ue(), a = $e(s, i.STOKER_FB_FUNCTIONS_REGION), o = Ke(a, "stoker-writeapi", { timeout: 540 * 1e3 });
|
|
11725
|
-
return
|
|
11737
|
+
return gm(e), (await o({
|
|
11726
11738
|
operation: "create",
|
|
11727
11739
|
path: r,
|
|
11728
11740
|
record: e,
|
|
11729
11741
|
user: t,
|
|
11730
11742
|
id: n
|
|
11731
11743
|
})).data?.result;
|
|
11732
|
-
},
|
|
11744
|
+
}, _m = async (r, e, t, n, s, i) => {
|
|
11733
11745
|
const a = He(), o = hc(), c = ke(), l = fr(), u = je(), f = Fe();
|
|
11734
11746
|
if (r.length === 0)
|
|
11735
11747
|
throw new Error("EMPTY_PATH");
|
|
@@ -11775,13 +11787,13 @@ const lw = async (r, e) => {
|
|
|
11775
11787
|
}
|
|
11776
11788
|
e.id = b;
|
|
11777
11789
|
const S = Go("create", r, e, a, I, Wt(), y.uid, zt.now(), Pr(), !!T);
|
|
11778
|
-
if (C && (S[C.archivedField] = !1), Nt(S), !T && R && Ge("create", "started", S, r, b, v, y.uid), T || (await oe("preOperation", c, E, ["create", S, b, m, A]), await oe("preWrite", c, E, ["create", S, b, m, A])),
|
|
11790
|
+
if (C && (S[C.archivedField] = !1), Nt(S), !T && R && Ge("create", "started", S, r, b, v, y.uid), T || (await oe("preOperation", c, E, ["create", S, b, m, A]), await oe("preWrite", c, E, ["create", S, b, m, A])), Qd(v, S, a), Xd(v, S), T || await fg(S, v, E, f.Role), !T)
|
|
11779
11791
|
try {
|
|
11780
|
-
await
|
|
11792
|
+
await am("create", S, v, E, ["create", S, m, A], a), N && (g(), await oc("create", b, S, v, f));
|
|
11781
11793
|
} catch (M) {
|
|
11782
11794
|
throw new Error(`VALIDATION_ERROR: ${M.message}`);
|
|
11783
11795
|
}
|
|
11784
|
-
if (i && i(), Nt(S),
|
|
11796
|
+
if (i && i(), Nt(S), vy(S, b, v, a, y.uid, f), sc("create", A, r, b, S, a, v, n, o, Co, Ao, Tn, (M) => Ae(u, "system_fields", _.collection, `${_.collection}-${M.name}`, b), (M, $) => Ae(u, "system_unique", _.collection, `Unique-${_.collection}-${M.name}`, $), (M) => Ae(u, "system_fields", _.collection, `${_.collection}-${M}`, b)), A.set(Ae(u, r.join("/"), b), S), !T && R && Ge("create", "written", S, r, b, v, y.uid), await uc("create", r, b, S, m, v, E, A, y.uid, R || !1, f, !!T), T?.type === "unique")
|
|
11785
11797
|
return { docId: b, record: S };
|
|
11786
11798
|
R && Ge("create", "success", S, r, b, v, y.uid);
|
|
11787
11799
|
const k = ["create", S, b, m, !!T], D = [...k];
|
|
@@ -11821,7 +11833,7 @@ const lw = async (r, e) => {
|
|
|
11821
11833
|
throw new Error("CLIENT_OFFLINE");
|
|
11822
11834
|
})(), O || d.auth)
|
|
11823
11835
|
return await yw(r, e);
|
|
11824
|
-
if (
|
|
11836
|
+
if (wm(e))
|
|
11825
11837
|
throw new Error("RECORD_BUSY");
|
|
11826
11838
|
let y;
|
|
11827
11839
|
try {
|
|
@@ -11831,24 +11843,24 @@ const lw = async (r, e) => {
|
|
|
11831
11843
|
}
|
|
11832
11844
|
delete y.id;
|
|
11833
11845
|
const N = Ro(a), g = { collection: h.collection }, A = Go("delete", r, y, n, C, Wt(), E.uid, zt.now(), Pr(), !!w);
|
|
11834
|
-
Nt(A), !w && v && Ge("delete", "started", A, r, e, d, E.uid), w || (await oe("preOperation", o, R, ["delete", A, e, g, N]), await oe("preWrite", o, R, ["delete", A, e, g, N])), Nt(A),
|
|
11846
|
+
Nt(A), !w && v && Ge("delete", "started", A, r, e, d, E.uid), w || (await oe("preOperation", o, R, ["delete", A, e, g, N]), await oe("preWrite", o, R, ["delete", A, e, g, 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, g, d, R, N, E.uid, v || !1, c, !!w), v && Ge("delete", "success", { ...A, ...w?.record || {} }, r, e, d, E.uid);
|
|
11835
11847
|
const m = ["delete", A, e, g, !!w], S = [...m];
|
|
11836
11848
|
return await oe("postWrite", o, R, m), await oe("postOperation", o, R, S), { id: e, ...A };
|
|
11837
|
-
},
|
|
11849
|
+
}, vm = (r) => {
|
|
11838
11850
|
if (typeof r == "object")
|
|
11839
11851
|
for (const e in r)
|
|
11840
|
-
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() : vm(r[e]));
|
|
11841
11853
|
};
|
|
11842
11854
|
let ht = {};
|
|
11843
11855
|
const _w = async (r, e) => {
|
|
11844
11856
|
const t = fr(), n = mc(), s = t.currentUser;
|
|
11845
11857
|
if (s?.uid !== e.uid)
|
|
11846
11858
|
return;
|
|
11847
|
-
const i = await vd(pe(
|
|
11859
|
+
const i = await vd(pe(Jm(n, "system_write_log"), ge("status", "==", "written"), ge("user", "==", e.uid), et("Last_Write_At", "asc")));
|
|
11848
11860
|
if (await new Promise((o) => setTimeout(o, 2e3)), s?.uid !== e.uid)
|
|
11849
11861
|
return;
|
|
11850
11862
|
await Od(n);
|
|
11851
|
-
const a =
|
|
11863
|
+
const a = bm();
|
|
11852
11864
|
if (a?.version)
|
|
11853
11865
|
for (const o of i.docs) {
|
|
11854
11866
|
ht[o.id] ??= 0;
|
|
@@ -11875,7 +11887,7 @@ const _w = async (r, e) => {
|
|
|
11875
11887
|
);
|
|
11876
11888
|
continue;
|
|
11877
11889
|
}
|
|
11878
|
-
if (console.info(`Retrying pending ${u} operation: ${o.ref.path}`), u === "create" && (ht[f]++, await
|
|
11890
|
+
if (console.info(`Retrying pending ${u} operation: ${o.ref.path}`), u === "create" && (ht[f]++, await _m(h, l.data, void 0, {
|
|
11879
11891
|
retry: {
|
|
11880
11892
|
type: "offline",
|
|
11881
11893
|
docId: f
|
|
@@ -11884,7 +11896,7 @@ const _w = async (r, e) => {
|
|
|
11884
11896
|
console.error(O), ht[f]--;
|
|
11885
11897
|
})), u === "update") {
|
|
11886
11898
|
const O = r.collections[d], { softDelete: R } = O;
|
|
11887
|
-
R && l.data?.[R.archivedField] && l.data?.[R.archivedField] !== l.originalRecord?.[R.archivedField] && (l.data[R.timestampField] = Pr()), l.data &&
|
|
11899
|
+
R && l.data?.[R.archivedField] && l.data?.[R.archivedField] !== l.originalRecord?.[R.archivedField] && (l.data[R.timestampField] = Pr()), l.data && vm(l.data), ht[f]++, await lc(h, f, l.data, void 0, {
|
|
11888
11900
|
retry: {
|
|
11889
11901
|
type: "offline",
|
|
11890
11902
|
originalRecord: l.originalRecord
|
|
@@ -11909,12 +11921,12 @@ const _w = async (r, e) => {
|
|
|
11909
11921
|
}));
|
|
11910
11922
|
}
|
|
11911
11923
|
}
|
|
11912
|
-
},
|
|
11924
|
+
}, wm = (r) => !!ht[r], vw = () => {
|
|
11913
11925
|
ht = {};
|
|
11914
11926
|
};
|
|
11915
11927
|
let ln, Ga = 0;
|
|
11916
11928
|
const ww = async () => {
|
|
11917
|
-
const r =
|
|
11929
|
+
const r = Am(), e = ke();
|
|
11918
11930
|
return dr(Ae(r, "system_deployment", "latest_deploy"), (n) => {
|
|
11919
11931
|
if (n.exists())
|
|
11920
11932
|
ln = n.data(), Ga++, Ga > 1 && (ln.refresh ? window.location.reload() : Ee(e.onVersionUpdate, [ln, Ga]));
|
|
@@ -11923,10 +11935,10 @@ const ww = async () => {
|
|
|
11923
11935
|
}, (n) => {
|
|
11924
11936
|
throw new Error("Error getting version info", { cause: n.message });
|
|
11925
11937
|
});
|
|
11926
|
-
},
|
|
11938
|
+
}, bm = () => ln;
|
|
11927
11939
|
let So;
|
|
11928
11940
|
const bw = async () => {
|
|
11929
|
-
const r = ke(), e =
|
|
11941
|
+
const r = ke(), e = Am();
|
|
11930
11942
|
dr(Ae(e, "system_deployment", "maintenance_mode"), (t) => {
|
|
11931
11943
|
if (t.exists())
|
|
11932
11944
|
So = t.data(), Ee(r.onMaintenanceUpdate, [So.active ? "on" : "off"]);
|
|
@@ -11940,12 +11952,12 @@ let kr, wr = null;
|
|
|
11940
11952
|
const Ew = () => {
|
|
11941
11953
|
const r = gd(), e = ke();
|
|
11942
11954
|
let t = !1;
|
|
11943
|
-
return
|
|
11955
|
+
return zm(Bm(r, ".info/connected"), (s) => {
|
|
11944
11956
|
s.val() === !0 ? (wr && (clearTimeout(wr), wr = null), kr = "Online", Ee(e.onConnectionStatusChange, [kr, !t]), t || (t = !0)) : !wr && t && (wr = setTimeout(() => {
|
|
11945
11957
|
kr = "Offline", Ee(e.onConnectionStatusChange, [kr]);
|
|
11946
11958
|
}, 5e3));
|
|
11947
11959
|
});
|
|
11948
|
-
}, Wt = () => kr, Sw = () => navigator.onLine ? "Online" : "Offline",
|
|
11960
|
+
}, Wt = () => kr, Sw = () => navigator.onLine ? "Online" : "Offline", Om = async () => {
|
|
11949
11961
|
const r = ke(), e = fr(), t = e.currentUser;
|
|
11950
11962
|
if (r.preLogout && await Ee(r.preLogout, [t]) === !1)
|
|
11951
11963
|
throw new Error("Operation cancelled by preLogout");
|
|
@@ -11958,7 +11970,7 @@ const Ew = () => {
|
|
|
11958
11970
|
}
|
|
11959
11971
|
}, Tw = (r) => {
|
|
11960
11972
|
const e = (t) => {
|
|
11961
|
-
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"),
|
|
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"), Om()), 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));
|
|
11962
11974
|
};
|
|
11963
11975
|
window.addEventListener("error", (t) => {
|
|
11964
11976
|
e(t.message);
|
|
@@ -11967,7 +11979,7 @@ const Ew = () => {
|
|
|
11967
11979
|
e(n);
|
|
11968
11980
|
});
|
|
11969
11981
|
};
|
|
11970
|
-
let ft, Tt,
|
|
11982
|
+
let ft, Tt, Em, ye, Sm, Dr, fc, dc, qe, Tm, Sn = [], ve;
|
|
11971
11983
|
const Ha = {
|
|
11972
11984
|
firestoreWriteApp: {}
|
|
11973
11985
|
}, dt = {
|
|
@@ -11986,7 +11998,7 @@ const Ha = {
|
|
|
11986
11998
|
return ve;
|
|
11987
11999
|
},
|
|
11988
12000
|
getTimezone() {
|
|
11989
|
-
return
|
|
12001
|
+
return Em;
|
|
11990
12002
|
},
|
|
11991
12003
|
getConnectionStatus: Wt,
|
|
11992
12004
|
getNetworkStatus: Sw,
|
|
@@ -11996,7 +12008,7 @@ const Ha = {
|
|
|
11996
12008
|
for (const t of Object.values(e.collections))
|
|
11997
12009
|
for (const n of t.fields)
|
|
11998
12010
|
if (n.type === "Computed") {
|
|
11999
|
-
const s =
|
|
12011
|
+
const s = Ey(n, lt(t.labels.collection));
|
|
12000
12012
|
s.formula && (n.formula = s.formula);
|
|
12001
12013
|
}
|
|
12002
12014
|
} else
|
|
@@ -12005,7 +12017,7 @@ const Ha = {
|
|
|
12005
12017
|
return e;
|
|
12006
12018
|
},
|
|
12007
12019
|
getCurrentUser() {
|
|
12008
|
-
return
|
|
12020
|
+
return Tm;
|
|
12009
12021
|
},
|
|
12010
12022
|
getCurrentUserRoleGroups() {
|
|
12011
12023
|
return Oe(dc);
|
|
@@ -12017,9 +12029,9 @@ const Ha = {
|
|
|
12017
12029
|
return Oe(ye);
|
|
12018
12030
|
},
|
|
12019
12031
|
getCollectionConfigModule(r) {
|
|
12020
|
-
return Oe(
|
|
12032
|
+
return Oe(Sm[r]);
|
|
12021
12033
|
},
|
|
12022
|
-
getVersionInfo:
|
|
12034
|
+
getVersionInfo: bm,
|
|
12023
12035
|
getMaintenanceInfo: Ow,
|
|
12024
12036
|
getCurrentUserPermissions: Fe,
|
|
12025
12037
|
getLoadingState: Eo,
|
|
@@ -12039,7 +12051,7 @@ const Ha = {
|
|
|
12039
12051
|
return ze.maintenance;
|
|
12040
12052
|
}
|
|
12041
12053
|
}, Rw = () => {
|
|
12042
|
-
Dr = {}, fc = {}, dc = {}, qe = {},
|
|
12054
|
+
Dr = {}, fc = {}, dc = {}, qe = {}, ig(), uw(), vw();
|
|
12043
12055
|
}, Aw = () => Sn, Cw = () => {
|
|
12044
12056
|
Sn = [];
|
|
12045
12057
|
};
|
|
@@ -12047,23 +12059,23 @@ let md = !1;
|
|
|
12047
12059
|
const zw = async (r, e, t, n) => {
|
|
12048
12060
|
if (ve = t, ft)
|
|
12049
12061
|
return console.error("Stoker is already initialized."), !0;
|
|
12050
|
-
|
|
12062
|
+
xm("stoker-client", hp, "web"), Tt = ve.MODE, ye = r.default("web", To, n), Em = await se(ye, ["global", "timezone"]), se(ye, ["global", "roles"]), se(ye, ["global", "appName"]), se(ye, ["global", "auth", "enableMultiFactorAuth"]);
|
|
12051
12063
|
const s = JSON.parse(ve.STOKER_FB_WEB_APP_CONFIG), i = await se(ye, ["global", "firebase", "GDPRSettings"]);
|
|
12052
12064
|
ft = Vn(s, {
|
|
12053
12065
|
automaticDataCollectionEnabled: i || !0
|
|
12054
12066
|
});
|
|
12055
|
-
const a =
|
|
12067
|
+
const a = up(ft);
|
|
12056
12068
|
Tt === "development" && (a.instrumentationEnabled = !1, a.dataCollectionEnabled = !1);
|
|
12057
12069
|
const o = ["firestoreWrite"];
|
|
12058
12070
|
for (const g of o)
|
|
12059
12071
|
Ha[`${g}App`] = Vn(s, g);
|
|
12060
12072
|
const { firestoreWriteApp: c } = Ha, l = Vn(s, "maintenance");
|
|
12061
12073
|
ze.maintenance = je(l);
|
|
12062
|
-
const u =
|
|
12063
|
-
if (u.settings.minimumFetchIntervalMillis = 36e5, await
|
|
12074
|
+
const u = fp();
|
|
12075
|
+
if (u.settings.minimumFetchIntervalMillis = 36e5, await dp(u), ve.STOKER_FB_ENABLE_APP_CHECK === "true" && ve.STOKER_FB_APP_CHECK_KEY) {
|
|
12064
12076
|
(Tt === "development" || window.location.hostname === "localhost") && (globalThis.FIREBASE_APPCHECK_DEBUG_TOKEN = !0);
|
|
12065
12077
|
const g = {
|
|
12066
|
-
provider: new
|
|
12078
|
+
provider: new lp(ve.STOKER_FB_APP_CHECK_KEY),
|
|
12067
12079
|
isTokenAutoRefreshEnabled: !0
|
|
12068
12080
|
};
|
|
12069
12081
|
Ct.main = Bn(ft, g), Ct.firestoreWrite = Bn(c, g), Ct.maintenance = Bn(l, g);
|
|
@@ -12108,23 +12120,23 @@ const zw = async (r, e, t, n) => {
|
|
|
12108
12120
|
"firebase",
|
|
12109
12121
|
"logLevel",
|
|
12110
12122
|
"prod"
|
|
12111
|
-
]), R = await
|
|
12123
|
+
]), R = await Fm().catch((g) => {
|
|
12112
12124
|
throw new Error("Error checking analytics support.", { cause: g });
|
|
12113
12125
|
});
|
|
12114
|
-
Tt === "production" && f && R &&
|
|
12126
|
+
Tt === "production" && f && R && Dm(ft, d || {}), h && Mm(h);
|
|
12115
12127
|
const C = await se(ye, [
|
|
12116
12128
|
"global",
|
|
12117
12129
|
"auth",
|
|
12118
12130
|
"authPersistenceType"
|
|
12119
12131
|
]), E = {
|
|
12120
12132
|
popupRedirectResolver: void 0,
|
|
12121
|
-
persistence: C === "LOCAL" ? [
|
|
12133
|
+
persistence: C === "LOCAL" ? [Pm, qm, wc] : C === "SESSION" ? [wc, bc] : [bc]
|
|
12122
12134
|
};
|
|
12123
12135
|
dt.main = vc(ft, E);
|
|
12124
12136
|
for (const g of o)
|
|
12125
12137
|
dt[g] = vc(Ha[`${g}App`], E);
|
|
12126
12138
|
const { main: I } = dt;
|
|
12127
|
-
|
|
12139
|
+
Lm(I, async (g) => {
|
|
12128
12140
|
if (g && await Ee(ye.preLogin, [g]) === !1)
|
|
12129
12141
|
throw new Error("Operation cancelled by preLogin");
|
|
12130
12142
|
});
|
|
@@ -12137,11 +12149,11 @@ const zw = async (r, e, t, n) => {
|
|
|
12137
12149
|
if (!T?.includes("Auth")) {
|
|
12138
12150
|
const g = ve.STOKER_FB_EMULATOR_AUTH_PORT ? parseInt(ve.STOKER_FB_EMULATOR_AUTH_PORT) : 9099;
|
|
12139
12151
|
for (const A of Object.values(dt))
|
|
12140
|
-
|
|
12152
|
+
$m(A, `http://localhost:${g}`);
|
|
12141
12153
|
}
|
|
12142
12154
|
if (!T?.includes("Database")) {
|
|
12143
12155
|
const g = ve.STOKER_FB_EMULATOR_DATABASE_PORT ? parseInt(ve.STOKER_FB_EMULATOR_DATABASE_PORT) : 9e3;
|
|
12144
|
-
|
|
12156
|
+
Zm(gd(), "localhost", g);
|
|
12145
12157
|
}
|
|
12146
12158
|
if (!T?.includes("Firestore")) {
|
|
12147
12159
|
const g = ve.STOKER_FB_EMULATOR_FIRESTORE_PORT ? parseInt(ve.STOKER_FB_EMULATOR_FIRESTORE_PORT) : 8080;
|
|
@@ -12149,18 +12161,18 @@ const zw = async (r, e, t, n) => {
|
|
|
12149
12161
|
}
|
|
12150
12162
|
if (!T?.includes("Storage")) {
|
|
12151
12163
|
const g = ve.STOKER_FB_EMULATOR_STORAGE_PORT ? parseInt(ve.STOKER_FB_EMULATOR_STORAGE_PORT) : 9199;
|
|
12152
|
-
|
|
12164
|
+
ap(op(), "localhost", g);
|
|
12153
12165
|
}
|
|
12154
12166
|
if (!T?.includes("Functions")) {
|
|
12155
12167
|
const g = ve.STOKER_FB_EMULATOR_FUNCTIONS_PORT ? parseInt(ve.STOKER_FB_EMULATOR_FUNCTIONS_PORT) : 5001;
|
|
12156
|
-
|
|
12168
|
+
cp($e(ft, ve.STOKER_FB_FUNCTIONS_REGION), "localhost", g);
|
|
12157
12169
|
}
|
|
12158
12170
|
}
|
|
12159
12171
|
if (ww(), bw(), Ew(), Tt === "development" && (_ ? Yr(_) : Yr("debug")), Tt === "production" && (O ? Yr(O) : Yr("error")), v) {
|
|
12160
12172
|
const g = Wn(I, async (A) => {
|
|
12161
12173
|
if (A) {
|
|
12162
12174
|
const b = JSON.parse(ve.STOKER_FB_WEB_APP_CONFIG);
|
|
12163
|
-
|
|
12175
|
+
Nm(() => {
|
|
12164
12176
|
console.log(`Tenant - ${b.projectId} - User - ${A.uid}`);
|
|
12165
12177
|
});
|
|
12166
12178
|
}
|
|
@@ -12177,8 +12189,8 @@ const zw = async (r, e, t, n) => {
|
|
|
12177
12189
|
return Wn(I, async (g) => {
|
|
12178
12190
|
if (g) {
|
|
12179
12191
|
qe = g;
|
|
12180
|
-
const A = await
|
|
12181
|
-
|
|
12192
|
+
const A = await jm(qe), { claims: b } = A;
|
|
12193
|
+
Tm = {
|
|
12182
12194
|
...qe,
|
|
12183
12195
|
token: {
|
|
12184
12196
|
claims: b
|
|
@@ -12206,8 +12218,8 @@ const zw = async (r, e, t, n) => {
|
|
|
12206
12218
|
})
|
|
12207
12219
|
};
|
|
12208
12220
|
let ae;
|
|
12209
|
-
if (k === "EAGER" ? ae =
|
|
12210
|
-
localCache:
|
|
12221
|
+
if (k === "EAGER" ? ae = Qm() : ae = Xm({ cacheSizeBytes: D }), N === "ALL" ? M = $ : M = {
|
|
12222
|
+
localCache: ep({
|
|
12211
12223
|
garbageCollector: ae
|
|
12212
12224
|
})
|
|
12213
12225
|
}, 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")) {
|
|
@@ -12216,15 +12228,15 @@ const zw = async (r, e, t, n) => {
|
|
|
12216
12228
|
st !== "maintenance" && Sc(Z, "localhost", Ce);
|
|
12217
12229
|
}
|
|
12218
12230
|
if (N === "ALL") {
|
|
12219
|
-
const Ce =
|
|
12220
|
-
Ce &&
|
|
12231
|
+
const Ce = tp(ze.main);
|
|
12232
|
+
Ce && rp(Ce);
|
|
12221
12233
|
}
|
|
12222
12234
|
const B = await Ke($e(ft, ve.STOKER_FB_FUNCTIONS_REGION), "stoker-schema")().catch((Ce) => {
|
|
12223
12235
|
throw new Error("Error fetching schema.", { cause: Ce });
|
|
12224
12236
|
});
|
|
12225
12237
|
Dr = B.data.schema;
|
|
12226
12238
|
const te = Object.entries(B.data.allRoleGroups).map(([Ce, st]) => [Ce, new Set(st)]);
|
|
12227
|
-
fc = Object.fromEntries(te), dc = B.data.currentUserRoleGroups,
|
|
12239
|
+
fc = Object.fromEntries(te), dc = B.data.currentUserRoleGroups, Sm = Oy(Object.keys(Dr.collections), e, "web", To, n);
|
|
12228
12240
|
const Je = await lw(qe, A);
|
|
12229
12241
|
Sn.push(...Je), N === "WRITE" && _w(Dr, qe), await Ee(ye.postLogin, [qe]);
|
|
12230
12242
|
const Ve = new Event("stoker:ready");
|
|
@@ -12245,7 +12257,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12245
12257
|
}), console.error(`Error signing out of ${k.app.name}.`);
|
|
12246
12258
|
});
|
|
12247
12259
|
})), await Promise.all(Object.entries(ze).map(async ([k, D]) => {
|
|
12248
|
-
k !== "maintenance" && Object.keys(D).length !== 0 && await
|
|
12260
|
+
k !== "maintenance" && Object.keys(D).length !== 0 && await np(D).catch((x) => {
|
|
12249
12261
|
console.error(`Error terminating ${D.app.name}.`), m.error = !0, m.instances.push({
|
|
12250
12262
|
instance: D.app.name,
|
|
12251
12263
|
code: "TERMINATE_APP",
|
|
@@ -12263,7 +12275,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12263
12275
|
})), m.error ? console.info("Sign out operation completed with errors.") : console.info("Sign out operation completed successfully."), await Ee(ye.postLogout, [m]);
|
|
12264
12276
|
}
|
|
12265
12277
|
}), y ? !1 : I.currentUser ? (v && console.info(`${I.currentUser.uid} successfully logged in.`), !0) : !1;
|
|
12266
|
-
}, { getEnv: Ue, getTimezone:
|
|
12278
|
+
}, { getEnv: Ue, getTimezone: Rm, getSchema: He, getCurrentUser: Bw, getCurrentUserRoleGroups: Kr, getAllRoleGroups: hc, getGlobalConfigModule: ke, getCollectionConfigModule: lt, getAppCheck: Zw, getAppCheckFirestoreWrite: Gw, getFirestoreWriteAuth: kw, getFirestoreWrite: mc, getFirestoreMaintenance: Am } = To, Hw = async (r, e, t) => {
|
|
12267
12279
|
const [n, s] = [fr(), kw()], i = ke();
|
|
12268
12280
|
if (!r || !e)
|
|
12269
12281
|
throw new Error("Email and password are required.");
|
|
@@ -12273,12 +12285,12 @@ const zw = async (r, e, t, n) => {
|
|
|
12273
12285
|
a = n.currentUser?.uid;
|
|
12274
12286
|
else
|
|
12275
12287
|
try {
|
|
12276
|
-
a = (await
|
|
12288
|
+
a = (await Um(n, r, e)).user.uid;
|
|
12277
12289
|
} catch (c) {
|
|
12278
12290
|
if (c.code === "auth/multi-factor-auth-required")
|
|
12279
12291
|
if (t) {
|
|
12280
12292
|
o ||= await t();
|
|
12281
|
-
const l =
|
|
12293
|
+
const l = Vm(n, c), u = Ja.assertionForSignIn(l.hints[0].uid, o);
|
|
12282
12294
|
a = (await l.resolveSignIn(u)).user.uid;
|
|
12283
12295
|
} else
|
|
12284
12296
|
throw new Error("TOTP retrieval function not found.");
|
|
@@ -12291,7 +12303,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12291
12303
|
const h = (await f()).data.customToken;
|
|
12292
12304
|
if (!h)
|
|
12293
12305
|
throw new Error("The user is not authenticated.");
|
|
12294
|
-
await
|
|
12306
|
+
await Wm(s, h);
|
|
12295
12307
|
} catch {
|
|
12296
12308
|
throw n && n.currentUser && await yd(n), new Error("The user is not authenticated.");
|
|
12297
12309
|
}
|
|
@@ -12343,7 +12355,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12343
12355
|
await Od(e).catch((t) => {
|
|
12344
12356
|
throw new Error(`Error waiting for pending writes in ${e.app.name}.`, { cause: t });
|
|
12345
12357
|
});
|
|
12346
|
-
},
|
|
12358
|
+
}, Cm = async (r, e, t, n, s) => {
|
|
12347
12359
|
const i = r.at(-1);
|
|
12348
12360
|
if (!i)
|
|
12349
12361
|
throw new Error("EMPTY_PATH");
|
|
@@ -12360,7 +12372,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12360
12372
|
"global",
|
|
12361
12373
|
"firebase",
|
|
12362
12374
|
"serverTimestampOptions"
|
|
12363
|
-
]), C =
|
|
12375
|
+
]), C = fm(r, e, l);
|
|
12364
12376
|
if (C.length === 0)
|
|
12365
12377
|
throw new Error("PERMISSION_DENIED");
|
|
12366
12378
|
const w = h?.roles?.includes(a.Role), E = { collection: d.collection };
|
|
@@ -12380,7 +12392,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12380
12392
|
const b = () => {
|
|
12381
12393
|
const x = Ed(u, async () => {
|
|
12382
12394
|
if (x(), g) {
|
|
12383
|
-
if (
|
|
12395
|
+
if (lm(g, A), !s?.noComputedFields) {
|
|
12384
12396
|
const M = [];
|
|
12385
12397
|
for (const $ of f.fields)
|
|
12386
12398
|
$.type === "Computed" && M.push(Ee(() => $.formula(g)).then((G) => {
|
|
@@ -12455,7 +12467,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12455
12467
|
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("/")}`, {
|
|
12456
12468
|
cause: H
|
|
12457
12469
|
}));
|
|
12458
|
-
}) :
|
|
12470
|
+
}) : Cm(
|
|
12459
12471
|
[...Je.Collection_Path],
|
|
12460
12472
|
te,
|
|
12461
12473
|
(H) => {
|
|
@@ -12512,7 +12524,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12512
12524
|
}
|
|
12513
12525
|
y.set(x.path, !0), g ||= {}, g.id ||= $.id, g = { ...g, ...G }, delete g.Collection_Path_String;
|
|
12514
12526
|
const ae = A.get(x) || /* @__PURE__ */ new Set();
|
|
12515
|
-
|
|
12527
|
+
cm(G, ae), A.set(x, ae), y.size === C.length && D().then(() => {
|
|
12516
12528
|
b(), oe("postOperation", p, O, [
|
|
12517
12529
|
"read",
|
|
12518
12530
|
g,
|
|
@@ -12593,12 +12605,12 @@ const zw = async (r, e, t, n) => {
|
|
|
12593
12605
|
})) : s.pagination.startAt ? (Ka(s.pagination.startAt), T = T.map((j, Y) => {
|
|
12594
12606
|
if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
|
|
12595
12607
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using startAt");
|
|
12596
|
-
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection),
|
|
12608
|
+
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection), sp(y.first.get(Y)));
|
|
12597
12609
|
return s.pagination.number && (W = pe(W, Ir(s.pagination.number))), W;
|
|
12598
12610
|
})) : s.pagination.endAt && (Ya(s.pagination.endAt), T = T.map((j, Y) => {
|
|
12599
12611
|
if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
|
|
12600
12612
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using endAt");
|
|
12601
|
-
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection),
|
|
12613
|
+
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection), ip(y.last.get(Y)));
|
|
12602
12614
|
return s.pagination.number && (W = pe(W, Ir(s.pagination.number))), W;
|
|
12603
12615
|
})) : T = T.map((j) => {
|
|
12604
12616
|
let Y = pe(j);
|
|
@@ -12619,7 +12631,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12619
12631
|
Y();
|
|
12620
12632
|
const W = [];
|
|
12621
12633
|
D.forEach((de) => {
|
|
12622
|
-
|
|
12634
|
+
lm(de, x.get(de.id));
|
|
12623
12635
|
for (const X of f.fields)
|
|
12624
12636
|
X.type === "Computed" && W.push(Ee(() => X.formula(de)).then((me) => {
|
|
12625
12637
|
de[X.name] = me;
|
|
@@ -12651,17 +12663,17 @@ const zw = async (r, e, t, n) => {
|
|
|
12651
12663
|
G[j] ||= /* @__PURE__ */ new Map();
|
|
12652
12664
|
for (const me of W)
|
|
12653
12665
|
for (const K of ae[j].entries()) {
|
|
12654
|
-
const [
|
|
12666
|
+
const [ne, Ie] = K;
|
|
12655
12667
|
Ie.doc === j && Ie.type === me.type && Ie.field === me.name && (!D.has(j) || // eslint-disable-next-line security/detect-object-injection
|
|
12656
|
-
!Z[me.name][
|
|
12668
|
+
!Z[me.name][ne]) && (Ie.listener(), G[j].delete(ne));
|
|
12657
12669
|
}
|
|
12658
12670
|
for (const me of W)
|
|
12659
12671
|
if ("collection" in me) {
|
|
12660
12672
|
const K = Z[me.name];
|
|
12661
12673
|
if (!K)
|
|
12662
12674
|
continue;
|
|
12663
|
-
for (const
|
|
12664
|
-
!K?.[
|
|
12675
|
+
for (const ne of Object.keys(K))
|
|
12676
|
+
!K?.[ne].id && !G[j].has(ne) && (de.set(ne, !1), G[j].has(ne) ? X.set(ne, !0) : G[j].set(ne, !0));
|
|
12665
12677
|
}
|
|
12666
12678
|
if (de.size === 0)
|
|
12667
12679
|
S.set(j, "loaded"), $(H);
|
|
@@ -12671,55 +12683,55 @@ const zw = async (r, e, t, n) => {
|
|
|
12671
12683
|
const K = Z[me.name];
|
|
12672
12684
|
if (!K)
|
|
12673
12685
|
continue;
|
|
12674
|
-
for (const [
|
|
12675
|
-
if (X.has(
|
|
12686
|
+
for (const [ne, Ie] of Object.entries(K))
|
|
12687
|
+
if (X.has(ne)) {
|
|
12676
12688
|
const Gt = async () => {
|
|
12677
|
-
K[
|
|
12689
|
+
K[ne].id ? (de.set(ne, !0), Array.from(de.values()).every((bt) => bt) && S.set(j, "loaded")) : setTimeout(Gt, 100);
|
|
12678
12690
|
};
|
|
12679
12691
|
Gt();
|
|
12680
12692
|
} else {
|
|
12681
12693
|
const Gt = o.collections[me.collection], { access: bt } = Gt, { serverReadOnly: it } = bt;
|
|
12682
|
-
it?.includes(a.Role) ? _r([...Ie.Collection_Path],
|
|
12694
|
+
it?.includes(a.Role) ? _r([...Ie.Collection_Path], ne).then((Se) => {
|
|
12683
12695
|
if (!Se) {
|
|
12684
|
-
delete K[
|
|
12696
|
+
delete K[ne];
|
|
12685
12697
|
return;
|
|
12686
12698
|
}
|
|
12687
|
-
if (!D.has(j) || !K?.[
|
|
12688
|
-
de.set(
|
|
12699
|
+
if (!D.has(j) || !K?.[ne]) {
|
|
12700
|
+
de.set(ne, !0), G[j].delete(ne);
|
|
12689
12701
|
return;
|
|
12690
12702
|
}
|
|
12691
|
-
K[
|
|
12703
|
+
K[ne] = Se, de.set(ne, !0), Array.from(de.values()).every((Ot) => Ot) && (S.set(j, "loaded"), $(H));
|
|
12692
12704
|
}).catch((Se) => {
|
|
12693
|
-
delete K[
|
|
12705
|
+
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("/")}`, {
|
|
12694
12706
|
cause: Se
|
|
12695
12707
|
}));
|
|
12696
|
-
}) :
|
|
12708
|
+
}) : Cm(
|
|
12697
12709
|
[...Ie.Collection_Path],
|
|
12698
|
-
|
|
12710
|
+
ne,
|
|
12699
12711
|
(Se) => {
|
|
12700
12712
|
if (!Se) {
|
|
12701
|
-
delete K[
|
|
12713
|
+
delete K[ne];
|
|
12702
12714
|
return;
|
|
12703
12715
|
}
|
|
12704
|
-
if (!D.has(j) || !K?.[
|
|
12705
|
-
ae[j].has(
|
|
12716
|
+
if (!D.has(j) || !K?.[ne]) {
|
|
12717
|
+
ae[j].has(ne) && ae[j].get(ne)?.listener(), de.set(ne, !0), G[j].delete(ne);
|
|
12706
12718
|
return;
|
|
12707
12719
|
}
|
|
12708
|
-
K[
|
|
12720
|
+
K[ne] = Se, de.set(ne, !0), Array.from(de.values()).every((Ot) => Ot) && (S.set(j, "loaded"), $(H));
|
|
12709
12721
|
},
|
|
12710
12722
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12711
12723
|
(Se) => {
|
|
12712
|
-
delete K[
|
|
12724
|
+
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("/")}`, {
|
|
12713
12725
|
cause: Se
|
|
12714
12726
|
}));
|
|
12715
12727
|
},
|
|
12716
12728
|
{ ...s, relations: !1 }
|
|
12717
12729
|
).then((Se) => {
|
|
12718
|
-
if (!D.has(j) || !K?.[
|
|
12719
|
-
Se(), G[j].delete(
|
|
12730
|
+
if (!D.has(j) || !K?.[ne]) {
|
|
12731
|
+
Se(), G[j].delete(ne);
|
|
12720
12732
|
return;
|
|
12721
12733
|
}
|
|
12722
|
-
k.push(Se), ae[j].set(
|
|
12734
|
+
k.push(Se), ae[j].set(ne, {
|
|
12723
12735
|
doc: j,
|
|
12724
12736
|
type: me.type,
|
|
12725
12737
|
field: me.name,
|
|
@@ -12742,7 +12754,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12742
12754
|
});
|
|
12743
12755
|
H.id ||= j.id, H = { ...H, ...Y }, delete H.Collection_Path_String;
|
|
12744
12756
|
const W = x.get(j.id) || /* @__PURE__ */ new Map(), de = W.get(Z) || /* @__PURE__ */ new Set();
|
|
12745
|
-
|
|
12757
|
+
cm(Y, de), W.set(Z, de), x.set(j.id, W), D.set(j.id, H);
|
|
12746
12758
|
}, Je = s?.only === "cache" || E;
|
|
12747
12759
|
for (const Z of T) {
|
|
12748
12760
|
let H = !0;
|
|
@@ -12824,10 +12836,10 @@ const zw = async (r, e, t, n) => {
|
|
|
12824
12836
|
const s = je(), i = { to: r, body: e };
|
|
12825
12837
|
await Sd(Mr(s, "system_messages"), i);
|
|
12826
12838
|
}, ib = (r) => {
|
|
12827
|
-
const e =
|
|
12839
|
+
const e = Rm();
|
|
12828
12840
|
return z.fromJSDate(r).setZone(e);
|
|
12829
12841
|
}, Nw = (r) => {
|
|
12830
|
-
const e =
|
|
12842
|
+
const e = Rm();
|
|
12831
12843
|
return z.fromJSDate(r.toDate()).setZone(e);
|
|
12832
12844
|
}, ab = (r, e) => {
|
|
12833
12845
|
const n = z.fromJSDate(r, { zone: e }).offset, i = z.fromJSDate(r).offset, a = n - i;
|
|
@@ -12840,7 +12852,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12840
12852
|
return (await Ke(s, r)(e)).data;
|
|
12841
12853
|
};
|
|
12842
12854
|
export {
|
|
12843
|
-
|
|
12855
|
+
_m as addRecord,
|
|
12844
12856
|
pw as addRecordServer,
|
|
12845
12857
|
Hw as authenticateStoker,
|
|
12846
12858
|
lb as callFunction,
|
|
@@ -12850,7 +12862,7 @@ export {
|
|
|
12850
12862
|
Xw as deleteFolder,
|
|
12851
12863
|
gw as deleteRecord,
|
|
12852
12864
|
yw as deleteRecordServer,
|
|
12853
|
-
|
|
12865
|
+
dm as deserializeTimestamps,
|
|
12854
12866
|
cb as displayDate,
|
|
12855
12867
|
hc as getAllRoleGroups,
|
|
12856
12868
|
Zw as getAppCheck,
|
|
@@ -12862,10 +12874,10 @@ export {
|
|
|
12862
12874
|
Bw as getCurrentUser,
|
|
12863
12875
|
Fe as getCurrentUserPermissions,
|
|
12864
12876
|
Kr as getCurrentUserRoleGroups,
|
|
12865
|
-
|
|
12877
|
+
fm as getDocumentRefs,
|
|
12866
12878
|
Ue as getEnv,
|
|
12867
12879
|
rb as getFiles,
|
|
12868
|
-
|
|
12880
|
+
Am as getFirestoreMaintenance,
|
|
12869
12881
|
mc as getFirestoreWrite,
|
|
12870
12882
|
kw as getFirestoreWriteAuth,
|
|
12871
12883
|
ke as getGlobalConfigModule,
|
|
@@ -12875,11 +12887,11 @@ export {
|
|
|
12875
12887
|
_r as getOne,
|
|
12876
12888
|
dw as getOneServer,
|
|
12877
12889
|
He as getSchema,
|
|
12878
|
-
|
|
12890
|
+
mm as getSome,
|
|
12879
12891
|
fw as getSomeServer,
|
|
12880
|
-
|
|
12892
|
+
Rm as getTimezone,
|
|
12881
12893
|
Aw as getUnsubscribes,
|
|
12882
|
-
|
|
12894
|
+
bm as getVersionInfo,
|
|
12883
12895
|
Ug as getZodSchema,
|
|
12884
12896
|
zw as initializeStoker,
|
|
12885
12897
|
sr as isDeleteSentinel,
|
|
@@ -12895,10 +12907,10 @@ export {
|
|
|
12895
12907
|
xw as sendAdminSMS,
|
|
12896
12908
|
nb as sendMail,
|
|
12897
12909
|
sb as sendMessage,
|
|
12898
|
-
|
|
12899
|
-
|
|
12910
|
+
gm as serializeTimestamps,
|
|
12911
|
+
Om as signOut,
|
|
12900
12912
|
tb as subscribeMany,
|
|
12901
|
-
|
|
12913
|
+
Cm as subscribeOne,
|
|
12902
12914
|
Ee as tryPromise,
|
|
12903
12915
|
lc as updateRecord,
|
|
12904
12916
|
mw as updateRecordServer,
|