@firebase/firestore 3.4.8 → 3.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/firestore/lite/index.d.ts +1 -0
  3. package/dist/firestore/src/api/transaction.d.ts +2 -1
  4. package/dist/firestore/src/api/transaction_options.d.ts +17 -0
  5. package/dist/firestore/src/api.d.ts +1 -0
  6. package/dist/firestore/src/core/firestore_client.d.ts +2 -1
  7. package/dist/firestore/src/core/query.d.ts +2 -4
  8. package/dist/firestore/src/core/target.d.ts +6 -4
  9. package/dist/firestore/src/core/transaction_options.d.ts +25 -0
  10. package/dist/firestore/src/core/transaction_runner.d.ts +3 -2
  11. package/dist/firestore/src/lite-api/transaction.d.ts +2 -1
  12. package/dist/firestore/src/lite-api/transaction_options.d.ts +23 -0
  13. package/dist/firestore/src/local/index_manager.d.ts +24 -3
  14. package/dist/firestore/src/local/indexeddb_index_manager.d.ts +4 -7
  15. package/dist/firestore/src/local/indexeddb_schema.d.ts +1 -0
  16. package/dist/firestore/src/local/local_documents_view.d.ts +1 -1
  17. package/dist/firestore/src/local/memory_index_manager.d.ts +3 -2
  18. package/dist/firestore/src/local/query_engine.d.ts +44 -5
  19. package/dist/firestore/src/model/collections.d.ts +1 -1
  20. package/dist/firestore/src/model/values.d.ts +14 -2
  21. package/dist/firestore/src/util/misc.d.ts +3 -0
  22. package/dist/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
  23. package/dist/firestore/test/unit/local/test_index_manager.d.ts +2 -2
  24. package/dist/index.d.ts +24 -1
  25. package/dist/index.esm2017.js +4108 -3992
  26. package/dist/index.esm2017.js.map +1 -1
  27. package/dist/index.esm5.js +4198 -4087
  28. package/dist/index.esm5.js.map +1 -1
  29. package/dist/index.node.cjs.js +1711 -1565
  30. package/dist/index.node.cjs.js.map +1 -1
  31. package/dist/index.node.mjs +1711 -1565
  32. package/dist/index.node.mjs.map +1 -1
  33. package/dist/index.rn.js +4100 -3984
  34. package/dist/index.rn.js.map +1 -1
  35. package/dist/internal.d.ts +50 -4
  36. package/dist/lite/firestore/lite/index.d.ts +1 -0
  37. package/dist/lite/firestore/src/api/transaction.d.ts +2 -1
  38. package/dist/lite/firestore/src/api/transaction_options.d.ts +17 -0
  39. package/dist/lite/firestore/src/api.d.ts +1 -0
  40. package/dist/lite/firestore/src/core/firestore_client.d.ts +2 -1
  41. package/dist/lite/firestore/src/core/query.d.ts +2 -4
  42. package/dist/lite/firestore/src/core/target.d.ts +6 -4
  43. package/dist/lite/firestore/src/core/transaction_options.d.ts +25 -0
  44. package/dist/lite/firestore/src/core/transaction_runner.d.ts +3 -2
  45. package/dist/lite/firestore/src/lite-api/transaction.d.ts +2 -1
  46. package/dist/lite/firestore/src/lite-api/transaction_options.d.ts +23 -0
  47. package/dist/lite/firestore/src/local/index_manager.d.ts +24 -3
  48. package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +4 -7
  49. package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +1 -0
  50. package/dist/lite/firestore/src/local/local_documents_view.d.ts +1 -1
  51. package/dist/lite/firestore/src/local/memory_index_manager.d.ts +3 -2
  52. package/dist/lite/firestore/src/local/query_engine.d.ts +44 -5
  53. package/dist/lite/firestore/src/model/collections.d.ts +1 -1
  54. package/dist/lite/firestore/src/model/values.d.ts +14 -2
  55. package/dist/lite/firestore/src/util/misc.d.ts +3 -0
  56. package/dist/lite/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
  57. package/dist/lite/firestore/test/unit/local/test_index_manager.d.ts +2 -2
  58. package/dist/lite/index.browser.esm2017.js +341 -312
  59. package/dist/lite/index.browser.esm2017.js.map +1 -1
  60. package/dist/lite/index.browser.esm5.js +299 -291
  61. package/dist/lite/index.browser.esm5.js.map +1 -1
  62. package/dist/lite/index.d.ts +24 -1
  63. package/dist/lite/index.node.cjs.js +56 -15
  64. package/dist/lite/index.node.cjs.js.map +1 -1
  65. package/dist/lite/index.node.mjs +56 -15
  66. package/dist/lite/index.node.mjs.map +1 -1
  67. package/dist/lite/index.rn.esm2017.js +1227 -1198
  68. package/dist/lite/index.rn.esm2017.js.map +1 -1
  69. package/dist/lite/internal.d.ts +25 -1
  70. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +28 -28
  71. package/dist/lite/packages/firestore/lite/index.d.ts +1 -0
  72. package/dist/lite/packages/firestore/src/api/transaction.d.ts +2 -1
  73. package/dist/lite/packages/firestore/src/api/transaction_options.d.ts +17 -0
  74. package/dist/lite/packages/firestore/src/api.d.ts +1 -0
  75. package/dist/lite/packages/firestore/src/core/firestore_client.d.ts +2 -1
  76. package/dist/lite/packages/firestore/src/core/query.d.ts +2 -4
  77. package/dist/lite/packages/firestore/src/core/target.d.ts +6 -4
  78. package/dist/lite/packages/firestore/src/core/transaction_options.d.ts +25 -0
  79. package/dist/lite/packages/firestore/src/core/transaction_runner.d.ts +3 -2
  80. package/dist/lite/packages/firestore/src/lite-api/transaction.d.ts +2 -1
  81. package/dist/lite/packages/firestore/src/lite-api/transaction_options.d.ts +23 -0
  82. package/dist/lite/packages/firestore/src/local/index_manager.d.ts +24 -3
  83. package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +4 -7
  84. package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +1 -0
  85. package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +1 -1
  86. package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +3 -2
  87. package/dist/lite/packages/firestore/src/local/query_engine.d.ts +44 -5
  88. package/dist/lite/packages/firestore/src/model/collections.d.ts +1 -1
  89. package/dist/lite/packages/firestore/src/model/values.d.ts +14 -2
  90. package/dist/lite/packages/firestore/src/util/misc.d.ts +3 -0
  91. package/dist/lite/packages/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
  92. package/dist/lite/packages/firestore/test/unit/local/test_index_manager.d.ts +2 -2
  93. package/dist/lite/private.d.ts +25 -1
  94. package/dist/packages/firestore/dist/index.esm2017.d.ts +155 -154
  95. package/dist/packages/firestore/lite/index.d.ts +1 -0
  96. package/dist/packages/firestore/src/api/transaction.d.ts +2 -1
  97. package/dist/packages/firestore/src/api/transaction_options.d.ts +17 -0
  98. package/dist/packages/firestore/src/api.d.ts +1 -0
  99. package/dist/packages/firestore/src/core/firestore_client.d.ts +2 -1
  100. package/dist/packages/firestore/src/core/query.d.ts +2 -4
  101. package/dist/packages/firestore/src/core/target.d.ts +6 -4
  102. package/dist/packages/firestore/src/core/transaction_options.d.ts +25 -0
  103. package/dist/packages/firestore/src/core/transaction_runner.d.ts +3 -2
  104. package/dist/packages/firestore/src/lite-api/transaction.d.ts +2 -1
  105. package/dist/packages/firestore/src/lite-api/transaction_options.d.ts +23 -0
  106. package/dist/packages/firestore/src/local/index_manager.d.ts +24 -3
  107. package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +4 -7
  108. package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +1 -0
  109. package/dist/packages/firestore/src/local/local_documents_view.d.ts +1 -1
  110. package/dist/packages/firestore/src/local/memory_index_manager.d.ts +3 -2
  111. package/dist/packages/firestore/src/local/query_engine.d.ts +44 -5
  112. package/dist/packages/firestore/src/model/collections.d.ts +1 -1
  113. package/dist/packages/firestore/src/model/values.d.ts +14 -2
  114. package/dist/packages/firestore/src/util/misc.d.ts +3 -0
  115. package/dist/packages/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
  116. package/dist/packages/firestore/test/unit/local/test_index_manager.d.ts +2 -2
  117. package/dist/private.d.ts +50 -4
  118. package/package.json +7 -7
@@ -67,7 +67,7 @@ m.MOCK_USER = new m("mock-user");
67
67
  * See the License for the specific language governing permissions and
68
68
  * limitations under the License.
69
69
  */
70
- var y = "9.6.11", v = new l("@firebase/firestore");
70
+ var y = "9.8.0", v = new l("@firebase/firestore");
71
71
 
