@stoker-platform/web-client 0.5.21 → 0.5.23

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.
Files changed (2) hide show
  1. package/dist/bundle.js +576 -569
  2. package/package.json +3 -3
package/dist/bundle.js CHANGED
@@ -2,13 +2,13 @@ import { getApp as it, registerVersion as xm, initializeApp as zn, setLogLevel a
2
2
  import { isSupported as Fm, initializeAnalytics as Dm, setConsent as Mm } from "firebase/analytics";
3
3
  import { getAuth as fr, validatePassword as _d, initializeAuth as Oc, indexedDBLocalPersistence as Pm, browserLocalPersistence as qm, browserSessionPersistence as Ec, inMemoryPersistence as Sc, beforeAuthStateChanged as Lm, connectAuthEmulator as $m, onAuthStateChanged as Bn, getIdTokenResult as jm, signOut as vd, signInWithEmailAndPassword as Um, getMultiFactorResolver as Vm, TotpMultiFactorGenerator as Xa, signInWithCustomToken as Wm, multiFactor as Tc } from "firebase/auth";
4
4
  import { getDatabase as wd, onValue as zm, ref as Bm, connectDatabaseEmulator as Zm } from "firebase/database";
5
- import { getFirestore as je, where as pe, query as he, collection as qr, and as Xr, or as Rc, onSnapshot as dr, doc as Ce, Timestamp as Bt, setDoc as Gm, getDoc as bd, orderBy as rt, limit as Xt, startAfter as eo, endBefore as to, limitToLast as Nr, getDocsFromCache as Od, getDocsFromServer as Hm, getDocs as Km, getCountFromServer as Ed, getDocFromCache as Ym, getDocFromServer as Jm, writeBatch as Co, serverTimestamp as Lr, deleteField as An, arrayRemove as ko, arrayUnion as Io, collectionGroup as Qm, connectFirestoreEmulator as Ac, persistentLocalCache as Cc, persistentSingleTabManager as kc, persistentMultipleTabManager as Ic, memoryEagerGarbageCollector as Xm, memoryLruGarbageCollector as ep, memoryLocalCache as tp, initializeFirestore as Zn, getPersistentCacheIndexManager as rp, enablePersistentCacheIndexAutoCreation as np, terminate as sp, clearIndexedDbPersistence as xc, waitForPendingWrites as ip, onSnapshotsInSync as Sd, startAt as ap, endAt as op, addDoc as Td } from "firebase/firestore";
5
+ import { getFirestore as Ue, where as pe, query as he, collection as qr, and as Xr, or as Rc, onSnapshot as dr, doc as Ce, Timestamp as Bt, setDoc as Gm, getDoc as bd, orderBy as rt, limit as Xt, startAfter as eo, endBefore as to, limitToLast as Nr, getDocsFromCache as Od, getDocsFromServer as Hm, getDocs as Km, getCountFromServer as Ed, getDocFromCache as Ym, getDocFromServer as Jm, writeBatch as Co, serverTimestamp as Lr, deleteField as An, arrayRemove as ko, arrayUnion as Io, collectionGroup as Qm, connectFirestoreEmulator as Ac, persistentLocalCache as Cc, persistentSingleTabManager as kc, persistentMultipleTabManager as Ic, memoryEagerGarbageCollector as Xm, memoryLruGarbageCollector as ep, memoryLocalCache as tp, initializeFirestore as Zn, getPersistentCacheIndexManager as rp, enablePersistentCacheIndexAutoCreation as np, terminate as sp, clearIndexedDbPersistence as xc, waitForPendingWrites as ip, onSnapshotsInSync as Sd, startAt as ap, endAt as op, addDoc as Td } from "firebase/firestore";
6
6
  import { connectStorageEmulator as cp, getStorage as lp } from "firebase/storage";
7
- import { getFunctions as $e, httpsCallable as Ye, connectFunctionsEmulator as up } from "firebase/functions";
7
+ import { getFunctions as je, httpsCallable as Je, connectFunctionsEmulator as up } from "firebase/functions";
8
8
  import { ReCaptchaEnterpriseProvider as fp, initializeAppCheck as Gn, onTokenChanged as Hn } from "firebase/app-check";
9
9
  import { getPerformance as dp } from "firebase/performance";
10
10
  import { getRemoteConfig as hp, fetchAndActivate as mp } from "firebase/remote-config";
11
- const pp = "0.5.20", yp = (r) => !!r.auth, vt = (r, e) => {
11
+ const pp = "0.5.23", yp = (r) => !!r.auth, vt = (r, e) => {
12
12
  if (e?.operations)
13
13
  return e.operations.includes(r);
14
14
  }, Cn = (r, e) => e ? e.Role ? r.access?.includes(e.Role) : !1 : !0, gp = (r, e) => e ? !e.Role || r.restrictCreate === !0 ? !1 : typeof r.restrictCreate == "object" ? r.restrictCreate?.includes(e.Role) : !0 : !0, _p = (r, e) => e ? !e.Role || r.restrictUpdate === !0 ? !1 : typeof r.restrictUpdate == "object" ? r.restrictUpdate?.includes(e.Role) : !0 : !0, re = (r, e) => r.filter((t) => t.name === e)[0], ge = (r) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(r.type), Rd = (r, e) => {
@@ -2260,7 +2260,7 @@ var af;
2260
2260
  // second overwrites first
2261
2261
  });
2262
2262
  })(af || (af = {}));
