@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.
@@ -6,6 +6,8 @@ import { Logger as o, LogLevel as a } from "@firebase/logger";
6
6
 
7
7
  import { FirebaseError as u, base64 as _, DecodeBase64StringError as c, getDefaultEmulatorHostnameAndPort as l, createMockUserToken as h, getModularInstance as d, deepEqual as f } from "@firebase/util";
8
8
 
9
+ const E = "4.6.2-dataconnect-preview.877f8b7d0";
10
+
9
11
  /**
10
12
  * @license
11
13
  * Copyright 2017 Google LLC
@@ -25,8 +27,7 @@ import { FirebaseError as u, base64 as _, DecodeBase64StringError as c, getDefau
25
27
  /**
26
28
  * Simple wrapper around a nullable UID. Mostly exists to make code more
27
29
  * readable.
28
- */
29
- class User {
30
+ */ class User {
30
31
  constructor(t) {
31
32
  this.uid = t;
32
33
  }
@@ -66,7 +67,7 @@ User.MOCK_USER = new User("mock-user");
66
67
  * See the License for the specific language governing permissions and
67
68
  * limitations under the License.
68
69
  */
69
- let E = "10.12.0-canary.8fb372afb";
70
+ let m = "10.12.0-dataconnect-preview.877f8b7d0";
70
71
 
71
72
  /**
72
73
  * @license
@@ -84,7 +85,7 @@ let E = "10.12.0-canary.8fb372afb";
84
85
  * See the License for the specific language governing permissions and
85
86
  * limitations under the License.
86
87
  */
87
- const m = new o("@firebase/firestore");
88
+ const A = new o("@firebase/firestore");
88
89
 
89
90
  /**
90
91
  * Sets the verbosity of Cloud Firestore logs (debug, error, or silent).
@@ -99,29 +100,29 @@ const m = new o("@firebase/firestore");
99
100
  * <li><code>`silent` to turn off logging.</li>
100
101
  * </ul>
101
102
  */ function setLogLevel(t) {
102
- m.setLogLevel(t);
103
+ A.setLogLevel(t);
103
104
  }
104
105
 
105
106
  function __PRIVATE_logDebug(t, ...e) {
106
- if (m.logLevel <= a.DEBUG) {
107
+ if (A.logLevel <= a.DEBUG) {
107
108
  const r = e.map(__PRIVATE_argToString);
108
- m.debug(`Firestore (${E}): ${t}`, ...r);
109
+ A.debug(`Firestore (${m}): ${t}`, ...r);
109
110
  }
110
111
  }
111
112
 
112
113
  function __PRIVATE_logError(t, ...e) {
113
- if (m.logLevel <= a.ERROR) {
114
+ if (A.logLevel <= a.ERROR) {
114
115
  const r = e.map(__PRIVATE_argToString);
115
- m.error(`Firestore (${E}): ${t}`, ...r);
116
+ A.error(`Firestore (${m}): ${t}`, ...r);
116
117
  }
117
118
  }
118
119
 
119
120
  /**
120
121
  * @internal
121
122
  */ function __PRIVATE_logWarn(t, ...e) {
122
- if (m.logLevel <= a.WARN) {
123
+ if (A.logLevel <= a.WARN) {
123
124
  const r = e.map(__PRIVATE_argToString);
124
- m.warn(`Firestore (${E}): ${t}`, ...r);
125
+ A.warn(`Firestore (${m}): ${t}`, ...r);
125
126
  }
126
127
  }
127
128
 
@@ -182,7 +183,7 @@ function __PRIVATE_logError(t, ...e) {
182
183
  */ function fail(t = "Unexpected state") {
183
184
  // Log the failure in addition to throw an exception, just in case the
184
185
  // exception is swallowed.
185
- const e = `FIRESTORE (${E}) INTERNAL ASSERTION FAILED: ` + t;
186
+ const e = `FIRESTORE (${m}) INTERNAL ASSERTION FAILED: ` + t;
186
187
  // NOTE: We don't use FirestoreError here because these are internal failures
187
188
  // that cannot be handled by the user. (Also it would create a circular
188
189
  // dependency between the error and assert modules which doesn't work.)
@@ -222,7 +223,7 @@ e) {
222
223
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
223
224
  * See the License for the specific language governing permissions and
224
225
  * limitations under the License.
225
- */ const A = "ok", T = "cancelled", R = "unknown", P = "invalid-argument", I = "deadline-exceeded", V = "not-found", p = "already-exists", y = "permission-denied", w = "unauthenticated", g = "resource-exhausted", F = "failed-precondition", v = "aborted", D = "out-of-range", b = "unimplemented", C = "internal", S = "unavailable", N = "data-loss";
226
+ */ const T = "ok", R = "cancelled", P = "unknown", I = "invalid-argument", V = "deadline-exceeded", p = "not-found", y = "already-exists", w = "permission-denied", g = "unauthenticated", F = "resource-exhausted", v = "failed-precondition", D = "aborted", b = "out-of-range", C = "unimplemented", S = "internal", N = "unavailable", O = "data-loss";
226
227
 
227
228
  /** An error returned by a Firestore operation. */ class FirestoreError extends u {
228
229
  /** @hideconstructor */
@@ -579,7 +580,7 @@ class BasePath {
579
580
  // for legacy reasons and should not be used frequently).
580
581
  const e = [];
581
582
  for (const r of t) {
582
- if (r.indexOf("//") >= 0) throw new FirestoreError(P, `Invalid segment (${r}). Paths must not contain // in them.`);
583
+ if (r.indexOf("//") >= 0) throw new FirestoreError(I, `Invalid segment (${r}). Paths must not contain // in them.`);
583
584
  // Strip leading and traling slashed.
584
585
  e.push(...r.split("/").filter((t => t.length > 0)));
585
586
  }
@@ -590,7 +591,7 @@ class BasePath {
590
591
  }
591
592
  }
592
593
 
593
- const O = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
594
+ const q = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
594
595
 
595
596
  /**
596
597
  * A dot-separated path for navigating sub-objects within a document.
@@ -603,7 +604,7 @@ const O = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
603
604
  * Returns true if the string could be used as a segment in a field path
604
605
  * without escaping.
605
606
  */ static isValidIdentifier(t) {
606
- return O.test(t);
607
+ return q.test(t);
607
608
  }
608
609
  canonicalString() {
609
610
  return this.toArray().map((t => (t = t.replace(/\\/g, "\\\\").replace(/`/g, "\\`"),
@@ -635,21 +636,21 @@ const O = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
635
636
  const e = [];
636
637
  let r = "", n = 0;
637
638
  const __PRIVATE_addCurrentSegment = () => {
638
- if (0 === r.length) throw new FirestoreError(P, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
639
+ if (0 === r.length) throw new FirestoreError(I, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
639
640
  e.push(r), r = "";
640
641
  };
641
642
  let i = !1;
642
643
  for (;n < t.length; ) {
643
644
  const e = t[n];
644
645
  if ("\\" === e) {
645
- if (n + 1 === t.length) throw new FirestoreError(P, "Path has trailing escape character: " + t);
646
+ if (n + 1 === t.length) throw new FirestoreError(I, "Path has trailing escape character: " + t);
646
647
  const e = t[n + 1];
647
- if ("\\" !== e && "." !== e && "`" !== e) throw new FirestoreError(P, "Path has invalid escape sequence: " + t);
648
+ if ("\\" !== e && "." !== e && "`" !== e) throw new FirestoreError(I, "Path has invalid escape sequence: " + t);
648
649
  r += e, n += 2;
649
650
  } else "`" === e ? (i = !i, n++) : "." !== e || i ? (r += e, n++) : (__PRIVATE_addCurrentSegment(),
650
651
  n++);
651
652
  }
652
- if (__PRIVATE_addCurrentSegment(), i) throw new FirestoreError(P, "Unterminated ` in path: " + t);
653
+ if (__PRIVATE_addCurrentSegment(), i) throw new FirestoreError(I, "Unterminated ` in path: " + t);
653
654
  return new FieldPath$1(e);
654
655
  }
655
656
  static emptyPath() {
@@ -738,7 +739,7 @@ const O = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
738
739
  * See the License for the specific language governing permissions and
739
740
  * limitations under the License.
740
741
  */ function __PRIVATE_validateNonEmptyArgument(t, e, r) {
741
- if (!r) throw new FirestoreError(P, `Function ${t}() cannot be called with an empty ${e}.`);
742
+ if (!r) throw new FirestoreError(I, `Function ${t}() cannot be called with an empty ${e}.`);
742
743
  }
743
744
 
744
745
  /**
@@ -750,14 +751,14 @@ const O = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
750
751
  * an even numbers of segments).
751
752
  */
752
753
  function __PRIVATE_validateDocumentPath(t) {
753
- if (!DocumentKey.isDocumentKey(t)) throw new FirestoreError(P, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);
754
+ if (!DocumentKey.isDocumentKey(t)) throw new FirestoreError(I, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);
754
755
  }
755
756
 
756
757
  /**
757
758
  * Validates that `path` refers to a collection (indicated by the fact it
758
759
  * contains an odd numbers of segments).
759
760
  */ function __PRIVATE_validateCollectionPath(t) {
760
- if (DocumentKey.isDocumentKey(t)) throw new FirestoreError(P, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);
761
+ if (DocumentKey.isDocumentKey(t)) throw new FirestoreError(I, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);
761
762
  }
762
763
 
763
764
  /**
@@ -801,17 +802,17 @@ e) {
801
802
  // Unwrap Compat types
802
803
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
803
804
  t = t._delegate), !(t instanceof e)) {
804
- if (e.name === t.constructor.name) throw new FirestoreError(P, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
805
+ if (e.name === t.constructor.name) throw new FirestoreError(I, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
805
806
  {
806
807
  const r = __PRIVATE_valueDescription(t);
807
- throw new FirestoreError(P, `Expected type '${e.name}', but it was: ${r}`);
808
+ throw new FirestoreError(I, `Expected type '${e.name}', but it was: ${r}`);
808
809
  }
809
810
  }
810
811
  return t;
811
812
  }
812
813
 
813
814
  function __PRIVATE_validatePositiveNumber(t, e) {
814
- if (e <= 0) throw new FirestoreError(P, `Function ${t}() requires a positive number, but it was: ${e}.`);
815
+ if (e <= 0) throw new FirestoreError(I, `Function ${t}() requires a positive number, but it was: ${e}.`);
815
816
  }
816
817
 
817
818
  /**
@@ -861,7 +862,7 @@ function __PRIVATE_cloneLongPollingOptions(t) {
861
862
  /**
862
863
  * The value returned from the most recent invocation of
863
864
  * `generateUniqueDebugId()`, or null if it has never been invoked.
864
- */ let q = null;
865
+ */ let B = null;
865
866
 
866
867
  /**
867
868
  * Generates and returns an initial value for `lastUniqueDebugId`.
@@ -886,9 +887,9 @@ function __PRIVATE_cloneLongPollingOptions(t) {
886
887
  * @return the 10-character generated ID (e.g. "0xa1b2c3d4").
887
888
  */
888
889
  function __PRIVATE_generateUniqueDebugId() {
889
- return null === q ? q = function __PRIVATE_generateInitialUniqueDebugId() {
890
+ return null === B ? B = function __PRIVATE_generateInitialUniqueDebugId() {
890
891
  return 268435456 + Math.round(2147483648 * Math.random());
891
- }() : q++, "0x" + q.toString(16);
892
+ }() : B++, "0x" + B.toString(16);
892
893
  }
893
894
 
894
895
  /**
@@ -939,7 +940,7 @@ function __PRIVATE_generateUniqueDebugId() {
939
940
  * See the License for the specific language governing permissions and
940
941
  * limitations under the License.
941
942
  */
942
- const B = {
943
+ const $ = {
943
944
  BatchGetDocuments: "batchGet",
944
945
  Commit: "commit",
945
946
  RunQuery: "runQuery",
@@ -977,7 +978,7 @@ const B = {
977
978
  * are used for reverse lookups from the webchannel stream. Do NOT change the
978
979
  * names of these identifiers or change this into a const enum.
979
980
  */
980
- var $, Q;
981
+ var Q, L;
981
982
 
982
983
  /**
983
984
  * Converts an HTTP Status Code to the equivalent error code.
@@ -988,7 +989,7 @@ var $, Q;
988
989
  */
989
990
  function __PRIVATE_mapCodeFromHttpStatus(t) {
990
991
  if (void 0 === t) return __PRIVATE_logError("RPC_ERROR", "HTTP error has no status"),
991
- R;
992
+ P;
992
993
  // The canonical error codes for Google APIs [1] specify mapping onto HTTP
993
994
  // status codes but the mapping is not bijective. In each case of ambiguity
994
995
  // this function chooses a primary error.
@@ -998,66 +999,66 @@ function __PRIVATE_mapCodeFromHttpStatus(t) {
998
999
  switch (t) {
999
1000
  case 200:
1000
1001
  // OK
1001
- return A;
1002
+ return T;
1002
1003
 
1003
1004
  case 400:
1004
1005
  // Bad Request
1005
- return F;
1006
+ return v;
1006
1007
 
1007
1008
  // Other possibilities based on the forward mapping
1008
1009
  // return Code.INVALID_ARGUMENT;
1009
1010
  // return Code.OUT_OF_RANGE;
1010
1011
  case 401:
1011
1012
  // Unauthorized
1012
- return w;
1013
+ return g;
1013
1014
 
1014
1015
  case 403:
1015
1016
  // Forbidden
1016
- return y;
1017
+ return w;
1017
1018
 
1018
1019
  case 404:
1019
1020
  // Not Found
1020
- return V;
1021
+ return p;
1021
1022
 
1022
1023
  case 409:
1023
1024
  // Conflict
1024
- return v;
1025
+ return D;
1025
1026
 
1026
1027
  // Other possibilities:
1027
1028
  // return Code.ALREADY_EXISTS;
1028
1029
  case 416:
1029
1030
  // Range Not Satisfiable
1030
- return D;
1031
+ return b;
1031
1032
 
1032
1033
  case 429:
1033
1034
  // Too Many Requests
1034
- return g;
1035
+ return F;
1035
1036
 
1036
1037
  case 499:
1037
1038
  // Client Closed Request
1038
- return T;
1039
+ return R;
1039
1040
 
1040
1041
  case 500:
1041
1042
  // Internal Server Error
1042
- return R;
1043
+ return P;
1043
1044
 
1044
1045
  // Other possibilities:
1045
1046
  // return Code.INTERNAL;
1046
1047
  // return Code.DATA_LOSS;
1047
1048
  case 501:
1048
1049
  // Unimplemented
1049
- return b;
1050
+ return C;
1050
1051
 
1051
1052
  case 503:
1052
1053
  // Service Unavailable
1053
- return S;
1054
+ return N;
1054
1055
 
1055
1056
  case 504:
1056
1057
  // Gateway Timeout
1057
- return I;
1058
+ return V;
1058
1059
 
1059
1060
  default:
1060
- return t >= 200 && t < 300 ? A : t >= 400 && t < 500 ? F : t >= 500 && t < 600 ? C : R;
1061
+ return t >= 200 && t < 300 ? T : t >= 400 && t < 500 ? v : t >= 500 && t < 600 ? S : P;
1061
1062
  }
1062
1063
  }
1063
1064
 
@@ -1080,13 +1081,13 @@ function __PRIVATE_mapCodeFromHttpStatus(t) {
1080
1081
  /**
1081
1082
  * A Rest-based connection that relies on the native HTTP stack
1082
1083
  * (e.g. `fetch` or a polyfill).
1083
- */ (Q = $ || ($ = {}))[Q.OK = 0] = "OK", Q[Q.CANCELLED = 1] = "CANCELLED", Q[Q.UNKNOWN = 2] = "UNKNOWN",
1084
- Q[Q.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT", Q[Q.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED",
1085
- Q[Q.NOT_FOUND = 5] = "NOT_FOUND", Q[Q.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", Q[Q.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
1086
- Q[Q.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", Q[Q.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
1087
- Q[Q.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", Q[Q.ABORTED = 10] = "ABORTED",
1088
- Q[Q.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", Q[Q.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
1089
- Q[Q.INTERNAL = 13] = "INTERNAL", Q[Q.UNAVAILABLE = 14] = "UNAVAILABLE", Q[Q.DATA_LOSS = 15] = "DATA_LOSS";
1084
+ */ (L = Q || (Q = {}))[L.OK = 0] = "OK", L[L.CANCELLED = 1] = "CANCELLED", L[L.UNKNOWN = 2] = "UNKNOWN",
1085
+ L[L.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT", L[L.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED",
1086
+ L[L.NOT_FOUND = 5] = "NOT_FOUND", L[L.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", L[L.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
1087
+ L[L.UNAUTHENTICATED = 16] = "UNAUTHENTICATED", L[L.RESOURCE_EXHAUSTED = 8] = "RESOURCE_EXHAUSTED",
1088
+ L[L.FAILED_PRECONDITION = 9] = "FAILED_PRECONDITION", L[L.ABORTED = 10] = "ABORTED",
1089
+ L[L.OUT_OF_RANGE = 11] = "OUT_OF_RANGE", L[L.UNIMPLEMENTED = 12] = "UNIMPLEMENTED",
1090
+ L[L.INTERNAL = 13] = "INTERNAL", L[L.UNAVAILABLE = 14] = "UNAVAILABLE", L[L.DATA_LOSS = 15] = "DATA_LOSS";
1090
1091
 
1091
1092
  class __PRIVATE_FetchConnection extends
1092
1093
  /**
@@ -1130,7 +1131,7 @@ class __PRIVATE_RestConnection {
1130
1131
  // SDK_VERSION is updated to different value at runtime depending on the entry point,
1131
1132
  // so we need to get its value when we need it in a function.
1132
1133
  function __PRIVATE_getGoogApiClientValue() {
1133
- return "gl-js/ fire/" + E;
1134
+ return "gl-js/ fire/" + m;
1134
1135
  }(),
1135
1136
  // Content-Type: text/plain will avoid preflight requests which might
1136
1137
  // mess with CORS and redirects by proxies. If we add custom headers
@@ -1140,7 +1141,7 @@ class __PRIVATE_RestConnection {
1140
1141
  e && e.headers.forEach(((e, r) => t[r] = e)), r && r.headers.forEach(((e, r) => t[r] = e));
1141
1142
  }
1142
1143
  I(t, e) {
1143
- const r = B[t];
1144
+ const r = $[t];
1144
1145
  return `${this.m}/v1/${e}:${r}`;
1145
1146
  }
1146
1147
  /**
@@ -1493,7 +1494,7 @@ class ByteString {
1493
1494
 
1494
1495
  ByteString.EMPTY_BYTE_STRING = new ByteString("");
1495
1496
 
1496
- const L = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1497
+ const M = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1497
1498
 
1498
1499
  /**
1499
1500
  * Converts the possible Proto values for a timestamp value into a "seconds and
@@ -1507,7 +1508,7 @@ const L = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1507
1508
  // (millis), so we do some custom parsing here.
1508
1509
  // Parse the nanos right out of the string.
1509
1510
  let e = 0;
1510
- const r = L.exec(t);
1511
+ const r = M.exec(t);
1511
1512
  if (__PRIVATE_hardAssert(!!r), r[1]) {
1512
1513
  // Pad the fraction out to 9 digits (nanos).
1513
1514
  let t = r[1];
@@ -1590,11 +1591,11 @@ class Timestamp {
1590
1591
  * The fractions of a second at nanosecond resolution.*
1591
1592
  */
1592
1593
  e) {
1593
- if (this.seconds = t, this.nanoseconds = e, e < 0) throw new FirestoreError(P, "Timestamp nanoseconds out of range: " + e);
1594
- if (e >= 1e9) throw new FirestoreError(P, "Timestamp nanoseconds out of range: " + e);
1595
- if (t < -62135596800) throw new FirestoreError(P, "Timestamp seconds out of range: " + t);
1594
+ if (this.seconds = t, this.nanoseconds = e, e < 0) throw new FirestoreError(I, "Timestamp nanoseconds out of range: " + e);
1595
+ if (e >= 1e9) throw new FirestoreError(I, "Timestamp nanoseconds out of range: " + e);
1596
+ if (t < -62135596800) throw new FirestoreError(I, "Timestamp seconds out of range: " + t);
1596
1597
  // This will break in the year 10,000.
1597
- if (t >= 253402300800) throw new FirestoreError(P, "Timestamp seconds out of range: " + t);
1598
+ if (t >= 253402300800) throw new FirestoreError(I, "Timestamp seconds out of range: " + t);
1598
1599
  }
1599
1600
  /**
1600
1601
  * Creates a new timestamp with the current date, with millisecond precision.
@@ -1750,7 +1751,7 @@ class Timestamp {
1750
1751
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1751
1752
  * See the License for the specific language governing permissions and
1752
1753
  * limitations under the License.
1753
- */ const M = {
1754
+ */ const x = {
1754
1755
  fields: {
1755
1756
  __type__: {
1756
1757
  stringValue: "__max__"
@@ -1932,9 +1933,9 @@ function __PRIVATE_valueCompare(t, e) {
1932
1933
 
1933
1934
  case 10 /* TypeOrder.ObjectValue */ :
1934
1935
  return function __PRIVATE_compareMaps(t, e) {
1935
- if (t === M && e === M) return 0;
1936
- if (t === M) return 1;
1937
- if (e === M) return -1;
1936
+ if (t === x && e === x) return 0;
1937
+ if (t === x) return 1;
1938
+ if (e === x) return -1;
1938
1939
  const r = t.fields || {}, n = Object.keys(r), i = e.fields || {}, s = Object.keys(i);
1939
1940
  // Even though MapValues are likely sorted correctly based on their insertion
1940
1941
  // order (e.g. when received from the backend), local modifications can bring
@@ -3490,13 +3491,13 @@ function toNumber(t, e) {
3490
3491
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3491
3492
  * See the License for the specific language governing permissions and
3492
3493
  * limitations under the License.
3493
- */ const x = (() => {
3494
+ */ const k = (() => {
3494
3495
  const t = {
3495
3496
  asc: "ASCENDING",
3496
3497
  desc: "DESCENDING"
3497
3498
  };
3498
3499
  return t;
3499
- })(), k = (() => {
3500
+ })(), U = (() => {
3500
3501
  const t = {
3501
3502
  "<": "LESS_THAN",
3502
3503
  "<=": "LESS_THAN_OR_EQUAL",
@@ -3510,7 +3511,7 @@ function toNumber(t, e) {
3510
3511
  "array-contains-any": "ARRAY_CONTAINS_ANY"
3511
3512
  };
3512
3513
  return t;
3513
- })(), U = (() => {
3514
+ })(), j = (() => {
3514
3515
  const t = {
3515
3516
  and: "AND",
3516
3517
  or: "OR"
@@ -3599,8 +3600,8 @@ function fromName(t, e) {
3599
3600
  const e = ResourcePath.fromString(t);
3600
3601
  return __PRIVATE_hardAssert(__PRIVATE_isValidResourceName(e)), e;
3601
3602
  }(e);
3602
- if (r.get(1) !== t.databaseId.projectId) throw new FirestoreError(P, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
3603
- if (r.get(3) !== t.databaseId.database) throw new FirestoreError(P, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
3603
+ if (r.get(1) !== t.databaseId.projectId) throw new FirestoreError(I, "Tried to deserialize key from different project: " + r.get(1) + " vs " + t.databaseId.projectId);
3604
+ if (r.get(3) !== t.databaseId.database) throw new FirestoreError(I, "Tried to deserialize key from different database: " + r.get(3) + " vs " + t.databaseId.database);
3604
3605
  return new DocumentKey(function __PRIVATE_extractLocalPathFromResourceName(t) {
3605
3606
  return __PRIVATE_hardAssert(t.length > 4 && "documents" === t.get(4)), t.popFirst(5);
3606
3607
  }
@@ -3734,16 +3735,16 @@ function __PRIVATE_toQueryTarget(t, e) {
3734
3735
  }
3735
3736
 
3736
3737
  function __PRIVATE_toDirection(t) {
3737
- return x[t];
3738
+ return k[t];
3738
3739
  }
3739
3740
 
3740
3741
  // visible for testing
3741
3742
  function __PRIVATE_toOperatorName(t) {
3742
- return k[t];
3743
+ return U[t];
3743
3744
  }
3744
3745
 
3745
3746
  function __PRIVATE_toCompositeOperatorName(t) {
3746
- return U[t];
3747
+ return j[t];
3747
3748
  }
3748
3749
 
3749
3750
  function __PRIVATE_toFieldPathReference(t) {
@@ -3960,18 +3961,18 @@ class __PRIVATE_DatastoreImpl extends class Datastore {} {
3960
3961
  this.serializer = n, this.Y = !1;
3961
3962
  }
3962
3963
  Z() {
3963
- if (this.Y) throw new FirestoreError(F, "The client has already been terminated.");
3964
+ if (this.Y) throw new FirestoreError(v, "The client has already been terminated.");
3964
3965
  }
3965
3966
  /** Invokes the provided RPC with auth and AppCheck tokens. */ P(t, e, r, n) {
3966
3967
  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 => {
3967
- throw "FirebaseError" === t.name ? (t.code === w && (this.authCredentials.invalidateToken(),
3968
- this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(R, t.toString());
3968
+ throw "FirebaseError" === t.name ? (t.code === g && (this.authCredentials.invalidateToken(),
3969
+ this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(P, t.toString());
3969
3970
  }));
3970
3971
  }
3971
3972
  /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ g(t, e, r, n, i) {
3972
3973
  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 => {
3973
- throw "FirebaseError" === t.name ? (t.code === w && (this.authCredentials.invalidateToken(),
3974
- this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(R, t.toString());
3974
+ throw "FirebaseError" === t.name ? (t.code === g && (this.authCredentials.invalidateToken(),
3975
+ this.appCheckCredentials.invalidateToken()), t) : new FirestoreError(P, t.toString());
3975
3976
  }));
3976
3977
  }
3977
3978
  terminate() {
@@ -4085,7 +4086,7 @@ async function __PRIVATE_invokeRunAggregationQueryRpc(t, e, r) {
4085
4086
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4086
4087
  * See the License for the specific language governing permissions and
4087
4088
  * limitations under the License.
4088
- */ const j = new Map;
4089
+ */ const z = new Map;
4089
4090
 
4090
4091
  /**
4091
4092
  * An instance map that ensures only one Datastore exists per Firestore
@@ -4097,8 +4098,8 @@ async function __PRIVATE_invokeRunAggregationQueryRpc(t, e, r) {
4097
4098
  * instance is terminated.
4098
4099
  */
4099
4100
  function __PRIVATE_getDatastore(t) {
4100
- if (t._terminated) throw new FirestoreError(F, "The client has already been terminated.");
4101
- if (!j.has(t)) {
4101
+ if (t._terminated) throw new FirestoreError(v, "The client has already been terminated.");
4102
+ if (!z.has(t)) {
4102
4103
  __PRIVATE_logDebug("ComponentProvider", "Initializing Datastore");
4103
4104
  const e = function __PRIVATE_newConnection(t) {
4104
4105
  return new __PRIVATE_FetchConnection(t, fetch.bind(null));
@@ -4123,9 +4124,9 @@ function __PRIVATE_getDatastore(t) {
4123
4124
  */ (t._databaseId, t.app.options.appId || "", t._persistenceKey, t._freezeSettings())), r = __PRIVATE_newSerializer(t._databaseId), n = function __PRIVATE_newDatastore(t, e, r, n) {
4124
4125
  return new __PRIVATE_DatastoreImpl(t, e, r, n);
4125
4126
  }(t._authCredentials, t._appCheckCredentials, e, r);
4126
- j.set(t, n);
4127
+ z.set(t, n);
4127
4128
  }
4128
- return j.get(t);
4129
+ return z.get(t);
4129
4130
  }
4130
4131
 
4131
4132
  /**
@@ -4141,16 +4142,16 @@ class FirestoreSettingsImpl {
4141
4142
  constructor(t) {
4142
4143
  var e, r;
4143
4144
  if (void 0 === t.host) {
4144
- if (void 0 !== t.ssl) throw new FirestoreError(P, "Can't provide ssl option if host option is not set");
4145
+ if (void 0 !== t.ssl) throw new FirestoreError(I, "Can't provide ssl option if host option is not set");
4145
4146
  this.host = "firestore.googleapis.com", this.ssl = true;
4146
4147
  } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;
4147
4148
  if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties,
4148
4149
  this.localCache = t.localCache, void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
4149
- if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(P, "cacheSizeBytes must be at least 1048576");
4150
+ if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new FirestoreError(I, "cacheSizeBytes must be at least 1048576");
4150
4151
  this.cacheSizeBytes = t.cacheSizeBytes;
4151
4152
  }
4152
4153
  !function __PRIVATE_validateIsNotUsedTogether(t, e, r, n) {
4153
- if (!0 === e && !0 === n) throw new FirestoreError(P, `${t} and ${r} cannot be used together.`);
4154
+ if (!0 === e && !0 === n) throw new FirestoreError(I, `${t} and ${r} cannot be used together.`);
4154
4155
  }("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling),
4155
4156
  this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalForceLongPolling ? this.experimentalAutoDetectLongPolling = !1 : void 0 === t.experimentalAutoDetectLongPolling ? this.experimentalAutoDetectLongPolling = true :
4156
4157
  // For backwards compatibility, coerce the value to boolean even though
@@ -4160,9 +4161,9 @@ class FirestoreSettingsImpl {
4160
4161
  this.experimentalLongPollingOptions = __PRIVATE_cloneLongPollingOptions(null !== (r = t.experimentalLongPollingOptions) && void 0 !== r ? r : {}),
4161
4162
  function __PRIVATE_validateLongPollingOptions(t) {
4162
4163
  if (void 0 !== t.timeoutSeconds) {
4163
- if (isNaN(t.timeoutSeconds)) throw new FirestoreError(P, `invalid long polling timeout: ${t.timeoutSeconds} (must not be NaN)`);
4164
- if (t.timeoutSeconds < 5) throw new FirestoreError(P, `invalid long polling timeout: ${t.timeoutSeconds} (minimum allowed value is 5)`);
4165
- if (t.timeoutSeconds > 30) throw new FirestoreError(P, `invalid long polling timeout: ${t.timeoutSeconds} (maximum allowed value is 30)`);
4164
+ if (isNaN(t.timeoutSeconds)) throw new FirestoreError(I, `invalid long polling timeout: ${t.timeoutSeconds} (must not be NaN)`);
4165
+ if (t.timeoutSeconds < 5) throw new FirestoreError(I, `invalid long polling timeout: ${t.timeoutSeconds} (minimum allowed value is 5)`);
4166
+ if (t.timeoutSeconds > 30) throw new FirestoreError(I, `invalid long polling timeout: ${t.timeoutSeconds} (maximum allowed value is 30)`);
4166
4167
  }
4167
4168
  }
4168
4169
  /**
@@ -4209,7 +4210,7 @@ class Firestore {
4209
4210
  * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
4210
4211
  * instance.
4211
4212
  */ get app() {
4212
- if (!this._app) throw new FirestoreError(F, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
4213
+ if (!this._app) throw new FirestoreError(v, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
4213
4214
  return this._app;
4214
4215
  }
4215
4216
  get _initialized() {
@@ -4219,7 +4220,7 @@ class Firestore {
4219
4220
  return void 0 !== this._terminateTask;
4220
4221
  }
4221
4222
  _setSettings(t) {
4222
- if (this._settingsFrozen) throw new FirestoreError(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.");
4223
+ if (this._settingsFrozen) throw new FirestoreError(v, "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.");
4223
4224
  this._settings = new FirestoreSettingsImpl(t), void 0 !== t.credentials && (this._authCredentials = function __PRIVATE_makeAuthCredentialsProvider(t) {
4224
4225
  if (!t) return new __PRIVATE_EmptyAuthCredentialsProvider;
4225
4226
  switch (t.type) {
@@ -4230,7 +4231,7 @@ class Firestore {
4230
4231
  return t.client;
4231
4232
 
4232
4233
  default:
4233
- throw new FirestoreError(P, "makeAuthCredentialsProvider failed due to invalid credential type");
4234
+ throw new FirestoreError(I, "makeAuthCredentialsProvider failed due to invalid credential type");
4234
4235
  }
4235
4236
  }(t.credentials));
4236
4237
  }
@@ -4258,8 +4259,8 @@ class Firestore {
4258
4259
  * Only ever called once.
4259
4260
  */ _terminate() {
4260
4261
  return function __PRIVATE_removeComponents(t) {
4261
- const e = j.get(t);
4262
- e && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"), j.delete(t),
4262
+ const e = z.get(t);
4263
+ e && (__PRIVATE_logDebug("ComponentProvider", "Removing Datastore"), z.delete(t),
4263
4264
  e.terminate());
4264
4265
  }(this), Promise.resolve();
4265
4266
  }
@@ -4268,7 +4269,7 @@ class Firestore {
4268
4269
  function initializeFirestore(t, e, r) {
4269
4270
  r || (r = "(default)");
4270
4271
  const n = _getProvider(t, "firestore/lite");
4271
- if (n.isInitialized(r)) throw new FirestoreError(F, "Firestore can only be initialized once per app.");
4272
+ if (n.isInitialized(r)) throw new FirestoreError(v, "Firestore can only be initialized once per app.");
4272
4273
  return n.initialize({
4273
4274
  options: e,
4274
4275
  instanceIdentifier: r
@@ -4312,7 +4313,7 @@ function getFirestore(e, r) {
4312
4313
  // invalid field "uid" and missing field "sub" / "user_id".)
4313
4314
  e = h(n.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);
4314
4315
  const s = n.mockUserToken.sub || n.mockUserToken.user_id;
4315
- if (!s) throw new FirestoreError(P, "mockUserToken must contain 'sub' or 'user_id' field!");
4316
+ if (!s) throw new FirestoreError(I, "mockUserToken must contain 'sub' or 'user_id' field!");
4316
4317
  r = new User(s);
4317
4318
  }
4318
4319
  t._authCredentials = new __PRIVATE_EmulatorAuthCredentialsProvider(new __PRIVATE_OAuthToken(e, r));
@@ -4531,7 +4532,7 @@ function collection(t, e, ...r) {
4531
4532
  return __PRIVATE_validateCollectionPath(n), new CollectionReference(t, /* converter= */ null, n);
4532
4533
  }
4533
4534
  {
4534
- if (!(t instanceof DocumentReference || t instanceof CollectionReference)) throw new FirestoreError(P, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4535
+ if (!(t instanceof DocumentReference || t instanceof CollectionReference)) throw new FirestoreError(I, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4535
4536
  const n = t._path.child(ResourcePath.fromString(e, ...r));
4536
4537
  return __PRIVATE_validateCollectionPath(n), new CollectionReference(t.firestore,
4537
4538
  /* converter= */ null, n);
@@ -4552,7 +4553,7 @@ function collection(t, e, ...r) {
4552
4553
  * @returns The created `Query`.
4553
4554
  */ function collectionGroup(t, e) {
4554
4555
  if (t = __PRIVATE_cast(t, Firestore), __PRIVATE_validateNonEmptyArgument("collectionGroup", "collection id", e),
4555
- e.indexOf("/") >= 0) throw new FirestoreError(P, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
4556
+ e.indexOf("/") >= 0) throw new FirestoreError(I, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
4556
4557
  return new Query(t,
4557
4558
  /* converter= */ null, function __PRIVATE_newQueryForCollectionGroup(t) {
4558
4559
  return new __PRIVATE_QueryImpl(ResourcePath.emptyPath(), t);
@@ -4570,7 +4571,7 @@ function doc(t, e, ...r) {
4570
4571
  /* converter= */ null, new DocumentKey(n));
4571
4572
  }
4572
4573
  {
4573
- if (!(t instanceof DocumentReference || t instanceof CollectionReference)) throw new FirestoreError(P, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4574
+ if (!(t instanceof DocumentReference || t instanceof CollectionReference)) throw new FirestoreError(I, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4574
4575
  const n = t._path.child(ResourcePath.fromString(e, ...r));
4575
4576
  return __PRIVATE_validateDocumentPath(n), new DocumentReference(t.firestore, t instanceof CollectionReference ? t.converter : null, new DocumentKey(n));
4576
4577
  }
@@ -4631,7 +4632,7 @@ function doc(t, e, ...r) {
4631
4632
  try {
4632
4633
  return new Bytes(ByteString.fromBase64String(t));
4633
4634
  } catch (t) {
4634
- throw new FirestoreError(P, "Failed to construct data from Base64 string: " + t);
4635
+ throw new FirestoreError(I, "Failed to construct data from Base64 string: " + t);
4635
4636
  }
4636
4637
  }
4637
4638
  /**
@@ -4703,7 +4704,7 @@ function doc(t, e, ...r) {
4703
4704
  * @param fieldNames - A list of field names.
4704
4705
  */
4705
4706
  constructor(...t) {
4706
- for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new FirestoreError(P, "Invalid field name at argument $(i + 1). Field names must not be empty.");
4707
+ for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new FirestoreError(I, "Invalid field name at argument $(i + 1). Field names must not be empty.");
4707
4708
  this._internalPath = new FieldPath$1(t);
4708
4709
  }
4709
4710
  /**
@@ -4782,8 +4783,8 @@ function doc(t, e, ...r) {
4782
4783
  * @param longitude - The longitude as number between -180 and 180.
4783
4784
  */
4784
4785
  constructor(t, e) {
4785
- if (!isFinite(t) || t < -90 || t > 90) throw new FirestoreError(P, "Latitude must be a number between -90 and 90, but was: " + t);
4786
- if (!isFinite(e) || e < -180 || e > 180) throw new FirestoreError(P, "Longitude must be a number between -180 and 180, but was: " + e);
4786
+ if (!isFinite(t) || t < -90 || t > 90) throw new FirestoreError(I, "Latitude must be a number between -90 and 90, but was: " + t);
4787
+ if (!isFinite(e) || e < -180 || e > 180) throw new FirestoreError(I, "Longitude must be a number between -180 and 180, but was: " + e);
4787
4788
  this._lat = t, this._long = e;
4788
4789
  }
4789
4790
  /**
@@ -4833,7 +4834,7 @@ function doc(t, e, ...r) {
4833
4834
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4834
4835
  * See the License for the specific language governing permissions and
4835
4836
  * limitations under the License.
4836
- */ const z = /^__.*__$/;
4837
+ */ const W = /^__.*__$/;
4837
4838
 
4838
4839
  /** The result of parsing document data (e.g. for a setData call). */ class ParsedSetData {
4839
4840
  constructor(t, e, r) {
@@ -4944,7 +4945,7 @@ function __PRIVATE_isWrite(t) {
4944
4945
  }
4945
4946
  st(t) {
4946
4947
  if (0 === t.length) throw this._t("Document fields must not be empty");
4947
- if (__PRIVATE_isWrite(this.et) && z.test(t)) throw this._t('Document fields cannot begin and end with "__"');
4948
+ if (__PRIVATE_isWrite(this.et) && W.test(t)) throw this._t('Document fields cannot begin and end with "__"');
4948
4949
  }
4949
4950
  }
4950
4951
 
@@ -4981,7 +4982,7 @@ function __PRIVATE_newUserDataReader(t) {
4981
4982
  const t = [];
4982
4983
  for (const n of s.mergeFields) {
4983
4984
  const i = __PRIVATE_fieldPathFromArgument$1(e, n, r);
4984
- if (!o.contains(i)) throw new FirestoreError(P, `Field '${i}' is specified in your field mask but missing from your input data.`);
4985
+ if (!o.contains(i)) throw new FirestoreError(I, `Field '${i}' is specified in your field mask but missing from your input data.`);
4985
4986
  __PRIVATE_fieldMaskContains(t, i) || t.push(i);
4986
4987
  }
4987
4988
  u = new FieldMask(t), _ = o.fieldTransforms.filter((t => u.covers(t.field)));
@@ -5098,7 +5099,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
5098
5099
 
5099
5100
  /** Parse update data from a list of field/value arguments. */ function __PRIVATE_parseUpdateVarargs(t, e, r, n, i, s) {
5100
5101
  const o = t.ht(1 /* UserDataSource.Update */ , e, r), a = [ __PRIVATE_fieldPathFromArgument$1(e, n, r) ], u = [ i ];
5101
- if (s.length % 2 != 0) throw new FirestoreError(P, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);
5102
+ if (s.length % 2 != 0) throw new FirestoreError(I, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);
5102
5103
  for (let t = 0; t < s.length; t += 2) a.push(__PRIVATE_fieldPathFromArgument$1(e, s[t])),
5103
5104
  u.push(s[t + 1]);
5104
5105
  const _ = [], c = ObjectValue.empty();
@@ -5302,7 +5303,7 @@ function __PRIVATE_validatePlainObject(t, e, r) {
5302
5303
 
5303
5304
  /**
5304
5305
  * Matches any characters in a field path string that are reserved.
5305
- */ const W = new RegExp("[~\\*/\\[\\]]");
5306
+ */ const K = new RegExp("[~\\*/\\[\\]]");
5306
5307
 
5307
5308
  /**
5308
5309
  * Wraps fromDotSeparatedString with an error message about the method that
@@ -5313,7 +5314,7 @@ function __PRIVATE_validatePlainObject(t, e, r) {
5313
5314
  * @param targetDoc - The document against which the field path will be
5314
5315
  * evaluated.
5315
5316
  */ function __PRIVATE_fieldPathFromDotSeparatedString(t, e, r) {
5316
- if (e.search(W) >= 0) throw __PRIVATE_createError(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t,
5317
+ if (e.search(K) >= 0) throw __PRIVATE_createError(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t,
5317
5318
  /* hasConverter= */ !1,
5318
5319
  /* path= */ void 0, r);
5319
5320
  try {
@@ -5331,7 +5332,7 @@ function __PRIVATE_createError(t, e, r, n, i) {
5331
5332
  r && (a += " (via `toFirestore()`)"), a += ". ";
5332
5333
  let u = "";
5333
5334
  return (s || o) && (u += " (found", s && (u += ` in field ${n}`), o && (u += ` in document ${i}`),
5334
- u += ")"), new FirestoreError(P, a + t + u);
5335
+ u += ")"), new FirestoreError(I, a + t + u);
5335
5336
  }
5336
5337
 
5337
5338
  /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function __PRIVATE_fieldMaskContains(t, e) {
@@ -5528,7 +5529,7 @@ function query(t, e, ...r) {
5528
5529
  let n = [];
5529
5530
  e instanceof AppliableConstraint && n.push(e), n = n.concat(r), function __PRIVATE_validateQueryConstraintArray(t) {
5530
5531
  const e = t.filter((t => t instanceof QueryCompositeFilterConstraint)).length, r = t.filter((t => t instanceof QueryFieldFilterConstraint)).length;
5531
- if (e > 1 || e > 0 && r > 0) throw new FirestoreError(P, "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(...)))`.");
5532
+ if (e > 1 || e > 0 && r > 0) throw new FirestoreError(I, "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(...)))`.");
5532
5533
  }
5533
5534
  /**
5534
5535
  * @license
@@ -5582,7 +5583,7 @@ function query(t, e, ...r) {
5582
5583
  const e = __PRIVATE_newUserDataReader(t.firestore), r = function __PRIVATE_newQueryFilter(t, e, r, n, i, s, o) {
5583
5584
  let a;
5584
5585
  if (i.isKeyField()) {
5585
- if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(P, `Invalid Query. You can't perform '${s}' queries on documentId().`);
5586
+ if ("array-contains" /* Operator.ARRAY_CONTAINS */ === s || "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === s) throw new FirestoreError(I, `Invalid Query. You can't perform '${s}' queries on documentId().`);
5586
5587
  if ("in" /* Operator.IN */ === s || "not-in" /* Operator.NOT_IN */ === s) {
5587
5588
  __PRIVATE_validateDisjunctiveFilterElements(o, s);
5588
5589
  const e = [];
@@ -5709,8 +5710,8 @@ function query(t, e, ...r) {
5709
5710
  }
5710
5711
  _apply(t) {
5711
5712
  const e = function __PRIVATE_newQueryOrderBy(t, e, r) {
5712
- if (null !== t.startAt) throw new FirestoreError(P, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
5713
- if (null !== t.endAt) throw new FirestoreError(P, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
5713
+ if (null !== t.startAt) throw new FirestoreError(I, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
5714
+ if (null !== t.endAt) throw new FirestoreError(I, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
5714
5715
  return new OrderBy(e, r);
5715
5716
  }
5716
5717
  /**
@@ -5870,7 +5871,7 @@ function endAt(...t) {
5870
5871
 
5871
5872
  /** Helper function to create a bound from a document or fields */ function __PRIVATE_newQueryBoundFromDocOrFields(t, e, r, n) {
5872
5873
  if (r[0] = d(r[0]), r[0] instanceof DocumentSnapshot) return function __PRIVATE_newQueryBoundFromDocument(t, e, r, n, i) {
5873
- if (!n) throw new FirestoreError(V, `Can't use a DocumentSnapshot that doesn't exist for ${r}().`);
5874
+ if (!n) throw new FirestoreError(p, `Can't use a DocumentSnapshot that doesn't exist for ${r}().`);
5874
5875
  const s = [];
5875
5876
  // Because people expect to continue/end a query at the exact document
5876
5877
  // provided, we need to use the implicit sort order rather than the explicit
@@ -5881,10 +5882,10 @@ function endAt(...t) {
5881
5882
  // results.
5882
5883
  for (const r of __PRIVATE_queryNormalizedOrderBy(t)) if (r.field.isKeyField()) s.push(__PRIVATE_refValue(e, n.key)); else {
5883
5884
  const t = n.data.field(r.field);
5884
- if (__PRIVATE_isServerTimestamp(t)) throw new FirestoreError(P, '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.)');
5885
+ if (__PRIVATE_isServerTimestamp(t)) throw new FirestoreError(I, '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.)');
5885
5886
  if (null === t) {
5886
5887
  const t = r.field.canonicalString();
5887
- throw new FirestoreError(P, `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.`);
5888
+ throw new FirestoreError(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.`);
5888
5889
  }
5889
5890
  s.push(t);
5890
5891
  }
@@ -5898,15 +5899,15 @@ function endAt(...t) {
5898
5899
  return function __PRIVATE_newQueryBoundFromFields(t, e, r, n, i, s) {
5899
5900
  // Use explicit order by's because it has to match the query the user made
5900
5901
  const o = t.explicitOrderBy;
5901
- if (i.length > o.length) throw new FirestoreError(P, `Too many arguments provided to ${n}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
5902
+ if (i.length > o.length) throw new FirestoreError(I, `Too many arguments provided to ${n}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
5902
5903
  const a = [];
5903
5904
  for (let s = 0; s < i.length; s++) {
5904
5905
  const u = i[s];
5905
5906
  if (o[s].field.isKeyField()) {
5906
- if ("string" != typeof u) throw new FirestoreError(P, `Invalid query. Expected a string for document ID in ${n}(), but got a ${typeof u}`);
5907
- if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== u.indexOf("/")) throw new FirestoreError(P, `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.`);
5907
+ if ("string" != typeof u) throw new FirestoreError(I, `Invalid query. Expected a string for document ID in ${n}(), but got a ${typeof u}`);
5908
+ if (!__PRIVATE_isCollectionGroupQuery(t) && -1 !== u.indexOf("/")) throw new FirestoreError(I, `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.`);
5908
5909
  const r = t.path.child(ResourcePath.fromString(u));
5909
- if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(P, `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.`);
5910
+ if (!DocumentKey.isDocumentKey(r)) throw new FirestoreError(I, `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.`);
5910
5911
  const i = new DocumentKey(r);
5911
5912
  a.push(__PRIVATE_refValue(e, i));
5912
5913
  } else {
@@ -5926,21 +5927,21 @@ function endAt(...t) {
5926
5927
 
5927
5928
  function __PRIVATE_parseDocumentIdValue(t, e, r) {
5928
5929
  if ("string" == typeof (r = d(r))) {
5929
- if ("" === r) throw new FirestoreError(P, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
5930
- if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== r.indexOf("/")) throw new FirestoreError(P, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${r}' contains a '/' character.`);
5930
+ if ("" === r) throw new FirestoreError(I, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
5931
+ if (!__PRIVATE_isCollectionGroupQuery(e) && -1 !== r.indexOf("/")) throw new FirestoreError(I, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${r}' contains a '/' character.`);
5931
5932
  const n = e.path.child(ResourcePath.fromString(r));
5932
- if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(P, `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}).`);
5933
+ if (!DocumentKey.isDocumentKey(n)) throw new FirestoreError(I, `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}).`);
5933
5934
  return __PRIVATE_refValue(t, new DocumentKey(n));
5934
5935
  }
5935
5936
  if (r instanceof DocumentReference) return __PRIVATE_refValue(t, r._key);
5936
- throw new FirestoreError(P, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${__PRIVATE_valueDescription(r)}.`);
5937
+ throw new FirestoreError(I, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${__PRIVATE_valueDescription(r)}.`);
5937
5938
  }
5938
5939
 
5939
5940
  /**
5940
5941
  * Validates that the value passed into a disjunctive filter satisfies all
5941
5942
  * array requirements.
5942
5943
  */ function __PRIVATE_validateDisjunctiveFilterElements(t, e) {
5943
- if (!Array.isArray(t) || 0 === t.length) throw new FirestoreError(P, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);
5944
+ if (!Array.isArray(t) || 0 === t.length) throw new FirestoreError(I, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);
5944
5945
  }
5945
5946
 
5946
5947
  /**
@@ -5974,11 +5975,11 @@ function __PRIVATE_parseDocumentIdValue(t, e, r) {
5974
5975
  }(e.op));
5975
5976
  if (null !== r)
5976
5977
  // Special case when it's a duplicate op to give a slightly clearer error message.
5977
- throw r === e.op ? new FirestoreError(P, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new FirestoreError(P, `Invalid query. You cannot use '${e.op.toString()}' filters with '${r.toString()}' filters.`);
5978
+ throw r === e.op ? new FirestoreError(I, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new FirestoreError(I, `Invalid query. You cannot use '${e.op.toString()}' filters with '${r.toString()}' filters.`);
5978
5979
  }
5979
5980
 
5980
5981
  function __PRIVATE_validateQueryFilterConstraint(t, e) {
5981
- if (!(e instanceof QueryFieldFilterConstraint || e instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(P, `Function ${t}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`);
5982
+ if (!(e instanceof QueryFieldFilterConstraint || e instanceof QueryCompositeFilterConstraint)) throw new FirestoreError(I, `Function ${t}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`);
5982
5983
  }
5983
5984
 
5984
5985
  /**
@@ -6145,7 +6146,7 @@ class __PRIVATE_LiteUserDataWriter extends class AbstractUserDataWriter {
6145
6146
  * @returns A Promise that will be resolved with the results of the query.
6146
6147
  */ function getDocs(t) {
6147
6148
  (function __PRIVATE_validateHasExplicitOrderByForLimitToLast(t) {
6148
- if ("L" /* LimitType.Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new FirestoreError(b, "limitToLast() queries require specifying at least one orderBy() clause");
6149
+ if ("L" /* LimitType.Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new FirestoreError(C, "limitToLast() queries require specifying at least one orderBy() clause");
6149
6150
  })((t = __PRIVATE_cast(t, Query))._query);
6150
6151
  const e = __PRIVATE_getDatastore(t.firestore), r = new __PRIVATE_LiteUserDataWriter(t.firestore);
6151
6152
  return __PRIVATE_invokeRunQueryRpc(e, t._query).then((e => {
@@ -6482,12 +6483,12 @@ function sum(t) {
6482
6483
  return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
6483
6484
  }
6484
6485
  _verifyNotCommitted() {
6485
- if (this._committed) throw new FirestoreError(F, "A write batch can no longer be used after commit() has been called.");
6486
+ if (this._committed) throw new FirestoreError(v, "A write batch can no longer be used after commit() has been called.");
6486
6487
  }
6487
6488
  }
6488
6489
 
6489
6490
  function __PRIVATE_validateReference(t, e) {
6490
- if ((t = d(t)).firestore !== e) throw new FirestoreError(P, "Provided document reference is from a different Firestore instance.");
6491
+ if ((t = d(t)).firestore !== e) throw new FirestoreError(I, "Provided document reference is from a different Firestore instance.");
6491
6492
  return t;
6492
6493
  }
6493
6494
 
@@ -6546,7 +6547,7 @@ function __PRIVATE_validateReference(t, e) {
6546
6547
  this.writtenDocs = new Set;
6547
6548
  }
6548
6549
  async lookup(t) {
6549
- if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(P, "Firestore transactions require all reads to be executed before all writes."),
6550
+ if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw this.lastTransactionError = new FirestoreError(I, "Firestore transactions require all reads to be executed before all writes."),
6550
6551
  this.lastTransactionError;
6551
6552
  const e = await __PRIVATE_invokeBatchGetDocumentsRpc(this.datastore, t);
6552
6553
  return e.forEach((t => this.recordVersion(t))), e;
@@ -6590,7 +6591,7 @@ function __PRIVATE_validateReference(t, e) {
6590
6591
  if (r) {
6591
6592
  if (!e.isEqual(r))
6592
6593
  // This transaction will fail no matter what.
6593
- throw new FirestoreError(v, "Document version changed between two reads.");
6594
+ throw new FirestoreError(D, "Document version changed between two reads.");
6594
6595
  } else this.readVersions.set(t.key.toString(), e);
6595
6596
  }
6596
6597
  /**
@@ -6617,7 +6618,7 @@ function __PRIVATE_validateReference(t, e) {
6617
6618
  // express that to the backend, we have to validate locally.
6618
6619
  // Note: this can change once we can send separate verify writes in the
6619
6620
  // transaction.
6620
- throw new FirestoreError(P, "Can't update a document that doesn't exist.");
6621
+ throw new FirestoreError(I, "Can't update a document that doesn't exist.");
6621
6622
  // Document exists, base precondition on document update time.
6622
6623
  return Precondition.updateTime(e);
6623
6624
  }
@@ -6646,7 +6647,7 @@ function __PRIVATE_validateReference(t, e) {
6646
6647
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6647
6648
  * See the License for the specific language governing permissions and
6648
6649
  * limitations under the License.
6649
- */ const K = {
6650
+ */ const G = {
6650
6651
  maxAttempts: 5
6651
6652
  };
6652
6653
 
@@ -6723,29 +6724,29 @@ class __PRIVATE_TransactionRunner {
6723
6724
  default:
6724
6725
  return fail();
6725
6726
 
6726
- case T:
6727
6727
  case R:
6728
- case I:
6729
- case g:
6730
- case C:
6728
+ case P:
6729
+ case V:
6730
+ case F:
6731
6731
  case S:
6732
+ case N:
6732
6733
  // Unauthenticated means something went wrong with our token and we need
6733
6734
  // to retry with new credentials which will happen automatically.
6734
- case w:
6735
+ case g:
6735
6736
  return !1;
6736
6737
 
6737
- case P:
6738
- case V:
6738
+ case I:
6739
6739
  case p:
6740
6740
  case y:
6741
- case F:
6741
+ case w:
6742
+ case v:
6742
6743
  // Aborted might be retried in some scenarios, but that is dependant on
6743
6744
  // the context and should handled individually by the calling code.
6744
6745
  // See https://cloud.google.com/apis/design/errors.
6745
- case v:
6746
- case D:
6746
+ case D:
6747
6747
  case b:
6748
- case N:
6748
+ case C:
6749
+ case O:
6749
6750
  return !0;
6750
6751
  }
6751
6752
  }(e);
@@ -6850,7 +6851,7 @@ class __PRIVATE_TransactionRunner {
6850
6851
  * As long as the operation has not yet been run, calling cancel() provides a
6851
6852
  * guarantee that the operation will not be run.
6852
6853
  */ cancel(t) {
6853
- null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(T, "Operation cancelled" + (t ? ": " + t : ""))));
6854
+ null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new FirestoreError(R, "Operation cancelled" + (t ? ": " + t : ""))));
6854
6855
  }
6855
6856
  handleDelayElapsed() {
6856
6857
  this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(),
@@ -7178,9 +7179,9 @@ class Transaction {
7178
7179
  * `updateFunction `is returned here. Otherwise, if the transaction failed, a
7179
7180
  * rejected promise with the corresponding failure error is returned.
7180
7181
  */ function runTransaction(t, e, r) {
7181
- const n = __PRIVATE_getDatastore(t = __PRIVATE_cast(t, Firestore)), i = Object.assign(Object.assign({}, K), r);
7182
+ const n = __PRIVATE_getDatastore(t = __PRIVATE_cast(t, Firestore)), i = Object.assign(Object.assign({}, G), r);
7182
7183
  !function __PRIVATE_validateTransactionOptions(t) {
7183
- if (t.maxAttempts < 1) throw new FirestoreError(P, "Max attempts must be at least 1");
7184
+ if (t.maxAttempts < 1) throw new FirestoreError(I, "Max attempts must be at least 1");
7184
7185
  }(i);
7185
7186
  const s = new __PRIVATE_Deferred;
7186
7187
  return new __PRIVATE_TransactionRunner(function __PRIVATE_newAsyncQueue() {
@@ -7197,10 +7198,10 @@ class Transaction {
7197
7198
  * @packageDocumentation
7198
7199
  */ !function __PRIVATE_registerFirestore() {
7199
7200
  !function __PRIVATE_setSDKVersion(t) {
7200
- E = t;
7201
+ m = t;
7201
7202
  }(`${i}_lite`), r(new s("firestore/lite", ((t, {instanceIdentifier: e, options: r}) => {
7202
7203
  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) {
7203
- if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new FirestoreError(P, '"projectId" not provided in firebase.initializeApp.');
7204
+ if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new FirestoreError(I, '"projectId" not provided in firebase.initializeApp.');
7204
7205
  return new DatabaseId(t.options.projectId, e);
7205
7206
  }
7206
7207
  /**
@@ -7222,7 +7223,7 @@ class Transaction {
7222
7223
  return r && i._setSettings(r), i;
7223
7224
  }), "PUBLIC").setMultipleInstances(!0)),
7224
7225
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
7225
- n("firestore-lite", "4.6.2-canary.8fb372afb", "rn"), n("firestore-lite", "4.6.2-canary.8fb372afb", "esm2017");
7226
+ n("firestore-lite", E, "rn"), n("firestore-lite", E, "esm2017");
7226
7227
  }();
7227
7228
 
7228
7229
  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 };