@firebase/firestore 3.4.5 → 3.4.6-canary.3198d58dc

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 (167) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/firestore/src/core/bundle.d.ts +2 -2
  3. package/dist/firestore/src/core/bundle_impl.d.ts +2 -0
  4. package/dist/firestore/src/core/query.d.ts +7 -0
  5. package/dist/firestore/src/core/snapshot_version.d.ts +1 -0
  6. package/dist/firestore/src/core/sync_engine_impl.d.ts +1 -1
  7. package/dist/firestore/src/index/index_entry.d.ts +6 -0
  8. package/dist/firestore/src/local/document_overlay_cache.d.ts +4 -5
  9. package/dist/firestore/src/local/index_manager.d.ts +2 -2
  10. package/dist/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
  11. package/dist/firestore/src/local/indexeddb_index_manager.d.ts +48 -1
  12. package/dist/firestore/src/local/indexeddb_mutation_batch_impl.d.ts +2 -1
  13. package/dist/firestore/src/local/indexeddb_remote_document_cache.d.ts +0 -17
  14. package/dist/firestore/src/local/indexeddb_schema.d.ts +47 -563
  15. package/dist/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  16. package/dist/firestore/src/local/indexeddb_schema_legacy.d.ts +29 -0
  17. package/dist/firestore/src/local/indexeddb_sentinels.d.ts +243 -0
  18. package/dist/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
  19. package/dist/firestore/src/local/local_documents_view.d.ts +3 -4
  20. package/dist/firestore/src/local/local_serializer.d.ts +3 -1
  21. package/dist/firestore/src/local/local_store_impl.d.ts +1 -7
  22. package/dist/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
  23. package/dist/firestore/src/local/memory_index_manager.d.ts +1 -1
  24. package/dist/firestore/src/local/remote_document_cache.d.ts +13 -4
  25. package/dist/firestore/src/local/shared_client_state.d.ts +6 -3
  26. package/dist/firestore/src/local/shared_client_state_schema.d.ts +1 -1
  27. package/dist/firestore/src/local/shared_client_state_syncer.d.ts +1 -1
  28. package/dist/firestore/src/local/simple_db.d.ts +11 -0
  29. package/dist/firestore/src/model/collections.d.ts +7 -0
  30. package/dist/firestore/src/model/field_index.d.ts +10 -1
  31. package/dist/firestore/src/model/type_order.d.ts +2 -1
  32. package/dist/firestore/src/platform/node/base64.d.ts +1 -0
  33. package/dist/firestore/src/util/obj_map.d.ts +3 -0
  34. package/dist/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
  35. package/dist/firestore/test/unit/local/test_index_manager.d.ts +1 -1
  36. package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +3 -1
  37. package/dist/index.esm2017.js +4533 -4502
  38. package/dist/index.esm2017.js.map +1 -1
  39. package/dist/index.esm5.js +4455 -4308
  40. package/dist/index.esm5.js.map +1 -1
  41. package/dist/index.node.cjs.js +1606 -1180
  42. package/dist/index.node.cjs.js.map +1 -1
  43. package/dist/index.node.mjs +1606 -1180
  44. package/dist/index.node.mjs.map +1 -1
  45. package/dist/index.rn.js +4425 -4394
  46. package/dist/index.rn.js.map +1 -1
  47. package/dist/internal.d.ts +31 -10
  48. package/dist/lite/firestore/src/core/bundle.d.ts +2 -2
  49. package/dist/lite/firestore/src/core/bundle_impl.d.ts +2 -0
  50. package/dist/lite/firestore/src/core/query.d.ts +7 -0
  51. package/dist/lite/firestore/src/core/snapshot_version.d.ts +1 -0
  52. package/dist/lite/firestore/src/core/sync_engine_impl.d.ts +1 -1
  53. package/dist/lite/firestore/src/index/index_entry.d.ts +6 -0
  54. package/dist/lite/firestore/src/local/document_overlay_cache.d.ts +4 -5
  55. package/dist/lite/firestore/src/local/index_manager.d.ts +2 -2
  56. package/dist/lite/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
  57. package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +48 -1
  58. package/dist/lite/firestore/src/local/indexeddb_mutation_batch_impl.d.ts +2 -1
  59. package/dist/lite/firestore/src/local/indexeddb_remote_document_cache.d.ts +0 -17
  60. package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +47 -563
  61. package/dist/lite/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  62. package/dist/lite/firestore/src/local/indexeddb_schema_legacy.d.ts +29 -0
  63. package/dist/lite/firestore/src/local/indexeddb_sentinels.d.ts +243 -0
  64. package/dist/lite/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
  65. package/dist/lite/firestore/src/local/local_documents_view.d.ts +3 -4
  66. package/dist/lite/firestore/src/local/local_serializer.d.ts +3 -1
  67. package/dist/lite/firestore/src/local/local_store_impl.d.ts +1 -7
  68. package/dist/lite/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
  69. package/dist/lite/firestore/src/local/memory_index_manager.d.ts +1 -1
  70. package/dist/lite/firestore/src/local/remote_document_cache.d.ts +13 -4
  71. package/dist/lite/firestore/src/local/shared_client_state.d.ts +6 -3
  72. package/dist/lite/firestore/src/local/shared_client_state_schema.d.ts +1 -1
  73. package/dist/lite/firestore/src/local/shared_client_state_syncer.d.ts +1 -1
  74. package/dist/lite/firestore/src/local/simple_db.d.ts +11 -0
  75. package/dist/lite/firestore/src/model/collections.d.ts +7 -0
  76. package/dist/lite/firestore/src/model/field_index.d.ts +10 -1
  77. package/dist/lite/firestore/src/model/type_order.d.ts +2 -1
  78. package/dist/lite/firestore/src/platform/node/base64.d.ts +1 -0
  79. package/dist/lite/firestore/src/util/obj_map.d.ts +3 -0
  80. package/dist/lite/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
  81. package/dist/lite/firestore/test/unit/local/test_index_manager.d.ts +1 -1
  82. package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +3 -1
  83. package/dist/lite/index.browser.esm2017.js +37 -24
  84. package/dist/lite/index.browser.esm2017.js.map +1 -1
  85. package/dist/lite/index.browser.esm5.js +104 -113
  86. package/dist/lite/index.browser.esm5.js.map +1 -1
  87. package/dist/lite/index.node.cjs.js +24 -9
  88. package/dist/lite/index.node.cjs.js.map +1 -1
  89. package/dist/lite/index.node.mjs +24 -9
  90. package/dist/lite/index.node.mjs.map +1 -1
  91. package/dist/lite/index.rn.esm2017.js +37 -24
  92. package/dist/lite/index.rn.esm2017.js.map +1 -1
  93. package/dist/lite/internal.d.ts +1 -0
  94. package/dist/lite/packages/firestore/src/core/bundle.d.ts +2 -2
  95. package/dist/lite/packages/firestore/src/core/bundle_impl.d.ts +2 -0
  96. package/dist/lite/packages/firestore/src/core/query.d.ts +7 -0
  97. package/dist/lite/packages/firestore/src/core/snapshot_version.d.ts +1 -0
  98. package/dist/lite/packages/firestore/src/core/sync_engine_impl.d.ts +1 -1
  99. package/dist/lite/packages/firestore/src/index/index_entry.d.ts +6 -0
  100. package/dist/lite/packages/firestore/src/local/document_overlay_cache.d.ts +4 -5
  101. package/dist/lite/packages/firestore/src/local/index_manager.d.ts +2 -2
  102. package/dist/lite/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
  103. package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +48 -1
  104. package/dist/lite/packages/firestore/src/local/indexeddb_mutation_batch_impl.d.ts +2 -1
  105. package/dist/lite/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +0 -17
  106. package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +47 -563
  107. package/dist/lite/packages/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  108. package/dist/lite/packages/firestore/src/local/indexeddb_schema_legacy.d.ts +29 -0
  109. package/dist/lite/packages/firestore/src/local/indexeddb_sentinels.d.ts +243 -0
  110. package/dist/lite/packages/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
  111. package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +3 -4
  112. package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +3 -1
  113. package/dist/lite/packages/firestore/src/local/local_store_impl.d.ts +1 -7
  114. package/dist/lite/packages/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
  115. package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +1 -1
  116. package/dist/lite/packages/firestore/src/local/remote_document_cache.d.ts +13 -4
  117. package/dist/lite/packages/firestore/src/local/shared_client_state.d.ts +6 -3
  118. package/dist/lite/packages/firestore/src/local/shared_client_state_schema.d.ts +1 -1
  119. package/dist/lite/packages/firestore/src/local/shared_client_state_syncer.d.ts +1 -1
  120. package/dist/lite/packages/firestore/src/local/simple_db.d.ts +11 -0
  121. package/dist/lite/packages/firestore/src/model/collections.d.ts +7 -0
  122. package/dist/lite/packages/firestore/src/model/field_index.d.ts +10 -1
  123. package/dist/lite/packages/firestore/src/model/type_order.d.ts +2 -1
  124. package/dist/lite/packages/firestore/src/platform/node/base64.d.ts +1 -0
  125. package/dist/lite/packages/firestore/src/util/obj_map.d.ts +3 -0
  126. package/dist/lite/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
  127. package/dist/lite/packages/firestore/test/unit/local/test_index_manager.d.ts +1 -1
  128. package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +3 -1
  129. package/dist/lite/private.d.ts +1 -0
  130. package/dist/packages/firestore/dist/index.esm2017.d.ts +197 -197
  131. package/dist/packages/firestore/src/core/bundle.d.ts +2 -2
  132. package/dist/packages/firestore/src/core/bundle_impl.d.ts +2 -0
  133. package/dist/packages/firestore/src/core/query.d.ts +7 -0
  134. package/dist/packages/firestore/src/core/snapshot_version.d.ts +1 -0
  135. package/dist/packages/firestore/src/core/sync_engine_impl.d.ts +1 -1
  136. package/dist/packages/firestore/src/index/index_entry.d.ts +6 -0
  137. package/dist/packages/firestore/src/local/document_overlay_cache.d.ts +4 -5
  138. package/dist/packages/firestore/src/local/index_manager.d.ts +2 -2
  139. package/dist/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
  140. package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +48 -1
  141. package/dist/packages/firestore/src/local/indexeddb_mutation_batch_impl.d.ts +2 -1
  142. package/dist/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +0 -17
  143. package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +47 -563
  144. package/dist/packages/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  145. package/dist/packages/firestore/src/local/indexeddb_schema_legacy.d.ts +29 -0
  146. package/dist/packages/firestore/src/local/indexeddb_sentinels.d.ts +243 -0
  147. package/dist/packages/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
  148. package/dist/packages/firestore/src/local/local_documents_view.d.ts +3 -4
  149. package/dist/packages/firestore/src/local/local_serializer.d.ts +3 -1
  150. package/dist/packages/firestore/src/local/local_store_impl.d.ts +1 -7
  151. package/dist/packages/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
  152. package/dist/packages/firestore/src/local/memory_index_manager.d.ts +1 -1
  153. package/dist/packages/firestore/src/local/remote_document_cache.d.ts +13 -4
  154. package/dist/packages/firestore/src/local/shared_client_state.d.ts +6 -3
  155. package/dist/packages/firestore/src/local/shared_client_state_schema.d.ts +1 -1
  156. package/dist/packages/firestore/src/local/shared_client_state_syncer.d.ts +1 -1
  157. package/dist/packages/firestore/src/local/simple_db.d.ts +11 -0
  158. package/dist/packages/firestore/src/model/collections.d.ts +7 -0
  159. package/dist/packages/firestore/src/model/field_index.d.ts +10 -1
  160. package/dist/packages/firestore/src/model/type_order.d.ts +2 -1
  161. package/dist/packages/firestore/src/platform/node/base64.d.ts +1 -0
  162. package/dist/packages/firestore/src/util/obj_map.d.ts +3 -0
  163. package/dist/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
  164. package/dist/packages/firestore/test/unit/local/test_index_manager.d.ts +1 -1
  165. package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +3 -1
  166. package/dist/private.d.ts +31 -10
  167. package/package.json +9 -9