2263
- const V = ue.arrayToEnum([
2263
+ const W = ue.arrayToEnum([
2264
2264
  "string",
2265
2265
  "nan",
2266
2266
  "number",
@@ -2284,23 +2284,23 @@ const V = ue.arrayToEnum([
2284
2284
  ]), Tt = (r) => {
2285
2285
  switch (typeof r) {
2286
2286
  case "undefined":
2287
- return V.undefined;
2287
+ return W.undefined;
2288
2288
  case "string":
2289
- return V.string;
2289
+ return W.string;
2290
2290
  case "number":
2291
- return Number.isNaN(r) ? V.nan : V.number;
2291
+ return Number.isNaN(r) ? W.nan : W.number;
2292
2292
  case "boolean":
2293
- return V.boolean;
2293
+ return W.boolean;
2294
2294
  case "function":
2295
- return V.function;
2295
+ return W.function;
2296
2296
  case "bigint":
2297
- return V.bigint;
2297
+ return W.bigint;
2298
2298
  case "symbol":
2299
- return V.symbol;
2299
+ return W.symbol;
2300
2300
  case "object":
2301
- return Array.isArray(r) ? V.array : r === null ? V.null : r.then && typeof r.then == "function" && r.catch && typeof r.catch == "function" ? V.promise : typeof Map < "u" && r instanceof Map ? V.map : typeof Set < "u" && r instanceof Set ? V.set : typeof Date < "u" && r instanceof Date ? V.date : V.object;
2301
+ return Array.isArray(r) ? W.array : r === null ? W.null : r.then && typeof r.then == "function" && r.catch && typeof r.catch == "function" ? W.promise : typeof Map < "u" && r instanceof Map ? W.map : typeof Set < "u" && r instanceof Set ? W.set : typeof Date < "u" && r instanceof Date ? W.date : W.object;
2302
2302
  default:
2303
- return V.unknown;
2303
+ return W.unknown;
2304
2304
  }
2305
2305
  }, N = ue.arrayToEnum([
2306
2306
  "invalid_type",
@@ -2388,7 +2388,7 @@ const ro = (r, e) => {
2388
2388
  let t;
2389
2389
  switch (r.code) {
2390
2390
  case N.invalid_type:
2391
- r.received === V.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
2391
+ r.received === W.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
2392
2392
  break;
2393
2393
  case N.invalid_literal:
2394
2394
  t = `Invalid literal value, expected ${JSON.stringify(r.expected, ue.jsonStringifyReplacer)}`;
@@ -2526,7 +2526,7 @@ class Pe {
2526
2526
  }
2527
2527
  const te = Object.freeze({
2528
2528
  status: "aborted"
2529
- }), Rr = (r) => ({ status: "dirty", value: r }), Je = (r) => ({ status: "valid", value: r }), of = (r) => r.status === "aborted", cf = (r) => r.status === "dirty", ir = (r) => r.status === "valid", hn = (r) => typeof Promise < "u" && r instanceof Promise;
2529
+ }), Rr = (r) => ({ status: "dirty", value: r }), Qe = (r) => ({ status: "valid", value: r }), of = (r) => r.status === "aborted", cf = (r) => r.status === "dirty", ir = (r) => r.status === "valid", hn = (r) => typeof Promise < "u" && r instanceof Promise;
2530
2530
  var B;
2531
2531
  (function(r) {
2532
2532
  r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e?.message;
@@ -2695,7 +2695,7 @@ class ce {
2695
2695
  _refinement(e) {
2696
2696
  return new cr({
2697
2697
  schema: this,
2698
- typeName: ee.ZodEffects,
2698
+ typeName: X.ZodEffects,
2699
2699
  effect: { type: "refinement", refinement: e }
2700
2700
  });
2701
2701
  }
@@ -2734,7 +2734,7 @@ class ce {
2734
2734
  return new cr({
2735
2735
  ...ie(this._def),
2736
2736
  schema: this,
2737
- typeName: ee.ZodEffects,
2737
+ typeName: X.ZodEffects,
2738
2738
  effect: { type: "transform", transform: e }
2739
2739
  });
2740
2740
  }
@@ -2744,12 +2744,12 @@ class ce {
2744
2744
  ...ie(this._def),
2745
2745
  innerType: this,
2746
2746
  defaultValue: t,
2747
- typeName: ee.ZodDefault
2747
+ typeName: X.ZodDefault
2748
2748
  });
2749
2749
  }
2750
2750
  brand() {
2751
2751
  return new $g({
2752
- typeName: ee.ZodBranded,
2752
+ typeName: X.ZodBranded,
2753
2753
  type: this,
2754
2754
  ...ie(this._def)
2755
2755
  });
@@ -2760,7 +2760,7 @@ class ce {
2760
2760
  ...ie(this._def),
2761
2761
  innerType: this,
2762
2762
  catchValue: t,
2763
- typeName: ee.ZodCatch
2763
+ typeName: X.ZodCatch
2764
2764
  });
2765
2765
  }
2766
2766
  describe(e) {
@@ -2821,11 +2821,11 @@ function qg(r, e) {
2821
2821
  }
2822
2822
  class yt extends ce {
2823
2823
  _parse(e) {
2824
- if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== V.string) {
2824
+ if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== W.string) {
2825
2825
  const i = this._getOrReturnCtx(e);
2826
2826
  return $(i, {
2827
2827
  code: N.invalid_type,
2828
- expected: V.string,
2828
+ expected: W.string,
2829
2829
  received: i.parsedType
2830
2830
  }), te;
2831
2831
  }
@@ -3198,7 +3198,7 @@ class yt extends ce {
3198
3198
  }
3199
3199
  yt.create = (r) => new yt({
3200
3200
  checks: [],
3201
- typeName: ee.ZodString,
3201
+ typeName: X.ZodString,
3202
3202
  coerce: r?.coerce ?? !1,
3203
3203
  ...ie(r)
3204
3204
  });
@@ -3211,11 +3211,11 @@ class ar extends ce {
3211
3211
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
3212
3212
  }
3213
3213
  _parse(e) {
3214
- if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== V.number) {
3214
+ if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== W.number) {
3215
3215
  const i = this._getOrReturnCtx(e);
3216
3216
  return $(i, {
3217
3217
  code: N.invalid_type,
3218
- expected: V.number,
3218
+ expected: W.number,
3219
3219
  received: i.parsedType
3220
3220
  }), te;
3221
3221
  }
@@ -3374,7 +3374,7 @@ class ar extends ce {
3374
3374
  }
3375
3375
  ar.create = (r) => new ar({
3376
3376
  checks: [],
3377
- typeName: ee.ZodNumber,
3377
+ typeName: X.ZodNumber,
3378
3378
  coerce: r?.coerce || !1,
3379
3379
  ...ie(r)
3380
3380
  });
@@ -3389,7 +3389,7 @@ class $r extends ce {
3389
3389
  } catch {
3390
3390
  return this._getInvalidInput(e);
3391
3391
  }
3392
- if (this._getType(e) !== V.bigint)
3392
+ if (this._getType(e) !== W.bigint)
3393
3393
  return this._getInvalidInput(e);
3394
3394
  let n;
3395
3395
  const s = new Pe();
@@ -3417,7 +3417,7 @@ class $r extends ce {
3417
3417
  const t = this._getOrReturnCtx(e);
3418
3418
  return $(t, {
3419
3419
  code: N.invalid_type,
3420
- expected: V.bigint,
3420
+ expected: W.bigint,
3421
3421
  received: t.parsedType
3422
3422
  }), te;
3423
3423
  }
@@ -3507,35 +3507,35 @@ class $r extends ce {
3507
3507
  }
3508
3508
  $r.create = (r) => new $r({
3509
3509
  checks: [],
3510
- typeName: ee.ZodBigInt,
3510
+ typeName: X.ZodBigInt,
3511
3511
  coerce: r?.coerce ?? !1,
3512
3512
  ...ie(r)
3513
3513
  });
3514
3514
  class no extends ce {
3515
3515
  _parse(e) {
3516
- if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== V.boolean) {
3516
+ if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== W.boolean) {
3517
3517
  const n = this._getOrReturnCtx(e);
3518
3518
  return $(n, {
3519
3519
  code: N.invalid_type,
3520
- expected: V.boolean,
3520
+ expected: W.boolean,
3521
3521
  received: n.parsedType
3522
3522
  }), te;
3523
3523
  }
3524
- return Je(e.data);
3524
+ return Qe(e.data);
3525
3525
  }
3526
3526
  }
3527
3527
  no.create = (r) => new no({
3528
- typeName: ee.ZodBoolean,
3528
+ typeName: X.ZodBoolean,
3529
3529
  coerce: r?.coerce || !1,
3530
3530
  ...ie(r)
3531
3531
  });
3532
3532
  class mn extends ce {
3533
3533
  _parse(e) {
3534
- if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== V.date) {
3534
+ if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== W.date) {
3535
3535
  const i = this._getOrReturnCtx(e);
3536
3536
  return $(i, {
3537
3537
  code: N.invalid_type,
3538
- expected: V.date,
3538
+ expected: W.date,
3539
3539
  received: i.parsedType
3540
3540
  }), te;
3541
3541
  }
@@ -3604,58 +3604,58 @@ class mn extends ce {
3604
3604
  mn.create = (r) => new mn({
3605
3605
  checks: [],
3606
3606
  coerce: r?.coerce || !1,
3607
- typeName: ee.ZodDate,
3607
+ typeName: X.ZodDate,
3608
3608
  ...ie(r)
3609
3609
  });
3610
3610
  class uf extends ce {
3611
3611
  _parse(e) {
3612
- if (this._getType(e) !== V.symbol) {
3612
+ if (this._getType(e) !== W.symbol) {
3613
3613
  const n = this._getOrReturnCtx(e);
3614
3614
  return $(n, {
3615
3615
  code: N.invalid_type,
3616
- expected: V.symbol,
3616
+ expected: W.symbol,
3617
3617
  received: n.parsedType
3618
3618
  }), te;
3619
3619
  }
3620
- return Je(e.data);
3620
+ return Qe(e.data);
3621
3621
  }
3622
3622
  }
3623
3623
  uf.create = (r) => new uf({
3624
- typeName: ee.ZodSymbol,
3624
+ typeName: X.ZodSymbol,
3625
3625
  ...ie(r)
3626
3626
  });
3627
3627
  class ff extends ce {
3628
3628
  _parse(e) {
3629
- if (this._getType(e) !== V.undefined) {
3629
+ if (this._getType(e) !== W.undefined) {
3630
3630
  const n = this._getOrReturnCtx(e);
3631
3631
  return $(n, {
3632
3632
  code: N.invalid_type,
3633
- expected: V.undefined,
3633
+ expected: W.undefined,
3634
3634
  received: n.parsedType
3635
3635
  }), te;
3636
3636
  }
3637
- return Je(e.data);
3637
+ return Qe(e.data);
3638
3638
  }
3639
3639
  }
3640
3640
  ff.create = (r) => new ff({
3641
- typeName: ee.ZodUndefined,
3641
+ typeName: X.ZodUndefined,
3642
3642
  ...ie(r)
3643
3643
  });
3644
3644
  class df extends ce {
3645
3645
  _parse(e) {
3646
- if (this._getType(e) !== V.null) {
3646
+ if (this._getType(e) !== W.null) {
3647
3647
  const n = this._getOrReturnCtx(e);
3648
3648
  return $(n, {
3649
3649
  code: N.invalid_type,
3650
- expected: V.null,
3650
+ expected: W.null,
3651
3651
  received: n.parsedType
3652
3652
  }), te;
3653
3653
  }
3654
- return Je(e.data);
3654
+ return Qe(e.data);
3655
3655
  }
3656
3656
  }
3657
3657
  df.create = (r) => new df({
3658
- typeName: ee.ZodNull,
3658
+ typeName: X.ZodNull,
3659
3659
  ...ie(r)
3660
3660
  });
3661
3661
  class so extends ce {
@@ -3663,11 +3663,11 @@ class so extends ce {
3663
3663
  super(...arguments), this._any = !0;
3664
3664
  }
3665
3665
  _parse(e) {
3666
- return Je(e.data);
3666
+ return Qe(e.data);
3667
3667
  }
3668
3668
  }
3669
3669
  so.create = (r) => new so({
3670
- typeName: ee.ZodAny,
3670
+ typeName: X.ZodAny,
3671
3671
  ...ie(r)
3672
3672
  });
3673
3673
  class hf extends ce {
@@ -3675,11 +3675,11 @@ class hf extends ce {
3675
3675
  super(...arguments), this._unknown = !0;
3676
3676
  }
3677
3677
  _parse(e) {
3678
- return Je(e.data);
3678
+ return Qe(e.data);
3679
3679
  }
3680
3680
  }
3681
3681
  hf.create = (r) => new hf({
3682
- typeName: ee.ZodUnknown,
3682
+ typeName: X.ZodUnknown,
3683
3683
  ...ie(r)
3684
3684
  });
3685
3685
  class Nt extends ce {
@@ -3687,39 +3687,39 @@ class Nt extends ce {
3687
3687
  const t = this._getOrReturnCtx(e);
3688
3688
  return $(t, {
3689
3689
  code: N.invalid_type,
3690
- expected: V.never,
3690
+ expected: W.never,
3691
3691
  received: t.parsedType
3692
3692
  }), te;
3693
3693
  }
3694
3694
  }
3695
3695
  Nt.create = (r) => new Nt({
3696
- typeName: ee.ZodNever,
3696
+ typeName: X.ZodNever,
3697
3697
  ...ie(r)
3698
3698
  });
3699
3699
  class mf extends ce {
3700
3700
  _parse(e) {
3701
- if (this._getType(e) !== V.undefined) {
3701
+ if (this._getType(e) !== W.undefined) {
3702
3702
  const n = this._getOrReturnCtx(e);
3703
3703
  return $(n, {
3704
3704
  code: N.invalid_type,
3705
- expected: V.void,
3705
+ expected: W.void,
3706
3706
  received: n.parsedType
3707
3707
  }), te;
3708
3708
  }
3709
- return Je(e.data);
3709
+ return Qe(e.data);
3710
3710
  }
3711
3711
  }
3712
3712
  mf.create = (r) => new mf({
3713
- typeName: ee.ZodVoid,
3713
+ typeName: X.ZodVoid,
3714
3714
  ...ie(r)
3715
3715
  });
3716
3716
  class at extends ce {
3717
3717
  _parse(e) {
3718
3718
  const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
3719
- if (t.parsedType !== V.array)
3719
+ if (t.parsedType !== W.array)
3720
3720
  return $(t, {
3721
3721
  code: N.invalid_type,
3722
- expected: V.array,
3722
+ expected: W.array,
3723
3723
  received: t.parsedType
3724
3724
  }), te;
3725
3725
  if (s.exactLength !== null) {
@@ -3783,7 +3783,7 @@ at.create = (r, e) => new at({
3783
3783
  minLength: null,
3784
3784
  maxLength: null,
3785
3785
  exactLength: null,
3786
- typeName: ee.ZodArray,
3786
+ typeName: X.ZodArray,
3787
3787
  ...ie(e)
3788
3788
  });
3789
3789
  function Qt(r) {
@@ -3813,11 +3813,11 @@ class Re extends ce {
3813
3813
  return this._cached = { shape: e, keys: t }, this._cached;
3814
3814
  }
3815
3815
  _parse(e) {
3816
- if (this._getType(e) !== V.object) {
3816
+ if (this._getType(e) !== W.object) {
3817
3817
  const l = this._getOrReturnCtx(e);
3818
3818
  return $(l, {
3819
3819
  code: N.invalid_type,
3820
- expected: V.object,
3820
+ expected: W.object,
3821
3821
  received: l.parsedType
3822
3822
  }), te;
3823
3823
  }
@@ -3945,7 +3945,7 @@ class Re extends ce {
3945
3945
  ...this._def.shape(),
3946
3946
  ...e._def.shape()
3947
3947
  }),
3948
- typeName: ee.ZodObject
3948
+ typeName: X.ZodObject
3949
3949
  });
3950
3950
  }
3951
3951
  // merge<
@@ -4072,21 +4072,21 @@ Re.create = (r, e) => new Re({
4072
4072
  shape: () => r,
4073
4073
  unknownKeys: "strip",
4074
4074
  catchall: Nt.create(),
4075
- typeName: ee.ZodObject,
4075
+ typeName: X.ZodObject,
4076
4076
  ...ie(e)
4077
4077
  });
4078
4078
  Re.strictCreate = (r, e) => new Re({
4079
4079
  shape: () => r,
4080
4080
  unknownKeys: "strict",
4081
4081
  catchall: Nt.create(),
4082
- typeName: ee.ZodObject,
4082
+ typeName: X.ZodObject,
4083
4083
  ...ie(e)
4084
4084
  });
4085
4085
  Re.lazycreate = (r, e) => new Re({
4086
4086
  shape: r,
4087
4087
  unknownKeys: "strip",
4088
4088
  catchall: Nt.create(),
4089
- typeName: ee.ZodObject,
4089
+ typeName: X.ZodObject,
4090
4090
  ...ie(e)
4091
4091
  });
4092
4092
  class pn extends ce {
@@ -4159,14 +4159,14 @@ class pn extends ce {
4159
4159
  }
4160
4160
  pn.create = (r, e) => new pn({
4161
4161
  options: r,
4162
- typeName: ee.ZodUnion,
4162
+ typeName: X.ZodUnion,
4163
4163
  ...ie(e)
4164
4164
  });
4165
4165
  function io(r, e) {
4166
4166
  const t = Tt(r), n = Tt(e);
4167
4167
  if (r === e)
4168
4168
  return { valid: !0, data: r };
4169
- if (t === V.object && n === V.object) {
4169
+ if (t === W.object && n === W.object) {
4170
4170
  const s = ue.objectKeys(e), i = ue.objectKeys(r).filter((o) => s.indexOf(o) !== -1), a = { ...r, ...e };
4171
4171
  for (const o of i) {
4172
4172
  const c = io(r[o], e[o]);
@@ -4175,7 +4175,7 @@ function io(r, e) {
4175
4175
  a[o] = c.data;
4176
4176
  }
4177
4177
  return { valid: !0, data: a };
4178
- } else if (t === V.array && n === V.array) {
4178
+ } else if (t === W.array && n === W.array) {
4179
4179
  if (r.length !== e.length)
4180
4180
  return { valid: !1 };
4181
4181
  const s = [];
@@ -4186,7 +4186,7 @@ function io(r, e) {
4186
4186
  s.push(c.data);
4187
4187
  }
4188
4188
  return { valid: !0, data: s };
4189
- } else return t === V.date && n === V.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
4189
+ } else return t === W.date && n === W.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
4190
4190
  }
4191
4191
  class yn extends ce {
4192
4192
  _parse(e) {
@@ -4223,16 +4223,16 @@ class yn extends ce {
4223
4223
  yn.create = (r, e, t) => new yn({
4224
4224
  left: r,
4225
4225
  right: e,
4226
- typeName: ee.ZodIntersection,
4226
+ typeName: X.ZodIntersection,
4227
4227
  ...ie(t)
4228
4228
  });
4229
4229
  class Wt extends ce {
4230
4230
  _parse(e) {
4231
4231
  const { status: t, ctx: n } = this._processInputParams(e);
4232
- if (n.parsedType !== V.array)
4232
+ if (n.parsedType !== W.array)
4233
4233
  return $(n, {
4234
4234
  code: N.invalid_type,
4235
- expected: V.array,
4235
+ expected: W.array,
4236
4236
  received: n.parsedType
4237
4237
  }), te;
4238
4238
  if (n.data.length < this._def.items.length)
@@ -4271,7 +4271,7 @@ Wt.create = (r, e) => {
4271
4271
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
4272
4272
  return new Wt({
4273
4273
  items: r,
4274
- typeName: ee.ZodTuple,
4274
+ typeName: X.ZodTuple,
4275
4275
  rest: null,
4276
4276
  ...ie(e)
4277
4277
  });
@@ -4285,10 +4285,10 @@ class gn extends ce {
4285
4285
  }
4286
4286
  _parse(e) {
4287
4287
  const { status: t, ctx: n } = this._processInputParams(e);
4288
- if (n.parsedType !== V.object)
4288
+ if (n.parsedType !== W.object)
4289
4289
  return $(n, {
4290
4290
  code: N.invalid_type,
4291
- expected: V.object,
4291
+ expected: W.object,
4292
4292
  received: n.parsedType
4293
4293
  }), te;
4294
4294
  const s = [], i = this._def.keyType, a = this._def.valueType;
@@ -4307,12 +4307,12 @@ class gn extends ce {
4307
4307
  return t instanceof ce ? new gn({
4308
4308
  keyType: e,
4309
4309
  valueType: t,
4310
- typeName: ee.ZodRecord,
4310
+ typeName: X.ZodRecord,
4311
4311
  ...ie(n)
4312
4312
  }) : new gn({
4313
4313
  keyType: yt.create(),
4314
4314
  valueType: e,
4315
- typeName: ee.ZodRecord,
4315
+ typeName: X.ZodRecord,
4316
4316
  ...ie(t)
4317
4317
  });
4318
4318
  }
@@ -4326,10 +4326,10 @@ class pf extends ce {
4326
4326
  }
4327
4327
  _parse(e) {
4328
4328
  const { status: t, ctx: n } = this._processInputParams(e);
4329
- if (n.parsedType !== V.map)
4329
+ if (n.parsedType !== W.map)
4330
4330
  return $(n, {
4331
4331
  code: N.invalid_type,
4332
- expected: V.map,
4332
+ expected: W.map,
4333
4333
  received: n.parsedType
4334
4334
  }), te;
4335
4335
  const s = this._def.keyType, i = this._def.valueType, a = [...n.data.entries()].map(([o, c], l) => ({
@@ -4362,16 +4362,16 @@ class pf extends ce {
4362
4362
  pf.create = (r, e, t) => new pf({
4363
4363
  valueType: e,
4364
4364
  keyType: r,
4365
- typeName: ee.ZodMap,
4365
+ typeName: X.ZodMap,
4366
4366
  ...ie(t)
4367
4367
  });
4368
4368
  class jr extends ce {
4369
4369
  _parse(e) {
4370
4370
  const { status: t, ctx: n } = this._processInputParams(e);
4371
- if (n.parsedType !== V.set)
4371
+ if (n.parsedType !== W.set)
4372
4372
  return $(n, {
4373
4373
  code: N.invalid_type,
4374
- expected: V.set,
4374
+ expected: W.set,
4375
4375
  received: n.parsedType
4376
4376
  }), te;
4377
4377
  const s = this._def;
@@ -4426,7 +4426,7 @@ jr.create = (r, e) => new jr({
4426
4426
  valueType: r,
4427
4427
  minSize: null,
4428
4428
  maxSize: null,
4429
- typeName: ee.ZodSet,
4429
+ typeName: X.ZodSet,
4430
4430
  ...ie(e)
4431
4431
  });
4432
4432
  class yf extends ce {
@@ -4440,7 +4440,7 @@ class yf extends ce {
4440
4440
  }
4441
4441
  yf.create = (r, e) => new yf({
4442
4442
  getter: r,
4443
- typeName: ee.ZodLazy,
4443
+ typeName: X.ZodLazy,
4444
4444
  ...ie(e)
4445
4445
  });
4446
4446
  class ao extends ce {
@@ -4461,13 +4461,13 @@ class ao extends ce {
4461
4461
  }
4462
4462
  ao.create = (r, e) => new ao({
4463
4463
  value: r,
4464
- typeName: ee.ZodLiteral,
4464
+ typeName: X.ZodLiteral,
4465
4465
  ...ie(e)
4466
4466
  });
4467
4467
  function nh(r, e) {
4468
4468
  return new or({
4469
4469
  values: r,
4470
- typeName: ee.ZodEnum,
4470
+ typeName: X.ZodEnum,
4471
4471
  ...ie(e)
4472
4472
  });
4473
4473
  }
@@ -4489,7 +4489,7 @@ class or extends ce {
4489
4489
  options: n
4490
4490
  }), te;
4491
4491
  }
4492
- return Je(e.data);
4492
+ return Qe(e.data);
4493
4493
  }
4494
4494
  get options() {
4495
4495
  return this._def.values;
@@ -4529,7 +4529,7 @@ or.create = nh;
4529
4529
  class gf extends ce {
4530
4530
  _parse(e) {
4531
4531
  const t = ue.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
4532
- if (n.parsedType !== V.string && n.parsedType !== V.number) {
4532
+ if (n.parsedType !== W.string && n.parsedType !== W.number) {
4533
4533
  const s = ue.objectValues(t);
4534
4534
  return $(n, {
4535
4535
  expected: ue.joinValues(s),
@@ -4545,7 +4545,7 @@ class gf extends ce {
4545
4545
  options: s
4546
4546
  }), te;
4547
4547
  }
4548
- return Je(e.data);
4548
+ return Qe(e.data);
4549
4549
  }
4550
4550
  get enum() {
4551
4551
  return this._def.values;
@@ -4553,7 +4553,7 @@ class gf extends ce {
4553
4553
  }
4554
4554
  gf.create = (r, e) => new gf({
4555
4555
  values: r,
4556
- typeName: ee.ZodNativeEnum,
4556
+ typeName: X.ZodNativeEnum,
4557
4557
  ...ie(e)
4558
4558
  });
4559
4559
  class _n extends ce {
@@ -4562,14 +4562,14 @@ class _n extends ce {
4562
4562
  }
4563
4563
  _parse(e) {
4564
4564
  const { ctx: t } = this._processInputParams(e);
4565
- if (t.parsedType !== V.promise && t.common.async === !1)
4565
+ if (t.parsedType !== W.promise && t.common.async === !1)
4566
4566
  return $(t, {
4567
4567
  code: N.invalid_type,
4568
- expected: V.promise,
4568
+ expected: W.promise,
4569
4569
  received: t.parsedType
4570
4570
  }), te;
4571
- const n = t.parsedType === V.promise ? t.data : Promise.resolve(t.data);
4572
- return Je(n.then((s) => this._def.type.parseAsync(s, {
4571
+ const n = t.parsedType === W.promise ? t.data : Promise.resolve(t.data);
4572
+ return Qe(n.then((s) => this._def.type.parseAsync(s, {
4573
4573
  path: t.path,
4574
4574
  errorMap: t.common.contextualErrorMap
4575
4575
  })));
@@ -4577,7 +4577,7 @@ class _n extends ce {
4577
4577
  }
4578
4578
  _n.create = (r, e) => new _n({
4579
4579
  type: r,
4580
- typeName: ee.ZodPromise,
4580
+ typeName: X.ZodPromise,
4581
4581
  ...ie(e)
4582
4582
  });
4583
4583
  class cr extends ce {
@@ -4585,7 +4585,7 @@ class cr extends ce {
4585
4585
  return this._def.schema;
4586
4586
  }
4587
4587
  sourceType() {
4588
- return this._def.schema._def.typeName === ee.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
4588
+ return this._def.schema._def.typeName === X.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
4589
4589
  }
4590
4590
  _parse(e) {
4591
4591
  const { status: t, ctx: n } = this._processInputParams(e), s = this._def.effect || null, i = {
@@ -4662,19 +4662,19 @@ class cr extends ce {
4662
4662
  }
4663
4663
  cr.create = (r, e, t) => new cr({
4664
4664
  schema: r,
4665
- typeName: ee.ZodEffects,
4665
+ typeName: X.ZodEffects,
4666
4666
  effect: e,
4667
4667
  ...ie(t)
4668
4668
  });
4669
4669
  cr.createWithPreprocess = (r, e, t) => new cr({
4670
4670
  schema: e,
4671
4671
  effect: { type: "preprocess", transform: r },
4672
- typeName: ee.ZodEffects,
4672
+ typeName: X.ZodEffects,
4673
4673
  ...ie(t)
4674
4674
  });
4675
4675
  class kt extends ce {
4676
4676
  _parse(e) {
4677
- return this._getType(e) === V.undefined ? Je(void 0) : this._def.innerType._parse(e);
4677
+ return this._getType(e) === W.undefined ? Qe(void 0) : this._def.innerType._parse(e);
4678
4678
  }
4679
4679
  unwrap() {
4680
4680
  return this._def.innerType;
@@ -4682,12 +4682,12 @@ class kt extends ce {
4682
4682
  }
4683
4683
  kt.create = (r, e) => new kt({
4684
4684
  innerType: r,
4685
- typeName: ee.ZodOptional,
4685
+ typeName: X.ZodOptional,
4686
4686
  ...ie(e)
4687
4687
  });
4688
4688
  class lr extends ce {
4689
4689
  _parse(e) {
4690
- return this._getType(e) === V.null ? Je(null) : this._def.innerType._parse(e);
4690
+ return this._getType(e) === W.null ? Qe(null) : this._def.innerType._parse(e);
4691
4691
  }
4692
4692
  unwrap() {
4693
4693
  return this._def.innerType;
@@ -4695,14 +4695,14 @@ class lr extends ce {
4695
4695
  }
4696
4696
  lr.create = (r, e) => new lr({
4697
4697
  innerType: r,
4698
- typeName: ee.ZodNullable,
4698
+ typeName: X.ZodNullable,
4699
4699
  ...ie(e)
4700
4700
  });
4701
4701
  class oo extends ce {
4702
4702
  _parse(e) {
4703
4703
  const { ctx: t } = this._processInputParams(e);
4704
4704
  let n = t.data;
4705
- return t.parsedType === V.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
4705
+ return t.parsedType === W.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
4706
4706
  data: n,
4707
4707
  path: t.path,
4708
4708
  parent: t
@@ -4714,7 +4714,7 @@ class oo extends ce {
4714
4714
  }
4715
4715
  oo.create = (r, e) => new oo({
4716
4716
  innerType: r,
4717
- typeName: ee.ZodDefault,
4717
+ typeName: X.ZodDefault,
4718
4718
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
4719
4719
  ...ie(e)
4720
4720
  });
@@ -4757,17 +4757,17 @@ class co extends ce {
4757
4757
  }
4758
4758
  co.create = (r, e) => new co({
4759
4759
  innerType: r,
4760
- typeName: ee.ZodCatch,
4760
+ typeName: X.ZodCatch,
4761
4761
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
4762
4762
  ...ie(e)
4763
4763
  });
4764
4764
  class _f extends ce {
4765
4765
  _parse(e) {
4766
- if (this._getType(e) !== V.nan) {
4766
+ if (this._getType(e) !== W.nan) {
4767
4767
  const n = this._getOrReturnCtx(e);
4768
4768
  return $(n, {
4769
4769
  code: N.invalid_type,
4770
- expected: V.nan,
4770
+ expected: W.nan,
4771
4771
  received: n.parsedType
4772
4772
  }), te;
4773
4773
  }
@@ -4775,7 +4775,7 @@ class _f extends ce {
4775
4775
  }
4776
4776
  }
4777
4777
  _f.create = (r) => new _f({
4778
- typeName: ee.ZodNaN,
4778
+ typeName: X.ZodNaN,
4779
4779
  ...ie(r)
4780
4780
  });
4781
4781
  class $g extends ce {
@@ -4827,7 +4827,7 @@ class Yo extends ce {
4827
4827
  return new Yo({
4828
4828
  in: e,
4829
4829
  out: t,
4830
- typeName: ee.ZodPipeline
4830
+ typeName: X.ZodPipeline
4831
4831
  });
4832
4832
  }
4833
4833
  }
@@ -4842,13 +4842,13 @@ class lo extends ce {
4842
4842
  }
4843
4843
  lo.create = (r, e) => new lo({
4844
4844
  innerType: r,
4845
- typeName: ee.ZodReadonly,
4845
+ typeName: X.ZodReadonly,
4846
4846
  ...ie(e)
4847
4847
  });
4848
- var ee;
4848
+ var X;
4849
4849
  (function(r) {
4850
4850
  r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
4851
- })(ee || (ee = {}));
4851
+ })(X || (X = {}));
4852
4852
  const pt = yt.create, uo = ar.create, jg = no.create, Ut = so.create;
4853
4853
  Nt.create;
4854
4854
  const Ln = at.create, sh = Re.create, vn = pn.create;
@@ -4987,14 +4987,14 @@ class ah extends Gt {
4987
4987
  super(`Invalid unit ${e}`);
4988
4988
  }
4989
4989
  }
4990
- class Ne extends Gt {
4990
+ class xe extends Gt {
4991
4991
  }
4992
4992
  class Et extends Gt {
4993
4993
  constructor() {
4994
4994
  super("Zone is an abstract class");
4995
4995
  }
4996
4996
  }
4997
- const L = "numeric", st = "short", Le = "long", bn = {
4997
+ const L = "numeric", st = "short", $e = "long", bn = {
4998
4998
  year: L,
4999
4999
  month: L,
5000
5000
  day: L
@@ -5009,13 +5009,13 @@ const L = "numeric", st = "short", Le = "long", bn = {
5009
5009
  weekday: st
5010
5010
  }, ch = {
5011
5011
  year: L,
5012
- month: Le,
5012
+ month: $e,
5013
5013
  day: L
5014
5014
  }, lh = {
5015
5015
  year: L,
5016
- month: Le,
5016
+ month: $e,
5017
5017
  day: L,
5018
- weekday: Le
5018
+ weekday: $e
5019
5019
  }, uh = {
5020
5020
  hour: L,
5021
5021
  minute: L
@@ -5032,7 +5032,7 @@ const L = "numeric", st = "short", Le = "long", bn = {
5032
5032
  hour: L,
5033
5033
  minute: L,
5034
5034
  second: L,
5035
- timeZoneName: Le
5035
+ timeZoneName: $e
5036
5036
  }, mh = {
5037
5037
  hour: L,
5038
5038
  minute: L,
@@ -5053,7 +5053,7 @@ const L = "numeric", st = "short", Le = "long", bn = {
5053
5053
  minute: L,
5054
5054
  second: L,
5055
5055
  hourCycle: "h23",
5056
- timeZoneName: Le
5056
+ timeZoneName: $e
5057
5057
  }, _h = {
5058
5058
  year: L,
5059
5059
  month: L,
@@ -5089,14 +5089,14 @@ const L = "numeric", st = "short", Le = "long", bn = {
5089
5089
  minute: L
5090
5090
  }, Oh = {
5091
5091
  year: L,
5092
- month: Le,
5092
+ month: $e,
5093
5093
  day: L,
5094
5094
  hour: L,
5095
5095
  minute: L,
5096
5096
  timeZoneName: st
5097
5097
  }, Eh = {
5098
5098
  year: L,
5099
- month: Le,
5099
+ month: $e,
5100
5100
  day: L,
5101
5101
  hour: L,
5102
5102
  minute: L,
@@ -5104,21 +5104,21 @@ const L = "numeric", st = "short", Le = "long", bn = {
5104
5104
  timeZoneName: st
5105
5105
  }, Sh = {
5106
5106
  year: L,
5107
- month: Le,
5107
+ month: $e,
5108
5108
  day: L,
5109
- weekday: Le,
5109
+ weekday: $e,
5110
5110
  hour: L,
5111
5111
  minute: L,
5112
- timeZoneName: Le
5112
+ timeZoneName: $e
5113
5113
  }, Th = {
5114
5114
  year: L,
5115
- month: Le,
5115
+ month: $e,
5116
5116
  day: L,
5117
- weekday: Le,
5117
+ weekday: $e,
5118
5118
  hour: L,
5119
5119
  minute: L,
5120
5120
  second: L,
5121
- timeZoneName: Le
5121
+ timeZoneName: $e
5122
5122
  };
5123
5123
  class Gr {
5124
5124
  /**
@@ -5278,7 +5278,7 @@ function Qg(r, e) {
5278
5278
  const t = r.formatToParts(e), n = [];
5279
5279
  for (let s = 0; s < t.length; s++) {
5280
5280
  const { type: i, value: a } = t[s], o = Yg[i];
5281
- i === "era" ? n[o] = a : X(o) || (n[o] = parseInt(a, 10));
5281
+ i === "era" ? n[o] = a : Q(o) || (n[o] = parseInt(a, 10));
5282
5282
  }
5283
5283
  return n;
5284
5284
  }
@@ -5590,7 +5590,7 @@ class de {
5590
5590
  );
5591
5591
  }
5592
5592
  static create(e, t, n, s, i = !1) {
5593
- const a = e || be.defaultLocale, o = a || (i ? "en-US" : r_()), c = t || be.defaultNumberingSystem, l = n || be.defaultOutputCalendar, u = Oo(s) || be.defaultWeekSettings;
5593
+ const a = e || Oe.defaultLocale, o = a || (i ? "en-US" : r_()), c = t || Oe.defaultNumberingSystem, l = n || Oe.defaultOutputCalendar, u = Oo(s) || Oe.defaultWeekSettings;
5594
5594
  return new de(o, c, l, u, a);
5595
5595
  }
5596
5596
  static resetCache() {
@@ -5865,7 +5865,7 @@ class d_ extends Gr {
5865
5865
  }
5866
5866
  }
5867
5867
  function Ct(r, e) {
5868
- if (X(r) || r === null)
5868
+ if (Q(r) || r === null)
5869
5869
  return e;
5870
5870
  if (r instanceof Gr)
5871
5871
  return r;
@@ -5947,7 +5947,7 @@ function et({ numberingSystem: r }, e = "") {
5947
5947
  return s === void 0 && (s = new RegExp(`${Qo[t]}${e}`), n.set(e, s)), s;
5948
5948
  }
5949
5949
  let Of = () => Date.now(), Ef = "system", Sf = null, Tf = null, Rf = null, Af = 60, Cf, kf = null;
5950
- class be {
5950
+ class Oe {
5951
5951
  /**
5952
5952
  * Get the callback for returning the current timestamp.
5953
5953
  * @type {function}
@@ -6095,7 +6095,7 @@ class nt {
6095
6095
  }
6096
6096
  }
6097
6097
  const Ch = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], kh = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
6098
- function Ze(r, e) {
6098
+ function Ge(r, e) {
6099
6099
  return new nt(
6100
6100
  "unit out of range",
6101
6101
  `you specified ${e} (of type ${typeof e}) as a ${r}, which is invalid`
@@ -6138,12 +6138,12 @@ function xf(r) {
6138
6138
  return { year: e, month: n, day: s, ...Wn(r) };
6139
6139
  }
6140
6140
  function Nf(r, e) {
6141
- if (!X(r.localWeekday) || !X(r.localWeekNumber) || !X(r.localWeekYear)) {
6142
- if (!X(r.weekday) || !X(r.weekNumber) || !X(r.weekYear))
6141
+ if (!Q(r.localWeekday) || !Q(r.localWeekNumber) || !Q(r.localWeekYear)) {
6142
+ if (!Q(r.weekday) || !Q(r.weekNumber) || !Q(r.weekYear))
6143
6143
  throw new er(
6144
6144
  "Cannot mix locale-based week fields with ISO-based week fields"
6145
6145
  );
6146
- return X(r.localWeekday) || (r.weekday = r.localWeekday), X(r.localWeekNumber) || (r.weekNumber = r.localWeekNumber), X(r.localWeekYear) || (r.weekYear = r.localWeekYear), delete r.localWeekday, delete r.localWeekNumber, delete r.localWeekYear, {
6146
+ return Q(r.localWeekday) || (r.weekday = r.localWeekday), Q(r.localWeekNumber) || (r.weekNumber = r.localWeekNumber), Q(r.localWeekYear) || (r.weekYear = r.localWeekYear), delete r.localWeekday, delete r.localWeekNumber, delete r.localWeekYear, {
6147
6147
  minDaysInFirstWeek: e.getMinDaysInFirstWeek(),
6148
6148
  startOfWeek: e.getStartOfWeek()
6149
6149
  };
@@ -6151,26 +6151,26 @@ function Nf(r, e) {
6151
6151
  return { minDaysInFirstWeek: 4, startOfWeek: 1 };
6152
6152
  }
6153
6153
  function y_(r, e = 4, t = 1) {
6154
- const n = jn(r.weekYear), s = Ge(
6154
+ const n = jn(r.weekYear), s = He(
6155
6155
  r.weekNumber,
6156
6156
  1,
6157
6157
  Ur(r.weekYear, e, t)
6158
- ), i = Ge(r.weekday, 1, 7);
6159
- return n ? s ? i ? !1 : Ze("weekday", r.weekday) : Ze("week", r.weekNumber) : Ze("weekYear", r.weekYear);
6158
+ ), i = He(r.weekday, 1, 7);
6159
+ return n ? s ? i ? !1 : Ge("weekday", r.weekday) : Ge("week", r.weekNumber) : Ge("weekYear", r.weekYear);
6160
6160
  }
6161
6161
  function g_(r) {
6162
- const e = jn(r.year), t = Ge(r.ordinal, 1, rr(r.year));
6163
- return e ? t ? !1 : Ze("ordinal", r.ordinal) : Ze("year", r.year);
6162
+ const e = jn(r.year), t = He(r.ordinal, 1, rr(r.year));
6163
+ return e ? t ? !1 : Ge("ordinal", r.ordinal) : Ge("year", r.year);
6164
6164
  }
6165
6165
  function Nh(r) {
6166
- const e = jn(r.year), t = Ge(r.month, 1, 12), n = Ge(r.day, 1, En(r.year, r.month));
6167
- return e ? t ? n ? !1 : Ze("day", r.day) : Ze("month", r.month) : Ze("year", r.year);
6166
+ const e = jn(r.year), t = He(r.month, 1, 12), n = He(r.day, 1, En(r.year, r.month));
6167
+ return e ? t ? n ? !1 : Ge("day", r.day) : Ge("month", r.month) : Ge("year", r.year);
6168
6168
  }
6169
6169
  function Fh(r) {
6170
- const { hour: e, minute: t, second: n, millisecond: s } = r, i = Ge(e, 0, 23) || e === 24 && t === 0 && n === 0 && s === 0, a = Ge(t, 0, 59), o = Ge(n, 0, 59), c = Ge(s, 0, 999);
6171
- return i ? a ? o ? c ? !1 : Ze("millisecond", s) : Ze("second", n) : Ze("minute", t) : Ze("hour", e);
6170
+ const { hour: e, minute: t, second: n, millisecond: s } = r, i = He(e, 0, 23) || e === 24 && t === 0 && n === 0 && s === 0, a = He(t, 0, 59), o = He(n, 0, 59), c = He(s, 0, 999);
6171
+ return i ? a ? o ? c ? !1 : Ge("millisecond", s) : Ge("second", n) : Ge("minute", t) : Ge("hour", e);
6172
6172
  }
6173
- function X(r) {
6173
+ function Q(r) {
6174
6174
  return typeof r > "u";
6175
6175
  }
6176
6176
  function It(r) {
@@ -6219,16 +6219,16 @@ function Oo(r) {
6219
6219
  if (r == null)
6220
6220
  return null;
6221
6221
  if (typeof r != "object")
6222
- throw new Ne("Week settings must be an object");
6223
- if (!Ge(r.firstDay, 1, 7) || !Ge(r.minimalDays, 1, 7) || !Array.isArray(r.weekend) || r.weekend.some((e) => !Ge(e, 1, 7)))
6224
- throw new Ne("Invalid week settings");
6222
+ throw new xe("Week settings must be an object");
6223
+ if (!He(r.firstDay, 1, 7) || !He(r.minimalDays, 1, 7) || !Array.isArray(r.weekend) || r.weekend.some((e) => !He(e, 1, 7)))
6224
+ throw new xe("Invalid week settings");
6225
6225
  return {
6226
6226
  firstDay: r.firstDay,
6227
6227
  minimalDays: r.minimalDays,
6228
6228
  weekend: Array.from(r.weekend)
6229
6229
  };
6230
6230
  }
6231
- function Ge(r, e, t) {
6231
+ function He(r, e, t) {
6232
6232
  return jn(r) && r >= e && r <= t;
6233
6233
  }
6234
6234
  function O_(r, e) {
@@ -6240,15 +6240,15 @@ function Ae(r, e = 2) {
6240
6240
  return t ? n = "-" + ("" + -r).padStart(e, "0") : n = ("" + r).padStart(e, "0"), n;
6241
6241
  }
6242
6242
  function Rt(r) {
6243
- if (!(X(r) || r === null || r === ""))
6243
+ if (!(Q(r) || r === null || r === ""))
6244
6244
  return parseInt(r, 10);
6245
6245
  }
6246
6246
  function qt(r) {
6247
- if (!(X(r) || r === null || r === ""))
6247
+ if (!(Q(r) || r === null || r === ""))
6248
6248
  return parseFloat(r);
6249
6249
  }
6250
6250
  function tc(r) {
6251
- if (!(X(r) || r === null || r === "")) {
6251
+ if (!(Q(r) || r === null || r === "")) {
6252
6252
  const e = parseFloat("0." + r) * 1e3;
6253
6253
  return Math.floor(e);
6254
6254
  }
@@ -6300,7 +6300,7 @@ function Ur(r, e = 4, t = 1) {
6300
6300
  return (rr(r) - n + s) / 7;
6301
6301
  }
6302
6302
  function Eo(r) {
6303
- return r > 99 ? r : r > be.twoDigitCutoffYear ? 1900 + r : 2e3 + r;
6303
+ return r > 99 ? r : r > Oe.twoDigitCutoffYear ? 1900 + r : 2e3 + r;
6304
6304
  }
6305
6305
  function Ph(r, e, t, n = null) {
6306
6306
  const s = new Date(r), i = {
@@ -6324,7 +6324,7 @@ function Vn(r, e) {
6324
6324
  function qh(r) {
6325
6325
  const e = Number(r);
6326
6326
  if (typeof r == "boolean" || r === "" || !Number.isFinite(e))
6327
- throw new Ne(`Invalid unit value ${r}`);
6327
+ throw new xe(`Invalid unit value ${r}`);
6328
6328
  return e;
6329
6329
  }
6330
6330
  function Sn(r, e) {
@@ -6497,9 +6497,9 @@ const D_ = {
6497
6497
  FFF: Eh,
6498
6498
  FFFF: Th
6499
6499
  };
6500
- class Fe {
6500
+ class Ne {
6501
6501
  static create(e, t = {}) {
6502
- return new Fe(e, t);
6502
+ return new Ne(e, t);
6503
6503
  }
6504
6504
  static parseFormat(e) {
6505
6505
  let t = null, n = "", s = !1;
@@ -6548,7 +6548,7 @@ class Fe {
6548
6548
  m ? { weekday: h } : { weekday: h, month: "long", day: "numeric" },
6549
6549
  "weekday"
6550
6550
  ), u = (h) => {
6551
- const m = Fe.macroTokenToFormatOpts(h);
6551
+ const m = Ne.macroTokenToFormatOpts(h);
6552
6552
  return m ? this.formatWithSystemDefault(e, m) : h;
6553
6553
  }, f = (h) => n ? N_(e, h) : i({ era: h }, "era"), d = (h) => {
6554
6554
  switch (h) {
@@ -6693,7 +6693,7 @@ class Fe {
6693
6693
  return u(h);
6694
6694
  }
6695
6695
  };
6696
- return Mf(Fe.parseFormat(t), d);
6696
+ return Mf(Ne.parseFormat(t), d);
6697
6697
  }
6698
6698
  formatDurationFromString(e, t) {
6699
6699
  const n = this.opts.signMode === "negativeLargestOnly" ? -1 : 1, s = (u) => {
@@ -6725,7 +6725,7 @@ class Fe {
6725
6725
  return this.opts.signMode === "negativeLargestOnly" && h !== f.largestUnit ? E = "never" : this.opts.signMode === "all" ? E = "always" : E = "auto", this.num(u.get(h) * m, d.length, E);
6726
6726
  } else
6727
6727
  return d;
6728
- }, a = Fe.parseFormat(t), o = a.reduce(
6728
+ }, a = Ne.parseFormat(t), o = a.reduce(
6729
6729
  (u, { literal: f, val: d }) => f ? u : u.concat(d),
6730
6730
  []
6731
6731
  ), c = e.shiftTo(...o.map(s).filter((u) => u)), l = {
@@ -6775,7 +6775,7 @@ const Gh = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, M_ = `(?:${Gh.source}?(?:\\[(${
6775
6775
  ), V_ = RegExp(`(?: ${Kh.source})?`);
6776
6776
  function nr(r, e, t) {
6777
6777
  const n = r[e];
6778
- return X(n) ? t : Rt(n);
6778
+ return Q(n) ? t : Rt(n);
6779
6779
  }
6780
6780
  function W_(r, e) {
6781
6781
  return [{
@@ -6973,25 +6973,25 @@ const qf = "Invalid Duration", Jh = {
6973
6973
  milliseconds: 720 * 60 * 60 * 1e3
6974
6974
  },
6975
6975
  ...Jh
6976
- }, ze = 146097 / 400, Kt = 146097 / 4800, vv = {
6976
+ }, Be = 146097 / 400, Kt = 146097 / 4800, vv = {
6977
6977
  years: {
6978
6978
  quarters: 4,
6979
6979
  months: 12,
6980
- weeks: ze / 7,
6981
- days: ze,
6982
- hours: ze * 24,
6983
- minutes: ze * 24 * 60,
6984
- seconds: ze * 24 * 60 * 60,
6985
- milliseconds: ze * 24 * 60 * 60 * 1e3
6980
+ weeks: Be / 7,
6981
+ days: Be,
6982
+ hours: Be * 24,
6983
+ minutes: Be * 24 * 60,
6984
+ seconds: Be * 24 * 60 * 60,
6985
+ milliseconds: Be * 24 * 60 * 60 * 1e3
6986
6986
  },
6987
6987
  quarters: {
6988
6988
  months: 3,
6989
- weeks: ze / 28,
6990
- days: ze / 4,
6991
- hours: ze * 24 / 4,
6992
- minutes: ze * 24 * 60 / 4,
6993
- seconds: ze * 24 * 60 * 60 / 4,
6994
- milliseconds: ze * 24 * 60 * 60 * 1e3 / 4
6989
+ weeks: Be / 28,
6990
+ days: Be / 4,
6991
+ hours: Be * 24 / 4,
6992
+ minutes: Be * 24 * 60 / 4,
6993
+ seconds: Be * 24 * 60 * 60 / 4,
6994
+ milliseconds: Be * 24 * 60 * 60 * 1e3 / 4
6995
6995
  },
6996
6996
  months: {
6997
6997
  weeks: Kt / 7,
@@ -7031,7 +7031,7 @@ function Qh(r, e) {
7031
7031
  function Lf(r, e) {
7032
7032
  const t = Qh(r, e) < 0 ? -1 : 1;
7033
7033
  Vt.reduceRight((n, s) => {
7034
- if (X(e[s]))
7034
+ if (Q(e[s]))
7035
7035
  return n;
7036
7036
  if (n) {
7037
7037
  const i = e[n] * t, a = r[s][n], o = Math.floor(i / a);
@@ -7039,7 +7039,7 @@ function Lf(r, e) {
7039
7039
  }
7040
7040
  return s;
7041
7041
  }, null), Vt.reduce((n, s) => {
7042
- if (X(e[s]))
7042
+ if (Q(e[s]))
7043
7043
  return n;
7044
7044
  if (n) {
7045
7045
  const i = e[n] % 1;
@@ -7097,7 +7097,7 @@ class le {
7097
7097
  */
7098
7098
  static fromObject(e, t = {}) {
7099
7099
  if (e == null || typeof e != "object")
7100
- throw new Ne(
7100
+ throw new xe(
7101
7101
  `Duration.fromObject: argument expected to be an object, got ${e === null ? "null" : typeof e}`
7102
7102
  );
7103
7103
  return new le({
@@ -7124,7 +7124,7 @@ class le {
7124
7124
  return e;
7125
7125
  if (typeof e == "object")
7126
7126
  return le.fromObject(e);
7127
- throw new Ne(
7127
+ throw new xe(
7128
7128
  `Unknown duration argument ${e} of type ${typeof e}`
7129
7129
  );
7130
7130
  }
@@ -7174,9 +7174,9 @@ class le {
7174
7174
  */
7175
7175
  static invalid(e, t = null) {
7176
7176
  if (!e)
7177
- throw new Ne("need to specify a reason the Duration is invalid");
7177
+ throw new xe("need to specify a reason the Duration is invalid");
7178
7178
  const n = e instanceof nt ? e : new nt(e, t);
7179
- if (be.throwOnInvalid)
7179
+ if (Oe.throwOnInvalid)
7180
7180
  throw new Zg(n);
7181
7181
  return new le({ invalid: n });
7182
7182
  }
@@ -7261,7 +7261,7 @@ class le {
7261
7261
  ...t,
7262
7262
  floor: t.round !== !1 && t.floor !== !1
7263
7263
  };
7264
- return this.isValid ? Fe.create(this.loc, n).formatDurationFromString(this, e) : qf;
7264
+ return this.isValid ? Ne.create(this.loc, n).formatDurationFromString(this, e) : qf;
7265
7265
  }
7266
7266
  /**
7267
7267
  * Returns a string representation of a Duration with all units included.
@@ -7283,7 +7283,7 @@ class le {
7283
7283
  if (!this.isValid) return qf;
7284
7284
  const t = e.showZeros !== !1, n = Vt.map((s) => {
7285
7285
  const i = this.values[s];
7286
- return X(i) || i === 0 && !t ? null : this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...e, unit: s.slice(0, -1) }).format(i);
7286
+ return Q(i) || i === 0 && !t ? null : this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...e, unit: s.slice(0, -1) }).format(i);
7287
7287
  }).filter((s) => s);
7288
7288
  return this.loc.listFormatter({ type: "conjunction", style: e.listStyle || "narrow", ...e }).format(n);
7289
7289
  }
@@ -7652,12 +7652,12 @@ class le {
7652
7652
  }
7653
7653
  const Yt = "Invalid Interval";
7654
7654
  function bv(r, e) {
7655
- return !r || !r.isValid ? we.invalid("missing or invalid start") : !e || !e.isValid ? we.invalid("missing or invalid end") : e < r ? we.invalid(
7655
+ return !r || !r.isValid ? be.invalid("missing or invalid start") : !e || !e.isValid ? be.invalid("missing or invalid end") : e < r ? be.invalid(
7656
7656
  "end before start",
7657
7657
  `The end of an interval must be after its start, but you had start=${r.toISO()} and end=${e.toISO()}`
7658
7658
  ) : null;
7659
7659
  }
7660
- class we {
7660
+ class be {
7661
7661
  /**
7662
7662
  * @private
7663
7663
  */
@@ -7672,11 +7672,11 @@ class we {
7672
7672
  */
7673
7673
  static invalid(e, t = null) {
7674
7674
  if (!e)
7675
- throw new Ne("need to specify a reason the Interval is invalid");
7675
+ throw new xe("need to specify a reason the Interval is invalid");
7676
7676
  const n = e instanceof nt ? e : new nt(e, t);
7677
- if (be.throwOnInvalid)
7677
+ if (Oe.throwOnInvalid)
7678
7678
  throw new Bg(n);
7679
- return new we({ invalid: n });
7679
+ return new be({ invalid: n });
7680
7680
  }
7681
7681
  /**
7682
7682
  * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.
@@ -7686,7 +7686,7 @@ class we {
7686
7686
  */
7687
7687
  static fromDateTimes(e, t) {
7688
7688
  const n = br(e), s = br(t), i = bv(n, s);
7689
- return i ?? new we({
7689
+ return i ?? new be({
7690
7690
  start: n,
7691
7691
  end: s
7692
7692
  });
@@ -7699,7 +7699,7 @@ class we {
7699
7699
  */
7700
7700
  static after(e, t) {
7701
7701
  const n = le.fromDurationLike(t), s = br(e);
7702
- return we.fromDateTimes(s, s.plus(n));
7702
+ return be.fromDateTimes(s, s.plus(n));
7703
7703
  }
7704
7704
  /**
7705
7705
  * Create an Interval from an end DateTime and a Duration to extend backwards to.
@@ -7709,7 +7709,7 @@ class we {
7709
7709
  */
7710
7710
  static before(e, t) {
7711
7711
  const n = le.fromDurationLike(t), s = br(e);
7712
- return we.fromDateTimes(s.minus(n), s);
7712
+ return be.fromDateTimes(s.minus(n), s);
7713
7713
  }
7714
7714
  /**
7715
7715
  * Create an Interval from an ISO 8601 string.
@@ -7735,18 +7735,18 @@ class we {
7735
7735
  c = !1;
7736
7736
  }
7737
7737
  if (a && c)
7738
- return we.fromDateTimes(i, o);
7738
+ return be.fromDateTimes(i, o);
7739
7739
  if (a) {
7740
7740
  const l = le.fromISO(s, t);
7741
7741
  if (l.isValid)
7742
- return we.after(i, l);
7742
+ return be.after(i, l);
7743
7743
  } else if (c) {
7744
7744
  const l = le.fromISO(n, t);
7745
7745
  if (l.isValid)
7746
- return we.before(o, l);
7746
+ return be.before(o, l);
7747
7747
  }
7748
7748
  }
7749
- return we.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
7749
+ return be.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
7750
7750
  }
7751
7751
  /**
7752
7752
  * Check if an object is an Interval. Works across context boundaries
@@ -7869,7 +7869,7 @@ class we {
7869
7869
  * @return {Interval}
7870
7870
  */
7871
7871
  set({ start: e, end: t } = {}) {
7872
- return this.isValid ? we.fromDateTimes(e || this.s, t || this.e) : this;
7872
+ return this.isValid ? be.fromDateTimes(e || this.s, t || this.e) : this;
7873
7873
  }
7874
7874
  /**
7875
7875
  * Split this Interval at each of the specified DateTimes
@@ -7882,7 +7882,7 @@ class we {
7882
7882
  let { s } = this, i = 0;
7883
7883
  for (; s < this.e; ) {
7884
7884
  const a = t[i] || this.e, o = +a > +this.e ? this.e : a;
7885
- n.push(we.fromDateTimes(s, o)), s = o, i += 1;
7885
+ n.push(be.fromDateTimes(s, o)), s = o, i += 1;
7886
7886
  }
7887
7887
  return n;
7888
7888
  }
@@ -7900,7 +7900,7 @@ class we {
7900
7900
  const a = [];
7901
7901
  for (; n < this.e; ) {
7902
7902
  const o = this.start.plus(t.mapUnits((c) => c * s));
7903
- i = +o > +this.e ? this.e : o, a.push(we.fromDateTimes(n, i)), n = i, s += 1;
7903
+ i = +o > +this.e ? this.e : o, a.push(be.fromDateTimes(n, i)), n = i, s += 1;
7904
7904
  }
7905
7905
  return a;
7906
7906
  }
@@ -7962,7 +7962,7 @@ class we {
7962
7962
  intersection(e) {
7963
7963
  if (!this.isValid) return this;
7964
7964
  const t = this.s > e.s ? this.s : e.s, n = this.e < e.e ? this.e : e.e;
7965
- return t >= n ? null : we.fromDateTimes(t, n);
7965
+ return t >= n ? null : be.fromDateTimes(t, n);
7966
7966
  }
7967
7967
  /**
7968
7968
  * Return an Interval representing the union of this Interval and the specified Interval.
@@ -7973,7 +7973,7 @@ class we {
7973
7973
  union(e) {
7974
7974
  if (!this.isValid) return this;
7975
7975
  const t = this.s < e.s ? this.s : e.s, n = this.e > e.e ? this.e : e.e;
7976
- return we.fromDateTimes(t, n);
7976
+ return be.fromDateTimes(t, n);
7977
7977
  }
7978
7978
  /**
7979
7979
  * Merge an array of Intervals into an equivalent minimal set of Intervals.
@@ -8003,8 +8003,8 @@ class we {
8003
8003
  { time: c.e, type: "e" }
8004
8004
  ]), a = Array.prototype.concat(...i), o = a.sort((c, l) => c.time - l.time);
8005
8005
  for (const c of o)
8006
- n += c.type === "s" ? 1 : -1, n === 1 ? t = c.time : (t && +t != +c.time && s.push(we.fromDateTimes(t, c.time)), t = null);
8007
- return we.merge(s);
8006
+ n += c.type === "s" ? 1 : -1, n === 1 ? t = c.time : (t && +t != +c.time && s.push(be.fromDateTimes(t, c.time)), t = null);
8007
+ return be.merge(s);
8008
8008
  }
8009
8009
  /**
8010
8010
  * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.
@@ -8012,7 +8012,7 @@ class we {
8012
8012
  * @return {Array}
8013
8013
  */
8014
8014
  difference(...e) {
8015
- return we.xor([this].concat(e)).map((t) => this.intersection(t)).filter((t) => t && !t.isEmpty());
8015
+ return be.xor([this].concat(e)).map((t) => this.intersection(t)).filter((t) => t && !t.isEmpty());
8016
8016
  }
8017
8017
  /**
8018
8018
  * Returns a string representation of this Interval appropriate for debugging.
@@ -8047,7 +8047,7 @@ class we {
8047
8047
  * @return {string}
8048
8048
  */
8049
8049
  toLocaleString(e = bn, t = {}) {
8050
- return this.isValid ? Fe.create(this.s.loc.clone(t), e).formatInterval(this) : Yt;
8050
+ return this.isValid ? Ne.create(this.s.loc.clone(t), e).formatInterval(this) : Yt;
8051
8051
  }
8052
8052
  /**
8053
8053
  * Returns an ISO 8601-compliant string representation of this Interval.
@@ -8114,7 +8114,7 @@ class we {
8114
8114
  * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))
8115
8115
  */
8116
8116
  mapEndpoints(e) {
8117
- return we.fromDateTimes(e(this.s), e(this.e));
8117
+ return be.fromDateTimes(e(this.s), e(this.e));
8118
8118
  }
8119
8119
  }
8120
8120
  class rn {
@@ -8123,7 +8123,7 @@ class rn {
8123
8123
  * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.
8124
8124
  * @return {boolean}
8125
8125
  */
8126
- static hasDST(e = be.defaultZone) {
8126
+ static hasDST(e = Oe.defaultZone) {
8127
8127
  const t = Z.now().setZone(e).set({ month: 12 });
8128
8128
  return !e.isUniversal && t.offset !== t.set({ month: 6 }).offset;
8129
8129
  }
@@ -8150,7 +8150,7 @@ class rn {
8150
8150
  * @return {Zone}
8151
8151
  */
8152
8152
  static normalizeZone(e) {
8153
- return Ct(e, be.defaultZone);
8153
+ return Ct(e, Oe.defaultZone);
8154
8154
  }
8155
8155
  /**
8156
8156
  * Get the weekday on which the week starts according to the given locale.
@@ -8585,7 +8585,7 @@ function Fv(r) {
8585
8585
  }
8586
8586
  };
8587
8587
  let t = null, n;
8588
- return X(r.z) || (t = _t.create(r.z)), X(r.Z) || (t || (t = new Me(r.Z)), n = r.Z), X(r.q) || (r.M = (r.q - 1) * 3 + 1), X(r.h) || (r.h < 12 && r.a === 1 ? r.h += 12 : r.h === 12 && r.a === 0 && (r.h = 0)), r.G === 0 && r.y && (r.y = -r.y), X(r.u) || (r.S = tc(r.u)), [Object.keys(r).reduce((i, a) => {
8588
+ return Q(r.z) || (t = _t.create(r.z)), Q(r.Z) || (t || (t = new Me(r.Z)), n = r.Z), Q(r.q) || (r.M = (r.q - 1) * 3 + 1), Q(r.h) || (r.h < 12 && r.a === 1 ? r.h += 12 : r.h === 12 && r.a === 0 && (r.h = 0)), r.G === 0 && r.y && (r.y = -r.y), Q(r.u) || (r.S = tc(r.u)), [Object.keys(r).reduce((i, a) => {
8589
8589
  const o = e(a);
8590
8590
  return o && (i[o] = r[a]), i;
8591
8591
  }, {}), t, n];
@@ -8597,7 +8597,7 @@ function Dv() {
8597
8597
  function Mv(r, e) {
8598
8598
  if (r.literal)
8599
8599
  return r;
8600
- const t = Fe.macroTokenToFormatOpts(r.val), n = sm(t, e);
8600
+ const t = Ne.macroTokenToFormatOpts(r.val), n = sm(t, e);
8601
8601
  return n == null || n.includes(void 0) ? r : n;
8602
8602
  }
8603
8603
  function tm(r, e) {
@@ -8605,7 +8605,7 @@ function tm(r, e) {
8605
8605
  }
8606
8606
  class rm {
8607
8607
  constructor(e, t) {
8608
- if (this.locale = e, this.format = t, this.tokens = tm(Fe.parseFormat(t), e), this.units = this.tokens.map((n) => Cv(n, e)), this.disqualifyingUnit = this.units.find((n) => n.invalidReason), !this.disqualifyingUnit) {
8608
+ if (this.locale = e, this.format = t, this.tokens = tm(Ne.parseFormat(t), e), this.units = this.tokens.map((n) => Cv(n, e)), this.disqualifyingUnit = this.units.find((n) => n.invalidReason), !this.disqualifyingUnit) {
8609
8609
  const [n, s] = xv(this.units);
8610
8610
  this.regex = RegExp(n, "i"), this.handlers = s;
8611
8611
  }
@@ -8647,7 +8647,7 @@ function Pv(r, e, t) {
8647
8647
  function sm(r, e) {
8648
8648
  if (!r)
8649
8649
  return null;
8650
- const n = Fe.create(e, r).dtFormatter(Dv()), s = n.formatToParts(), i = n.resolvedOptions();
8650
+ const n = Ne.create(e, r).dtFormatter(Dv()), s = n.formatToParts(), i = n.resolvedOptions();
8651
8651
  return s.map((a) => Iv(a, r, i));
8652
8652
  }
8653
8653
  const Ra = "Invalid DateTime", Wf = 864e13;
@@ -8735,7 +8735,7 @@ function Jt(r, e, t, n, s, i) {
8735
8735
  );
8736
8736
  }
8737
8737
  function an(r, e, t = !0) {
8738
- return r.isValid ? Fe.create(de.create("en-US"), {
8738
+ return r.isValid ? Ne.create(de.create("en-US"), {
8739
8739
  allowZ: t,
8740
8740
  forceSimple: !0
8741
8741
  }).formatDateTimeFromString(r, e) : null;
@@ -8846,23 +8846,23 @@ function Zf(r) {
8846
8846
  }
8847
8847
  }
8848
8848
  function Uv(r) {
8849
- if (kr === void 0 && (kr = be.now()), r.type !== "iana")
8849
+ if (kr === void 0 && (kr = Oe.now()), r.type !== "iana")
8850
8850
  return r.offset(kr);
8851
8851
  const e = r.name;
8852
8852
  let t = So.get(e);
8853
8853
  return t === void 0 && (t = r.offset(kr), So.set(e, t)), t;
8854
8854
  }
8855
8855
  function Gf(r, e) {
8856
- const t = Ct(e.zone, be.defaultZone);
8856
+ const t = Ct(e.zone, Oe.defaultZone);
8857
8857
  if (!t.isValid)
8858
8858
  return Z.invalid(Cr(t));
8859
8859
  const n = de.fromObject(e);
8860
8860
  let s, i;
8861
- if (X(r.year))
8862
- s = be.now();
8861
+ if (Q(r.year))
8862
+ s = Oe.now();
8863
8863
  else {
8864
8864
  for (const c of ln)
8865
- X(r[c]) && (r[c] = am[c]);
8865
+ Q(r[c]) && (r[c] = am[c]);
8866
8866
  const a = Nh(r) || Fh(r);
8867
8867
  if (a)
8868
8868
  return Z.invalid(a);
@@ -8872,7 +8872,7 @@ function Gf(r, e) {
8872
8872
  return new Z({ ts: s, zone: t, loc: n, o: i });
8873
8873
  }
8874
8874
  function Hf(r, e, t) {
8875
- const n = X(t.round) ? !0 : t.round, s = X(t.rounding) ? "trunc" : t.rounding, i = (o, c) => (o = rc(o, n || t.calendary ? 0 : 2, t.calendary ? "round" : s), e.loc.clone(t).relFormatter(t).format(o, c)), a = (o) => t.calendary ? e.hasSame(r, o) ? 0 : e.startOf(o).diff(r.startOf(o), o).get(o) : e.diff(r, o).get(o);
8875
+ const n = Q(t.round) ? !0 : t.round, s = Q(t.rounding) ? "trunc" : t.rounding, i = (o, c) => (o = rc(o, n || t.calendary ? 0 : 2, t.calendary ? "round" : s), e.loc.clone(t).relFormatter(t).format(o, c)), a = (o) => t.calendary ? e.hasSame(r, o) ? 0 : e.startOf(o).diff(r.startOf(o), o).get(o) : e.diff(r, o).get(o);
8876
8876
  if (t.unit)
8877
8877
  return i(a(t.unit), t.unit);
8878
8878
  for (const o of t.units) {
@@ -8893,9 +8893,9 @@ class Z {
8893
8893
  * @access private
8894
8894
  */
8895
8895
  constructor(e) {
8896
- const t = e.zone || be.defaultZone;
8896
+ const t = e.zone || Oe.defaultZone;
8897
8897
  let n = e.invalid || (Number.isNaN(e.ts) ? new nt("invalid input") : null) || (t.isValid ? null : Cr(t));
8898
- this.ts = X(e.ts) ? be.now() : e.ts;
8898
+ this.ts = Q(e.ts) ? Oe.now() : e.ts;
8899
8899
  let s = null, i = null;
8900
8900
  if (!n)
8901
8901
  if (e.old && e.old.ts === this.ts && e.old.zone.equals(t))
@@ -8982,7 +8982,7 @@ class Z {
8982
8982
  const n = v_(e) ? e.valueOf() : NaN;
8983
8983
  if (Number.isNaN(n))
8984
8984
  return Z.invalid("invalid input");
8985
- const s = Ct(t.zone, be.defaultZone);
8985
+ const s = Ct(t.zone, Oe.defaultZone);
8986
8986
  return s.isValid ? new Z({
8987
8987
  ts: n,
8988
8988
  zone: s,
@@ -9004,10 +9004,10 @@ class Z {
9004
9004
  if (It(e))
9005
9005
  return e < -Wf || e > Wf ? Z.invalid("Timestamp out of range") : new Z({
9006
9006
  ts: e,
9007
- zone: Ct(t.zone, be.defaultZone),
9007
+ zone: Ct(t.zone, Oe.defaultZone),
9008
9008
  loc: de.fromObject(t)
9009
9009
  });
9010
- throw new Ne(
9010
+ throw new xe(
9011
9011
  `fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`
9012
9012
  );
9013
9013
  }
@@ -9026,10 +9026,10 @@ class Z {
9026
9026
  if (It(e))
9027
9027
  return new Z({
9028
9028
  ts: e * 1e3,
9029
- zone: Ct(t.zone, be.defaultZone),
9029
+ zone: Ct(t.zone, Oe.defaultZone),
9030
9030
  loc: de.fromObject(t)
9031
9031
  });
9032
- throw new Ne("fromSeconds requires a numerical input");
9032
+ throw new xe("fromSeconds requires a numerical input");
9033
9033
  }
9034
9034
  /**
9035
9035
  * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.
@@ -9066,10 +9066,10 @@ class Z {
9066
9066
  */
9067
9067
  static fromObject(e, t = {}) {
9068
9068
  e = e || {};
9069
- const n = Ct(t.zone, be.defaultZone);
9069
+ const n = Ct(t.zone, Oe.defaultZone);
9070
9070
  if (!n.isValid)
9071
9071
  return Z.invalid(Cr(n));
9072
- const s = de.fromObject(t), i = Sn(e, Zf), { minDaysInFirstWeek: a, startOfWeek: o } = Nf(i, s), c = be.now(), l = X(t.specificOffset) ? n.offset(c) : t.specificOffset, u = !X(i.ordinal), f = !X(i.year), d = !X(i.month) || !X(i.day), h = f || d, m = i.weekYear || i.weekNumber;
9072
+ const s = de.fromObject(t), i = Sn(e, Zf), { minDaysInFirstWeek: a, startOfWeek: o } = Nf(i, s), c = Oe.now(), l = Q(t.specificOffset) ? n.offset(c) : t.specificOffset, u = !Q(i.ordinal), f = !Q(i.year), d = !Q(i.month) || !Q(i.day), h = f || d, m = i.weekYear || i.weekNumber;
9073
9073
  if ((h || u) && m)
9074
9074
  throw new er(
9075
9075
  "Can't mix weekYear/weekNumber units with year/month/day or ordinals"
@@ -9082,7 +9082,7 @@ class Z {
9082
9082
  let T = !1;
9083
9083
  for (const p of g) {
9084
9084
  const k = i[p];
9085
- X(k) ? T ? i[p] = v[p] : i[p] = S[p] : T = !0;
9085
+ Q(k) ? T ? i[p] = v[p] : i[p] = S[p] : T = !0;
9086
9086
  }
9087
9087
  const P = E ? y_(i, a, o) : u ? g_(i) : Nh(i), y = P || Fh(i);
9088
9088
  if (y)
@@ -9173,8 +9173,8 @@ class Z {
9173
9173
  * @return {DateTime}
9174
9174
  */
9175
9175
  static fromFormat(e, t, n = {}) {
9176
- if (X(e) || X(t))
9177
- throw new Ne("fromFormat requires an input string and a format");
9176
+ if (Q(e) || Q(t))
9177
+ throw new xe("fromFormat requires an input string and a format");
9178
9178
  const { locale: s = null, numberingSystem: i = null } = n, a = de.fromOpts({
9179
9179
  locale: s,
9180
9180
  numberingSystem: i,
@@ -9221,9 +9221,9 @@ class Z {
9221
9221
  */
9222
9222
  static invalid(e, t = null) {
9223
9223
  if (!e)
9224
- throw new Ne("need to specify a reason the DateTime is invalid");
9224
+ throw new xe("need to specify a reason the DateTime is invalid");
9225
9225
  const n = e instanceof nt ? e : new nt(e, t);
9226
- if (be.throwOnInvalid)
9226
+ if (Oe.throwOnInvalid)
9227
9227
  throw new zg(n);
9228
9228
  return new Z({ invalid: n });
9229
9229
  }
@@ -9253,7 +9253,7 @@ class Z {
9253
9253
  * @returns {string}
9254
9254
  */
9255
9255
  static expandFormat(e, t = {}) {
9256
- return tm(Fe.parseFormat(e), de.fromObject(t)).map((s) => s.val).join("");
9256
+ return tm(Ne.parseFormat(e), de.fromObject(t)).map((s) => s.val).join("");
9257
9257
  }
9258
9258
  static resetCache() {
9259
9259
  kr = void 0, So.clear();
@@ -9617,7 +9617,7 @@ class Z {
9617
9617
  * @return {Object}
9618
9618
  */
9619
9619
  resolvedLocaleOptions(e = {}) {
9620
- const { locale: t, numberingSystem: n, calendar: s } = Fe.create(
9620
+ const { locale: t, numberingSystem: n, calendar: s } = Ne.create(
9621
9621
  this.loc.clone(e),
9622
9622
  e
9623
9623
  ).resolvedOptions(this);
@@ -9642,7 +9642,7 @@ class Z {
9642
9642
  * @return {DateTime}
9643
9643
  */
9644
9644
  toLocal() {
9645
- return this.setZone(be.defaultZone);
9645
+ return this.setZone(Oe.defaultZone);
9646
9646
  }
9647
9647
  /**
9648
9648
  * "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.
@@ -9654,7 +9654,7 @@ class Z {
9654
9654
  * @return {DateTime}
9655
9655
  */
9656
9656
  setZone(e, { keepLocalTime: t = !1, keepCalendarTime: n = !1 } = {}) {
9657
- if (e = Ct(e, be.defaultZone), e.equals(this.zone))
9657
+ if (e = Ct(e, Oe.defaultZone), e.equals(this.zone))
9658
9658
  return this;
9659
9659
  if (e.isValid) {
9660
9660
  let s = this.ts;
@@ -9700,7 +9700,7 @@ class Z {
9700
9700
  */
9701
9701
  set(e) {
9702
9702
  if (!this.isValid) return this;
9703
- const t = Sn(e, Zf), { minDaysInFirstWeek: n, startOfWeek: s } = Nf(t, this.loc), i = !X(t.weekYear) || !X(t.weekNumber) || !X(t.weekday), a = !X(t.ordinal), o = !X(t.year), c = !X(t.month) || !X(t.day), l = o || c, u = t.weekYear || t.weekNumber;
9703
+ const t = Sn(e, Zf), { minDaysInFirstWeek: n, startOfWeek: s } = Nf(t, this.loc), i = !Q(t.weekYear) || !Q(t.weekNumber) || !Q(t.weekday), a = !Q(t.ordinal), o = !Q(t.year), c = !Q(t.month) || !Q(t.day), l = o || c, u = t.weekYear || t.weekNumber;
9704
9704
  if ((l || a) && u)
9705
9705
  throw new er(
9706
9706
  "Can't mix weekYear/weekNumber units with year/month/day or ordinals"
@@ -9712,7 +9712,7 @@ class Z {
9712
9712
  { ...On(this.c, n, s), ...t },
9713
9713
  n,
9714
9714
  s
9715
- ) : X(t.ordinal) ? (f = { ...this.toObject(), ...t }, X(t.day) && (f.day = Math.min(En(f.year, f.month), f.day))) : f = xf({ ...Sa(this.c), ...t });
9715
+ ) : Q(t.ordinal) ? (f = { ...this.toObject(), ...t }, Q(t.day) && (f.day = Math.min(En(f.year, f.month), f.day))) : f = xf({ ...Sa(this.c), ...t });
9716
9716
  const [d, h] = cn(f, this.o, this.zone);
9717
9717
  return Lt(this, { ts: d, o: h });
9718
9718
  }
@@ -9823,7 +9823,7 @@ class Z {
9823
9823
  * @return {string}
9824
9824
  */
9825
9825
  toFormat(e, t = {}) {
9826
- return this.isValid ? Fe.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this, e) : Ra;
9826
+ return this.isValid ? Ne.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this, e) : Ra;
9827
9827
  }
9828
9828
  /**
9829
9829
  * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.
@@ -9845,7 +9845,7 @@ class Z {
9845
9845
  * @return {string}
9846
9846
  */
9847
9847
  toLocaleString(e = bn, t = {}) {
9848
- return this.isValid ? Fe.create(this.loc.clone(t), e).formatDateTime(this) : Ra;
9848
+ return this.isValid ? Ne.create(this.loc.clone(t), e).formatDateTime(this) : Ra;
9849
9849
  }
9850
9850
  /**
9851
9851
  * Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.
@@ -9861,7 +9861,7 @@ class Z {
9861
9861
  * //=> ]
9862
9862
  */
9863
9863
  toLocaleParts(e = {}) {
9864
- return this.isValid ? Fe.create(this.loc.clone(e), e).formatDateTimeParts(this) : [];
9864
+ return this.isValid ? Ne.create(this.loc.clone(e), e).formatDateTimeParts(this) : [];
9865
9865
  }
9866
9866
  /**
9867
9867
  * Returns an ISO 8601-compliant string representation of this DateTime
@@ -10133,7 +10133,7 @@ class Z {
10133
10133
  * @return {Interval|DateTime}
10134
10134
  */
10135
10135
  until(e) {
10136
- return this.isValid ? we.fromDateTimes(this, e) : this;
10136
+ return this.isValid ? be.fromDateTimes(this, e) : this;
10137
10137
  }
10138
10138
  /**
10139
10139
  * Return whether this DateTime is in the same unit of time as another DateTime.
@@ -10219,7 +10219,7 @@ class Z {
10219
10219
  */
10220
10220
  static min(...e) {
10221
10221
  if (!e.every(Z.isDateTime))
10222
- throw new Ne("min requires all arguments be DateTimes");
10222
+ throw new xe("min requires all arguments be DateTimes");
10223
10223
  return Ff(e, (t) => t.valueOf(), Math.min);
10224
10224
  }
10225
10225
  /**
@@ -10229,7 +10229,7 @@ class Z {
10229
10229
  */
10230
10230
  static max(...e) {
10231
10231
  if (!e.every(Z.isDateTime))
10232
- throw new Ne("max requires all arguments be DateTimes");
10232
+ throw new xe("max requires all arguments be DateTimes");
10233
10233
  return Ff(e, (t) => t.valueOf(), Math.max);
10234
10234
  }
10235
10235
  // MISC
@@ -10285,8 +10285,8 @@ class Z {
10285
10285
  * @returns {DateTime}
10286
10286
  */
10287
10287
  static fromFormatParser(e, t, n = {}) {
10288
- if (X(e) || X(t))
10289
- throw new Ne(
10288
+ if (Q(e) || Q(t))
10289
+ throw new xe(
10290
10290
  "fromFormatParser requires an input string and a format parser"
10291
10291
  );
10292
10292
  const { locale: s = null, numberingSystem: i = null } = n, a = de.fromOpts({
@@ -10295,7 +10295,7 @@ class Z {
10295
10295
  defaultToEN: !0
10296
10296
  });
10297
10297
  if (!a.equals(t.locale))
10298
- throw new Ne(
10298
+ throw new xe(
10299
10299
  `fromFormatParser called with a locale of ${a}, but the format parser was created for ${t.locale}`
10300
10300
  );
10301
10301
  const { result: o, zone: c, specificOffset: l, invalidReason: u } = t.explainFromTokens(e);
@@ -10471,7 +10471,7 @@ function br(r) {
10471
10471
  return Z.fromJSDate(r);
10472
10472
  if (r && typeof r == "object")
10473
10473
  return Z.fromObject(r);
10474
- throw new Ne(
10474
+ throw new xe(
10475
10475
  `Unknown datetime argument: ${r}, of type ${typeof r}`
10476
10476
  );
10477
10477
  }
@@ -10479,7 +10479,7 @@ const Yf = async (r, e) => {
10479
10479
  if (r) {
10480
10480
  const t = await _e(r, e);
10481
10481
  if (!t.valid)
10482
- throw new Error(`VALIDATION_ERROR: ${t.message}`);
10482
+ throw new Error(t.message);
10483
10483
  }
10484
10484
  }, om = async (r, e, t, n, s, i) => {
10485
10485
  await Yf(n.custom?.preValidate, s);
@@ -10713,44 +10713,44 @@ var Za, hd;
10713
10713
  function nw() {
10714
10714
  if (hd) return Za;
10715
10715
  hd = 1;
10716
- var r = Mo(), e = Vv(), t = Zo(), n = Wv(), s = zv(), i = zd(), a = Zd(), o = Bv(), c = Zv(), l = jd(), u = Gv(), f = qn(), d = Hv(), h = Qv(), m = Gd(), E = Ft(), g = Mn(), v = ew(), S = wt(), T = rw(), P = Vo(), y = Br(), A = 1, R = 2, _ = 4, C = "[object Arguments]", p = "[object Array]", k = "[object Boolean]", I = "[object Date]", b = "[object Error]", w = "[object Function]", O = "[object GeneratorFunction]", x = "[object Map]", F = "[object Number]", M = "[object Object]", D = "[object RegExp]", Y = "[object Set]", J = "[object String]", W = "[object Symbol]", q = "[object WeakMap]", H = "[object ArrayBuffer]", Ie = "[object DataView]", Qe = "[object Float32Array]", Ee = "[object Float64Array]", Ve = "[object Int8Array]", Mt = "[object Int16Array]", j = "[object Int32Array]", ae = "[object Uint8Array]", z = "[object Uint8ClampedArray]", Q = "[object Uint16Array]", U = "[object Uint32Array]", G = {};
10717
- G[C] = G[p] = G[H] = G[Ie] = G[k] = G[I] = G[Qe] = G[Ee] = G[Ve] = G[Mt] = G[j] = G[x] = G[F] = G[M] = G[D] = G[Y] = G[J] = G[W] = G[ae] = G[z] = G[Q] = G[U] = !0, G[b] = G[w] = G[q] = !1;
10718
- function Se(K, ye, ne, Xe, ut, We) {
10719
- var xe, vr = ye & A, Te = ye & R, wr = ye & _;
10720
- if (ne && (xe = ut ? ne(K, Xe, ut, We) : ne(K)), xe !== void 0)
10721
- return xe;
10716
+ var r = Mo(), e = Vv(), t = Zo(), n = Wv(), s = zv(), i = zd(), a = Zd(), o = Bv(), c = Zv(), l = jd(), u = Gv(), f = qn(), d = Hv(), h = Qv(), m = Gd(), E = Ft(), g = Mn(), v = ew(), S = wt(), T = rw(), P = Vo(), y = Br(), A = 1, R = 2, _ = 4, C = "[object Arguments]", p = "[object Array]", k = "[object Boolean]", I = "[object Date]", b = "[object Error]", w = "[object Function]", O = "[object GeneratorFunction]", x = "[object Map]", F = "[object Number]", M = "[object Object]", D = "[object RegExp]", Y = "[object Set]", ee = "[object String]", j = "[object Symbol]", q = "[object WeakMap]", H = "[object ArrayBuffer]", qe = "[object DataView]", De = "[object Float32Array]", Ee = "[object Float64Array]", We = "[object Int8Array]", Mt = "[object Int16Array]", U = "[object Int32Array]", ae = "[object Uint8Array]", z = "[object Uint8ClampedArray]", J = "[object Uint16Array]", V = "[object Uint32Array]", G = {};
10717
+ G[C] = G[p] = G[H] = G[qe] = G[k] = G[I] = G[De] = G[Ee] = G[We] = G[Mt] = G[U] = G[x] = G[F] = G[M] = G[D] = G[Y] = G[ee] = G[j] = G[ae] = G[z] = G[J] = G[V] = !0, G[b] = G[w] = G[q] = !1;
10718
+ function Se(K, ye, ne, Xe, ut, ze) {
10719
+ var Ie, vr = ye & A, Te = ye & R, wr = ye & _;
10720
+ if (ne && (Ie = ut ? ne(K, Xe, ut, ze) : ne(K)), Ie !== void 0)
10721
+ return Ie;
10722
10722
  if (!S(K))
10723
10723
  return K;
10724
10724
  var _c = E(K);
10725
10725
  if (_c) {
10726
- if (xe = d(K), !vr)
10727
- return a(K, xe);
10726
+ if (Ie = d(K), !vr)
10727
+ return a(K, Ie);
10728
10728
  } else {
10729
10729
  var Ht = f(K), vc = Ht == w || Ht == O;
10730
10730
  if (g(K))
10731
10731
  return i(K, vr);
10732
10732
  if (Ht == M || Ht == C || vc && !ut) {
10733
- if (xe = Te || vc ? {} : m(K), !vr)
10734
- return Te ? c(K, s(xe, K)) : o(K, n(xe, K));
10733
+ if (Ie = Te || vc ? {} : m(K), !vr)
10734
+ return Te ? c(K, s(Ie, K)) : o(K, n(Ie, K));
10735
10735
  } else {
10736
10736
  if (!G[Ht])
10737
10737
  return ut ? K : {};
10738
- xe = h(K, Ht, vr);
10738
+ Ie = h(K, Ht, vr);
10739
10739
  }
10740
10740
  }
10741
- We || (We = new r());
10742
- var wc = We.get(K);
10741
+ ze || (ze = new r());
10742
+ var wc = ze.get(K);
10743
10743
  if (wc)
10744
10744
  return wc;
10745
- We.set(K, xe), T(K) ? K.forEach(function(Ot) {
10746
- xe.add(Se(Ot, ye, ne, Ot, K, We));
10745
+ ze.set(K, Ie), T(K) ? K.forEach(function(Ot) {
10746
+ Ie.add(Se(Ot, ye, ne, Ot, K, ze));
10747
10747
  }) : v(K) && K.forEach(function(Ot, Pt) {
10748
- xe.set(Pt, Se(Ot, ye, ne, Pt, K, We));
10748
+ Ie.set(Pt, Se(Ot, ye, ne, Pt, K, ze));
10749
10749
  });
10750
10750
  var Im = wr ? Te ? u : l : Te ? y : P, bc = _c ? void 0 : Im(K);
10751
10751
  return e(bc || K, function(Ot, Pt) {
10752
- bc && (Pt = Ot, Ot = K[Pt]), t(xe, Pt, Se(Ot, ye, ne, Pt, K, We));
10753
- }), xe;
10752
+ bc && (Pt = Ot, Ot = K[Pt]), t(Ie, Pt, Se(Ot, ye, ne, Pt, K, ze));
10753
+ }), Ie;
10754
10754
  }
10755
10755
  return Za = Se, Za;
10756
10756
  }
@@ -10765,7 +10765,7 @@ function sw() {
10765
10765
  return Ga = n, Ga;
10766
10766
  }
10767
10767
  var iw = sw();
10768
- const Oe = /* @__PURE__ */ In(iw), xt = (r) => {
10768
+ const ve = /* @__PURE__ */ In(iw), xt = (r) => {
10769
10769
  for (const e in r)
10770
10770
  Object.prototype.hasOwnProperty.call(r, e) && (r[e] === void 0 ? delete r[e] : typeof r[e] == "object" && r[e] !== null && xt(r[e]));
10771
10771
  }, aw = (r, e) => {
@@ -10851,7 +10851,7 @@ const Oe = /* @__PURE__ */ In(iw), xt = (r) => {
10851
10851
  throw new Error("Email body is too long");
10852
10852
  return e;
10853
10853
  }, oc = (r, e, t) => {
10854
- const n = je(), s = Dt(), i = Ke(), a = De(), o = r.at(-1);
10854
+ const n = Ue(), s = Dt(), i = Ye(), a = Fe(), o = r.at(-1);
10855
10855
  if (!o)
10856
10856
  throw new Error("EMPTY_PATH");
10857
10857
  const c = i.collections[o], { labels: l, fields: u, preloadCache: f } = c, d = lt(o), h = a.collections?.[l.collection];
@@ -10928,17 +10928,17 @@ const Oe = /* @__PURE__ */ In(iw), xt = (r) => {
10928
10928
  throw new Error("PERMISSION_DENIED");
10929
10929
  const D = M?.individualEntities, Y = [];
10930
10930
  if (D) {
10931
- const J = x.singleQuery ? x.singleQuery : _;
10932
- for (let W = 0; W < D.length; W += J) {
10933
- const q = D.slice(W, W + J);
10931
+ const ee = x.singleQuery ? x.singleQuery : _;
10932
+ for (let j = 0; j < D.length; j += ee) {
10933
+ const q = D.slice(j, j + ee);
10934
10934
  Y.push(q);
10935
10935
  }
10936
10936
  if (!x.singleQuery)
10937
- Y.forEach((W) => {
10938
- p.push(...T(C.concat(pe(`${F.name}_Array`, "array-contains-any", W))));
10937
+ Y.forEach((j) => {
10938
+ p.push(...T(C.concat(pe(`${F.name}_Array`, "array-contains-any", j))));
10939
10939
  });
10940
10940
  else {
10941
- if (D.length > J)
10941
+ if (D.length > ee)
10942
10942
  throw new Error(`INPUT_ERROR: Individual entity parentFilter with singleQuery set to true must not have more than ${x.singleQuery} entities`);
10943
10943
  C.push(pe(`${F.name}_Array`, "array-contains-any", D));
10944
10944
  }
@@ -10978,19 +10978,19 @@ const Oe = /* @__PURE__ */ In(iw), xt = (r) => {
10978
10978
  const D = a.collections?.[F.collection];
10979
10979
  if (!D)
10980
10980
  throw new Error("PERMISSION_DENIED");
10981
- const Y = D.parentEntities, J = [];
10981
+ const Y = D.parentEntities, ee = [];
10982
10982
  if (Y) {
10983
- const W = x.singleQuery ? x.singleQuery : _;
10984
- for (let q = 0; q < Y.length; q += W) {
10985
- const H = Y.slice(q, q + W);
10986
- J.push(H);
10983
+ const j = x.singleQuery ? x.singleQuery : _;
10984
+ for (let q = 0; q < Y.length; q += j) {
10985
+ const H = Y.slice(q, q + j);
10986
+ ee.push(H);
10987
10987
  }
10988
10988
  if (!x.singleQuery)
10989
- J.forEach((q) => {
10989
+ ee.forEach((q) => {
10990
10990
  k.push(...T(C.concat(pe(`${M.name}_Array`, "array-contains-any", q))));
10991
10991
  });
10992
10992
  else {
10993
- if (Y && Y.length > W)
10993
+ if (Y && Y.length > j)
10994
10994
  throw new Error(`INPUT_ERROR: Parent entity parentFilter with singleQuery set to true must not have more than ${x.singleQuery} entities`);
10995
10995
  C.push(pe(`${M.name}_Array`, "array-contains-any", Y));
10996
10996
  }
@@ -11007,13 +11007,13 @@ const Oe = /* @__PURE__ */ In(iw), xt = (r) => {
11007
11007
  Object.entries(F).forEach(([M, D]) => {
11008
11008
  if (D.length > 0) {
11009
11009
  const Y = [];
11010
- for (let J = 0; J < D.length; J += _) {
11011
- const W = D.slice(J, J + _);
11012
- Y.push(W);
11010
+ for (let ee = 0; ee < D.length; ee += _) {
11011
+ const j = D.slice(ee, ee + _);
11012
+ Y.push(j);
11013
11013
  }
11014
- Y.forEach((J) => {
11014
+ Y.forEach((ee) => {
11015
11015
  I.push(...T(C.concat([
11016
- pe(`${O.name}_Array`, "array-contains-any", J),
11016
+ pe(`${O.name}_Array`, "array-contains-any", ee),
11017
11017
  pe(x.name, "==", M)
11018
11018
  ])));
11019
11019
  });
@@ -11030,17 +11030,17 @@ const Oe = /* @__PURE__ */ In(iw), xt = (r) => {
11030
11030
  if (!D)
11031
11031
  throw new Error("PERMISSION_DENIED");
11032
11032
  const Y = D.parentPropertyEntities || {};
11033
- Object.entries(Y).forEach(([J, W]) => {
11034
- if (W.length > 0) {
11033
+ Object.entries(Y).forEach(([ee, j]) => {
11034
+ if (j.length > 0) {
11035
11035
  const q = [];
11036
- for (let H = 0; H < W.length; H += _) {
11037
- const Ie = W.slice(H, H + _);
11038
- q.push(Ie);
11036
+ for (let H = 0; H < j.length; H += _) {
11037
+ const qe = j.slice(H, H + _);
11038
+ q.push(qe);
11039
11039
  }
11040
11040
  q.forEach((H) => {
11041
11041
  I.push(...T(C.concat([
11042
11042
  pe(`${F.name}_Array`, "array-contains-any", H),
11043
- pe(M.name, "==", J)
11043
+ pe(M.name, "==", ee)
11044
11044
  ])));
11045
11045
  });
11046
11046
  }
@@ -11066,7 +11066,7 @@ const Oe = /* @__PURE__ */ In(iw), xt = (r) => {
11066
11066
  n.includes(s) || t.includes(s) || await Mr(s, r?.[s].constraints, r?.[s].range, r?.[s].orQueries, r);
11067
11067
  return Ir;
11068
11068
  }, To = () => fm, lw = () => Ir, uw = async (r, e, t, n) => {
11069
- const { labels: s, preloadCache: i } = r, o = Jr()[s.collection], c = ke(), l = lt(s.collection), u = De();
11069
+ const { labels: s, preloadCache: i } = r, o = Jr()[s.collection], c = ke(), l = lt(s.collection), u = Fe();
11070
11070
  if (!u?.Role)
11071
11071
  throw new Error("PERMISSION_DENIED");
11072
11072
  if (!i?.roles.includes(u.Role))
@@ -11106,7 +11106,7 @@ const Oe = /* @__PURE__ */ In(iw), xt = (r) => {
11106
11106
  });
11107
11107
  });
11108
11108
  }, Mr = async (r, e, t, n, s) => {
11109
- const i = Ke(), a = De();
11109
+ const i = Ye(), a = Fe();
11110
11110
  if (!a?.Role)
11111
11111
  throw new Error("PERMISSION_DENIED");
11112
11112
  const o = i.collections[r], { labels: c, preloadCache: l } = o, u = To();
@@ -11142,7 +11142,7 @@ const Oe = /* @__PURE__ */ In(iw), xt = (r) => {
11142
11142
  };
11143
11143
  let $t = null;
11144
11144
  const fw = async (r, e) => {
11145
- const t = [], n = Dt(), s = je(), i = ke();
11145
+ const t = [], n = Dt(), s = Ue(), i = ke();
11146
11146
  if (!e.claims.doc)
11147
11147
  throw new Error("User document ID not found in claims");
11148
11148
  let a = !1, o = null;
@@ -11174,13 +11174,13 @@ const fw = async (r, e) => {
11174
11174
  });
11175
11175
  t.push(f);
11176
11176
  }), t;
11177
- }, De = () => $t, dw = () => {
11177
+ }, Fe = () => $t, dw = () => {
11178
11178
  $t = null;
11179
11179
  }, cc = (r) => {
11180
11180
  if (typeof r == "object")
11181
11181
  for (const e in r)
11182
11182
  Object.prototype.hasOwnProperty.call(r, e) && (sr(r[e]) ? r[e] = "_DELETE_FIELD" : cc(r[e]));
11183
- }, He = async (r, e, t, n, s, i, a, o, c) => {
11183
+ }, Ke = async (r, e, t, n, s, i, a, o, c) => {
11184
11184
  const l = Dt(), { labels: u } = i, f = ke(), d = gc(), h = await se(f, ["global", "firebase", "writeLogTTL"]), m = {
11185
11185
  operation: r,
11186
11186
  collection: u.collection,
@@ -11199,14 +11199,14 @@ const fw = async (r, e) => {
11199
11199
  const S = /* @__PURE__ */ new Date(), T = new Date((/* @__PURE__ */ new Date()).setDate(S.getDate() + h));
11200
11200
  m.TTL = Bt.fromDate(T);
11201
11201
  }
11202
- const E = Oe(t);
11203
- r !== "delete" && (m.data.data = E, e === "written" && cc(m.data.data)), r !== "delete" && e !== "written" && tr(E), r === "update" && (m.data.originalRecord = Oe(c)), r !== "delete" && ["started", "written"].includes(e) && (delete m.data.data.Saved_At, delete m.data.data.Last_Save_At), e === "failed" && (m.data.error = JSON.stringify(o));
11202
+ const E = ve(t);
11203
+ r !== "delete" && (m.data.data = E, e === "written" && cc(m.data.data)), r !== "delete" && e !== "written" && tr(E), r === "update" && (m.data.originalRecord = ve(c)), r !== "delete" && ["started", "written"].includes(e) && (delete m.data.data.Saved_At, delete m.data.data.Last_Save_At), e === "failed" && (m.data.error = JSON.stringify(o));
11204
11204
  const g = t.Last_Write_At, v = Ce(d, "tenants", l, n.join("/"), s, "system_write_log", `${a}-${g.valueOf()}`);
11205
11205
  Gm(v, m).catch((S) => {
11206
11206
  console.error(`Error saving "${e}" ${r} log entry for record ${s} in ${u.collection} collection.`, { cause: S });
11207
11207
  });
11208
11208
  }, lc = async (r, e, t, n, s) => {
11209
- const i = Dt(), a = je(), o = n.labels.collection, c = n.fields.filter((u) => "unique" in u && u.unique), l = [];
11209
+ const i = Dt(), a = Ue(), o = n.labels.collection, c = n.fields.filter((u) => "unique" in u && u.unique), l = [];
11210
11210
  if (!s.Role)
11211
11211
  throw new Error("No role found in permissions");
11212
11212
  if (await Promise.all(c.map(async (u) => {
@@ -11225,7 +11225,7 @@ const fw = async (r, e) => {
11225
11225
  })), l.length > 0)
11226
11226
  throw new Error(l.join(", "));
11227
11227
  }, dm = (r, e, t) => {
11228
- const n = je(), s = Dt(), i = Ke(), a = De(), o = r.at(-1);
11228
+ const n = Ue(), s = Dt(), i = Ye(), a = Fe(), o = r.at(-1);
11229
11229
  if (!o)
11230
11230
  throw new Error("EMPTY_PATH");
11231
11231
  const c = i.collections[o], { labels: l } = c, u = a.collections?.[l.collection];
@@ -11246,7 +11246,7 @@ const fw = async (r, e) => {
11246
11246
  };
11247
11247
  e(r);
11248
11248
  }, hw = async (r, e, t) => {
11249
- const n = it(), s = Ue(), i = $e(n, s.STOKER_FB_FUNCTIONS_REGION), a = e?.map((u) => u[2] instanceof Date ? [u[0], u[1], u[2].toISOString()] : u), o = Ye(i, "stoker-readapi");
11249
+ const n = it(), s = Ve(), i = je(n, s.STOKER_FB_FUNCTIONS_REGION), a = e?.map((u) => u[2] instanceof Date ? [u[0], u[1], u[2].toISOString()] : u), o = Je(i, "stoker-readapi");
11250
11250
  let c;
11251
11251
  if (!t?.pagination)
11252
11252
  c = await o({
@@ -11271,7 +11271,7 @@ const fw = async (r, e) => {
11271
11271
  hm(u);
11272
11272
  return l?.result;
11273
11273
  }, mm = async (r, e, t, n, s, i, a) => {
11274
- const o = De();
11274
+ const o = Fe();
11275
11275
  if (!o)
11276
11276
  throw new Error("PERMISSIONS_NOT_FOUND");
11277
11277
  const c = e.at(-2), l = Cd(n.collections[c], n, o).map((d) => d.labels.collection);
@@ -11297,7 +11297,7 @@ const fw = async (r, e) => {
11297
11297
  });
11298
11298
  await Promise.all(f);
11299
11299
  }, uc = async (r, e, t, n, s, i) => {
11300
- if (!De())
11300
+ if (!Fe())
11301
11301
  throw new Error("PERMISSIONS_NOT_FOUND");
11302
11302
  const o = e.at(-2);
11303
11303
  t.fields ||= n.collections[o].fields.filter((u) => ge(u));
@@ -11343,14 +11343,14 @@ const fw = async (r, e) => {
11343
11343
  const n = r.at(-1);
11344
11344
  if (!n)
11345
11345
  throw new Error("EMPTY_PATH");
11346
- const s = Ke(!0), a = Jr()[n], o = s.collections[n], { labels: c, access: l, preloadCache: u } = o, { serverReadOnly: f } = l, d = ke(), h = Object.keys(s.collections).includes(n), m = d.disabledCollections?.includes(n);
11346
+ const s = Ye(!0), a = Jr()[n], o = s.collections[n], { labels: c, access: l, preloadCache: u } = o, { serverReadOnly: f } = l, d = ke(), h = Object.keys(s.collections).includes(n), m = d.disabledCollections?.includes(n);
11347
11347
  if (!h || m)
11348
11348
  throw new Error("COLLECTION_NOT_FOUND");
11349
11349
  const E = await lt(c.collection), g = await se(d, [
11350
11350
  "global",
11351
11351
  "firebase",
11352
11352
  "serverTimestampOptions"
11353
- ]), v = De();
11353
+ ]), v = Fe();
11354
11354
  if (!v?.Role)
11355
11355
  throw new Error("PERMISSIONS_DENIED");
11356
11356
  if (f?.includes(v.Role))
@@ -11406,14 +11406,14 @@ const fw = async (r, e) => {
11406
11406
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11407
11407
  _.get(b.id),
11408
11408
  O,
11409
- Oe(t.subcollections),
11409
+ ve(t.subcollections),
11410
11410
  s,
11411
- Oe(t?.relations),
11411
+ ve(t?.relations),
11412
11412
  t?.only,
11413
11413
  t?.noEmbeddingFields
11414
11414
  )), t?.relations && (t.relations.fields && (t.relations.fields = t.relations.fields.map((D) => {
11415
11415
  if (typeof D == "string") {
11416
- const Y = o.fields.find((J) => J.name === D);
11416
+ const Y = o.fields.find((ee) => ee.name === D);
11417
11417
  if (Y)
11418
11418
  return Y;
11419
11419
  throw new Error(`SCHEMA_ERROR: Field ${D} not found in collection ${n}`);
@@ -11423,7 +11423,7 @@ const fw = async (r, e) => {
11423
11423
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11424
11424
  _.get(b.id),
11425
11425
  O,
11426
- Oe(t.relations),
11426
+ ve(t.relations),
11427
11427
  s,
11428
11428
  t?.only,
11429
11429
  t?.noEmbeddingFields
@@ -11439,14 +11439,14 @@ const fw = async (r, e) => {
11439
11439
  }
11440
11440
  return { cursor: P, pages: k, docs: Array.from(_.values()) };
11441
11441
  }, mw = async (r, e, t) => {
11442
- const n = it(), s = Ue(), i = $e(n, s.STOKER_FB_FUNCTIONS_REGION), l = (await Ye(i, "stoker-readapi")({
11442
+ const n = it(), s = Ve(), i = je(n, s.STOKER_FB_FUNCTIONS_REGION), l = (await Je(i, "stoker-readapi")({
11443
11443
  path: r,
11444
11444
  id: e,
11445
11445
  options: t
11446
11446
  })).data.result;
11447
11447
  return hm(l), l;
11448
11448
  }, ym = async (r, e, t, n, s, i) => {
11449
- const a = De();
11449
+ const a = Fe();
11450
11450
  if (!a)
11451
11451
  throw new Error("PERMISSIONS_NOT_FOUND");
11452
11452
  const o = e.at(-2), c = Cd(n.collections[o], n, a).map((f) => f.labels.collection);
@@ -11471,7 +11471,7 @@ const fw = async (r, e) => {
11471
11471
  });
11472
11472
  await Promise.all(u);
11473
11473
  }, gm = async (r, e, t, n, s, i, a) => {
11474
- if (!De())
11474
+ if (!Fe())
11475
11475
  throw new Error("PERMISSIONS_NOT_FOUND");
11476
11476
  const c = e.at(-2);
11477
11477
  t.fields ||= n.collections[c].fields.filter((f) => ge(f));
@@ -11516,14 +11516,14 @@ const fw = async (r, e) => {
11516
11516
  const n = r.at(-1);
11517
11517
  if (!n)
11518
11518
  throw new Error("EMPTY_PATH");
11519
- const s = Ke(!0), a = Jr()[n], o = ke(), c = Object.keys(s.collections).includes(n), l = o.disabledCollections?.includes(n);
11519
+ const s = Ye(!0), a = Jr()[n], o = ke(), c = Object.keys(s.collections).includes(n), l = o.disabledCollections?.includes(n);
11520
11520
  if (!c || l)
11521
11521
  throw new Error("COLLECTION_NOT_FOUND");
11522
11522
  const u = await se(o, [
11523
11523
  "global",
11524
11524
  "firebase",
11525
11525
  "serverTimestampOptions"
11526
- ]), f = s.collections[n], { labels: d, access: h } = f, { serverReadOnly: m } = h, E = lt(d.collection), g = De();
11526
+ ]), f = s.collections[n], { labels: d, access: h } = f, { serverReadOnly: m } = h, E = lt(d.collection), g = Fe();
11527
11527
  if (!g?.Role)
11528
11528
  throw new Error("PERMISSIONS_DENIED");
11529
11529
  if (m?.includes(g.Role))
@@ -11543,7 +11543,7 @@ const fw = async (r, e) => {
11543
11543
  for (const I of R)
11544
11544
  y.id ||= I.id, y = { ...y, ...I.data }, delete y.Collection_Path_String;
11545
11545
  const _ = [], C = r ? [...r, e] : [d.collection, e];
11546
- if (t?.subcollections && _.push(ym(y, C, Oe(t.subcollections), s, Oe(t?.relations), t?.only)), t?.relations && (t.relations.fields && (t.relations.fields = t.relations.fields.map((I) => {
11546
+ if (t?.subcollections && _.push(ym(y, C, ve(t.subcollections), s, ve(t?.relations), t?.only)), t?.relations && (t.relations.fields && (t.relations.fields = t.relations.fields.map((I) => {
11547
11547
  if (typeof I == "string") {
11548
11548
  const b = f.fields.find((w) => w.name === I);
11549
11549
  if (b)
@@ -11551,7 +11551,7 @@ const fw = async (r, e) => {
11551
11551
  throw new Error(`SCHEMA_ERROR: Field ${I} not found in collection ${n}`);
11552
11552
  }
11553
11553
  return I;
11554
- })), _.push(gm(y, C, Oe(t.relations), s, t?.only, t?.noComputedFields, t?.noEmbeddingFields))), await Promise.all(_), !t?.noComputedFields)
11554
+ })), _.push(gm(y, C, ve(t.relations), s, t?.only, t?.noComputedFields, t?.noEmbeddingFields))), await Promise.all(_), !t?.noComputedFields)
11555
11555
  for (const I of f.fields)
11556
11556
  I.type === "Computed" && (y[I.name] = await I.formula(y));
11557
11557
  if (t?.noEmbeddingFields)
@@ -11569,7 +11569,7 @@ const fw = async (r, e) => {
11569
11569
  };
11570
11570
  e(r);
11571
11571
  }, yw = async (r, e, t, n) => {
11572
- const s = it(), i = Ue(), a = $e(s, i.STOKER_FB_FUNCTIONS_REGION), o = Ye(a, "stoker-writeapi", { timeout: 540 * 1e3 });
11572
+ const s = it(), i = Ve(), a = je(s, i.STOKER_FB_FUNCTIONS_REGION), o = Je(a, "stoker-writeapi", { timeout: 540 * 1e3 });
11573
11573
  return _m(t), cc(t), (await o({
11574
11574
  operation: "update",
11575
11575
  path: r,
@@ -11578,7 +11578,7 @@ const fw = async (r, e) => {
11578
11578
  user: n
11579
11579
  })).data?.result;
11580
11580
  }, fc = async (r, e, t, n, s, i) => {
11581
- const a = Dt(), o = Ke(), c = Ke(!0), l = yc(), u = ke(), f = fr(), d = je(), h = De();
11581
+ const a = Dt(), o = Ye(), c = Ye(!0), l = yc(), u = ke(), f = fr(), d = Ue(), h = Fe();
11582
11582
  if (r.length === 0)
11583
11583
  throw new Error("EMPTY_PATH");
11584
11584
  const m = r.at(-1), E = Object.keys(o.collections).includes(m), g = u.disabledCollections?.includes(m);
@@ -11614,55 +11614,62 @@ const fw = async (r, e) => {
11614
11614
  if (!await se(u, ["global", "firebase", "enableEmulators"])) {
11615
11615
  F();
11616
11616
  try {
11617
- const { isValid: Ie } = await _d(f, n.password);
11618
- if (!Ie)
11617
+ const { isValid: De } = await _d(f, n.password);
11618
+ if (!De)
11619
11619
  throw new Error("Please create a stronger password");
11620
- } catch (Ie) {
11621
- throw new Error(`VALIDATION_ERROR: ${Ie.message}`);
11620
+ } catch (De) {
11621
+ throw new Error(`VALIDATION_ERROR: ${De.message}`);
11622
11622
  }
11623
11623
  }
11624
11624
  }
11625
- return await yw(r, e, t, n ? { operation: n.operation, permissions: n.permissions, password: n.password } : void 0);
11625
+ const q = [
11626
+ "update",
11627
+ { ...i, ...t },
11628
+ I,
11629
+ k,
11630
+ ve(i)
11631
+ ];
11632
+ return await oe("preValidate", u, R, q), await yw(r, e, t, n ? { operation: n.operation, permissions: n.permissions, password: n.password } : void 0);
11626
11633
  }
11627
11634
  delete t.id;
11628
11635
  const M = Ko("update", r, t, o, _, zt(), p.uid, Bt.now(), Lr(), !!C);
11629
11636
  for (const q of P)
11630
11637
  !ge(q) && sr(M[q.name]) && q.nullable && (M[q.name] = null);
11631
- if (xt(M), xt(i), !C && y && He("update", "started", M, r, e, v, p.uid, void 0, i), !C) {
11638
+ if (xt(M), xt(i), !C && y && Ke("update", "started", M, r, e, v, p.uid, void 0, i), !C) {
11632
11639
  const q = [
11633
11640
  "update",
11634
11641
  M,
11635
11642
  e,
11636
11643
  I,
11637
11644
  k,
11638
- Oe(i)
11645
+ ve(i)
11639
11646
  ];
11640
11647
  await oe("preOperation", u, R, q);
11641
- const H = ["update", M, e, I, k, Oe(i)];
11648
+ const H = ["update", M, e, I, k, ve(i)];
11642
11649
  await oe("preWrite", u, R, H);
11643
11650
  }
11644
11651
  if (Xd(v, M, o), eh(v, M), !C)
11645
11652
  try {
11646
11653
  const q = { ...i, ...M };
11647
- tr(q), await om("update", q, v, R, ["update", q, I, k, Oe(i)], o), x && (F(), await lc("update", e, M, v, h));
11654
+ tr(q), await om("update", q, v, R, ["update", q, I, k, ve(i)], o), x && (F(), await lc("update", e, M, v, h));
11648
11655
  } catch (q) {
11649
11656
  throw new Error(`VALIDATION_ERROR: ${q.message}`);
11650
11657
  }
11651
- if (Oy(M, i, e, v, o, p.uid, h), xt(M), ac("update", k, r, e, M, o, v, s, l, Io, ko, An, (q) => Ce(d, "tenants", a, "system_fields", S.collection, `${S.collection}-${q.name}`, e), (q, H) => Ce(d, "tenants", a, "system_unique", S.collection, `Unique-${S.collection}-${q.name}`, H), (q) => Ce(d, "tenants", a, "system_fields", S.collection, `${S.collection}-${q}`, e)), k.update(Ce(d, "tenants", a, r.join("/"), e), M), !C && y && He("update", "written", M, r, e, v, p.uid, void 0, i), await dc("update", r, e, M, I, v, R, k, p.uid, y || !1, h, !!C, i), C?.type === "unique") {
11658
+ if (Oy(M, i, e, v, o, p.uid, h), xt(M), ac("update", k, r, e, M, o, v, s, l, Io, ko, An, (q) => Ce(d, "tenants", a, "system_fields", S.collection, `${S.collection}-${q.name}`, e), (q, H) => Ce(d, "tenants", a, "system_unique", S.collection, `Unique-${S.collection}-${q.name}`, H), (q) => Ce(d, "tenants", a, "system_fields", S.collection, `${S.collection}-${q}`, e)), k.update(Ce(d, "tenants", a, r.join("/"), e), M), !C && y && Ke("update", "written", M, r, e, v, p.uid, void 0, i), await dc("update", r, e, M, I, v, R, k, p.uid, y || !1, h, !!C, i), C?.type === "unique") {
11652
11659
  const q = { ...i, ...M };
11653
11660
  return tr(q), { id: e, ...q };
11654
11661
  }
11655
- y && He("update", "success", M, r, e, v, p.uid, void 0, i);
11656
- const D = ["update", M, e, I, !!C, Oe(i)], Y = [...D];
11662
+ y && Ke("update", "success", M, r, e, v, p.uid, void 0, i);
11663
+ const D = ["update", M, e, I, !!C, ve(i)], Y = [...D];
11657
11664
  await oe("postWrite", u, R, D), await oe("postOperation", u, R, Y);
11658
- const J = { ...i, ...M };
11659
- return tr(J), { id: e, ...J };
11665
+ const ee = { ...i, ...M };
11666
+ return tr(ee), { id: e, ...ee };
11660
11667
  }, dc = async (r, e, t, n, s, i, a, o, c, l, u, f, d) => {
11661
- const h = Ke(), m = ke(), { labels: E } = i;
11668
+ const h = Ye(), m = ke(), { labels: E } = i;
11662
11669
  let g = 0;
11663
11670
  const v = async () => {
11664
11671
  try {
11665
- await Oe(o).commit();
11672
+ await ve(o).commit();
11666
11673
  return;
11667
11674
  } catch (S) {
11668
11675
  let T;
@@ -11724,7 +11731,7 @@ const fw = async (r, e) => {
11724
11731
  g++, await v();
11725
11732
  return;
11726
11733
  } else
11727
- l && He(
11734
+ l && Ke(
11728
11735
  r,
11729
11736
  "failed",
11730
11737
  n,
@@ -11741,7 +11748,7 @@ const fw = async (r, e) => {
11741
11748
  };
11742
11749
  await v();
11743
11750
  }, gw = async (r, e, t, n) => {
11744
- const s = it(), i = Ue(), a = $e(s, i.STOKER_FB_FUNCTIONS_REGION), o = Ye(a, "stoker-writeapi", { timeout: 540 * 1e3 });
11751
+ const s = it(), i = Ve(), a = je(s, i.STOKER_FB_FUNCTIONS_REGION), o = Je(a, "stoker-writeapi", { timeout: 540 * 1e3 });
11745
11752
  return _m(e), (await o({
11746
11753
  operation: "create",
11747
11754
  path: r,
@@ -11750,7 +11757,7 @@ const fw = async (r, e) => {
11750
11757
  id: n
11751
11758
  })).data?.result;
11752
11759
  }, vm = async (r, e, t, n, s, i) => {
11753
- const a = Dt(), o = Ke(), c = yc(), l = ke(), u = fr(), f = je(), d = De();
11760
+ const a = Dt(), o = Ye(), c = yc(), l = ke(), u = fr(), f = Ue(), d = Fe();
11754
11761
  if (r.length === 0)
11755
11762
  throw new Error("EMPTY_PATH");
11756
11763
  const h = r.at(-1), m = Object.keys(o.collections).includes(h), E = l.disabledCollections?.includes(h);
@@ -11783,38 +11790,38 @@ const fw = async (r, e) => {
11783
11790
  if (!await se(l, ["global", "firebase", "enableEmulators"])) {
11784
11791
  k();
11785
11792
  try {
11786
- const { isValid: J } = await _d(u, t.password);
11787
- if (!J)
11793
+ const { isValid: j } = await _d(u, t.password);
11794
+ if (!j)
11788
11795
  throw new Error("Please create a stronger password");
11789
- } catch (J) {
11790
- throw new Error(`VALIDATION_ERROR: ${J.message}`);
11796
+ } catch (j) {
11797
+ throw new Error(`VALIDATION_ERROR: ${j.message}`);
11791
11798
  }
11792
11799
  }
11793
11800
  }
11794
- return i && i(), await gw(r, e, t ? { permissions: t.permissions, password: t.password } : void 0, b);
11801
+ return await oe("preValidate", l, A, ["create", e, w, I]), i && i(), await gw(r, e, t ? { permissions: t.permissions, password: t.password } : void 0, b);
11795
11802
  }
11796
11803
  e.id = b;
11797
11804
  const O = Ko("create", r, e, o, R, zt(), C.uid, Bt.now(), Lr(), !!_);
11798
- if (P && (O[P.archivedField] = !1), xt(O), !_ && T && He("create", "started", O, r, b, g, C.uid), _ || (await oe("preOperation", l, A, ["create", O, b, w, I]), await oe("preWrite", l, A, ["create", O, b, w, I])), Xd(g, O, o), eh(g, O), _ || await hg(O, g, A, d.Role), !_)
11805
+ if (P && (O[P.archivedField] = !1), xt(O), !_ && T && Ke("create", "started", O, r, b, g, C.uid), _ || (await oe("preOperation", l, A, ["create", O, b, w, I]), await oe("preWrite", l, A, ["create", O, b, w, I])), Xd(g, O, o), eh(g, O), _ || await hg(O, g, A, d.Role), !_)
11799
11806
  try {
11800
11807
  await om("create", O, g, A, ["create", O, w, I], o), p && (k(), await lc("create", b, O, g, d));
11801
11808
  } catch (D) {
11802
11809
  throw new Error(`VALIDATION_ERROR: ${D.message}`);
11803
11810
  }
11804
- if (i && i(), xt(O), by(O, b, g, o, C.uid, d), ac("create", I, r, b, O, o, g, n, c, Io, ko, An, (D) => Ce(f, "tenants", a, "system_fields", v.collection, `${v.collection}-${D.name}`, b), (D, Y) => Ce(f, "tenants", a, "system_unique", v.collection, `Unique-${v.collection}-${D.name}`, Y), (D) => Ce(f, "tenants", a, "system_fields", v.collection, `${v.collection}-${D}`, b)), I.set(Ce(f, "tenants", a, r.join("/"), b), O), !_ && T && He("create", "written", O, r, b, g, C.uid), await dc("create", r, b, O, w, g, A, I, C.uid, T || !1, d, !!_), _?.type === "unique")
11811
+ if (i && i(), xt(O), by(O, b, g, o, C.uid, d), ac("create", I, r, b, O, o, g, n, c, Io, ko, An, (D) => Ce(f, "tenants", a, "system_fields", v.collection, `${v.collection}-${D.name}`, b), (D, Y) => Ce(f, "tenants", a, "system_unique", v.collection, `Unique-${v.collection}-${D.name}`, Y), (D) => Ce(f, "tenants", a, "system_fields", v.collection, `${v.collection}-${D}`, b)), I.set(Ce(f, "tenants", a, r.join("/"), b), O), !_ && T && Ke("create", "written", O, r, b, g, C.uid), await dc("create", r, b, O, w, g, A, I, C.uid, T || !1, d, !!_), _?.type === "unique")
11805
11812
  return { id: b, ...O };
11806
- T && He("create", "success", O, r, b, g, C.uid);
11813
+ T && Ke("create", "success", O, r, b, g, C.uid);
11807
11814
  const x = ["create", O, b, w, !!_], F = [...x];
11808
11815
  return await oe("postWrite", l, A, x), await oe("postOperation", l, A, F), { id: b, ...O };
11809
11816
  }, _w = async (r, e) => {
11810
- const t = it(), n = Ue(), s = $e(t, n.STOKER_FB_FUNCTIONS_REGION);
11811
- return (await Ye(s, "stoker-writeapi", { timeout: 540 * 1e3 })({
11817
+ const t = it(), n = Ve(), s = je(t, n.STOKER_FB_FUNCTIONS_REGION);
11818
+ return (await Je(s, "stoker-writeapi", { timeout: 540 * 1e3 })({
11812
11819
  operation: "delete",
11813
11820
  path: r,
11814
11821
  id: e
11815
11822
  })).data?.result;
11816
11823
  }, vw = async (r, e, t) => {
11817
- const n = Dt(), s = Ke(), i = yc(), a = fr(), o = je(), c = ke(), l = De();
11824
+ const n = Dt(), s = Ye(), i = yc(), a = fr(), o = Ue(), c = ke(), l = Fe();
11818
11825
  if (r.length === 0)
11819
11826
  throw new Error("EMPTY_PATH");
11820
11827
  const u = r.at(-1), f = Object.keys(s.collections).includes(u), d = c.disabledCollections?.includes(u);
@@ -11845,13 +11852,13 @@ const fw = async (r, e) => {
11845
11852
  try {
11846
11853
  C = await _r(r, e);
11847
11854
  } catch (F) {
11848
- throw g && y?.record && F.message.indexOf("NOT_FOUND") !== -1 && await He("delete", "failed", y?.record, r, e, h, A.uid, F), F;
11855
+ throw g && y?.record && F.message.indexOf("NOT_FOUND") !== -1 && await Ke("delete", "failed", y?.record, r, e, h, A.uid, F), F;
11849
11856
  }
11850
11857
  if (S || h.auth && C.User_ID)
11851
11858
  return await _w(r, e);
11852
11859
  delete C.id;
11853
11860
  const p = Co(o), k = { collection: m.collection }, I = Ko("delete", r, C, s, P, zt(), A.uid, Bt.now(), Lr(), !!y);
11854
- xt(I), !y && g && He("delete", "started", I, r, e, h, A.uid), y || (await oe("preOperation", c, T, ["delete", I, e, k, p]), await oe("preWrite", c, T, ["delete", I, e, k, p])), xt(I), Ey(I, e, h, s, A.uid, l), ac("delete", p, r, e, I, s, h, t, i, Io, ko, An, (F) => Ce(o, "tenants", n, "system_fields", m.collection, `${m.collection}-${F.name}`, e), (F, M) => Ce(o, "tenants", n, "system_unique", m.collection, `Unique-${m.collection}-${F.name}`, M), (F) => Ce(o, "tenants", n, "system_fields", m.collection, `${m.collection}-${F}`, e)), p.delete(Ce(o, "tenants", n, r.join("/"), e)), !y && g && He("delete", "written", I, r, e, h, A.uid), await dc("delete", r, e, I, k, h, T, p, A.uid, g || !1, l, !!y), g && He("delete", "success", { ...I, ...y?.record || {} }, r, e, h, A.uid);
11861
+ xt(I), !y && g && Ke("delete", "started", I, r, e, h, A.uid), y || (await oe("preOperation", c, T, ["delete", I, e, k, p]), await oe("preWrite", c, T, ["delete", I, e, k, p])), xt(I), Ey(I, e, h, s, A.uid, l), ac("delete", p, r, e, I, s, h, t, i, Io, ko, An, (F) => Ce(o, "tenants", n, "system_fields", m.collection, `${m.collection}-${F.name}`, e), (F, M) => Ce(o, "tenants", n, "system_unique", m.collection, `Unique-${m.collection}-${F.name}`, M), (F) => Ce(o, "tenants", n, "system_fields", m.collection, `${m.collection}-${F}`, e)), p.delete(Ce(o, "tenants", n, r.join("/"), e)), !y && g && Ke("delete", "written", I, r, e, h, A.uid), await dc("delete", r, e, I, k, h, T, p, A.uid, g || !1, l, !!y), g && Ke("delete", "success", { ...I, ...y?.record || {} }, r, e, h, A.uid);
11855
11862
  const w = ["delete", I, e, k, !!y], O = [...w];
11856
11863
  return await oe("postWrite", c, T, w), await oe("postOperation", c, T, O), { id: e, ...I };
11857
11864
  }, wm = (r) => {
@@ -11859,8 +11866,8 @@ const fw = async (r, e) => {
11859
11866
  for (const e in r)
11860
11867
  Object.prototype.hasOwnProperty.call(r, e) && (r[e] === "_DELETE_FIELD" ? r[e] = An() : wm(r[e]));
11861
11868
  }, ww = async (r, e) => {
11862
- const t = it(), n = Ue(), s = $e(t, n.STOKER_FB_FUNCTIONS_REGION);
11863
- return (await Ye(s, r)(e)).data;
11869
+ const t = it(), n = Ve(), s = je(t, n.STOKER_FB_FUNCTIONS_REGION);
11870
+ return (await Je(s, r)(e)).data;
11864
11871
  };
11865
11872
  let mt = {};
11866
11873
  const bw = async (r, e) => {
@@ -11885,7 +11892,7 @@ const bw = async (r, e) => {
11885
11892
  if (s?.uid !== e.uid)
11886
11893
  return;
11887
11894
  if (a.force && m !== a.version) {
11888
- He(
11895
+ Ke(
11889
11896
  u,
11890
11897
  "failed",
11891
11898
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -11994,13 +12001,13 @@ const Rw = () => {
11994
12001
  e(n);
11995
12002
  });
11996
12003
  };
11997
- let dt, hc, St, Sm, me, Tm, Pr, mc, pc, qe, Rm, Rn = [], ve;
12004
+ let dt, hc, St, Sm, me, Tm, Pr, mc, pc, Le, Rm, Rn = [], we;
11998
12005
  const Ya = {
11999
12006
  firestoreWriteApp: {}
12000
12007
  }, ht = {
12001
12008
  main: {},
12002
12009
  firestoreWrite: {}
12003
- }, Be = {
12010
+ }, Ze = {
12004
12011
  main: {},
12005
12012
  firestoreWrite: {},
12006
12013
  maintenance: {}
@@ -12013,7 +12020,7 @@ const Ya = {
12013
12020
  return hc;
12014
12021
  },
12015
12022
  getEnv() {
12016
- return ve;
12023
+ return we;
12017
12024
  },
12018
12025
  getTimezone() {
12019
12026
  return Sm;
@@ -12021,7 +12028,7 @@ const Ya = {
12021
12028
  getConnectionStatus: zt,
12022
12029
  getNetworkStatus: Aw,
12023
12030
  getSchema(r = !1) {
12024
- const e = Oe(Pr);
12031
+ const e = ve(Pr);
12025
12032
  if (r) {
12026
12033
  for (const t of Object.values(e.collections))
12027
12034
  for (const n of t.fields)
@@ -12038,20 +12045,20 @@ const Ya = {
12038
12045
  return Rm;
12039
12046
  },
12040
12047
  getCurrentUserRoleGroups() {
12041
- return Oe(pc);
12048
+ return ve(pc);
12042
12049
  },
12043
12050
  getAllRoleGroups() {
12044
- return Oe(mc);
12051
+ return ve(mc);
12045
12052
  },
12046
12053
  getGlobalConfigModule() {
12047
- return Oe(me);
12054
+ return ve(me);
12048
12055
  },
12049
12056
  getCollectionConfigModule(r) {
12050
- return Oe(Tm[r]);
12057
+ return ve(Tm[r]);
12051
12058
  },
12052
12059
  getVersionInfo: Om,
12053
12060
  getMaintenanceInfo: Tw,
12054
- getCurrentUserPermissions: De,
12061
+ getCurrentUserPermissions: Fe,
12055
12062
  getLoadingState: To,
12056
12063
  getAppCheck() {
12057
12064
  return At.main;
@@ -12063,22 +12070,22 @@ const Ya = {
12063
12070
  return ht.firestoreWrite;
12064
12071
  },
12065
12072
  getFirestoreWrite() {
12066
- return Be.firestoreWrite;
12073
+ return Ze.firestoreWrite;
12067
12074
  },
12068
12075
  getFirestoreMaintenance() {
12069
- return Be.maintenance;
12076
+ return Ze.maintenance;
12070
12077
  }
12071
12078
  }, kw = () => {
12072
- hc = "", Pr = {}, mc = {}, pc = {}, qe = {}, og(), dw(), Ow();
12079
+ hc = "", Pr = {}, mc = {}, pc = {}, Le = {}, og(), dw(), Ow();
12073
12080
  }, Iw = () => Rn, xw = () => {
12074
12081
  Rn = [];
12075
12082
  };
12076
12083
  let gd = !1;
12077
12084
  const Gw = async (r, e, t, n) => {
12078
- if (ve = t, dt)
12085
+ if (we = t, dt)
12079
12086
  return console.error("Stoker is already initialized."), !0;
12080
- xm("stoker-client", pp, "web"), St = ve.MODE, me = r.default("web", Ao, n), Sm = await se(me, ["global", "timezone"]), se(me, ["global", "roles"]), se(me, ["global", "appName"]), se(me, ["global", "auth", "enableMultiFactorAuth"]);
12081
- const s = JSON.parse(ve.STOKER_FB_WEB_APP_CONFIG), i = await se(me, ["global", "firebase", "GDPRSettings"]);
12087
+ xm("stoker-client", pp, "web"), St = we.MODE, me = r.default("web", Ao, n), Sm = await se(me, ["global", "timezone"]), se(me, ["global", "roles"]), se(me, ["global", "appName"]), se(me, ["global", "auth", "enableMultiFactorAuth"]);
12088
+ const s = JSON.parse(we.STOKER_FB_WEB_APP_CONFIG), i = await se(me, ["global", "firebase", "GDPRSettings"]);
12082
12089
  dt = zn(s, {
12083
12090
  automaticDataCollectionEnabled: i || !0
12084
12091
  });
@@ -12088,12 +12095,12 @@ const Gw = async (r, e, t, n) => {
12088
12095
  for (const p of o)
12089
12096
  Ya[`${p}App`] = zn(s, p);
12090
12097
  const { firestoreWriteApp: c } = Ya, l = zn(s, "maintenance");
12091
- Be.maintenance = je(l);
12098
+ Ze.maintenance = Ue(l);
12092
12099
  const u = hp();
12093
- if (u.settings.minimumFetchIntervalMillis = 36e5, await mp(u), ve.STOKER_FB_ENABLE_APP_CHECK === "true" && ve.STOKER_FB_APP_CHECK_KEY) {
12100
+ if (u.settings.minimumFetchIntervalMillis = 36e5, await mp(u), we.STOKER_FB_ENABLE_APP_CHECK === "true" && we.STOKER_FB_APP_CHECK_KEY) {
12094
12101
  (St === "development" || window.location.hostname === "localhost") && (globalThis.FIREBASE_APPCHECK_DEBUG_TOKEN = !0);
12095
12102
  const p = {
12096
- provider: new fp(ve.STOKER_FB_APP_CHECK_KEY),
12103
+ provider: new fp(we.STOKER_FB_APP_CHECK_KEY),
12097
12104
  isTokenAutoRefreshEnabled: !0
12098
12105
  };
12099
12106
  At.main = Gn(dt, p), At.firestoreWrite = Gn(c, p), At.maintenance = Gn(l, p);
@@ -12165,31 +12172,31 @@ const Gw = async (r, e, t, n) => {
12165
12172
  ]);
12166
12173
  if (St === "development" && m) {
12167
12174
  if (!R?.includes("Auth")) {
12168
- const p = ve.STOKER_FB_EMULATOR_AUTH_PORT ? parseInt(ve.STOKER_FB_EMULATOR_AUTH_PORT) : 9099;
12175
+ const p = we.STOKER_FB_EMULATOR_AUTH_PORT ? parseInt(we.STOKER_FB_EMULATOR_AUTH_PORT) : 9099;
12169
12176
  for (const k of Object.values(ht))
12170
12177
  $m(k, `http://localhost:${p}`);
12171
12178
  }
12172
12179
  if (!R?.includes("Database")) {
12173
- const p = ve.STOKER_FB_EMULATOR_DATABASE_PORT ? parseInt(ve.STOKER_FB_EMULATOR_DATABASE_PORT) : 9e3;
12180
+ const p = we.STOKER_FB_EMULATOR_DATABASE_PORT ? parseInt(we.STOKER_FB_EMULATOR_DATABASE_PORT) : 9e3;
12174
12181
  Zm(wd(), "localhost", p);
12175
12182
  }
12176
12183
  if (!R?.includes("Firestore")) {
12177
- const p = ve.STOKER_FB_EMULATOR_FIRESTORE_PORT ? parseInt(ve.STOKER_FB_EMULATOR_FIRESTORE_PORT) : 8080;
12178
- Ac(Be.maintenance, "localhost", p);
12184
+ const p = we.STOKER_FB_EMULATOR_FIRESTORE_PORT ? parseInt(we.STOKER_FB_EMULATOR_FIRESTORE_PORT) : 8080;
12185
+ Ac(Ze.maintenance, "localhost", p);
12179
12186
  }
12180
12187
  if (!R?.includes("Storage")) {
12181
- const p = ve.STOKER_FB_EMULATOR_STORAGE_PORT ? parseInt(ve.STOKER_FB_EMULATOR_STORAGE_PORT) : 9199;
12188
+ const p = we.STOKER_FB_EMULATOR_STORAGE_PORT ? parseInt(we.STOKER_FB_EMULATOR_STORAGE_PORT) : 9199;
12182
12189
  cp(lp(), "localhost", p);
12183
12190
  }
12184
12191
  if (!R?.includes("Functions")) {
12185
- const p = ve.STOKER_FB_EMULATOR_FUNCTIONS_PORT ? parseInt(ve.STOKER_FB_EMULATOR_FUNCTIONS_PORT) : 5001;
12186
- up($e(dt, ve.STOKER_FB_FUNCTIONS_REGION), "localhost", p);
12192
+ const p = we.STOKER_FB_EMULATOR_FUNCTIONS_PORT ? parseInt(we.STOKER_FB_EMULATOR_FUNCTIONS_PORT) : 5001;
12193
+ up(je(dt, we.STOKER_FB_FUNCTIONS_REGION), "localhost", p);
12187
12194
  }
12188
12195
  }
12189
12196
  if (Ew(), Sw(), Rw(), St === "development" && (g ? Qr(g) : Qr("debug")), St === "production" && (v ? Qr(v) : Qr("error")), E) {
12190
12197
  const p = Bn(A, async (k) => {
12191
12198
  if (k) {
12192
- const I = JSON.parse(ve.STOKER_FB_WEB_APP_CONFIG);
12199
+ const I = JSON.parse(we.STOKER_FB_WEB_APP_CONFIG);
12193
12200
  Nm(() => {
12194
12201
  console.log(`Tenant - ${I.projectId} - User - ${k.uid}`);
12195
12202
  });
@@ -12206,23 +12213,23 @@ const Gw = async (r, e, t, n) => {
12206
12213
  let C;
12207
12214
  return Bn(A, async (p) => {
12208
12215
  if (p) {
12209
- qe = p;
12210
- const k = await jm(qe), { claims: I } = k;
12216
+ Le = p;
12217
+ const k = await jm(Le), { claims: I } = k;
12211
12218
  hc = I.tenant, Rm = {
12212
- ...qe,
12219
+ ...Le,
12213
12220
  token: {
12214
12221
  claims: I
12215
12222
  }
12216
12223
  };
12217
12224
  const b = [];
12218
12225
  for (const Ee of Object.values(ht))
12219
- b.push(new Promise((Ve) => {
12220
- const Mt = Bn(Ee, async (j) => {
12221
- j && (Mt(), Ve({}));
12226
+ b.push(new Promise((We) => {
12227
+ const Mt = Bn(Ee, async (U) => {
12228
+ U && (Mt(), We({}));
12222
12229
  });
12223
12230
  }));
12224
- await Promise.all(b), gd || (Cw(me), gd = !0), C = await se(me, ["global", "auth", "offlinePersistenceType"], [qe, I]);
12225
- const w = await se(me, ["global", "auth", "tabManager"], [qe, I]), O = await se(me, ["global", "auth", "garbageCollectionStrategy"], [qe, I]), x = await se(me, ["global", "auth", "maxCacheSize"], [qe, I]) || -1, F = await se(me, ["global", "auth", "maxWriteCacheSize"], [qe, I]);
12231
+ await Promise.all(b), gd || (Cw(me), gd = !0), C = await se(me, ["global", "auth", "offlinePersistenceType"], [Le, I]);
12232
+ const w = await se(me, ["global", "auth", "tabManager"], [Le, I]), O = await se(me, ["global", "auth", "garbageCollectionStrategy"], [Le, I]), x = await se(me, ["global", "auth", "maxCacheSize"], [Le, I]) || -1, F = await se(me, ["global", "auth", "maxWriteCacheSize"], [Le, I]);
12226
12233
  let M;
12227
12234
  const D = {
12228
12235
  localCache: Cc({
@@ -12235,31 +12242,31 @@ const Gw = async (r, e, t, n) => {
12235
12242
  cacheSizeBytes: F || x
12236
12243
  })
12237
12244
  };
12238
- let J;
12239
- if (O === "EAGER" ? J = Xm() : J = ep({ cacheSizeBytes: x }), C === "ALL" ? M = D : M = {
12245
+ let ee;
12246
+ if (O === "EAGER" ? ee = Xm() : ee = ep({ cacheSizeBytes: x }), C === "ALL" ? M = D : M = {
12240
12247
  localCache: tp({
12241
- garbageCollector: J
12248
+ garbageCollector: ee
12242
12249
  })
12243
- }, Be.main = Zn(dt, M), ["ALL", "WRITE"].includes(C) ? Be.firestoreWrite = Zn(c, Y) : Be.firestoreWrite = Zn(c, M), St === "development" && m && !R?.includes("Firestore")) {
12244
- const Ee = ve.STOKER_FB_EMULATOR_FIRESTORE_PORT ? parseInt(ve.STOKER_FB_EMULATOR_FIRESTORE_PORT) : 8080;
12245
- for (const [Ve, Mt] of Object.entries(Be))
12246
- Ve !== "maintenance" && Ac(Mt, "localhost", Ee);
12250
+ }, Ze.main = Zn(dt, M), ["ALL", "WRITE"].includes(C) ? Ze.firestoreWrite = Zn(c, Y) : Ze.firestoreWrite = Zn(c, M), St === "development" && m && !R?.includes("Firestore")) {
12251
+ const Ee = we.STOKER_FB_EMULATOR_FIRESTORE_PORT ? parseInt(we.STOKER_FB_EMULATOR_FIRESTORE_PORT) : 8080;
12252
+ for (const [We, Mt] of Object.entries(Ze))
12253
+ We !== "maintenance" && Ac(Mt, "localhost", Ee);
12247
12254
  }
12248
12255
  if (C === "ALL") {
12249
- const Ee = rp(Be.main);
12256
+ const Ee = rp(Ze.main);
12250
12257
  Ee && np(Ee);
12251
12258
  }
12252
- const q = await Ye($e(dt, ve.STOKER_FB_FUNCTIONS_REGION), "stoker-schema")().catch((Ee) => {
12259
+ const q = await Je(je(dt, we.STOKER_FB_FUNCTIONS_REGION), "stoker-schema")().catch((Ee) => {
12253
12260
  throw new Error("Error fetching schema.", { cause: Ee });
12254
12261
  });
12255
12262
  Pr = q.data.schema;
12256
- const H = Object.entries(q.data.allRoleGroups).map(([Ee, Ve]) => [Ee, new Set(Ve)]);
12263
+ const H = Object.entries(q.data.allRoleGroups).map(([Ee, We]) => [Ee, new Set(We)]);
12257
12264
  mc = Object.fromEntries(H), pc = q.data.currentUserRoleGroups, Tm = Sy(Object.keys(Pr.collections), e, "web", Ao, n);
12258
- const Ie = await fw(qe, k);
12259
- Rn.push(...Ie), C === "WRITE" && bw(Pr, qe), await _e(me.postLogin, [qe]);
12260
- const Qe = new Event("stoker:ready");
12261
- document.dispatchEvent(Qe);
12262
- } else if (qe) {
12265
+ const qe = await fw(Le, k);
12266
+ Rn.push(...qe), C === "WRITE" && bw(Pr, Le), await _e(me.postLogin, [Le]);
12267
+ const De = new Event("stoker:ready");
12268
+ document.dispatchEvent(De);
12269
+ } else if (Le) {
12263
12270
  kw(), Iw().forEach((O) => {
12264
12271
  O();
12265
12272
  }), xw();
@@ -12274,7 +12281,7 @@ const Gw = async (r, e, t, n) => {
12274
12281
  error: x
12275
12282
  }), console.error(`Error signing out of ${O.app.name}.`);
12276
12283
  });
12277
- })), await Promise.all(Object.entries(Be).map(async ([O, x]) => {
12284
+ })), await Promise.all(Object.entries(Ze).map(async ([O, x]) => {
12278
12285
  O !== "maintenance" && Object.keys(x).length !== 0 && await sp(x).catch((F) => {
12279
12286
  console.error(`Error terminating ${x.app.name}.`), b.error = !0, b.instances.push({
12280
12287
  instance: x.app.name,
@@ -12286,14 +12293,14 @@ const Gw = async (r, e, t, n) => {
12286
12293
  "global",
12287
12294
  "auth",
12288
12295
  "clearPersistenceOnSignOut"
12289
- ]) ?? !0) && (C === "ALL" && await xc(Be.main).catch((O) => {
12296
+ ]) ?? !0) && (C === "ALL" && await xc(Ze.main).catch((O) => {
12290
12297
  console.error('Error clearing indexedDB persistence in "[DEFAULT]".'), b.error = !0, b.instances.push({ instance: "[DEFAULT]", code: "CLEAR_CACHE", error: O });
12291
- }), ["ALL", "WRITE"].includes(C) && await xc(Be.firestoreWrite).catch((O) => {
12298
+ }), ["ALL", "WRITE"].includes(C) && await xc(Ze.firestoreWrite).catch((O) => {
12292
12299
  console.error('Error clearing indexedDB persistence in "firestoreWrite".'), b.error = !0, b.instances.push({ instance: "firestoreWrite", code: "CLEAR_CACHE", error: O });
12293
12300
  })), b.error ? console.info("Sign out operation completed with errors.") : console.info("Sign out operation completed successfully."), await _e(me.postLogout, [b]);
12294
12301
  }
12295
12302
  }), _ ? !1 : A.currentUser ? (E && console.info(`${A.currentUser.uid} successfully logged in.`), !0) : !1;
12296
- }, { getTenant: Dt, getEnv: Ue, getTimezone: Am, getSchema: Ke, getCurrentUser: Hw, getCurrentUserRoleGroups: Jr, getAllRoleGroups: yc, getGlobalConfigModule: ke, getCollectionConfigModule: lt, getAppCheck: Kw, getAppCheckFirestoreWrite: Yw, getFirestoreWriteAuth: Nw, getFirestoreWrite: gc, getFirestoreMaintenance: Cm } = Ao, Jw = async (r, e, t) => {
12303
+ }, { getTenant: Dt, getEnv: Ve, getTimezone: Am, getSchema: Ye, getCurrentUser: Hw, getCurrentUserRoleGroups: Jr, getAllRoleGroups: yc, getGlobalConfigModule: ke, getCollectionConfigModule: lt, getAppCheck: Kw, getAppCheckFirestoreWrite: Yw, getFirestoreWriteAuth: Nw, getFirestoreWrite: gc, getFirestoreMaintenance: Cm } = Ao, Jw = async (r, e, t) => {
12297
12304
  const [n, s] = [fr(), Nw()], i = ke();
12298
12305
  if (!r || !e)
12299
12306
  throw new Error("Email and password are required.");
@@ -12316,7 +12323,7 @@ const Gw = async (r, e, t, n) => {
12316
12323
  throw c;
12317
12324
  }
12318
12325
  if (!s.currentUser) {
12319
- const c = it(), l = Ue(), u = $e(c, l.STOKER_FB_FUNCTIONS_REGION), f = Ye(u, "stoker-customtoken");
12326
+ const c = it(), l = Ve(), u = je(c, l.STOKER_FB_FUNCTIONS_REGION), f = Je(u, "stoker-customtoken");
12320
12327
  try {
12321
12328
  const h = (await f()).data.customToken;
12322
12329
  if (!h)
@@ -12360,15 +12367,15 @@ const Gw = async (r, e, t, n) => {
12360
12367
  } else
12361
12368
  throw new Error("User must have an email address to enroll in multi-factor authentication.");
12362
12369
  }, rb = async (r, e, t) => {
12363
- const n = it(), s = Ue(), i = $e(n, s.STOKER_FB_FUNCTIONS_REGION);
12364
- await Ye(i, "stoker-deletefolder")({
12370
+ const n = it(), s = Ve(), i = je(n, s.STOKER_FB_FUNCTIONS_REGION);
12371
+ await Je(i, "stoker-deletefolder")({
12365
12372
  path: r || "",
12366
12373
  id: e.id,
12367
12374
  collectionPath: e.Collection_Path,
12368
12375
  folderName: t
12369
12376
  });
12370
12377
  }, nb = async () => {
12371
- const r = [je(), gc()];
12378
+ const r = [Ue(), gc()];
12372
12379
  for (const e of Object.values(r))
12373
12380
  await ip(e).catch((t) => {
12374
12381
  throw new Error(`Error waiting for pending writes in ${e.app.name}.`, { cause: t });
@@ -12377,10 +12384,10 @@ const Gw = async (r, e, t, n) => {
12377
12384
  const i = r.at(-1);
12378
12385
  if (!i)
12379
12386
  throw new Error("EMPTY_PATH");
12380
- const a = De();
12387
+ const a = Fe();
12381
12388
  if (!a?.Role)
12382
12389
  throw new Error("PERMISSIONS_NOT_FOUND");
12383
- const o = Ke(!0), l = Jr()[i], u = je(), f = o.collections[i];
12390
+ const o = Ye(!0), l = Jr()[i], u = Ue(), f = o.collections[i];
12384
12391
  if (!f)
12385
12392
  throw new Error("COLLECTION_NOT_FOUND");
12386
12393
  const { labels: d, preloadCache: h } = f, m = ke(), E = Object.keys(o.collections).includes(i), g = m.disabledCollections?.includes(i);
@@ -12422,55 +12429,55 @@ const Gw = async (r, e, t, n) => {
12422
12429
  for (const M of f.fields)
12423
12430
  M.type === "Embedding" && delete p[M.name];
12424
12431
  }
12425
- t(Oe(p));
12432
+ t(ve(p));
12426
12433
  });
12427
12434
  }, b = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), O = (F) => typeof F == "object" ? F.fields.filter((D) => typeof D == "object" && ge(D) && jt(f, o, a).includes(D.collection)) : f.fields.filter((D) => ge(D) && jt(f, o, a).includes(D.collection)), x = () => new Promise((F) => {
12428
12435
  if (!s?.relations) {
12429
12436
  F({});
12430
12437
  return;
12431
12438
  }
12432
- const M = Oe(s.relations), D = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new Map(), J = O(M);
12433
- for (const W of J)
12439
+ const M = ve(s.relations), D = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new Map(), ee = O(M);
12440
+ for (const j of ee)
12434
12441
  for (const q of w.values())
12435
- q.type === W.type && q.field === W.name && // eslint-disable-next-line security/detect-object-injection
12436
- !p[W.name][q.id] && (q.listener(), b.delete(`${W.name}_${q.id}`));
12437
- for (const W of J)
12438
- if ("collection" in W) {
12439
- const q = p[W.name];
12442
+ q.type === j.type && q.field === j.name && // eslint-disable-next-line security/detect-object-injection
12443
+ !p[j.name][q.id] && (q.listener(), b.delete(`${j.name}_${q.id}`));
12444
+ for (const j of ee)
12445
+ if ("collection" in j) {
12446
+ const q = p[j.name];
12440
12447
  if (!q)
12441
12448
  continue;
12442
12449
  for (const H of Object.keys(q))
12443
- q?.[H].id || (D.set(`${W.name}_${H}`, !1), b.has(`${W.name}_${H}`) ? Y.set(`${W.name}_${H}`, !0) : b.set(`${W.name}_${H}`, !0));
12450
+ q?.[H].id || (D.set(`${j.name}_${H}`, !1), b.has(`${j.name}_${H}`) ? Y.set(`${j.name}_${H}`, !0) : b.set(`${j.name}_${H}`, !0));
12444
12451
  }
12445
12452
  if (D.size === 0)
12446
12453
  F({});
12447
12454
  else
12448
- for (const W of J)
12449
- if ("collection" in W) {
12450
- const q = p[W.name];
12455
+ for (const j of ee)
12456
+ if ("collection" in j) {
12457
+ const q = p[j.name];
12451
12458
  if (!q)
12452
12459
  continue;
12453
- for (const [H, Ie] of Object.entries(q))
12454
- if (Y.has(`${W.name}_${H}`)) {
12455
- const Qe = async () => {
12456
- q[H].id ? (D.set(`${W.name}_${H}`, !0), Array.from(D.values()).every((Ee) => Ee) && (F({}), I())) : setTimeout(Qe, 100);
12460
+ for (const [H, qe] of Object.entries(q))
12461
+ if (Y.has(`${j.name}_${H}`)) {
12462
+ const De = async () => {
12463
+ q[H].id ? (D.set(`${j.name}_${H}`, !0), Array.from(D.values()).every((Ee) => Ee) && (F({}), I())) : setTimeout(De, 100);
12457
12464
  };
12458
- Qe();
12465
+ De();
12459
12466
  } else {
12460
- const Qe = o.collections[W.collection], { access: Ee } = Qe, { serverReadOnly: Ve } = Ee;
12461
- Ve?.includes(a.Role) ? _r([...Ie.Collection_Path], H, {
12467
+ const De = o.collections[j.collection], { access: Ee } = De, { serverReadOnly: We } = Ee;
12468
+ We?.includes(a.Role) ? _r([...qe.Collection_Path], H, {
12462
12469
  noComputedFields: s?.noComputedFields,
12463
12470
  noEmbeddingFields: s?.noEmbeddingFields
12464
- }).then((j) => {
12465
- if (!j) {
12471
+ }).then((U) => {
12472
+ if (!U) {
12466
12473
  delete q[H];
12467
12474
  return;
12468
12475
  }
12469
12476
  if (!q?.[H]) {
12470
- D.set(`${W.name}_${H}`, !0), b.delete(`${W.name}_${H}`);
12477
+ D.set(`${j.name}_${H}`, !0), b.delete(`${j.name}_${H}`);
12471
12478
  return;
12472
12479
  }
12473
- q[H] = j, D.set(`${W.name}_${H}`, !0), Array.from(D.values()).every((ae) => ae) && (F({}), I(), oe("postOperation", m, v, [
12480
+ q[H] = U, D.set(`${j.name}_${H}`, !0), Array.from(D.values()).every((ae) => ae) && (F({}), I(), oe("postOperation", m, v, [
12474
12481
  "read",
12475
12482
  p,
12476
12483
  e,
@@ -12481,23 +12488,23 @@ const Gw = async (r, e, t, n) => {
12481
12488
  p,
12482
12489
  !0
12483
12490
  ]));
12484
- }).catch((j) => {
12485
- delete q[H], j.code !== "permission-denied" && n && n(new Error(`Error fetching relation document in collection ${W.collection} with ID ${e} at location ${Ie.Collection_Path?.join("/")}`, {
12486
- cause: j
12491
+ }).catch((U) => {
12492
+ delete q[H], U.code !== "permission-denied" && n && n(new Error(`Error fetching relation document in collection ${j.collection} with ID ${e} at location ${qe.Collection_Path?.join("/")}`, {
12493
+ cause: U
12487
12494
  }));
12488
12495
  }) : km(
12489
- [...Ie.Collection_Path],
12496
+ [...qe.Collection_Path],
12490
12497
  H,
12491
- (j) => {
12492
- if (!j) {
12498
+ (U) => {
12499
+ if (!U) {
12493
12500
  delete q[H];
12494
12501
  return;
12495
12502
  }
12496
12503
  if (!q?.[H]) {
12497
- w.get(`${W.name}_${H}`) && w.get(`${W.name}_${H}`).listener(), D.set(`${W.name}_${H}`, !0), b.delete(`${W.name}_${H}`);
12504
+ w.get(`${j.name}_${H}`) && w.get(`${j.name}_${H}`).listener(), D.set(`${j.name}_${H}`, !0), b.delete(`${j.name}_${H}`);
12498
12505
  return;
12499
12506
  }
12500
- q[H] = j, D.set(`${W.name}_${H}`, !0), Array.from(D.values()).every((ae) => ae) && (F({}), I(), oe("postOperation", m, v, [
12507
+ q[H] = U, D.set(`${j.name}_${H}`, !0), Array.from(D.values()).every((ae) => ae) && (F({}), I(), oe("postOperation", m, v, [
12501
12508
  "read",
12502
12509
  p,
12503
12510
  e,
@@ -12510,22 +12517,22 @@ const Gw = async (r, e, t, n) => {
12510
12517
  ]));
12511
12518
  },
12512
12519
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12513
- (j) => {
12514
- delete q[H], j.code !== "permission-denied" && n && n(new Error(`Error fetching relation document in collection ${W.collection} with ID ${e} at location ${Ie.Collection_Path?.join("/")}`, {
12515
- cause: j
12520
+ (U) => {
12521
+ delete q[H], U.code !== "permission-denied" && n && n(new Error(`Error fetching relation document in collection ${j.collection} with ID ${e} at location ${qe.Collection_Path?.join("/")}`, {
12522
+ cause: U
12516
12523
  }));
12517
12524
  },
12518
12525
  { ...s, relations: !1 }
12519
- ).then((j) => {
12526
+ ).then((U) => {
12520
12527
  if (!q?.[H]) {
12521
- j(), b.delete(`${W.name}_${H}`);
12528
+ U(), b.delete(`${j.name}_${H}`);
12522
12529
  return;
12523
12530
  }
12524
- C.push(j), w.set(`${W.name}_${H}`, {
12531
+ C.push(U), w.set(`${j.name}_${H}`, {
12525
12532
  id: H,
12526
- type: W.type,
12527
- field: W.name,
12528
- listener: j
12533
+ type: j.type,
12534
+ field: j.name,
12535
+ listener: U
12529
12536
  });
12530
12537
  });
12531
12538
  }
@@ -12536,13 +12543,13 @@ const Gw = async (r, e, t, n) => {
12536
12543
  if (D.exists()) {
12537
12544
  const Y = D.data({ serverTimestamps: S || "none" });
12538
12545
  if (_.has(F.path) && s?.relations) {
12539
- const W = O(s?.relations);
12540
- for (const q of W)
12546
+ const j = O(s?.relations);
12547
+ for (const q of j)
12541
12548
  "collection" in q && Y[q.name] && (Y[q.name] = p?.[q.name]);
12542
12549
  }
12543
12550
  _.set(F.path, !0), p ||= {}, p.id ||= D.id, p = { ...p, ...Y }, delete p.Collection_Path_String;
12544
- const J = k.get(F) || /* @__PURE__ */ new Set();
12545
- lm(Y, J), k.set(F, J), _.size === T.length && x().then(() => {
12551
+ const ee = k.get(F) || /* @__PURE__ */ new Set();
12552
+ lm(Y, ee), k.set(F, ee), _.size === T.length && x().then(() => {
12546
12553
  I(), oe("postOperation", m, v, [
12547
12554
  "read",
12548
12555
  p,
@@ -12579,10 +12586,10 @@ const Gw = async (r, e, t, n) => {
12579
12586
  const i = r.at(-1);
12580
12587
  if (!i)
12581
12588
  throw new Error("EMPTY_PATH");
12582
- const a = De();
12589
+ const a = Fe();
12583
12590
  if (!a?.Role)
12584
12591
  throw new Error("PERMISSION_DENIED");
12585
- const o = Ke(!0), l = Jr()[i], u = je(), f = o.collections[i], { labels: d, preloadCache: h, access: m } = f, { serverReadOnly: E } = m, g = ke(), v = Object.keys(o.collections).includes(i), S = g.disabledCollections?.includes(i);
12592
+ const o = Ye(!0), l = Jr()[i], u = Ue(), f = o.collections[i], { labels: d, preloadCache: h, access: m } = f, { serverReadOnly: E } = m, g = ke(), v = Object.keys(o.collections).includes(i), S = g.disabledCollections?.includes(i);
12586
12593
  if (!v || S)
12587
12594
  throw new Error("COLLECTION_NOT_FOUND");
12588
12595
  const T = lt(d.collection), P = await se(g, [
@@ -12591,15 +12598,15 @@ const Gw = async (r, e, t, n) => {
12591
12598
  "serverTimestampOptions"
12592
12599
  ]), y = h?.roles?.includes(a.Role);
12593
12600
  if (s?.pagination?.number !== void 0) {
12594
- const j = s.pagination.number;
12595
- if (typeof j != "number" || !Number.isFinite(j) || !Number.isInteger(j) || j < 1)
12601
+ const U = s.pagination.number;
12602
+ if (typeof U != "number" || !Number.isFinite(U) || !Number.isInteger(U) || U < 1)
12596
12603
  throw new Error("INPUT_ERROR: Pagination number must be a positive finite integer");
12597
12604
  }
12598
12605
  const A = oc(r, l, s?.getAll);
12599
12606
  if (A.length === 0)
12600
12607
  return { pages: 0, count: 0, unsubscribe: () => {
12601
12608
  } };
12602
- let R = A.map((j) => he(j, ...e));
12609
+ let R = A.map((U) => he(U, ...e));
12603
12610
  const _ = s?.pagination?.startAfter || s?.pagination?.endBefore || s?.pagination?.startAt || s?.pagination?.endAt || {
12604
12611
  first: /* @__PURE__ */ new Map(),
12605
12612
  last: /* @__PURE__ */ new Map()
@@ -12607,118 +12614,118 @@ const Gw = async (r, e, t, n) => {
12607
12614
  if (s?.pagination) {
12608
12615
  if (s.pagination.startAfter && s.pagination.endBefore || s.pagination.startAfter && s.pagination.endAt || s.pagination.startAfter && s.pagination.startAt || s.pagination.startAt && s.pagination.endBefore || s.pagination.startAt && s.pagination.endAt || s.pagination.endBefore && s.pagination.endAt)
12609
12616
  throw new Error("INPUT_ERROR: Only one of startAfter, startAt, endBefore, or endAt can be provided");
12610
- const j = s.pagination.startAfter || s.pagination.endBefore || s.pagination.startAt || s.pagination.endAt, ae = Ud(a.Role, f, o);
12611
- if (j && ae !== !0)
12617
+ const U = s.pagination.startAfter || s.pagination.endBefore || s.pagination.startAt || s.pagination.endAt, ae = Ud(a.Role, f, o);
12618
+ if (U && ae !== !0)
12612
12619
  throw new Error("INPUT_ERROR: Pagination is not allowed when using " + ae);
12613
- s.pagination.startAfter || s.pagination.endBefore || s.pagination.startAt || s.pagination.endAt ? s.pagination.startAfter ? (Qa(s.pagination.startAfter), R = R.map((z, Q) => {
12620
+ s.pagination.startAfter || s.pagination.endBefore || s.pagination.startAt || s.pagination.endAt ? s.pagination.startAfter ? (Qa(s.pagination.startAfter), R = R.map((z, J) => {
12614
12621
  if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
12615
12622
  throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using startAfter");
12616
- let U = he(z, rt(s.pagination.orderByField, s.pagination.orderByDirection), eo(_.last.get(Q)));
12617
- return s.pagination.number && (U = he(U, Xt(s.pagination.number))), U;
12618
- })) : s.pagination.endBefore ? (Ja(s.pagination.endBefore), R = R.map((z, Q) => {
12623
+ let V = he(z, rt(s.pagination.orderByField, s.pagination.orderByDirection), eo(_.last.get(J)));
12624
+ return s.pagination.number && (V = he(V, Xt(s.pagination.number))), V;
12625
+ })) : s.pagination.endBefore ? (Ja(s.pagination.endBefore), R = R.map((z, J) => {
12619
12626
  if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
12620
12627
  throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using endBefore");
12621
- let U = he(z, rt(s.pagination.orderByField, s.pagination.orderByDirection), to(_.first.get(Q)));
12622
- return s.pagination.number && (U = he(U, Nr(s.pagination.number))), U;
12623
- })) : s.pagination.startAt ? (Ja(s.pagination.startAt), R = R.map((z, Q) => {
12628
+ let V = he(z, rt(s.pagination.orderByField, s.pagination.orderByDirection), to(_.first.get(J)));
12629
+ return s.pagination.number && (V = he(V, Nr(s.pagination.number))), V;
12630
+ })) : s.pagination.startAt ? (Ja(s.pagination.startAt), R = R.map((z, J) => {
12624
12631
  if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
12625
12632
  throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using startAt");
12626
- let U = he(z, rt(s.pagination.orderByField, s.pagination.orderByDirection), ap(_.first.get(Q)));
12627
- return s.pagination.number && (U = he(U, Nr(s.pagination.number))), U;
12628
- })) : s.pagination.endAt && (Qa(s.pagination.endAt), R = R.map((z, Q) => {
12633
+ let V = he(z, rt(s.pagination.orderByField, s.pagination.orderByDirection), ap(_.first.get(J)));
12634
+ return s.pagination.number && (V = he(V, Nr(s.pagination.number))), V;
12635
+ })) : s.pagination.endAt && (Qa(s.pagination.endAt), R = R.map((z, J) => {
12629
12636
  if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
12630
12637
  throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using endAt");
12631
- let U = he(z, rt(s.pagination.orderByField, s.pagination.orderByDirection), op(_.last.get(Q)));
12632
- return s.pagination.number && (U = he(U, Nr(s.pagination.number))), U;
12638
+ let V = he(z, rt(s.pagination.orderByField, s.pagination.orderByDirection), op(_.last.get(J)));
12639
+ return s.pagination.number && (V = he(V, Nr(s.pagination.number))), V;
12633
12640
  })) : R = R.map((z) => {
12634
- let Q = he(z);
12635
- return s.pagination?.orderByField && s.pagination.orderByDirection && (Q = he(z, rt(s.pagination.orderByField, s.pagination.orderByDirection))), s.pagination.number && (Q = he(Q, Xt(s.pagination.number))), Q;
12641
+ let J = he(z);
12642
+ return s.pagination?.orderByField && s.pagination.orderByDirection && (J = he(z, rt(s.pagination.orderByField, s.pagination.orderByDirection))), s.pagination.number && (J = he(J, Xt(s.pagination.number))), J;
12636
12643
  });
12637
12644
  }
12638
12645
  const C = { collection: d.collection };
12639
12646
  await oe("preOperation", g, T, ["read", void 0, void 0, C]), await oe("preRead", g, T, [C, R, !0, !0]);
12640
12647
  let I = !0;
12641
- const b = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), O = [], x = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), D = (j, ae, z) => {
12642
- const Q = [];
12643
- x.forEach((U) => {
12644
- um(U, F.get(U.id));
12648
+ const b = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), O = [], x = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), D = (U, ae, z) => {
12649
+ const J = [];
12650
+ x.forEach((V) => {
12651
+ um(V, F.get(V.id));
12645
12652
  for (const G of f.fields)
12646
- G.type === "Computed" && !s?.noComputedFields && Q.push(_e(G.formula, [U, z]).then((Se) => {
12647
- U[G.name] = Se;
12648
- })), s?.noEmbeddingFields && G.type === "Embedding" && delete U[G.name];
12649
- }), Promise.all(Q).then(() => {
12650
- t(Array.from(x.values()), j, ae), x.forEach((U) => {
12651
- const G = ["read", U, U.id, C];
12652
- oe("postOperation", g, T, G), oe("postRead", g, T, [C, A, U, !0]);
12653
+ G.type === "Computed" && !s?.noComputedFields && J.push(_e(G.formula, [V, z]).then((Se) => {
12654
+ V[G.name] = Se;
12655
+ })), s?.noEmbeddingFields && G.type === "Embedding" && delete V[G.name];
12656
+ }), Promise.all(J).then(() => {
12657
+ t(Array.from(x.values()), U, ae), x.forEach((V) => {
12658
+ const G = ["read", V, V.id, C];
12659
+ oe("postOperation", g, T, G), oe("postRead", g, T, [C, A, V, !0]);
12653
12660
  });
12654
12661
  });
12655
- }, Y = (j, ae) => {
12662
+ }, Y = (U, ae) => {
12656
12663
  let z = !0;
12657
- if (s?.relations && x.forEach((Q) => {
12658
- const U = w.get(Q.id);
12659
- U === "loaded" || U === "deleted" || (z = !1);
12664
+ if (s?.relations && x.forEach((J) => {
12665
+ const V = w.get(J.id);
12666
+ V === "loaded" || V === "deleted" || (z = !1);
12660
12667
  }), b.size === R.length && z) {
12661
12668
  I = !1;
12662
- const Q = Sd(u, () => {
12663
- Q(), !s?.noComputedFields && T?.admin?.retriever ? _e(T.admin.retriever).then((U) => {
12664
- D(j, ae, U);
12665
- }) : D(j, ae);
12669
+ const J = Sd(u, () => {
12670
+ J(), !s?.noComputedFields && T?.admin?.retriever ? _e(T.admin.retriever).then((V) => {
12671
+ D(U, ae, V);
12672
+ }) : D(U, ae);
12666
12673
  });
12667
12674
  }
12668
12675
  };
12669
- typeof s?.relations == "object" && (s.relations.fields = s.relations.fields.map((j) => {
12670
- if (typeof j == "string") {
12671
- const ae = f.fields.find((z) => z.name === j);
12676
+ typeof s?.relations == "object" && (s.relations.fields = s.relations.fields.map((U) => {
12677
+ if (typeof U == "string") {
12678
+ const ae = f.fields.find((z) => z.name === U);
12672
12679
  if (ae)
12673
12680
  return ae;
12674
- throw new Error(`SCHEMA_ERROR: Field ${j} not found in collection ${i}`);
12681
+ throw new Error(`SCHEMA_ERROR: Field ${U} not found in collection ${i}`);
12675
12682
  }
12676
- return j;
12683
+ return U;
12677
12684
  }));
12678
- const J = {}, W = {}, q = (j, ae) => {
12679
- if (!j)
12685
+ const ee = {}, j = {}, q = (U, ae) => {
12686
+ if (!U)
12680
12687
  return;
12681
- const z = j.id;
12682
- w.set(z, "loading"), W[z] ||= /* @__PURE__ */ new Map();
12683
- const Q = Oe(s?.relations), U = typeof Q == "object" ? Q.fields.filter((K) => typeof K == "object" && ge(K) && jt(f, o, a).includes(K.collection)) : f.fields.filter((K) => ge(K) && jt(f, o, a).includes(K.collection)), G = /* @__PURE__ */ new Map(), Se = /* @__PURE__ */ new Map();
12684
- J[z] ||= /* @__PURE__ */ new Map();
12685
- for (const K of U)
12686
- for (const ye of W[z].entries()) {
12688
+ const z = U.id;
12689
+ w.set(z, "loading"), j[z] ||= /* @__PURE__ */ new Map();
12690
+ const J = ve(s?.relations), V = typeof J == "object" ? J.fields.filter((K) => typeof K == "object" && ge(K) && jt(f, o, a).includes(K.collection)) : f.fields.filter((K) => ge(K) && jt(f, o, a).includes(K.collection)), G = /* @__PURE__ */ new Map(), Se = /* @__PURE__ */ new Map();
12691
+ ee[z] ||= /* @__PURE__ */ new Map();
12692
+ for (const K of V)
12693
+ for (const ye of j[z].entries()) {
12687
12694
  const [ne, Xe] = ye;
12688
12695
  Xe.doc === z && Xe.type === K.type && Xe.field === K.name && (!x.has(z) || // eslint-disable-next-line security/detect-object-injection
12689
- !j[K.name][ne]) && (Xe.listener(), J[z].delete(ne));
12696
+ !U[K.name][ne]) && (Xe.listener(), ee[z].delete(ne));
12690
12697
  }
12691
- for (const K of U)
12698
+ for (const K of V)
12692
12699
  if ("collection" in K) {
12693
- const ye = j[K.name];
12700
+ const ye = U[K.name];
12694
12701
  if (!ye)
12695
12702
  continue;
12696
12703
  for (const ne of Object.keys(ye))
12697
- !ye?.[ne].id && !J[z].has(ne) && (G.set(ne, !1), J[z].has(ne) ? Se.set(ne, !0) : J[z].set(ne, !0));
12704
+ !ye?.[ne].id && !ee[z].has(ne) && (G.set(ne, !1), ee[z].has(ne) ? Se.set(ne, !0) : ee[z].set(ne, !0));
12698
12705
  }
12699
12706
  if (G.size === 0)
12700
12707
  w.set(z, "loaded"), Y(ae);
12701
12708
  else
12702
- for (const K of U)
12709
+ for (const K of V)
12703
12710
  if ("collection" in K) {
12704
- const ye = j[K.name];
12711
+ const ye = U[K.name];
12705
12712
  if (!ye)
12706
12713
  continue;
12707
12714
  for (const [ne, Xe] of Object.entries(ye))
12708
12715
  if (Se.has(ne)) {
12709
12716
  const ut = async () => {
12710
- ye[ne].id ? (G.set(ne, !0), Array.from(G.values()).every((We) => We) && w.set(z, "loaded")) : setTimeout(ut, 100);
12717
+ ye[ne].id ? (G.set(ne, !0), Array.from(G.values()).every((ze) => ze) && w.set(z, "loaded")) : setTimeout(ut, 100);
12711
12718
  };
12712
12719
  ut();
12713
12720
  } else {
12714
- const ut = o.collections[K.collection], { access: We } = ut, { serverReadOnly: xe } = We;
12715
- xe?.includes(a.Role) ? _r([...Xe.Collection_Path], ne).then((Te) => {
12721
+ const ut = o.collections[K.collection], { access: ze } = ut, { serverReadOnly: Ie } = ze;
12722
+ Ie?.includes(a.Role) ? _r([...Xe.Collection_Path], ne).then((Te) => {
12716
12723
  if (!Te) {
12717
12724
  delete ye[ne];
12718
12725
  return;
12719
12726
  }
12720
12727
  if (!x.has(z) || !ye?.[ne]) {
12721
- G.set(ne, !0), J[z].delete(ne);
12728
+ G.set(ne, !0), ee[z].delete(ne);
12722
12729
  return;
12723
12730
  }
12724
12731
  ye[ne] = Te, G.set(ne, !0), Array.from(G.values()).every((wr) => wr) && (w.set(z, "loaded"), Y(ae));
@@ -12735,7 +12742,7 @@ const Gw = async (r, e, t, n) => {
12735
12742
  return;
12736
12743
  }
12737
12744
  if (!x.has(z) || !ye?.[ne]) {
12738
- W[z].has(ne) && W[z].get(ne)?.listener(), G.set(ne, !0), J[z].delete(ne);
12745
+ j[z].has(ne) && j[z].get(ne)?.listener(), G.set(ne, !0), ee[z].delete(ne);
12739
12746
  return;
12740
12747
  }
12741
12748
  ye[ne] = Te, G.set(ne, !0), Array.from(G.values()).every((wr) => wr) && (w.set(z, "loaded"), Y(ae));
@@ -12749,10 +12756,10 @@ const Gw = async (r, e, t, n) => {
12749
12756
  { ...s, relations: !1 }
12750
12757
  ).then((Te) => {
12751
12758
  if (!x.has(z) || !ye?.[ne]) {
12752
- Te(), J[z].delete(ne);
12759
+ Te(), ee[z].delete(ne);
12753
12760
  return;
12754
12761
  }
12755
- O.push(Te), W[z].set(ne, {
12762
+ O.push(Te), j[z].set(ne, {
12756
12763
  doc: z,
12757
12764
  type: K.type,
12758
12765
  field: K.name,
@@ -12761,64 +12768,64 @@ const Gw = async (r, e, t, n) => {
12761
12768
  });
12762
12769
  }
12763
12770
  }
12764
- }, H = (j) => {
12765
- const ae = Oe(s?.relations), z = typeof ae == "object" ? ae.fields.filter((Q) => typeof Q == "object" && ge(Q) && jt(f, o, a).includes(Q.collection)) : f.fields.filter((Q) => ge(Q) && jt(f, o, a).includes(Q.collection));
12766
- for (const Q of z)
12767
- if (W[j])
12768
- for (const U of W[j].entries()) {
12769
- const [G, Se] = U;
12770
- Se.doc === j && Se.type === Q.type && Se.field === Q.name && (Se.listener(), J[j].delete(G));
12771
+ }, H = (U) => {
12772
+ const ae = ve(s?.relations), z = typeof ae == "object" ? ae.fields.filter((J) => typeof J == "object" && ge(J) && jt(f, o, a).includes(J.collection)) : f.fields.filter((J) => ge(J) && jt(f, o, a).includes(J.collection));
12773
+ for (const J of z)
12774
+ if (j[U])
12775
+ for (const V of j[U].entries()) {
12776
+ const [G, Se] = V;
12777
+ Se.doc === U && Se.type === J.type && Se.field === J.name && (Se.listener(), ee[U].delete(G));
12771
12778
  }
12772
- }, Ie = (j, ae, z) => {
12773
- const Q = z.data({
12779
+ }, qe = (U, ae, z) => {
12780
+ const J = z.data({
12774
12781
  serverTimestamps: P || "none"
12775
12782
  });
12776
- ae.id ||= z.id, ae = { ...ae, ...Q }, delete ae.Collection_Path_String;
12777
- const U = F.get(z.id) || /* @__PURE__ */ new Map(), G = U.get(j) || /* @__PURE__ */ new Set();
12778
- lm(Q, G), U.set(j, G), F.set(z.id, U), x.set(z.id, ae);
12779
- }, Qe = s?.only === "cache" || y;
12780
- for (const j of R) {
12783
+ ae.id ||= z.id, ae = { ...ae, ...J }, delete ae.Collection_Path_String;
12784
+ const V = F.get(z.id) || /* @__PURE__ */ new Map(), G = V.get(U) || /* @__PURE__ */ new Set();
12785
+ lm(J, G), V.set(U, G), F.set(z.id, V), x.set(z.id, ae);
12786
+ }, De = s?.only === "cache" || y;
12787
+ for (const U of R) {
12781
12788
  let ae = !0;
12782
- const z = dr(j, { source: Qe ? "cache" : "default", includeMetadataChanges: !0 }, (Q) => {
12783
- (Qe || Q.metadata.fromCache === !1) && (b.set(j, !0), _.first.set(R.indexOf(j), Q.docs[0]), _.last.set(R.indexOf(j), Q.docs.at(-1) || Q.docs[0]), I && s?.relations || Y(_, Q.metadata)), b.get(j) === !0 && (ae ? (Q.docs.forEach((U) => {
12784
- const G = x.get(U.id) || {}, Se = M.get(U.id) || 0;
12785
- M.set(U.id, Se + 1), Ie(j, G, U);
12786
- }), ae = !1) : Q.docChanges().forEach((U) => {
12787
- const G = x.get(U.doc.id) || {}, Se = M.get(U.doc.id) || 0;
12788
- U.type === "added" && M.set(U.doc.id, Se + 1), U.type === "added" || U.type === "modified" ? Ie(j, G, U.doc) : U.type === "removed" && (M.set(U.doc.id, Se - 1), M.get(U.doc.id) === 0 && (x.delete(U.doc.id), b.size === R.length && s?.relations && (w.set(U.doc.id, "deleted"), H(U.doc.id))));
12789
- }), b.size === R.length && s?.relations && (x.size === 0 && Y(_, Q.metadata), x.forEach((U) => {
12790
- q(U, _);
12789
+ const z = dr(U, { source: De ? "cache" : "default", includeMetadataChanges: !0 }, (J) => {
12790
+ (De || J.metadata.fromCache === !1) && (b.set(U, !0), _.first.set(R.indexOf(U), J.docs[0]), _.last.set(R.indexOf(U), J.docs.at(-1) || J.docs[0]), I && s?.relations || Y(_, J.metadata)), b.get(U) === !0 && (ae ? (J.docs.forEach((V) => {
12791
+ const G = x.get(V.id) || {}, Se = M.get(V.id) || 0;
12792
+ M.set(V.id, Se + 1), qe(U, G, V);
12793
+ }), ae = !1) : J.docChanges().forEach((V) => {
12794
+ const G = x.get(V.doc.id) || {}, Se = M.get(V.doc.id) || 0;
12795
+ V.type === "added" && M.set(V.doc.id, Se + 1), V.type === "added" || V.type === "modified" ? qe(U, G, V.doc) : V.type === "removed" && (M.set(V.doc.id, Se - 1), M.get(V.doc.id) === 0 && (x.delete(V.doc.id), b.size === R.length && s?.relations && (w.set(V.doc.id, "deleted"), H(V.doc.id))));
12796
+ }), b.size === R.length && s?.relations && (x.size === 0 && Y(_, J.metadata), x.forEach((V) => {
12797
+ q(V, _);
12791
12798
  })));
12792
- }, (Q) => {
12793
- n && n(new Error(`Error fetching documents at location ${r.join("/")}`, { cause: Q })), O.forEach((U) => U());
12799
+ }, (J) => {
12800
+ n && n(new Error(`Error fetching documents at location ${r.join("/")}`, { cause: J })), O.forEach((V) => V());
12794
12801
  });
12795
12802
  O.push(z);
12796
12803
  }
12797
- let Ee, Ve;
12804
+ let Ee, We;
12798
12805
  if (s?.pagination && !h?.roles.includes(a.Role) && !E?.includes(a.Role)) {
12799
- let j = he(A[0], ...e);
12800
- s.pagination.orderByField && s.pagination.orderByDirection && (j = he(j, rt(s.pagination.orderByField, s.pagination.orderByDirection)));
12801
- const ae = await Ed(j).catch(() => {
12806
+ let U = he(A[0], ...e);
12807
+ s.pagination.orderByField && s.pagination.orderByDirection && (U = he(U, rt(s.pagination.orderByField, s.pagination.orderByDirection)));
12808
+ const ae = await Ed(U).catch(() => {
12802
12809
  });
12803
12810
  if (ae) {
12804
12811
  Ee = ae.data().count;
12805
12812
  const z = s.pagination.number;
12806
- Ve = z && z > 0 ? Math.ceil(Ee / z) : 1;
12813
+ We = z && z > 0 ? Math.ceil(Ee / z) : 1;
12807
12814
  }
12808
12815
  }
12809
- return { pages: Ve, count: Ee, unsubscribe: (j) => {
12810
- j === "first" && Ja(_), j === "last" && Qa(_), O.forEach((ae) => ae());
12816
+ return { pages: We, count: Ee, unsubscribe: (U) => {
12817
+ U === "first" && Ja(_), U === "last" && Qa(_), O.forEach((ae) => ae());
12811
12818
  } };
12812
12819
  }, ib = async (r, e) => {
12813
- const t = it(), n = Ue(), s = $e(t, n.STOKER_FB_FUNCTIONS_REGION);
12814
- return (await Ye(s, "stoker-getfiles")({
12820
+ const t = it(), n = Ve(), s = je(t, n.STOKER_FB_FUNCTIONS_REGION);
12821
+ return (await Je(s, "stoker-getfiles")({
12815
12822
  collectionPath: e.Collection_Path,
12816
12823
  id: e.id,
12817
12824
  path: r
12818
12825
  })).data.result;
12819
12826
  }, Fw = async (r, e, t, n, s, i) => {
12820
- const a = it(), o = Ue(), c = $e(a, o.STOKER_FB_FUNCTIONS_REGION);
12821
- await Ye(c, "stoker-adminemail")({
12827
+ const a = it(), o = Ve(), c = je(a, o.STOKER_FB_FUNCTIONS_REGION);
12828
+ await Je(c, "stoker-adminemail")({
12822
12829
  subject: r,
12823
12830
  text: e,
12824
12831
  html: t,
@@ -12827,14 +12834,14 @@ const Gw = async (r, e, t, n) => {
12827
12834
  replyTo: i
12828
12835
  });
12829
12836
  }, ab = async (r, e, t, n, s, i, a, o, c) => {
12830
- if (Ue().MODE === "development") {
12837
+ if (Ve().MODE === "development") {
12831
12838
  await Fw(e, t, n, s, i, a);
12832
12839
  return;
12833
12840
  }
12834
12841
  const f = Ha(r), d = cw(e), h = t ? pd(t) : void 0, m = n ? pd(n) : void 0, E = s ? Ha(s) : void 0, g = i ? Ha(i) : void 0, v = a ? Tn(a) : void 0, S = c ? Tn(c) : void 0, T = Array.isArray(f) ? f : [f];
12835
12842
  if (T.length === 0 || T.length === 1 && !T[0])
12836
12843
  throw new Error("No valid email addresses provided");
12837
- const P = je(), y = { to: f, message: { subject: d } };
12844
+ const P = Ue(), y = { to: f, message: { subject: d } };
12838
12845
  if (h && (y.message.text = h), m && (y.message.html = m), E) {
12839
12846
  const A = Array.isArray(E) ? E : [E];
12840
12847
  A.length > 0 && A[0] && (y.cc = E);
@@ -12845,16 +12852,16 @@ const Gw = async (r, e, t, n) => {
12845
12852
  }
12846
12853
  v && (y.replyTo = v), o && (y.message.attachments = o), S && (y.from = S), await Td(qr(P, "system_mail"), y);
12847
12854
  }, Dw = async (r) => {
12848
- const e = it(), t = Ue(), n = $e(e, t.STOKER_FB_FUNCTIONS_REGION);
12849
- await Ye(n, "stoker-adminsms")({
12855
+ const e = it(), t = Ve(), n = je(e, t.STOKER_FB_FUNCTIONS_REGION);
12856
+ await Je(n, "stoker-adminsms")({
12850
12857
  body: r
12851
12858
  });
12852
12859
  }, ob = async (r, e) => {
12853
- if (Ue().MODE === "development") {
12860
+ if (Ve().MODE === "development") {
12854
12861
  await Dw(e);
12855
12862
  return;
12856
12863
  }
12857
- const s = je(), i = { to: r, body: e };
12864
+ const s = Ue(), i = { to: r, body: e };
12858
12865
  await Td(qr(s, "system_messages"), i);
12859
12866
  }, cb = (r) => {
12860
12867
  const e = Am();
@@ -12890,10 +12897,10 @@ export {
12890
12897
  oc as getCollectionRefs,
12891
12898
  zt as getConnectionStatus,
12892
12899
  Hw as getCurrentUser,
12893
- De as getCurrentUserPermissions,
12900
+ Fe as getCurrentUserPermissions,
12894
12901
  Jr as getCurrentUserRoleGroups,
12895
12902
  dm as getDocumentRefs,
12896
- Ue as getEnv,
12903
+ Ve as getEnv,
12897
12904
  ib as getFiles,
12898
12905
  Cm as getFirestoreMaintenance,
12899
12906
  gc as getFirestoreWrite,
@@ -12904,7 +12911,7 @@ export {
12904
12911
  Aw as getNetworkStatus,
12905
12912
  _r as getOne,
12906
12913
  mw as getOneServer,
12907
- Ke as getSchema,
12914
+ Ye as getSchema,
12908
12915
  pm as getSome,
12909
12916
  hw as getSomeServer,
12910
12917
  Dt as getTenant,