@firebase/firestore 3.7.1 → 3.7.2-canary.457fc2eeb

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.
@@ -66,7 +66,7 @@ w.MOCK_USER = new w("mock-user");
66
66
  * See the License for the specific language governing permissions and
67
67
  * limitations under the License.
68
68
  */
69
- let m = "9.12.1";
69
+ let m = "9.13.0-canary.457fc2eeb";
70
70
 
71
71
  /**
72
72
  * @license
@@ -200,7 +200,7 @@ function _(t, ...e) {
200
200
  /**
201
201
  * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an
202
202
  * instance of `T` before casting.
203
- */ function T(t,
203
+ */ function A(t,
204
204
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
205
205
  e) {
206
206
  return t;
@@ -221,7 +221,7 @@ e) {
221
221
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
222
222
  * See the License for the specific language governing permissions and
223
223
  * limitations under the License.
224
- */ const A = "ok", R = "cancelled", P = "unknown", V = "invalid-argument", N = "deadline-exceeded", $ = "not-found", D = "already-exists", x = "permission-denied", S = "unauthenticated", F = "resource-exhausted", q = "failed-precondition", O = "aborted", k = "out-of-range", C = "unimplemented", L = "internal", M = "unavailable", U = "data-loss";
224
+ */ const T = "ok", R = "cancelled", P = "unknown", V = "invalid-argument", N = "deadline-exceeded", $ = "not-found", D = "already-exists", x = "permission-denied", S = "unauthenticated", F = "resource-exhausted", q = "failed-precondition", O = "aborted", k = "out-of-range", C = "unimplemented", L = "internal", M = "unavailable", U = "data-loss";
225
225
 
226
226
  /** An error returned by a Firestore operation. */ class j extends c {
227
227
  /** @hideconstructor */
@@ -909,7 +909,7 @@ function pt(t) {
909
909
  switch (t) {
910
910
  case 200:
911
911
  // OK
912
- return A;
912
+ return T;
913
913
 
914
914
  case 400:
915
915
  // Bad Request
@@ -968,7 +968,7 @@ function pt(t) {
968
968
  return N;
969
969
 
970
970
  default:
971
- return t >= 200 && t < 300 ? A : t >= 400 && t < 500 ? q : t >= 500 && t < 600 ? L : P;
971
+ return t >= 200 && t < 300 ? T : t >= 400 && t < 500 ? q : t >= 500 && t < 600 ? L : P;
972
972
  }
973
973
  }
974
974
 
@@ -1017,10 +1017,10 @@ class {
1017
1017
  return !1;
1018
1018
  }
1019
1019
  I(t, e, n, r, s) {
1020
- const i = this.T(t, e);
1020
+ const i = this.A(t, e);
1021
1021
  g("RestConnection", "Sending: ", i, n);
1022
1022
  const o = {};
1023
- return this.A(o, r, s), this.R(t, i, o, n).then((t => (g("RestConnection", "Received: ", t),
1023
+ return this.T(o, r, s), this.R(t, i, o, n).then((t => (g("RestConnection", "Received: ", t),
1024
1024
  t)), (e => {
1025
1025
  throw v("RestConnection", `${t} failed with error: `, e, "url: ", i, "request:", n),
1026
1026
  e;
@@ -1034,7 +1034,7 @@ class {
1034
1034
  /**
1035
1035
  * Modifies the headers for a request, adding any authorization token if
1036
1036
  * present and any additional headers for the request.
1037
- */ A(t, e, n) {
1037
+ */ T(t, e, n) {
1038
1038
  t["X-Goog-Api-Client"] = "gl-js/ fire/" + m,
1039
1039
  // Content-Type: text/plain will avoid preflight requests which might
1040
1040
  // mess with CORS and redirects by proxies. If we add custom headers
@@ -1043,7 +1043,7 @@ class {
1043
1043
  t["Content-Type"] = "text/plain", this.databaseInfo.appId && (t["X-Firebase-GMPID"] = this.databaseInfo.appId),
1044
1044
  e && e.headers.forEach(((e, n) => t[n] = e)), n && n.headers.forEach(((e, n) => t[n] = e));
1045
1045
  }
1046
- T(t, e) {
1046
+ A(t, e) {
1047
1047
  const n = dt[t];
1048
1048
  return `${this.p}/v1/${e}:${n}`;
1049
1049
  }
@@ -1059,19 +1059,25 @@ class {
1059
1059
  throw new Error("Not supported by FetchConnection");
1060
1060
  }
1061
1061
  async R(t, e, n, r) {
1062
- const s = JSON.stringify(r);
1063
- let i;
1062
+ var s;
1063
+ const i = JSON.stringify(r);
1064
+ let o;
1064
1065
  try {
1065
- i = await this.V(e, {
1066
+ o = await this.V(e, {
1066
1067
  method: "POST",
1067
1068
  headers: n,
1068
- body: s
1069
+ body: i
1069
1070
  });
1070
1071
  } catch (t) {
1071
1072
  throw new j(pt(t.status), "Request failed with error: " + t.statusText);
1072
1073
  }
1073
- if (!i.ok) throw new j(pt(i.status), "Request failed with error: " + i.statusText);
1074
- return i.json();
1074
+ if (!o.ok) {
1075
+ let t = await o.json();
1076
+ Array.isArray(t) && (t = t[0]);
1077
+ const e = null === (s = null == t ? void 0 : t.error) || void 0 === s ? void 0 : s.message;
1078
+ throw new j(pt(o.status), `Request failed with error: ${null != e ? e : o.statusText}`);
1079
+ }
1080
+ return o.json();
1075
1081
  }
1076
1082
  }
1077
1083
 
@@ -1371,13 +1377,13 @@ class Et {
1371
1377
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1372
1378
  * See the License for the specific language governing permissions and
1373
1379
  * limitations under the License.
1374
- */ function Tt(t) {
1380
+ */ function At(t) {
1375
1381
  let e = 0;
1376
1382
  for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;
1377
1383
  return e;
1378
1384
  }
1379
1385
 
1380
- function At(t, e) {
1386
+ function Tt(t, e) {
1381
1387
  for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);
1382
1388
  }
1383
1389
 
@@ -2238,7 +2244,7 @@ function jt(t) {
2238
2244
  case 10 /* ObjectValue */ :
2239
2245
  return function(t, e) {
2240
2246
  const n = t.mapValue.fields || {}, r = e.mapValue.fields || {};
2241
- if (Tt(n) !== Tt(r)) return !1;
2247
+ if (At(n) !== At(r)) return !1;
2242
2248
  for (const t in n) if (n.hasOwnProperty(t) && (void 0 === r[t] || !Bt(n[t], r[t]))) return !1;
2243
2249
  return !0;
2244
2250
  }
@@ -2382,7 +2388,7 @@ function Gt(t, e) {
2382
2388
  fields: {}
2383
2389
  }
2384
2390
  };
2385
- return At(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = Xt(n))), e;
2391
+ return Tt(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = Xt(n))), e;
2386
2392
  }
2387
2393
  if (t.arrayValue) {
2388
2394
  const e = {
@@ -2478,7 +2484,7 @@ class Zt {
2478
2484
  * Modifies `fieldsMap` by adding, replacing or deleting the specified
2479
2485
  * entries.
2480
2486
  */ applyChanges(t, e, n) {
2481
- At(e, ((e, n) => t[e] = n));
2487
+ Tt(e, ((e, n) => t[e] = n));
2482
2488
  for (const e of n) delete t[e];
2483
2489
  }
2484
2490
  clone() {
@@ -2863,7 +2869,7 @@ function _e(t) {
2863
2869
  * which can be different from the order by constraints the user provided (e.g.
2864
2870
  * the SDK and backend always orders by `__name__`).
2865
2871
  */ function ve(t) {
2866
- const e = T(t);
2872
+ const e = A(t);
2867
2873
  if (null === e.O) {
2868
2874
  e.O = [];
2869
2875
  const t = ge(e), n = ye(e);
@@ -2888,7 +2894,7 @@ function _e(t) {
2888
2894
  /**
2889
2895
  * Converts this `Query` instance to it's corresponding `Target` representation.
2890
2896
  */ function be(t) {
2891
- const e = T(t);
2897
+ const e = A(t);
2892
2898
  if (!e.k) if ("F" /* First */ === e.limitType) e.k = ne(e.path, e.collectionGroup, ve(e), e.filters, e.limit, e.startAt, e.endAt); else {
2893
2899
  // Flip the orderBy directions since we want the last results
2894
2900
  const t = [];
@@ -2987,7 +2993,7 @@ function Ie(t, e) {
2987
2993
  * See the License for the specific language governing permissions and
2988
2994
  * limitations under the License.
2989
2995
  */
2990
- /** Used to represent a field transform on a mutation. */ class Te {
2996
+ /** Used to represent a field transform on a mutation. */ class Ae {
2991
2997
  constructor() {
2992
2998
  // Make sure that the structural type of `TransformOperation` is unique.
2993
2999
  // See https://github.com/microsoft/TypeScript/issues/5451
@@ -2995,15 +3001,15 @@ function Ie(t, e) {
2995
3001
  }
2996
3002
  }
2997
3003
 
2998
- /** Transforms a value into a server-generated timestamp. */ class Ae extends Te {}
3004
+ /** Transforms a value into a server-generated timestamp. */ class Te extends Ae {}
2999
3005
 
3000
- /** Transforms an array value via a union operation. */ class Re extends Te {
3006
+ /** Transforms an array value via a union operation. */ class Re extends Ae {
3001
3007
  constructor(t) {
3002
3008
  super(), this.elements = t;
3003
3009
  }
3004
3010
  }
3005
3011
 
3006
- /** Transforms an array value via a remove operation. */ class Pe extends Te {
3012
+ /** Transforms an array value via a remove operation. */ class Pe extends Ae {
3007
3013
  constructor(t) {
3008
3014
  super(), this.elements = t;
3009
3015
  }
@@ -3014,7 +3020,7 @@ function Ie(t, e) {
3014
3020
  * transforms. Converts all field values to integers or doubles, but unlike the
3015
3021
  * backend does not cap integer values at 2^63. Instead, JavaScript number
3016
3022
  * arithmetic is used and precision loss can occur for values greater than 2^53.
3017
- */ class Ve extends Te {
3023
+ */ class Ve extends Ae {
3018
3024
  constructor(t, e) {
3019
3025
  super(), this.L = t, this.M = e;
3020
3026
  }
@@ -3338,7 +3344,7 @@ function He(t, e) {
3338
3344
  }
3339
3345
  return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((t => function(t, e) {
3340
3346
  const n = e.transform;
3341
- if (n instanceof Ae) return {
3347
+ if (n instanceof Te) return {
3342
3348
  fieldPath: e.field.canonicalString(),
3343
3349
  setToServerValue: "REQUEST_TIME"
3344
3350
  };
@@ -3630,40 +3636,40 @@ class sn {
3630
3636
  */
3631
3637
  class on extends class {} {
3632
3638
  constructor(t, e, n, r) {
3633
- super(), this.authCredentials = t, this.appCheckCredentials = e, this.tt = n, this.L = r,
3634
- this.et = !1;
3639
+ super(), this.authCredentials = t, this.appCheckCredentials = e, this.connection = n,
3640
+ this.L = r, this.tt = !1;
3635
3641
  }
3636
- nt() {
3637
- if (this.et) throw new j(q, "The client has already been terminated.");
3642
+ et() {
3643
+ if (this.tt) throw new j(q, "The client has already been terminated.");
3638
3644
  }
3639
3645
  /** Invokes the provided RPC with auth and AppCheck tokens. */ I(t, e, n) {
3640
- return this.nt(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([r, s]) => this.tt.I(t, e, n, r, s))).catch((t => {
3646
+ return this.et(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([r, s]) => this.connection.I(t, e, n, r, s))).catch((t => {
3641
3647
  throw "FirebaseError" === t.name ? (t.code === S && (this.authCredentials.invalidateToken(),
3642
3648
  this.appCheckCredentials.invalidateToken()), t) : new j(P, t.toString());
3643
3649
  }));
3644
3650
  }
3645
3651
  /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ P(t, e, n, r) {
3646
- return this.nt(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.tt.P(t, e, n, s, i, r))).catch((t => {
3652
+ return this.et(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.connection.P(t, e, n, s, i, r))).catch((t => {
3647
3653
  throw "FirebaseError" === t.name ? (t.code === S && (this.authCredentials.invalidateToken(),
3648
3654
  this.appCheckCredentials.invalidateToken()), t) : new j(P, t.toString());
3649
3655
  }));
3650
3656
  }
3651
3657
  terminate() {
3652
- this.et = !0;
3658
+ this.tt = !0;
3653
3659
  }
3654
3660
  }
3655
3661
 
3656
3662
  // TODO(firestorexp): Make sure there is only one Datastore instance per
3657
3663
  // firestore-exp client.
3658
3664
  async function un(t, e) {
3659
- const n = T(t), r = Ge(n.L) + "/documents", s = {
3665
+ const n = A(t), r = Ge(n.L) + "/documents", s = {
3660
3666
  writes: e.map((t => He(n.L, t)))
3661
3667
  };
3662
3668
  await n.I("Commit", r, s);
3663
3669
  }
3664
3670
 
3665
3671
  async function cn(t, e) {
3666
- const n = T(t), r = Ge(n.L) + "/documents", s = {
3672
+ const n = A(t), r = Ge(n.L) + "/documents", s = {
3667
3673
  documents: e.map((t => Qe(n.L, t)))
3668
3674
  }, i = await n.P("BatchGetDocuments", r, s, e.length), o = new Map;
3669
3675
  i.forEach((t => {
@@ -3678,7 +3684,7 @@ async function cn(t, e) {
3678
3684
  }
3679
3685
 
3680
3686
  async function an(t, e) {
3681
- const n = T(t), r = Je(n.L, be(e));
3687
+ const n = A(t), r = Je(n.L, be(e));
3682
3688
  return (await n.P("RunQuery", r.parent, {
3683
3689
  structuredQuery: r.structuredQuery
3684
3690
  })).filter((t => !!t.document)).map((t => function(t, e, n) {
@@ -3692,7 +3698,7 @@ async function an(t, e) {
3692
3698
  }
3693
3699
 
3694
3700
  async function hn(t, e) {
3695
- const n = T(t), r = function(t, e) {
3701
+ const n = A(t), r = function(t, e) {
3696
3702
  const n = Je(t, e);
3697
3703
  return {
3698
3704
  structuredAggregationQuery: {
@@ -3705,7 +3711,7 @@ async function hn(t, e) {
3705
3711
  parent: n.parent
3706
3712
  };
3707
3713
  }(n.L, be(e)), s = r.parent;
3708
- n.tt.v || delete r.parent;
3714
+ n.connection.v || delete r.parent;
3709
3715
  return (await n.P("RunAggregationQuery", s, r, /*expectedResponseCount=*/ 1)).filter((t => !!t.result)).map((t => t.result.aggregateFields));
3710
3716
  }
3711
3717
 
@@ -4114,7 +4120,7 @@ class _n {
4114
4120
  /**
4115
4121
  * The collection this `DocumentReference` belongs to.
4116
4122
  */ get parent() {
4117
- return new Tn(this.firestore, this.converter, this._key.path.popLast());
4123
+ return new An(this.firestore, this.converter, this._key.path.popLast());
4118
4124
  }
4119
4125
  withConverter(t) {
4120
4126
  return new En(this.firestore, t, this._key);
@@ -4144,7 +4150,7 @@ class _n {
4144
4150
  /**
4145
4151
  * A `CollectionReference` object can be used for adding documents, getting
4146
4152
  * document references, and querying for documents (using {@link query}).
4147
- */ class Tn extends In {
4153
+ */ class An extends In {
4148
4154
  /** @hideconstructor */
4149
4155
  constructor(t, e, n) {
4150
4156
  super(t, e, new pe(n)), this._path = n,
@@ -4169,19 +4175,19 @@ class _n {
4169
4175
  /* converter= */ null, new st(t));
4170
4176
  }
4171
4177
  withConverter(t) {
4172
- return new Tn(this.firestore, t, this._path);
4178
+ return new An(this.firestore, t, this._path);
4173
4179
  }
4174
4180
  }
4175
4181
 
4176
- function An(t, e, ...n) {
4182
+ function Tn(t, e, ...n) {
4177
4183
  if (t = f(t), it("collection", "path", e), t instanceof wn) {
4178
4184
  const r = et.fromString(e, ...n);
4179
- return ut(r), new Tn(t, /* converter= */ null, r);
4185
+ return ut(r), new An(t, /* converter= */ null, r);
4180
4186
  }
4181
4187
  {
4182
- if (!(t instanceof En || t instanceof Tn)) throw new j(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4188
+ if (!(t instanceof En || t instanceof An)) throw new j(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4183
4189
  const r = t._path.child(et.fromString(e, ...n));
4184
- return ut(r), new Tn(t.firestore,
4190
+ return ut(r), new An(t.firestore,
4185
4191
  /* converter= */ null, r);
4186
4192
  }
4187
4193
  }
@@ -4221,9 +4227,9 @@ function Pn(t, e, ...n) {
4221
4227
  /* converter= */ null, new st(r));
4222
4228
  }
4223
4229
  {
4224
- if (!(t instanceof En || t instanceof Tn)) throw new j(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4230
+ if (!(t instanceof En || t instanceof An)) throw new j(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4225
4231
  const r = t._path.child(et.fromString(e, ...n));
4226
- return ot(r), new En(t.firestore, t instanceof Tn ? t.converter : null, new st(r));
4232
+ return ot(r), new En(t.firestore, t instanceof An ? t.converter : null, new st(r));
4227
4233
  }
4228
4234
  }
4229
4235
 
@@ -4235,7 +4241,7 @@ function Pn(t, e, ...n) {
4235
4241
  * @returns true if the references point to the same location in the same
4236
4242
  * Firestore database.
4237
4243
  */ function Vn(t, e) {
4238
- return t = f(t), e = f(e), (t instanceof En || t instanceof Tn) && (e instanceof En || e instanceof Tn) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);
4244
+ return t = f(t), e = f(e), (t instanceof En || t instanceof An) && (e instanceof En || e instanceof An) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);
4239
4245
  }
4240
4246
 
4241
4247
  /**
@@ -4547,55 +4553,55 @@ function Cn(t) {
4547
4553
  this.settings = t, this.databaseId = e, this.L = n, this.ignoreUndefinedProperties = r,
4548
4554
  // Minor hack: If fieldTransforms is undefined, we assume this is an
4549
4555
  // external call and we need to validate the entire path.
4550
- void 0 === s && this.rt(), this.fieldTransforms = s || [], this.fieldMask = i || [];
4556
+ void 0 === s && this.nt(), this.fieldTransforms = s || [], this.fieldMask = i || [];
4551
4557
  }
4552
4558
  get path() {
4553
4559
  return this.settings.path;
4554
4560
  }
4555
- get st() {
4556
- return this.settings.st;
4561
+ get rt() {
4562
+ return this.settings.rt;
4557
4563
  }
4558
- /** Returns a new context with the specified settings overwritten. */ it(t) {
4564
+ /** Returns a new context with the specified settings overwritten. */ st(t) {
4559
4565
  return new Ln(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.L, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
4560
4566
  }
4561
- ot(t) {
4567
+ it(t) {
4562
4568
  var e;
4563
- const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.it({
4569
+ const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.st({
4564
4570
  path: n,
4565
- ut: !1
4571
+ ot: !1
4566
4572
  });
4567
- return r.ct(t), r;
4573
+ return r.ut(t), r;
4568
4574
  }
4569
- at(t) {
4575
+ ct(t) {
4570
4576
  var e;
4571
- const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.it({
4577
+ const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.st({
4572
4578
  path: n,
4573
- ut: !1
4579
+ ot: !1
4574
4580
  });
4575
- return r.rt(), r;
4581
+ return r.nt(), r;
4576
4582
  }
4577
- ht(t) {
4583
+ at(t) {
4578
4584
  // TODO(b/34871131): We don't support array paths right now; so make path
4579
4585
  // undefined.
4580
- return this.it({
4586
+ return this.st({
4581
4587
  path: void 0,
4582
- ut: !0
4588
+ ot: !0
4583
4589
  });
4584
4590
  }
4585
- lt(t) {
4586
- return ir(t, this.settings.methodName, this.settings.ft || !1, this.path, this.settings.dt);
4591
+ ht(t) {
4592
+ return ir(t, this.settings.methodName, this.settings.lt || !1, this.path, this.settings.ft);
4587
4593
  }
4588
4594
  /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ contains(t) {
4589
4595
  return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));
4590
4596
  }
4591
- rt() {
4597
+ nt() {
4592
4598
  // TODO(b/34871131): Remove null check once we have proper paths for fields
4593
4599
  // within arrays.
4594
- if (this.path) for (let t = 0; t < this.path.length; t++) this.ct(this.path.get(t));
4600
+ if (this.path) for (let t = 0; t < this.path.length; t++) this.ut(this.path.get(t));
4595
4601
  }
4596
- ct(t) {
4597
- if (0 === t.length) throw this.lt("Document fields must not be empty");
4598
- if (Cn(this.st) && qn.test(t)) throw this.lt('Document fields cannot begin and end with "__"');
4602
+ ut(t) {
4603
+ if (0 === t.length) throw this.ht("Document fields must not be empty");
4604
+ if (Cn(this.rt) && qn.test(t)) throw this.ht('Document fields cannot begin and end with "__"');
4599
4605
  }
4600
4606
  }
4601
4607
 
@@ -4606,14 +4612,14 @@ function Cn(t) {
4606
4612
  constructor(t, e, n) {
4607
4613
  this.databaseId = t, this.ignoreUndefinedProperties = e, this.L = n || rn(t);
4608
4614
  }
4609
- /** Creates a new top-level parse context. */ wt(t, e, n, r = !1) {
4615
+ /** Creates a new top-level parse context. */ dt(t, e, n, r = !1) {
4610
4616
  return new Ln({
4611
- st: t,
4617
+ rt: t,
4612
4618
  methodName: e,
4613
- dt: n,
4619
+ ft: n,
4614
4620
  path: rt.emptyPath(),
4615
- ut: !1,
4616
- ft: r
4621
+ ot: !1,
4622
+ lt: r
4617
4623
  }, this.databaseId, this.L, this.ignoreUndefinedProperties);
4618
4624
  }
4619
4625
  }
@@ -4624,7 +4630,7 @@ function Un(t) {
4624
4630
  }
4625
4631
 
4626
4632
  /** Parse document data from a set() call. */ function jn(t, e, n, r, s, i = {}) {
4627
- const o = t.wt(i.merge || i.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, s);
4633
+ const o = t.dt(i.merge || i.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, s);
4628
4634
  er("Data must be an object, but it was:", o, r);
4629
4635
  const u = Zn(r, o);
4630
4636
  let c, a;
@@ -4642,7 +4648,7 @@ function Un(t) {
4642
4648
 
4643
4649
  class Bn extends Sn {
4644
4650
  _toFieldTransform(t) {
4645
- if (2 /* MergeSet */ !== t.st) throw 1 /* Update */ === t.st ? t.lt(`${this._methodName}() can only appear at the top level of your update data`) : t.lt(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);
4651
+ if (2 /* MergeSet */ !== t.rt) throw 1 /* Update */ === t.rt ? t.ht(`${this._methodName}() can only appear at the top level of your update data`) : t.ht(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);
4646
4652
  // No transform to add for a delete, but we need to add it to our
4647
4653
  // fieldMask so it gets deleted.
4648
4654
  return t.fieldMask.push(t.path), null;
@@ -4669,16 +4675,16 @@ class Bn extends Sn {
4669
4675
  * @param arrayElement - Whether or not the FieldValue has an array.
4670
4676
  */ function Qn(t, e, n) {
4671
4677
  return new Ln({
4672
- st: 3 /* Argument */ ,
4673
- dt: e.settings.dt,
4678
+ rt: 3 /* Argument */ ,
4679
+ ft: e.settings.ft,
4674
4680
  methodName: t._methodName,
4675
- ut: n
4681
+ ot: n
4676
4682
  }, e.databaseId, e.L, e.ignoreUndefinedProperties);
4677
4683
  }
4678
4684
 
4679
4685
  class zn extends Sn {
4680
4686
  _toFieldTransform(t) {
4681
- return new Ne(t.path, new Ae);
4687
+ return new Ne(t.path, new Te);
4682
4688
  }
4683
4689
  isEqual(t) {
4684
4690
  return t instanceof zn;
@@ -4687,11 +4693,11 @@ class zn extends Sn {
4687
4693
 
4688
4694
  class Wn extends Sn {
4689
4695
  constructor(t, e) {
4690
- super(t), this.yt = e;
4696
+ super(t), this.wt = e;
4691
4697
  }
4692
4698
  _toFieldTransform(t) {
4693
4699
  const e = Qn(this, t,
4694
- /*array=*/ !0), n = this.yt.map((t => Xn(t, e))), r = new Re(n);
4700
+ /*array=*/ !0), n = this.wt.map((t => Xn(t, e))), r = new Re(n);
4695
4701
  return new Ne(t.path, r);
4696
4702
  }
4697
4703
  isEqual(t) {
@@ -4702,11 +4708,11 @@ class Wn extends Sn {
4702
4708
 
4703
4709
  class Gn extends Sn {
4704
4710
  constructor(t, e) {
4705
- super(t), this.yt = e;
4711
+ super(t), this.wt = e;
4706
4712
  }
4707
4713
  _toFieldTransform(t) {
4708
4714
  const e = Qn(this, t,
4709
- /*array=*/ !0), n = this.yt.map((t => Xn(t, e))), r = new Pe(n);
4715
+ /*array=*/ !0), n = this.wt.map((t => Xn(t, e))), r = new Pe(n);
4710
4716
  return new Ne(t.path, r);
4711
4717
  }
4712
4718
  isEqual(t) {
@@ -4717,10 +4723,10 @@ class Gn extends Sn {
4717
4723
 
4718
4724
  class Kn extends Sn {
4719
4725
  constructor(t, e) {
4720
- super(t), this.gt = e;
4726
+ super(t), this.yt = e;
4721
4727
  }
4722
4728
  _toFieldTransform(t) {
4723
- const e = new Ve(t.L, Ie(t.L, this.gt));
4729
+ const e = new Ve(t.L, Ie(t.L, this.yt));
4724
4730
  return new Ne(t.path, e);
4725
4731
  }
4726
4732
  isEqual(t) {
@@ -4730,15 +4736,15 @@ class Kn extends Sn {
4730
4736
  }
4731
4737
 
4732
4738
  /** Parse update data from an update() call. */ function Yn(t, e, n, r) {
4733
- const s = t.wt(1 /* Update */ , e, n);
4739
+ const s = t.dt(1 /* Update */ , e, n);
4734
4740
  er("Data must be an object, but it was:", s, r);
4735
4741
  const i = [], o = Zt.empty();
4736
- At(r, ((t, r) => {
4742
+ Tt(r, ((t, r) => {
4737
4743
  const u = sr(e, t, n);
4738
4744
  // For Compat types, we have to "extract" the underlying types before
4739
4745
  // performing validation.
4740
4746
  r = f(r);
4741
- const c = s.at(u);
4747
+ const c = s.ct(u);
4742
4748
  if (r instanceof Bn)
4743
4749
  // Add it to the field mask, but don't add anything to updateData.
4744
4750
  i.push(u); else {
@@ -4751,7 +4757,7 @@ class Kn extends Sn {
4751
4757
  }
4752
4758
 
4753
4759
  /** Parse update data from a list of field/value arguments. */ function Hn(t, e, n, r, s, i) {
4754
- const o = t.wt(1 /* Update */ , e, n), u = [ nr(e, r, n) ], c = [ s ];
4760
+ const o = t.dt(1 /* Update */ , e, n), u = [ nr(e, r, n) ], c = [ s ];
4755
4761
  if (i.length % 2 != 0) throw new j(V, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);
4756
4762
  for (let t = 0; t < i.length; t += 2) u.push(nr(e, i[t])), c.push(i[t + 1]);
4757
4763
  const a = [], h = Zt.empty();
@@ -4763,7 +4769,7 @@ class Kn extends Sn {
4763
4769
  // For Compat types, we have to "extract" the underlying types before
4764
4770
  // performing validation.
4765
4771
  n = f(n);
4766
- const r = o.at(e);
4772
+ const r = o.ct(e);
4767
4773
  if (n instanceof Bn)
4768
4774
  // Add it to the field mask, but don't add anything to updateData.
4769
4775
  a.push(e); else {
@@ -4782,7 +4788,7 @@ class Kn extends Sn {
4782
4788
  * @param allowArrays - Whether the query value is an array that may directly
4783
4789
  * contain additional arrays (e.g. the operand of an `in` query).
4784
4790
  */ function Jn(t, e, n, r = !1) {
4785
- return Xn(n, t.wt(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
4791
+ return Xn(n, t.dt(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
4786
4792
  }
4787
4793
 
4788
4794
  /**
@@ -4810,8 +4816,8 @@ class Kn extends Sn {
4810
4816
  */
4811
4817
  return function(t, e) {
4812
4818
  // Sentinels are only supported with writes, and not within arrays.
4813
- if (!Cn(e.st)) throw e.lt(`${t._methodName}() can only be used with update() and set()`);
4814
- if (!e.path) throw e.lt(`${t._methodName}() is not currently supported inside arrays`);
4819
+ if (!Cn(e.rt)) throw e.ht(`${t._methodName}() can only be used with update() and set()`);
4820
+ if (!e.path) throw e.ht(`${t._methodName}() is not currently supported inside arrays`);
4815
4821
  const n = t._toFieldTransform(e);
4816
4822
  n && e.fieldTransforms.push(n);
4817
4823
  }
@@ -4835,12 +4841,12 @@ class Kn extends Sn {
4835
4841
  // the set of values to be included for the IN query) that may directly
4836
4842
  // contain additional arrays (each representing an individual field
4837
4843
  // value), so we disable this validation.
4838
- if (e.settings.ut && 4 /* ArrayArgument */ !== e.st) throw e.lt("Nested arrays are not supported");
4844
+ if (e.settings.ot && 4 /* ArrayArgument */ !== e.rt) throw e.ht("Nested arrays are not supported");
4839
4845
  return function(t, e) {
4840
4846
  const n = [];
4841
4847
  let r = 0;
4842
4848
  for (const s of t) {
4843
- let t = Xn(s, e.ht(r));
4849
+ let t = Xn(s, e.at(r));
4844
4850
  null == t && (
4845
4851
  // Just include nulls in the array for fields being replaced with a
4846
4852
  // sentinel.
@@ -4892,12 +4898,12 @@ class Kn extends Sn {
4892
4898
  };
4893
4899
  if (t instanceof En) {
4894
4900
  const n = e.databaseId, r = t.firestore._databaseId;
4895
- if (!r.isEqual(n)) throw e.lt(`Document reference is for database ${r.projectId}/${r.database} but should be for database ${n.projectId}/${n.database}`);
4901
+ if (!r.isEqual(n)) throw e.ht(`Document reference is for database ${r.projectId}/${r.database} but should be for database ${n.projectId}/${n.database}`);
4896
4902
  return {
4897
4903
  referenceValue: Be(t.firestore._databaseId || e.databaseId, t._key.path)
4898
4904
  };
4899
4905
  }
4900
- throw e.lt(`Unsupported field value: ${ct(t)}`);
4906
+ throw e.ht(`Unsupported field value: ${ct(t)}`);
4901
4907
  }
4902
4908
  /**
4903
4909
  * Checks whether an object looks like a JSON object that should be converted
@@ -4913,8 +4919,8 @@ function Zn(t, e) {
4913
4919
  return !function(t) {
4914
4920
  for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;
4915
4921
  return !0;
4916
- }(t) ? At(t, ((t, r) => {
4917
- const s = Xn(r, e.ot(t));
4922
+ }(t) ? Tt(t, ((t, r) => {
4923
+ const s = Xn(r, e.it(t));
4918
4924
  null != s && (n[t] = s);
4919
4925
  })) :
4920
4926
  // If we encounter an empty object, we explicitly add it to the update
@@ -4935,7 +4941,7 @@ function er(t, e, n) {
4935
4941
  return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
4936
4942
  }(n)) {
4937
4943
  const r = ct(n);
4938
- throw "an object" === r ? e.lt(t + " a custom object") : e.lt(t + " " + r);
4944
+ throw "an object" === r ? e.ht(t + " a custom object") : e.ht(t + " " + r);
4939
4945
  }
4940
4946
  }
4941
4947
 
@@ -5186,7 +5192,7 @@ class fr {}
5186
5192
 
5187
5193
  class wr extends fr {
5188
5194
  constructor(t, e, n) {
5189
- super(), this._t = t, this.vt = e, this.bt = n, this.type = "where";
5195
+ super(), this.gt = t, this._t = e, this.vt = n, this.type = "where";
5190
5196
  }
5191
5197
  _apply(t) {
5192
5198
  const e = Un(t.firestore), n = function(t, e, n, r, s, i, o) {
@@ -5255,7 +5261,7 @@ class wr extends fr {
5255
5261
  // Special case when it's a duplicate op to give a slightly clearer error message.
5256
5262
  throw n === e.op ? new j(V, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new j(V, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);
5257
5263
  }(t, c), c;
5258
- }(t._query, "where", e, t.firestore._databaseId, this._t, this.vt, this.bt);
5264
+ }(t._query, "where", e, t.firestore._databaseId, this.gt, this._t, this.vt);
5259
5265
  return new In(t.firestore, t.converter, function(t, e) {
5260
5266
  const n = t.filters.concat([ e ]);
5261
5267
  return new pe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
@@ -5280,7 +5286,7 @@ class wr extends fr {
5280
5286
 
5281
5287
  class pr extends fr {
5282
5288
  constructor(t, e) {
5283
- super(), this._t = t, this.Et = e, this.type = "orderBy";
5289
+ super(), this.gt = t, this.bt = e, this.type = "orderBy";
5284
5290
  }
5285
5291
  _apply(t) {
5286
5292
  const e = function(t, e, n) {
@@ -5305,7 +5311,7 @@ class pr extends fr {
5305
5311
  * Will throw if the document does not contain all fields of the order by
5306
5312
  * of the query or if any of the fields in the order by are an uncommitted
5307
5313
  * server timestamp.
5308
- */ (t._query, this._t, this.Et);
5314
+ */ (t._query, this.gt, this.bt);
5309
5315
  return new In(t.firestore, t.converter, function(t, e) {
5310
5316
  // TODO(dimond): validate that orderBy does not list the same key twice.
5311
5317
  const n = t.explicitOrderBy.concat([ e ]);
@@ -5329,12 +5335,12 @@ class pr extends fr {
5329
5335
 
5330
5336
  class gr extends fr {
5331
5337
  constructor(t, e, n) {
5332
- super(), this.type = t, this.It = e, this.Tt = n;
5338
+ super(), this.type = t, this.Et = e, this.It = n;
5333
5339
  }
5334
5340
  _apply(t) {
5335
5341
  return new In(t.firestore, t.converter, function(t, e, n) {
5336
5342
  return new pe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
5337
- }(t._query, this.It, this.Tt));
5343
+ }(t._query, this.Et, this.It));
5338
5344
  }
5339
5345
  }
5340
5346
 
@@ -5361,10 +5367,10 @@ class gr extends fr {
5361
5367
 
5362
5368
  class br extends fr {
5363
5369
  constructor(t, e, n) {
5364
- super(), this.type = t, this.At = e, this.Rt = n;
5370
+ super(), this.type = t, this.At = e, this.Tt = n;
5365
5371
  }
5366
5372
  _apply(t) {
5367
- const e = Pr(t, this.type, this.At, this.Rt);
5373
+ const e = Pr(t, this.type, this.At, this.Tt);
5368
5374
  return new In(t.firestore, t.converter, function(t, e) {
5369
5375
  return new pe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
5370
5376
  }(t._query, e));
@@ -5381,25 +5387,25 @@ function Ir(...t) {
5381
5387
  /*inclusive=*/ !1);
5382
5388
  }
5383
5389
 
5384
- class Tr extends fr {
5390
+ class Ar extends fr {
5385
5391
  constructor(t, e, n) {
5386
- super(), this.type = t, this.At = e, this.Rt = n;
5392
+ super(), this.type = t, this.At = e, this.Tt = n;
5387
5393
  }
5388
5394
  _apply(t) {
5389
- const e = Pr(t, this.type, this.At, this.Rt);
5395
+ const e = Pr(t, this.type, this.At, this.Tt);
5390
5396
  return new In(t.firestore, t.converter, function(t, e) {
5391
5397
  return new pe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
5392
5398
  }(t._query, e));
5393
5399
  }
5394
5400
  }
5395
5401
 
5396
- function Ar(...t) {
5397
- return new Tr("endBefore", t,
5402
+ function Tr(...t) {
5403
+ return new Ar("endBefore", t,
5398
5404
  /*inclusive=*/ !1);
5399
5405
  }
5400
5406
 
5401
5407
  function Rr(...t) {
5402
- return new Tr("endAt", t, /*inclusive=*/ !0);
5408
+ return new Ar("endAt", t, /*inclusive=*/ !0);
5403
5409
  }
5404
5410
 
5405
5411
  /** Helper function to create a bound from a document or fields */ function Pr(t, e, n, r) {
@@ -5580,7 +5586,7 @@ class xr extends class {
5580
5586
  }
5581
5587
  convertObject(t, e) {
5582
5588
  const n = {};
5583
- return At(t.fields, ((t, r) => {
5589
+ return Tt(t.fields, ((t, r) => {
5584
5590
  n[t] = this.convertValue(r, e);
5585
5591
  })), n;
5586
5592
  }
@@ -5720,7 +5726,7 @@ function Or(t, e, n, ...r) {
5720
5726
  * @returns A `Promise` resolved with a `DocumentReference` pointing to the
5721
5727
  * newly created document after it has been written to the backend.
5722
5728
  */ function Cr(t, e) {
5723
- const n = Pn(t = at(t, Tn)), r = Dr(t.converter, e), s = jn(Un(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
5729
+ const n = Pn(t = at(t, An)), r = Dr(t.converter, e), s = jn(Un(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
5724
5730
  return un(fn(t.firestore), [ s.toMutation(n._key, $e.exists(!1)) ]).then((() => n));
5725
5731
  }
5726
5732
 
@@ -6116,26 +6122,26 @@ function Gr(t, e) {
6116
6122
  class Jr {
6117
6123
  constructor(t, e, n, r, s) {
6118
6124
  this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = r,
6119
- this.deferred = s, this.Pt = n.maxAttempts, this.Vt = new sn(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
6125
+ this.deferred = s, this.Rt = n.maxAttempts, this.Pt = new sn(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
6120
6126
  }
6121
6127
  /** Runs the transaction and sets the result on deferred. */ run() {
6122
- this.Pt -= 1, this.Nt();
6128
+ this.Rt -= 1, this.Vt();
6123
6129
  }
6124
- Nt() {
6125
- this.Vt.J((async () => {
6126
- const t = new Yr(this.datastore), e = this.$t(t);
6130
+ Vt() {
6131
+ this.Pt.J((async () => {
6132
+ const t = new Yr(this.datastore), e = this.Nt(t);
6127
6133
  e && e.then((e => {
6128
6134
  this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {
6129
6135
  this.deferred.resolve(e);
6130
6136
  })).catch((t => {
6131
- this.Dt(t);
6137
+ this.$t(t);
6132
6138
  }))));
6133
6139
  })).catch((t => {
6134
- this.Dt(t);
6140
+ this.$t(t);
6135
6141
  }));
6136
6142
  }));
6137
6143
  }
6138
- $t(t) {
6144
+ Nt(t) {
6139
6145
  try {
6140
6146
  const e = this.updateFunction(t);
6141
6147
  return !lt(e) && e.catch && e.then ? e : (this.deferred.reject(Error("Transaction callback must return a Promise")),
@@ -6145,16 +6151,16 @@ class Jr {
6145
6151
  return this.deferred.reject(t), null;
6146
6152
  }
6147
6153
  }
6148
- Dt(t) {
6149
- this.Pt > 0 && this.xt(t) ? (this.Pt -= 1, this.asyncQueue.enqueueAndForget((() => (this.Nt(),
6154
+ $t(t) {
6155
+ this.Rt > 0 && this.Dt(t) ? (this.Rt -= 1, this.asyncQueue.enqueueAndForget((() => (this.Vt(),
6150
6156
  Promise.resolve())))) : this.deferred.reject(t);
6151
6157
  }
6152
- xt(t) {
6158
+ Dt(t) {
6153
6159
  if ("FirebaseError" === t.name) {
6154
6160
  // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and
6155
6161
  // non-matching document versions with ABORTED. These errors should be retried.
6156
6162
  const e = t.code;
6157
- return "aborted" === e || "failed-precondition" === e || !
6163
+ return "aborted" === e || "failed-precondition" === e || "already-exists" === e || !
6158
6164
  /**
6159
6165
  * Determines whether an error code represents a permanent error when received
6160
6166
  * in response to a non-write operation.
@@ -6320,39 +6326,39 @@ class Jr {
6320
6326
  */ class ts {
6321
6327
  constructor() {
6322
6328
  // The last promise in the queue.
6323
- this.St = Promise.resolve(),
6329
+ this.xt = Promise.resolve(),
6324
6330
  // A list of retryable operations. Retryable operations are run in order and
6325
6331
  // retried with backoff.
6326
- this.Ft = [],
6332
+ this.St = [],
6327
6333
  // Is this AsyncQueue being shut down? Once it is set to true, it will not
6328
6334
  // be changed again.
6329
- this.qt = !1,
6335
+ this.Ft = !1,
6330
6336
  // Operations scheduled to be queued in the future. Operations are
6331
6337
  // automatically removed after they are run or canceled.
6332
- this.Ot = [],
6338
+ this.qt = [],
6333
6339
  // visible for testing
6334
- this.kt = null,
6340
+ this.Ot = null,
6335
6341
  // Flag set while there's an outstanding AsyncQueue operation, used for
6336
6342
  // assertion sanity-checks.
6337
- this.Ct = !1,
6343
+ this.kt = !1,
6338
6344
  // Enabled during shutdown on Safari to prevent future access to IndexedDB.
6339
- this.Lt = !1,
6345
+ this.Ct = !1,
6340
6346
  // List of TimerIds to fast-forward delays for.
6341
- this.Mt = [],
6347
+ this.Lt = [],
6342
6348
  // Backoff timer used to schedule retries for retryable operations
6343
- this.Vt = new sn(this, "async_queue_retry" /* AsyncQueueRetry */),
6349
+ this.Pt = new sn(this, "async_queue_retry" /* AsyncQueueRetry */),
6344
6350
  // Visibility handler that triggers an immediate retry of all retryable
6345
6351
  // operations. Meant to speed up recovery when we regain file system access
6346
6352
  // after page comes into foreground.
6347
- this.Ut = () => {
6353
+ this.Mt = () => {
6348
6354
  const t = Xr();
6349
- t && g("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.Vt.Z();
6355
+ t && g("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.Pt.Z();
6350
6356
  };
6351
6357
  const t = Xr();
6352
- t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.Ut);
6358
+ t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.Mt);
6353
6359
  }
6354
6360
  get isShuttingDown() {
6355
- return this.qt;
6361
+ return this.Ft;
6356
6362
  }
6357
6363
  /**
6358
6364
  * Adds a new operation to the queue without waiting for it to complete (i.e.
@@ -6362,38 +6368,38 @@ class Jr {
6362
6368
  this.enqueue(t);
6363
6369
  }
6364
6370
  enqueueAndForgetEvenWhileRestricted(t) {
6365
- this.jt(),
6371
+ this.Ut(),
6366
6372
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
6367
- this.Bt(t);
6373
+ this.jt(t);
6368
6374
  }
6369
6375
  enterRestrictedMode(t) {
6370
- if (!this.qt) {
6371
- this.qt = !0, this.Lt = t || !1;
6376
+ if (!this.Ft) {
6377
+ this.Ft = !0, this.Ct = t || !1;
6372
6378
  const e = Xr();
6373
- e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Ut);
6379
+ e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Mt);
6374
6380
  }
6375
6381
  }
6376
6382
  enqueue(t) {
6377
- if (this.jt(), this.qt)
6383
+ if (this.Ut(), this.Ft)
6378
6384
  // Return a Promise which never resolves.
6379
6385
  return new Promise((() => {}));
6380
6386
  // Create a deferred Promise that we can return to the callee. This
6381
6387
  // allows us to return a "hanging Promise" only to the callee and still
6382
6388
  // advance the queue even when the operation is not run.
6383
6389
  const e = new B;
6384
- return this.Bt((() => this.qt && this.Lt ? Promise.resolve() : (t().then(e.resolve, e.reject),
6390
+ return this.jt((() => this.Ft && this.Ct ? Promise.resolve() : (t().then(e.resolve, e.reject),
6385
6391
  e.promise))).then((() => e.promise));
6386
6392
  }
6387
6393
  enqueueRetryable(t) {
6388
- this.enqueueAndForget((() => (this.Ft.push(t), this.Qt())));
6394
+ this.enqueueAndForget((() => (this.St.push(t), this.Bt())));
6389
6395
  }
6390
6396
  /**
6391
6397
  * Runs the next operation from the retryable queue. If the operation fails,
6392
6398
  * reschedules with backoff.
6393
- */ async Qt() {
6394
- if (0 !== this.Ft.length) {
6399
+ */ async Bt() {
6400
+ if (0 !== this.St.length) {
6395
6401
  try {
6396
- await this.Ft[0](), this.Ft.shift(), this.Vt.reset();
6402
+ await this.St[0](), this.St.shift(), this.Pt.reset();
6397
6403
  } catch (t) {
6398
6404
  if (!
6399
6405
  /**
@@ -6437,7 +6443,7 @@ class Jr {
6437
6443
  // Failure will be handled by AsyncQueue
6438
6444
  g("AsyncQueue", "Operation failed with retryable error: " + t);
6439
6445
  }
6440
- this.Ft.length > 0 &&
6446
+ this.St.length > 0 &&
6441
6447
  // If there are additional operations, we re-schedule `retryNextOp()`.
6442
6448
  // This is necessary to run retryable operations that failed during
6443
6449
  // their initial attempt since we don't know whether they are already
@@ -6448,12 +6454,12 @@ class Jr {
6448
6454
  // Since `backoffAndRun()` cancels an existing backoff and schedules a
6449
6455
  // new backoff on every call, there is only ever a single additional
6450
6456
  // operation in the queue.
6451
- this.Vt.J((() => this.Qt()));
6457
+ this.Pt.J((() => this.Bt()));
6452
6458
  }
6453
6459
  }
6454
- Bt(t) {
6455
- const e = this.St.then((() => (this.Ct = !0, t().catch((t => {
6456
- this.kt = t, this.Ct = !1;
6460
+ jt(t) {
6461
+ const e = this.xt.then((() => (this.kt = !0, t().catch((t => {
6462
+ this.Ot = t, this.kt = !1;
6457
6463
  const e =
6458
6464
  /**
6459
6465
  * Chrome includes Error.message in Error.stack. Other browsers do not.
@@ -6494,38 +6500,38 @@ class Jr {
6494
6500
  // all further attempts to chain (via .then) will just short-circuit
6495
6501
  // and return the rejected Promise.
6496
6502
  throw _("INTERNAL UNHANDLED ERROR: ", e), t;
6497
- })).then((t => (this.Ct = !1, t))))));
6498
- return this.St = e, e;
6503
+ })).then((t => (this.kt = !1, t))))));
6504
+ return this.xt = e, e;
6499
6505
  }
6500
6506
  enqueueAfterDelay(t, e, n) {
6501
- this.jt(),
6507
+ this.Ut(),
6502
6508
  // Fast-forward delays for timerIds that have been overriden.
6503
- this.Mt.indexOf(t) > -1 && (e = 0);
6504
- const r = Zr.createAndSchedule(this, t, e, n, (t => this.zt(t)));
6505
- return this.Ot.push(r), r;
6509
+ this.Lt.indexOf(t) > -1 && (e = 0);
6510
+ const r = Zr.createAndSchedule(this, t, e, n, (t => this.Qt(t)));
6511
+ return this.qt.push(r), r;
6506
6512
  }
6507
- jt() {
6508
- this.kt && E();
6513
+ Ut() {
6514
+ this.Ot && E();
6509
6515
  }
6510
6516
  verifyOperationInProgress() {}
6511
6517
  /**
6512
6518
  * Waits until all currently queued tasks are finished executing. Delayed
6513
6519
  * operations are not run.
6514
- */ async Wt() {
6520
+ */ async zt() {
6515
6521
  // Operations in the queue prior to draining may have enqueued additional
6516
6522
  // operations. Keep draining the queue until the tail is no longer advanced,
6517
6523
  // which indicates that no more new operations were enqueued and that all
6518
6524
  // operations were executed.
6519
6525
  let t;
6520
6526
  do {
6521
- t = this.St, await t;
6522
- } while (t !== this.St);
6527
+ t = this.xt, await t;
6528
+ } while (t !== this.xt);
6523
6529
  }
6524
6530
  /**
6525
6531
  * For Tests: Determine if a delayed operation with a particular TimerId
6526
6532
  * exists.
6527
- */ Gt(t) {
6528
- for (const e of this.Ot) if (e.timerId === t) return !0;
6533
+ */ Wt(t) {
6534
+ for (const e of this.qt) if (e.timerId === t) return !0;
6529
6535
  return !1;
6530
6536
  }
6531
6537
  /**
@@ -6534,24 +6540,24 @@ class Jr {
6534
6540
  * @param lastTimerId - Delayed operations up to and including this TimerId
6535
6541
  * will be drained. Pass TimerId.All to run all delayed operations.
6536
6542
  * @returns a Promise that resolves once all operations have been run.
6537
- */ Kt(t) {
6543
+ */ Gt(t) {
6538
6544
  // Note that draining may generate more delayed ops, so we do that first.
6539
- return this.Wt().then((() => {
6545
+ return this.zt().then((() => {
6540
6546
  // Run ops in the same order they'd run if they ran naturally.
6541
- this.Ot.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));
6542
- for (const e of this.Ot) if (e.skipDelay(), "all" /* All */ !== t && e.timerId === t) break;
6543
- return this.Wt();
6547
+ this.qt.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));
6548
+ for (const e of this.qt) if (e.skipDelay(), "all" /* All */ !== t && e.timerId === t) break;
6549
+ return this.zt();
6544
6550
  }));
6545
6551
  }
6546
6552
  /**
6547
6553
  * For Tests: Skip all subsequent delays for a timer id.
6548
- */ Yt(t) {
6549
- this.Mt.push(t);
6554
+ */ Kt(t) {
6555
+ this.Lt.push(t);
6550
6556
  }
6551
- /** Called once a DelayedOperation is run or canceled. */ zt(t) {
6557
+ /** Called once a DelayedOperation is run or canceled. */ Qt(t) {
6552
6558
  // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.
6553
- const e = this.Ot.indexOf(t);
6554
- this.Ot.splice(e, 1);
6559
+ const e = this.qt.indexOf(t);
6560
+ this.qt.splice(e, 1);
6555
6561
  }
6556
6562
  }
6557
6563
 
@@ -6658,7 +6664,7 @@ class es {
6658
6664
  return n && s._setSettings(n), s;
6659
6665
  }), "PUBLIC").setMultipleInstances(!0)),
6660
6666
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
6661
- r("firestore-lite", "3.7.1", "rn"), r("firestore-lite", "3.7.1", "esm2017");
6667
+ r("firestore-lite", "3.7.2-canary.457fc2eeb", "rn"), r("firestore-lite", "3.7.2-canary.457fc2eeb", "esm2017");
6662
6668
 
6663
- export { _n as AggregateField, vn as AggregateQuerySnapshot, $n as Bytes, Tn as CollectionReference, En as DocumentReference, ur as DocumentSnapshot, Dn as FieldPath, Sn as FieldValue, wn as Firestore, j as FirestoreError, Fn as GeoPoint, In as Query, fr as QueryConstraint, cr as QueryDocumentSnapshot, ar as QuerySnapshot, Et as Timestamp, es as Transaction, Wr as WriteBatch, Cr as addDoc, Mr as aggregateQuerySnapshotEqual, Qr as arrayRemove, Br as arrayUnion, An as collection, Rn as collectionGroup, yn as connectFirestoreEmulator, kr as deleteDoc, Ur as deleteField, Pn as doc, xn as documentId, Rr as endAt, Ar as endBefore, Lr as getCount, Sr as getDoc, Fr as getDocs, pn as getFirestore, zr as increment, mn as initializeFirestore, _r as limit, vr as limitToLast, yr as orderBy, dr as query, Nn as queryEqual, Vn as refEqual, ns as runTransaction, jr as serverTimestamp, qr as setDoc, y as setLogLevel, hr as snapshotEqual, Ir as startAfter, Er as startAt, gn as terminate, Or as updateDoc, mr as where, Kr as writeBatch };
6669
+ export { _n as AggregateField, vn as AggregateQuerySnapshot, $n as Bytes, An as CollectionReference, En as DocumentReference, ur as DocumentSnapshot, Dn as FieldPath, Sn as FieldValue, wn as Firestore, j as FirestoreError, Fn as GeoPoint, In as Query, fr as QueryConstraint, cr as QueryDocumentSnapshot, ar as QuerySnapshot, Et as Timestamp, es as Transaction, Wr as WriteBatch, Cr as addDoc, Mr as aggregateQuerySnapshotEqual, Qr as arrayRemove, Br as arrayUnion, Tn as collection, Rn as collectionGroup, yn as connectFirestoreEmulator, kr as deleteDoc, Ur as deleteField, Pn as doc, xn as documentId, Rr as endAt, Tr as endBefore, Lr as getCount, Sr as getDoc, Fr as getDocs, pn as getFirestore, zr as increment, mn as initializeFirestore, _r as limit, vr as limitToLast, yr as orderBy, dr as query, Nn as queryEqual, Vn as refEqual, ns as runTransaction, jr as serverTimestamp, qr as setDoc, y as setLogLevel, hr as snapshotEqual, Ir as startAfter, Er as startAt, gn as terminate, Or as updateDoc, mr as where, Kr as writeBatch };
6664
6670
  //# sourceMappingURL=index.rn.esm2017.js.map