@firebase/firestore 3.4.3-canary.e80d18d65 → 3.4.4-canary.2dd99ae2d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
  3. package/dist/firestore/src/api.d.ts +1 -1
  4. package/dist/firestore/src/core/database_info.d.ts +1 -0
  5. package/dist/firestore/src/core/firestore_client.d.ts +2 -0
  6. package/dist/firestore/src/core/target.d.ts +26 -1
  7. package/dist/firestore/src/local/local_serializer.d.ts +1 -1
  8. package/dist/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
  9. package/dist/firestore/src/model/document.d.ts +7 -0
  10. package/dist/firestore/src/model/document_key.d.ts +1 -0
  11. package/dist/firestore/src/model/field_index.d.ts +87 -7
  12. package/dist/firestore/src/model/values.d.ts +7 -0
  13. package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
  14. package/dist/firestore/test/unit/model/field_index.test.d.ts +17 -0
  15. package/dist/firestore/test/unit/model/target.test.d.ts +17 -0
  16. package/dist/firestore/test/util/helpers.d.ts +8 -2
  17. package/dist/index.esm2017.js +3317 -3218
  18. package/dist/index.esm2017.js.map +1 -1
  19. package/dist/index.esm5.js +3685 -3620
  20. package/dist/index.esm5.js.map +1 -1
  21. package/dist/index.node.cjs.js +309 -152
  22. package/dist/index.node.cjs.js.map +1 -1
  23. package/dist/index.node.mjs +309 -152
  24. package/dist/index.node.mjs.map +1 -1
  25. package/dist/index.rn.js +3316 -3259
  26. package/dist/index.rn.js.map +1 -1
  27. package/dist/internal.d.ts +14 -12
  28. package/dist/lite/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
  29. package/dist/lite/firestore/src/api.d.ts +1 -1
  30. package/dist/lite/firestore/src/core/database_info.d.ts +1 -0
  31. package/dist/lite/firestore/src/core/firestore_client.d.ts +2 -0
  32. package/dist/lite/firestore/src/core/target.d.ts +26 -1
  33. package/dist/lite/firestore/src/local/local_serializer.d.ts +1 -1
  34. package/dist/lite/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
  35. package/dist/lite/firestore/src/model/document.d.ts +7 -0
  36. package/dist/lite/firestore/src/model/document_key.d.ts +1 -0
  37. package/dist/lite/firestore/src/model/field_index.d.ts +87 -7
  38. package/dist/lite/firestore/src/model/values.d.ts +7 -0
  39. package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
  40. package/dist/lite/firestore/test/unit/model/field_index.test.d.ts +17 -0
  41. package/dist/lite/firestore/test/unit/model/target.test.d.ts +17 -0
  42. package/dist/lite/firestore/test/util/helpers.d.ts +8 -2
  43. package/dist/lite/index.browser.esm2017.js +20 -9
  44. package/dist/lite/index.browser.esm2017.js.map +1 -1
  45. package/dist/lite/index.browser.esm5.js +88 -81
  46. package/dist/lite/index.browser.esm5.js.map +1 -1
  47. package/dist/lite/index.node.cjs.js +20 -8
  48. package/dist/lite/index.node.cjs.js.map +1 -1
  49. package/dist/lite/index.node.mjs +20 -8
  50. package/dist/lite/index.node.mjs.map +1 -1
  51. package/dist/lite/index.rn.esm2017.js +20 -9
  52. package/dist/lite/index.rn.esm2017.js.map +1 -1
  53. package/dist/lite/internal.d.ts +9 -0
  54. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +1 -0
  55. package/dist/lite/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
  56. package/dist/lite/packages/firestore/src/api.d.ts +1 -1
  57. package/dist/lite/packages/firestore/src/core/database_info.d.ts +1 -0
  58. package/dist/lite/packages/firestore/src/core/firestore_client.d.ts +2 -0
  59. package/dist/lite/packages/firestore/src/core/target.d.ts +26 -1
  60. package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +1 -1
  61. package/dist/lite/packages/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
  62. package/dist/lite/packages/firestore/src/model/document.d.ts +7 -0
  63. package/dist/lite/packages/firestore/src/model/document_key.d.ts +1 -0
  64. package/dist/lite/packages/firestore/src/model/field_index.d.ts +87 -7
  65. package/dist/lite/packages/firestore/src/model/values.d.ts +7 -0
  66. package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
  67. package/dist/lite/packages/firestore/test/unit/model/field_index.test.d.ts +17 -0
  68. package/dist/lite/packages/firestore/test/unit/model/target.test.d.ts +17 -0
  69. package/dist/lite/packages/firestore/test/util/helpers.d.ts +8 -2
  70. package/dist/lite/private.d.ts +7 -0
  71. package/dist/packages/firestore/dist/index.esm2017.d.ts +183 -181
  72. package/dist/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
  73. package/dist/packages/firestore/src/api.d.ts +1 -1
  74. package/dist/packages/firestore/src/core/database_info.d.ts +1 -0
  75. package/dist/packages/firestore/src/core/firestore_client.d.ts +2 -0
  76. package/dist/packages/firestore/src/core/target.d.ts +26 -1
  77. package/dist/packages/firestore/src/local/local_serializer.d.ts +1 -1
  78. package/dist/packages/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
  79. package/dist/packages/firestore/src/model/document.d.ts +7 -0
  80. package/dist/packages/firestore/src/model/document_key.d.ts +1 -0
  81. package/dist/packages/firestore/src/model/field_index.d.ts +87 -7
  82. package/dist/packages/firestore/src/model/values.d.ts +7 -0
  83. package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
  84. package/dist/packages/firestore/test/unit/model/field_index.test.d.ts +17 -0
  85. package/dist/packages/firestore/test/unit/model/target.test.d.ts +17 -0
  86. package/dist/packages/firestore/test/util/helpers.d.ts +8 -2
  87. package/dist/private.d.ts +12 -12
  88. package/package.json +10 -10
