@firebase/firestore 3.4.8 → 3.4.9-canary.0197076b8

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 (163) 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 +4 -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 +4 -1
  12. package/dist/firestore/src/lite-api/transaction_options.d.ts +23 -0
  13. package/dist/firestore/src/local/document_overlay_cache.d.ts +5 -0
  14. package/dist/firestore/src/local/index_manager.d.ts +24 -3
  15. package/dist/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
  16. package/dist/firestore/src/local/indexeddb_index_manager.d.ts +4 -7
  17. package/dist/firestore/src/local/indexeddb_schema.d.ts +4 -2
  18. package/dist/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  19. package/dist/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
  20. package/dist/firestore/src/local/local_documents_view.d.ts +47 -8
  21. package/dist/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
  22. package/dist/firestore/src/local/memory_index_manager.d.ts +3 -2
  23. package/dist/firestore/src/local/overlayed_document.d.ts +36 -0
  24. package/dist/firestore/src/local/query_engine.d.ts +44 -5
  25. package/dist/firestore/src/model/collections.d.ts +3 -1
  26. package/dist/firestore/src/model/field_mask.d.ts +6 -0
  27. package/dist/firestore/src/model/mutation.d.ts +19 -1
  28. package/dist/firestore/src/model/mutation_batch.d.ts +9 -4
  29. package/dist/firestore/src/model/values.d.ts +14 -2
  30. package/dist/firestore/src/tsdoc-metadata.json +11 -11
  31. package/dist/firestore/src/util/misc.d.ts +3 -0
  32. package/dist/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
  33. package/dist/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
  34. package/dist/firestore/test/unit/local/test_index_manager.d.ts +2 -2
  35. package/dist/firestore/test/util/helpers.d.ts +12 -0
  36. package/dist/index.d.ts +28 -3
  37. package/dist/index.esm2017.js +9384 -9023
  38. package/dist/index.esm2017.js.map +1 -1
  39. package/dist/index.esm5.js +7406 -7016
  40. package/dist/index.esm5.js.map +1 -1
  41. package/dist/index.node.cjs.js +5607 -5089
  42. package/dist/index.node.cjs.js.map +1 -1
  43. package/dist/index.node.mjs +5607 -5089
  44. package/dist/index.node.mjs.map +1 -1
  45. package/dist/index.rn.js +7162 -6801
  46. package/dist/index.rn.js.map +1 -1
  47. package/dist/internal.d.ts +6007 -5918
  48. package/dist/lite/firestore/lite/index.d.ts +1 -0
  49. package/dist/lite/firestore/src/api/transaction.d.ts +4 -1
  50. package/dist/lite/firestore/src/api/transaction_options.d.ts +17 -0
  51. package/dist/lite/firestore/src/api.d.ts +1 -0
  52. package/dist/lite/firestore/src/core/firestore_client.d.ts +2 -1
  53. package/dist/lite/firestore/src/core/query.d.ts +2 -4
  54. package/dist/lite/firestore/src/core/target.d.ts +6 -4
  55. package/dist/lite/firestore/src/core/transaction_options.d.ts +25 -0
  56. package/dist/lite/firestore/src/core/transaction_runner.d.ts +3 -2
  57. package/dist/lite/firestore/src/lite-api/transaction.d.ts +4 -1
  58. package/dist/lite/firestore/src/lite-api/transaction_options.d.ts +23 -0
  59. package/dist/lite/firestore/src/local/document_overlay_cache.d.ts +5 -0
  60. package/dist/lite/firestore/src/local/index_manager.d.ts +24 -3
  61. package/dist/lite/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
  62. package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +4 -7
  63. package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +4 -2
  64. package/dist/lite/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  65. package/dist/lite/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
  66. package/dist/lite/firestore/src/local/local_documents_view.d.ts +47 -8
  67. package/dist/lite/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
  68. package/dist/lite/firestore/src/local/memory_index_manager.d.ts +3 -2
  69. package/dist/lite/firestore/src/local/overlayed_document.d.ts +36 -0
  70. package/dist/lite/firestore/src/local/query_engine.d.ts +44 -5
  71. package/dist/lite/firestore/src/model/collections.d.ts +3 -1
  72. package/dist/lite/firestore/src/model/field_mask.d.ts +6 -0
  73. package/dist/lite/firestore/src/model/mutation.d.ts +19 -1
  74. package/dist/lite/firestore/src/model/mutation_batch.d.ts +9 -4
  75. package/dist/lite/firestore/src/model/values.d.ts +14 -2
  76. package/dist/lite/firestore/src/util/misc.d.ts +3 -0
  77. package/dist/lite/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
  78. package/dist/lite/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
  79. package/dist/lite/firestore/test/unit/local/test_index_manager.d.ts +2 -2
  80. package/dist/lite/firestore/test/util/helpers.d.ts +12 -0
  81. package/dist/lite/index.browser.esm2017.js +1209 -698
  82. package/dist/lite/index.browser.esm2017.js.map +1 -1
  83. package/dist/lite/index.browser.esm5.js +1213 -813
  84. package/dist/lite/index.browser.esm5.js.map +1 -1
  85. package/dist/lite/index.d.ts +26 -1
  86. package/dist/lite/index.node.cjs.js +709 -15
  87. package/dist/lite/index.node.cjs.js.map +1 -1
  88. package/dist/lite/index.node.mjs +709 -15
  89. package/dist/lite/index.node.mjs.map +1 -1
  90. package/dist/lite/index.rn.esm2017.js +1828 -1317
  91. package/dist/lite/index.rn.esm2017.js.map +1 -1
  92. package/dist/lite/internal.d.ts +2912 -2874
  93. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +103 -101
  94. package/dist/lite/packages/firestore/lite/index.d.ts +1 -0
  95. package/dist/lite/packages/firestore/src/api/transaction.d.ts +4 -1
  96. package/dist/lite/packages/firestore/src/api/transaction_options.d.ts +17 -0
  97. package/dist/lite/packages/firestore/src/api.d.ts +1 -0
  98. package/dist/lite/packages/firestore/src/core/firestore_client.d.ts +2 -1
  99. package/dist/lite/packages/firestore/src/core/query.d.ts +2 -4
  100. package/dist/lite/packages/firestore/src/core/target.d.ts +6 -4
  101. package/dist/lite/packages/firestore/src/core/transaction_options.d.ts +25 -0
  102. package/dist/lite/packages/firestore/src/core/transaction_runner.d.ts +3 -2
  103. package/dist/lite/packages/firestore/src/lite-api/transaction.d.ts +4 -1
  104. package/dist/lite/packages/firestore/src/lite-api/transaction_options.d.ts +23 -0
  105. package/dist/lite/packages/firestore/src/local/document_overlay_cache.d.ts +5 -0
  106. package/dist/lite/packages/firestore/src/local/index_manager.d.ts +24 -3
  107. package/dist/lite/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
  108. package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +4 -7
  109. package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +4 -2
  110. package/dist/lite/packages/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  111. package/dist/lite/packages/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
  112. package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +47 -8
  113. package/dist/lite/packages/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
  114. package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +3 -2
  115. package/dist/lite/packages/firestore/src/local/overlayed_document.d.ts +36 -0
  116. package/dist/lite/packages/firestore/src/local/query_engine.d.ts +44 -5
  117. package/dist/lite/packages/firestore/src/model/collections.d.ts +3 -1
  118. package/dist/lite/packages/firestore/src/model/field_mask.d.ts +6 -0
  119. package/dist/lite/packages/firestore/src/model/mutation.d.ts +19 -1
  120. package/dist/lite/packages/firestore/src/model/mutation_batch.d.ts +9 -4
  121. package/dist/lite/packages/firestore/src/model/values.d.ts +14 -2
  122. package/dist/lite/packages/firestore/src/util/misc.d.ts +3 -0
  123. package/dist/lite/packages/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
  124. package/dist/lite/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
  125. package/dist/lite/packages/firestore/test/unit/local/test_index_manager.d.ts +2 -2
  126. package/dist/lite/packages/firestore/test/util/helpers.d.ts +12 -0
  127. package/dist/lite/private.d.ts +2772 -2734
  128. package/dist/packages/firestore/dist/index.esm2017.d.ts +197 -194
  129. package/dist/packages/firestore/lite/index.d.ts +1 -0
  130. package/dist/packages/firestore/src/api/transaction.d.ts +4 -1
  131. package/dist/packages/firestore/src/api/transaction_options.d.ts +17 -0
  132. package/dist/packages/firestore/src/api.d.ts +1 -0
  133. package/dist/packages/firestore/src/core/firestore_client.d.ts +2 -1
  134. package/dist/packages/firestore/src/core/query.d.ts +2 -4
  135. package/dist/packages/firestore/src/core/target.d.ts +6 -4
  136. package/dist/packages/firestore/src/core/transaction_options.d.ts +25 -0
  137. package/dist/packages/firestore/src/core/transaction_runner.d.ts +3 -2
  138. package/dist/packages/firestore/src/lite-api/transaction.d.ts +4 -1
  139. package/dist/packages/firestore/src/lite-api/transaction_options.d.ts +23 -0
  140. package/dist/packages/firestore/src/local/document_overlay_cache.d.ts +5 -0
  141. package/dist/packages/firestore/src/local/index_manager.d.ts +24 -3
  142. package/dist/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
  143. package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +4 -7
  144. package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +4 -2
  145. package/dist/packages/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  146. package/dist/packages/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
  147. package/dist/packages/firestore/src/local/local_documents_view.d.ts +47 -8
  148. package/dist/packages/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
  149. package/dist/packages/firestore/src/local/memory_index_manager.d.ts +3 -2
  150. package/dist/packages/firestore/src/local/overlayed_document.d.ts +36 -0
  151. package/dist/packages/firestore/src/local/query_engine.d.ts +44 -5
  152. package/dist/packages/firestore/src/model/collections.d.ts +3 -1
  153. package/dist/packages/firestore/src/model/field_mask.d.ts +6 -0
  154. package/dist/packages/firestore/src/model/mutation.d.ts +19 -1
  155. package/dist/packages/firestore/src/model/mutation_batch.d.ts +9 -4
  156. package/dist/packages/firestore/src/model/values.d.ts +14 -2
  157. package/dist/packages/firestore/src/util/misc.d.ts +3 -0
  158. package/dist/packages/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
  159. package/dist/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
  160. package/dist/packages/firestore/test/unit/local/test_index_manager.d.ts +2 -2
  161. package/dist/packages/firestore/test/util/helpers.d.ts +12 -0
  162. package/dist/private.d.ts +5715 -5626
  163. package/package.json +20 -18
@@ -27,7 +27,7 @@ import { FirebaseError as h, getModularInstance as p, createMockUserToken as d }
27
27
  /**
28
28
  * Simple wrapper around a nullable UID. Mostly exists to make code more
29
29
  * readable.
30
- */ var m = /** @class */ function() {
30
+ */ var y = /** @class */ function() {
31
31
  function t(t) {
32
32
  this.uid = t;
33
33
  }
@@ -45,11 +45,11 @@ import { FirebaseError as h, getModularInstance as p, createMockUserToken as d }
45
45
  }, t;
46
46
  }();
47
47
 
48
- /** A user with a null UID. */ m.UNAUTHENTICATED = new m(null),
48
+ /** A user with a null UID. */ y.UNAUTHENTICATED = new y(null),
49
49
  // TODO(mikelehen): Look into getting a proper uid-equivalent for
50
50
  // non-FirebaseAuth providers.
51
- m.GOOGLE_CREDENTIALS = new m("google-credentials-uid"), m.FIRST_PARTY = new m("first-party-uid"),
52
- m.MOCK_USER = new m("mock-user");
51
+ y.GOOGLE_CREDENTIALS = new y("google-credentials-uid"), y.FIRST_PARTY = new y("first-party-uid"),
52
+ y.MOCK_USER = new y("mock-user");
53
53
 
