@firebase/firestore 4.6.2-canary.8fb372afb → 4.6.2-dataconnect-preview.877f8b7d0

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.
@@ -3,6 +3,8 @@ import { Component } from '@firebase/component';
3
3
  import { Logger, LogLevel } from '@firebase/logger';
4
4
  import { FirebaseError, getDefaultEmulatorHostnameAndPort, createMockUserToken, getModularInstance, deepEqual } from '@firebase/util';
5
5
 
6
+ const d = "4.6.2-dataconnect-preview.877f8b7d0";
7
+
6
8
  /**
7
9
  * @license
8
10
  * Copyright 2017 Google LLC
@@ -22,8 +24,7 @@ import { FirebaseError, getDefaultEmulatorHostnameAndPort, createMockUserToken,
22
24
  /**
23
25
  * Simple wrapper around a nullable UID. Mostly exists to make code more
24
26
  * readable.
25
- */
26
- class User {
27
+ */ class User {
27
28
  constructor(t) {
28
29
  this.uid = t;
29
30
  }
@@ -63,7 +64,7 @@ User.MOCK_USER = new User("mock-user");
63
64
  * See the License for the specific language governing permissions and
64
65
  * limitations under the License.
65
66
  */
66
- let d = "10.12.0-canary.8fb372afb";
67
+ let f = "10.12.0-dataconnect-preview.877f8b7d0";
67
68
 
68
69
  /**
69
70
  * @license
@@ -81,7 +82,7 @@ let d = "10.12.0-canary.8fb372afb";
81
82
  * See the License for the specific language governing permissions and
82
83
  * limitations under the License.
83
84
  */
84
- const f = new Logger("@firebase/firestore");
85
+ const E = new Logger("@firebase/firestore");
85
86
 
86
87
  /**
87
88
  * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).
@@ -96,29 +97,29 @@ const f = new Logger("@firebase/firestore");
96
97
  * <li><code>`silent` to turn off logging.</li>
97
98
  * </ul>
98
99
  */ function setLogLevel(t) {
99
- f.setLogLevel(t);
100
+ E.setLogLevel(t);
100
101
  }
101
102
 
102
103
  function __PRIVATE_logDebug(t, ...e) {
103
- if (f.logLevel <= LogLevel.DEBUG) {
104
+ if (E.logLevel <= LogLevel.DEBUG) {
104
105
  const r = e.map(__PRIVATE_argToString);
105
- f.debug(`Firestore (${d}): ${t}`, ...r);
106
+ E.debug(`Firestore (${f}): ${t}`, ...r);
106
107
  }
107
108
  }
108
109
 
109
110
  function __PRIVATE_logError(t, ...e) {
110
- if (f.logLevel <= LogLevel.ERROR) {
111
+ if (E.logLevel <= LogLevel.ERROR) {
111
112
  const r = e.map(__PRIVATE_argToString);
112
- f.error(`Firestore (${d}): ${t}`, ...r);
113
+ E.error(`Firestore (${f}): ${t}`, ...r);
113
114
  }
114
115
  }
115
116
 
116
117
  /**
117
118
  * @internal
118
119
  */ function __PRIVATE_logWarn(t, ...e) {
119
- if (f.logLevel <= LogLevel.WARN) {
120
+ if (E.logLevel <= LogLevel.WARN) {
120
121
  const r = e.map(__PRIVATE_argToString);
121
- f.warn(`Firestore (${d}): ${t}`, ...r);
122
+ E.warn(`Firestore (${f}): ${t}`, ...r);
122
123
  }
123
124
  }
124
125
 
@@ -179,7 +180,7 @@ function __PRIVATE_logError(t, ...e) {
179
180
  */ function fail(t = "Unexpected state") {
180
181
  // Log the failure in addition to throw an exception, just in case the
181
182
  // exception is swallowed.
182
- const e = `FIRESTORE (${d}) INTERNAL ASSERTION FAILED: ` + t;
183
+ const e = `FIRESTORE (${f}) INTERNAL ASSERTION FAILED: ` + t;
183
184
  // NOTE: We don't use FirestoreError here because these are internal failures
184
185
  // that cannot be handled by the user. (Also it would create a circular
185
186
  // dependency between the error and assert modules which doesn't work.)
@@ -219,7 +220,7 @@ e) {
219
220
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
220
221
  * See the License for the specific language governing permissions and
221
222
  * limitations under the License.
222
- */ const E = "ok", m = "cancelled", A = "unknown", T = "invalid-argument", R = "deadline-exceeded", P = "not-found", I = "already-exists", V = "permission-denied", p = "unauthenticated", y = "resource-exhausted", w = "failed-precondition", g = "aborted", F = "out-of-range", v = "unimplemented", D = "internal", b = "unavailable", C = "data-loss";
223
+ */ const m = "ok", A = "cancelled", T = "unknown", R = "invalid-argument", P = "deadline-exceeded", I = "not-found", V = "already-exists", p = "permission-denied", y = "unauthenticated", w = "resource-exhausted", g = "failed-precondition", F = "aborted", v = "out-of-range", D = "unimplemented", b = "internal", C = "unavailable", S = "data-loss";
223
224
 
224
225
  /** An error returned by a Firestore operation. */ class FirestoreError extends FirebaseError {
225
226
  /** @hideconstructor */
@@ -576,7 +577,7 @@ class BasePath {
576
577
  // for legacy reasons and should not be used frequently).
577
578
  const e = [];
578
579
  for (const r of t) {
579
- if (r.indexOf("//") >= 0) throw new FirestoreError(T, `Invalid segment (${r}). Paths must not contain // in them.`);
580
+ if (r.indexOf("//") >= 0) throw new FirestoreError(R, `Invalid segment (${r}). Paths must not contain // in them.`);
580
581
  // Strip leading and traling slashed.
581
582
  e.push(...r.split("/").filter((t => t.length > 0)));
582
583
  }
@@ -587,7 +588,7 @@ class BasePath {
587
588
  }
588
589
  }
589
590
 
590
- const S = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
591
+ const N = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
591
592
 
592
593
  /**
593
594
  * A dot-separated path for navigating sub-objects within a document.
@@ -600,7 +601,7 @@ const S = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
600
601
  * Returns true if the string could be used as a segment in a field path
601
602
  * without escaping.
602
603
  */ static isValidIdentifier(t) {
603
- return S.test(t);
604
+ return N.test(t);
604
605
  }
605
606
  canonicalString() {
606
607
  return this.toArray().map((t => (t = t.replace(/\\/g, "\\\\").replace(/`/g, "\\`"),
@@ -632,21 +633,21 @@ const S = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
632
633
  const e = [];
633
634
  let r = "", n = 0;
634
635
  const __PRIVATE_addCurrentSegment = () => {
635
- if (0 === r.length) throw new FirestoreError(T, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
636
+ if (0 === r.length) throw new FirestoreError(R, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
636
637
  e.push(r), r = "";
637
638
  };
638
639
  let i = !1;
639
640
  for (;n < t.length; ) {
640
641
  const e = t[n];
641
642
  if ("\\" === e) {
642
- if (n + 1 === t.length) throw new FirestoreError(T, "Path has trailing escape character: " + t);
643
+ if (n + 1 === t.length) throw new FirestoreError(R, "Path has trailing escape character: " + t);
643
644
  const e = t[n + 1];
644
- if ("\\" !== e && "." !== e && "`" !== e) throw new FirestoreError(T, "Path has invalid escape sequence: " + t);
645
+ if ("\\" !== e && "." !== e && "`" !== e) throw new FirestoreError(R, "Path has invalid escape sequence: " + t);
645
646
  r += e, n += 2;
646
647
  } else "`" === e ? (i = !i, n++) : "." !== e || i ? (r += e, n++) : (__PRIVATE_addCurrentSegment(),
647
648
  n++);
648
649
  }
649
- if (__PRIVATE_addCurrentSegment(), i) throw new FirestoreError(T, "Unterminated ` in path: " + t);
650
+ if (__PRIVATE_addCurrentSegment(), i) throw new FirestoreError(R, "Unterminated ` in path: " + t);
650
651
  return new FieldPath$1(e);
651
652
  }
652
653
  static emptyPath() {
@@ -735,7 +736,7 @@ const S = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
735
736
  * See the License for the specific language governing permissions and
736
737
  * limitations under the License.
737
738
  */ function __PRIVATE_validateNonEmptyArgument(t, e, r) {
738
- if (!r) throw new FirestoreError(T, `Function ${t}() cannot be called with an empty ${e}.`);
739
+ if (!r) throw new FirestoreError(R, `Function ${t}() cannot be called with an empty ${e}.`);
739
740
  }
740
741
 
741
742
  /**
@@ -747,14 +748,14 @@ const S = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
747
748
  * an even numbers of segments).
748
749
  */
749
750
  function __PRIVATE_validateDocumentPath(t) {
750
- if (!DocumentKey.isDocumentKey(t)) throw new FirestoreError(T, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);
751
+ if (!DocumentKey.isDocumentKey(t)) throw new FirestoreError(R, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);
751
752
  }
752
753
 
753
754
  /**
754
755
  * Validates that `path` refers to a collection (indicated by the fact it
755
756
  * contains an odd numbers of segments).
756
757
  */ function __PRIVATE_validateCollectionPath(t) {
757
- if (DocumentKey.isDocumentKey(t)) throw new FirestoreError(T, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);
758
+ if (DocumentKey.isDocumentKey(t)) throw new FirestoreError(R, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);
758
759
  }
759
760
 
760
761
  /**
@@ -798,17 +799,17 @@ e) {
798
799
  // Unwrap Compat types
799
800
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
800
801
  t = t._delegate), !(t instanceof e)) {
801
- if (e.name === t.constructor.name) throw new FirestoreError(T, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
802
+ if (e.name === t.constructor.name) throw new FirestoreError(R, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
802
803
  {
803
804
  const r = __PRIVATE_valueDescription(t);
804
- throw new FirestoreError(T, `Expected type '${e.name}', but it was: ${r}`);
805
+ throw new FirestoreError(R, `Expected type '${e.name}', but it was: ${r}`);
805
806
  }
806
807
  }
807
808
  return t;
808
809
  }
809
810
 
810
811
  function __PRIVATE_validatePositiveNumber(t, e) {
811
- if (e <= 0) throw new FirestoreError(T, `Function ${t}() requires a positive number, but it was: ${e}.`);
812
+ if (e <= 0) throw new FirestoreError(R, `Function ${t}() requires a positive number, but it was: ${e}.`);
812
813
  }
813
814
 
814
815
  /**
@@ -858,7 +859,7 @@ function __PRIVATE_cloneLongPollingOptions(t) {
858
859
  /**
859
860
  * The value returned from the most recent invocation of
860
861
  * `generateUniqueDebugId()`, or null if it has never been invoked.
861
- */ let N = null;
862
+ */ let O = null;
862
863
 
863
864
  /**
864
865
  * Generates and returns an initial value for `lastUniqueDebugId`.
@@ -883,9 +884,9 @@ function __PRIVATE_cloneLongPollingOptions(t) {
883
884
  * @return the 10-character generated ID (e.g. "0xa1b2c3d4").
884
885
  */
885
886
  function __PRIVATE_generateUniqueDebugId() {
886
- return null === N ? N = function __PRIVATE_generateInitialUniqueDebugId() {
887
+ return null === O ? O = function __PRIVATE_generateInitialUniqueDebugId() {
887
888
  return 268435456 + Math.round(2147483648 * Math.random());
888
- }() : N++, "0x" + N.toString(16);
889
+ }() : O++, "0x" + O.toString(16);
889
890
  }
890
891
 
891
892
  /**
@@ -936,7 +937,7 @@ function __PRIVATE_generateUniqueDebugId() {
936
937
  * See the License for the specific language governing permissions and
937
938
  * limitations under the License.
938
939
  */
939
- const O = {
940
+ const q = {
940
941
  BatchGetDocuments: "batchGet",
941
942
  Commit: "commit",
942
943
  RunQuery: "runQuery",
@@ -974,7 +975,7 @@ const O = {
974
975
  * are used for reverse lookups from the webchannel stream. Do NOT change the
975
976
  * names of these identifiers or change this into a const enum.
976
977
  */
977
- var q, B;
978
+ var B, $;
978
979
 
979
980
  /**
980
981
  * Converts an HTTP Status Code to the equivalent error code.
@@ -985,7 +986,7 @@ var q, B;
985
986
  */
986
987
  function __PRIVATE_mapCodeFromHttpStatus(t) {
987
988
  if (void 0 === t) return __PRIVATE_logError("RPC_ERROR", "HTTP error has no status"),
988
- A;
989
+ T;
989
990
  // The canonical error codes for Google APIs [1] specify mapping onto HTTP
990
991
  // status codes but the mapping is not bijective. In each case of ambiguity
991
992
  // this function chooses a primary error.
@@ -995,66 +996,66 @@ function __PRIVATE_mapCodeFromHttpStatus(t) {
995
996
  switch (t) {
996
997
  case 200:
997
998
  // OK
998
- return E;
999
+ return m;
999
1000
 
1000
1001
  case 400:
1001
1002
  // Bad Request
1002
- return w;
1003
+ return g;
1003
1004
 
1004
1005
  // Other possibilities based on the forward mapping
1005
1006
  // return Code.INVALID_ARGUMENT;
1006
1007
  // return Code.OUT_OF_RANGE;
1007
1008
  case 401:
1008
1009
  // Unauthorized
1009
- return p;
1010
+ return y;
1010
1011
 
1011
1012
  case 403:
1012
1013
  // Forbidden
1013
- return V;
1014
+ return p;
1014
1015
 
1015
1016
  case 404:
1016
1017
  // Not Found
1017
- return P;
1018
+ return I;
1018
1019
 
1019
1020
  case 409:
1020
1021
  // Conflict
1021
- return g;
1022
+ return F;
1022
1023
 
1023
1024
  // Other possibilities:
1024
1025
  // return Code.ALREADY_EXISTS;
1025
1026
  case 416:
1026
1027
  // Range Not Satisfiable
1027
- return F;
1028
+ return v;
1028
1029
 
1029
1030
  case 429:
1030
1031
  // Too Many Requests
1031
- return y;
1032
+ return w;
1032
1033
 
1033
1034
  case 499:
1034
1035
  // Client Closed Request
1035
- return m;
1036
+ return A;
1036
1037
 
1037
1038
  case 500:
1038
1039
  // Internal Server Error
1039
- return A;
1040
+ return T;
1040
1041
 
1041
1042
  // Other possibilities:
1042
1043
  // return Code.INTERNAL;
1043
1044
  // return Code.DATA_LOSS;
1044
1045
  case 501:
1045
1046
  // Unimplemented
1046
- return v;
1047
+ return D;
1047
1048
 
1048
1049
  case 503:
1049
1050
  // Service Unavailable
1050
- return b;
1051
+ return C;
1051
1052
 
1052
1053
  case 504:
1053
1054
  // Gateway Timeout
1054
- return R;
1055
+ return P;
1055
1056
 
1056
1057
  default:
1057
- return t >= 200 && t < 300 ? E : t >= 400 && t < 500 ? w : t >= 500 && t < 600 ? D : A;
1058
+ return t >= 200 && t < 300 ? m : t >= 400 && t < 500 ? g : t >= 500 && t < 600 ? b : T;
1058
1059
  }
1059
1060
  }
1060
1061
 
@@ -1077,13 +1078,13 @@ function __PRIVATE_mapCodeFromHttpStatus(t) {
1077
1078
  /**
1078
1079
  * A Rest-based connection that relies on the native HTTP stack
1079
1080
  * (e.g. `fetch` or a polyfill).
1080
- */ (B = q || (q = {}))[B.OK = 0] = "OK", B[B.CANCELLED = 1] = "CANCELLED", B[B.UNKNOWN = 2] = "UNKNOWN",
1081
- B[B.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT", B[B.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED",
1082
- B[B.NOT_FOUND = 5] = "NOT_FOUND", B[B.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", B[B.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
1083
- B[B.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", B[B.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
1084
- B[B.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", B[B.ABORTED = 10] = "ABORTED",
1085
- B[B.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", B[B.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
1086
- B[B.INTERNAL = 13] = "INTERNAL", B[B.UNAVAILABLE = 14] = "UNAVAILABLE", B[B.DATA_LOSS = 15] = "DATA_LOSS";
1081
+ */ ($ = B || (B = {}))[$.OK = 0] = "OK", $[$.CANCELLED = 1] = "CANCELLED", $[$.UNKNOWN = 2] = "UNKNOWN",
1082
+ $[$.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT", $[$.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED",
1083
+ $[$.NOT_FOUND = 5] = "NOT_FOUND", $[$.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", $[$.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
1084
+ $[$.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", $[$.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
1085
+ $[$.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", $[$.ABORTED = 10] = "ABORTED",
1086
+ $[$.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", $[$.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
1087
+ $[$.INTERNAL = 13] = "INTERNAL", $[$.UNAVAILABLE = 14] = "UNAVAILABLE", $[$.DATA_LOSS = 15] = "DATA_LOSS";
1087
1088
 
1088
1089
  class __PRIVATE_FetchConnection extends
1089
1090
  /**
@@ -1127,7 +1128,7 @@ class __PRIVATE_RestConnection {
1127
1128
  // SDK_VERSION is updated to different value at runtime depending on the entry point,
1128
1129
  // so we need to get its value when we need it in a function.
1129
1130
  function __PRIVATE_getGoogApiClientValue() {
1130
- return "gl-js/ fire/" + d;
1131
+ return "gl-js/ fire/" + f;
1131
1132
  }(),
1132
1133
  // Content-Type: text/plain will avoid preflight requests which might
1133
1134
  // mess with CORS and redirects by proxies. If we add custom headers
@@ -1137,7 +1138,7 @@ class __PRIVATE_RestConnection {
1137
1138
  e && e.headers.forEach(((e, r) => t[r] = e)), r && r.headers.forEach(((e, r) => t[r] = e));
1138
1139
  }
1139
1140
  I(t, e) {
1140
- const r = O[t];
1141
+ const r = q[t];
1141
1142
  return `${this.m}/v1/${e}:${r}`;
1142
1143
  }
1143
1144
  /**
@@ -1483,7 +1484,7 @@ class ByteString {
1483
1484
 
1484
1485
  ByteString.EMPTY_BYTE_STRING = new ByteString("");
1485
1486
 
1486
- const $ = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1487
+ const Q = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1487
1488
 
1488
1489
  /**
1489
1490
  * Converts the possible Proto values for a timestamp value into a "seconds and
@@ -1497,7 +1498,7 @@ const $ = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1497
1498
  // (millis), so we do some custom parsing here.
1498
1499
  // Parse the nanos right out of the string.
1499
1500
  let e = 0;
1500
- const r = $.exec(t);
1501
+ const r = Q.exec(t);
1501
1502
  if (__PRIVATE_hardAssert(!!r), r[1]) {
1502
1503
  // Pad the fraction out to 9 digits (nanos).
1503
1504
  let t = r[1];
@@ -1580,11 +1581,11 @@ class Timestamp {
1580
1581
  * The fractions of a second at nanosecond resolution.*
1581
1582
  */
1582
1583
  e) {
1583
- if (this.seconds = t, this.nanoseconds = e, e < 0) throw new FirestoreError(T, "Timestamp nanoseconds out of range: " + e);
1584
- if (e >= 1e9) throw new FirestoreError(T, "Timestamp nanoseconds out of range: " + e);
1585
- if (t < -62135596800) throw new FirestoreError(T, "Timestamp seconds out of range: " + t);
1584
+ if (this.seconds = t, this.nanoseconds = e, e < 0) throw new FirestoreError(R, "Timestamp nanoseconds out of range: " + e);
1585
+ if (e >= 1e9) throw new FirestoreError(R, "Timestamp nanoseconds out of range: " + e);
1586
+ if (t < -62135596800) throw new FirestoreError(R, "Timestamp seconds out of range: " + t);
1586
1587
  // This will break in the year 10,000.
1587
- if (t >= 253402300800) throw new FirestoreError(T, "Timestamp seconds out of range: " + t);
1588
+ if (t >= 253402300800) throw new FirestoreError(R, "Timestamp seconds out of range: " + t);
1588
1589
  }
1589
1590
  /**
1590
1591
  * Creates a new timestamp with the current date, with millisecond precision.
@@ -1740,7 +1741,7 @@ class Timestamp {
1740
1741
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1741
1742
  * See the License for the specific language governing permissions and
1742
1743
  * limitations under the License.
1743
- */ const Q = {
1744
+ */ const L = {
1744
1745
  fields: {
1745
1746
  __type__: {
1746
1747
  stringValue: "__max__"
@@ -1922,9 +1923,9 @@ function __PRIVATE_valueCompare(t, e) {
1922
1923
 
1923
1924
  case 10 /* TypeOrder.ObjectValue */ :
1924
1925
  return function __PRIVATE_compareMaps(t, e) {
1925
- if (t === Q && e === Q) return 0;
1926
- if (t === Q) return 1;
1927
- if (e === Q) return -1;
1926
+ if (t === L && e === L) return 0;
1927
+ if (t === L) return 1;
1928
+ if (e === L) return -1;
1928
1929
  const r = t.fields || {}, n = Object.keys(r), i = e.fields || {}, s = Object.keys(i);
1929
1930
  // Even though MapValues are likely sorted correctly based on their insertion
1930
1931
  // order (e.g. when received from the backend), local modifications can bring
@@ -3480,13 +3481,13 @@ function toNumber(t, e) {
3480
3481
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3481
3482
  * See the License for the specific language governing permissions and
3482
3483
  * limitations under the License.
3483
- */ const L = (() => {
3484
+ */ const M = (() => {
3484
3485
  const t = {
3485
3486
  asc: "ASCENDING",
3486
3487
  desc: "DESCENDING"
3487
3488
  };
3488
3489
  return t;
3489
- })(), M = (() => {
3490
+ })(), x = (() => {
3490
3491
  const t = {
3491
3492
  "<": "LESS_THAN",
3492
3493
  "<=": "LESS_THAN_OR_EQUAL",
@@ -3500,7 +3501,7 @@ function toNumber(t, e) {
3500
3501
  "array-contains-any": "ARRAY_CONTAINS_ANY"
3501
3502
  };
3502
3503
  return t;
3503
- })(), x = (() => {
3504
+ })(), k = (() => {
3504
3505
  const t = {
3505
3506
  and: "AND",
3506
3507
  or: "OR"
@@ -3589,8 +3590,8 @@ function fromName(t, e) {
3589
3590
  const e = ResourcePath.fromString(t);
3590
3591
  return __PRIVATE_hardAssert(__PRIVATE_isValidResourceName(e)), e;
3591
3592
  }(e);
3592
- if (r.get(1) !== t.databaseId.projectId) throw new FirestoreError(T, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
3593
- if (r.get(3) !== t.databaseId.database) throw new FirestoreError(T, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
3593
+ if (r.get(1) !== t.databaseId.projectId) throw new FirestoreError(R, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
3594
+ if (r.get(3) !== t.databaseId.database) throw new FirestoreError(R, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
3594
3595
  return new DocumentKey(function __PRIVATE_extractLocalPathFromResourceName(t) {
3595
3596
  return __PRIVATE_hardAssert(t.length > 4 && "documents" === t.get(4)), t.popFirst(5);
3596
3597
  }
@@ -3724,16 +3725,16 @@ function __PRIVATE_toQueryTarget(t, e) {
3724
3725
  }
3725
3726
 
3726
3727
  function __PRIVATE_toDirection(t) {
3727
- return L[t];
3728
+ return M[t];
3728
3729
  }
3729
3730
 
3730
3731
  // visible for testing
3731
3732
  function __PRIVATE_toOperatorName(t) {
3732
- return M[t];
3733
+ return x[t];
3733
3734
  }
3734
3735
 
3735
3736
  function __PRIVATE_toCompositeOperatorName(t) {
3736
- return x[t];
3737
+ return k[t];
3737
3738
  }
3738
3739
 
3739
3740
  function __PRIVATE_toFieldPathReference(t) {
@@ -3950,18 +3951,18 @@ class __PRIVATE_DatastoreImpl extends class Datastore {} {
3950
3951
  this.serializer = n, this.Y = !1;
3951
3952
  }
3952
3953
  Z() {
3953
- if (this.Y) throw new FirestoreError(w, "The client has already been terminated.");
3954
+ if (this.Y) throw new FirestoreError(g, "The client has already been terminated.");
3954
3955
  }
3955
3956
  /** Invokes the provided RPC with auth and AppCheck tokens. */ P(t, e, r, n) {
3956
3957
  return this.Z(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([i, s]) => this.connection.P(t, __PRIVATE_toResourcePath(e, r), n, i, s))).catch((t => {
3957
- throw "FirebaseError" === t.name ? (t.code === p && (this.authCredentials.invalidateToken(),
3958
- this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(A, t.toString());
3958
+ throw "FirebaseError" === t.name ? (t.code === y && (this.authCredentials.invalidateToken(),
3959
+ this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(T, t.toString());
3959
3960
  }));
3960
3961
  }
3961
3962
  /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ g(t, e, r, n, i) {
3962
3963
  return this.Z(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, o]) => this.connection.g(t, __PRIVATE_toResourcePath(e, r), n, s, o, i))).catch((t => {
3963
- throw "FirebaseError" === t.name ? (t.code === p && (this.authCredentials.invalidateToken(),
3964
- this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(A, t.toString());
3964
+ throw "FirebaseError" === t.name ? (t.code === y && (this.authCredentials.invalidateToken(),
3965
+ this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(T, t.toString());
3965
3966
  }));
3966
3967
  }
3967
3968
  terminate() {
@@ -4075,7 +4076,7 @@ async function __PRIVATE_invokeRunAggregationQueryRpc(t, e, r) {
4075
4076
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4076
4077
  * See the License for the specific language governing permissions and
4077
4078
  * limitations under the License.
4078
- */ const k = new Map;
4079
+ */ const U = new Map;
4079
4080
 
4080
4081
  /**
4081
4082
  * An instance map that ensures only one Datastore exists per Firestore
@@ -4087,8 +4088,8 @@ async function __PRIVATE_invokeRunAggregationQueryRpc(t, e, r) {
4087
4088
  * instance is terminated.
4088
4089
  */
4089
4090
  function __PRIVATE_getDatastore(t) {
4090
- if (t._terminated) throw new FirestoreError(w, "The client has already been terminated.");
4091
- if (!k.has(t)) {
4091
+ if (t._terminated) throw new FirestoreError(g, "The client has already been terminated.");
4092
+ if (!U.has(t)) {
4092
4093
  __PRIVATE_logDebug("ComponentProvider", "Initializing Datastore");
4093
4094
  const e = function __PRIVATE_newConnection(t) {
4094
4095
  return new __PRIVATE_FetchConnection(t, fetch.bind(null));
@@ -4113,9 +4114,9 @@ function __PRIVATE_getDatastore(t) {
4113
4114
  */ (t._databaseId, t.app.options.appId || "", t._persistenceKey, t._freezeSettings())), r = __PRIVATE_newSerializer(t._databaseId), n = function __PRIVATE_newDatastore(t, e, r, n) {
4114
4115
  return new __PRIVATE_DatastoreImpl(t, e, r, n);
4115
4116
  }(t._authCredentials, t._appCheckCredentials, e, r);
4116
- k.set(t, n);
4117
+ U.set(t, n);
4117
4118
  }
4118
- return k.get(t);
4119
+ return U.get(t);
4119
4120
  }
4120
4121
 
4121
4122
  /**
@@ -4131,16 +4132,16 @@ class FirestoreSettingsImpl {
4131
4132
  constructor(t) {
4132
4133
  var e, r;
4133
4134
  if (void 0 === t.host) {
4134
- if (void 0 !== t.ssl) throw new FirestoreError(T, "Can't provide ssl option if host option is not set");
4135
+ if (void 0 !== t.ssl) throw new FirestoreError(R, "Can't provide ssl option if host option is not set");
4135
4136
  this.host = "firestore.googleapis.com", this.ssl = true;
4136
4137
  } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;
4137
4138
  if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties,
4138
4139
  this.localCache = t.localCache, void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
4139
- if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(T, "cacheSizeBytes must be at least 1048576");
4140
+ if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(R, "cacheSizeBytes must be at least 1048576");
4140
4141
  this.cacheSizeBytes = t.cacheSizeBytes;
4141
4142
  }
4142
4143
  !function __PRIVATE_validateIsNotUsedTogether(t, e, r, n) {
4143
- if (!0 === e && !0 === n) throw new FirestoreError(T, `${t} and ${r} cannot be used together.`);
4144
+ if (!0 === e && !0 === n) throw new FirestoreError(R, `${t} and ${r} cannot be used together.`);
4144
4145
  }("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling),
4145
4146
  this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalForceLongPolling ? this.experimentalAutoDetectLongPolling = !1 : void 0 === t.experimentalAutoDetectLongPolling ? this.experimentalAutoDetectLongPolling = true :
4146
4147
  // For backwards compatibility, coerce the value to boolean even though
@@ -4150,9 +4151,9 @@ class FirestoreSettingsImpl {
4150
4151
  this.experimentalLongPollingOptions = __PRIVATE_cloneLongPollingOptions(null !== (r = t.experimentalLongPollingOptions) && void 0 !== r ? r : {}),
4151
4152
  function __PRIVATE_validateLongPollingOptions(t) {
4152
4153
  if (void 0 !== t.timeoutSeconds) {
4153
- if (isNaN(t.timeoutSeconds)) throw new FirestoreError(T, `invalid long polling timeout: ${t.timeoutSeconds} (must not be NaN)`);
4154
- if (t.timeoutSeconds < 5) throw new FirestoreError(T, `invalid long polling timeout: ${t.timeoutSeconds} (minimum allowed value is 5)`);
4155
- if (t.timeoutSeconds > 30) throw new FirestoreError(T, `invalid long polling timeout: ${t.timeoutSeconds} (maximum allowed value is 30)`);
4154
+ if (isNaN(t.timeoutSeconds)) throw new FirestoreError(R, `invalid long polling timeout: ${t.timeoutSeconds} (must not be NaN)`);
4155
+ if (t.timeoutSeconds < 5) throw new FirestoreError(R, `invalid long polling timeout: ${t.timeoutSeconds} (minimum allowed value is 5)`);
4156
+ if (t.timeoutSeconds > 30) throw new FirestoreError(R, `invalid long polling timeout: ${t.timeoutSeconds} (maximum allowed value is 30)`);
4156
4157
  }
4157
4158
  }
4158
4159
  /**
@@ -4199,7 +4200,7 @@ class Firestore {
4199
4200
  * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
4200
4201
  * instance.
4201
4202
  */ get app() {
4202
- if (!this._app) throw new FirestoreError(w, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
4203
+ if (!this._app) throw new FirestoreError(g, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
4203
4204
  return this._app;
4204
4205
  }
4205
4206
  get _initialized() {
@@ -4209,7 +4210,7 @@ class Firestore {
4209
4210
  return void 0 !== this._terminateTask;
4210
4211
  }
4211
4212
  _setSettings(t) {
4212
- if (this._settingsFrozen) throw new FirestoreError(w, "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.");
4213
+ if (this._settingsFrozen) throw new FirestoreError(g, "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.");
4213
4214
  this._settings = new FirestoreSettingsImpl(t), void 0 !== t.credentials && (this._authCredentials = function __PRIVATE_makeAuthCredentialsProvider(t) {
4214
4215
  if (!t) return new __PRIVATE_EmptyAuthCredentialsProvider;
4215
4216
  switch (t.type) {
@@ -4220,7 +4221,7 @@ class Firestore {
4220
4221
  return t.client;
4221
4222
 
4222
4223
  default:
4223
- throw new FirestoreError(T, "makeAuthCredentialsProvider failed due to invalid credential type");
4224
+ throw new FirestoreError(R, "makeAuthCredentialsProvider failed due to invalid credential type");
4224
4225
  }
4225
4226
  }(t.credentials));
4226
4227
  }
@@ -4248,8 +4249,8 @@ class Firestore {
4248
4249
  * Only ever called once.
4249
4250
  */ _terminate() {
4250
4251
  return function __PRIVATE_removeComponents(t) {
4251
- const e = k.get(t);
4252
- e && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"), k.delete(t),
4252
+ const e = U.get(t);
4253
+ e && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"), U.delete(t),
4253
4254
  e.terminate());
4254
4255
  }(this), Promise.resolve();
4255
4256
  }
@@ -4258,7 +4259,7 @@ class Firestore {
4258
4259
  function initializeFirestore(t, e, r) {
4259
4260
  r || (r = "(default)");
4260
4261
  const n = _getProvider(t, "firestore/lite");
4261
- if (n.isInitialized(r)) throw new FirestoreError(w, "Firestore can only be initialized once per app.");
4262
+ if (n.isInitialized(r)) throw new FirestoreError(g, "Firestore can only be initialized once per app.");
4262
4263
  return n.initialize({
4263
4264
  options: e,
4264
4265
  instanceIdentifier: r
@@ -4302,7 +4303,7 @@ function getFirestore(e, r) {
4302
4303
  // invalid field "uid" and missing field "sub" / "user_id".)
4303
4304
  e = createMockUserToken(n.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);
4304
4305
  const s = n.mockUserToken.sub || n.mockUserToken.user_id;
4305
- if (!s) throw new FirestoreError(T, "mockUserToken must contain 'sub' or 'user_id' field!");
4306
+ if (!s) throw new FirestoreError(R, "mockUserToken must contain 'sub' or 'user_id' field!");
4306
4307
  r = new User(s);
4307
4308
  }
4308
4309
  t._authCredentials = new __PRIVATE_EmulatorAuthCredentialsProvider(new __PRIVATE_OAuthToken(e, r));
@@ -4521,7 +4522,7 @@ function collection(t, e, ...r) {
4521
4522
  return __PRIVATE_validateCollectionPath(n), new CollectionReference(t, /* converter= */ null, n);
4522
4523
  }
4523
4524
  {
4524
- if (!(t instanceof DocumentReference || t instanceof CollectionReference)) throw new FirestoreError(T, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4525
+ if (!(t instanceof DocumentReference || t instanceof CollectionReference)) throw new FirestoreError(R, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4525
4526
  const n = t._path.child(ResourcePath.fromString(e, ...r));
4526
4527
  return __PRIVATE_validateCollectionPath(n), new CollectionReference(t.firestore,
4527
4528
  /* converter= */ null, n);
@@ -4542,7 +4543,7 @@ function collection(t, e, ...r) {
4542
4543
  * @returns The created `Query`.
4543
4544
  */ function collectionGroup(t, e) {
4544
4545
  if (t = __PRIVATE_cast(t, Firestore), __PRIVATE_validateNonEmptyArgument("collectionGroup", "collection id", e),
4545
- e.indexOf("/") >= 0) throw new FirestoreError(T, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
4546
+ e.indexOf("/") >= 0) throw new FirestoreError(R, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
4546
4547
  return new Query(t,
4547
4548
  /* converter= */ null, function __PRIVATE_newQueryForCollectionGroup(t) {
4548
4549
  return new __PRIVATE_QueryImpl(ResourcePath.emptyPath(), t);
@@ -4560,7 +4561,7 @@ function doc(t, e, ...r) {
4560
4561
  /* converter= */ null, new DocumentKey(n));
4561
4562
  }
4562
4563
  {
4563
- if (!(t instanceof DocumentReference || t instanceof CollectionReference)) throw new FirestoreError(T, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4564
+ if (!(t instanceof DocumentReference || t instanceof CollectionReference)) throw new FirestoreError(R, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4564
4565
  const n = t._path.child(ResourcePath.fromString(e, ...r));
4565
4566
  return __PRIVATE_validateDocumentPath(n), new DocumentReference(t.firestore, t instanceof CollectionReference ? t.converter : null, new DocumentKey(n));
4566
4567
  }
@@ -4621,7 +4622,7 @@ function doc(t, e, ...r) {
4621
4622
  try {
4622
4623
  return new Bytes(ByteString.fromBase64String(t));
4623
4624
  } catch (t) {
4624
- throw new FirestoreError(T, "Failed to construct data from Base64 string: " + t);
4625
+ throw new FirestoreError(R, "Failed to construct data from Base64 string: " + t);
4625
4626
  }
4626
4627
  }
4627
4628
  /**
@@ -4693,7 +4694,7 @@ function doc(t, e, ...r) {
4693
4694
  * @param fieldNames - A list of field names.
4694
4695
  */
4695
4696
  constructor(...t) {
4696
- for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new FirestoreError(T, "Invalid field name at argument $(i + 1). Field names must not be empty.");
4697
+ for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new FirestoreError(R, "Invalid field name at argument $(i + 1). Field names must not be empty.");
4697
4698
  this._internalPath = new FieldPath$1(t);
4698
4699
  }
4699
4700
  /**
@@ -4772,8 +4773,8 @@ function doc(t, e, ...r) {
4772
4773
  * @param longitude - The longitude as number between -180 and 180.
4773
4774
  */
4774
4775
  constructor(t, e) {
4775
- if (!isFinite(t) || t < -90 || t > 90) throw new FirestoreError(T, "Latitude must be a number between -90 and 90, but was: " + t);
4776
- if (!isFinite(e) || e < -180 || e > 180) throw new FirestoreError(T, "Longitude must be a number between -180 and 180, but was: " + e);
4776
+ if (!isFinite(t) || t < -90 || t > 90) throw new FirestoreError(R, "Latitude must be a number between -90 and 90, but was: " + t);
4777
+ if (!isFinite(e) || e < -180 || e > 180) throw new FirestoreError(R, "Longitude must be a number between -180 and 180, but was: " + e);
4777
4778
  this._lat = t, this._long = e;
4778
4779
  }
4779
4780
  /**
@@ -4823,7 +4824,7 @@ function doc(t, e, ...r) {
4823
4824
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4824
4825
  * See the License for the specific language governing permissions and
4825
4826
  * limitations under the License.
4826
- */ const U = /^__.*__$/;
4827
+ */ const j = /^__.*__$/;
4827
4828
 
4828
4829
  /** The result of parsing document data (e.g. for a setData call). */ class ParsedSetData {
4829
4830
  constructor(t, e, r) {
@@ -4934,7 +4935,7 @@ function __PRIVATE_isWrite(t) {
4934
4935
  }
4935
4936
  st(t) {
4936
4937
  if (0 === t.length) throw this._t("Document fields must not be empty");
4937
- if (__PRIVATE_isWrite(this.et) && U.test(t)) throw this._t('Document fields cannot begin and end with "__"');
4938
+ if (__PRIVATE_isWrite(this.et) && j.test(t)) throw this._t('Document fields cannot begin and end with "__"');
4938
4939
  }
4939
4940
  }
4940
4941
 
@@ -4971,7 +4972,7 @@ function __PRIVATE_newUserDataReader(t) {
4971
4972
  const t = [];
4972
4973
  for (const n of s.mergeFields) {
4973
4974
  const i = __PRIVATE_fieldPathFromArgument$1(e, n, r);
4974
- if (!o.contains(i)) throw new FirestoreError(T, `Field '${i}' is specified in your field mask but missing from your input data.`);
4975
+ if (!o.contains(i)) throw new FirestoreError(R, `Field '${i}' is specified in your field mask but missing from your input data.`);
4975
4976
  __PRIVATE_fieldMaskContains(t, i) || t.push(i);
4976
4977
  }
4977
4978
  u = new FieldMask(t), _ = o.fieldTransforms.filter((t => u.covers(t.field)));
@@ -5088,7 +5089,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
5088
5089
 
5089
5090
  /** Parse update data from a list of field/value arguments. */ function __PRIVATE_parseUpdateVarargs(t, e, r, n, i, s) {
5090
5091
  const o = t.ht(1 /* UserDataSource.Update */ , e, r), a = [ __PRIVATE_fieldPathFromArgument$1(e, n, r) ], u = [ i ];
5091
- if (s.length % 2 != 0) throw new FirestoreError(T, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);
5092
+ if (s.length % 2 != 0) throw new FirestoreError(R, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);
5092
5093
  for (let t = 0; t < s.length; t += 2) a.push(__PRIVATE_fieldPathFromArgument$1(e, s[t])),
5093
5094
  u.push(s[t + 1]);
5094
5095
  const _ = [], c = ObjectValue.empty();
@@ -5292,7 +5293,7 @@ function __PRIVATE_validatePlainObject(t, e, r) {
5292
5293
 
5293
5294
  /**
5294
5295
  * Matches any characters in a field path string that are reserved.
5295
- */ const j = new RegExp("[~\\*/\\[\\]]");
5296
+ */ const z = new RegExp("[~\\*/\\[\\]]");
5296
5297
 
5297
5298
  /**
5298
5299
  * Wraps fromDotSeparatedString with an error message about the method that
@@ -5303,7 +5304,7 @@ function __PRIVATE_validatePlainObject(t, e, r) {
5303
5304
  * @param targetDoc - The document against which the field path will be
5304
5305
  * evaluated.
5305
5306
  */ function __PRIVATE_fieldPathFromDotSeparatedString(t, e, r) {
5306
- if (e.search(j) >= 0) throw __PRIVATE_createError(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t,
5307
+ if (e.search(z) >= 0) throw __PRIVATE_createError(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t,
5307
5308
  /* hasConverter= */ !1,
5308
5309
  /* path= */ void 0, r);
5309
5310
  try {
@@ -5321,7 +5322,7 @@ function __PRIVATE_createError(t, e, r, n, i) {
5321
5322
  r && (a += " (via `toFirestore()`)"), a += ". ";
5322
5323
  let u = "";
5323
5324
  return (s || o) && (u += " (found", s && (u += ` in field ${n}`), o && (u += ` in document ${i}`),
5324
- u += ")"), new FirestoreError(T, a + t + u);
5325
+ u += ")"), new FirestoreError(R, a + t + u);
5325
5326
  }
5326
5327
 
5327
5328
  /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function __PRIVATE_fieldMaskContains(t, e) {
@@ -5518,7 +5519,7 @@ function query(t, e, ...r) {
5518
5519
  let n = [];
5519
5520
  e instanceof AppliableConstraint && n.push(e), n = n.concat(r), function __PRIVATE_validateQueryConstraintArray(t) {
5520
5521
  const e = t.filter((t => t instanceof QueryCompositeFilterConstraint)).length, r = t.filter((t => t instanceof QueryFieldFilterConstraint)).length;
5521
- if (e > 1 || e > 0 && r > 0) throw new FirestoreError(T, "InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.");
5522
+ if (e > 1 || e > 0 && r > 0) throw new FirestoreError(R, "InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.");
5522
5523
  }
5523
5524
  /**
5524
5525
  * @license
@@ -5572,7 +5573,7 @@ function query(t, e, ...r) {
5572
5573
  const e = __PRIVATE_newUserDataReader(t.firestore), r = function __PRIVATE_newQueryFilter(t, e, r, n, i, s, o) {
5573
5574
  let a;
5574
5575
  if (i.isKeyField()) {
5575
- if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(T, `Invalid Query. You can't perform '${s}' queries on documentId().`);
5576
+ if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(R, `Invalid Query. You can't perform '${s}' queries on documentId().`);
5576
5577
  if ("in" /* Operator.IN */ === s || "not-in" /* Operator.NOT_IN */ === s) {
5577
5578
  __PRIVATE_validateDisjunctiveFilterElements(o, s);
5578
5579
  const e = [];
@@ -5699,8 +5700,8 @@ function query(t, e, ...r) {
5699
5700
  }
5700
5701
  _apply(t) {
5701
5702
  const e = function __PRIVATE_newQueryOrderBy(t, e, r) {
5702
- if (null !== t.startAt) throw new FirestoreError(T, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
5703
- if (null !== t.endAt) throw new FirestoreError(T, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
5703
+ if (null !== t.startAt) throw new FirestoreError(R, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
5704
+ if (null !== t.endAt) throw new FirestoreError(R, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
5704
5705
  return new OrderBy(e, r);
5705
5706
  }
5706
5707
  /**
@@ -5860,7 +5861,7 @@ function endAt(...t) {
5860
5861
 
5861
5862
  /** Helper function to create a bound from a document or fields */ function __PRIVATE_newQueryBoundFromDocOrFields(t, e, r, n) {
5862
5863
  if (r[0] = getModularInstance(r[0]), r[0] instanceof DocumentSnapshot) return function __PRIVATE_newQueryBoundFromDocument(t, e, r, n, i) {
5863
- if (!n) throw new FirestoreError(P, `Can't use a DocumentSnapshot that doesn't exist for ${r}().`);
5864
+ if (!n) throw new FirestoreError(I, `Can't use a DocumentSnapshot that doesn't exist for ${r}().`);
5864
5865
  const s = [];
5865
5866
  // Because people expect to continue/end a query at the exact document
5866
5867
  // provided, we need to use the implicit sort order rather than the explicit
@@ -5871,10 +5872,10 @@ function endAt(...t) {
5871
5872
  // results.
5872
5873
  for (const r of __PRIVATE_queryNormalizedOrderBy(t)) if (r.field.isKeyField()) s.push(__PRIVATE_refValue(e, n.key)); else {
5873
5874
  const t = n.data.field(r.field);
5874
- if (__PRIVATE_isServerTimestamp(t)) throw new FirestoreError(T, 'Invalid query. You are trying to start or end a query using a document for which the field "' + r.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
5875
+ if (__PRIVATE_isServerTimestamp(t)) throw new FirestoreError(R, 'Invalid query. You are trying to start or end a query using a document for which the field "' + r.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
5875
5876
  if (null === t) {
5876
5877
  const t = r.field.canonicalString();
5877
- throw new FirestoreError(T, `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.`);
5878
+ throw new FirestoreError(R, `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.`);
5878
5879
  }
5879
5880
  s.push(t);
5880
5881
  }
@@ -5888,15 +5889,15 @@ function endAt(...t) {
5888
5889
  return function __PRIVATE_newQueryBoundFromFields(t, e, r, n, i, s) {
5889
5890
  // Use explicit order by's because it has to match the query the user made
5890
5891
  const o = t.explicitOrderBy;
5891
- if (i.length > o.length) throw new FirestoreError(T, `Too many arguments provided to ${n}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
5892
+ if (i.length > o.length) throw new FirestoreError(R, `Too many arguments provided to ${n}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
5892
5893
  const a = [];
5893
5894
  for (let s = 0; s < i.length; s++) {
5894
5895
  const u = i[s];
5895
5896
  if (o[s].field.isKeyField()) {
5896
- if ("string" != typeof u) throw new FirestoreError(T, `Invalid query. Expected a string for document ID in ${n}(), but got a ${typeof u}`);
5897
- if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== u.indexOf("/")) throw new FirestoreError(T, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${n}() must be a plain document ID, but '${u}' contains a slash.`);
5897
+ if ("string" != typeof u) throw new FirestoreError(R, `Invalid query. Expected a string for document ID in ${n}(), but got a ${typeof u}`);
5898
+ if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== u.indexOf("/")) throw new FirestoreError(R, `Invalid query. When querying a collection and ordering by documentId(), the value passed to ${n}() must be a plain document ID, but '${u}' contains a slash.`);
5898
5899
  const r = t.path.child(ResourcePath.fromString(u));
5899
- if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(T, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${n}() must result in a valid document path, but '${r}' is not because it contains an odd number of segments.`);
5900
+ if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(R, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${n}() must result in a valid document path, but '${r}' is not because it contains an odd number of segments.`);
5900
5901
  const i = new DocumentKey(r);
5901
5902
  a.push(__PRIVATE_refValue(e, i));
5902
5903
  } else {
@@ -5916,21 +5917,21 @@ function endAt(...t) {
5916
5917
 
5917
5918
  function __PRIVATE_parseDocumentIdValue(t, e, r) {
5918
5919
  if ("string" == typeof (r = getModularInstance(r))) {
5919
- if ("" === r) throw new FirestoreError(T, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
5920
- if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== r.indexOf("/")) throw new FirestoreError(T, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${r}' contains a '/' character.`);
5920
+ if ("" === r) throw new FirestoreError(R, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
5921
+ if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== r.indexOf("/")) throw new FirestoreError(R, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${r}' contains a '/' character.`);
5921
5922
  const n = e.path.child(ResourcePath.fromString(r));
5922
- if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(T, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${n}' is not because it has an odd number of segments (${n.length}).`);
5923
+ if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(R, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${n}' is not because it has an odd number of segments (${n.length}).`);
5923
5924
  return __PRIVATE_refValue(t, new DocumentKey(n));
5924
5925
  }
5925
5926
  if (r instanceof DocumentReference) return __PRIVATE_refValue(t, r._key);
5926
- throw new FirestoreError(T, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${__PRIVATE_valueDescription(r)}.`);
5927
+ throw new FirestoreError(R, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${__PRIVATE_valueDescription(r)}.`);
5927
5928
  }
5928
5929
 
5929
5930
  /**
5930
5931
  * Validates that the value passed into a disjunctive filter satisfies all
5931
5932
  * array requirements.
5932
5933
  */ function __PRIVATE_validateDisjunctiveFilterElements(t, e) {
5933
- if (!Array.isArray(t) || 0 === t.length) throw new FirestoreError(T, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);
5934
+ if (!Array.isArray(t) || 0 === t.length) throw new FirestoreError(R, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);
5934
5935
  }
5935
5936
 
5936
5937
  /**
@@ -5964,11 +5965,11 @@ function __PRIVATE_parseDocumentIdValue(t, e, r) {
5964
5965
  }(e.op));
5965
5966
  if (null !== r)
5966
5967
  // Special case when it's a duplicate op to give a slightly clearer error message.
5967
- throw r === e.op ? new FirestoreError(T, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new FirestoreError(T, `Invalid query. You cannot use '${e.op.toString()}' filters with '${r.toString()}' filters.`);
5968
+ throw r === e.op ? new FirestoreError(R, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new FirestoreError(R, `Invalid query. You cannot use '${e.op.toString()}' filters with '${r.toString()}' filters.`);
5968
5969
  }
5969
5970
 
5970
5971
  function __PRIVATE_validateQueryFilterConstraint(t, e) {
5971
- if (!(e instanceof QueryFieldFilterConstraint || e instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(T, `Function ${t}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`);
5972
+ if (!(e instanceof QueryFieldFilterConstraint || e instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(R, `Function ${t}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`);
5972
5973
  }
5973
5974
 
5974
5975
  /**
@@ -6135,7 +6136,7 @@ class __PRIVATE_LiteUserDataWriter extends class AbstractUserDataWriter {
6135
6136
  * @returns A Promise that will be resolved with the results of the query.
6136
6137
  */ function getDocs(t) {
6137
6138
  (function __PRIVATE_validateHasExplicitOrderByForLimitToLast(t) {
6138
- if ("L" /* LimitType.Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new FirestoreError(v, "limitToLast() queries require specifying at least one orderBy() clause");
6139
+ if ("L" /* LimitType.Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new FirestoreError(D, "limitToLast() queries require specifying at least one orderBy() clause");
6139
6140
  })((t = __PRIVATE_cast(t, Query))._query);
6140
6141
  const e = __PRIVATE_getDatastore(t.firestore), r = new __PRIVATE_LiteUserDataWriter(t.firestore);
6141
6142
  return __PRIVATE_invokeRunQueryRpc(e, t._query).then((e => {
@@ -6472,12 +6473,12 @@ function sum(t) {
6472
6473
  return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
6473
6474
  }
6474
6475
  _verifyNotCommitted() {
6475
- if (this._committed) throw new FirestoreError(w, "A write batch can no longer be used after commit() has been called.");
6476
+ if (this._committed) throw new FirestoreError(g, "A write batch can no longer be used after commit() has been called.");
6476
6477
  }
6477
6478
  }
6478
6479
 
6479
6480
  function __PRIVATE_validateReference(t, e) {
6480
- if ((t = getModularInstance(t)).firestore !== e) throw new FirestoreError(T, "Provided document reference is from a different Firestore instance.");
6481
+ if ((t = getModularInstance(t)).firestore !== e) throw new FirestoreError(R, "Provided document reference is from a different Firestore instance.");
6481
6482
  return t;
6482
6483
  }
6483
6484
 
@@ -6536,7 +6537,7 @@ function __PRIVATE_validateReference(t, e) {
6536
6537
  this.writtenDocs = new Set;
6537
6538
  }
6538
6539
  async lookup(t) {
6539
- if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(T, "Firestore transactions require all reads to be executed before all writes."),
6540
+ if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(R, "Firestore transactions require all reads to be executed before all writes."),
6540
6541
  this.lastTransactionError;
6541
6542
  const e = await __PRIVATE_invokeBatchGetDocumentsRpc(this.datastore, t);
6542
6543
  return e.forEach((t => this.recordVersion(t))), e;
@@ -6580,7 +6581,7 @@ function __PRIVATE_validateReference(t, e) {
6580
6581
  if (r) {
6581
6582
  if (!e.isEqual(r))
6582
6583
  // This transaction will fail no matter what.
6583
- throw new FirestoreError(g, "Document version changed between two reads.");
6584
+ throw new FirestoreError(F, "Document version changed between two reads.");
6584
6585
  } else this.readVersions.set(t.key.toString(), e);
6585
6586
  }
6586
6587
  /**
@@ -6607,7 +6608,7 @@ function __PRIVATE_validateReference(t, e) {
6607
6608
  // express that to the backend, we have to validate locally.
6608
6609
  // Note: this can change once we can send separate verify writes in the
6609
6610
  // transaction.
6610
- throw new FirestoreError(T, "Can't update a document that doesn't exist.");
6611
+ throw new FirestoreError(R, "Can't update a document that doesn't exist.");
6611
6612
  // Document exists, base precondition on document update time.
6612
6613
  return Precondition.updateTime(e);
6613
6614
  }
@@ -6636,7 +6637,7 @@ function __PRIVATE_validateReference(t, e) {
6636
6637
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6637
6638
  * See the License for the specific language governing permissions and
6638
6639
  * limitations under the License.
6639
- */ const z = {
6640
+ */ const W = {
6640
6641
  maxAttempts: 5
6641
6642
  };
6642
6643
 
@@ -6713,29 +6714,29 @@ class __PRIVATE_TransactionRunner {
6713
6714
  default:
6714
6715
  return fail();
6715
6716
 
6716
- case m:
6717
6717
  case A:
6718
- case R:
6719
- case y:
6720
- case D:
6718
+ case T:
6719
+ case P:
6720
+ case w:
6721
6721
  case b:
6722
+ case C:
6722
6723
  // Unauthenticated means something went wrong with our token and we need
6723
6724
  // to retry with new credentials which will happen automatically.
6724
- case p:
6725
+ case y:
6725
6726
  return !1;
6726
6727
 
6727
- case T:
6728
- case P:
6728
+ case R:
6729
6729
  case I:
6730
6730
  case V:
6731
- case w:
6731
+ case p:
6732
+ case g:
6732
6733
  // Aborted might be retried in some scenarios, but that is dependant on
6733
6734
  // the context and should handled individually by the calling code.
6734
6735
  // See https://cloud.google.com/apis/design/errors.
6735
- case g:
6736
- case F:
6736
+ case F:
6737
6737
  case v:
6738
- case C:
6738
+ case D:
6739
+ case S:
6739
6740
  return !0;
6740
6741
  }
6741
6742
  }(e);
@@ -6840,7 +6841,7 @@ class __PRIVATE_TransactionRunner {
6840
6841
  * As long as the operation has not yet been run, calling cancel() provides a
6841
6842
  * guarantee that the operation will not be run.
6842
6843
  */ cancel(t) {
6843
- null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(m, "Operation cancelled" + (t ? ": " + t : ""))));
6844
+ null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(A, "Operation cancelled" + (t ? ": " + t : ""))));
6844
6845
  }
6845
6846
  handleDelayElapsed() {
6846
6847
  this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(),
@@ -7168,9 +7169,9 @@ class Transaction {
7168
7169
  * `updateFunction `is returned here. Otherwise, if the transaction failed, a
7169
7170
  * rejected promise with the corresponding failure error is returned.
7170
7171
  */ function runTransaction(t, e, r) {
7171
- const n = __PRIVATE_getDatastore(t = __PRIVATE_cast(t, Firestore)), i = Object.assign(Object.assign({}, z), r);
7172
+ const n = __PRIVATE_getDatastore(t = __PRIVATE_cast(t, Firestore)), i = Object.assign(Object.assign({}, W), r);
7172
7173
  !function __PRIVATE_validateTransactionOptions(t) {
7173
- if (t.maxAttempts < 1) throw new FirestoreError(T, "Max attempts must be at least 1");
7174
+ if (t.maxAttempts < 1) throw new FirestoreError(R, "Max attempts must be at least 1");
7174
7175
  }(i);
7175
7176
  const s = new __PRIVATE_Deferred;
7176
7177
  return new __PRIVATE_TransactionRunner(function __PRIVATE_newAsyncQueue() {
@@ -7187,10 +7188,10 @@ class Transaction {
7187
7188
  * @packageDocumentation
7188
7189
  */ !function __PRIVATE_registerFirestore() {
7189
7190
  !function __PRIVATE_setSDKVersion(t) {
7190
- d = t;
7191
+ f = t;
7191
7192
  }(`${SDK_VERSION}_lite`), _registerComponent(new Component("firestore/lite", ((t, {instanceIdentifier: e, options: r}) => {
7192
7193
  const n = t.getProvider("app").getImmediate(), i = new Firestore(new __PRIVATE_LiteAuthCredentialsProvider(t.getProvider("auth-internal")), new __PRIVATE_LiteAppCheckTokenProvider(t.getProvider("app-check-internal")), function __PRIVATE_databaseIdFromApp(t, e) {
7193
- if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new FirestoreError(T, '"projectId" not provided in firebase.initializeApp.');
7194
+ if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new FirestoreError(R, '"projectId" not provided in firebase.initializeApp.');
7194
7195
  return new DatabaseId(t.options.projectId, e);
7195
7196
  }
7196
7197
  /**
@@ -7212,7 +7213,7 @@ class Transaction {
7212
7213
  return r && i._setSettings(r), i;
7213
7214
  }), "PUBLIC").setMultipleInstances(!0)),
7214
7215
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
7215
- registerVersion("firestore-lite", "4.6.2-canary.8fb372afb", ""), registerVersion("firestore-lite", "4.6.2-canary.8fb372afb", "esm2017");
7216
+ registerVersion("firestore-lite", d, ""), registerVersion("firestore-lite", d, "esm2017");
7216
7217
  }();
7217
7218
 
7218
7219
  export { AggregateField, AggregateQuerySnapshot, Bytes, CollectionReference, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Firestore, FirestoreError, GeoPoint, Query, QueryCompositeFilterConstraint, QueryConstraint, QueryDocumentSnapshot, QueryEndAtConstraint, QueryFieldFilterConstraint, QueryLimitConstraint, QueryOrderByConstraint, QuerySnapshot, QueryStartAtConstraint, Timestamp, Transaction, WriteBatch, addDoc, aggregateFieldEqual, aggregateQuerySnapshotEqual, and, arrayRemove, arrayUnion, average, collection, collectionGroup, connectFirestoreEmulator, count, deleteDoc, deleteField, doc, documentId, endAt, endBefore, getAggregate, getCount, getDoc, getDocs, getFirestore, increment, initializeFirestore, limit, limitToLast, or, orderBy, query, queryEqual, refEqual, runTransaction, serverTimestamp, setDoc, setLogLevel, snapshotEqual, startAfter, startAt, sum, terminate, updateDoc, where, writeBatch };