@@ -4,7 +4,7 @@ import { SDK_VERSION as i, _registerComponent as o, registerVersion as a, _getPr
4
4
 
5
5
  import { Component as c } from "@firebase/component";
6
6
 
7
- import { Logger as l, LogLevel as f } from "@firebase/logger";
7
+ import { Logger as f, LogLevel as l } from "@firebase/logger";
8
8
 
9
9
  import { FirebaseError as h, getModularInstance as p, createMockUserToken as d } from "@firebase/util";
10
10
 
@@ -67,7 +67,7 @@ m.MOCK_USER = new m("mock-user");
67
67
  * See the License for the specific language governing permissions and
68
68
  * limitations under the License.
69
69
  */
70
- var y = "9.6.4-canary.e80d18d65", v = new l("@firebase/firestore");
70
+ var y = "9.6.5-canary.2dd99ae2d", v = new f("@firebase/firestore");
71
71
 
72
72
  /**
73
73
  * @license
@@ -104,7 +104,7 @@ function g(t) {
104
104
 
105
105
  function w(t) {
106
106
  for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
107
- if (v.logLevel <= f.DEBUG) {
107
+ if (v.logLevel <= l.DEBUG) {
108
108
  var i = e.map(T);
109
109
  v.debug.apply(v, r([ "Firestore (" + y + "): " + t ], i));
110
110
  }
@@ -112,7 +112,7 @@ function w(t) {
112
112
 
113
113
  function b(t) {
114
114
  for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
115
- if (v.logLevel <= f.ERROR) {
115
+ if (v.logLevel <= l.ERROR) {
116
116
  var i = e.map(T);
117
117
  v.error.apply(v, r([ "Firestore (" + y + "): " + t ], i));
118
118
  }
@@ -122,7 +122,7 @@ function b(t) {
122
122
  * @internal
123
123
  */ function _(t) {
124
124
  for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
125
- if (v.logLevel <= f.WARN) {
125
+ if (v.logLevel <= l.WARN) {
126
126
  var i = e.map(T);
127
127
  v.warn.apply(v, r([ "Firestore (" + y + "): " + t ], i));
128
128
  }
@@ -225,7 +225,7 @@ e) {
225
225
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
226
226
  * See the License for the specific language governing permissions and
227
227
  * limitations under the License.
228
- */ var A = "cancelled", k = "unknown", V = "invalid-argument", D = "deadline-exceeded", N = "not-found", P = "permission-denied", q = "unauthenticated", F = "resource-exhausted", O = "failed-precondition", C = "aborted", j = "out-of-range", L = "unimplemented", R = "internal", M = "unavailable", U = /** @class */ function(e) {
228
+ */ var A = "cancelled", k = "unknown", V = "invalid-argument", D = "deadline-exceeded", P = "not-found", N = "permission-denied", q = "unauthenticated", F = "resource-exhausted", O = "failed-precondition", C = "aborted", j = "out-of-range", L = "unimplemented", R = "internal", M = "unavailable", U = /** @class */ function(e) {
229
229
  /** @hideconstructor */
230
230
  function n(
231
231
  /**
@@ -356,7 +356,9 @@ function(t, e, n, r, i, o, a, s) {
356
356
  function t(t, e) {
357
357
  this.projectId = t, this.database = e || "(default)";
358
358
  }
359
- return Object.defineProperty(t.prototype, "isDefaultDatabase", {
359
+ return t.empty = function() {
360
+ return new t("", "");
361
+ }, Object.defineProperty(t.prototype, "isDefaultDatabase", {
360
362
  get: function() {
361
363
  return "(default)" === this.database;
362
364
  },
@@ -523,6 +525,8 @@ function(t, e, n, r, i, o, a, s) {
523
525
  return new t(Z.fromString(e));
524
526
  }, t.fromName = function(e) {
525
527
  return new t(Z.fromString(e).popFirst(5));
528
+ }, t.empty = function() {
529
+ return new t(Z.emptyPath());
526
530
  },
527
531
  /** Returns true if the document is in the specified collectionId. */ t.prototype.hasCollectionId = function(t) {
528
532
  return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;
@@ -647,7 +651,7 @@ function ut(t, e) {
647
651
  return null == t;
648
652
  }
649
653
 
650
- /** Returns whether the value represents -0. */ function lt(t) {
654
+ /** Returns whether the value represents -0. */ function ft(t) {
651
655
  // Detect if the value is -0.0. Based on polyfill from
652
656
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
653
657
  return 0 === t && 1 / t == -1 / 0;
@@ -672,7 +676,7 @@ function ut(t, e) {
672
676
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
673
677
  * See the License for the specific language governing permissions and
674
678
  * limitations under the License.
675
- */ var ft, ht, pt = {
679
+ */ var lt, ht, pt = {
676
680
  BatchGetDocuments: "batchGet",
677
681
  Commit: "commit",
678
682
  RunQuery: "runQuery"
@@ -741,11 +745,11 @@ function dt(t) {
741
745
 
742
746
  case 403:
743
747
  // Forbidden
744
- return P;
748
+ return N;
745
749
 
746
750
  case 404:
747
751
  // Not Found
748
- return N;
752
+ return P;
749
753
 
750
754
  case 409:
751
755
  // Conflict
@@ -808,7 +812,7 @@ function dt(t) {
808
812
  /**
809
813
  * A Rest-based connection that relies on the native HTTP stack
810
814
  * (e.g. `fetch` or a polyfill).
811
- */ (ht = ft || (ft = {}))[ht.OK = 0] = "OK", ht[ht.CANCELLED = 1] = "CANCELLED",
815
+ */ (ht = lt || (lt = {}))[ht.OK = 0] = "OK", ht[ht.CANCELLED = 1] = "CANCELLED",
812
816
  ht[ht.UNKNOWN = 2] = "UNKNOWN", ht[ht.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT",
813
817
  ht[ht.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", ht[ht.NOT_FOUND = 5] = "NOT_FOUND",
814
818
  ht[ht.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", ht[ht.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
@@ -1418,7 +1422,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1418
1422
  * FieldValueOptions to value().
1419
1423
  * - With respect to other ServerTimestampValues, they sort by their
1420
1424
  * localWriteTime.
1421
- */ function Nt(t) {
1425
+ */ function Pt(t) {
1422
1426
  var e, n;
1423
1427
  return "server_timestamp" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);
1424
1428
  }
@@ -1428,9 +1432,9 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1428
1432
  *
1429
1433
  * Preserving the previous values allows the user to display the last resoled
1430
1434
  * value until the backend responds with the timestamp.
1431
- */ function Pt(t) {
1435
+ */ function Nt(t) {
1432
1436
  var e = t.mapValue.fields.__previous_value__;
1433
- return Nt(e) ? Pt(e) : e;
1437
+ return Pt(e) ? Nt(e) : e;
1434
1438
  }
1435
1439
 
1436
1440
  /**
@@ -1457,7 +1461,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1457
1461
  * limitations under the License.
1458
1462
  */
1459
1463
  /** Extracts the backend's type order for the provided value. */ function Ft(t) {
1460
- return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ? Nt(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : S();
1464
+ return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ? Pt(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : S();
1461
1465
  }
1462
1466
 
1463
1467
  /** Tests `left` and `right` for equality based on the backend semantics. */ function Ot(t, e) {
@@ -1504,7 +1508,7 @@ var At = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1504
1508
  if ("integerValue" in t && "integerValue" in e) return Vt(t.integerValue) === Vt(e.integerValue);
1505
1509
  if ("doubleValue" in t && "doubleValue" in e) {
1506
1510
  var n = Vt(t.doubleValue), r = Vt(e.doubleValue);
1507
- return n === r ? lt(n) === lt(r) : isNaN(n) && isNaN(r);
1511
+ return n === r ? ft(n) === ft(r) : isNaN(n) && isNaN(r);
1508
1512
  }
1509
1513
  return !1;
1510
1514
  }(t, e);
@@ -1780,25 +1784,26 @@ function Rt(t, e) {
1780
1784
  return new t(Gt(this.value));
1781
1785
  }, t;
1782
1786
  }(), Qt = /** @class */ function() {
1783
- function t(t, e, n, r, i) {
1784
- this.key = t, this.documentType = e, this.version = n, this.data = r, this.documentState = i
1787
+ function t(t, e, n, r, i, o) {
1788
+ this.key = t, this.documentType = e, this.version = n, this.readTime = r, this.data = i,
1789
+ this.documentState = o
1785
1790
  /**
1786
1791
  * Creates a document with no known version or data, but which can serve as
1787
1792
  * base document for mutations.
1788
1793
  */;
1789
1794
  }
1790
1795
  return t.newInvalidDocument = function(e) {
1791
- return new t(e, 0 /* INVALID */ , _t.min(), zt.empty(), 0 /* SYNCED */);
1796
+ return new t(e, 0 /* INVALID */ , _t.min(), _t.min(), zt.empty(), 0 /* SYNCED */);
1792
1797
  },
1793
1798
  /**
1794
1799
  * Creates a new document that is known to exist with the given data at the
1795
1800
  * given version.
1796
1801
  */
1797
1802
  t.newFoundDocument = function(e, n, r) {
1798
- return new t(e, 1 /* FOUND_DOCUMENT */ , n, r, 0 /* SYNCED */);
1803
+ return new t(e, 1 /* FOUND_DOCUMENT */ , n, _t.min(), r, 0 /* SYNCED */);
1799
1804
  },
1800
1805
  /** Creates a new document that is known to not exist at the given version. */ t.newNoDocument = function(e, n) {
1801
- return new t(e, 2 /* NO_DOCUMENT */ , n, zt.empty(), 0 /* SYNCED */);
1806
+ return new t(e, 2 /* NO_DOCUMENT */ , n, _t.min(), zt.empty(), 0 /* SYNCED */);
1802
1807
  },
1803
1808
  /**
1804
1809
  * Creates a new document that is known to exist at the given version but
@@ -1806,7 +1811,7 @@ function Rt(t, e) {
1806
1811
  * base document).
1807
1812
  */
1808
1813
  t.newUnknownDocument = function(e, n) {
1809
- return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, zt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
1814
+ return new t(e, 3 /* UNKNOWN_DOCUMENT */ , n, _t.min(), zt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
1810
1815
  },
1811
1816
  /**
1812
1817
  * Changes the document type to indicate that it exists and that its version
@@ -1836,6 +1841,8 @@ function Rt(t, e) {
1836
1841
  return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
1837
1842
  }, t.prototype.setHasLocalMutations = function() {
1838
1843
  return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;
1844
+ }, t.prototype.setReadTime = function(t) {
1845
+ return this.readTime = t, this;
1839
1846
  }, Object.defineProperty(t.prototype, "hasLocalMutations", {
1840
1847
  get: function() {
1841
1848
  return 1 /* HAS_LOCAL_MUTATIONS */ === this.documentState;
@@ -1865,7 +1872,7 @@ function Rt(t, e) {
1865
1872
  }, t.prototype.isEqual = function(e) {
1866
1873
  return e instanceof t && this.key.isEqual(e.key) && this.version.isEqual(e.version) && this.documentType === e.documentType && this.documentState === e.documentState && this.data.isEqual(e.data);
1867
1874
  }, t.prototype.mutableCopy = function() {
1868
- return new t(this.key, this.documentType, this.version, this.data.clone(), this.documentState);
1875
+ return new t(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);
1869
1876
  }, t.prototype.toString = function() {
1870
1877
  return "Document(" + this.key + ", " + this.version + ", " + JSON.stringify(this.data.value) + ", {documentType: " + this.documentType + "}), {documentState: " + this.documentState + "})";
1871
1878
  }, t;
@@ -2099,7 +2106,7 @@ function ce(t) {
2099
2106
  return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;
2100
2107
  }
2101
2108
 
2102
- function le(t) {
2109
+ function fe(t) {
2103
2110
  for (var e = 0, n = t.filters; e < n.length; e++) {
2104
2111
  var r = n[e];
2105
2112
  if (r.N()) return r.field;
@@ -2114,7 +2121,7 @@ function le(t) {
2114
2121
  /**
2115
2122
  * Returns whether the query matches a collection group rather than a specific
2116
2123
  * collection.
2117
- */ function fe(t) {
2124
+ */ function le(t) {
2118
2125
  return null !== t.collectionGroup;
2119
2126
  }
2120
2127
 
@@ -2126,7 +2133,7 @@ function le(t) {
2126
2133
  var e = I(t);
2127
2134
  if (null === e.$) {
2128
2135
  e.$ = [];
2129
- var n = le(e), r = ce(e);
2136
+ var n = fe(e), r = ce(e);
2130
2137
  if (null !== n && null === r)
2131
2138
  // In order to implicitly add key ordering, we must also add the
2132
2139
  // inequality filter field for it to be a valid query.
@@ -2193,7 +2200,7 @@ function le(t) {
2193
2200
  */
2194
2201
  function de(t, e) {
2195
2202
  return function(t) {
2196
- return "number" == typeof t && Number.isInteger(t) && !lt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
2203
+ return "number" == typeof t && Number.isInteger(t) && !ft(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
2197
2204
  }(e) ?
2198
2205
  /**
2199
2206
  * Returns an IntegerValue for `value`.
@@ -2215,7 +2222,7 @@ function de(t, e) {
2215
2222
  };
2216
2223
  }
2217
2224
  return {
2218
- doubleValue: lt(e) ? "-0" : e
2225
+ doubleValue: ft(e) ? "-0" : e
2219
2226
  };
2220
2227
  }(t, e);
2221
2228
  }
@@ -2347,7 +2354,7 @@ function de(t, e) {
2347
2354
  /**
2348
2355
  * Returns a value for a Date that's appropriate to put into a proto.
2349
2356
  */
2350
- function Ne(t, e) {
2357
+ function Pe(t, e) {
2351
2358
  return t.F ? new Date(1e3 * e.seconds).toISOString().replace(/\.\d*/, "").replace("Z", "") + "." + ("000000000" + e.nanoseconds).slice(-9) + "Z" : {
2352
2359
  seconds: "" + e.seconds,
2353
2360
  nanos: e.nanoseconds
@@ -2358,12 +2365,12 @@ function Ne(t, e) {
2358
2365
  * Returns a value for bytes that's appropriate to put in a proto.
2359
2366
  *
2360
2367
  * Visible for testing.
2361
- */ function Pe(t, e) {
2368
+ */ function Ne(t, e) {
2362
2369
  return t.F ? e.toBase64() : e.toUint8Array();
2363
2370
  }
2364
2371
 
2365
2372
  function qe(t, e) {
2366
- return Ne(t, e.toTimestamp());
2373
+ return Pe(t, e.toTimestamp());
2367
2374
  }
2368
2375
 
2369
2376
  function Fe(t) {
@@ -3243,7 +3250,7 @@ var sn = /** @class */ function() {
3243
3250
  /**
3244
3251
  * A `Query` refers to a query which you can read or listen to. You can also
3245
3252
  * construct refined `Query` objects by adding filters and ordering.
3246
- */ function ln(t, e) {
3253
+ */ function fn(t, e) {
3247
3254
  for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
3248
3255
  if (t = p(t), rt("collection", "path", e), t instanceof en) {
3249
3256
  var o = Z.fromString.apply(Z, r([ e ], n));
@@ -3267,7 +3274,7 @@ var sn = /** @class */ function() {
3267
3274
  * collection or subcollection with this ID as the last segment of its path
3268
3275
  * will be included. Cannot contain a slash.
3269
3276
  * @returns The created `Query`.
3270
- */ function fn(t, e) {
3277
+ */ function ln(t, e) {
3271
3278
  if (t = st(t, en), rt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new U(V, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
3272
3279
  return new un(t,
3273
3280
  /* converter= */ null,
@@ -3681,12 +3688,12 @@ function(t) {
3681
3688
  Un("Data must be an object, but it was:", a, r);
3682
3689
  var s, u, c = Rn(r, a);
3683
3690
  if (o.merge) s = new Et(a.fieldMask), u = a.fieldTransforms; else if (o.mergeFields) {
3684
- for (var l = [], f = 0, h = o.mergeFields; f < h.length; f++) {
3685
- var p = xn(e, h[f], n);
3691
+ for (var f = [], l = 0, h = o.mergeFields; l < h.length; l++) {
3692
+ var p = xn(e, h[l], n);
3686
3693
  if (!a.contains(p)) throw new U(V, "Field '" + p + "' is specified in your field mask but missing from your input data.");
3687
- Qn(l, p) || l.push(p);
3694
+ Qn(f, p) || f.push(p);
3688
3695
  }
3689
- s = new Et(l), u = a.fieldTransforms.filter((function(t) {
3696
+ s = new Et(f), u = a.fieldTransforms.filter((function(t) {
3690
3697
  return s.covers(t.field);
3691
3698
  }));
3692
3699
  } else s = null, u = a.fieldTransforms;
@@ -3731,7 +3738,7 @@ var Vn = /** @class */ function(e) {
3731
3738
  }, e.databaseId, e.q, e.ignoreUndefinedProperties);
3732
3739
  }
3733
3740
 
3734
- var Nn = /** @class */ function(e) {
3741
+ var Pn = /** @class */ function(e) {
3735
3742
  function n() {
3736
3743
  return null !== e && e.apply(this, arguments) || this;
3737
3744
  }
@@ -3740,7 +3747,7 @@ var Nn = /** @class */ function(e) {
3740
3747
  }, n.prototype.isEqual = function(t) {
3741
3748
  return t instanceof n;
3742
3749
  }, n;
3743
- }(gn), Pn = /** @class */ function(e) {
3750
+ }(gn), Nn = /** @class */ function(e) {
3744
3751
  function n(t, n) {
3745
3752
  var r = this;
3746
3753
  return (r = e.call(this, t) || this).lt = n, r;
@@ -3811,7 +3818,7 @@ var Nn = /** @class */ function(e) {
3811
3818
  for (var c = 0; c < o.length; c += 2) s.push(xn(e, o[c])), u.push(o[c + 1]);
3812
3819
  // We iterate in reverse order to pick the last value for a field if the
3813
3820
  // user specified the field multiple times.
3814
- for (var l = [], f = zt.empty(), h = s.length - 1; h >= 0; --h) if (!Qn(l, s[h])) {
3821
+ for (var f = [], l = zt.empty(), h = s.length - 1; h >= 0; --h) if (!Qn(f, s[h])) {
3815
3822
  var d = s[h], m = u[h];
3816
3823
  // For Compat types, we have to "extract" the underlying types before
3817
3824
  // performing validation.
@@ -3819,13 +3826,13 @@ var Nn = /** @class */ function(e) {
3819
3826
  var y = a.it(d);
3820
3827
  if (m instanceof Vn)
3821
3828
  // Add it to the field mask, but don't add anything to updateData.
3822
- l.push(d); else {
3829
+ f.push(d); else {
3823
3830
  var v = Ln(m, y);
3824
- null != v && (l.push(d), f.set(d, v));
3831
+ null != v && (f.push(d), l.set(d, v));
3825
3832
  }
3826
3833
  }
3827
- var g = new Et(l);
3828
- return new Tn(f, g, a.fieldTransforms);
3834
+ var g = new Et(f);
3835
+ return new Tn(l, g, a.fieldTransforms);
3829
3836
  }
3830
3837
 
3831
3838
  /**
@@ -3915,7 +3922,7 @@ var Nn = /** @class */ function(e) {
3915
3922
  if (t instanceof Date) {
3916
3923
  var n = bt.fromDate(t);
3917
3924
  return {
3918
- timestampValue: Ne(e.q, n)
3925
+ timestampValue: Pe(e.q, n)
3919
3926
  };
3920
3927
  }
3921
3928
  if (t instanceof bt) {
@@ -3924,7 +3931,7 @@ var Nn = /** @class */ function(e) {
3924
3931
  // truncation immediately without waiting for the backend to do that.
3925
3932
  var r = new bt(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
3926
3933
  return {
3927
- timestampValue: Ne(e.q, r)
3934
+ timestampValue: Pe(e.q, r)
3928
3935
  };
3929
3936
  }
3930
3937
  if (t instanceof wn) return {
@@ -3934,7 +3941,7 @@ var Nn = /** @class */ function(e) {
3934
3941
  }
3935
3942
  };
3936
3943
  if (t instanceof vn) return {
3937
- bytesValue: Pe(e.q, t._byteString)
3944
+ bytesValue: Ne(e.q, t._byteString)
3938
3945
  };
3939
3946
  if (t instanceof sn) {
3940
3947
  var i = e.databaseId, o = t.firestore._databaseId;
@@ -4257,9 +4264,9 @@ var Zn = /** @class */ function(e) {
4257
4264
  if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new U(V, "Invalid Query. You can't perform '" + o + "' queries on documentId().");
4258
4265
  if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
4259
4266
  dr(a, o);
4260
- for (var u = [], c = 0, l = a; c < l.length; c++) {
4261
- var f = l[c];
4262
- u.push(pr(r, t, f));
4267
+ for (var u = [], c = 0, f = a; c < f.length; c++) {
4268
+ var l = f[c];
4269
+ u.push(pr(r, t, l));
4263
4270
  }
4264
4271
  s = {
4265
4272
  arrayValue: {
@@ -4273,7 +4280,7 @@ var Zn = /** @class */ function(e) {
4273
4280
  var h = Wt.create(i, o, s);
4274
4281
  return function(t, e) {
4275
4282
  if (e.N()) {
4276
- var n = le(t);
4283
+ var n = fe(t);
4277
4284
  if (null !== n && !n.isEqual(e.field)) throw new U(V, "Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '" + n.toString() + "' and '" + e.field.toString() + "'");
4278
4285
  var r = ce(t);
4279
4286
  null !== r && mr(t, e.field, r);
@@ -4358,7 +4365,7 @@ var er = /** @class */ function(e) {
4358
4365
  return function(t, e) {
4359
4366
  if (null === ce(t)) {
4360
4367
  // This is the first order by. It must match any inequality.
4361
- var n = le(t);
4368
+ var n = fe(t);
4362
4369
  null !== n && mr(t, n, e.field);
4363
4370
  }
4364
4371
  }(t, r), r;
@@ -4456,19 +4463,19 @@ var cr = /** @class */ function(e) {
4456
4463
  }, n;
4457
4464
  }(Xn);
4458
4465
 
4459
- function lr() {
4466
+ function fr() {
4460
4467
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4461
4468
  return new cr("endBefore", t, /*before=*/ !0);
4462
4469
  }
4463
4470
 
4464
- function fr() {
4471
+ function lr() {
4465
4472
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4466
4473
  return new cr("endAt", t, /*before=*/ !1);
4467
4474
  }
4468
4475
 
4469
4476
  /** Helper function to create a bound from a document or fields */ function hr(t, e, n, r) {
4470
4477
  if (n[0] = p(n[0]), n[0] instanceof Kn) return function(t, e, n, r, i) {
4471
- if (!r) throw new U(N, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
4478
+ if (!r) throw new U(P, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
4472
4479
  // Because people expect to continue/end a query at the exact document
4473
4480
  // provided, we need to use the implicit sort order rather than the explicit
4474
4481
  // sort order, because it's guaranteed to contain the document key. That way
@@ -4480,10 +4487,10 @@ function fr() {
4480
4487
  var u = s[a];
4481
4488
  if (u.field.isKeyField()) o.push(Rt(e, r.key)); else {
4482
4489
  var c = r.data.field(u.field);
4483
- if (Nt(c)) throw new U(V, 'Invalid query. You are trying to start or end a query using a document for which the field "' + u.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
4490
+ if (Pt(c)) throw new U(V, 'Invalid query. You are trying to start or end a query using a document for which the field "' + u.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
4484
4491
  if (null === c) {
4485
- var l = u.field.canonicalString();
4486
- throw new U(V, "Invalid query. You are trying to start or end a query using a document for which the field '" + l + "' (used as the orderBy) does not exist.");
4492
+ var f = u.field.canonicalString();
4493
+ throw new U(V, "Invalid query. You are trying to start or end a query using a document for which the field '" + f + "' (used as the orderBy) does not exist.");
4487
4494
  }
4488
4495
  o.push(c);
4489
4496
  }
@@ -4499,11 +4506,11 @@ function fr() {
4499
4506
  var c = i[u];
4500
4507
  if (a[u].field.isKeyField()) {
4501
4508
  if ("string" != typeof c) throw new U(V, "Invalid query. Expected a string for document ID in " + r + "(), but got a " + typeof c);
4502
- if (!fe(t) && -1 !== c.indexOf("/")) throw new U(V, "Invalid query. When querying a collection and ordering by documentId(), the value passed to " + r + "() must be a plain document ID, but '" + c + "' contains a slash.");
4503
- var l = t.path.child(Z.fromString(c));
4504
- if (!nt.isDocumentKey(l)) throw new U(V, "Invalid query. When querying a collection group and ordering by documentId(), the value passed to " + r + "() must result in a valid document path, but '" + l + "' is not because it contains an odd number of segments.");
4505
- var f = new nt(l);
4506
- s.push(Rt(e, f));
4509
+ if (!le(t) && -1 !== c.indexOf("/")) throw new U(V, "Invalid query. When querying a collection and ordering by documentId(), the value passed to " + r + "() must be a plain document ID, but '" + c + "' contains a slash.");
4510
+ var f = t.path.child(Z.fromString(c));
4511
+ if (!nt.isDocumentKey(f)) throw new U(V, "Invalid query. When querying a collection group and ordering by documentId(), the value passed to " + r + "() must result in a valid document path, but '" + f + "' is not because it contains an odd number of segments.");
4512
+ var l = new nt(f);
4513
+ s.push(Rt(e, l));
4507
4514
  } else {
4508
4515
  var h = jn(n, r, c);
4509
4516
  s.push(h);
@@ -4516,7 +4523,7 @@ function fr() {
4516
4523
  function pr(t, e, n) {
4517
4524
  if ("string" == typeof (n = p(n))) {
4518
4525
  if ("" === n) throw new U(V, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
4519
- if (!fe(e) && -1 !== n.indexOf("/")) throw new U(V, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '" + n + "' contains a '/' character.");
4526
+ if (!le(e) && -1 !== n.indexOf("/")) throw new U(V, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '" + n + "' contains a '/' character.");
4520
4527
  var r = e.path.child(Z.fromString(n));
4521
4528
  if (!nt.isDocumentKey(r)) throw new U(V, "Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '" + r + "' is not because it has an odd number of segments (" + r.length + ").");
4522
4529
  return Rt(t, new nt(r));
@@ -4656,7 +4663,7 @@ var vr = /** @class */ function(e) {
4656
4663
  }, t.prototype.convertServerTimestamp = function(t, e) {
4657
4664
  switch (e) {
4658
4665
  case "previous":
4659
- var n = Pt(t);
4666
+ var n = Nt(t);
4660
4667
  return null == n ? null : this.convertValue(n, e);
4661
4668
 
4662
4669
  case "estimate":
@@ -4805,7 +4812,7 @@ function _r(t, e, n) {
4805
4812
  * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
4806
4813
  * include a server-generated timestamp in the written data.
4807
4814
  */ function Ir() {
4808
- return new Nn("serverTimestamp");
4815
+ return new Pn("serverTimestamp");
4809
4816
  }
4810
4817
 
4811
4818
  /**
@@ -4823,7 +4830,7 @@ function _r(t, e, n) {
4823
4830
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
4824
4831
  // NOTE: We don't actually parse the data until it's used in set() or
4825
4832
  // update() since we'd need the Firestore instance to do this.
4826
- return new Pn("arrayUnion", t);
4833
+ return new Nn("arrayUnion", t);
4827
4834
  }
4828
4835
 
4829
4836
  /**
@@ -4896,12 +4903,12 @@ function _r(t, e, n) {
4896
4903
  }
4897
4904
  return t.prototype.set = function(t, e, n) {
4898
4905
  this._verifyNotCommitted();
4899
- var r = Nr(t, this._firestore), i = yr(r.converter, e, n), o = kn(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
4906
+ var r = Pr(t, this._firestore), i = yr(r.converter, e, n), o = kn(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
4900
4907
  return this._mutations.push(o.toMutation(r._key, _e.none())), this;
4901
4908
  }, t.prototype.update = function(t, e, n) {
4902
4909
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
4903
4910
  this._verifyNotCommitted();
4904
- var o, a = Nr(t, this._firestore);
4911
+ var o, a = Pr(t, this._firestore);
4905
4912
  // For Compat types, we have to "extract" the underlying types before
4906
4913
  // performing validation.
4907
4914
  return o = "string" == typeof (e = p(e)) || e instanceof mn ? Cn(this._dataReader, "WriteBatch.update", a._key, e, n, r) : On(this._dataReader, "WriteBatch.update", a._key, e),
@@ -4915,7 +4922,7 @@ function _r(t, e, n) {
4915
4922
  */
4916
4923
  t.prototype.delete = function(t) {
4917
4924
  this._verifyNotCommitted();
4918
- var e = Nr(t, this._firestore);
4925
+ var e = Pr(t, this._firestore);
4919
4926
  return this._mutations = this._mutations.concat(new Ie(e._key, _e.none())), this;
4920
4927
  },
4921
4928
  /**
@@ -4937,7 +4944,7 @@ function _r(t, e, n) {
4937
4944
  }, t;
4938
4945
  }();
4939
4946
 
4940
- function Nr(t, e) {
4947
+ function Pr(t, e) {
4941
4948
  if ((t = p(t)).firestore !== e) throw new U(V, "Provided document reference is from a different Firestore instance.");
4942
4949
  return t;
4943
4950
  }
@@ -4954,7 +4961,7 @@ function Nr(t, e) {
4954
4961
  *
4955
4962
  * @returns A `WriteBatch` that can be used to atomically execute multiple
4956
4963
  * writes.
4957
- */ function Pr(t) {
4964
+ */ function Nr(t) {
4958
4965
  var e = Ze(t = st(t, en));
4959
4966
  return new Dr(t, (function(t) {
4960
4967
  return Ye(e, t);
@@ -5171,9 +5178,9 @@ function Nr(t, e) {
5171
5178
  return !1;
5172
5179
 
5173
5180
  case V:
5174
- case N:
5175
- case "already-exists":
5176
5181
  case P:
5182
+ case "already-exists":
5183
+ case N:
5177
5184
  case O:
5178
5185
  // Aborted might be retried in some scenarios, but that is dependant on
5179
5186
  // the context and should handled individually by the calling code.
@@ -5563,7 +5570,7 @@ function Nr(t, e) {
5563
5570
  */;
5564
5571
  }
5565
5572
  return t.prototype.get = function(t) {
5566
- var e = this, n = Nr(t, this._firestore), r = new vr(this._firestore);
5573
+ var e = this, n = Pr(t, this._firestore), r = new vr(this._firestore);
5567
5574
  return this._transaction.lookup([ n._key ]).then((function(t) {
5568
5575
  if (!t || 1 !== t.length) return S();
5569
5576
  var i = t[0];
@@ -5572,11 +5579,11 @@ function Nr(t, e) {
5572
5579
  throw S();
5573
5580
  }));
5574
5581
  }, t.prototype.set = function(t, e, n) {
5575
- var r = Nr(t, this._firestore), i = yr(r.converter, e, n), o = kn(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
5582
+ var r = Pr(t, this._firestore), i = yr(r.converter, e, n), o = kn(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
5576
5583
  return this._transaction.set(r._key, o), this;
5577
5584
  }, t.prototype.update = function(t, e, n) {
5578
5585
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
5579
- var o, a = Nr(t, this._firestore);
5586
+ var o, a = Pr(t, this._firestore);
5580
5587
  // For Compat types, we have to "extract" the underlying types before
5581
5588
  // performing validation.
5582
5589
  return o = "string" == typeof (e = p(e)) || e instanceof mn ? Cn(this._dataReader, "Transaction.update", a._key, e, n, r) : On(this._dataReader, "Transaction.update", a._key, e),
@@ -5589,7 +5596,7 @@ function Nr(t, e) {
5589
5596
  * @returns This `Transaction` instance. Used for chaining method calls.
5590
5597
  */
5591
5598
  t.prototype.delete = function(t) {
5592
- var e = Nr(t, this._firestore);
5599
+ var e = Pr(t, this._firestore);
5593
5600
  return this._transaction.delete(e._key), this;
5594
5601
  }, t;
5595
5602
  }();
@@ -5647,7 +5654,7 @@ y = i + "_lite", o(new c("firestore/lite", (function(t, e) {
5647
5654
  return n && i._setSettings(n), i;
5648
5655
  }), "PUBLIC")),
5649
5656
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
5650
- a("firestore-lite", "3.4.3-canary.e80d18d65", ""), a("firestore-lite", "3.4.3-canary.e80d18d65", "esm5");
5657
+ a("firestore-lite", "3.4.4-canary.2dd99ae2d", ""), a("firestore-lite", "3.4.4-canary.2dd99ae2d", "esm5");
5651
5658
 
5652
- export { vn as Bytes, cn as CollectionReference, sn as DocumentReference, Kn as DocumentSnapshot, mn as FieldPath, gn as FieldValue, en as Firestore, U as FirestoreError, wn as GeoPoint, un as Query, Xn as QueryConstraint, Hn as QueryDocumentSnapshot, Wn as QuerySnapshot, bt as Timestamp, Lr as Transaction, Dr as WriteBatch, Sr as addDoc, kr as arrayRemove, Ar as arrayUnion, ln as collection, fn as collectionGroup, on as connectFirestoreEmulator, Tr as deleteDoc, Er as deleteField, hn as doc, yn as documentId, fr as endAt, lr as endBefore, gr as getDoc, wr as getDocs, rn as getFirestore, Vr as increment, nn as initializeFirestore, ir as limit, or as limitToLast, nr as orderBy, Jn as query, dn as queryEqual, pn as refEqual, Rr as runTransaction, Ir as serverTimestamp, br as setDoc, g as setLogLevel, Yn as snapshotEqual, ur as startAfter, sr as startAt, an as terminate, _r as updateDoc, tr as where, Pr as writeBatch };
5659
+ export { vn as Bytes, cn as CollectionReference, sn as DocumentReference, Kn as DocumentSnapshot, mn as FieldPath, gn as FieldValue, en as Firestore, U as FirestoreError, wn as GeoPoint, un as Query, Xn as QueryConstraint, Hn as QueryDocumentSnapshot, Wn as QuerySnapshot, bt as Timestamp, Lr as Transaction, Dr as WriteBatch, Sr as addDoc, kr as arrayRemove, Ar as arrayUnion, fn as collection, ln as collectionGroup, on as connectFirestoreEmulator, Tr as deleteDoc, Er as deleteField, hn as doc, yn as documentId, lr as endAt, fr as endBefore, gr as getDoc, wr as getDocs, rn as getFirestore, Vr as increment, nn as initializeFirestore, ir as limit, or as limitToLast, nr as orderBy, Jn as query, dn as queryEqual, pn as refEqual, Rr as runTransaction, Ir as serverTimestamp, br as setDoc, g as setLogLevel, Yn as snapshotEqual, ur as startAfter, sr as startAt, an as terminate, _r as updateDoc, tr as where, Nr as writeBatch };
5653
5660
  //# sourceMappingURL=index.browser.esm5.js.map