54
54
  /**
55
55
  * @license
@@ -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 m = "9.8.2-canary.0197076b8", v = new l("@firebase/firestore");
71
71
 
72
72
  /**
73
73
  * @license
@@ -106,7 +106,7 @@ function w(t) {
106
106
  for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
107
107
  if (v.logLevel <= f.DEBUG) {
108
108
  var i = e.map(T);
109
- v.debug.apply(v, r([ "Firestore (" + y + "): " + t ], i));
109
+ v.debug.apply(v, r([ "Firestore (" + m + "): " + t ], i));
110
110
  }
111
111
  }
112
112
 
@@ -114,7 +114,7 @@ function b(t) {
114
114
  for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
115
115
  if (v.logLevel <= f.ERROR) {
116
116
  var i = e.map(T);
117
- v.error.apply(v, r([ "Firestore (" + y + "): " + t ], i));
117
+ v.error.apply(v, r([ "Firestore (" + m + "): " + t ], i));
118
118
  }
119
119
  }
120
120
 
@@ -124,7 +124,7 @@ function b(t) {
124
124
  for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
125
125
  if (v.logLevel <= f.WARN) {
126
126
  var i = e.map(T);
127
- v.warn.apply(v, r([ "Firestore (" + y + "): " + t ], i));
127
+ v.warn.apply(v, r([ "Firestore (" + m + "): " + t ], i));
128
128
  }
129
129
  }
130
130
 
@@ -180,11 +180,11 @@ function b(t) {
180
180
  * Returns `never` and can be used in expressions:
181
181
  * @example
182
182
  * let futureVar = fail('not implemented yet');
183
- */ function S(t) {
183
+ */ function E(t) {
184
184
  void 0 === t && (t = "Unexpected state");
185
185
  // Log the failure in addition to throw an exception, just in case the
186
186
  // exception is swallowed.
187
- var e = "FIRESTORE (" + y + ") INTERNAL ASSERTION FAILED: " + t;
187
+ var e = "FIRESTORE (" + m + ") INTERNAL ASSERTION FAILED: " + t;
188
188
  // NOTE: We don't use FirestoreError here because these are internal failures
189
189
  // that cannot be handled by the user. (Also it would create a circular
190
190
  // dependency between the error and assert modules which doesn't work.)
@@ -197,14 +197,14 @@ function b(t) {
197
197
  */;
198
198
  }
199
199
 
200
- function E(t, e) {
201
- t || S();
200
+ function S(t, e) {
201
+ t || E();
202
202
  }
203
203
 
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 k(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", A = "unknown", V = "invalid-argument", D = "deadline-exceeded", P = "not-found", N = "permission-denied", F = "unauthenticated", O = "resource-exhausted", q = "failed-precondition", R = "aborted", x = "out-of-range", C = "unimplemented", L = "internal", j = "unavailable", M = /** @class */ function(e) {
229
229
  /** @hideconstructor */
230
230
  function n(
231
231
  /**
@@ -253,17 +253,17 @@ e) {
253
253
  }));
254
254
  }, B = function(t, e) {
255
255
  this.user = e, this.type = "OAuth", this.headers = new Map, this.headers.set("Authorization", "Bearer " + t);
256
- }, G = /** @class */ function() {
256
+ }, z = /** @class */ function() {
257
257
  function t() {}
258
258
  return t.prototype.getToken = function() {
259
259
  return Promise.resolve(null);
260
260
  }, t.prototype.invalidateToken = function() {}, t.prototype.start = function(t, e) {
261
261
  // Fire with initial user.
262
262
  t.enqueueRetryable((function() {
263
- return e(m.UNAUTHENTICATED);
263
+ return e(y.UNAUTHENTICATED);
264
264
  }));
265
265
  }, t.prototype.shutdown = function() {}, t;
266
- }(), z = /** @class */ function() {
266
+ }(), G = /** @class */ function() {
267
267
  function t(t) {
268
268
  this.token = t,
269
269
  /**
@@ -285,7 +285,7 @@ e) {
285
285
  }, t.prototype.shutdown = function() {
286
286
  this.changeListener = null;
287
287
  }, t;
288
- }(), Q = /** @class */ function() {
288
+ }(), K = /** @class */ function() {
289
289
  function t(t) {
290
290
  var e = this;
291
291
  this.auth = null, t.onInit((function(t) {
@@ -295,28 +295,28 @@ e) {
295
295
  return t.prototype.getToken = function() {
296
296
  var t = this;
297
297
  return this.auth ? this.auth.getToken().then((function(e) {
298
- return e ? (E("string" == typeof e.accessToken), new B(e.accessToken, new m(t.auth.getUid()))) : null;
298
+ return e ? (S("string" == typeof e.accessToken), new B(e.accessToken, new y(t.auth.getUid()))) : null;
299
299
  })) : Promise.resolve(null);
300
300
  }, t.prototype.invalidateToken = function() {}, t.prototype.start = function(t, e) {},
301
301
  t.prototype.shutdown = function() {}, t;
302
- }(), K = function(t, e, n) {
303
- this.type = "FirstParty", this.user = m.FIRST_PARTY, this.headers = new Map, this.headers.set("X-Goog-AuthUser", e);
302
+ }(), Q = function(t, e, n) {
303
+ this.type = "FirstParty", this.user = y.FIRST_PARTY, this.headers = new Map, this.headers.set("X-Goog-AuthUser", e);
304
304
  var r = t.auth.getAuthHeaderValueForFirstParty([]);
305
305
  r && this.headers.set("Authorization", r), n && this.headers.set("X-Goog-Iam-Authorization-Token", n);
306
- }, H = /** @class */ function() {
306
+ }, W = /** @class */ function() {
307
307
  function t(t, e, n) {
308
308
  this.t = t, this.i = e, this.o = n;
309
309
  }
310
310
  return t.prototype.getToken = function() {
311
- return Promise.resolve(new K(this.t, this.i, this.o));
311
+ return Promise.resolve(new Q(this.t, this.i, this.o));
312
312
  }, t.prototype.start = function(t, e) {
313
313
  // Fire with initial uid.
314
314
  t.enqueueRetryable((function() {
315
- return e(m.FIRST_PARTY);
315
+ return e(y.FIRST_PARTY);
316
316
  }));
317
317
  }, t.prototype.shutdown = function() {}, t.prototype.invalidateToken = function() {},
318
318
  t;
319
- }(), W = function(t) {
319
+ }(), H = function(t) {
320
320
  this.value = t, this.type = "AppCheck", this.headers = new Map, t && t.length > 0 && this.headers.set("x-firebase-appcheck", this.value);
321
321
  }, Y = /** @class */ function() {
322
322
  function t(t) {
@@ -327,7 +327,7 @@ e) {
327
327
  }
328
328
  return t.prototype.getToken = function() {
329
329
  return this.appCheck ? this.appCheck.getToken().then((function(t) {
330
- return t ? (E("string" == typeof t.token), new W(t.token)) : null;
330
+ return t ? (S("string" == typeof t.token), new H(t.token)) : null;
331
331
  })) : Promise.resolve(null);
332
332
  }, t.prototype.invalidateToken = function() {}, t.prototype.start = function(t, e) {},
333
333
  t.prototype.shutdown = function() {}, t;
@@ -369,7 +369,7 @@ function(t, e, n, r, i, o, a, s) {
369
369
  }, t;
370
370
  }(), J = /** @class */ function() {
371
371
  function t(t, e, n) {
372
- void 0 === e ? e = 0 : e > t.length && S(), void 0 === n ? n = t.length - e : n > t.length - e && S(),
372
+ void 0 === e ? e = 0 : e > t.length && E(), void 0 === n ? n = t.length - e : n > t.length - e && E(),
373
373
  this.segments = t, this.offset = e, this.len = n;
374
374
  }
375
375
  return Object.defineProperty(t.prototype, "length", {
@@ -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
  /**
@@ -620,7 +620,7 @@ function rt(t, e, n) {
620
620
  }(t);
621
621
  return e ? "a custom " + e + " object" : "an object";
622
622
  }
623
- return "function" == typeof t ? "a function" : S();
623
+ return "function" == typeof t ? "a function" : E();
624
624
  }
625
625
 
626
626
  function st(t,
@@ -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
  /**
@@ -733,7 +733,7 @@ function ut(t, e) {
733
733
  * Code.UNKNOWN.
734
734
  */
735
735
  function dt(t) {
736
- if (void 0 === t) return b("RPC_ERROR", "HTTP error has no status"), k;
736
+ if (void 0 === t) return b("RPC_ERROR", "HTTP error has no status"), A;
737
737
  // The canonical error codes for Google APIs [1] specify mapping onto HTTP
738
738
  // status codes but the mapping is not bijective. In each case of ambiguity
739
739
  // this function chooses a primary error.
@@ -746,14 +746,14 @@ function dt(t) {
746
746
 
747
747
  case 400:
748
748
  // Bad Request
749
- return O;
749
+ return q;
750
750
 
751
751
  // Other possibilities based on the forward mapping
752
752
  // return Code.INVALID_ARGUMENT;
753
753
  // return Code.OUT_OF_RANGE;
754
754
  case 401:
755
755
  // Unauthorized
756
- return q;
756
+ return F;
757
757
 
758
758
  case 403:
759
759
  // Forbidden
@@ -765,43 +765,43 @@ function dt(t) {
765
765
 
766
766
  case 409:
767
767
  // Conflict
768
- return C;
768
+ return R;
769
769
 
770
770
  // Other possibilities:
771
771
  // return Code.ALREADY_EXISTS;
772
772
  case 416:
773
773
  // Range Not Satisfiable
774
- return L;
774
+ return x;
775
775
 
776
776
  case 429:
777
777
  // Too Many Requests
778
- return F;
778
+ return O;
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
786
- return k;
786
+ return A;
787
787
 
788
788
  // Other possibilities:
789
789
  // return Code.INTERNAL;
790
790
  // return Code.DATA_LOSS;
791
791
  case 501:
792
792
  // Unimplemented
793
- return j;
793
+ return C;
794
794
 
795
795
  case 503:
796
796
  // Service Unavailable
797
- return M;
797
+ return j;
798
798
 
799
799
  case 504:
800
800
  // Gateway Timeout
801
801
  return D;
802
802
 
803
803
  default:
804
- return t >= 200 && t < 300 ? "ok" : t >= 400 && t < 500 ? O : t >= 500 && t < 600 ? R : k;
804
+ return t >= 200 && t < 300 ? "ok" : t >= 400 && t < 500 ? q : t >= 500 && t < 600 ? L : A;
805
805
  }
806
806
  }
807
807
 
@@ -833,7 +833,7 @@ ht[ht.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", ht[ht.ABORTED = 10] = "A
833
833
  ht[ht.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", ht[ht.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
834
834
  ht[ht.INTERNAL = 13] = "INTERNAL", ht[ht.UNAVAILABLE = 14] = "UNAVAILABLE", ht[ht.DATA_LOSS = 15] = "DATA_LOSS";
835
835
 
836
- var mt = /** @class */ function(r) {
836
+ var yt = /** @class */ function(r) {
837
837
  /**
838
838
  * @param databaseInfo - The connection info.
839
839
  * @param fetchImpl - `fetch` or a Polyfill that implements the fetch API.
@@ -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
  }));
@@ -902,7 +902,7 @@ var mt = /** @class */ function(r) {
902
902
  * present and any additional headers for the request.
903
903
  */
904
904
  t.prototype.g = function(t, e, n) {
905
- t["X-Goog-Api-Client"] = "gl-js/ fire/" + y,
905
+ t["X-Goog-Api-Client"] = "gl-js/ fire/" + m,
906
906
  // Content-Type: text/plain will avoid preflight requests which might
907
907
  // mess with CORS and redirects by proxies. If we add custom headers
908
908
  // we will need to change this code to potentially use the $httpOverwrite
@@ -956,7 +956,7 @@ var mt = /** @class */ function(r) {
956
956
  * Generates `nBytes` of random bytes.
957
957
  *
958
958
  * If `nBytes < 0` , an error will be thrown.
959
- */ function yt(t) {
959
+ */ function mt(t) {
960
960
  // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.
961
961
  var e =
962
962
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -989,7 +989,7 @@ var mt = /** @class */ function(r) {
989
989
  // Alphanumeric characters
990
990
  var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", e = Math.floor(256 / t.length) * t.length, n = ""
991
991
  // The largest byte value that is a multiple of `char.length`.
992
- ; n.length < 20; ) for (var r = yt(40), i = 0; i < r.length; ++i)
992
+ ; n.length < 20; ) for (var r = mt(40), i = 0; i < r.length; ++i)
993
993
  // Only accept values that are [0, maxMultiple), this ensures they can
994
994
  // be evenly mapped to indices of `chars` via a modulo operation.
995
995
  n.length < 20 && r[i] < e && (n += t.charAt(r[i] % t.length));
@@ -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.
@@ -1218,13 +1218,329 @@ function Tt(t) {
1218
1218
  return e;
1219
1219
  }
1220
1220
 
1221
- function St(t, e) {
1221
+ function Et(t, e) {
1222
1222
  for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);
1223
1223
  }
1224
1224
 
1225
1225
  /**
1226
1226
  * @license
1227
- * Copyright 2020 Google LLC
1227
+ * Copyright 2017 Google LLC
1228
+ *
1229
+ * Licensed under the Apache License, Version 2.0 (the "License");
1230
+ * you may not use this file except in compliance with the License.
1231
+ * You may obtain a copy of the License at
1232
+ *
1233
+ * http://www.apache.org/licenses/LICENSE-2.0
1234
+ *
1235
+ * Unless required by applicable law or agreed to in writing, software
1236
+ * distributed under the License is distributed on an "AS IS" BASIS,
1237
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1238
+ * See the License for the specific language governing permissions and
1239
+ * limitations under the License.
1240
+ */
1241
+ // An immutable sorted map implementation, based on a Left-leaning Red-Black
1242
+ // tree.
1243
+ var St = /** @class */ function() {
1244
+ function t(t, e) {
1245
+ this.comparator = t, this.root = e || It.EMPTY;
1246
+ }
1247
+ // Returns a copy of the map, with the specified key/value added or replaced.
1248
+ return t.prototype.insert = function(e, n) {
1249
+ return new t(this.comparator, this.root.insert(e, n, this.comparator).copy(null, null, It.BLACK, null, null));
1250
+ },
1251
+ // Returns a copy of the map, with the specified key removed.
1252
+ t.prototype.remove = function(e) {
1253
+ return new t(this.comparator, this.root.remove(e, this.comparator).copy(null, null, It.BLACK, null, null));
1254
+ },
1255
+ // Returns the value of the node with the given key, or null.
1256
+ t.prototype.get = function(t) {
1257
+ for (var e = this.root; !e.isEmpty(); ) {
1258
+ var n = this.comparator(t, e.key);
1259
+ if (0 === n) return e.value;
1260
+ n < 0 ? e = e.left : n > 0 && (e = e.right);
1261
+ }
1262
+ return null;
1263
+ },
1264
+ // Returns the index of the element in this sorted map, or -1 if it doesn't
1265
+ // exist.
1266
+ t.prototype.indexOf = function(t) {
1267
+ for (
1268
+ // Number of nodes that were pruned when descending right
1269
+ var e = 0, n = this.root; !n.isEmpty(); ) {
1270
+ var r = this.comparator(t, n.key);
1271
+ if (0 === r) return e + n.left.size;
1272
+ r < 0 ? n = n.left : (
1273
+ // Count all nodes left of the node plus the node itself
1274
+ e += n.left.size + 1, n = n.right);
1275
+ }
1276
+ // Node not found
1277
+ return -1;
1278
+ }, t.prototype.isEmpty = function() {
1279
+ return this.root.isEmpty();
1280
+ }, Object.defineProperty(t.prototype, "size", {
1281
+ // Returns the total number of nodes in the map.
1282
+ get: function() {
1283
+ return this.root.size;
1284
+ },
1285
+ enumerable: !1,
1286
+ configurable: !0
1287
+ }),
1288
+ // Returns the minimum key in the map.
1289
+ t.prototype.minKey = function() {
1290
+ return this.root.minKey();
1291
+ },
1292
+ // Returns the maximum key in the map.
1293
+ t.prototype.maxKey = function() {
1294
+ return this.root.maxKey();
1295
+ },
1296
+ // Traverses the map in key order and calls the specified action function
1297
+ // for each key/value pair. If action returns true, traversal is aborted.
1298
+ // Returns the first truthy value returned by action, or the last falsey
1299
+ // value returned by action.
1300
+ t.prototype.inorderTraversal = function(t) {
1301
+ return this.root.inorderTraversal(t);
1302
+ }, t.prototype.forEach = function(t) {
1303
+ this.inorderTraversal((function(e, n) {
1304
+ return t(e, n), !1;
1305
+ }));
1306
+ }, t.prototype.toString = function() {
1307
+ var t = [];
1308
+ return this.inorderTraversal((function(e, n) {
1309
+ return t.push(e + ":" + n), !1;
1310
+ })), "{" + t.join(", ") + "}";
1311
+ },
1312
+ // Traverses the map in reverse key order and calls the specified action
1313
+ // function for each key/value pair. If action returns true, traversal is
1314
+ // aborted.
1315
+ // Returns the first truthy value returned by action, or the last falsey
1316
+ // value returned by action.
1317
+ t.prototype.reverseTraversal = function(t) {
1318
+ return this.root.reverseTraversal(t);
1319
+ },
1320
+ // Returns an iterator over the SortedMap.
1321
+ t.prototype.getIterator = function() {
1322
+ return new kt(this.root, null, this.comparator, !1);
1323
+ }, t.prototype.getIteratorFrom = function(t) {
1324
+ return new kt(this.root, t, this.comparator, !1);
1325
+ }, t.prototype.getReverseIterator = function() {
1326
+ return new kt(this.root, null, this.comparator, !0);
1327
+ }, t.prototype.getReverseIteratorFrom = function(t) {
1328
+ return new kt(this.root, t, this.comparator, !0);
1329
+ }, t;
1330
+ }(), kt = /** @class */ function() {
1331
+ function t(t, e, n, r) {
1332
+ this.isReverse = r, this.nodeStack = [];
1333
+ for (var i = 1; !t.isEmpty(); ) if (i = e ? n(t.key, e) : 1,
1334
+ // flip the comparison if we're going in reverse
1335
+ e && r && (i *= -1), i < 0)
1336
+ // This node is less than our start key. ignore it
1337
+ t = this.isReverse ? t.left : t.right; else {
1338
+ if (0 === i) {
1339
+ // This node is exactly equal to our start key. Push it on the stack,
1340
+ // but stop iterating;
1341
+ this.nodeStack.push(t);
1342
+ break;
1343
+ }
1344
+ // This node is greater than our start key, add it to the stack and move
1345
+ // to the next one
1346
+ this.nodeStack.push(t), t = this.isReverse ? t.right : t.left;
1347
+ }
1348
+ }
1349
+ return t.prototype.getNext = function() {
1350
+ var t = this.nodeStack.pop(), e = {
1351
+ key: t.key,
1352
+ value: t.value
1353
+ };
1354
+ if (this.isReverse) for (t = t.left; !t.isEmpty(); ) this.nodeStack.push(t), t = t.right; else for (t = t.right; !t.isEmpty(); ) this.nodeStack.push(t),
1355
+ t = t.left;
1356
+ return e;
1357
+ }, t.prototype.hasNext = function() {
1358
+ return this.nodeStack.length > 0;
1359
+ }, t.prototype.peek = function() {
1360
+ if (0 === this.nodeStack.length) return null;
1361
+ var t = this.nodeStack[this.nodeStack.length - 1];
1362
+ return {
1363
+ key: t.key,
1364
+ value: t.value
1365
+ };
1366
+ }, t;
1367
+ }(), It = /** @class */ function() {
1368
+ function t(e, n, r, i, o) {
1369
+ this.key = e, this.value = n, this.color = null != r ? r : t.RED, this.left = null != i ? i : t.EMPTY,
1370
+ this.right = null != o ? o : t.EMPTY, this.size = this.left.size + 1 + this.right.size;
1371
+ }
1372
+ // Returns a copy of the current node, optionally replacing pieces of it.
1373
+ return t.prototype.copy = function(e, n, r, i, o) {
1374
+ return new t(null != e ? e : this.key, null != n ? n : this.value, null != r ? r : this.color, null != i ? i : this.left, null != o ? o : this.right);
1375
+ }, t.prototype.isEmpty = function() {
1376
+ return !1;
1377
+ },
1378
+ // Traverses the tree in key order and calls the specified action function
1379
+ // for each node. If action returns true, traversal is aborted.
1380
+ // Returns the first truthy value returned by action, or the last falsey
1381
+ // value returned by action.
1382
+ t.prototype.inorderTraversal = function(t) {
1383
+ return this.left.inorderTraversal(t) || t(this.key, this.value) || this.right.inorderTraversal(t);
1384
+ },
1385
+ // Traverses the tree in reverse key order and calls the specified action
1386
+ // function for each node. If action returns true, traversal is aborted.
1387
+ // Returns the first truthy value returned by action, or the last falsey
1388
+ // value returned by action.
1389
+ t.prototype.reverseTraversal = function(t) {
1390
+ return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t);
1391
+ },
1392
+ // Returns the minimum node in the tree.
1393
+ t.prototype.min = function() {
1394
+ return this.left.isEmpty() ? this : this.left.min();
1395
+ },
1396
+ // Returns the maximum key in the tree.
1397
+ t.prototype.minKey = function() {
1398
+ return this.min().key;
1399
+ },
1400
+ // Returns the maximum key in the tree.
1401
+ t.prototype.maxKey = function() {
1402
+ return this.right.isEmpty() ? this.key : this.right.maxKey();
1403
+ },
1404
+ // Returns new tree, with the key/value added.
1405
+ t.prototype.insert = function(t, e, n) {
1406
+ var r = this, i = n(t, r.key);
1407
+ return (r = i < 0 ? r.copy(null, null, null, r.left.insert(t, e, n), null) : 0 === i ? r.copy(null, e, null, null, null) : r.copy(null, null, null, null, r.right.insert(t, e, n))).fixUp();
1408
+ }, t.prototype.removeMin = function() {
1409
+ if (this.left.isEmpty()) return t.EMPTY;
1410
+ var e = this;
1411
+ return e.left.isRed() || e.left.left.isRed() || (e = e.moveRedLeft()), (e = e.copy(null, null, null, e.left.removeMin(), null)).fixUp();
1412
+ },
1413
+ // Returns new tree, with the specified item removed.
1414
+ t.prototype.remove = function(e, n) {
1415
+ var r, i = this;
1416
+ if (n(e, i.key) < 0) i.left.isEmpty() || i.left.isRed() || i.left.left.isRed() || (i = i.moveRedLeft()),
1417
+ i = i.copy(null, null, null, i.left.remove(e, n), null); else {
1418
+ if (i.left.isRed() && (i = i.rotateRight()), i.right.isEmpty() || i.right.isRed() || i.right.left.isRed() || (i = i.moveRedRight()),
1419
+ 0 === n(e, i.key)) {
1420
+ if (i.right.isEmpty()) return t.EMPTY;
1421
+ r = i.right.min(), i = i.copy(r.key, r.value, null, null, i.right.removeMin());
1422
+ }
1423
+ i = i.copy(null, null, null, null, i.right.remove(e, n));
1424
+ }
1425
+ return i.fixUp();
1426
+ }, t.prototype.isRed = function() {
1427
+ return this.color;
1428
+ },
1429
+ // Returns new tree after performing any needed rotations.
1430
+ t.prototype.fixUp = function() {
1431
+ var t = this;
1432
+ return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()),
1433
+ t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;
1434
+ }, t.prototype.moveRedLeft = function() {
1435
+ var t = this.colorFlip();
1436
+ return t.right.left.isRed() && (t = (t = (t = t.copy(null, null, null, null, t.right.rotateRight())).rotateLeft()).colorFlip()),
1437
+ t;
1438
+ }, t.prototype.moveRedRight = function() {
1439
+ var t = this.colorFlip();
1440
+ return t.left.left.isRed() && (t = (t = t.rotateRight()).colorFlip()), t;
1441
+ }, t.prototype.rotateLeft = function() {
1442
+ var e = this.copy(null, null, t.RED, null, this.right.left);
1443
+ return this.right.copy(null, null, this.color, e, null);
1444
+ }, t.prototype.rotateRight = function() {
1445
+ var e = this.copy(null, null, t.RED, this.left.right, null);
1446
+ return this.left.copy(null, null, this.color, null, e);
1447
+ }, t.prototype.colorFlip = function() {
1448
+ var t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);
1449
+ return this.copy(null, null, !this.color, t, e);
1450
+ },
1451
+ // For testing.
1452
+ t.prototype.checkMaxDepth = function() {
1453
+ var t = this.check();
1454
+ return Math.pow(2, t) <= this.size + 1;
1455
+ },
1456
+ // In a balanced RB tree, the black-depth (number of black nodes) from root to
1457
+ // leaves is equal on both sides. This function verifies that or asserts.
1458
+ t.prototype.check = function() {
1459
+ if (this.isRed() && this.left.isRed()) throw E();
1460
+ if (this.right.isRed()) throw E();
1461
+ var t = this.left.check();
1462
+ if (t !== this.right.check()) throw E();
1463
+ return t + (this.isRed() ? 0 : 1);
1464
+ }, t;
1465
+ }();
1466
+
1467
+ // end SortedMap
1468
+ // An iterator over an LLRBNode.
1469
+ // end LLRBNode
1470
+ // Empty node is shared between all LLRB trees.
1471
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1472
+ It.EMPTY = null, It.RED = !0, It.BLACK = !1,
1473
+ // end LLRBEmptyNode
1474
+ It.EMPTY = new (/** @class */ function() {
1475
+ function t() {
1476
+ this.size = 0;
1477
+ }
1478
+ return Object.defineProperty(t.prototype, "key", {
1479
+ get: function() {
1480
+ throw E();
1481
+ },
1482
+ enumerable: !1,
1483
+ configurable: !0
1484
+ }), Object.defineProperty(t.prototype, "value", {
1485
+ get: function() {
1486
+ throw E();
1487
+ },
1488
+ enumerable: !1,
1489
+ configurable: !0
1490
+ }), Object.defineProperty(t.prototype, "color", {
1491
+ get: function() {
1492
+ throw E();
1493
+ },
1494
+ enumerable: !1,
1495
+ configurable: !0
1496
+ }), Object.defineProperty(t.prototype, "left", {
1497
+ get: function() {
1498
+ throw E();
1499
+ },
1500
+ enumerable: !1,
1501
+ configurable: !0
1502
+ }), Object.defineProperty(t.prototype, "right", {
1503
+ get: function() {
1504
+ throw E();
1505
+ },
1506
+ enumerable: !1,
1507
+ configurable: !0
1508
+ }),
1509
+ // Returns a copy of the current node.
1510
+ t.prototype.copy = function(t, e, n, r, i) {
1511
+ return this;
1512
+ },
1513
+ // Returns a copy of the tree, with the specified key/value added.
1514
+ t.prototype.insert = function(t, e, n) {
1515
+ return new It(t, e);
1516
+ },
1517
+ // Returns a copy of the tree, with the specified key removed.
1518
+ t.prototype.remove = function(t, e) {
1519
+ return this;
1520
+ }, t.prototype.isEmpty = function() {
1521
+ return !0;
1522
+ }, t.prototype.inorderTraversal = function(t) {
1523
+ return !1;
1524
+ }, t.prototype.reverseTraversal = function(t) {
1525
+ return !1;
1526
+ }, t.prototype.minKey = function() {
1527
+ return null;
1528
+ }, t.prototype.maxKey = function() {
1529
+ return null;
1530
+ }, t.prototype.isRed = function() {
1531
+ return !1;
1532
+ },
1533
+ // For testing.
1534
+ t.prototype.checkMaxDepth = function() {
1535
+ return !0;
1536
+ }, t.prototype.check = function() {
1537
+ return 0;
1538
+ }, t;
1539
+ }());
1540
+
1541
+ /**
1542
+ * @license
1543
+ * Copyright 2017 Google LLC
1228
1544
  *
1229
1545
  * Licensed under the Apache License, Version 2.0 (the "License");
1230
1546
  * you may not use this file except in compliance with the License.
@@ -1239,28 +1555,134 @@ function St(t, e) {
1239
1555
  * limitations under the License.
1240
1556
  */
1241
1557
  /**
1242
- * Provides a set of fields that can be used to partially patch a document.
1243
- * FieldMask is used in conjunction with ObjectValue.
1244
- * Examples:
1245
- * foo - Overwrites foo entirely with the provided value. If foo is not
1246
- * present in the companion ObjectValue, the field is deleted.
1247
- * foo.bar - Overwrites only the field bar of the object foo.
1248
- * If foo is not an object, foo is replaced with an object
1249
- * containing foo
1250
- */ var Et = /** @class */ function() {
1558
+ * SortedSet is an immutable (copy-on-write) collection that holds elements
1559
+ * in order specified by the provided comparator.
1560
+ *
1561
+ * NOTE: if provided comparator returns 0 for two elements, we consider them to
1562
+ * be equal!
1563
+ */
1564
+ var At = /** @class */ function() {
1565
+ function t(t) {
1566
+ this.comparator = t, this.data = new St(this.comparator);
1567
+ }
1568
+ return t.prototype.has = function(t) {
1569
+ return null !== this.data.get(t);
1570
+ }, t.prototype.first = function() {
1571
+ return this.data.minKey();
1572
+ }, t.prototype.last = function() {
1573
+ return this.data.maxKey();
1574
+ }, Object.defineProperty(t.prototype, "size", {
1575
+ get: function() {
1576
+ return this.data.size;
1577
+ },
1578
+ enumerable: !1,
1579
+ configurable: !0
1580
+ }), t.prototype.indexOf = function(t) {
1581
+ return this.data.indexOf(t);
1582
+ },
1583
+ /** Iterates elements in order defined by "comparator" */ t.prototype.forEach = function(t) {
1584
+ this.data.inorderTraversal((function(e, n) {
1585
+ return t(e), !1;
1586
+ }));
1587
+ },
1588
+ /** Iterates over `elem`s such that: range[0] &lt;= elem &lt; range[1]. */ t.prototype.forEachInRange = function(t, e) {
1589
+ for (var n = this.data.getIteratorFrom(t[0]); n.hasNext(); ) {
1590
+ var r = n.getNext();
1591
+ if (this.comparator(r.key, t[1]) >= 0) return;
1592
+ e(r.key);
1593
+ }
1594
+ },
1595
+ /**
1596
+ * Iterates over `elem`s such that: start &lt;= elem until false is returned.
1597
+ */
1598
+ t.prototype.forEachWhile = function(t, e) {
1599
+ var n;
1600
+ for (n = void 0 !== e ? this.data.getIteratorFrom(e) : this.data.getIterator(); n.hasNext(); ) if (!t(n.getNext().key)) return;
1601
+ },
1602
+ /** Finds the least element greater than or equal to `elem`. */ t.prototype.firstAfterOrEqual = function(t) {
1603
+ var e = this.data.getIteratorFrom(t);
1604
+ return e.hasNext() ? e.getNext().key : null;
1605
+ }, t.prototype.getIterator = function() {
1606
+ return new Vt(this.data.getIterator());
1607
+ }, t.prototype.getIteratorFrom = function(t) {
1608
+ return new Vt(this.data.getIteratorFrom(t));
1609
+ },
1610
+ /** Inserts or updates an element */ t.prototype.add = function(t) {
1611
+ return this.copy(this.data.remove(t).insert(t, !0));
1612
+ },
1613
+ /** Deletes an element */ t.prototype.delete = function(t) {
1614
+ return this.has(t) ? this.copy(this.data.remove(t)) : this;
1615
+ }, t.prototype.isEmpty = function() {
1616
+ return this.data.isEmpty();
1617
+ }, t.prototype.unionWith = function(t) {
1618
+ var e = this;
1619
+ // Make sure `result` always refers to the larger one of the two sets.
1620
+ return e.size < t.size && (e = t, t = this), t.forEach((function(t) {
1621
+ e = e.add(t);
1622
+ })), e;
1623
+ }, t.prototype.isEqual = function(e) {
1624
+ if (!(e instanceof t)) return !1;
1625
+ if (this.size !== e.size) return !1;
1626
+ for (var n = this.data.getIterator(), r = e.data.getIterator(); n.hasNext(); ) {
1627
+ var i = n.getNext().key, o = r.getNext().key;
1628
+ if (0 !== this.comparator(i, o)) return !1;
1629
+ }
1630
+ return !0;
1631
+ }, t.prototype.toArray = function() {
1632
+ var t = [];
1633
+ return this.forEach((function(e) {
1634
+ t.push(e);
1635
+ })), t;
1636
+ }, t.prototype.toString = function() {
1637
+ var t = [];
1638
+ return this.forEach((function(e) {
1639
+ return t.push(e);
1640
+ })), "SortedSet(" + t.toString() + ")";
1641
+ }, t.prototype.copy = function(e) {
1642
+ var n = new t(this.comparator);
1643
+ return n.data = e, n;
1644
+ }, t;
1645
+ }(), Vt = /** @class */ function() {
1646
+ function t(t) {
1647
+ this.iter = t;
1648
+ }
1649
+ return t.prototype.getNext = function() {
1650
+ return this.iter.getNext().key;
1651
+ }, t.prototype.hasNext = function() {
1652
+ return this.iter.hasNext();
1653
+ }, t;
1654
+ }(), Dt = /** @class */ function() {
1251
1655
  function t(t) {
1252
1656
  this.fields = t,
1253
1657
  // TODO(dimond): validation of FieldMask
1254
1658
  // Sort the field mask to support `FieldMask.isEqual()` and assert below.
1255
- t.sort(et.comparator)
1256
- /**
1659
+ t.sort(et.comparator);
1660
+ }
1661
+ return t.empty = function() {
1662
+ return new t([]);
1663
+ },
1664
+ /**
1665
+ * Returns a new FieldMask object that is the result of adding all the given
1666
+ * fields paths to this field mask.
1667
+ */
1668
+ t.prototype.unionWith = function(e) {
1669
+ for (var n = new At(et.comparator), r = 0, i = this.fields; r < i.length; r++) {
1670
+ var o = i[r];
1671
+ n = n.add(o);
1672
+ }
1673
+ for (var a = 0, s = e; a < s.length; a++) {
1674
+ var u = s[a];
1675
+ n = n.add(u);
1676
+ }
1677
+ return new t(n.toArray());
1678
+ },
1679
+ /**
1257
1680
  * Verifies that `fieldPath` is included by at least one field in this field
1258
1681
  * mask.
1259
1682
  *
1260
1683
  * This is an O(n) operation, where `n` is the size of the field mask.
1261
- */;
1262
- }
1263
- return t.prototype.covers = function(t) {
1684
+ */
1685
+ t.prototype.covers = function(t) {
1264
1686
  for (var e = 0, n = this.fields; e < n.length; e++) {
1265
1687
  if (n[e].isPrefixOf(t)) return !0;
1266
1688
  }
@@ -1270,7 +1692,7 @@ function St(t, e) {
1270
1692
  return t.isEqual(e);
1271
1693
  }));
1272
1694
  }, t;
1273
- }(), It = /** @class */ function() {
1695
+ }(), Pt = /** @class */ function() {
1274
1696
  function t(t) {
1275
1697
  this.binaryString = t;
1276
1698
  }
@@ -1318,64 +1740,23 @@ function St(t, e) {
1318
1740
  }, t;
1319
1741
  }();
1320
1742
 
1321
- /**
1322
- * @license
1323
- * Copyright 2020 Google LLC
1324
- *
1325
- * Licensed under the Apache License, Version 2.0 (the "License");
1326
- * you may not use this file except in compliance with the License.
1327
- * You may obtain a copy of the License at
1328
- *
1329
- * http://www.apache.org/licenses/LICENSE-2.0
1330
- *
1331
- * Unless required by applicable law or agreed to in writing, software
1332
- * distributed under the License is distributed on an "AS IS" BASIS,
1333
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1334
- * See the License for the specific language governing permissions and
1335
- * limitations under the License.
1336
- */
1337
- /** Converts a Base64 encoded string to a binary string. */
1338
- /**
1339
- * @license
1340
- * Copyright 2020 Google LLC
1341
- *
1342
- * Licensed under the Apache License, Version 2.0 (the "License");
1343
- * you may not use this file except in compliance with the License.
1344
- * You may obtain a copy of the License at
1345
- *
1346
- * http://www.apache.org/licenses/LICENSE-2.0
1347
- *
1348
- * Unless required by applicable law or agreed to in writing, software
1349
- * distributed under the License is distributed on an "AS IS" BASIS,
1350
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1351
- * See the License for the specific language governing permissions and
1352
- * limitations under the License.
1353
- */
1354
- /**
1355
- * Immutable class that represents a "proto" byte string.
1356
- *
1357
- * Proto byte strings can either be Base64-encoded strings or Uint8Arrays when
1358
- * sent on the wire. This class abstracts away this differentiation by holding
1359
- * the proto byte string in a common class that must be converted into a string
1360
- * before being sent as a proto.
1361
- * @internal
1362
- */ It.EMPTY_BYTE_STRING = new It("");
1743
+ Pt.EMPTY_BYTE_STRING = new Pt("");
1363
1744
 
1364
- var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1745
+ var Nt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1365
1746
 
1366
1747
  /**
1367
1748
  * Converts the possible Proto values for a timestamp value into a "seconds and
1368
1749
  * nanos" representation.
1369
- */ function kt(t) {
1750
+ */ function Ft(t) {
1370
1751
  // The json interface (for the browser) will return an iso timestamp string,
1371
1752
  // while the proto js library (for node) will return a
1372
1753
  // google.protobuf.Timestamp instance.
1373
- if (E(!!t), "string" == typeof t) {
1754
+ if (S(!!t), "string" == typeof t) {
1374
1755
  // The date string can have higher precision (nanos) than the Date class
1375
1756
  // (millis), so we do some custom parsing here.
1376
1757
  // Parse the nanos right out of the string.
1377
- var e = 0, n = At.exec(t);
1378
- if (E(!!n), n[1]) {
1758
+ var e = 0, n = Nt.exec(t);
1759
+ if (S(!!n), n[1]) {
1379
1760
  // Pad the fraction out to 9 digits (nanos).
1380
1761
  var r = n[1];
1381
1762
  r = (r + "000000000").substr(0, 9), e = Number(r);
@@ -1388,21 +1769,21 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1388
1769
  };
1389
1770
  }
1390
1771
  return {
1391
- seconds: Vt(t.seconds),
1392
- nanos: Vt(t.nanos)
1772
+ seconds: Ot(t.seconds),
1773
+ nanos: Ot(t.nanos)
1393
1774
  };
1394
1775
  }
1395
1776
 
1396
1777
  /**
1397
1778
  * Converts the possible Proto types for numbers into a JavaScript number.
1398
1779
  * Returns 0 if the value is not numeric.
1399
- */ function Vt(t) {
1780
+ */ function Ot(t) {
1400
1781
  // TODO(bjornick): Handle int64 greater than 53 bits.
1401
1782
  return "number" == typeof t ? t : "string" == typeof t ? Number(t) : 0;
1402
1783
  }
1403
1784
 
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);
1785
+ /** Converts the possible Proto types for Blobs into a ByteString. */ function qt(t) {
1786
+ return "string" == typeof t ? Pt.fromBase64String(t) : Pt.fromUint8Array(t);
1406
1787
  }
1407
1788
 
1408
1789
  /**
@@ -1438,7 +1819,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1438
1819
  * FieldValueOptions to value().
1439
1820
  * - With respect to other ServerTimestampValues, they sort by their
1440
1821
  * localWriteTime.
1441
- */ function Pt(t) {
1822
+ */ function Rt(t) {
1442
1823
  var e, n;
1443
1824
  return "server_timestamp" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);
1444
1825
  }
@@ -1448,15 +1829,15 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1448
1829
  *
1449
1830
  * Preserving the previous values allows the user to display the last resoled
1450
1831
  * value until the backend responds with the timestamp.
1451
- */ function Nt(t) {
1832
+ */ function xt(t) {
1452
1833
  var e = t.mapValue.fields.__previous_value__;
1453
- return Pt(e) ? Nt(e) : e;
1834
+ return Rt(e) ? xt(e) : e;
1454
1835
  }
1455
1836
 
1456
1837
  /**
1457
1838
  * Returns the local time at which this timestamp was first set.
1458
- */ function qt(t) {
1459
- var e = kt(t.mapValue.fields.__local_write_time__.timestampValue);
1839
+ */ function Ct(t) {
1840
+ var e = Ft(t.mapValue.fields.__local_write_time__.timestampValue);
1460
1841
  return new bt(e.seconds, e.nanos);
1461
1842
  }
1462
1843
 
@@ -1475,19 +1856,26 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1475
1856
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1476
1857
  * See the License for the specific language governing permissions and
1477
1858
  * limitations under the License.
1478
- */
1479
- /** Extracts the backend's type order for the provided value. */ function Ft(t) {
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 */ :
1859
+ */ var Lt = {
1860
+ fields: {
1861
+ __type__: {
1862
+ stringValue: "__max__"
1863
+ }
1864
+ }
1865
+ };
1866
+
1867
+ /** Extracts the backend's type order for the provided value. */ function jt(t) {
1868
+ 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 ? Rt(t) ? 4 /* ServerTimestampValue */ :
1481
1869
  /** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */
1482
1870
  function(t) {
1483
1871
  return "__max__" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;
1484
- }(t) ? 9 /* ArrayValue */ : 10 /* ObjectValue */ : S();
1872
+ }(t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : E();
1485
1873
  }
1486
1874
 
1487
- /** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {
1875
+ /** Tests `left` and `right` for equality based on the backend semantics. */ function Mt(t, e) {
1488
1876
  if (t === e) return !0;
1489
- var n = Ft(t);
1490
- if (n !== Ft(e)) return !1;
1877
+ var n = jt(t);
1878
+ if (n !== jt(e)) return !1;
1491
1879
  switch (n) {
1492
1880
  case 0 /* NullValue */ :
1493
1881
  case 9007199254740991 /* MaxValue */ :
@@ -1497,14 +1885,14 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1497
1885
  return t.booleanValue === e.booleanValue;
1498
1886
 
1499
1887
  case 4 /* ServerTimestampValue */ :
1500
- return qt(t).isEqual(qt(e));
1888
+ return Ct(t).isEqual(Ct(e));
1501
1889
 
1502
1890
  case 3 /* TimestampValue */ :
1503
1891
  return function(t, e) {
1504
1892
  if ("string" == typeof t.timestampValue && "string" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length)
1505
1893
  // Use string equality for ISO 8601 timestamps
1506
1894
  return t.timestampValue === e.timestampValue;
1507
- var n = kt(t.timestampValue), r = kt(e.timestampValue);
1895
+ var n = Ft(t.timestampValue), r = Ft(e.timestampValue);
1508
1896
  return n.seconds === r.seconds && n.nanos === r.nanos;
1509
1897
  }(t, e);
1510
1898
 
@@ -1513,7 +1901,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1513
1901
 
1514
1902
  case 6 /* BlobValue */ :
1515
1903
  return function(t, e) {
1516
- return Dt(t.bytesValue).isEqual(Dt(e.bytesValue));
1904
+ return qt(t.bytesValue).isEqual(qt(e.bytesValue));
1517
1905
  }(t, e);
1518
1906
 
1519
1907
  case 7 /* RefValue */ :
@@ -1521,44 +1909,44 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1521
1909
 
1522
1910
  case 8 /* GeoPointValue */ :
1523
1911
  return function(t, e) {
1524
- return Vt(t.geoPointValue.latitude) === Vt(e.geoPointValue.latitude) && Vt(t.geoPointValue.longitude) === Vt(e.geoPointValue.longitude);
1912
+ return Ot(t.geoPointValue.latitude) === Ot(e.geoPointValue.latitude) && Ot(t.geoPointValue.longitude) === Ot(e.geoPointValue.longitude);
1525
1913
  }(t, e);
1526
1914
 
1527
1915
  case 2 /* NumberValue */ :
1528
1916
  return function(t, e) {
1529
- if ("integerValue" in t && "integerValue" in e) return Vt(t.integerValue) === Vt(e.integerValue);
1917
+ if ("integerValue" in t && "integerValue" in e) return Ot(t.integerValue) === Ot(e.integerValue);
1530
1918
  if ("doubleValue" in t && "doubleValue" in e) {
1531
- var n = Vt(t.doubleValue), r = Vt(e.doubleValue);
1919
+ var n = Ot(t.doubleValue), r = Ot(e.doubleValue);
1532
1920
  return n === r ? lt(n) === lt(r) : isNaN(n) && isNaN(r);
1533
1921
  }
1534
1922
  return !1;
1535
1923
  }(t, e);
1536
1924
 
1537
1925
  case 9 /* ArrayValue */ :
1538
- return wt(t.arrayValue.values || [], e.arrayValue.values || [], Ot);
1926
+ return wt(t.arrayValue.values || [], e.arrayValue.values || [], Mt);
1539
1927
 
1540
1928
  case 10 /* ObjectValue */ :
1541
1929
  return function(t, e) {
1542
1930
  var n = t.mapValue.fields || {}, r = e.mapValue.fields || {};
1543
1931
  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;
1932
+ for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !Mt(n[i], r[i]))) return !1;
1545
1933
  return !0;
1546
1934
  }(t, e);
1547
1935
 
1548
1936
  default:
1549
- return S();
1937
+ return E();
1550
1938
  }
1551
1939
  }
1552
1940
 
1553
- function Ct(t, e) {
1941
+ function Ut(t, e) {
1554
1942
  return void 0 !== (t.values || []).find((function(t) {
1555
- return Ot(t, e);
1943
+ return Mt(t, e);
1556
1944
  }));
1557
1945
  }
1558
1946
 
1559
- function Lt(t, e) {
1947
+ function Bt(t, e) {
1560
1948
  if (t === e) return 0;
1561
- var n = Ft(t), r = Ft(e);
1949
+ var n = jt(t), r = jt(e);
1562
1950
  if (n !== r) return gt(n, r);
1563
1951
  switch (n) {
1564
1952
  case 0 /* NullValue */ :
@@ -1570,24 +1958,24 @@ function Lt(t, e) {
1570
1958
 
1571
1959
  case 2 /* NumberValue */ :
1572
1960
  return function(t, e) {
1573
- var n = Vt(t.integerValue || t.doubleValue), r = Vt(e.integerValue || e.doubleValue);
1961
+ var n = Ot(t.integerValue || t.doubleValue), r = Ot(e.integerValue || e.doubleValue);
1574
1962
  return n < r ? -1 : n > r ? 1 : n === r ? 0 :
1575
1963
  // one or both are NaN.
1576
1964
  isNaN(n) ? isNaN(r) ? 0 : -1 : 1;
1577
1965
  }(t, e);
1578
1966
 
1579
1967
  case 3 /* TimestampValue */ :
1580
- return jt(t.timestampValue, e.timestampValue);
1968
+ return zt(t.timestampValue, e.timestampValue);
1581
1969
 
1582
1970
  case 4 /* ServerTimestampValue */ :
1583
- return jt(qt(t), qt(e));
1971
+ return zt(Ct(t), Ct(e));
1584
1972
 
1585
1973
  case 5 /* StringValue */ :
1586
1974
  return gt(t.stringValue, e.stringValue);
1587
1975
 
1588
1976
  case 6 /* BlobValue */ :
1589
1977
  return function(t, e) {
1590
- var n = Dt(t), r = Dt(e);
1978
+ var n = qt(t), r = qt(e);
1591
1979
  return n.compareTo(r);
1592
1980
  }(t.bytesValue, e.bytesValue);
1593
1981
 
@@ -1602,14 +1990,14 @@ function Lt(t, e) {
1602
1990
 
1603
1991
  case 8 /* GeoPointValue */ :
1604
1992
  return function(t, e) {
1605
- var n = gt(Vt(t.latitude), Vt(e.latitude));
1606
- return 0 !== n ? n : gt(Vt(t.longitude), Vt(e.longitude));
1993
+ var n = gt(Ot(t.latitude), Ot(e.latitude));
1994
+ return 0 !== n ? n : gt(Ot(t.longitude), Ot(e.longitude));
1607
1995
  }(t.geoPointValue, e.geoPointValue);
1608
1996
 
1609
1997
  case 9 /* ArrayValue */ :
1610
1998
  return function(t, e) {
1611
1999
  for (var n = t.values || [], r = e.values || [], i = 0; i < n.length && i < r.length; ++i) {
1612
- var o = Lt(n[i], r[i]);
2000
+ var o = Bt(n[i], r[i]);
1613
2001
  if (o) return o;
1614
2002
  }
1615
2003
  return gt(n.length, r.length);
@@ -1617,6 +2005,9 @@ function Lt(t, e) {
1617
2005
 
1618
2006
  case 10 /* ObjectValue */ :
1619
2007
  return function(t, e) {
2008
+ if (t === Lt && e === Lt) return 0;
2009
+ if (t === Lt) return 1;
2010
+ if (e === Lt) return -1;
1620
2011
  var n = t.fields || {}, r = Object.keys(n), i = e.fields || {}, o = Object.keys(i);
1621
2012
  // Even though MapValues are likely sorted correctly based on their insertion
1622
2013
  // order (e.g. when received from the backend), local modifications can bring
@@ -1626,46 +2017,46 @@ function Lt(t, e) {
1626
2017
  for (var a = 0; a < r.length && a < o.length; ++a) {
1627
2018
  var s = gt(r[a], o[a]);
1628
2019
  if (0 !== s) return s;
1629
- var u = Lt(n[r[a]], i[o[a]]);
2020
+ var u = Bt(n[r[a]], i[o[a]]);
1630
2021
  if (0 !== u) return u;
1631
2022
  }
1632
2023
  return gt(r.length, o.length);
1633
2024
  }(t.mapValue, e.mapValue);
1634
2025
 
1635
2026
  default:
1636
- throw S();
2027
+ throw E();
1637
2028
  }
1638
2029
  }
1639
2030
 
1640
- function jt(t, e) {
2031
+ function zt(t, e) {
1641
2032
  if ("string" == typeof t && "string" == typeof e && t.length === e.length) return gt(t, e);
1642
- var n = kt(t), r = kt(e), i = gt(n.seconds, r.seconds);
2033
+ var n = Ft(t), r = Ft(e), i = gt(n.seconds, r.seconds);
1643
2034
  return 0 !== i ? i : gt(n.nanos, r.nanos);
1644
2035
  }
1645
2036
 
1646
- function Rt(t, e) {
2037
+ function Gt(t, e) {
1647
2038
  return {
1648
2039
  referenceValue: "projects/" + t.projectId + "/databases/" + t.database + "/documents/" + e.path.canonicalString()
1649
2040
  };
1650
2041
  }
1651
2042
 
1652
- /** Returns true if `value` is an ArrayValue. */ function Mt(t) {
2043
+ /** Returns true if `value` is an ArrayValue. */ function Kt(t) {
1653
2044
  return !!t && "arrayValue" in t;
1654
2045
  }
1655
2046
 
1656
- /** Returns true if `value` is a NullValue. */ function xt(t) {
2047
+ /** Returns true if `value` is a NullValue. */ function Qt(t) {
1657
2048
  return !!t && "nullValue" in t;
1658
2049
  }
1659
2050
 
1660
- /** Returns true if `value` is NaN. */ function Ut(t) {
2051
+ /** Returns true if `value` is NaN. */ function Wt(t) {
1661
2052
  return !!t && "doubleValue" in t && isNaN(Number(t.doubleValue));
1662
2053
  }
1663
2054
 
1664
- /** Returns true if `value` is a MapValue. */ function Bt(t) {
2055
+ /** Returns true if `value` is a MapValue. */ function Ht(t) {
1665
2056
  return !!t && "mapValue" in t;
1666
2057
  }
1667
2058
 
1668
- /** Creates a deep copy of `source`. */ function Gt(t) {
2059
+ /** Creates a deep copy of `source`. */ function Yt(t) {
1669
2060
  if (t.geoPointValue) return {
1670
2061
  geoPointValue: Object.assign({}, t.geoPointValue)
1671
2062
  };
@@ -1678,8 +2069,8 @@ function Rt(t, e) {
1678
2069
  fields: {}
1679
2070
  }
1680
2071
  };
1681
- return St(t.mapValue.fields, (function(t, n) {
1682
- return e.mapValue.fields[t] = Gt(n);
2072
+ return Et(t.mapValue.fields, (function(t, n) {
2073
+ return e.mapValue.fields[t] = Yt(n);
1683
2074
  })), e;
1684
2075
  }
1685
2076
  if (t.arrayValue) {
@@ -1687,13 +2078,13 @@ function Rt(t, e) {
1687
2078
  arrayValue: {
1688
2079
  values: []
1689
2080
  }
1690
- }, r = 0; r < (t.arrayValue.values || []).length; ++r) n.arrayValue.values[r] = Gt(t.arrayValue.values[r]);
2081
+ }, r = 0; r < (t.arrayValue.values || []).length; ++r) n.arrayValue.values[r] = Yt(t.arrayValue.values[r]);
1691
2082
  return n;
1692
2083
  }
1693
2084
  return Object.assign({}, t);
1694
2085
  }
1695
2086
 
1696
- var zt = /** @class */ function() {
2087
+ var $t = /** @class */ function() {
1697
2088
  function t(t) {
1698
2089
  this.value = t;
1699
2090
  }
@@ -1710,7 +2101,7 @@ var zt = /** @class */ function() {
1710
2101
  */
1711
2102
  t.prototype.field = function(t) {
1712
2103
  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;
2104
+ for (var e = this.value, n = 0; n < t.length - 1; ++n) if (!Ht(e = (e.mapValue.fields || {})[t.get(n)])) return null;
1714
2105
  return (e = (e.mapValue.fields || {})[t.lastSegment()]) || null;
1715
2106
  },
1716
2107
  /**
@@ -1720,7 +2111,7 @@ var zt = /** @class */ function() {
1720
2111
  * @param value - The value to set.
1721
2112
  */
1722
2113
  t.prototype.set = function(t, e) {
1723
- this.getFieldsMap(t.popLast())[t.lastSegment()] = Gt(e);
2114
+ this.getFieldsMap(t.popLast())[t.lastSegment()] = Yt(e);
1724
2115
  },
1725
2116
  /**
1726
2117
  * Sets the provided fields to the provided values.
@@ -1735,7 +2126,7 @@ var zt = /** @class */ function() {
1735
2126
  var a = e.getFieldsMap(n);
1736
2127
  e.applyChanges(a, r, i), r = {}, i = [], n = o.popLast();
1737
2128
  }
1738
- t ? r[o.lastSegment()] = Gt(t) : i.push(o.lastSegment());
2129
+ t ? r[o.lastSegment()] = Yt(t) : i.push(o.lastSegment());
1739
2130
  }));
1740
2131
  var o = this.getFieldsMap(n);
1741
2132
  this.applyChanges(o, r, i);
@@ -1748,9 +2139,9 @@ var zt = /** @class */ function() {
1748
2139
  */
1749
2140
  t.prototype.delete = function(t) {
1750
2141
  var e = this.field(t.popLast());
1751
- Bt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];
2142
+ Ht(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];
1752
2143
  }, t.prototype.isEqual = function(t) {
1753
- return Ot(this.value, t.value);
2144
+ return Mt(this.value, t.value);
1754
2145
  },
1755
2146
  /**
1756
2147
  * Returns the map that contains the leaf element of `path`. If the parent
@@ -1763,7 +2154,7 @@ var zt = /** @class */ function() {
1763
2154
  });
1764
2155
  for (var n = 0; n < t.length; ++n) {
1765
2156
  var r = e.mapValue.fields[t.get(n)];
1766
- Bt(r) && r.mapValue.fields || (r = {
2157
+ Ht(r) && r.mapValue.fields || (r = {
1767
2158
  mapValue: {
1768
2159
  fields: {}
1769
2160
  }
@@ -1776,7 +2167,7 @@ var zt = /** @class */ function() {
1776
2167
  * entries.
1777
2168
  */
1778
2169
  t.prototype.applyChanges = function(t, e, n) {
1779
- St(e, (function(e, n) {
2170
+ Et(e, (function(e, n) {
1780
2171
  return t[e] = n;
1781
2172
  }));
1782
2173
  for (var r = 0, i = n; r < i.length; r++) {
@@ -1784,9 +2175,9 @@ var zt = /** @class */ function() {
1784
2175
  delete t[o];
1785
2176
  }
1786
2177
  }, t.prototype.clone = function() {
1787
- return new t(Gt(this.value));
2178
+ return new t(Yt(this.value));
1788
2179
  }, t;
1789
- }(), Qt = /** @class */ function() {
2180
+ }(), Xt = /** @class */ function() {
1790
2181
  function t(t, e, n, r, i, o) {
1791
2182
  this.key = t, this.documentType = e, this.version = n, this.readTime = r, this.data = i,
1792
2183
  this.documentState = o
@@ -1796,7 +2187,7 @@ var zt = /** @class */ function() {
1796
2187
  */;
1797
2188
  }
1798
2189
  return t.newInvalidDocument = function(e) {
1799
- return new t(e, 0 /* INVALID */ , _t.min(), _t.min(), zt.empty(), 0 /* SYNCED */);
2190
+ return new t(e, 0 /* INVALID */ , _t.min(), _t.min(), $t.empty(), 0 /* SYNCED */);
1800
2191
  },
1801
2192
  /**
1802
2193
  * Creates a new document that is known to exist with the given data at the
@@ -1806,7 +2197,7 @@ var zt = /** @class */ function() {
1806
2197
  return new t(e, 1 /* FOUND_DOCUMENT */ , n, _t.min(), r, 0 /* SYNCED */);
1807
2198
  },
1808
2199
  /** 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 */);
2200
+ return new t(e, 2 /* NO_DOCUMENT */ , n, _t.min(), $t.empty(), 0 /* SYNCED */);
1810
2201
  },
1811
2202
  /**
1812
2203
  * Creates a new document that is known to exist at the given version but
@@ -1814,7 +2205,7 @@ var zt = /** @class */ function() {
1814
2205
  * base document).
1815
2206
  */
1816
2207
  t.newUnknownDocument = function(e, n) {
1817
- return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, _t.min(), zt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
2208
+ return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, _t.min(), $t.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
1818
2209
  },
1819
2210
  /**
1820
2211
  * Changes the document type to indicate that it exists and that its version
@@ -1829,7 +2220,7 @@ var zt = /** @class */ function() {
1829
2220
  * version.
1830
2221
  */
1831
2222
  t.prototype.convertToNoDocument = function(t) {
1832
- return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = zt.empty(),
2223
+ return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = $t.empty(),
1833
2224
  this.documentState = 0 /* SYNCED */ , this;
1834
2225
  },
1835
2226
  /**
@@ -1838,12 +2229,13 @@ var zt = /** @class */ function() {
1838
2229
  * base document).
1839
2230
  */
1840
2231
  t.prototype.convertToUnknownDocument = function(t) {
1841
- return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = zt.empty(),
2232
+ return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = $t.empty(),
1842
2233
  this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
1843
2234
  }, t.prototype.setHasCommittedMutations = function() {
1844
2235
  return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
1845
2236
  }, t.prototype.setHasLocalMutations = function() {
1846
- return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;
2237
+ return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this.version = _t.min(),
2238
+ this;
1847
2239
  }, t.prototype.setReadTime = function(t) {
1848
2240
  return this.readTime = t, this;
1849
2241
  }, Object.defineProperty(t.prototype, "hasLocalMutations", {
@@ -1879,7 +2271,7 @@ var zt = /** @class */ function() {
1879
2271
  }, t.prototype.toString = function() {
1880
2272
  return "Document(" + this.key + ", " + this.version + ", " + JSON.stringify(this.data.value) + ", {documentType: " + this.documentType + "}), {documentState: " + this.documentState + "})";
1881
2273
  }, t;
1882
- }(), Kt = function(t, e, n, r, i, o, a) {
2274
+ }(), Jt = function(t, e, n, r, i, o, a) {
1883
2275
  void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
1884
2276
  void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null),
1885
2277
  this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = r, this.limit = i,
@@ -1920,13 +2312,13 @@ var zt = /** @class */ function() {
1920
2312
  * using this factory method, because `Query` provides an implicit `orderBy`
1921
2313
  * property.
1922
2314
  */
1923
- function Ht(t, e, n, r, i, o, a) {
2315
+ function Zt(t, e, n, r, i, o, a) {
1924
2316
  return void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
1925
2317
  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);
2318
+ new Jt(t, e, n, r, i, o, a);
1927
2319
  }
1928
2320
 
1929
- var Wt = /** @class */ function(e) {
2321
+ var te = /** @class */ function(e) {
1930
2322
  function n(t, n, r) {
1931
2323
  var i = this;
1932
2324
  return (i = e.call(this) || this).field = t, i.op = n, i.value = r, i;
@@ -1934,15 +2326,15 @@ var Wt = /** @class */ function(e) {
1934
2326
  /**
1935
2327
  * Creates a filter based on the provided arguments.
1936
2328
  */ 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);
2329
+ return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.V(t, e, r) : new ee(t, e, r) : "array-contains" /* ARRAY_CONTAINS */ === e ? new oe(t, r) : "in" /* IN */ === e ? new ae(t, r) : "not-in" /* NOT_IN */ === e ? new se(t, r) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new ue(t, r) : new n(t, e, r);
1938
2330
  }, n.V = function(t, e, n) {
1939
- return "in" /* IN */ === e ? new $t(t, n) : new Xt(t, n);
2331
+ return "in" /* IN */ === e ? new ne(t, n) : new re(t, n);
1940
2332
  }, n.prototype.matches = function(t) {
1941
2333
  var e = t.data.field(this.field);
1942
2334
  // 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));
2335
+ return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.N(Bt(e, this.value)) : null !== e && jt(this.value) === jt(e) && this.N(Bt(e, this.value));
1944
2336
  // Only compare types with matching backend order (such as double and int).
1945
- }, n.prototype.D = function(t) {
2337
+ }, n.prototype.N = function(t) {
1946
2338
  switch (this.op) {
1947
2339
  case "<" /* LESS_THAN */ :
1948
2340
  return t < 0;
@@ -1963,12 +2355,12 @@ var Wt = /** @class */ function(e) {
1963
2355
  return t >= 0;
1964
2356
 
1965
2357
  default:
1966
- return S();
2358
+ return E();
1967
2359
  }
1968
- }, n.prototype.N = function() {
2360
+ }, n.prototype.D = function() {
1969
2361
  return [ "<" /* LESS_THAN */ , "<=" /* LESS_THAN_OR_EQUAL */ , ">" /* GREATER_THAN */ , ">=" /* GREATER_THAN_OR_EQUAL */ , "!=" /* NOT_EQUAL */ , "not-in" /* NOT_IN */ ].indexOf(this.op) >= 0;
1970
2362
  }, n;
1971
- }((function() {})), Yt = /** @class */ function(e) {
2363
+ }((function() {})), ee = /** @class */ function(e) {
1972
2364
  function n(t, n, r) {
1973
2365
  var i = this;
1974
2366
  return (i = e.call(this, t, n, r) || this).key = nt.fromName(r.referenceValue),
@@ -1976,12 +2368,12 @@ var Wt = /** @class */ function(e) {
1976
2368
  }
1977
2369
  return t(n, e), n.prototype.matches = function(t) {
1978
2370
  var e = nt.comparator(t.key, this.key);
1979
- return this.D(e);
2371
+ return this.N(e);
1980
2372
  }, n;
1981
- }(Wt), $t = /** @class */ function(e) {
2373
+ }(te), ne = /** @class */ function(e) {
1982
2374
  function n(t, n) {
1983
2375
  var r = this;
1984
- return (r = e.call(this, t, "in" /* IN */ , n) || this).keys = Jt("in" /* IN */ , n),
2376
+ return (r = e.call(this, t, "in" /* IN */ , n) || this).keys = ie("in" /* IN */ , n),
1985
2377
  r;
1986
2378
  }
1987
2379
  return t(n, e), n.prototype.matches = function(t) {
@@ -1989,10 +2381,10 @@ var Wt = /** @class */ function(e) {
1989
2381
  return e.isEqual(t.key);
1990
2382
  }));
1991
2383
  }, n;
1992
- }(Wt), Xt = /** @class */ function(e) {
2384
+ }(te), re = /** @class */ function(e) {
1993
2385
  function n(t, n) {
1994
2386
  var r = this;
1995
- return (r = e.call(this, t, "not-in" /* NOT_IN */ , n) || this).keys = Jt("not-in" /* NOT_IN */ , n),
2387
+ return (r = e.call(this, t, "not-in" /* NOT_IN */ , n) || this).keys = ie("not-in" /* NOT_IN */ , n),
1996
2388
  r;
1997
2389
  }
1998
2390
  return t(n, e), n.prototype.matches = function(t) {
@@ -2000,67 +2392,67 @@ var Wt = /** @class */ function(e) {
2000
2392
  return e.isEqual(t.key);
2001
2393
  }));
2002
2394
  }, n;
2003
- }(Wt);
2395
+ }(te);
2004
2396
 
2005
- /** Filter that matches on key fields (i.e. '__name__'). */ function Jt(t, e) {
2397
+ /** Filter that matches on key fields (i.e. '__name__'). */ function ie(t, e) {
2006
2398
  var n;
2007
2399
  return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((function(t) {
2008
2400
  return nt.fromName(t.referenceValue);
2009
2401
  }));
2010
2402
  }
2011
2403
 
2012
- /** A Filter that implements the array-contains operator. */ var Zt = /** @class */ function(e) {
2404
+ /** A Filter that implements the array-contains operator. */ var oe = /** @class */ function(e) {
2013
2405
  function n(t, n) {
2014
2406
  return e.call(this, t, "array-contains" /* ARRAY_CONTAINS */ , n) || this;
2015
2407
  }
2016
2408
  return t(n, e), n.prototype.matches = function(t) {
2017
2409
  var e = t.data.field(this.field);
2018
- return Mt(e) && Ct(e.arrayValue, this.value);
2410
+ return Kt(e) && Ut(e.arrayValue, this.value);
2019
2411
  }, n;
2020
- }(Wt), te = /** @class */ function(e) {
2412
+ }(te), ae = /** @class */ function(e) {
2021
2413
  function n(t, n) {
2022
2414
  return e.call(this, t, "in" /* IN */ , n) || this;
2023
2415
  }
2024
2416
  return t(n, e), n.prototype.matches = function(t) {
2025
2417
  var e = t.data.field(this.field);
2026
- return null !== e && Ct(this.value.arrayValue, e);
2418
+ return null !== e && Ut(this.value.arrayValue, e);
2027
2419
  }, n;
2028
- }(Wt), ee = /** @class */ function(e) {
2420
+ }(te), se = /** @class */ function(e) {
2029
2421
  function n(t, n) {
2030
2422
  return e.call(this, t, "not-in" /* NOT_IN */ , n) || this;
2031
2423
  }
2032
2424
  return t(n, e), n.prototype.matches = function(t) {
2033
- if (Ct(this.value.arrayValue, {
2425
+ if (Ut(this.value.arrayValue, {
2034
2426
  nullValue: "NULL_VALUE"
2035
2427
  })) return !1;
2036
2428
  var e = t.data.field(this.field);
2037
- return null !== e && !Ct(this.value.arrayValue, e);
2429
+ return null !== e && !Ut(this.value.arrayValue, e);
2038
2430
  }, n;
2039
- }(Wt), ne = /** @class */ function(e) {
2431
+ }(te), ue = /** @class */ function(e) {
2040
2432
  function n(t, n) {
2041
2433
  return e.call(this, t, "array-contains-any" /* ARRAY_CONTAINS_ANY */ , n) || this;
2042
2434
  }
2043
2435
  return t(n, e), n.prototype.matches = function(t) {
2044
2436
  var e = this, n = t.data.field(this.field);
2045
- return !(!Mt(n) || !n.arrayValue.values) && n.arrayValue.values.some((function(t) {
2046
- return Ct(e.value.arrayValue, t);
2437
+ return !(!Kt(n) || !n.arrayValue.values) && n.arrayValue.values.some((function(t) {
2438
+ return Ut(e.value.arrayValue, t);
2047
2439
  }));
2048
2440
  }, n;
2049
- }(Wt), re = function(t, e) {
2441
+ }(te), ce = function(t, e) {
2050
2442
  this.position = t, this.inclusive = e;
2051
- }, ie = function(t, e /* ASCENDING */) {
2443
+ }, le = function(t, e /* ASCENDING */) {
2052
2444
  void 0 === e && (e = "asc"), this.field = t, this.dir = e;
2053
2445
  };
2054
2446
 
2055
- /** A Filter that implements the IN operator. */ function oe(t, e) {
2447
+ /** A Filter that implements the IN operator. */ function fe(t, e) {
2056
2448
  return t.dir === e.dir && t.field.isEqual(e.field);
2057
2449
  }
2058
2450
 
2059
- function ae(t, e) {
2451
+ function he(t, e) {
2060
2452
  if (null === t) return null === e;
2061
2453
  if (null === e) return !1;
2062
2454
  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;
2455
+ for (var n = 0; n < t.position.length; n++) if (!Mt(t.position[n], e.position[n])) return !1;
2064
2456
  return !0;
2065
2457
  }
2066
2458
 
@@ -2086,7 +2478,7 @@ function ae(t, e) {
2086
2478
  * query the RemoteStore results.
2087
2479
  *
2088
2480
  * Visible for testing.
2089
- */ var se =
2481
+ */ var pe =
2090
2482
  /**
2091
2483
  * Initializes a Query with a path and optional additional query constraints.
2092
2484
  * Path must currently be empty if this is a collection group query.
@@ -2098,21 +2490,17 @@ function(t, e, n, r, i, o /* First */ , a, s) {
2098
2490
  this.filters = r, this.limit = i, this.limitType = o, this.startAt = a, this.endAt = s,
2099
2491
  this.$ = null,
2100
2492
  // The corresponding `Target` of this `Query` instance.
2101
- this.S = null, this.startAt, this.endAt;
2493
+ this.F = null, this.startAt, this.endAt;
2102
2494
  };
2103
2495
 
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) {
2496
+ /** Creates a new Query for a query that matches all documents at `path` */ function de(t) {
2109
2497
  return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;
2110
2498
  }
2111
2499
 
2112
- function le(t) {
2500
+ function ye(t) {
2113
2501
  for (var e = 0, n = t.filters; e < n.length; e++) {
2114
2502
  var r = n[e];
2115
- if (r.N()) return r.field;
2503
+ if (r.D()) return r.field;
2116
2504
  }
2117
2505
  return null;
2118
2506
  }
@@ -2124,7 +2512,7 @@ function le(t) {
2124
2512
  /**
2125
2513
  * Returns whether the query matches a collection group rather than a specific
2126
2514
  * collection.
2127
- */ function fe(t) {
2515
+ */ function me(t) {
2128
2516
  return null !== t.collectionGroup;
2129
2517
  }
2130
2518
 
@@ -2132,16 +2520,16 @@ function le(t) {
2132
2520
  * Returns the implicit order by constraint that is used to execute the Query,
2133
2521
  * which can be different from the order by constraints the user provided (e.g.
2134
2522
  * the SDK and backend always orders by `__name__`).
2135
- */ function he(t) {
2136
- var e = I(t);
2523
+ */ function ve(t) {
2524
+ var e = k(t);
2137
2525
  if (null === e.$) {
2138
2526
  e.$ = [];
2139
- var n = le(e), r = ce(e);
2527
+ var n = ye(e), r = de(e);
2140
2528
  if (null !== n && null === r)
2141
2529
  // In order to implicitly add key ordering, we must also add the
2142
2530
  // inequality filter field for it to be a valid query.
2143
2531
  // 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 {
2532
+ n.isKeyField() || e.$.push(new le(n)), e.$.push(new le(et.keyField(), "asc" /* ASCENDING */)); else {
2145
2533
  for (var i = !1, o = 0, a = e.explicitOrderBy; o < a.length; o++) {
2146
2534
  var s = a[o];
2147
2535
  e.$.push(s), s.field.isKeyField() && (i = !0);
@@ -2150,7 +2538,7 @@ function le(t) {
2150
2538
  // The order of the implicit key ordering always matches the last
2151
2539
  // explicit order by
2152
2540
  var u = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : "asc" /* ASCENDING */;
2153
- e.$.push(new ie(et.keyField(), u));
2541
+ e.$.push(new le(et.keyField(), u));
2154
2542
  }
2155
2543
  }
2156
2544
  }
@@ -2159,21 +2547,21 @@ function le(t) {
2159
2547
 
2160
2548
  /**
2161
2549
  * Converts this `Query` instance to it's corresponding `Target` representation.
2162
- */ 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 {
2550
+ */ function ge(t) {
2551
+ var e = k(t);
2552
+ if (!e.F) if ("F" /* First */ === e.limitType) e.F = Zt(e.path, e.collectionGroup, ve(e), e.filters, e.limit, e.startAt, e.endAt); else {
2165
2553
  for (
2166
2554
  // Flip the orderBy directions since we want the last results
2167
- var n = [], r = 0, i = he(e); r < i.length; r++) {
2555
+ var n = [], r = 0, i = ve(e); r < i.length; r++) {
2168
2556
  var o = i[r], a = "desc" /* DESCENDING */ === o.dir ? "asc" /* ASCENDING */ : "desc" /* DESCENDING */;
2169
- n.push(new ie(o.field, a));
2557
+ n.push(new le(o.field, a));
2170
2558
  }
2171
2559
  // 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;
2560
+ var s = e.endAt ? new ce(e.endAt.position, e.endAt.inclusive) : null, u = e.startAt ? new ce(e.startAt.position, e.startAt.inclusive) : null;
2173
2561
  // Now return as a LimitType.First query.
2174
- e.S = Ht(e.path, e.collectionGroup, n, e.filters, e.limit, s, u);
2562
+ e.F = Zt(e.path, e.collectionGroup, n, e.filters, e.limit, s, u);
2175
2563
  }
2176
- return e.S;
2564
+ return e.F;
2177
2565
  }
2178
2566
 
2179
2567
  /**
@@ -2201,7 +2589,7 @@ function le(t) {
2201
2589
  * The return value is an IntegerValue if it can safely represent the value,
2202
2590
  * otherwise a DoubleValue is returned.
2203
2591
  */
2204
- function de(t, e) {
2592
+ function we(t, e) {
2205
2593
  return function(t) {
2206
2594
  return "number" == typeof t && Number.isInteger(t) && !lt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
2207
2595
  }(e) ?
@@ -2213,7 +2601,7 @@ function de(t, e) {
2213
2601
  integerValue: "" + t
2214
2602
  };
2215
2603
  }(e) : function(t, e) {
2216
- if (t.F) {
2604
+ if (t.S) {
2217
2605
  if (isNaN(e)) return {
2218
2606
  doubleValue: "NaN"
2219
2607
  };
@@ -2246,36 +2634,36 @@ function de(t, e) {
2246
2634
  * See the License for the specific language governing permissions and
2247
2635
  * limitations under the License.
2248
2636
  */
2249
- /** Used to represent a field transform on a mutation. */ var me = function() {
2637
+ /** Used to represent a field transform on a mutation. */ var be = function() {
2250
2638
  // Make sure that the structural type of `TransformOperation` is unique.
2251
2639
  // See https://github.com/microsoft/TypeScript/issues/5451
2252
2640
  this._ = void 0;
2253
- }, ye = /** @class */ function(e) {
2641
+ }, _e = /** @class */ function(e) {
2254
2642
  function n() {
2255
2643
  return null !== e && e.apply(this, arguments) || this;
2256
2644
  }
2257
2645
  return t(n, e), n;
2258
- }(me), ve = /** @class */ function(e) {
2646
+ }(be), Te = /** @class */ function(e) {
2259
2647
  function n(t) {
2260
2648
  var n = this;
2261
2649
  return (n = e.call(this) || this).elements = t, n;
2262
2650
  }
2263
2651
  return t(n, e), n;
2264
- }(me), ge = /** @class */ function(e) {
2652
+ }(be), Ee = /** @class */ function(e) {
2265
2653
  function n(t) {
2266
2654
  var n = this;
2267
2655
  return (n = e.call(this) || this).elements = t, n;
2268
2656
  }
2269
2657
  return t(n, e), n;
2270
- }(me), we = /** @class */ function(e) {
2658
+ }(be), Se = /** @class */ function(e) {
2271
2659
  function n(t, n) {
2272
2660
  var r = this;
2273
2661
  return (r = e.call(this) || this).q = t, r.O = n, r;
2274
2662
  }
2275
2663
  return t(n, e), n;
2276
- }(me), be = function(t, e) {
2664
+ }(be), ke = function(t, e) {
2277
2665
  this.field = t, this.transform = e;
2278
- }, _e = /** @class */ function() {
2666
+ }, Ie = /** @class */ function() {
2279
2667
  function t(t, e) {
2280
2668
  this.updateTime = t, this.exists = e
2281
2669
  /** Creates a new empty Precondition. */;
@@ -2297,40 +2685,48 @@ function de(t, e) {
2297
2685
  }), t.prototype.isEqual = function(t) {
2298
2686
  return this.exists === t.exists && (this.updateTime ? !!t.updateTime && this.updateTime.isEqual(t.updateTime) : !t.updateTime);
2299
2687
  }, t;
2300
- }(), Te = function() {}, Se = /** @class */ function(e) {
2688
+ }(), Ae = function() {}, Ve = /** @class */ function(e) {
2301
2689
  function n(t, n, r, i) {
2302
2690
  void 0 === i && (i = []);
2303
2691
  var o = this;
2304
2692
  return (o = e.call(this) || this).key = t, o.value = n, o.precondition = r, o.fieldTransforms = i,
2305
2693
  o.type = 0 /* Set */ , o;
2306
2694
  }
2307
- return t(n, e), n;
2308
- }(Te), Ee = /** @class */ function(e) {
2695
+ return t(n, e), n.prototype.getFieldMask = function() {
2696
+ return null;
2697
+ }, n;
2698
+ }(Ae), De = /** @class */ function(e) {
2309
2699
  function n(t, n, r, i, o) {
2310
2700
  void 0 === o && (o = []);
2311
2701
  var a = this;
2312
2702
  return (a = e.call(this) || this).key = t, a.data = n, a.fieldMask = r, a.precondition = i,
2313
2703
  a.fieldTransforms = o, a.type = 1 /* Patch */ , a;
2314
2704
  }
2315
- return t(n, e), n;
2316
- }(Te), Ie = /** @class */ function(e) {
2705
+ return t(n, e), n.prototype.getFieldMask = function() {
2706
+ return this.fieldMask;
2707
+ }, n;
2708
+ }(Ae), Pe = /** @class */ function(e) {
2317
2709
  function n(t, n) {
2318
2710
  var r = this;
2319
2711
  return (r = e.call(this) || this).key = t, r.precondition = n, r.type = 2 /* Delete */ ,
2320
2712
  r.fieldTransforms = [], r;
2321
2713
  }
2322
- return t(n, e), n;
2323
- }(Te), Ae = /** @class */ function(e) {
2714
+ return t(n, e), n.prototype.getFieldMask = function() {
2715
+ return null;
2716
+ }, n;
2717
+ }(Ae), Ne = /** @class */ function(e) {
2324
2718
  function n(t, n) {
2325
2719
  var r = this;
2326
2720
  return (r = e.call(this) || this).key = t, r.precondition = n, r.type = 3 /* Verify */ ,
2327
2721
  r.fieldTransforms = [], r;
2328
2722
  }
2329
- return t(n, e), n;
2330
- }(Te), ke = {
2723
+ return t(n, e), n.prototype.getFieldMask = function() {
2724
+ return null;
2725
+ }, n;
2726
+ }(Ae), Fe = {
2331
2727
  asc: "ASCENDING",
2332
2728
  desc: "DESCENDING"
2333
- }, Ve = {
2729
+ }, Oe = {
2334
2730
  "<": "LESS_THAN",
2335
2731
  "<=": "LESS_THAN_OR_EQUAL",
2336
2732
  ">": "GREATER_THAN",
@@ -2341,8 +2737,8 @@ function de(t, e) {
2341
2737
  in: "IN",
2342
2738
  "not-in": "NOT_IN",
2343
2739
  "array-contains-any": "ARRAY_CONTAINS_ANY"
2344
- }, De = function(t, e) {
2345
- this.databaseId = t, this.F = e;
2740
+ }, qe = function(t, e) {
2741
+ this.databaseId = t, this.S = e;
2346
2742
  };
2347
2743
 
2348
2744
  /** Transforms a value into a server-generated timestamp. */
@@ -2357,8 +2753,8 @@ function de(t, e) {
2357
2753
  /**
2358
2754
  * Returns a value for a Date that's appropriate to put into a proto.
2359
2755
  */
2360
- function Pe(t, e) {
2361
- return t.F ? new Date(1e3 * e.seconds).toISOString().replace(/\.\d*/, "").replace("Z", "") + "." + ("000000000" + e.nanoseconds).slice(-9) + "Z" : {
2756
+ function Re(t, e) {
2757
+ return t.S ? new Date(1e3 * e.seconds).toISOString().replace(/\.\d*/, "").replace("Z", "") + "." + ("000000000" + e.nanoseconds).slice(-9) + "Z" : {
2362
2758
  seconds: "" + e.seconds,
2363
2759
  nanos: e.nanoseconds
2364
2760
  };
@@ -2368,72 +2764,72 @@ function Pe(t, e) {
2368
2764
  * Returns a value for bytes that's appropriate to put in a proto.
2369
2765
  *
2370
2766
  * Visible for testing.
2371
- */ function Ne(t, e) {
2372
- return t.F ? e.toBase64() : e.toUint8Array();
2767
+ */ function xe(t, e) {
2768
+ return t.S ? e.toBase64() : e.toUint8Array();
2373
2769
  }
2374
2770
 
2375
- function qe(t, e) {
2376
- return Pe(t, e.toTimestamp());
2771
+ function Ce(t, e) {
2772
+ return Re(t, e.toTimestamp());
2377
2773
  }
2378
2774
 
2379
- function Fe(t) {
2380
- return E(!!t), _t.fromTimestamp(function(t) {
2381
- var e = kt(t);
2775
+ function Le(t) {
2776
+ return S(!!t), _t.fromTimestamp(function(t) {
2777
+ var e = Ft(t);
2382
2778
  return new bt(e.seconds, e.nanos);
2383
2779
  }(t));
2384
2780
  }
2385
2781
 
2386
- function Oe(t, e) {
2782
+ function je(t, e) {
2387
2783
  return function(t) {
2388
2784
  return new Z([ "projects", t.projectId, "databases", t.database ]);
2389
2785
  }(t).child("documents").child(e).canonicalString();
2390
2786
  }
2391
2787
 
2392
- function Ce(t, e) {
2393
- return Oe(t.databaseId, e.path);
2788
+ function Me(t, e) {
2789
+ return je(t.databaseId, e.path);
2394
2790
  }
2395
2791
 
2396
- function Le(t, e) {
2792
+ function Ue(t, e) {
2397
2793
  var n, r = function(t) {
2398
2794
  var e = Z.fromString(t);
2399
- return E(ze(e)), e;
2795
+ return S(Ye(e)), e;
2400
2796
  }(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);
2403
- return new nt((E((n = r).length > 4 && "documents" === n.get(4)), n.popFirst(5)));
2797
+ 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);
2798
+ 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);
2799
+ return new nt((S((n = r).length > 4 && "documents" === n.get(4)), n.popFirst(5)));
2404
2800
  }
2405
2801
 
2406
- function je(t, e) {
2407
- return Oe(t.databaseId, e);
2802
+ function Be(t, e) {
2803
+ return je(t.databaseId, e);
2408
2804
  }
2409
2805
 
2410
- function Re(t) {
2806
+ function ze(t) {
2411
2807
  return new Z([ "projects", t.databaseId.projectId, "databases", t.databaseId.database ]).canonicalString();
2412
2808
  }
2413
2809
 
2414
- function Me(t, e, n) {
2810
+ function Ge(t, e, n) {
2415
2811
  return {
2416
- name: Ce(t, e),
2812
+ name: Me(t, e),
2417
2813
  fields: n.value.mapValue.fields
2418
2814
  };
2419
2815
  }
2420
2816
 
2421
- function xe(t) {
2422
- return ke[t];
2817
+ function Ke(t) {
2818
+ return Fe[t];
2423
2819
  }
2424
2820
 
2425
2821
  // visible for testing
2426
- function Ue(t) {
2427
- return Ve[t];
2822
+ function Qe(t) {
2823
+ return Oe[t];
2428
2824
  }
2429
2825
 
2430
- function Be(t) {
2826
+ function We(t) {
2431
2827
  return {
2432
2828
  fieldPath: t.canonicalString()
2433
2829
  };
2434
2830
  }
2435
2831
 
2436
- function Ge(t) {
2832
+ function He(t) {
2437
2833
  var e = [];
2438
2834
  return t.fields.forEach((function(t) {
2439
2835
  return e.push(t.canonicalString());
@@ -2442,7 +2838,7 @@ function Ge(t) {
2442
2838
  };
2443
2839
  }
2444
2840
 
2445
- function ze(t) {
2841
+ function Ye(t) {
2446
2842
  // Resource names have at least 4 components (project ID, database ID)
2447
2843
  return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
2448
2844
  }
@@ -2462,8 +2858,8 @@ function ze(t) {
2462
2858
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2463
2859
  * See the License for the specific language governing permissions and
2464
2860
  * limitations under the License.
2465
- */ function Qe(t) {
2466
- return new De(t, /* useProto3Json= */ !0);
2861
+ */ function $e(t) {
2862
+ return new qe(t, /* useProto3Json= */ !0);
2467
2863
  }
2468
2864
 
2469
2865
  /**
@@ -2490,7 +2886,7 @@ function ze(t) {
2490
2886
  * backoff curve, and a +/- 50% "jitter" that is calculated and added to the
2491
2887
  * base delay. This prevents clients from accidentally synchronizing their
2492
2888
  * delays causing spikes of load to the backend.
2493
- */ var Ke = /** @class */ function() {
2889
+ */ var Xe = /** @class */ function() {
2494
2890
  function t(
2495
2891
  /**
2496
2892
  * The AsyncQueue to run backoff operations on.
@@ -2516,7 +2912,7 @@ function ze(t) {
2516
2912
  * much as 1.5*maxDelayMs.
2517
2913
  */ , i) {
2518
2914
  void 0 === n && (n = 1e3), void 0 === r && (r = 1.5), void 0 === i && (i = 6e4),
2519
- this.C = t, this.timerId = e, this.L = n, this.U = r, this.k = i, this.j = 0, this.M = null,
2915
+ this.k = t, this.timerId = e, this.C = n, this.L = r, this.M = i, this.U = 0, this.j = null,
2520
2916
  /** The last backoff attempt, as epoch milliseconds. */
2521
2917
  this.B = Date.now(), this.reset();
2522
2918
  }
@@ -2527,14 +2923,14 @@ function ze(t) {
2527
2923
  * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and
2528
2924
  * subsequent ones will increase according to the backoffFactor.
2529
2925
  */ return t.prototype.reset = function() {
2530
- this.j = 0;
2926
+ this.U = 0;
2531
2927
  },
2532
2928
  /**
2533
2929
  * Resets the backoff delay to the maximum delay (e.g. for use after a
2534
2930
  * RESOURCE_EXHAUSTED error).
2535
2931
  */
2536
2932
  t.prototype.G = function() {
2537
- this.j = this.k;
2933
+ this.U = this.M;
2538
2934
  },
2539
2935
  /**
2540
2936
  * Returns a promise that resolves after currentDelayMs, and increases the
@@ -2547,50 +2943,50 @@ function ze(t) {
2547
2943
  this.cancel();
2548
2944
  // First schedule using the current base (which may be 0 and should be
2549
2945
  // honored as such).
2550
- var n = Math.floor(this.j + this.Y()), r = Math.max(0, Date.now() - this.B), i = Math.max(0, n - r);
2946
+ var n = Math.floor(this.U + this.K()), r = Math.max(0, Date.now() - this.B), i = Math.max(0, n - r);
2551
2947
  // Guard against lastAttemptTime being in the future due to a clock change.
2552
- i > 0 && w("ExponentialBackoff", "Backing off for " + i + " ms (base delay: " + this.j + " ms, delay with jitter: " + n + " ms, last attempt: " + r + " ms ago)"),
2553
- this.M = this.C.enqueueAfterDelay(this.timerId, i, (function() {
2948
+ i > 0 && w("ExponentialBackoff", "Backing off for " + i + " ms (base delay: " + this.U + " ms, delay with jitter: " + n + " ms, last attempt: " + r + " ms ago)"),
2949
+ this.j = this.k.enqueueAfterDelay(this.timerId, i, (function() {
2554
2950
  return e.B = Date.now(), t();
2555
2951
  })),
2556
2952
  // Apply backoff factor to determine next delay and ensure it is within
2557
2953
  // bounds.
2558
- this.j *= this.U, this.j < this.L && (this.j = this.L), this.j > this.k && (this.j = this.k);
2559
- }, t.prototype.H = function() {
2560
- null !== this.M && (this.M.skipDelay(), this.M = null);
2954
+ this.U *= this.L, this.U < this.C && (this.U = this.C), this.U > this.M && (this.U = this.M);
2955
+ }, t.prototype.Y = function() {
2956
+ null !== this.j && (this.j.skipDelay(), this.j = null);
2561
2957
  }, t.prototype.cancel = function() {
2562
- null !== this.M && (this.M.cancel(), this.M = null);
2958
+ null !== this.j && (this.j.cancel(), this.j = null);
2563
2959
  },
2564
- /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ t.prototype.Y = function() {
2565
- return (Math.random() - .5) * this.j;
2960
+ /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ t.prototype.K = function() {
2961
+ return (Math.random() - .5) * this.U;
2566
2962
  }, t;
2567
- }(), He = /** @class */ function(e) {
2963
+ }(), Je = /** @class */ function(e) {
2568
2964
  function n(t, n, r, i) {
2569
2965
  var o = this;
2570
2966
  return (o = e.call(this) || this).authCredentials = t, o.appCheckCredentials = n,
2571
- o.K = r, o.q = i, o.J = !1, o;
2967
+ o.H = r, o.q = i, o.J = !1, o;
2572
2968
  }
2573
2969
  return t(n, e), n.prototype.X = function() {
2574
- if (this.J) throw new x(O, "The client has already been terminated.");
2970
+ if (this.J) throw new M(q, "The client has already been terminated.");
2575
2971
  },
2576
2972
  /** Invokes the provided RPC with auth and AppCheck tokens. */ n.prototype.m = function(t, e, n) {
2577
2973
  var r = this;
2578
2974
  return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((function(i) {
2579
2975
  var o = i[0], a = i[1];
2580
- return r.K.m(t, e, n, o, a);
2976
+ return r.H.m(t, e, n, o, a);
2581
2977
  })).catch((function(t) {
2582
- throw "FirebaseError" === t.name ? (t.code === q && (r.authCredentials.invalidateToken(),
2583
- r.appCheckCredentials.invalidateToken()), t) : new x(k, t.toString());
2978
+ throw "FirebaseError" === t.name ? (t.code === F && (r.authCredentials.invalidateToken(),
2979
+ r.appCheckCredentials.invalidateToken()), t) : new M(A, t.toString());
2584
2980
  }));
2585
2981
  },
2586
2982
  /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ n.prototype.T = function(t, e, n) {
2587
2983
  var r = this;
2588
2984
  return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((function(i) {
2589
2985
  var o = i[0], a = i[1];
2590
- return r.K.T(t, e, n, o, a);
2986
+ return r.H.T(t, e, n, o, a);
2591
2987
  })).catch((function(t) {
2592
- throw "FirebaseError" === t.name ? (t.code === q && (r.authCredentials.invalidateToken(),
2593
- r.appCheckCredentials.invalidateToken()), t) : new x(k, t.toString());
2988
+ throw "FirebaseError" === t.name ? (t.code === F && (r.authCredentials.invalidateToken(),
2989
+ r.appCheckCredentials.invalidateToken()), t) : new M(A, t.toString());
2594
2990
  }));
2595
2991
  }, n.prototype.terminate = function() {
2596
2992
  this.J = !0;
@@ -2624,60 +3020,60 @@ function ze(t) {
2624
3020
  */
2625
3021
  // TODO(firestorexp): Make sure there is only one Datastore instance per
2626
3022
  // firestore-exp client.
2627
- function We(t, r) {
3023
+ function Ze(t, r) {
2628
3024
  return e(this, void 0, void 0, (function() {
2629
3025
  var e, i, o;
2630
3026
  return n(this, (function(n) {
2631
3027
  switch (n.label) {
2632
3028
  case 0:
2633
- return e = I(t), i = Re(e.q) + "/documents", o = {
3029
+ return e = k(t), i = ze(e.q) + "/documents", o = {
2634
3030
  writes: r.map((function(t) {
2635
3031
  return function(t, e) {
2636
3032
  var n;
2637
- if (e instanceof Se) n = {
2638
- update: Me(t, e.key, e.value)
2639
- }; else if (e instanceof Ie) n = {
2640
- delete: Ce(t, e.key)
2641
- }; else if (e instanceof Ee) n = {
2642
- update: Me(t, e.key, e.data),
2643
- updateMask: Ge(e.fieldMask)
3033
+ if (e instanceof Ve) n = {
3034
+ update: Ge(t, e.key, e.value)
3035
+ }; else if (e instanceof Pe) n = {
3036
+ delete: Me(t, e.key)
3037
+ }; else if (e instanceof De) n = {
3038
+ update: Ge(t, e.key, e.data),
3039
+ updateMask: He(e.fieldMask)
2644
3040
  }; else {
2645
- if (!(e instanceof Ae)) return S();
3041
+ if (!(e instanceof Ne)) return E();
2646
3042
  n = {
2647
- verify: Ce(t, e.key)
3043
+ verify: Me(t, e.key)
2648
3044
  };
2649
3045
  }
2650
3046
  return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((function(t) {
2651
3047
  return function(t, e) {
2652
3048
  var n = e.transform;
2653
- if (n instanceof ye) return {
3049
+ if (n instanceof _e) return {
2654
3050
  fieldPath: e.field.canonicalString(),
2655
3051
  setToServerValue: "REQUEST_TIME"
2656
3052
  };
2657
- if (n instanceof ve) return {
3053
+ if (n instanceof Te) return {
2658
3054
  fieldPath: e.field.canonicalString(),
2659
3055
  appendMissingElements: {
2660
3056
  values: n.elements
2661
3057
  }
2662
3058
  };
2663
- if (n instanceof ge) return {
3059
+ if (n instanceof Ee) return {
2664
3060
  fieldPath: e.field.canonicalString(),
2665
3061
  removeAllFromArray: {
2666
3062
  values: n.elements
2667
3063
  }
2668
3064
  };
2669
- if (n instanceof we) return {
3065
+ if (n instanceof Se) return {
2670
3066
  fieldPath: e.field.canonicalString(),
2671
3067
  increment: n.O
2672
3068
  };
2673
- throw S();
3069
+ throw E();
2674
3070
  }(0, t);
2675
3071
  }))), e.precondition.isNone || (n.currentDocument = function(t, e) {
2676
3072
  return void 0 !== e.updateTime ? {
2677
- updateTime: qe(t, e.updateTime)
3073
+ updateTime: Ce(t, e.updateTime)
2678
3074
  } : void 0 !== e.exists ? {
2679
3075
  exists: e.exists
2680
- } : S();
3076
+ } : E();
2681
3077
  }(t, e.precondition)), n;
2682
3078
  }(e.q, t);
2683
3079
  }))
@@ -2690,15 +3086,15 @@ function We(t, r) {
2690
3086
  }));
2691
3087
  }
2692
3088
 
2693
- function Ye(t, r) {
3089
+ function tn(t, r) {
2694
3090
  return e(this, void 0, void 0, (function() {
2695
3091
  var e, i, o, a, s, u;
2696
3092
  return n(this, (function(n) {
2697
3093
  switch (n.label) {
2698
3094
  case 0:
2699
- return e = I(t), i = Re(e.q) + "/documents", o = {
3095
+ return e = k(t), i = ze(e.q) + "/documents", o = {
2700
3096
  documents: r.map((function(t) {
2701
- return Ce(e.q, t);
3097
+ return Me(e.q, t);
2702
3098
  }))
2703
3099
  }, [ 4 /*yield*/ , e.T("BatchGetDocuments", i, o) ];
2704
3100
 
@@ -2706,44 +3102,44 @@ function Ye(t, r) {
2706
3102
  return a = n.sent(), s = new Map, a.forEach((function(t) {
2707
3103
  var n = function(t, e) {
2708
3104
  return "found" in e ? function(t, e) {
2709
- 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({
3105
+ S(!!e.found), e.found.name, e.found.updateTime;
3106
+ var n = Ue(t, e.found.name), r = Le(e.found.updateTime), i = new $t({
2711
3107
  mapValue: {
2712
3108
  fields: e.found.fields
2713
3109
  }
2714
3110
  });
2715
- return Qt.newFoundDocument(n, r, i);
3111
+ return Xt.newFoundDocument(n, r, i);
2716
3112
  }(t, e) : "missing" in e ? function(t, e) {
2717
- E(!!e.missing), E(!!e.readTime);
2718
- var n = Le(t, e.missing), r = Fe(e.readTime);
2719
- return Qt.newNoDocument(n, r);
2720
- }(t, e) : S();
3113
+ S(!!e.missing), S(!!e.readTime);
3114
+ var n = Ue(t, e.missing), r = Le(e.readTime);
3115
+ return Xt.newNoDocument(n, r);
3116
+ }(t, e) : E();
2721
3117
  }(e.q, t);
2722
3118
  s.set(n.key.toString(), n);
2723
3119
  })), u = [], [ 2 /*return*/ , (r.forEach((function(t) {
2724
3120
  var e = s.get(t.toString());
2725
- E(!!e), u.push(e);
3121
+ S(!!e), u.push(e);
2726
3122
  })), u) ];
2727
3123
  }
2728
3124
  }));
2729
3125
  }));
2730
3126
  }
2731
3127
 
2732
- function $e(t, r) {
3128
+ function en(t, r) {
2733
3129
  return e(this, void 0, void 0, (function() {
2734
3130
  var e, i;
2735
3131
  return n(this, (function(n) {
2736
3132
  switch (n.label) {
2737
3133
  case 0:
2738
- return e = I(t), i = function(t, e) {
3134
+ return e = k(t), i = function(t, e) {
2739
3135
  // Dissect the path into parent, collectionId, and optional key filter.
2740
3136
  var n = {
2741
3137
  structuredQuery: {}
2742
3138
  }, r = e.path;
2743
- null !== e.collectionGroup ? (n.parent = je(t, r), n.structuredQuery.from = [ {
3139
+ null !== e.collectionGroup ? (n.parent = Be(t, r), n.structuredQuery.from = [ {
2744
3140
  collectionId: e.collectionGroup,
2745
3141
  allDescendants: !0
2746
- } ]) : (n.parent = je(t, r.popLast()), n.structuredQuery.from = [ {
3142
+ } ]) : (n.parent = Be(t, r.popLast()), n.structuredQuery.from = [ {
2747
3143
  collectionId: r.lastSegment()
2748
3144
  } ]);
2749
3145
  var i = function(t) {
@@ -2752,36 +3148,36 @@ function $e(t, r) {
2752
3148
  // visible for testing
2753
3149
  return function(t) {
2754
3150
  if ("==" /* EQUAL */ === t.op) {
2755
- if (Ut(t.value)) return {
3151
+ if (Wt(t.value)) return {
2756
3152
  unaryFilter: {
2757
- field: Be(t.field),
3153
+ field: We(t.field),
2758
3154
  op: "IS_NAN"
2759
3155
  }
2760
3156
  };
2761
- if (xt(t.value)) return {
3157
+ if (Qt(t.value)) return {
2762
3158
  unaryFilter: {
2763
- field: Be(t.field),
3159
+ field: We(t.field),
2764
3160
  op: "IS_NULL"
2765
3161
  }
2766
3162
  };
2767
3163
  } else if ("!=" /* NOT_EQUAL */ === t.op) {
2768
- if (Ut(t.value)) return {
3164
+ if (Wt(t.value)) return {
2769
3165
  unaryFilter: {
2770
- field: Be(t.field),
3166
+ field: We(t.field),
2771
3167
  op: "IS_NOT_NAN"
2772
3168
  }
2773
3169
  };
2774
- if (xt(t.value)) return {
3170
+ if (Qt(t.value)) return {
2775
3171
  unaryFilter: {
2776
- field: Be(t.field),
3172
+ field: We(t.field),
2777
3173
  op: "IS_NOT_NULL"
2778
3174
  }
2779
3175
  };
2780
3176
  }
2781
3177
  return {
2782
3178
  fieldFilter: {
2783
- field: Be(t.field),
2784
- op: Ue(t.op),
3179
+ field: We(t.field),
3180
+ op: Qe(t.op),
2785
3181
  value: t.value
2786
3182
  }
2787
3183
  };
@@ -2801,15 +3197,15 @@ function $e(t, r) {
2801
3197
  // visible for testing
2802
3198
  return function(t) {
2803
3199
  return {
2804
- field: Be(t.field),
2805
- direction: xe(t.dir)
3200
+ field: We(t.field),
3201
+ direction: Ke(t.dir)
2806
3202
  };
2807
3203
  }(t);
2808
3204
  }));
2809
3205
  }(e.orderBy);
2810
3206
  o && (n.structuredQuery.orderBy = o);
2811
3207
  var a, s = function(t, e) {
2812
- return t.F || ct(e) ? e : {
3208
+ return t.S || ct(e) ? e : {
2813
3209
  value: e
2814
3210
  };
2815
3211
  }(t, e.limit);
@@ -2822,7 +3218,7 @@ function $e(t, r) {
2822
3218
  values: t.position
2823
3219
  };
2824
3220
  }(e.endAt)), n;
2825
- }(e.q, pe(r)), [ 4 /*yield*/ , e.T("RunQuery", i.parent, {
3221
+ }(e.q, ge(r)), [ 4 /*yield*/ , e.T("RunQuery", i.parent, {
2826
3222
  structuredQuery: i.structuredQuery
2827
3223
  }) ];
2828
3224
 
@@ -2831,11 +3227,11 @@ function $e(t, r) {
2831
3227
  return !!t.document;
2832
3228
  })).map((function(t) {
2833
3229
  return function(t, e, n) {
2834
- var r = Le(t, e.name), i = Fe(e.updateTime), o = new zt({
3230
+ var r = Ue(t, e.name), i = Le(e.updateTime), o = new $t({
2835
3231
  mapValue: {
2836
3232
  fields: e.fields
2837
3233
  }
2838
- }), a = Qt.newFoundDocument(r, i, o);
3234
+ }), a = Xt.newFoundDocument(r, i, o);
2839
3235
  return a;
2840
3236
  }(e.q, t.document);
2841
3237
  })) ];
@@ -2859,7 +3255,7 @@ function $e(t, r) {
2859
3255
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2860
3256
  * See the License for the specific language governing permissions and
2861
3257
  * limitations under the License.
2862
- */ var Xe = new Map;
3258
+ */ var nn = new Map;
2863
3259
 
2864
3260
  /**
2865
3261
  * An instance map that ensures only one Datastore exists per Firestore
@@ -2869,17 +3265,17 @@ function $e(t, r) {
2869
3265
  * Returns an initialized and started Datastore for the given Firestore
2870
3266
  * instance. Callers must invoke removeComponents() when the Firestore
2871
3267
  * instance is terminated.
2872
- */ function Je(t) {
2873
- if (t._terminated) throw new x(O, "The client has already been terminated.");
2874
- if (!Xe.has(t)) {
3268
+ */ function rn(t) {
3269
+ if (t._terminated) throw new M(q, "The client has already been terminated.");
3270
+ if (!nn.has(t)) {
2875
3271
  w("ComponentProvider", "Initializing Datastore");
2876
3272
  var e = function(t) {
2877
- return new mt(t, fetch.bind(null));
3273
+ return new yt(t, fetch.bind(null));
2878
3274
  }((i = t._databaseId, o = t.app.options.appId || "", a = t._persistenceKey, s = t._freezeSettings(),
2879
- new $(i, o, a, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), n = Qe(t._databaseId), r = function(t, e, n, r) {
2880
- return new He(t, e, n, r);
3275
+ new $(i, o, a, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), n = $e(t._databaseId), r = function(t, e, n, r) {
3276
+ return new Je(t, e, n, r);
2881
3277
  }(t._authCredentials, t._appCheckCredentials, e, n);
2882
- Xe.set(t, r);
3278
+ nn.set(t, r);
2883
3279
  }
2884
3280
  var i, o, a, s;
2885
3281
  /**
@@ -2897,7 +3293,7 @@ function $e(t, r) {
2897
3293
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2898
3294
  * See the License for the specific language governing permissions and
2899
3295
  * limitations under the License.
2900
- */ return Xe.get(t);
3296
+ */ return nn.get(t);
2901
3297
  }
2902
3298
 
2903
3299
  /**
@@ -2908,37 +3304,37 @@ function $e(t, r) {
2908
3304
  * A concrete type describing all the values that can be applied via a
2909
3305
  * user-supplied `FirestoreSettings` object. This is a separate type so that
2910
3306
  * defaults can be supplied and the value can be checked for equality.
2911
- */ var Ze = /** @class */ function() {
3307
+ */ var on = /** @class */ function() {
2912
3308
  function t(t) {
2913
3309
  var e;
2914
3310
  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");
3311
+ if (void 0 !== t.ssl) throw new M(V, "Can't provide ssl option if host option is not set");
2916
3312
  this.host = "firestore.googleapis.com", this.ssl = !0;
2917
3313
  } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;
2918
3314
  if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties,
2919
3315
  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");
3316
+ if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new M(V, "cacheSizeBytes must be at least 1048576");
2921
3317
  this.cacheSizeBytes = t.cacheSizeBytes;
2922
3318
  }
2923
3319
  this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling,
2924
3320
  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.");
3321
+ if (!0 === e && !0 === r) throw new M(V, "experimentalForceLongPolling and experimentalAutoDetectLongPolling cannot be used together.");
2926
3322
  }(0, t.experimentalForceLongPolling, 0, t.experimentalAutoDetectLongPolling);
2927
3323
  }
2928
3324
  return t.prototype.isEqual = function(t) {
2929
3325
  return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;
2930
3326
  }, t;
2931
- }(), tn = /** @class */ function() {
3327
+ }(), an = /** @class */ function() {
2932
3328
  /** @hideconstructor */
2933
3329
  function t(t, e, n) {
2934
3330
  this._authCredentials = e, this._appCheckCredentials = n,
2935
3331
  /**
2936
3332
  * Whether it's a Firestore or Firestore Lite instance.
2937
3333
  */
2938
- this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new Ze({}),
3334
+ this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new on({}),
2939
3335
  this._settingsFrozen = !1, t instanceof X ? this._databaseId = t : (this._app = t,
2940
3336
  this._databaseId = function(t) {
2941
- if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new x(V, '"projectId" not provided in firebase.initializeApp.');
3337
+ if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new M(V, '"projectId" not provided in firebase.initializeApp.');
2942
3338
  return new X(t.options.projectId);
2943
3339
  }(t));
2944
3340
  }
@@ -2948,7 +3344,7 @@ function $e(t, r) {
2948
3344
  * instance.
2949
3345
  */
2950
3346
  get: function() {
2951
- if (!this._app) throw new x(O, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
3347
+ if (!this._app) throw new M(q, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
2952
3348
  return this._app;
2953
3349
  },
2954
3350
  enumerable: !1,
@@ -2966,21 +3362,21 @@ function $e(t, r) {
2966
3362
  enumerable: !1,
2967
3363
  configurable: !0
2968
3364
  }), 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.");
2970
- this._settings = new Ze(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
2971
- if (!t) return new G;
3365
+ if (this._settingsFrozen) throw new M(q, "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.");
3366
+ this._settings = new on(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
3367
+ if (!t) return new z;
2972
3368
  switch (t.type) {
2973
3369
  case "gapi":
2974
3370
  var e = t.client;
2975
3371
  // Make sure this really is a Gapi client.
2976
- return E(!("object" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)),
2977
- new H(e, t.sessionIndex || "0", t.iamToken || null);
3372
+ return S(!("object" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)),
3373
+ new W(e, t.sessionIndex || "0", t.iamToken || null);
2978
3374
 
2979
3375
  case "provider":
2980
3376
  return t.client;
2981
3377
 
2982
3378
  default:
2983
- throw new x(V, "makeAuthCredentialsProvider failed due to invalid credential type");
3379
+ throw new M(V, "makeAuthCredentialsProvider failed due to invalid credential type");
2984
3380
  }
2985
3381
  }(t.credentials));
2986
3382
  }, t.prototype._getSettings = function() {
@@ -3005,8 +3401,8 @@ function $e(t, r) {
3005
3401
  * Only ever called once.
3006
3402
  */
3007
3403
  t.prototype._terminate = function() {
3008
- return t = this, (e = Xe.get(t)) && (w("ComponentProvider", "Removing Datastore"),
3009
- Xe.delete(t), e.terminate()), Promise.resolve();
3404
+ return t = this, (e = nn.get(t)) && (w("ComponentProvider", "Removing Datastore"),
3405
+ nn.delete(t), e.terminate()), Promise.resolve();
3010
3406
  var t, e;
3011
3407
  }, t;
3012
3408
  }();
@@ -3031,9 +3427,9 @@ function $e(t, r) {
3031
3427
  * The Cloud Firestore service interface.
3032
3428
  *
3033
3429
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
3034
- */ function en(t, e) {
3430
+ */ function sn(t, e) {
3035
3431
  var n = _getProvider(t, "firestore/lite");
3036
- if (n.isInitialized()) throw new x(O, "Firestore can only be initialized once per app.");
3432
+ if (n.isInitialized()) throw new M(q, "Firestore can only be initialized once per app.");
3037
3433
  return n.initialize({
3038
3434
  options: e
3039
3435
  });
@@ -3047,7 +3443,7 @@ function $e(t, r) {
3047
3443
  * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned `Firestore`
3048
3444
  * instance is associated with.
3049
3445
  * @returns The `Firestore` instance of the provided app.
3050
- */ function nn(t) {
3446
+ */ function un(t) {
3051
3447
  return void 0 === t && (t = s()), _getProvider(t, "firestore/lite").getImmediate();
3052
3448
  }
3053
3449
 
@@ -3063,25 +3459,25 @@ function $e(t, r) {
3063
3459
  * @param port - the emulator port (ex: 9000).
3064
3460
  * @param options.mockUserToken - the mock auth token to use for unit testing
3065
3461
  * Security Rules.
3066
- */ function rn(t, e, n, r) {
3462
+ */ function cn(t, e, n, r) {
3067
3463
  var i;
3068
3464
  void 0 === r && (r = {});
3069
- var o = (t = st(t, tn))._getSettings();
3465
+ var o = (t = st(t, an))._getSettings();
3070
3466
  if ("firestore.googleapis.com" !== o.host && o.host !== e && _("Host has been set in both settings() and useEmulator(), emulator host will be used"),
3071
3467
  t._setSettings(Object.assign(Object.assign({}, o), {
3072
3468
  host: e + ":" + n,
3073
3469
  ssl: !1
3074
3470
  })), r.mockUserToken) {
3075
3471
  var a, s;
3076
- if ("string" == typeof r.mockUserToken) a = r.mockUserToken, s = m.MOCK_USER; else {
3472
+ if ("string" == typeof r.mockUserToken) a = r.mockUserToken, s = y.MOCK_USER; else {
3077
3473
  // Let createMockUserToken validate first (catches common mistakes like
3078
3474
  // invalid field "uid" and missing field "sub" / "user_id".)
3079
3475
  a = d(r.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);
3080
3476
  var u = r.mockUserToken.sub || r.mockUserToken.user_id;
3081
- if (!u) throw new x(V, "mockUserToken must contain 'sub' or 'user_id' field!");
3082
- s = new m(u);
3477
+ if (!u) throw new M(V, "mockUserToken must contain 'sub' or 'user_id' field!");
3478
+ s = new y(u);
3083
3479
  }
3084
- t._authCredentials = new z(new B(a, s));
3480
+ t._authCredentials = new G(new B(a, s));
3085
3481
  }
3086
3482
  }
3087
3483
 
@@ -3104,8 +3500,8 @@ function $e(t, r) {
3104
3500
  * @param firestore - The `Firestore` instance to terminate.
3105
3501
  * @returns A `Promise` that is resolved when the instance has been successfully
3106
3502
  * terminated.
3107
- */ function on(t) {
3108
- return t = st(t, tn), u(t.app, "firestore/lite"), t._delete()
3503
+ */ function ln(t) {
3504
+ return t = st(t, an), u(t.app, "firestore/lite"), t._delete()
3109
3505
  /**
3110
3506
  * @license
3111
3507
  * Copyright 2020 Google LLC
@@ -3145,7 +3541,7 @@ function $e(t, r) {
3145
3541
  */;
3146
3542
  }
3147
3543
 
3148
- var an = /** @class */ function() {
3544
+ var fn = /** @class */ function() {
3149
3545
  /** @hideconstructor */
3150
3546
  function t(t,
3151
3547
  /**
@@ -3186,14 +3582,14 @@ var an = /** @class */ function() {
3186
3582
  * The collection this `DocumentReference` belongs to.
3187
3583
  */
3188
3584
  get: function() {
3189
- return new un(this.firestore, this.converter, this._key.path.popLast());
3585
+ return new pn(this.firestore, this.converter, this._key.path.popLast());
3190
3586
  },
3191
3587
  enumerable: !1,
3192
3588
  configurable: !0
3193
3589
  }), t.prototype.withConverter = function(e) {
3194
3590
  return new t(this.firestore, e, this._key);
3195
3591
  }, t;
3196
- }(), sn = /** @class */ function() {
3592
+ }(), hn = /** @class */ function() {
3197
3593
  // This is the lite version of the Query class in the main SDK.
3198
3594
  /** @hideconstructor protected */
3199
3595
  function t(t,
@@ -3208,11 +3604,11 @@ var an = /** @class */ function() {
3208
3604
  return t.prototype.withConverter = function(e) {
3209
3605
  return new t(this.firestore, e, this._query);
3210
3606
  }, t;
3211
- }(), un = /** @class */ function(e) {
3607
+ }(), pn = /** @class */ function(e) {
3212
3608
  /** @hideconstructor */
3213
3609
  function n(t, n, r) {
3214
3610
  var i = this;
3215
- return (i = e.call(this, t, n, new se(r)) || this)._path = r,
3611
+ return (i = e.call(this, t, n, new pe(r)) || this)._path = r,
3216
3612
  /** The type of this Firestore reference. */
3217
3613
  i.type = "collection", i;
3218
3614
  }
@@ -3239,7 +3635,7 @@ var an = /** @class */ function() {
3239
3635
  */
3240
3636
  get: function() {
3241
3637
  var t = this._path.popLast();
3242
- return t.isEmpty() ? null : new an(this.firestore,
3638
+ return t.isEmpty() ? null : new fn(this.firestore,
3243
3639
  /* converter= */ null, new nt(t));
3244
3640
  },
3245
3641
  enumerable: !1,
@@ -3247,20 +3643,20 @@ var an = /** @class */ function() {
3247
3643
  }), n.prototype.withConverter = function(t) {
3248
3644
  return new n(this.firestore, t, this._path);
3249
3645
  }, n;
3250
- }(sn);
3646
+ }(hn);
3251
3647
 
3252
3648
  /**
3253
3649
  * A `Query` refers to a query which you can read or listen to. You can also
3254
3650
  * construct refined `Query` objects by adding filters and ordering.
3255
- */ function cn(t, e) {
3651
+ */ function dn(t, e) {
3256
3652
  for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
3257
- if (t = p(t), rt("collection", "path", e), t instanceof tn) {
3653
+ if (t = p(t), rt("collection", "path", e), t instanceof an) {
3258
3654
  var o = Z.fromString.apply(Z, r([ e ], n));
3259
- return ot(o), new un(t, /* converter= */ null, o);
3655
+ return ot(o), new pn(t, /* converter= */ null, o);
3260
3656
  }
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");
3657
+ if (!(t instanceof fn || t instanceof pn)) throw new M(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3262
3658
  var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
3263
- return ot(a), new un(t.firestore,
3659
+ return ot(a), new pn(t.firestore,
3264
3660
  /* converter= */ null, a);
3265
3661
  }
3266
3662
 
@@ -3276,32 +3672,32 @@ var an = /** @class */ function() {
3276
3672
  * collection or subcollection with this ID as the last segment of its path
3277
3673
  * will be included. Cannot contain a slash.
3278
3674
  * @returns The created `Query`.
3279
- */ 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 '/'.");
3281
- return new sn(t,
3675
+ */ function yn(t, e) {
3676
+ if (t = st(t, an), 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 '/'.");
3677
+ return new hn(t,
3282
3678
  /* converter= */ null,
3283
3679
  /**
3284
3680
  * Creates a new Query for a collection group query that matches all documents
3285
3681
  * within the provided collection group.
3286
3682
  */
3287
3683
  function(t) {
3288
- return new se(Z.emptyPath(), t);
3684
+ return new pe(Z.emptyPath(), t);
3289
3685
  }(e));
3290
3686
  }
3291
3687
 
3292
- function fn(t, e) {
3688
+ function mn(t, e) {
3293
3689
  for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
3294
3690
  if (t = p(t),
3295
3691
  // We allow omission of 'pathString' but explicitly prohibit passing in both
3296
3692
  // 'undefined' and 'null'.
3297
- 1 === arguments.length && (e = vt.R()), rt("doc", "path", e), t instanceof tn) {
3693
+ 1 === arguments.length && (e = vt.R()), rt("doc", "path", e), t instanceof an) {
3298
3694
  var o = Z.fromString.apply(Z, r([ e ], n));
3299
- return it(o), new an(t,
3695
+ return it(o), new fn(t,
3300
3696
  /* converter= */ null, new nt(o));
3301
3697
  }
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");
3698
+ if (!(t instanceof fn || t instanceof pn)) throw new M(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3303
3699
  var a = t._path.child(Z.fromString.apply(Z, r([ e ], n)));
3304
- return it(a), new an(t.firestore, t instanceof un ? t.converter : null, new nt(a));
3700
+ return it(a), new fn(t.firestore, t instanceof pn ? t.converter : null, new nt(a));
3305
3701
  }
3306
3702
 
3307
3703
  /**
@@ -3311,8 +3707,8 @@ function fn(t, e) {
3311
3707
  * @param right - A reference to compare.
3312
3708
  * @returns true if the references point to the same location in the same
3313
3709
  * Firestore database.
3314
- */ function hn(t, e) {
3315
- return t = p(t), e = p(e), (t instanceof an || t instanceof un) && (e instanceof an || e instanceof un) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
3710
+ */ function vn(t, e) {
3711
+ return t = p(t), e = p(e), (t instanceof fn || t instanceof pn) && (e instanceof fn || e instanceof pn) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
3316
3712
  /**
3317
3713
  * Returns true if the provided queries point to the same collection and apply
3318
3714
  * the same constraints.
@@ -3324,18 +3720,18 @@ function fn(t, e) {
3324
3720
  */;
3325
3721
  }
3326
3722
 
3327
- function pn(t, e) {
3328
- return t = p(t), e = p(e), t instanceof sn && e instanceof sn && t.firestore === e.firestore && function(t, e) {
3723
+ function gn(t, e) {
3724
+ return t = p(t), e = p(e), t instanceof hn && e instanceof hn && t.firestore === e.firestore && function(t, e) {
3329
3725
  return function(t, e) {
3330
3726
  if (t.limit !== e.limit) return !1;
3331
3727
  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;
3728
+ for (var n = 0; n < t.orderBy.length; n++) if (!fe(t.orderBy[n], e.orderBy[n])) return !1;
3333
3729
  if (t.filters.length !== e.filters.length) return !1;
3334
3730
  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;
3731
+ i.op !== o.op || !i.field.isEqual(o.field) || !Mt(i.value, o.value)) return !1;
3336
3732
  var i, o;
3337
- return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!ae(t.startAt, e.startAt) && ae(t.endAt, e.endAt);
3338
- }(pe(t), pe(e)) && t.limitType === e.limitType;
3733
+ return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!he(t.startAt, e.startAt) && he(t.endAt, e.endAt);
3734
+ }(ge(t), ge(e)) && t.limitType === e.limitType;
3339
3735
  }(t._query, e._query) && t.converter === e.converter
3340
3736
  /**
3341
3737
  * @license
@@ -3363,7 +3759,7 @@ function pn(t, e) {
3363
3759
  */;
3364
3760
  }
3365
3761
 
3366
- var dn = /** @class */ function() {
3762
+ var wn = /** @class */ function() {
3367
3763
  /**
3368
3764
  * Creates a `FieldPath` from the provided field names. If more than one field
3369
3765
  * name is provided, the path will point to a nested field in a document.
@@ -3372,7 +3768,7 @@ var dn = /** @class */ function() {
3372
3768
  */
3373
3769
  function t() {
3374
3770
  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.");
3771
+ 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
3772
  this._internalPath = new et(t);
3377
3773
  }
3378
3774
  /**
@@ -3388,8 +3784,8 @@ var dn = /** @class */ function() {
3388
3784
  /**
3389
3785
  * Returns a special sentinel `FieldPath` to refer to the ID of a document.
3390
3786
  * It can be used in queries to sort or filter by the document ID.
3391
- */ function mn() {
3392
- return new dn("__name__");
3787
+ */ function bn() {
3788
+ return new wn("__name__");
3393
3789
  }
3394
3790
 
3395
3791
  /**
@@ -3410,7 +3806,7 @@ var dn = /** @class */ function() {
3410
3806
  */
3411
3807
  /**
3412
3808
  * An immutable object representing an array of bytes.
3413
- */ var yn = /** @class */ function() {
3809
+ */ var _n = /** @class */ function() {
3414
3810
  /** @hideconstructor */
3415
3811
  function t(t) {
3416
3812
  this._byteString = t;
@@ -3422,9 +3818,9 @@ var dn = /** @class */ function() {
3422
3818
  * @param base64 - The Base64 string used to create the `Bytes` object.
3423
3819
  */ return t.fromBase64String = function(e) {
3424
3820
  try {
3425
- return new t(It.fromBase64String(e));
3821
+ return new t(Pt.fromBase64String(e));
3426
3822
  } catch (e) {
3427
- throw new x(V, "Failed to construct data from Base64 string: " + e);
3823
+ throw new M(V, "Failed to construct data from Base64 string: " + e);
3428
3824
  }
3429
3825
  },
3430
3826
  /**
@@ -3433,7 +3829,7 @@ var dn = /** @class */ function() {
3433
3829
  * @param array - The Uint8Array used to create the `Bytes` object.
3434
3830
  */
3435
3831
  t.fromUint8Array = function(e) {
3436
- return new t(It.fromUint8Array(e));
3832
+ return new t(Pt.fromUint8Array(e));
3437
3833
  },
3438
3834
  /**
3439
3835
  * Returns the underlying bytes as a Base64-encoded string.
@@ -3468,14 +3864,14 @@ var dn = /** @class */ function() {
3468
3864
  t.prototype.isEqual = function(t) {
3469
3865
  return this._byteString.isEqual(t._byteString);
3470
3866
  }, t;
3471
- }(), vn =
3867
+ }(), Tn =
3472
3868
  /**
3473
3869
  * @param _methodName - The public API endpoint that returns this class.
3474
3870
  * @hideconstructor
3475
3871
  */
3476
3872
  function(t) {
3477
3873
  this._methodName = t;
3478
- }, gn = /** @class */ function() {
3874
+ }, En = /** @class */ function() {
3479
3875
  /**
3480
3876
  * Creates a new immutable `GeoPoint` object with the provided latitude and
3481
3877
  * longitude values.
@@ -3483,8 +3879,8 @@ function(t) {
3483
3879
  * @param longitude - The longitude as number between -180 and 180.
3484
3880
  */
3485
3881
  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);
3882
+ if (!isFinite(t) || t < -90 || t > 90) throw new M(V, "Latitude must be a number between -90 and 90, but was: " + t);
3883
+ if (!isFinite(e) || e < -180 || e > 180) throw new M(V, "Longitude must be a number between -180 and 180, but was: " + e);
3488
3884
  this._lat = t, this._long = e;
3489
3885
  }
3490
3886
  return Object.defineProperty(t.prototype, "latitude", {
@@ -3528,21 +3924,21 @@ function(t) {
3528
3924
  t.prototype._compareTo = function(t) {
3529
3925
  return gt(this._lat, t._lat) || gt(this._long, t._long);
3530
3926
  }, t;
3531
- }(), wn = /^__.*__$/, bn = /** @class */ function() {
3927
+ }(), Sn = /^__.*__$/, kn = /** @class */ function() {
3532
3928
  function t(t, e, n) {
3533
3929
  this.data = t, this.fieldMask = e, this.fieldTransforms = n;
3534
3930
  }
3535
3931
  return t.prototype.toMutation = function(t, e) {
3536
- return null !== this.fieldMask ? new Ee(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Se(t, this.data, e, this.fieldTransforms);
3932
+ return null !== this.fieldMask ? new De(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Ve(t, this.data, e, this.fieldTransforms);
3537
3933
  }, t;
3538
- }(), _n = /** @class */ function() {
3934
+ }(), In = /** @class */ function() {
3539
3935
  function t(t,
3540
3936
  // The fieldMask does not include document transforms.
3541
3937
  e, n) {
3542
3938
  this.data = t, this.fieldMask = e, this.fieldTransforms = n;
3543
3939
  }
3544
3940
  return t.prototype.toMutation = function(t, e) {
3545
- return new Ee(t, this.data, this.fieldMask, e, this.fieldTransforms);
3941
+ return new De(t, this.data, this.fieldMask, e, this.fieldTransforms);
3546
3942
  }, t;
3547
3943
  }();
3548
3944
 
@@ -3565,7 +3961,7 @@ function(t) {
3565
3961
  /**
3566
3962
  * Sentinel values that can be used when writing document fields with `set()`
3567
3963
  * or `update()`.
3568
- */ function Tn(t) {
3964
+ */ function An(t) {
3569
3965
  switch (t) {
3570
3966
  case 0 /* Set */ :
3571
3967
  // fall through
@@ -3579,11 +3975,11 @@ function(t) {
3579
3975
  return !1;
3580
3976
 
3581
3977
  default:
3582
- throw S();
3978
+ throw E();
3583
3979
  }
3584
3980
  }
3585
3981
 
3586
- /** A "context" object passed around while parsing user data. */ var Sn = /** @class */ function() {
3982
+ /** A "context" object passed around while parsing user data. */ var Vn = /** @class */ function() {
3587
3983
  /**
3588
3984
  * Initializes a ParseContext with the given source and path.
3589
3985
  *
@@ -3643,7 +4039,7 @@ function(t) {
3643
4039
  rt: !0
3644
4040
  });
3645
4041
  }, t.prototype.ut = function(t) {
3646
- return Gn(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
4042
+ return Hn(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
3647
4043
  },
3648
4044
  /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ t.prototype.contains = function(t) {
3649
4045
  return void 0 !== this.fieldMask.find((function(e) {
@@ -3657,15 +4053,15 @@ function(t) {
3657
4053
  if (this.path) for (var t = 0; t < this.path.length; t++) this.st(this.path.get(t));
3658
4054
  }, t.prototype.st = function(t) {
3659
4055
  if (0 === t.length) throw this.ut("Document fields must not be empty");
3660
- if (Tn(this.tt) && wn.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
4056
+ if (An(this.tt) && Sn.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
3661
4057
  }, t;
3662
- }(), En = /** @class */ function() {
4058
+ }(), Dn = /** @class */ function() {
3663
4059
  function t(t, e, n) {
3664
- this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n || Qe(t)
4060
+ this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n || $e(t)
3665
4061
  /** Creates a new top-level parse context. */;
3666
4062
  }
3667
4063
  return t.prototype.ht = function(t, e, n, r) {
3668
- return void 0 === r && (r = !1), new Sn({
4064
+ return void 0 === r && (r = !1), new Vn({
3669
4065
  tt: t,
3670
4066
  methodName: e,
3671
4067
  at: n,
@@ -3679,30 +4075,30 @@ function(t) {
3679
4075
  /**
3680
4076
  * Helper for parsing raw user input (provided via the API) into internal model
3681
4077
  * classes.
3682
- */ function In(t) {
3683
- var e = t._freezeSettings(), n = Qe(t._databaseId);
3684
- return new En(t._databaseId, !!e.ignoreUndefinedProperties, n);
4078
+ */ function Pn(t) {
4079
+ var e = t._freezeSettings(), n = $e(t._databaseId);
4080
+ return new Dn(t._databaseId, !!e.ignoreUndefinedProperties, n);
3685
4081
  }
3686
4082
 
3687
- /** Parse document data from a set() call. */ function An(t, e, n, r, i, o) {
4083
+ /** Parse document data from a set() call. */ function Nn(t, e, n, r, i, o) {
3688
4084
  void 0 === o && (o = {});
3689
4085
  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);
3692
- if (o.merge) s = new Et(a.fieldMask), u = a.fieldTransforms; else if (o.mergeFields) {
4086
+ Gn("Data must be an object, but it was:", a, r);
4087
+ var s, u, c = Bn(r, a);
4088
+ if (o.merge) s = new Dt(a.fieldMask), u = a.fieldTransforms; else if (o.mergeFields) {
3693
4089
  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.");
3696
- zn(l, p) || l.push(p);
4090
+ var p = Kn(e, h[f], n);
4091
+ if (!a.contains(p)) throw new M(V, "Field '" + p + "' is specified in your field mask but missing from your input data.");
4092
+ Yn(l, p) || l.push(p);
3697
4093
  }
3698
- s = new Et(l), u = a.fieldTransforms.filter((function(t) {
4094
+ s = new Dt(l), u = a.fieldTransforms.filter((function(t) {
3699
4095
  return s.covers(t.field);
3700
4096
  }));
3701
4097
  } else s = null, u = a.fieldTransforms;
3702
- return new bn(new zt(c), s, u);
4098
+ return new kn(new $t(c), s, u);
3703
4099
  }
3704
4100
 
3705
- var kn = /** @class */ function(e) {
4101
+ var Fn = /** @class */ function(e) {
3706
4102
  function n() {
3707
4103
  return null !== e && e.apply(this, arguments) || this;
3708
4104
  }
@@ -3714,7 +4110,7 @@ var kn = /** @class */ function(e) {
3714
4110
  }, n.prototype.isEqual = function(t) {
3715
4111
  return t instanceof n;
3716
4112
  }, n;
3717
- }(vn);
4113
+ }(Tn);
3718
4114
 
3719
4115
  /**
3720
4116
  * Creates a child context for parsing SerializableFieldValues.
@@ -3731,8 +4127,8 @@ var kn = /** @class */ function(e) {
3731
4127
  * context.
3732
4128
  * @param context - The parent context.
3733
4129
  * @param arrayElement - Whether or not the FieldValue has an array.
3734
- */ function Vn(t, e, n) {
3735
- return new Sn({
4130
+ */ function On(t, e, n) {
4131
+ return new Vn({
3736
4132
  tt: 3 /* Argument */ ,
3737
4133
  at: e.settings.at,
3738
4134
  methodName: t._methodName,
@@ -3740,101 +4136,101 @@ var kn = /** @class */ function(e) {
3740
4136
  }, e.databaseId, e.q, e.ignoreUndefinedProperties);
3741
4137
  }
3742
4138
 
3743
- var Dn = /** @class */ function(e) {
4139
+ var qn = /** @class */ function(e) {
3744
4140
  function n() {
3745
4141
  return null !== e && e.apply(this, arguments) || this;
3746
4142
  }
3747
4143
  return t(n, e), n.prototype._toFieldTransform = function(t) {
3748
- return new be(t.path, new ye);
4144
+ return new ke(t.path, new _e);
3749
4145
  }, n.prototype.isEqual = function(t) {
3750
4146
  return t instanceof n;
3751
4147
  }, n;
3752
- }(vn), Pn = /** @class */ function(e) {
4148
+ }(Tn), Rn = /** @class */ function(e) {
3753
4149
  function n(t, n) {
3754
4150
  var r = this;
3755
4151
  return (r = e.call(this, t) || this).lt = n, r;
3756
4152
  }
3757
4153
  return t(n, e), n.prototype._toFieldTransform = function(t) {
3758
- var e = Vn(this, t,
4154
+ var e = On(this, t,
3759
4155
  /*array=*/ !0), n = this.lt.map((function(t) {
3760
- return Ln(t, e);
3761
- })), r = new ve(n);
3762
- return new be(t.path, r);
4156
+ return Un(t, e);
4157
+ })), r = new Te(n);
4158
+ return new ke(t.path, r);
3763
4159
  }, n.prototype.isEqual = function(t) {
3764
4160
  // TODO(mrschmidt): Implement isEquals
3765
4161
  return this === t;
3766
4162
  }, n;
3767
- }(vn), Nn = /** @class */ function(e) {
4163
+ }(Tn), xn = /** @class */ function(e) {
3768
4164
  function n(t, n) {
3769
4165
  var r = this;
3770
4166
  return (r = e.call(this, t) || this).lt = n, r;
3771
4167
  }
3772
4168
  return t(n, e), n.prototype._toFieldTransform = function(t) {
3773
- var e = Vn(this, t,
4169
+ var e = On(this, t,
3774
4170
  /*array=*/ !0), n = this.lt.map((function(t) {
3775
- return Ln(t, e);
3776
- })), r = new ge(n);
3777
- return new be(t.path, r);
4171
+ return Un(t, e);
4172
+ })), r = new Ee(n);
4173
+ return new ke(t.path, r);
3778
4174
  }, n.prototype.isEqual = function(t) {
3779
4175
  // TODO(mrschmidt): Implement isEquals
3780
4176
  return this === t;
3781
4177
  }, n;
3782
- }(vn), qn = /** @class */ function(e) {
4178
+ }(Tn), Cn = /** @class */ function(e) {
3783
4179
  function n(t, n) {
3784
4180
  var r = this;
3785
4181
  return (r = e.call(this, t) || this).ft = n, r;
3786
4182
  }
3787
4183
  return t(n, e), n.prototype._toFieldTransform = function(t) {
3788
- var e = new we(t.q, de(t.q, this.ft));
3789
- return new be(t.path, e);
4184
+ var e = new Se(t.q, we(t.q, this.ft));
4185
+ return new ke(t.path, e);
3790
4186
  }, n.prototype.isEqual = function(t) {
3791
4187
  // TODO(mrschmidt): Implement isEquals
3792
4188
  return this === t;
3793
4189
  }, n;
3794
- }(vn);
4190
+ }(Tn);
3795
4191
 
3796
- /** Parse update data from an update() call. */ function Fn(t, e, n, r) {
4192
+ /** Parse update data from an update() call. */ function Ln(t, e, n, r) {
3797
4193
  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();
3800
- St(r, (function(t, r) {
3801
- var s = Bn(e, t, n);
4194
+ Gn("Data must be an object, but it was:", i, r);
4195
+ var o = [], a = $t.empty();
4196
+ Et(r, (function(t, r) {
4197
+ var s = Wn(e, t, n);
3802
4198
  // For Compat types, we have to "extract" the underlying types before
3803
4199
  // performing validation.
3804
4200
  r = p(r);
3805
4201
  var u = i.it(s);
3806
- if (r instanceof kn)
4202
+ if (r instanceof Fn)
3807
4203
  // Add it to the field mask, but don't add anything to updateData.
3808
4204
  o.push(s); else {
3809
- var c = Ln(r, u);
4205
+ var c = Un(r, u);
3810
4206
  null != c && (o.push(s), a.set(s, c));
3811
4207
  }
3812
4208
  }));
3813
- var s = new Et(o);
3814
- return new _n(a, s, i.fieldTransforms);
4209
+ var s = new Dt(o);
4210
+ return new In(a, s, i.fieldTransforms);
3815
4211
  }
3816
4212
 
3817
- /** 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]);
4213
+ /** Parse update data from a list of field/value arguments. */ function jn(t, e, n, r, i, o) {
4214
+ var a = t.ht(1 /* Update */ , e, n), s = [ Kn(e, r, n) ], u = [ i ];
4215
+ 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.");
4216
+ for (var c = 0; c < o.length; c += 2) s.push(Kn(e, o[c])), u.push(o[c + 1]);
3821
4217
  // We iterate in reverse order to pick the last value for a field if the
3822
4218
  // 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])) {
3824
- var d = s[h], m = u[h];
4219
+ for (var l = [], f = $t.empty(), h = s.length - 1; h >= 0; --h) if (!Yn(l, s[h])) {
4220
+ var d = s[h], y = u[h];
3825
4221
  // For Compat types, we have to "extract" the underlying types before
3826
4222
  // performing validation.
3827
- m = p(m);
3828
- var y = a.it(d);
3829
- if (m instanceof kn)
4223
+ y = p(y);
4224
+ var m = a.it(d);
4225
+ if (y instanceof Fn)
3830
4226
  // Add it to the field mask, but don't add anything to updateData.
3831
4227
  l.push(d); else {
3832
- var v = Ln(m, y);
4228
+ var v = Un(y, m);
3833
4229
  null != v && (l.push(d), f.set(d, v));
3834
4230
  }
3835
4231
  }
3836
- var g = new Et(l);
3837
- return new _n(f, g, a.fieldTransforms);
4232
+ var g = new Dt(l);
4233
+ return new In(f, g, a.fieldTransforms);
3838
4234
  }
3839
4235
 
3840
4236
  /**
@@ -3843,8 +4239,8 @@ var Dn = /** @class */ function(e) {
3843
4239
  *
3844
4240
  * @param allowArrays - Whether the query value is an array that may directly
3845
4241
  * contain additional arrays (e.g. the operand of an `in` query).
3846
- */ function Cn(t, e, n, r) {
3847
- return void 0 === r && (r = !1), Ln(n, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
4242
+ */ function Mn(t, e, n, r) {
4243
+ return void 0 === r && (r = !1), Un(n, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
3848
4244
  }
3849
4245
 
3850
4246
  /**
@@ -3855,12 +4251,12 @@ var Dn = /** @class */ function(e) {
3855
4251
  * the source of the data being parsed, etc.
3856
4252
  * @returns The parsed value, or null if the value was a FieldValue sentinel
3857
4253
  * that should not be included in the resulting parsed data.
3858
- */ function Ln(t, e) {
3859
- if (Rn(
4254
+ */ function Un(t, e) {
4255
+ if (zn(
3860
4256
  // Unwrap the API type from the Compat SDK. This will return the API type
3861
4257
  // from firestore-exp.
3862
- t = p(t))) return Mn("Unsupported field value:", e, t), jn(t, e);
3863
- if (t instanceof vn)
4258
+ t = p(t))) return Gn("Unsupported field value:", e, t), Bn(t, e);
4259
+ if (t instanceof Tn)
3864
4260
  // FieldValues usually parse into transforms (except deleteField())
3865
4261
  // in which case we do not want to include this field in our parsed data
3866
4262
  // (as doing so will overwrite the field directly prior to the transform
@@ -3872,7 +4268,7 @@ var Dn = /** @class */ function(e) {
3872
4268
  */
3873
4269
  return function(t, e) {
3874
4270
  // Sentinels are only supported with writes, and not within arrays.
3875
- if (!Tn(e.tt)) throw e.ut(t._methodName + "() can only be used with update() and set()");
4271
+ if (!An(e.tt)) throw e.ut(t._methodName + "() can only be used with update() and set()");
3876
4272
  if (!e.path) throw e.ut(t._methodName + "() is not currently supported inside arrays");
3877
4273
  var n = t._toFieldTransform(e);
3878
4274
  n && e.fieldTransforms.push(n);
@@ -3895,7 +4291,7 @@ var Dn = /** @class */ function(e) {
3895
4291
  if (e.settings.rt && 4 /* ArrayArgument */ !== e.tt) throw e.ut("Nested arrays are not supported");
3896
4292
  return function(t, e) {
3897
4293
  for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {
3898
- var a = Ln(o[i], e.ot(r));
4294
+ var a = Un(o[i], e.ot(r));
3899
4295
  null == a && (
3900
4296
  // Just include nulls in the array for fields being replaced with a
3901
4297
  // sentinel.
@@ -3914,7 +4310,7 @@ var Dn = /** @class */ function(e) {
3914
4310
  if (null === (t = p(t))) return {
3915
4311
  nullValue: "NULL_VALUE"
3916
4312
  };
3917
- if ("number" == typeof t) return de(e.q, t);
4313
+ if ("number" == typeof t) return we(e.q, t);
3918
4314
  if ("boolean" == typeof t) return {
3919
4315
  booleanValue: t
3920
4316
  };
@@ -3924,7 +4320,7 @@ var Dn = /** @class */ function(e) {
3924
4320
  if (t instanceof Date) {
3925
4321
  var n = bt.fromDate(t);
3926
4322
  return {
3927
- timestampValue: Pe(e.q, n)
4323
+ timestampValue: Re(e.q, n)
3928
4324
  };
3929
4325
  }
3930
4326
  if (t instanceof bt) {
@@ -3933,30 +4329,30 @@ var Dn = /** @class */ function(e) {
3933
4329
  // truncation immediately without waiting for the backend to do that.
3934
4330
  var r = new bt(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
3935
4331
  return {
3936
- timestampValue: Pe(e.q, r)
4332
+ timestampValue: Re(e.q, r)
3937
4333
  };
3938
4334
  }
3939
- if (t instanceof gn) return {
4335
+ if (t instanceof En) return {
3940
4336
  geoPointValue: {
3941
4337
  latitude: t.latitude,
3942
4338
  longitude: t.longitude
3943
4339
  }
3944
4340
  };
3945
- if (t instanceof yn) return {
3946
- bytesValue: Ne(e.q, t._byteString)
4341
+ if (t instanceof _n) return {
4342
+ bytesValue: xe(e.q, t._byteString)
3947
4343
  };
3948
- if (t instanceof an) {
4344
+ if (t instanceof fn) {
3949
4345
  var i = e.databaseId, o = t.firestore._databaseId;
3950
4346
  if (!o.isEqual(i)) throw e.ut("Document reference is for database " + o.projectId + "/" + o.database + " but should be for database " + i.projectId + "/" + i.database);
3951
4347
  return {
3952
- referenceValue: Oe(t.firestore._databaseId || e.databaseId, t._key.path)
4348
+ referenceValue: je(t.firestore._databaseId || e.databaseId, t._key.path)
3953
4349
  };
3954
4350
  }
3955
4351
  throw e.ut("Unsupported field value: " + at(t));
3956
4352
  }(t, e);
3957
4353
  }
3958
4354
 
3959
- function jn(t, e) {
4355
+ function Bn(t, e) {
3960
4356
  var n = {};
3961
4357
  return function(t) {
3962
4358
  for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;
@@ -3964,8 +4360,8 @@ function jn(t, e) {
3964
4360
  }(t) ?
3965
4361
  // If we encounter an empty object, we explicitly add it to the update
3966
4362
  // mask to ensure that the server creates a map entry.
3967
- e.path && e.path.length > 0 && e.fieldMask.push(e.path) : St(t, (function(t, r) {
3968
- var i = Ln(r, e.nt(t));
4363
+ e.path && e.path.length > 0 && e.fieldMask.push(e.path) : Et(t, (function(t, r) {
4364
+ var i = Un(r, e.nt(t));
3969
4365
  null != i && (n[t] = i);
3970
4366
  })), {
3971
4367
  mapValue: {
@@ -3974,12 +4370,12 @@ function jn(t, e) {
3974
4370
  };
3975
4371
  }
3976
4372
 
3977
- function Rn(t) {
3978
- 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);
4373
+ function zn(t) {
4374
+ return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof bt || t instanceof En || t instanceof _n || t instanceof fn || t instanceof Tn);
3979
4375
  }
3980
4376
 
3981
- function Mn(t, e, n) {
3982
- if (!Rn(n) || !function(t) {
4377
+ function Gn(t, e, n) {
4378
+ if (!zn(n) || !function(t) {
3983
4379
  return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
3984
4380
  }(n)) {
3985
4381
  var r = at(n);
@@ -3989,20 +4385,20 @@ function Mn(t, e, n) {
3989
4385
 
3990
4386
  /**
3991
4387
  * Helper that calls fromDotSeparatedString() but wraps any error thrown.
3992
- */ function xn(t, e, n) {
4388
+ */ function Kn(t, e, n) {
3993
4389
  if (
3994
4390
  // If required, replace the FieldPath Compat class with with the firestore-exp
3995
4391
  // FieldPath.
3996
- (e = p(e)) instanceof dn) return e._internalPath;
3997
- if ("string" == typeof e) return Bn(t, e);
3998
- throw Gn("Field path arguments must be of type string or ", t,
4392
+ (e = p(e)) instanceof wn) return e._internalPath;
4393
+ if ("string" == typeof e) return Wn(t, e);
4394
+ throw Hn("Field path arguments must be of type string or ", t,
3999
4395
  /* hasConverter= */ !1,
4000
4396
  /* path= */ void 0, n);
4001
4397
  }
4002
4398
 
4003
4399
  /**
4004
4400
  * Matches any characters in a field path string that are reserved.
4005
- */ var Un = new RegExp("[~\\*/\\[\\]]");
4401
+ */ var Qn = new RegExp("[~\\*/\\[\\]]");
4006
4402
 
4007
4403
  /**
4008
4404
  * Wraps fromDotSeparatedString with an error message about the method that
@@ -4012,29 +4408,29 @@ function Mn(t, e, n) {
4012
4408
  * split on dots.
4013
4409
  * @param targetDoc - The document against which the field path will be
4014
4410
  * evaluated.
4015
- */ function Bn(t, e, n) {
4016
- if (e.search(Un) >= 0) throw Gn("Invalid field path (" + e + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
4411
+ */ function Wn(t, e, n) {
4412
+ if (e.search(Qn) >= 0) throw Hn("Invalid field path (" + e + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
4017
4413
  /* hasConverter= */ !1,
4018
4414
  /* path= */ void 0, n);
4019
4415
  try {
4020
- return (new (dn.bind.apply(dn, r([ void 0 ], e.split(".")))))._internalPath;
4416
+ return (new (wn.bind.apply(wn, r([ void 0 ], e.split(".")))))._internalPath;
4021
4417
  } catch (r) {
4022
- throw Gn("Invalid field path (" + e + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
4418
+ throw Hn("Invalid field path (" + e + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
4023
4419
  /* hasConverter= */ !1,
4024
4420
  /* path= */ void 0, n);
4025
4421
  }
4026
4422
  }
4027
4423
 
4028
- function Gn(t, e, n, r, i) {
4424
+ function Hn(t, e, n, r, i) {
4029
4425
  var o = r && !r.isEmpty(), a = void 0 !== i, s = "Function " + e + "() called with invalid data";
4030
4426
  n && (s += " (via `toFirestore()`)");
4031
4427
  var u = "";
4032
4428
  return (o || a) && (u += " (found", o && (u += " in field " + r), a && (u += " in document " + i),
4033
- u += ")"), new x(V, (s += ". ") + t + u)
4429
+ u += ")"), new M(V, (s += ". ") + t + u)
4034
4430
  /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
4035
4431
  }
4036
4432
 
4037
- function zn(t, e) {
4433
+ function Yn(t, e) {
4038
4434
  return t.some((function(t) {
4039
4435
  return t.isEqual(e);
4040
4436
  }));
@@ -4064,7 +4460,7 @@ function zn(t, e) {
4064
4460
  * For a `DocumentSnapshot` that points to a non-existing document, any data
4065
4461
  * access will return 'undefined'. You can use the `exists()` method to
4066
4462
  * explicitly verify a document's existence.
4067
- */ var Qn = /** @class */ function() {
4463
+ */ var $n = /** @class */ function() {
4068
4464
  // Note: This class is stripped down version of the DocumentSnapshot in
4069
4465
  // the legacy SDK. The changes are:
4070
4466
  // - No support for SnapshotMetadata.
@@ -4085,7 +4481,7 @@ function zn(t, e) {
4085
4481
  * The `DocumentReference` for the document included in the `DocumentSnapshot`.
4086
4482
  */
4087
4483
  get: function() {
4088
- return new an(this._firestore, this._converter, this._key);
4484
+ return new fn(this._firestore, this._converter, this._key);
4089
4485
  },
4090
4486
  enumerable: !1,
4091
4487
  configurable: !0
@@ -4110,7 +4506,7 @@ function zn(t, e) {
4110
4506
  if (this._converter) {
4111
4507
  // We only want to use the converter and create a new DocumentSnapshot
4112
4508
  // if a converter has been provided.
4113
- var t = new Kn(this._firestore, this._userDataWriter, this._key, this._document,
4509
+ var t = new Xn(this._firestore, this._userDataWriter, this._key, this._document,
4114
4510
  /* converter= */ null);
4115
4511
  return this._converter.fromFirestore(t);
4116
4512
  }
@@ -4130,11 +4526,11 @@ function zn(t, e) {
4130
4526
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4131
4527
  t.prototype.get = function(t) {
4132
4528
  if (this._document) {
4133
- var e = this._document.data.field(Yn("DocumentSnapshot.get", t));
4529
+ var e = this._document.data.field(tr("DocumentSnapshot.get", t));
4134
4530
  if (null !== e) return this._userDataWriter.convertValue(e);
4135
4531
  }
4136
4532
  }, t;
4137
- }(), Kn = /** @class */ function(e) {
4533
+ }(), Xn = /** @class */ function(e) {
4138
4534
  function n() {
4139
4535
  return null !== e && e.apply(this, arguments) || this;
4140
4536
  }
@@ -4146,7 +4542,7 @@ function zn(t, e) {
4146
4542
  */ return t(n, e), n.prototype.data = function() {
4147
4543
  return e.prototype.data.call(this);
4148
4544
  }, n;
4149
- }(Qn), Hn = /** @class */ function() {
4545
+ }($n), Jn = /** @class */ function() {
4150
4546
  /** @hideconstructor */
4151
4547
  function t(t, e) {
4152
4548
  this._docs = e, this.query = t;
@@ -4200,15 +4596,15 @@ function zn(t, e) {
4200
4596
  * @param right - A snapshot to compare.
4201
4597
  * @returns true if the snapshots are equal.
4202
4598
  */
4203
- function Wn(t, e) {
4204
- return t = p(t), e = p(e), t instanceof Qn && e instanceof Qn ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Hn && e instanceof Hn && pn(t.query, e.query) && wt(t.docs, e.docs, Wn)
4599
+ function Zn(t, e) {
4600
+ return t = p(t), e = p(e), t instanceof $n && e instanceof $n ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Jn && e instanceof Jn && gn(t.query, e.query) && wt(t.docs, e.docs, Zn)
4205
4601
  /**
4206
4602
  * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
4207
4603
  */;
4208
4604
  }
4209
4605
 
4210
- function Yn(t, e) {
4211
- return "string" == typeof e ? Bn(t, e) : e instanceof dn ? e._internalPath : e._delegate._internalPath;
4606
+ function tr(t, e) {
4607
+ return "string" == typeof e ? Wn(t, e) : e instanceof wn ? e._internalPath : e._delegate._internalPath;
4212
4608
  }
4213
4609
 
4214
4610
  /**
@@ -4234,7 +4630,7 @@ function Yn(t, e) {
4234
4630
  * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and
4235
4631
  * can then be passed to {@link query} to create a new query instance that
4236
4632
  * also contains this `QueryConstraint`.
4237
- */ var $n = function() {};
4633
+ */ var er = function() {};
4238
4634
 
4239
4635
  /**
4240
4636
  * Creates a new immutable instance of {@link Query} that is extended to also include
@@ -4244,7 +4640,7 @@ function Yn(t, e) {
4244
4640
  * @param queryConstraints - The list of {@link QueryConstraint}s to apply.
4245
4641
  * @throws if any of the provided query constraints cannot be combined with the
4246
4642
  * existing or new constraints.
4247
- */ function Xn(t) {
4643
+ */ function nr(t) {
4248
4644
  for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
4249
4645
  for (var r = 0, i = e; r < i.length; r++) {
4250
4646
  var o = i[r];
@@ -4253,39 +4649,39 @@ function Yn(t, e) {
4253
4649
  return t;
4254
4650
  }
4255
4651
 
4256
- var Jn = /** @class */ function(e) {
4652
+ var rr = /** @class */ function(e) {
4257
4653
  function n(t, n, r) {
4258
4654
  var i = this;
4259
4655
  return (i = e.call(this) || this).dt = t, i.wt = n, i.yt = r, i.type = "where",
4260
4656
  i;
4261
4657
  }
4262
4658
  return t(n, e), n.prototype._apply = function(t) {
4263
- var e = In(t.firestore), n = function(t, e, n, r, i, o, a) {
4659
+ var e = Pn(t.firestore), n = function(t, e, n, r, i, o, a) {
4264
4660
  var s;
4265
4661
  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().");
4662
+ 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
4663
  if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
4268
- pr(a, o);
4664
+ gr(a, o);
4269
4665
  for (var u = [], c = 0, l = a; c < l.length; c++) {
4270
4666
  var f = l[c];
4271
- u.push(hr(r, t, f));
4667
+ u.push(vr(r, t, f));
4272
4668
  }
4273
4669
  s = {
4274
4670
  arrayValue: {
4275
4671
  values: u
4276
4672
  }
4277
4673
  };
4278
- } else s = hr(r, t, a);
4279
- } else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || pr(a, o),
4280
- s = Cn(n, "where", a,
4674
+ } else s = vr(r, t, a);
4675
+ } else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || gr(a, o),
4676
+ s = Mn(n, "where", a,
4281
4677
  /* allowArrays= */ "in" /* IN */ === o || "not-in" /* NOT_IN */ === o);
4282
- var h = Wt.create(i, o, s);
4678
+ var h = te.create(i, o, s);
4283
4679
  return function(t, e) {
4284
- if (e.N()) {
4285
- 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() + "'");
4287
- var r = ce(t);
4288
- null !== r && dr(t, e.field, r);
4680
+ if (e.D()) {
4681
+ var n = ye(t);
4682
+ 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() + "'");
4683
+ var r = de(t);
4684
+ null !== r && wr(t, e.field, r);
4289
4685
  }
4290
4686
  var i = function(t, e) {
4291
4687
  for (var n = 0, r = t.filters; n < r.length; n++) {
@@ -4329,15 +4725,15 @@ var Jn = /** @class */ function(e) {
4329
4725
  }(e.op));
4330
4726
  if (null !== i)
4331
4727
  // 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.");
4728
+ 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
4729
  }(t, h), h;
4334
4730
  }(t._query, 0, e, t.firestore._databaseId, this.dt, this.wt, this.yt);
4335
- return new sn(t.firestore, t.converter, function(t, e) {
4731
+ return new hn(t.firestore, t.converter, function(t, e) {
4336
4732
  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);
4733
+ return new pe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
4338
4734
  }(t._query, n));
4339
4735
  }, n;
4340
- }($n);
4736
+ }(er);
4341
4737
 
4342
4738
  /**
4343
4739
  * Creates a {@link QueryConstraint} that enforces that documents must contain the
@@ -4349,36 +4745,36 @@ var Jn = /** @class */ function(e) {
4349
4745
  * "&lt;=", "!=").
4350
4746
  * @param value - The value for comparison
4351
4747
  * @returns The created {@link Query}.
4352
- */ function Zn(t, e, n) {
4353
- var r = e, i = Yn("where", t);
4354
- return new Jn(i, r, n);
4748
+ */ function ir(t, e, n) {
4749
+ var r = e, i = tr("where", t);
4750
+ return new rr(i, r, n);
4355
4751
  }
4356
4752
 
4357
- var tr = /** @class */ function(e) {
4753
+ var or = /** @class */ function(e) {
4358
4754
  function n(t, n) {
4359
4755
  var r = this;
4360
4756
  return (r = e.call(this) || this).dt = t, r._t = n, r.type = "orderBy", r;
4361
4757
  }
4362
4758
  return t(n, e), n.prototype._apply = function(t) {
4363
4759
  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);
4760
+ if (null !== t.startAt) throw new M(V, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
4761
+ if (null !== t.endAt) throw new M(V, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
4762
+ var r = new le(e, n);
4367
4763
  return function(t, e) {
4368
- if (null === ce(t)) {
4764
+ if (null === de(t)) {
4369
4765
  // This is the first order by. It must match any inequality.
4370
- var n = le(t);
4371
- null !== n && dr(t, n, e.field);
4766
+ var n = ye(t);
4767
+ null !== n && wr(t, n, e.field);
4372
4768
  }
4373
4769
  }(t, r), r;
4374
4770
  }(t._query, this.dt, this._t);
4375
- return new sn(t.firestore, t.converter, function(t, e) {
4771
+ return new hn(t.firestore, t.converter, function(t, e) {
4376
4772
  // TODO(dimond): validate that orderBy does not list the same key twice.
4377
4773
  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);
4774
+ return new pe(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
4379
4775
  }(t._query, e));
4380
4776
  }, n;
4381
- }($n);
4777
+ }(er);
4382
4778
 
4383
4779
  /**
4384
4780
  * Creates a {@link QueryConstraint} that sorts the query result by the
@@ -4388,31 +4784,31 @@ var tr = /** @class */ function(e) {
4388
4784
  * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
4389
4785
  * not specified, order will be ascending.
4390
4786
  * @returns The created {@link Query}.
4391
- */ function er(t, e) {
4787
+ */ function ar(t, e) {
4392
4788
  void 0 === e && (e = "asc");
4393
- var n = e, r = Yn("orderBy", t);
4394
- return new tr(r, n);
4789
+ var n = e, r = tr("orderBy", t);
4790
+ return new or(r, n);
4395
4791
  }
4396
4792
 
4397
- var nr = /** @class */ function(e) {
4793
+ var sr = /** @class */ function(e) {
4398
4794
  function n(t, n, r) {
4399
4795
  var i = this;
4400
4796
  return (i = e.call(this) || this).type = t, i.gt = n, i.vt = r, i;
4401
4797
  }
4402
4798
  return t(n, e), n.prototype._apply = function(t) {
4403
- 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);
4799
+ return new hn(t.firestore, t.converter, function(t, e, n) {
4800
+ return new pe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
4405
4801
  }(t._query, this.gt, this.vt));
4406
4802
  }, n;
4407
- }($n);
4803
+ }(er);
4408
4804
 
4409
4805
  /**
4410
4806
  * Creates a {@link QueryConstraint} that only returns the first matching documents.
4411
4807
  *
4412
4808
  * @param limit - The maximum number of items to return.
4413
4809
  * @returns The created {@link Query}.
4414
- */ function rr(t) {
4415
- return ut("limit", t), new nr("limit", t, "F" /* First */)
4810
+ */ function ur(t) {
4811
+ return ut("limit", t), new sr("limit", t, "F" /* First */)
4416
4812
  /**
4417
4813
  * Creates a {@link QueryConstraint} that only returns the last matching documents.
4418
4814
  *
@@ -4424,62 +4820,62 @@ var nr = /** @class */ function(e) {
4424
4820
  */;
4425
4821
  }
4426
4822
 
4427
- function ir(t) {
4428
- return ut("limitToLast", t), new nr("limitToLast", t, "L" /* Last */);
4823
+ function cr(t) {
4824
+ return ut("limitToLast", t), new sr("limitToLast", t, "L" /* Last */);
4429
4825
  }
4430
4826
 
4431
- var or = /** @class */ function(e) {
4827
+ var lr = /** @class */ function(e) {
4432
4828
  function n(t, n, r) {
4433
4829
  var i = this;
4434
4830
  return (i = e.call(this) || this).type = t, i.bt = n, i.Et = r, i;
4435
4831
  }
4436
4832
  return t(n, e), n.prototype._apply = function(t) {
4437
- var e = fr(t, this.type, this.bt, this.Et);
4438
- 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);
4833
+ var e = mr(t, this.type, this.bt, this.Et);
4834
+ return new hn(t.firestore, t.converter, function(t, e) {
4835
+ return new pe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
4440
4836
  }(t._query, e));
4441
4837
  }, n;
4442
- }($n);
4838
+ }(er);
4443
4839
 
4444
- function ar() {
4840
+ function fr() {
4445
4841
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4446
- return new or("startAt", t,
4842
+ return new lr("startAt", t,
4447
4843
  /*inclusive=*/ !0);
4448
4844
  }
4449
4845
 
4450
- function sr() {
4846
+ function hr() {
4451
4847
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4452
- return new or("startAfter", t,
4848
+ return new lr("startAfter", t,
4453
4849
  /*inclusive=*/ !1);
4454
4850
  }
4455
4851
 
4456
- var ur = /** @class */ function(e) {
4852
+ var pr = /** @class */ function(e) {
4457
4853
  function n(t, n, r) {
4458
4854
  var i = this;
4459
4855
  return (i = e.call(this) || this).type = t, i.bt = n, i.Et = r, i;
4460
4856
  }
4461
4857
  return t(n, e), n.prototype._apply = function(t) {
4462
- var e = fr(t, this.type, this.bt, this.Et);
4463
- 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);
4858
+ var e = mr(t, this.type, this.bt, this.Et);
4859
+ return new hn(t.firestore, t.converter, function(t, e) {
4860
+ return new pe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
4465
4861
  }(t._query, e));
4466
4862
  }, n;
4467
- }($n);
4863
+ }(er);
4468
4864
 
4469
- function cr() {
4865
+ function dr() {
4470
4866
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4471
- return new ur("endBefore", t,
4867
+ return new pr("endBefore", t,
4472
4868
  /*inclusive=*/ !1);
4473
4869
  }
4474
4870
 
4475
- function lr() {
4871
+ function yr() {
4476
4872
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4477
- return new ur("endAt", t, /*inclusive=*/ !0);
4873
+ return new pr("endAt", t, /*inclusive=*/ !0);
4478
4874
  }
4479
4875
 
4480
- /** Helper function to create a bound from a document or fields */ function fr(t, e, n, r) {
4481
- 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 + "().");
4876
+ /** Helper function to create a bound from a document or fields */ function mr(t, e, n, r) {
4877
+ if (n[0] = p(n[0]), n[0] instanceof $n) return function(t, e, n, r, i) {
4878
+ if (!r) throw new M(P, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
4483
4879
  // Because people expect to continue/end a query at the exact document
4484
4880
  // provided, we need to use the implicit sort order rather than the explicit
4485
4881
  // sort order, because it's guaranteed to contain the document key. That way
@@ -4487,65 +4883,65 @@ function lr() {
4487
4883
  // the provided document. Without the key (by using the explicit sort
4488
4884
  // orders), multiple documents could match the position, yielding duplicate
4489
4885
  // results.
4490
- for (var o = [], a = 0, s = he(t); a < s.length; a++) {
4886
+ for (var o = [], a = 0, s = ve(t); a < s.length; a++) {
4491
4887
  var u = s[a];
4492
- if (u.field.isKeyField()) o.push(Rt(e, r.key)); else {
4888
+ if (u.field.isKeyField()) o.push(Gt(e, r.key)); else {
4493
4889
  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.)');
4890
+ if (Rt(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
4891
  if (null === c) {
4496
4892
  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.");
4893
+ 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
4894
  }
4499
4895
  o.push(c);
4500
4896
  }
4501
4897
  }
4502
- return new re(o, i);
4898
+ return new ce(o, i);
4503
4899
  }(t._query, t.firestore._databaseId, e, n[0]._document, r);
4504
- var i = In(t.firestore);
4900
+ var i = Pn(t.firestore);
4505
4901
  return function(t, e, n, r, i, o) {
4506
4902
  // Use explicit order by's because it has to match the query the user made
4507
4903
  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");
4904
+ 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
4905
  for (var s = [], u = 0; u < i.length; u++) {
4510
4906
  var c = i[u];
4511
4907
  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.");
4908
+ if ("string" != typeof c) throw new M(V, "Invalid query. Expected a string for document ID in " + r + "(), but got a " + typeof c);
4909
+ if (!me(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
4910
  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.");
4911
+ 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
4912
  var f = new nt(l);
4517
- s.push(Rt(e, f));
4913
+ s.push(Gt(e, f));
4518
4914
  } else {
4519
- var h = Cn(n, r, c);
4915
+ var h = Mn(n, r, c);
4520
4916
  s.push(h);
4521
4917
  }
4522
4918
  }
4523
- return new re(s, o);
4919
+ return new ce(s, o);
4524
4920
  }(t._query, t.firestore._databaseId, i, e, n, r);
4525
4921
  }
4526
4922
 
4527
- function hr(t, e, n) {
4923
+ function vr(t, e, n) {
4528
4924
  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.");
4925
+ 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.");
4926
+ if (!me(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
4927
  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));
4928
+ 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 + ").");
4929
+ return Gt(t, new nt(r));
4534
4930
  }
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) + ".");
4931
+ if (n instanceof fn) return Gt(t, n._key);
4932
+ 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
4933
  }
4538
4934
 
4539
4935
  /**
4540
4936
  * Validates that the value passed into a disjunctive filter satisfies all
4541
4937
  * array requirements.
4542
- */ 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.");
4938
+ */ function gr(t, e) {
4939
+ if (!Array.isArray(t) || 0 === t.length) throw new M(V, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
4940
+ if (t.length > 10) throw new M(V, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
4545
4941
  }
4546
4942
 
4547
- 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.");
4943
+ function wr(t, e, n) {
4944
+ 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
4945
  }
4550
4946
 
4551
4947
  /**
@@ -4594,28 +4990,28 @@ function dr(t, e, n) {
4594
4990
  * because we want to provide the user with a more specific error message if
4595
4991
  * their `set()` or fails due to invalid data originating from a `toFirestore()`
4596
4992
  * call.
4597
- */ function mr(t, e, n) {
4993
+ */ function br(t, e, n) {
4598
4994
  // Cast to `any` in order to satisfy the union type constraint on
4599
4995
  // toFirestore().
4600
4996
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4601
4997
  return t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e;
4602
4998
  }
4603
4999
 
4604
- var yr = /** @class */ function(e) {
5000
+ var _r = /** @class */ function(e) {
4605
5001
  function n(t) {
4606
5002
  var n = this;
4607
5003
  return (n = e.call(this) || this).firestore = t, n;
4608
5004
  }
4609
5005
  return t(n, e), n.prototype.convertBytes = function(t) {
4610
- return new yn(t);
5006
+ return new _n(t);
4611
5007
  }, n.prototype.convertReference = function(t) {
4612
5008
  var e = this.convertDocumentKey(t, this.firestore._databaseId);
4613
- return new an(this.firestore, /* converter= */ null, e);
5009
+ return new fn(this.firestore, /* converter= */ null, e);
4614
5010
  }, n;
4615
5011
  }(/** @class */ function() {
4616
5012
  function t() {}
4617
5013
  return t.prototype.convertValue = function(t, e) {
4618
- switch (void 0 === e && (e = "none"), Ft(t)) {
5014
+ switch (void 0 === e && (e = "none"), jt(t)) {
4619
5015
  case 0 /* NullValue */ :
4620
5016
  return null;
4621
5017
 
@@ -4623,7 +5019,7 @@ var yr = /** @class */ function(e) {
4623
5019
  return t.booleanValue;
4624
5020
 
4625
5021
  case 2 /* NumberValue */ :
4626
- return Vt(t.integerValue || t.doubleValue);
5022
+ return Ot(t.integerValue || t.doubleValue);
4627
5023
 
4628
5024
  case 3 /* TimestampValue */ :
4629
5025
  return this.convertTimestamp(t.timestampValue);
@@ -4635,7 +5031,7 @@ var yr = /** @class */ function(e) {
4635
5031
  return t.stringValue;
4636
5032
 
4637
5033
  case 6 /* BlobValue */ :
4638
- return this.convertBytes(Dt(t.bytesValue));
5034
+ return this.convertBytes(qt(t.bytesValue));
4639
5035
 
4640
5036
  case 7 /* RefValue */ :
4641
5037
  return this.convertReference(t.referenceValue);
@@ -4650,15 +5046,15 @@ var yr = /** @class */ function(e) {
4650
5046
  return this.convertObject(t.mapValue, e);
4651
5047
 
4652
5048
  default:
4653
- throw S();
5049
+ throw E();
4654
5050
  }
4655
5051
  }, t.prototype.convertObject = function(t, e) {
4656
5052
  var n = this, r = {};
4657
- return St(t.fields, (function(t, i) {
5053
+ return Et(t.fields, (function(t, i) {
4658
5054
  r[t] = n.convertValue(i, e);
4659
5055
  })), r;
4660
5056
  }, t.prototype.convertGeoPoint = function(t) {
4661
- return new gn(Vt(t.latitude), Vt(t.longitude));
5057
+ return new En(Ot(t.latitude), Ot(t.longitude));
4662
5058
  }, t.prototype.convertArray = function(t, e) {
4663
5059
  var n = this;
4664
5060
  return (t.values || []).map((function(t) {
@@ -4667,21 +5063,21 @@ var yr = /** @class */ function(e) {
4667
5063
  }, t.prototype.convertServerTimestamp = function(t, e) {
4668
5064
  switch (e) {
4669
5065
  case "previous":
4670
- var n = Nt(t);
5066
+ var n = xt(t);
4671
5067
  return null == n ? null : this.convertValue(n, e);
4672
5068
 
4673
5069
  case "estimate":
4674
- return this.convertTimestamp(qt(t));
5070
+ return this.convertTimestamp(Ct(t));
4675
5071
 
4676
5072
  default:
4677
5073
  return null;
4678
5074
  }
4679
5075
  }, t.prototype.convertTimestamp = function(t) {
4680
- var e = kt(t);
5076
+ var e = Ft(t);
4681
5077
  return new bt(e.seconds, e.nanos);
4682
5078
  }, t.prototype.convertDocumentKey = function(t, e) {
4683
5079
  var n = Z.fromString(t);
4684
- E(ze(n));
5080
+ S(Ye(n));
4685
5081
  var r = new X(n.get(1), n.get(3)), i = new nt(n.popFirst(5));
4686
5082
  return r.isEqual(e) ||
4687
5083
  // TODO(b/64130202): Somehow support foreign references.
@@ -4702,12 +5098,12 @@ var yr = /** @class */ function(e) {
4702
5098
  * @param reference - The reference of the document to fetch.
4703
5099
  * @returns A Promise resolved with a `DocumentSnapshot` containing the current
4704
5100
  * document contents.
4705
- */ function vr(t) {
4706
- var e = Je((t = st(t, an)).firestore), n = new yr(t.firestore);
4707
- return Ye(e, [ t._key ]).then((function(e) {
4708
- E(1 === e.length);
5101
+ */ function Tr(t) {
5102
+ var e = rn((t = st(t, fn)).firestore), n = new _r(t.firestore);
5103
+ return tn(e, [ t._key ]).then((function(e) {
5104
+ S(1 === e.length);
4709
5105
  var r = e[0];
4710
- return new Qn(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
5106
+ return new $n(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
4711
5107
  }));
4712
5108
  }
4713
5109
 
@@ -4722,35 +5118,35 @@ var yr = /** @class */ function(e) {
4722
5118
  *
4723
5119
  * @param query - The `Query` to execute.
4724
5120
  * @returns A Promise that will be resolved with the results of the query.
4725
- */ function gr(t) {
5121
+ */ function Er(t) {
4726
5122
  !function(t) {
4727
- if (ue(t) && 0 === t.explicitOrderBy.length) throw new x(j, "limitToLast() queries require specifying at least one orderBy() clause");
4728
- }((t = st(t, sn))._query);
4729
- var e = Je(t.firestore), n = new yr(t.firestore);
4730
- return $e(e, t._query).then((function(e) {
5123
+ if ("L" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new M(C, "limitToLast() queries require specifying at least one orderBy() clause");
5124
+ }((t = st(t, hn))._query);
5125
+ var e = rn(t.firestore), n = new _r(t.firestore);
5126
+ return en(e, t._query).then((function(e) {
4731
5127
  var r = e.map((function(e) {
4732
- return new Kn(t.firestore, n, e.key, e, t.converter);
5128
+ return new Xn(t.firestore, n, e.key, e, t.converter);
4733
5129
  }));
4734
- return ue(t._query) &&
5130
+ return "L" /* Last */ === t._query.limitType &&
4735
5131
  // Limit to last queries reverse the orderBy constraint that was
4736
5132
  // specified by the user. As such, we need to reverse the order of the
4737
5133
  // results to return the documents in the expected order.
4738
- r.reverse(), new Hn(t, r);
5134
+ r.reverse(), new Jn(t, r);
4739
5135
  }));
4740
5136
  }
4741
5137
 
4742
- 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);
4744
- return We(Je(t.firestore), [ i.toMutation(t._key, _e.none()) ]);
5138
+ function Sr(t, e, n) {
5139
+ var r = br((t = st(t, fn)).converter, e, n), i = Nn(Pn(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
5140
+ return Ze(rn(t.firestore), [ i.toMutation(t._key, Ie.none()) ]);
4745
5141
  }
4746
5142
 
4747
- function br(t, e, n) {
5143
+ function kr(t, e, n) {
4748
5144
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
4749
- var o, a = In((t = st(t, an)).firestore);
5145
+ var o, a = Pn((t = st(t, fn)).firestore);
4750
5146
  // For Compat types, we have to "extract" the underlying types before
4751
5147
  // performing validation.
4752
- return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(a, "updateDoc", t._key, e, n, r) : Fn(a, "updateDoc", t._key, e),
4753
- We(Je(t.firestore), [ o.toMutation(t._key, _e.exists(!0)) ]);
5148
+ return o = "string" == typeof (e = p(e)) || e instanceof wn ? jn(a, "updateDoc", t._key, e, n, r) : Ln(a, "updateDoc", t._key, e),
5149
+ Ze(rn(t.firestore), [ o.toMutation(t._key, Ie.exists(!0)) ]);
4754
5150
  }
4755
5151
 
4756
5152
  /**
@@ -4764,8 +5160,8 @@ function br(t, e, n) {
4764
5160
  * @param reference - A reference to the document to delete.
4765
5161
  * @returns A `Promise` resolved once the document has been successfully
4766
5162
  * deleted from the backend.
4767
- */ function _r(t) {
4768
- return We(Je((t = st(t, an)).firestore), [ new Ie(t._key, _e.none()) ]);
5163
+ */ function Ir(t) {
5164
+ return Ze(rn((t = st(t, fn)).firestore), [ new Pe(t._key, Ie.none()) ]);
4769
5165
  }
4770
5166
 
4771
5167
  /**
@@ -4782,9 +5178,9 @@ function br(t, e, n) {
4782
5178
  * @throws Error - If the provided input is not a valid Firestore document.
4783
5179
  * @returns A `Promise` resolved with a `DocumentReference` pointing to the
4784
5180
  * newly created document after it has been written to the backend.
4785
- */ 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, {});
4787
- return We(Je(t.firestore), [ i.toMutation(n._key, _e.exists(!1)) ]).then((function() {
5181
+ */ function Ar(t, e) {
5182
+ var n = mn(t = st(t, pn)), r = br(t.converter, e), i = Nn(Pn(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
5183
+ return Ze(rn(t.firestore), [ i.toMutation(n._key, Ie.exists(!1)) ]).then((function() {
4788
5184
  return n;
4789
5185
  }));
4790
5186
  }
@@ -4808,15 +5204,15 @@ function br(t, e, n) {
4808
5204
  /**
4809
5205
  * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
4810
5206
  * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
4811
- */ function Sr() {
4812
- return new kn("deleteField");
5207
+ */ function Vr() {
5208
+ return new Fn("deleteField");
4813
5209
  }
4814
5210
 
4815
5211
  /**
4816
5212
  * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
4817
5213
  * include a server-generated timestamp in the written data.
4818
- */ function Er() {
4819
- return new Dn("serverTimestamp");
5214
+ */ function Dr() {
5215
+ return new qn("serverTimestamp");
4820
5216
  }
4821
5217
 
4822
5218
  /**
@@ -4830,11 +5226,11 @@ function br(t, e, n) {
4830
5226
  * @param elements - The elements to union into the array.
4831
5227
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
4832
5228
  * `updateDoc()`.
4833
- */ function Ir() {
5229
+ */ function Pr() {
4834
5230
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4835
5231
  // NOTE: We don't actually parse the data until it's used in set() or
4836
5232
  // update() since we'd need the Firestore instance to do this.
4837
- return new Pn("arrayUnion", t);
5233
+ return new Rn("arrayUnion", t);
4838
5234
  }
4839
5235
 
4840
5236
  /**
@@ -4847,11 +5243,11 @@ function br(t, e, n) {
4847
5243
  * @param elements - The elements to remove from the array.
4848
5244
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
4849
5245
  * `updateDoc()`
4850
- */ function Ar() {
5246
+ */ function Nr() {
4851
5247
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4852
5248
  // NOTE: We don't actually parse the data until it's used in set() or
4853
5249
  // update() since we'd need the Firestore instance to do this.
4854
- return new Nn("arrayRemove", t);
5250
+ return new xn("arrayRemove", t);
4855
5251
  }
4856
5252
 
4857
5253
  /**
@@ -4872,8 +5268,8 @@ function br(t, e, n) {
4872
5268
  * @param n - The value to increment by.
4873
5269
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
4874
5270
  * `updateDoc()`
4875
- */ function kr(t) {
4876
- return new qn("increment", t);
5271
+ */ function Fr(t) {
5272
+ return new Cn("increment", t);
4877
5273
  }
4878
5274
 
4879
5275
  /**
@@ -4899,24 +5295,24 @@ function br(t, e, n) {
4899
5295
  * provides methods for adding writes to the write batch. None of the writes
4900
5296
  * will be committed (or visible locally) until {@link WriteBatch.commit} is
4901
5297
  * called.
4902
- */ var Vr = /** @class */ function() {
5298
+ */ var Or = /** @class */ function() {
4903
5299
  /** @hideconstructor */
4904
5300
  function t(t, e) {
4905
5301
  this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
4906
- this._dataReader = In(t);
5302
+ this._dataReader = Pn(t);
4907
5303
  }
4908
5304
  return t.prototype.set = function(t, e, n) {
4909
5305
  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);
4911
- return this._mutations.push(o.toMutation(r._key, _e.none())), this;
5306
+ var r = qr(t, this._firestore), i = br(r.converter, e, n), o = Nn(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
5307
+ return this._mutations.push(o.toMutation(r._key, Ie.none())), this;
4912
5308
  }, t.prototype.update = function(t, e, n) {
4913
5309
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
4914
5310
  this._verifyNotCommitted();
4915
- var o, a = Dr(t, this._firestore);
5311
+ var o, a = qr(t, this._firestore);
4916
5312
  // For Compat types, we have to "extract" the underlying types before
4917
5313
  // performing validation.
4918
- return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(this._dataReader, "WriteBatch.update", a._key, e, n, r) : Fn(this._dataReader, "WriteBatch.update", a._key, e),
4919
- this._mutations.push(o.toMutation(a._key, _e.exists(!0))), this;
5314
+ return o = "string" == typeof (e = p(e)) || e instanceof wn ? jn(this._dataReader, "WriteBatch.update", a._key, e, n, r) : Ln(this._dataReader, "WriteBatch.update", a._key, e),
5315
+ this._mutations.push(o.toMutation(a._key, Ie.exists(!0))), this;
4920
5316
  },
4921
5317
  /**
4922
5318
  * Deletes the document referred to by the provided {@link DocumentReference}.
@@ -4926,8 +5322,8 @@ function br(t, e, n) {
4926
5322
  */
4927
5323
  t.prototype.delete = function(t) {
4928
5324
  this._verifyNotCommitted();
4929
- var e = Dr(t, this._firestore);
4930
- return this._mutations = this._mutations.concat(new Ie(e._key, _e.none())), this;
5325
+ var e = qr(t, this._firestore);
5326
+ return this._mutations = this._mutations.concat(new Pe(e._key, Ie.none())), this;
4931
5327
  },
4932
5328
  /**
4933
5329
  * Commits all of the writes in this write batch as a single atomic unit.
@@ -4944,12 +5340,12 @@ function br(t, e, n) {
4944
5340
  t.prototype.commit = function() {
4945
5341
  return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
4946
5342
  }, 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.");
5343
+ if (this._committed) throw new M(q, "A write batch can no longer be used after commit() has been called.");
4948
5344
  }, t;
4949
5345
  }();
4950
5346
 
4951
- function Dr(t, e) {
4952
- if ((t = p(t)).firestore !== e) throw new x(V, "Provided document reference is from a different Firestore instance.");
5347
+ function qr(t, e) {
5348
+ if ((t = p(t)).firestore !== e) throw new M(V, "Provided document reference is from a different Firestore instance.");
4953
5349
  return t;
4954
5350
  }
4955
5351
 
@@ -4965,10 +5361,10 @@ function Dr(t, e) {
4965
5361
  *
4966
5362
  * @returns A `WriteBatch` that can be used to atomically execute multiple
4967
5363
  * writes.
4968
- */ function Pr(t) {
4969
- var e = Je(t = st(t, tn));
4970
- return new Vr(t, (function(t) {
4971
- return We(e, t);
5364
+ */ function Rr(t) {
5365
+ var e = rn(t = st(t, an));
5366
+ return new Or(t, (function(t) {
5367
+ return Ze(e, t);
4972
5368
  }));
4973
5369
  }
4974
5370
 
@@ -4991,7 +5387,7 @@ function Dr(t, e) {
4991
5387
  /**
4992
5388
  * Internal transaction object responsible for accumulating the mutations to
4993
5389
  * perform and the base versions for any documents read.
4994
- */ var Nr = /** @class */ function() {
5390
+ */ var xr = /** @class */ function() {
4995
5391
  function t(t) {
4996
5392
  this.datastore = t,
4997
5393
  // The version of each document that was read during this transaction.
@@ -5015,8 +5411,8 @@ function Dr(t, e) {
5015
5411
  return n(this, (function(n) {
5016
5412
  switch (n.label) {
5017
5413
  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.");
5019
- return [ 4 /*yield*/ , Ye(this.datastore, t) ];
5414
+ if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new M(V, "Firestore transactions require all reads to be executed before all writes.");
5415
+ return [ 4 /*yield*/ , tn(this.datastore, t) ];
5020
5416
 
5021
5417
  case 1:
5022
5418
  return [ 2 /*return*/ , ((e = n.sent()).forEach((function(t) {
@@ -5035,7 +5431,7 @@ function Dr(t, e) {
5035
5431
  }
5036
5432
  this.writtenDocs.add(t.toString());
5037
5433
  }, t.prototype.delete = function(t) {
5038
- this.write(new Ie(t, this.precondition(t))), this.writtenDocs.add(t.toString());
5434
+ this.write(new Pe(t, this.precondition(t))), this.writtenDocs.add(t.toString());
5039
5435
  }, t.prototype.commit = function() {
5040
5436
  return e(this, void 0, void 0, (function() {
5041
5437
  var t, e = this;
@@ -5052,8 +5448,8 @@ function Dr(t, e) {
5052
5448
  // a `verify` operation.
5053
5449
  t.forEach((function(t, n) {
5054
5450
  var r = nt.fromPath(n);
5055
- e.mutations.push(new Ae(r, e.precondition(r)));
5056
- })), [ 4 /*yield*/ , We(this.datastore, this.mutations) ];
5451
+ e.mutations.push(new Ne(r, e.precondition(r)));
5452
+ })), [ 4 /*yield*/ , Ze(this.datastore, this.mutations) ];
5057
5453
 
5058
5454
  case 1:
5059
5455
  // For each mutation, note that the doc was written.
@@ -5064,7 +5460,7 @@ function Dr(t, e) {
5064
5460
  }, t.prototype.recordVersion = function(t) {
5065
5461
  var e;
5066
5462
  if (t.isFoundDocument()) e = t.version; else {
5067
- if (!t.isNoDocument()) throw S();
5463
+ if (!t.isNoDocument()) throw E();
5068
5464
  // For deleted docs, we must use baseVersion 0 when we overwrite them.
5069
5465
  e = _t.min();
5070
5466
  }
@@ -5072,7 +5468,7 @@ function Dr(t, e) {
5072
5468
  if (n) {
5073
5469
  if (!e.isEqual(n))
5074
5470
  // This transaction will fail no matter what.
5075
- throw new x(C, "Document version changed between two reads.");
5471
+ throw new M(R, "Document version changed between two reads.");
5076
5472
  } else this.readVersions.set(t.key.toString(), e);
5077
5473
  },
5078
5474
  /**
@@ -5081,7 +5477,7 @@ function Dr(t, e) {
5081
5477
  */
5082
5478
  t.prototype.precondition = function(t) {
5083
5479
  var e = this.readVersions.get(t.toString());
5084
- return !this.writtenDocs.has(t.toString()) && e ? _e.updateTime(e) : _e.none();
5480
+ return !this.writtenDocs.has(t.toString()) && e ? Ie.updateTime(e) : Ie.none();
5085
5481
  },
5086
5482
  /**
5087
5483
  * Returns the precondition for a document if the operation is an update.
@@ -5101,20 +5497,22 @@ function Dr(t, e) {
5101
5497
  // express that to the backend, we have to validate locally.
5102
5498
  // Note: this can change once we can send separate verify writes in the
5103
5499
  // transaction.
5104
- throw new x(V, "Can't update a document that doesn't exist.");
5500
+ throw new M(V, "Can't update a document that doesn't exist.");
5105
5501
  // Document exists, base precondition on document update time.
5106
- return _e.updateTime(e);
5502
+ return Ie.updateTime(e);
5107
5503
  }
5108
5504
  // Document was not read, so we just use the preconditions for a blind
5109
5505
  // update.
5110
- return _e.exists(!0);
5506
+ return Ie.exists(!0);
5111
5507
  }, t.prototype.write = function(t) {
5112
5508
  this.ensureCommitNotCalled(), this.mutations.push(t);
5113
5509
  }, 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 */)
5510
+ }(), Cr = {
5511
+ maxAttempts: 5
5512
+ }, Lr = /** @class */ function() {
5513
+ function t(t, e, n, r, i) {
5514
+ this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = r,
5515
+ this.deferred = i, this.Tt = n.maxAttempts, this.It = new Xe(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
5118
5516
  /** Runs the transaction and sets the result on deferred. */;
5119
5517
  }
5120
5518
  return t.prototype.run = function() {
@@ -5125,7 +5523,7 @@ function Dr(t, e) {
5125
5523
  return e(t, void 0, void 0, (function() {
5126
5524
  var t, e, r = this;
5127
5525
  return n(this, (function(n) {
5128
- return t = new Nr(this.datastore), (e = this.Rt(t)) && e.then((function(e) {
5526
+ return t = new xr(this.datastore), (e = this.Rt(t)) && e.then((function(e) {
5129
5527
  r.asyncQueue.enqueueAndForget((function() {
5130
5528
  return t.commit().then((function() {
5131
5529
  r.deferred.resolve(e);
@@ -5168,30 +5566,30 @@ function Dr(t, e) {
5168
5566
  function(t) {
5169
5567
  switch (t) {
5170
5568
  default:
5171
- return S();
5569
+ return E();
5172
5570
 
5571
+ case I:
5173
5572
  case A:
5174
- case k:
5175
5573
  case D:
5176
- case F:
5177
- case R:
5178
- case M:
5574
+ case O:
5575
+ case L:
5576
+ case j:
5179
5577
  // Unauthenticated means something went wrong with our token and we need
5180
5578
  // to retry with new credentials which will happen automatically.
5181
- case q:
5579
+ case F:
5182
5580
  return !1;
5183
5581
 
5184
5582
  case V:
5185
5583
  case P:
5186
5584
  case "already-exists":
5187
5585
  case N:
5188
- case O:
5586
+ case q:
5189
5587
  // Aborted might be retried in some scenarios, but that is dependant on
5190
5588
  // the context and should handled individually by the calling code.
5191
5589
  // See https://cloud.google.com/apis/design/errors.
5192
- case C:
5193
- case L:
5194
- case j:
5590
+ case R:
5591
+ case x:
5592
+ case C:
5195
5593
  case "data-loss":
5196
5594
  return !0;
5197
5595
  }
@@ -5203,7 +5601,7 @@ function Dr(t, e) {
5203
5601
 
5204
5602
  /**
5205
5603
  * @license
5206
- * Copyright 2019 Google LLC
5604
+ * Copyright 2022 Google LLC
5207
5605
  *
5208
5606
  * Licensed under the Apache License, Version 2.0 (the "License");
5209
5607
  * you may not use this file except in compliance with the License.
@@ -5217,10 +5615,6 @@ function Dr(t, e) {
5217
5615
  * See the License for the specific language governing permissions and
5218
5616
  * limitations under the License.
5219
5617
  */
5220
- /**
5221
- * TransactionRunner encapsulates the logic needed to run and retry transactions
5222
- * with backoff.
5223
- */
5224
5618
  /**
5225
5619
  * @license
5226
5620
  * Copyright 2020 Google LLC
@@ -5237,7 +5631,7 @@ function Dr(t, e) {
5237
5631
  * See the License for the specific language governing permissions and
5238
5632
  * limitations under the License.
5239
5633
  */
5240
- /** The Platform's 'document' implementation or null if not available. */ function Fr() {
5634
+ /** The Platform's 'document' implementation or null if not available. */ function jr() {
5241
5635
  // `document` is not always available, e.g. in ReactNative and WebWorkers.
5242
5636
  // eslint-disable-next-line no-restricted-globals
5243
5637
  return "undefined" != typeof document ? document : null;
@@ -5269,7 +5663,7 @@ function Dr(t, e) {
5269
5663
  * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type
5270
5664
  * in newer versions of TypeScript defines `finally`, which is not available in
5271
5665
  * IE.
5272
- */ var Or = /** @class */ function() {
5666
+ */ var Mr = /** @class */ function() {
5273
5667
  function t(t, e, n, r, i) {
5274
5668
  this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = i,
5275
5669
  this.deferred = new U, this.then = this.deferred.promise.then.bind(this.deferred.promise),
@@ -5321,7 +5715,7 @@ function Dr(t, e) {
5321
5715
  * guarantee that the operation will not be run.
5322
5716
  */
5323
5717
  t.prototype.cancel = function(t) {
5324
- null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new x(A, "Operation cancelled" + (t ? ": " + t : ""))));
5718
+ null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new M(I, "Operation cancelled" + (t ? ": " + t : ""))));
5325
5719
  }, t.prototype.handleDelayElapsed = function() {
5326
5720
  var t = this;
5327
5721
  this.asyncQueue.enqueueAndForget((function() {
@@ -5333,40 +5727,40 @@ function Dr(t, e) {
5333
5727
  null !== this.timerHandle && (this.removalCallback(this), clearTimeout(this.timerHandle),
5334
5728
  this.timerHandle = null);
5335
5729
  }, t;
5336
- }(), Cr = /** @class */ function() {
5730
+ }(), Ur = /** @class */ function() {
5337
5731
  function t() {
5338
5732
  var t = this;
5339
5733
  // The last promise in the queue.
5340
- this.Dt = Promise.resolve(),
5734
+ this.Nt = Promise.resolve(),
5341
5735
  // A list of retryable operations. Retryable operations are run in order and
5342
5736
  // retried with backoff.
5343
- this.Nt = [],
5737
+ this.Dt = [],
5344
5738
  // Is this AsyncQueue being shut down? Once it is set to true, it will not
5345
5739
  // be changed again.
5346
5740
  this.$t = !1,
5347
5741
  // Operations scheduled to be queued in the future. Operations are
5348
5742
  // automatically removed after they are run or canceled.
5349
- this.St = [],
5743
+ this.xt = [],
5350
5744
  // visible for testing
5351
5745
  this.Ft = null,
5352
5746
  // Flag set while there's an outstanding AsyncQueue operation, used for
5353
5747
  // assertion sanity-checks.
5354
- this.xt = !1,
5748
+ this.St = !1,
5355
5749
  // Enabled during shutdown on Safari to prevent future access to IndexedDB.
5356
5750
  this.qt = !1,
5357
5751
  // List of TimerIds to fast-forward delays for.
5358
5752
  this.Ot = [],
5359
5753
  // Backoff timer used to schedule retries for retryable operations
5360
- this.It = new Ke(this, "async_queue_retry" /* AsyncQueueRetry */),
5754
+ this.It = new Xe(this, "async_queue_retry" /* AsyncQueueRetry */),
5361
5755
  // Visibility handler that triggers an immediate retry of all retryable
5362
5756
  // operations. Meant to speed up recovery when we regain file system access
5363
5757
  // after page comes into foreground.
5364
- this.Ct = function() {
5365
- var e = Fr();
5366
- e && w("AsyncQueue", "Visibility state changed to " + e.visibilityState), t.It.H();
5758
+ this.kt = function() {
5759
+ var e = jr();
5760
+ e && w("AsyncQueue", "Visibility state changed to " + e.visibilityState), t.It.Y();
5367
5761
  };
5368
- var e = Fr();
5369
- e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.Ct);
5762
+ var e = jr();
5763
+ e && "function" == typeof e.addEventListener && e.addEventListener("visibilitychange", this.kt);
5370
5764
  }
5371
5765
  return Object.defineProperty(t.prototype, "isShuttingDown", {
5372
5766
  get: function() {
@@ -5383,25 +5777,25 @@ function Dr(t, e) {
5383
5777
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
5384
5778
  this.enqueue(t);
5385
5779
  }, t.prototype.enqueueAndForgetEvenWhileRestricted = function(t) {
5386
- this.Lt(),
5780
+ this.Ct(),
5387
5781
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
5388
- this.Ut(t);
5782
+ this.Lt(t);
5389
5783
  }, t.prototype.enterRestrictedMode = function(t) {
5390
5784
  if (!this.$t) {
5391
5785
  this.$t = !0, this.qt = t || !1;
5392
- var e = Fr();
5393
- e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Ct);
5786
+ var e = jr();
5787
+ e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.kt);
5394
5788
  }
5395
5789
  }, t.prototype.enqueue = function(t) {
5396
5790
  var e = this;
5397
- if (this.Lt(), this.$t)
5791
+ if (this.Ct(), this.$t)
5398
5792
  // Return a Promise which never resolves.
5399
5793
  return new Promise((function() {}));
5400
5794
  // Create a deferred Promise that we can return to the callee. This
5401
5795
  // allows us to return a "hanging Promise" only to the callee and still
5402
5796
  // advance the queue even when the operation is not run.
5403
5797
  var n = new U;
5404
- return this.Ut((function() {
5798
+ return this.Lt((function() {
5405
5799
  return e.$t && e.qt ? Promise.resolve() : (t().then(n.resolve, n.reject), n.promise);
5406
5800
  })).then((function() {
5407
5801
  return n.promise;
@@ -5409,27 +5803,27 @@ function Dr(t, e) {
5409
5803
  }, t.prototype.enqueueRetryable = function(t) {
5410
5804
  var e = this;
5411
5805
  this.enqueueAndForget((function() {
5412
- return e.Nt.push(t), e.kt();
5806
+ return e.Dt.push(t), e.Mt();
5413
5807
  }));
5414
5808
  },
5415
5809
  /**
5416
5810
  * Runs the next operation from the retryable queue. If the operation fails,
5417
5811
  * reschedules with backoff.
5418
5812
  */
5419
- t.prototype.kt = function() {
5813
+ t.prototype.Mt = function() {
5420
5814
  return e(this, void 0, void 0, (function() {
5421
5815
  var t, e = this;
5422
5816
  return n(this, (function(n) {
5423
5817
  switch (n.label) {
5424
5818
  case 0:
5425
- if (0 === this.Nt.length) return [ 3 /*break*/ , 5 ];
5819
+ if (0 === this.Dt.length) return [ 3 /*break*/ , 5 ];
5426
5820
  n.label = 1;
5427
5821
 
5428
5822
  case 1:
5429
- return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , this.Nt[0]() ];
5823
+ return n.trys.push([ 1, 3, , 4 ]), [ 4 /*yield*/ , this.Dt[0]() ];
5430
5824
 
5431
5825
  case 2:
5432
- return n.sent(), this.Nt.shift(), this.It.reset(), [ 3 /*break*/ , 4 ];
5826
+ return n.sent(), this.Dt.shift(), this.It.reset(), [ 3 /*break*/ , 4 ];
5433
5827
 
5434
5828
  case 3:
5435
5829
  if (t = n.sent(), "IndexedDbTransactionError" !== t.name) throw t;
@@ -5438,7 +5832,7 @@ function Dr(t, e) {
5438
5832
  [ 3 /*break*/ , 4 ];
5439
5833
 
5440
5834
  case 4:
5441
- this.Nt.length > 0 &&
5835
+ this.Dt.length > 0 &&
5442
5836
  // If there are additional operations, we re-schedule `retryNextOp()`.
5443
5837
  // This is necessary to run retryable operations that failed during
5444
5838
  // their initial attempt since we don't know whether they are already
@@ -5450,7 +5844,7 @@ function Dr(t, e) {
5450
5844
  // new backoff on every call, there is only ever a single additional
5451
5845
  // operation in the queue.
5452
5846
  this.It.W((function() {
5453
- return e.kt();
5847
+ return e.Mt();
5454
5848
  })), n.label = 5;
5455
5849
 
5456
5850
  case 5:
@@ -5458,10 +5852,10 @@ function Dr(t, e) {
5458
5852
  }
5459
5853
  }));
5460
5854
  }));
5461
- }, t.prototype.Ut = function(t) {
5462
- var e = this, n = this.Dt.then((function() {
5463
- return e.xt = !0, t().catch((function(t) {
5464
- e.Ft = t, e.xt = !1;
5855
+ }, t.prototype.Lt = function(t) {
5856
+ var e = this, n = this.Nt.then((function() {
5857
+ return e.St = !0, t().catch((function(t) {
5858
+ e.Ft = t, e.St = !1;
5465
5859
  var n =
5466
5860
  /**
5467
5861
  * Chrome includes Error.message in Error.stack. Other browsers do not.
@@ -5478,39 +5872,39 @@ function Dr(t, e) {
5478
5872
  // and return the rejected Promise.
5479
5873
  throw b("INTERNAL UNHANDLED ERROR: ", n), t;
5480
5874
  })).then((function(t) {
5481
- return e.xt = !1, t;
5875
+ return e.St = !1, t;
5482
5876
  }));
5483
5877
  }));
5484
- return this.Dt = n, n;
5878
+ return this.Nt = n, n;
5485
5879
  }, t.prototype.enqueueAfterDelay = function(t, e, n) {
5486
5880
  var r = this;
5487
- this.Lt(),
5881
+ this.Ct(),
5488
5882
  // Fast-forward delays for timerIds that have been overriden.
5489
5883
  this.Ot.indexOf(t) > -1 && (e = 0);
5490
- var i = Or.createAndSchedule(this, t, e, n, (function(t) {
5491
- return r.jt(t);
5884
+ var i = Mr.createAndSchedule(this, t, e, n, (function(t) {
5885
+ return r.Ut(t);
5492
5886
  }));
5493
- return this.St.push(i), i;
5494
- }, t.prototype.Lt = function() {
5495
- this.Ft && S();
5887
+ return this.xt.push(i), i;
5888
+ }, t.prototype.Ct = function() {
5889
+ this.Ft && E();
5496
5890
  }, t.prototype.verifyOperationInProgress = function() {},
5497
5891
  /**
5498
5892
  * Waits until all currently queued tasks are finished executing. Delayed
5499
5893
  * operations are not run.
5500
5894
  */
5501
- t.prototype.Mt = function() {
5895
+ t.prototype.jt = function() {
5502
5896
  return e(this, void 0, void 0, (function() {
5503
5897
  var t;
5504
5898
  return n(this, (function(e) {
5505
5899
  switch (e.label) {
5506
5900
  case 0:
5507
- return [ 4 /*yield*/ , t = this.Dt ];
5901
+ return [ 4 /*yield*/ , t = this.Nt ];
5508
5902
 
5509
5903
  case 1:
5510
5904
  e.sent(), e.label = 2;
5511
5905
 
5512
5906
  case 2:
5513
- if (t !== this.Dt) return [ 3 /*break*/ , 0 ];
5907
+ if (t !== this.Nt) return [ 3 /*break*/ , 0 ];
5514
5908
  e.label = 3;
5515
5909
 
5516
5910
  case 3:
@@ -5524,7 +5918,7 @@ function Dr(t, e) {
5524
5918
  * exists.
5525
5919
  */
5526
5920
  t.prototype.Bt = function(t) {
5527
- for (var e = 0, n = this.St; e < n.length; e++) {
5921
+ for (var e = 0, n = this.xt; e < n.length; e++) {
5528
5922
  if (n[e].timerId === t) return !0;
5529
5923
  }
5530
5924
  return !1;
@@ -5539,16 +5933,16 @@ function Dr(t, e) {
5539
5933
  t.prototype.zt = function(t) {
5540
5934
  var e = this;
5541
5935
  // Note that draining may generate more delayed ops, so we do that first.
5542
- return this.Mt().then((function() {
5936
+ return this.jt().then((function() {
5543
5937
  // Run ops in the same order they'd run if they ran naturally.
5544
- e.St.sort((function(t, e) {
5938
+ e.xt.sort((function(t, e) {
5545
5939
  return t.targetTimeMs - e.targetTimeMs;
5546
5940
  }));
5547
- for (var n = 0, r = e.St; n < r.length; n++) {
5941
+ for (var n = 0, r = e.xt; n < r.length; n++) {
5548
5942
  var i = r[n];
5549
5943
  if (i.skipDelay(), "all" /* All */ !== t && i.timerId === t) break;
5550
5944
  }
5551
- return e.Mt();
5945
+ return e.jt();
5552
5946
  }));
5553
5947
  },
5554
5948
  /**
@@ -5557,15 +5951,15 @@ function Dr(t, e) {
5557
5951
  t.prototype.Gt = function(t) {
5558
5952
  this.Ot.push(t);
5559
5953
  },
5560
- /** Called once a DelayedOperation is run or canceled. */ t.prototype.jt = function(t) {
5954
+ /** Called once a DelayedOperation is run or canceled. */ t.prototype.Ut = function(t) {
5561
5955
  // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.
5562
- var e = this.St.indexOf(t);
5563
- this.St.splice(e, 1);
5956
+ var e = this.xt.indexOf(t);
5957
+ this.xt.splice(e, 1);
5564
5958
  }, t;
5565
- }(), Lr = /** @class */ function() {
5959
+ }(), Br = /** @class */ function() {
5566
5960
  /** @hideconstructor */
5567
5961
  function t(t, e) {
5568
- this._firestore = t, this._transaction = e, this._dataReader = In(t)
5962
+ this._firestore = t, this._transaction = e, this._dataReader = Pn(t)
5569
5963
  /**
5570
5964
  * Reads the document referenced by the provided {@link DocumentReference}.
5571
5965
  *
@@ -5574,23 +5968,23 @@ function Dr(t, e) {
5574
5968
  */;
5575
5969
  }
5576
5970
  return t.prototype.get = function(t) {
5577
- var e = this, n = Dr(t, this._firestore), r = new yr(this._firestore);
5971
+ var e = this, n = qr(t, this._firestore), r = new _r(this._firestore);
5578
5972
  return this._transaction.lookup([ n._key ]).then((function(t) {
5579
- if (!t || 1 !== t.length) return S();
5973
+ if (!t || 1 !== t.length) return E();
5580
5974
  var i = t[0];
5581
- if (i.isFoundDocument()) return new Qn(e._firestore, r, i.key, i, n.converter);
5582
- if (i.isNoDocument()) return new Qn(e._firestore, r, n._key, null, n.converter);
5583
- throw S();
5975
+ if (i.isFoundDocument()) return new $n(e._firestore, r, i.key, i, n.converter);
5976
+ if (i.isNoDocument()) return new $n(e._firestore, r, n._key, null, n.converter);
5977
+ throw E();
5584
5978
  }));
5585
5979
  }, 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);
5980
+ var r = qr(t, this._firestore), i = br(r.converter, e, n), o = Nn(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
5587
5981
  return this._transaction.set(r._key, o), this;
5588
5982
  }, t.prototype.update = function(t, e, n) {
5589
5983
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
5590
- var o, a = Dr(t, this._firestore);
5984
+ var o, a = qr(t, this._firestore);
5591
5985
  // For Compat types, we have to "extract" the underlying types before
5592
5986
  // performing validation.
5593
- return o = "string" == typeof (e = p(e)) || e instanceof dn ? On(this._dataReader, "Transaction.update", a._key, e, n, r) : Fn(this._dataReader, "Transaction.update", a._key, e),
5987
+ return o = "string" == typeof (e = p(e)) || e instanceof wn ? jn(this._dataReader, "Transaction.update", a._key, e, n, r) : Ln(this._dataReader, "Transaction.update", a._key, e),
5594
5988
  this._transaction.update(a._key, o), this;
5595
5989
  },
5596
5990
  /**
@@ -5600,7 +5994,7 @@ function Dr(t, e) {
5600
5994
  * @returns This `Transaction` instance. Used for chaining method calls.
5601
5995
  */
5602
5996
  t.prototype.delete = function(t) {
5603
- var e = Dr(t, this._firestore);
5997
+ var e = qr(t, this._firestore);
5604
5998
  return this._transaction.delete(e._key), this;
5605
5999
  }, t;
5606
6000
  }();
@@ -5633,16 +6027,22 @@ function Dr(t, e) {
5633
6027
  * transaction against.
5634
6028
  * @param updateFunction - The function to execute within the transaction
5635
6029
  * context.
6030
+ * @param options - An options object to configure maximum number of attempts to
6031
+ * commit.
5636
6032
  * @returns If the transaction completed successfully or was explicitly aborted
5637
6033
  * (the `updateFunction` returned a failed promise), the promise returned by the
5638
6034
  * `updateFunction `is returned here. Otherwise, if the transaction failed, a
5639
6035
  * rejected promise with the corresponding failure error is returned.
5640
6036
  */
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) {
5644
- return e(new Lr(t, n));
5645
- }), r).run(), r.promise
6037
+ function zr(t, e, n) {
6038
+ var r = rn(t = st(t, an)), i = Object.assign(Object.assign({}, Cr), n);
6039
+ !function(t) {
6040
+ if (t.maxAttempts < 1) throw new M(V, "Max attempts must be at least 1");
6041
+ }(i);
6042
+ var o = new U;
6043
+ return new Lr(new Ur, r, i, (function(n) {
6044
+ return e(new Br(t, n));
6045
+ }), o).run(), o.promise
5646
6046
  /**
5647
6047
  * Firestore Lite
5648
6048
  *
@@ -5653,12 +6053,12 @@ function jr(t, e) {
5653
6053
  */;
5654
6054
  }
5655
6055
 
5656
- y = i + "_lite", o(new c("firestore/lite", (function(t, e) {
5657
- var n = e.options, r = t.getProvider("app").getImmediate(), i = new tn(r, new Q(t.getProvider("auth-internal")), new Y(t.getProvider("app-check-internal")));
6056
+ m = i + "_lite", o(new c("firestore/lite", (function(t, e) {
6057
+ var n = e.options, r = t.getProvider("app").getImmediate(), i = new an(r, new K(t.getProvider("auth-internal")), new Y(t.getProvider("app-check-internal")));
5658
6058
  return n && i._setSettings(n), i;
5659
6059
  }), "PUBLIC")),
5660
6060
  // 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");
6061
+ a("firestore-lite", "3.4.9-canary.0197076b8", ""), a("firestore-lite", "3.4.9-canary.0197076b8", "esm5");
5662
6062
 
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 };
6063
+ export { _n as Bytes, pn as CollectionReference, fn as DocumentReference, $n as DocumentSnapshot, wn as FieldPath, Tn as FieldValue, an as Firestore, M as FirestoreError, En as GeoPoint, hn as Query, er as QueryConstraint, Xn as QueryDocumentSnapshot, Jn as QuerySnapshot, bt as Timestamp, Br as Transaction, Or as WriteBatch, Ar as addDoc, Nr as arrayRemove, Pr as arrayUnion, dn as collection, yn as collectionGroup, cn as connectFirestoreEmulator, Ir as deleteDoc, Vr as deleteField, mn as doc, bn as documentId, yr as endAt, dr as endBefore, Tr as getDoc, Er as getDocs, un as getFirestore, Fr as increment, sn as initializeFirestore, ur as limit, cr as limitToLast, ar as orderBy, nr as query, gn as queryEqual, vn as refEqual, zr as runTransaction, Dr as serverTimestamp, Sr as setDoc, g as setLogLevel, Zn as snapshotEqual, hr as startAfter, fr as startAt, ln as terminate, kr as updateDoc, ir as where, Rr as writeBatch };
5664
6064
  //# sourceMappingURL=index.browser.esm5.js.map