@firebase/firestore 3.4.0 → 3.4.1-canary.0b385f18c

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 (100) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/firestore/compat/index.d.ts +1 -1
  3. package/dist/firestore/src/index/directional_index_byte_encoder.d.ts +24 -0
  4. package/dist/firestore/src/index/firestore_index_value_writer.d.ts +33 -0
  5. package/dist/firestore/src/index/index_byte_encoder.d.ts +14 -0
  6. package/dist/firestore/src/index/ordered_code_writer.d.ts +60 -0
  7. package/dist/firestore/src/lite-api/reference.d.ts +4 -2
  8. package/dist/firestore/src/lite-api/reference_impl.d.ts +5 -0
  9. package/dist/firestore/src/lite-api/transaction.d.ts +4 -0
  10. package/dist/firestore/src/lite-api/write_batch.d.ts +3 -0
  11. package/dist/firestore/src/local/indexeddb_remote_document_cache.d.ts +5 -0
  12. package/dist/firestore/src/model/collections.d.ts +0 -4
  13. package/dist/firestore/src/model/document.d.ts +3 -1
  14. package/dist/firestore/src/model/values.d.ts +3 -0
  15. package/dist/firestore/src/util/byte_string.d.ts +1 -0
  16. package/dist/firestore/src/util/error.d.ts +2 -3
  17. package/dist/firestore/test/unit/index/ordered_code_writer.test.d.ts +1 -0
  18. package/dist/firestore/test/util/helpers.d.ts +1 -0
  19. package/dist/index.d.ts +13 -21
  20. package/dist/index.esm2017.js +2649 -2640
  21. package/dist/index.esm2017.js.map +1 -1
  22. package/dist/index.esm5.js +2640 -2630
  23. package/dist/index.esm5.js.map +1 -1
  24. package/dist/index.node.cjs.js +49 -38
  25. package/dist/index.node.cjs.js.map +1 -1
  26. package/dist/index.node.mjs +50 -35
  27. package/dist/index.node.mjs.map +1 -1
  28. package/dist/index.rn.js +2847 -2838
  29. package/dist/index.rn.js.map +1 -1
  30. package/dist/internal.d.ts +18 -22
  31. package/dist/lite/firestore/compat/index.d.ts +1 -1
  32. package/dist/lite/firestore/src/index/directional_index_byte_encoder.d.ts +24 -0
  33. package/dist/lite/firestore/src/index/firestore_index_value_writer.d.ts +33 -0
  34. package/dist/lite/firestore/src/index/index_byte_encoder.d.ts +14 -0
  35. package/dist/lite/firestore/src/index/ordered_code_writer.d.ts +60 -0
  36. package/dist/lite/firestore/src/lite-api/reference.d.ts +4 -2
  37. package/dist/lite/firestore/src/lite-api/reference_impl.d.ts +5 -0
  38. package/dist/lite/firestore/src/lite-api/transaction.d.ts +4 -0
  39. package/dist/lite/firestore/src/lite-api/write_batch.d.ts +3 -0
  40. package/dist/lite/firestore/src/local/indexeddb_remote_document_cache.d.ts +5 -0
  41. package/dist/lite/firestore/src/model/collections.d.ts +0 -4
  42. package/dist/lite/firestore/src/model/document.d.ts +3 -1
  43. package/dist/lite/firestore/src/model/values.d.ts +3 -0
  44. package/dist/lite/firestore/src/util/byte_string.d.ts +1 -0
  45. package/dist/lite/firestore/src/util/error.d.ts +2 -3
  46. package/dist/lite/firestore/test/unit/index/ordered_code_writer.test.d.ts +1 -0
  47. package/dist/lite/firestore/test/util/helpers.d.ts +1 -0
  48. package/dist/lite/index.browser.esm2017.js +846 -833
  49. package/dist/lite/index.browser.esm2017.js.map +1 -1
  50. package/dist/lite/index.browser.esm5.js +834 -820
  51. package/dist/lite/index.browser.esm5.js.map +1 -1
  52. package/dist/lite/index.d.ts +18 -21
  53. package/dist/lite/index.node.cjs.js +26 -8
  54. package/dist/lite/index.node.cjs.js.map +1 -1
  55. package/dist/lite/index.node.mjs +27 -9
  56. package/dist/lite/index.node.mjs.map +1 -1
  57. package/dist/lite/index.rn.esm2017.js +836 -823
  58. package/dist/lite/index.rn.esm2017.js.map +1 -1
  59. package/dist/lite/internal.d.ts +86 -21
  60. package/dist/lite/packages/firestore/babel-register.d.ts +1 -0
  61. package/dist/lite/packages/firestore/compat/index.d.ts +1 -1
  62. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +114 -113
  63. package/dist/lite/packages/firestore/src/index/directional_index_byte_encoder.d.ts +24 -0
  64. package/dist/lite/packages/firestore/src/index/firestore_index_value_writer.d.ts +33 -0
  65. package/dist/lite/packages/firestore/src/index/index_byte_encoder.d.ts +14 -0
  66. package/dist/lite/packages/firestore/src/index/ordered_code_writer.d.ts +60 -0
  67. package/dist/lite/packages/firestore/src/lite-api/reference.d.ts +4 -2
  68. package/dist/lite/packages/firestore/src/lite-api/reference_impl.d.ts +5 -0
  69. package/dist/lite/packages/firestore/src/lite-api/transaction.d.ts +4 -0
  70. package/dist/lite/packages/firestore/src/lite-api/write_batch.d.ts +3 -0
  71. package/dist/lite/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +5 -0
  72. package/dist/lite/packages/firestore/src/model/collections.d.ts +0 -4
  73. package/dist/lite/packages/firestore/src/model/document.d.ts +3 -1
  74. package/dist/lite/packages/firestore/src/model/values.d.ts +3 -0
  75. package/dist/lite/packages/firestore/src/util/byte_string.d.ts +1 -0
  76. package/dist/lite/packages/firestore/src/util/error.d.ts +2 -3
  77. package/dist/lite/packages/firestore/test/unit/index/ordered_code_writer.test.d.ts +1 -0
  78. package/dist/lite/packages/firestore/test/util/helpers.d.ts +1 -0
  79. package/dist/lite/private.d.ts +85 -21
  80. package/dist/packages/firestore/babel-register.d.ts +1 -0
  81. package/dist/packages/firestore/compat/index.d.ts +1 -1
  82. package/dist/packages/firestore/dist/index.esm2017.d.ts +152 -152
  83. package/dist/packages/firestore/src/index/directional_index_byte_encoder.d.ts +24 -0
  84. package/dist/packages/firestore/src/index/firestore_index_value_writer.d.ts +33 -0
  85. package/dist/packages/firestore/src/index/index_byte_encoder.d.ts +14 -0
  86. package/dist/packages/firestore/src/index/ordered_code_writer.d.ts +60 -0
  87. package/dist/packages/firestore/src/lite-api/reference.d.ts +4 -2
  88. package/dist/packages/firestore/src/lite-api/reference_impl.d.ts +5 -0
  89. package/dist/packages/firestore/src/lite-api/transaction.d.ts +4 -0
  90. package/dist/packages/firestore/src/lite-api/write_batch.d.ts +3 -0
  91. package/dist/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +5 -0
  92. package/dist/packages/firestore/src/model/collections.d.ts +0 -4
  93. package/dist/packages/firestore/src/model/document.d.ts +3 -1
  94. package/dist/packages/firestore/src/model/values.d.ts +3 -0
  95. package/dist/packages/firestore/src/util/byte_string.d.ts +1 -0
  96. package/dist/packages/firestore/src/util/error.d.ts +2 -3
  97. package/dist/packages/firestore/test/unit/index/ordered_code_writer.test.d.ts +1 -0
  98. package/dist/packages/firestore/test/util/helpers.d.ts +1 -0
  99. package/dist/private.d.ts +17 -22
  100. package/package.json +10 -10
@@ -1,7 +1,7 @@
1
1
  import { _registerComponent, registerVersion, _getProvider, getApp, _removeServiceInstance, SDK_VERSION } from '@firebase/app';
2
2
  import { Component } from '@firebase/component';
3
3
  import { Logger, LogLevel } from '@firebase/logger';
4
- import { createMockUserToken, getModularInstance } from '@firebase/util';
4
+ import { FirebaseError, createMockUserToken, getModularInstance } from '@firebase/util';
5
5
 
6
6
  /**
7
7
  * @license
@@ -23,7 +23,7 @@ import { createMockUserToken, getModularInstance } from '@firebase/util';
23
23
  * Simple wrapper around a nullable UID. Mostly exists to make code more
24
24
  * readable.
25
25
  */