@@ -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.7", v = new l("@firebase/firestore");
70
+ var y = "9.6.9-canary.3198d58dc", v = new l("@firebase/firestore");
71
71
 
72
72
  /**
73
73
  * @license
@@ -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", U = /** @class */ function(e) {
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) {
229
229
  /** @hideconstructor */
230
230
  function n(
231
231
  /**
@@ -246,7 +246,7 @@ e) {
246
246
  }, r;
247
247
  }
248
248
  return t(n, e), n;
249
- }(h), x = function() {
249
+ }(h), U = function() {
250
250
  var t = this;
251
251
  this.promise = new Promise((function(e, n) {
252
252
  t.resolve = e, t.reject = n;
@@ -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 U(V, "Invalid segment (" + a + "). Paths must not contain // in them.");
449
+ if (a.indexOf("//") >= 0) throw new x(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 U(V, "Invalid field path (" + t + "). Paths must not be empty, begin with '.', end with '.', or contain '..'");
504
+ if (0 === r.length) throw new x(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 U(V, "Path has trailing escape character: " + t);
509
+ if (i + 1 === t.length) throw new x(V, "Path has trailing escape character: " + t);
510
510
  var u = t[i + 1];
511
- if ("\\" !== u && "." !== u && "`" !== u) throw new U(V, "Path has invalid escape sequence: " + t);
511
+ if ("\\" !== u && "." !== u && "`" !== u) throw new x(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 U(V, "Unterminated ` in path: " + t);
515
+ if (o(), a) throw new x(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 U(V, "Function " + t + "() cannot be called with an empty " + e + ".");
583
+ if (!n) throw new x(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 U(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 x(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 U(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 x(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 U(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 x(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 U(V, "Expected type '" + e.name + "', but it was: " + n);
635
+ throw new x(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 U(V, "Function " + t + "() requires a positive number, but it was: " + e + ".");
641
+ if (e <= 0) throw new x(V, "Function " + t + "() requires a positive number, but it was: " + e + ".");
642
642
  }
643
643
 
644
644
  /**
@@ -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 U(dt(a.status), "Request failed with error: " + a.statusText);
870
+ throw a = n.sent(), new x(dt(a.status), "Request failed with error: " + a.statusText);
871
871
 
872
872
  case 4:
873
- if (!e.ok) throw new U(dt(e.status), "Request failed with error: " + e.statusText);
873
+ if (!e.ok) throw new x(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 U(V, "Timestamp nanoseconds out of range: " + e);
1062
- if (e >= 1e9) throw new U(V, "Timestamp nanoseconds out of range: " + e);
1063
- if (t < -62135596800) throw new U(V, "Timestamp seconds out of range: " + t);
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);
1064
1064
  // This will break in the year 10,000.
1065
- if (t >= 253402300800) throw new U(V, "Timestamp seconds out of range: " + t);
1065
+ if (t >= 253402300800) throw new x(V, "Timestamp seconds out of range: " + t);
1066
1066
  }
1067
1067
  /**
1068
1068
  * Creates a new timestamp with the current date, with millisecond precision.
@@ -1159,6 +1159,8 @@ function gt(t, e) {
1159
1159
  return new t(e);
1160
1160
  }, t.min = function() {
1161
1161
  return new t(new bt(0, 0));
1162
+ }, t.max = function() {
1163
+ return new t(new bt(253402300799, 999999999));
1162
1164
  }, t.prototype.compareTo = function(t) {
1163
1165
  return this.timestamp._compareTo(t.timestamp);
1164
1166
  }, t.prototype.isEqual = function(t) {
@@ -1275,6 +1277,8 @@ function St(t, e) {
1275
1277
  return t.fromBase64String = function(e) {
1276
1278
  return new t(atob(e));
1277
1279
  }, t.fromUint8Array = function(e) {
1280
+ // TODO(indexing); Remove the copy of the byte string here as this method
1281
+ // is frequently called during indexing.
1278
1282
  var n =
1279
1283
  /**
1280
1284
  * Helper function to convert an Uint8array to a binary string.
@@ -1473,7 +1477,11 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1473
1477
  * limitations under the License.
1474
1478
  */
1475
1479
  /** Extracts the backend's type order for the provided value. */ function Ft(t) {
1476
- 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 */ : 10 /* ObjectValue */ : S();
1480
+ 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
+ /** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */
1482
+ function(t) {
1483
+ return "__max__" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;
1484
+ }(t) ? 9 /* ArrayValue */ : 10 /* ObjectValue */ : S();
1477
1485
  }
1478
1486
 
1479
1487
  /** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {
@@ -1482,6 +1490,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1482
1490
  if (n !== Ft(e)) return !1;
1483
1491
  switch (n) {
1484
1492
  case 0 /* NullValue */ :
1493
+ case 9007199254740991 /* MaxValue */ :
1485
1494
  return !0;
1486
1495
 
1487
1496
  case 1 /* BooleanValue */ :
@@ -1553,6 +1562,7 @@ function Lt(t, e) {
1553
1562
  if (n !== r) return gt(n, r);
1554
1563
  switch (n) {
1555
1564
  case 0 /* NullValue */ :
1565
+ case 9007199254740991 /* MaxValue */ :
1556
1566
  return 0;
1557
1567
 
1558
1568
  case 1 /* BooleanValue */ :
@@ -1643,11 +1653,11 @@ function Rt(t, e) {
1643
1653
  return !!t && "arrayValue" in t;
1644
1654
  }
1645
1655
 
1646
- /** Returns true if `value` is a NullValue. */ function Ut(t) {
1656
+ /** Returns true if `value` is a NullValue. */ function xt(t) {
1647
1657
  return !!t && "nullValue" in t;
1648
1658
  }
1649
1659
 
1650
- /** Returns true if `value` is NaN. */ function xt(t) {
1660
+ /** Returns true if `value` is NaN. */ function Ut(t) {
1651
1661
  return !!t && "doubleValue" in t && isNaN(Number(t.doubleValue));
1652
1662
  }
1653
1663
 
@@ -1683,26 +1693,7 @@ function Rt(t, e) {
1683
1693
  return Object.assign({}, t);
1684
1694
  }
1685
1695
 
1686
- /**
1687
- * @license
1688
- * Copyright 2017 Google LLC
1689
- *
1690
- * Licensed under the Apache License, Version 2.0 (the "License");
1691
- * you may not use this file except in compliance with the License.
1692
- * You may obtain a copy of the License at
1693
- *
1694
- * http://www.apache.org/licenses/LICENSE-2.0
1695
- *
1696
- * Unless required by applicable law or agreed to in writing, software
1697
- * distributed under the License is distributed on an "AS IS" BASIS,
1698
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1699
- * See the License for the specific language governing permissions and
1700
- * limitations under the License.
1701
- */
1702
- /**
1703
- * An ObjectValue represents a MapValue in the Firestore Proto and offers the
1704
- * ability to add and remove fields (via the ObjectValueBuilder).
1705
- */ var zt = /** @class */ function() {
1696
+ var zt = /** @class */ function() {
1706
1697
  function t(t) {
1707
1698
  this.value = t;
1708
1699
  }
@@ -2407,8 +2398,8 @@ function Le(t, e) {
2407
2398
  var e = Z.fromString(t);
2408
2399
  return E(ze(e)), e;
2409
2400
  }(e);
2410
- if (r.get(1) !== t.databaseId.projectId) throw new U(V, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
2411
- if (r.get(3) !== t.databaseId.database) throw new U(V, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
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);
2412
2403
  return new nt((E((n = r).length > 4 && "documents" === n.get(4)), n.popFirst(5)));
2413
2404
  }
2414
2405
 
@@ -2427,12 +2418,12 @@ function Me(t, e, n) {
2427
2418
  };
2428
2419
  }
2429
2420
 
2430
- function Ue(t) {
2421
+ function xe(t) {
2431
2422
  return ke[t];
2432
2423
  }
2433
2424
 
2434
2425
  // visible for testing
2435
- function xe(t) {
2426
+ function Ue(t) {
2436
2427
  return Ve[t];
2437
2428
  }
2438
2429
 
@@ -2580,7 +2571,7 @@ function ze(t) {
2580
2571
  o.K = r, o.q = i, o.J = !1, o;
2581
2572
  }
2582
2573
  return t(n, e), n.prototype.X = function() {
2583
- if (this.J) throw new U(O, "The client has already been terminated.");
2574
+ if (this.J) throw new x(O, "The client has already been terminated.");
2584
2575
  },
2585
2576
  /** Invokes the provided RPC with auth and AppCheck tokens. */ n.prototype.m = function(t, e, n) {
2586
2577
  var r = this;
@@ -2589,7 +2580,7 @@ function ze(t) {
2589
2580
  return r.K.m(t, e, n, o, a);
2590
2581
  })).catch((function(t) {
2591
2582
  throw "FirebaseError" === t.name ? (t.code === q && (r.authCredentials.invalidateToken(),
2592
- r.appCheckCredentials.invalidateToken()), t) : new U(k, t.toString());
2583
+ r.appCheckCredentials.invalidateToken()), t) : new x(k, t.toString());
2593
2584
  }));
2594
2585
  },
2595
2586
  /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ n.prototype.T = function(t, e, n) {
@@ -2599,7 +2590,7 @@ function ze(t) {
2599
2590
  return r.K.T(t, e, n, o, a);
2600
2591
  })).catch((function(t) {
2601
2592
  throw "FirebaseError" === t.name ? (t.code === q && (r.authCredentials.invalidateToken(),
2602
- r.appCheckCredentials.invalidateToken()), t) : new U(k, t.toString());
2593
+ r.appCheckCredentials.invalidateToken()), t) : new x(k, t.toString());
2603
2594
  }));
2604
2595
  }, n.prototype.terminate = function() {
2605
2596
  this.J = !0;
@@ -2761,26 +2752,26 @@ function $e(t, r) {
2761
2752
  // visible for testing
2762
2753
  return function(t) {
2763
2754
  if ("==" /* EQUAL */ === t.op) {
2764
- if (xt(t.value)) return {
2755
+ if (Ut(t.value)) return {
2765
2756
  unaryFilter: {
2766
2757
  field: Be(t.field),
2767
2758
  op: "IS_NAN"
2768
2759
  }
2769
2760
  };
2770
- if (Ut(t.value)) return {
2761
+ if (xt(t.value)) return {
2771
2762
  unaryFilter: {
2772
2763
  field: Be(t.field),
2773
2764
  op: "IS_NULL"
2774
2765
  }
2775
2766
  };
2776
2767
  } else if ("!=" /* NOT_EQUAL */ === t.op) {
2777
- if (xt(t.value)) return {
2768
+ if (Ut(t.value)) return {
2778
2769
  unaryFilter: {
2779
2770
  field: Be(t.field),
2780
2771
  op: "IS_NOT_NAN"
2781
2772
  }
2782
2773
  };
2783
- if (Ut(t.value)) return {
2774
+ if (xt(t.value)) return {
2784
2775
  unaryFilter: {
2785
2776
  field: Be(t.field),
2786
2777
  op: "IS_NOT_NULL"
@@ -2790,7 +2781,7 @@ function $e(t, r) {
2790
2781
  return {
2791
2782
  fieldFilter: {
2792
2783
  field: Be(t.field),
2793
- op: xe(t.op),
2784
+ op: Ue(t.op),
2794
2785
  value: t.value
2795
2786
  }
2796
2787
  };
@@ -2811,7 +2802,7 @@ function $e(t, r) {
2811
2802
  return function(t) {
2812
2803
  return {
2813
2804
  field: Be(t.field),
2814
- direction: Ue(t.dir)
2805
+ direction: xe(t.dir)
2815
2806
  };
2816
2807
  }(t);
2817
2808
  }));
@@ -2879,7 +2870,7 @@ function $e(t, r) {
2879
2870
  * instance. Callers must invoke removeComponents() when the Firestore
2880
2871
  * instance is terminated.
2881
2872
  */ function Je(t) {
2882
- if (t._terminated) throw new U(O, "The client has already been terminated.");
2873
+ if (t._terminated) throw new x(O, "The client has already been terminated.");
2883
2874
  if (!Xe.has(t)) {
2884
2875
  w("ComponentProvider", "Initializing Datastore");
2885
2876
  var e = function(t) {
@@ -2921,17 +2912,17 @@ function $e(t, r) {
2921
2912
  function t(t) {
2922
2913
  var e;
2923
2914
  if (void 0 === t.host) {
2924
- if (void 0 !== t.ssl) throw new U(V, "Can't provide ssl option if host option is not set");
2915
+ if (void 0 !== t.ssl) throw new x(V, "Can't provide ssl option if host option is not set");
2925
2916
  this.host = "firestore.googleapis.com", this.ssl = !0;
2926
2917
  } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;
2927
2918
  if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties,
2928
2919
  void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
2929
- if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new U(V, "cacheSizeBytes must be at least 1048576");
2920
+ if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new x(V, "cacheSizeBytes must be at least 1048576");
2930
2921
  this.cacheSizeBytes = t.cacheSizeBytes;
2931
2922
  }
2932
2923
  this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling,
2933
2924
  this.useFetchStreams = !!t.useFetchStreams, function(t, e, n, r) {
2934
- if (!0 === e && !0 === r) throw new U(V, "experimentalForceLongPolling and experimentalAutoDetectLongPolling cannot be used together.");
2925
+ if (!0 === e && !0 === r) throw new x(V, "experimentalForceLongPolling and experimentalAutoDetectLongPolling cannot be used together.");
2935
2926
  }(0, t.experimentalForceLongPolling, 0, t.experimentalAutoDetectLongPolling);
2936
2927
  }
2937
2928
  return t.prototype.isEqual = function(t) {
@@ -2947,7 +2938,7 @@ function $e(t, r) {
2947
2938
  this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new Ze({}),
2948
2939
  this._settingsFrozen = !1, t instanceof X ? this._databaseId = t : (this._app = t,
2949
2940
  this._databaseId = function(t) {
2950
- if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new U(V, '"projectId" not provided in firebase.initializeApp.');
2941
+ if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new x(V, '"projectId" not provided in firebase.initializeApp.');
2951
2942
  return new X(t.options.projectId);
2952
2943
  }(t));
2953
2944
  }
@@ -2957,7 +2948,7 @@ function $e(t, r) {
2957
2948
  * instance.
2958
2949
  */
2959
2950
  get: function() {
2960
- if (!this._app) throw new U(O, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
2951
+ if (!this._app) throw new x(O, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
2961
2952
  return this._app;
2962
2953
  },
2963
2954
  enumerable: !1,
@@ -2975,7 +2966,7 @@ function $e(t, r) {
2975
2966
  enumerable: !1,
2976
2967
  configurable: !0
2977
2968
  }), t.prototype._setSettings = function(t) {
2978
- if (this._settingsFrozen) throw new U(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.");
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.");
2979
2970
  this._settings = new Ze(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
2980
2971
  if (!t) return new G;
2981
2972
  switch (t.type) {
@@ -2989,7 +2980,7 @@ function $e(t, r) {
2989
2980
  return t.client;
2990
2981
 
2991
2982
  default:
2992
- throw new U(V, "makeAuthCredentialsProvider failed due to invalid credential type");
2983
+ throw new x(V, "makeAuthCredentialsProvider failed due to invalid credential type");
2993
2984
  }
2994
2985
  }(t.credentials));
2995
2986
  }, t.prototype._getSettings = function() {
@@ -3042,7 +3033,7 @@ function $e(t, r) {
3042
3033
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
3043
3034
  */ function en(t, e) {
3044
3035
  var n = _getProvider(t, "firestore/lite");
3045
- if (n.isInitialized()) throw new U(O, "Firestore can only be initialized once per app.");
3036
+ if (n.isInitialized()) throw new x(O, "Firestore can only be initialized once per app.");
3046
3037
  return n.initialize({
3047
3038
  options: e
3048
3039
  });
@@ -3087,7 +3078,7 @@ function $e(t, r) {
3087
3078
  // invalid field "uid" and missing field "sub" / "user_id".)
3088
3079
  a = d(r.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);
3089
3080
  var u = r.mockUserToken.sub || r.mockUserToken.user_id;
3090
- if (!u) throw new U(V, "mockUserToken must contain 'sub' or 'user_id' field!");
3081
+ if (!u) throw new x(V, "mockUserToken must contain 'sub' or 'user_id' field!");
3091
3082
  s = new m(u);
3092
3083
  }
3093
3084
  t._authCredentials = new z(new B(a, s));
@@ -3267,7 +3258,7 @@ var an = /** @class */ function() {
3267
3258
  var o = Z.fromString.apply(Z, r([ e ], n));
3268
3259
  return ot(o), new un(t, /* converter= */ null, o);
3269
3260
  }
3270
- if (!(t instanceof an || t instanceof un)) throw new U(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
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");
3271
3262
  var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
3272
3263
  return ot(a), new un(t.firestore,
3273
3264
  /* converter= */ null, a);
@@ -3286,7 +3277,7 @@ var an = /** @class */ function() {
3286
3277
  * will be included. Cannot contain a slash.
3287
3278
  * @returns The created `Query`.
3288
3279
  */ function ln(t, e) {
3289
- if (t = st(t, tn), rt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new U(V, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
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 '/'.");
3290
3281
  return new sn(t,
3291
3282
  /* converter= */ null,
3292
3283
  /**
@@ -3308,7 +3299,7 @@ function fn(t, e) {
3308
3299
  return it(o), new an(t,
3309
3300
  /* converter= */ null, new nt(o));
3310
3301
  }
3311
- if (!(t instanceof an || t instanceof un)) throw new U(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
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");
3312
3303
  var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
3313
3304
  return it(a), new an(t.firestore, t instanceof un ? t.converter : null, new nt(a));
3314
3305
  }
@@ -3381,7 +3372,7 @@ var dn = /** @class */ function() {
3381
3372
  */
3382
3373
  function t() {
3383
3374
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3384
- for (var n = 0; n < t.length; ++n) if (0 === t[n].length) throw new U(V, "Invalid field name at argument $(i + 1). Field names must not be empty.");
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.");
3385
3376
  this._internalPath = new et(t);
3386
3377
  }
3387
3378
  /**
@@ -3433,7 +3424,7 @@ var dn = /** @class */ function() {
3433
3424
  try {
3434
3425
  return new t(It.fromBase64String(e));
3435
3426
  } catch (e) {
3436
- throw new U(V, "Failed to construct data from Base64 string: " + e);
3427
+ throw new x(V, "Failed to construct data from Base64 string: " + e);
3437
3428
  }
3438
3429
  },
3439
3430
  /**
@@ -3492,8 +3483,8 @@ function(t) {
3492
3483
  * @param longitude - The longitude as number between -180 and 180.
3493
3484
  */
3494
3485
  function t(t, e) {
3495
- if (!isFinite(t) || t < -90 || t > 90) throw new U(V, "Latitude must be a number between -90 and 90, but was: " + t);
3496
- if (!isFinite(e) || e < -180 || e > 180) throw new U(V, "Longitude must be a number between -180 and 180, but was: " + 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);
3497
3488
  this._lat = t, this._long = e;
3498
3489
  }
3499
3490
  return Object.defineProperty(t.prototype, "latitude", {
@@ -3700,8 +3691,8 @@ function(t) {
3700
3691
  var s, u, c = jn(r, a);
3701
3692
  if (o.merge) s = new Et(a.fieldMask), u = a.fieldTransforms; else if (o.mergeFields) {
3702
3693
  for (var l = [], f = 0, h = o.mergeFields; f < h.length; f++) {
3703
- var p = Un(e, h[f], n);
3704
- if (!a.contains(p)) throw new U(V, "Field '" + p + "' is specified in your field mask but missing from your input data.");
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.");
3705
3696
  zn(l, p) || l.push(p);
3706
3697
  }
3707
3698
  s = new Et(l), u = a.fieldTransforms.filter((function(t) {
@@ -3824,9 +3815,9 @@ var Dn = /** @class */ function(e) {
3824
3815
  }
3825
3816
 
3826
3817
  /** Parse update data from a list of field/value arguments. */ function On(t, e, n, r, i, o) {
3827
- var a = t.ht(1 /* Update */ , e, n), s = [ Un(e, r, n) ], u = [ i ];
3828
- if (o.length % 2 != 0) throw new U(V, "Function " + e + "() needs to be called with an even number of arguments that alternate between field names and values.");
3829
- for (var c = 0; c < o.length; c += 2) s.push(Un(e, o[c])), u.push(o[c + 1]);
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]);
3830
3821
  // We iterate in reverse order to pick the last value for a field if the
3831
3822
  // user specified the field multiple times.
3832
3823
  for (var l = [], f = zt.empty(), h = s.length - 1; h >= 0; --h) if (!zn(l, s[h])) {
@@ -3998,7 +3989,7 @@ function Mn(t, e, n) {
3998
3989
 
3999
3990
  /**
4000
3991
  * Helper that calls fromDotSeparatedString() but wraps any error thrown.
4001
- */ function Un(t, e, n) {
3992
+ */ function xn(t, e, n) {
4002
3993
  if (
4003
3994
  // If required, replace the FieldPath Compat class with with the firestore-exp
4004
3995
  // FieldPath.
@@ -4011,7 +4002,7 @@ function Mn(t, e, n) {
4011
4002
 
4012
4003
  /**
4013
4004
  * Matches any characters in a field path string that are reserved.
4014
- */ var xn = new RegExp("[~\\*/\\[\\]]");
4005
+ */ var Un = new RegExp("[~\\*/\\[\\]]");
4015
4006
 
4016
4007
  /**
4017
4008
  * Wraps fromDotSeparatedString with an error message about the method that
@@ -4022,7 +4013,7 @@ function Mn(t, e, n) {
4022
4013
  * @param targetDoc - The document against which the field path will be
4023
4014
  * evaluated.
4024
4015
  */ function Bn(t, e, n) {
4025
- if (e.search(xn) >= 0) throw Gn("Invalid field path (" + e + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
4016
+ if (e.search(Un) >= 0) throw Gn("Invalid field path (" + e + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
4026
4017
  /* hasConverter= */ !1,
4027
4018
  /* path= */ void 0, n);
4028
4019
  try {
@@ -4039,7 +4030,7 @@ function Gn(t, e, n, r, i) {
4039
4030
  n && (s += " (via `toFirestore()`)");
4040
4031
  var u = "";
4041
4032
  return (o || a) && (u += " (found", o && (u += " in field " + r), a && (u += " in document " + i),
4042
- u += ")"), new U(V, (s += ". ") + t + u)
4033
+ u += ")"), new x(V, (s += ". ") + t + u)
4043
4034
  /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
4044
4035
  }
4045
4036
 
@@ -4272,7 +4263,7 @@ var Jn = /** @class */ function(e) {
4272
4263
  var e = In(t.firestore), n = function(t, e, n, r, i, o, a) {
4273
4264
  var s;
4274
4265
  if (i.isKeyField()) {
4275
- if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new U(V, "Invalid Query. You can't perform '" + o + "' queries on documentId().");
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().");
4276
4267
  if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
4277
4268
  pr(a, o);
4278
4269
  for (var u = [], c = 0, l = a; c < l.length; c++) {
@@ -4292,7 +4283,7 @@ var Jn = /** @class */ function(e) {
4292
4283
  return function(t, e) {
4293
4284
  if (e.N()) {
4294
4285
  var n = le(t);
4295
- if (null !== n && !n.isEqual(e.field)) throw new U(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() + "'");
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() + "'");
4296
4287
  var r = ce(t);
4297
4288
  null !== r && dr(t, e.field, r);
4298
4289
  }
@@ -4338,7 +4329,7 @@ var Jn = /** @class */ function(e) {
4338
4329
  }(e.op));
4339
4330
  if (null !== i)
4340
4331
  // Special case when it's a duplicate op to give a slightly clearer error message.
4341
- throw i === e.op ? new U(V, "Invalid query. You cannot use more than one '" + e.op.toString() + "' filter.") : new U(V, "Invalid query. You cannot use '" + e.op.toString() + "' filters with '" + i.toString() + "' filters.");
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.");
4342
4333
  }(t, h), h;
4343
4334
  }(t._query, 0, e, t.firestore._databaseId, this.dt, this.wt, this.yt);
4344
4335
  return new sn(t.firestore, t.converter, function(t, e) {
@@ -4370,8 +4361,8 @@ var tr = /** @class */ function(e) {
4370
4361
  }
4371
4362
  return t(n, e), n.prototype._apply = function(t) {
4372
4363
  var e = function(t, e, n) {
4373
- if (null !== t.startAt) throw new U(V, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
4374
- if (null !== t.endAt) throw new U(V, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
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().");
4375
4366
  var r = new ie(e, n);
4376
4367
  return function(t, e) {
4377
4368
  if (null === ce(t)) {
@@ -4488,7 +4479,7 @@ function lr() {
4488
4479
 
4489
4480
  /** Helper function to create a bound from a document or fields */ function fr(t, e, n, r) {
4490
4481
  if (n[0] = p(n[0]), n[0] instanceof Qn) return function(t, e, n, r, i) {
4491
- if (!r) throw new U(P, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
4482
+ if (!r) throw new x(P, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
4492
4483
  // Because people expect to continue/end a query at the exact document
4493
4484
  // provided, we need to use the implicit sort order rather than the explicit
4494
4485
  // sort order, because it's guaranteed to contain the document key. That way
@@ -4500,10 +4491,10 @@ function lr() {
4500
4491
  var u = s[a];
4501
4492
  if (u.field.isKeyField()) o.push(Rt(e, r.key)); else {
4502
4493
  var c = r.data.field(u.field);
4503
- if (Pt(c)) throw new U(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.)');
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.)');
4504
4495
  if (null === c) {
4505
4496
  var l = u.field.canonicalString();
4506
- throw new U(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.");
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.");
4507
4498
  }
4508
4499
  o.push(c);
4509
4500
  }
@@ -4514,14 +4505,14 @@ function lr() {
4514
4505
  return function(t, e, n, r, i, o) {
4515
4506
  // Use explicit order by's because it has to match the query the user made
4516
4507
  var a = t.explicitOrderBy;
4517
- if (i.length > a.length) throw new U(V, "Too many arguments provided to " + r + "(). The number of arguments must be less than or equal to the number of orderBy() clauses");
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");
4518
4509
  for (var s = [], u = 0; u < i.length; u++) {
4519
4510
  var c = i[u];
4520
4511
  if (a[u].field.isKeyField()) {
4521
- if ("string" != typeof c) throw new U(V, "Invalid query. Expected a string for document ID in " + r + "(), but got a " + typeof c);
4522
- if (!fe(t) && -1 !== c.indexOf("/")) throw new U(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.");
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.");
4523
4514
  var l = t.path.child(Z.fromString(c));
4524
- if (!nt.isDocumentKey(l)) throw new U(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.");
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.");
4525
4516
  var f = new nt(l);
4526
4517
  s.push(Rt(e, f));
4527
4518
  } else {
@@ -4535,26 +4526,26 @@ function lr() {
4535
4526
 
4536
4527
  function hr(t, e, n) {
4537
4528
  if ("string" == typeof (n = p(n))) {
4538
- if ("" === n) throw new U(V, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
4539
- if (!fe(e) && -1 !== n.indexOf("/")) throw new U(V, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '" + n + "' contains a '/' character.");
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.");
4540
4531
  var r = e.path.child(Z.fromString(n));
4541
- if (!nt.isDocumentKey(r)) throw new U(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 + ").");
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 + ").");
4542
4533
  return Rt(t, new nt(r));
4543
4534
  }
4544
4535
  if (n instanceof an) return Rt(t, n._key);
4545
- throw new U(V, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + at(n) + ".");
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) + ".");
4546
4537
  }
4547
4538
 
4548
4539
  /**
4549
4540
  * Validates that the value passed into a disjunctive filter satisfies all
4550
4541
  * array requirements.
4551
4542
  */ function pr(t, e) {
4552
- if (!Array.isArray(t) || 0 === t.length) throw new U(V, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
4553
- if (t.length > 10) throw new U(V, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
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.");
4554
4545
  }
4555
4546
 
4556
4547
  function dr(t, e, n) {
4557
- if (!n.isEqual(e)) throw new U(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.");
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.");
4558
4549
  }
4559
4550
 
4560
4551
  /**
@@ -4733,7 +4724,7 @@ var yr = /** @class */ function(e) {
4733
4724
  * @returns A Promise that will be resolved with the results of the query.
4734
4725
  */ function gr(t) {
4735
4726
  !function(t) {
4736
- if (ue(t) && 0 === t.explicitOrderBy.length) throw new U(j, "limitToLast() queries require specifying at least one orderBy() clause");
4727
+ if (ue(t) && 0 === t.explicitOrderBy.length) throw new x(j, "limitToLast() queries require specifying at least one orderBy() clause");
4737
4728
  }((t = st(t, sn))._query);
4738
4729
  var e = Je(t.firestore), n = new yr(t.firestore);
4739
4730
  return $e(e, t._query).then((function(e) {
@@ -4953,12 +4944,12 @@ function br(t, e, n) {
4953
4944
  t.prototype.commit = function() {
4954
4945
  return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
4955
4946
  }, t.prototype._verifyNotCommitted = function() {
4956
- if (this._committed) throw new U(O, "A write batch can no longer be used after commit() has been called.");
4947
+ if (this._committed) throw new x(O, "A write batch can no longer be used after commit() has been called.");
4957
4948
  }, t;
4958
4949
  }();
4959
4950
 
4960
4951
  function Dr(t, e) {
4961
- if ((t = p(t)).firestore !== e) throw new U(V, "Provided document reference is from a different Firestore instance.");
4952
+ if ((t = p(t)).firestore !== e) throw new x(V, "Provided document reference is from a different Firestore instance.");
4962
4953
  return t;
4963
4954
  }
4964
4955
 
@@ -5024,7 +5015,7 @@ function Dr(t, e) {
5024
5015
  return n(this, (function(n) {
5025
5016
  switch (n.label) {
5026
5017
  case 0:
5027
- if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new U(V, "Firestore transactions require all reads to be executed before all writes.");
5018
+ if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new x(V, "Firestore transactions require all reads to be executed before all writes.");
5028
5019
  return [ 4 /*yield*/ , Ye(this.datastore, t) ];
5029
5020
 
5030
5021
  case 1:
@@ -5081,7 +5072,7 @@ function Dr(t, e) {
5081
5072
  if (n) {
5082
5073
  if (!e.isEqual(n))
5083
5074
  // This transaction will fail no matter what.
5084
- throw new U(C, "Document version changed between two reads.");
5075
+ throw new x(C, "Document version changed between two reads.");
5085
5076
  } else this.readVersions.set(t.key.toString(), e);
5086
5077
  },
5087
5078
  /**
@@ -5110,7 +5101,7 @@ function Dr(t, e) {
5110
5101
  // express that to the backend, we have to validate locally.
5111
5102
  // Note: this can change once we can send separate verify writes in the
5112
5103
  // transaction.
5113
- throw new U(V, "Can't update a document that doesn't exist.");
5104
+ throw new x(V, "Can't update a document that doesn't exist.");
5114
5105
  // Document exists, base precondition on document update time.
5115
5106
  return _e.updateTime(e);
5116
5107
  }
@@ -5281,7 +5272,7 @@ function Dr(t, e) {
5281
5272
  */ var Or = /** @class */ function() {
5282
5273
  function t(t, e, n, r, i) {
5283
5274
  this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = i,
5284
- this.deferred = new x, this.then = this.deferred.promise.then.bind(this.deferred.promise),
5275
+ this.deferred = new U, this.then = this.deferred.promise.then.bind(this.deferred.promise),
5285
5276
  // It's normal for the deferred promise to be canceled (due to cancellation)
5286
5277
  // and so we attach a dummy catch callback to avoid
5287
5278
  // 'UnhandledPromiseRejectionWarning' log spam.
@@ -5330,7 +5321,7 @@ function Dr(t, e) {
5330
5321
  * guarantee that the operation will not be run.
5331
5322
  */
5332
5323
  t.prototype.cancel = function(t) {
5333
- null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new U(A, "Operation cancelled" + (t ? ": " + t : ""))));
5324
+ null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new x(A, "Operation cancelled" + (t ? ": " + t : ""))));
5334
5325
  }, t.prototype.handleDelayElapsed = function() {
5335
5326
  var t = this;
5336
5327
  this.asyncQueue.enqueueAndForget((function() {
@@ -5409,7 +5400,7 @@ function Dr(t, e) {
5409
5400
  // Create a deferred Promise that we can return to the callee. This
5410
5401
  // allows us to return a "hanging Promise" only to the callee and still
5411
5402
  // advance the queue even when the operation is not run.
5412
- var n = new x;
5403
+ var n = new U;
5413
5404
  return this.Ut((function() {
5414
5405
  return e.$t && e.qt ? Promise.resolve() : (t().then(n.resolve, n.reject), n.promise);
5415
5406
  })).then((function() {
@@ -5648,7 +5639,7 @@ function Dr(t, e) {
5648
5639
  * rejected promise with the corresponding failure error is returned.
5649
5640
  */
5650
5641
  function jr(t, e) {
5651
- var n = Je(t = st(t, tn)), r = new x;
5642
+ var n = Je(t = st(t, tn)), r = new U;
5652
5643
  return new qr(new Cr, n, (function(n) {
5653
5644
  return e(new Lr(t, n));
5654
5645
  }), r).run(), r.promise
@@ -5667,7 +5658,7 @@ y = i + "_lite", o(new c("firestore/lite", (function(t, e) {
5667
5658
  return n && i._setSettings(n), i;
5668
5659
  }), "PUBLIC")),
5669
5660
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
5670
- a("firestore-lite", "3.4.5", ""), a("firestore-lite", "3.4.5", "esm5");
5661
+ a("firestore-lite", "3.4.6-canary.3198d58dc", ""), a("firestore-lite", "3.4.6-canary.3198d58dc", "esm5");
5671
5662
 
5672
- export { yn as Bytes, un as CollectionReference, an as DocumentReference, Qn as DocumentSnapshot, dn as FieldPath, vn as FieldValue, tn as Firestore, U 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 };
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 };
5673
5664
  //# sourceMappingURL=index.browser.esm5.js.map