@firebase/firestore 1.14.0-canary.daf63c2c → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -289,7 +289,7 @@ var h = {
289
289
  }, t.prototype.toMillis = function() {
290
290
  return 1e3 * this.seconds + this.nanoseconds / 1e6;
291
291
  }, t.prototype.p = function(t) {
292
- return this.seconds === t.seconds ? Ie(this.nanoseconds, t.nanoseconds) : Ie(this.seconds, t.seconds);
292
+ return this.seconds === t.seconds ? Ee(this.nanoseconds, t.nanoseconds) : Ee(this.seconds, t.seconds);
293
293
  }, t.prototype.isEqual = function(t) {
294
294
  return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds;
295
295
  }, t.prototype.toString = function() {
@@ -555,7 +555,7 @@ T.EMPTY = new T(new w([]));
555
555
  */
556
556
  // An immutable sorted map implementation, based on a Left-leaning Red-Black
557
557
  // tree.
558
- var I = /** @class */ function() {
558
+ var E = /** @class */ function() {
559
559
  function t(t, e) {
560
560
  this.F = t, this.root = e || N.EMPTY;
561
561
  }
@@ -634,17 +634,17 @@ var I = /** @class */ function() {
634
634
  },
635
635
  // Returns an iterator over the SortedMap.
636
636
  t.prototype._t = function() {
637
- return new E(this.root, null, this.F, !1);
637
+ return new I(this.root, null, this.F, !1);
638
638
  }, t.prototype.lt = function(t) {
639
- return new E(this.root, t, this.F, !1);
639
+ return new I(this.root, t, this.F, !1);
640
640
  }, t.prototype.dt = function() {
641
- return new E(this.root, null, this.F, !0);
641
+ return new I(this.root, null, this.F, !0);
642
642
  }, t.prototype.ft = function(t) {
643
- return new E(this.root, t, this.F, !0);
643
+ return new I(this.root, t, this.F, !0);
644
644
  }, t;
645
- }(), E = /** @class */ function() {
645
+ }(), I = /** @class */ function() {
646
646
  function t(t, e, n, r) {
647
- this.Tt = r, this.Et = [];
647
+ this.Tt = r, this.wt = [];
648
648
  for (var i = 1; !t.U(); ) if (i = e ? n(t.key, e) : 1,
649
649
  // flip the comparison if we're going in reverse
650
650
  r && (i *= -1), i < 0)
@@ -653,27 +653,27 @@ var I = /** @class */ function() {
653
653
  if (0 === i) {
654
654
  // This node is exactly equal to our start key. Push it on the stack,
655
655
  // but stop iterating;
656
- this.Et.push(t);
656
+ this.wt.push(t);
657
657
  break;
658
658
  }
659
659
  // This node is greater than our start key, add it to the stack and move
660
660
  // to the next one
661
- this.Et.push(t), t = this.Tt ? t.right : t.left;
661
+ this.wt.push(t), t = this.Tt ? t.right : t.left;
662
662
  }
663
663
  }
664
- return t.prototype.wt = function() {
665
- var t = this.Et.pop(), e = {
664
+ return t.prototype.Et = function() {
665
+ var t = this.wt.pop(), e = {
666
666
  key: t.key,
667
667
  value: t.value
668
668
  };
669
- if (this.Tt) for (t = t.left; !t.U(); ) this.Et.push(t), t = t.right; else for (t = t.right; !t.U(); ) this.Et.push(t),
669
+ if (this.Tt) for (t = t.left; !t.U(); ) this.wt.push(t), t = t.right; else for (t = t.right; !t.U(); ) this.wt.push(t),
670
670
  t = t.left;
671
671
  return e;
672
672
  }, t.prototype.It = function() {
673
- return this.Et.length > 0;
673
+ return this.wt.length > 0;
674
674
  }, t.prototype.Rt = function() {
675
- if (0 === this.Et.length) return null;
676
- var t = this.Et[this.Et.length - 1];
675
+ if (0 === this.wt.length) return null;
676
+ var t = this.wt[this.wt.length - 1];
677
677
  return {
678
678
  key: t.key,
679
679
  value: t.value
@@ -878,7 +878,7 @@ N.EMPTY = new (/** @class */ function() {
878
878
  */
879
879
  var A = /** @class */ function() {
880
880
  function t(t) {
881
- this.F = t, this.data = new I(this.F);
881
+ this.F = t, this.data = new E(this.F);
882
882
  }
883
883
  return t.prototype.has = function(t) {
884
884
  return null !== this.data.get(t);
@@ -902,7 +902,7 @@ var A = /** @class */ function() {
902
902
  },
903
903
  /** Iterates over `elem`s such that: range[0] <= elem < range[1]. */ t.prototype.Ct = function(t, e) {
904
904
  for (var n = this.data.lt(t[0]); n.It(); ) {
905
- var r = n.wt();
905
+ var r = n.Et();
906
906
  if (this.F(r.key, t[1]) >= 0) return;
907
907
  e(r.key);
908
908
  }
@@ -912,11 +912,11 @@ var A = /** @class */ function() {
912
912
  */
913
913
  t.prototype.kt = function(t, e) {
914
914
  var n;
915
- for (n = void 0 !== e ? this.data.lt(e) : this.data._t(); n.It(); ) if (!t(n.wt().key)) return;
915
+ for (n = void 0 !== e ? this.data.lt(e) : this.data._t(); n.It(); ) if (!t(n.Et().key)) return;
916
916
  },
917
917
  /** Finds the least element greater than or equal to `elem`. */ t.prototype.Nt = function(t) {
918
918
  var e = this.data.lt(t);
919
- return e.It() ? e.wt().key : null;
919
+ return e.It() ? e.Et().key : null;
920
920
  }, t.prototype._t = function() {
921
921
  return new S(this.data._t());
922
922
  }, t.prototype.lt = function(t) {
@@ -939,7 +939,7 @@ var A = /** @class */ function() {
939
939
  if (!(e instanceof t)) return !1;
940
940
  if (this.size !== e.size) return !1;
941
941
  for (var n = this.data._t(), r = e.data._t(); n.It(); ) {
942
- var i = n.wt().key, o = r.wt().key;
942
+ var i = n.Et().key, o = r.Et().key;
943
943
  if (0 !== this.F(i, o)) return !1;
944
944
  }
945
945
  return !0;
@@ -961,8 +961,8 @@ var A = /** @class */ function() {
961
961
  function t(t) {
962
962
  this.$t = t;
963
963
  }
964
- return t.prototype.wt = function() {
965
- return this.$t.wt().key;
964
+ return t.prototype.Et = function() {
965
+ return this.$t.Et().key;
966
966
  }, t.prototype.It = function() {
967
967
  return this.$t.It();
968
968
  }, t;
@@ -1047,17 +1047,17 @@ function x(t) {
1047
1047
  }, t.prototype.Ot = function() {
1048
1048
  return 2 * this.Mt.length;
1049
1049
  }, t.prototype.D = function(t) {
1050
- return Ie(this.Mt, t.Mt);
1050
+ return Ee(this.Mt, t.Mt);
1051
1051
  }, t.prototype.isEqual = function(t) {
1052
1052
  return this.Mt === t.Mt;
1053
1053
  }, t;
1054
1054
  }();
1055
1055
 
1056
- function V(t) {
1056
+ function L(t) {
1057
1057
  return null == t;
1058
1058
  }
1059
1059
 
1060
- /** Returns whether the value represents -0. */ function L(t) {
1060
+ /** Returns whether the value represents -0. */ function U(t) {
1061
1061
  // Detect if the value is -0.0. Based on polyfill from
1062
1062
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
1063
1063
  return -0 === t && 1 / t == -1 / 0;
@@ -1066,8 +1066,8 @@ function V(t) {
1066
1066
  /**
1067
1067
  * Returns whether a value is an integer and in the safe integer range
1068
1068
  * @param value The value to test for being an integer and in the safe range
1069
- */ function U(t) {
1070
- return "number" == typeof t && Number.isInteger(t) && !L(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
1069
+ */ function V(t) {
1070
+ return "number" == typeof t && Number.isInteger(t) && !U(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
1071
1071
  }
1072
1072
 
1073
1073
  /**
@@ -1187,13 +1187,13 @@ var C = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1187
1187
  if ("integerValue" in t && "integerValue" in e) return K(t.integerValue) === K(e.integerValue);
1188
1188
  if ("doubleValue" in t && "doubleValue" in e) {
1189
1189
  var n = K(t.doubleValue), r = K(e.doubleValue);
1190
- return n === r ? L(n) === L(r) : isNaN(n) && isNaN(r);
1190
+ return n === r ? U(n) === U(r) : isNaN(n) && isNaN(r);
1191
1191
  }
1192
1192
  return !1;
1193
1193
  }(t, e);
1194
1194
 
1195
1195
  case 9 /* ArrayValue */ :
1196
- return Ee(t.arrayValue.values || [], e.arrayValue.values || [], q);
1196
+ return Ie(t.arrayValue.values || [], e.arrayValue.values || [], q);
1197
1197
 
1198
1198
  case 10 /* ObjectValue */ :
1199
1199
  return function(t, e) {
@@ -1216,13 +1216,13 @@ function F(t, e) {
1216
1216
 
1217
1217
  function j(t, e) {
1218
1218
  var n = M(t), r = M(e);
1219
- if (n !== r) return Ie(n, r);
1219
+ if (n !== r) return Ee(n, r);
1220
1220
  switch (n) {
1221
1221
  case 0 /* NullValue */ :
1222
1222
  return 0;
1223
1223
 
1224
1224
  case 1 /* BooleanValue */ :
1225
- return Ie(t.booleanValue, e.booleanValue);
1225
+ return Ee(t.booleanValue, e.booleanValue);
1226
1226
 
1227
1227
  case 2 /* NumberValue */ :
1228
1228
  return function(t, e) {
@@ -1239,7 +1239,7 @@ function j(t, e) {
1239
1239
  return G(P(t), P(e));
1240
1240
 
1241
1241
  case 5 /* StringValue */ :
1242
- return Ie(t.stringValue, e.stringValue);
1242
+ return Ee(t.stringValue, e.stringValue);
1243
1243
 
1244
1244
  case 6 /* BlobValue */ :
1245
1245
  return function(t, e) {
@@ -1250,16 +1250,16 @@ function j(t, e) {
1250
1250
  case 7 /* RefValue */ :
1251
1251
  return function(t, e) {
1252
1252
  for (var n = t.split("/"), r = e.split("/"), i = 0; i < n.length && i < r.length; i++) {
1253
- var o = Ie(n[i], r[i]);
1253
+ var o = Ee(n[i], r[i]);
1254
1254
  if (0 !== o) return o;
1255
1255
  }
1256
- return Ie(n.length, r.length);
1256
+ return Ee(n.length, r.length);
1257
1257
  }(t.referenceValue, e.referenceValue);
1258
1258
 
1259
1259
  case 8 /* GeoPointValue */ :
1260
1260
  return function(t, e) {
1261
- var n = Ie(K(t.latitude), K(e.latitude));
1262
- return 0 !== n ? n : Ie(K(t.longitude), K(e.longitude));
1261
+ var n = Ee(K(t.latitude), K(e.latitude));
1262
+ return 0 !== n ? n : Ee(K(t.longitude), K(e.longitude));
1263
1263
  }(t.geoPointValue, e.geoPointValue);
1264
1264
 
1265
1265
  case 9 /* ArrayValue */ :
@@ -1268,7 +1268,7 @@ function j(t, e) {
1268
1268
  var o = j(n[i], r[i]);
1269
1269
  if (o) return o;
1270
1270
  }
1271
- return Ie(n.length, r.length);
1271
+ return Ee(n.length, r.length);
1272
1272
  }(t.arrayValue, e.arrayValue);
1273
1273
 
1274
1274
  case 10 /* ObjectValue */ :
@@ -1280,12 +1280,12 @@ function j(t, e) {
1280
1280
  // canonical IDs are independent of insertion order.
1281
1281
  r.sort(), o.sort();
1282
1282
  for (var s = 0; s < r.length && s < o.length; ++s) {
1283
- var u = Ie(r[s], o[s]);
1283
+ var u = Ee(r[s], o[s]);
1284
1284
  if (0 !== u) return u;
1285
1285
  var a = j(n[r[s]], i[o[s]]);
1286
1286
  if (0 !== a) return a;
1287
1287
  }
1288
- return Ie(r.length, o.length);
1288
+ return Ee(r.length, o.length);
1289
1289
  }(t.mapValue, e.mapValue);
1290
1290
 
1291
1291
  default:
@@ -1294,9 +1294,9 @@ function j(t, e) {
1294
1294
  }
1295
1295
 
1296
1296
  function G(t, e) {
1297
- if ("string" == typeof t && "string" == typeof e && t.length === e.length) return Ie(t, e);
1298
- var n = z(t), r = z(e), i = Ie(n.seconds, r.seconds);
1299
- return 0 !== i ? i : Ie(n.nanos, r.nanos);
1297
+ if ("string" == typeof t && "string" == typeof e && t.length === e.length) return Ee(t, e);
1298
+ var n = z(t), r = z(e), i = Ee(n.seconds, r.seconds);
1299
+ return 0 !== i ? i : Ee(n.nanos, r.nanos);
1300
1300
  }
1301
1301
 
1302
1302
  function B(t) {
@@ -1375,7 +1375,7 @@ function z(t) {
1375
1375
  }
1376
1376
 
1377
1377
  /** Returns true if `value` is a DoubleValue. */
1378
- /** Returns true if `value` is an ArrayValue. */ function J(t) {
1378
+ /** Returns true if `value` is an ArrayValue. */ function X(t) {
1379
1379
  return !!t && "arrayValue" in t;
1380
1380
  }
1381
1381
 
@@ -1383,7 +1383,7 @@ function z(t) {
1383
1383
  return !!t && "nullValue" in t;
1384
1384
  }
1385
1385
 
1386
- /** Returns true if `value` is NaN. */ function X(t) {
1386
+ /** Returns true if `value` is NaN. */ function J(t) {
1387
1387
  return !!t && "doubleValue" in t && isNaN(Number(t.doubleValue));
1388
1388
  }
1389
1389
 
@@ -1469,7 +1469,7 @@ var tt = /** @class */ function() {
1469
1469
  return null;
1470
1470
  // Array transforms are idempotent and don't require a base value.
1471
1471
  }, t.prototype.isEqual = function(e) {
1472
- return e instanceof t && Ee(this.elements, e.elements, q);
1472
+ return e instanceof t && Ie(this.elements, e.elements, q);
1473
1473
  }, t;
1474
1474
  }(), et = /** @class */ function() {
1475
1475
  function t(t) {
@@ -1499,7 +1499,7 @@ var tt = /** @class */ function() {
1499
1499
  return null;
1500
1500
  // Array transforms are idempotent and don't require a base value.
1501
1501
  }, t.prototype.isEqual = function(e) {
1502
- return e instanceof t && Ee(this.elements, e.elements, q);
1502
+ return e instanceof t && Ie(this.elements, e.elements, q);
1503
1503
  }, t;
1504
1504
  }(), nt = /** @class */ function() {
1505
1505
  function t(t, e) {
@@ -1533,7 +1533,7 @@ var tt = /** @class */ function() {
1533
1533
  }();
1534
1534
 
1535
1535
  /** Transforms an array value via a remove operation. */ function rt(t) {
1536
- return J(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];
1536
+ return X(t) && t.arrayValue.values ? t.arrayValue.values.slice() : [];
1537
1537
  }
1538
1538
 
1539
1539
  /**
@@ -1812,7 +1812,7 @@ var at = /** @class */ function() {
1812
1812
  }
1813
1813
  return e ? e.oe() : null;
1814
1814
  }, n.prototype.isEqual = function(t) {
1815
- return t instanceof n && this.key.isEqual(t.key) && Ee(this.fieldTransforms, t.fieldTransforms, (function(t, e) {
1815
+ return t instanceof n && this.key.isEqual(t.key) && Ie(this.fieldTransforms, t.fieldTransforms, (function(t, e) {
1816
1816
  return t.isEqual(e);
1817
1817
  })) && this.Zt.isEqual(t.Zt);
1818
1818
  },
@@ -2051,25 +2051,25 @@ var yt = /** @class */ function() {
2051
2051
  function t(t, e) {
2052
2052
  this.key = t, this.version = e;
2053
2053
  }
2054
- return t.Ee = function(t, e) {
2054
+ return t.we = function(t, e) {
2055
2055
  return T.F(t.key, e.key);
2056
2056
  }, t;
2057
2057
  }(), vt = /** @class */ function(t) {
2058
2058
  function n(e, n, r, i) {
2059
2059
  var o = this;
2060
- return (o = t.call(this, e, n) || this).we = r, o.te = !!i.te, o.hasCommittedMutations = !!i.hasCommittedMutations,
2060
+ return (o = t.call(this, e, n) || this).Ee = r, o.te = !!i.te, o.hasCommittedMutations = !!i.hasCommittedMutations,
2061
2061
  o;
2062
2062
  }
2063
2063
  return e.__extends(n, t), n.prototype.field = function(t) {
2064
- return this.we.field(t);
2064
+ return this.Ee.field(t);
2065
2065
  }, n.prototype.data = function() {
2066
- return this.we;
2066
+ return this.Ee;
2067
2067
  }, n.prototype.Ie = function() {
2068
- return this.we.proto;
2068
+ return this.Ee.proto;
2069
2069
  }, n.prototype.isEqual = function(t) {
2070
- return t instanceof n && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.te === t.te && this.hasCommittedMutations === t.hasCommittedMutations && this.we.isEqual(t.we);
2070
+ return t instanceof n && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.te === t.te && this.hasCommittedMutations === t.hasCommittedMutations && this.Ee.isEqual(t.Ee);
2071
2071
  }, n.prototype.toString = function() {
2072
- return "Document(" + this.key + ", " + this.version + ", " + this.we.toString() + ", {hasLocalMutations: " + this.te + "}), {hasCommittedMutations: " + this.hasCommittedMutations + "})";
2072
+ return "Document(" + this.key + ", " + this.version + ", " + this.Ee.toString() + ", {hasLocalMutations: " + this.te + "}), {hasCommittedMutations: " + this.hasCommittedMutations + "})";
2073
2073
  }, Object.defineProperty(n.prototype, "hasPendingWrites", {
2074
2074
  get: function() {
2075
2075
  return this.te || this.hasCommittedMutations;
@@ -2135,7 +2135,7 @@ var yt = /** @class */ function() {
2135
2135
  return t.canonicalId();
2136
2136
  })).join(","), t += "|ob:", t += this.orderBy.map((function(t) {
2137
2137
  return t.canonicalId();
2138
- })).join(","), V(this.limit) || (t += "|l:", t += this.limit), this.startAt && (t += "|lb:",
2138
+ })).join(","), L(this.limit) || (t += "|l:", t += this.limit), this.startAt && (t += "|lb:",
2139
2139
  t += this.startAt.canonicalId()), this.endAt && (t += "|ub:", t += this.endAt.canonicalId()),
2140
2140
  this.Ae = t;
2141
2141
  }
@@ -2144,7 +2144,7 @@ var yt = /** @class */ function() {
2144
2144
  var t = this.path.K();
2145
2145
  return null !== this.collectionGroup && (t += " collectionGroup=" + this.collectionGroup),
2146
2146
  this.filters.length > 0 && (t += ", filters: [" + this.filters.join(", ") + "]"),
2147
- V(this.limit) || (t += ", limit: " + this.limit), this.orderBy.length > 0 && (t += ", orderBy: [" + this.orderBy.join(", ") + "]"),
2147
+ L(this.limit) || (t += ", limit: " + this.limit), this.orderBy.length > 0 && (t += ", orderBy: [" + this.orderBy.join(", ") + "]"),
2148
2148
  this.startAt && (t += ", startAt: " + this.startAt.canonicalId()), this.endAt && (t += ", endAt: " + this.endAt.canonicalId()),
2149
2149
  "Target(" + t + ")";
2150
2150
  }, t.prototype.isEqual = function(t) {
@@ -2181,7 +2181,7 @@ var yt = /** @class */ function() {
2181
2181
  // In order to implicitly add key ordering, we must also add the
2182
2182
  // inequality filter field for it to be a valid query.
2183
2183
  // Note that the default inequality field and key ordering is ascending.
2184
- t.Y() ? this.pe = [ Ut ] : this.pe = [ new Lt(t), Ut ]; else {
2184
+ t.Y() ? this.pe = [ Vt ] : this.pe = [ new Ut(t), Vt ]; else {
2185
2185
  this.pe = [];
2186
2186
  for (var n = !1, r = 0, i = this.Ve; r < i.length; r++) {
2187
2187
  var o = i[r];
@@ -2191,7 +2191,7 @@ var yt = /** @class */ function() {
2191
2191
  // The order of the implicit key ordering always matches the last
2192
2192
  // explicit order by
2193
2193
  var s = this.Ve.length > 0 ? this.Ve[this.Ve.length - 1].dir : kt.ASCENDING;
2194
- this.pe.push(s === kt.ASCENDING ? Ut : Ot);
2194
+ this.pe.push(s === kt.ASCENDING ? Vt : Ot);
2195
2195
  }
2196
2196
  }
2197
2197
  }
@@ -2251,15 +2251,15 @@ var yt = /** @class */ function() {
2251
2251
  }, t.prototype.matches = function(t) {
2252
2252
  return this.Ue(t) && this.qe(t) && this.Qe(t) && this.We(t);
2253
2253
  }, t.prototype.je = function() {
2254
- return !V(this.limit) && "F" /* First */ === this.ge;
2254
+ return !L(this.limit) && "F" /* First */ === this.ge;
2255
2255
  }, t.prototype.Ke = function() {
2256
- return !V(this.limit) && "L" /* Last */ === this.ge;
2256
+ return !L(this.limit) && "L" /* Last */ === this.ge;
2257
2257
  }, t.prototype.De = function() {
2258
2258
  return this.Ve.length > 0 ? this.Ve[0].field : null;
2259
2259
  }, t.prototype.Se = function() {
2260
2260
  for (var t = 0, e = this.filters; t < e.length; t++) {
2261
2261
  var n = e[t];
2262
- if (n instanceof It && n.Ge()) return n.field;
2262
+ if (n instanceof Et && n.Ge()) return n.field;
2263
2263
  }
2264
2264
  return null;
2265
2265
  },
@@ -2268,7 +2268,7 @@ var yt = /** @class */ function() {
2268
2268
  t.prototype.ze = function(t) {
2269
2269
  for (var e = 0, n = this.filters; e < n.length; e++) {
2270
2270
  var r = n[e];
2271
- if (r instanceof It && t.indexOf(r.op) >= 0) return r.op;
2271
+ if (r instanceof Et && t.indexOf(r.op) >= 0) return r.op;
2272
2272
  }
2273
2273
  return null;
2274
2274
  }, t.prototype.Pe = function() {
@@ -2286,10 +2286,10 @@ var yt = /** @class */ function() {
2286
2286
  // Flip the orderBy directions since we want the last results
2287
2287
  var t = [], e = 0, n = this.orderBy; e < n.length; e++) {
2288
2288
  var r = n[e], i = r.dir === kt.DESCENDING ? kt.ASCENDING : kt.DESCENDING;
2289
- t.push(new Lt(r.field, i));
2289
+ t.push(new Ut(r.field, i));
2290
2290
  }
2291
2291
  // We need to swap the cursors to match the now-flipped query ordering.
2292
- var o = this.endAt ? new Vt(this.endAt.position, !this.endAt.before) : null, s = this.startAt ? new Vt(this.startAt.position, !this.startAt.before) : null;
2292
+ var o = this.endAt ? new Lt(this.endAt.position, !this.endAt.before) : null, s = this.startAt ? new Lt(this.startAt.position, !this.startAt.before) : null;
2293
2293
  // Now return as a LimitType.First query.
2294
2294
  this.ye = new _t(this.path, this.collectionGroup, t, this.filters, this.limit, o, s);
2295
2295
  }
@@ -2384,7 +2384,7 @@ var yt = /** @class */ function() {
2384
2384
  Tt.GREATER_THAN = new Tt(">"), Tt.GREATER_THAN_OR_EQUAL = new Tt(">="), Tt.ARRAY_CONTAINS = new Tt("array-contains"),
2385
2385
  Tt.IN = new Tt("in"), Tt.ARRAY_CONTAINS_ANY = new Tt("array-contains-any");
2386
2386
 
2387
- var It = /** @class */ function(t) {
2387
+ var Et = /** @class */ function(t) {
2388
2388
  function n(e, n, r) {
2389
2389
  var i = this;
2390
2390
  return (i = t.call(this) || this).field = e, i.op = n, i.value = r, i;
@@ -2392,12 +2392,12 @@ var It = /** @class */ function(t) {
2392
2392
  /**
2393
2393
  * Creates a filter based on the provided arguments.
2394
2394
  */ return e.__extends(n, t), n.create = function(t, e, r) {
2395
- if (t.Y()) return e === Tt.IN ? new Nt(t, r) : new Et(t, e, r);
2395
+ if (t.Y()) return e === Tt.IN ? new Nt(t, r) : new It(t, e, r);
2396
2396
  if (H(r)) {
2397
2397
  if (e !== Tt.EQUAL) throw new c(h.INVALID_ARGUMENT, "Invalid query. Null supports only equality comparisons.");
2398
2398
  return new n(t, e, r);
2399
2399
  }
2400
- if (X(r)) {
2400
+ if (J(r)) {
2401
2401
  if (e !== Tt.EQUAL) throw new c(h.INVALID_ARGUMENT, "Invalid query. NaN supports only equality comparisons.");
2402
2402
  return new n(t, e, r);
2403
2403
  }
@@ -2438,7 +2438,7 @@ var It = /** @class */ function(t) {
2438
2438
  }, n.prototype.toString = function() {
2439
2439
  return this.field.K() + " " + this.op + " " + B(this.value);
2440
2440
  }, n;
2441
- }((function() {})), Et = /** @class */ function(t) {
2441
+ }((function() {})), It = /** @class */ function(t) {
2442
2442
  function n(e, n, r) {
2443
2443
  var i = this;
2444
2444
  return (i = t.call(this, e, n, r) || this).key = T.tt(r.referenceValue), i;
@@ -2447,7 +2447,7 @@ var It = /** @class */ function(t) {
2447
2447
  var e = T.F(t.key, this.key);
2448
2448
  return this.Ye(e);
2449
2449
  }, n;
2450
- }(It), Nt = /** @class */ function(t) {
2450
+ }(Et), Nt = /** @class */ function(t) {
2451
2451
  function n(e, n) {
2452
2452
  var r = this;
2453
2453
  return (r = t.call(this, e, Tt.IN, n) || this).keys = (n.arrayValue.values || []).map((function(t) {
@@ -2459,15 +2459,15 @@ var It = /** @class */ function(t) {
2459
2459
  return e.isEqual(t.key);
2460
2460
  }));
2461
2461
  }, n;
2462
- }(It), At = /** @class */ function(t) {
2462
+ }(Et), At = /** @class */ function(t) {
2463
2463
  function n(e, n) {
2464
2464
  return t.call(this, e, Tt.ARRAY_CONTAINS, n) || this;
2465
2465
  }
2466
2466
  return e.__extends(n, t), n.prototype.matches = function(t) {
2467
2467
  var e = t.field(this.field);
2468
- return J(e) && F(e.arrayValue, this.value);
2468
+ return X(e) && F(e.arrayValue, this.value);
2469
2469
  }, n;
2470
- }(It), St = /** @class */ function(t) {
2470
+ }(Et), St = /** @class */ function(t) {
2471
2471
  function n(e, n) {
2472
2472
  return t.call(this, e, Tt.IN, n) || this;
2473
2473
  }
@@ -2475,17 +2475,17 @@ var It = /** @class */ function(t) {
2475
2475
  var e = t.field(this.field);
2476
2476
  return null !== e && F(this.value.arrayValue, e);
2477
2477
  }, n;
2478
- }(It), Dt = /** @class */ function(t) {
2478
+ }(Et), Dt = /** @class */ function(t) {
2479
2479
  function n(e, n) {
2480
2480
  return t.call(this, e, Tt.ARRAY_CONTAINS_ANY, n) || this;
2481
2481
  }
2482
2482
  return e.__extends(n, t), n.prototype.matches = function(t) {
2483
2483
  var e = this, n = t.field(this.field);
2484
- return !(!J(n) || !n.arrayValue.values) && n.arrayValue.values.some((function(t) {
2484
+ return !(!X(n) || !n.arrayValue.values) && n.arrayValue.values.some((function(t) {
2485
2485
  return F(e.value.arrayValue, t);
2486
2486
  }));
2487
2487
  }, n;
2488
- }(It), kt = /** @class */ function() {
2488
+ }(Et), kt = /** @class */ function() {
2489
2489
  function t(t) {
2490
2490
  this.name = t;
2491
2491
  }
@@ -2511,7 +2511,7 @@ kt.DESCENDING = new kt("desc");
2511
2511
  * after a bound. This is influenced by whether the position is just before or
2512
2512
  * just after the provided values.
2513
2513
  */
2514
- var xt, Rt, Vt = /** @class */ function() {
2514
+ var xt, Rt, Lt = /** @class */ function() {
2515
2515
  function t(t, e) {
2516
2516
  this.position = t, this.before = e;
2517
2517
  }
@@ -2538,12 +2538,12 @@ var xt, Rt, Vt = /** @class */ function() {
2538
2538
  for (var e = 0; e < this.position.length; e++) if (!q(this.position[e], t.position[e])) return !1;
2539
2539
  return !0;
2540
2540
  }, t;
2541
- }(), Lt = /** @class */ function() {
2541
+ }(), Ut = /** @class */ function() {
2542
2542
  function t(t, e) {
2543
2543
  this.field = t, void 0 === e && (e = kt.ASCENDING), this.dir = e, this.Xe = t.Y();
2544
2544
  }
2545
2545
  return t.prototype.compare = function(t, e) {
2546
- var n = this.Xe ? vt.Ee(t, e) : vt.Re(this.field, t, e);
2546
+ var n = this.Xe ? vt.we(t, e) : vt.Re(this.field, t, e);
2547
2547
  switch (this.dir) {
2548
2548
  case kt.ASCENDING:
2549
2549
  return n;
@@ -2562,7 +2562,7 @@ var xt, Rt, Vt = /** @class */ function() {
2562
2562
  }, t.prototype.isEqual = function(t) {
2563
2563
  return this.dir === t.dir && this.field.isEqual(t.field);
2564
2564
  }, t;
2565
- }(), Ut = new Lt(b.X(), kt.ASCENDING), Ot = new Lt(b.X(), kt.DESCENDING), Pt = /** @class */ function() {
2565
+ }(), Vt = new Ut(b.X(), kt.ASCENDING), Ot = new Ut(b.X(), kt.DESCENDING), Pt = /** @class */ function() {
2566
2566
  function t(
2567
2567
  /** The target being listened to. */
2568
2568
  t,
@@ -2773,7 +2773,7 @@ Rt[Rt.INTERNAL = 13] = "INTERNAL", Rt[Rt.UNAVAILABLE = 14] = "UNAVAILABLE", Rt[R
2773
2773
  * See the License for the specific language governing permissions and
2774
2774
  * limitations under the License.
2775
2775
  */
2776
- var Ft = new I(T.F);
2776
+ var Ft = new E(T.F);
2777
2777
 
2778
2778
  function jt() {
2779
2779
  return Ft;
@@ -2783,13 +2783,13 @@ function Gt() {
2783
2783
  return jt();
2784
2784
  }
2785
2785
 
2786
- var Bt = new I(T.F);
2786
+ var Bt = new E(T.F);
2787
2787
 
2788
2788
  function zt() {
2789
2789
  return Bt;
2790
2790
  }
2791
2791
 
2792
- var Kt = new I(T.F);
2792
+ var Kt = new E(T.F);
2793
2793
 
2794
2794
  function Wt() {
2795
2795
  return Kt;
@@ -2806,10 +2806,10 @@ function Qt() {
2806
2806
  return n;
2807
2807
  }
2808
2808
 
2809
- var Jt = new A(Ie);
2809
+ var Xt = new A(Ee);
2810
2810
 
2811
2811
  function Ht() {
2812
- return Jt;
2812
+ return Xt;
2813
2813
  }
2814
2814
 
2815
2815
  /**
@@ -2833,7 +2833,7 @@ function Ht() {
2833
2833
  * in order specified by the provided comparator. We always add a document key
2834
2834
  * comparator on top of what is provided to guarantee document equality based on
2835
2835
  * the key.
2836
- */ var Xt = /** @class */ function() {
2836
+ */ var Jt = /** @class */ function() {
2837
2837
  /** The default ordering is by key if the comparator is omitted */
2838
2838
  function t(t) {
2839
2839
  // We are adding document key comparator to the end as it's the only
@@ -2842,7 +2842,7 @@ function Ht() {
2842
2842
  return t(e, n) || T.F(e.key, n.key);
2843
2843
  } : function(t, e) {
2844
2844
  return T.F(t.key, e.key);
2845
- }, this.rs = zt(), this.os = new I(this.F)
2845
+ }, this.rs = zt(), this.os = new E(this.F)
2846
2846
  /**
2847
2847
  * Returns an empty copy of the existing DocumentSet, using the same
2848
2848
  * comparator.
@@ -2892,7 +2892,7 @@ function Ht() {
2892
2892
  if (!(e instanceof t)) return !1;
2893
2893
  if (this.size !== e.size) return !1;
2894
2894
  for (var n = this.os._t(), r = e.os._t(); n.It(); ) {
2895
- var i = n.wt().key, o = r.wt().key;
2895
+ var i = n.Et().key, o = r.Et().key;
2896
2896
  if (!i.isEqual(o)) return !1;
2897
2897
  }
2898
2898
  return !0;
@@ -2907,7 +2907,7 @@ function Ht() {
2907
2907
  }, t;
2908
2908
  }(), Zt = /** @class */ function() {
2909
2909
  function t() {
2910
- this.as = new I(T.F);
2910
+ this.as = new E(T.F);
2911
2911
  }
2912
2912
  return t.prototype.track = function(t) {
2913
2913
  var e = t.doc.key, n = this.as.get(e);
@@ -2956,7 +2956,7 @@ function Ht() {
2956
2956
  type: 0 /* Added */ ,
2957
2957
  doc: t
2958
2958
  });
2959
- })), new t(e, n, Xt.hs(n), o, r, i,
2959
+ })), new t(e, n, Jt.hs(n), o, r, i,
2960
2960
  /* syncStateChanged= */ !0,
2961
2961
  /* excludesMetadataChanges= */ !1);
2962
2962
  }, Object.defineProperty(t.prototype, "hasPendingWrites", {
@@ -2996,7 +2996,7 @@ function Ht() {
2996
2996
  * A set of which document updates are due only to limbo resolution targets.
2997
2997
  */
2998
2998
  i) {
2999
- this.ts = t, this.Ts = e, this.ms = n, this.Es = r, this.ws = i;
2999
+ this.ts = t, this.Ts = e, this.ms = n, this.ws = r, this.Es = i;
3000
3000
  }
3001
3001
  /**
3002
3002
  * HACK: Views require RemoteEvents in order to determine whether the view is
@@ -3199,7 +3199,7 @@ n
3199
3199
  * known to be inconsistent and their listens needs to be re-established by
3200
3200
  * RemoteStore.
3201
3201
  */
3202
- this.Gs = new A(Ie)
3202
+ this.Gs = new A(Ee)
3203
3203
  /**
3204
3204
  * Processes and adds the DocumentWatchChange to the current set of changes.
3205
3205
  */;
@@ -3330,7 +3330,7 @@ n
3330
3330
  })), i && (r = r.add(t));
3331
3331
  }));
3332
3332
  var i = new te(t, n, this.Gs, this.js, r);
3333
- return this.js = jt(), this.Ks = ue(), this.Gs = new A(Ie), i;
3333
+ return this.js = jt(), this.Ks = ue(), this.Gs = new A(Ee), i;
3334
3334
  },
3335
3335
  /**
3336
3336
  * Adds the provided document to the internal list of document updates and
@@ -3382,7 +3382,7 @@ n
3382
3382
  return e || (e = new oe, this.Ws.set(t, e)), e;
3383
3383
  }, t.prototype.hn = function(t) {
3384
3384
  var e = this.Ks.get(t);
3385
- return e || (e = new A(Ie), this.Ks = this.Ks.it(t, e)), e;
3385
+ return e || (e = new A(Ee), this.Ks = this.Ks.it(t, e)), e;
3386
3386
  },
3387
3387
  /**
3388
3388
  * Verifies that the user is still interested in this target (by calling
@@ -3441,11 +3441,11 @@ n
3441
3441
  * DocumentChangeSet keeps track of a set of changes to docs in a query, merging
3442
3442
  * duplicate events for the same doc.
3443
3443
  */ function ue() {
3444
- return new I(T.F);
3444
+ return new E(T.F);
3445
3445
  }
3446
3446
 
3447
3447
  function ae() {
3448
- return new I(T.F);
3448
+ return new E(T.F);
3449
3449
  }
3450
3450
 
3451
3451
  /**
@@ -3490,7 +3490,7 @@ function ae() {
3490
3490
  * expects a { value: <number> } struct.
3491
3491
  */
3492
3492
  t.prototype.ln = function(t) {
3493
- return this.options.dn || V(t) ? t : {
3493
+ return this.options.dn || L(t) ? t : {
3494
3494
  value: t
3495
3495
  };
3496
3496
  },
@@ -3499,7 +3499,7 @@ function ae() {
3499
3499
  */
3500
3500
  t.prototype.fn = function(t) {
3501
3501
  var e;
3502
- return V(e = "object" == typeof t ? t.value : t) ? null : e;
3502
+ return L(e = "object" == typeof t ? t.value : t) ? null : e;
3503
3503
  },
3504
3504
  /**
3505
3505
  * Returns an IntegerValue for `value`.
@@ -3526,7 +3526,7 @@ function ae() {
3526
3526
  };
3527
3527
  }
3528
3528
  return {
3529
- doubleValue: L(t) ? "-0" : t
3529
+ doubleValue: U(t) ? "-0" : t
3530
3530
  };
3531
3531
  },
3532
3532
  /**
@@ -3535,7 +3535,7 @@ function ae() {
3535
3535
  * otherwise a DoubleValue is returned.
3536
3536
  */
3537
3537
  t.prototype.Tn = function(t) {
3538
- return U(t) ? this.Wt(t) : this.jt(t);
3538
+ return V(t) ? this.Wt(t) : this.jt(t);
3539
3539
  },
3540
3540
  /**
3541
3541
  * Returns a value for a Date that's appropriate to put into a proto.
@@ -3560,7 +3560,7 @@ function ae() {
3560
3560
  /**
3561
3561
  * Returns a ByteString based on the proto string value.
3562
3562
  */
3563
- t.prototype.En = function(t) {
3563
+ t.prototype.wn = function(t) {
3564
3564
  return this.options.dn ? (be(void 0 === t || "string" == typeof t, "value must be undefined or a string when using proto3 Json"),
3565
3565
  R.fromBase64String(t || "")) : (be(void 0 === t || t instanceof Uint8Array, "value must be undefined or Uint8Array"),
3566
3566
  R.fromUint8Array(t || new Uint8Array));
@@ -3568,20 +3568,20 @@ function ae() {
3568
3568
  return this.k(t.k());
3569
3569
  }, t.prototype.fromVersion = function(t) {
3570
3570
  return be(!!t, "Trying to deserialize version that isn't set"), v.v(this.v(t));
3571
- }, t.prototype.wn = function(t, e) {
3571
+ }, t.prototype.En = function(t, e) {
3572
3572
  return this.In(e || this.cn).child("documents").child(t).K();
3573
3573
  }, t.prototype.Rn = function(t) {
3574
3574
  var e = w.G(t);
3575
3575
  return be(le(e), "Tried to deserialize invalid key " + e.toString()), e;
3576
3576
  }, t.prototype.An = function(t) {
3577
- return this.wn(t.path);
3577
+ return this.En(t.path);
3578
3578
  }, t.prototype.tt = function(t) {
3579
3579
  var e = this.Rn(t);
3580
3580
  return be(e.get(1) === this.cn.projectId, "Tried to deserialize key from different project: " + e.get(1) + " vs " + this.cn.projectId),
3581
3581
  be(!e.get(3) && !this.cn.database || e.get(3) === this.cn.database, "Tried to deserialize key from different database: " + e.get(3) + " vs " + this.cn.database),
3582
3582
  new T(this.Pn(e));
3583
3583
  }, t.prototype.Vn = function(t) {
3584
- return this.wn(t);
3584
+ return this.En(t);
3585
3585
  }, t.prototype.gn = function(t) {
3586
3586
  var e = this.Rn(t);
3587
3587
  // In v1beta1 queries for collections at the root did not have a trailing
@@ -3643,7 +3643,7 @@ function ae() {
3643
3643
  t.targetChange;
3644
3644
  // proto3 default value is unset in JSON (undefined), so use 'NO_CHANGE'
3645
3645
  // if unset
3646
- var n = this.Nn(t.targetChange.targetChangeType || "NO_CHANGE"), r = t.targetChange.targetIds || [], i = this.En(t.targetChange.resumeToken), o = t.targetChange.cause, s = o && this._n(o);
3646
+ var n = this.Nn(t.targetChange.targetChangeType || "NO_CHANGE"), r = t.targetChange.targetIds || [], i = this.wn(t.targetChange.resumeToken), o = t.targetChange.cause, s = o && this._n(o);
3647
3647
  e = new ie(n, r, i, s || null);
3648
3648
  } else if ("documentChange" in t) {
3649
3649
  t.documentChange;
@@ -3670,9 +3670,9 @@ function ae() {
3670
3670
  } else {
3671
3671
  if (!("filter" in t)) return _e("Unknown change type " + JSON.stringify(t));
3672
3672
  t.filter;
3673
- var I = t.filter;
3674
- I.targetId;
3675
- var E = I.count || 0, N = new Ct(E), A = I.targetId;
3673
+ var E = t.filter;
3674
+ E.targetId;
3675
+ var I = E.count || 0, N = new Ct(I), A = E.targetId;
3676
3676
  e = new re(A, N);
3677
3677
  }
3678
3678
  return e;
@@ -3876,7 +3876,7 @@ function ae() {
3876
3876
  var e = this;
3877
3877
  if (0 !== t.length) {
3878
3878
  var n = t.map((function(t) {
3879
- return t instanceof It ? e.ni(t) : _e("Unrecognized filter: " + JSON.stringify(t));
3879
+ return t instanceof Et ? e.ni(t) : _e("Unrecognized filter: " + JSON.stringify(t));
3880
3880
  }));
3881
3881
  return 1 === n.length ? n[0] : {
3882
3882
  compositeFilter: {
@@ -3909,7 +3909,7 @@ function ae() {
3909
3909
  };
3910
3910
  }, t.prototype.ti = function(t) {
3911
3911
  var e = !!t.before, n = t.values || [];
3912
- return new Vt(n, e);
3912
+ return new Lt(n, e);
3913
3913
  },
3914
3914
  // visible for testing
3915
3915
  t.prototype.ai = function(t) {
@@ -3977,14 +3977,14 @@ function ae() {
3977
3977
  direction: this.ai(t.dir)
3978
3978
  };
3979
3979
  }, t.prototype.hi = function(t) {
3980
- return new Lt(this.di(t.field), this.ui(t.direction));
3980
+ return new Ut(this.di(t.field), this.ui(t.direction));
3981
3981
  }, t.prototype.ri = function(t) {
3982
- return It.create(this.di(t.fieldFilter.field), this._i(t.fieldFilter.op), t.fieldFilter.value);
3982
+ return Et.create(this.di(t.fieldFilter.field), this._i(t.fieldFilter.op), t.fieldFilter.value);
3983
3983
  },
3984
3984
  // visible for testing
3985
3985
  t.prototype.ni = function(t) {
3986
3986
  if (t.op === Tt.EQUAL) {
3987
- if (X(t.value)) return {
3987
+ if (J(t.value)) return {
3988
3988
  unaryFilter: {
3989
3989
  field: this.li(t.field),
3990
3990
  op: "IS_NAN"
@@ -4008,13 +4008,13 @@ function ae() {
4008
4008
  switch (t.unaryFilter.op) {
4009
4009
  case "IS_NAN":
4010
4010
  var e = this.di(t.unaryFilter.field);
4011
- return It.create(e, Tt.EQUAL, {
4011
+ return Et.create(e, Tt.EQUAL, {
4012
4012
  doubleValue: NaN
4013
4013
  });
4014
4014
 
4015
4015
  case "IS_NULL":
4016
4016
  var n = this.di(t.unaryFilter.field);
4017
- return It.create(n, Tt.EQUAL, {
4017
+ return Et.create(n, Tt.EQUAL, {
4018
4018
  nullValue: "NULL_VALUE"
4019
4019
  });
4020
4020
 
@@ -4197,11 +4197,11 @@ function be(t, e) {
4197
4197
  }, t;
4198
4198
  }();
4199
4199
 
4200
- function Ie(t, e) {
4200
+ function Ee(t, e) {
4201
4201
  return t < e ? -1 : t > e ? 1 : 0;
4202
4202
  }
4203
4203
 
4204
- /** Helper to compare arrays using isEqual(). */ function Ee(t, e, n) {
4204
+ /** Helper to compare arrays using isEqual(). */ function Ie(t, e, n) {
4205
4205
  return t.length === e.length && t.every((function(t, r) {
4206
4206
  return n(t, e[r]);
4207
4207
  }));
@@ -4249,7 +4249,7 @@ function(t, e, n, r, i) {
4249
4249
  function t(t, e) {
4250
4250
  this.projectId = t, this.database = e || "(default)";
4251
4251
  }
4252
- return Object.defineProperty(t.prototype, "Ei", {
4252
+ return Object.defineProperty(t.prototype, "wi", {
4253
4253
  get: function() {
4254
4254
  return "(default)" === this.database;
4255
4255
  },
@@ -4258,11 +4258,11 @@ function(t, e, n, r, i) {
4258
4258
  }), t.prototype.isEqual = function(e) {
4259
4259
  return e instanceof t && e.projectId === this.projectId && e.database === this.database;
4260
4260
  }, t.prototype.D = function(t) {
4261
- return Ie(this.projectId, t.projectId) || Ie(this.database, t.database);
4261
+ return Ee(this.projectId, t.projectId) || Ee(this.database, t.database);
4262
4262
  }, t;
4263
4263
  }(), De = /** @class */ function() {
4264
4264
  function t(t) {
4265
- this.wi = t,
4265
+ this.Ei = t,
4266
4266
  /**
4267
4267
  * The inner map for a key -> value pair. Due to the possibility of
4268
4268
  * collisions we keep a list of entries that we do a linear search through
@@ -4273,7 +4273,7 @@ function(t, e, n, r, i) {
4273
4273
  /** Get a value for this key, or undefined if it does not exist. */;
4274
4274
  }
4275
4275
  return t.prototype.get = function(t) {
4276
- var e = this.wi(t), n = this.Ii[e];
4276
+ var e = this.Ei(t), n = this.Ii[e];
4277
4277
  if (void 0 !== n) for (var r = 0, i = n; r < i.length; r++) {
4278
4278
  var o = i[r], s = o[0], u = o[1];
4279
4279
  if (s.isEqual(t)) return u;
@@ -4282,7 +4282,7 @@ function(t, e, n, r, i) {
4282
4282
  return void 0 !== this.get(t);
4283
4283
  },
4284
4284
  /** Put this key and value in the map. */ t.prototype.set = function(t, e) {
4285
- var n = this.wi(t), r = this.Ii[n];
4285
+ var n = this.Ei(t), r = this.Ii[n];
4286
4286
  if (void 0 !== r) {
4287
4287
  for (var i = 0; i < r.length; i++) if (r[i][0].isEqual(t)) return void (r[i] = [ t, e ]);
4288
4288
  r.push([ t, e ]);
@@ -4292,7 +4292,7 @@ function(t, e, n, r, i) {
4292
4292
  * Remove this key from the map. Returns a boolean if anything was deleted.
4293
4293
  */
4294
4294
  t.prototype.delete = function(t) {
4295
- var e = this.wi(t), n = this.Ii[e];
4295
+ var e = this.Ei(t), n = this.Ii[e];
4296
4296
  if (void 0 === n) return !1;
4297
4297
  for (var r = 0; r < n.length; r++) if (n[r][0].isEqual(t)) return 1 === n.length ? delete this.Ii[e] : n.splice(r, 1),
4298
4298
  !0;
@@ -4380,9 +4380,9 @@ function(t, e, n, r, i) {
4380
4380
  return t.add(e.key);
4381
4381
  }), Qt());
4382
4382
  }, t.prototype.isEqual = function(t) {
4383
- return this.batchId === t.batchId && Ee(this.mutations, t.mutations, (function(t, e) {
4383
+ return this.batchId === t.batchId && Ie(this.mutations, t.mutations, (function(t, e) {
4384
4384
  return t.isEqual(e);
4385
- })) && Ee(this.baseMutations, t.baseMutations, (function(t, e) {
4385
+ })) && Ie(this.baseMutations, t.baseMutations, (function(t, e) {
4386
4386
  return t.isEqual(e);
4387
4387
  }));
4388
4388
  }, t;
@@ -4408,16 +4408,16 @@ function(t, e, n, r, i) {
4408
4408
  }(), Re = /** @class */ function() {
4409
4409
  function t() {
4410
4410
  // A set of outstanding references to a document sorted by key.
4411
- this.pi = new A(Ve.Ee),
4411
+ this.pi = new A(Le.we),
4412
4412
  // A set of outstanding references to a document sorted by target id.
4413
- this.yi = new A(Ve.bi)
4413
+ this.yi = new A(Le.bi)
4414
4414
  /** Returns true if the reference set contains no references. */;
4415
4415
  }
4416
4416
  return t.prototype.U = function() {
4417
4417
  return this.pi.U();
4418
4418
  },
4419
4419
  /** Adds a reference to the given document key for the given ID. */ t.prototype.vi = function(t, e) {
4420
- var n = new Ve(t, e);
4420
+ var n = new Le(t, e);
4421
4421
  this.pi = this.pi.add(n), this.yi = this.yi.add(n);
4422
4422
  },
4423
4423
  /** Add references to the given document keys for the given ID. */ t.prototype.Si = function(t, e) {
@@ -4431,7 +4431,7 @@ function(t, e, n, r, i) {
4431
4431
  * ID.
4432
4432
  */
4433
4433
  t.prototype.Di = function(t, e) {
4434
- this.Ci(new Ve(t, e));
4434
+ this.Ci(new Le(t, e));
4435
4435
  }, t.prototype.ki = function(t, e) {
4436
4436
  var n = this;
4437
4437
  t.forEach((function(t) {
@@ -4443,7 +4443,7 @@ function(t, e, n, r, i) {
4443
4443
  * removed.
4444
4444
  */
4445
4445
  t.prototype.Ni = function(t) {
4446
- var e = this, n = T.EMPTY, r = new Ve(n, t), i = new Ve(n, t + 1), o = [];
4446
+ var e = this, n = T.EMPTY, r = new Le(n, t), i = new Le(n, t + 1), o = [];
4447
4447
  return this.yi.Ct([ r, i ], (function(t) {
4448
4448
  e.Ci(t), o.push(t.key);
4449
4449
  })), o;
@@ -4455,26 +4455,26 @@ function(t, e, n, r, i) {
4455
4455
  }, t.prototype.Ci = function(t) {
4456
4456
  this.pi = this.pi.delete(t), this.yi = this.yi.delete(t);
4457
4457
  }, t.prototype.$i = function(t) {
4458
- var e = T.EMPTY, n = new Ve(e, t), r = new Ve(e, t + 1), i = Qt();
4458
+ var e = T.EMPTY, n = new Le(e, t), r = new Le(e, t + 1), i = Qt();
4459
4459
  return this.yi.Ct([ n, r ], (function(t) {
4460
4460
  i = i.add(t.key);
4461
4461
  })), i;
4462
4462
  }, t.prototype.Mi = function(t) {
4463
- var e = new Ve(t, 0), n = this.pi.Nt(e);
4463
+ var e = new Le(t, 0), n = this.pi.Nt(e);
4464
4464
  return null !== n && t.isEqual(n.key);
4465
4465
  }, t;
4466
- }(), Ve = /** @class */ function() {
4466
+ }(), Le = /** @class */ function() {
4467
4467
  function t(t, e) {
4468
4468
  this.key = t, this.Li = e
4469
4469
  /** Compare by key then by ID */;
4470
4470
  }
4471
- return t.Ee = function(t, e) {
4472
- return T.F(t.key, e.key) || Ie(t.Li, e.Li);
4471
+ return t.we = function(t, e) {
4472
+ return T.F(t.key, e.key) || Ee(t.Li, e.Li);
4473
4473
  },
4474
4474
  /** Compare by ID then by key */ t.bi = function(t, e) {
4475
- return Ie(t.Li, e.Li) || T.F(t.key, e.key);
4475
+ return Ee(t.Li, e.Li) || T.F(t.key, e.key);
4476
4476
  }, t;
4477
- }(), Le = /** @class */ function() {
4477
+ }(), Ue = /** @class */ function() {
4478
4478
  function t(t) {
4479
4479
  var e = this;
4480
4480
  // NOTE: next/catchCallback will always point to our own wrapper functions,
@@ -4569,7 +4569,7 @@ function(t, e, n, r, i) {
4569
4569
  r.push(e.call(n, t, i));
4570
4570
  })), this.Ki(r);
4571
4571
  }, t;
4572
- }(), Ue = /** @class */ function() {
4572
+ }(), Ve = /** @class */ function() {
4573
4573
  function t() {
4574
4574
  // A mapping of document key to the new cache entry that should be written (or null if any
4575
4575
  // existing cache entry should be removed).
@@ -4619,7 +4619,7 @@ function(t, e, n, r, i) {
4619
4619
  t.prototype.tr = function(t, e) {
4620
4620
  this.Xi();
4621
4621
  var n = this.zi.get(e);
4622
- return void 0 !== n ? Le.resolve(n) : this.er(t, e);
4622
+ return void 0 !== n ? Ue.resolve(n) : this.er(t, e);
4623
4623
  },
4624
4624
  /**
4625
4625
  * Looks up several entries in the cache, forwarding to
@@ -4708,7 +4708,7 @@ function(t, e, n, r, i) {
4708
4708
  */
4709
4709
  t.prototype.mr = function(t, e) {
4710
4710
  var n = this;
4711
- return this.ar.Er(t, e).next((function(r) {
4711
+ return this.ar.wr(t, e).next((function(r) {
4712
4712
  var i = n.dr(t, e, r), o = jt();
4713
4713
  return i.forEach((function(t, e) {
4714
4714
  // TODO(http://b/32275378): Don't conflate missing / deleted.
@@ -4724,7 +4724,7 @@ function(t, e, n, r, i) {
4724
4724
  * @param sinceReadTime If not set to SnapshotVersion.MIN, return only
4725
4725
  * documents that have been read since this snapshot version (exclusive).
4726
4726
  */
4727
- t.prototype.wr = function(t, e, n) {
4727
+ t.prototype.Er = function(t, e, n) {
4728
4728
  return e.Pe() ? this.Ir(t, e.path) : e.He() ? this.Rr(t, e, n) : this.Ar(t, e, n);
4729
4729
  }, t.prototype.Ir = function(t, e) {
4730
4730
  // Just do a simple document lookup.
@@ -4735,7 +4735,7 @@ function(t, e, n, r, i) {
4735
4735
  }, t.prototype.Rr = function(t, e, n) {
4736
4736
  var r = this, i = e.collectionGroup, o = zt();
4737
4737
  return this.ur.Pr(t, i).next((function(s) {
4738
- return Le.forEach(s, (function(s) {
4738
+ return Ue.forEach(s, (function(s) {
4739
4739
  var u = e.Le(s.child(i));
4740
4740
  return r.Ar(t, u, n).next((function(t) {
4741
4741
  t.forEach((function(t, e) {
@@ -4749,7 +4749,7 @@ function(t, e, n, r, i) {
4749
4749
  }, t.prototype.Ar = function(t, e, n) {
4750
4750
  var r, i, o = this;
4751
4751
  // Query the remote documents and overlay mutations.
4752
- return this.hr.wr(t, e, n).next((function(n) {
4752
+ return this.hr.Er(t, e, n).next((function(n) {
4753
4753
  return r = n, o.ar.Vr(t, e);
4754
4754
  })).next((function(e) {
4755
4755
  return i = e, o.gr(t, i, r).next((function(t) {
@@ -5130,8 +5130,8 @@ var Fe = function() {
5130
5130
  * limitations under the License.
5131
5131
  */
5132
5132
  function Be(t, e) {
5133
- var n = t[0], r = t[1], i = e[0], o = e[1], s = Ie(n, i);
5134
- return 0 === s ? Ie(r, o) : s;
5133
+ var n = t[0], r = t[1], i = e[0], o = e[1], s = Ee(n, i);
5134
+ return 0 === s ? Ee(r, o) : s;
5135
5135
  }
5136
5136
 
5137
5137
  /**
@@ -5178,7 +5178,7 @@ function Be(t, e) {
5178
5178
  // A cap on the total number of sequence numbers that will be collected. This prevents
5179
5179
  // us from collecting a huge number of sequence numbers if the cache has grown very large.
5180
5180
  n) {
5181
- this.mo = t, this.Eo = e, this.wo = n;
5181
+ this.mo = t, this.wo = e, this.Eo = n;
5182
5182
  }
5183
5183
  return t.Io = function(e) {
5184
5184
  return new t(e, t.Ro, t.Ao);
@@ -5226,7 +5226,7 @@ var Ye = /** @class */ function() {
5226
5226
  },
5227
5227
  /** Returns the nth sequence number, counting in order from the smallest. */ t.prototype.Lo = function(t, e) {
5228
5228
  var n = this;
5229
- if (0 === e) return Le.resolve(qe.kr);
5229
+ if (0 === e) return Ue.resolve(qe.kr);
5230
5230
  var r = new ze(e);
5231
5231
  return this.Fo.Xs(t, (function(t) {
5232
5232
  return r._o(t.sequenceNumber);
@@ -5254,7 +5254,7 @@ var Ye = /** @class */ function() {
5254
5254
  }, t.prototype.Uo = function(t, e) {
5255
5255
  var n = this;
5256
5256
  return this.Do.mo === We.Po ? (ve("LruGarbageCollector", "Garbage collection skipped; disabled"),
5257
- Le.resolve(Ke)) : this.qo(t).next((function(r) {
5257
+ Ue.resolve(Ke)) : this.qo(t).next((function(r) {
5258
5258
  return r < n.Do.mo ? (ve("LruGarbageCollector", "Garbage collection skipped; Cache size " + r + " is lower than threshold " + n.Do.mo),
5259
5259
  Ke) : n.Qo(t, e);
5260
5260
  }));
@@ -5262,17 +5262,17 @@ var Ye = /** @class */ function() {
5262
5262
  return this.Fo.qo(t);
5263
5263
  }, t.prototype.Qo = function(t, e) {
5264
5264
  var n, i, o, s, u, a, h, c = this, f = Date.now();
5265
- return this.$o(t, this.Do.Eo).next((function(e) {
5265
+ return this.$o(t, this.Do.wo).next((function(e) {
5266
5266
  // Cap at the configured max
5267
- return e > c.Do.wo ? (ve("LruGarbageCollector", "Capping sequence numbers to collect down to the maximum of " + c.Do.wo + " from " + e),
5268
- i = c.Do.wo) : i = e, s = Date.now(), c.Lo(t, i);
5267
+ return e > c.Do.Eo ? (ve("LruGarbageCollector", "Capping sequence numbers to collect down to the maximum of " + c.Do.Eo + " from " + e),
5268
+ i = c.Do.Eo) : i = e, s = Date.now(), c.Lo(t, i);
5269
5269
  })).next((function(r) {
5270
5270
  return n = r, u = Date.now(), c.xo(t, n, e);
5271
5271
  })).next((function(e) {
5272
5272
  return o = e, a = Date.now(), c.Bo(t, n);
5273
5273
  })).next((function(t) {
5274
5274
  return h = Date.now(), ye() <= r.LogLevel.DEBUG && ve("LruGarbageCollector", "LRU Garbage Collection\n\tCounted targets in " + (s - f) + "ms\n\tDetermined least recently used " + i + " in " + (u - s) + "ms\n\tRemoved " + o + " targets in " + (a - u) + "ms\n\tRemoved " + t + " documents in " + (h - a) + "ms\nTotal Duration: " + (h - f) + "ms"),
5275
- Le.resolve({
5275
+ Ue.resolve({
5276
5276
  lo: !0,
5277
5277
  do: i,
5278
5278
  fo: o,
@@ -5280,7 +5280,7 @@ var Ye = /** @class */ function() {
5280
5280
  });
5281
5281
  }));
5282
5282
  }, t;
5283
- }(), Je = /** @class */ function() {
5283
+ }(), Xe = /** @class */ function() {
5284
5284
  function t(
5285
5285
  /** Manages our in-memory or durable persistence. */
5286
5286
  t, e, n) {
@@ -5295,7 +5295,7 @@ var Ye = /** @class */ function() {
5295
5295
  * PORTING NOTE: We are using an immutable data structure on Web to make re-runs
5296
5296
  * of `applyRemoteEvent()` idempotent.
5297
5297
  */
5298
- this.Ko = new I(Ie),
5298
+ this.Ko = new E(Ee),
5299
5299
  /** Maps a target to its targetID. */
5300
5300
  // TODO(wuandy): Evaluate if TargetId can be part of Target.
5301
5301
  this.Go = new De((function(t) {
@@ -5411,7 +5411,7 @@ var Ye = /** @class */ function() {
5411
5411
  var e = this;
5412
5412
  return this.persistence.runTransaction("Lookup mutation documents", "readonly", (function(n) {
5413
5413
  return e.ar.Th(n, t).next((function(t) {
5414
- return t ? e.sh.Tr(n, t) : Le.resolve(null);
5414
+ return t ? e.sh.Tr(n, t) : Ue.resolve(null);
5415
5415
  }));
5416
5416
  }));
5417
5417
  },
@@ -5432,8 +5432,8 @@ var Ye = /** @class */ function() {
5432
5432
  t.prototype.mh = function(t) {
5433
5433
  var e = this;
5434
5434
  return this.persistence.runTransaction("Acknowledge batch", "readwrite-primary", (function(n) {
5435
- var r = t.batch.keys(), i = e.Xo.Eh({
5436
- wh: !0
5435
+ var r = t.batch.keys(), i = e.Xo.wh({
5436
+ Eh: !0
5437
5437
  });
5438
5438
  return e.ar.mh(n, t.batch, t.streamToken).next((function() {
5439
5439
  return e.Ih(n, t, i);
@@ -5513,8 +5513,8 @@ var Ye = /** @class */ function() {
5513
5513
  t.prototype.vh = function(e) {
5514
5514
  var n = this, r = e.ts, i = this.Ko;
5515
5515
  return this.persistence.runTransaction("Apply remote event", "readwrite-primary", (function(o) {
5516
- var s = n.Xo.Eh({
5517
- wh: !0
5516
+ var s = n.Xo.wh({
5517
+ Eh: !0
5518
5518
  });
5519
5519
  // Reset newTargetDataByTargetMap in case this transaction gets re-run.
5520
5520
  i = n.Ko;
@@ -5544,13 +5544,13 @@ var Ye = /** @class */ function() {
5544
5544
  // can synthesize remote events when we get permission denied errors while
5545
5545
  // trying to resolve the state of a locally cached document that is in
5546
5546
  // limbo.
5547
- if (e.Es.forEach((function(t, e) {
5547
+ if (e.ws.forEach((function(t, e) {
5548
5548
  h = h.add(t);
5549
5549
  })),
5550
5550
  // Each loop iteration only affects its "own" doc, so it's safe to get all the remote
5551
5551
  // documents in advance in a single call.
5552
5552
  u.push(s.getEntries(o, h).next((function(t) {
5553
- e.Es.forEach((function(i, h) {
5553
+ e.ws.forEach((function(i, h) {
5554
5554
  var c = t.get(i);
5555
5555
  // Note: The order of the steps below is important, since we want
5556
5556
  // to ensure that rejected limbo resolutions (which fabricate
@@ -5562,7 +5562,7 @@ var Ye = /** @class */ function() {
5562
5562
  // access.
5563
5563
  s.Zi(i, r), a = a.it(i, h)) : null == c || h.version.D(c.version) > 0 || 0 === h.version.D(c.version) && c.hasPendingWrites ? (s.Yi(h, r),
5564
5564
  a = a.it(i, h)) : ve("LocalStore", "Ignoring outdated watch update for ", i, ". Current version:", c.version, " Watch version:", h.version),
5565
- e.ws.has(i) && u.push(n.persistence.Jo.Fh(o, i));
5565
+ e.Es.has(i) && u.push(n.persistence.Jo.Fh(o, i));
5566
5566
  }));
5567
5567
  }))), !r.isEqual(v.MIN)) {
5568
5568
  var c = n.th.bh(o).next((function(t) {
@@ -5570,7 +5570,7 @@ var Ye = /** @class */ function() {
5570
5570
  }));
5571
5571
  u.push(c);
5572
5572
  }
5573
- return Le.Ki(u).next((function() {
5573
+ return Ue.Ki(u).next((function() {
5574
5574
  return s.apply(o);
5575
5575
  })).next((function() {
5576
5576
  return n.sh.mr(o, a);
@@ -5613,8 +5613,8 @@ var Ye = /** @class */ function() {
5613
5613
  }
5614
5614
  }
5615
5615
  return this.persistence.runTransaction("notifyLocalViewChanges", "readwrite", (function(n) {
5616
- return Le.forEach(t, (function(t) {
5617
- return Le.forEach(t.yr, (function(t) {
5616
+ return Ue.forEach(t, (function(t) {
5617
+ return Ue.forEach(t.yr, (function(t) {
5618
5618
  return e.persistence.Jo.Di(n, t);
5619
5619
  }));
5620
5620
  }));
@@ -5659,7 +5659,7 @@ var Ye = /** @class */ function() {
5659
5659
  // This target has been listened to previously, so reuse the
5660
5660
  // previous targetID.
5661
5661
  // TODO(mcg): freshen last accessed date?
5662
- r = i, Le.resolve(r)) : e.th.Qh(n).next((function(i) {
5662
+ r = i, Ue.resolve(r)) : e.th.Qh(n).next((function(i) {
5663
5663
  return r = new Pt(t, i, 0 /* Listen */ , n.Ch), e.th.Wh(n, r).next((function() {
5664
5664
  return r;
5665
5665
  }));
@@ -5677,7 +5677,7 @@ var Ye = /** @class */ function() {
5677
5677
  // Visible for testing.
5678
5678
  t.prototype.qh = function(t, e) {
5679
5679
  var n = this.Go.get(e);
5680
- return void 0 !== n ? Le.resolve(this.Ko.get(n)) : this.th.qh(t, e);
5680
+ return void 0 !== n ? Ue.resolve(this.Ko.get(n)) : this.th.qh(t, e);
5681
5681
  },
5682
5682
  /**
5683
5683
  * Unpin all the documents associated with the given target. If
@@ -5701,7 +5701,7 @@ var Ye = /** @class */ function() {
5701
5701
  // transaction fails since there are no side effects if the target has
5702
5702
  // already been removed.
5703
5703
  var o = n.jo.Ni(t);
5704
- return e ? Le.resolve() : Le.forEach(o, (function(t) {
5704
+ return e ? Ue.resolve() : Ue.forEach(o, (function(t) {
5705
5705
  return n.persistence.Jo.Di(i, t);
5706
5706
  })).next((function() {
5707
5707
  n.persistence.Jo.removeTarget(i, r);
@@ -5726,7 +5726,7 @@ var Ye = /** @class */ function() {
5726
5726
  i = t;
5727
5727
  }));
5728
5728
  })).next((function() {
5729
- return n.Wo.wr(o, t, e ? r : v.MIN, e ? i : Qt());
5729
+ return n.Wo.Er(o, t, e ? r : v.MIN, e ? i : Qt());
5730
5730
  })).next((function(t) {
5731
5731
  return {
5732
5732
  documents: t,
@@ -5757,7 +5757,7 @@ var Ye = /** @class */ function() {
5757
5757
  t.prototype.Zh = function(t) {
5758
5758
  this.persistence.Zh(t);
5759
5759
  }, t.prototype.Ih = function(t, e, n) {
5760
- var r = this, i = e.batch, o = i.keys(), s = Le.resolve();
5760
+ var r = this, i = e.batch, o = i.keys(), s = Ue.resolve();
5761
5761
  return o.forEach((function(r) {
5762
5762
  s = s.next((function() {
5763
5763
  return n.tr(t, r);
@@ -5876,7 +5876,7 @@ function He(t) {
5876
5876
  * Forward the magic "arguments" variable as second parameter on which the
5877
5877
  * parameter validation is performed:
5878
5878
  * validateNoArgs('myFunction', arguments);
5879
- */ function Xe(t, e) {
5879
+ */ function Je(t, e) {
5880
5880
  if (0 !== e.length) throw new c(h.INVALID_ARGUMENT, "Function " + t + "() does not support arguments, but was called with " + yn(e.length, "argument") + ".");
5881
5881
  }
5882
5882
 
@@ -6124,7 +6124,7 @@ function vn() {
6124
6124
  *
6125
6125
  * Note that while you can't hide the constructor in JavaScript code, we are
6126
6126
  * using the hack above to make sure no-one outside this module can call it.
6127
- */ Je.Mh = 3e8;
6127
+ */ Xe.Mh = 3e8;
6128
6128
 
6129
6129
  var wn = /** @class */ function() {
6130
6130
  function t(t) {
@@ -6191,14 +6191,14 @@ bn.ha = new bn(b.X().K());
6191
6191
  /**
6192
6192
  * Matches any characters in a field path string that are reserved.
6193
6193
  */
6194
- var Tn = new RegExp("[~\\*/\\[\\]]"), In = /** @class */ function() {
6194
+ var Tn = new RegExp("[~\\*/\\[\\]]"), En = /** @class */ function() {
6195
6195
  function t(t) {
6196
6196
  this.aa = t;
6197
6197
  }
6198
6198
  return t.delete = function() {
6199
- return Xe("FieldValue.delete", arguments), En.instance;
6199
+ return Je("FieldValue.delete", arguments), In.instance;
6200
6200
  }, t.serverTimestamp = function() {
6201
- return Xe("FieldValue.serverTimestamp", arguments), Nn.instance;
6201
+ return Je("FieldValue.serverTimestamp", arguments), Nn.instance;
6202
6202
  }, t.arrayUnion = function() {
6203
6203
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
6204
6204
  // NOTE: We don't actually parse the data until it's used in set() or
@@ -6215,12 +6215,12 @@ var Tn = new RegExp("[~\\*/\\[\\]]"), In = /** @class */ function() {
6215
6215
  }, t.prototype.isEqual = function(t) {
6216
6216
  return this === t;
6217
6217
  }, t;
6218
- }(), En = /** @class */ function(t) {
6218
+ }(), In = /** @class */ function(t) {
6219
6219
  function n() {
6220
6220
  return t.call(this, "FieldValue.delete") || this;
6221
6221
  }
6222
6222
  return e.__extends(n, t), n;
6223
- }(In);
6223
+ }(En);
6224
6224
 
6225
6225
  /**
6226
6226
  * Parses a field path string into a FieldPath, treating dots as separators.
@@ -6245,14 +6245,14 @@ var Tn = new RegExp("[~\\*/\\[\\]]"), In = /** @class */ function() {
6245
6245
  * An opaque base class for FieldValue sentinel objects in our public API,
6246
6246
  * with public static methods for creating said sentinel objects.
6247
6247
  */
6248
- /** Singleton instance. */ En.instance = new En;
6248
+ /** Singleton instance. */ In.instance = new In;
6249
6249
 
6250
6250
  var Nn = /** @class */ function(t) {
6251
6251
  function n() {
6252
6252
  return t.call(this, "FieldValue.serverTimestamp") || this;
6253
6253
  }
6254
6254
  return e.__extends(n, t), n;
6255
- }(In);
6255
+ }(En);
6256
6256
 
6257
6257
  /** Singleton instance. */ Nn.instance = new Nn;
6258
6258
 
@@ -6262,19 +6262,19 @@ var An = /** @class */ function(t) {
6262
6262
  return (n = t.call(this, "FieldValue.arrayUnion") || this).ua = e, n;
6263
6263
  }
6264
6264
  return e.__extends(n, t), n;
6265
- }(In), Sn = /** @class */ function(t) {
6265
+ }(En), Sn = /** @class */ function(t) {
6266
6266
  function n(e) {
6267
6267
  var n = this;
6268
6268
  return (n = t.call(this, "FieldValue.arrayRemove") || this).ua = e, n;
6269
6269
  }
6270
6270
  return e.__extends(n, t), n;
6271
- }(In), Dn = /** @class */ function(t) {
6271
+ }(En), Dn = /** @class */ function(t) {
6272
6272
  function n(e) {
6273
6273
  var n = this;
6274
6274
  return (n = t.call(this, "FieldValue.increment") || this).ca = e, n;
6275
6275
  }
6276
6276
  return e.__extends(n, t), n;
6277
- }(In), kn = mn(In, "Use FieldValue.<field>() instead."), xn = /** @class */ function() {
6277
+ }(En), kn = mn(En, "Use FieldValue.<field>() instead."), xn = /** @class */ function() {
6278
6278
  function t(t, e) {
6279
6279
  if (Ze("GeoPoint", arguments, 2), en("GeoPoint", "number", 1, t), en("GeoPoint", "number", 2, e),
6280
6280
  !isFinite(t) || t < -90 || t > 90) throw new c(h.INVALID_ARGUMENT, "Latitude must be a number between -90 and 90, but was: " + t);
@@ -6307,9 +6307,9 @@ var An = /** @class */ function(t) {
6307
6307
  * with an underscore.
6308
6308
  */
6309
6309
  t.prototype.p = function(t) {
6310
- return Ie(this._a, t._a) || Ie(this.la, t.la);
6310
+ return Ee(this._a, t._a) || Ee(this.la, t.la);
6311
6311
  }, t;
6312
- }(), Rn = /^__.*__$/, Vn = /** @class */ function() {
6312
+ }(), Rn = /^__.*__$/, Ln = /** @class */ function() {
6313
6313
  function t(t, e, n) {
6314
6314
  this.data = t, this.se = e, this.fieldTransforms = n;
6315
6315
  }
@@ -6318,7 +6318,7 @@ var An = /** @class */ function(t) {
6318
6318
  return null !== this.se ? n.push(new ct(t, this.data, this.se, e)) : n.push(new ht(t, this.data, e)),
6319
6319
  this.fieldTransforms.length > 0 && n.push(new ft(t, this.fieldTransforms)), n;
6320
6320
  }, t;
6321
- }(), Ln = /** @class */ function() {
6321
+ }(), Un = /** @class */ function() {
6322
6322
  function t(t, e, n) {
6323
6323
  this.data = t, this.se = e, this.fieldTransforms = n;
6324
6324
  }
@@ -6329,7 +6329,7 @@ var An = /** @class */ function(t) {
6329
6329
  }, t;
6330
6330
  }();
6331
6331
 
6332
- function Un(t) {
6332
+ function Vn(t) {
6333
6333
  switch (t) {
6334
6334
  case 0 /* Set */ :
6335
6335
  // fall through
@@ -6377,10 +6377,10 @@ function Un(t) {
6377
6377
  void 0 === i && this.ma(), this.Ta = void 0 !== r && r, this.fieldTransforms = i || [],
6378
6378
  this.se = o || [];
6379
6379
  }
6380
- return t.prototype.Ea = function(e) {
6380
+ return t.prototype.wa = function(e) {
6381
6381
  var n = null == this.path ? null : this.path.child(e), r = new t(this.fa, this.methodName, n,
6382
6382
  /*arrayElement=*/ !1, this.fieldTransforms, this.se);
6383
- return r.wa(e), r;
6383
+ return r.Ea(e), r;
6384
6384
  }, t.prototype.Ia = function(e) {
6385
6385
  var n = null == this.path ? null : this.path.child(e), r = new t(this.fa, this.methodName, n,
6386
6386
  /*arrayElement=*/ !1, this.fieldTransforms, this.se);
@@ -6404,10 +6404,10 @@ function Un(t) {
6404
6404
  }, t.prototype.ma = function() {
6405
6405
  // TODO(b/34871131): Remove null check once we have proper paths for fields
6406
6406
  // within arrays.
6407
- if (null !== this.path) for (var t = 0; t < this.path.length; t++) this.wa(this.path.get(t));
6408
- }, t.prototype.wa = function(t) {
6407
+ if (null !== this.path) for (var t = 0; t < this.path.length; t++) this.Ea(this.path.get(t));
6408
+ }, t.prototype.Ea = function(t) {
6409
6409
  if (0 === t.length) throw this.Aa("Document fields must not be empty");
6410
- if (Un(this.fa) && Rn.test(t)) throw this.Aa('Document fields cannot begin and end with "__"');
6410
+ if (Vn(this.fa) && Rn.test(t)) throw this.Aa('Document fields cannot begin and end with "__"');
6411
6411
  }, t;
6412
6412
  }(), Pn = function(t, e) {
6413
6413
  this.cn = t, this.key = e;
@@ -6420,7 +6420,7 @@ function Un(t) {
6420
6420
  var n = new On(0 /* Set */ , t, b.H);
6421
6421
  qn("Data must be an object, but it was:", n, e);
6422
6422
  var r = this.ga(e, n);
6423
- return new Vn(new dt(r),
6423
+ return new Ln(new dt(r),
6424
6424
  /* fieldMask= */ null, n.fieldTransforms);
6425
6425
  },
6426
6426
  /** Parse document data from a set() call with '{merge:true}'. */ t.prototype.pa = function(t, e, n) {
@@ -6441,7 +6441,7 @@ function Un(t) {
6441
6441
  return i.zt(t.field);
6442
6442
  }));
6443
6443
  } else i = it.Gt(r.se), o = r.fieldTransforms;
6444
- return new Vn(new dt(s), i, o);
6444
+ return new Ln(new dt(s), i, o);
6445
6445
  },
6446
6446
  /** Parse update data from an update() call. */ t.prototype.ya = function(t, e) {
6447
6447
  var n = this, r = new On(1 /* Update */ , t, b.H);
@@ -6449,7 +6449,7 @@ function Un(t) {
6449
6449
  var i = new A(b.F), o = dt._e();
6450
6450
  k(e, (function(e, s) {
6451
6451
  var u = jn(t, e), a = r.Ia(u);
6452
- if ((s = n.ba(s, a)) instanceof En)
6452
+ if ((s = n.ba(s, a)) instanceof In)
6453
6453
  // Add it to the field mask, but don't add anything to updateData.
6454
6454
  i = i.add(u); else {
6455
6455
  var h = n.va(s, a);
@@ -6457,7 +6457,7 @@ function Un(t) {
6457
6457
  }
6458
6458
  }));
6459
6459
  var s = it.Kt(i);
6460
- return new Ln(o.oe(), s, r.fieldTransforms);
6460
+ return new Un(o.oe(), s, r.fieldTransforms);
6461
6461
  },
6462
6462
  /** Parse update data from a list of field/value arguments. */ t.prototype.Sa = function(t, e, n, r) {
6463
6463
  var i = new On(1 /* Update */ , t, b.H), o = [ Fn(t, e) ], s = [ n ];
@@ -6465,7 +6465,7 @@ function Un(t) {
6465
6465
  for (var u = 0; u < r.length; u += 2) o.push(Fn(t, r[u])), s.push(r[u + 1]);
6466
6466
  for (var a = new A(b.F), f = dt._e(), l = 0; l < o.length; ++l) {
6467
6467
  var p = o[l], d = i.Ia(p), y = this.ba(s[l], d);
6468
- if (y instanceof En)
6468
+ if (y instanceof In)
6469
6469
  // Add it to the field mask, but don't add anything to updateData.
6470
6470
  a = a.add(p); else {
6471
6471
  var m = this.va(y, d);
@@ -6473,7 +6473,7 @@ function Un(t) {
6473
6473
  }
6474
6474
  }
6475
6475
  var v = it.Kt(a);
6476
- return new Ln(f.oe(), v, i.fieldTransforms);
6476
+ return new Un(f.oe(), v, i.fieldTransforms);
6477
6477
  },
6478
6478
  /**
6479
6479
  * Parse a "query value" (e.g. value in a where filter or a value in a cursor
@@ -6506,7 +6506,7 @@ function Un(t) {
6506
6506
  */
6507
6507
  t.prototype.va = function(t, e) {
6508
6508
  if (Mn(t = this.ba(t, e))) return qn("Unsupported field value:", e, t), this.ga(t, e);
6509
- if (t instanceof In)
6509
+ if (t instanceof En)
6510
6510
  // FieldValues usually parse into transforms (except FieldValue.delete())
6511
6511
  // in which case we do not want to include this field in our parsed data
6512
6512
  // (as doing so will overwrite the field directly prior to the transform
@@ -6533,7 +6533,7 @@ function Un(t) {
6533
6533
  // If we encounter an empty object, we explicitly add it to the update
6534
6534
  // mask to ensure that the server creates a map entry.
6535
6535
  e.path && e.path.length > 0 && e.se.push(e.path) : k(t, (function(t, i) {
6536
- var o = n.va(i, e.Ea(t));
6536
+ var o = n.va(i, e.wa(t));
6537
6537
  null != o && (r[t] = o);
6538
6538
  })), {
6539
6539
  mapValue: {
@@ -6562,9 +6562,9 @@ function Un(t) {
6562
6562
  */
6563
6563
  t.prototype.Ca = function(t, e) {
6564
6564
  // Sentinels are only supported with writes, and not within arrays.
6565
- if (!Un(e.fa)) throw e.Aa(t.aa + "() can only be used with update() and set()");
6565
+ if (!Vn(e.fa)) throw e.Aa(t.aa + "() can only be used with update() and set()");
6566
6566
  if (null === e.path) throw e.Aa(t.aa + "() is not currently supported inside arrays");
6567
- if (t instanceof En) {
6567
+ if (t instanceof In) {
6568
6568
  if (2 /* MergeSet */ !== e.fa) throw 1 /* Update */ === e.fa ? e.Aa("FieldValue.delete() can only appear at the top level of your update data") : e.Aa("FieldValue.delete() cannot be used with set() unless you pass {merge:true}");
6569
6569
  // No transform to add for a delete, but we need to add it to our
6570
6570
  // fieldMask so it gets deleted.
@@ -6621,7 +6621,7 @@ function Un(t) {
6621
6621
  bytesValue: this.serializer.mn(t)
6622
6622
  };
6623
6623
  if (t instanceof Pn) return {
6624
- referenceValue: this.serializer.wn(t.key.path, t.cn)
6624
+ referenceValue: this.serializer.En(t.key.path, t.cn)
6625
6625
  };
6626
6626
  throw e.Aa("Unsupported field value: " + hn(t));
6627
6627
  }, t.prototype.Fa = function(t, e) {
@@ -6649,7 +6649,7 @@ function Un(t) {
6649
6649
  * to specific FieldValue types other than ObjectValue.
6650
6650
  */
6651
6651
  function Mn(t) {
6652
- return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof m || t instanceof xn || t instanceof wn || t instanceof Pn || t instanceof In);
6652
+ return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof m || t instanceof xn || t instanceof wn || t instanceof Pn || t instanceof En);
6653
6653
  }
6654
6654
 
6655
6655
  function qn(t, e, n) {
@@ -7061,7 +7061,7 @@ function qn(t, e, n) {
7061
7061
  */
7062
7062
  s.lastStreamToken = R.xt, s;
7063
7063
  }
7064
- return e.__extends(n, t), Object.defineProperty(n.prototype, "Eu", {
7064
+ return e.__extends(n, t), Object.defineProperty(n.prototype, "wu", {
7065
7065
  /**
7066
7066
  * Tracks whether or not a handshake has been successfully exchanged and
7067
7067
  * the stream is ready to accept mutations.
@@ -7076,13 +7076,13 @@ function qn(t, e, n) {
7076
7076
  n.prototype.start = function() {
7077
7077
  this.mu = !1, t.prototype.start.call(this);
7078
7078
  }, n.prototype.ru = function() {
7079
- this.mu && this.wu([]);
7079
+ this.mu && this.Eu([]);
7080
7080
  }, n.prototype.cu = function(t) {
7081
7081
  return this.Ka.lu("Write", t);
7082
7082
  }, n.prototype.onMessage = function(t) {
7083
7083
  if (
7084
7084
  // Always capture the last stream token.
7085
- be(!!t.streamToken, "Got a write response without a stream token"), this.lastStreamToken = this.serializer.En(t.streamToken),
7085
+ be(!!t.streamToken, "Got a write response without a stream token"), this.lastStreamToken = this.serializer.wn(t.streamToken),
7086
7086
  this.mu) {
7087
7087
  // A successful first write response means the stream is healthy,
7088
7088
  // Note, that we could consider a successful handshake healthy, however,
@@ -7106,7 +7106,7 @@ function qn(t, e, n) {
7106
7106
  var t = {};
7107
7107
  t.database = this.serializer.pn, this.nu(t);
7108
7108
  },
7109
- /** Sends a group of mutations to the Firestore backend to apply. */ n.prototype.wu = function(t) {
7109
+ /** Sends a group of mutations to the Firestore backend to apply. */ n.prototype.Eu = function(t) {
7110
7110
  var e = this, n = {
7111
7111
  streamToken: this.serializer.mn(this.lastStreamToken),
7112
7112
  writes: t.map((function(t) {
@@ -7288,7 +7288,7 @@ function qn(t, e, n) {
7288
7288
  }, t.prototype.write = function(t) {
7289
7289
  this.ku(), this.mutations = this.mutations.concat(t);
7290
7290
  }, t.prototype.ku = function() {}, t;
7291
- }(), Jn = /** @class */ function() {
7291
+ }(), Xn = /** @class */ function() {
7292
7292
  function t(t, e) {
7293
7293
  this.Nr = t, this.$u = e,
7294
7294
  /** The current OnlineState. */
@@ -7417,7 +7417,7 @@ function qn(t, e, n) {
7417
7417
  }));
7418
7418
  }));
7419
7419
  }));
7420
- })), this.Xu = new Jn(r, i),
7420
+ })), this.Xu = new Xn(r, i),
7421
7421
  // Create streams (but note they're not started yet).
7422
7422
  this.Zu = this.bu.Vu({
7423
7423
  _u: this.tc.bind(this),
@@ -7593,11 +7593,11 @@ function qn(t, e, n) {
7593
7593
  switch (e.label) {
7594
7594
  case 0:
7595
7595
  // Mark the client as online since we got a message from the server
7596
- return this.Xu.set("Online" /* Online */), t instanceof ie && 2 /* Removed */ === t.state && t.cause ? [ 2 /*return*/ , this.Ec(t) ] : (t instanceof ne ? this.Gu.zs(t) : t instanceof re ? this.Gu.sn(t) : this.Gu.Ys(t),
7596
+ return this.Xu.set("Online" /* Online */), t instanceof ie && 2 /* Removed */ === t.state && t.cause ? [ 2 /*return*/ , this.wc(t) ] : (t instanceof ne ? this.Gu.zs(t) : t instanceof re ? this.Gu.sn(t) : this.Gu.Ys(t),
7597
7597
  n.isEqual(v.MIN) ? [ 3 /*break*/ , 4 ] : [ 4 /*yield*/ , this.Wu.bh() ]);
7598
7598
 
7599
7599
  case 1:
7600
- return r = e.sent(), n.D(r) >= 0 ? [ 4 /*yield*/ , this.wc(n) ] : [ 3 /*break*/ , 3 ];
7600
+ return r = e.sent(), n.D(r) >= 0 ? [ 4 /*yield*/ , this.Ec(n) ] : [ 3 /*break*/ , 3 ];
7601
7601
 
7602
7602
  // We have received a target change with a global snapshot if the snapshot
7603
7603
  // version is not equal to SnapshotVersion.MIN.
@@ -7620,7 +7620,7 @@ function qn(t, e, n) {
7620
7620
  * RemoteEvent, and passes that on to the listener, which is typically the
7621
7621
  * SyncEngine.
7622
7622
  */
7623
- t.prototype.wc = function(t) {
7623
+ t.prototype.Ec = function(t) {
7624
7624
  var e = this, n = this.Gu.rn(t);
7625
7625
  // Update in-memory resume tokens. LocalStore will update the
7626
7626
  // persistent view of these when applying the completed RemoteEvent.
@@ -7652,7 +7652,7 @@ function qn(t, e, n) {
7652
7652
  }
7653
7653
  })), this.mc.vh(n);
7654
7654
  },
7655
- /** Handles an error on a target */ t.prototype.Ec = function(t) {
7655
+ /** Handles an error on a target */ t.prototype.wc = function(t) {
7656
7656
  var n = this, r = t.cause, i = Promise.resolve();
7657
7657
  return t.targetIds.forEach((function(t) {
7658
7658
  i = i.then((function() {
@@ -7718,7 +7718,7 @@ function qn(t, e, n) {
7718
7718
  * immediately if the write stream is established.
7719
7719
  */
7720
7720
  t.prototype.Ac = function(t) {
7721
- this.ju.push(t), this.nc.Xa() && this.nc.Eu && this.nc.wu(t.mutations);
7721
+ this.ju.push(t), this.nc.Xa() && this.nc.wu && this.nc.Eu(t.mutations);
7722
7722
  }, t.prototype.Pc = function() {
7723
7723
  return this.Ju() && !this.nc.Ya() && this.ju.length > 0;
7724
7724
  }, t.prototype.Vc = function() {
@@ -7736,7 +7736,7 @@ function qn(t, e, n) {
7736
7736
  // Send the write pipeline now that the stream is established.
7737
7737
  for (var e = 0, n = t.ju; e < n.length; e++) {
7738
7738
  var r = n[e];
7739
- t.nc.wu(r.mutations);
7739
+ t.nc.Eu(r.mutations);
7740
7740
  }
7741
7741
  })).catch(He);
7742
7742
  }, t.prototype.Iu = function(t, e) {
@@ -7750,7 +7750,7 @@ function qn(t, e, n) {
7750
7750
  return e.__generator(this, (function(e) {
7751
7751
  // If the write stream closed due to an error, invoke the error callbacks if
7752
7752
  // there are pending writes.
7753
- return t && this.ju.length > 0 ? [ 2 /*return*/ , (n = this.nc.Eu ? this.yc(t) : this.bc(t),
7753
+ return t && this.ju.length > 0 ? [ 2 /*return*/ , (n = this.nc.wu ? this.yc(t) : this.bc(t),
7754
7754
  n.then((function() {
7755
7755
  // The write stream might have been started by refilling the write
7756
7756
  // pipeline for failed writes
@@ -7915,7 +7915,7 @@ function qn(t, e, n) {
7915
7915
  // The format of the LocalStorage key that stores the client state is:
7916
7916
  // firestore_clients_<persistence_prefix>_<instance_key>
7917
7917
  /** Assembles the key for a client state in WebStorage */
7918
- function Xn(t, e) {
7918
+ function Jn(t, e) {
7919
7919
  return "firestore_clients_" + t + "_" + e;
7920
7920
  }
7921
7921
 
@@ -7999,7 +7999,7 @@ var tr = /** @class */ function() {
7999
7999
  */;
8000
8000
  }
8001
8001
  return t.kc = function(e, n) {
8002
- for (var r = JSON.parse(n), i = "object" == typeof r && r.activeTargetIds instanceof Array, o = Ht(), s = 0; i && s < r.activeTargetIds.length; ++s) i = U(r.activeTargetIds[s]),
8002
+ for (var r = JSON.parse(n), i = "object" == typeof r && r.activeTargetIds instanceof Array, o = Ht(), s = 0; i && s < r.activeTargetIds.length; ++s) i = V(r.activeTargetIds[s]),
8003
8003
  o = o.add(r.activeTargetIds[s]);
8004
8004
  return i ? new t(e, o) : (ge("SharedClientState", "Failed to parse client data for instance '" + e + "': " + n),
8005
8005
  null);
@@ -8049,7 +8049,7 @@ var tr = /** @class */ function() {
8049
8049
  // Escape the special characters mentioned here:
8050
8050
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
8051
8051
  var s = r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
8052
- this.storage = this.platform.window.localStorage, this.currentUser = o, this.qc = Xn(this.persistenceKey, this.Mc),
8052
+ this.storage = this.platform.window.localStorage, this.currentUser = o, this.qc = Jn(this.persistenceKey, this.Mc),
8053
8053
  this.Qc =
8054
8054
  /** Assembles the key for the current sequence number. */
8055
8055
  function(t) {
@@ -8080,7 +8080,7 @@ var tr = /** @class */ function() {
8080
8080
  return [ 4 /*yield*/ , this.mc.Jh() ];
8081
8081
 
8082
8082
  case 1:
8083
- for (t = e.sent(), n = 0, r = t; n < r.length; n++) (i = r[n]) !== this.Mc && (o = this.getItem(Xn(this.persistenceKey, i))) && (s = nr.kc(i, o)) && (this.Lc[s.clientId] = s);
8083
+ for (t = e.sent(), n = 0, r = t; n < r.length; n++) (i = r[n]) !== this.Mc && (o = this.getItem(Jn(this.persistenceKey, i))) && (s = nr.kc(i, o)) && (this.Lc[s.clientId] = s);
8084
8084
  for (this.zc(), (u = this.storage.getItem(this.Gc)) && (a = this.Hc(u)) && this.Jc(a),
8085
8085
  h = 0, c = this.Bc; h < c.length; h++) f = c[h], this.xc(f);
8086
8086
  return this.Bc = [],
@@ -8166,7 +8166,7 @@ var tr = /** @class */ function() {
8166
8166
  } else if (this.jc.test(t.key)) {
8167
8167
  if (null !== t.newValue && (i = this.T_(t.key, t.newValue))) return [ 2 /*return*/ , this.m_(i) ];
8168
8168
  } else if (this.Kc.test(t.key)) {
8169
- if (null !== t.newValue && (o = this.E_(t.key, t.newValue))) return [ 2 /*return*/ , this.w_(o) ];
8169
+ if (null !== t.newValue && (o = this.w_(t.key, t.newValue))) return [ 2 /*return*/ , this.E_(o) ];
8170
8170
  } else if (t.key === this.Gc) {
8171
8171
  if (null !== t.newValue && (s = this.Hc(t.newValue))) return [ 2 /*return*/ , this.Jc(s) ];
8172
8172
  } else t.key === this.Qc && (u = function(t) {
@@ -8237,7 +8237,7 @@ var tr = /** @class */ function() {
8237
8237
  * Parses a query target state from WebStorage. Returns 'null' if the value
8238
8238
  * could not be parsed.
8239
8239
  */
8240
- t.prototype.E_ = function(t, e) {
8240
+ t.prototype.w_ = function(t, e) {
8241
8241
  var n = this.Kc.exec(t), r = Number(n[1]);
8242
8242
  return er.kc(r, e);
8243
8243
  },
@@ -8254,7 +8254,7 @@ var tr = /** @class */ function() {
8254
8254
  [ 2 /*return*/ ]);
8255
8255
  }));
8256
8256
  }));
8257
- }, t.prototype.w_ = function(t) {
8257
+ }, t.prototype.E_ = function(t) {
8258
8258
  return this.mc.R_(t.targetId, t.state, t.error);
8259
8259
  }, t.prototype.d_ = function(t, n) {
8260
8260
  var r = this, i = this.Yc();
@@ -8345,7 +8345,7 @@ var tr = /** @class */ function() {
8345
8345
  /** Documents in the view but not in the remote target */
8346
8346
  this.S_ = Qt(),
8347
8347
  /** Document Keys that have local changes */
8348
- this._s = Qt(), this.D_ = new Xt(t.Be.bind(t));
8348
+ this._s = Qt(), this.D_ = new Jt(t.Be.bind(t));
8349
8349
  }
8350
8350
  return Object.defineProperty(t.prototype, "C_", {
8351
8351
  /**
@@ -8596,7 +8596,7 @@ var tr = /** @class */ function() {
8596
8596
  }, t.prototype.z_ = function(t) {
8597
8597
  try {
8598
8598
  var e = this.updateFunction(t);
8599
- return !V(e) && e.catch && e.then ? e : (this.Lr.reject(Error("Transaction callback must return a Promise")),
8599
+ return !L(e) && e.catch && e.then ? e : (this.Lr.reject(Error("Transaction callback must return a Promise")),
8600
8600
  null);
8601
8601
  } catch (t) {
8602
8602
  // Do not retry errors thrown by user provided updateFunction.
@@ -8660,7 +8660,7 @@ n) {
8660
8660
  * Keeps track of the target ID for each document that is in limbo with an
8661
8661
  * active target.
8662
8662
  */
8663
- this.il = new I(T.F),
8663
+ this.il = new E(T.F),
8664
8664
  /**
8665
8665
  * Keeps track of the information about an active limbo resolution for each
8666
8666
  * active target ID that was started for the purpose of limbo resolution.
@@ -8819,7 +8819,7 @@ n) {
8819
8819
  return this._l("write()"), [ 4 /*yield*/ , this.Wu.lh(t) ];
8820
8820
 
8821
8821
  case 1:
8822
- return r = e.sent(), this.X_.Zc(r.batchId), this.ml(r.batchId, n), [ 4 /*yield*/ , this.El(r.zi) ];
8822
+ return r = e.sent(), this.X_.Zc(r.batchId), this.ml(r.batchId, n), [ 4 /*yield*/ , this.wl(r.zi) ];
8823
8823
 
8824
8824
  case 2:
8825
8825
  return e.sent(), [ 4 /*yield*/ , this.W_.uc() ];
@@ -8871,7 +8871,7 @@ n) {
8871
8871
  be(t.Ps.size + t.Vs.size + t.gs.size <= 1, "Limbo resolution for single document contains multiple changes."),
8872
8872
  t.Ps.size > 0 ? n.Y_ = !0 : t.Vs.size > 0 ? be(n.Y_, "Received change for limbo target document without add.") : t.gs.size > 0 && (be(n.Y_, "Received remove for limbo target document without add."),
8873
8873
  n.Y_ = !1));
8874
- })), [ 4 /*yield*/ , this.El(n, t) ];
8874
+ })), [ 4 /*yield*/ , this.wl(n, t) ];
8875
8875
 
8876
8876
  case 3:
8877
8877
  // Update `receivedDocument` as appropriate for any limbo targets.
@@ -8904,7 +8904,7 @@ n) {
8904
8904
  this.el.forEach((function(e, r) {
8905
8905
  var i = r.view.B_(t);
8906
8906
  i.snapshot && n.push(i.snapshot);
8907
- })), this.tl.wl(t), this.tl.du(n), this.onlineState = t, this.isPrimary && this.X_.c_(t);
8907
+ })), this.tl.El(t), this.tl.du(n), this.onlineState = t, this.isPrimary && this.X_.c_(t);
8908
8908
  }
8909
8909
  }, t.prototype.Ic = function(t, n) {
8910
8910
  return e.__awaiter(this, void 0, void 0, (function() {
@@ -8917,10 +8917,10 @@ n) {
8917
8917
  this.X_.a_(t, "rejected", n), r = this.rl.get(t), (i = r && r.key) ? (
8918
8918
  // Since this query failed, we won't want to manually unlisten to it.
8919
8919
  // So go ahead and remove it from bookkeeping.
8920
- this.il = this.il.remove(i), this.rl.delete(t), this.Il(), o = (o = new I(T.F)).it(i, new gt(i, v.S())),
8920
+ this.il = this.il.remove(i), this.rl.delete(t), this.Il(), o = (o = new E(T.F)).it(i, new gt(i, v.S())),
8921
8921
  s = Qt().add(i), u = new te(v.MIN,
8922
8922
  /* targetChanges= */ new Map,
8923
- /* targetMismatches= */ new A(Ie), o, s), [ 2 /*return*/ , this.vh(u) ]) : [ 4 /*yield*/ , this.Wu.jh(t, /* keepPersistedTargetData */ !1).then((function() {
8923
+ /* targetMismatches= */ new A(Ee), o, s), [ 2 /*return*/ , this.vh(u) ]) : [ 4 /*yield*/ , this.Wu.jh(t, /* keepPersistedTargetData */ !1).then((function() {
8924
8924
  return a.Tl(t, n);
8925
8925
  })).catch(He) ];
8926
8926
 
@@ -8955,7 +8955,7 @@ n) {
8955
8955
  this.Rl(t, r || null), this.Wu.Yh(t)) : _e("Unknown batchState: " + n), e.label = 4;
8956
8956
 
8957
8957
  case 4:
8958
- return [ 4 /*yield*/ , this.El(i) ];
8958
+ return [ 4 /*yield*/ , this.wl(i) ];
8959
8959
 
8960
8960
  case 5:
8961
8961
  return e.sent(), [ 3 /*break*/ , 7 ];
@@ -8992,7 +8992,7 @@ n) {
8992
8992
  return e.trys.push([ 1, 4, , 6 ]), [ 4 /*yield*/ , this.Wu.mh(t) ];
8993
8993
 
8994
8994
  case 2:
8995
- return r = e.sent(), this.X_.e_(n, "acknowledged"), [ 4 /*yield*/ , this.El(r) ];
8995
+ return r = e.sent(), this.X_.e_(n, "acknowledged"), [ 4 /*yield*/ , this.wl(r) ];
8996
8996
 
8997
8997
  case 3:
8998
8998
  return e.sent(), [ 3 /*break*/ , 6 ];
@@ -9025,7 +9025,7 @@ n) {
9025
9025
  return e.trys.push([ 1, 4, , 6 ]), [ 4 /*yield*/ , this.Wu.Ah(t) ];
9026
9026
 
9027
9027
  case 2:
9028
- return r = e.sent(), this.X_.e_(t, "rejected", n), [ 4 /*yield*/ , this.El(r) ];
9028
+ return r = e.sent(), this.X_.e_(t, "rejected", n), [ 4 /*yield*/ , this.wl(r) ];
9029
9029
 
9030
9030
  case 3:
9031
9031
  return e.sent(), [ 3 /*break*/ , 6 ];
@@ -9079,7 +9079,7 @@ n) {
9079
9079
  })), this.al.clear();
9080
9080
  }, t.prototype.ml = function(t, e) {
9081
9081
  var n = this.hl[this.currentUser.s()];
9082
- n || (n = new I(Ie)), n = n.it(t, e), this.hl[this.currentUser.s()] = n;
9082
+ n || (n = new E(Ee)), n = n.it(t, e), this.hl[this.currentUser.s()] = n;
9083
9083
  },
9084
9084
  /**
9085
9085
  * Resolves or rejects the user callback for the given batch and then discards
@@ -9147,7 +9147,7 @@ n) {
9147
9147
  // Visible for testing
9148
9148
  t.prototype.vl = function() {
9149
9149
  return this.nl;
9150
- }, t.prototype.El = function(t, n) {
9150
+ }, t.prototype.wl = function(t, n) {
9151
9151
  return e.__awaiter(this, void 0, void 0, (function() {
9152
9152
  var r, i, o, s = this;
9153
9153
  return e.__generator(this, (function(e) {
@@ -9196,7 +9196,7 @@ n) {
9196
9196
  case 1:
9197
9197
  return r = e.sent(),
9198
9198
  // TODO(b/114226417): Consider calling this only in the primary tab.
9199
- this.X_.oh(t, r.uh, r._h), [ 4 /*yield*/ , this.El(r.ah) ];
9199
+ this.X_.oh(t, r.uh, r._h), [ 4 /*yield*/ , this.wl(r.ah) ];
9200
9200
 
9201
9201
  case 2:
9202
9202
  // TODO(b/114226417): Consider calling this only in the primary tab.
@@ -9257,7 +9257,7 @@ n) {
9257
9257
  var t = this;
9258
9258
  this.rl.forEach((function(e, n) {
9259
9259
  t.W_.fc(n);
9260
- })), this.ol.Fi(), this.rl = new Map, this.il = new I(T.F);
9260
+ })), this.ol.Fi(), this.rl = new Map, this.il = new E(T.F);
9261
9261
  },
9262
9262
  /**
9263
9263
  * Reconcile the query views of the provided query targets with the state from
@@ -9374,7 +9374,7 @@ n) {
9374
9374
  return [ 4 /*yield*/ , this.Wu.ea() ];
9375
9375
 
9376
9376
  case 3:
9377
- return i = e.sent(), o = te.Is(t, "current" === n), [ 4 /*yield*/ , this.El(i, o) ];
9377
+ return i = e.sent(), o = te.Is(t, "current" === n), [ 4 /*yield*/ , this.wl(i, o) ];
9378
9378
 
9379
9379
  case 4:
9380
9380
  return e.sent(), [ 3 /*break*/ , 8 ];
@@ -9518,7 +9518,7 @@ n) {
9518
9518
  // Remove all listeners. NOTE: We don't need to call syncEngine.unlisten()
9519
9519
  // after an error.
9520
9520
  this.Fl.delete(t);
9521
- }, t.prototype.wl = function(t) {
9521
+ }, t.prototype.El = function(t) {
9522
9522
  this.onlineState = t;
9523
9523
  var e = !1;
9524
9524
  this.Fl.forEach((function(n, r) {
@@ -9606,7 +9606,7 @@ n) {
9606
9606
  function t() {}
9607
9607
  return t.prototype.ih = function(t) {
9608
9608
  this.Gl = t;
9609
- }, t.prototype.wr = function(t, e, n, i) {
9609
+ }, t.prototype.Er = function(t, e, n, i) {
9610
9610
  var o = this;
9611
9611
  // Queries that match all documents don't benefit from using
9612
9612
  // IndexFreeQueries. It is more efficient to scan all documents in a
@@ -9614,7 +9614,7 @@ n) {
9614
9614
  return e.Oe() || n.isEqual(v.MIN) ? this.zl(t, e) : this.Gl.Tr(t, i).next((function(s) {
9615
9615
  var u = o.Hl(e, s);
9616
9616
  return (e.je() || e.Ke()) && o.M_(e.ge, u, i, n) ? o.zl(t, e) : (ye() <= r.LogLevel.DEBUG && ve("IndexFreeQueryEngine", "Re-using previous result from %s to execute query: %s", n.toString(), e.toString()),
9617
- o.Gl.wr(t, e, n).next((function(t) {
9617
+ o.Gl.Er(t, e, n).next((function(t) {
9618
9618
  // We merge `previousResults` into `updateResults`, since
9619
9619
  // `updateResults` is already a DocumentMap. If a document is
9620
9620
  // contained in both lists, then its contents are the same.
@@ -9663,7 +9663,7 @@ n) {
9663
9663
  return !!i && (i.hasPendingWrites || i.version.D(r) > 0);
9664
9664
  }, t.prototype.zl = function(t, e) {
9665
9665
  return ye() <= r.LogLevel.DEBUG && ve("IndexFreeQueryEngine", "Using full collection scan to execute query: %s", e.toString()),
9666
- this.Gl.wr(t, e, v.MIN);
9666
+ this.Gl.Er(t, e, v.MIN);
9667
9667
  }, t;
9668
9668
  }();
9669
9669
 
@@ -9784,7 +9784,7 @@ function wr(t) {
9784
9784
  * since .then() continuations are executed asynchronously (e.g. via
9785
9785
  * .setImmediate), which would cause IndexedDB to end the transaction.
9786
9786
  * See PersistencePromise for more details.
9787
- */ var Ir = /** @class */ function() {
9787
+ */ var Er = /** @class */ function() {
9788
9788
  function t(e) {
9789
9789
  this.db = e,
9790
9790
  // NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the
@@ -9802,7 +9802,7 @@ function wr(t) {
9802
9802
  */;
9803
9803
  }
9804
9804
  return t.Yl = function(e, n, r) {
9805
- return ve("SimpleDb", "Opening database:", e), new Le((function(i, o) {
9805
+ return ve("SimpleDb", "Opening database:", e), new Ue((function(i, o) {
9806
9806
  // TODO(mikelehen): Investigate browser compatibility.
9807
9807
  // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB
9808
9808
  // suggests IE9 and older WebKit browsers handle upgrade
@@ -9899,7 +9899,7 @@ function wr(t) {
9899
9899
  // caller.
9900
9900
  return e.trys.push([ 1, 3, , 4 ]), s = r(t).catch((function(e) {
9901
9901
  // Abort the transaction if there was an error.
9902
- return t.abort(e), Le.reject(e);
9902
+ return t.abort(e), Ue.reject(e);
9903
9903
  })).Wi(), a = {}, s.catch((function() {})), [ 4 /*yield*/ , t.nd ];
9904
9904
 
9905
9905
  case 2:
@@ -9939,7 +9939,7 @@ function wr(t) {
9939
9939
  }, t.prototype.close = function() {
9940
9940
  this.db.close();
9941
9941
  }, t;
9942
- }(), Er = /** @class */ function() {
9942
+ }(), Ir = /** @class */ function() {
9943
9943
  function t(t) {
9944
9944
  this.rd = t, this.od = !1, this.hd = null;
9945
9945
  }
@@ -10098,9 +10098,9 @@ function wr(t) {
10098
10098
  * The provided callback should return `true` to continue iteration, and
10099
10099
  * `false` otherwise.
10100
10100
  */
10101
- t.prototype.Ed = function(t) {
10101
+ t.prototype.wd = function(t) {
10102
10102
  var e = this.cursor({});
10103
- return new Le((function(n, r) {
10103
+ return new Ue((function(n, r) {
10104
10104
  e.onerror = function(t) {
10105
10105
  var e = kr(t.target.error);
10106
10106
  r(e);
@@ -10113,16 +10113,16 @@ function wr(t) {
10113
10113
  }));
10114
10114
  }, t.prototype.dd = function(t, e) {
10115
10115
  var n = [];
10116
- return new Le((function(r, i) {
10116
+ return new Ue((function(r, i) {
10117
10117
  t.onerror = function(t) {
10118
10118
  i(t.target.error);
10119
10119
  }, t.onsuccess = function(t) {
10120
10120
  var i = t.target.result;
10121
10121
  if (i) {
10122
- var o = new Er(i), s = e(i.primaryKey, i.value, o);
10123
- if (s instanceof Le) {
10122
+ var o = new Ir(i), s = e(i.primaryKey, i.value, o);
10123
+ if (s instanceof Ue) {
10124
10124
  var u = s.catch((function(t) {
10125
- return o.done(), Le.reject(t);
10125
+ return o.done(), Ue.reject(t);
10126
10126
  }));
10127
10127
  n.push(u);
10128
10128
  }
@@ -10130,7 +10130,7 @@ function wr(t) {
10130
10130
  } else r();
10131
10131
  };
10132
10132
  })).next((function() {
10133
- return Le.Ki(n);
10133
+ return Ue.Ki(n);
10134
10134
  }));
10135
10135
  }, t.prototype.options = function(t, e) {
10136
10136
  var n = void 0;
@@ -10158,7 +10158,7 @@ function wr(t) {
10158
10158
  * handlers to resolve / reject the PersistencePromise as appropriate.
10159
10159
  */
10160
10160
  function Sr(t) {
10161
- return new Le((function(e, n) {
10161
+ return new Ue((function(e, n) {
10162
10162
  t.onsuccess = function(t) {
10163
10163
  var n = t.target.result;
10164
10164
  e(n);
@@ -10173,7 +10173,7 @@ function Sr(t) {
10173
10173
  var Dr = !1;
10174
10174
 
10175
10175
  function kr(t) {
10176
- var e = Ir.Jl(i.getUA());
10176
+ var e = Er.Jl(i.getUA());
10177
10177
  if (e >= 12.2 && e < 13) {
10178
10178
  var n = "An internal error was encountered in the Indexed Database server";
10179
10179
  if (t.message.indexOf(n) >= 0) {
@@ -10226,7 +10226,7 @@ function kr(t) {
10226
10226
  * view of the documents that were previously affected by the mutation.
10227
10227
  */
10228
10228
  // PORTING NOTE: Multi-tab only.
10229
- this.wd = {}
10229
+ this.Ed = {}
10230
10230
  /**
10231
10231
  * Creates a new mutation queue for the given user.
10232
10232
  * @param user The user for which to create a mutation queue.
@@ -10241,7 +10241,7 @@ function kr(t) {
10241
10241
  return be("" !== e.uid, "UserID must not be an empty string."), new t(e.t() ? e.uid : "", n, r, i);
10242
10242
  }, t.prototype.Rd = function(t) {
10243
10243
  var e = !0, n = IDBKeyRange.bound([ this.userId, Number.NEGATIVE_INFINITY ], [ this.userId, Number.POSITIVE_INFINITY ]);
10244
- return Lr(t).md({
10244
+ return Ur(t).md({
10245
10245
  index: $r.userMutationsIndex,
10246
10246
  range: n
10247
10247
  }, (function(t, n, r) {
@@ -10266,7 +10266,7 @@ function kr(t) {
10266
10266
  return n.lastStreamToken = e.toBase64(), Or(t).put(n);
10267
10267
  }));
10268
10268
  }, t.prototype.dh = function(t, e, n, r) {
10269
- var i = this, o = Ur(t), s = Lr(t);
10269
+ var i = this, o = Vr(t), s = Ur(t);
10270
10270
  // The IndexedDb implementation in Chrome (and Firefox) does not handle
10271
10271
  // compound indices that include auto-generated keys correctly. To ensure
10272
10272
  // that the index entry is added correctly in all browsers, we perform two
@@ -10279,7 +10279,7 @@ function kr(t) {
10279
10279
  return s.add({}).next((function(u) {
10280
10280
  be("number" == typeof u, "Auto-generated key is not a number");
10281
10281
  for (var a = new ke(u, e, n, r), h = i.serializer.Pd(i.userId, a), c = [], f = new A((function(t, e) {
10282
- return Ie(t.K(), e.K());
10282
+ return Ee(t.K(), e.K());
10283
10283
  })), l = 0, p = r; l < p.length; l++) {
10284
10284
  var d = p[l], y = ti.key(i.userId, d.key.path, u);
10285
10285
  f = f.add(d.key.path.L()), c.push(s.put(h)), c.push(o.put(y, ti.PLACEHOLDER));
@@ -10287,29 +10287,29 @@ function kr(t) {
10287
10287
  return f.forEach((function(e) {
10288
10288
  c.push(i.ur.Vd(t, e));
10289
10289
  })), t.rr((function() {
10290
- i.wd[u] = a.keys();
10291
- })), Le.Ki(c).next((function() {
10290
+ i.Ed[u] = a.keys();
10291
+ })), Ue.Ki(c).next((function() {
10292
10292
  return a;
10293
10293
  }));
10294
10294
  }));
10295
10295
  }, t.prototype.Ph = function(t, e) {
10296
10296
  var n = this;
10297
- return Lr(t).get(e).next((function(t) {
10297
+ return Ur(t).get(e).next((function(t) {
10298
10298
  return t ? (be(t.userId === n.userId, "Unexpected user '" + t.userId + "' for mutation batch " + e),
10299
10299
  n.serializer.gd(t)) : null;
10300
10300
  }));
10301
10301
  }, t.prototype.Th = function(t, e) {
10302
10302
  var n = this;
10303
- return this.wd[e] ? Le.resolve(this.wd[e]) : this.Ph(t, e).next((function(t) {
10303
+ return this.Ed[e] ? Ue.resolve(this.Ed[e]) : this.Ph(t, e).next((function(t) {
10304
10304
  if (t) {
10305
10305
  var r = t.keys();
10306
- return n.wd[e] = r, r;
10306
+ return n.Ed[e] = r, r;
10307
10307
  }
10308
10308
  return null;
10309
10309
  }));
10310
10310
  }, t.prototype.xh = function(t, e) {
10311
10311
  var n = this, r = e + 1, i = IDBKeyRange.lowerBound([ this.userId, r ]), o = null;
10312
- return Lr(t).md({
10312
+ return Ur(t).md({
10313
10313
  index: $r.userMutationsIndex,
10314
10314
  range: i
10315
10315
  }, (function(t, e, i) {
@@ -10320,7 +10320,7 @@ function kr(t) {
10320
10320
  }));
10321
10321
  }, t.prototype.gh = function(t) {
10322
10322
  var e = IDBKeyRange.upperBound([ this.userId, Number.POSITIVE_INFINITY ]), n = -1;
10323
- return Lr(t).md({
10323
+ return Ur(t).md({
10324
10324
  index: $r.userMutationsIndex,
10325
10325
  range: e,
10326
10326
  reverse: !0
@@ -10331,7 +10331,7 @@ function kr(t) {
10331
10331
  }));
10332
10332
  }, t.prototype.hh = function(t) {
10333
10333
  var e = this, n = IDBKeyRange.bound([ this.userId, -1 ], [ this.userId, Number.POSITIVE_INFINITY ]);
10334
- return Lr(t).ld($r.userMutationsIndex, n).next((function(t) {
10334
+ return Ur(t).ld($r.userMutationsIndex, n).next((function(t) {
10335
10335
  return t.map((function(t) {
10336
10336
  return e.serializer.gd(t);
10337
10337
  }));
@@ -10340,7 +10340,7 @@ function kr(t) {
10340
10340
  var n = this, r = ti.prefixForPath(this.userId, e.path), i = IDBKeyRange.lowerBound(r), o = [];
10341
10341
  // Scan the document-mutation index starting with a prefix starting with
10342
10342
  // the given documentKey.
10343
- return Ur(t).md({
10343
+ return Vr(t).md({
10344
10344
  range: i
10345
10345
  }, (function(r, i, s) {
10346
10346
  var u = r[0], a = r[1], h = r[2], c = Tr(a);
@@ -10353,7 +10353,7 @@ function kr(t) {
10353
10353
  // can stop as soon as we hit any such row.
10354
10354
  if (u === n.userId && e.path.isEqual(c))
10355
10355
  // Look up the mutation batch in the store.
10356
- return Lr(t).get(h).next((function(t) {
10356
+ return Ur(t).get(h).next((function(t) {
10357
10357
  if (!t) throw _e("Dangling document-mutation reference found: " + r + " which points to " + h);
10358
10358
  be(t.userId === n.userId, "Unexpected user '" + t.userId + "' for mutation batch " + h),
10359
10359
  o.push(n.serializer.gd(t));
@@ -10362,10 +10362,10 @@ function kr(t) {
10362
10362
  })).next((function() {
10363
10363
  return o;
10364
10364
  }));
10365
- }, t.prototype.Er = function(t, e) {
10366
- var n = this, r = new A(Ie), i = [];
10365
+ }, t.prototype.wr = function(t, e) {
10366
+ var n = this, r = new A(Ee), i = [];
10367
10367
  return e.forEach((function(e) {
10368
- var o = ti.prefixForPath(n.userId, e.path), s = IDBKeyRange.lowerBound(o), u = Ur(t).md({
10368
+ var o = ti.prefixForPath(n.userId, e.path), s = IDBKeyRange.lowerBound(o), u = Vr(t).md({
10369
10369
  range: s
10370
10370
  }, (function(t, i, o) {
10371
10371
  var s = t[0], u = t[1], a = t[2], h = Tr(u);
@@ -10379,12 +10379,12 @@ function kr(t) {
10379
10379
  s === n.userId && e.path.isEqual(h) ? r = r.add(a) : o.done();
10380
10380
  }));
10381
10381
  i.push(u);
10382
- })), Le.Ki(i).next((function() {
10382
+ })), Ue.Ki(i).next((function() {
10383
10383
  return n.pd(t, r);
10384
10384
  }));
10385
10385
  }, t.prototype.Vr = function(t, e) {
10386
- var n = this, r = e.path, i = r.length + 1, o = ti.prefixForPath(this.userId, r), s = IDBKeyRange.lowerBound(o), u = new A(Ie);
10387
- return Ur(t).md({
10386
+ var n = this, r = e.path, i = r.length + 1, o = ti.prefixForPath(this.userId, r), s = IDBKeyRange.lowerBound(o), u = new A(Ee);
10387
+ return Vr(t).md({
10388
10388
  range: s
10389
10389
  }, (function(t, e, o) {
10390
10390
  var s = t[0], a = t[1], h = t[2], c = Tr(a);
@@ -10402,33 +10402,33 @@ function kr(t) {
10402
10402
  var n = this, r = [], i = [];
10403
10403
  // TODO(rockwood): Implement this using iterate.
10404
10404
  return e.forEach((function(e) {
10405
- i.push(Lr(t).get(e).next((function(t) {
10405
+ i.push(Ur(t).get(e).next((function(t) {
10406
10406
  if (null === t) throw _e("Dangling document-mutation reference found, which points to " + e);
10407
10407
  be(t.userId === n.userId, "Unexpected user '" + t.userId + "' for mutation batch " + e),
10408
10408
  r.push(n.serializer.gd(t));
10409
10409
  })));
10410
- })), Le.Ki(i).next((function() {
10410
+ })), Ue.Ki(i).next((function() {
10411
10411
  return r;
10412
10412
  }));
10413
10413
  }, t.prototype.Vh = function(t, e) {
10414
10414
  var n = this;
10415
- return Vr(t.yd, this.userId, e).next((function(r) {
10415
+ return Lr(t.yd, this.userId, e).next((function(r) {
10416
10416
  return t.rr((function() {
10417
10417
  n.Xh(e.batchId);
10418
- })), Le.forEach(r, (function(e) {
10418
+ })), Ue.forEach(r, (function(e) {
10419
10419
  return n.Jo.bd(t, e);
10420
10420
  }));
10421
10421
  }));
10422
10422
  }, t.prototype.Xh = function(t) {
10423
- delete this.wd[t];
10423
+ delete this.Ed[t];
10424
10424
  }, t.prototype.Rh = function(t) {
10425
10425
  var e = this;
10426
10426
  return this.Rd(t).next((function(n) {
10427
- if (!n) return Le.resolve();
10427
+ if (!n) return Ue.resolve();
10428
10428
  // Verify that there are no entries in the documentMutations index if
10429
10429
  // the queue is empty.
10430
10430
  var r = IDBKeyRange.lowerBound(ti.prefixForUser(e.userId)), i = [];
10431
- return Ur(t).md({
10431
+ return Vr(t).md({
10432
10432
  range: r
10433
10433
  }, (function(t, n, r) {
10434
10434
  if (t[0] === e.userId) {
@@ -10460,7 +10460,7 @@ function kr(t) {
10460
10460
  * mutation for the given key.
10461
10461
  */ function Rr(t, e, n) {
10462
10462
  var r = ti.prefixForPath(e, n.path), i = r[1], o = IDBKeyRange.lowerBound(r), s = !1;
10463
- return Ur(t).md({
10463
+ return Vr(t).md({
10464
10464
  range: o,
10465
10465
  Td: !0
10466
10466
  }, (function(t, n, r) {
@@ -10476,7 +10476,7 @@ function kr(t) {
10476
10476
  /**
10477
10477
  * Delete a mutation batch and the associated document mutations.
10478
10478
  * @return A PersistencePromise of the document mutations that were removed.
10479
- */ function Vr(t, e, n) {
10479
+ */ function Lr(t, e, n) {
10480
10480
  var r = t.store($r.store), i = t.store(ti.store), o = [], s = IDBKeyRange.only(n.batchId), u = 0, a = r.md({
10481
10481
  range: s
10482
10482
  }, (function(t, e, n) {
@@ -10489,20 +10489,20 @@ function kr(t) {
10489
10489
  var l = f[c], p = ti.key(e, l.key.path, n.batchId);
10490
10490
  o.push(i.delete(p)), h.push(l.key);
10491
10491
  }
10492
- return Le.Ki(o).next((function() {
10492
+ return Ue.Ki(o).next((function() {
10493
10493
  return h;
10494
10494
  }));
10495
10495
  }
10496
10496
 
10497
10497
  /**
10498
10498
  * Helper to get a typed SimpleDbStore for the mutations object store.
10499
- */ function Lr(t) {
10499
+ */ function Ur(t) {
10500
10500
  return vi.ed(t, $r.store);
10501
10501
  }
10502
10502
 
10503
10503
  /**
10504
10504
  * Helper to get a typed SimpleDbStore for the mutationQueues object store.
10505
- */ function Ur(t) {
10505
+ */ function Vr(t) {
10506
10506
  return vi.ed(t, ti.store);
10507
10507
  }
10508
10508
 
@@ -10588,7 +10588,7 @@ function kr(t) {
10588
10588
  var a = r.serializer.$d(u);
10589
10589
  a.sequenceNumber <= e && null === n.get(a.targetId) && (i++, o.push(r.Nd(t, a)));
10590
10590
  })).next((function() {
10591
- return Le.Ki(o);
10591
+ return Ue.Ki(o);
10592
10592
  })).next((function() {
10593
10593
  return i;
10594
10594
  }));
@@ -10649,14 +10649,14 @@ function kr(t) {
10649
10649
  return e.forEach((function(e) {
10650
10650
  var s = wr(e.path);
10651
10651
  i.push(o.put(new si(n, s))), i.push(r.Jo.vi(t, e));
10652
- })), Le.Ki(i);
10652
+ })), Ue.Ki(i);
10653
10653
  }, t.prototype.Sh = function(t, e, n) {
10654
10654
  var r = this, i = Fr(t);
10655
10655
  // PORTING NOTE: The reverse index (documentsTargets) is maintained by
10656
10656
  // IndexedDb.
10657
- return Le.forEach(e, (function(e) {
10657
+ return Ue.forEach(e, (function(e) {
10658
10658
  var o = wr(e.path);
10659
- return Le.Ki([ i.delete([ n, o ]), r.Jo.Di(t, e) ]);
10659
+ return Ue.Ki([ i.delete([ n, o ]), r.Jo.Di(t, e) ]);
10660
10660
  }));
10661
10661
  }, t.prototype.Fd = function(t, e) {
10662
10662
  var n = Fr(t), r = IDBKeyRange.bound([ e ], [ e + 1 ],
@@ -10709,7 +10709,7 @@ function kr(t) {
10709
10709
  }
10710
10710
 
10711
10711
  function Mr(t) {
10712
- return Ir.ed(t, ui.store).get(ui.key).next((function(t) {
10712
+ return Er.ed(t, ui.store).get(ui.key).next((function(t) {
10713
10713
  return be(null !== t, "Missing metadata row."), t;
10714
10714
  }));
10715
10715
  }
@@ -10818,7 +10818,7 @@ function qr(t) {
10818
10818
  * key (zero if the key cannot be found).
10819
10819
  */
10820
10820
  t.prototype.Qd = function(t, e) {
10821
- var n = this, r = Gt(), i = new I(T.F);
10821
+ var n = this, r = Gt(), i = new E(T.F);
10822
10822
  return this.qd(t, e, (function(t, e) {
10823
10823
  var o = n.xd(e);
10824
10824
  o ? (r = r.it(t, o), i = i.it(t, Kr(e))) : (r = r.it(t, null), i = i.it(t, 0));
@@ -10829,24 +10829,24 @@ function qr(t) {
10829
10829
  };
10830
10830
  }));
10831
10831
  }, t.prototype.qd = function(t, e, n) {
10832
- if (e.U()) return Le.resolve();
10833
- var r = IDBKeyRange.bound(e.first().path.j(), e.last().path.j()), i = e._t(), o = i.wt();
10832
+ if (e.U()) return Ue.resolve();
10833
+ var r = IDBKeyRange.bound(e.first().path.j(), e.last().path.j()), i = e._t(), o = i.Et();
10834
10834
  return Br(t).md({
10835
10835
  range: r
10836
10836
  }, (function(t, e, r) {
10837
10837
  // Go through keys not found in cache.
10838
- for (var s = T.nt(t); o && T.F(o, s) < 0; ) n(o, null), o = i.wt();
10838
+ for (var s = T.nt(t); o && T.F(o, s) < 0; ) n(o, null), o = i.Et();
10839
10839
  o && o.isEqual(s) && (
10840
10840
  // Key found in cache.
10841
- n(o, e), o = i.It() ? i.wt() : null),
10841
+ n(o, e), o = i.It() ? i.Et() : null),
10842
10842
  // Skip to the next key (if there is one).
10843
10843
  o ? r.ud(o.path.j()) : r.done();
10844
10844
  })).next((function() {
10845
10845
  // The rest of the keys are not in the cache. One case where `iterate`
10846
10846
  // above won't go through them is when the cache is empty.
10847
- for (;o; ) n(o, null), o = i.It() ? i.wt() : null;
10847
+ for (;o; ) n(o, null), o = i.It() ? i.Et() : null;
10848
10848
  }));
10849
- }, t.prototype.wr = function(t, e, n) {
10849
+ }, t.prototype.Er = function(t, e, n) {
10850
10850
  var r = this, i = zt(), o = e.path.length + 1, s = {};
10851
10851
  if (n.isEqual(v.MIN)) {
10852
10852
  // Documents are ordered by key, so we can use a prefix scan to narrow
@@ -10900,8 +10900,8 @@ function qr(t) {
10900
10900
  })).next((function() {
10901
10901
  return r;
10902
10902
  }));
10903
- }, t.prototype.Eh = function(e) {
10904
- return new t.Hd(this, !!e && e.wh);
10903
+ }, t.prototype.wh = function(e) {
10904
+ return new t.Hd(this, !!e && e.Eh);
10905
10905
  }, t.prototype.Jd = function(t) {
10906
10906
  return this.getMetadata(t).next((function(t) {
10907
10907
  return t.byteSize;
@@ -10983,7 +10983,7 @@ function zr(t) {
10983
10983
  */
10984
10984
  function n(e, n) {
10985
10985
  var r = this;
10986
- return (r = t.call(this) || this).Yd = e, r.wh = n,
10986
+ return (r = t.call(this) || this).Yd = e, r.Eh = n,
10987
10987
  // A map of document sizes prior to applying the changes in this buffer.
10988
10988
  r.Xd = new De((function(t) {
10989
10989
  return t.toString();
@@ -10991,7 +10991,7 @@ function zr(t) {
10991
10991
  }
10992
10992
  return e.__extends(n, t), n.prototype.nr = function(t) {
10993
10993
  var e = this, n = [], r = 0, i = new A((function(t, e) {
10994
- return Ie(t.K(), e.K());
10994
+ return Ee(t.K(), e.K());
10995
10995
  }));
10996
10996
  return this.zi.forEach((function(o, s) {
10997
10997
  var u = e.Xd.get(o);
@@ -11000,7 +11000,7 @@ function zr(t) {
11000
11000
  i = i.add(o.path.L());
11001
11001
  var h = Kr(a);
11002
11002
  r += h - u, n.push(e.Yd.Yi(t, o, a));
11003
- } else if (r -= u, e.wh) {
11003
+ } else if (r -= u, e.Eh) {
11004
11004
  // In order to track removals, we store a "sentinel delete" in the
11005
11005
  // RemoteDocumentCache. This entry is represented by a NoDocument
11006
11006
  // with a version of 0 and ignored by `maybeDecodeDocument()` but
@@ -11010,7 +11010,7 @@ function zr(t) {
11010
11010
  } else n.push(e.Yd.Zi(t, o));
11011
11011
  })), i.forEach((function(r) {
11012
11012
  n.push(e.Yd.ur.Vd(t, r));
11013
- })), n.push(this.Yd.updateMetadata(t, r)), Le.Ki(n);
11013
+ })), n.push(this.Yd.updateMetadata(t, r)), Ue.Ki(n);
11014
11014
  }, n.prototype.er = function(t, e) {
11015
11015
  var n = this;
11016
11016
  // Record the size of everything we load from the cache so we can compute a delta later.
@@ -11031,16 +11031,16 @@ function zr(t) {
11031
11031
  })), e;
11032
11032
  }));
11033
11033
  }, n;
11034
- }(Ue);
11034
+ }(Ve);
11035
11035
 
11036
11036
  var Wr = /** @class */ function() {
11037
11037
  function t() {
11038
11038
  this.tf = new Yr;
11039
11039
  }
11040
11040
  return t.prototype.Vd = function(t, e) {
11041
- return this.tf.add(e), Le.resolve();
11041
+ return this.tf.add(e), Ue.resolve();
11042
11042
  }, t.prototype.Pr = function(t, e) {
11043
- return Le.resolve(this.tf.getEntries(e));
11043
+ return Ue.resolve(this.tf.getEntries(e));
11044
11044
  }, t;
11045
11045
  }(), Yr = /** @class */ function() {
11046
11046
  function t() {
@@ -11056,7 +11056,7 @@ var Wr = /** @class */ function() {
11056
11056
  }, t.prototype.getEntries = function(t) {
11057
11057
  return (this.index[t] || new A(w.F)).j();
11058
11058
  }, t;
11059
- }(), Qr = 10, Jr = /** @class */ function() {
11059
+ }(), Qr = 10, Xr = /** @class */ function() {
11060
11060
  function t(t) {
11061
11061
  this.serializer = t;
11062
11062
  }
@@ -11071,7 +11071,7 @@ var Wr = /** @class */ function() {
11071
11071
  be(n < r && n >= 0 && r <= Qr, "Unexpected schema upgrade from v" + n + " to v" + r + ".");
11072
11072
  var o = new Nr(e);
11073
11073
  n < 1 && r >= 1 && (function(t) {
11074
- t.createObjectStore(Xr.store);
11074
+ t.createObjectStore(Jr.store);
11075
11075
  }(t), function(t) {
11076
11076
  t.createObjectStore(Zr.store, {
11077
11077
  keyPath: Zr.keyPath
@@ -11086,7 +11086,7 @@ var Wr = /** @class */ function() {
11086
11086
  }(t));
11087
11087
  // Migration 2 to populate the targetGlobal object no longer needed since
11088
11088
  // migration 3 unconditionally clears it.
11089
- var s = Le.resolve();
11089
+ var s = Ue.resolve();
11090
11090
  return n < 3 && r >= 3 && (
11091
11091
  // Brand new clients don't need to drop and recreate--only clients that
11092
11092
  // potentially have corrupt data.
@@ -11124,7 +11124,7 @@ var Wr = /** @class */ function() {
11124
11124
  var r = e.store($r.store), i = n.map((function(t) {
11125
11125
  return r.put(t);
11126
11126
  }));
11127
- return Le.Ki(i);
11127
+ return Ue.Ki(i);
11128
11128
  }));
11129
11129
  }(t, o);
11130
11130
  }))), s = s.next((function() {
@@ -11171,13 +11171,13 @@ var Wr = /** @class */ function() {
11171
11171
  }, t.prototype.removeAcknowledgedMutations = function(t) {
11172
11172
  var e = this, n = t.store(Zr.store), r = t.store($r.store);
11173
11173
  return n.ld().next((function(n) {
11174
- return Le.forEach(n, (function(n) {
11174
+ return Ue.forEach(n, (function(n) {
11175
11175
  var i = IDBKeyRange.bound([ n.userId, -1 ], [ n.userId, n.lastAcknowledgedBatchId ]);
11176
11176
  return r.ld($r.userMutationsIndex, i).next((function(r) {
11177
- return Le.forEach(r, (function(r) {
11177
+ return Ue.forEach(r, (function(r) {
11178
11178
  be(r.userId === n.userId, "Cannot process batch " + r.batchId + " from unexpected user");
11179
11179
  var i = e.serializer.gd(r);
11180
- return Vr(t, n.userId, i).next((function() {}));
11180
+ return Lr(t, n.userId, i).next((function() {}));
11181
11181
  }));
11182
11182
  }));
11183
11183
  }));
@@ -11196,12 +11196,12 @@ var Wr = /** @class */ function() {
11196
11196
  return [ 0, wr(t) ];
11197
11197
  }(o);
11198
11198
  r.push(e.get(s).next((function(n) {
11199
- return n ? Le.resolve() : function(n) {
11199
+ return n ? Ue.resolve() : function(n) {
11200
11200
  return e.put(new si(0, wr(n), t));
11201
11201
  }(o);
11202
11202
  })));
11203
11203
  })).next((function() {
11204
- return Le.Ki(r);
11204
+ return Ue.Ki(r);
11205
11205
  }));
11206
11206
  }));
11207
11207
  }, t.prototype.createCollectionParentIndex = function(t, e) {
@@ -11243,7 +11243,7 @@ var Wr = /** @class */ function() {
11243
11243
  }, t;
11244
11244
  }(), Hr = function(t, e) {
11245
11245
  this.seconds = t, this.nanoseconds = e;
11246
- }, Xr = function(t,
11246
+ }, Jr = function(t,
11247
11247
  /** Whether to allow shared access from multiple tabs. */
11248
11248
  e, n) {
11249
11249
  this.ownerId = t, this.allowTabSynchronization = e, this.leaseTimestampMs = n;
@@ -11261,12 +11261,12 @@ e, n) {
11261
11261
  * older clients that only supported single locked access to the persistence
11262
11262
  * layer.
11263
11263
  */
11264
- Xr.store = "owner",
11264
+ Jr.store = "owner",
11265
11265
  /**
11266
11266
  * The key string used for the single object that exists in the
11267
11267
  * DbPrimaryClient store.
11268
11268
  */
11269
- Xr.key = "owner";
11269
+ Jr.key = "owner";
11270
11270
 
11271
11271
  var Zr = function(
11272
11272
  /**
@@ -11681,7 +11681,7 @@ r) {
11681
11681
  /** Keys are automatically assigned via the clientId properties. */
11682
11682
  ci.keyPath = "clientId";
11683
11683
 
11684
- var fi = e.__spreadArrays(e.__spreadArrays(e.__spreadArrays([ Zr.store, $r.store, ti.store, ri.store, oi.store, Xr.store, ui.store, si.store ], [ ci.store ]), [ ii.store ]), [ ai.store ]), li = /** @class */ function() {
11684
+ var fi = e.__spreadArrays(e.__spreadArrays(e.__spreadArrays([ Zr.store, $r.store, ti.store, ri.store, oi.store, Jr.store, ui.store, si.store ], [ ci.store ]), [ ii.store ]), [ ai.store ]), li = /** @class */ function() {
11685
11685
  function t() {
11686
11686
  /**
11687
11687
  * An in-memory copy of the index entries we've already written since the SDK
@@ -11713,7 +11713,7 @@ var fi = e.__spreadArrays(e.__spreadArrays(e.__spreadArrays([ Zr.store, $r.store
11713
11713
  };
11714
11714
  return pi(t).put(o);
11715
11715
  }
11716
- return Le.resolve();
11716
+ return Ue.resolve();
11717
11717
  }, t.prototype.Pr = function(t, e) {
11718
11718
  var n = [], r = IDBKeyRange.bound([ e, "" ], [ Ne(e), "" ],
11719
11719
  /*lowerOpen=*/ !1,
@@ -11888,11 +11888,22 @@ function pi(t) {
11888
11888
  this.window = i.window, this.Tf = this.window.localStorage;
11889
11889
  }
11890
11890
  return t.ed = function(t, e) {
11891
- if (t instanceof mi) return Ir.ed(t.yd, e);
11891
+ if (t instanceof mi) return Er.ed(t.yd, e);
11892
11892
  throw _e("IndexedDbPersistence must use instances of IndexedDbTransaction");
11893
- }, t.mf = function(e) {
11894
- if (!t.Uc()) throw new c(h.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
11895
- return new t(e.allowTabSynchronization, e.persistenceKey, e.clientId, e.platform, e.Ef, e.$a, e.serializer, e.rf);
11893
+ }, t.mf = function(n) {
11894
+ return e.__awaiter(this, void 0, void 0, (function() {
11895
+ var r;
11896
+ return e.__generator(this, (function(e) {
11897
+ switch (e.label) {
11898
+ case 0:
11899
+ if (!t.Uc()) throw new c(h.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
11900
+ return [ 4 /*yield*/ , (r = new t(n.allowTabSynchronization, n.persistenceKey, n.clientId, n.platform, n.wf, n.$a, n.serializer, n.rf)).start() ];
11901
+
11902
+ case 1:
11903
+ return [ 2 /*return*/ , (e.sent(), r) ];
11904
+ }
11905
+ }));
11906
+ }));
11896
11907
  },
11897
11908
  /**
11898
11909
  * Attempt to start IndexedDb persistence.
@@ -11901,10 +11912,10 @@ function pi(t) {
11901
11912
  */
11902
11913
  t.prototype.start = function() {
11903
11914
  var t = this;
11904
- return Ir.Yl(this.df, Qr, new Jr(this.serializer)).then((function(e) {
11905
- return t.wf = e, t.If();
11915
+ return Er.Yl(this.df, Qr, new Xr(this.serializer)).then((function(e) {
11916
+ return t.Ef = e, t.If();
11906
11917
  })).then((function() {
11907
- return t.Rf(), t.Af(), t.Pf(), t.wf.runTransaction("readonly", [ ui.store ], (function(t) {
11918
+ return t.Rf(), t.Af(), t.Pf(), t.Ef.runTransaction("readonly", [ ui.store ], (function(t) {
11908
11919
  return qr(t);
11909
11920
  }));
11910
11921
  })).then((function(e) {
@@ -11912,7 +11923,7 @@ function pi(t) {
11912
11923
  })).then((function() {
11913
11924
  t.hf = !0;
11914
11925
  })).catch((function(e) {
11915
- return t.wf && t.wf.close(), Promise.reject(e);
11926
+ return t.Ef && t.Ef.close(), Promise.reject(e);
11916
11927
  }));
11917
11928
  }, t.prototype.gf = function(t) {
11918
11929
  var n = this;
@@ -11925,7 +11936,7 @@ function pi(t) {
11925
11936
  }, t(this.isPrimary);
11926
11937
  }, t.prototype.pf = function(t) {
11927
11938
  var n = this;
11928
- this.wf.sd((function(r) {
11939
+ this.Ef.sd((function(r) {
11929
11940
  return e.__awaiter(n, void 0, void 0, (function() {
11930
11941
  return e.__generator(this, (function(e) {
11931
11942
  switch (e.label) {
@@ -11971,7 +11982,7 @@ function pi(t) {
11971
11982
  */
11972
11983
  t.prototype.If = function() {
11973
11984
  var t = this;
11974
- return this.wf.runTransaction("readwrite", fi, (function(e) {
11985
+ return this.Ef.runTransaction("readwrite", fi, (function(e) {
11975
11986
  return wi(e).put(new ci(t.clientId, Date.now(), t.networkEnabled, t.inForeground)).next((function() {
11976
11987
  if (t.isPrimary) return t.yf(e).next((function(e) {
11977
11988
  e || (t.isPrimary = !1, t.$a.qr((function() {
@@ -11998,8 +12009,8 @@ function pi(t) {
11998
12009
  }));
11999
12010
  }, t.prototype.yf = function(t) {
12000
12011
  var e = this;
12001
- return gi(t).get(Xr.key).next((function(t) {
12002
- return Le.resolve(e.Df(t));
12012
+ return gi(t).get(Jr.key).next((function(t) {
12013
+ return Ue.resolve(e.Df(t));
12003
12014
  }));
12004
12015
  }, t.prototype.Cf = function(t) {
12005
12016
  return wi(t).delete(this.clientId);
@@ -12023,7 +12034,7 @@ function pi(t) {
12023
12034
  return -1 === e.indexOf(t);
12024
12035
  }));
12025
12036
  // Delete metadata for clients that are no longer considered active.
12026
- return Le.forEach(i, (function(t) {
12037
+ return Ue.forEach(i, (function(t) {
12027
12038
  return r.delete(t.clientId);
12028
12039
  })).next((function() {
12029
12040
  return i;
@@ -12075,7 +12086,7 @@ function pi(t) {
12075
12086
  */
12076
12087
  t.prototype.bf = function(t) {
12077
12088
  var e = this;
12078
- return gi(t).get(Xr.key).next((function(n) {
12089
+ return gi(t).get(Jr.key).next((function(n) {
12079
12090
  // A client is eligible for the primary lease if:
12080
12091
  // - its network is enabled and the client's tab is in the foreground.
12081
12092
  // - its network is enabled and no other client's tab is in the
@@ -12125,7 +12136,7 @@ function pi(t) {
12125
12136
  // The shutdown() operations are idempotent and can be called even when
12126
12137
  // start() aborted (e.g. because it couldn't acquire the persistence lease).
12127
12138
  return this.hf = !1, this.Lf(), this.cf && (this.cf.cancel(), this.cf = null), this.Of(),
12128
- this.xf(), [ 4 /*yield*/ , this.wf.runTransaction("readwrite", [ Xr.store, ci.store ], (function(e) {
12139
+ this.xf(), [ 4 /*yield*/ , this.Ef.runTransaction("readwrite", [ Jr.store, ci.store ], (function(e) {
12129
12140
  return t.vf(e).next((function() {
12130
12141
  return t.Cf(e);
12131
12142
  }));
@@ -12134,7 +12145,7 @@ function pi(t) {
12134
12145
  case 1:
12135
12146
  // The shutdown() operations are idempotent and can be called even when
12136
12147
  // start() aborted (e.g. because it couldn't acquire the persistence lease).
12137
- return e.sent(), this.wf.close(),
12148
+ return e.sent(), this.Ef.close(),
12138
12149
  // Remove the entry marking the client as zombied from LocalStorage since
12139
12150
  // we successfully deleted its metadata from IndexedDb.
12140
12151
  this.Bf(), [ 2 /*return*/ ];
@@ -12153,7 +12164,7 @@ function pi(t) {
12153
12164
  }));
12154
12165
  }, t.prototype.Jh = function() {
12155
12166
  var t = this;
12156
- return this.wf.runTransaction("readonly", [ ci.store ], (function(e) {
12167
+ return this.Ef.runTransaction("readonly", [ ci.store ], (function(e) {
12157
12168
  return wi(e).ld().next((function(e) {
12158
12169
  return t.Ff(e, 18e5).map((function(t) {
12159
12170
  return t.clientId;
@@ -12166,7 +12177,7 @@ function pi(t) {
12166
12177
  return e.__generator(this, (function(e) {
12167
12178
  switch (e.label) {
12168
12179
  case 0:
12169
- return t.Uc() ? (r = n + t.ff, [ 4 /*yield*/ , Ir.delete(r) ]) : [ 2 /*return*/ , Promise.resolve() ];
12180
+ return t.Uc() ? (r = n + t.ff, [ 4 /*yield*/ , Er.delete(r) ]) : [ 2 /*return*/ , Promise.resolve() ];
12170
12181
 
12171
12182
  case 1:
12172
12183
  return e.sent(), [ 2 /*return*/ ];
@@ -12193,7 +12204,7 @@ function pi(t) {
12193
12204
  var i, o = "readonly" === e ? "readonly" : "readwrite";
12194
12205
  // Do all transactions as readwrite against all object stores, since we
12195
12206
  // are the only reader/writer.
12196
- return this.wf.runTransaction(o, fi, (function(o) {
12207
+ return this.Ef.runTransaction(o, fi, (function(o) {
12197
12208
  return i = new mi(o, r.Vf.next()), "readwrite-primary" === e ? r.yf(o).next((function(t) {
12198
12209
  return !!t || r.bf(o);
12199
12210
  })).next((function(e) {
@@ -12221,7 +12232,7 @@ function pi(t) {
12221
12232
  // be turned off.
12222
12233
  t.prototype.Uf = function(t) {
12223
12234
  var e = this;
12224
- return gi(t).get(Xr.key).next((function(t) {
12235
+ return gi(t).get(Jr.key).next((function(t) {
12225
12236
  if (null !== t && e.Nf(t.leaseTimestampMs, 5e3) && !e.Mf(t.ownerId) && !e.Df(t) && !t.allowTabSynchronization) throw new c(h.FAILED_PRECONDITION, yi);
12226
12237
  }));
12227
12238
  },
@@ -12230,10 +12241,10 @@ function pi(t) {
12230
12241
  * method does not verify that the client is eligible for this lease.
12231
12242
  */
12232
12243
  t.prototype.Sf = function(t) {
12233
- var e = new Xr(this.clientId, this.allowTabSynchronization, Date.now());
12234
- return gi(t).put(Xr.key, e);
12244
+ var e = new Jr(this.clientId, this.allowTabSynchronization, Date.now());
12245
+ return gi(t).put(Jr.key, e);
12235
12246
  }, t.Uc = function() {
12236
- return Ir.Uc();
12247
+ return Er.Uc();
12237
12248
  },
12238
12249
  /**
12239
12250
  * Generates a string used as a prefix when storing data in IndexedDB and
@@ -12246,12 +12257,12 @@ function pi(t) {
12246
12257
  // projectIDs are DNS-compatible names and cannot contain dots
12247
12258
  // so there's no danger of collisions.
12248
12259
  var e = t.cn.projectId;
12249
- return t.cn.Ei || (e += "." + t.cn.database), "firestore/" + t.persistenceKey + "/" + e + "/";
12260
+ return t.cn.wi || (e += "." + t.cn.database), "firestore/" + t.persistenceKey + "/" + e + "/";
12250
12261
  },
12251
12262
  /** Checks the primary lease and removes it if we are the current primary. */ t.prototype.vf = function(t) {
12252
12263
  var e = this, n = gi(t);
12253
- return n.get(Xr.key).next((function(t) {
12254
- return e.Df(t) ? (ve("IndexedDbPersistence", "Releasing primary lease."), n.delete(Xr.key)) : Le.resolve();
12264
+ return n.get(Jr.key).next((function(t) {
12265
+ return e.Df(t) ? (ve("IndexedDbPersistence", "Releasing primary lease."), n.delete(Jr.key)) : Ue.resolve();
12255
12266
  }));
12256
12267
  },
12257
12268
  /** Verifies that `updateTimeMs` is within `maxAgeMs`. */ t.prototype.Nf = function(t, e) {
@@ -12356,7 +12367,7 @@ function pi(t) {
12356
12367
  * Helper to get a typed SimpleDbStore for the primary client object store.
12357
12368
  */
12358
12369
  function gi(t) {
12359
- return t.store(Xr.store);
12370
+ return t.store(Jr.store);
12360
12371
  }
12361
12372
 
12362
12373
  /**
@@ -12409,18 +12420,18 @@ var _i = /** @class */ function() {
12409
12420
  * the collection run.
12410
12421
  */
12411
12422
  t.prototype.Kf = function(t, e) {
12412
- return this.Qf.Mi(e) ? Le.resolve(!0) : function(t, e) {
12423
+ return this.Qf.Mi(e) ? Ue.resolve(!0) : function(t, e) {
12413
12424
  var n = !1;
12414
- return Or(t).Ed((function(r) {
12425
+ return Or(t).wd((function(r) {
12415
12426
  return Rr(t, r, e).next((function(t) {
12416
- return t && (n = !0), Le.resolve(!t);
12427
+ return t && (n = !0), Ue.resolve(!t);
12417
12428
  }));
12418
12429
  })).next((function() {
12419
12430
  return n;
12420
12431
  }));
12421
12432
  }(t, e);
12422
12433
  }, t.prototype.Bo = function(t, e) {
12423
- var n = this, r = this.db.Zo().Eh(), i = [], o = 0;
12434
+ var n = this, r = this.db.Zo().wh(), i = [], o = 0;
12424
12435
  return this.jf(t, (function(s, u) {
12425
12436
  if (u <= e) {
12426
12437
  var a = n.Kf(t, s).next((function(e) {
@@ -12434,7 +12445,7 @@ var _i = /** @class */ function() {
12434
12445
  i.push(a);
12435
12446
  }
12436
12447
  })).next((function() {
12437
- return Le.Ki(i);
12448
+ return Ue.Ki(i);
12438
12449
  })).next((function() {
12439
12450
  return r.apply(t);
12440
12451
  })).next((function() {
@@ -12523,19 +12534,19 @@ function bi(t, e) {
12523
12534
  */
12524
12535
  this.lastStreamToken = R.xt,
12525
12536
  /** An ordered mapping between documents and the mutations batch IDs. */
12526
- this.zf = new A(Ve.Ee);
12537
+ this.zf = new A(Le.we);
12527
12538
  }
12528
12539
  return t.prototype.Rd = function(t) {
12529
- return Le.resolve(0 === this.ar.length);
12540
+ return Ue.resolve(0 === this.ar.length);
12530
12541
  }, t.prototype.mh = function(t, e, n) {
12531
12542
  var r = e.batchId, i = this.Hf(r, "acknowledged");
12532
12543
  return be(0 === i, "Can only acknowledge the first batch in the mutation queue"),
12533
12544
  // Verify that the batch in the queue is the one to be acknowledged.
12534
- this.ar[i], this.lastStreamToken = n, Le.resolve();
12545
+ this.ar[i], this.lastStreamToken = n, Ue.resolve();
12535
12546
  }, t.prototype.ph = function(t) {
12536
- return Le.resolve(this.lastStreamToken);
12547
+ return Ue.resolve(this.lastStreamToken);
12537
12548
  }, t.prototype.yh = function(t, e) {
12538
- return this.lastStreamToken = e, Le.resolve();
12549
+ return this.lastStreamToken = e, Ue.resolve();
12539
12550
  }, t.prototype.dh = function(t, e, n, r) {
12540
12551
  var i = this.Gf;
12541
12552
  this.Gf++, this.ar.length > 0 && this.ar[this.ar.length - 1];
@@ -12544,37 +12555,37 @@ function bi(t, e) {
12544
12555
  // Track references by document key and index collection parents.
12545
12556
  for (var s = 0, u = r; s < u.length; s++) {
12546
12557
  var a = u[s];
12547
- this.zf = this.zf.add(new Ve(a.key, i)), this.ur.Vd(t, a.key.path.L());
12558
+ this.zf = this.zf.add(new Le(a.key, i)), this.ur.Vd(t, a.key.path.L());
12548
12559
  }
12549
- return Le.resolve(o);
12560
+ return Ue.resolve(o);
12550
12561
  }, t.prototype.Ph = function(t, e) {
12551
- return Le.resolve(this.Jf(e));
12562
+ return Ue.resolve(this.Jf(e));
12552
12563
  }, t.prototype.Th = function(t, e) {
12553
12564
  var n = this.Jf(e);
12554
- return Le.resolve(n.keys());
12565
+ return Ue.resolve(n.keys());
12555
12566
  }, t.prototype.xh = function(t, e) {
12556
12567
  var n = e + 1, r = this.Yf(n), i = r < 0 ? 0 : r;
12557
12568
  // The requested batchId may still be out of range so normalize it to the
12558
12569
  // start of the queue.
12559
- return Le.resolve(this.ar.length > i ? this.ar[i] : null);
12570
+ return Ue.resolve(this.ar.length > i ? this.ar[i] : null);
12560
12571
  }, t.prototype.gh = function() {
12561
- return Le.resolve(0 === this.ar.length ? -1 : this.Gf - 1);
12572
+ return Ue.resolve(0 === this.ar.length ? -1 : this.Gf - 1);
12562
12573
  }, t.prototype.hh = function(t) {
12563
- return Le.resolve(this.ar.slice());
12574
+ return Ue.resolve(this.ar.slice());
12564
12575
  }, t.prototype._r = function(t, e) {
12565
- var n = this, r = new Ve(e, 0), i = new Ve(e, Number.POSITIVE_INFINITY), o = [];
12576
+ var n = this, r = new Le(e, 0), i = new Le(e, Number.POSITIVE_INFINITY), o = [];
12566
12577
  return this.zf.Ct([ r, i ], (function(t) {
12567
12578
  var e = n.Jf(t.Li);
12568
12579
  o.push(e);
12569
- })), Le.resolve(o);
12570
- }, t.prototype.Er = function(t, e) {
12571
- var n = this, r = new A(Ie);
12580
+ })), Ue.resolve(o);
12581
+ }, t.prototype.wr = function(t, e) {
12582
+ var n = this, r = new A(Ee);
12572
12583
  return e.forEach((function(t) {
12573
- var e = new Ve(t, 0), i = new Ve(t, Number.POSITIVE_INFINITY);
12584
+ var e = new Le(t, 0), i = new Le(t, Number.POSITIVE_INFINITY);
12574
12585
  n.zf.Ct([ e, i ], (function(t) {
12575
12586
  r = r.add(t.Li);
12576
12587
  }));
12577
- })), Le.resolve(this.Xf(r));
12588
+ })), Ue.resolve(this.Xf(r));
12578
12589
  }, t.prototype.Vr = function(t, e) {
12579
12590
  // Use the query path as a prefix for testing if a document matches the
12580
12591
  // query.
@@ -12584,7 +12595,7 @@ function bi(t, e) {
12584
12595
  // segments. The empty segment can be used a suffix of the query path
12585
12596
  // because it precedes all other segments in an ordered traversal.
12586
12597
  T.st(i) || (i = i.child(""));
12587
- var o = new Ve(new T(i), 0), s = new A(Ie);
12598
+ var o = new Le(new T(i), 0), s = new A(Ee);
12588
12599
  // Find unique batchIDs referenced by all documents potentially matching the
12589
12600
  // query.
12590
12601
  return this.zf.kt((function(t) {
@@ -12596,7 +12607,7 @@ function bi(t, e) {
12596
12607
  // TODO(mcg): we'll need a different scanner when we implement
12597
12608
  // ancestor queries.
12598
12609
  e.length === r && (s = s.add(t.Li)), !0);
12599
- }), o), Le.resolve(this.Xf(s));
12610
+ }), o), Ue.resolve(this.Xf(s));
12600
12611
  }, t.prototype.Xf = function(t) {
12601
12612
  var e = this, n = [];
12602
12613
  // Construct an array of matching batches, sorted by batchID to ensure that
@@ -12610,8 +12621,8 @@ function bi(t, e) {
12610
12621
  be(0 === this.Hf(e.batchId, "removed"), "Can only remove the first entry of the mutation queue"),
12611
12622
  this.ar.shift();
12612
12623
  var r = this.zf;
12613
- return Le.forEach(e.mutations, (function(i) {
12614
- var o = new Ve(i.key, e.batchId);
12624
+ return Ue.forEach(e.mutations, (function(i) {
12625
+ var o = new Le(i.key, e.batchId);
12615
12626
  return r = r.delete(o), n.Jo.bd(t, i.key);
12616
12627
  })).next((function() {
12617
12628
  n.zf = r;
@@ -12619,10 +12630,10 @@ function bi(t, e) {
12619
12630
  }, t.prototype.Xh = function(t) {
12620
12631
  // No-op since the memory mutation queue does not maintain a separate cache.
12621
12632
  }, t.prototype.Mi = function(t, e) {
12622
- var n = new Ve(e, 0), r = this.zf.Nt(n);
12623
- return Le.resolve(e.isEqual(r && r.key));
12633
+ var n = new Le(e, 0), r = this.zf.Nt(n);
12634
+ return Ue.resolve(e.isEqual(r && r.key));
12624
12635
  }, t.prototype.Rh = function(t) {
12625
- return this.ar.length, Le.resolve();
12636
+ return this.ar.length, Ue.resolve();
12626
12637
  },
12627
12638
  /**
12628
12639
  * Finds the index of the given batchId in the mutation queue and asserts that
@@ -12659,7 +12670,7 @@ function bi(t, e) {
12659
12670
  var e = this.Yf(t);
12660
12671
  return e < 0 || e >= this.ar.length ? null : this.ar[e];
12661
12672
  }, t;
12662
- }(), Ii = /** @class */ function() {
12673
+ }(), Ei = /** @class */ function() {
12663
12674
  /**
12664
12675
  * @param sizer Used to assess the size of a document. For eager GC, this is expected to just
12665
12676
  * return 0 to avoid unnecessarily doing the work of calculating the size.
@@ -12667,7 +12678,7 @@ function bi(t, e) {
12667
12678
  function t(t, e) {
12668
12679
  this.ur = t, this.Zf = e,
12669
12680
  /** Underlying cache of documents and their read times. */
12670
- this.docs = new I(T.F),
12681
+ this.docs = new E(T.F),
12671
12682
  /** Size of all cached documents. */
12672
12683
  this.size = 0
12673
12684
  /**
@@ -12696,37 +12707,37 @@ function bi(t, e) {
12696
12707
  e && (this.docs = this.docs.remove(t), this.size -= e.size);
12697
12708
  }, t.prototype.tr = function(t, e) {
12698
12709
  var n = this.docs.get(e);
12699
- return Le.resolve(n ? n.Ud : null);
12710
+ return Ue.resolve(n ? n.Ud : null);
12700
12711
  }, t.prototype.getEntries = function(t, e) {
12701
12712
  var n = this, r = Gt();
12702
12713
  return e.forEach((function(t) {
12703
12714
  var e = n.docs.get(t);
12704
12715
  r = r.it(t, e ? e.Ud : null);
12705
- })), Le.resolve(r);
12706
- }, t.prototype.wr = function(t, e, n) {
12716
+ })), Ue.resolve(r);
12717
+ }, t.prototype.Er = function(t, e, n) {
12707
12718
  for (var r = zt(), i = new T(e.path.child("")), o = this.docs.lt(i)
12708
12719
  // Documents are ordered by key, so we can use a prefix scan to narrow down
12709
12720
  // the documents we need to match the query against.
12710
12721
  ; o.It(); ) {
12711
- var s = o.wt(), u = s.key, a = s.value, h = a.Ud, c = a.readTime;
12722
+ var s = o.Et(), u = s.key, a = s.value, h = a.Ud, c = a.readTime;
12712
12723
  if (!e.path.q(u.path)) break;
12713
12724
  c.D(n) <= 0 || h instanceof vt && e.matches(h) && (r = r.it(h.key, h));
12714
12725
  }
12715
- return Le.resolve(r);
12726
+ return Ue.resolve(r);
12716
12727
  }, t.prototype.tT = function(t, e) {
12717
- return Le.forEach(this.docs, (function(t) {
12728
+ return Ue.forEach(this.docs, (function(t) {
12718
12729
  return e(t);
12719
12730
  }));
12720
12731
  }, t.prototype.ea = function(t, e) {
12721
12732
  throw new Error("getNewDocumentChanges() is not supported with MemoryPersistence");
12722
12733
  }, t.prototype.na = function(t) {
12723
- return Le.resolve(v.MIN);
12724
- }, t.prototype.Eh = function(e) {
12734
+ return Ue.resolve(v.MIN);
12735
+ }, t.prototype.wh = function(e) {
12725
12736
  // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps
12726
12737
  // a separate changelog and does not need special handling for removals.
12727
12738
  return new t.Hd(this);
12728
12739
  }, t.prototype.Jd = function(t) {
12729
- return Le.resolve(this.size);
12740
+ return Ue.resolve(this.size);
12730
12741
  }, t;
12731
12742
  }();
12732
12743
 
@@ -12749,7 +12760,7 @@ function bi(t, e) {
12749
12760
  /**
12750
12761
  * Handles the details of adding and updating documents in the MemoryRemoteDocumentCache.
12751
12762
  */
12752
- Ii.Hd = /** @class */ function(t) {
12763
+ Ei.Hd = /** @class */ function(t) {
12753
12764
  function n(e) {
12754
12765
  var n = this;
12755
12766
  return (n = t.call(this) || this).Yd = e, n;
@@ -12758,13 +12769,13 @@ Ii.Hd = /** @class */ function(t) {
12758
12769
  var e = this, n = [];
12759
12770
  return this.zi.forEach((function(r, i) {
12760
12771
  i ? n.push(e.Yd.Yi(t, i, e.readTime)) : e.Yd.Zi(r);
12761
- })), Le.Ki(n);
12772
+ })), Ue.Ki(n);
12762
12773
  }, n.prototype.er = function(t, e) {
12763
12774
  return this.Yd.tr(t, e);
12764
12775
  }, n.prototype.sr = function(t, e) {
12765
12776
  return this.Yd.getEntries(t, e);
12766
12777
  }, n;
12767
- }(Ue);
12778
+ }(Ve);
12768
12779
 
12769
12780
  /**
12770
12781
  * @license
@@ -12782,7 +12793,7 @@ Ii.Hd = /** @class */ function(t) {
12782
12793
  * See the License for the specific language governing permissions and
12783
12794
  * limitations under the License.
12784
12795
  */
12785
- var Ei = /** @class */ function() {
12796
+ var Ii = /** @class */ function() {
12786
12797
  function t(t) {
12787
12798
  this.persistence = t,
12788
12799
  /**
@@ -12806,40 +12817,40 @@ var Ei = /** @class */ function() {
12806
12817
  return t.prototype.Xs = function(t, e) {
12807
12818
  return this.eT.forEach((function(t, n) {
12808
12819
  return e(n);
12809
- })), Le.resolve();
12820
+ })), Ue.resolve();
12810
12821
  }, t.prototype.bh = function(t) {
12811
- return Le.resolve(this.lastRemoteSnapshotVersion);
12822
+ return Ue.resolve(this.lastRemoteSnapshotVersion);
12812
12823
  }, t.prototype.Dd = function(t) {
12813
- return Le.resolve(this.sT);
12824
+ return Ue.resolve(this.sT);
12814
12825
  }, t.prototype.Qh = function(t) {
12815
- return this.highestTargetId = this.iT.next(), Le.resolve(this.highestTargetId);
12826
+ return this.highestTargetId = this.iT.next(), Ue.resolve(this.highestTargetId);
12816
12827
  }, t.prototype.$h = function(t, e, n) {
12817
12828
  return n && (this.lastRemoteSnapshotVersion = n), e > this.sT && (this.sT = e),
12818
- Le.resolve();
12829
+ Ue.resolve();
12819
12830
  }, t.prototype.Cd = function(t) {
12820
12831
  this.eT.set(t.target, t);
12821
12832
  var e = t.targetId;
12822
12833
  e > this.highestTargetId && (this.iT = new ur(e), this.highestTargetId = e), t.sequenceNumber > this.sT && (this.sT = t.sequenceNumber);
12823
12834
  }, t.prototype.Wh = function(t, e) {
12824
- return this.Cd(e), this.targetCount += 1, Le.resolve();
12835
+ return this.Cd(e), this.targetCount += 1, Ue.resolve();
12825
12836
  }, t.prototype.Nh = function(t, e) {
12826
- return this.Cd(e), Le.resolve();
12837
+ return this.Cd(e), Ue.resolve();
12827
12838
  }, t.prototype.Nd = function(t, e) {
12828
12839
  return this.eT.delete(e.target), this.nT.Ni(e.targetId), this.targetCount -= 1,
12829
- Le.resolve();
12840
+ Ue.resolve();
12830
12841
  }, t.prototype.xo = function(t, e, n) {
12831
12842
  var r = this, i = 0, o = [];
12832
12843
  return this.eT.forEach((function(s, u) {
12833
12844
  u.sequenceNumber <= e && null === n.get(u.targetId) && (r.eT.delete(s), o.push(r.Fd(t, u.targetId)),
12834
12845
  i++);
12835
- })), Le.Ki(o).next((function() {
12846
+ })), Ue.Ki(o).next((function() {
12836
12847
  return i;
12837
12848
  }));
12838
12849
  }, t.prototype.Ld = function(t) {
12839
- return Le.resolve(this.targetCount);
12850
+ return Ue.resolve(this.targetCount);
12840
12851
  }, t.prototype.qh = function(t, e) {
12841
12852
  var n = this.eT.get(e) || null;
12842
- return Le.resolve(n);
12853
+ return Ue.resolve(n);
12843
12854
  }, t.prototype.un = function(t, e) {
12844
12855
  // This method is only needed for multi-tab and we can't implement it
12845
12856
  // efficiently without additional data structures.
@@ -12849,20 +12860,20 @@ var Ei = /** @class */ function() {
12849
12860
  var r = this.persistence.Jo, i = [];
12850
12861
  return r && e.forEach((function(e) {
12851
12862
  i.push(r.vi(t, e));
12852
- })), Le.Ki(i);
12863
+ })), Ue.Ki(i);
12853
12864
  }, t.prototype.Sh = function(t, e, n) {
12854
12865
  this.nT.ki(e, n);
12855
12866
  var r = this.persistence.Jo, i = [];
12856
12867
  return r && e.forEach((function(e) {
12857
12868
  i.push(r.Di(t, e));
12858
- })), Le.Ki(i);
12869
+ })), Ue.Ki(i);
12859
12870
  }, t.prototype.Fd = function(t, e) {
12860
- return this.nT.Ni(e), Le.resolve();
12871
+ return this.nT.Ni(e), Ue.resolve();
12861
12872
  }, t.prototype.Gh = function(t, e) {
12862
12873
  var n = this.nT.$i(e);
12863
- return Le.resolve(n);
12874
+ return Ue.resolve(n);
12864
12875
  }, t.prototype.Mi = function(t, e) {
12865
- return Le.resolve(this.nT.Mi(e));
12876
+ return Ue.resolve(this.nT.Mi(e));
12866
12877
  }, t;
12867
12878
  }(), Ni = /** @class */ function() {
12868
12879
  /**
@@ -12874,13 +12885,11 @@ var Ei = /** @class */ function() {
12874
12885
  function t(t, e) {
12875
12886
  var n = this;
12876
12887
  this.clientId = t, this.rT = {}, this.Vf = new qe(0), this.hf = !1, this.hf = !0,
12877
- this.Jo = e(this), this.th = new Ei(this), this.ur = new Wr, this.hr = new Ii(this.ur, (function(t) {
12888
+ this.Jo = e(this), this.th = new Ii(this), this.ur = new Wr, this.hr = new Ei(this.ur, (function(t) {
12878
12889
  return n.Jo.oT(t);
12879
12890
  }));
12880
12891
  }
12881
- return t.prototype.start = function() {
12882
- return Promise.resolve();
12883
- }, t.prototype.lc = function() {
12892
+ return t.prototype.lc = function() {
12884
12893
  // No durable state to ensure is closed on shutdown.
12885
12894
  return this.hf = !1, Promise.resolve();
12886
12895
  }, Object.defineProperty(t.prototype, "ko", {
@@ -12923,7 +12932,7 @@ var Ei = /** @class */ function() {
12923
12932
  return i.or(), t;
12924
12933
  }));
12925
12934
  }, t.prototype.uT = function(t, e) {
12926
- return Le.Gi(Object.values(this.rT).map((function(n) {
12935
+ return Ue.Gi(Object.values(this.rT).map((function(n) {
12927
12936
  return function() {
12928
12937
  return n.Mi(t, e);
12929
12938
  };
@@ -12951,11 +12960,11 @@ var Ei = /** @class */ function() {
12951
12960
  }), t.prototype.Ho = function(t) {
12952
12961
  this.Qf = t;
12953
12962
  }, t.prototype.vi = function(t, e) {
12954
- return this.lT.delete(e), Le.resolve();
12963
+ return this.lT.delete(e), Ue.resolve();
12955
12964
  }, t.prototype.Di = function(t, e) {
12956
- return this.lT.add(e), Le.resolve();
12965
+ return this.lT.add(e), Ue.resolve();
12957
12966
  }, t.prototype.bd = function(t, e) {
12958
- return this.lT.add(e), Le.resolve();
12967
+ return this.lT.add(e), Ue.resolve();
12959
12968
  }, t.prototype.removeTarget = function(t, e) {
12960
12969
  var n = this, r = this.persistence.eh();
12961
12970
  return r.Gh(t, e.targetId).next((function(t) {
@@ -12968,9 +12977,9 @@ var Ei = /** @class */ function() {
12968
12977
  }, t.prototype.hT = function() {
12969
12978
  this.cT = new Set;
12970
12979
  }, t.prototype.aT = function(t) {
12971
- var e = this, n = this.persistence.Zo().Eh();
12980
+ var e = this, n = this.persistence.Zo().wh();
12972
12981
  // Remove newly orphaned documents.
12973
- return Le.forEach(this.lT, (function(r) {
12982
+ return Ue.forEach(this.lT, (function(r) {
12974
12983
  return e.dT(t, r).next((function(t) {
12975
12984
  t || n.Zi(r);
12976
12985
  }));
@@ -12987,48 +12996,61 @@ var Ei = /** @class */ function() {
12987
12996
  return 0;
12988
12997
  }, t.prototype.dT = function(t, e) {
12989
12998
  var n = this;
12990
- return Le.Gi([ function() {
12999
+ return Ue.Gi([ function() {
12991
13000
  return n.persistence.eh().Mi(t, e);
12992
13001
  }, function() {
12993
13002
  return n.persistence.uT(t, e);
12994
13003
  }, function() {
12995
- return Le.resolve(n.Qf.Mi(e));
13004
+ return Ue.resolve(n.Qf.Mi(e));
12996
13005
  } ]);
12997
13006
  }, t;
12998
13007
  }(), Di = /** @class */ function() {
12999
13008
  function t() {}
13000
- return t.prototype.initialize = function(t) {
13009
+ return t.prototype.initialize = function(t, n, r, i, o, s, u, a) {
13001
13010
  return e.__awaiter(this, void 0, void 0, (function() {
13002
- var n = this;
13003
- return e.__generator(this, (function(r) {
13004
- switch (r.label) {
13011
+ var f, l, p, d, y = this;
13012
+ return e.__generator(this, (function(m) {
13013
+ switch (m.label) {
13005
13014
  case 0:
13006
- return this.X_ = this.fT(t), this.persistence = this.TT(t), [ 4 /*yield*/ , this.persistence.start() ];
13015
+ if (f = vi.qf(n), l = r.fT(n.cn), !or.Uc(r)) throw new c(h.UNIMPLEMENTED, "IndexedDB persistence is only available on platforms that support LocalStorage.");
13016
+ return this.X_ = a.synchronizeTabs ? new or(t, r, f, o, s) : new sr, this.X_.$u = function(t) {
13017
+ return y.mc.B_(t, 1 /* SharedClientState */);
13018
+ }, p = this, [ 4 /*yield*/ , vi.mf({
13019
+ allowTabSynchronization: a.synchronizeTabs,
13020
+ persistenceKey: f,
13021
+ clientId: o,
13022
+ platform: r,
13023
+ $a: t,
13024
+ serializer: l,
13025
+ wf: We.Io(a.cacheSizeBytes),
13026
+ rf: this.X_
13027
+ }) ];
13007
13028
 
13008
13029
  case 1:
13009
- return r.sent(), this.mT = this.ET(t), this.Wu = this.wT(t), this.W_ = this.IT(t),
13010
- this.mc = this.RT(t), this.AT = this.PT(t), this.X_.$u = function(t) {
13011
- return n.mc.B_(t, 1 /* SharedClientState */);
13012
- }, this.W_.mc = this.mc, this.X_.mc = this.mc, [ 4 /*yield*/ , this.X_.start() ];
13030
+ return p.persistence = m.sent(), d = this.persistence.Jo.bo, this.TT = new Ye(d, t),
13031
+ this.Wu = new Xe(this.persistence, new gr, s), this.W_ = new Hn(this.Wu, i, t, (function(t) {
13032
+ return y.mc.B_(t, 0 /* RemoteStore */);
13033
+ }), r.mT()), this.mc = new dr(this.Wu, this.W_, this.X_, s, u), this.wT = new mr(this.mc),
13034
+ this.W_.mc = this.mc, this.X_.mc = this.mc, [ 4 /*yield*/ , this.X_.start() ];
13013
13035
 
13014
13036
  case 2:
13015
- return r.sent(), [ 4 /*yield*/ , this.W_.start() ];
13037
+ return m.sent(), [ 4 /*yield*/ , this.W_.start() ];
13016
13038
 
13017
13039
  case 3:
13018
- return r.sent(), [ 4 /*yield*/ , this.Wu.start() ];
13040
+ return m.sent(), [ 4 /*yield*/ , this.Wu.start() ];
13019
13041
 
13020
13042
  case 4:
13021
13043
  // NOTE: This will immediately call the listener, so we make sure to
13022
13044
  // set it after localStore / remoteStore are started.
13023
- return r.sent(), [ 4 /*yield*/ , this.persistence.gf((function(t) {
13024
- return e.__awaiter(n, void 0, void 0, (function() {
13045
+ return m.sent(), [ 4 /*yield*/ , this.persistence.gf((function(t) {
13046
+ return e.__awaiter(y, void 0, void 0, (function() {
13025
13047
  return e.__generator(this, (function(e) {
13026
13048
  switch (e.label) {
13027
13049
  case 0:
13028
13050
  return [ 4 /*yield*/ , this.mc.Cc(t) ];
13029
13051
 
13030
13052
  case 1:
13031
- return e.sent(), this.mT && (t && !this.mT.ko ? this.mT.start(this.Wu) : t || this.mT.stop()),
13053
+ return e.sent(), t && !this.TT.ko ? this.TT.start(this.Wu) : t || this.TT.stop(),
13032
13054
  [ 2 /*return*/ ];
13033
13055
  }
13034
13056
  }));
@@ -13038,61 +13060,46 @@ var Ei = /** @class */ function() {
13038
13060
  case 5:
13039
13061
  // NOTE: This will immediately call the listener, so we make sure to
13040
13062
  // set it after localStore / remoteStore are started.
13041
- return r.sent(), [ 2 /*return*/ ];
13063
+ return m.sent(), [ 2 /*return*/ ];
13042
13064
  }
13043
13065
  }));
13044
13066
  }));
13045
- }, t.prototype.PT = function(t) {
13046
- return new mr(this.mc);
13047
- }, t.prototype.ET = function(t) {
13048
- return null;
13049
- }, t.prototype.wT = function(t) {
13050
- return new Je(this.persistence, new gr, t.VT);
13051
- }, t.prototype.TT = function(t) {
13052
- return new Ni(t.clientId, Si._T);
13053
- }, t.prototype.IT = function(t) {
13054
- var e = this;
13055
- return new Hn(this.Wu, t.bu, t.Nr, (function(t) {
13056
- return e.mc.B_(t, 0 /* RemoteStore */);
13057
- }), t.platform.gT());
13058
- }, t.prototype.fT = function(t) {
13059
- return new sr;
13060
- }, t.prototype.RT = function(t) {
13061
- return new dr(this.Wu, this.W_, this.X_, t.VT, t.Z_);
13062
13067
  }, t.prototype.clearPersistence = function(t) {
13063
- throw new c(h.FAILED_PRECONDITION, "You are using the memory-only build of Firestore. Persistence support is only available via the @firebase/firestore bundle or the firebase-firestore.js build.");
13064
- }, t;
13065
- }(), ki = /** @class */ function(t) {
13066
- function n() {
13067
- return null !== t && t.apply(this, arguments) || this;
13068
- }
13069
- return e.__extends(n, t), n.prototype.ET = function(t) {
13070
- var e = this.persistence.Jo.bo;
13071
- return new Ye(e, t.Nr);
13072
- }, n.prototype.TT = function(t) {
13073
- var e = vi.qf(t.pT), n = t.platform.yT(t.pT.cn);
13074
- return vi.mf({
13075
- allowTabSynchronization: t.bT.synchronizeTabs,
13076
- persistenceKey: e,
13077
- clientId: t.clientId,
13078
- platform: t.platform,
13079
- $a: t.Nr,
13080
- serializer: n,
13081
- Ef: We.Io(t.bT.cacheSizeBytes),
13082
- rf: this.X_
13083
- });
13084
- }, n.prototype.fT = function(t) {
13085
- if (t.bT.synchronizeTabs) {
13086
- if (!or.Uc(t.platform)) throw new c(h.UNIMPLEMENTED, "IndexedDB persistence is only available on platforms that support LocalStorage.");
13087
- var e = vi.qf(t.pT);
13088
- return new or(t.Nr, t.platform, e, t.clientId, t.VT);
13089
- }
13090
- return new sr;
13091
- }, n.prototype.clearPersistence = function(t) {
13092
13068
  var e = vi.qf(t);
13093
13069
  return vi.clearPersistence(e);
13094
- }, n;
13095
- }(Di), xi = /** @class */ function() {
13070
+ }, t;
13071
+ }(), ki = "You are using the memory-only build of Firestore. Persistence support is only available via the @firebase/firestore bundle or the firebase-firestore.js build.", xi = /** @class */ function() {
13072
+ function t(t) {
13073
+ void 0 === t && (t = Si._T), this.ET = t;
13074
+ }
13075
+ return t.prototype.initialize = function(t, n, r, i, o, s, u, a) {
13076
+ return e.__awaiter(this, void 0, void 0, (function() {
13077
+ var n = this;
13078
+ return e.__generator(this, (function(e) {
13079
+ switch (e.label) {
13080
+ case 0:
13081
+ if (a.IT) throw new c(h.FAILED_PRECONDITION, ki);
13082
+ return this.persistence = new Ni(o, this.ET), this.TT = null, this.X_ = new sr,
13083
+ this.Wu = new Xe(this.persistence, new gr, s), this.W_ = new Hn(this.Wu, i, t, (function(t) {
13084
+ return n.mc.B_(t, 0 /* RemoteStore */);
13085
+ }), r.mT()), this.mc = new dr(this.Wu, this.W_, this.X_, s, u), this.wT = new mr(this.mc),
13086
+ this.W_.mc = this.mc, [ 4 /*yield*/ , this.W_.start() ];
13087
+
13088
+ case 1:
13089
+ return e.sent(), [ 4 /*yield*/ , this.W_.Cc(!0) ];
13090
+
13091
+ case 2:
13092
+ return e.sent(), [ 4 /*yield*/ , this.mc.Cc(!0) ];
13093
+
13094
+ case 3:
13095
+ return e.sent(), [ 2 /*return*/ ];
13096
+ }
13097
+ }));
13098
+ }));
13099
+ }, t.prototype.clearPersistence = function() {
13100
+ throw new c(h.FAILED_PRECONDITION, ki);
13101
+ }, t;
13102
+ }(), Ri = /** @class */ function() {
13096
13103
  function t(t, e, n,
13097
13104
  /**
13098
13105
  * Asynchronous queue responsible for all of our internal processing. When
@@ -13103,7 +13110,7 @@ var Ei = /** @class */ function() {
13103
13110
  * an async I/O to complete).
13104
13111
  */
13105
13112
  r) {
13106
- this.platform = t, this.pT = e, this.credentials = n, this.Nr = r, this.clientId = Te.mi()
13113
+ this.platform = t, this.RT = e, this.credentials = n, this.Nr = r, this.clientId = Te.mi()
13107
13114
  /**
13108
13115
  * Starts up the FirestoreClient, returning only whether or not enabling
13109
13116
  * persistence succeeded.
@@ -13143,7 +13150,7 @@ var Ei = /** @class */ function() {
13143
13150
  }
13144
13151
  return t.prototype.start = function(t, e) {
13145
13152
  var n = this;
13146
- this.vT();
13153
+ this.AT();
13147
13154
  // We defer our initialization until we get the current user from
13148
13155
  // setChangeListener(). We block the async queue until we got the initial
13149
13156
  // user and the initialization is completed. This will prevent any scheduled
@@ -13160,7 +13167,7 @@ var Ei = /** @class */ function() {
13160
13167
  // need to await the completion of initializationDone because the result of
13161
13168
  // this method should not reflect any other kind of failure to start.
13162
13169
  return this.credentials.l((function(s) {
13163
- if (!o) return o = !0, ve("FirestoreClient", "Initializing. user=", s.uid), n.ST(t, e, s, i).then(r.resolve, r.reject);
13170
+ if (!o) return o = !0, ve("FirestoreClient", "Initializing. user=", s.uid), n.PT(t, e, s, i).then(r.resolve, r.reject);
13164
13171
  n.Nr.qr((function() {
13165
13172
  return n.Dc(s);
13166
13173
  }));
@@ -13172,7 +13179,7 @@ var Ei = /** @class */ function() {
13172
13179
  },
13173
13180
  /** Enables the network connection and requeues all pending operations. */ t.prototype.enableNetwork = function() {
13174
13181
  var t = this;
13175
- return this.vT(), this.Nr.enqueue((function() {
13182
+ return this.AT(), this.Nr.enqueue((function() {
13176
13183
  return t.mc.enableNetwork();
13177
13184
  }));
13178
13185
  },
@@ -13196,30 +13203,21 @@ var Ei = /** @class */ function() {
13196
13203
  * continue, i.e. that one of the persistence implementations actually
13197
13204
  * succeeded.
13198
13205
  */
13199
- t.prototype.ST = function(t, n, r, i) {
13206
+ t.prototype.PT = function(t, n, r, i) {
13200
13207
  return e.__awaiter(this, void 0, void 0, (function() {
13201
13208
  var o, s, u, a, h = this;
13202
13209
  return e.__generator(this, (function(c) {
13203
13210
  switch (c.label) {
13204
13211
  case 0:
13205
- return c.trys.push([ 0, 3, , 4 ]), [ 4 /*yield*/ , this.platform.DT(this.pT) ];
13212
+ return c.trys.push([ 0, 3, , 4 ]), [ 4 /*yield*/ , this.platform.VT(this.RT) ];
13206
13213
 
13207
13214
  case 1:
13208
- return o = c.sent(), s = this.platform.yT(this.pT.cn), u = new Yn(this.Nr, o, this.credentials, s),
13209
- [ 4 /*yield*/ , t.initialize({
13210
- Nr: this.Nr,
13211
- pT: this.pT,
13212
- platform: this.platform,
13213
- bu: u,
13214
- clientId: this.clientId,
13215
- VT: r,
13216
- Z_: 100,
13217
- bT: n
13218
- }) ];
13215
+ return o = c.sent(), s = this.platform.fT(this.RT.cn), u = new Yn(this.Nr, o, this.credentials, s),
13216
+ [ 4 /*yield*/ , t.initialize(this.Nr, this.RT, this.platform, u, this.clientId, r, 100, n) ];
13219
13217
 
13220
13218
  case 2:
13221
13219
  return c.sent(), this.persistence = t.persistence, this.X_ = t.X_, this.Wu = t.Wu,
13222
- this.W_ = t.W_, this.mc = t.mc, this.mT = t.mT, this.CT = t.AT,
13220
+ this.W_ = t.W_, this.mc = t.mc, this.TT = t.TT, this.gT = t.wT,
13223
13221
  // When a user calls clearPersistence() in one client, all other clients
13224
13222
  // need to be terminated to allow the delete to succeed.
13225
13223
  this.persistence.pf((function() {
@@ -13241,10 +13239,10 @@ var Ei = /** @class */ function() {
13241
13239
  if (a = c.sent(),
13242
13240
  // Regardless of whether or not the retry succeeds, from an user
13243
13241
  // perspective, offline persistence has failed.
13244
- i.reject(a), !this.kT(a)) throw a;
13242
+ i.reject(a), !this.pT(a)) throw a;
13245
13243
  return [ 2 /*return*/ , (console.warn("Error enabling offline persistence. Falling back to persistence disabled: " + a),
13246
- this.ST(new Di, {
13247
- NT: !1
13244
+ this.PT(new xi, {
13245
+ IT: !1
13248
13246
  }, r, i)) ];
13249
13247
 
13250
13248
  case 4:
@@ -13257,7 +13255,7 @@ var Ei = /** @class */ function() {
13257
13255
  * Decides whether the provided error allows us to gracefully disable
13258
13256
  * persistence (as opposed to crashing the client).
13259
13257
  */
13260
- t.prototype.kT = function(t) {
13258
+ t.prototype.pT = function(t) {
13261
13259
  return "FirebaseError" === t.name ? t.code === h.FAILED_PRECONDITION || t.code === h.UNIMPLEMENTED : !("undefined" != typeof DOMException && t instanceof DOMException) ||
13262
13260
  // When the browser is out of quota we could get either quota exceeded
13263
13261
  // or an aborted error depending on whether the error happened during
@@ -13271,7 +13269,7 @@ var Ei = /** @class */ function() {
13271
13269
  * Checks that the client has not been terminated. Ensures that other methods on
13272
13270
  * this class cannot be called after the client is terminated.
13273
13271
  */
13274
- t.prototype.vT = function() {
13272
+ t.prototype.AT = function() {
13275
13273
  if (this.Nr.Hr) throw new c(h.FAILED_PRECONDITION, "The client has already been terminated.");
13276
13274
  }, t.prototype.Dc = function(t) {
13277
13275
  return this.Nr.no(), ve("FirestoreClient", "Credential Changed. Current user: " + t.uid),
@@ -13279,7 +13277,7 @@ var Ei = /** @class */ function() {
13279
13277
  },
13280
13278
  /** Disables the network connection. Pending operations will not complete. */ t.prototype.disableNetwork = function() {
13281
13279
  var t = this;
13282
- return this.vT(), this.Nr.enqueue((function() {
13280
+ return this.AT(), this.Nr.enqueue((function() {
13283
13281
  return t.mc.disableNetwork();
13284
13282
  }));
13285
13283
  }, t.prototype.terminate = function() {
@@ -13290,7 +13288,7 @@ var Ei = /** @class */ function() {
13290
13288
  switch (t.label) {
13291
13289
  case 0:
13292
13290
  // PORTING NOTE: LocalStore does not need an explicit shutdown on web.
13293
- return this.mT && this.mT.stop(), [ 4 /*yield*/ , this.W_.lc() ];
13291
+ return this.TT && this.TT.stop(), [ 4 /*yield*/ , this.W_.lc() ];
13294
13292
 
13295
13293
  case 1:
13296
13294
  return t.sent(), [ 4 /*yield*/ , this.X_.lc() ];
@@ -13317,37 +13315,37 @@ var Ei = /** @class */ function() {
13317
13315
  */
13318
13316
  t.prototype.waitForPendingWrites = function() {
13319
13317
  var t = this;
13320
- this.vT();
13318
+ this.AT();
13321
13319
  var e = new Fe;
13322
13320
  return this.Nr.qr((function() {
13323
13321
  return t.mc.Pl(e);
13324
13322
  })), e.promise;
13325
13323
  }, t.prototype.listen = function(t, e, n) {
13326
13324
  var r = this;
13327
- this.vT();
13325
+ this.AT();
13328
13326
  var i = new vr(t, e, n);
13329
13327
  return this.Nr.qr((function() {
13330
- return r.CT.listen(i);
13328
+ return r.gT.listen(i);
13331
13329
  })), i;
13332
13330
  }, t.prototype.fc = function(t) {
13333
13331
  var e = this;
13334
13332
  // Checks for termination but does not raise error, allowing unlisten after
13335
13333
  // termination to be a no-op.
13336
- this.FT || this.Nr.qr((function() {
13337
- return e.CT.fc(t);
13334
+ this.yT || this.Nr.qr((function() {
13335
+ return e.gT.fc(t);
13338
13336
  }));
13339
- }, t.prototype.$T = function(t) {
13337
+ }, t.prototype.bT = function(t) {
13340
13338
  var e = this;
13341
- return this.vT(), this.Nr.enqueue((function() {
13339
+ return this.AT(), this.Nr.enqueue((function() {
13342
13340
  return e.Wu.Bh(t);
13343
13341
  })).then((function(t) {
13344
13342
  if (t instanceof vt) return t;
13345
13343
  if (t instanceof gt) return null;
13346
13344
  throw new c(h.UNAVAILABLE, "Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)");
13347
13345
  }));
13348
- }, t.prototype.MT = function(t) {
13346
+ }, t.prototype.vT = function(t) {
13349
13347
  var n = this;
13350
- return this.vT(), this.Nr.enqueue((function() {
13348
+ return this.AT(), this.Nr.enqueue((function() {
13351
13349
  return e.__awaiter(n, void 0, void 0, (function() {
13352
13350
  var n, r, i;
13353
13351
  return e.__generator(this, (function(e) {
@@ -13365,23 +13363,23 @@ var Ei = /** @class */ function() {
13365
13363
  }));
13366
13364
  }, t.prototype.write = function(t) {
13367
13365
  var e = this;
13368
- this.vT();
13366
+ this.AT();
13369
13367
  var n = new Fe;
13370
13368
  return this.Nr.qr((function() {
13371
13369
  return e.mc.write(t, n);
13372
13370
  })), n.promise;
13373
13371
  }, t.prototype.cn = function() {
13374
- return this.pT.cn;
13372
+ return this.RT.cn;
13375
13373
  }, t.prototype.Ol = function(t) {
13376
13374
  var e = this;
13377
- this.vT(), this.Nr.qr((function() {
13378
- return e.CT.Ol(t), Promise.resolve();
13375
+ this.AT(), this.Nr.qr((function() {
13376
+ return e.gT.Ol(t), Promise.resolve();
13379
13377
  }));
13380
13378
  }, t.prototype.xl = function(t) {
13381
13379
  // Checks for shutdown but does not raise error, allowing remove after
13382
13380
  // shutdown to be a no-op.
13383
- this.FT || this.CT.xl(t);
13384
- }, Object.defineProperty(t.prototype, "FT", {
13381
+ this.yT || this.gT.xl(t);
13382
+ }, Object.defineProperty(t.prototype, "yT", {
13385
13383
  get: function() {
13386
13384
  // Technically, the asyncQueue is still running, but only accepting operations
13387
13385
  // related to termination or supposed to be run after termination. It is effectively
@@ -13392,13 +13390,13 @@ var Ei = /** @class */ function() {
13392
13390
  configurable: !0
13393
13391
  }), t.prototype.transaction = function(t) {
13394
13392
  var e = this;
13395
- this.vT();
13393
+ this.AT();
13396
13394
  var n = new Fe;
13397
13395
  return this.Nr.qr((function() {
13398
13396
  return e.mc.runTransaction(e.Nr, t, n), Promise.resolve();
13399
13397
  })), n.promise;
13400
13398
  }, t;
13401
- }(), Ri = /** @class */ function() {
13399
+ }(), Li = /** @class */ function() {
13402
13400
  function t(t) {
13403
13401
  this.observer = t,
13404
13402
  /**
@@ -13408,12 +13406,12 @@ var Ei = /** @class */ function() {
13408
13406
  this.muted = !1;
13409
13407
  }
13410
13408
  return t.prototype.next = function(t) {
13411
- this.LT(this.observer.next, t);
13409
+ this.ST(this.observer.next, t);
13412
13410
  }, t.prototype.error = function(t) {
13413
- this.LT(this.observer.error, t);
13414
- }, t.prototype.OT = function() {
13411
+ this.ST(this.observer.error, t);
13412
+ }, t.prototype.DT = function() {
13415
13413
  this.muted = !0;
13416
- }, t.prototype.LT = function(t, e) {
13414
+ }, t.prototype.ST = function(t, e) {
13417
13415
  var n = this;
13418
13416
  this.muted || setTimeout((function() {
13419
13417
  n.muted || t(e);
@@ -13457,7 +13455,7 @@ var Ei = /** @class */ function() {
13457
13455
  * See the License for the specific language governing permissions and
13458
13456
  * limitations under the License.
13459
13457
  */
13460
- function Vi(t) {
13458
+ function Ui(t) {
13461
13459
  /**
13462
13460
  * Returns true if obj is an object and contains at least one of the specified
13463
13461
  * methods.
@@ -13472,11 +13470,11 @@ function Vi(t) {
13472
13470
  }(t);
13473
13471
  }
13474
13472
 
13475
- var Li = /** @class */ function() {
13473
+ var Vi = /** @class */ function() {
13476
13474
  function t(t, e, n, r) {
13477
- this.firestore = t, this.timestampsInSnapshots = e, this.xT = n, this.converter = r;
13475
+ this.firestore = t, this.timestampsInSnapshots = e, this.CT = n, this.converter = r;
13478
13476
  }
13479
- return t.prototype.BT = function(t) {
13477
+ return t.prototype.kT = function(t) {
13480
13478
  switch (M(t)) {
13481
13479
  case 0 /* NullValue */ :
13482
13480
  return null;
@@ -13488,10 +13486,10 @@ var Li = /** @class */ function() {
13488
13486
  return K(t.integerValue || t.doubleValue);
13489
13487
 
13490
13488
  case 3 /* TimestampValue */ :
13491
- return this.UT(t.timestampValue);
13489
+ return this.NT(t.timestampValue);
13492
13490
 
13493
13491
  case 4 /* ServerTimestampValue */ :
13494
- return this.qT(t);
13492
+ return this.FT(t);
13495
13493
 
13496
13494
  case 5 /* StringValue */ :
13497
13495
  return t.stringValue;
@@ -13500,58 +13498,58 @@ var Li = /** @class */ function() {
13500
13498
  return new wn(W(t.bytesValue));
13501
13499
 
13502
13500
  case 7 /* RefValue */ :
13503
- return this.QT(t.referenceValue);
13501
+ return this.$T(t.referenceValue);
13504
13502
 
13505
13503
  case 8 /* GeoPointValue */ :
13506
13504
  return new xn(t.geoPointValue.latitude, t.geoPointValue.longitude);
13507
13505
 
13508
13506
  case 9 /* ArrayValue */ :
13509
- return this.WT(t.arrayValue);
13507
+ return this.MT(t.arrayValue);
13510
13508
 
13511
13509
  case 10 /* ObjectValue */ :
13512
- return this.jT(t.mapValue);
13510
+ return this.LT(t.mapValue);
13513
13511
 
13514
13512
  default:
13515
13513
  throw _e("Invalid value type: " + JSON.stringify(t));
13516
13514
  }
13517
- }, t.prototype.jT = function(t) {
13515
+ }, t.prototype.LT = function(t) {
13518
13516
  var e = this, n = {};
13519
13517
  return k(t.fields || {}, (function(t, r) {
13520
- n[t] = e.BT(r);
13518
+ n[t] = e.kT(r);
13521
13519
  })), n;
13522
- }, t.prototype.WT = function(t) {
13520
+ }, t.prototype.MT = function(t) {
13523
13521
  var e = this;
13524
13522
  return (t.values || []).map((function(t) {
13525
- return e.BT(t);
13523
+ return e.kT(t);
13526
13524
  }));
13527
- }, t.prototype.qT = function(t) {
13528
- switch (this.xT) {
13525
+ }, t.prototype.FT = function(t) {
13526
+ switch (this.CT) {
13529
13527
  case "previous":
13530
13528
  var e = function t(e) {
13531
13529
  var n = e.mapValue.fields.__previous_value__;
13532
13530
  return O(n) ? t(n) : n;
13533
13531
  }(t);
13534
- return null == e ? null : this.BT(e);
13532
+ return null == e ? null : this.kT(e);
13535
13533
 
13536
13534
  case "estimate":
13537
- return this.UT(P(t));
13535
+ return this.NT(P(t));
13538
13536
 
13539
13537
  default:
13540
13538
  return null;
13541
13539
  }
13542
- }, t.prototype.UT = function(t) {
13540
+ }, t.prototype.NT = function(t) {
13543
13541
  var e = z(t), n = new m(e.seconds, e.nanos);
13544
13542
  return this.timestampsInSnapshots ? n : n.toDate();
13545
- }, t.prototype.QT = function(t) {
13543
+ }, t.prototype.$T = function(t) {
13546
13544
  var e = w.G(t);
13547
13545
  be(le(e), "ReferenceValue is not valid " + t);
13548
13546
  var n = new Se(e.get(1), e.get(3)), r = new T(e.M(5));
13549
- return n.isEqual(this.firestore.KT) ||
13547
+ return n.isEqual(this.firestore.OT) ||
13550
13548
  // TODO(b/64130202): Somehow support foreign references.
13551
- ge("Document " + r + " contains a document reference within a different database (" + n.projectId + "/" + n.database + ") which is not supported. It will be treated as a reference in the current database (" + this.firestore.KT.projectId + "/" + this.firestore.KT.database + ") instead."),
13552
- new qi(r, this.firestore, this.converter);
13549
+ ge("Document " + r + " contains a document reference within a different database (" + n.projectId + "/" + n.database + ") which is not supported. It will be treated as a reference in the current database (" + this.firestore.OT.projectId + "/" + this.firestore.OT.database + ") instead."),
13550
+ new Fi(r, this.firestore, this.converter);
13553
13551
  }, t;
13554
- }(), Ui = We.Po, Oi = /** @class */ function() {
13552
+ }(), Oi = We.Po, Pi = /** @class */ function() {
13555
13553
  function t(t) {
13556
13554
  var e, n;
13557
13555
  if (void 0 === t.host) {
@@ -13567,7 +13565,7 @@ var Li = /** @class */ function() {
13567
13565
  !0 === t.timestampsInSnapshots ? ge("The setting 'timestampsInSnapshots: true' is no longer required and should be removed.") : !1 === t.timestampsInSnapshots && ge("Support for 'timestampsInSnapshots: false' will be removed soon. You must update your code to handle Timestamp objects."),
13568
13566
  this.timestampsInSnapshots = null === (n = t.timestampsInSnapshots) || void 0 === n || n,
13569
13567
  on("settings", "number", "cacheSizeBytes", t.cacheSizeBytes), void 0 === t.cacheSizeBytes) this.cacheSizeBytes = We.po; else {
13570
- if (t.cacheSizeBytes !== Ui && t.cacheSizeBytes < We.Vo) throw new c(h.INVALID_ARGUMENT, "cacheSizeBytes must be at least " + We.Vo);
13568
+ if (t.cacheSizeBytes !== Oi && t.cacheSizeBytes < We.Vo) throw new c(h.INVALID_ARGUMENT, "cacheSizeBytes must be at least " + We.Vo);
13571
13569
  this.cacheSizeBytes = t.cacheSizeBytes;
13572
13570
  }
13573
13571
  on("settings", "boolean", "experimentalForceLongPolling", t.experimentalForceLongPolling),
@@ -13576,16 +13574,16 @@ var Li = /** @class */ function() {
13576
13574
  return t.prototype.isEqual = function(t) {
13577
13575
  return this.host === t.host && this.ssl === t.ssl && this.timestampsInSnapshots === t.timestampsInSnapshots && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.forceLongPolling === t.forceLongPolling;
13578
13576
  }, t;
13579
- }(), Pi = /** @class */ function() {
13577
+ }(), Ci = /** @class */ function() {
13580
13578
  // Note: We are using `MemoryComponentProvider` as a default
13581
13579
  // ComponentProvider to ensure backwards compatibility with the format
13582
13580
  // expected by the console build.
13583
13581
  function t(n, r, i) {
13584
13582
  var o = this;
13585
- if (void 0 === i && (i = new Di), this.GT = null,
13583
+ if (void 0 === i && (i = new xi), this.xT = null,
13586
13584
  // Public for use in tests.
13587
13585
  // TODO(mikelehen): Use modularized initialization instead.
13588
- this.zT = new Ge, this.INTERNAL = {
13586
+ this.BT = new Ge, this.INTERNAL = {
13589
13587
  delete: function() {
13590
13588
  return e.__awaiter(o, void 0, void 0, (function() {
13591
13589
  return e.__generator(this, (function(t) {
@@ -13593,7 +13591,7 @@ var Li = /** @class */ function() {
13593
13591
  case 0:
13594
13592
  // The client must be initalized to ensure that all subsequent API usage
13595
13593
  // throws an exception.
13596
- return this.HT(), [ 4 /*yield*/ , this.JT.terminate() ];
13594
+ return this.UT(), [ 4 /*yield*/ , this.qT.terminate() ];
13597
13595
 
13598
13596
  case 1:
13599
13597
  // The client must be initalized to ensure that all subsequent API usage
@@ -13607,63 +13605,63 @@ var Li = /** @class */ function() {
13607
13605
  // This is very likely a Firebase app object
13608
13606
  // TODO(b/34177605): Can we somehow use instanceof?
13609
13607
  var s = n;
13610
- this.GT = s, this.KT = t.YT(s), this.XT = s.name, this.ZT = new p(r);
13608
+ this.xT = s, this.OT = t.QT(s), this.WT = s.name, this.jT = new p(r);
13611
13609
  } else {
13612
13610
  var u = n;
13613
13611
  if (!u.projectId) throw new c(h.INVALID_ARGUMENT, "Must provide projectId");
13614
- this.KT = new Se(u.projectId, u.database),
13612
+ this.OT = new Se(u.projectId, u.database),
13615
13613
  // Use a default persistenceKey that lines up with FirebaseApp.
13616
- this.XT = "[DEFAULT]", this.ZT = new l;
13614
+ this.WT = "[DEFAULT]", this.jT = new l;
13617
13615
  }
13618
- this.tm = i, this.em = new Oi({}), this.sm = this.nm(this.KT);
13616
+ this.KT = i, this.GT = new Pi({}), this.zT = this.HT(this.OT);
13619
13617
  }
13620
13618
  return t.prototype.settings = function(t) {
13621
13619
  Ze("Firestore.settings", arguments, 1), en("Firestore.settings", "object", 1, t);
13622
- var e = new Oi(t);
13623
- if (this.JT && !this.em.isEqual(e)) throw new c(h.FAILED_PRECONDITION, "Firestore has already been started and its settings can no longer be changed. You can only call settings() before calling any other methods on a Firestore object.");
13624
- this.em = e, void 0 !== e.credentials && (this.ZT = function(t) {
13620
+ var e = new Pi(t);
13621
+ if (this.qT && !this.GT.isEqual(e)) throw new c(h.FAILED_PRECONDITION, "Firestore has already been started and its settings can no longer be changed. You can only call settings() before calling any other methods on a Firestore object.");
13622
+ this.GT = e, void 0 !== e.credentials && (this.jT = function(t) {
13625
13623
  if (!t) return new l;
13626
13624
  switch (t.type) {
13627
13625
  case "gapi":
13628
- var e = t.im;
13626
+ var e = t.JT;
13629
13627
  // Make sure this really is a Gapi client.
13630
13628
  return be(!("object" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty), "unexpected gapi interface"),
13631
13629
  new y(e, t.V || "0");
13632
13630
 
13633
13631
  case "provider":
13634
- return t.im;
13632
+ return t.JT;
13635
13633
 
13636
13634
  default:
13637
13635
  throw new c(h.INVALID_ARGUMENT, "makeCredentialsProvider failed due to invalid credential type");
13638
13636
  }
13639
13637
  }(e.credentials));
13640
13638
  }, t.prototype.enableNetwork = function() {
13641
- return this.HT(), this.JT.enableNetwork();
13639
+ return this.UT(), this.qT.enableNetwork();
13642
13640
  }, t.prototype.disableNetwork = function() {
13643
- return this.HT(), this.JT.disableNetwork();
13641
+ return this.UT(), this.qT.disableNetwork();
13644
13642
  }, t.prototype.enablePersistence = function(t) {
13645
13643
  var e, n;
13646
- if (this.JT) throw new c(h.FAILED_PRECONDITION, "Firestore has already been started and persistence can no longer be enabled. You can only call enablePersistence() before calling any other methods on a Firestore object.");
13644
+ if (this.qT) throw new c(h.FAILED_PRECONDITION, "Firestore has already been started and persistence can no longer be enabled. You can only call enablePersistence() before calling any other methods on a Firestore object.");
13647
13645
  var r = !1;
13648
13646
  return t && (void 0 !== t.experimentalTabSynchronization && ge("The 'experimentalTabSynchronization' setting will be removed. Use 'synchronizeTabs' instead."),
13649
13647
  r = null !== (n = null !== (e = t.synchronizeTabs) && void 0 !== e ? e : t.experimentalTabSynchronization) && void 0 !== n && n),
13650
- this.rm(this.tm, {
13651
- NT: !0,
13652
- cacheSizeBytes: this.em.cacheSizeBytes,
13648
+ this.YT(this.KT, {
13649
+ IT: !0,
13650
+ cacheSizeBytes: this.GT.cacheSizeBytes,
13653
13651
  synchronizeTabs: r
13654
13652
  });
13655
13653
  }, t.prototype.clearPersistence = function() {
13656
13654
  return e.__awaiter(this, void 0, void 0, (function() {
13657
13655
  var t, n = this;
13658
13656
  return e.__generator(this, (function(r) {
13659
- if (void 0 !== this.JT && !this.JT.FT) throw new c(h.FAILED_PRECONDITION, "Persistence cannot be cleared after this Firestore instance is initialized.");
13660
- return t = new Fe, [ 2 /*return*/ , (this.zT.Jr((function() {
13657
+ if (void 0 !== this.qT && !this.qT.yT) throw new c(h.FAILED_PRECONDITION, "Persistence cannot be cleared after this Firestore instance is initialized.");
13658
+ return t = new Fe, [ 2 /*return*/ , (this.BT.Jr((function() {
13661
13659
  return e.__awaiter(n, void 0, void 0, (function() {
13662
13660
  var n, r;
13663
13661
  return e.__generator(this, (function(e) {
13664
13662
  switch (e.label) {
13665
13663
  case 0:
13666
- return e.trys.push([ 0, 2, , 3 ]), n = this.om(), [ 4 /*yield*/ , this.tm.clearPersistence(n) ];
13664
+ return e.trys.push([ 0, 2, , 3 ]), n = this.XT(), [ 4 /*yield*/ , this.KT.clearPersistence(n) ];
13667
13665
 
13668
13666
  case 1:
13669
13667
  return e.sent(), t.resolve(), [ 3 /*break*/ , 3 ];
@@ -13681,23 +13679,23 @@ var Li = /** @class */ function() {
13681
13679
  }));
13682
13680
  }, t.prototype.terminate = function() {
13683
13681
  return this.app._removeServiceInstance("firestore"), this.INTERNAL.delete();
13684
- }, Object.defineProperty(t.prototype, "hm", {
13682
+ }, Object.defineProperty(t.prototype, "ZT", {
13685
13683
  get: function() {
13686
- return this.HT(), this.JT.FT;
13684
+ return this.UT(), this.qT.yT;
13687
13685
  },
13688
13686
  enumerable: !0,
13689
13687
  configurable: !0
13690
13688
  }), t.prototype.waitForPendingWrites = function() {
13691
- return this.HT(), this.JT.waitForPendingWrites();
13689
+ return this.UT(), this.qT.waitForPendingWrites();
13692
13690
  }, t.prototype.onSnapshotsInSync = function(t) {
13693
- if (this.HT(), Vi(t)) return this.am(t);
13691
+ if (this.UT(), Ui(t)) return this.tm(t);
13694
13692
  en("Firestore.onSnapshotsInSync", "function", 1, t);
13695
13693
  var e = {
13696
13694
  next: t
13697
13695
  };
13698
- return this.am(e);
13699
- }, t.prototype.am = function(t) {
13700
- var e = this, n = new Ri({
13696
+ return this.tm(e);
13697
+ }, t.prototype.tm = function(t) {
13698
+ var e = this, n = new Li({
13701
13699
  next: function() {
13702
13700
  t.next && t.next();
13703
13701
  },
@@ -13705,34 +13703,34 @@ var Li = /** @class */ function() {
13705
13703
  throw _e("Uncaught Error in onSnapshotsInSync");
13706
13704
  }
13707
13705
  });
13708
- return this.JT.Ol(n), function() {
13709
- n.OT(), e.JT.xl(n);
13706
+ return this.qT.Ol(n), function() {
13707
+ n.DT(), e.qT.xl(n);
13710
13708
  };
13711
- }, t.prototype.HT = function() {
13712
- return this.JT ||
13709
+ }, t.prototype.UT = function() {
13710
+ return this.qT ||
13713
13711
  // Kick off starting the client but don't actually wait for it.
13714
13712
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
13715
- this.rm(new Di, {
13716
- NT: !1
13717
- }), this.JT;
13718
- }, t.prototype.om = function() {
13719
- return new Ae(this.KT, this.XT, this.em.host, this.em.ssl, this.em.forceLongPolling);
13720
- }, t.prototype.rm = function(t, e) {
13721
- var n = this.om();
13722
- return this.JT = new xi(pe.Lt(), n, this.ZT, this.zT), this.JT.start(t, e);
13723
- }, t.prototype.nm = function(t) {
13713
+ this.YT(new xi, {
13714
+ IT: !1
13715
+ }), this.qT;
13716
+ }, t.prototype.XT = function() {
13717
+ return new Ae(this.OT, this.WT, this.GT.host, this.GT.ssl, this.GT.forceLongPolling);
13718
+ }, t.prototype.YT = function(t, e) {
13719
+ var n = this.XT();
13720
+ return this.qT = new Ri(pe.Lt(), n, this.jT, this.BT), this.qT.start(t, e);
13721
+ }, t.prototype.HT = function(t) {
13724
13722
  var e = new fe(t, {
13725
13723
  dn: pe.Lt().dn
13726
13724
  });
13727
13725
  return new Cn(e, (function(e) {
13728
- if (e instanceof qi) {
13729
- var n = t, r = e.firestore.KT;
13726
+ if (e instanceof Fi) {
13727
+ var n = t, r = e.firestore.OT;
13730
13728
  if (!r.isEqual(n)) throw new c(h.INVALID_ARGUMENT, "Document reference is for database " + r.projectId + "/" + r.database + " but should be for database " + n.projectId + "/" + n.database);
13731
- return new Pn(t, e.um);
13729
+ return new Pn(t, e.em);
13732
13730
  }
13733
13731
  return e;
13734
13732
  }));
13735
- }, t.YT = function(t) {
13733
+ }, t.QT = function(t) {
13736
13734
  if (e = t.options, "projectId", !Object.prototype.hasOwnProperty.call(e, "projectId")) throw new c(h.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
13737
13735
  var e, n = t.options.projectId;
13738
13736
  // Export the classes with a private constructor (it will fail if invoked
@@ -13743,29 +13741,29 @@ var Li = /** @class */ function() {
13743
13741
  return new Se(n);
13744
13742
  }, Object.defineProperty(t.prototype, "app", {
13745
13743
  get: function() {
13746
- if (!this.GT) throw new c(h.FAILED_PRECONDITION, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
13747
- return this.GT;
13744
+ if (!this.xT) throw new c(h.FAILED_PRECONDITION, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
13745
+ return this.xT;
13748
13746
  },
13749
13747
  enumerable: !0,
13750
13748
  configurable: !0
13751
13749
  }), t.prototype.collection = function(t) {
13752
13750
  return Ze("Firestore.collection", arguments, 1), en("Firestore.collection", "non-empty string", 1, t),
13753
- this.HT(), new Ki(w.G(t), this);
13751
+ this.UT(), new Wi(w.G(t), this);
13754
13752
  }, t.prototype.doc = function(t) {
13755
13753
  return Ze("Firestore.doc", arguments, 1), en("Firestore.doc", "non-empty string", 1, t),
13756
- this.HT(), qi.cm(w.G(t), this);
13754
+ this.UT(), Fi.sm(w.G(t), this);
13757
13755
  }, t.prototype.collectionGroup = function(t) {
13758
13756
  if (Ze("Firestore.collectionGroup", arguments, 1), en("Firestore.collectionGroup", "non-empty string", 1, t),
13759
13757
  t.indexOf("/") >= 0) throw new c(h.INVALID_ARGUMENT, "Invalid collection ID '" + t + "' passed to function Firestore.collectionGroup(). Collection IDs must not contain '/'.");
13760
- return this.HT(), new Bi(new bt(w.H, t), this);
13758
+ return this.UT(), new zi(new bt(w.H, t), this);
13761
13759
  }, t.prototype.runTransaction = function(t) {
13762
13760
  var e = this;
13763
13761
  return Ze("Firestore.runTransaction", arguments, 1), en("Firestore.runTransaction", "function", 1, t),
13764
- this.HT().transaction((function(n) {
13765
- return t(new Ci(e, n));
13762
+ this.UT().transaction((function(n) {
13763
+ return t(new Mi(e, n));
13766
13764
  }));
13767
13765
  }, t.prototype.batch = function() {
13768
- return this.HT(), new Mi(this);
13766
+ return this.UT(), new qi(this);
13769
13767
  }, Object.defineProperty(t, "logLevel", {
13770
13768
  get: function() {
13771
13769
  switch (ye()) {
@@ -13803,92 +13801,92 @@ var Li = /** @class */ function() {
13803
13801
  },
13804
13802
  // Note: this is not a property because the minifier can't work correctly with
13805
13803
  // the way TypeScript compiler outputs properties.
13806
- t.prototype._m = function() {
13807
- return this.em.timestampsInSnapshots;
13804
+ t.prototype.nm = function() {
13805
+ return this.GT.timestampsInSnapshots;
13808
13806
  }, t;
13809
- }(), Ci = /** @class */ function() {
13807
+ }(), Mi = /** @class */ function() {
13810
13808
  function t(t, e) {
13811
- this.lm = t, this.dm = e;
13809
+ this.im = t, this.rm = e;
13812
13810
  }
13813
13811
  return t.prototype.get = function(t) {
13814
13812
  var e = this;
13815
13813
  Ze("Transaction.get", arguments, 1);
13816
- var n = Ji("Transaction.get", t, this.lm);
13817
- return this.dm.pu([ n.um ]).then((function(t) {
13814
+ var n = Hi("Transaction.get", t, this.im);
13815
+ return this.rm.pu([ n.em ]).then((function(t) {
13818
13816
  if (!t || 1 !== t.length) return _e("Mismatch in docs returned from document lookup.");
13819
13817
  var r = t[0];
13820
- if (r instanceof gt) return new ji(e.lm, n.um, null,
13818
+ if (r instanceof gt) return new Gi(e.im, n.em, null,
13821
13819
  /* fromCache= */ !1,
13822
- /* hasPendingWrites= */ !1, n.fm);
13823
- if (r instanceof vt) return new ji(e.lm, n.um, r,
13820
+ /* hasPendingWrites= */ !1, n.om);
13821
+ if (r instanceof vt) return new Gi(e.im, n.em, r,
13824
13822
  /* fromCache= */ !1,
13825
- /* hasPendingWrites= */ !1, n.fm);
13823
+ /* hasPendingWrites= */ !1, n.om);
13826
13824
  throw _e("BatchGetDocumentsRequest returned unexpected document type: " + r.constructor.name);
13827
13825
  }));
13828
13826
  }, t.prototype.set = function(t, e, n) {
13829
13827
  tn("Transaction.set", arguments, 2, 3);
13830
- var r = Ji("Transaction.set", t, this.lm);
13831
- n = Wi("Transaction.set", n);
13832
- var i = Xi(r.fm, e, "Transaction.set"), o = i[0], s = i[1], u = n.merge || n.mergeFields ? this.lm.sm.pa(s, o, n.mergeFields) : this.lm.sm.Va(s, o);
13833
- return this.dm.set(r.um, u), this;
13828
+ var r = Hi("Transaction.set", t, this.im);
13829
+ n = Yi("Transaction.set", n);
13830
+ var i = Zi(r.om, e, "Transaction.set"), o = i[0], s = i[1], u = n.merge || n.mergeFields ? this.im.zT.pa(s, o, n.mergeFields) : this.im.zT.Va(s, o);
13831
+ return this.rm.set(r.em, u), this;
13834
13832
  }, t.prototype.update = function(t, e, n) {
13835
13833
  for (var r, i, o = [], s = 3; s < arguments.length; s++) o[s - 3] = arguments[s];
13836
13834
  return "string" == typeof e || e instanceof bn ? ($e("Transaction.update", arguments, 3),
13837
- r = Ji("Transaction.update", t, this.lm), i = this.lm.sm.Sa("Transaction.update", e, n, o)) : (Ze("Transaction.update", arguments, 2),
13838
- r = Ji("Transaction.update", t, this.lm), i = this.lm.sm.ya("Transaction.update", e)),
13839
- this.dm.update(r.um, i), this;
13835
+ r = Hi("Transaction.update", t, this.im), i = this.im.zT.Sa("Transaction.update", e, n, o)) : (Ze("Transaction.update", arguments, 2),
13836
+ r = Hi("Transaction.update", t, this.im), i = this.im.zT.ya("Transaction.update", e)),
13837
+ this.rm.update(r.em, i), this;
13840
13838
  }, t.prototype.delete = function(t) {
13841
13839
  Ze("Transaction.delete", arguments, 1);
13842
- var e = Ji("Transaction.delete", t, this.lm);
13843
- return this.dm.delete(e.um), this;
13840
+ var e = Hi("Transaction.delete", t, this.im);
13841
+ return this.rm.delete(e.em), this;
13844
13842
  }, t;
13845
- }(), Mi = /** @class */ function() {
13843
+ }(), qi = /** @class */ function() {
13846
13844
  function t(t) {
13847
- this.lm = t, this.Tm = [], this.mm = !1;
13845
+ this.im = t, this.hm = [], this.am = !1;
13848
13846
  }
13849
13847
  return t.prototype.set = function(t, e, n) {
13850
- tn("WriteBatch.set", arguments, 2, 3), this.Em();
13851
- var r = Ji("WriteBatch.set", t, this.lm);
13852
- n = Wi("WriteBatch.set", n);
13853
- var i = Xi(r.fm, e, "WriteBatch.set"), o = i[0], s = i[1], u = n.merge || n.mergeFields ? this.lm.sm.pa(s, o, n.mergeFields) : this.lm.sm.Va(s, o);
13854
- return this.Tm = this.Tm.concat(u.da(r.um, ut.NONE)), this;
13848
+ tn("WriteBatch.set", arguments, 2, 3), this.um();
13849
+ var r = Hi("WriteBatch.set", t, this.im);
13850
+ n = Yi("WriteBatch.set", n);
13851
+ var i = Zi(r.om, e, "WriteBatch.set"), o = i[0], s = i[1], u = n.merge || n.mergeFields ? this.im.zT.pa(s, o, n.mergeFields) : this.im.zT.Va(s, o);
13852
+ return this.hm = this.hm.concat(u.da(r.em, ut.NONE)), this;
13855
13853
  }, t.prototype.update = function(t, e, n) {
13856
13854
  for (var r, i, o = [], s = 3; s < arguments.length; s++) o[s - 3] = arguments[s];
13857
- return this.Em(), "string" == typeof e || e instanceof bn ? ($e("WriteBatch.update", arguments, 3),
13858
- r = Ji("WriteBatch.update", t, this.lm), i = this.lm.sm.Sa("WriteBatch.update", e, n, o)) : (Ze("WriteBatch.update", arguments, 2),
13859
- r = Ji("WriteBatch.update", t, this.lm), i = this.lm.sm.ya("WriteBatch.update", e)),
13860
- this.Tm = this.Tm.concat(i.da(r.um, ut.exists(!0))), this;
13855
+ return this.um(), "string" == typeof e || e instanceof bn ? ($e("WriteBatch.update", arguments, 3),
13856
+ r = Hi("WriteBatch.update", t, this.im), i = this.im.zT.Sa("WriteBatch.update", e, n, o)) : (Ze("WriteBatch.update", arguments, 2),
13857
+ r = Hi("WriteBatch.update", t, this.im), i = this.im.zT.ya("WriteBatch.update", e)),
13858
+ this.hm = this.hm.concat(i.da(r.em, ut.exists(!0))), this;
13861
13859
  }, t.prototype.delete = function(t) {
13862
- Ze("WriteBatch.delete", arguments, 1), this.Em();
13863
- var e = Ji("WriteBatch.delete", t, this.lm);
13864
- return this.Tm = this.Tm.concat(new lt(e.um, ut.NONE)), this;
13860
+ Ze("WriteBatch.delete", arguments, 1), this.um();
13861
+ var e = Hi("WriteBatch.delete", t, this.im);
13862
+ return this.hm = this.hm.concat(new lt(e.em, ut.NONE)), this;
13865
13863
  }, t.prototype.commit = function() {
13866
- return this.Em(), this.mm = !0, this.Tm.length > 0 ? this.lm.HT().write(this.Tm) : Promise.resolve();
13867
- }, t.prototype.Em = function() {
13868
- if (this.mm) throw new c(h.FAILED_PRECONDITION, "A write batch can no longer be used after commit() has been called.");
13864
+ return this.um(), this.am = !0, this.hm.length > 0 ? this.im.UT().write(this.hm) : Promise.resolve();
13865
+ }, t.prototype.um = function() {
13866
+ if (this.am) throw new c(h.FAILED_PRECONDITION, "A write batch can no longer be used after commit() has been called.");
13869
13867
  }, t;
13870
- }(), qi = /** @class */ function() {
13868
+ }(), Fi = /** @class */ function() {
13871
13869
  function t(t, e, n) {
13872
- this.um = t, this.firestore = e, this.fm = n, this.JT = this.firestore.HT();
13870
+ this.em = t, this.firestore = e, this.om = n, this.qT = this.firestore.UT();
13873
13871
  }
13874
- return t.cm = function(e, n, r) {
13872
+ return t.sm = function(e, n, r) {
13875
13873
  if (e.length % 2 != 0) throw new c(h.INVALID_ARGUMENT, "Invalid document reference. Document references must have an even number of segments, but " + e.K() + " has " + e.length);
13876
13874
  return new t(new T(e), n, r);
13877
13875
  }, Object.defineProperty(t.prototype, "id", {
13878
13876
  get: function() {
13879
- return this.um.path.B();
13877
+ return this.em.path.B();
13880
13878
  },
13881
13879
  enumerable: !0,
13882
13880
  configurable: !0
13883
13881
  }), Object.defineProperty(t.prototype, "parent", {
13884
13882
  get: function() {
13885
- return new Ki(this.um.path.L(), this.firestore, this.fm);
13883
+ return new Wi(this.em.path.L(), this.firestore, this.om);
13886
13884
  },
13887
13885
  enumerable: !0,
13888
13886
  configurable: !0
13889
13887
  }), Object.defineProperty(t.prototype, "path", {
13890
13888
  get: function() {
13891
- return this.um.path.K();
13889
+ return this.em.path.K();
13892
13890
  },
13893
13891
  enumerable: !0,
13894
13892
  configurable: !0
@@ -13896,68 +13894,68 @@ var Li = /** @class */ function() {
13896
13894
  if (Ze("DocumentReference.collection", arguments, 1), en("DocumentReference.collection", "non-empty string", 1, t),
13897
13895
  !t) throw new c(h.INVALID_ARGUMENT, "Must provide a non-empty collection name to collection()");
13898
13896
  var e = w.G(t);
13899
- return new Ki(this.um.path.child(e), this.firestore);
13897
+ return new Wi(this.em.path.child(e), this.firestore);
13900
13898
  }, t.prototype.isEqual = function(e) {
13901
13899
  if (!(e instanceof t)) throw ln("isEqual", "DocumentReference", 1, e);
13902
- return this.firestore === e.firestore && this.um.isEqual(e.um) && this.fm === e.fm;
13900
+ return this.firestore === e.firestore && this.em.isEqual(e.em) && this.om === e.om;
13903
13901
  }, t.prototype.set = function(t, e) {
13904
- tn("DocumentReference.set", arguments, 1, 2), e = Wi("DocumentReference.set", e);
13905
- var n = Xi(this.fm, t, "DocumentReference.set"), r = n[0], i = n[1], o = e.merge || e.mergeFields ? this.firestore.sm.pa(i, r, e.mergeFields) : this.firestore.sm.Va(i, r);
13906
- return this.JT.write(o.da(this.um, ut.NONE));
13902
+ tn("DocumentReference.set", arguments, 1, 2), e = Yi("DocumentReference.set", e);
13903
+ var n = Zi(this.om, t, "DocumentReference.set"), r = n[0], i = n[1], o = e.merge || e.mergeFields ? this.firestore.zT.pa(i, r, e.mergeFields) : this.firestore.zT.Va(i, r);
13904
+ return this.qT.write(o.da(this.em, ut.NONE));
13907
13905
  }, t.prototype.update = function(t, e) {
13908
13906
  for (var n, r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
13909
13907
  return "string" == typeof t || t instanceof bn ? ($e("DocumentReference.update", arguments, 2),
13910
- n = this.firestore.sm.Sa("DocumentReference.update", t, e, r)) : (Ze("DocumentReference.update", arguments, 1),
13911
- n = this.firestore.sm.ya("DocumentReference.update", t)), this.JT.write(n.da(this.um, ut.exists(!0)));
13908
+ n = this.firestore.zT.Sa("DocumentReference.update", t, e, r)) : (Ze("DocumentReference.update", arguments, 1),
13909
+ n = this.firestore.zT.ya("DocumentReference.update", t)), this.qT.write(n.da(this.em, ut.exists(!0)));
13912
13910
  }, t.prototype.delete = function() {
13913
- return Ze("DocumentReference.delete", arguments, 0), this.JT.write([ new lt(this.um, ut.NONE) ]);
13911
+ return Ze("DocumentReference.delete", arguments, 0), this.qT.write([ new lt(this.em, ut.NONE) ]);
13914
13912
  }, t.prototype.onSnapshot = function() {
13915
13913
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
13916
13914
  tn("DocumentReference.onSnapshot", arguments, 1, 4);
13917
13915
  var n, r = {
13918
13916
  includeMetadataChanges: !1
13919
13917
  }, i = 0;
13920
- "object" != typeof t[i] || Vi(t[i]) || (fn("DocumentReference.onSnapshot", r = t[i], [ "includeMetadataChanges" ]),
13918
+ "object" != typeof t[i] || Ui(t[i]) || (fn("DocumentReference.onSnapshot", r = t[i], [ "includeMetadataChanges" ]),
13921
13919
  on("DocumentReference.onSnapshot", "boolean", "includeMetadataChanges", r.includeMetadataChanges),
13922
13920
  i++);
13923
13921
  var o = {
13924
13922
  includeMetadataChanges: r.includeMetadataChanges
13925
13923
  };
13926
- return Vi(t[i]) ? n = t[i] : (en("DocumentReference.onSnapshot", "function", i, t[i]),
13924
+ return Ui(t[i]) ? n = t[i] : (en("DocumentReference.onSnapshot", "function", i, t[i]),
13927
13925
  nn("DocumentReference.onSnapshot", "function", i + 1, t[i + 1]), nn("DocumentReference.onSnapshot", "function", i + 2, t[i + 2]),
13928
13926
  n = {
13929
13927
  next: t[i],
13930
13928
  error: t[i + 1],
13931
13929
  complete: t[i + 2]
13932
- }), this.wm(o, n);
13933
- }, t.prototype.wm = function(t, e) {
13930
+ }), this.cm(o, n);
13931
+ }, t.prototype.cm = function(t, e) {
13934
13932
  var n = this, r = function(t) {
13935
13933
  console.error("Uncaught Error in onSnapshot:", t);
13936
13934
  };
13937
13935
  e.error && (r = e.error.bind(e));
13938
- var i = new Ri({
13936
+ var i = new Li({
13939
13937
  next: function(t) {
13940
13938
  if (e.next) {
13941
- var r = t.docs.get(n.um);
13942
- e.next(new ji(n.firestore, n.um, r, t.fromCache, t.hasPendingWrites, n.fm));
13939
+ var r = t.docs.get(n.em);
13940
+ e.next(new Gi(n.firestore, n.em, r, t.fromCache, t.hasPendingWrites, n.om));
13943
13941
  }
13944
13942
  },
13945
13943
  error: r
13946
- }), o = this.JT.listen(bt.ve(this.um.path), i, t);
13944
+ }), o = this.qT.listen(bt.ve(this.em.path), i, t);
13947
13945
  return function() {
13948
- i.OT(), n.JT.fc(o);
13946
+ i.DT(), n.qT.fc(o);
13949
13947
  };
13950
13948
  }, t.prototype.get = function(t) {
13951
13949
  var e = this;
13952
- return tn("DocumentReference.get", arguments, 0, 1), Qi("DocumentReference.get", t),
13950
+ return tn("DocumentReference.get", arguments, 0, 1), Xi("DocumentReference.get", t),
13953
13951
  new Promise((function(n, r) {
13954
- t && "cache" === t.source ? e.firestore.HT().$T(e.um).then((function(t) {
13955
- n(new ji(e.firestore, e.um, t,
13956
- /*fromCache=*/ !0, t instanceof vt && t.te, e.fm));
13957
- }), r) : e.Im(n, r, t);
13952
+ t && "cache" === t.source ? e.firestore.UT().bT(e.em).then((function(t) {
13953
+ n(new Gi(e.firestore, e.em, t,
13954
+ /*fromCache=*/ !0, t instanceof vt && t.te, e.om));
13955
+ }), r) : e._m(n, r, t);
13958
13956
  }));
13959
- }, t.prototype.Im = function(t, e, n) {
13960
- var r = this.wm({
13957
+ }, t.prototype._m = function(t, e, n) {
13958
+ var r = this.cm({
13961
13959
  includeMetadataChanges: !0,
13962
13960
  Kl: !0
13963
13961
  }, {
@@ -13977,75 +13975,75 @@ var Li = /** @class */ function() {
13977
13975
  error: e
13978
13976
  });
13979
13977
  }, t.prototype.withConverter = function(e) {
13980
- return new t(this.um, this.firestore, e);
13978
+ return new t(this.em, this.firestore, e);
13981
13979
  }, t;
13982
- }(), Fi = /** @class */ function() {
13980
+ }(), ji = /** @class */ function() {
13983
13981
  function t(t, e) {
13984
13982
  this.hasPendingWrites = t, this.fromCache = e;
13985
13983
  }
13986
13984
  return t.prototype.isEqual = function(t) {
13987
13985
  return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;
13988
13986
  }, t;
13989
- }(), ji = /** @class */ function() {
13987
+ }(), Gi = /** @class */ function() {
13990
13988
  function t(t, e, n, r, i, o) {
13991
- this.lm = t, this.um = e, this.Rm = n, this.Am = r, this.Pm = i, this.fm = o;
13989
+ this.im = t, this.em = e, this.lm = n, this.dm = r, this.fm = i, this.om = o;
13992
13990
  }
13993
13991
  return t.prototype.data = function(t) {
13994
- if (tn("DocumentSnapshot.data", arguments, 0, 1), t = Yi("DocumentSnapshot.data", t),
13995
- this.Rm) {
13992
+ if (tn("DocumentSnapshot.data", arguments, 0, 1), t = Qi("DocumentSnapshot.data", t),
13993
+ this.lm) {
13996
13994
  // We only want to use the converter and create a new DocumentSnapshot
13997
13995
  // if a converter has been provided.
13998
- if (this.fm) {
13999
- var e = new Gi(this.lm, this.um, this.Rm, this.Am, this.Pm);
14000
- return this.fm.fromFirestore(e, t);
13996
+ if (this.om) {
13997
+ var e = new Bi(this.im, this.em, this.lm, this.dm, this.fm);
13998
+ return this.om.fromFirestore(e, t);
14001
13999
  }
14002
- return new Li(this.lm, this.lm._m(), t.serverTimestamps,
14003
- /* converter= */ void 0).BT(this.Rm.Ie());
14000
+ return new Vi(this.im, this.im.nm(), t.serverTimestamps,
14001
+ /* converter= */ void 0).kT(this.lm.Ie());
14004
14002
  }
14005
14003
  }, t.prototype.get = function(t, e) {
14006
- if (tn("DocumentSnapshot.get", arguments, 1, 2), e = Yi("DocumentSnapshot.get", e),
14007
- this.Rm) {
14008
- var n = this.Rm.data().field(Fn("DocumentSnapshot.get", t));
14009
- if (null !== n) return new Li(this.lm, this.lm._m(), e.serverTimestamps, this.fm).BT(n);
14004
+ if (tn("DocumentSnapshot.get", arguments, 1, 2), e = Qi("DocumentSnapshot.get", e),
14005
+ this.lm) {
14006
+ var n = this.lm.data().field(Fn("DocumentSnapshot.get", t));
14007
+ if (null !== n) return new Vi(this.im, this.im.nm(), e.serverTimestamps, this.om).kT(n);
14010
14008
  }
14011
14009
  }, Object.defineProperty(t.prototype, "id", {
14012
14010
  get: function() {
14013
- return this.um.path.B();
14011
+ return this.em.path.B();
14014
14012
  },
14015
14013
  enumerable: !0,
14016
14014
  configurable: !0
14017
14015
  }), Object.defineProperty(t.prototype, "ref", {
14018
14016
  get: function() {
14019
- return new qi(this.um, this.lm, this.fm);
14017
+ return new Fi(this.em, this.im, this.om);
14020
14018
  },
14021
14019
  enumerable: !0,
14022
14020
  configurable: !0
14023
14021
  }), Object.defineProperty(t.prototype, "exists", {
14024
14022
  get: function() {
14025
- return null !== this.Rm;
14023
+ return null !== this.lm;
14026
14024
  },
14027
14025
  enumerable: !0,
14028
14026
  configurable: !0
14029
14027
  }), Object.defineProperty(t.prototype, "metadata", {
14030
14028
  get: function() {
14031
- return new Fi(this.Pm, this.Am);
14029
+ return new ji(this.fm, this.dm);
14032
14030
  },
14033
14031
  enumerable: !0,
14034
14032
  configurable: !0
14035
14033
  }), t.prototype.isEqual = function(e) {
14036
14034
  if (!(e instanceof t)) throw ln("isEqual", "DocumentSnapshot", 1, e);
14037
- return this.lm === e.lm && this.Am === e.Am && this.um.isEqual(e.um) && (null === this.Rm ? null === e.Rm : this.Rm.isEqual(e.Rm)) && this.fm === e.fm;
14035
+ return this.im === e.im && this.dm === e.dm && this.em.isEqual(e.em) && (null === this.lm ? null === e.lm : this.lm.isEqual(e.lm)) && this.om === e.om;
14038
14036
  }, t;
14039
- }(), Gi = /** @class */ function(t) {
14037
+ }(), Bi = /** @class */ function(t) {
14040
14038
  function n() {
14041
14039
  return null !== t && t.apply(this, arguments) || this;
14042
14040
  }
14043
14041
  return e.__extends(n, t), n.prototype.data = function(e) {
14044
14042
  return t.prototype.data.call(this, e);
14045
14043
  }, n;
14046
- }(ji), Bi = /** @class */ function() {
14044
+ }(Gi), zi = /** @class */ function() {
14047
14045
  function t(t, e, n) {
14048
- this.Vm = t, this.firestore = e, this.fm = n;
14046
+ this.Tm = t, this.firestore = e, this.om = n;
14049
14047
  }
14050
14048
  return t.prototype.where = function(e, n, r) {
14051
14049
  var i;
@@ -14058,22 +14056,22 @@ var Li = /** @class */ function() {
14058
14056
  if (o.Y()) {
14059
14057
  if (s === Tt.ARRAY_CONTAINS || s === Tt.ARRAY_CONTAINS_ANY) throw new c(h.INVALID_ARGUMENT, "Invalid Query. You can't perform '" + s.toString() + "' queries on FieldPath.documentId().");
14060
14058
  if (s === Tt.IN) {
14061
- this.gm(r, s);
14059
+ this.mm(r, s);
14062
14060
  for (var u = [], a = 0, f = r; a < f.length; a++) {
14063
14061
  var l = f[a];
14064
- u.push(this.pm(l));
14062
+ u.push(this.wm(l));
14065
14063
  }
14066
14064
  i = {
14067
14065
  arrayValue: {
14068
14066
  values: u
14069
14067
  }
14070
14068
  };
14071
- } else i = this.pm(r);
14072
- } else s !== Tt.IN && s !== Tt.ARRAY_CONTAINS_ANY || this.gm(r, s), i = this.firestore.sm.Da("Query.where", r,
14069
+ } else i = this.wm(r);
14070
+ } else s !== Tt.IN && s !== Tt.ARRAY_CONTAINS_ANY || this.mm(r, s), i = this.firestore.zT.Da("Query.where", r,
14073
14071
  // We only allow nested arrays for IN queries.
14074
14072
  /** allowArrays = */ s === Tt.IN);
14075
- var p = It.create(o, s, i);
14076
- return this.ym(p), new t(this.Vm.Ce(p), this.firestore, this.fm);
14073
+ var p = Et.create(o, s, i);
14074
+ return this.Em(p), new t(this.Tm.Ce(p), this.firestore, this.om);
14077
14075
  }, t.prototype.orderBy = function(e, n) {
14078
14076
  var r;
14079
14077
  if (tn("Query.orderBy", arguments, 1, 2), nn("Query.orderBy", "non-empty string", 2, n),
@@ -14081,55 +14079,55 @@ var Li = /** @class */ function() {
14081
14079
  if ("desc" !== n) throw new c(h.INVALID_ARGUMENT, "Function Query.orderBy() has unknown direction '" + n + "', expected 'asc' or 'desc'.");
14082
14080
  r = kt.DESCENDING;
14083
14081
  }
14084
- if (null !== this.Vm.startAt) throw new c(h.INVALID_ARGUMENT, "Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().");
14085
- if (null !== this.Vm.endAt) throw new c(h.INVALID_ARGUMENT, "Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().");
14086
- var i = Fn("Query.orderBy", e), o = new Lt(i, r);
14087
- return this.bm(o), new t(this.Vm.ke(o), this.firestore, this.fm);
14082
+ if (null !== this.Tm.startAt) throw new c(h.INVALID_ARGUMENT, "Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().");
14083
+ if (null !== this.Tm.endAt) throw new c(h.INVALID_ARGUMENT, "Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().");
14084
+ var i = Fn("Query.orderBy", e), o = new Ut(i, r);
14085
+ return this.Im(o), new t(this.Tm.ke(o), this.firestore, this.om);
14088
14086
  }, t.prototype.limit = function(e) {
14089
14087
  return Ze("Query.limit", arguments, 1), en("Query.limit", "number", 1, e), pn("Query.limit", 1, e),
14090
- new t(this.Vm.Ne(e), this.firestore, this.fm);
14088
+ new t(this.Tm.Ne(e), this.firestore, this.om);
14091
14089
  }, t.prototype.limitToLast = function(e) {
14092
14090
  return Ze("Query.limitToLast", arguments, 1), en("Query.limitToLast", "number", 1, e),
14093
- pn("Query.limitToLast", 1, e), new t(this.Vm.Fe(e), this.firestore, this.fm);
14091
+ pn("Query.limitToLast", 1, e), new t(this.Tm.Fe(e), this.firestore, this.om);
14094
14092
  }, t.prototype.startAt = function(e) {
14095
14093
  for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];
14096
14094
  $e("Query.startAt", arguments, 1);
14097
- var i = this.vm("Query.startAt", e, n,
14095
+ var i = this.Rm("Query.startAt", e, n,
14098
14096
  /*before=*/ !0);
14099
- return new t(this.Vm.$e(i), this.firestore, this.fm);
14097
+ return new t(this.Tm.$e(i), this.firestore, this.om);
14100
14098
  }, t.prototype.startAfter = function(e) {
14101
14099
  for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];
14102
14100
  $e("Query.startAfter", arguments, 1);
14103
- var i = this.vm("Query.startAfter", e, n,
14101
+ var i = this.Rm("Query.startAfter", e, n,
14104
14102
  /*before=*/ !1);
14105
- return new t(this.Vm.$e(i), this.firestore, this.fm);
14103
+ return new t(this.Tm.$e(i), this.firestore, this.om);
14106
14104
  }, t.prototype.endBefore = function(e) {
14107
14105
  for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];
14108
14106
  $e("Query.endBefore", arguments, 1);
14109
- var i = this.vm("Query.endBefore", e, n,
14107
+ var i = this.Rm("Query.endBefore", e, n,
14110
14108
  /*before=*/ !0);
14111
- return new t(this.Vm.Me(i), this.firestore, this.fm);
14109
+ return new t(this.Tm.Me(i), this.firestore, this.om);
14112
14110
  }, t.prototype.endAt = function(e) {
14113
14111
  for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];
14114
14112
  $e("Query.endAt", arguments, 1);
14115
- var i = this.vm("Query.endAt", e, n,
14113
+ var i = this.Rm("Query.endAt", e, n,
14116
14114
  /*before=*/ !1);
14117
- return new t(this.Vm.Me(i), this.firestore, this.fm);
14115
+ return new t(this.Tm.Me(i), this.firestore, this.om);
14118
14116
  }, t.prototype.isEqual = function(e) {
14119
14117
  if (!(e instanceof t)) throw ln("isEqual", "Query", 1, e);
14120
- return this.firestore === e.firestore && this.Vm.isEqual(e.Vm);
14118
+ return this.firestore === e.firestore && this.Tm.isEqual(e.Tm);
14121
14119
  }, t.prototype.withConverter = function(e) {
14122
- return new t(this.Vm, this.firestore, e);
14120
+ return new t(this.Tm, this.firestore, e);
14123
14121
  },
14124
- /** Helper function to create a bound from a document or fields */ t.prototype.vm = function(t, e, n, r) {
14125
- if (cn(t, 1, e), e instanceof ji) {
14122
+ /** Helper function to create a bound from a document or fields */ t.prototype.Rm = function(t, e, n, r) {
14123
+ if (cn(t, 1, e), e instanceof Gi) {
14126
14124
  if (n.length > 0) throw new c(h.INVALID_ARGUMENT, "Too many arguments provided to " + t + "().");
14127
14125
  var i = e;
14128
14126
  if (!i.exists) throw new c(h.NOT_FOUND, "Can't use a DocumentSnapshot that doesn't exist for " + t + "().");
14129
- return this.Sm(i.Rm, r);
14127
+ return this.Am(i.lm, r);
14130
14128
  }
14131
14129
  var o = [ e ].concat(n);
14132
- return this.Dm(t, o, r);
14130
+ return this.Pm(t, o, r);
14133
14131
  },
14134
14132
  /**
14135
14133
  * Create a Bound from a query and a document.
@@ -14142,7 +14140,7 @@ var Li = /** @class */ function() {
14142
14140
  * of the query or if any of the fields in the order by are an uncommitted
14143
14141
  * server timestamp.
14144
14142
  */
14145
- t.prototype.Sm = function(t, e) {
14143
+ t.prototype.Am = function(t, e) {
14146
14144
  // Because people expect to continue/end a query at the exact document
14147
14145
  // provided, we need to use the implicit sort order rather than the explicit
14148
14146
  // sort order, because it's guaranteed to contain the document key. That way
@@ -14150,9 +14148,9 @@ var Li = /** @class */ function() {
14150
14148
  // the provided document. Without the key (by using the explicit sort
14151
14149
  // orders), multiple documents could match the position, yielding duplicate
14152
14150
  // results.
14153
- for (var n = [], r = 0, i = this.Vm.orderBy; r < i.length; r++) {
14151
+ for (var n = [], r = 0, i = this.Tm.orderBy; r < i.length; r++) {
14154
14152
  var o = i[r];
14155
- if (o.field.Y()) n.push(Y(this.firestore.KT, t.key)); else {
14153
+ if (o.field.Y()) n.push(Y(this.firestore.OT, t.key)); else {
14156
14154
  var s = t.field(o.field);
14157
14155
  if (O(s)) throw new c(h.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field "' + o.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
14158
14156
  if (null === s) {
@@ -14162,67 +14160,67 @@ var Li = /** @class */ function() {
14162
14160
  n.push(s);
14163
14161
  }
14164
14162
  }
14165
- return new Vt(n, e);
14163
+ return new Lt(n, e);
14166
14164
  },
14167
14165
  /**
14168
14166
  * Converts a list of field values to a Bound for the given query.
14169
14167
  */
14170
- t.prototype.Dm = function(t, e, n) {
14168
+ t.prototype.Pm = function(t, e, n) {
14171
14169
  // Use explicit order by's because it has to match the query the user made
14172
- var r = this.Vm.Ve;
14170
+ var r = this.Tm.Ve;
14173
14171
  if (e.length > r.length) throw new c(h.INVALID_ARGUMENT, "Too many arguments provided to " + t + "(). The number of arguments must be less than or equal to the number of Query.orderBy() clauses");
14174
14172
  for (var i = [], o = 0; o < e.length; o++) {
14175
14173
  var s = e[o];
14176
14174
  if (r[o].field.Y()) {
14177
14175
  if ("string" != typeof s) throw new c(h.INVALID_ARGUMENT, "Invalid query. Expected a string for document ID in " + t + "(), but got a " + typeof s);
14178
- if (!this.Vm.He() && -1 !== s.indexOf("/")) throw new c(h.INVALID_ARGUMENT, "Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to " + t + "() must be a plain document ID, but '" + s + "' contains a slash.");
14179
- var u = this.Vm.path.child(w.G(s));
14176
+ if (!this.Tm.He() && -1 !== s.indexOf("/")) throw new c(h.INVALID_ARGUMENT, "Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to " + t + "() must be a plain document ID, but '" + s + "' contains a slash.");
14177
+ var u = this.Tm.path.child(w.G(s));
14180
14178
  if (!T.st(u)) throw new c(h.INVALID_ARGUMENT, "Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to " + t + "() must result in a valid document path, but '" + u + "' is not because it contains an odd number of segments.");
14181
14179
  var a = new T(u);
14182
- i.push(Y(this.firestore.KT, a));
14180
+ i.push(Y(this.firestore.OT, a));
14183
14181
  } else {
14184
- var f = this.firestore.sm.Da(t, s);
14182
+ var f = this.firestore.zT.Da(t, s);
14185
14183
  i.push(f);
14186
14184
  }
14187
14185
  }
14188
- return new Vt(i, n);
14186
+ return new Lt(i, n);
14189
14187
  }, t.prototype.onSnapshot = function() {
14190
14188
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
14191
14189
  tn("Query.onSnapshot", arguments, 1, 4);
14192
14190
  var n, r = {}, i = 0;
14193
- return "object" != typeof t[i] || Vi(t[i]) || (fn("Query.onSnapshot", r = t[i], [ "includeMetadataChanges" ]),
14191
+ return "object" != typeof t[i] || Ui(t[i]) || (fn("Query.onSnapshot", r = t[i], [ "includeMetadataChanges" ]),
14194
14192
  on("Query.onSnapshot", "boolean", "includeMetadataChanges", r.includeMetadataChanges),
14195
- i++), Vi(t[i]) ? n = t[i] : (en("Query.onSnapshot", "function", i, t[i]), nn("Query.onSnapshot", "function", i + 1, t[i + 1]),
14193
+ i++), Ui(t[i]) ? n = t[i] : (en("Query.onSnapshot", "function", i, t[i]), nn("Query.onSnapshot", "function", i + 1, t[i + 1]),
14196
14194
  nn("Query.onSnapshot", "function", i + 2, t[i + 2]), n = {
14197
14195
  next: t[i],
14198
14196
  error: t[i + 1],
14199
14197
  complete: t[i + 2]
14200
- }), this.Cm(this.Vm), this.wm(r, n);
14201
- }, t.prototype.wm = function(t, e) {
14198
+ }), this.Vm(this.Tm), this.cm(r, n);
14199
+ }, t.prototype.cm = function(t, e) {
14202
14200
  var n = this, r = function(t) {
14203
14201
  console.error("Uncaught Error in onSnapshot:", t);
14204
14202
  };
14205
14203
  e.error && (r = e.error.bind(e));
14206
- var i = new Ri({
14204
+ var i = new Li({
14207
14205
  next: function(t) {
14208
- e.next && e.next(new zi(n.firestore, n.Vm, t, n.fm));
14206
+ e.next && e.next(new Ki(n.firestore, n.Tm, t, n.om));
14209
14207
  },
14210
14208
  error: r
14211
- }), o = this.firestore.HT(), s = o.listen(this.Vm, i, t);
14209
+ }), o = this.firestore.UT(), s = o.listen(this.Tm, i, t);
14212
14210
  return function() {
14213
- i.OT(), o.fc(s);
14211
+ i.DT(), o.fc(s);
14214
14212
  };
14215
- }, t.prototype.Cm = function(t) {
14213
+ }, t.prototype.Vm = function(t) {
14216
14214
  if (t.Ke() && 0 === t.Ve.length) throw new c(h.UNIMPLEMENTED, "limitToLast() queries require specifying at least one orderBy() clause");
14217
14215
  }, t.prototype.get = function(t) {
14218
14216
  var e = this;
14219
- return tn("Query.get", arguments, 0, 1), Qi("Query.get", t), this.Cm(this.Vm), new Promise((function(n, r) {
14220
- t && "cache" === t.source ? e.firestore.HT().MT(e.Vm).then((function(t) {
14221
- n(new zi(e.firestore, e.Vm, t, e.fm));
14222
- }), r) : e.Im(n, r, t);
14217
+ return tn("Query.get", arguments, 0, 1), Xi("Query.get", t), this.Vm(this.Tm), new Promise((function(n, r) {
14218
+ t && "cache" === t.source ? e.firestore.UT().vT(e.Tm).then((function(t) {
14219
+ n(new Ki(e.firestore, e.Tm, t, e.om));
14220
+ }), r) : e._m(n, r, t);
14223
14221
  }));
14224
- }, t.prototype.Im = function(t, e, n) {
14225
- var r = this.wm({
14222
+ }, t.prototype._m = function(t, e, n) {
14223
+ var r = this.cm({
14226
14224
  includeMetadataChanges: !0,
14227
14225
  Kl: !0
14228
14226
  }, {
@@ -14239,17 +14237,17 @@ var Li = /** @class */ function() {
14239
14237
  * appropriate errors if the value is anything other than a DocumentReference
14240
14238
  * or String, or if the string is malformed.
14241
14239
  */
14242
- t.prototype.pm = function(t) {
14240
+ t.prototype.wm = function(t) {
14243
14241
  if ("string" == typeof t) {
14244
14242
  if ("" === t) throw new c(h.INVALID_ARGUMENT, "Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");
14245
- if (!this.Vm.He() && -1 !== t.indexOf("/")) throw new c(h.INVALID_ARGUMENT, "Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '" + t + "' contains a '/' character.");
14246
- var e = this.Vm.path.child(w.G(t));
14243
+ if (!this.Tm.He() && -1 !== t.indexOf("/")) throw new c(h.INVALID_ARGUMENT, "Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '" + t + "' contains a '/' character.");
14244
+ var e = this.Tm.path.child(w.G(t));
14247
14245
  if (!T.st(e)) throw new c(h.INVALID_ARGUMENT, "Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '" + e + "' is not because it has an odd number of segments (" + e.length + ").");
14248
- return Y(this.firestore.KT, new T(e));
14246
+ return Y(this.firestore.OT, new T(e));
14249
14247
  }
14250
- if (t instanceof qi) {
14248
+ if (t instanceof Fi) {
14251
14249
  var n = t;
14252
- return Y(this.firestore.KT, n.um);
14250
+ return Y(this.firestore.OT, n.em);
14253
14251
  }
14254
14252
  throw new c(h.INVALID_ARGUMENT, "Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: " + hn(t) + ".");
14255
14253
  },
@@ -14257,43 +14255,43 @@ var Li = /** @class */ function() {
14257
14255
  * Validates that the value passed into a disjunctrive filter satisfies all
14258
14256
  * array requirements.
14259
14257
  */
14260
- t.prototype.gm = function(t, e) {
14258
+ t.prototype.mm = function(t, e) {
14261
14259
  if (!Array.isArray(t) || 0 === t.length) throw new c(h.INVALID_ARGUMENT, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
14262
14260
  if (t.length > 10) throw new c(h.INVALID_ARGUMENT, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
14263
14261
  if (t.indexOf(null) >= 0) throw new c(h.INVALID_ARGUMENT, "Invalid Query. '" + e.toString() + "' filters cannot contain 'null' in the value array.");
14264
14262
  if (t.filter((function(t) {
14265
14263
  return Number.isNaN(t);
14266
14264
  })).length > 0) throw new c(h.INVALID_ARGUMENT, "Invalid Query. '" + e.toString() + "' filters cannot contain 'NaN' in the value array.");
14267
- }, t.prototype.ym = function(t) {
14268
- if (t instanceof It) {
14265
+ }, t.prototype.Em = function(t) {
14266
+ if (t instanceof Et) {
14269
14267
  var e = [ Tt.ARRAY_CONTAINS, Tt.ARRAY_CONTAINS_ANY ], n = [ Tt.IN, Tt.ARRAY_CONTAINS_ANY ], r = e.indexOf(t.op) >= 0, i = n.indexOf(t.op) >= 0;
14270
14268
  if (t.Ge()) {
14271
- var o = this.Vm.Se();
14269
+ var o = this.Tm.Se();
14272
14270
  if (null !== o && !o.isEqual(t.field)) throw new c(h.INVALID_ARGUMENT, "Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '" + o.toString() + "' and '" + t.field.toString() + "'");
14273
- var s = this.Vm.De();
14274
- null !== s && this.km(t.field, s);
14271
+ var s = this.Tm.De();
14272
+ null !== s && this.gm(t.field, s);
14275
14273
  } else if (i || r) {
14276
14274
  // You can have at most 1 disjunctive filter and 1 array filter. Check if
14277
14275
  // the new filter conflicts with an existing one.
14278
14276
  var u = null;
14279
- if (i && (u = this.Vm.ze(n)), null === u && r && (u = this.Vm.ze(e)), null != u)
14277
+ if (i && (u = this.Tm.ze(n)), null === u && r && (u = this.Tm.ze(e)), null != u)
14280
14278
  // We special case when it's a duplicate op to give a slightly clearer error message.
14281
14279
  throw u === t.op ? new c(h.INVALID_ARGUMENT, "Invalid query. You cannot use more than one '" + t.op.toString() + "' filter.") : new c(h.INVALID_ARGUMENT, "Invalid query. You cannot use '" + t.op.toString() + "' filters with '" + u.toString() + "' filters.");
14282
14280
  }
14283
14281
  }
14284
- }, t.prototype.bm = function(t) {
14285
- if (null === this.Vm.De()) {
14282
+ }, t.prototype.Im = function(t) {
14283
+ if (null === this.Tm.De()) {
14286
14284
  // This is the first order by. It must match any inequality.
14287
- var e = this.Vm.Se();
14288
- null !== e && this.km(e, t.field);
14285
+ var e = this.Tm.Se();
14286
+ null !== e && this.gm(e, t.field);
14289
14287
  }
14290
- }, t.prototype.km = function(t, e) {
14288
+ }, t.prototype.gm = function(t, e) {
14291
14289
  if (!e.isEqual(t)) throw new c(h.INVALID_ARGUMENT, "Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '" + t.toString() + "' and so you must also use '" + t.toString() + "' as your first Query.orderBy(), but your first Query.orderBy() is on field '" + e.toString() + "' instead.");
14292
14290
  }, t;
14293
- }(), zi = /** @class */ function() {
14291
+ }(), Ki = /** @class */ function() {
14294
14292
  function t(t, e, n, r) {
14295
- this.lm = t, this.Nm = e, this.Fm = n, this.fm = r, this.$m = null, this.Mm = null,
14296
- this.metadata = new Fi(n.hasPendingWrites, n.fromCache);
14293
+ this.im = t, this.pm = e, this.ym = n, this.om = r, this.bm = null, this.vm = null,
14294
+ this.metadata = new ji(n.hasPendingWrites, n.fromCache);
14297
14295
  }
14298
14296
  return Object.defineProperty(t.prototype, "docs", {
14299
14297
  get: function() {
@@ -14306,33 +14304,33 @@ var Li = /** @class */ function() {
14306
14304
  configurable: !0
14307
14305
  }), Object.defineProperty(t.prototype, "empty", {
14308
14306
  get: function() {
14309
- return this.Fm.docs.U();
14307
+ return this.ym.docs.U();
14310
14308
  },
14311
14309
  enumerable: !0,
14312
14310
  configurable: !0
14313
14311
  }), Object.defineProperty(t.prototype, "size", {
14314
14312
  get: function() {
14315
- return this.Fm.docs.size;
14313
+ return this.ym.docs.size;
14316
14314
  },
14317
14315
  enumerable: !0,
14318
14316
  configurable: !0
14319
14317
  }), t.prototype.forEach = function(t, e) {
14320
14318
  var n = this;
14321
14319
  tn("QuerySnapshot.forEach", arguments, 1, 2), en("QuerySnapshot.forEach", "function", 1, t),
14322
- this.Fm.docs.forEach((function(r) {
14323
- t.call(e, n.Lm(r));
14320
+ this.ym.docs.forEach((function(r) {
14321
+ t.call(e, n.Sm(r));
14324
14322
  }));
14325
14323
  }, Object.defineProperty(t.prototype, "query", {
14326
14324
  get: function() {
14327
- return new Bi(this.Nm, this.lm, this.fm);
14325
+ return new zi(this.pm, this.im, this.om);
14328
14326
  },
14329
14327
  enumerable: !0,
14330
14328
  configurable: !0
14331
14329
  }), t.prototype.docChanges = function(t) {
14332
14330
  t && (fn("QuerySnapshot.docChanges", t, [ "includeMetadataChanges" ]), on("QuerySnapshot.docChanges", "boolean", "includeMetadataChanges", t.includeMetadataChanges));
14333
14331
  var e = !(!t || !t.includeMetadataChanges);
14334
- if (e && this.Fm.ds) throw new c(h.INVALID_ARGUMENT, "To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");
14335
- return this.$m && this.Mm === e || (this.$m =
14332
+ if (e && this.ym.ds) throw new c(h.INVALID_ARGUMENT, "To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");
14333
+ return this.bm && this.vm === e || (this.bm =
14336
14334
  /**
14337
14335
  * Calculates the array of firestore.DocumentChange's for a given ViewSnapshot.
14338
14336
  *
@@ -14344,7 +14342,7 @@ var Li = /** @class */ function() {
14344
14342
  // fast
14345
14343
  var i = 0;
14346
14344
  return n.docChanges.map((function(e) {
14347
- var o = new Gi(t, e.doc.key, e.doc, n.fromCache, n._s.has(e.doc.key), r);
14345
+ var o = new Bi(t, e.doc.key, e.doc, n.fromCache, n._s.has(e.doc.key), r);
14348
14346
  return e.doc, {
14349
14347
  type: "added",
14350
14348
  doc: o,
@@ -14359,45 +14357,45 @@ var Li = /** @class */ function() {
14359
14357
  return n.docChanges.filter((function(t) {
14360
14358
  return e || 3 /* Metadata */ !== t.type;
14361
14359
  })).map((function(e) {
14362
- var i = new Gi(t, e.doc.key, e.doc, n.fromCache, n._s.has(e.doc.key), r), s = -1, u = -1;
14360
+ var i = new Bi(t, e.doc.key, e.doc, n.fromCache, n._s.has(e.doc.key), r), s = -1, u = -1;
14363
14361
  return 0 /* Added */ !== e.type && (s = o.indexOf(e.doc.key), o = o.delete(e.doc.key)),
14364
14362
  1 /* Removed */ !== e.type && (u = (o = o.add(e.doc)).indexOf(e.doc.key)), {
14365
- type: Hi(e.type),
14363
+ type: Ji(e.type),
14366
14364
  doc: i,
14367
14365
  oldIndex: s,
14368
14366
  newIndex: u
14369
14367
  };
14370
14368
  }));
14371
- }(this.lm, e, this.Fm, this.fm), this.Mm = e), this.$m;
14369
+ }(this.im, e, this.ym, this.om), this.vm = e), this.bm;
14372
14370
  },
14373
14371
  /** Check the equality. The call can be very expensive. */ t.prototype.isEqual = function(e) {
14374
14372
  if (!(e instanceof t)) throw ln("isEqual", "QuerySnapshot", 1, e);
14375
- return this.lm === e.lm && this.Nm.isEqual(e.Nm) && this.Fm.isEqual(e.Fm) && this.fm === e.fm;
14376
- }, t.prototype.Lm = function(t) {
14377
- return new Gi(this.lm, t.key, t, this.metadata.fromCache, this.Fm._s.has(t.key), this.fm);
14373
+ return this.im === e.im && this.pm.isEqual(e.pm) && this.ym.isEqual(e.ym) && this.om === e.om;
14374
+ }, t.prototype.Sm = function(t) {
14375
+ return new Bi(this.im, t.key, t, this.metadata.fromCache, this.ym._s.has(t.key), this.om);
14378
14376
  }, t;
14379
- }(), Ki = /** @class */ function(t) {
14377
+ }(), Wi = /** @class */ function(t) {
14380
14378
  function n(e, n, r) {
14381
14379
  var i = this;
14382
- if ((i = t.call(this, bt.ve(e), n, r) || this).Om = e, e.length % 2 != 1) throw new c(h.INVALID_ARGUMENT, "Invalid collection reference. Collection references must have an odd number of segments, but " + e.K() + " has " + e.length);
14380
+ if ((i = t.call(this, bt.ve(e), n, r) || this).Dm = e, e.length % 2 != 1) throw new c(h.INVALID_ARGUMENT, "Invalid collection reference. Collection references must have an odd number of segments, but " + e.K() + " has " + e.length);
14383
14381
  return i;
14384
14382
  }
14385
14383
  return e.__extends(n, t), Object.defineProperty(n.prototype, "id", {
14386
14384
  get: function() {
14387
- return this.Vm.path.B();
14385
+ return this.Tm.path.B();
14388
14386
  },
14389
14387
  enumerable: !0,
14390
14388
  configurable: !0
14391
14389
  }), Object.defineProperty(n.prototype, "parent", {
14392
14390
  get: function() {
14393
- var t = this.Vm.path.L();
14394
- return t.U() ? null : new qi(new T(t), this.firestore);
14391
+ var t = this.Tm.path.L();
14392
+ return t.U() ? null : new Fi(new T(t), this.firestore);
14395
14393
  },
14396
14394
  enumerable: !0,
14397
14395
  configurable: !0
14398
14396
  }), Object.defineProperty(n.prototype, "path", {
14399
14397
  get: function() {
14400
- return this.Vm.path.K();
14398
+ return this.Tm.path.K();
14401
14399
  },
14402
14400
  enumerable: !0,
14403
14401
  configurable: !0
@@ -14408,17 +14406,17 @@ var Li = /** @class */ function() {
14408
14406
  0 === arguments.length && (t = Te.mi()), en("CollectionReference.doc", "non-empty string", 1, t),
14409
14407
  "" === t) throw new c(h.INVALID_ARGUMENT, "Document path must be a non-empty string");
14410
14408
  var e = w.G(t);
14411
- return qi.cm(this.Vm.path.child(e), this.firestore, this.fm);
14409
+ return Fi.sm(this.Tm.path.child(e), this.firestore, this.om);
14412
14410
  }, n.prototype.add = function(t) {
14413
- Ze("CollectionReference.add", arguments, 1), en("CollectionReference.add", "object", 1, this.fm ? this.fm.toFirestore(t) : t);
14411
+ Ze("CollectionReference.add", arguments, 1), en("CollectionReference.add", "object", 1, this.om ? this.om.toFirestore(t) : t);
14414
14412
  var e = this.doc();
14415
14413
  return e.set(t).then((function() {
14416
14414
  return e;
14417
14415
  }));
14418
14416
  }, n.prototype.withConverter = function(t) {
14419
- return new n(this.Om, this.firestore, t);
14417
+ return new n(this.Dm, this.firestore, t);
14420
14418
  }, n;
14421
- }(Bi);
14419
+ }(zi);
14422
14420
 
14423
14421
  /**
14424
14422
  * @license
@@ -14437,7 +14435,7 @@ var Li = /** @class */ function() {
14437
14435
  * limitations under the License.
14438
14436
  */
14439
14437
  // settings() defaults:
14440
- function Wi(t, e) {
14438
+ function Yi(t, e) {
14441
14439
  if (void 0 === e) return {
14442
14440
  merge: !1
14443
14441
  };
@@ -14452,24 +14450,24 @@ function Wi(t, e) {
14452
14450
  return e;
14453
14451
  }
14454
14452
 
14455
- function Yi(t, e) {
14453
+ function Qi(t, e) {
14456
14454
  return void 0 === e ? {} : (fn(t, e, [ "serverTimestamps" ]), sn(t, 0, "serverTimestamps", e.serverTimestamps, [ "estimate", "previous", "none" ]),
14457
14455
  e);
14458
14456
  }
14459
14457
 
14460
- function Qi(t, e) {
14458
+ function Xi(t, e) {
14461
14459
  nn(t, "object", 1, e), e && (fn(t, e, [ "source" ]), sn(t, 0, "source", e.source, [ "default", "server", "cache" ]));
14462
14460
  }
14463
14461
 
14464
- function Ji(t, e, n) {
14465
- if (e instanceof qi) {
14462
+ function Hi(t, e, n) {
14463
+ if (e instanceof Fi) {
14466
14464
  if (e.firestore !== n) throw new c(h.INVALID_ARGUMENT, "Provided document reference is from a different Firestore instance.");
14467
14465
  return e;
14468
14466
  }
14469
14467
  throw ln(t, "DocumentReference", 1, e);
14470
14468
  }
14471
14469
 
14472
- function Hi(t) {
14470
+ function Ji(t) {
14473
14471
  switch (t) {
14474
14472
  case 0 /* Added */ :
14475
14473
  return "added";
@@ -14494,58 +14492,58 @@ function Hi(t) {
14494
14492
  * because we want to provide the user with a more specific error message if
14495
14493
  * their set() or fails due to invalid data originating from a toFirestore()
14496
14494
  * call.
14497
- */ function Xi(t, e, n) {
14495
+ */ function Zi(t, e, n) {
14498
14496
  var r;
14499
14497
  return t ? (r = t.toFirestore(e), n = "toFirestore() in " + n) : r = e, [ r, n ];
14500
14498
  }
14501
14499
 
14502
- var Zi = mn(Pi, "Use firebase.firestore() instead."), $i = mn(Ci, "Use firebase.firestore().runTransaction() instead."), to = mn(Mi, "Use firebase.firestore().batch() instead."), eo = mn(qi, "Use firebase.firestore().doc() instead."), no = mn(ji), ro = mn(Gi), io = mn(Bi), oo = mn(zi), so = mn(Ki, "Use firebase.firestore().collection() instead."), uo = {
14503
- Firestore: Zi,
14500
+ var $i = mn(Ci, "Use firebase.firestore() instead."), to = mn(Mi, "Use firebase.firestore().runTransaction() instead."), eo = mn(qi, "Use firebase.firestore().batch() instead."), no = mn(Fi, "Use firebase.firestore().doc() instead."), ro = mn(Gi), io = mn(Bi), oo = mn(zi), so = mn(Ki), uo = mn(Wi, "Use firebase.firestore().collection() instead."), ao = {
14501
+ Firestore: $i,
14504
14502
  GeoPoint: xn,
14505
14503
  Timestamp: m,
14506
14504
  Blob: _n,
14507
- Transaction: $i,
14508
- WriteBatch: to,
14509
- DocumentReference: eo,
14510
- DocumentSnapshot: no,
14511
- Query: io,
14512
- QueryDocumentSnapshot: ro,
14513
- QuerySnapshot: oo,
14514
- CollectionReference: so,
14505
+ Transaction: to,
14506
+ WriteBatch: eo,
14507
+ DocumentReference: no,
14508
+ DocumentSnapshot: ro,
14509
+ Query: oo,
14510
+ QueryDocumentSnapshot: io,
14511
+ QuerySnapshot: so,
14512
+ CollectionReference: uo,
14515
14513
  FieldPath: bn,
14516
14514
  FieldValue: kn,
14517
- setLogLevel: Pi.setLogLevel,
14518
- CACHE_SIZE_UNLIMITED: Ui
14519
- }, ao = /** @class */ function() {
14515
+ setLogLevel: Ci.setLogLevel,
14516
+ CACHE_SIZE_UNLIMITED: Oi
14517
+ }, ho = /** @class */ function() {
14520
14518
  function t() {}
14521
14519
  return t.prototype.Hu = function(t) {
14522
14520
  // No-op.
14523
14521
  }, t.prototype.lc = function() {
14524
14522
  // No-op.
14525
14523
  }, t;
14526
- }(), ho = /** @class */ function() {
14524
+ }(), co = /** @class */ function() {
14527
14525
  function t() {
14528
14526
  var t = this;
14529
- this.xm = function() {
14530
- return t.Bm();
14531
- }, this.Um = function() {
14532
- return t.qm();
14533
- }, this.Qm = [], this.Wm();
14527
+ this.Cm = function() {
14528
+ return t.km();
14529
+ }, this.Nm = function() {
14530
+ return t.Fm();
14531
+ }, this.$m = [], this.Mm();
14534
14532
  }
14535
14533
  return t.prototype.Hu = function(t) {
14536
- this.Qm.push(t);
14534
+ this.$m.push(t);
14537
14535
  }, t.prototype.lc = function() {
14538
- window.removeEventListener("online", this.xm), window.removeEventListener("offline", this.Um);
14539
- }, t.prototype.Wm = function() {
14540
- window.addEventListener("online", this.xm), window.addEventListener("offline", this.Um);
14541
- }, t.prototype.Bm = function() {
14536
+ window.removeEventListener("online", this.Cm), window.removeEventListener("offline", this.Nm);
14537
+ }, t.prototype.Mm = function() {
14538
+ window.addEventListener("online", this.Cm), window.addEventListener("offline", this.Nm);
14539
+ }, t.prototype.km = function() {
14542
14540
  ve("ConnectivityMonitor", "Network connectivity changed: AVAILABLE");
14543
- for (var t = 0, e = this.Qm; t < e.length; t++) {
14541
+ for (var t = 0, e = this.$m; t < e.length; t++) {
14544
14542
  (0, e[t])(0 /* AVAILABLE */);
14545
14543
  }
14546
- }, t.prototype.qm = function() {
14544
+ }, t.prototype.Fm = function() {
14547
14545
  ve("ConnectivityMonitor", "Network connectivity changed: UNAVAILABLE");
14548
- for (var t = 0, e = this.Qm; t < e.length; t++) {
14546
+ for (var t = 0, e = this.$m; t < e.length; t++) {
14549
14547
  (0, e[t])(1 /* UNAVAILABLE */);
14550
14548
  }
14551
14549
  },
@@ -14555,44 +14553,44 @@ var Zi = mn(Pi, "Use firebase.firestore() instead."), $i = mn(Ci, "Use firebase.
14555
14553
  t.Uc = function() {
14556
14554
  return "undefined" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;
14557
14555
  }, t;
14558
- }(), co = /** @class */ function() {
14556
+ }(), fo = /** @class */ function() {
14559
14557
  function t(t) {
14560
- this.jm = t.jm, this.Km = t.Km;
14558
+ this.Lm = t.Lm, this.Om = t.Om;
14561
14559
  }
14562
14560
  return t.prototype._u = function(t) {
14563
- this.Gm = t;
14561
+ this.xm = t;
14564
14562
  }, t.prototype.ou = function(t) {
14565
- this.zm = t;
14563
+ this.Bm = t;
14566
14564
  }, t.prototype.onMessage = function(t) {
14567
- this.Hm = t;
14565
+ this.Um = t;
14568
14566
  }, t.prototype.close = function() {
14569
- this.Km();
14567
+ this.Om();
14570
14568
  }, t.prototype.send = function(t) {
14571
- this.jm(t);
14572
- }, t.prototype.Jm = function() {
14573
- this.Gm();
14574
- }, t.prototype.Ym = function(t) {
14575
- this.zm(t);
14576
- }, t.prototype.Xm = function(t) {
14577
- this.Hm(t);
14569
+ this.Lm(t);
14570
+ }, t.prototype.qm = function() {
14571
+ this.xm();
14572
+ }, t.prototype.Qm = function(t) {
14573
+ this.Bm(t);
14574
+ }, t.prototype.Wm = function(t) {
14575
+ this.Um(t);
14578
14576
  }, t;
14579
- }(), fo = {
14577
+ }(), lo = {
14580
14578
  BatchGetDocuments: "batchGet",
14581
14579
  Commit: "commit"
14582
- }, lo = "gl-js/ fire/" + u, po = /** @class */ function() {
14580
+ }, po = "gl-js/ fire/" + u, yo = /** @class */ function() {
14583
14581
  function t(t) {
14584
14582
  this.cn = t.cn;
14585
14583
  var e = t.ssl ? "https" : "http";
14586
- this.Zm = e + "://" + t.host, this.forceLongPolling = t.forceLongPolling;
14584
+ this.jm = e + "://" + t.host, this.forceLongPolling = t.forceLongPolling;
14587
14585
  }
14588
14586
  /**
14589
14587
  * Modifies the headers for a request, adding any authorization token if
14590
14588
  * present and any additional headers for the request.
14591
- */ return t.prototype.tE = function(t, e) {
14589
+ */ return t.prototype.Km = function(t, e) {
14592
14590
  if (e) for (var n in e.h) e.h.hasOwnProperty(n) && (t[n] = e.h[n]);
14593
- t["X-Goog-Api-Client"] = lo;
14591
+ t["X-Goog-Api-Client"] = po;
14594
14592
  }, t.prototype.gu = function(t, e, n) {
14595
- var r = this, i = this.eE(t);
14593
+ var r = this, i = this.Gm(t);
14596
14594
  return new Promise((function(o, u) {
14597
14595
  var a = new s.XhrIo;
14598
14596
  a.listenOnce(s.EventType.COMPLETE, (function() {
@@ -14647,14 +14645,14 @@ var Zi = mn(Pi, "Use firebase.firestore() instead."), $i = mn(Ci, "Use firebase.
14647
14645
  var p = {
14648
14646
  "Content-Type": "text/plain"
14649
14647
  };
14650
- r.tE(p, n), a.send(i, "POST", l, p, 15);
14648
+ r.Km(p, n), a.send(i, "POST", l, p, 15);
14651
14649
  }));
14652
14650
  }, t.prototype.yu = function(t, e, n) {
14653
14651
  // The REST API automatically aggregates all of the streamed results, so we
14654
14652
  // can just use the normal invoke() method.
14655
14653
  return this.gu(t, e, n);
14656
14654
  }, t.prototype.lu = function(t, e) {
14657
- var n = [ this.Zm, "/", "google.firestore.v1.Firestore", "/", t, "/channel" ], r = s.createWebChannelTransport(), o = {
14655
+ var n = [ this.jm, "/", "google.firestore.v1.Firestore", "/", t, "/channel" ], r = s.createWebChannelTransport(), o = {
14658
14656
  // Required for backend stickiness, routing behavior is based on this
14659
14657
  // parameter.
14660
14658
  httpSessionIdParam: "gsessionid",
@@ -14677,7 +14675,7 @@ var Zi = mn(Pi, "Use firebase.firestore() instead."), $i = mn(Ci, "Use firebase.
14677
14675
  },
14678
14676
  forceLongPolling: this.forceLongPolling
14679
14677
  };
14680
- this.tE(o.initMessageHeaders, e),
14678
+ this.Km(o.initMessageHeaders, e),
14681
14679
  // Sending the custom headers we just added to request.initMessageHeaders
14682
14680
  // (Authorization, etc.) will trigger the browser to make a CORS preflight
14683
14681
  // request because the XHR will no longer meet the criteria for a "simple"
@@ -14696,12 +14694,12 @@ var Zi = mn(Pi, "Use firebase.firestore() instead."), $i = mn(Ci, "Use firebase.
14696
14694
  i.isMobileCordova() || i.isReactNative() || i.isElectron() || i.isIE() || i.isUWP() || i.isBrowserExtension() || (o.httpHeadersOverwriteParam = "$httpHeaders");
14697
14695
  var u = n.join("");
14698
14696
  ve("Connection", "Creating WebChannel: " + u + " " + o);
14699
- var a = r.createWebChannel(u, o), f = !1, l = !1, p = new co({
14700
- jm: function(t) {
14697
+ var a = r.createWebChannel(u, o), f = !1, l = !1, p = new fo({
14698
+ Lm: function(t) {
14701
14699
  l ? ve("Connection", "Not sending because WebChannel is closed:", t) : (f || (ve("Connection", "Opening WebChannel transport."),
14702
14700
  a.open(), f = !0), ve("Connection", "WebChannel sending:", t), a.send(t));
14703
14701
  },
14704
- Km: function() {
14702
+ Om: function() {
14705
14703
  return a.close();
14706
14704
  }
14707
14705
  }), d = function(t, e) {
@@ -14729,9 +14727,9 @@ var Zi = mn(Pi, "Use firebase.firestore() instead."), $i = mn(Ci, "Use firebase.
14729
14727
  return d(s.WebChannel.EventType.OPEN, (function() {
14730
14728
  l || ve("Connection", "WebChannel transport opened.");
14731
14729
  })), d(s.WebChannel.EventType.CLOSE, (function() {
14732
- l || (l = !0, ve("Connection", "WebChannel transport closed"), p.Ym());
14730
+ l || (l = !0, ve("Connection", "WebChannel transport closed"), p.Qm());
14733
14731
  })), d(s.WebChannel.EventType.ERROR, (function(t) {
14734
- l || (l = !0, ve("Connection", "WebChannel transport errored:", t), p.Ym(new c(h.UNAVAILABLE, "The operation could not be completed")));
14732
+ l || (l = !0, ve("Connection", "WebChannel transport errored:", t), p.Qm(new c(h.UNAVAILABLE, "The operation could not be completed")));
14735
14733
  })), d(s.WebChannel.EventType.MESSAGE, (function(t) {
14736
14734
  var e;
14737
14735
  if (!l) {
@@ -14754,21 +14752,21 @@ var Zi = mn(Pi, "Use firebase.firestore() instead."), $i = mn(Ci, "Use firebase.
14754
14752
  }(o), u = i.message;
14755
14753
  void 0 === s && (s = h.INTERNAL, u = "Unknown error status: " + o + " with message " + i.message),
14756
14754
  // Mark closed so no further events are propagated
14757
- l = !0, p.Ym(new c(s, u)), a.close();
14758
- } else ve("Connection", "WebChannel received:", n), p.Xm(n);
14755
+ l = !0, p.Qm(new c(s, u)), a.close();
14756
+ } else ve("Connection", "WebChannel received:", n), p.Wm(n);
14759
14757
  }
14760
14758
  })), setTimeout((function() {
14761
14759
  // Technically we could/should wait for the WebChannel opened event,
14762
14760
  // but because we want to send the first message with the WebChannel
14763
14761
  // handshake we pretend the channel opened here (asynchronously), and
14764
14762
  // then delay the actual open until the first message is sent.
14765
- p.Jm();
14763
+ p.qm();
14766
14764
  }), 0), p;
14767
14765
  },
14768
14766
  // visible for testing
14769
- t.prototype.eE = function(t) {
14770
- var e = fo[t];
14771
- return this.Zm + "/v1/projects/" + this.cn.projectId + "/databases/" + this.cn.database + "/documents:" + e;
14767
+ t.prototype.Gm = function(t) {
14768
+ var e = lo[t];
14769
+ return this.jm + "/v1/projects/" + this.cn.projectId + "/databases/" + this.cn.database + "/documents:" + e;
14772
14770
  }, t;
14773
14771
  }();
14774
14772
 
@@ -14824,7 +14822,7 @@ var Zi = mn(Pi, "Use firebase.firestore() instead."), $i = mn(Ci, "Use firebase.
14824
14822
  * Registers the main Firestore build with the components framework.
14825
14823
  * Persistence can be enabled via `firebase.firestore().enablePersistence()`.
14826
14824
  */
14827
- function yo(t) {
14825
+ function mo(t) {
14828
14826
  /**
14829
14827
  * Configures Firestore as part of the Firebase SDK by calling registerService.
14830
14828
  *
@@ -14835,10 +14833,10 @@ function yo(t) {
14835
14833
  !function(t, e) {
14836
14834
  t.INTERNAL.registerComponent(new o.Component("firestore", (function(t) {
14837
14835
  return function(t, e) {
14838
- return new Pi(t, e, new ki);
14836
+ return new Ci(t, e, new Di);
14839
14837
  }(t.getProvider("app").getImmediate(), t.getProvider("auth-internal"));
14840
- }), "PUBLIC" /* PUBLIC */).setServiceProps(Object.assign({}, uo)));
14841
- }(t), t.registerVersion("@firebase/firestore", "1.14.0-canary.daf63c2c")
14838
+ }), "PUBLIC" /* PUBLIC */).setServiceProps(Object.assign({}, ao)));
14839
+ }(t), t.registerVersion("@firebase/firestore", "1.14.0")
14842
14840
  /**
14843
14841
  * @license
14844
14842
  * Copyright 2017 Google Inc.
@@ -14880,11 +14878,11 @@ pe.fi(new (/** @class */ function() {
14880
14878
  },
14881
14879
  enumerable: !0,
14882
14880
  configurable: !0
14883
- }), t.prototype.DT = function(t) {
14884
- return Promise.resolve(new po(t));
14885
- }, t.prototype.gT = function() {
14886
- return ho.Uc() ? new ho : new ao;
14887
- }, t.prototype.yT = function(t) {
14881
+ }), t.prototype.VT = function(t) {
14882
+ return Promise.resolve(new yo(t));
14883
+ }, t.prototype.mT = function() {
14884
+ return co.Uc() ? new co : new ho;
14885
+ }, t.prototype.fT = function(t) {
14888
14886
  return new fe(t, {
14889
14887
  dn: !0
14890
14888
  });
@@ -14895,5 +14893,5 @@ pe.fi(new (/** @class */ function() {
14895
14893
  }, t.prototype.btoa = function(t) {
14896
14894
  return btoa(t);
14897
14895
  }, t;
14898
- }())), yo(n), exports.__PRIVATE_registerFirestore = yo;
14896
+ }())), mo(n), exports.__PRIVATE_registerFirestore = mo;
14899
14897
  //# sourceMappingURL=index.cjs.js.map