26
- class h {
26
+ class l {
27
27
  constructor(t) {
28
28
  this.uid = t;
29
29
  }
@@ -41,11 +41,11 @@ class h {
41
41
  }
42
42
  }
43
43
 
44
- /** A user with a null UID. */ h.UNAUTHENTICATED = new h(null),
44
+ /** A user with a null UID. */ l.UNAUTHENTICATED = new l(null),
45
45
  // TODO(mikelehen): Look into getting a proper uid-equivalent for
46
46
  // non-FirebaseAuth providers.
47
- h.GOOGLE_CREDENTIALS = new h("google-credentials-uid"), h.FIRST_PARTY = new h("first-party-uid"),
48
- h.MOCK_USER = new h("mock-user");
47
+ l.GOOGLE_CREDENTIALS = new l("google-credentials-uid"), l.FIRST_PARTY = new l("first-party-uid"),
48
+ l.MOCK_USER = new l("mock-user");
49
49
 
50
50
  /**
51
51
  * @license
@@ -63,7 +63,7 @@ h.MOCK_USER = new h("mock-user");
63
63
  * See the License for the specific language governing permissions and
64
64
  * limitations under the License.
65
65
  */
66
- let l = "9.6.0";
66
+ let f = "9.6.1-canary.0b385f18c";
67
67
 
68
68
  /**
69
69
  * @license
@@ -81,7 +81,7 @@ let l = "9.6.0";
81
81
  * See the License for the specific language governing permissions and
82
82
  * limitations under the License.
83
83
  */
84
- const f = new Logger("@firebase/firestore");
84
+ const d = new Logger("@firebase/firestore");
85
85
 
86
86
  /**
87
87
  * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).
@@ -95,36 +95,36 @@ const f = new Logger("@firebase/firestore");
95
95
  * <li>`error` to log errors only.</li>
96
96
  * <li><code>`silent` to turn off logging.</li>
97
97
  * </ul>
98
- */ function d(t) {
99
- f.setLogLevel(t);
98
+ */ function w(t) {
99
+ d.setLogLevel(t);
100
100
  }
101
101
 
102
- function w(t, ...n) {
103
- if (f.logLevel <= LogLevel.DEBUG) {
104
- const e = n.map(y);
105
- f.debug(`Firestore (${l}): ${t}`, ...e);
102
+ function m(t, ...n) {
103
+ if (d.logLevel <= LogLevel.DEBUG) {
104
+ const e = n.map(_);
105
+ d.debug(`Firestore (${f}): ${t}`, ...e);
106
106
  }
107
107
  }
108
108
 
109
- function m(t, ...n) {
110
- if (f.logLevel <= LogLevel.ERROR) {
111
- const e = n.map(y);
112
- f.error(`Firestore (${l}): ${t}`, ...e);
109
+ function p(t, ...n) {
110
+ if (d.logLevel <= LogLevel.ERROR) {
111
+ const e = n.map(_);
112
+ d.error(`Firestore (${f}): ${t}`, ...e);
113
113
  }
114
114
  }
115
115
 
116
116
  /**
117
117
  * @internal
118
- */ function p(t, ...n) {
119
- if (f.logLevel <= LogLevel.WARN) {
120
- const e = n.map(y);
121
- f.warn(`Firestore (${l}): ${t}`, ...e);
118
+ */ function y(t, ...n) {
119
+ if (d.logLevel <= LogLevel.WARN) {
120
+ const e = n.map(_);
121
+ d.warn(`Firestore (${f}): ${t}`, ...e);
122
122
  }
123
123
  }
124
124
 
125
125
  /**
126
126
  * Converts an additional log parameter to a string representation.
127
- */ function y(t) {
127
+ */ function _(t) {
128
128
  if ("string" == typeof t) return t;
129
129
  try {
130
130
  return n = t, JSON.stringify(n);
@@ -175,14 +175,14 @@ function m(t, ...n) {
175
175
  * Returns `never` and can be used in expressions:
176
176
  * @example
177
177
  * let futureVar = fail('not implemented yet');
178
- */ function _(t = "Unexpected state") {
178
+ */ function g(t = "Unexpected state") {
179
179
  // Log the failure in addition to throw an exception, just in case the
180
180
  // exception is swallowed.
181
- const n = `FIRESTORE (${l}) INTERNAL ASSERTION FAILED: ` + t;
181
+ const n = `FIRESTORE (${f}) INTERNAL ASSERTION FAILED: ` + t;
182
182
  // NOTE: We don't use FirestoreError here because these are internal failures
183
183
  // that cannot be handled by the user. (Also it would create a circular
184
184
  // dependency between the error and assert modules which doesn't work.)
185
- throw m(n), new Error(n);
185
+ throw p(n), new Error(n);
186
186
  }
187
187
 
188
188
  /**
@@ -190,14 +190,14 @@ function m(t, ...n) {
190
190
  * given message if it did.
191
191
  *
192
192
  * Messages are stripped in production builds.
193
- */ function g(t, n) {
194
- t || _();
193
+ */ function b(t, n) {
194
+ t || g();
195
195
  }
196
196
 
197
197
  /**
198
198
  * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an
199
199
  * instance of `T` before casting.
200
- */ function b(t,
200
+ */ function v(t,
201
201
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
202
202
  n) {
203
203
  return t;
@@ -218,9 +218,9 @@ n) {
218
218
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
219
219
  * See the License for the specific language governing permissions and
220
220
  * limitations under the License.
221
- */ const v = "ok", E = "cancelled", T = "unknown", I = "invalid-argument", A = "deadline-exceeded", P = "not-found", R = "already-exists", V = "permission-denied", D = "unauthenticated", N = "resource-exhausted", $ = "failed-precondition", F = "aborted", S = "out-of-range", q = "unimplemented", x = "internal", O = "unavailable", C = "data-loss";
221
+ */ const E = "ok", T = "cancelled", I = "unknown", A = "invalid-argument", P = "deadline-exceeded", R = "not-found", V = "already-exists", D = "permission-denied", N = "unauthenticated", $ = "resource-exhausted", F = "failed-precondition", S = "aborted", x = "out-of-range", q = "unimplemented", O = "internal", C = "unavailable", L = "data-loss";
222
222
 
223
- /** An error returned by a Firestore operation. */ class L extends Error {
223
+ /** An error returned by a Firestore operation. */ class U extends FirebaseError {
224
224
  /** @hideconstructor */
225
225
  constructor(
226
226
  /**
@@ -231,9 +231,7 @@ n) {
231
231
  * A custom error description.
232
232
  */
233
233
  n) {
234
- super(n), this.code = t, this.message = n,
235
- /** The custom name for all FirestoreErrors. */
236
- this.name = "FirebaseError",
234
+ super(t, n), this.code = t, this.message = n,
237
235
  // HACK: We write a toString property directly because Error is not a real
238
236
  // class and so inheritance does not work correctly. We could alternatively
239
237
  // do the same "back-door inheritance" trick that FirebaseError does.
@@ -256,7 +254,7 @@ n) {
256
254
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
257
255
  * See the License for the specific language governing permissions and
258
256
  * limitations under the License.
259
- */ class U {
257
+ */ class k {
260
258
  constructor() {
261
259
  this.promise = new Promise(((t, n) => {
262
260
  this.resolve = t, this.reject = n;
@@ -279,7 +277,7 @@ n) {
279
277
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
280
278
  * See the License for the specific language governing permissions and
281
279
  * limitations under the License.
282
- */ class k {
280
+ */ class j {
283
281
  constructor(t, n) {
284
282
  this.user = n, this.type = "OAuth", this.headers = new Map, this.headers.set("Authorization", `Bearer ${t}`);
285
283
  }
@@ -288,14 +286,14 @@ n) {
288
286
  /**
289
287
  * A CredentialsProvider that always yields an empty token.
290
288
  * @internal
291
- */ class j {
289
+ */ class M {
292
290
  getToken() {
293
291
  return Promise.resolve(null);
294
292
  }
295
293
  invalidateToken() {}
296
294
  start(t, n) {
297
295
  // Fire with initial user.
298
- t.enqueueRetryable((() => n(h.UNAUTHENTICATED)));
296
+ t.enqueueRetryable((() => n(l.UNAUTHENTICATED)));
299
297
  }
300
298
  shutdown() {}
301
299
  }
@@ -303,7 +301,7 @@ n) {
303
301
  /**
304
302
  * A CredentialsProvider that always returns a constant token. Used for
305
303
  * emulator token mocking.
306
- */ class M {
304
+ */ class B {
307
305
  constructor(t) {
308
306
  this.token = t,
309
307
  /**
@@ -327,15 +325,15 @@ n) {
327
325
  }
328
326
  }
329
327
 
330
- /** Credential provider for the Lite SDK. */ class B {
328
+ /** Credential provider for the Lite SDK. */ class z {
331
329
  constructor(t) {
332
330
  this.auth = null, t.onInit((t => {
333
331
  this.auth = t;
334
332
  }));
335
333
  }
336
334
  getToken() {
337
- return this.auth ? this.auth.getToken().then((t => t ? (g("string" == typeof t.accessToken),
338
- new k(t.accessToken, new h(this.auth.getUid()))) : null)) : Promise.resolve(null);
335
+ return this.auth ? this.auth.getToken().then((t => t ? (b("string" == typeof t.accessToken),
336
+ new j(t.accessToken, new l(this.auth.getUid()))) : null)) : Promise.resolve(null);
339
337
  }
340
338
  invalidateToken() {}
341
339
  start(t, n) {}
@@ -348,9 +346,9 @@ n) {
348
346
  * Technically this may no longer be necessary since the SDK should gracefully
349
347
  * recover from unauthenticated errors (see b/33147818 for context), but it's
350
348
  * safer to keep the implementation as-is.
351
- */ class z {
349
+ */ class G {
352
350
  constructor(t, n, e) {
353
- this.type = "FirstParty", this.user = h.FIRST_PARTY, this.headers = new Map, this.headers.set("X-Goog-AuthUser", n);
351
+ this.type = "FirstParty", this.user = l.FIRST_PARTY, this.headers = new Map, this.headers.set("X-Goog-AuthUser", n);
354
352
  const r = t.auth.getAuthHeaderValueForFirstParty([]);
355
353
  r && this.headers.set("Authorization", r), e && this.headers.set("X-Goog-Iam-Authorization-Token", e);
356
354
  }
@@ -360,36 +358,36 @@ n) {
360
358
  * Provides user credentials required for the Firestore JavaScript SDK
361
359
  * to authenticate the user, using technique that is only available
362
360
  * to applications hosted by Google.
363
- */ class G {
361
+ */ class Q {
364
362
  constructor(t, n, e) {
365
363
  this.t = t, this.i = n, this.o = e;
366
364
  }
367
365
  getToken() {
368
- return Promise.resolve(new z(this.t, this.i, this.o));
366
+ return Promise.resolve(new G(this.t, this.i, this.o));
369
367
  }
370
368
  start(t, n) {
371
369
  // Fire with initial uid.
372
- t.enqueueRetryable((() => n(h.FIRST_PARTY)));
370
+ t.enqueueRetryable((() => n(l.FIRST_PARTY)));
373
371
  }
374
372
  shutdown() {}
375
373
  invalidateToken() {}
376
374
  }
377
375
 
378
- class Q {
376
+ class W {
379
377
  constructor(t) {
380
378
  this.value = t, this.type = "AppCheck", this.headers = new Map, t && t.length > 0 && this.headers.set("x-firebase-appcheck", this.value);
381
379
  }
382
380
  }
383
381
 
384
- /** AppCheck token provider for the Lite SDK. */ class W {
382
+ /** AppCheck token provider for the Lite SDK. */ class Y {
385
383
  constructor(t) {
386
384
  this.u = t, this.appCheck = null, t.onInit((t => {
387
385
  this.appCheck = t;
388
386
  }));
389
387
  }
390
388
  getToken() {
391
- return this.appCheck ? this.appCheck.getToken().then((t => t ? (g("string" == typeof t.token),
392
- new Q(t.token)) : null)) : Promise.resolve(null);
389
+ return this.appCheck ? this.appCheck.getToken().then((t => t ? (b("string" == typeof t.token),
390
+ new W(t.token)) : null)) : Promise.resolve(null);
393
391
  }
394
392
  invalidateToken() {}
395
393
  start(t, n) {}
@@ -416,7 +414,7 @@ class Q {
416
414
  * See the License for the specific language governing permissions and
417
415
  * limitations under the License.
418
416
  */
419
- class Y {
417
+ class H {
420
418
  /**
421
419
  * Constructs a DatabaseInfo using the provided host, databaseId and
422
420
  * persistenceKey.
@@ -445,7 +443,7 @@ class Y {
445
443
  * Represents the database ID a Firestore client is associated with.
446
444
  * @internal
447
445
  */
448
- class H {
446
+ class K {
449
447
  constructor(t, n) {
450
448
  this.projectId = t, this.database = n || "(default)";
451
449
  }
@@ -453,7 +451,7 @@ class H {
453
451
  return "(default)" === this.database;
454
452
  }
455
453
  isEqual(t) {
456
- return t instanceof H && t.projectId === this.projectId && t.database === this.database;
454
+ return t instanceof K && t.projectId === this.projectId && t.database === this.database;
457
455
  }
458
456
  }
459
457
 
@@ -476,20 +474,20 @@ class H {
476
474
  /**
477
475
  * Path represents an ordered sequence of string segments.
478
476
  */
479
- class K {
477
+ class J {
480
478
  constructor(t, n, e) {
481
- void 0 === n ? n = 0 : n > t.length && _(), void 0 === e ? e = t.length - n : e > t.length - n && _(),
479
+ void 0 === n ? n = 0 : n > t.length && g(), void 0 === e ? e = t.length - n : e > t.length - n && g(),
482
480
  this.segments = t, this.offset = n, this.len = e;
483
481
  }
484
482
  get length() {
485
483
  return this.len;
486
484
  }
487
485
  isEqual(t) {
488
- return 0 === K.comparator(this, t);
486
+ return 0 === J.comparator(this, t);
489
487
  }
490
488
  child(t) {
491
489
  const n = this.segments.slice(this.offset, this.limit());
492
- return t instanceof K ? t.forEach((t => {
490
+ return t instanceof J ? t.forEach((t => {
493
491
  n.push(t);
494
492
  })) : n.push(t), this.construct(n);
495
493
  }
@@ -546,9 +544,9 @@ class K {
546
544
  * within Firestore.
547
545
  *
548
546
  * @internal
549
- */ class J extends K {
547
+ */ class X extends J {
550
548
  construct(t, n, e) {
551
- return new J(t, n, e);
549
+ return new X(t, n, e);
552
550
  }
553
551
  canonicalString() {
554
552
  // NOTE: The client is ignorant of any path segments containing escape
@@ -569,35 +567,35 @@ class K {
569
567
  // for legacy reasons and should not be used frequently).
570
568
  const n = [];
571
569
  for (const e of t) {
572
- if (e.indexOf("//") >= 0) throw new L(I, `Invalid segment (${e}). Paths must not contain // in them.`);
570
+ if (e.indexOf("//") >= 0) throw new U(A, `Invalid segment (${e}). Paths must not contain // in them.`);
573
571
  // Strip leading and traling slashed.
574
572
  n.push(...e.split("/").filter((t => t.length > 0)));
575
573
  }
576
- return new J(n);
574
+ return new X(n);
577
575
  }
578
576
  static emptyPath() {
579
- return new J([]);
577
+ return new X([]);
580
578
  }
581
579
  }
582
580
 
583
- const X = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
581
+ const Z = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
584
582
 
585
583
  /**
586
584
  * A dot-separated path for navigating sub-objects within a document.
587
585
  * @internal
588
- */ class Z extends K {
586
+ */ class tt extends J {
589
587
  construct(t, n, e) {
590
- return new Z(t, n, e);
588
+ return new tt(t, n, e);
591
589
  }
592
590
  /**
593
591
  * Returns true if the string could be used as a segment in a field path
594
592
  * without escaping.
595
593
  */ static isValidIdentifier(t) {
596
- return X.test(t);
594
+ return Z.test(t);
597
595
  }
598
596
  canonicalString() {
599
597
  return this.toArray().map((t => (t = t.replace(/\\/g, "\\\\").replace(/`/g, "\\`"),
600
- Z.isValidIdentifier(t) || (t = "`" + t + "`"), t))).join(".");
598
+ tt.isValidIdentifier(t) || (t = "`" + t + "`"), t))).join(".");
601
599
  }
602
600
  toString() {
603
601
  return this.canonicalString();
@@ -610,7 +608,7 @@ const X = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
610
608
  /**
611
609
  * The field designating the key of a document.
612
610
  */ static keyField() {
613
- return new Z([ "__name__" ]);
611
+ return new tt([ "__name__" ]);
614
612
  }
615
613
  /**
616
614
  * Parses a field string from the given server-formatted string.
@@ -625,24 +623,24 @@ const X = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
625
623
  const n = [];
626
624
  let e = "", r = 0;
627
625
  const s = () => {
628
- if (0 === e.length) throw new L(I, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
626
+ if (0 === e.length) throw new U(A, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
629
627
  n.push(e), e = "";
630
628
  };
631
629
  let i = !1;
632
630
  for (;r < t.length; ) {
633
631
  const n = t[r];
634
632
  if ("\\" === n) {
635
- if (r + 1 === t.length) throw new L(I, "Path has trailing escape character: " + t);
633
+ if (r + 1 === t.length) throw new U(A, "Path has trailing escape character: " + t);
636
634
  const n = t[r + 1];
637
- if ("\\" !== n && "." !== n && "`" !== n) throw new L(I, "Path has invalid escape sequence: " + t);
635
+ if ("\\" !== n && "." !== n && "`" !== n) throw new U(A, "Path has invalid escape sequence: " + t);
638
636
  e += n, r += 2;
639
637
  } else "`" === n ? (i = !i, r++) : "." !== n || i ? (e += n, r++) : (s(), r++);
640
638
  }
641
- if (s(), i) throw new L(I, "Unterminated ` in path: " + t);
642
- return new Z(n);
639
+ if (s(), i) throw new U(A, "Unterminated ` in path: " + t);
640
+ return new tt(n);
643
641
  }
644
642
  static emptyPath() {
645
- return new Z([]);
643
+ return new tt([]);
646
644
  }
647
645
  }
648
646
 
@@ -664,27 +662,27 @@ const X = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
664
662
  */
665
663
  /**
666
664
  * @internal
667
- */ class tt {
665
+ */ class nt {
668
666
  constructor(t) {
669
667
  this.path = t;
670
668
  }
671
669
  static fromPath(t) {
672
- return new tt(J.fromString(t));
670
+ return new nt(X.fromString(t));
673
671
  }
674
672
  static fromName(t) {
675
- return new tt(J.fromString(t).popFirst(5));
673
+ return new nt(X.fromString(t).popFirst(5));
676
674
  }
677
675
  /** Returns true if the document is in the specified collectionId. */ hasCollectionId(t) {
678
676
  return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;
679
677
  }
680
678
  isEqual(t) {
681
- return null !== t && 0 === J.comparator(this.path, t.path);
679
+ return null !== t && 0 === X.comparator(this.path, t.path);
682
680
  }
683
681
  toString() {
684
682
  return this.path.toString();
685
683
  }
686
684
  static comparator(t, n) {
687
- return J.comparator(t.path, n.path);
685
+ return X.comparator(t.path, n.path);
688
686
  }
689
687
  static isDocumentKey(t) {
690
688
  return t.length % 2 == 0;
@@ -695,7 +693,7 @@ const X = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
695
693
  * @param segments - The segments of the path to the document
696
694
  * @returns A new instance of DocumentKey
697
695
  */ static fromSegments(t) {
698
- return new tt(new J(t.slice()));
696
+ return new nt(new X(t.slice()));
699
697
  }
700
698
  }
701
699
 
@@ -714,8 +712,8 @@ const X = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
714
712
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
715
713
  * See the License for the specific language governing permissions and
716
714
  * limitations under the License.
717
- */ function nt(t, n, e) {
718
- if (!e) throw new L(I, `Function ${t}() cannot be called with an empty ${n}.`);
715
+ */ function et(t, n, e) {
716
+ if (!e) throw new U(A, `Function ${t}() cannot be called with an empty ${n}.`);
719
717
  }
720
718
 
721
719
  /**
@@ -726,15 +724,15 @@ const X = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
726
724
  * Validates that `path` refers to a document (indicated by the fact it contains
727
725
  * an even numbers of segments).
728
726
  */
729
- function et(t) {
730
- if (!tt.isDocumentKey(t)) throw new L(I, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);
727
+ function rt(t) {
728
+ if (!nt.isDocumentKey(t)) throw new U(A, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);
731
729
  }
732
730
 
733
731
  /**
734
732
  * Validates that `path` refers to a collection (indicated by the fact it
735
733
  * contains an odd numbers of segments).
736
- */ function rt(t) {
737
- if (tt.isDocumentKey(t)) throw new L(I, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);
734
+ */ function st(t) {
735
+ if (nt.isDocumentKey(t)) throw new U(A, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);
738
736
  }
739
737
 
740
738
  /**
@@ -742,7 +740,7 @@ function et(t) {
742
740
  * (i.e. excludes Array, Date, etc.).
743
741
  */
744
742
  /** Returns a string describing the type / value of the provided input. */
745
- function st(t) {
743
+ function it(t) {
746
744
  if (void 0 === t) return "undefined";
747
745
  if (null === t) return "null";
748
746
  if ("string" == typeof t) return t.length > 20 && (t = `${t.substring(0, 20)}...`),
@@ -768,27 +766,27 @@ function st(t) {
768
766
  return n ? `a custom ${n} object` : "an object";
769
767
  }
770
768
  }
771
- return "function" == typeof t ? "a function" : _();
769
+ return "function" == typeof t ? "a function" : g();
772
770
  }
773
771
 
774
- function it(t,
772
+ function ot(t,
775
773
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
776
774
  n) {
777
775
  if ("_delegate" in t && (
778
776
  // Unwrap Compat types
779
777
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
780
778
  t = t._delegate), !(t instanceof n)) {
781
- if (n.name === t.constructor.name) throw new L(I, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
779
+ if (n.name === t.constructor.name) throw new U(A, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
782
780
  {
783
- const e = st(t);
784
- throw new L(I, `Expected type '${n.name}', but it was: ${e}`);
781
+ const e = it(t);
782
+ throw new U(A, `Expected type '${n.name}', but it was: ${e}`);
785
783
  }
786
784
  }
787
785
  return t;
788
786
  }
789
787
 
790
- function ot(t, n) {
791
- if (n <= 0) throw new L(I, `Function ${t}() requires a positive number, but it was: ${n}.`);
788
+ function ut(t, n) {
789
+ if (n <= 0) throw new U(A, `Function ${t}() requires a positive number, but it was: ${n}.`);
792
790
  }
793
791
 
794
792
  /**
@@ -809,11 +807,11 @@ function ot(t, n) {
809
807
  */
810
808
  /**
811
809
  * Returns whether a variable is either undefined or null.
812
- */ function ut(t) {
810
+ */ function ct(t) {
813
811
  return null == t;
814
812
  }
815
813
 
816
- /** Returns whether the value represents -0. */ function ct(t) {
814
+ /** Returns whether the value represents -0. */ function at(t) {
817
815
  // Detect if the value is -0.0. Based on polyfill from
818
816
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
819
817
  return 0 === t && 1 / t == -1 / 0;
@@ -839,7 +837,7 @@ function ot(t, n) {
839
837
  * See the License for the specific language governing permissions and
840
838
  * limitations under the License.
841
839
  */
842
- const at = {
840
+ const ht = {
843
841
  BatchGetDocuments: "batchGet",
844
842
  Commit: "commit",
845
843
  RunQuery: "runQuery"
@@ -876,7 +874,7 @@ const at = {
876
874
  * are used for reverse lookups from the webchannel stream. Do NOT change the
877
875
  * names of these identifiers or change this into a const enum.
878
876
  */
879
- var ht, lt;
877
+ var lt, ft;
880
878
 
881
879
  /**
882
880
  * Converts an HTTP Status Code to the equivalent error code.
@@ -885,8 +883,8 @@ var ht, lt;
885
883
  * @returns The equivalent Code. Unknown status codes are mapped to
886
884
  * Code.UNKNOWN.
887
885
  */
888
- function ft(t) {
889
- if (void 0 === t) return m("RPC_ERROR", "HTTP error has no status"), T;
886
+ function dt(t) {
887
+ if (void 0 === t) return p("RPC_ERROR", "HTTP error has no status"), I;
890
888
  // The canonical error codes for Google APIs [1] specify mapping onto HTTP
891
889
  // status codes but the mapping is not bijective. In each case of ambiguity
892
890
  // this function chooses a primary error.
@@ -896,48 +894,48 @@ function ft(t) {
896
894
  switch (t) {
897
895
  case 200:
898
896
  // OK
899
- return v;
897
+ return E;
900
898
 
901
899
  case 400:
902
900
  // Bad Request
903
- return $;
901
+ return F;
904
902
 
905
903
  // Other possibilities based on the forward mapping
906
904
  // return Code.INVALID_ARGUMENT;
907
905
  // return Code.OUT_OF_RANGE;
908
906
  case 401:
909
907
  // Unauthorized
910
- return D;
908
+ return N;
911
909
 
912
910
  case 403:
913
911
  // Forbidden
914
- return V;
912
+ return D;
915
913
 
916
914
  case 404:
917
915
  // Not Found
918
- return P;
916
+ return R;
919
917
 
920
918
  case 409:
921
919
  // Conflict
922
- return F;
920
+ return S;
923
921
 
924
922
  // Other possibilities:
925
923
  // return Code.ALREADY_EXISTS;
926
924
  case 416:
927
925
  // Range Not Satisfiable
928
- return S;
926
+ return x;
929
927
 
930
928
  case 429:
931
929
  // Too Many Requests
932
- return N;
930
+ return $;
933
931
 
934
932
  case 499:
935
933
  // Client Closed Request
936
- return E;
934
+ return T;
937
935
 
938
936
  case 500:
939
937
  // Internal Server Error
940
- return T;
938
+ return I;
941
939
 
942
940
  // Other possibilities:
943
941
  // return Code.INTERNAL;
@@ -948,14 +946,14 @@ function ft(t) {
948
946
 
949
947
  case 503:
950
948
  // Service Unavailable
951
- return O;
949
+ return C;
952
950
 
953
951
  case 504:
954
952
  // Gateway Timeout
955
- return A;
953
+ return P;
956
954
 
957
955
  default:
958
- return t >= 200 && t < 300 ? v : t >= 400 && t < 500 ? $ : t >= 500 && t < 600 ? x : T;
956
+ return t >= 200 && t < 300 ? E : t >= 400 && t < 500 ? F : t >= 500 && t < 600 ? O : I;
959
957
  }
960
958
  }
961
959
 
@@ -978,16 +976,16 @@ function ft(t) {
978
976
  /**
979
977
  * A Rest-based connection that relies on the native HTTP stack
980
978
  * (e.g. `fetch` or a polyfill).
981
- */ (lt = ht || (ht = {}))[lt.OK = 0] = "OK", lt[lt.CANCELLED = 1] = "CANCELLED",
982
- lt[lt.UNKNOWN = 2] = "UNKNOWN", lt[lt.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT",
983
- lt[lt.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", lt[lt.NOT_FOUND = 5] = "NOT_FOUND",
984
- lt[lt.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", lt[lt.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
985
- lt[lt.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", lt[lt.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
986
- lt[lt.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", lt[lt.ABORTED = 10] = "ABORTED",
987
- lt[lt.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", lt[lt.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
988
- lt[lt.INTERNAL = 13] = "INTERNAL", lt[lt.UNAVAILABLE = 14] = "UNAVAILABLE", lt[lt.DATA_LOSS = 15] = "DATA_LOSS";
979
+ */ (ft = lt || (lt = {}))[ft.OK = 0] = "OK", ft[ft.CANCELLED = 1] = "CANCELLED",
980
+ ft[ft.UNKNOWN = 2] = "UNKNOWN", ft[ft.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT",
981
+ ft[ft.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", ft[ft.NOT_FOUND = 5] = "NOT_FOUND",
982
+ ft[ft.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", ft[ft.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
983
+ ft[ft.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", ft[ft.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
984
+ ft[ft.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", ft[ft.ABORTED = 10] = "ABORTED",
985
+ ft[ft.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", ft[ft.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
986
+ ft[ft.INTERNAL = 13] = "INTERNAL", ft[ft.UNAVAILABLE = 14] = "UNAVAILABLE", ft[ft.DATA_LOSS = 15] = "DATA_LOSS";
989
987
 
990
- class dt extends
988
+ class wt extends
991
989
  /**
992
990
  * Base class for all Rest-based connections to the backend (WebChannel and
993
991
  * HTTP).
@@ -1000,11 +998,11 @@ class {
1000
998
  }
1001
999
  m(t, n, e, r, s) {
1002
1000
  const i = this.p(t, n);
1003
- w("RestConnection", "Sending: ", i, e);
1001
+ m("RestConnection", "Sending: ", i, e);
1004
1002
  const o = {};
1005
- return this.g(o, r, s), this.v(t, i, o, e).then((t => (w("RestConnection", "Received: ", t),
1003
+ return this.g(o, r, s), this.v(t, i, o, e).then((t => (m("RestConnection", "Received: ", t),
1006
1004
  t)), (n => {
1007
- throw p("RestConnection", `${t} failed with error: `, n, "url: ", i, "request:", e),
1005
+ throw y("RestConnection", `${t} failed with error: `, n, "url: ", i, "request:", e),
1008
1006
  n;
1009
1007
  }));
1010
1008
  }
@@ -1017,7 +1015,7 @@ class {
1017
1015
  * Modifies the headers for a request, adding any authorization token if
1018
1016
  * present and any additional headers for the request.
1019
1017
  */ g(t, n, e) {
1020
- t["X-Goog-Api-Client"] = "gl-js/ fire/" + l,
1018
+ t["X-Goog-Api-Client"] = "gl-js/ fire/" + f,
1021
1019
  // Content-Type: text/plain will avoid preflight requests which might
1022
1020
  // mess with CORS and redirects by proxies. If we add custom headers
1023
1021
  // we will need to change this code to potentially use the $httpOverwrite
@@ -1026,7 +1024,7 @@ class {
1026
1024
  n && n.headers.forEach(((n, e) => t[e] = n)), e && e.headers.forEach(((n, e) => t[e] = n));
1027
1025
  }
1028
1026
  p(t, n) {
1029
- const e = at[t];
1027
+ const e = ht[t];
1030
1028
  return `${this.h}/v1/${n}:${e}`;
1031
1029
  }
1032
1030
  } {
@@ -1050,9 +1048,9 @@ class {
1050
1048
  body: s
1051
1049
  });
1052
1050
  } catch (t) {
1053
- throw new L(ft(t.status), "Request failed with error: " + t.statusText);
1051
+ throw new U(dt(t.status), "Request failed with error: " + t.statusText);
1054
1052
  }
1055
- if (!i.ok) throw new L(ft(i.status), "Request failed with error: " + i.statusText);
1053
+ if (!i.ok) throw new U(dt(i.status), "Request failed with error: " + i.statusText);
1056
1054
  return i.json();
1057
1055
  }
1058
1056
  }
@@ -1095,7 +1093,7 @@ class {
1095
1093
  *
1096
1094
  * If `nBytes < 0` , an error will be thrown.
1097
1095
  */
1098
- function wt(t) {
1096
+ function mt(t) {
1099
1097
  // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.
1100
1098
  const n =
1101
1099
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1121,14 +1119,14 @@ function wt(t) {
1121
1119
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1122
1120
  * See the License for the specific language governing permissions and
1123
1121
  * limitations under the License.
1124
- */ class mt {
1122
+ */ class pt {
1125
1123
  static P() {
1126
1124
  // Alphanumeric characters
1127
1125
  const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = Math.floor(256 / t.length) * t.length;
1128
1126
  // The largest byte value that is a multiple of `char.length`.
1129
1127
  let e = "";
1130
1128
  for (;e.length < 20; ) {
1131
- const r = wt(40);
1129
+ const r = mt(40);
1132
1130
  for (let s = 0; s < r.length; ++s)
1133
1131
  // Only accept values that are [0, maxMultiple), this ensures they can
1134
1132
  // be evenly mapped to indices of `chars` via a modulo operation.
@@ -1138,11 +1136,11 @@ function wt(t) {
1138
1136
  }
1139
1137
  }
1140
1138
 
1141
- function pt(t, n) {
1139
+ function yt(t, n) {
1142
1140
  return t < n ? -1 : t > n ? 1 : 0;
1143
1141
  }
1144
1142
 
1145
- /** Helper to compare arrays using isEqual(). */ function yt(t, n, e) {
1143
+ /** Helper to compare arrays using isEqual(). */ function _t(t, n, e) {
1146
1144
  return t.length === n.length && t.every(((t, r) => e(t, n[r])));
1147
1145
  }
1148
1146
 
@@ -1177,7 +1175,7 @@ function pt(t, n) {
1177
1175
  * For examples and further specifications, refer to the
1178
1176
  * {@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto | Timestamp definition}.
1179
1177
  */
1180
- class _t {
1178
+ class gt {
1181
1179
  /**
1182
1180
  * Creates a new timestamp.
1183
1181
  *
@@ -1198,18 +1196,18 @@ class _t {
1198
1196
  * The fractions of a second at nanosecond resolution.*
1199
1197
  */
1200
1198
  n) {
1201
- if (this.seconds = t, this.nanoseconds = n, n < 0) throw new L(I, "Timestamp nanoseconds out of range: " + n);
1202
- if (n >= 1e9) throw new L(I, "Timestamp nanoseconds out of range: " + n);
1203
- if (t < -62135596800) throw new L(I, "Timestamp seconds out of range: " + t);
1199
+ if (this.seconds = t, this.nanoseconds = n, n < 0) throw new U(A, "Timestamp nanoseconds out of range: " + n);
1200
+ if (n >= 1e9) throw new U(A, "Timestamp nanoseconds out of range: " + n);
1201
+ if (t < -62135596800) throw new U(A, "Timestamp seconds out of range: " + t);
1204
1202
  // This will break in the year 10,000.
1205
- if (t >= 253402300800) throw new L(I, "Timestamp seconds out of range: " + t);
1203
+ if (t >= 253402300800) throw new U(A, "Timestamp seconds out of range: " + t);
1206
1204
  }
1207
1205
  /**
1208
1206
  * Creates a new timestamp with the current date, with millisecond precision.
1209
1207
  *
1210
1208
  * @returns a new timestamp representing the current date.
1211
1209
  */ static now() {
1212
- return _t.fromMillis(Date.now());
1210
+ return gt.fromMillis(Date.now());
1213
1211
  }
1214
1212
  /**
1215
1213
  * Creates a new timestamp from the given date.
@@ -1218,7 +1216,7 @@ class _t {
1218
1216
  * @returns A new `Timestamp` representing the same point in time as the given
1219
1217
  * date.
1220
1218
  */ static fromDate(t) {
1221
- return _t.fromMillis(t.getTime());
1219
+ return gt.fromMillis(t.getTime());
1222
1220
  }
1223
1221
  /**
1224
1222
  * Creates a new timestamp from the given number of milliseconds.
@@ -1229,7 +1227,7 @@ class _t {
1229
1227
  * number of milliseconds.
1230
1228
  */ static fromMillis(t) {
1231
1229
  const n = Math.floor(t / 1e3), e = Math.floor(1e6 * (t - 1e3 * n));
1232
- return new _t(n, e);
1230
+ return new gt(n, e);
1233
1231
  }
1234
1232
  /**
1235
1233
  * Converts a `Timestamp` to a JavaScript `Date` object. This conversion
@@ -1251,7 +1249,7 @@ class _t {
1251
1249
  return 1e3 * this.seconds + this.nanoseconds / 1e6;
1252
1250
  }
1253
1251
  _compareTo(t) {
1254
- return this.seconds === t.seconds ? pt(this.nanoseconds, t.nanoseconds) : pt(this.seconds, t.seconds);
1252
+ return this.seconds === t.seconds ? yt(this.nanoseconds, t.nanoseconds) : yt(this.seconds, t.seconds);
1255
1253
  }
1256
1254
  /**
1257
1255
  * Returns true if this `Timestamp` is equal to the provided one.
@@ -1307,15 +1305,15 @@ class _t {
1307
1305
  /**
1308
1306
  * A version of a document in Firestore. This corresponds to the version
1309
1307
  * timestamp, such as update_time or read_time.
1310
- */ class gt {
1308
+ */ class bt {
1311
1309
  constructor(t) {
1312
1310
  this.timestamp = t;
1313
1311
  }
1314
1312
  static fromTimestamp(t) {
1315
- return new gt(t);
1313
+ return new bt(t);
1316
1314
  }
1317
1315
  static min() {
1318
- return new gt(new _t(0, 0));
1316
+ return new bt(new gt(0, 0));
1319
1317
  }
1320
1318
  compareTo(t) {
1321
1319
  return this.timestamp._compareTo(t.timestamp);
@@ -1350,13 +1348,13 @@ class _t {
1350
1348
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1351
1349
  * See the License for the specific language governing permissions and
1352
1350
  * limitations under the License.
1353
- */ function bt(t) {
1351
+ */ function vt(t) {
1354
1352
  let n = 0;
1355
1353
  for (const e in t) Object.prototype.hasOwnProperty.call(t, e) && n++;
1356
1354
  return n;
1357
1355
  }
1358
1356
 
1359
- function vt(t, n) {
1357
+ function Et(t, n) {
1360
1358
  for (const e in t) Object.prototype.hasOwnProperty.call(t, e) && n(e, t[e]);
1361
1359
  }
1362
1360
 
@@ -1386,12 +1384,12 @@ function vt(t, n) {
1386
1384
  * If foo is not an object, foo is replaced with an object
1387
1385
  * containing foo
1388
1386
  */
1389
- class Et {
1387
+ class Tt {
1390
1388
  constructor(t) {
1391
1389
  this.fields = t,
1392
1390
  // TODO(dimond): validation of FieldMask
1393
1391
  // Sort the field mask to support `FieldMask.isEqual()` and assert below.
1394
- t.sort(Z.comparator);
1392
+ t.sort(tt.comparator);
1395
1393
  }
1396
1394
  /**
1397
1395
  * Verifies that `fieldPath` is included by at least one field in this field
@@ -1403,7 +1401,7 @@ class Et {
1403
1401
  return !1;
1404
1402
  }
1405
1403
  isEqual(t) {
1406
- return yt(this.fields, t.fields, ((t, n) => t.isEqual(n)));
1404
+ return _t(this.fields, t.fields, ((t, n) => t.isEqual(n)));
1407
1405
  }
1408
1406
  }
1409
1407
 
@@ -1449,13 +1447,13 @@ class Et {
1449
1447
  * before being sent as a proto.
1450
1448
  * @internal
1451
1449
  */
1452
- class Tt {
1450
+ class It {
1453
1451
  constructor(t) {
1454
1452
  this.binaryString = t;
1455
1453
  }
1456
1454
  static fromBase64String(t) {
1457
1455
  const n = atob(t);
1458
- return new Tt(n);
1456
+ return new It(n);
1459
1457
  }
1460
1458
  static fromUint8Array(t) {
1461
1459
  const n =
@@ -1470,7 +1468,19 @@ class Tt {
1470
1468
  /**
1471
1469
  * Helper function to convert a binary string to an Uint8Array.
1472
1470
  */ (t);
1473
- return new Tt(n);
1471
+ return new It(n);
1472
+ }
1473
+ [Symbol.iterator]() {
1474
+ let t = 0;
1475
+ return {
1476
+ next: () => t < this.binaryString.length ? {
1477
+ value: this.binaryString.charCodeAt(t++),
1478
+ done: !1
1479
+ } : {
1480
+ value: void 0,
1481
+ done: !0
1482
+ }
1483
+ };
1474
1484
  }
1475
1485
  toBase64() {
1476
1486
  return t = this.binaryString, btoa(t);
@@ -1506,31 +1516,31 @@ class Tt {
1506
1516
  return 2 * this.binaryString.length;
1507
1517
  }
1508
1518
  compareTo(t) {
1509
- return pt(this.binaryString, t.binaryString);
1519
+ return yt(this.binaryString, t.binaryString);
1510
1520
  }
1511
1521
  isEqual(t) {
1512
1522
  return this.binaryString === t.binaryString;
1513
1523
  }
1514
1524
  }
1515
1525
 
1516
- Tt.EMPTY_BYTE_STRING = new Tt("");
1526
+ It.EMPTY_BYTE_STRING = new It("");
1517
1527
 
1518
- const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1528
+ const At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1519
1529
 
1520
1530
  /**
1521
1531
  * Converts the possible Proto values for a timestamp value into a "seconds and
1522
1532
  * nanos" representation.
1523
- */ function At(t) {
1533
+ */ function Pt(t) {
1524
1534
  // The json interface (for the browser) will return an iso timestamp string,
1525
1535
  // while the proto js library (for node) will return a
1526
1536
  // google.protobuf.Timestamp instance.
1527
- if (g(!!t), "string" == typeof t) {
1537
+ if (b(!!t), "string" == typeof t) {
1528
1538
  // The date string can have higher precision (nanos) than the Date class
1529
1539
  // (millis), so we do some custom parsing here.
1530
1540
  // Parse the nanos right out of the string.
1531
1541
  let n = 0;
1532
- const e = It.exec(t);
1533
- if (g(!!e), e[1]) {
1542
+ const e = At.exec(t);
1543
+ if (b(!!e), e[1]) {
1534
1544
  // Pad the fraction out to 9 digits (nanos).
1535
1545
  let t = e[1];
1536
1546
  t = (t + "000000000").substr(0, 9), n = Number(t);
@@ -1543,21 +1553,21 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1543
1553
  };
1544
1554
  }
1545
1555
  return {
1546
- seconds: Pt(t.seconds),
1547
- nanos: Pt(t.nanos)
1556
+ seconds: Rt(t.seconds),
1557
+ nanos: Rt(t.nanos)
1548
1558
  };
1549
1559
  }
1550
1560
 
1551
1561
  /**
1552
1562
  * Converts the possible Proto types for numbers into a JavaScript number.
1553
1563
  * Returns 0 if the value is not numeric.
1554
- */ function Pt(t) {
1564
+ */ function Rt(t) {
1555
1565
  // TODO(bjornick): Handle int64 greater than 53 bits.
1556
1566
  return "number" == typeof t ? t : "string" == typeof t ? Number(t) : 0;
1557
1567
  }
1558
1568
 
1559
- /** Converts the possible Proto types for Blobs into a ByteString. */ function Rt(t) {
1560
- return "string" == typeof t ? Tt.fromBase64String(t) : Tt.fromUint8Array(t);
1569
+ /** Converts the possible Proto types for Blobs into a ByteString. */ function Vt(t) {
1570
+ return "string" == typeof t ? It.fromBase64String(t) : It.fromUint8Array(t);
1561
1571
  }
1562
1572
 
1563
1573
  /**
@@ -1593,7 +1603,7 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1593
1603
  * FieldValueOptions to value().
1594
1604
  * - With respect to other ServerTimestampValues, they sort by their
1595
1605
  * localWriteTime.
1596
- */ function Vt(t) {
1606
+ */ function Dt(t) {
1597
1607
  var n, e;
1598
1608
  return "server_timestamp" === (null === (e = ((null === (n = null == t ? void 0 : t.mapValue) || void 0 === n ? void 0 : n.fields) || {}).__type__) || void 0 === e ? void 0 : e.stringValue);
1599
1609
  }
@@ -1603,16 +1613,16 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1603
1613
  *
1604
1614
  * Preserving the previous values allows the user to display the last resoled
1605
1615
  * value until the backend responds with the timestamp.
1606
- */ function Dt(t) {
1616
+ */ function Nt(t) {
1607
1617
  const n = t.mapValue.fields.__previous_value__;
1608
- return Vt(n) ? Dt(n) : n;
1618
+ return Dt(n) ? Nt(n) : n;
1609
1619
  }
1610
1620
 
1611
1621
  /**
1612
1622
  * Returns the local time at which this timestamp was first set.
1613
- */ function Nt(t) {
1614
- const n = At(t.mapValue.fields.__local_write_time__.timestampValue);
1615
- return new _t(n.seconds, n.nanos);
1623
+ */ function $t(t) {
1624
+ const n = Pt(t.mapValue.fields.__local_write_time__.timestampValue);
1625
+ return new gt(n.seconds, n.nanos);
1616
1626
  }
1617
1627
 
1618
1628
  /**
@@ -1631,13 +1641,14 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1631
1641
  * See the License for the specific language governing permissions and
1632
1642
  * limitations under the License.
1633
1643
  */
1634
- /** Extracts the backend's type order for the provided value. */ function $t(t) {
1635
- 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 ? Vt(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : _();
1644
+ /** Extracts the backend's type order for the provided value. */ function Ft(t) {
1645
+ 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 ? Dt(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : g();
1636
1646
  }
1637
1647
 
1638
- /** Tests `left` and `right` for equality based on the backend semantics. */ function Ft(t, n) {
1639
- const e = $t(t);
1640
- if (e !== $t(n)) return !1;
1648
+ /** Tests `left` and `right` for equality based on the backend semantics. */ function St(t, n) {
1649
+ if (t === n) return !0;
1650
+ const e = Ft(t);
1651
+ if (e !== Ft(n)) return !1;
1641
1652
  switch (e) {
1642
1653
  case 0 /* NullValue */ :
1643
1654
  return !0;
@@ -1646,14 +1657,14 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1646
1657
  return t.booleanValue === n.booleanValue;
1647
1658
 
1648
1659
  case 4 /* ServerTimestampValue */ :
1649
- return Nt(t).isEqual(Nt(n));
1660
+ return $t(t).isEqual($t(n));
1650
1661
 
1651
1662
  case 3 /* TimestampValue */ :
1652
1663
  return function(t, n) {
1653
1664
  if ("string" == typeof t.timestampValue && "string" == typeof n.timestampValue && t.timestampValue.length === n.timestampValue.length)
1654
1665
  // Use string equality for ISO 8601 timestamps
1655
1666
  return t.timestampValue === n.timestampValue;
1656
- const e = At(t.timestampValue), r = At(n.timestampValue);
1667
+ const e = Pt(t.timestampValue), r = Pt(n.timestampValue);
1657
1668
  return e.seconds === r.seconds && e.nanos === r.nanos;
1658
1669
  }(t, n);
1659
1670
 
@@ -1662,7 +1673,7 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1662
1673
 
1663
1674
  case 6 /* BlobValue */ :
1664
1675
  return function(t, n) {
1665
- return Rt(t.bytesValue).isEqual(Rt(n.bytesValue));
1676
+ return Vt(t.bytesValue).isEqual(Vt(n.bytesValue));
1666
1677
  }(t, n);
1667
1678
 
1668
1679
  case 7 /* RefValue */ :
@@ -1670,70 +1681,71 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1670
1681
 
1671
1682
  case 8 /* GeoPointValue */ :
1672
1683
  return function(t, n) {
1673
- return Pt(t.geoPointValue.latitude) === Pt(n.geoPointValue.latitude) && Pt(t.geoPointValue.longitude) === Pt(n.geoPointValue.longitude);
1684
+ return Rt(t.geoPointValue.latitude) === Rt(n.geoPointValue.latitude) && Rt(t.geoPointValue.longitude) === Rt(n.geoPointValue.longitude);
1674
1685
  }(t, n);
1675
1686
 
1676
1687
  case 2 /* NumberValue */ :
1677
1688
  return function(t, n) {
1678
- if ("integerValue" in t && "integerValue" in n) return Pt(t.integerValue) === Pt(n.integerValue);
1689
+ if ("integerValue" in t && "integerValue" in n) return Rt(t.integerValue) === Rt(n.integerValue);
1679
1690
  if ("doubleValue" in t && "doubleValue" in n) {
1680
- const e = Pt(t.doubleValue), r = Pt(n.doubleValue);
1681
- return e === r ? ct(e) === ct(r) : isNaN(e) && isNaN(r);
1691
+ const e = Rt(t.doubleValue), r = Rt(n.doubleValue);
1692
+ return e === r ? at(e) === at(r) : isNaN(e) && isNaN(r);
1682
1693
  }
1683
1694
  return !1;
1684
1695
  }(t, n);
1685
1696
 
1686
1697
  case 9 /* ArrayValue */ :
1687
- return yt(t.arrayValue.values || [], n.arrayValue.values || [], Ft);
1698
+ return _t(t.arrayValue.values || [], n.arrayValue.values || [], St);
1688
1699
 
1689
1700
  case 10 /* ObjectValue */ :
1690
1701
  return function(t, n) {
1691
1702
  const e = t.mapValue.fields || {}, r = n.mapValue.fields || {};
1692
- if (bt(e) !== bt(r)) return !1;
1693
- for (const t in e) if (e.hasOwnProperty(t) && (void 0 === r[t] || !Ft(e[t], r[t]))) return !1;
1703
+ if (vt(e) !== vt(r)) return !1;
1704
+ for (const t in e) if (e.hasOwnProperty(t) && (void 0 === r[t] || !St(e[t], r[t]))) return !1;
1694
1705
  return !0;
1695
1706
  }
1696
1707
  /** Returns true if the ArrayValue contains the specified element. */ (t, n);
1697
1708
 
1698
1709
  default:
1699
- return _();
1710
+ return g();
1700
1711
  }
1701
1712
  }
1702
1713
 
1703
- function St(t, n) {
1704
- return void 0 !== (t.values || []).find((t => Ft(t, n)));
1714
+ function xt(t, n) {
1715
+ return void 0 !== (t.values || []).find((t => St(t, n)));
1705
1716
  }
1706
1717
 
1707
1718
  function qt(t, n) {
1708
- const e = $t(t), r = $t(n);
1709
- if (e !== r) return pt(e, r);
1719
+ if (t === n) return 0;
1720
+ const e = Ft(t), r = Ft(n);
1721
+ if (e !== r) return yt(e, r);
1710
1722
  switch (e) {
1711
1723
  case 0 /* NullValue */ :
1712
1724
  return 0;
1713
1725
 
1714
1726
  case 1 /* BooleanValue */ :
1715
- return pt(t.booleanValue, n.booleanValue);
1727
+ return yt(t.booleanValue, n.booleanValue);
1716
1728
 
1717
1729
  case 2 /* NumberValue */ :
1718
1730
  return function(t, n) {
1719
- const e = Pt(t.integerValue || t.doubleValue), r = Pt(n.integerValue || n.doubleValue);
1731
+ const e = Rt(t.integerValue || t.doubleValue), r = Rt(n.integerValue || n.doubleValue);
1720
1732
  return e < r ? -1 : e > r ? 1 : e === r ? 0 :
1721
1733
  // one or both are NaN.
1722
1734
  isNaN(e) ? isNaN(r) ? 0 : -1 : 1;
1723
1735
  }(t, n);
1724
1736
 
1725
1737
  case 3 /* TimestampValue */ :
1726
- return xt(t.timestampValue, n.timestampValue);
1738
+ return Ot(t.timestampValue, n.timestampValue);
1727
1739
 
1728
1740
  case 4 /* ServerTimestampValue */ :
1729
- return xt(Nt(t), Nt(n));
1741
+ return Ot($t(t), $t(n));
1730
1742
 
1731
1743
  case 5 /* StringValue */ :
1732
- return pt(t.stringValue, n.stringValue);
1744
+ return yt(t.stringValue, n.stringValue);
1733
1745
 
1734
1746
  case 6 /* BlobValue */ :
1735
1747
  return function(t, n) {
1736
- const e = Rt(t), r = Rt(n);
1748
+ const e = Vt(t), r = Vt(n);
1737
1749
  return e.compareTo(r);
1738
1750
  }(t.bytesValue, n.bytesValue);
1739
1751
 
@@ -1741,17 +1753,17 @@ function qt(t, n) {
1741
1753
  return function(t, n) {
1742
1754
  const e = t.split("/"), r = n.split("/");
1743
1755
  for (let t = 0; t < e.length && t < r.length; t++) {
1744
- const n = pt(e[t], r[t]);
1756
+ const n = yt(e[t], r[t]);
1745
1757
  if (0 !== n) return n;
1746
1758
  }
1747
- return pt(e.length, r.length);
1759
+ return yt(e.length, r.length);
1748
1760
  }(t.referenceValue, n.referenceValue);
1749
1761
 
1750
1762
  case 8 /* GeoPointValue */ :
1751
1763
  return function(t, n) {
1752
- const e = pt(Pt(t.latitude), Pt(n.latitude));
1764
+ const e = yt(Rt(t.latitude), Rt(n.latitude));
1753
1765
  if (0 !== e) return e;
1754
- return pt(Pt(t.longitude), Pt(n.longitude));
1766
+ return yt(Rt(t.longitude), Rt(n.longitude));
1755
1767
  }(t.geoPointValue, n.geoPointValue);
1756
1768
 
1757
1769
  case 9 /* ArrayValue */ :
@@ -1761,7 +1773,7 @@ function qt(t, n) {
1761
1773
  const n = qt(e[t], r[t]);
1762
1774
  if (n) return n;
1763
1775
  }
1764
- return pt(e.length, r.length);
1776
+ return yt(e.length, r.length);
1765
1777
  }(t.arrayValue, n.arrayValue);
1766
1778
 
1767
1779
  case 10 /* ObjectValue */ :
@@ -1773,49 +1785,49 @@ function qt(t, n) {
1773
1785
  // canonical IDs are independent of insertion order.
1774
1786
  r.sort(), i.sort();
1775
1787
  for (let t = 0; t < r.length && t < i.length; ++t) {
1776
- const n = pt(r[t], i[t]);
1788
+ const n = yt(r[t], i[t]);
1777
1789
  if (0 !== n) return n;
1778
1790
  const o = qt(e[r[t]], s[i[t]]);
1779
1791
  if (0 !== o) return o;
1780
1792
  }
1781
- return pt(r.length, i.length);
1793
+ return yt(r.length, i.length);
1782
1794
  }
1783
1795
  /** Returns a reference value for the provided database and key. */ (t.mapValue, n.mapValue);
1784
1796
 
1785
1797
  default:
1786
- throw _();
1798
+ throw g();
1787
1799
  }
1788
1800
  }
1789
1801
 
1790
- function xt(t, n) {
1791
- if ("string" == typeof t && "string" == typeof n && t.length === n.length) return pt(t, n);
1792
- const e = At(t), r = At(n), s = pt(e.seconds, r.seconds);
1793
- return 0 !== s ? s : pt(e.nanos, r.nanos);
1802
+ function Ot(t, n) {
1803
+ if ("string" == typeof t && "string" == typeof n && t.length === n.length) return yt(t, n);
1804
+ const e = Pt(t), r = Pt(n), s = yt(e.seconds, r.seconds);
1805
+ return 0 !== s ? s : yt(e.nanos, r.nanos);
1794
1806
  }
1795
1807
 
1796
- function Ot(t, n) {
1808
+ function Ct(t, n) {
1797
1809
  return {
1798
1810
  referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${n.path.canonicalString()}`
1799
1811
  };
1800
1812
  }
1801
1813
 
1802
- /** Returns true if `value` is an ArrayValue. */ function Ct(t) {
1814
+ /** Returns true if `value` is an ArrayValue. */ function Lt(t) {
1803
1815
  return !!t && "arrayValue" in t;
1804
1816
  }
1805
1817
 
1806
- /** Returns true if `value` is a NullValue. */ function Lt(t) {
1818
+ /** Returns true if `value` is a NullValue. */ function Ut(t) {
1807
1819
  return !!t && "nullValue" in t;
1808
1820
  }
1809
1821
 
1810
- /** Returns true if `value` is NaN. */ function Ut(t) {
1822
+ /** Returns true if `value` is NaN. */ function kt(t) {
1811
1823
  return !!t && "doubleValue" in t && isNaN(Number(t.doubleValue));
1812
1824
  }
1813
1825
 
1814
- /** Returns true if `value` is a MapValue. */ function kt(t) {
1826
+ /** Returns true if `value` is a MapValue. */ function jt(t) {
1815
1827
  return !!t && "mapValue" in t;
1816
1828
  }
1817
1829
 
1818
- /** Creates a deep copy of `source`. */ function jt(t) {
1830
+ /** Creates a deep copy of `source`. */ function Mt(t) {
1819
1831
  if (t.geoPointValue) return {
1820
1832
  geoPointValue: Object.assign({}, t.geoPointValue)
1821
1833
  };
@@ -1828,7 +1840,7 @@ function Ot(t, n) {
1828
1840
  fields: {}
1829
1841
  }
1830
1842
  };
1831
- return vt(t.mapValue.fields, ((t, e) => n.mapValue.fields[t] = jt(e))), n;
1843
+ return Et(t.mapValue.fields, ((t, e) => n.mapValue.fields[t] = Mt(e))), n;
1832
1844
  }
1833
1845
  if (t.arrayValue) {
1834
1846
  const n = {
@@ -1836,7 +1848,7 @@ function Ot(t, n) {
1836
1848
  values: []
1837
1849
  }
1838
1850
  };
1839
- for (let e = 0; e < (t.arrayValue.values || []).length; ++e) n.arrayValue.values[e] = jt(t.arrayValue.values[e]);
1851
+ for (let e = 0; e < (t.arrayValue.values || []).length; ++e) n.arrayValue.values[e] = Mt(t.arrayValue.values[e]);
1840
1852
  return n;
1841
1853
  }
1842
1854
  return Object.assign({}, t);
@@ -1861,12 +1873,12 @@ function Ot(t, n) {
1861
1873
  /**
1862
1874
  * An ObjectValue represents a MapValue in the Firestore Proto and offers the
1863
1875
  * ability to add and remove fields (via the ObjectValueBuilder).
1864
- */ class Mt {
1876
+ */ class Bt {
1865
1877
  constructor(t) {
1866
1878
  this.value = t;
1867
1879
  }
1868
1880
  static empty() {
1869
- return new Mt({
1881
+ return new Bt({
1870
1882
  mapValue: {}
1871
1883
  });
1872
1884
  }
@@ -1880,7 +1892,7 @@ function Ot(t, n) {
1880
1892
  {
1881
1893
  let n = this.value;
1882
1894
  for (let e = 0; e < t.length - 1; ++e) if (n = (n.mapValue.fields || {})[t.get(e)],
1883
- !kt(n)) return null;
1895
+ !jt(n)) return null;
1884
1896
  return n = (n.mapValue.fields || {})[t.lastSegment()], n || null;
1885
1897
  }
1886
1898
  }
@@ -1890,21 +1902,21 @@ function Ot(t, n) {
1890
1902
  * @param path - The field path to set.
1891
1903
  * @param value - The value to set.
1892
1904
  */ set(t, n) {
1893
- this.getFieldsMap(t.popLast())[t.lastSegment()] = jt(n);
1905
+ this.getFieldsMap(t.popLast())[t.lastSegment()] = Mt(n);
1894
1906
  }
1895
1907
  /**
1896
1908
  * Sets the provided fields to the provided values.
1897
1909
  *
1898
1910
  * @param data - A map of fields to values (or null for deletes).
1899
1911
  */ setAll(t) {
1900
- let n = Z.emptyPath(), e = {}, r = [];
1912
+ let n = tt.emptyPath(), e = {}, r = [];
1901
1913
  t.forEach(((t, s) => {
1902
1914
  if (!n.isImmediateParentOf(s)) {
1903
1915
  // Insert the accumulated changes at this parent location
1904
1916
  const t = this.getFieldsMap(n);
1905
1917
  this.applyChanges(t, e, r), e = {}, r = [], n = s.popLast();
1906
1918
  }
1907
- t ? e[s.lastSegment()] = jt(t) : r.push(s.lastSegment());
1919
+ t ? e[s.lastSegment()] = Mt(t) : r.push(s.lastSegment());
1908
1920
  }));
1909
1921
  const s = this.getFieldsMap(n);
1910
1922
  this.applyChanges(s, e, r);
@@ -1916,10 +1928,10 @@ function Ot(t, n) {
1916
1928
  * @param path - The field path to remove.
1917
1929
  */ delete(t) {
1918
1930
  const n = this.field(t.popLast());
1919
- kt(n) && n.mapValue.fields && delete n.mapValue.fields[t.lastSegment()];
1931
+ jt(n) && n.mapValue.fields && delete n.mapValue.fields[t.lastSegment()];
1920
1932
  }
1921
1933
  isEqual(t) {
1922
- return Ft(this.value, t.value);
1934
+ return St(this.value, t.value);
1923
1935
  }
1924
1936
  /**
1925
1937
  * Returns the map that contains the leaf element of `path`. If the parent
@@ -1931,7 +1943,7 @@ function Ot(t, n) {
1931
1943
  });
1932
1944
  for (let e = 0; e < t.length; ++e) {
1933
1945
  let r = n.mapValue.fields[t.get(e)];
1934
- kt(r) && r.mapValue.fields || (r = {
1946
+ jt(r) && r.mapValue.fields || (r = {
1935
1947
  mapValue: {
1936
1948
  fields: {}
1937
1949
  }
@@ -1943,11 +1955,11 @@ function Ot(t, n) {
1943
1955
  * Modifies `fieldsMap` by adding, replacing or deleting the specified
1944
1956
  * entries.
1945
1957
  */ applyChanges(t, n, e) {
1946
- vt(n, ((n, e) => t[n] = e));
1958
+ Et(n, ((n, e) => t[n] = e));
1947
1959
  for (const n of e) delete t[n];
1948
1960
  }
1949
1961
  clone() {
1950
- return new Mt(jt(this.value));
1962
+ return new Bt(Mt(this.value));
1951
1963
  }
1952
1964
  }
1953
1965
 
@@ -1976,7 +1988,7 @@ function Ot(t, n) {
1976
1988
  * not transition to one of these states even after all mutations have been
1977
1989
  * applied, `isValidDocument()` returns false and the document should be removed
1978
1990
  * from all views.
1979
- */ class Bt {
1991
+ */ class zt {
1980
1992
  constructor(t, n, e, r, s) {
1981
1993
  this.key = t, this.documentType = n, this.version = e, this.data = r, this.documentState = s;
1982
1994
  }
@@ -1984,23 +1996,23 @@ function Ot(t, n) {
1984
1996
  * Creates a document with no known version or data, but which can serve as
1985
1997
  * base document for mutations.
1986
1998
  */ static newInvalidDocument(t) {
1987
- return new Bt(t, 0 /* INVALID */ , gt.min(), Mt.empty(), 0 /* SYNCED */);
1999
+ return new zt(t, 0 /* INVALID */ , bt.min(), Bt.empty(), 0 /* SYNCED */);
1988
2000
  }
1989
2001
  /**
1990
2002
  * Creates a new document that is known to exist with the given data at the
1991
2003
  * given version.
1992
2004
  */ static newFoundDocument(t, n, e) {
1993
- return new Bt(t, 1 /* FOUND_DOCUMENT */ , n, e, 0 /* SYNCED */);
2005
+ return new zt(t, 1 /* FOUND_DOCUMENT */ , n, e, 0 /* SYNCED */);
1994
2006
  }
1995
2007
  /** Creates a new document that is known to not exist at the given version. */ static newNoDocument(t, n) {
1996
- return new Bt(t, 2 /* NO_DOCUMENT */ , n, Mt.empty(), 0 /* SYNCED */);
2008
+ return new zt(t, 2 /* NO_DOCUMENT */ , n, Bt.empty(), 0 /* SYNCED */);
1997
2009
  }
1998
2010
  /**
1999
2011
  * Creates a new document that is known to exist at the given version but
2000
2012
  * whose data is not known (e.g. a document that was updated without a known
2001
2013
  * base document).
2002
2014
  */ static newUnknownDocument(t, n) {
2003
- return new Bt(t, 3 /* UNKNOWN_DOCUMENT */ , n, Mt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
2015
+ return new zt(t, 3 /* UNKNOWN_DOCUMENT */ , n, Bt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
2004
2016
  }
2005
2017
  /**
2006
2018
  * Changes the document type to indicate that it exists and that its version
@@ -2013,7 +2025,7 @@ function Ot(t, n) {
2013
2025
  * Changes the document type to indicate that it doesn't exist at the given
2014
2026
  * version.
2015
2027
  */ convertToNoDocument(t) {
2016
- return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = Mt.empty(),
2028
+ return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = Bt.empty(),
2017
2029
  this.documentState = 0 /* SYNCED */ , this;
2018
2030
  }
2019
2031
  /**
@@ -2021,7 +2033,7 @@ function Ot(t, n) {
2021
2033
  * that its data is not known (e.g. a document that was updated without a known
2022
2034
  * base document).
2023
2035
  */ convertToUnknownDocument(t) {
2024
- return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = Mt.empty(),
2036
+ return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = Bt.empty(),
2025
2037
  this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
2026
2038
  }
2027
2039
  setHasCommittedMutations() {
@@ -2052,10 +2064,10 @@ function Ot(t, n) {
2052
2064
  return 3 /* UNKNOWN_DOCUMENT */ === this.documentType;
2053
2065
  }
2054
2066
  isEqual(t) {
2055
- return t instanceof Bt && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);
2067
+ return t instanceof zt && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);
2056
2068
  }
2057
- clone() {
2058
- return new Bt(this.key, this.documentType, this.version, this.data.clone(), this.documentState);
2069
+ mutableCopy() {
2070
+ return new zt(this.key, this.documentType, this.version, this.data.clone(), this.documentState);
2059
2071
  }
2060
2072
  toString() {
2061
2073
  return `Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`;
@@ -2079,7 +2091,7 @@ function Ot(t, n) {
2079
2091
  * limitations under the License.
2080
2092
  */
2081
2093
  // Visible for testing
2082
- class zt {
2094
+ class Gt {
2083
2095
  constructor(t, n = null, e = [], r = [], s = null, i = null, o = null) {
2084
2096
  this.path = t, this.collectionGroup = n, this.orderBy = e, this.filters = r, this.limit = s,
2085
2097
  this.startAt = i, this.endAt = o, this.R = null;
@@ -2093,26 +2105,26 @@ class zt {
2093
2105
  * NOTE: you should always construct `Target` from `Query.toTarget` instead of
2094
2106
  * using this factory method, because `Query` provides an implicit `orderBy`
2095
2107
  * property.
2096
- */ function Gt(t, n = null, e = [], r = [], s = null, i = null, o = null) {
2097
- return new zt(t, n, e, r, s, i, o);
2108
+ */ function Qt(t, n = null, e = [], r = [], s = null, i = null, o = null) {
2109
+ return new Gt(t, n, e, r, s, i, o);
2098
2110
  }
2099
2111
 
2100
- class Qt extends class {} {
2112
+ class Wt extends class {} {
2101
2113
  constructor(t, n, e) {
2102
2114
  super(), this.field = t, this.op = n, this.value = e;
2103
2115
  }
2104
2116
  /**
2105
2117
  * Creates a filter based on the provided arguments.
2106
2118
  */ static create(t, n, e) {
2107
- return t.isKeyField() ? "in" /* IN */ === n || "not-in" /* NOT_IN */ === n ? this.V(t, n, e) : new Wt(t, n, e) : "array-contains" /* ARRAY_CONTAINS */ === n ? new Jt(t, e) : "in" /* IN */ === n ? new Xt(t, e) : "not-in" /* NOT_IN */ === n ? new Zt(t, e) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === n ? new tn(t, e) : new Qt(t, n, e);
2119
+ return t.isKeyField() ? "in" /* IN */ === n || "not-in" /* NOT_IN */ === n ? this.V(t, n, e) : new Yt(t, n, e) : "array-contains" /* ARRAY_CONTAINS */ === n ? new Xt(t, e) : "in" /* IN */ === n ? new Zt(t, e) : "not-in" /* NOT_IN */ === n ? new tn(t, e) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === n ? new nn(t, e) : new Wt(t, n, e);
2108
2120
  }
2109
2121
  static V(t, n, e) {
2110
- return "in" /* IN */ === n ? new Yt(t, e) : new Ht(t, e);
2122
+ return "in" /* IN */ === n ? new Ht(t, e) : new Kt(t, e);
2111
2123
  }
2112
2124
  matches(t) {
2113
2125
  const n = t.data.field(this.field);
2114
2126
  // Types do not have to match in NOT_EQUAL filters.
2115
- return "!=" /* NOT_EQUAL */ === this.op ? null !== n && this.D(qt(n, this.value)) : null !== n && $t(this.value) === $t(n) && this.D(qt(n, this.value));
2127
+ return "!=" /* NOT_EQUAL */ === this.op ? null !== n && this.D(qt(n, this.value)) : null !== n && Ft(this.value) === Ft(n) && this.D(qt(n, this.value));
2116
2128
  // Only compare types with matching backend order (such as double and int).
2117
2129
  }
2118
2130
  D(t) {
@@ -2136,7 +2148,7 @@ class Qt extends class {} {
2136
2148
  return t >= 0;
2137
2149
 
2138
2150
  default:
2139
- return _();
2151
+ return g();
2140
2152
  }
2141
2153
  }
2142
2154
  N() {
@@ -2145,79 +2157,79 @@ class Qt extends class {} {
2145
2157
  }
2146
2158
 
2147
2159
  /** Filter that matches on key fields (i.e. '__name__'). */
2148
- class Wt extends Qt {
2160
+ class Yt extends Wt {
2149
2161
  constructor(t, n, e) {
2150
- super(t, n, e), this.key = tt.fromName(e.referenceValue);
2162
+ super(t, n, e), this.key = nt.fromName(e.referenceValue);
2151
2163
  }
2152
2164
  matches(t) {
2153
- const n = tt.comparator(t.key, this.key);
2165
+ const n = nt.comparator(t.key, this.key);
2154
2166
  return this.D(n);
2155
2167
  }
2156
2168
  }
2157
2169
 
2158
- /** Filter that matches on key fields within an array. */ class Yt extends Qt {
2170
+ /** Filter that matches on key fields within an array. */ class Ht extends Wt {
2159
2171
  constructor(t, n) {
2160
- super(t, "in" /* IN */ , n), this.keys = Kt("in" /* IN */ , n);
2172
+ super(t, "in" /* IN */ , n), this.keys = Jt("in" /* IN */ , n);
2161
2173
  }
2162
2174
  matches(t) {
2163
2175
  return this.keys.some((n => n.isEqual(t.key)));
2164
2176
  }
2165
2177
  }
2166
2178
 
2167
- /** Filter that matches on key fields not present within an array. */ class Ht extends Qt {
2179
+ /** Filter that matches on key fields not present within an array. */ class Kt extends Wt {
2168
2180
  constructor(t, n) {
2169
- super(t, "not-in" /* NOT_IN */ , n), this.keys = Kt("not-in" /* NOT_IN */ , n);
2181
+ super(t, "not-in" /* NOT_IN */ , n), this.keys = Jt("not-in" /* NOT_IN */ , n);
2170
2182
  }
2171
2183
  matches(t) {
2172
2184
  return !this.keys.some((n => n.isEqual(t.key)));
2173
2185
  }
2174
2186
  }
2175
2187
 
2176
- function Kt(t, n) {
2188
+ function Jt(t, n) {
2177
2189
  var e;
2178
- return ((null === (e = n.arrayValue) || void 0 === e ? void 0 : e.values) || []).map((t => tt.fromName(t.referenceValue)));
2190
+ return ((null === (e = n.arrayValue) || void 0 === e ? void 0 : e.values) || []).map((t => nt.fromName(t.referenceValue)));
2179
2191
  }
2180
2192
 
2181
- /** A Filter that implements the array-contains operator. */ class Jt extends Qt {
2193
+ /** A Filter that implements the array-contains operator. */ class Xt extends Wt {
2182
2194
  constructor(t, n) {
2183
2195
  super(t, "array-contains" /* ARRAY_CONTAINS */ , n);
2184
2196
  }
2185
2197
  matches(t) {
2186
2198
  const n = t.data.field(this.field);
2187
- return Ct(n) && St(n.arrayValue, this.value);
2199
+ return Lt(n) && xt(n.arrayValue, this.value);
2188
2200
  }
2189
2201
  }
2190
2202
 
2191
- /** A Filter that implements the IN operator. */ class Xt extends Qt {
2203
+ /** A Filter that implements the IN operator. */ class Zt extends Wt {
2192
2204
  constructor(t, n) {
2193
2205
  super(t, "in" /* IN */ , n);
2194
2206
  }
2195
2207
  matches(t) {
2196
2208
  const n = t.data.field(this.field);
2197
- return null !== n && St(this.value.arrayValue, n);
2209
+ return null !== n && xt(this.value.arrayValue, n);
2198
2210
  }
2199
2211
  }
2200
2212
 
2201
- /** A Filter that implements the not-in operator. */ class Zt extends Qt {
2213
+ /** A Filter that implements the not-in operator. */ class tn extends Wt {
2202
2214
  constructor(t, n) {
2203
2215
  super(t, "not-in" /* NOT_IN */ , n);
2204
2216
  }
2205
2217
  matches(t) {
2206
- if (St(this.value.arrayValue, {
2218
+ if (xt(this.value.arrayValue, {
2207
2219
  nullValue: "NULL_VALUE"
2208
2220
  })) return !1;
2209
2221
  const n = t.data.field(this.field);
2210
- return null !== n && !St(this.value.arrayValue, n);
2222
+ return null !== n && !xt(this.value.arrayValue, n);
2211
2223
  }
2212
2224
  }
2213
2225
 
2214
- /** A Filter that implements the array-contains-any operator. */ class tn extends Qt {
2226
+ /** A Filter that implements the array-contains-any operator. */ class nn extends Wt {
2215
2227
  constructor(t, n) {
2216
2228
  super(t, "array-contains-any" /* ARRAY_CONTAINS_ANY */ , n);
2217
2229
  }
2218
2230
  matches(t) {
2219
2231
  const n = t.data.field(this.field);
2220
- return !(!Ct(n) || !n.arrayValue.values) && n.arrayValue.values.some((t => St(this.value.arrayValue, t)));
2232
+ return !(!Lt(n) || !n.arrayValue.values) && n.arrayValue.values.some((t => xt(this.value.arrayValue, t)));
2221
2233
  }
2222
2234
  }
2223
2235
 
@@ -2234,7 +2246,7 @@ function Kt(t, n) {
2234
2246
  * Bound provides a function to determine whether a document comes before or
2235
2247
  * after a bound. This is influenced by whether the position is just before or
2236
2248
  * just after the provided values.
2237
- */ class nn {
2249
+ */ class en {
2238
2250
  constructor(t, n) {
2239
2251
  this.position = t, this.before = n;
2240
2252
  }
@@ -2242,22 +2254,22 @@ function Kt(t, n) {
2242
2254
 
2243
2255
  /**
2244
2256
  * An ordering on a field, in some Direction. Direction defaults to ASCENDING.
2245
- */ class en {
2257
+ */ class rn {
2246
2258
  constructor(t, n = "asc" /* ASCENDING */) {
2247
2259
  this.field = t, this.dir = n;
2248
2260
  }
2249
2261
  }
2250
2262
 
2251
- function rn(t, n) {
2263
+ function sn(t, n) {
2252
2264
  return t.dir === n.dir && t.field.isEqual(n.field);
2253
2265
  }
2254
2266
 
2255
- function sn(t, n) {
2267
+ function on(t, n) {
2256
2268
  if (null === t) return null === n;
2257
2269
  if (null === n) return !1;
2258
2270
  if (t.before !== n.before || t.position.length !== n.position.length) return !1;
2259
2271
  for (let e = 0; e < t.position.length; e++) {
2260
- if (!Ft(t.position[e], n.position[e])) return !1;
2272
+ if (!St(t.position[e], n.position[e])) return !1;
2261
2273
  }
2262
2274
  return !0;
2263
2275
  }
@@ -2284,7 +2296,7 @@ function sn(t, n) {
2284
2296
  * query the RemoteStore results.
2285
2297
  *
2286
2298
  * Visible for testing.
2287
- */ class on {
2299
+ */ class un {
2288
2300
  /**
2289
2301
  * Initializes a Query with a path and optional additional query constraints.
2290
2302
  * Path must currently be empty if this is a collection group query.
@@ -2297,15 +2309,15 @@ function sn(t, n) {
2297
2309
  }
2298
2310
  }
2299
2311
 
2300
- /** Creates a new Query for a query that matches all documents at `path` */ function un(t) {
2301
- return !ut(t.limit) && "L" /* Last */ === t.limitType;
2312
+ /** Creates a new Query for a query that matches all documents at `path` */ function cn(t) {
2313
+ return !ct(t.limit) && "L" /* Last */ === t.limitType;
2302
2314
  }
2303
2315
 
2304
- function cn(t) {
2316
+ function an(t) {
2305
2317
  return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;
2306
2318
  }
2307
2319
 
2308
- function an(t) {
2320
+ function hn(t) {
2309
2321
  for (const n of t.filters) if (n.N()) return n.field;
2310
2322
  return null;
2311
2323
  }
@@ -2318,7 +2330,7 @@ function an(t) {
2318
2330
  * Returns whether the query matches a collection group rather than a specific
2319
2331
  * collection.
2320
2332
  */
2321
- function hn(t) {
2333
+ function ln(t) {
2322
2334
  return null !== t.collectionGroup;
2323
2335
  }
2324
2336
 
@@ -2326,23 +2338,23 @@ function hn(t) {
2326
2338
  * Returns the implicit order by constraint that is used to execute the Query,
2327
2339
  * which can be different from the order by constraints the user provided (e.g.
2328
2340
  * the SDK and backend always orders by `__name__`).
2329
- */ function ln(t) {
2330
- const n = b(t);
2341
+ */ function fn(t) {
2342
+ const n = v(t);
2331
2343
  if (null === n.$) {
2332
2344
  n.$ = [];
2333
- const t = an(n), e = cn(n);
2345
+ const t = hn(n), e = an(n);
2334
2346
  if (null !== t && null === e)
2335
2347
  // In order to implicitly add key ordering, we must also add the
2336
2348
  // inequality filter field for it to be a valid query.
2337
2349
  // Note that the default inequality field and key ordering is ascending.
2338
- t.isKeyField() || n.$.push(new en(t)), n.$.push(new en(Z.keyField(), "asc" /* ASCENDING */)); else {
2350
+ t.isKeyField() || n.$.push(new rn(t)), n.$.push(new rn(tt.keyField(), "asc" /* ASCENDING */)); else {
2339
2351
  let t = !1;
2340
2352
  for (const e of n.explicitOrderBy) n.$.push(e), e.field.isKeyField() && (t = !0);
2341
2353
  if (!t) {
2342
2354
  // The order of the implicit key ordering always matches the last
2343
2355
  // explicit order by
2344
2356
  const t = n.explicitOrderBy.length > 0 ? n.explicitOrderBy[n.explicitOrderBy.length - 1].dir : "asc" /* ASCENDING */;
2345
- n.$.push(new en(Z.keyField(), t));
2357
+ n.$.push(new rn(tt.keyField(), t));
2346
2358
  }
2347
2359
  }
2348
2360
  }
@@ -2351,34 +2363,34 @@ function hn(t) {
2351
2363
 
2352
2364
  /**
2353
2365
  * Converts this `Query` instance to it's corresponding `Target` representation.
2354
- */ function fn(t) {
2355
- const n = b(t);
2356
- if (!n.F) if ("F" /* First */ === n.limitType) n.F = Gt(n.path, n.collectionGroup, ln(n), n.filters, n.limit, n.startAt, n.endAt); else {
2366
+ */ function dn(t) {
2367
+ const n = v(t);
2368
+ if (!n.F) if ("F" /* First */ === n.limitType) n.F = Qt(n.path, n.collectionGroup, fn(n), n.filters, n.limit, n.startAt, n.endAt); else {
2357
2369
  // Flip the orderBy directions since we want the last results
2358
2370
  const t = [];
2359
- for (const e of ln(n)) {
2371
+ for (const e of fn(n)) {
2360
2372
  const n = "desc" /* DESCENDING */ === e.dir ? "asc" /* ASCENDING */ : "desc" /* DESCENDING */;
2361
- t.push(new en(e.field, n));
2373
+ t.push(new rn(e.field, n));
2362
2374
  }
2363
2375
  // We need to swap the cursors to match the now-flipped query ordering.
2364
- const e = n.endAt ? new nn(n.endAt.position, !n.endAt.before) : null, r = n.startAt ? new nn(n.startAt.position, !n.startAt.before) : null;
2376
+ const e = n.endAt ? new en(n.endAt.position, !n.endAt.before) : null, r = n.startAt ? new en(n.startAt.position, !n.startAt.before) : null;
2365
2377
  // Now return as a LimitType.First query.
2366
- n.F = Gt(n.path, n.collectionGroup, t, n.filters, n.limit, e, r);
2378
+ n.F = Qt(n.path, n.collectionGroup, t, n.filters, n.limit, e, r);
2367
2379
  }
2368
2380
  return n.F;
2369
2381
  }
2370
2382
 
2371
- function dn(t, n) {
2383
+ function wn(t, n) {
2372
2384
  return function(t, n) {
2373
2385
  if (t.limit !== n.limit) return !1;
2374
2386
  if (t.orderBy.length !== n.orderBy.length) return !1;
2375
- for (let e = 0; e < t.orderBy.length; e++) if (!rn(t.orderBy[e], n.orderBy[e])) return !1;
2387
+ for (let e = 0; e < t.orderBy.length; e++) if (!sn(t.orderBy[e], n.orderBy[e])) return !1;
2376
2388
  if (t.filters.length !== n.filters.length) return !1;
2377
2389
  for (let s = 0; s < t.filters.length; s++) if (e = t.filters[s], r = n.filters[s],
2378
- e.op !== r.op || !e.field.isEqual(r.field) || !Ft(e.value, r.value)) return !1;
2390
+ e.op !== r.op || !e.field.isEqual(r.field) || !St(e.value, r.value)) return !1;
2379
2391
  var e, r;
2380
- return t.collectionGroup === n.collectionGroup && !!t.path.isEqual(n.path) && !!sn(t.startAt, n.startAt) && sn(t.endAt, n.endAt);
2381
- }(fn(t), fn(n)) && t.limitType === n.limitType;
2392
+ return t.collectionGroup === n.collectionGroup && !!t.path.isEqual(n.path) && !!on(t.startAt, n.startAt) && on(t.endAt, n.endAt);
2393
+ }(dn(t), dn(n)) && t.limitType === n.limitType;
2382
2394
  }
2383
2395
 
2384
2396
  /**
@@ -2406,9 +2418,9 @@ function dn(t, n) {
2406
2418
  * The return value is an IntegerValue if it can safely represent the value,
2407
2419
  * otherwise a DoubleValue is returned.
2408
2420
  */
2409
- function wn(t, n) {
2421
+ function mn(t, n) {
2410
2422
  return function(t) {
2411
- return "number" == typeof t && Number.isInteger(t) && !ct(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
2423
+ return "number" == typeof t && Number.isInteger(t) && !at(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
2412
2424
  }(n) ?
2413
2425
  /**
2414
2426
  * Returns an IntegerValue for `value`.
@@ -2430,7 +2442,7 @@ function wn(t, n) {
2430
2442
  };
2431
2443
  }
2432
2444
  return {
2433
- doubleValue: ct(n) ? "-0" : n
2445
+ doubleValue: at(n) ? "-0" : n
2434
2446
  };
2435
2447
  }(t, n);
2436
2448
  }
@@ -2451,7 +2463,7 @@ function wn(t, n) {
2451
2463
  * See the License for the specific language governing permissions and
2452
2464
  * limitations under the License.
2453
2465
  */
2454
- /** Used to represent a field transform on a mutation. */ class mn {
2466
+ /** Used to represent a field transform on a mutation. */ class pn {
2455
2467
  constructor() {
2456
2468
  // Make sure that the structural type of `TransformOperation` is unique.
2457
2469
  // See https://github.com/microsoft/TypeScript/issues/5451
@@ -2459,15 +2471,15 @@ function wn(t, n) {
2459
2471
  }
2460
2472
  }
2461
2473
 
2462
- /** Transforms a value into a server-generated timestamp. */ class pn extends mn {}
2474
+ /** Transforms a value into a server-generated timestamp. */ class yn extends pn {}
2463
2475
 
2464
- /** Transforms an array value via a union operation. */ class yn extends mn {
2476
+ /** Transforms an array value via a union operation. */ class _n extends pn {
2465
2477
  constructor(t) {
2466
2478
  super(), this.elements = t;
2467
2479
  }
2468
2480
  }
2469
2481
 
2470
- /** Transforms an array value via a remove operation. */ class _n extends mn {
2482
+ /** Transforms an array value via a remove operation. */ class gn extends pn {
2471
2483
  constructor(t) {
2472
2484
  super(), this.elements = t;
2473
2485
  }
@@ -2478,7 +2490,7 @@ function wn(t, n) {
2478
2490
  * transforms. Converts all field values to integers or doubles, but unlike the
2479
2491
  * backend does not cap integer values at 2^63. Instead, JavaScript number
2480
2492
  * arithmetic is used and precision loss can occur for values greater than 2^53.
2481
- */ class gn extends mn {
2493
+ */ class bn extends pn {
2482
2494
  constructor(t, n) {
2483
2495
  super(), this.q = t, this.O = n;
2484
2496
  }
@@ -2500,7 +2512,7 @@ function wn(t, n) {
2500
2512
  * See the License for the specific language governing permissions and
2501
2513
  * limitations under the License.
2502
2514
  */
2503
- /** A field path and the TransformOperation to perform upon it. */ class bn {
2515
+ /** A field path and the TransformOperation to perform upon it. */ class vn {
2504
2516
  constructor(t, n) {
2505
2517
  this.field = t, this.transform = n;
2506
2518
  }
@@ -2510,18 +2522,18 @@ function wn(t, n) {
2510
2522
  * Encodes a precondition for a mutation. This follows the model that the
2511
2523
  * backend accepts with the special case of an explicit "empty" precondition
2512
2524
  * (meaning no precondition).
2513
- */ class vn {
2525
+ */ class En {
2514
2526
  constructor(t, n) {
2515
2527
  this.updateTime = t, this.exists = n;
2516
2528
  }
2517
2529
  /** Creates a new empty Precondition. */ static none() {
2518
- return new vn;
2530
+ return new En;
2519
2531
  }
2520
2532
  /** Creates a new Precondition with an exists flag. */ static exists(t) {
2521
- return new vn(void 0, t);
2533
+ return new En(void 0, t);
2522
2534
  }
2523
2535
  /** Creates a new Precondition based on a version a document exists at. */ static updateTime(t) {
2524
- return new vn(t);
2536
+ return new En(t);
2525
2537
  }
2526
2538
  /** Returns whether this Precondition is empty. */ get isNone() {
2527
2539
  return void 0 === this.updateTime && void 0 === this.exists;
@@ -2574,12 +2586,12 @@ function wn(t, n) {
2574
2586
  * applyToLocalView() to implement the actual behavior of applying the mutation
2575
2587
  * to some source document (see `setMutationApplyToRemoteDocument()` for an
2576
2588
  * example).
2577
- */ class En {}
2589
+ */ class Tn {}
2578
2590
 
2579
2591
  /**
2580
2592
  * A mutation that creates or replaces the document at the given key with the
2581
2593
  * object value contents.
2582
- */ class Tn extends En {
2594
+ */ class In extends Tn {
2583
2595
  constructor(t, n, e, r = []) {
2584
2596
  super(), this.key = t, this.value = n, this.precondition = e, this.fieldTransforms = r,
2585
2597
  this.type = 0 /* Set */;
@@ -2598,14 +2610,14 @@ function wn(t, n) {
2598
2610
  * is deleted.
2599
2611
  * * When a field is not in the mask but is in the values, the values map is
2600
2612
  * ignored.
2601
- */ class In extends En {
2613
+ */ class An extends Tn {
2602
2614
  constructor(t, n, e, r, s = []) {
2603
2615
  super(), this.key = t, this.data = n, this.fieldMask = e, this.precondition = r,
2604
2616
  this.fieldTransforms = s, this.type = 1 /* Patch */;
2605
2617
  }
2606
2618
  }
2607
2619
 
2608
- /** A mutation that deletes the document at the given key. */ class An extends En {
2620
+ /** A mutation that deletes the document at the given key. */ class Pn extends Tn {
2609
2621
  constructor(t, n) {
2610
2622
  super(), this.key = t, this.precondition = n, this.type = 2 /* Delete */ , this.fieldTransforms = [];
2611
2623
  }
@@ -2617,7 +2629,7 @@ function wn(t, n) {
2617
2629
  *
2618
2630
  * The `verify` operation is only used in Transactions, and this class serves
2619
2631
  * primarily to facilitate serialization into protos.
2620
- */ class Pn extends En {
2632
+ */ class Rn extends Tn {
2621
2633
  constructor(t, n) {
2622
2634
  super(), this.key = t, this.precondition = n, this.type = 3 /* Verify */ , this.fieldTransforms = [];
2623
2635
  }
@@ -2638,13 +2650,13 @@ function wn(t, n) {
2638
2650
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2639
2651
  * See the License for the specific language governing permissions and
2640
2652
  * limitations under the License.
2641
- */ const Rn = (() => {
2653
+ */ const Vn = (() => {
2642
2654
  const t = {
2643
2655
  asc: "ASCENDING",
2644
2656
  desc: "DESCENDING"
2645
2657
  };
2646
2658
  return t;
2647
- })(), Vn = (() => {
2659
+ })(), Dn = (() => {
2648
2660
  const t = {
2649
2661
  "<": "LESS_THAN",
2650
2662
  "<=": "LESS_THAN_OR_EQUAL",
@@ -2674,7 +2686,7 @@ function wn(t, n) {
2674
2686
  * TODO(klimt): We can remove the databaseId argument if we keep the full
2675
2687
  * resource name in documents.
2676
2688
  */
2677
- class Dn {
2689
+ class Nn {
2678
2690
  constructor(t, n) {
2679
2691
  this.databaseId = t, this.S = n;
2680
2692
  }
@@ -2691,7 +2703,7 @@ class Dn {
2691
2703
  /**
2692
2704
  * Returns a value for a Date that's appropriate to put into a proto.
2693
2705
  */
2694
- function Nn(t, n) {
2706
+ function $n(t, n) {
2695
2707
  if (t.S) {
2696
2708
  return `${new Date(1e3 * n.seconds).toISOString().replace(/\.\d*/, "").replace("Z", "")}.${("000000000" + n.nanoseconds).slice(-9)}Z`;
2697
2709
  }
@@ -2706,129 +2718,129 @@ function Nn(t, n) {
2706
2718
  *
2707
2719
  * Visible for testing.
2708
2720
  */
2709
- function $n(t, n) {
2721
+ function Fn(t, n) {
2710
2722
  return t.S ? n.toBase64() : n.toUint8Array();
2711
2723
  }
2712
2724
 
2713
- function Fn(t, n) {
2714
- return Nn(t, n.toTimestamp());
2725
+ function Sn(t, n) {
2726
+ return $n(t, n.toTimestamp());
2715
2727
  }
2716
2728
 
2717
- function Sn(t) {
2718
- return g(!!t), gt.fromTimestamp(function(t) {
2719
- const n = At(t);
2720
- return new _t(n.seconds, n.nanos);
2729
+ function xn(t) {
2730
+ return b(!!t), bt.fromTimestamp(function(t) {
2731
+ const n = Pt(t);
2732
+ return new gt(n.seconds, n.nanos);
2721
2733
  }(t));
2722
2734
  }
2723
2735
 
2724
2736
  function qn(t, n) {
2725
2737
  return function(t) {
2726
- return new J([ "projects", t.projectId, "databases", t.database ]);
2738
+ return new X([ "projects", t.projectId, "databases", t.database ]);
2727
2739
  }(t).child("documents").child(n).canonicalString();
2728
2740
  }
2729
2741
 
2730
- function xn(t, n) {
2742
+ function On(t, n) {
2731
2743
  return qn(t.databaseId, n.path);
2732
2744
  }
2733
2745
 
2734
- function On(t, n) {
2746
+ function Cn(t, n) {
2735
2747
  const e = function(t) {
2736
- const n = J.fromString(t);
2737
- return g(Yn(n)), n;
2748
+ const n = X.fromString(t);
2749
+ return b(Hn(n)), n;
2738
2750
  }(n);
2739
- if (e.get(1) !== t.databaseId.projectId) throw new L(I, "Tried to deserialize key from different project: " + e.get(1) + " vs " + t.databaseId.projectId);
2740
- if (e.get(3) !== t.databaseId.database) throw new L(I, "Tried to deserialize key from different database: " + e.get(3) + " vs " + t.databaseId.database);
2741
- return new tt((g((r = e).length > 4 && "documents" === r.get(4)), r.popFirst(5)));
2751
+ if (e.get(1) !== t.databaseId.projectId) throw new U(A, "Tried to deserialize key from different project: " + e.get(1) + " vs " + t.databaseId.projectId);
2752
+ if (e.get(3) !== t.databaseId.database) throw new U(A, "Tried to deserialize key from different database: " + e.get(3) + " vs " + t.databaseId.database);
2753
+ return new nt((b((r = e).length > 4 && "documents" === r.get(4)), r.popFirst(5)));
2742
2754
  var r;
2743
2755
  /** Creates a Document proto from key and fields (but no create/update time) */}
2744
2756
 
2745
- function Cn(t, n) {
2757
+ function Ln(t, n) {
2746
2758
  return qn(t.databaseId, n);
2747
2759
  }
2748
2760
 
2749
- function Ln(t) {
2750
- return new J([ "projects", t.databaseId.projectId, "databases", t.databaseId.database ]).canonicalString();
2761
+ function Un(t) {
2762
+ return new X([ "projects", t.databaseId.projectId, "databases", t.databaseId.database ]).canonicalString();
2751
2763
  }
2752
2764
 
2753
- function Un(t, n, e) {
2765
+ function kn(t, n, e) {
2754
2766
  return {
2755
- name: xn(t, n),
2767
+ name: On(t, n),
2756
2768
  fields: e.value.mapValue.fields
2757
2769
  };
2758
2770
  }
2759
2771
 
2760
- function kn(t, n) {
2772
+ function jn(t, n) {
2761
2773
  return "found" in n ? function(t, n) {
2762
- g(!!n.found), n.found.name, n.found.updateTime;
2763
- const e = On(t, n.found.name), r = Sn(n.found.updateTime), s = new Mt({
2774
+ b(!!n.found), n.found.name, n.found.updateTime;
2775
+ const e = Cn(t, n.found.name), r = xn(n.found.updateTime), s = new Bt({
2764
2776
  mapValue: {
2765
2777
  fields: n.found.fields
2766
2778
  }
2767
2779
  });
2768
- return Bt.newFoundDocument(e, r, s);
2780
+ return zt.newFoundDocument(e, r, s);
2769
2781
  }(t, n) : "missing" in n ? function(t, n) {
2770
- g(!!n.missing), g(!!n.readTime);
2771
- const e = On(t, n.missing), r = Sn(n.readTime);
2772
- return Bt.newNoDocument(e, r);
2773
- }(t, n) : _();
2782
+ b(!!n.missing), b(!!n.readTime);
2783
+ const e = Cn(t, n.missing), r = xn(n.readTime);
2784
+ return zt.newNoDocument(e, r);
2785
+ }(t, n) : g();
2774
2786
  }
2775
2787
 
2776
- function jn(t, n) {
2788
+ function Mn(t, n) {
2777
2789
  let e;
2778
- if (n instanceof Tn) e = {
2779
- update: Un(t, n.key, n.value)
2790
+ if (n instanceof In) e = {
2791
+ update: kn(t, n.key, n.value)
2792
+ }; else if (n instanceof Pn) e = {
2793
+ delete: On(t, n.key)
2780
2794
  }; else if (n instanceof An) e = {
2781
- delete: xn(t, n.key)
2782
- }; else if (n instanceof In) e = {
2783
- update: Un(t, n.key, n.data),
2784
- updateMask: Wn(n.fieldMask)
2795
+ update: kn(t, n.key, n.data),
2796
+ updateMask: Yn(n.fieldMask)
2785
2797
  }; else {
2786
- if (!(n instanceof Pn)) return _();
2798
+ if (!(n instanceof Rn)) return g();
2787
2799
  e = {
2788
- verify: xn(t, n.key)
2800
+ verify: On(t, n.key)
2789
2801
  };
2790
2802
  }
2791
2803
  return n.fieldTransforms.length > 0 && (e.updateTransforms = n.fieldTransforms.map((t => function(t, n) {
2792
2804
  const e = n.transform;
2793
- if (e instanceof pn) return {
2805
+ if (e instanceof yn) return {
2794
2806
  fieldPath: n.field.canonicalString(),
2795
2807
  setToServerValue: "REQUEST_TIME"
2796
2808
  };
2797
- if (e instanceof yn) return {
2809
+ if (e instanceof _n) return {
2798
2810
  fieldPath: n.field.canonicalString(),
2799
2811
  appendMissingElements: {
2800
2812
  values: e.elements
2801
2813
  }
2802
2814
  };
2803
- if (e instanceof _n) return {
2815
+ if (e instanceof gn) return {
2804
2816
  fieldPath: n.field.canonicalString(),
2805
2817
  removeAllFromArray: {
2806
2818
  values: e.elements
2807
2819
  }
2808
2820
  };
2809
- if (e instanceof gn) return {
2821
+ if (e instanceof bn) return {
2810
2822
  fieldPath: n.field.canonicalString(),
2811
2823
  increment: e.O
2812
2824
  };
2813
- throw _();
2825
+ throw g();
2814
2826
  }(0, t)))), n.precondition.isNone || (e.currentDocument = function(t, n) {
2815
2827
  return void 0 !== n.updateTime ? {
2816
- updateTime: Fn(t, n.updateTime)
2828
+ updateTime: Sn(t, n.updateTime)
2817
2829
  } : void 0 !== n.exists ? {
2818
2830
  exists: n.exists
2819
- } : _();
2831
+ } : g();
2820
2832
  }(t, n.precondition)), e;
2821
2833
  }
2822
2834
 
2823
- function Mn(t, n) {
2835
+ function Bn(t, n) {
2824
2836
  // Dissect the path into parent, collectionId, and optional key filter.
2825
2837
  const e = {
2826
2838
  structuredQuery: {}
2827
2839
  }, r = n.path;
2828
- null !== n.collectionGroup ? (e.parent = Cn(t, r), e.structuredQuery.from = [ {
2840
+ null !== n.collectionGroup ? (e.parent = Ln(t, r), e.structuredQuery.from = [ {
2829
2841
  collectionId: n.collectionGroup,
2830
2842
  allDescendants: !0
2831
- } ]) : (e.parent = Cn(t, r.popLast()), e.structuredQuery.from = [ {
2843
+ } ]) : (e.parent = Ln(t, r.popLast()), e.structuredQuery.from = [ {
2832
2844
  collectionId: r.lastSegment()
2833
2845
  } ]);
2834
2846
  const s = function(t) {
@@ -2837,36 +2849,36 @@ function Mn(t, n) {
2837
2849
  // visible for testing
2838
2850
  function(t) {
2839
2851
  if ("==" /* EQUAL */ === t.op) {
2840
- if (Ut(t.value)) return {
2852
+ if (kt(t.value)) return {
2841
2853
  unaryFilter: {
2842
- field: Qn(t.field),
2854
+ field: Wn(t.field),
2843
2855
  op: "IS_NAN"
2844
2856
  }
2845
2857
  };
2846
- if (Lt(t.value)) return {
2858
+ if (Ut(t.value)) return {
2847
2859
  unaryFilter: {
2848
- field: Qn(t.field),
2860
+ field: Wn(t.field),
2849
2861
  op: "IS_NULL"
2850
2862
  }
2851
2863
  };
2852
2864
  } else if ("!=" /* NOT_EQUAL */ === t.op) {
2853
- if (Ut(t.value)) return {
2865
+ if (kt(t.value)) return {
2854
2866
  unaryFilter: {
2855
- field: Qn(t.field),
2867
+ field: Wn(t.field),
2856
2868
  op: "IS_NOT_NAN"
2857
2869
  }
2858
2870
  };
2859
- if (Lt(t.value)) return {
2871
+ if (Ut(t.value)) return {
2860
2872
  unaryFilter: {
2861
- field: Qn(t.field),
2873
+ field: Wn(t.field),
2862
2874
  op: "IS_NOT_NULL"
2863
2875
  }
2864
2876
  };
2865
2877
  }
2866
2878
  return {
2867
2879
  fieldFilter: {
2868
- field: Qn(t.field),
2869
- op: Gn(t.op),
2880
+ field: Wn(t.field),
2881
+ op: Qn(t.op),
2870
2882
  value: t.value
2871
2883
  }
2872
2884
  };
@@ -2886,52 +2898,52 @@ function Mn(t, n) {
2886
2898
  // visible for testing
2887
2899
  function(t) {
2888
2900
  return {
2889
- field: Qn(t.field),
2890
- direction: zn(t.dir)
2901
+ field: Wn(t.field),
2902
+ direction: Gn(t.dir)
2891
2903
  };
2892
2904
  }(t)));
2893
2905
  }(n.orderBy);
2894
2906
  i && (e.structuredQuery.orderBy = i);
2895
2907
  const o = function(t, n) {
2896
- return t.S || ut(n) ? n : {
2908
+ return t.S || ct(n) ? n : {
2897
2909
  value: n
2898
2910
  };
2899
2911
  }(t, n.limit);
2900
- return null !== o && (e.structuredQuery.limit = o), n.startAt && (e.structuredQuery.startAt = Bn(n.startAt)),
2901
- n.endAt && (e.structuredQuery.endAt = Bn(n.endAt)), e;
2912
+ return null !== o && (e.structuredQuery.limit = o), n.startAt && (e.structuredQuery.startAt = zn(n.startAt)),
2913
+ n.endAt && (e.structuredQuery.endAt = zn(n.endAt)), e;
2902
2914
  }
2903
2915
 
2904
- function Bn(t) {
2916
+ function zn(t) {
2905
2917
  return {
2906
2918
  before: t.before,
2907
2919
  values: t.position
2908
2920
  };
2909
2921
  }
2910
2922
 
2911
- // visible for testing
2912
- function zn(t) {
2913
- return Rn[t];
2914
- }
2915
-
2916
2923
  // visible for testing
2917
2924
  function Gn(t) {
2918
2925
  return Vn[t];
2919
2926
  }
2920
2927
 
2928
+ // visible for testing
2921
2929
  function Qn(t) {
2930
+ return Dn[t];
2931
+ }
2932
+
2933
+ function Wn(t) {
2922
2934
  return {
2923
2935
  fieldPath: t.canonicalString()
2924
2936
  };
2925
2937
  }
2926
2938
 
2927
- function Wn(t) {
2939
+ function Yn(t) {
2928
2940
  const n = [];
2929
2941
  return t.fields.forEach((t => n.push(t.canonicalString()))), {
2930
2942
  fieldPaths: n
2931
2943
  };
2932
2944
  }
2933
2945
 
2934
- function Yn(t) {
2946
+ function Hn(t) {
2935
2947
  // Resource names have at least 4 components (project ID, database ID)
2936
2948
  return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
2937
2949
  }
@@ -2951,8 +2963,8 @@ function Yn(t) {
2951
2963
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2952
2964
  * See the License for the specific language governing permissions and
2953
2965
  * limitations under the License.
2954
- */ function Hn(t) {
2955
- return new Dn(t, /* useProto3Json= */ !0);
2966
+ */ function Kn(t) {
2967
+ return new Nn(t, /* useProto3Json= */ !0);
2956
2968
  }
2957
2969
 
2958
2970
  /**
@@ -2980,7 +2992,7 @@ function Yn(t) {
2980
2992
  * base delay. This prevents clients from accidentally synchronizing their
2981
2993
  * delays causing spikes of load to the backend.
2982
2994
  */
2983
- class Kn {
2995
+ class Jn {
2984
2996
  constructor(
2985
2997
  /**
2986
2998
  * The AsyncQueue to run backoff operations on.
@@ -3035,7 +3047,7 @@ class Kn {
3035
3047
  // honored as such).
3036
3048
  const n = Math.floor(this.j + this.Y()), e = Math.max(0, Date.now() - this.B), r = Math.max(0, n - e);
3037
3049
  // Guard against lastAttemptTime being in the future due to a clock change.
3038
- r > 0 && w("ExponentialBackoff", `Backing off for ${r} ms (base delay: ${this.j} ms, delay with jitter: ${n} ms, last attempt: ${e} ms ago)`),
3050
+ r > 0 && m("ExponentialBackoff", `Backing off for ${r} ms (base delay: ${this.j} ms, delay with jitter: ${n} ms, last attempt: ${e} ms ago)`),
3039
3051
  this.M = this.C.enqueueAfterDelay(this.timerId, r, (() => (this.B = Date.now(),
3040
3052
  t()))),
3041
3053
  // Apply backoff factor to determine next delay and ensure it is within
@@ -3078,24 +3090,24 @@ class Kn {
3078
3090
  * An implementation of Datastore that exposes additional state for internal
3079
3091
  * consumption.
3080
3092
  */
3081
- class Jn extends class {} {
3093
+ class Xn extends class {} {
3082
3094
  constructor(t, n, e, r) {
3083
3095
  super(), this.authCredentials = t, this.appCheckCredentials = n, this.K = e, this.q = r,
3084
3096
  this.J = !1;
3085
3097
  }
3086
3098
  X() {
3087
- if (this.J) throw new L($, "The client has already been terminated.");
3099
+ if (this.J) throw new U(F, "The client has already been terminated.");
3088
3100
  }
3089
3101
  /** Invokes the provided RPC with auth and AppCheck tokens. */ m(t, n, e) {
3090
3102
  return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([r, s]) => this.K.m(t, n, e, r, s))).catch((t => {
3091
- throw "FirebaseError" === t.name ? (t.code === D && (this.authCredentials.invalidateToken(),
3092
- this.appCheckCredentials.invalidateToken()), t) : new L(T, t.toString());
3103
+ throw "FirebaseError" === t.name ? (t.code === N && (this.authCredentials.invalidateToken(),
3104
+ this.appCheckCredentials.invalidateToken()), t) : new U(I, t.toString());
3093
3105
  }));
3094
3106
  }
3095
3107
  /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ T(t, n, e) {
3096
3108
  return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([r, s]) => this.K.T(t, n, e, r, s))).catch((t => {
3097
- throw "FirebaseError" === t.name ? (t.code === D && (this.authCredentials.invalidateToken(),
3098
- this.appCheckCredentials.invalidateToken()), t) : new L(T, t.toString());
3109
+ throw "FirebaseError" === t.name ? (t.code === N && (this.authCredentials.invalidateToken(),
3110
+ this.appCheckCredentials.invalidateToken()), t) : new U(I, t.toString());
3099
3111
  }));
3100
3112
  }
3101
3113
  terminate() {
@@ -3105,38 +3117,38 @@ class Jn extends class {} {
3105
3117
 
3106
3118
  // TODO(firestorexp): Make sure there is only one Datastore instance per
3107
3119
  // firestore-exp client.
3108
- async function Xn(t, n) {
3109
- const e = b(t), r = Ln(e.q) + "/documents", s = {
3110
- writes: n.map((t => jn(e.q, t)))
3120
+ async function Zn(t, n) {
3121
+ const e = v(t), r = Un(e.q) + "/documents", s = {
3122
+ writes: n.map((t => Mn(e.q, t)))
3111
3123
  };
3112
3124
  await e.m("Commit", r, s);
3113
3125
  }
3114
3126
 
3115
- async function Zn(t, n) {
3116
- const e = b(t), r = Ln(e.q) + "/documents", s = {
3117
- documents: n.map((t => xn(e.q, t)))
3127
+ async function te(t, n) {
3128
+ const e = v(t), r = Un(e.q) + "/documents", s = {
3129
+ documents: n.map((t => On(e.q, t)))
3118
3130
  }, i = await e.T("BatchGetDocuments", r, s), o = new Map;
3119
3131
  i.forEach((t => {
3120
- const n = kn(e.q, t);
3132
+ const n = jn(e.q, t);
3121
3133
  o.set(n.key.toString(), n);
3122
3134
  }));
3123
3135
  const u = [];
3124
3136
  return n.forEach((t => {
3125
3137
  const n = o.get(t.toString());
3126
- g(!!n), u.push(n);
3138
+ b(!!n), u.push(n);
3127
3139
  })), u;
3128
3140
  }
3129
3141
 
3130
- async function te(t, n) {
3131
- const e = b(t), r = Mn(e.q, fn(n));
3142
+ async function ne(t, n) {
3143
+ const e = v(t), r = Bn(e.q, dn(n));
3132
3144
  return (await e.T("RunQuery", r.parent, {
3133
3145
  structuredQuery: r.structuredQuery
3134
3146
  })).filter((t => !!t.document)).map((t => function(t, n, e) {
3135
- const r = On(t, n.name), s = Sn(n.updateTime), i = new Mt({
3147
+ const r = Cn(t, n.name), s = xn(n.updateTime), i = new Bt({
3136
3148
  mapValue: {
3137
3149
  fields: n.fields
3138
3150
  }
3139
- }), o = Bt.newFoundDocument(r, s, i);
3151
+ }), o = zt.newFoundDocument(r, s, i);
3140
3152
  return e && o.setHasCommittedMutations(), e ? o.setHasCommittedMutations() : o;
3141
3153
  }(e.q, t.document, void 0)));
3142
3154
  }
@@ -3156,7 +3168,7 @@ async function te(t, n) {
3156
3168
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3157
3169
  * See the License for the specific language governing permissions and
3158
3170
  * limitations under the License.
3159
- */ const ne = new Map;
3171
+ */ const ee = new Map;
3160
3172
 
3161
3173
  /**
3162
3174
  * An instance map that ensures only one Datastore exists per Firestore
@@ -3167,17 +3179,17 @@ async function te(t, n) {
3167
3179
  * instance. Callers must invoke removeComponents() when the Firestore
3168
3180
  * instance is terminated.
3169
3181
  */
3170
- function ee(t) {
3171
- if (t._terminated) throw new L($, "The client has already been terminated.");
3172
- if (!ne.has(t)) {
3173
- w("ComponentProvider", "Initializing Datastore");
3182
+ function re(t) {
3183
+ if (t._terminated) throw new U(F, "The client has already been terminated.");
3184
+ if (!ee.has(t)) {
3185
+ m("ComponentProvider", "Initializing Datastore");
3174
3186
  const i = function(t) {
3175
- return new dt(t, fetch.bind(null));
3187
+ return new wt(t, fetch.bind(null));
3176
3188
  }((n = t._databaseId, e = t.app.options.appId || "", r = t._persistenceKey, s = t._freezeSettings(),
3177
- new Y(n, e, r, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), o = Hn(t._databaseId), u = function(t, n, e, r) {
3178
- return new Jn(t, n, e, r);
3189
+ new H(n, e, r, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), o = Kn(t._databaseId), u = function(t, n, e, r) {
3190
+ return new Xn(t, n, e, r);
3179
3191
  }(t._authCredentials, t._appCheckCredentials, i, o);
3180
- ne.set(t, u);
3192
+ ee.set(t, u);
3181
3193
  }
3182
3194
  var n, e, r, s;
3183
3195
  /**
@@ -3195,7 +3207,7 @@ function ee(t) {
3195
3207
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3196
3208
  * See the License for the specific language governing permissions and
3197
3209
  * limitations under the License.
3198
- */ return ne.get(t);
3210
+ */ return ee.get(t);
3199
3211
  }
3200
3212
 
3201
3213
  /**
@@ -3207,21 +3219,21 @@ function ee(t) {
3207
3219
  * user-supplied `FirestoreSettings` object. This is a separate type so that
3208
3220
  * defaults can be supplied and the value can be checked for equality.
3209
3221
  */
3210
- class re {
3222
+ class se {
3211
3223
  constructor(t) {
3212
3224
  var n;
3213
3225
  if (void 0 === t.host) {
3214
- if (void 0 !== t.ssl) throw new L(I, "Can't provide ssl option if host option is not set");
3226
+ if (void 0 !== t.ssl) throw new U(A, "Can't provide ssl option if host option is not set");
3215
3227
  this.host = "firestore.googleapis.com", this.ssl = true;
3216
3228
  } else this.host = t.host, this.ssl = null === (n = t.ssl) || void 0 === n || n;
3217
3229
  if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties,
3218
3230
  void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
3219
- if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new L(I, "cacheSizeBytes must be at least 1048576");
3231
+ if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new U(A, "cacheSizeBytes must be at least 1048576");
3220
3232
  this.cacheSizeBytes = t.cacheSizeBytes;
3221
3233
  }
3222
3234
  this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling,
3223
3235
  this.useFetchStreams = !!t.useFetchStreams, function(t, n, e, r) {
3224
- if (!0 === n && !0 === r) throw new L(I, `${t} and ${e} cannot be used together.`);
3236
+ if (!0 === n && !0 === r) throw new U(A, `${t} and ${e} cannot be used together.`);
3225
3237
  }("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling);
3226
3238
  }
3227
3239
  isEqual(t) {
@@ -3249,18 +3261,18 @@ class re {
3249
3261
  * The Cloud Firestore service interface.
3250
3262
  *
3251
3263
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
3252
- */ class se {
3264
+ */ class ie {
3253
3265
  /** @hideconstructor */
3254
3266
  constructor(t, n, e) {
3255
3267
  this._authCredentials = n, this._appCheckCredentials = e,
3256
3268
  /**
3257
3269
  * Whether it's a Firestore or Firestore Lite instance.
3258
3270
  */
3259
- this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new re({}),
3260
- this._settingsFrozen = !1, t instanceof H ? this._databaseId = t : (this._app = t,
3271
+ this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new se({}),
3272
+ this._settingsFrozen = !1, t instanceof K ? this._databaseId = t : (this._app = t,
3261
3273
  this._databaseId = function(t) {
3262
- if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new L(I, '"projectId" not provided in firebase.initializeApp.');
3263
- return new H(t.options.projectId);
3274
+ if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new U(A, '"projectId" not provided in firebase.initializeApp.');
3275
+ return new K(t.options.projectId);
3264
3276
  }
3265
3277
  /**
3266
3278
  * Initializes a new instance of Cloud Firestore with the provided settings.
@@ -3278,7 +3290,7 @@ class re {
3278
3290
  * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
3279
3291
  * instance.
3280
3292
  */ get app() {
3281
- if (!this._app) throw new L($, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
3293
+ if (!this._app) throw new U(F, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
3282
3294
  return this._app;
3283
3295
  }
3284
3296
  get _initialized() {
@@ -3288,21 +3300,21 @@ class re {
3288
3300
  return void 0 !== this._terminateTask;
3289
3301
  }
3290
3302
  _setSettings(t) {
3291
- if (this._settingsFrozen) throw new L($, "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.");
3292
- this._settings = new re(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
3293
- if (!t) return new j;
3303
+ if (this._settingsFrozen) throw new U(F, "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.");
3304
+ this._settings = new se(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
3305
+ if (!t) return new M;
3294
3306
  switch (t.type) {
3295
3307
  case "gapi":
3296
3308
  const n = t.client;
3297
3309
  // Make sure this really is a Gapi client.
3298
- return g(!("object" != typeof n || null === n || !n.auth || !n.auth.getAuthHeaderValueForFirstParty)),
3299
- new G(n, t.sessionIndex || "0", t.iamToken || null);
3310
+ return b(!("object" != typeof n || null === n || !n.auth || !n.auth.getAuthHeaderValueForFirstParty)),
3311
+ new Q(n, t.sessionIndex || "0", t.iamToken || null);
3300
3312
 
3301
3313
  case "provider":
3302
3314
  return t.client;
3303
3315
 
3304
3316
  default:
3305
- throw new L(I, "makeAuthCredentialsProvider failed due to invalid credential type");
3317
+ throw new U(A, "makeAuthCredentialsProvider failed due to invalid credential type");
3306
3318
  }
3307
3319
  }(t.credentials));
3308
3320
  }
@@ -3330,15 +3342,15 @@ class re {
3330
3342
  * Only ever called once.
3331
3343
  */ _terminate() {
3332
3344
  return function(t) {
3333
- const n = ne.get(t);
3334
- n && (w("ComponentProvider", "Removing Datastore"), ne.delete(t), n.terminate());
3345
+ const n = ee.get(t);
3346
+ n && (m("ComponentProvider", "Removing Datastore"), ee.delete(t), n.terminate());
3335
3347
  }(this), Promise.resolve();
3336
3348
  }
3337
3349
  }
3338
3350
 
3339
- function ie(t, n) {
3351
+ function oe(t, n) {
3340
3352
  const e = _getProvider(t, "firestore/lite");
3341
- if (e.isInitialized()) throw new L($, "Firestore can only be initialized once per app.");
3353
+ if (e.isInitialized()) throw new U(F, "Firestore can only be initialized once per app.");
3342
3354
  return e.initialize({
3343
3355
  options: n
3344
3356
  });
@@ -3352,7 +3364,7 @@ function ie(t, n) {
3352
3364
  * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned `Firestore`
3353
3365
  * instance is associated with.
3354
3366
  * @returns The `Firestore` instance of the provided app.
3355
- */ function oe(n = getApp()) {
3367
+ */ function ue(n = getApp()) {
3356
3368
  return _getProvider(n, "firestore/lite").getImmediate();
3357
3369
  }
3358
3370
 
@@ -3368,24 +3380,24 @@ function ie(t, n) {
3368
3380
  * @param port - the emulator port (ex: 9000).
3369
3381
  * @param options.mockUserToken - the mock auth token to use for unit testing
3370
3382
  * Security Rules.
3371
- */ function ue(t, n, e, r = {}) {
3383
+ */ function ce(t, n, e, r = {}) {
3372
3384
  var s;
3373
- const i = (t = it(t, se))._getSettings();
3374
- if ("firestore.googleapis.com" !== i.host && i.host !== n && p("Host has been set in both settings() and useEmulator(), emulator host will be used"),
3385
+ const i = (t = ot(t, ie))._getSettings();
3386
+ if ("firestore.googleapis.com" !== i.host && i.host !== n && y("Host has been set in both settings() and useEmulator(), emulator host will be used"),
3375
3387
  t._setSettings(Object.assign(Object.assign({}, i), {
3376
3388
  host: `${n}:${e}`,
3377
3389
  ssl: !1
3378
3390
  })), r.mockUserToken) {
3379
3391
  let n, e;
3380
- if ("string" == typeof r.mockUserToken) n = r.mockUserToken, e = h.MOCK_USER; else {
3392
+ if ("string" == typeof r.mockUserToken) n = r.mockUserToken, e = l.MOCK_USER; else {
3381
3393
  // Let createMockUserToken validate first (catches common mistakes like
3382
3394
  // invalid field "uid" and missing field "sub" / "user_id".)
3383
3395
  n = createMockUserToken(r.mockUserToken, null === (s = t._app) || void 0 === s ? void 0 : s.options.projectId);
3384
3396
  const i = r.mockUserToken.sub || r.mockUserToken.user_id;
3385
- if (!i) throw new L(I, "mockUserToken must contain 'sub' or 'user_id' field!");
3386
- e = new h(i);
3397
+ if (!i) throw new U(A, "mockUserToken must contain 'sub' or 'user_id' field!");
3398
+ e = new l(i);
3387
3399
  }
3388
- t._authCredentials = new M(new k(n, e));
3400
+ t._authCredentials = new B(new j(n, e));
3389
3401
  }
3390
3402
  }
3391
3403
 
@@ -3408,8 +3420,8 @@ function ie(t, n) {
3408
3420
  * @param firestore - The `Firestore` instance to terminate.
3409
3421
  * @returns A `Promise` that is resolved when the instance has been successfully
3410
3422
  * terminated.
3411
- */ function ce(t) {
3412
- return t = it(t, se), _removeServiceInstance(t.app, "firestore/lite"), t._delete();
3423
+ */ function ae(t) {
3424
+ return t = ot(t, ie), _removeServiceInstance(t.app, "firestore/lite"), t._delete();
3413
3425
  }
3414
3426
 
3415
3427
  /**
@@ -3449,7 +3461,7 @@ function ie(t, n) {
3449
3461
  * and can be used to write, read, or listen to the location. The document at
3450
3462
  * the referenced location may or may not exist.
3451
3463
  */
3452
- class ae {
3464
+ class he {
3453
3465
  /** @hideconstructor */
3454
3466
  constructor(t,
3455
3467
  /**
@@ -3477,17 +3489,17 @@ class ae {
3477
3489
  /**
3478
3490
  * The collection this `DocumentReference` belongs to.
3479
3491
  */ get parent() {
3480
- return new le(this.firestore, this.converter, this._key.path.popLast());
3492
+ return new fe(this.firestore, this.converter, this._key.path.popLast());
3481
3493
  }
3482
3494
  withConverter(t) {
3483
- return new ae(this.firestore, t, this._key);
3495
+ return new he(this.firestore, t, this._key);
3484
3496
  }
3485
3497
  }
3486
3498
 
3487
3499
  /**
3488
3500
  * A `Query` refers to a query which you can read or listen to. You can also
3489
3501
  * construct refined `Query` objects by adding filters and ordering.
3490
- */ class he {
3502
+ */ class le {
3491
3503
  // This is the lite version of the Query class in the main SDK.
3492
3504
  /** @hideconstructor protected */
3493
3505
  constructor(t,
@@ -3500,17 +3512,17 @@ class ae {
3500
3512
  this.type = "query", this.firestore = t;
3501
3513
  }
3502
3514
  withConverter(t) {
3503
- return new he(this.firestore, t, this._query);
3515
+ return new le(this.firestore, t, this._query);
3504
3516
  }
3505
3517
  }
3506
3518
 
3507
3519
  /**
3508
3520
  * A `CollectionReference` object can be used for adding documents, getting
3509
3521
  * document references, and querying for documents (using {@link query}).
3510
- */ class le extends he {
3522
+ */ class fe extends le {
3511
3523
  /** @hideconstructor */
3512
3524
  constructor(t, n, e) {
3513
- super(t, n, new on(e)), this._path = e,
3525
+ super(t, n, new un(e)), this._path = e,
3514
3526
  /** The type of this Firestore reference. */
3515
3527
  this.type = "collection";
3516
3528
  }
@@ -3528,23 +3540,23 @@ class ae {
3528
3540
  * subcollection. If this isn't a subcollection, the reference is null.
3529
3541
  */ get parent() {
3530
3542
  const t = this._path.popLast();
3531
- return t.isEmpty() ? null : new ae(this.firestore,
3532
- /* converter= */ null, new tt(t));
3543
+ return t.isEmpty() ? null : new he(this.firestore,
3544
+ /* converter= */ null, new nt(t));
3533
3545
  }
3534
3546
  withConverter(t) {
3535
- return new le(this.firestore, t, this._path);
3547
+ return new fe(this.firestore, t, this._path);
3536
3548
  }
3537
3549
  }
3538
3550
 
3539
- function fe(t, n, ...e) {
3540
- if (t = getModularInstance(t), nt("collection", "path", n), t instanceof se) {
3541
- const r = J.fromString(n, ...e);
3542
- return rt(r), new le(t, /* converter= */ null, r);
3551
+ function de(t, n, ...e) {
3552
+ if (t = getModularInstance(t), et("collection", "path", n), t instanceof ie) {
3553
+ const r = X.fromString(n, ...e);
3554
+ return st(r), new fe(t, /* converter= */ null, r);
3543
3555
  }
3544
3556
  {
3545
- if (!(t instanceof ae || t instanceof le)) throw new L(I, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3546
- const r = t._path.child(J.fromString(n, ...e));
3547
- return rt(r), new le(t.firestore,
3557
+ if (!(t instanceof he || t instanceof fe)) throw new U(A, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3558
+ const r = t._path.child(X.fromString(n, ...e));
3559
+ return st(r), new fe(t.firestore,
3548
3560
  /* converter= */ null, r);
3549
3561
  }
3550
3562
  }
@@ -3561,32 +3573,32 @@ function fe(t, n, ...e) {
3561
3573
  * collection or subcollection with this ID as the last segment of its path
3562
3574
  * will be included. Cannot contain a slash.
3563
3575
  * @returns The created `Query`.
3564
- */ function de(t, n) {
3565
- if (t = it(t, se), nt("collectionGroup", "collection id", n), n.indexOf("/") >= 0) throw new L(I, `Invalid collection ID '${n}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
3566
- return new he(t,
3576
+ */ function we(t, n) {
3577
+ if (t = ot(t, ie), et("collectionGroup", "collection id", n), n.indexOf("/") >= 0) throw new U(A, `Invalid collection ID '${n}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
3578
+ return new le(t,
3567
3579
  /* converter= */ null,
3568
3580
  /**
3569
3581
  * Creates a new Query for a collection group query that matches all documents
3570
3582
  * within the provided collection group.
3571
3583
  */
3572
3584
  function(t) {
3573
- return new on(J.emptyPath(), t);
3585
+ return new un(X.emptyPath(), t);
3574
3586
  }(n));
3575
3587
  }
3576
3588
 
3577
- function we(t, n, ...e) {
3589
+ function me(t, n, ...e) {
3578
3590
  if (t = getModularInstance(t),
3579
3591
  // We allow omission of 'pathString' but explicitly prohibit passing in both
3580
3592
  // 'undefined' and 'null'.
3581
- 1 === arguments.length && (n = mt.P()), nt("doc", "path", n), t instanceof se) {
3582
- const r = J.fromString(n, ...e);
3583
- return et(r), new ae(t,
3584
- /* converter= */ null, new tt(r));
3593
+ 1 === arguments.length && (n = pt.P()), et("doc", "path", n), t instanceof ie) {
3594
+ const r = X.fromString(n, ...e);
3595
+ return rt(r), new he(t,
3596
+ /* converter= */ null, new nt(r));
3585
3597
  }
3586
3598
  {
3587
- if (!(t instanceof ae || t instanceof le)) throw new L(I, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3588
- const r = t._path.child(J.fromString(n, ...e));
3589
- return et(r), new ae(t.firestore, t instanceof le ? t.converter : null, new tt(r));
3599
+ if (!(t instanceof he || t instanceof fe)) throw new U(A, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3600
+ const r = t._path.child(X.fromString(n, ...e));
3601
+ return rt(r), new he(t.firestore, t instanceof fe ? t.converter : null, new nt(r));
3590
3602
  }
3591
3603
  }
3592
3604
 
@@ -3597,8 +3609,8 @@ function we(t, n, ...e) {
3597
3609
  * @param right - A reference to compare.
3598
3610
  * @returns true if the references point to the same location in the same
3599
3611
  * Firestore database.
3600
- */ function me(t, n) {
3601
- return t = getModularInstance(t), n = getModularInstance(n), (t instanceof ae || t instanceof le) && (n instanceof ae || n instanceof le) && (t.firestore === n.firestore && t.path === n.path && t.converter === n.converter);
3612
+ */ function pe(t, n) {
3613
+ return t = getModularInstance(t), n = getModularInstance(n), (t instanceof he || t instanceof fe) && (n instanceof he || n instanceof fe) && (t.firestore === n.firestore && t.path === n.path && t.converter === n.converter);
3602
3614
  }
3603
3615
 
3604
3616
  /**
@@ -3609,8 +3621,8 @@ function we(t, n, ...e) {
3609
3621
  * @param right - A `Query` to compare.
3610
3622
  * @returns true if the references point to the same location in the same
3611
3623
  * Firestore database.
3612
- */ function pe(t, n) {
3613
- return t = getModularInstance(t), n = getModularInstance(n), t instanceof he && n instanceof he && (t.firestore === n.firestore && dn(t._query, n._query) && t.converter === n.converter);
3624
+ */ function ye(t, n) {
3625
+ return t = getModularInstance(t), n = getModularInstance(n), t instanceof le && n instanceof le && (t.firestore === n.firestore && wn(t._query, n._query) && t.converter === n.converter);
3614
3626
  }
3615
3627
 
3616
3628
  /**
@@ -3636,7 +3648,7 @@ function we(t, n, ...e) {
3636
3648
  *
3637
3649
  * Create a `FieldPath` by providing field names. If more than one field
3638
3650
  * name is provided, the path will point to a nested field in a document.
3639
- */ class ye {
3651
+ */ class _e {
3640
3652
  /**
3641
3653
  * Creates a `FieldPath` from the provided field names. If more than one field
3642
3654
  * name is provided, the path will point to a nested field in a document.
@@ -3644,8 +3656,8 @@ function we(t, n, ...e) {
3644
3656
  * @param fieldNames - A list of field names.
3645
3657
  */
3646
3658
  constructor(...t) {
3647
- for (let n = 0; n < t.length; ++n) if (0 === t[n].length) throw new L(I, "Invalid field name at argument $(i + 1). Field names must not be empty.");
3648
- this._internalPath = new Z(t);
3659
+ for (let n = 0; n < t.length; ++n) if (0 === t[n].length) throw new U(A, "Invalid field name at argument $(i + 1). Field names must not be empty.");
3660
+ this._internalPath = new tt(t);
3649
3661
  }
3650
3662
  /**
3651
3663
  * Returns true if this `FieldPath` is equal to the provided one.
@@ -3660,8 +3672,8 @@ function we(t, n, ...e) {
3660
3672
  /**
3661
3673
  * Returns a special sentinel `FieldPath` to refer to the ID of a document.
3662
3674
  * It can be used in queries to sort or filter by the document ID.
3663
- */ function _e() {
3664
- return new ye("__name__");
3675
+ */ function ge() {
3676
+ return new _e("__name__");
3665
3677
  }
3666
3678
 
3667
3679
  /**
@@ -3682,7 +3694,7 @@ function we(t, n, ...e) {
3682
3694
  */
3683
3695
  /**
3684
3696
  * An immutable object representing an array of bytes.
3685
- */ class ge {
3697
+ */ class be {
3686
3698
  /** @hideconstructor */
3687
3699
  constructor(t) {
3688
3700
  this._byteString = t;
@@ -3694,9 +3706,9 @@ function we(t, n, ...e) {
3694
3706
  * @param base64 - The Base64 string used to create the `Bytes` object.
3695
3707
  */ static fromBase64String(t) {
3696
3708
  try {
3697
- return new ge(Tt.fromBase64String(t));
3709
+ return new be(It.fromBase64String(t));
3698
3710
  } catch (t) {
3699
- throw new L(I, "Failed to construct data from Base64 string: " + t);
3711
+ throw new U(A, "Failed to construct data from Base64 string: " + t);
3700
3712
  }
3701
3713
  }
3702
3714
  /**
@@ -3704,7 +3716,7 @@ function we(t, n, ...e) {
3704
3716
  *
3705
3717
  * @param array - The Uint8Array used to create the `Bytes` object.
3706
3718
  */ static fromUint8Array(t) {
3707
- return new ge(Tt.fromUint8Array(t));
3719
+ return new be(It.fromUint8Array(t));
3708
3720
  }
3709
3721
  /**
3710
3722
  * Returns the underlying bytes as a Base64-encoded string.
@@ -3756,7 +3768,7 @@ function we(t, n, ...e) {
3756
3768
  /**
3757
3769
  * Sentinel values that can be used when writing document fields with `set()`
3758
3770
  * or `update()`.
3759
- */ class be {
3771
+ */ class ve {
3760
3772
  /**
3761
3773
  * @param _methodName - The public API endpoint that returns this class.
3762
3774
  * @hideconstructor
@@ -3788,7 +3800,7 @@ function we(t, n, ...e) {
3788
3800
  *
3789
3801
  * Latitude values are in the range of [-90, 90].
3790
3802
  * Longitude values are in the range of [-180, 180].
3791
- */ class ve {
3803
+ */ class Ee {
3792
3804
  /**
3793
3805
  * Creates a new immutable `GeoPoint` object with the provided latitude and
3794
3806
  * longitude values.
@@ -3796,8 +3808,8 @@ function we(t, n, ...e) {
3796
3808
  * @param longitude - The longitude as number between -180 and 180.
3797
3809
  */
3798
3810
  constructor(t, n) {
3799
- if (!isFinite(t) || t < -90 || t > 90) throw new L(I, "Latitude must be a number between -90 and 90, but was: " + t);
3800
- if (!isFinite(n) || n < -180 || n > 180) throw new L(I, "Longitude must be a number between -180 and 180, but was: " + n);
3811
+ if (!isFinite(t) || t < -90 || t > 90) throw new U(A, "Latitude must be a number between -90 and 90, but was: " + t);
3812
+ if (!isFinite(n) || n < -180 || n > 180) throw new U(A, "Longitude must be a number between -180 and 180, but was: " + n);
3801
3813
  this._lat = t, this._long = n;
3802
3814
  }
3803
3815
  /**
@@ -3828,7 +3840,7 @@ function we(t, n, ...e) {
3828
3840
  * Actually private to JS consumers of our API, so this function is prefixed
3829
3841
  * with an underscore.
3830
3842
  */ _compareTo(t) {
3831
- return pt(this._lat, t._lat) || pt(this._long, t._long);
3843
+ return yt(this._lat, t._lat) || yt(this._long, t._long);
3832
3844
  }
3833
3845
  }
3834
3846
 
@@ -3847,29 +3859,29 @@ function we(t, n, ...e) {
3847
3859
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3848
3860
  * See the License for the specific language governing permissions and
3849
3861
  * limitations under the License.
3850
- */ const Ee = /^__.*__$/;
3862
+ */ const Te = /^__.*__$/;
3851
3863
 
3852
- /** The result of parsing document data (e.g. for a setData call). */ class Te {
3864
+ /** The result of parsing document data (e.g. for a setData call). */ class Ie {
3853
3865
  constructor(t, n, e) {
3854
3866
  this.data = t, this.fieldMask = n, this.fieldTransforms = e;
3855
3867
  }
3856
3868
  toMutation(t, n) {
3857
- return null !== this.fieldMask ? new In(t, this.data, this.fieldMask, n, this.fieldTransforms) : new Tn(t, this.data, n, this.fieldTransforms);
3869
+ return null !== this.fieldMask ? new An(t, this.data, this.fieldMask, n, this.fieldTransforms) : new In(t, this.data, n, this.fieldTransforms);
3858
3870
  }
3859
3871
  }
3860
3872
 
3861
- /** The result of parsing "update" data (i.e. for an updateData call). */ class Ie {
3873
+ /** The result of parsing "update" data (i.e. for an updateData call). */ class Ae {
3862
3874
  constructor(t,
3863
3875
  // The fieldMask does not include document transforms.
3864
3876
  n, e) {
3865
3877
  this.data = t, this.fieldMask = n, this.fieldTransforms = e;
3866
3878
  }
3867
3879
  toMutation(t, n) {
3868
- return new In(t, this.data, this.fieldMask, n, this.fieldTransforms);
3880
+ return new An(t, this.data, this.fieldMask, n, this.fieldTransforms);
3869
3881
  }
3870
3882
  }
3871
3883
 
3872
- function Ae(t) {
3884
+ function Pe(t) {
3873
3885
  switch (t) {
3874
3886
  case 0 /* Set */ :
3875
3887
  // fall through
@@ -3883,11 +3895,11 @@ function Ae(t) {
3883
3895
  return !1;
3884
3896
 
3885
3897
  default:
3886
- throw _();
3898
+ throw g();
3887
3899
  }
3888
3900
  }
3889
3901
 
3890
- /** A "context" object passed around while parsing user data. */ class Pe {
3902
+ /** A "context" object passed around while parsing user data. */ class Re {
3891
3903
  /**
3892
3904
  * Initializes a ParseContext with the given source and path.
3893
3905
  *
@@ -3919,7 +3931,7 @@ function Ae(t) {
3919
3931
  return this.settings.tt;
3920
3932
  }
3921
3933
  /** Returns a new context with the specified settings overwritten. */ nt(t) {
3922
- return new Pe(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.q, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
3934
+ return new Re(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.q, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
3923
3935
  }
3924
3936
  et(t) {
3925
3937
  var n;
@@ -3946,7 +3958,7 @@ function Ae(t) {
3946
3958
  });
3947
3959
  }
3948
3960
  ut(t) {
3949
- return Qe(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
3961
+ return We(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
3950
3962
  }
3951
3963
  /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ contains(t) {
3952
3964
  return void 0 !== this.fieldMask.find((n => t.isPrefixOf(n))) || void 0 !== this.fieldTransforms.find((n => t.isPrefixOf(n.field)));
@@ -3958,52 +3970,52 @@ function Ae(t) {
3958
3970
  }
3959
3971
  st(t) {
3960
3972
  if (0 === t.length) throw this.ut("Document fields must not be empty");
3961
- if (Ae(this.tt) && Ee.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
3973
+ if (Pe(this.tt) && Te.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
3962
3974
  }
3963
3975
  }
3964
3976
 
3965
3977
  /**
3966
3978
  * Helper for parsing raw user input (provided via the API) into internal model
3967
3979
  * classes.
3968
- */ class Re {
3980
+ */ class Ve {
3969
3981
  constructor(t, n, e) {
3970
- this.databaseId = t, this.ignoreUndefinedProperties = n, this.q = e || Hn(t);
3982
+ this.databaseId = t, this.ignoreUndefinedProperties = n, this.q = e || Kn(t);
3971
3983
  }
3972
3984
  /** Creates a new top-level parse context. */ ht(t, n, e, r = !1) {
3973
- return new Pe({
3985
+ return new Re({
3974
3986
  tt: t,
3975
3987
  methodName: n,
3976
3988
  at: e,
3977
- path: Z.emptyPath(),
3989
+ path: tt.emptyPath(),
3978
3990
  rt: !1,
3979
3991
  ct: r
3980
3992
  }, this.databaseId, this.q, this.ignoreUndefinedProperties);
3981
3993
  }
3982
3994
  }
3983
3995
 
3984
- function Ve(t) {
3985
- const n = t._freezeSettings(), e = Hn(t._databaseId);
3986
- return new Re(t._databaseId, !!n.ignoreUndefinedProperties, e);
3996
+ function De(t) {
3997
+ const n = t._freezeSettings(), e = Kn(t._databaseId);
3998
+ return new Ve(t._databaseId, !!n.ignoreUndefinedProperties, e);
3987
3999
  }
3988
4000
 
3989
- /** Parse document data from a set() call. */ function De(t, n, e, r, s, i = {}) {
4001
+ /** Parse document data from a set() call. */ function Ne(t, n, e, r, s, i = {}) {
3990
4002
  const o = t.ht(i.merge || i.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , n, e, s);
3991
- Me("Data must be an object, but it was:", o, r);
3992
- const u = ke(r, o);
4003
+ Be("Data must be an object, but it was:", o, r);
4004
+ const u = je(r, o);
3993
4005
  let c, a;
3994
- if (i.merge) c = new Et(o.fieldMask), a = o.fieldTransforms; else if (i.mergeFields) {
4006
+ if (i.merge) c = new Tt(o.fieldMask), a = o.fieldTransforms; else if (i.mergeFields) {
3995
4007
  const t = [];
3996
4008
  for (const r of i.mergeFields) {
3997
- const s = Be(n, r, e);
3998
- if (!o.contains(s)) throw new L(I, `Field '${s}' is specified in your field mask but missing from your input data.`);
3999
- We(t, s) || t.push(s);
4009
+ const s = ze(n, r, e);
4010
+ if (!o.contains(s)) throw new U(A, `Field '${s}' is specified in your field mask but missing from your input data.`);
4011
+ Ye(t, s) || t.push(s);
4000
4012
  }
4001
- c = new Et(t), a = o.fieldTransforms.filter((t => c.covers(t.field)));
4013
+ c = new Tt(t), a = o.fieldTransforms.filter((t => c.covers(t.field)));
4002
4014
  } else c = null, a = o.fieldTransforms;
4003
- return new Te(new Mt(u), c, a);
4015
+ return new Ie(new Bt(u), c, a);
4004
4016
  }
4005
4017
 
4006
- class Ne extends be {
4018
+ class $e extends ve {
4007
4019
  _toFieldTransform(t) {
4008
4020
  if (2 /* MergeSet */ !== t.tt) throw 1 /* Update */ === t.tt ? t.ut(`${this._methodName}() can only appear at the top level of your update data`) : t.ut(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);
4009
4021
  // No transform to add for a delete, but we need to add it to our
@@ -4011,7 +4023,7 @@ class Ne extends be {
4011
4023
  return t.fieldMask.push(t.path), null;
4012
4024
  }
4013
4025
  isEqual(t) {
4014
- return t instanceof Ne;
4026
+ return t instanceof $e;
4015
4027
  }
4016
4028
  }
4017
4029
 
@@ -4030,8 +4042,8 @@ class Ne extends be {
4030
4042
  * context.
4031
4043
  * @param context - The parent context.
4032
4044
  * @param arrayElement - Whether or not the FieldValue has an array.
4033
- */ function $e(t, n, e) {
4034
- return new Pe({
4045
+ */ function Fe(t, n, e) {
4046
+ return new Re({
4035
4047
  tt: 3 /* Argument */ ,
4036
4048
  at: n.settings.at,
4037
4049
  methodName: t._methodName,
@@ -4039,23 +4051,23 @@ class Ne extends be {
4039
4051
  }, n.databaseId, n.q, n.ignoreUndefinedProperties);
4040
4052
  }
4041
4053
 
4042
- class Fe extends be {
4054
+ class Se extends ve {
4043
4055
  _toFieldTransform(t) {
4044
- return new bn(t.path, new pn);
4056
+ return new vn(t.path, new yn);
4045
4057
  }
4046
4058
  isEqual(t) {
4047
- return t instanceof Fe;
4059
+ return t instanceof Se;
4048
4060
  }
4049
4061
  }
4050
4062
 
4051
- class Se extends be {
4063
+ class xe extends ve {
4052
4064
  constructor(t, n) {
4053
4065
  super(t), this.lt = n;
4054
4066
  }
4055
4067
  _toFieldTransform(t) {
4056
- const n = $e(this, t,
4057
- /*array=*/ !0), e = this.lt.map((t => Ue(t, n))), r = new yn(e);
4058
- return new bn(t.path, r);
4068
+ const n = Fe(this, t,
4069
+ /*array=*/ !0), e = this.lt.map((t => ke(t, n))), r = new _n(e);
4070
+ return new vn(t.path, r);
4059
4071
  }
4060
4072
  isEqual(t) {
4061
4073
  // TODO(mrschmidt): Implement isEquals
@@ -4063,14 +4075,14 @@ class Se extends be {
4063
4075
  }
4064
4076
  }
4065
4077
 
4066
- class qe extends be {
4078
+ class qe extends ve {
4067
4079
  constructor(t, n) {
4068
4080
  super(t), this.lt = n;
4069
4081
  }
4070
4082
  _toFieldTransform(t) {
4071
- const n = $e(this, t,
4072
- /*array=*/ !0), e = this.lt.map((t => Ue(t, n))), r = new _n(e);
4073
- return new bn(t.path, r);
4083
+ const n = Fe(this, t,
4084
+ /*array=*/ !0), e = this.lt.map((t => ke(t, n))), r = new gn(e);
4085
+ return new vn(t.path, r);
4074
4086
  }
4075
4087
  isEqual(t) {
4076
4088
  // TODO(mrschmidt): Implement isEquals
@@ -4078,13 +4090,13 @@ class qe extends be {
4078
4090
  }
4079
4091
  }
4080
4092
 
4081
- class xe extends be {
4093
+ class Oe extends ve {
4082
4094
  constructor(t, n) {
4083
4095
  super(t), this.ft = n;
4084
4096
  }
4085
4097
  _toFieldTransform(t) {
4086
- const n = new gn(t.q, wn(t.q, this.ft));
4087
- return new bn(t.path, n);
4098
+ const n = new bn(t.q, mn(t.q, this.ft));
4099
+ return new vn(t.path, n);
4088
4100
  }
4089
4101
  isEqual(t) {
4090
4102
  // TODO(mrschmidt): Implement isEquals
@@ -4092,50 +4104,50 @@ class xe extends be {
4092
4104
  }
4093
4105
  }
4094
4106
 
4095
- /** Parse update data from an update() call. */ function Oe(t, n, e, r) {
4107
+ /** Parse update data from an update() call. */ function Ce(t, n, e, r) {
4096
4108
  const s = t.ht(1 /* Update */ , n, e);
4097
- Me("Data must be an object, but it was:", s, r);
4098
- const i = [], o = Mt.empty();
4099
- vt(r, ((t, r) => {
4100
- const u = Ge(n, t, e);
4109
+ Be("Data must be an object, but it was:", s, r);
4110
+ const i = [], o = Bt.empty();
4111
+ Et(r, ((t, r) => {
4112
+ const u = Qe(n, t, e);
4101
4113
  // For Compat types, we have to "extract" the underlying types before
4102
4114
  // performing validation.
4103
4115
  r = getModularInstance(r);
4104
4116
  const c = s.it(u);
4105
- if (r instanceof Ne)
4117
+ if (r instanceof $e)
4106
4118
  // Add it to the field mask, but don't add anything to updateData.
4107
4119
  i.push(u); else {
4108
- const t = Ue(r, c);
4120
+ const t = ke(r, c);
4109
4121
  null != t && (i.push(u), o.set(u, t));
4110
4122
  }
4111
4123
  }));
4112
- const u = new Et(i);
4113
- return new Ie(o, u, s.fieldTransforms);
4124
+ const u = new Tt(i);
4125
+ return new Ae(o, u, s.fieldTransforms);
4114
4126
  }
4115
4127
 
4116
- /** Parse update data from a list of field/value arguments. */ function Ce(t, n, e, r, s, i) {
4117
- const o = t.ht(1 /* Update */ , n, e), u = [ Be(n, r, e) ], c = [ s ];
4118
- if (i.length % 2 != 0) throw new L(I, `Function ${n}() needs to be called with an even number of arguments that alternate between field names and values.`);
4119
- for (let t = 0; t < i.length; t += 2) u.push(Be(n, i[t])), c.push(i[t + 1]);
4120
- const h = [], l = Mt.empty();
4128
+ /** Parse update data from a list of field/value arguments. */ function Le(t, n, e, r, s, i) {
4129
+ const o = t.ht(1 /* Update */ , n, e), u = [ ze(n, r, e) ], c = [ s ];
4130
+ if (i.length % 2 != 0) throw new U(A, `Function ${n}() needs to be called with an even number of arguments that alternate between field names and values.`);
4131
+ for (let t = 0; t < i.length; t += 2) u.push(ze(n, i[t])), c.push(i[t + 1]);
4132
+ const a = [], l = Bt.empty();
4121
4133
  // We iterate in reverse order to pick the last value for a field if the
4122
4134
  // user specified the field multiple times.
4123
- for (let t = u.length - 1; t >= 0; --t) if (!We(h, u[t])) {
4135
+ for (let t = u.length - 1; t >= 0; --t) if (!Ye(a, u[t])) {
4124
4136
  const n = u[t];
4125
4137
  let e = c[t];
4126
4138
  // For Compat types, we have to "extract" the underlying types before
4127
4139
  // performing validation.
4128
4140
  e = getModularInstance(e);
4129
4141
  const r = o.it(n);
4130
- if (e instanceof Ne)
4142
+ if (e instanceof $e)
4131
4143
  // Add it to the field mask, but don't add anything to updateData.
4132
- h.push(n); else {
4133
- const t = Ue(e, r);
4134
- null != t && (h.push(n), l.set(n, t));
4144
+ a.push(n); else {
4145
+ const t = ke(e, r);
4146
+ null != t && (a.push(n), l.set(n, t));
4135
4147
  }
4136
4148
  }
4137
- const f = new Et(h);
4138
- return new Ie(l, f, o.fieldTransforms);
4149
+ const f = new Tt(a);
4150
+ return new Ae(l, f, o.fieldTransforms);
4139
4151
  }
4140
4152
 
4141
4153
  /**
@@ -4144,8 +4156,8 @@ class xe extends be {
4144
4156
  *
4145
4157
  * @param allowArrays - Whether the query value is an array that may directly
4146
4158
  * contain additional arrays (e.g. the operand of an `in` query).
4147
- */ function Le(t, n, e, r = !1) {
4148
- return Ue(e, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , n));
4159
+ */ function Ue(t, n, e, r = !1) {
4160
+ return ke(e, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , n));
4149
4161
  }
4150
4162
 
4151
4163
  /**
@@ -4156,12 +4168,12 @@ class xe extends be {
4156
4168
  * the source of the data being parsed, etc.
4157
4169
  * @returns The parsed value, or null if the value was a FieldValue sentinel
4158
4170
  * that should not be included in the resulting parsed data.
4159
- */ function Ue(t, n) {
4160
- if (je(
4171
+ */ function ke(t, n) {
4172
+ if (Me(
4161
4173
  // Unwrap the API type from the Compat SDK. This will return the API type
4162
4174
  // from firestore-exp.
4163
- t = getModularInstance(t))) return Me("Unsupported field value:", n, t), ke(t, n);
4164
- if (t instanceof be)
4175
+ t = getModularInstance(t))) return Be("Unsupported field value:", n, t), je(t, n);
4176
+ if (t instanceof ve)
4165
4177
  // FieldValues usually parse into transforms (except FieldValue.delete())
4166
4178
  // in which case we do not want to include this field in our parsed data
4167
4179
  // (as doing so will overwrite the field directly prior to the transform
@@ -4173,7 +4185,7 @@ class xe extends be {
4173
4185
  */
4174
4186
  return function(t, n) {
4175
4187
  // Sentinels are only supported with writes, and not within arrays.
4176
- if (!Ae(n.tt)) throw n.ut(`${t._methodName}() can only be used with update() and set()`);
4188
+ if (!Pe(n.tt)) throw n.ut(`${t._methodName}() can only be used with update() and set()`);
4177
4189
  if (!n.path) throw n.ut(`${t._methodName}() is not currently supported inside arrays`);
4178
4190
  const e = t._toFieldTransform(n);
4179
4191
  e && n.fieldTransforms.push(e);
@@ -4203,7 +4215,7 @@ class xe extends be {
4203
4215
  const e = [];
4204
4216
  let r = 0;
4205
4217
  for (const s of t) {
4206
- let t = Ue(s, n.ot(r));
4218
+ let t = ke(s, n.ot(r));
4207
4219
  null == t && (
4208
4220
  // Just include nulls in the array for fields being replaced with a
4209
4221
  // sentinel.
@@ -4222,7 +4234,7 @@ class xe extends be {
4222
4234
  if (null === (t = getModularInstance(t))) return {
4223
4235
  nullValue: "NULL_VALUE"
4224
4236
  };
4225
- if ("number" == typeof t) return wn(n.q, t);
4237
+ if ("number" == typeof t) return mn(n.q, t);
4226
4238
  if ("boolean" == typeof t) return {
4227
4239
  booleanValue: t
4228
4240
  };
@@ -4230,37 +4242,37 @@ class xe extends be {
4230
4242
  stringValue: t
4231
4243
  };
4232
4244
  if (t instanceof Date) {
4233
- const e = _t.fromDate(t);
4245
+ const e = gt.fromDate(t);
4234
4246
  return {
4235
- timestampValue: Nn(n.q, e)
4247
+ timestampValue: $n(n.q, e)
4236
4248
  };
4237
4249
  }
4238
- if (t instanceof _t) {
4250
+ if (t instanceof gt) {
4239
4251
  // Firestore backend truncates precision down to microseconds. To ensure
4240
4252
  // offline mode works the same with regards to truncation, perform the
4241
4253
  // truncation immediately without waiting for the backend to do that.
4242
- const e = new _t(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
4254
+ const e = new gt(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
4243
4255
  return {
4244
- timestampValue: Nn(n.q, e)
4256
+ timestampValue: $n(n.q, e)
4245
4257
  };
4246
4258
  }
4247
- if (t instanceof ve) return {
4259
+ if (t instanceof Ee) return {
4248
4260
  geoPointValue: {
4249
4261
  latitude: t.latitude,
4250
4262
  longitude: t.longitude
4251
4263
  }
4252
4264
  };
4253
- if (t instanceof ge) return {
4254
- bytesValue: $n(n.q, t._byteString)
4265
+ if (t instanceof be) return {
4266
+ bytesValue: Fn(n.q, t._byteString)
4255
4267
  };
4256
- if (t instanceof ae) {
4268
+ if (t instanceof he) {
4257
4269
  const e = n.databaseId, r = t.firestore._databaseId;
4258
4270
  if (!r.isEqual(e)) throw n.ut(`Document reference is for database ${r.projectId}/${r.database} but should be for database ${e.projectId}/${e.database}`);
4259
4271
  return {
4260
4272
  referenceValue: qn(t.firestore._databaseId || n.databaseId, t._key.path)
4261
4273
  };
4262
4274
  }
4263
- throw n.ut(`Unsupported field value: ${st(t)}`);
4275
+ throw n.ut(`Unsupported field value: ${it(t)}`);
4264
4276
  }
4265
4277
  /**
4266
4278
  * Checks whether an object looks like a JSON object that should be converted
@@ -4271,13 +4283,13 @@ class xe extends be {
4271
4283
  */ (t, n);
4272
4284
  }
4273
4285
 
4274
- function ke(t, n) {
4286
+ function je(t, n) {
4275
4287
  const e = {};
4276
4288
  return !function(t) {
4277
4289
  for (const n in t) if (Object.prototype.hasOwnProperty.call(t, n)) return !1;
4278
4290
  return !0;
4279
- }(t) ? vt(t, ((t, r) => {
4280
- const s = Ue(r, n.et(t));
4291
+ }(t) ? Et(t, ((t, r) => {
4292
+ const s = ke(r, n.et(t));
4281
4293
  null != s && (e[t] = s);
4282
4294
  })) :
4283
4295
  // If we encounter an empty object, we explicitly add it to the update
@@ -4289,35 +4301,35 @@ function ke(t, n) {
4289
4301
  };
4290
4302
  }
4291
4303
 
4292
- function je(t) {
4293
- return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof _t || t instanceof ve || t instanceof ge || t instanceof ae || t instanceof be);
4304
+ function Me(t) {
4305
+ return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof gt || t instanceof Ee || t instanceof be || t instanceof he || t instanceof ve);
4294
4306
  }
4295
4307
 
4296
- function Me(t, n, e) {
4297
- if (!je(e) || !function(t) {
4308
+ function Be(t, n, e) {
4309
+ if (!Me(e) || !function(t) {
4298
4310
  return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
4299
4311
  }(e)) {
4300
- const r = st(e);
4312
+ const r = it(e);
4301
4313
  throw "an object" === r ? n.ut(t + " a custom object") : n.ut(t + " " + r);
4302
4314
  }
4303
4315
  }
4304
4316
 
4305
4317
  /**
4306
4318
  * Helper that calls fromDotSeparatedString() but wraps any error thrown.
4307
- */ function Be(t, n, e) {
4319
+ */ function ze(t, n, e) {
4308
4320
  if ((
4309
4321
  // If required, replace the FieldPath Compat class with with the firestore-exp
4310
4322
  // FieldPath.
4311
- n = getModularInstance(n)) instanceof ye) return n._internalPath;
4312
- if ("string" == typeof n) return Ge(t, n);
4313
- throw Qe("Field path arguments must be of type string or FieldPath.", t,
4323
+ n = getModularInstance(n)) instanceof _e) return n._internalPath;
4324
+ if ("string" == typeof n) return Qe(t, n);
4325
+ throw We("Field path arguments must be of type string or FieldPath.", t,
4314
4326
  /* hasConverter= */ !1,
4315
4327
  /* path= */ void 0, e);
4316
4328
  }
4317
4329
 
4318
4330
  /**
4319
4331
  * Matches any characters in a field path string that are reserved.
4320
- */ const ze = new RegExp("[~\\*/\\[\\]]");
4332
+ */ const Ge = new RegExp("[~\\*/\\[\\]]");
4321
4333
 
4322
4334
  /**
4323
4335
  * Wraps fromDotSeparatedString with an error message about the method that
@@ -4327,29 +4339,29 @@ function Me(t, n, e) {
4327
4339
  * split on dots.
4328
4340
  * @param targetDoc - The document against which the field path will be
4329
4341
  * evaluated.
4330
- */ function Ge(t, n, e) {
4331
- if (n.search(ze) >= 0) throw Qe(`Invalid field path (${n}). Paths must not contain '~', '*', '/', '[', or ']'`, t,
4342
+ */ function Qe(t, n, e) {
4343
+ if (n.search(Ge) >= 0) throw We(`Invalid field path (${n}). Paths must not contain '~', '*', '/', '[', or ']'`, t,
4332
4344
  /* hasConverter= */ !1,
4333
4345
  /* path= */ void 0, e);
4334
4346
  try {
4335
- return new ye(...n.split("."))._internalPath;
4347
+ return new _e(...n.split("."))._internalPath;
4336
4348
  } catch (r) {
4337
- throw Qe(`Invalid field path (${n}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t,
4349
+ throw We(`Invalid field path (${n}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t,
4338
4350
  /* hasConverter= */ !1,
4339
4351
  /* path= */ void 0, e);
4340
4352
  }
4341
4353
  }
4342
4354
 
4343
- function Qe(t, n, e, r, s) {
4355
+ function We(t, n, e, r, s) {
4344
4356
  const i = r && !r.isEmpty(), o = void 0 !== s;
4345
4357
  let u = `Function ${n}() called with invalid data`;
4346
4358
  e && (u += " (via `toFirestore()`)"), u += ". ";
4347
4359
  let c = "";
4348
4360
  return (i || o) && (c += " (found", i && (c += ` in field ${r}`), o && (c += ` in document ${s}`),
4349
- c += ")"), new L(I, u + t + c);
4361
+ c += ")"), new U(A, u + t + c);
4350
4362
  }
4351
4363
 
4352
- /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function We(t, n) {
4364
+ /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function Ye(t, n) {
4353
4365
  return t.some((t => t.isEqual(n)));
4354
4366
  }
4355
4367
 
@@ -4377,7 +4389,7 @@ function Qe(t, n, e, r, s) {
4377
4389
  * For a `DocumentSnapshot` that points to a non-existing document, any data
4378
4390
  * access will return 'undefined'. You can use the `exists()` method to
4379
4391
  * explicitly verify a document's existence.
4380
- */ class Ye {
4392
+ */ class He {
4381
4393
  // Note: This class is stripped down version of the DocumentSnapshot in
4382
4394
  // the legacy SDK. The changes are:
4383
4395
  // - No support for SnapshotMetadata.
@@ -4393,7 +4405,7 @@ function Qe(t, n, e, r, s) {
4393
4405
  /**
4394
4406
  * The `DocumentReference` for the document included in the `DocumentSnapshot`.
4395
4407
  */ get ref() {
4396
- return new ae(this._firestore, this._converter, this._key);
4408
+ return new he(this._firestore, this._converter, this._key);
4397
4409
  }
4398
4410
  /**
4399
4411
  * Signals whether or not the document at the snapshot's location exists.
@@ -4413,7 +4425,7 @@ function Qe(t, n, e, r, s) {
4413
4425
  if (this._converter) {
4414
4426
  // We only want to use the converter and create a new DocumentSnapshot
4415
4427
  // if a converter has been provided.
4416
- const t = new He(this._firestore, this._userDataWriter, this._key, this._document,
4428
+ const t = new Ke(this._firestore, this._userDataWriter, this._key, this._document,
4417
4429
  /* converter= */ null);
4418
4430
  return this._converter.fromFirestore(t);
4419
4431
  }
@@ -4433,7 +4445,7 @@ function Qe(t, n, e, r, s) {
4433
4445
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4434
4446
  get(t) {
4435
4447
  if (this._document) {
4436
- const n = this._document.data.field(Xe("DocumentSnapshot.get", t));
4448
+ const n = this._document.data.field(Ze("DocumentSnapshot.get", t));
4437
4449
  if (null !== n) return this._userDataWriter.convertValue(n);
4438
4450
  }
4439
4451
  }
@@ -4449,7 +4461,7 @@ function Qe(t, n, e, r, s) {
4449
4461
  * `DocumentSnapshot`. Since query results contain only existing documents, the
4450
4462
  * `exists` property will always be true and `data()` will never return
4451
4463
  * 'undefined'.
4452
- */ class He extends Ye {
4464
+ */ class Ke extends He {
4453
4465
  /**
4454
4466
  * Retrieves all fields in the document as an `Object`.
4455
4467
  *
@@ -4467,7 +4479,7 @@ function Qe(t, n, e, r, s) {
4467
4479
  * array via the `docs` property or enumerated using the `forEach` method. The
4468
4480
  * number of documents can be determined via the `empty` and `size`
4469
4481
  * properties.
4470
- */ class Ke {
4482
+ */ class Je {
4471
4483
  /** @hideconstructor */
4472
4484
  constructor(t, n) {
4473
4485
  this._docs = n, this.query = t;
@@ -4498,14 +4510,14 @@ function Qe(t, n, e, r, s) {
4498
4510
  * @param left - A snapshot to compare.
4499
4511
  * @param right - A snapshot to compare.
4500
4512
  * @returns true if the snapshots are equal.
4501
- */ function Je(t, n) {
4502
- return t = getModularInstance(t), n = getModularInstance(n), t instanceof Ye && n instanceof Ye ? t._firestore === n._firestore && t._key.isEqual(n._key) && (null === t._document ? null === n._document : t._document.isEqual(n._document)) && t._converter === n._converter : t instanceof Ke && n instanceof Ke && (pe(t.query, n.query) && yt(t.docs, n.docs, Je));
4513
+ */ function Xe(t, n) {
4514
+ return t = getModularInstance(t), n = getModularInstance(n), t instanceof He && n instanceof He ? t._firestore === n._firestore && t._key.isEqual(n._key) && (null === t._document ? null === n._document : t._document.isEqual(n._document)) && t._converter === n._converter : t instanceof Je && n instanceof Je && (ye(t.query, n.query) && _t(t.docs, n.docs, Xe));
4503
4515
  }
4504
4516
 
4505
4517
  /**
4506
4518
  * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
4507
- */ function Xe(t, n) {
4508
- return "string" == typeof n ? Ge(t, n) : n instanceof ye ? n._internalPath : n._delegate._internalPath;
4519
+ */ function Ze(t, n) {
4520
+ return "string" == typeof n ? Qe(t, n) : n instanceof _e ? n._internalPath : n._delegate._internalPath;
4509
4521
  }
4510
4522
 
4511
4523
  /**
@@ -4532,7 +4544,7 @@ function Qe(t, n, e, r, s) {
4532
4544
  * can then be passed to {@link query} to create a new query instance that
4533
4545
  * also contains this `QueryConstraint`.
4534
4546
  */
4535
- class Ze {}
4547
+ class tr {}
4536
4548
 
4537
4549
  /**
4538
4550
  * Creates a new immutable instance of {@link Query} that is extended to also include
@@ -4542,40 +4554,40 @@ class Ze {}
4542
4554
  * @param queryConstraints - The list of {@link QueryConstraint}s to apply.
4543
4555
  * @throws if any of the provided query constraints cannot be combined with the
4544
4556
  * existing or new constraints.
4545
- */ function tr(t, ...n) {
4557
+ */ function nr(t, ...n) {
4546
4558
  for (const e of n) t = e._apply(t);
4547
4559
  return t;
4548
4560
  }
4549
4561
 
4550
- class nr extends Ze {
4562
+ class er extends tr {
4551
4563
  constructor(t, n, e) {
4552
4564
  super(), this.dt = t, this.wt = n, this.yt = e, this.type = "where";
4553
4565
  }
4554
4566
  _apply(t) {
4555
- const n = Ve(t.firestore), e = function(t, n, e, r, s, i, o) {
4567
+ const n = De(t.firestore), e = function(t, n, e, r, s, i, o) {
4556
4568
  let u;
4557
4569
  if (s.isKeyField()) {
4558
- if ("array-contains" /* ARRAY_CONTAINS */ === i || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === i) throw new L(I, `Invalid Query. You can't perform '${i}' queries on FieldPath.documentId().`);
4570
+ if ("array-contains" /* ARRAY_CONTAINS */ === i || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === i) throw new U(A, `Invalid Query. You can't perform '${i}' queries on FieldPath.documentId().`);
4559
4571
  if ("in" /* IN */ === i || "not-in" /* NOT_IN */ === i) {
4560
- pr(o, i);
4572
+ yr(o, i);
4561
4573
  const n = [];
4562
- for (const e of o) n.push(mr(r, t, e));
4574
+ for (const e of o) n.push(pr(r, t, e));
4563
4575
  u = {
4564
4576
  arrayValue: {
4565
4577
  values: n
4566
4578
  }
4567
4579
  };
4568
- } else u = mr(r, t, o);
4569
- } else "in" /* IN */ !== i && "not-in" /* NOT_IN */ !== i && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== i || pr(o, i),
4570
- u = Le(e, n, o,
4580
+ } else u = pr(r, t, o);
4581
+ } else "in" /* IN */ !== i && "not-in" /* NOT_IN */ !== i && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== i || yr(o, i),
4582
+ u = Ue(e, n, o,
4571
4583
  /* allowArrays= */ "in" /* IN */ === i || "not-in" /* NOT_IN */ === i);
4572
- const c = Qt.create(s, i, u);
4584
+ const c = Wt.create(s, i, u);
4573
4585
  return function(t, n) {
4574
4586
  if (n.N()) {
4575
- const e = an(t);
4576
- if (null !== e && !e.isEqual(n.field)) throw new L(I, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${e.toString()}' and '${n.field.toString()}'`);
4577
- const r = cn(t);
4578
- null !== r && yr(t, n.field, r);
4587
+ const e = hn(t);
4588
+ if (null !== e && !e.isEqual(n.field)) throw new U(A, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${e.toString()}' and '${n.field.toString()}'`);
4589
+ const r = an(t);
4590
+ null !== r && _r(t, n.field, r);
4579
4591
  }
4580
4592
  const e = function(t, n) {
4581
4593
  for (const e of t.filters) if (n.indexOf(e.op) >= 0) return e.op;
@@ -4616,12 +4628,12 @@ class nr extends Ze {
4616
4628
  }(n.op));
4617
4629
  if (null !== e)
4618
4630
  // Special case when it's a duplicate op to give a slightly clearer error message.
4619
- throw e === n.op ? new L(I, `Invalid query. You cannot use more than one '${n.op.toString()}' filter.`) : new L(I, `Invalid query. You cannot use '${n.op.toString()}' filters with '${e.toString()}' filters.`);
4631
+ throw e === n.op ? new U(A, `Invalid query. You cannot use more than one '${n.op.toString()}' filter.`) : new U(A, `Invalid query. You cannot use '${n.op.toString()}' filters with '${e.toString()}' filters.`);
4620
4632
  }(t, c), c;
4621
4633
  }(t._query, "where", n, t.firestore._databaseId, this.dt, this.wt, this.yt);
4622
- return new he(t.firestore, t.converter, function(t, n) {
4634
+ return new le(t.firestore, t.converter, function(t, n) {
4623
4635
  const e = t.filters.concat([ n ]);
4624
- return new on(t.path, t.collectionGroup, t.explicitOrderBy.slice(), e, t.limit, t.limitType, t.startAt, t.endAt);
4636
+ return new un(t.path, t.collectionGroup, t.explicitOrderBy.slice(), e, t.limit, t.limitType, t.startAt, t.endAt);
4625
4637
  }(t._query, e));
4626
4638
  }
4627
4639
  }
@@ -4636,25 +4648,25 @@ class nr extends Ze {
4636
4648
  * "&lt;=", "!=").
4637
4649
  * @param value - The value for comparison
4638
4650
  * @returns The created {@link Query}.
4639
- */ function er(t, n, e) {
4640
- const r = n, s = Xe("where", t);
4641
- return new nr(s, r, e);
4651
+ */ function rr(t, n, e) {
4652
+ const r = n, s = Ze("where", t);
4653
+ return new er(s, r, e);
4642
4654
  }
4643
4655
 
4644
- class rr extends Ze {
4656
+ class sr extends tr {
4645
4657
  constructor(t, n) {
4646
4658
  super(), this.dt = t, this._t = n, this.type = "orderBy";
4647
4659
  }
4648
4660
  _apply(t) {
4649
4661
  const n = function(t, n, e) {
4650
- if (null !== t.startAt) throw new L(I, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
4651
- if (null !== t.endAt) throw new L(I, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
4652
- const r = new en(n, e);
4662
+ if (null !== t.startAt) throw new U(A, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
4663
+ if (null !== t.endAt) throw new U(A, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
4664
+ const r = new rn(n, e);
4653
4665
  return function(t, n) {
4654
- if (null === cn(t)) {
4666
+ if (null === an(t)) {
4655
4667
  // This is the first order by. It must match any inequality.
4656
- const e = an(t);
4657
- null !== e && yr(t, e, n.field);
4668
+ const e = hn(t);
4669
+ null !== e && _r(t, e, n.field);
4658
4670
  }
4659
4671
  }(t, r), r;
4660
4672
  }
@@ -4669,10 +4681,10 @@ class rr extends Ze {
4669
4681
  * of the query or if any of the fields in the order by are an uncommitted
4670
4682
  * server timestamp.
4671
4683
  */ (t._query, this.dt, this._t);
4672
- return new he(t.firestore, t.converter, function(t, n) {
4684
+ return new le(t.firestore, t.converter, function(t, n) {
4673
4685
  // TODO(dimond): validate that orderBy does not list the same key twice.
4674
4686
  const e = t.explicitOrderBy.concat([ n ]);
4675
- return new on(t.path, t.collectionGroup, e, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
4687
+ return new un(t.path, t.collectionGroup, e, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
4676
4688
  }(t._query, n));
4677
4689
  }
4678
4690
  }
@@ -4685,18 +4697,18 @@ class rr extends Ze {
4685
4697
  * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
4686
4698
  * not specified, order will be ascending.
4687
4699
  * @returns The created {@link Query}.
4688
- */ function sr(t, n = "asc") {
4689
- const e = n, r = Xe("orderBy", t);
4690
- return new rr(r, e);
4700
+ */ function ir(t, n = "asc") {
4701
+ const e = n, r = Ze("orderBy", t);
4702
+ return new sr(r, e);
4691
4703
  }
4692
4704
 
4693
- class ir extends Ze {
4705
+ class or extends tr {
4694
4706
  constructor(t, n, e) {
4695
4707
  super(), this.type = t, this.gt = n, this.bt = e;
4696
4708
  }
4697
4709
  _apply(t) {
4698
- return new he(t.firestore, t.converter, function(t, n, e) {
4699
- return new on(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), n, e, t.startAt, t.endAt);
4710
+ return new le(t.firestore, t.converter, function(t, n, e) {
4711
+ return new un(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), n, e, t.startAt, t.endAt);
4700
4712
  }(t._query, this.gt, this.bt));
4701
4713
  }
4702
4714
  }
@@ -4706,8 +4718,8 @@ class ir extends Ze {
4706
4718
  *
4707
4719
  * @param limit - The maximum number of items to return.
4708
4720
  * @returns The created {@link Query}.
4709
- */ function or(t) {
4710
- return ot("limit", t), new ir("limit", t, "F" /* First */);
4721
+ */ function ur(t) {
4722
+ return ut("limit", t), new or("limit", t, "F" /* First */);
4711
4723
  }
4712
4724
 
4713
4725
  /**
@@ -4718,54 +4730,54 @@ class ir extends Ze {
4718
4730
  *
4719
4731
  * @param limit - The maximum number of items to return.
4720
4732
  * @returns The created {@link Query}.
4721
- */ function ur(t) {
4722
- return ot("limitToLast", t), new ir("limitToLast", t, "L" /* Last */);
4733
+ */ function cr(t) {
4734
+ return ut("limitToLast", t), new or("limitToLast", t, "L" /* Last */);
4723
4735
  }
4724
4736
 
4725
- class cr extends Ze {
4737
+ class ar extends tr {
4726
4738
  constructor(t, n, e) {
4727
4739
  super(), this.type = t, this.vt = n, this.Et = e;
4728
4740
  }
4729
4741
  _apply(t) {
4730
- const n = wr(t, this.type, this.vt, this.Et);
4731
- return new he(t.firestore, t.converter, function(t, n) {
4732
- return new on(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, n, t.endAt);
4742
+ const n = mr(t, this.type, this.vt, this.Et);
4743
+ return new le(t.firestore, t.converter, function(t, n) {
4744
+ return new un(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, n, t.endAt);
4733
4745
  }(t._query, n));
4734
4746
  }
4735
4747
  }
4736
4748
 
4737
- function ar(...t) {
4738
- return new cr("startAt", t, /*before=*/ !0);
4749
+ function hr(...t) {
4750
+ return new ar("startAt", t, /*before=*/ !0);
4739
4751
  }
4740
4752
 
4741
- function hr(...t) {
4742
- return new cr("startAfter", t,
4753
+ function lr(...t) {
4754
+ return new ar("startAfter", t,
4743
4755
  /*before=*/ !1);
4744
4756
  }
4745
4757
 
4746
- class lr extends Ze {
4758
+ class fr extends tr {
4747
4759
  constructor(t, n, e) {
4748
4760
  super(), this.type = t, this.vt = n, this.Et = e;
4749
4761
  }
4750
4762
  _apply(t) {
4751
- const n = wr(t, this.type, this.vt, this.Et);
4752
- return new he(t.firestore, t.converter, function(t, n) {
4753
- return new on(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, n);
4763
+ const n = mr(t, this.type, this.vt, this.Et);
4764
+ return new le(t.firestore, t.converter, function(t, n) {
4765
+ return new un(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, n);
4754
4766
  }(t._query, n));
4755
4767
  }
4756
4768
  }
4757
4769
 
4758
- function fr(...t) {
4759
- return new lr("endBefore", t, /*before=*/ !0);
4770
+ function dr(...t) {
4771
+ return new fr("endBefore", t, /*before=*/ !0);
4760
4772
  }
4761
4773
 
4762
- function dr(...t) {
4763
- return new lr("endAt", t, /*before=*/ !1);
4774
+ function wr(...t) {
4775
+ return new fr("endAt", t, /*before=*/ !1);
4764
4776
  }
4765
4777
 
4766
- /** Helper function to create a bound from a document or fields */ function wr(t, n, e, r) {
4767
- if (e[0] = getModularInstance(e[0]), e[0] instanceof Ye) return function(t, n, e, r, s) {
4768
- if (!r) throw new L(P, `Can't use a DocumentSnapshot that doesn't exist for ${e}().`);
4778
+ /** Helper function to create a bound from a document or fields */ function mr(t, n, e, r) {
4779
+ if (e[0] = getModularInstance(e[0]), e[0] instanceof He) return function(t, n, e, r, s) {
4780
+ if (!r) throw new U(R, `Can't use a DocumentSnapshot that doesn't exist for ${e}().`);
4769
4781
  const i = [];
4770
4782
  // Because people expect to continue/end a query at the exact document
4771
4783
  // provided, we need to use the implicit sort order rather than the explicit
@@ -4774,42 +4786,42 @@ function dr(...t) {
4774
4786
  // the provided document. Without the key (by using the explicit sort
4775
4787
  // orders), multiple documents could match the position, yielding duplicate
4776
4788
  // results.
4777
- for (const e of ln(t)) if (e.field.isKeyField()) i.push(Ot(n, r.key)); else {
4789
+ for (const e of fn(t)) if (e.field.isKeyField()) i.push(Ct(n, r.key)); else {
4778
4790
  const t = r.data.field(e.field);
4779
- if (Vt(t)) throw new L(I, 'Invalid query. You are trying to start or end a query using a document for which the field "' + e.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
4791
+ if (Dt(t)) throw new U(A, 'Invalid query. You are trying to start or end a query using a document for which the field "' + e.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
4780
4792
  if (null === t) {
4781
4793
  const t = e.field.canonicalString();
4782
- throw new L(I, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);
4794
+ throw new U(A, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);
4783
4795
  }
4784
4796
  i.push(t);
4785
4797
  }
4786
- return new nn(i, s);
4798
+ return new en(i, s);
4787
4799
  }
4788
4800
  /**
4789
4801
  * Converts a list of field values to a `Bound` for the given query.
4790
4802
  */ (t._query, t.firestore._databaseId, n, e[0]._document, r);
4791
4803
  {
4792
- const s = Ve(t.firestore);
4804
+ const s = De(t.firestore);
4793
4805
  return function(t, n, e, r, s, i) {
4794
4806
  // Use explicit order by's because it has to match the query the user made
4795
4807
  const o = t.explicitOrderBy;
4796
- if (s.length > o.length) throw new L(I, `Too many arguments provided to ${r}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
4808
+ if (s.length > o.length) throw new U(A, `Too many arguments provided to ${r}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
4797
4809
  const u = [];
4798
4810
  for (let i = 0; i < s.length; i++) {
4799
4811
  const c = s[i];
4800
4812
  if (o[i].field.isKeyField()) {
4801
- if ("string" != typeof c) throw new L(I, `Invalid query. Expected a string for document ID in ${r}(), but got a ${typeof c}`);
4802
- if (!hn(t) && -1 !== c.indexOf("/")) throw new L(I, `Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to ${r}() must be a plain document ID, but '${c}' contains a slash.`);
4803
- const e = t.path.child(J.fromString(c));
4804
- if (!tt.isDocumentKey(e)) throw new L(I, `Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to ${r}() must result in a valid document path, but '${e}' is not because it contains an odd number of segments.`);
4805
- const s = new tt(e);
4806
- u.push(Ot(n, s));
4813
+ if ("string" != typeof c) throw new U(A, `Invalid query. Expected a string for document ID in ${r}(), but got a ${typeof c}`);
4814
+ if (!ln(t) && -1 !== c.indexOf("/")) throw new U(A, `Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to ${r}() must be a plain document ID, but '${c}' contains a slash.`);
4815
+ const e = t.path.child(X.fromString(c));
4816
+ if (!nt.isDocumentKey(e)) throw new U(A, `Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to ${r}() must result in a valid document path, but '${e}' is not because it contains an odd number of segments.`);
4817
+ const s = new nt(e);
4818
+ u.push(Ct(n, s));
4807
4819
  } else {
4808
- const t = Le(e, r, c);
4820
+ const t = Ue(e, r, c);
4809
4821
  u.push(t);
4810
4822
  }
4811
4823
  }
4812
- return new nn(u, i);
4824
+ return new en(u, i);
4813
4825
  }
4814
4826
  /**
4815
4827
  * Parses the given `documentIdValue` into a `ReferenceValue`, throwing
@@ -4819,28 +4831,28 @@ function dr(...t) {
4819
4831
  }
4820
4832
  }
4821
4833
 
4822
- function mr(t, n, e) {
4834
+ function pr(t, n, e) {
4823
4835
  if ("string" == typeof (e = getModularInstance(e))) {
4824
- if ("" === e) throw new L(I, "Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");
4825
- if (!hn(n) && -1 !== e.indexOf("/")) throw new L(I, `Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '${e}' contains a '/' character.`);
4826
- const r = n.path.child(J.fromString(e));
4827
- if (!tt.isDocumentKey(r)) throw new L(I, `Invalid query. When querying a collection group by FieldPath.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}).`);
4828
- return Ot(t, new tt(r));
4836
+ if ("" === e) throw new U(A, "Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");
4837
+ if (!ln(n) && -1 !== e.indexOf("/")) throw new U(A, `Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '${e}' contains a '/' character.`);
4838
+ const r = n.path.child(X.fromString(e));
4839
+ if (!nt.isDocumentKey(r)) throw new U(A, `Invalid query. When querying a collection group by FieldPath.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}).`);
4840
+ return Ct(t, new nt(r));
4829
4841
  }
4830
- if (e instanceof ae) return Ot(t, e._key);
4831
- throw new L(I, `Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: ${st(e)}.`);
4842
+ if (e instanceof he) return Ct(t, e._key);
4843
+ throw new U(A, `Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: ${it(e)}.`);
4832
4844
  }
4833
4845
 
4834
4846
  /**
4835
4847
  * Validates that the value passed into a disjunctive filter satisfies all
4836
4848
  * array requirements.
4837
- */ function pr(t, n) {
4838
- if (!Array.isArray(t) || 0 === t.length) throw new L(I, `Invalid Query. A non-empty array is required for '${n.toString()}' filters.`);
4839
- if (t.length > 10) throw new L(I, `Invalid Query. '${n.toString()}' filters support a maximum of 10 elements in the value array.`);
4849
+ */ function yr(t, n) {
4850
+ if (!Array.isArray(t) || 0 === t.length) throw new U(A, `Invalid Query. A non-empty array is required for '${n.toString()}' filters.`);
4851
+ if (t.length > 10) throw new U(A, `Invalid Query. '${n.toString()}' filters support a maximum of 10 elements in the value array.`);
4840
4852
  }
4841
4853
 
4842
- function yr(t, n, e) {
4843
- if (!e.isEqual(n)) throw new L(I, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${n.toString()}' and so you must also use '${n.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${e.toString()}' instead.`);
4854
+ function _r(t, n, e) {
4855
+ if (!e.isEqual(n)) throw new U(A, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${n.toString()}' and so you must also use '${n.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${e.toString()}' instead.`);
4844
4856
  }
4845
4857
 
4846
4858
  /**
@@ -4890,7 +4902,7 @@ function yr(t, n, e) {
4890
4902
  * their `set()` or fails due to invalid data originating from a `toFirestore()`
4891
4903
  * call.
4892
4904
  */
4893
- function _r(t, n, e) {
4905
+ function gr(t, n, e) {
4894
4906
  let r;
4895
4907
  // Cast to `any` in order to satisfy the union type constraint on
4896
4908
  // toFirestore().
@@ -4899,9 +4911,9 @@ function _r(t, n, e) {
4899
4911
  r;
4900
4912
  }
4901
4913
 
4902
- class gr extends class {
4914
+ class br extends class {
4903
4915
  convertValue(t, n = "none") {
4904
- switch ($t(t)) {
4916
+ switch (Ft(t)) {
4905
4917
  case 0 /* NullValue */ :
4906
4918
  return null;
4907
4919
 
@@ -4909,7 +4921,7 @@ class gr extends class {
4909
4921
  return t.booleanValue;
4910
4922
 
4911
4923
  case 2 /* NumberValue */ :
4912
- return Pt(t.integerValue || t.doubleValue);
4924
+ return Rt(t.integerValue || t.doubleValue);
4913
4925
 
4914
4926
  case 3 /* TimestampValue */ :
4915
4927
  return this.convertTimestamp(t.timestampValue);
@@ -4921,7 +4933,7 @@ class gr extends class {
4921
4933
  return t.stringValue;
4922
4934
 
4923
4935
  case 6 /* BlobValue */ :
4924
- return this.convertBytes(Rt(t.bytesValue));
4936
+ return this.convertBytes(Vt(t.bytesValue));
4925
4937
 
4926
4938
  case 7 /* RefValue */ :
4927
4939
  return this.convertReference(t.referenceValue);
@@ -4936,17 +4948,17 @@ class gr extends class {
4936
4948
  return this.convertObject(t.mapValue, n);
4937
4949
 
4938
4950
  default:
4939
- throw _();
4951
+ throw g();
4940
4952
  }
4941
4953
  }
4942
4954
  convertObject(t, n) {
4943
4955
  const e = {};
4944
- return vt(t.fields, ((t, r) => {
4956
+ return Et(t.fields, ((t, r) => {
4945
4957
  e[t] = this.convertValue(r, n);
4946
4958
  })), e;
4947
4959
  }
4948
4960
  convertGeoPoint(t) {
4949
- return new ve(Pt(t.latitude), Pt(t.longitude));
4961
+ return new Ee(Rt(t.latitude), Rt(t.longitude));
4950
4962
  }
4951
4963
  convertArray(t, n) {
4952
4964
  return (t.values || []).map((t => this.convertValue(t, n)));
@@ -4954,27 +4966,27 @@ class gr extends class {
4954
4966
  convertServerTimestamp(t, n) {
4955
4967
  switch (n) {
4956
4968
  case "previous":
4957
- const e = Dt(t);
4969
+ const e = Nt(t);
4958
4970
  return null == e ? null : this.convertValue(e, n);
4959
4971
 
4960
4972
  case "estimate":
4961
- return this.convertTimestamp(Nt(t));
4973
+ return this.convertTimestamp($t(t));
4962
4974
 
4963
4975
  default:
4964
4976
  return null;
4965
4977
  }
4966
4978
  }
4967
4979
  convertTimestamp(t) {
4968
- const n = At(t);
4969
- return new _t(n.seconds, n.nanos);
4980
+ const n = Pt(t);
4981
+ return new gt(n.seconds, n.nanos);
4970
4982
  }
4971
4983
  convertDocumentKey(t, n) {
4972
- const e = J.fromString(t);
4973
- g(Yn(e));
4974
- const r = new H(e.get(1), e.get(3)), s = new tt(e.popFirst(5));
4984
+ const e = X.fromString(t);
4985
+ b(Hn(e));
4986
+ const r = new K(e.get(1), e.get(3)), s = new nt(e.popFirst(5));
4975
4987
  return r.isEqual(n) ||
4976
4988
  // TODO(b/64130202): Somehow support foreign references.
4977
- m(`Document ${s} contains a document reference within a different database (${r.projectId}/${r.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),
4989
+ p(`Document ${s} contains a document reference within a different database (${r.projectId}/${r.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),
4978
4990
  s;
4979
4991
  }
4980
4992
  } {
@@ -4982,11 +4994,11 @@ class gr extends class {
4982
4994
  super(), this.firestore = t;
4983
4995
  }
4984
4996
  convertBytes(t) {
4985
- return new ge(t);
4997
+ return new be(t);
4986
4998
  }
4987
4999
  convertReference(t) {
4988
5000
  const n = this.convertDocumentKey(t, this.firestore._databaseId);
4989
- return new ae(this.firestore, /* converter= */ null, n);
5001
+ return new he(this.firestore, /* converter= */ null, n);
4990
5002
  }
4991
5003
  }
4992
5004
 
@@ -5002,12 +5014,12 @@ class gr extends class {
5002
5014
  * @param reference - The reference of the document to fetch.
5003
5015
  * @returns A Promise resolved with a `DocumentSnapshot` containing the current
5004
5016
  * document contents.
5005
- */ function br(t) {
5006
- const n = ee((t = it(t, ae)).firestore), e = new gr(t.firestore);
5007
- return Zn(n, [ t._key ]).then((n => {
5008
- g(1 === n.length);
5017
+ */ function vr(t) {
5018
+ const n = re((t = ot(t, he)).firestore), e = new br(t.firestore);
5019
+ return te(n, [ t._key ]).then((n => {
5020
+ b(1 === n.length);
5009
5021
  const r = n[0];
5010
- return new Ye(t.firestore, e, t._key, r.isFoundDocument() ? r : null, t.converter);
5022
+ return new He(t.firestore, e, t._key, r.isFoundDocument() ? r : null, t.converter);
5011
5023
  }));
5012
5024
  }
5013
5025
 
@@ -5022,33 +5034,33 @@ class gr extends class {
5022
5034
  *
5023
5035
  * @param query - The `Query` to execute.
5024
5036
  * @returns A Promise that will be resolved with the results of the query.
5025
- */ function vr(t) {
5037
+ */ function Er(t) {
5026
5038
  !function(t) {
5027
- if (un(t) && 0 === t.explicitOrderBy.length) throw new L(q, "limitToLast() queries require specifying at least one orderBy() clause");
5028
- }((t = it(t, he))._query);
5029
- const n = ee(t.firestore), e = new gr(t.firestore);
5030
- return te(n, t._query).then((n => {
5031
- const r = n.map((n => new He(t.firestore, e, n.key, n, t.converter)));
5032
- return un(t._query) &&
5039
+ if (cn(t) && 0 === t.explicitOrderBy.length) throw new U(q, "limitToLast() queries require specifying at least one orderBy() clause");
5040
+ }((t = ot(t, le))._query);
5041
+ const n = re(t.firestore), e = new br(t.firestore);
5042
+ return ne(n, t._query).then((n => {
5043
+ const r = n.map((n => new Ke(t.firestore, e, n.key, n, t.converter)));
5044
+ return cn(t._query) &&
5033
5045
  // Limit to last queries reverse the orderBy constraint that was
5034
5046
  // specified by the user. As such, we need to reverse the order of the
5035
5047
  // results to return the documents in the expected order.
5036
- r.reverse(), new Ke(t, r);
5048
+ r.reverse(), new Je(t, r);
5037
5049
  }));
5038
5050
  }
5039
5051
 
5040
- function Er(t, n, e) {
5041
- const r = _r((t = it(t, ae)).converter, n, e), s = De(Ve(t.firestore), "setDoc", t._key, r, null !== t.converter, e);
5042
- return Xn(ee(t.firestore), [ s.toMutation(t._key, vn.none()) ]);
5052
+ function Tr(t, n, e) {
5053
+ const r = gr((t = ot(t, he)).converter, n, e), s = Ne(De(t.firestore), "setDoc", t._key, r, null !== t.converter, e);
5054
+ return Zn(re(t.firestore), [ s.toMutation(t._key, En.none()) ]);
5043
5055
  }
5044
5056
 
5045
- function Tr(t, n, e, ...r) {
5046
- const s = Ve((t = it(t, ae)).firestore);
5057
+ function Ir(t, n, e, ...r) {
5058
+ const s = De((t = ot(t, he)).firestore);
5047
5059
  // For Compat types, we have to "extract" the underlying types before
5048
5060
  // performing validation.
5049
5061
  let i;
5050
- i = "string" == typeof (n = getModularInstance(n)) || n instanceof ye ? Ce(s, "updateDoc", t._key, n, e, r) : Oe(s, "updateDoc", t._key, n);
5051
- return Xn(ee(t.firestore), [ i.toMutation(t._key, vn.exists(!0)) ]);
5062
+ i = "string" == typeof (n = getModularInstance(n)) || n instanceof _e ? Le(s, "updateDoc", t._key, n, e, r) : Ce(s, "updateDoc", t._key, n);
5063
+ return Zn(re(t.firestore), [ i.toMutation(t._key, En.exists(!0)) ]);
5052
5064
  }
5053
5065
 
5054
5066
  /**
@@ -5062,8 +5074,8 @@ function Tr(t, n, e, ...r) {
5062
5074
  * @param reference - A reference to the document to delete.
5063
5075
  * @returns A `Promise` resolved once the document has been successfully
5064
5076
  * deleted from the backend.
5065
- */ function Ir(t) {
5066
- return Xn(ee((t = it(t, ae)).firestore), [ new An(t._key, vn.none()) ]);
5077
+ */ function Ar(t) {
5078
+ return Zn(re((t = ot(t, he)).firestore), [ new Pn(t._key, En.none()) ]);
5067
5079
  }
5068
5080
 
5069
5081
  /**
@@ -5077,11 +5089,12 @@ function Tr(t, n, e, ...r) {
5077
5089
  *
5078
5090
  * @param reference - A reference to the collection to add this document to.
5079
5091
  * @param data - An Object containing the data for the new document.
5092
+ * @throws Error - If the provided input is not a valid Firestore document.
5080
5093
  * @returns A `Promise` resolved with a `DocumentReference` pointing to the
5081
5094
  * newly created document after it has been written to the backend.
5082
- */ function Ar(t, n) {
5083
- const e = we(t = it(t, le)), r = _r(t.converter, n), s = De(Ve(t.firestore), "addDoc", e._key, r, null !== e.converter, {});
5084
- return Xn(ee(t.firestore), [ s.toMutation(e._key, vn.exists(!1)) ]).then((() => e));
5095
+ */ function Pr(t, n) {
5096
+ const e = me(t = ot(t, fe)), r = gr(t.converter, n), s = Ne(De(t.firestore), "addDoc", e._key, r, null !== e.converter, {});
5097
+ return Zn(re(t.firestore), [ s.toMutation(e._key, En.exists(!1)) ]).then((() => e));
5085
5098
  }
5086
5099
 
5087
5100
  /**
@@ -5103,15 +5116,15 @@ function Tr(t, n, e, ...r) {
5103
5116
  /**
5104
5117
  * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
5105
5118
  * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
5106
- */ function Pr() {
5107
- return new Ne("deleteField");
5119
+ */ function Rr() {
5120
+ return new $e("deleteField");
5108
5121
  }
5109
5122
 
5110
5123
  /**
5111
5124
  * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
5112
5125
  * include a server-generated timestamp in the written data.
5113
- */ function Rr() {
5114
- return new Fe("serverTimestamp");
5126
+ */ function Vr() {
5127
+ return new Se("serverTimestamp");
5115
5128
  }
5116
5129
 
5117
5130
  /**
@@ -5125,10 +5138,10 @@ function Tr(t, n, e, ...r) {
5125
5138
  * @param elements - The elements to union into the array.
5126
5139
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
5127
5140
  * `updateDoc()`.
5128
- */ function Vr(...t) {
5141
+ */ function Dr(...t) {
5129
5142
  // NOTE: We don't actually parse the data until it's used in set() or
5130
5143
  // update() since we'd need the Firestore instance to do this.
5131
- return new Se("arrayUnion", t);
5144
+ return new xe("arrayUnion", t);
5132
5145
  }
5133
5146
 
5134
5147
  /**
@@ -5141,7 +5154,7 @@ function Tr(t, n, e, ...r) {
5141
5154
  * @param elements - The elements to remove from the array.
5142
5155
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
5143
5156
  * `updateDoc()`
5144
- */ function Dr(...t) {
5157
+ */ function Nr(...t) {
5145
5158
  // NOTE: We don't actually parse the data until it's used in set() or
5146
5159
  // update() since we'd need the Firestore instance to do this.
5147
5160
  return new qe("arrayRemove", t);
@@ -5165,8 +5178,8 @@ function Tr(t, n, e, ...r) {
5165
5178
  * @param n - The value to increment by.
5166
5179
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
5167
5180
  * `updateDoc()`
5168
- */ function Nr(t) {
5169
- return new xe("increment", t);
5181
+ */ function $r(t) {
5182
+ return new Oe("increment", t);
5170
5183
  }
5171
5184
 
5172
5185
  /**
@@ -5192,25 +5205,25 @@ function Tr(t, n, e, ...r) {
5192
5205
  * provides methods for adding writes to the write batch. None of the writes
5193
5206
  * will be committed (or visible locally) until {@link WriteBatch.commit} is
5194
5207
  * called.
5195
- */ class $r {
5208
+ */ class Fr {
5196
5209
  /** @hideconstructor */
5197
5210
  constructor(t, n) {
5198
5211
  this._firestore = t, this._commitHandler = n, this._mutations = [], this._committed = !1,
5199
- this._dataReader = Ve(t);
5212
+ this._dataReader = De(t);
5200
5213
  }
5201
5214
  set(t, n, e) {
5202
5215
  this._verifyNotCommitted();
5203
- const r = Fr(t, this._firestore), s = _r(r.converter, n, e), i = De(this._dataReader, "WriteBatch.set", r._key, s, null !== r.converter, e);
5204
- return this._mutations.push(i.toMutation(r._key, vn.none())), this;
5216
+ const r = Sr(t, this._firestore), s = gr(r.converter, n, e), i = Ne(this._dataReader, "WriteBatch.set", r._key, s, null !== r.converter, e);
5217
+ return this._mutations.push(i.toMutation(r._key, En.none())), this;
5205
5218
  }
5206
5219
  update(t, n, e, ...r) {
5207
5220
  this._verifyNotCommitted();
5208
- const s = Fr(t, this._firestore);
5221
+ const s = Sr(t, this._firestore);
5209
5222
  // For Compat types, we have to "extract" the underlying types before
5210
5223
  // performing validation.
5211
5224
  let i;
5212
- return i = "string" == typeof (n = getModularInstance(n)) || n instanceof ye ? Ce(this._dataReader, "WriteBatch.update", s._key, n, e, r) : Oe(this._dataReader, "WriteBatch.update", s._key, n),
5213
- this._mutations.push(i.toMutation(s._key, vn.exists(!0))), this;
5225
+ return i = "string" == typeof (n = getModularInstance(n)) || n instanceof _e ? Le(this._dataReader, "WriteBatch.update", s._key, n, e, r) : Ce(this._dataReader, "WriteBatch.update", s._key, n),
5226
+ this._mutations.push(i.toMutation(s._key, En.exists(!0))), this;
5214
5227
  }
5215
5228
  /**
5216
5229
  * Deletes the document referred to by the provided {@link DocumentReference}.
@@ -5219,8 +5232,8 @@ function Tr(t, n, e, ...r) {
5219
5232
  * @returns This `WriteBatch` instance. Used for chaining method calls.
5220
5233
  */ delete(t) {
5221
5234
  this._verifyNotCommitted();
5222
- const n = Fr(t, this._firestore);
5223
- return this._mutations = this._mutations.concat(new An(n._key, vn.none())), this;
5235
+ const n = Sr(t, this._firestore);
5236
+ return this._mutations = this._mutations.concat(new Pn(n._key, En.none())), this;
5224
5237
  }
5225
5238
  /**
5226
5239
  * Commits all of the writes in this write batch as a single atomic unit.
@@ -5237,12 +5250,12 @@ function Tr(t, n, e, ...r) {
5237
5250
  return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
5238
5251
  }
5239
5252
  _verifyNotCommitted() {
5240
- if (this._committed) throw new L($, "A write batch can no longer be used after commit() has been called.");
5253
+ if (this._committed) throw new U(F, "A write batch can no longer be used after commit() has been called.");
5241
5254
  }
5242
5255
  }
5243
5256
 
5244
- function Fr(t, n) {
5245
- if ((t = getModularInstance(t)).firestore !== n) throw new L(I, "Provided document reference is from a different Firestore instance.");
5257
+ function Sr(t, n) {
5258
+ if ((t = getModularInstance(t)).firestore !== n) throw new U(A, "Provided document reference is from a different Firestore instance.");
5246
5259
  return t;
5247
5260
  }
5248
5261
 
@@ -5258,9 +5271,9 @@ function Fr(t, n) {
5258
5271
  *
5259
5272
  * @returns A `WriteBatch` that can be used to atomically execute multiple
5260
5273
  * writes.
5261
- */ function Sr(t) {
5262
- const n = ee(t = it(t, se));
5263
- return new $r(t, (t => Xn(n, t)));
5274
+ */ function xr(t) {
5275
+ const n = re(t = ot(t, ie));
5276
+ return new Fr(t, (t => Zn(n, t)));
5264
5277
  }
5265
5278
 
5266
5279
  /**
@@ -5301,8 +5314,8 @@ function Fr(t, n) {
5301
5314
  this.writtenDocs = new Set;
5302
5315
  }
5303
5316
  async lookup(t) {
5304
- if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new L(I, "Firestore transactions require all reads to be executed before all writes.");
5305
- const n = await Zn(this.datastore, t);
5317
+ if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new U(A, "Firestore transactions require all reads to be executed before all writes.");
5318
+ const n = await te(this.datastore, t);
5306
5319
  return n.forEach((t => this.recordVersion(t))), n;
5307
5320
  }
5308
5321
  set(t, n) {
@@ -5317,7 +5330,7 @@ function Fr(t, n) {
5317
5330
  this.writtenDocs.add(t.toString());
5318
5331
  }
5319
5332
  delete(t) {
5320
- this.write(new An(t, this.precondition(t))), this.writtenDocs.add(t.toString());
5333
+ this.write(new Pn(t, this.precondition(t))), this.writtenDocs.add(t.toString());
5321
5334
  }
5322
5335
  async commit() {
5323
5336
  if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError;
@@ -5329,22 +5342,22 @@ function Fr(t, n) {
5329
5342
  // For each document that was read but not written to, we want to perform
5330
5343
  // a `verify` operation.
5331
5344
  t.forEach(((t, n) => {
5332
- const e = tt.fromPath(n);
5333
- this.mutations.push(new Pn(e, this.precondition(e)));
5334
- })), await Xn(this.datastore, this.mutations), this.committed = !0;
5345
+ const e = nt.fromPath(n);
5346
+ this.mutations.push(new Rn(e, this.precondition(e)));
5347
+ })), await Zn(this.datastore, this.mutations), this.committed = !0;
5335
5348
  }
5336
5349
  recordVersion(t) {
5337
5350
  let n;
5338
5351
  if (t.isFoundDocument()) n = t.version; else {
5339
- if (!t.isNoDocument()) throw _();
5352
+ if (!t.isNoDocument()) throw g();
5340
5353
  // For deleted docs, we must use baseVersion 0 when we overwrite them.
5341
- n = gt.min();
5354
+ n = bt.min();
5342
5355
  }
5343
5356
  const e = this.readVersions.get(t.key.toString());
5344
5357
  if (e) {
5345
5358
  if (!n.isEqual(e))
5346
5359
  // This transaction will fail no matter what.
5347
- throw new L(F, "Document version changed between two reads.");
5360
+ throw new U(S, "Document version changed between two reads.");
5348
5361
  } else this.readVersions.set(t.key.toString(), n);
5349
5362
  }
5350
5363
  /**
@@ -5352,7 +5365,7 @@ function Fr(t, n) {
5352
5365
  * as a precondition, or no precondition if it was not read.
5353
5366
  */ precondition(t) {
5354
5367
  const n = this.readVersions.get(t.toString());
5355
- return !this.writtenDocs.has(t.toString()) && n ? vn.updateTime(n) : vn.none();
5368
+ return !this.writtenDocs.has(t.toString()) && n ? En.updateTime(n) : En.none();
5356
5369
  }
5357
5370
  /**
5358
5371
  * Returns the precondition for a document if the operation is an update.
@@ -5361,7 +5374,7 @@ function Fr(t, n) {
5361
5374
  // The first time a document is written, we want to take into account the
5362
5375
  // read time and existence
5363
5376
  if (!this.writtenDocs.has(t.toString()) && n) {
5364
- if (n.isEqual(gt.min()))
5377
+ if (n.isEqual(bt.min()))
5365
5378
  // The document doesn't exist, so fail the transaction.
5366
5379
  // This has to be validated locally because you can't send a
5367
5380
  // precondition that a document does not exist without changing the
@@ -5371,13 +5384,13 @@ function Fr(t, n) {
5371
5384
  // express that to the backend, we have to validate locally.
5372
5385
  // Note: this can change once we can send separate verify writes in the
5373
5386
  // transaction.
5374
- throw new L(I, "Can't update a document that doesn't exist.");
5387
+ throw new U(A, "Can't update a document that doesn't exist.");
5375
5388
  // Document exists, base precondition on document update time.
5376
- return vn.updateTime(n);
5389
+ return En.updateTime(n);
5377
5390
  }
5378
5391
  // Document was not read, so we just use the preconditions for a blind
5379
5392
  // update.
5380
- return vn.exists(!0);
5393
+ return En.exists(!0);
5381
5394
  }
5382
5395
  write(t) {
5383
5396
  this.ensureCommitNotCalled(), this.mutations.push(t);
@@ -5405,10 +5418,10 @@ function Fr(t, n) {
5405
5418
  * TransactionRunner encapsulates the logic needed to run and retry transactions
5406
5419
  * with backoff.
5407
5420
  */
5408
- class xr {
5421
+ class Or {
5409
5422
  constructor(t, n, e, r) {
5410
5423
  this.asyncQueue = t, this.datastore = n, this.updateFunction = e, this.deferred = r,
5411
- this.Tt = 5, this.It = new Kn(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
5424
+ this.Tt = 5, this.It = new Jn(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
5412
5425
  }
5413
5426
  /** Runs the transaction and sets the result on deferred. */ run() {
5414
5427
  this.Tt -= 1, this.At();
@@ -5430,7 +5443,7 @@ class xr {
5430
5443
  Pt(t) {
5431
5444
  try {
5432
5445
  const n = this.updateFunction(t);
5433
- return !ut(n) && n.catch && n.then ? n : (this.deferred.reject(Error("Transaction callback must return a Promise")),
5446
+ return !ct(n) && n.catch && n.then ? n : (this.deferred.reject(Error("Transaction callback must return a Promise")),
5434
5447
  null);
5435
5448
  } catch (t) {
5436
5449
  // Do not retry errors thrown by user provided updateFunction.
@@ -5456,31 +5469,31 @@ class xr {
5456
5469
  function(t) {
5457
5470
  switch (t) {
5458
5471
  default:
5459
- return _();
5472
+ return g();
5460
5473
 
5461
- case E:
5462
5474
  case T:
5463
- case A:
5464
- case N:
5465
- case x:
5475
+ case I:
5476
+ case P:
5477
+ case $:
5466
5478
  case O:
5479
+ case C:
5467
5480
  // Unauthenticated means something went wrong with our token and we need
5468
5481
  // to retry with new credentials which will happen automatically.
5469
- case D:
5482
+ case N:
5470
5483
  return !1;
5471
5484
 
5472
- case I:
5473
- case P:
5485
+ case A:
5474
5486
  case R:
5475
5487
  case V:
5476
- case $:
5488
+ case D:
5489
+ case F:
5477
5490
  // Aborted might be retried in some scenarios, but that is dependant on
5478
5491
  // the context and should handled individually by the calling code.
5479
5492
  // See https://cloud.google.com/apis/design/errors.
5480
- case F:
5481
- case S:
5493
+ case S:
5494
+ case x:
5482
5495
  case q:
5483
- case C:
5496
+ case L:
5484
5497
  return !0;
5485
5498
  }
5486
5499
  }(n);
@@ -5505,7 +5518,7 @@ class xr {
5505
5518
  * See the License for the specific language governing permissions and
5506
5519
  * limitations under the License.
5507
5520
  */
5508
- /** The Platform's 'document' implementation or null if not available. */ function Or() {
5521
+ /** The Platform's 'document' implementation or null if not available. */ function Cr() {
5509
5522
  // `document` is not always available, e.g. in ReactNative and WebWorkers.
5510
5523
  // eslint-disable-next-line no-restricted-globals
5511
5524
  return "undefined" != typeof document ? document : null;
@@ -5537,10 +5550,10 @@ class xr {
5537
5550
  * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type
5538
5551
  * in newer versions of TypeScript defines `finally`, which is not available in
5539
5552
  * IE.
5540
- */ class Cr {
5553
+ */ class Lr {
5541
5554
  constructor(t, n, e, r, s) {
5542
5555
  this.asyncQueue = t, this.timerId = n, this.targetTimeMs = e, this.op = r, this.removalCallback = s,
5543
- this.deferred = new U, this.then = this.deferred.promise.then.bind(this.deferred.promise),
5556
+ this.deferred = new k, this.then = this.deferred.promise.then.bind(this.deferred.promise),
5544
5557
  // It's normal for the deferred promise to be canceled (due to cancellation)
5545
5558
  // and so we attach a dummy catch callback to avoid
5546
5559
  // 'UnhandledPromiseRejectionWarning' log spam.
@@ -5560,7 +5573,7 @@ class xr {
5560
5573
  * PORTING NOTE: This exists to prevent making removeDelayedOperation() and
5561
5574
  * the DelayedOperation class public.
5562
5575
  */ static createAndSchedule(t, n, e, r, s) {
5563
- const i = Date.now() + e, o = new Cr(t, n, i, r, s);
5576
+ const i = Date.now() + e, o = new Lr(t, n, i, r, s);
5564
5577
  return o.start(e), o;
5565
5578
  }
5566
5579
  /**
@@ -5582,7 +5595,7 @@ class xr {
5582
5595
  * As long as the operation has not yet been run, calling cancel() provides a
5583
5596
  * guarantee that the operation will not be run.
5584
5597
  */ cancel(t) {
5585
- null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new L(E, "Operation cancelled" + (t ? ": " + t : ""))));
5598
+ null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new U(T, "Operation cancelled" + (t ? ": " + t : ""))));
5586
5599
  }
5587
5600
  handleDelayElapsed() {
5588
5601
  this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(),
@@ -5609,7 +5622,7 @@ class xr {
5609
5622
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5610
5623
  * See the License for the specific language governing permissions and
5611
5624
  * limitations under the License.
5612
- */ class Lr {
5625
+ */ class Ur {
5613
5626
  constructor() {
5614
5627
  // The last promise in the queue.
5615
5628
  this.Dt = Promise.resolve(),
@@ -5626,21 +5639,21 @@ class xr {
5626
5639
  this.St = null,
5627
5640
  // Flag set while there's an outstanding AsyncQueue operation, used for
5628
5641
  // assertion sanity-checks.
5629
- this.qt = !1,
5630
- // Enabled during shutdown on Safari to prevent future access to IndexedDB.
5631
5642
  this.xt = !1,
5643
+ // Enabled during shutdown on Safari to prevent future access to IndexedDB.
5644
+ this.qt = !1,
5632
5645
  // List of TimerIds to fast-forward delays for.
5633
5646
  this.Ot = [],
5634
5647
  // Backoff timer used to schedule retries for retryable operations
5635
- this.It = new Kn(this, "async_queue_retry" /* AsyncQueueRetry */),
5648
+ this.It = new Jn(this, "async_queue_retry" /* AsyncQueueRetry */),
5636
5649
  // Visibility handler that triggers an immediate retry of all retryable
5637
5650
  // operations. Meant to speed up recovery when we regain file system access
5638
5651
  // after page comes into foreground.
5639
5652
  this.Ct = () => {
5640
- const t = Or();
5641
- t && w("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.It.H();
5653
+ const t = Cr();
5654
+ t && m("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.It.H();
5642
5655
  };
5643
- const t = Or();
5656
+ const t = Cr();
5644
5657
  t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.Ct);
5645
5658
  }
5646
5659
  get isShuttingDown() {
@@ -5660,8 +5673,8 @@ class xr {
5660
5673
  }
5661
5674
  enterRestrictedMode(t) {
5662
5675
  if (!this.$t) {
5663
- this.$t = !0, this.xt = t || !1;
5664
- const n = Or();
5676
+ this.$t = !0, this.qt = t || !1;
5677
+ const n = Cr();
5665
5678
  n && "function" == typeof n.removeEventListener && n.removeEventListener("visibilitychange", this.Ct);
5666
5679
  }
5667
5680
  }
@@ -5672,8 +5685,8 @@ class xr {
5672
5685
  // Create a deferred Promise that we can return to the callee. This
5673
5686
  // allows us to return a "hanging Promise" only to the callee and still
5674
5687
  // advance the queue even when the operation is not run.
5675
- const n = new U;
5676
- return this.Ut((() => this.$t && this.xt ? Promise.resolve() : (t().then(n.resolve, n.reject),
5688
+ const n = new k;
5689
+ return this.Ut((() => this.$t && this.qt ? Promise.resolve() : (t().then(n.resolve, n.reject),
5677
5690
  n.promise))).then((() => n.promise));
5678
5691
  }
5679
5692
  enqueueRetryable(t) {
@@ -5727,7 +5740,7 @@ class xr {
5727
5740
  * limitations under the License.
5728
5741
  */ (t)) throw t;
5729
5742
  // Failure will be handled by AsyncQueue
5730
- w("AsyncQueue", "Operation failed with retryable error: " + t);
5743
+ m("AsyncQueue", "Operation failed with retryable error: " + t);
5731
5744
  }
5732
5745
  this.Nt.length > 0 &&
5733
5746
  // If there are additional operations, we re-schedule `retryNextOp()`.
@@ -5744,8 +5757,8 @@ class xr {
5744
5757
  }
5745
5758
  }
5746
5759
  Ut(t) {
5747
- const n = this.Dt.then((() => (this.qt = !0, t().catch((t => {
5748
- this.St = t, this.qt = !1;
5760
+ const n = this.Dt.then((() => (this.xt = !0, t().catch((t => {
5761
+ this.St = t, this.xt = !1;
5749
5762
  const n =
5750
5763
  /**
5751
5764
  * Chrome includes Error.message in Error.stack. Other browsers do not.
@@ -5785,19 +5798,19 @@ class xr {
5785
5798
  // Re-throw the error so that this.tail becomes a rejected Promise and
5786
5799
  // all further attempts to chain (via .then) will just short-circuit
5787
5800
  // and return the rejected Promise.
5788
- throw m("INTERNAL UNHANDLED ERROR: ", n), t;
5789
- })).then((t => (this.qt = !1, t))))));
5801
+ throw p("INTERNAL UNHANDLED ERROR: ", n), t;
5802
+ })).then((t => (this.xt = !1, t))))));
5790
5803
  return this.Dt = n, n;
5791
5804
  }
5792
5805
  enqueueAfterDelay(t, n, e) {
5793
5806
  this.Lt(),
5794
5807
  // Fast-forward delays for timerIds that have been overriden.
5795
5808
  this.Ot.indexOf(t) > -1 && (n = 0);
5796
- const r = Cr.createAndSchedule(this, t, n, e, (t => this.jt(t)));
5809
+ const r = Lr.createAndSchedule(this, t, n, e, (t => this.jt(t)));
5797
5810
  return this.Ft.push(r), r;
5798
5811
  }
5799
5812
  Lt() {
5800
- this.St && _();
5813
+ this.St && g();
5801
5814
  }
5802
5815
  verifyOperationInProgress() {}
5803
5816
  /**
@@ -5847,10 +5860,10 @@ class xr {
5847
5860
  }
5848
5861
  }
5849
5862
 
5850
- class Ur {
5863
+ class kr {
5851
5864
  /** @hideconstructor */
5852
5865
  constructor(t, n) {
5853
- this._firestore = t, this._transaction = n, this._dataReader = Ve(t);
5866
+ this._firestore = t, this._transaction = n, this._dataReader = De(t);
5854
5867
  }
5855
5868
  /**
5856
5869
  * Reads the document referenced by the provided {@link DocumentReference}.
@@ -5858,25 +5871,25 @@ class Ur {
5858
5871
  * @param documentRef - A reference to the document to be read.
5859
5872
  * @returns A `DocumentSnapshot` with the read data.
5860
5873
  */ get(t) {
5861
- const n = Fr(t, this._firestore), e = new gr(this._firestore);
5874
+ const n = Sr(t, this._firestore), e = new br(this._firestore);
5862
5875
  return this._transaction.lookup([ n._key ]).then((t => {
5863
- if (!t || 1 !== t.length) return _();
5876
+ if (!t || 1 !== t.length) return g();
5864
5877
  const r = t[0];
5865
- if (r.isFoundDocument()) return new Ye(this._firestore, e, r.key, r, n.converter);
5866
- if (r.isNoDocument()) return new Ye(this._firestore, e, n._key, null, n.converter);
5867
- throw _();
5878
+ if (r.isFoundDocument()) return new He(this._firestore, e, r.key, r, n.converter);
5879
+ if (r.isNoDocument()) return new He(this._firestore, e, n._key, null, n.converter);
5880
+ throw g();
5868
5881
  }));
5869
5882
  }
5870
5883
  set(t, n, e) {
5871
- const r = Fr(t, this._firestore), s = _r(r.converter, n, e), i = De(this._dataReader, "Transaction.set", r._key, s, null !== r.converter, e);
5884
+ const r = Sr(t, this._firestore), s = gr(r.converter, n, e), i = Ne(this._dataReader, "Transaction.set", r._key, s, null !== r.converter, e);
5872
5885
  return this._transaction.set(r._key, i), this;
5873
5886
  }
5874
5887
  update(t, n, e, ...r) {
5875
- const s = Fr(t, this._firestore);
5888
+ const s = Sr(t, this._firestore);
5876
5889
  // For Compat types, we have to "extract" the underlying types before
5877
5890
  // performing validation.
5878
5891
  let i;
5879
- return i = "string" == typeof (n = getModularInstance(n)) || n instanceof ye ? Ce(this._dataReader, "Transaction.update", s._key, n, e, r) : Oe(this._dataReader, "Transaction.update", s._key, n),
5892
+ return i = "string" == typeof (n = getModularInstance(n)) || n instanceof _e ? Le(this._dataReader, "Transaction.update", s._key, n, e, r) : Ce(this._dataReader, "Transaction.update", s._key, n),
5880
5893
  this._transaction.update(s._key, i), this;
5881
5894
  }
5882
5895
  /**
@@ -5885,7 +5898,7 @@ class Ur {
5885
5898
  * @param documentRef - A reference to the document to be deleted.
5886
5899
  * @returns This `Transaction` instance. Used for chaining method calls.
5887
5900
  */ delete(t) {
5888
- const n = Fr(t, this._firestore);
5901
+ const n = Sr(t, this._firestore);
5889
5902
  return this._transaction.delete(n._key), this;
5890
5903
  }
5891
5904
  }
@@ -5906,9 +5919,9 @@ class Ur {
5906
5919
  * (the `updateFunction` returned a failed promise), the promise returned by the
5907
5920
  * `updateFunction `is returned here. Otherwise, if the transaction failed, a
5908
5921
  * rejected promise with the corresponding failure error is returned.
5909
- */ function kr(t, n) {
5910
- const e = ee(t = it(t, se)), r = new U;
5911
- return new xr(new Lr, e, (e => n(new Ur(t, e))), r).run(), r.promise;
5922
+ */ function jr(t, n) {
5923
+ const e = re(t = ot(t, ie)), r = new k;
5924
+ return new Or(new Ur, e, (e => n(new kr(t, e))), r).run(), r.promise;
5912
5925
  }
5913
5926
 
5914
5927
  /**
@@ -5919,13 +5932,13 @@ class Ur {
5919
5932
  * directly to the backend, and `onSnapshot()` APIs are not supported.
5920
5933
  * @packageDocumentation
5921
5934
  */ !function(t) {
5922
- l = t;
5935
+ f = t;
5923
5936
  }(`${SDK_VERSION}_lite`), _registerComponent(new Component("firestore/lite", ((t, {options: n}) => {
5924
- const e = t.getProvider("app").getImmediate(), r = new se(e, new B(t.getProvider("auth-internal")), new W(t.getProvider("app-check-internal")));
5937
+ const e = t.getProvider("app").getImmediate(), r = new ie(e, new z(t.getProvider("auth-internal")), new Y(t.getProvider("app-check-internal")));
5925
5938
  return n && r._setSettings(n), r;
5926
- }), "PUBLIC" /* PUBLIC */)),
5939
+ }), "PUBLIC")),
5927
5940
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
5928
- registerVersion("firestore-lite", "3.4.0", ""), registerVersion("firestore-lite", "3.4.0", "esm2017");
5941
+ registerVersion("firestore-lite", "3.4.1-canary.0b385f18c", ""), registerVersion("firestore-lite", "3.4.1-canary.0b385f18c", "esm2017");
5929
5942
 
5930
- export { ge as Bytes, le as CollectionReference, ae as DocumentReference, Ye as DocumentSnapshot, ye as FieldPath, be as FieldValue, se as Firestore, L as FirestoreError, ve as GeoPoint, he as Query, Ze as QueryConstraint, He as QueryDocumentSnapshot, Ke as QuerySnapshot, _t as Timestamp, Ur as Transaction, $r as WriteBatch, Ar as addDoc, Dr as arrayRemove, Vr as arrayUnion, fe as collection, de as collectionGroup, ue as connectFirestoreEmulator, Ir as deleteDoc, Pr as deleteField, we as doc, _e as documentId, dr as endAt, fr as endBefore, br as getDoc, vr as getDocs, oe as getFirestore, Nr as increment, ie as initializeFirestore, or as limit, ur as limitToLast, sr as orderBy, tr as query, pe as queryEqual, me as refEqual, kr as runTransaction, Rr as serverTimestamp, Er as setDoc, d as setLogLevel, Je as snapshotEqual, hr as startAfter, ar as startAt, ce as terminate, Tr as updateDoc, er as where, Sr as writeBatch };
5943
+ export { be as Bytes, fe as CollectionReference, he as DocumentReference, He as DocumentSnapshot, _e as FieldPath, ve as FieldValue, ie as Firestore, U as FirestoreError, Ee as GeoPoint, le as Query, tr as QueryConstraint, Ke as QueryDocumentSnapshot, Je as QuerySnapshot, gt as Timestamp, kr as Transaction, Fr as WriteBatch, Pr as addDoc, Nr as arrayRemove, Dr as arrayUnion, de as collection, we as collectionGroup, ce as connectFirestoreEmulator, Ar as deleteDoc, Rr as deleteField, me as doc, ge as documentId, wr as endAt, dr as endBefore, vr as getDoc, Er as getDocs, ue as getFirestore, $r as increment, oe as initializeFirestore, ur as limit, cr as limitToLast, ir as orderBy, nr as query, ye as queryEqual, pe as refEqual, jr as runTransaction, Vr as serverTimestamp, Tr as setDoc, w as setLogLevel, Xe as snapshotEqual, lr as startAfter, hr as startAt, ae as terminate, Ir as updateDoc, rr as where, xr as writeBatch };
5931
5944
  //# sourceMappingURL=index.browser.esm2017.js.map