72
72
  /**
73
73
  * @license
@@ -204,7 +204,7 @@ function E(t, e) {
204
204
  /**
205
205
  * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an
206
206
  * instance of `T` before casting.
207
- */ function I(t,
207
+ */ function A(t,
208
208
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
209
209
  e) {
210
210
  return t;
@@ -225,7 +225,7 @@ e) {
225
225
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
226
226
  * See the License for the specific language governing permissions and
227
227
  * limitations under the License.
228
- */ var A = "cancelled", k = "unknown", V = "invalid-argument", D = "deadline-exceeded", P = "not-found", N = "permission-denied", q = "unauthenticated", F = "resource-exhausted", O = "failed-precondition", C = "aborted", L = "out-of-range", j = "unimplemented", R = "internal", M = "unavailable", x = /** @class */ function(e) {
228
+ */ var I = "cancelled", k = "unknown", V = "invalid-argument", D = "deadline-exceeded", P = "not-found", N = "permission-denied", q = "unauthenticated", F = "resource-exhausted", O = "failed-precondition", C = "aborted", j = "out-of-range", L = "unimplemented", R = "internal", x = "unavailable", M = /** @class */ function(e) {
229
229
  /** @hideconstructor */
230
230
  function n(
231
231
  /**
@@ -446,7 +446,7 @@ function(t, e, n, r, i, o, a, s) {
446
446
  // for legacy reasons and should not be used frequently).
447
447
  for (var r = [], i = 0, o = t; i < o.length; i++) {
448
448
  var a = o[i];
449
- if (a.indexOf("//") >= 0) throw new x(V, "Invalid segment (" + a + "). Paths must not contain // in them.");
449
+ if (a.indexOf("//") >= 0) throw new M(V, "Invalid segment (" + a + "). Paths must not contain // in them.");
450
450
  // Strip leading and traling slashed.
451
451
  r.push.apply(r, a.split("/").filter((function(t) {
452
452
  return t.length > 0;
@@ -501,18 +501,18 @@ function(t, e, n, r, i, o, a, s) {
501
501
  */
502
502
  n.fromServerFormat = function(t) {
503
503
  for (var e = [], r = "", i = 0, o = function() {
504
- if (0 === r.length) throw new x(V, "Invalid field path (" + t + "). Paths must not be empty, begin with '.', end with '.', or contain '..'");
504
+ if (0 === r.length) throw new M(V, "Invalid field path (" + t + "). Paths must not be empty, begin with '.', end with '.', or contain '..'");
505
505
  e.push(r), r = "";
506
506
  }, a = !1; i < t.length; ) {
507
507
  var s = t[i];
508
508
  if ("\\" === s) {
509
- if (i + 1 === t.length) throw new x(V, "Path has trailing escape character: " + t);
509
+ if (i + 1 === t.length) throw new M(V, "Path has trailing escape character: " + t);
510
510
  var u = t[i + 1];
511
- if ("\\" !== u && "." !== u && "`" !== u) throw new x(V, "Path has invalid escape sequence: " + t);
511
+ if ("\\" !== u && "." !== u && "`" !== u) throw new M(V, "Path has invalid escape sequence: " + t);
512
512
  r += u, i += 2;
513
513
  } else "`" === s ? (a = !a, i++) : "." !== s || a ? (r += s, i++) : (o(), i++);
514
514
  }
515
- if (o(), a) throw new x(V, "Unterminated ` in path: " + t);
515
+ if (o(), a) throw new M(V, "Unterminated ` in path: " + t);
516
516
  return new n(e);
517
517
  }, n.emptyPath = function() {
518
518
  return new n([]);
@@ -580,7 +580,7 @@ function(t, e, n, r, i, o, a, s) {
580
580
  * limitations under the License.
581
581
  */
582
582
  function rt(t, e, n) {
583
- if (!n) throw new x(V, "Function " + t + "() cannot be called with an empty " + e + ".");
583
+ if (!n) throw new M(V, "Function " + t + "() cannot be called with an empty " + e + ".");
584
584
  }
585
585
 
586
586
  /**
@@ -591,14 +591,14 @@ function rt(t, e, n) {
591
591
  * Validates that `path` refers to a document (indicated by the fact it contains
592
592
  * an even numbers of segments).
593
593
  */ function it(t) {
594
- if (!nt.isDocumentKey(t)) throw new x(V, "Invalid document reference. Document references must have an even number of segments, but " + t + " has " + t.length + ".");
594
+ if (!nt.isDocumentKey(t)) throw new M(V, "Invalid document reference. Document references must have an even number of segments, but " + t + " has " + t.length + ".");
595
595
  }
596
596
 
597
597
  /**
598
598
  * Validates that `path` refers to a collection (indicated by the fact it
599
599
  * contains an odd numbers of segments).
600
600
  */ function ot(t) {
601
- if (nt.isDocumentKey(t)) throw new x(V, "Invalid collection reference. Collection references must have an odd number of segments, but " + t + " has " + t.length + ".");
601
+ if (nt.isDocumentKey(t)) throw new M(V, "Invalid collection reference. Collection references must have an odd number of segments, but " + t + " has " + t.length + ".");
602
602
  }
603
603
 
604
604
  /**
@@ -630,15 +630,15 @@ e) {
630
630
  // Unwrap Compat types
631
631
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
632
632
  t = t._delegate), !(t instanceof e)) {
633
- if (e.name === t.constructor.name) throw new x(V, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
633
+ if (e.name === t.constructor.name) throw new M(V, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
634
634
  var n = at(t);
635
- throw new x(V, "Expected type '" + e.name + "', but it was: " + n);
635
+ throw new M(V, "Expected type '" + e.name + "', but it was: " + n);
636
636
  }
637
637
  return t;
638
638
  }
639
639
 
640
640
  function ut(t, e) {
641
- if (e <= 0) throw new x(V, "Function " + t + "() requires a positive number, but it was: " + e + ".");
641
+ if (e <= 0) throw new M(V, "Function " + t + "() requires a positive number, but it was: " + e + ".");
642
642
  }
643
643
 
644
644
  /**
@@ -771,7 +771,7 @@ function dt(t) {
771
771
  // return Code.ALREADY_EXISTS;
772
772
  case 416:
773
773
  // Range Not Satisfiable
774
- return L;
774
+ return j;
775
775
 
776
776
  case 429:
777
777
  // Too Many Requests
@@ -779,7 +779,7 @@ function dt(t) {
779
779
 
780
780
  case 499:
781
781
  // Client Closed Request
782
- return A;
782
+ return I;
783
783
 
784
784
  case 500:
785
785
  // Internal Server Error
@@ -790,11 +790,11 @@ function dt(t) {
790
790
  // return Code.DATA_LOSS;
791
791
  case 501:
792
792
  // Unimplemented
793
- return j;
793
+ return L;
794
794
 
795
795
  case 503:
796
796
  // Service Unavailable
797
- return M;
797
+ return x;
798
798
 
799
799
  case 504:
800
800
  // Gateway Timeout
@@ -840,13 +840,13 @@ var mt = /** @class */ function(r) {
840
840
  */
841
841
  function i(t, e) {
842
842
  var n = this;
843
- return (n = r.call(this, t) || this).I = e, n;
843
+ return (n = r.call(this, t) || this).A = e, n;
844
844
  }
845
845
  /**
846
846
  * Base class for all Rest-based connections to the backend (WebChannel and
847
847
  * HTTP).
848
848
  */
849
- return t(i, r), i.prototype.A = function(t, e) {
849
+ return t(i, r), i.prototype.I = function(t, e) {
850
850
  throw new Error("Not supported by FetchConnection");
851
851
  }, i.prototype.v = function(t, r, i, o) {
852
852
  return e(this, void 0, void 0, (function() {
@@ -857,7 +857,7 @@ var mt = /** @class */ function(r) {
857
857
  t = JSON.stringify(o), n.label = 1;
858
858
 
859
859
  case 1:
860
- return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , this.I(r, {
860
+ return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , this.A(r, {
861
861
  method: "POST",
862
862
  headers: i,
863
863
  body: t
@@ -867,10 +867,10 @@ var mt = /** @class */ function(r) {
867
867
  return e = n.sent(), [ 3 /*break*/ , 4 ];
868
868
 
869
869
  case 3:
870
- throw a = n.sent(), new x(dt(a.status), "Request failed with error: " + a.statusText);
870
+ throw a = n.sent(), new M(dt(a.status), "Request failed with error: " + a.statusText);
871
871
 
872
872
  case 4:
873
- if (!e.ok) throw new x(dt(e.status), "Request failed with error: " + e.statusText);
873
+ if (!e.ok) throw new M(dt(e.status), "Request failed with error: " + e.statusText);
874
874
  return [ 2 /*return*/ , e.json() ];
875
875
  }
876
876
  }));
@@ -1058,11 +1058,11 @@ function gt(t, e) {
1058
1058
  * The fractions of a second at nanosecond resolution.*
1059
1059
  */
1060
1060
  e) {
1061
- if (this.seconds = t, this.nanoseconds = e, e < 0) throw new x(V, "Timestamp nanoseconds out of range: " + e);
1062
- if (e >= 1e9) throw new x(V, "Timestamp nanoseconds out of range: " + e);
1063
- if (t < -62135596800) throw new x(V, "Timestamp seconds out of range: " + t);
1061
+ if (this.seconds = t, this.nanoseconds = e, e < 0) throw new M(V, "Timestamp nanoseconds out of range: " + e);
1062
+ if (e >= 1e9) throw new M(V, "Timestamp nanoseconds out of range: " + e);
1063
+ if (t < -62135596800) throw new M(V, "Timestamp seconds out of range: " + t);
1064
1064
  // This will break in the year 10,000.
1065
- if (t >= 253402300800) throw new x(V, "Timestamp seconds out of range: " + t);
1065
+ if (t >= 253402300800) throw new M(V, "Timestamp seconds out of range: " + t);
1066
1066
  }
1067
1067
  /**
1068
1068
  * Creates a new timestamp with the current date, with millisecond precision.
@@ -1270,7 +1270,7 @@ function St(t, e) {
1270
1270
  return t.isEqual(e);
1271
1271
  }));
1272
1272
  }, t;
1273
- }(), It = /** @class */ function() {
1273
+ }(), At = /** @class */ function() {
1274
1274
  function t(t) {
1275
1275
  this.binaryString = t;
1276
1276
  }
@@ -1359,9 +1359,9 @@ function St(t, e) {
1359
1359
  * the proto byte string in a common class that must be converted into a string
1360
1360
  * before being sent as a proto.
1361
1361
  * @internal
1362
- */ It.EMPTY_BYTE_STRING = new It("");
1362
+ */ At.EMPTY_BYTE_STRING = new At("");
1363
1363
 
1364
- var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1364
+ var It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1365
1365
 
1366
1366
  /**
1367
1367
  * Converts the possible Proto values for a timestamp value into a "seconds and
@@ -1374,7 +1374,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1374
1374
  // The date string can have higher precision (nanos) than the Date class
1375
1375
  // (millis), so we do some custom parsing here.
1376
1376
  // Parse the nanos right out of the string.
1377
- var e = 0, n = At.exec(t);
1377
+ var e = 0, n = It.exec(t);
1378
1378
  if (E(!!n), n[1]) {
1379
1379
  // Pad the fraction out to 9 digits (nanos).
1380
1380
  var r = n[1];
@@ -1402,7 +1402,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1402
1402
  }
1403
1403
 
1404
1404
  /** Converts the possible Proto types for Blobs into a ByteString. */ function Dt(t) {
1405
- return "string" == typeof t ? It.fromBase64String(t) : It.fromUint8Array(t);
1405
+ return "string" == typeof t ? At.fromBase64String(t) : At.fromUint8Array(t);
1406
1406
  }
1407
1407
 
1408
1408
  /**
@@ -1475,19 +1475,26 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1475
1475
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1476
1476
  * See the License for the specific language governing permissions and
1477
1477
  * limitations under the License.
1478
- */
1479
- /** Extracts the backend's type order for the provided value. */ function Ft(t) {
1478
+ */ var Ft = {
1479
+ fields: {
1480
+ __type__: {
1481
+ stringValue: "__max__"
1482
+ }
1483
+ }
1484
+ };
1485
+
1486
+ /** Extracts the backend's type order for the provided value. */ function Ot(t) {
1480
1487
  return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ? Pt(t) ? 4 /* ServerTimestampValue */ :
1481
1488
  /** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */
1482
1489
  function(t) {
1483
1490
  return "__max__" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;
1484
- }(t) ? 9 /* ArrayValue */ : 10 /* ObjectValue */ : S();
1491
+ }(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : S();
1485
1492
  }
1486
1493
 
1487
- /** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {
1494
+ /** Tests `left` and `right` for equality based on the backend semantics. */ function Ct(t, e) {
1488
1495
  if (t === e) return !0;
1489
- var n = Ft(t);
1490
- if (n !== Ft(e)) return !1;
1496
+ var n = Ot(t);
1497
+ if (n !== Ot(e)) return !1;
1491
1498
  switch (n) {
1492
1499
  case 0 /* NullValue */ :
1493
1500
  case 9007199254740991 /* MaxValue */ :
@@ -1535,13 +1542,13 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1535
1542
  }(t, e);
1536
1543
 
1537
1544
  case 9 /* ArrayValue */ :
1538
- return wt(t.arrayValue.values || [], e.arrayValue.values || [], Ot);
1545
+ return wt(t.arrayValue.values || [], e.arrayValue.values || [], Ct);
1539
1546
 
1540
1547
  case 10 /* ObjectValue */ :
1541
1548
  return function(t, e) {
1542
1549
  var n = t.mapValue.fields || {}, r = e.mapValue.fields || {};
1543
1550
  if (Tt(n) !== Tt(r)) return !1;
1544
- for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !Ot(n[i], r[i]))) return !1;
1551
+ for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !Ct(n[i], r[i]))) return !1;
1545
1552
  return !0;
1546
1553
  }(t, e);
1547
1554
 
@@ -1550,15 +1557,15 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1550
1557
  }
1551
1558
  }
1552
1559
 
1553
- function Ct(t, e) {
1560
+ function jt(t, e) {
1554
1561
  return void 0 !== (t.values || []).find((function(t) {
1555
- return Ot(t, e);
1562
+ return Ct(t, e);
1556
1563
  }));
1557
1564
  }
1558
1565
 
1559
1566
  function Lt(t, e) {
1560
1567
  if (t === e) return 0;
1561
- var n = Ft(t), r = Ft(e);
1568
+ var n = Ot(t), r = Ot(e);
1562
1569
  if (n !== r) return gt(n, r);
1563
1570
  switch (n) {
1564
1571
  case 0 /* NullValue */ :
@@ -1577,10 +1584,10 @@ function Lt(t, e) {
1577
1584
  }(t, e);
1578
1585
 
1579
1586
  case 3 /* TimestampValue */ :
1580
- return jt(t.timestampValue, e.timestampValue);
1587
+ return Rt(t.timestampValue, e.timestampValue);
1581
1588
 
1582
1589
  case 4 /* ServerTimestampValue */ :
1583
- return jt(qt(t), qt(e));
1590
+ return Rt(qt(t), qt(e));
1584
1591
 
1585
1592
  case 5 /* StringValue */ :
1586
1593
  return gt(t.stringValue, e.stringValue);
@@ -1617,6 +1624,9 @@ function Lt(t, e) {
1617
1624
 
1618
1625
  case 10 /* ObjectValue */ :
1619
1626
  return function(t, e) {
1627
+ if (t === Ft && e === Ft) return 0;
1628
+ if (t === Ft) return 1;
1629
+ if (e === Ft) return -1;
1620
1630
  var n = t.fields || {}, r = Object.keys(n), i = e.fields || {}, o = Object.keys(i);
1621
1631
  // Even though MapValues are likely sorted correctly based on their insertion
1622
1632
  // order (e.g. when received from the backend), local modifications can bring
@@ -1637,13 +1647,13 @@ function Lt(t, e) {
1637
1647
  }
1638
1648
  }
1639
1649
 
1640
- function jt(t, e) {
1650
+ function Rt(t, e) {
1641
1651
  if ("string" == typeof t && "string" == typeof e && t.length === e.length) return gt(t, e);
1642
1652
  var n = kt(t), r = kt(e), i = gt(n.seconds, r.seconds);
1643
1653
  return 0 !== i ? i : gt(n.nanos, r.nanos);
1644
1654
  }
1645
1655
 
1646
- function Rt(t, e) {
1656
+ function xt(t, e) {
1647
1657
  return {
1648
1658
  referenceValue: "projects/" + t.projectId + "/databases/" + t.database + "/documents/" + e.path.canonicalString()
1649
1659
  };
@@ -1653,19 +1663,19 @@ function Rt(t, e) {
1653
1663
  return !!t && "arrayValue" in t;
1654
1664
  }
1655
1665
 
1656
- /** Returns true if `value` is a NullValue. */ function xt(t) {
1666
+ /** Returns true if `value` is a NullValue. */ function Ut(t) {
1657
1667
  return !!t && "nullValue" in t;
1658
1668
  }
1659
1669
 
1660
- /** Returns true if `value` is NaN. */ function Ut(t) {
1670
+ /** Returns true if `value` is NaN. */ function Bt(t) {
1661
1671
  return !!t && "doubleValue" in t && isNaN(Number(t.doubleValue));
1662
1672
  }
1663
1673
 
1664
- /** Returns true if `value` is a MapValue. */ function Bt(t) {
1674
+ /** Returns true if `value` is a MapValue. */ function Gt(t) {
1665
1675
  return !!t && "mapValue" in t;
1666
1676
  }
1667
1677
 
1668
- /** Creates a deep copy of `source`. */ function Gt(t) {
1678
+ /** Creates a deep copy of `source`. */ function zt(t) {
1669
1679
  if (t.geoPointValue) return {
1670
1680
  geoPointValue: Object.assign({}, t.geoPointValue)
1671
1681
  };
@@ -1679,7 +1689,7 @@ function Rt(t, e) {
1679
1689
  }
1680
1690
  };
1681
1691
  return St(t.mapValue.fields, (function(t, n) {
1682
- return e.mapValue.fields[t] = Gt(n);
1692
+ return e.mapValue.fields[t] = zt(n);
1683
1693
  })), e;
1684
1694
  }
1685
1695
  if (t.arrayValue) {
@@ -1687,13 +1697,13 @@ function Rt(t, e) {
1687
1697
  arrayValue: {
1688
1698
  values: []
1689
1699
  }
1690
- }, r = 0; r < (t.arrayValue.values || []).length; ++r) n.arrayValue.values[r] = Gt(t.arrayValue.values[r]);
1700
+ }, r = 0; r < (t.arrayValue.values || []).length; ++r) n.arrayValue.values[r] = zt(t.arrayValue.values[r]);
1691
1701
  return n;
1692
1702
  }
1693
1703
  return Object.assign({}, t);
1694
1704
  }
1695
1705
 
1696
- var zt = /** @class */ function() {
1706
+ var Qt = /** @class */ function() {
1697
1707
  function t(t) {
1698
1708
  this.value = t;
1699
1709
  }
@@ -1710,7 +1720,7 @@ var zt = /** @class */ function() {
1710
1720
  */
1711
1721
  t.prototype.field = function(t) {
1712
1722
  if (t.isEmpty()) return this.value;
1713
- for (var e = this.value, n = 0; n < t.length - 1; ++n) if (!Bt(e = (e.mapValue.fields || {})[t.get(n)])) return null;
1723
+ for (var e = this.value, n = 0; n < t.length - 1; ++n) if (!Gt(e = (e.mapValue.fields || {})[t.get(n)])) return null;
1714
1724
  return (e = (e.mapValue.fields || {})[t.lastSegment()]) || null;
1715
1725
  },
1716
1726
  /**
@@ -1720,7 +1730,7 @@ var zt = /** @class */ function() {
1720
1730
  * @param value - The value to set.
1721
1731
  */
1722
1732
  t.prototype.set = function(t, e) {
1723
- this.getFieldsMap(t.popLast())[t.lastSegment()] = Gt(e);
1733
+ this.getFieldsMap(t.popLast())[t.lastSegment()] = zt(e);
1724
1734
  },
1725
1735
  /**
1726
1736
  * Sets the provided fields to the provided values.
@@ -1735,7 +1745,7 @@ var zt = /** @class */ function() {
1735
1745
  var a = e.getFieldsMap(n);
1736
1746
  e.applyChanges(a, r, i), r = {}, i = [], n = o.popLast();
1737
1747
  }
1738
- t ? r[o.lastSegment()] = Gt(t) : i.push(o.lastSegment());
1748
+ t ? r[o.lastSegment()] = zt(t) : i.push(o.lastSegment());
1739
1749
  }));
1740
1750
  var o = this.getFieldsMap(n);
1741
1751
  this.applyChanges(o, r, i);
@@ -1748,9 +1758,9 @@ var zt = /** @class */ function() {
1748
1758
  */
1749
1759
  t.prototype.delete = function(t) {
1750
1760
  var e = this.field(t.popLast());
1751
- Bt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];
1761
+ Gt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];
1752
1762
  }, t.prototype.isEqual = function(t) {
1753
- return Ot(this.value, t.value);
1763
+ return Ct(this.value, t.value);
1754
1764
  },
1755
1765
  /**
1756
1766
  * Returns the map that contains the leaf element of `path`. If the parent
@@ -1763,7 +1773,7 @@ var zt = /** @class */ function() {
1763
1773
  });
1764
1774
  for (var n = 0; n < t.length; ++n) {
1765
1775
  var r = e.mapValue.fields[t.get(n)];
1766
- Bt(r) && r.mapValue.fields || (r = {
1776
+ Gt(r) && r.mapValue.fields || (r = {
1767
1777
  mapValue: {
1768
1778
  fields: {}
1769
1779
  }
@@ -1784,9 +1794,9 @@ var zt = /** @class */ function() {
1784
1794
  delete t[o];
1785
1795
  }
1786
1796
  }, t.prototype.clone = function() {
1787
- return new t(Gt(this.value));
1797
+ return new t(zt(this.value));
1788
1798
  }, t;
1789
- }(), Qt = /** @class */ function() {
1799
+ }(), Kt = /** @class */ function() {
1790
1800
  function t(t, e, n, r, i, o) {
1791
1801
  this.key = t, this.documentType = e, this.version = n, this.readTime = r, this.data = i,
1792
1802
  this.documentState = o
@@ -1796,7 +1806,7 @@ var zt = /** @class */ function() {
1796
1806
  */;
1797
1807
  }
1798
1808
  return t.newInvalidDocument = function(e) {
1799
- return new t(e, 0 /* INVALID */ , _t.min(), _t.min(), zt.empty(), 0 /* SYNCED */);
1809
+ return new t(e, 0 /* INVALID */ , _t.min(), _t.min(), Qt.empty(), 0 /* SYNCED */);
1800
1810
  },
1801
1811
  /**
1802
1812
  * Creates a new document that is known to exist with the given data at the
@@ -1806,7 +1816,7 @@ var zt = /** @class */ function() {
1806
1816
  return new t(e, 1 /* FOUND_DOCUMENT */ , n, _t.min(), r, 0 /* SYNCED */);
1807
1817
  },
1808
1818
  /** Creates a new document that is known to not exist at the given version. */ t.newNoDocument = function(e, n) {
1809
- return new t(e, 2 /* NO_DOCUMENT */ , n, _t.min(), zt.empty(), 0 /* SYNCED */);
1819
+ return new t(e, 2 /* NO_DOCUMENT */ , n, _t.min(), Qt.empty(), 0 /* SYNCED */);
1810
1820
  },
1811
1821
  /**
1812
1822
  * Creates a new document that is known to exist at the given version but
@@ -1814,7 +1824,7 @@ var zt = /** @class */ function() {
1814
1824
  * base document).
1815
1825
  */
1816
1826
  t.newUnknownDocument = function(e, n) {
1817
- return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, _t.min(), zt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
1827
+ return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, _t.min(), Qt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
1818
1828
  },
1819
1829
  /**
1820
1830
  * Changes the document type to indicate that it exists and that its version
@@ -1829,7 +1839,7 @@ var zt = /** @class */ function() {
1829
1839
  * version.
1830
1840
  */
1831
1841
  t.prototype.convertToNoDocument = function(t) {
1832
- return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = zt.empty(),
1842
+ return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = Qt.empty(),
1833
1843
  this.documentState = 0 /* SYNCED */ , this;
1834
1844
  },
1835
1845
  /**
@@ -1838,7 +1848,7 @@ var zt = /** @class */ function() {
1838
1848
  * base document).
1839
1849
  */
1840
1850
  t.prototype.convertToUnknownDocument = function(t) {
1841
- return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = zt.empty(),
1851
+ return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = Qt.empty(),
1842
1852
  this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
1843
1853
  }, t.prototype.setHasCommittedMutations = function() {
1844
1854
  return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
@@ -1879,7 +1889,7 @@ var zt = /** @class */ function() {
1879
1889
  }, t.prototype.toString = function() {
1880
1890
  return "Document(" + this.key + ", " + this.version + ", " + JSON.stringify(this.data.value) + ", {documentType: " + this.documentType + "}), {documentState: " + this.documentState + "})";
1881
1891
  }, t;
1882
- }(), Kt = function(t, e, n, r, i, o, a) {
1892
+ }(), Ht = function(t, e, n, r, i, o, a) {
1883
1893
  void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
1884
1894
  void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null),
1885
1895
  this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = r, this.limit = i,
@@ -1920,13 +1930,13 @@ var zt = /** @class */ function() {
1920
1930
  * using this factory method, because `Query` provides an implicit `orderBy`
1921
1931
  * property.
1922
1932
  */
1923
- function Ht(t, e, n, r, i, o, a) {
1933
+ function Wt(t, e, n, r, i, o, a) {
1924
1934
  return void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
1925
1935
  void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null),
1926
- new Kt(t, e, n, r, i, o, a);
1936
+ new Ht(t, e, n, r, i, o, a);
1927
1937
  }
1928
1938
 
1929
- var Wt = /** @class */ function(e) {
1939
+ var Yt = /** @class */ function(e) {
1930
1940
  function n(t, n, r) {
1931
1941
  var i = this;
1932
1942
  return (i = e.call(this) || this).field = t, i.op = n, i.value = r, i;
@@ -1934,13 +1944,13 @@ var Wt = /** @class */ function(e) {
1934
1944
  /**
1935
1945
  * Creates a filter based on the provided arguments.
1936
1946
  */ return t(n, e), n.create = function(t, e, r) {
1937
- return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.V(t, e, r) : new Yt(t, e, r) : "array-contains" /* ARRAY_CONTAINS */ === e ? new Zt(t, r) : "in" /* IN */ === e ? new te(t, r) : "not-in" /* NOT_IN */ === e ? new ee(t, r) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new ne(t, r) : new n(t, e, r);
1947
+ return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.V(t, e, r) : new $t(t, e, r) : "array-contains" /* ARRAY_CONTAINS */ === e ? new te(t, r) : "in" /* IN */ === e ? new ee(t, r) : "not-in" /* NOT_IN */ === e ? new ne(t, r) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new re(t, r) : new n(t, e, r);
1938
1948
  }, n.V = function(t, e, n) {
1939
- return "in" /* IN */ === e ? new $t(t, n) : new Xt(t, n);
1949
+ return "in" /* IN */ === e ? new Xt(t, n) : new Jt(t, n);
1940
1950
  }, n.prototype.matches = function(t) {
1941
1951
  var e = t.data.field(this.field);
1942
1952
  // Types do not have to match in NOT_EQUAL filters.
1943
- return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.D(Lt(e, this.value)) : null !== e && Ft(this.value) === Ft(e) && this.D(Lt(e, this.value));
1953
+ return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.D(Lt(e, this.value)) : null !== e && Ot(this.value) === Ot(e) && this.D(Lt(e, this.value));
1944
1954
  // Only compare types with matching backend order (such as double and int).
1945
1955
  }, n.prototype.D = function(t) {
1946
1956
  switch (this.op) {
@@ -1968,7 +1978,7 @@ var Wt = /** @class */ function(e) {
1968
1978
  }, n.prototype.N = function() {
1969
1979
  return [ "<" /* LESS_THAN */ , "<=" /* LESS_THAN_OR_EQUAL */ , ">" /* GREATER_THAN */ , ">=" /* GREATER_THAN_OR_EQUAL */ , "!=" /* NOT_EQUAL */ , "not-in" /* NOT_IN */ ].indexOf(this.op) >= 0;
1970
1980
  }, n;
1971
- }((function() {})), Yt = /** @class */ function(e) {
1981
+ }((function() {})), $t = /** @class */ function(e) {
1972
1982
  function n(t, n, r) {
1973
1983
  var i = this;
1974
1984
  return (i = e.call(this, t, n, r) || this).key = nt.fromName(r.referenceValue),
@@ -1978,10 +1988,10 @@ var Wt = /** @class */ function(e) {
1978
1988
  var e = nt.comparator(t.key, this.key);
1979
1989
  return this.D(e);
1980
1990
  }, n;
1981
- }(Wt), $t = /** @class */ function(e) {
1991
+ }(Yt), Xt = /** @class */ function(e) {
1982
1992
  function n(t, n) {
1983
1993
  var r = this;
1984
- return (r = e.call(this, t, "in" /* IN */ , n) || this).keys = Jt("in" /* IN */ , n),
1994
+ return (r = e.call(this, t, "in" /* IN */ , n) || this).keys = Zt("in" /* IN */ , n),
1985
1995
  r;
1986
1996
  }
1987
1997
  return t(n, e), n.prototype.matches = function(t) {
@@ -1989,10 +1999,10 @@ var Wt = /** @class */ function(e) {
1989
1999
  return e.isEqual(t.key);
1990
2000
  }));
1991
2001
  }, n;
1992
- }(Wt), Xt = /** @class */ function(e) {
2002
+ }(Yt), Jt = /** @class */ function(e) {
1993
2003
  function n(t, n) {
1994
2004
  var r = this;
1995
- return (r = e.call(this, t, "not-in" /* NOT_IN */ , n) || this).keys = Jt("not-in" /* NOT_IN */ , n),
2005
+ return (r = e.call(this, t, "not-in" /* NOT_IN */ , n) || this).keys = Zt("not-in" /* NOT_IN */ , n),
1996
2006
  r;
1997
2007
  }
1998
2008
  return t(n, e), n.prototype.matches = function(t) {
@@ -2000,67 +2010,67 @@ var Wt = /** @class */ function(e) {
2000
2010
  return e.isEqual(t.key);
2001
2011
  }));
2002
2012
  }, n;
2003
- }(Wt);
2013
+ }(Yt);
2004
2014
 
2005
- /** Filter that matches on key fields (i.e. '__name__'). */ function Jt(t, e) {
2015
+ /** Filter that matches on key fields (i.e. '__name__'). */ function Zt(t, e) {
2006
2016
  var n;
2007
2017
  return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((function(t) {
2008
2018
  return nt.fromName(t.referenceValue);
2009
2019
  }));
2010
2020
  }
2011
2021
 
2012
- /** A Filter that implements the array-contains operator. */ var Zt = /** @class */ function(e) {
2022
+ /** A Filter that implements the array-contains operator. */ var te = /** @class */ function(e) {
2013
2023
  function n(t, n) {
2014
2024
  return e.call(this, t, "array-contains" /* ARRAY_CONTAINS */ , n) || this;
2015
2025
  }
2016
2026
  return t(n, e), n.prototype.matches = function(t) {
2017
2027
  var e = t.data.field(this.field);
2018
- return Mt(e) && Ct(e.arrayValue, this.value);
2028
+ return Mt(e) && jt(e.arrayValue, this.value);
2019
2029
  }, n;
2020
- }(Wt), te = /** @class */ function(e) {
2030
+ }(Yt), ee = /** @class */ function(e) {
2021
2031
  function n(t, n) {
2022
2032
  return e.call(this, t, "in" /* IN */ , n) || this;
2023
2033
  }
2024
2034
  return t(n, e), n.prototype.matches = function(t) {
2025
2035
  var e = t.data.field(this.field);
2026
- return null !== e && Ct(this.value.arrayValue, e);
2036
+ return null !== e && jt(this.value.arrayValue, e);
2027
2037
  }, n;
2028
- }(Wt), ee = /** @class */ function(e) {
2038
+ }(Yt), ne = /** @class */ function(e) {
2029
2039
  function n(t, n) {
2030
2040
  return e.call(this, t, "not-in" /* NOT_IN */ , n) || this;
2031
2041
  }
2032
2042
  return t(n, e), n.prototype.matches = function(t) {
2033
- if (Ct(this.value.arrayValue, {
2043
+ if (jt(this.value.arrayValue, {
2034
2044
  nullValue: "NULL_VALUE"
2035
2045
  })) return !1;
2036
2046
  var e = t.data.field(this.field);
2037
- return null !== e && !Ct(this.value.arrayValue, e);
2047
+ return null !== e && !jt(this.value.arrayValue, e);
2038
2048
  }, n;
2039
- }(Wt), ne = /** @class */ function(e) {
2049
+ }(Yt), re = /** @class */ function(e) {
2040
2050
  function n(t, n) {
2041
2051
  return e.call(this, t, "array-contains-any" /* ARRAY_CONTAINS_ANY */ , n) || this;
2042
2052
  }
2043
2053
  return t(n, e), n.prototype.matches = function(t) {
2044
2054
  var e = this, n = t.data.field(this.field);
2045
2055
  return !(!Mt(n) || !n.arrayValue.values) && n.arrayValue.values.some((function(t) {
2046
- return Ct(e.value.arrayValue, t);
2056
+ return jt(e.value.arrayValue, t);
2047
2057
  }));
2048
2058
  }, n;
2049
- }(Wt), re = function(t, e) {
2059
+ }(Yt), ie = function(t, e) {
2050
2060
  this.position = t, this.inclusive = e;
2051
- }, ie = function(t, e /* ASCENDING */) {
2061
+ }, oe = function(t, e /* ASCENDING */) {
2052
2062
  void 0 === e && (e = "asc"), this.field = t, this.dir = e;
2053
2063
  };
2054
2064
 
2055
- /** A Filter that implements the IN operator. */ function oe(t, e) {
2065
+ /** A Filter that implements the IN operator. */ function ae(t, e) {
2056
2066
  return t.dir === e.dir && t.field.isEqual(e.field);
2057
2067
  }
2058
2068
 
2059
- function ae(t, e) {
2069
+ function se(t, e) {
2060
2070
  if (null === t) return null === e;
2061
2071
  if (null === e) return !1;
2062
2072
  if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;
2063
- for (var n = 0; n < t.position.length; n++) if (!Ot(t.position[n], e.position[n])) return !1;
2073
+ for (var n = 0; n < t.position.length; n++) if (!Ct(t.position[n], e.position[n])) return !1;
2064
2074
  return !0;
2065
2075
  }
2066
2076
 
@@ -2086,7 +2096,7 @@ function ae(t, e) {
2086
2096
  * query the RemoteStore results.
2087
2097
  *
2088
2098
  * Visible for testing.
2089
- */ var se =
2099
+ */ var ue =
2090
2100
  /**
2091
2101
  * Initializes a Query with a path and optional additional query constraints.
2092
2102
  * Path must currently be empty if this is a collection group query.
@@ -2101,11 +2111,7 @@ function(t, e, n, r, i, o /* First */ , a, s) {
2101
2111
  this.S = null, this.startAt, this.endAt;
2102
2112
  };
2103
2113
 
2104
- /** Creates a new Query for a query that matches all documents at `path` */ function ue(t) {
2105
- return !ct(t.limit) && "L" /* Last */ === t.limitType;
2106
- }
2107
-
2108
- function ce(t) {
2114
+ /** Creates a new Query for a query that matches all documents at `path` */ function ce(t) {
2109
2115
  return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;
2110
2116
  }
2111
2117
 
@@ -2133,7 +2139,7 @@ function le(t) {
2133
2139
  * which can be different from the order by constraints the user provided (e.g.
2134
2140
  * the SDK and backend always orders by `__name__`).
2135
2141
  */ function he(t) {
2136
- var e = I(t);
2142
+ var e = A(t);
2137
2143
  if (null === e.$) {
2138
2144
  e.$ = [];
2139
2145
  var n = le(e), r = ce(e);
@@ -2141,7 +2147,7 @@ function le(t) {
2141
2147
  // In order to implicitly add key ordering, we must also add the
2142
2148
  // inequality filter field for it to be a valid query.
2143
2149
  // Note that the default inequality field and key ordering is ascending.
2144
- n.isKeyField() || e.$.push(new ie(n)), e.$.push(new ie(et.keyField(), "asc" /* ASCENDING */)); else {
2150
+ n.isKeyField() || e.$.push(new oe(n)), e.$.push(new oe(et.keyField(), "asc" /* ASCENDING */)); else {
2145
2151
  for (var i = !1, o = 0, a = e.explicitOrderBy; o < a.length; o++) {
2146
2152
  var s = a[o];
2147
2153
  e.$.push(s), s.field.isKeyField() && (i = !0);
@@ -2150,7 +2156,7 @@ function le(t) {
2150
2156
  // The order of the implicit key ordering always matches the last
2151
2157
  // explicit order by
2152
2158
  var u = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : "asc" /* ASCENDING */;
2153
- e.$.push(new ie(et.keyField(), u));
2159
+ e.$.push(new oe(et.keyField(), u));
2154
2160
  }
2155
2161
  }
2156
2162
  }
@@ -2160,18 +2166,18 @@ function le(t) {
2160
2166
  /**
2161
2167
  * Converts this `Query` instance to it's corresponding `Target` representation.
2162
2168
  */ function pe(t) {
2163
- var e = I(t);
2164
- if (!e.S) if ("F" /* First */ === e.limitType) e.S = Ht(e.path, e.collectionGroup, he(e), e.filters, e.limit, e.startAt, e.endAt); else {
2169
+ var e = A(t);
2170
+ if (!e.S) if ("F" /* First */ === e.limitType) e.S = Wt(e.path, e.collectionGroup, he(e), e.filters, e.limit, e.startAt, e.endAt); else {
2165
2171
  for (
2166
2172
  // Flip the orderBy directions since we want the last results
2167
2173
  var n = [], r = 0, i = he(e); r < i.length; r++) {
2168
2174
  var o = i[r], a = "desc" /* DESCENDING */ === o.dir ? "asc" /* ASCENDING */ : "desc" /* DESCENDING */;
2169
- n.push(new ie(o.field, a));
2175
+ n.push(new oe(o.field, a));
2170
2176
  }
2171
2177
  // We need to swap the cursors to match the now-flipped query ordering.
2172
- var s = e.endAt ? new re(e.endAt.position, !e.endAt.inclusive) : null, u = e.startAt ? new re(e.startAt.position, !e.startAt.inclusive) : null;
2178
+ var s = e.endAt ? new ie(e.endAt.position, e.endAt.inclusive) : null, u = e.startAt ? new ie(e.startAt.position, e.startAt.inclusive) : null;
2173
2179
  // Now return as a LimitType.First query.
2174
- e.S = Ht(e.path, e.collectionGroup, n, e.filters, e.limit, s, u);
2180
+ e.S = Wt(e.path, e.collectionGroup, n, e.filters, e.limit, s, u);
2175
2181
  }
2176
2182
  return e.S;
2177
2183
  }
@@ -2313,14 +2319,14 @@ function de(t, e) {
2313
2319
  a.fieldTransforms = o, a.type = 1 /* Patch */ , a;
2314
2320
  }
2315
2321
  return t(n, e), n;
2316
- }(Te), Ie = /** @class */ function(e) {
2322
+ }(Te), Ae = /** @class */ function(e) {
2317
2323
  function n(t, n) {
2318
2324
  var r = this;
2319
2325
  return (r = e.call(this) || this).key = t, r.precondition = n, r.type = 2 /* Delete */ ,
2320
2326
  r.fieldTransforms = [], r;
2321
2327
  }
2322
2328
  return t(n, e), n;
2323
- }(Te), Ae = /** @class */ function(e) {
2329
+ }(Te), Ie = /** @class */ function(e) {
2324
2330
  function n(t, n) {
2325
2331
  var r = this;
2326
2332
  return (r = e.call(this) || this).key = t, r.precondition = n, r.type = 3 /* Verify */ ,
@@ -2393,17 +2399,17 @@ function Ce(t, e) {
2393
2399
  return Oe(t.databaseId, e.path);
2394
2400
  }
2395
2401
 
2396
- function Le(t, e) {
2402
+ function je(t, e) {
2397
2403
  var n, r = function(t) {
2398
2404
  var e = Z.fromString(t);
2399
2405
  return E(ze(e)), e;
2400
2406
  }(e);
2401
- if (r.get(1) !== t.databaseId.projectId) throw new x(V, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
2402
- if (r.get(3) !== t.databaseId.database) throw new x(V, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
2407
+ if (r.get(1) !== t.databaseId.projectId) throw new M(V, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
2408
+ if (r.get(3) !== t.databaseId.database) throw new M(V, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
2403
2409
  return new nt((E((n = r).length > 4 && "documents" === n.get(4)), n.popFirst(5)));
2404
2410
  }
2405
2411
 
2406
- function je(t, e) {
2412
+ function Le(t, e) {
2407
2413
  return Oe(t.databaseId, e);
2408
2414
  }
2409
2415
 
@@ -2411,14 +2417,14 @@ function Re(t) {
2411
2417
  return new Z([ "projects", t.databaseId.projectId, "databases", t.databaseId.database ]).canonicalString();
2412
2418
  }
2413
2419
 
2414
- function Me(t, e, n) {
2420
+ function xe(t, e, n) {
2415
2421
  return {
2416
2422
  name: Ce(t, e),
2417
2423
  fields: n.value.mapValue.fields
2418
2424
  };
2419
2425
  }
2420
2426
 
2421
- function xe(t) {
2427
+ function Me(t) {
2422
2428
  return ke[t];
2423
2429
  }
2424
2430
 
@@ -2571,7 +2577,7 @@ function ze(t) {
2571
2577
  o.K = r, o.q = i, o.J = !1, o;
2572
2578
  }
2573
2579
  return t(n, e), n.prototype.X = function() {
2574
- if (this.J) throw new x(O, "The client has already been terminated.");
2580
+ if (this.J) throw new M(O, "The client has already been terminated.");
2575
2581
  },
2576
2582
  /** Invokes the provided RPC with auth and AppCheck tokens. */ n.prototype.m = function(t, e, n) {
2577
2583
  var r = this;
@@ -2580,7 +2586,7 @@ function ze(t) {
2580
2586
  return r.K.m(t, e, n, o, a);
2581
2587
  })).catch((function(t) {
2582
2588
  throw "FirebaseError" === t.name ? (t.code === q && (r.authCredentials.invalidateToken(),
2583
- r.appCheckCredentials.invalidateToken()), t) : new x(k, t.toString());
2589
+ r.appCheckCredentials.invalidateToken()), t) : new M(k, t.toString());
2584
2590
  }));
2585
2591
  },
2586
2592
  /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ n.prototype.T = function(t, e, n) {
@@ -2590,7 +2596,7 @@ function ze(t) {
2590
2596
  return r.K.T(t, e, n, o, a);
2591
2597
  })).catch((function(t) {
2592
2598
  throw "FirebaseError" === t.name ? (t.code === q && (r.authCredentials.invalidateToken(),
2593
- r.appCheckCredentials.invalidateToken()), t) : new x(k, t.toString());
2599
+ r.appCheckCredentials.invalidateToken()), t) : new M(k, t.toString());
2594
2600
  }));
2595
2601
  }, n.prototype.terminate = function() {
2596
2602
  this.J = !0;
@@ -2630,19 +2636,19 @@ function We(t, r) {
2630
2636
  return n(this, (function(n) {
2631
2637
  switch (n.label) {
2632
2638
  case 0:
2633
- return e = I(t), i = Re(e.q) + "/documents", o = {
2639
+ return e = A(t), i = Re(e.q) + "/documents", o = {
2634
2640
  writes: r.map((function(t) {
2635
2641
  return function(t, e) {
2636
2642
  var n;
2637
2643
  if (e instanceof Se) n = {
2638
- update: Me(t, e.key, e.value)
2639
- }; else if (e instanceof Ie) n = {
2644
+ update: xe(t, e.key, e.value)
2645
+ }; else if (e instanceof Ae) n = {
2640
2646
  delete: Ce(t, e.key)
2641
2647
  }; else if (e instanceof Ee) n = {
2642
- update: Me(t, e.key, e.data),
2648
+ update: xe(t, e.key, e.data),
2643
2649
  updateMask: Ge(e.fieldMask)
2644
2650
  }; else {
2645
- if (!(e instanceof Ae)) return S();
2651
+ if (!(e instanceof Ie)) return S();
2646
2652
  n = {
2647
2653
  verify: Ce(t, e.key)
2648
2654
  };
@@ -2696,7 +2702,7 @@ function Ye(t, r) {
2696
2702
  return n(this, (function(n) {
2697
2703
  switch (n.label) {
2698
2704
  case 0:
2699
- return e = I(t), i = Re(e.q) + "/documents", o = {
2705
+ return e = A(t), i = Re(e.q) + "/documents", o = {
2700
2706
  documents: r.map((function(t) {
2701
2707
  return Ce(e.q, t);
2702
2708
  }))
@@ -2707,16 +2713,16 @@ function Ye(t, r) {
2707
2713
  var n = function(t, e) {
2708
2714
  return "found" in e ? function(t, e) {
2709
2715
  E(!!e.found), e.found.name, e.found.updateTime;
2710
- var n = Le(t, e.found.name), r = Fe(e.found.updateTime), i = new zt({
2716
+ var n = je(t, e.found.name), r = Fe(e.found.updateTime), i = new Qt({
2711
2717
  mapValue: {
2712
2718
  fields: e.found.fields
2713
2719
  }
2714
2720
  });
2715
- return Qt.newFoundDocument(n, r, i);
2721
+ return Kt.newFoundDocument(n, r, i);
2716
2722
  }(t, e) : "missing" in e ? function(t, e) {
2717
2723
  E(!!e.missing), E(!!e.readTime);
2718
- var n = Le(t, e.missing), r = Fe(e.readTime);
2719
- return Qt.newNoDocument(n, r);
2724
+ var n = je(t, e.missing), r = Fe(e.readTime);
2725
+ return Kt.newNoDocument(n, r);
2720
2726
  }(t, e) : S();
2721
2727
  }(e.q, t);
2722
2728
  s.set(n.key.toString(), n);
@@ -2735,15 +2741,15 @@ function $e(t, r) {
2735
2741
  return n(this, (function(n) {
2736
2742
  switch (n.label) {
2737
2743
  case 0:
2738
- return e = I(t), i = function(t, e) {
2744
+ return e = A(t), i = function(t, e) {
2739
2745
  // Dissect the path into parent, collectionId, and optional key filter.
2740
2746
  var n = {
2741
2747
  structuredQuery: {}
2742
2748
  }, r = e.path;
2743
- null !== e.collectionGroup ? (n.parent = je(t, r), n.structuredQuery.from = [ {
2749
+ null !== e.collectionGroup ? (n.parent = Le(t, r), n.structuredQuery.from = [ {
2744
2750
  collectionId: e.collectionGroup,
2745
2751
  allDescendants: !0
2746
- } ]) : (n.parent = je(t, r.popLast()), n.structuredQuery.from = [ {
2752
+ } ]) : (n.parent = Le(t, r.popLast()), n.structuredQuery.from = [ {
2747
2753
  collectionId: r.lastSegment()
2748
2754
  } ]);
2749
2755
  var i = function(t) {
@@ -2752,26 +2758,26 @@ function $e(t, r) {
2752
2758
  // visible for testing
2753
2759
  return function(t) {
2754
2760
  if ("==" /* EQUAL */ === t.op) {
2755
- if (Ut(t.value)) return {
2761
+ if (Bt(t.value)) return {
2756
2762
  unaryFilter: {
2757
2763
  field: Be(t.field),
2758
2764
  op: "IS_NAN"
2759
2765
  }
2760
2766
  };
2761
- if (xt(t.value)) return {
2767
+ if (Ut(t.value)) return {
2762
2768
  unaryFilter: {
2763
2769
  field: Be(t.field),
2764
2770
  op: "IS_NULL"
2765
2771
  }
2766
2772
  };
2767
2773
  } else if ("!=" /* NOT_EQUAL */ === t.op) {
2768
- if (Ut(t.value)) return {
2774
+ if (Bt(t.value)) return {
2769
2775
  unaryFilter: {
2770
2776
  field: Be(t.field),
2771
2777
  op: "IS_NOT_NAN"
2772
2778
  }
2773
2779
  };
2774
- if (xt(t.value)) return {
2780
+ if (Ut(t.value)) return {
2775
2781
  unaryFilter: {
2776
2782
  field: Be(t.field),
2777
2783
  op: "IS_NOT_NULL"
@@ -2802,7 +2808,7 @@ function $e(t, r) {
2802
2808
  return function(t) {
2803
2809
  return {
2804
2810
  field: Be(t.field),
2805
- direction: xe(t.dir)
2811
+ direction: Me(t.dir)
2806
2812
  };
2807
2813
  }(t);
2808
2814
  }));
@@ -2831,11 +2837,11 @@ function $e(t, r) {
2831
2837
  return !!t.document;
2832
2838
  })).map((function(t) {
2833
2839
  return function(t, e, n) {
2834
- var r = Le(t, e.name), i = Fe(e.updateTime), o = new zt({
2840
+ var r = je(t, e.name), i = Fe(e.updateTime), o = new Qt({
2835
2841
  mapValue: {
2836
2842
  fields: e.fields
2837
2843
  }
2838
- }), a = Qt.newFoundDocument(r, i, o);
2844
+ }), a = Kt.newFoundDocument(r, i, o);
2839
2845
  return a;
2840
2846
  }(e.q, t.document);
2841
2847
  })) ];
@@ -2870,7 +2876,7 @@ function $e(t, r) {
2870
2876
  * instance. Callers must invoke removeComponents() when the Firestore
2871
2877
  * instance is terminated.
2872
2878
  */ function Je(t) {
2873
- if (t._terminated) throw new x(O, "The client has already been terminated.");
2879
+ if (t._terminated) throw new M(O, "The client has already been terminated.");
2874
2880
  if (!Xe.has(t)) {
2875
2881
  w("ComponentProvider", "Initializing Datastore");
2876
2882
  var e = function(t) {
@@ -2912,17 +2918,17 @@ function $e(t, r) {
2912
2918
  function t(t) {
2913
2919
  var e;
2914
2920
  if (void 0 === t.host) {
2915
- if (void 0 !== t.ssl) throw new x(V, "Can't provide ssl option if host option is not set");
2921
+ if (void 0 !== t.ssl) throw new M(V, "Can't provide ssl option if host option is not set");
2916
2922
  this.host = "firestore.googleapis.com", this.ssl = !0;
2917
2923
  } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;
2918
2924
  if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties,
2919
2925
  void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
2920
- if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new x(V, "cacheSizeBytes must be at least 1048576");
2926
+ if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new M(V, "cacheSizeBytes must be at least 1048576");
2921
2927
  this.cacheSizeBytes = t.cacheSizeBytes;
2922
2928
  }
2923
2929
  this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling,
2924
2930
  this.useFetchStreams = !!t.useFetchStreams, function(t, e, n, r) {
2925
- if (!0 === e && !0 === r) throw new x(V, "experimentalForceLongPolling and experimentalAutoDetectLongPolling cannot be used together.");
2931
+ if (!0 === e && !0 === r) throw new M(V, "experimentalForceLongPolling and experimentalAutoDetectLongPolling cannot be used together.");
2926
2932
  }(0, t.experimentalForceLongPolling, 0, t.experimentalAutoDetectLongPolling);
2927
2933
  }
2928
2934
  return t.prototype.isEqual = function(t) {
@@ -2938,7 +2944,7 @@ function $e(t, r) {
2938
2944
  this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new Ze({}),
2939
2945
  this._settingsFrozen = !1, t instanceof X ? this._databaseId = t : (this._app = t,
2940
2946
  this._databaseId = function(t) {
2941
- if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new x(V, '"projectId" not provided in firebase.initializeApp.');
2947
+ if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new M(V, '"projectId" not provided in firebase.initializeApp.');
2942
2948
  return new X(t.options.projectId);
2943
2949
  }(t));
2944
2950
  }
@@ -2948,7 +2954,7 @@ function $e(t, r) {
2948
2954
  * instance.
2949
2955
  */
2950
2956
  get: function() {
2951
- if (!this._app) throw new x(O, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
2957
+ if (!this._app) throw new M(O, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
2952
2958
  return this._app;
2953
2959
  },
2954
2960
  enumerable: !1,
@@ -2966,7 +2972,7 @@ function $e(t, r) {
2966
2972
  enumerable: !1,
2967
2973
  configurable: !0
2968
2974
  }), t.prototype._setSettings = function(t) {
2969
- if (this._settingsFrozen) throw new x(O, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
2975
+ if (this._settingsFrozen) throw new M(O, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
2970
2976
  this._settings = new Ze(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
2971
2977
  if (!t) return new G;
2972
2978
  switch (t.type) {
@@ -2980,7 +2986,7 @@ function $e(t, r) {
2980
2986
  return t.client;
2981
2987
 
2982
2988
  default:
2983
- throw new x(V, "makeAuthCredentialsProvider failed due to invalid credential type");
2989
+ throw new M(V, "makeAuthCredentialsProvider failed due to invalid credential type");
2984
2990
  }
2985
2991
  }(t.credentials));
2986
2992
  }, t.prototype._getSettings = function() {
@@ -3033,7 +3039,7 @@ function $e(t, r) {
3033
3039
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
3034
3040
  */ function en(t, e) {
3035
3041
  var n = _getProvider(t, "firestore/lite");
3036
- if (n.isInitialized()) throw new x(O, "Firestore can only be initialized once per app.");
3042
+ if (n.isInitialized()) throw new M(O, "Firestore can only be initialized once per app.");
3037
3043
  return n.initialize({
3038
3044
  options: e
3039
3045
  });
@@ -3078,7 +3084,7 @@ function $e(t, r) {
3078
3084
  // invalid field "uid" and missing field "sub" / "user_id".)
3079
3085
  a = d(r.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);
3080
3086
  var u = r.mockUserToken.sub || r.mockUserToken.user_id;
3081
- if (!u) throw new x(V, "mockUserToken must contain 'sub' or 'user_id' field!");
3087
+ if (!u) throw new M(V, "mockUserToken must contain 'sub' or 'user_id' field!");
3082
3088
  s = new m(u);
3083
3089
  }
3084
3090
  t._authCredentials = new z(new B(a, s));
@@ -3212,7 +3218,7 @@ var an = /** @class */ function() {
3212
3218
  /** @hideconstructor */
3213
3219
  function n(t, n, r) {
3214
3220
  var i = this;
3215
- return (i = e.call(this, t, n, new se(r)) || this)._path = r,
3221
+ return (i = e.call(this, t, n, new ue(r)) || this)._path = r,
3216
3222
  /** The type of this Firestore reference. */
3217
3223
  i.type = "collection", i;
3218
3224
  }
@@ -3258,7 +3264,7 @@ var an = /** @class */ function() {
3258
3264
  var o = Z.fromString.apply(Z, r([ e ], n));
3259
3265
  return ot(o), new un(t, /* converter= */ null, o);
3260
3266
  }
3261
- if (!(t instanceof an || t instanceof un)) throw new x(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3267
+ if (!(t instanceof an || t instanceof un)) throw new M(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3262
3268
  var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
3263
3269
  return ot(a), new un(t.firestore,
3264
3270
  /* converter= */ null, a);
@@ -3277,7 +3283,7 @@ var an = /** @class */ function() {
3277
3283
  * will be included. Cannot contain a slash.
3278
3284
  * @returns The created `Query`.
3279
3285
  */ function ln(t, e) {
3280
- if (t = st(t, tn), rt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new x(V, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
3286
+ if (t = st(t, tn), rt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new M(V, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
3281
3287
  return new sn(t,
3282
3288
  /* converter= */ null,
3283
3289
  /**
@@ -3285,7 +3291,7 @@ var an = /** @class */ function() {
3285
3291
  * within the provided collection group.
3286
3292
  */
3287
3293
  function(t) {
3288
- return new se(Z.emptyPath(), t);
3294
+ return new ue(Z.emptyPath(), t);
3289
3295
  }(e));
3290
3296
  }
3291
3297
 
@@ -3299,7 +3305,7 @@ function fn(t, e) {
3299
3305
  return it(o), new an(t,
3300
3306
  /* converter= */ null, new nt(o));
3301
3307
  }
3302
- if (!(t instanceof an || t instanceof un)) throw new x(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3308
+ if (!(t instanceof an || t instanceof un)) throw new M(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3303
3309
  var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
3304
3310
  return it(a), new an(t.firestore, t instanceof un ? t.converter : null, new nt(a));
3305
3311
  }
@@ -3329,12 +3335,12 @@ function pn(t, e) {
3329
3335
  return function(t, e) {
3330
3336
  if (t.limit !== e.limit) return !1;
3331
3337
  if (t.orderBy.length !== e.orderBy.length) return !1;
3332
- for (var n = 0; n < t.orderBy.length; n++) if (!oe(t.orderBy[n], e.orderBy[n])) return !1;
3338
+ for (var n = 0; n < t.orderBy.length; n++) if (!ae(t.orderBy[n], e.orderBy[n])) return !1;
3333
3339
  if (t.filters.length !== e.filters.length) return !1;
3334
3340
  for (var r = 0; r < t.filters.length; r++) if (i = t.filters[r], o = e.filters[r],
3335
- i.op !== o.op || !i.field.isEqual(o.field) || !Ot(i.value, o.value)) return !1;
3341
+ i.op !== o.op || !i.field.isEqual(o.field) || !Ct(i.value, o.value)) return !1;
3336
3342
  var i, o;
3337
- return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!ae(t.startAt, e.startAt) && ae(t.endAt, e.endAt);
3343
+ return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!se(t.startAt, e.startAt) && se(t.endAt, e.endAt);
3338
3344
  }(pe(t), pe(e)) && t.limitType === e.limitType;
3339
3345
  }(t._query, e._query) && t.converter === e.converter
3340
3346
  /**
@@ -3372,7 +3378,7 @@ var dn = /** @class */ function() {
3372
3378
  */
3373
3379
  function t() {
3374
3380
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3375
- for (var n = 0; n < t.length; ++n) if (0 === t[n].length) throw new x(V, "Invalid field name at argument $(i + 1). Field names must not be empty.");
3381
+ for (var n = 0; n < t.length; ++n) if (0 === t[n].length) throw new M(V, "Invalid field name at argument $(i + 1). Field names must not be empty.");
3376
3382
  this._internalPath = new et(t);
3377
3383
  }
3378
3384
  /**
@@ -3422,9 +3428,9 @@ var dn = /** @class */ function() {
3422
3428
  * @param base64 - The Base64 string used to create the `Bytes` object.
3423
3429
  */ return t.fromBase64String = function(e) {
3424
3430
  try {
3425
- return new t(It.fromBase64String(e));
3431
+ return new t(At.fromBase64String(e));
3426
3432
  } catch (e) {
3427
- throw new x(V, "Failed to construct data from Base64 string: " + e);
3433
+ throw new M(V, "Failed to construct data from Base64 string: " + e);
3428
3434
  }
3429
3435
  },
3430
3436
  /**
@@ -3433,7 +3439,7 @@ var dn = /** @class */ function() {
3433
3439
  * @param array - The Uint8Array used to create the `Bytes` object.
3434
3440
  */
3435
3441
  t.fromUint8Array = function(e) {
3436
- return new t(It.fromUint8Array(e));
3442
+ return new t(At.fromUint8Array(e));
3437
3443
  },
3438
3444
  /**
3439
3445
  * Returns the underlying bytes as a Base64-encoded string.
@@ -3483,8 +3489,8 @@ function(t) {
3483
3489
  * @param longitude - The longitude as number between -180 and 180.
3484
3490
  */
3485
3491
  function t(t, e) {
3486
- if (!isFinite(t) || t < -90 || t > 90) throw new x(V, "Latitude must be a number between -90 and 90, but was: " + t);
3487
- if (!isFinite(e) || e < -180 || e > 180) throw new x(V, "Longitude must be a number between -180 and 180, but was: " + e);
3492
+ if (!isFinite(t) || t < -90 || t > 90) throw new M(V, "Latitude must be a number between -90 and 90, but was: " + t);
3493
+ if (!isFinite(e) || e < -180 || e > 180) throw new M(V, "Longitude must be a number between -180 and 180, but was: " + e);
3488
3494
  this._lat = t, this._long = e;
3489
3495
  }
3490
3496
  return Object.defineProperty(t.prototype, "latitude", {
@@ -3679,27 +3685,27 @@ function(t) {
3679
3685
  /**
3680
3686
  * Helper for parsing raw user input (provided via the API) into internal model
3681
3687
  * classes.
3682
- */ function In(t) {
3688
+ */ function An(t) {
3683
3689
  var e = t._freezeSettings(), n = Qe(t._databaseId);
3684
3690
  return new En(t._databaseId, !!e.ignoreUndefinedProperties, n);
3685
3691
  }
3686
3692
 
3687
- /** Parse document data from a set() call. */ function An(t, e, n, r, i, o) {
3693
+ /** Parse document data from a set() call. */ function In(t, e, n, r, i, o) {
3688
3694
  void 0 === o && (o = {});
3689
3695
  var a = t.ht(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
3690
- Mn("Data must be an object, but it was:", a, r);
3691
- var s, u, c = jn(r, a);
3696
+ xn("Data must be an object, but it was:", a, r);
3697
+ var s, u, c = Ln(r, a);
3692
3698
  if (o.merge) s = new Et(a.fieldMask), u = a.fieldTransforms; else if (o.mergeFields) {
3693
3699
  for (var l = [], f = 0, h = o.mergeFields; f < h.length; f++) {
3694
- var p = xn(e, h[f], n);
3695
- if (!a.contains(p)) throw new x(V, "Field '" + p + "' is specified in your field mask but missing from your input data.");
3700
+ var p = Mn(e, h[f], n);
3701
+ if (!a.contains(p)) throw new M(V, "Field '" + p + "' is specified in your field mask but missing from your input data.");
3696
3702
  zn(l, p) || l.push(p);
3697
3703
  }
3698
3704
  s = new Et(l), u = a.fieldTransforms.filter((function(t) {
3699
3705
  return s.covers(t.field);
3700
3706
  }));
3701
3707
  } else s = null, u = a.fieldTransforms;
3702
- return new bn(new zt(c), s, u);
3708
+ return new bn(new Qt(c), s, u);
3703
3709
  }
3704
3710
 
3705
3711
  var kn = /** @class */ function(e) {
@@ -3757,7 +3763,7 @@ var Dn = /** @class */ function(e) {
3757
3763
  return t(n, e), n.prototype._toFieldTransform = function(t) {
3758
3764
  var e = Vn(this, t,
3759
3765
  /*array=*/ !0), n = this.lt.map((function(t) {
3760
- return Ln(t, e);
3766
+ return jn(t, e);
3761
3767
  })), r = new ve(n);
3762
3768
  return new be(t.path, r);
3763
3769
  }, n.prototype.isEqual = function(t) {
@@ -3772,7 +3778,7 @@ var Dn = /** @class */ function(e) {
3772
3778
  return t(n, e), n.prototype._toFieldTransform = function(t) {
3773
3779
  var e = Vn(this, t,
3774
3780
  /*array=*/ !0), n = this.lt.map((function(t) {
3775
- return Ln(t, e);
3781
+ return jn(t, e);
3776
3782
  })), r = new ge(n);
3777
3783
  return new be(t.path, r);
3778
3784
  }, n.prototype.isEqual = function(t) {
@@ -3795,8 +3801,8 @@ var Dn = /** @class */ function(e) {
3795
3801
 
3796
3802
  /** Parse update data from an update() call. */ function Fn(t, e, n, r) {
3797
3803
  var i = t.ht(1 /* Update */ , e, n);
3798
- Mn("Data must be an object, but it was:", i, r);
3799
- var o = [], a = zt.empty();
3804
+ xn("Data must be an object, but it was:", i, r);
3805
+ var o = [], a = Qt.empty();
3800
3806
  St(r, (function(t, r) {
3801
3807
  var s = Bn(e, t, n);
3802
3808
  // For Compat types, we have to "extract" the underlying types before
@@ -3806,7 +3812,7 @@ var Dn = /** @class */ function(e) {
3806
3812
  if (r instanceof kn)
3807
3813
  // Add it to the field mask, but don't add anything to updateData.
3808
3814
  o.push(s); else {
3809
- var c = Ln(r, u);
3815
+ var c = jn(r, u);
3810
3816
  null != c && (o.push(s), a.set(s, c));
3811
3817
  }
3812
3818
  }));
@@ -3815,12 +3821,12 @@ var Dn = /** @class */ function(e) {
3815
3821
  }
3816
3822
 
3817
3823
  /** Parse update data from a list of field/value arguments. */ function On(t, e, n, r, i, o) {
3818
- var a = t.ht(1 /* Update */ , e, n), s = [ xn(e, r, n) ], u = [ i ];
3819
- if (o.length % 2 != 0) throw new x(V, "Function " + e + "() needs to be called with an even number of arguments that alternate between field names and values.");
3820
- for (var c = 0; c < o.length; c += 2) s.push(xn(e, o[c])), u.push(o[c + 1]);
3824
+ var a = t.ht(1 /* Update */ , e, n), s = [ Mn(e, r, n) ], u = [ i ];
3825
+ if (o.length % 2 != 0) throw new M(V, "Function " + e + "() needs to be called with an even number of arguments that alternate between field names and values.");
3826
+ for (var c = 0; c < o.length; c += 2) s.push(Mn(e, o[c])), u.push(o[c + 1]);
3821
3827
  // We iterate in reverse order to pick the last value for a field if the
3822
3828
  // user specified the field multiple times.
3823
- for (var l = [], f = zt.empty(), h = s.length - 1; h >= 0; --h) if (!zn(l, s[h])) {
3829
+ for (var l = [], f = Qt.empty(), h = s.length - 1; h >= 0; --h) if (!zn(l, s[h])) {
3824
3830
  var d = s[h], m = u[h];
3825
3831
  // For Compat types, we have to "extract" the underlying types before
3826
3832
  // performing validation.
@@ -3829,7 +3835,7 @@ var Dn = /** @class */ function(e) {
3829
3835
  if (m instanceof kn)
3830
3836
  // Add it to the field mask, but don't add anything to updateData.
3831
3837
  l.push(d); else {
3832
- var v = Ln(m, y);
3838
+ var v = jn(m, y);
3833
3839
  null != v && (l.push(d), f.set(d, v));
3834
3840
  }
3835
3841
  }
@@ -3844,7 +3850,7 @@ var Dn = /** @class */ function(e) {
3844
3850
  * @param allowArrays - Whether the query value is an array that may directly
3845
3851
  * contain additional arrays (e.g. the operand of an `in` query).
3846
3852
  */ function Cn(t, e, n, r) {
3847
- return void 0 === r && (r = !1), Ln(n, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
3853
+ return void 0 === r && (r = !1), jn(n, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
3848
3854
  }
3849
3855
 
3850
3856
  /**
@@ -3855,11 +3861,11 @@ var Dn = /** @class */ function(e) {
3855
3861
  * the source of the data being parsed, etc.
3856
3862
  * @returns The parsed value, or null if the value was a FieldValue sentinel
3857
3863
  * that should not be included in the resulting parsed data.
3858
- */ function Ln(t, e) {
3864
+ */ function jn(t, e) {
3859
3865
  if (Rn(
3860
3866
  // Unwrap the API type from the Compat SDK. This will return the API type
3861
3867
  // from firestore-exp.
3862
- t = p(t))) return Mn("Unsupported field value:", e, t), jn(t, e);
3868
+ t = p(t))) return xn("Unsupported field value:", e, t), Ln(t, e);
3863
3869
  if (t instanceof vn)
3864
3870
  // FieldValues usually parse into transforms (except deleteField())
3865
3871
  // in which case we do not want to include this field in our parsed data
@@ -3895,7 +3901,7 @@ var Dn = /** @class */ function(e) {
3895
3901
  if (e.settings.rt && 4 /* ArrayArgument */ !== e.tt) throw e.ut("Nested arrays are not supported");
3896
3902
  return function(t, e) {
3897
3903
  for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {
3898
- var a = Ln(o[i], e.ot(r));
3904
+ var a = jn(o[i], e.ot(r));
3899
3905
  null == a && (
3900
3906
  // Just include nulls in the array for fields being replaced with a
3901
3907
  // sentinel.
@@ -3956,7 +3962,7 @@ var Dn = /** @class */ function(e) {
3956
3962
  }(t, e);
3957
3963
  }
3958
3964
 
3959
- function jn(t, e) {
3965
+ function Ln(t, e) {
3960
3966
  var n = {};
3961
3967
  return function(t) {
3962
3968
  for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;
@@ -3965,7 +3971,7 @@ function jn(t, e) {
3965
3971
  // If we encounter an empty object, we explicitly add it to the update
3966
3972
  // mask to ensure that the server creates a map entry.
3967
3973
  e.path && e.path.length > 0 && e.fieldMask.push(e.path) : St(t, (function(t, r) {
3968
- var i = Ln(r, e.nt(t));
3974
+ var i = jn(r, e.nt(t));
3969
3975
  null != i && (n[t] = i);
3970
3976
  })), {
3971
3977
  mapValue: {
@@ -3978,7 +3984,7 @@ function Rn(t) {
3978
3984
  return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof bt || t instanceof gn || t instanceof yn || t instanceof an || t instanceof vn);
3979
3985
  }
3980
3986
 
3981
- function Mn(t, e, n) {
3987
+ function xn(t, e, n) {
3982
3988
  if (!Rn(n) || !function(t) {
3983
3989
  return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
3984
3990
  }(n)) {
@@ -3989,7 +3995,7 @@ function Mn(t, e, n) {
3989
3995
 
3990
3996
  /**
3991
3997
  * Helper that calls fromDotSeparatedString() but wraps any error thrown.
3992
- */ function xn(t, e, n) {
3998
+ */ function Mn(t, e, n) {
3993
3999
  if (
3994
4000
  // If required, replace the FieldPath Compat class with with the firestore-exp
3995
4001
  // FieldPath.
@@ -4030,7 +4036,7 @@ function Gn(t, e, n, r, i) {
4030
4036
  n && (s += " (via `toFirestore()`)");
4031
4037
  var u = "";
4032
4038
  return (o || a) && (u += " (found", o && (u += " in field " + r), a && (u += " in document " + i),
4033
- u += ")"), new x(V, (s += ". ") + t + u)
4039
+ u += ")"), new M(V, (s += ". ") + t + u)
4034
4040
  /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
4035
4041
  }
4036
4042
 
@@ -4260,10 +4266,10 @@ var Jn = /** @class */ function(e) {
4260
4266
  i;
4261
4267
  }
4262
4268
  return t(n, e), n.prototype._apply = function(t) {
4263
- var e = In(t.firestore), n = function(t, e, n, r, i, o, a) {
4269
+ var e = An(t.firestore), n = function(t, e, n, r, i, o, a) {
4264
4270
  var s;
4265
4271
  if (i.isKeyField()) {
4266
- if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new x(V, "Invalid Query. You can't perform '" + o + "' queries on documentId().");
4272
+ if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new M(V, "Invalid Query. You can't perform '" + o + "' queries on documentId().");
4267
4273
  if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
4268
4274
  pr(a, o);
4269
4275
  for (var u = [], c = 0, l = a; c < l.length; c++) {
@@ -4279,11 +4285,11 @@ var Jn = /** @class */ function(e) {
4279
4285
  } else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || pr(a, o),
4280
4286
  s = Cn(n, "where", a,
4281
4287
  /* allowArrays= */ "in" /* IN */ === o || "not-in" /* NOT_IN */ === o);
4282
- var h = Wt.create(i, o, s);
4288
+ var h = Yt.create(i, o, s);
4283
4289
  return function(t, e) {
4284
4290
  if (e.N()) {
4285
4291
  var n = le(t);
4286
- if (null !== n && !n.isEqual(e.field)) throw new x(V, "Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '" + n.toString() + "' and '" + e.field.toString() + "'");
4292
+ if (null !== n && !n.isEqual(e.field)) throw new M(V, "Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '" + n.toString() + "' and '" + e.field.toString() + "'");
4287
4293
  var r = ce(t);
4288
4294
  null !== r && dr(t, e.field, r);
4289
4295
  }
@@ -4329,12 +4335,12 @@ var Jn = /** @class */ function(e) {
4329
4335
  }(e.op));
4330
4336
  if (null !== i)
4331
4337
  // Special case when it's a duplicate op to give a slightly clearer error message.
4332
- throw i === e.op ? new x(V, "Invalid query. You cannot use more than one '" + e.op.toString() + "' filter.") : new x(V, "Invalid query. You cannot use '" + e.op.toString() + "' filters with '" + i.toString() + "' filters.");
4338
+ throw i === e.op ? new M(V, "Invalid query. You cannot use more than one '" + e.op.toString() + "' filter.") : new M(V, "Invalid query. You cannot use '" + e.op.toString() + "' filters with '" + i.toString() + "' filters.");
4333
4339
  }(t, h), h;
4334
4340
  }(t._query, 0, e, t.firestore._databaseId, this.dt, this.wt, this.yt);
4335
4341
  return new sn(t.firestore, t.converter, function(t, e) {
4336
4342
  var n = t.filters.concat([ e ]);
4337
- return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
4343
+ return new ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
4338
4344
  }(t._query, n));
4339
4345
  }, n;
4340
4346
  }($n);
@@ -4361,9 +4367,9 @@ var tr = /** @class */ function(e) {
4361
4367
  }
4362
4368
  return t(n, e), n.prototype._apply = function(t) {
4363
4369
  var e = function(t, e, n) {
4364
- if (null !== t.startAt) throw new x(V, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
4365
- if (null !== t.endAt) throw new x(V, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
4366
- var r = new ie(e, n);
4370
+ if (null !== t.startAt) throw new M(V, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
4371
+ if (null !== t.endAt) throw new M(V, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
4372
+ var r = new oe(e, n);
4367
4373
  return function(t, e) {
4368
4374
  if (null === ce(t)) {
4369
4375
  // This is the first order by. It must match any inequality.
@@ -4375,7 +4381,7 @@ var tr = /** @class */ function(e) {
4375
4381
  return new sn(t.firestore, t.converter, function(t, e) {
4376
4382
  // TODO(dimond): validate that orderBy does not list the same key twice.
4377
4383
  var n = t.explicitOrderBy.concat([ e ]);
4378
- return new se(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
4384
+ return new ue(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
4379
4385
  }(t._query, e));
4380
4386
  }, n;
4381
4387
  }($n);
@@ -4397,12 +4403,12 @@ var tr = /** @class */ function(e) {
4397
4403
  var nr = /** @class */ function(e) {
4398
4404
  function n(t, n, r) {
4399
4405
  var i = this;
4400
- return (i = e.call(this) || this).type = t, i.gt = n, i.vt = r, i;
4406
+ return (i = e.call(this) || this).type = t, i.gt = n, i.bt = r, i;
4401
4407
  }
4402
4408
  return t(n, e), n.prototype._apply = function(t) {
4403
4409
  return new sn(t.firestore, t.converter, function(t, e, n) {
4404
- return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
4405
- }(t._query, this.gt, this.vt));
4410
+ return new ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
4411
+ }(t._query, this.gt, this.bt));
4406
4412
  }, n;
4407
4413
  }($n);
4408
4414
 
@@ -4431,12 +4437,12 @@ function ir(t) {
4431
4437
  var or = /** @class */ function(e) {
4432
4438
  function n(t, n, r) {
4433
4439
  var i = this;
4434
- return (i = e.call(this) || this).type = t, i.bt = n, i.Et = r, i;
4440
+ return (i = e.call(this) || this).type = t, i.vt = n, i.Et = r, i;
4435
4441
  }
4436
4442
  return t(n, e), n.prototype._apply = function(t) {
4437
- var e = fr(t, this.type, this.bt, this.Et);
4443
+ var e = fr(t, this.type, this.vt, this.Et);
4438
4444
  return new sn(t.firestore, t.converter, function(t, e) {
4439
- return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
4445
+ return new ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
4440
4446
  }(t._query, e));
4441
4447
  }, n;
4442
4448
  }($n);
@@ -4456,12 +4462,12 @@ function sr() {
4456
4462
  var ur = /** @class */ function(e) {
4457
4463
  function n(t, n, r) {
4458
4464
  var i = this;
4459
- return (i = e.call(this) || this).type = t, i.bt = n, i.Et = r, i;
4465
+ return (i = e.call(this) || this).type = t, i.vt = n, i.Et = r, i;
4460
4466
  }
4461
4467
  return t(n, e), n.prototype._apply = function(t) {
4462
- var e = fr(t, this.type, this.bt, this.Et);
4468
+ var e = fr(t, this.type, this.vt, this.Et);
4463
4469
  return new sn(t.firestore, t.converter, function(t, e) {
4464
- return new se(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
4470
+ return new ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
4465
4471
  }(t._query, e));
4466
4472
  }, n;
4467
4473
  }($n);
@@ -4479,7 +4485,7 @@ function lr() {
4479
4485
 
4480
4486
  /** Helper function to create a bound from a document or fields */ function fr(t, e, n, r) {
4481
4487
  if (n[0] = p(n[0]), n[0] instanceof Qn) return function(t, e, n, r, i) {
4482
- if (!r) throw new x(P, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
4488
+ if (!r) throw new M(P, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
4483
4489
  // Because people expect to continue/end a query at the exact document
4484
4490
  // provided, we need to use the implicit sort order rather than the explicit
4485
4491
  // sort order, because it's guaranteed to contain the document key. That way
@@ -4489,63 +4495,63 @@ function lr() {
4489
4495
  // results.
4490
4496
  for (var o = [], a = 0, s = he(t); a < s.length; a++) {
4491
4497
  var u = s[a];
4492
- if (u.field.isKeyField()) o.push(Rt(e, r.key)); else {
4498
+ if (u.field.isKeyField()) o.push(xt(e, r.key)); else {
4493
4499
  var c = r.data.field(u.field);
4494
- if (Pt(c)) throw new x(V, 'Invalid query. You are trying to start or end a query using a document for which the field "' + u.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
4500
+ if (Pt(c)) throw new M(V, 'Invalid query. You are trying to start or end a query using a document for which the field "' + u.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
4495
4501
  if (null === c) {
4496
4502
  var l = u.field.canonicalString();
4497
- throw new x(V, "Invalid query. You are trying to start or end a query using a document for which the field '" + l + "' (used as the orderBy) does not exist.");
4503
+ throw new M(V, "Invalid query. You are trying to start or end a query using a document for which the field '" + l + "' (used as the orderBy) does not exist.");
4498
4504
  }
4499
4505
  o.push(c);
4500
4506
  }
4501
4507
  }
4502
- return new re(o, i);
4508
+ return new ie(o, i);
4503
4509
  }(t._query, t.firestore._databaseId, e, n[0]._document, r);
4504
- var i = In(t.firestore);
4510
+ var i = An(t.firestore);
4505
4511
  return function(t, e, n, r, i, o) {
4506
4512
  // Use explicit order by's because it has to match the query the user made
4507
4513
  var a = t.explicitOrderBy;
4508
- if (i.length > a.length) throw new x(V, "Too many arguments provided to " + r + "(). The number of arguments must be less than or equal to the number of orderBy() clauses");
4514
+ if (i.length > a.length) throw new M(V, "Too many arguments provided to " + r + "(). The number of arguments must be less than or equal to the number of orderBy() clauses");
4509
4515
  for (var s = [], u = 0; u < i.length; u++) {
4510
4516
  var c = i[u];
4511
4517
  if (a[u].field.isKeyField()) {
4512
- if ("string" != typeof c) throw new x(V, "Invalid query. Expected a string for document ID in " + r + "(), but got a " + typeof c);
4513
- if (!fe(t) && -1 !== c.indexOf("/")) throw new x(V, "Invalid query. When querying a collection and ordering by documentId(), the value passed to " + r + "() must be a plain document ID, but '" + c + "' contains a slash.");
4518
+ if ("string" != typeof c) throw new M(V, "Invalid query. Expected a string for document ID in " + r + "(), but got a " + typeof c);
4519
+ if (!fe(t) && -1 !== c.indexOf("/")) throw new M(V, "Invalid query. When querying a collection and ordering by documentId(), the value passed to " + r + "() must be a plain document ID, but '" + c + "' contains a slash.");
4514
4520
  var l = t.path.child(Z.fromString(c));
4515
- if (!nt.isDocumentKey(l)) throw new x(V, "Invalid query. When querying a collection group and ordering by documentId(), the value passed to " + r + "() must result in a valid document path, but '" + l + "' is not because it contains an odd number of segments.");
4521
+ if (!nt.isDocumentKey(l)) throw new M(V, "Invalid query. When querying a collection group and ordering by documentId(), the value passed to " + r + "() must result in a valid document path, but '" + l + "' is not because it contains an odd number of segments.");
4516
4522
  var f = new nt(l);
4517
- s.push(Rt(e, f));
4523
+ s.push(xt(e, f));
4518
4524
  } else {
4519
4525
  var h = Cn(n, r, c);
4520
4526
  s.push(h);
4521
4527
  }
4522
4528
  }
4523
- return new re(s, o);
4529
+ return new ie(s, o);
4524
4530
  }(t._query, t.firestore._databaseId, i, e, n, r);
4525
4531
  }
4526
4532
 
4527
4533
  function hr(t, e, n) {
4528
4534
  if ("string" == typeof (n = p(n))) {
4529
- if ("" === n) throw new x(V, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
4530
- if (!fe(e) && -1 !== n.indexOf("/")) throw new x(V, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '" + n + "' contains a '/' character.");
4535
+ if ("" === n) throw new M(V, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
4536
+ if (!fe(e) && -1 !== n.indexOf("/")) throw new M(V, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '" + n + "' contains a '/' character.");
4531
4537
  var r = e.path.child(Z.fromString(n));
4532
- if (!nt.isDocumentKey(r)) throw new x(V, "Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '" + r + "' is not because it has an odd number of segments (" + r.length + ").");
4533
- return Rt(t, new nt(r));
4538
+ if (!nt.isDocumentKey(r)) throw new M(V, "Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '" + r + "' is not because it has an odd number of segments (" + r.length + ").");
4539
+ return xt(t, new nt(r));
4534
4540
  }
4535
- if (n instanceof an) return Rt(t, n._key);
4536
- throw new x(V, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + at(n) + ".");
4541
+ if (n instanceof an) return xt(t, n._key);
4542
+ throw new M(V, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + at(n) + ".");
4537
4543
  }
4538
4544
 
4539
4545
  /**
4540
4546
  * Validates that the value passed into a disjunctive filter satisfies all
4541
4547
  * array requirements.
4542
4548
  */ function pr(t, e) {
4543
- if (!Array.isArray(t) || 0 === t.length) throw new x(V, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
4544
- if (t.length > 10) throw new x(V, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
4549
+ if (!Array.isArray(t) || 0 === t.length) throw new M(V, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
4550
+ if (t.length > 10) throw new M(V, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
4545
4551
  }
4546
4552
 
4547
4553
  function dr(t, e, n) {
4548
- if (!n.isEqual(e)) throw new x(V, "Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '" + e.toString() + "' and so you must also use '" + e.toString() + "' as your first argument to orderBy(), but your first orderBy() is on field '" + n.toString() + "' instead.");
4554
+ if (!n.isEqual(e)) throw new M(V, "Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '" + e.toString() + "' and so you must also use '" + e.toString() + "' as your first argument to orderBy(), but your first orderBy() is on field '" + n.toString() + "' instead.");
4549
4555
  }
4550
4556
 
4551
4557
  /**
@@ -4615,7 +4621,7 @@ var yr = /** @class */ function(e) {
4615
4621
  }(/** @class */ function() {
4616
4622
  function t() {}
4617
4623
  return t.prototype.convertValue = function(t, e) {
4618
- switch (void 0 === e && (e = "none"), Ft(t)) {
4624
+ switch (void 0 === e && (e = "none"), Ot(t)) {
4619
4625
  case 0 /* NullValue */ :
4620
4626
  return null;
4621
4627
 
@@ -4724,14 +4730,14 @@ var yr = /** @class */ function(e) {
4724
4730
  * @returns A Promise that will be resolved with the results of the query.
4725
4731
  */ function gr(t) {
4726
4732
  !function(t) {
4727
- if (ue(t) && 0 === t.explicitOrderBy.length) throw new x(j, "limitToLast() queries require specifying at least one orderBy() clause");
4733
+ if ("L" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new M(L, "limitToLast() queries require specifying at least one orderBy() clause");
4728
4734
  }((t = st(t, sn))._query);
4729
4735
  var e = Je(t.firestore), n = new yr(t.firestore);
4730
4736
  return $e(e, t._query).then((function(e) {
4731
4737
  var r = e.map((function(e) {
4732
4738
  return new Kn(t.firestore, n, e.key, e, t.converter);
4733
4739
  }));
4734
- return ue(t._query) &&
4740
+ return "L" /* Last */ === t._query.limitType &&
4735
4741
  // Limit to last queries reverse the orderBy constraint that was
4736
4742
  // specified by the user. As such, we need to reverse the order of the
4737
4743
  // results to return the documents in the expected order.
@@ -4740,13 +4746,13 @@ var yr = /** @class */ function(e) {
4740
4746
  }
4741
4747
 
4742
4748
  function wr(t, e, n) {
4743
- var r = mr((t = st(t, an)).converter, e, n), i = An(In(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
4749
+ var r = mr((t = st(t, an)).converter, e, n), i = In(An(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
4744
4750
  return We(Je(t.firestore), [ i.toMutation(t._key, _e.none()) ]);
4745
4751
  }
4746
4752
 
4747
4753
  function br(t, e, n) {
4748
4754
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
4749
- var o, a = In((t = st(t, an)).firestore);
4755
+ var o, a = An((t = st(t, an)).firestore);
4750
4756
  // For Compat types, we have to "extract" the underlying types before
4751
4757
  // performing validation.
4752
4758
  return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(a, "updateDoc", t._key, e, n, r) : Fn(a, "updateDoc", t._key, e),
@@ -4765,7 +4771,7 @@ function br(t, e, n) {
4765
4771
  * @returns A `Promise` resolved once the document has been successfully
4766
4772
  * deleted from the backend.
4767
4773
  */ function _r(t) {
4768
- return We(Je((t = st(t, an)).firestore), [ new Ie(t._key, _e.none()) ]);
4774
+ return We(Je((t = st(t, an)).firestore), [ new Ae(t._key, _e.none()) ]);
4769
4775
  }
4770
4776
 
4771
4777
  /**
@@ -4783,7 +4789,7 @@ function br(t, e, n) {
4783
4789
  * @returns A `Promise` resolved with a `DocumentReference` pointing to the
4784
4790
  * newly created document after it has been written to the backend.
4785
4791
  */ function Tr(t, e) {
4786
- var n = fn(t = st(t, un)), r = mr(t.converter, e), i = An(In(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
4792
+ var n = fn(t = st(t, un)), r = mr(t.converter, e), i = In(An(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
4787
4793
  return We(Je(t.firestore), [ i.toMutation(n._key, _e.exists(!1)) ]).then((function() {
4788
4794
  return n;
4789
4795
  }));
@@ -4830,7 +4836,7 @@ function br(t, e, n) {
4830
4836
  * @param elements - The elements to union into the array.
4831
4837
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
4832
4838
  * `updateDoc()`.
4833
- */ function Ir() {
4839
+ */ function Ar() {
4834
4840
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4835
4841
  // NOTE: We don't actually parse the data until it's used in set() or
4836
4842
  // update() since we'd need the Firestore instance to do this.
@@ -4847,7 +4853,7 @@ function br(t, e, n) {
4847
4853
  * @param elements - The elements to remove from the array.
4848
4854
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
4849
4855
  * `updateDoc()`
4850
- */ function Ar() {
4856
+ */ function Ir() {
4851
4857
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4852
4858
  // NOTE: We don't actually parse the data until it's used in set() or
4853
4859
  // update() since we'd need the Firestore instance to do this.
@@ -4903,11 +4909,11 @@ function br(t, e, n) {
4903
4909
  /** @hideconstructor */
4904
4910
  function t(t, e) {
4905
4911
  this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
4906
- this._dataReader = In(t);
4912
+ this._dataReader = An(t);
4907
4913
  }
4908
4914
  return t.prototype.set = function(t, e, n) {
4909
4915
  this._verifyNotCommitted();
4910
- var r = Dr(t, this._firestore), i = mr(r.converter, e, n), o = An(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
4916
+ var r = Dr(t, this._firestore), i = mr(r.converter, e, n), o = In(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
4911
4917
  return this._mutations.push(o.toMutation(r._key, _e.none())), this;
4912
4918
  }, t.prototype.update = function(t, e, n) {
4913
4919
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
@@ -4927,7 +4933,7 @@ function br(t, e, n) {
4927
4933
  t.prototype.delete = function(t) {
4928
4934
  this._verifyNotCommitted();
4929
4935
  var e = Dr(t, this._firestore);
4930
- return this._mutations = this._mutations.concat(new Ie(e._key, _e.none())), this;
4936
+ return this._mutations = this._mutations.concat(new Ae(e._key, _e.none())), this;
4931
4937
  },
4932
4938
  /**
4933
4939
  * Commits all of the writes in this write batch as a single atomic unit.
@@ -4944,12 +4950,12 @@ function br(t, e, n) {
4944
4950
  t.prototype.commit = function() {
4945
4951
  return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
4946
4952
  }, t.prototype._verifyNotCommitted = function() {
4947
- if (this._committed) throw new x(O, "A write batch can no longer be used after commit() has been called.");
4953
+ if (this._committed) throw new M(O, "A write batch can no longer be used after commit() has been called.");
4948
4954
  }, t;
4949
4955
  }();
4950
4956
 
4951
4957
  function Dr(t, e) {
4952
- if ((t = p(t)).firestore !== e) throw new x(V, "Provided document reference is from a different Firestore instance.");
4958
+ if ((t = p(t)).firestore !== e) throw new M(V, "Provided document reference is from a different Firestore instance.");
4953
4959
  return t;
4954
4960
  }
4955
4961
 
@@ -5015,7 +5021,7 @@ function Dr(t, e) {
5015
5021
  return n(this, (function(n) {
5016
5022
  switch (n.label) {
5017
5023
  case 0:
5018
- if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new x(V, "Firestore transactions require all reads to be executed before all writes.");
5024
+ if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new M(V, "Firestore transactions require all reads to be executed before all writes.");
5019
5025
  return [ 4 /*yield*/ , Ye(this.datastore, t) ];
5020
5026
 
5021
5027
  case 1:
@@ -5035,7 +5041,7 @@ function Dr(t, e) {
5035
5041
  }
5036
5042
  this.writtenDocs.add(t.toString());
5037
5043
  }, t.prototype.delete = function(t) {
5038
- this.write(new Ie(t, this.precondition(t))), this.writtenDocs.add(t.toString());
5044
+ this.write(new Ae(t, this.precondition(t))), this.writtenDocs.add(t.toString());
5039
5045
  }, t.prototype.commit = function() {
5040
5046
  return e(this, void 0, void 0, (function() {
5041
5047
  var t, e = this;
@@ -5052,7 +5058,7 @@ function Dr(t, e) {
5052
5058
  // a `verify` operation.
5053
5059
  t.forEach((function(t, n) {
5054
5060
  var r = nt.fromPath(n);
5055
- e.mutations.push(new Ae(r, e.precondition(r)));
5061
+ e.mutations.push(new Ie(r, e.precondition(r)));
5056
5062
  })), [ 4 /*yield*/ , We(this.datastore, this.mutations) ];
5057
5063
 
5058
5064
  case 1:
@@ -5072,7 +5078,7 @@ function Dr(t, e) {
5072
5078
  if (n) {
5073
5079
  if (!e.isEqual(n))
5074
5080
  // This transaction will fail no matter what.
5075
- throw new x(C, "Document version changed between two reads.");
5081
+ throw new M(C, "Document version changed between two reads.");
5076
5082
  } else this.readVersions.set(t.key.toString(), e);
5077
5083
  },
5078
5084
  /**
@@ -5101,7 +5107,7 @@ function Dr(t, e) {
5101
5107
  // express that to the backend, we have to validate locally.
5102
5108
  // Note: this can change once we can send separate verify writes in the
5103
5109
  // transaction.
5104
- throw new x(V, "Can't update a document that doesn't exist.");
5110
+ throw new M(V, "Can't update a document that doesn't exist.");
5105
5111
  // Document exists, base precondition on document update time.
5106
5112
  return _e.updateTime(e);
5107
5113
  }
@@ -5111,17 +5117,19 @@ function Dr(t, e) {
5111
5117
  }, t.prototype.write = function(t) {
5112
5118
  this.ensureCommitNotCalled(), this.mutations.push(t);
5113
5119
  }, t.prototype.ensureCommitNotCalled = function() {}, t;
5114
- }(), qr = /** @class */ function() {
5115
- function t(t, e, n, r) {
5116
- this.asyncQueue = t, this.datastore = e, this.updateFunction = n, this.deferred = r,
5117
- this.Tt = 5, this.It = new Ke(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
5120
+ }(), qr = {
5121
+ maxAttempts: 5
5122
+ }, Fr = /** @class */ function() {
5123
+ function t(t, e, n, r, i) {
5124
+ this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = r,
5125
+ this.deferred = i, this.Tt = n.maxAttempts, this.At = new Ke(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
5118
5126
  /** Runs the transaction and sets the result on deferred. */;
5119
5127
  }
5120
5128
  return t.prototype.run = function() {
5121
- this.Tt -= 1, this.At();
5122
- }, t.prototype.At = function() {
5129
+ this.Tt -= 1, this.It();
5130
+ }, t.prototype.It = function() {
5123
5131
  var t = this;
5124
- this.It.W((function() {
5132
+ this.At.W((function() {
5125
5133
  return e(t, void 0, void 0, (function() {
5126
5134
  var t, e, r = this;
5127
5135
  return n(this, (function(n) {
@@ -5151,7 +5159,7 @@ function Dr(t, e) {
5151
5159
  }, t.prototype.Pt = function(t) {
5152
5160
  var e = this;
5153
5161
  this.Tt > 0 && this.Vt(t) ? (this.Tt -= 1, this.asyncQueue.enqueueAndForget((function() {
5154
- return e.At(), Promise.resolve();
5162
+ return e.It(), Promise.resolve();
5155
5163
  }))) : this.deferred.reject(t);
5156
5164
  }, t.prototype.Vt = function(t) {
5157
5165
  if ("FirebaseError" === t.name) {
@@ -5170,12 +5178,12 @@ function Dr(t, e) {
5170
5178
  default:
5171
5179
  return S();
5172
5180
 
5173
- case A:
5181
+ case I:
5174
5182
  case k:
5175
5183
  case D:
5176
5184
  case F:
5177
5185
  case R:
5178
- case M:
5186
+ case x:
5179
5187
  // Unauthenticated means something went wrong with our token and we need
5180
5188
  // to retry with new credentials which will happen automatically.
5181
5189
  case q:
@@ -5190,8 +5198,8 @@ function Dr(t, e) {
5190
5198
  // the context and should handled individually by the calling code.
5191
5199
  // See https://cloud.google.com/apis/design/errors.
5192
5200
  case C:
5193
- case L:
5194
5201
  case j:
5202
+ case L:
5195
5203
  case "data-loss":
5196
5204
  return !0;
5197
5205
  }
@@ -5203,7 +5211,7 @@ function Dr(t, e) {
5203
5211
 
5204
5212
  /**
5205
5213
  * @license
5206
- * Copyright 2019 Google LLC
5214
+ * Copyright 2022 Google LLC
5207
5215
  *
5208
5216
  * Licensed under the Apache License, Version 2.0 (the "License");
5209
5217
  * you may not use this file except in compliance with the License.
@@ -5217,10 +5225,6 @@ function Dr(t, e) {
5217
5225
  * See the License for the specific language governing permissions and
5218
5226
  * limitations under the License.
5219
5227
  */
5220
- /**
5221
- * TransactionRunner encapsulates the logic needed to run and retry transactions
5222
- * with backoff.
5223
- */
5224
5228
  /**
5225
5229
  * @license
5226
5230
  * Copyright 2020 Google LLC
@@ -5237,7 +5241,7 @@ function Dr(t, e) {
5237
5241
  * See the License for the specific language governing permissions and
5238
5242
  * limitations under the License.
5239
5243
  */
5240
- /** The Platform's 'document' implementation or null if not available. */ function Fr() {
5244
+ /** The Platform's 'document' implementation or null if not available. */ function Or() {
5241
5245
  // `document` is not always available, e.g. in ReactNative and WebWorkers.
5242
5246
  // eslint-disable-next-line no-restricted-globals
5243
5247
  return "undefined" != typeof document ? document : null;
@@ -5269,7 +5273,7 @@ function Dr(t, e) {
5269
5273
  * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type
5270
5274
  * in newer versions of TypeScript defines `finally`, which is not available in
5271
5275
  * IE.
5272
- */ var Or = /** @class */ function() {
5276
+ */ var Cr = /** @class */ function() {
5273
5277
  function t(t, e, n, r, i) {
5274
5278
  this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = i,
5275
5279
  this.deferred = new U, this.then = this.deferred.promise.then.bind(this.deferred.promise),
@@ -5321,7 +5325,7 @@ function Dr(t, e) {
5321
5325
  * guarantee that the operation will not be run.
5322
5326
  */
5323
5327
  t.prototype.cancel = function(t) {
5324
- null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new x(A, "Operation cancelled" + (t ? ": " + t : ""))));
5328
+ null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new M(I, "Operation cancelled" + (t ? ": " + t : ""))));
5325
5329
  }, t.prototype.handleDelayElapsed = function() {
5326
5330
  var t = this;
5327
5331
  this.asyncQueue.enqueueAndForget((function() {
@@ -5333,7 +5337,7 @@ function Dr(t, e) {
5333
5337
  null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle),
5334
5338
  this.timerHandle = null);
5335
5339
  }, t;
5336
- }(), Cr = /** @class */ function() {
5340
+ }(), jr = /** @class */ function() {
5337
5341
  function t() {
5338
5342
  var t = this;
5339
5343
  // The last promise in the queue.
@@ -5348,24 +5352,24 @@ function Dr(t, e) {
5348
5352
  // automatically removed after they are run or canceled.
5349
5353
  this.St = [],
5350
5354
  // visible for testing
5351
- this.Ft = null,
5355
+ this.xt = null,
5352
5356
  // Flag set while there's an outstanding AsyncQueue operation, used for
5353
5357
  // assertion sanity-checks.
5354
- this.xt = !1,
5358
+ this.Ft = !1,
5355
5359
  // Enabled during shutdown on Safari to prevent future access to IndexedDB.
5356
5360
  this.qt = !1,
5357
5361
  // List of TimerIds to fast-forward delays for.
5358
5362
  this.Ot = [],
5359
5363
  // Backoff timer used to schedule retries for retryable operations
5360
- this.It = new Ke(this, "async_queue_retry" /* AsyncQueueRetry */),
5364
+ this.At = new Ke(this, "async_queue_retry" /* AsyncQueueRetry */),
5361
5365
  // Visibility handler that triggers an immediate retry of all retryable
5362
5366
  // operations. Meant to speed up recovery when we regain file system access
5363
5367
  // after page comes into foreground.
5364
5368
  this.Ct = function() {
5365
- var e = Fr();
5366
- e && w("AsyncQueue", "Visibility state changed to " + e.visibilityState), t.It.H();
5369
+ var e = Or();
5370
+ e && w("AsyncQueue", "Visibility state changed to " + e.visibilityState), t.At.H();
5367
5371
  };
5368
- var e = Fr();
5372
+ var e = Or();
5369
5373
  e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.Ct);
5370
5374
  }
5371
5375
  return Object.defineProperty(t.prototype, "isShuttingDown", {
@@ -5389,7 +5393,7 @@ function Dr(t, e) {
5389
5393
  }, t.prototype.enterRestrictedMode = function(t) {
5390
5394
  if (!this.$t) {
5391
5395
  this.$t = !0, this.qt = t || !1;
5392
- var e = Fr();
5396
+ var e = Or();
5393
5397
  e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Ct);
5394
5398
  }
5395
5399
  }, t.prototype.enqueue = function(t) {
@@ -5429,7 +5433,7 @@ function Dr(t, e) {
5429
5433
  return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , this.Nt[0]() ];
5430
5434
 
5431
5435
  case 2:
5432
- return n.sent(), this.Nt.shift(), this.It.reset(), [ 3 /*break*/ , 4 ];
5436
+ return n.sent(), this.Nt.shift(), this.At.reset(), [ 3 /*break*/ , 4 ];
5433
5437
 
5434
5438
  case 3:
5435
5439
  if (t = n.sent(), "IndexedDbTransactionError" !== t.name) throw t;
@@ -5449,7 +5453,7 @@ function Dr(t, e) {
5449
5453
  // Since `backoffAndRun()` cancels an existing backoff and schedules a
5450
5454
  // new backoff on every call, there is only ever a single additional
5451
5455
  // operation in the queue.
5452
- this.It.W((function() {
5456
+ this.At.W((function() {
5453
5457
  return e.kt();
5454
5458
  })), n.label = 5;
5455
5459
 
@@ -5460,8 +5464,8 @@ function Dr(t, e) {
5460
5464
  }));
5461
5465
  }, t.prototype.Ut = function(t) {
5462
5466
  var e = this, n = this.Dt.then((function() {
5463
- return e.xt = !0, t().catch((function(t) {
5464
- e.Ft = t, e.xt = !1;
5467
+ return e.Ft = !0, t().catch((function(t) {
5468
+ e.xt = t, e.Ft = !1;
5465
5469
  var n =
5466
5470
  /**
5467
5471
  * Chrome includes Error.message in Error.stack. Other browsers do not.
@@ -5478,7 +5482,7 @@ function Dr(t, e) {
5478
5482
  // and return the rejected Promise.
5479
5483
  throw b("INTERNAL UNHANDLED ERROR: ", n), t;
5480
5484
  })).then((function(t) {
5481
- return e.xt = !1, t;
5485
+ return e.Ft = !1, t;
5482
5486
  }));
5483
5487
  }));
5484
5488
  return this.Dt = n, n;
@@ -5487,12 +5491,12 @@ function Dr(t, e) {
5487
5491
  this.Lt(),
5488
5492
  // Fast-forward delays for timerIds that have been overriden.
5489
5493
  this.Ot.indexOf(t) > -1 && (e = 0);
5490
- var i = Or.createAndSchedule(this, t, e, n, (function(t) {
5494
+ var i = Cr.createAndSchedule(this, t, e, n, (function(t) {
5491
5495
  return r.jt(t);
5492
5496
  }));
5493
5497
  return this.St.push(i), i;
5494
5498
  }, t.prototype.Lt = function() {
5495
- this.Ft && S();
5499
+ this.xt && S();
5496
5500
  }, t.prototype.verifyOperationInProgress = function() {},
5497
5501
  /**
5498
5502
  * Waits until all currently queued tasks are finished executing. Delayed
@@ -5565,7 +5569,7 @@ function Dr(t, e) {
5565
5569
  }(), Lr = /** @class */ function() {
5566
5570
  /** @hideconstructor */
5567
5571
  function t(t, e) {
5568
- this._firestore = t, this._transaction = e, this._dataReader = In(t)
5572
+ this._firestore = t, this._transaction = e, this._dataReader = An(t)
5569
5573
  /**
5570
5574
  * Reads the document referenced by the provided {@link DocumentReference}.
5571
5575
  *
@@ -5583,7 +5587,7 @@ function Dr(t, e) {
5583
5587
  throw S();
5584
5588
  }));
5585
5589
  }, t.prototype.set = function(t, e, n) {
5586
- var r = Dr(t, this._firestore), i = mr(r.converter, e, n), o = An(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
5590
+ var r = Dr(t, this._firestore), i = mr(r.converter, e, n), o = In(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
5587
5591
  return this._transaction.set(r._key, o), this;
5588
5592
  }, t.prototype.update = function(t, e, n) {
5589
5593
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
@@ -5638,11 +5642,15 @@ function Dr(t, e) {
5638
5642
  * `updateFunction `is returned here. Otherwise, if the transaction failed, a
5639
5643
  * rejected promise with the corresponding failure error is returned.
5640
5644
  */
5641
- function jr(t, e) {
5642
- var n = Je(t = st(t, tn)), r = new U;
5643
- return new qr(new Cr, n, (function(n) {
5645
+ function Rr(t, e, n) {
5646
+ var r = Je(t = st(t, tn)), i = Object.assign(Object.assign({}, qr), n);
5647
+ !function(t) {
5648
+ if (t.maxAttempts < 1) throw new M(V, "Max attempts must be at least 1");
5649
+ }(i);
5650
+ var o = new U;
5651
+ return new Fr(new jr, r, i, (function(n) {
5644
5652
  return e(new Lr(t, n));
5645
- }), r).run(), r.promise
5653
+ }), o).run(), o.promise
5646
5654
  /**
5647
5655
  * Firestore Lite
5648
5656
  *
@@ -5658,7 +5666,7 @@ y = i + "_lite", o(new c("firestore/lite", (function(t, e) {
5658
5666
  return n && i._setSettings(n), i;
5659
5667
  }), "PUBLIC")),
5660
5668
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
5661
- a("firestore-lite", "3.4.8", ""), a("firestore-lite", "3.4.8", "esm5");
5669
+ a("firestore-lite", "3.4.9", ""), a("firestore-lite", "3.4.9", "esm5");
5662
5670
 
5663
- export { yn as Bytes, un as CollectionReference, an as DocumentReference, Qn as DocumentSnapshot, dn as FieldPath, vn as FieldValue, tn as Firestore, x as FirestoreError, gn as GeoPoint, sn as Query, $n as QueryConstraint, Kn as QueryDocumentSnapshot, Hn as QuerySnapshot, bt as Timestamp, Lr as Transaction, Vr as WriteBatch, Tr as addDoc, Ar as arrayRemove, Ir as arrayUnion, cn as collection, ln as collectionGroup, rn as connectFirestoreEmulator, _r as deleteDoc, Sr as deleteField, fn as doc, mn as documentId, lr as endAt, cr as endBefore, vr as getDoc, gr as getDocs, nn as getFirestore, kr as increment, en as initializeFirestore, rr as limit, ir as limitToLast, er as orderBy, Xn as query, pn as queryEqual, hn as refEqual, jr as runTransaction, Er as serverTimestamp, wr as setDoc, g as setLogLevel, Wn as snapshotEqual, sr as startAfter, ar as startAt, on as terminate, br as updateDoc, Zn as where, Pr as writeBatch };
5671
+ export { yn as Bytes, un as CollectionReference, an as DocumentReference, Qn as DocumentSnapshot, dn as FieldPath, vn as FieldValue, tn as Firestore, M as FirestoreError, gn as GeoPoint, sn as Query, $n as QueryConstraint, Kn as QueryDocumentSnapshot, Hn as QuerySnapshot, bt as Timestamp, Lr as Transaction, Vr as WriteBatch, Tr as addDoc, Ir as arrayRemove, Ar as arrayUnion, cn as collection, ln as collectionGroup, rn as connectFirestoreEmulator, _r as deleteDoc, Sr as deleteField, fn as doc, mn as documentId, lr as endAt, cr as endBefore, vr as getDoc, gr as getDocs, nn as getFirestore, kr as increment, en as initializeFirestore, rr as limit, ir as limitToLast, er as orderBy, Xn as query, pn as queryEqual, hn as refEqual, Rr as runTransaction, Er as serverTimestamp, wr as setDoc, g as setLogLevel, Wn as snapshotEqual, sr as startAfter, ar as startAt, on as terminate, br as updateDoc, Zn as where, Pr as writeBatch };
5664
5672
  //# sourceMappingURL=index.browser.esm5.js.map