@firebase/firestore 3.10.1-canary.0a27d2fbf → 3.10.1-canary.195e82ebb

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.
package/dist/index.cjs.js CHANGED
@@ -30,7 +30,7 @@ const v = "@firebase/firestore";
30
30
  * Simple wrapper around a nullable UID. Mostly exists to make code more
31
31
  * readable.
32
32
  */
33
- class P {
33
+ class b {
34
34
  constructor(t) {
35
35
  this.uid = t;
36
36
  }
@@ -48,11 +48,11 @@ class P {
48
48
  }
49
49
  }
50
50
 
51
- /** A user with a null UID. */ P.UNAUTHENTICATED = new P(null),
51
+ /** A user with a null UID. */ b.UNAUTHENTICATED = new b(null),
52
52
  // TODO(mikelehen): Look into getting a proper uid-equivalent for
53
53
  // non-FirebaseAuth providers.
54
- P.GOOGLE_CREDENTIALS = new P("google-credentials-uid"), P.FIRST_PARTY = new P("first-party-uid"),
55
- P.MOCK_USER = new P("mock-user");
54
+ b.GOOGLE_CREDENTIALS = new b("google-credentials-uid"), b.FIRST_PARTY = new b("first-party-uid"),
55
+ b.MOCK_USER = new b("mock-user");
56
56
 
57
57
  /**
58
58
  * @license
@@ -70,7 +70,7 @@ P.MOCK_USER = new P("mock-user");
70
70
  * See the License for the specific language governing permissions and
71
71
  * limitations under the License.
72
72
  */
73
- let b = "9.20.0-canary.0a27d2fbf";
73
+ let P = "9.20.0-canary.195e82ebb";
74
74
 
75
75
  /**
76
76
  * @license
@@ -114,14 +114,14 @@ function S() {
114
114
  function C(t, ...e) {
115
115
  if (V.logLevel <= logger.LogLevel.DEBUG) {
116
116
  const n = e.map(k);
117
- V.debug(`Firestore (${b}): ${t}`, ...n);
117
+ V.debug(`Firestore (${P}): ${t}`, ...n);
118
118
  }
119
119
  }
120
120
 
121
121
  function x(t, ...e) {
122
122
  if (V.logLevel <= logger.LogLevel.ERROR) {
123
123
  const n = e.map(k);
124
- V.error(`Firestore (${b}): ${t}`, ...n);
124
+ V.error(`Firestore (${P}): ${t}`, ...n);
125
125
  }
126
126
  }
127
127
 
@@ -130,7 +130,7 @@ function x(t, ...e) {
130
130
  */ function N(t, ...e) {
131
131
  if (V.logLevel <= logger.LogLevel.WARN) {
132
132
  const n = e.map(k);
133
- V.warn(`Firestore (${b}): ${t}`, ...n);
133
+ V.warn(`Firestore (${P}): ${t}`, ...n);
134
134
  }
135
135
  }
136
136
 
@@ -190,7 +190,7 @@ function x(t, ...e) {
190
190
  */ function O(t = "Unexpected state") {
191
191
  // Log the failure in addition to throw an exception, just in case the
192
192
  // exception is swallowed.
193
- const e = `FIRESTORE (${b}) INTERNAL ASSERTION FAILED: ` + t;
193
+ const e = `FIRESTORE (${P}) INTERNAL ASSERTION FAILED: ` + t;
194
194
  // NOTE: We don't use FirestoreError here because these are internal failures
195
195
  // that cannot be handled by the user. (Also it would create a circular
196
196
  // dependency between the error and assert modules which doesn't work.)
@@ -429,7 +429,7 @@ e) {
429
429
  invalidateToken() {}
430
430
  start(t, e) {
431
431
  // Fire with initial user.
432
- t.enqueueRetryable((() => e(P.UNAUTHENTICATED)));
432
+ t.enqueueRetryable((() => e(b.UNAUTHENTICATED)));
433
433
  }
434
434
  shutdown() {}
435
435
  }
@@ -465,7 +465,7 @@ class Q {
465
465
  constructor(t) {
466
466
  this.t = t,
467
467
  /** Tracks the current User. */
468
- this.currentUser = P.UNAUTHENTICATED,
468
+ this.currentUser = b.UNAUTHENTICATED,
469
469
  /**
470
470
  * Counter used to detect if the token changed while a getToken request was
471
471
  * outstanding.
@@ -530,7 +530,7 @@ class Q {
530
530
  // to guarantee to get the actual user.
531
531
  u() {
532
532
  const t = this.auth && this.auth.getUid();
533
- return $(null === t || "string" == typeof t), new P(t);
533
+ return $(null === t || "string" == typeof t), new b(t);
534
534
  }
535
535
  }
536
536
 
@@ -542,7 +542,7 @@ class Q {
542
542
  * safer to keep the implementation as-is.
543
543
  */ class z {
544
544
  constructor(t, e, n) {
545
- this.h = t, this.l = e, this.m = n, this.type = "FirstParty", this.user = P.FIRST_PARTY,
545
+ this.h = t, this.l = e, this.m = n, this.type = "FirstParty", this.user = b.FIRST_PARTY,
546
546
  this.g = new Map;
547
547
  }
548
548
  /**
@@ -573,7 +573,7 @@ class Q {
573
573
  }
574
574
  start(t, e) {
575
575
  // Fire with initial uid.
576
- t.enqueueRetryable((() => e(P.FIRST_PARTY)));
576
+ t.enqueueRetryable((() => e(b.FIRST_PARTY)));
577
577
  }
578
578
  shutdown() {}
579
579
  invalidateToken() {}
@@ -1578,17 +1578,17 @@ class Rt {
1578
1578
  this.R = new q, this.transaction.oncomplete = () => {
1579
1579
  this.R.resolve();
1580
1580
  }, this.transaction.onabort = () => {
1581
- e.error ? this.R.reject(new bt(t, e.error)) : this.R.resolve();
1581
+ e.error ? this.R.reject(new Pt(t, e.error)) : this.R.resolve();
1582
1582
  }, this.transaction.onerror = e => {
1583
1583
  const n = xt(e.target.error);
1584
- this.R.reject(new bt(t, n));
1584
+ this.R.reject(new Pt(t, n));
1585
1585
  };
1586
1586
  }
1587
1587
  static open(t, e, n, s) {
1588
1588
  try {
1589
1589
  return new Rt(e, t.transaction(s, n));
1590
1590
  } catch (t) {
1591
- throw new bt(e, t);
1591
+ throw new Pt(e, t);
1592
1592
  }
1593
1593
  }
1594
1594
  get v() {
@@ -1703,10 +1703,10 @@ class Rt {
1703
1703
  const n = t.target.result;
1704
1704
  e(n);
1705
1705
  }, s.onblocked = () => {
1706
- n(new bt(t, "Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."));
1706
+ n(new Pt(t, "Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."));
1707
1707
  }, s.onerror = e => {
1708
1708
  const s = e.target.error;
1709
- "VersionError" === s.name ? n(new L(B.FAILED_PRECONDITION, "A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")) : "InvalidStateError" === s.name ? n(new L(B.FAILED_PRECONDITION, "Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: " + s)) : n(new bt(t, s));
1709
+ "VersionError" === s.name ? n(new L(B.FAILED_PRECONDITION, "A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")) : "InvalidStateError" === s.name ? n(new L(B.FAILED_PRECONDITION, "Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: " + s)) : n(new Pt(t, s));
1710
1710
  }, s.onupgradeneeded = t => {
1711
1711
  C("SimpleDb", 'Database "' + this.name + '" requires upgrade from version:', t.oldVersion);
1712
1712
  const e = t.target.result;
@@ -1758,7 +1758,7 @@ class Rt {
1758
1758
  * A controller for iterating over a key range or index. It allows an iterate
1759
1759
  * callback to delete the currently-referenced object, or jump to a new key
1760
1760
  * within the key range or index.
1761
- */ class Pt {
1761
+ */ class bt {
1762
1762
  constructor(t) {
1763
1763
  this.L = t, this.q = !1, this.U = null;
1764
1764
  }
@@ -1791,7 +1791,7 @@ class Rt {
1791
1791
  }
1792
1792
  }
1793
1793
 
1794
- /** An error that wraps exceptions that thrown during IndexedDB execution. */ class bt extends L {
1794
+ /** An error that wraps exceptions that thrown during IndexedDB execution. */ class Pt extends L {
1795
1795
  constructor(t, e) {
1796
1796
  super(B.UNAVAILABLE, `IndexedDB transaction '${t}' failed: ${e}`), this.name = "IndexedDbTransactionError";
1797
1797
  }
@@ -1933,7 +1933,7 @@ class Rt {
1933
1933
  }, t.onsuccess = t => {
1934
1934
  const i = t.target.result;
1935
1935
  if (!i) return void s();
1936
- const r = new Pt(i), o = e(i.primaryKey, i.value, r);
1936
+ const r = new bt(i), o = e(i.primaryKey, i.value, r);
1937
1937
  if (o instanceof At) {
1938
1938
  const t = o.catch((t => (r.done(), At.reject(t))));
1939
1939
  n.push(t);
@@ -2946,7 +2946,7 @@ function ve() {
2946
2946
  * the proto byte string in a common class that must be converted into a string
2947
2947
  * before being sent as a proto.
2948
2948
  * @internal
2949
- */ class Pe {
2949
+ */ class be {
2950
2950
  constructor(t) {
2951
2951
  this.binaryString = t;
2952
2952
  }
@@ -2962,7 +2962,7 @@ function ve() {
2962
2962
  }
2963
2963
  }
2964
2964
  /** Converts a binary string to a Base64 encoded string. */ (t);
2965
- return new Pe(e);
2965
+ return new be(e);
2966
2966
  }
2967
2967
  static fromUint8Array(t) {
2968
2968
  // TODO(indexing); Remove the copy of the byte string here as this method
@@ -2979,7 +2979,7 @@ function ve() {
2979
2979
  /**
2980
2980
  * Helper function to convert a binary string to an Uint8Array.
2981
2981
  */ (t);
2982
- return new Pe(e);
2982
+ return new be(e);
2983
2983
  }
2984
2984
  [Symbol.iterator]() {
2985
2985
  let t = 0;
@@ -3033,9 +3033,9 @@ function ve() {
3033
3033
  }
3034
3034
  }
3035
3035
 
3036
- Pe.EMPTY_BYTE_STRING = new Pe("");
3036
+ be.EMPTY_BYTE_STRING = new be("");
3037
3037
 
3038
- const be = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
3038
+ const Pe = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
3039
3039
 
3040
3040
  /**
3041
3041
  * Converts the possible Proto values for a timestamp value into a "seconds and
@@ -3049,7 +3049,7 @@ const be = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
3049
3049
  // (millis), so we do some custom parsing here.
3050
3050
  // Parse the nanos right out of the string.
3051
3051
  let e = 0;
3052
- const n = be.exec(t);
3052
+ const n = Pe.exec(t);
3053
3053
  if ($(!!n), n[1]) {
3054
3054
  // Pad the fraction out to 9 digits (nanos).
3055
3055
  let t = n[1];
@@ -3077,7 +3077,7 @@ const be = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
3077
3077
  }
3078
3078
 
3079
3079
  /** Converts the possible Proto types for Blobs into a ByteString. */ function De(t) {
3080
- return "string" == typeof t ? Pe.fromBase64String(t) : Pe.fromUint8Array(t);
3080
+ return "string" == typeof t ? be.fromBase64String(t) : be.fromUint8Array(t);
3081
3081
  }
3082
3082
 
3083
3083
  /**
@@ -3981,7 +3981,7 @@ class _n extends dn {
3981
3981
  return t.isKeyField() ? "in" /* Operator.IN */ === e || "not-in" /* Operator.NOT_IN */ === e ? this.createKeyFieldInFilter(t, e, n) : new Rn(t, e, n) : "array-contains" /* Operator.ARRAY_CONTAINS */ === e ? new Vn(t, n) : "in" /* Operator.IN */ === e ? new Sn(t, n) : "not-in" /* Operator.NOT_IN */ === e ? new Dn(t, n) : "array-contains-any" /* Operator.ARRAY_CONTAINS_ANY */ === e ? new Cn(t, n) : new _n(t, e, n);
3982
3982
  }
3983
3983
  static createKeyFieldInFilter(t, e, n) {
3984
- return "in" /* Operator.IN */ === e ? new vn(t, n) : new Pn(t, n);
3984
+ return "in" /* Operator.IN */ === e ? new vn(t, n) : new bn(t, n);
3985
3985
  }
3986
3986
  matches(t) {
3987
3987
  const e = t.data.field(this.field);
@@ -4143,23 +4143,23 @@ class Rn extends _n {
4143
4143
 
4144
4144
  /** Filter that matches on key fields within an array. */ class vn extends _n {
4145
4145
  constructor(t, e) {
4146
- super(t, "in" /* Operator.IN */ , e), this.keys = bn("in" /* Operator.IN */ , e);
4146
+ super(t, "in" /* Operator.IN */ , e), this.keys = Pn("in" /* Operator.IN */ , e);
4147
4147
  }
4148
4148
  matches(t) {
4149
4149
  return this.keys.some((e => e.isEqual(t.key)));
4150
4150
  }
4151
4151
  }
4152
4152
 
4153
- /** Filter that matches on key fields not present within an array. */ class Pn extends _n {
4153
+ /** Filter that matches on key fields not present within an array. */ class bn extends _n {
4154
4154
  constructor(t, e) {
4155
- super(t, "not-in" /* Operator.NOT_IN */ , e), this.keys = bn("not-in" /* Operator.NOT_IN */ , e);
4155
+ super(t, "not-in" /* Operator.NOT_IN */ , e), this.keys = Pn("not-in" /* Operator.NOT_IN */ , e);
4156
4156
  }
4157
4157
  matches(t) {
4158
4158
  return !this.keys.some((e => e.isEqual(t.key)));
4159
4159
  }
4160
4160
  }
4161
4161
 
4162
- function bn(t, e) {
4162
+ function Pn(t, e) {
4163
4163
  var n;
4164
4164
  return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((t => ct.fromName(t.referenceValue)));
4165
4165
  }
@@ -4882,7 +4882,7 @@ function gs() {
4882
4882
  {
4883
4883
  mapValue: n
4884
4884
  };
4885
- }(n, e) : t instanceof Ps ? bs(t, e) : t instanceof Vs ? Ss(t, e) : function(t, e) {
4885
+ }(n, e) : t instanceof bs ? Ps(t, e) : t instanceof Vs ? Ss(t, e) : function(t, e) {
4886
4886
  // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit
4887
4887
  // precision and resolves overflows by reducing precision, we do not
4888
4888
  // manually cap overflows at 2^63.
@@ -4898,7 +4898,7 @@ function gs() {
4898
4898
  // The server just sends null as the transform result for array operations,
4899
4899
  // so we have to calculate a result the same as we do for local
4900
4900
  // applications.
4901
- return t instanceof Ps ? bs(t, e) : t instanceof Vs ? Ss(t, e) : n;
4901
+ return t instanceof bs ? Ps(t, e) : t instanceof Vs ? Ss(t, e) : n;
4902
4902
  }
4903
4903
 
4904
4904
  /**
@@ -4928,13 +4928,13 @@ function gs() {
4928
4928
  /** Transforms a value into a server-generated timestamp. */
4929
4929
  class vs extends Ts {}
4930
4930
 
4931
- /** Transforms an array value via a union operation. */ class Ps extends Ts {
4931
+ /** Transforms an array value via a union operation. */ class bs extends Ts {
4932
4932
  constructor(t) {
4933
4933
  super(), this.elements = t;
4934
4934
  }
4935
4935
  }
4936
4936
 
4937
- function bs(t, e) {
4937
+ function Ps(t, e) {
4938
4938
  const n = xs(e);
4939
4939
  for (const e of t.elements) n.some((t => Be(t, e))) || n.push(e);
4940
4940
  return {
@@ -5003,7 +5003,7 @@ function xs(t) {
5003
5003
 
5004
5004
  function ks(t, e) {
5005
5005
  return t.field.isEqual(e.field) && function(t, e) {
5006
- return t instanceof Ps && e instanceof Ps || t instanceof Vs && e instanceof Vs ? tt(t.elements, e.elements, Be) : t instanceof Ds && e instanceof Ds ? Be(t.wt, e.wt) : t instanceof vs && e instanceof vs;
5006
+ return t instanceof bs && e instanceof bs || t instanceof Vs && e instanceof Vs ? tt(t.elements, e.elements, Be) : t instanceof Ds && e instanceof Ds ? Be(t.wt, e.wt) : t instanceof vs && e instanceof vs;
5007
5007
  }(t.transform, e.transform);
5008
5008
  }
5009
5009
 
@@ -5993,7 +5993,7 @@ class _i {
5993
5993
  * matches the target. The resume token essentially identifies a point in
5994
5994
  * time from which the server should resume sending results.
5995
5995
  */
5996
- n = Pe.EMPTY_BYTE_STRING
5996
+ n = be.EMPTY_BYTE_STRING
5997
5997
  /** An RPC error indicating why the watch failed. */ , s = null) {
5998
5998
  this.state = t, this.targetIds = e, this.resumeToken = n, this.cause = s;
5999
5999
  }
@@ -6014,13 +6014,13 @@ class _i {
6014
6014
  */
6015
6015
  this.Rt = yi(),
6016
6016
  /** See public getters for explanations of these fields. */
6017
- this.vt = Pe.EMPTY_BYTE_STRING, this.Pt = !1,
6017
+ this.vt = be.EMPTY_BYTE_STRING, this.bt = !1,
6018
6018
  /**
6019
6019
  * Whether this target state should be included in the next snapshot. We
6020
6020
  * initialize to true so that newly-added targets are included in the next
6021
6021
  * RemoteEvent.
6022
6022
  */
6023
- this.bt = !0;
6023
+ this.Pt = !0;
6024
6024
  }
6025
6025
  /**
6026
6026
  * Whether this target has been marked 'current'.
@@ -6030,7 +6030,7 @@ class _i {
6030
6030
  * was added and that the target is consistent with the rest of the watch
6031
6031
  * stream.
6032
6032
  */ get current() {
6033
- return this.Pt;
6033
+ return this.bt;
6034
6034
  }
6035
6035
  /** The last resume token sent to us for this target. */ get resumeToken() {
6036
6036
  return this.vt;
@@ -6039,13 +6039,13 @@ class _i {
6039
6039
  return 0 !== this.At;
6040
6040
  }
6041
6041
  /** Whether we have modified any state that should trigger a snapshot. */ get St() {
6042
- return this.bt;
6042
+ return this.Pt;
6043
6043
  }
6044
6044
  /**
6045
6045
  * Applies the resume token to the TargetChange, but only when it has a new
6046
6046
  * value. Empty resumeTokens are discarded.
6047
6047
  */ Dt(t) {
6048
- t.approximateByteSize() > 0 && (this.bt = !0, this.vt = t);
6048
+ t.approximateByteSize() > 0 && (this.Pt = !0, this.vt = t);
6049
6049
  }
6050
6050
  /**
6051
6051
  * Creates a target change from the current set of changes.
@@ -6071,18 +6071,18 @@ class _i {
6071
6071
  default:
6072
6072
  O();
6073
6073
  }
6074
- })), new li(this.vt, this.Pt, t, e, n);
6074
+ })), new li(this.vt, this.bt, t, e, n);
6075
6075
  }
6076
6076
  /**
6077
6077
  * Resets the document changes and sets `hasPendingChanges` to false.
6078
6078
  */ xt() {
6079
- this.bt = !1, this.Rt = yi();
6079
+ this.Pt = !1, this.Rt = yi();
6080
6080
  }
6081
6081
  Nt(t, e) {
6082
- this.bt = !0, this.Rt = this.Rt.insert(t, e);
6082
+ this.Pt = !0, this.Rt = this.Rt.insert(t, e);
6083
6083
  }
6084
6084
  kt(t) {
6085
- this.bt = !0, this.Rt = this.Rt.remove(t);
6085
+ this.Pt = !0, this.Rt = this.Rt.remove(t);
6086
6086
  }
6087
6087
  Ot() {
6088
6088
  this.At += 1;
@@ -6091,7 +6091,7 @@ class _i {
6091
6091
  this.At -= 1;
6092
6092
  }
6093
6093
  Mt() {
6094
- this.bt = !0, this.Pt = !0;
6094
+ this.Pt = !0, this.bt = !0;
6095
6095
  }
6096
6096
  }
6097
6097
 
@@ -6424,14 +6424,14 @@ function Ri(t, e) {
6424
6424
  return Ai(t, e.toTimestamp());
6425
6425
  }
6426
6426
 
6427
- function Pi(t) {
6427
+ function bi(t) {
6428
6428
  return $(!!t), st.fromTimestamp(function(t) {
6429
6429
  const e = Ve(t);
6430
6430
  return new nt(e.seconds, e.nanos);
6431
6431
  }(t));
6432
6432
  }
6433
6433
 
6434
- function bi(t, e) {
6434
+ function Pi(t, e) {
6435
6435
  return function(t) {
6436
6436
  return new rt([ "projects", t.projectId, "databases", t.database ]);
6437
6437
  }(t).child("documents").child(e).canonicalString();
@@ -6443,7 +6443,7 @@ function Vi(t) {
6443
6443
  }
6444
6444
 
6445
6445
  function Si(t, e) {
6446
- return bi(t.databaseId, e.path);
6446
+ return Pi(t.databaseId, e.path);
6447
6447
  }
6448
6448
 
6449
6449
  function Di(t, e) {
@@ -6454,7 +6454,7 @@ function Di(t, e) {
6454
6454
  }
6455
6455
 
6456
6456
  function Ci(t, e) {
6457
- return bi(t.databaseId, e);
6457
+ return Pi(t.databaseId, e);
6458
6458
  }
6459
6459
 
6460
6460
  function xi(t) {
@@ -6482,7 +6482,7 @@ function ki(t) {
6482
6482
  }
6483
6483
 
6484
6484
  function $i(t, e, n) {
6485
- const s = Di(t, e.name), i = Pi(e.updateTime), r = e.createTime ? Pi(e.createTime) : st.min(), o = new rn({
6485
+ const s = Di(t, e.name), i = bi(e.updateTime), r = e.createTime ? bi(e.createTime) : st.min(), o = new rn({
6486
6486
  mapValue: {
6487
6487
  fields: e.fields
6488
6488
  }
@@ -6493,7 +6493,7 @@ function $i(t, e, n) {
6493
6493
  function Mi(t, e) {
6494
6494
  return "found" in e ? function(t, e) {
6495
6495
  $(!!e.found), e.found.name, e.found.updateTime;
6496
- const n = Di(t, e.found.name), s = Pi(e.found.updateTime), i = e.found.createTime ? Pi(e.found.createTime) : st.min(), r = new rn({
6496
+ const n = Di(t, e.found.name), s = bi(e.found.updateTime), i = e.found.createTime ? bi(e.found.createTime) : st.min(), r = new rn({
6497
6497
  mapValue: {
6498
6498
  fields: e.found.fields
6499
6499
  }
@@ -6501,7 +6501,7 @@ function Mi(t, e) {
6501
6501
  return un.newFoundDocument(n, s, i, r);
6502
6502
  }(t, e) : "missing" in e ? function(t, e) {
6503
6503
  $(!!e.missing), $(!!e.readTime);
6504
- const n = Di(t, e.missing), s = Pi(e.readTime);
6504
+ const n = Di(t, e.missing), s = bi(e.readTime);
6505
6505
  return un.newNoDocument(n, s);
6506
6506
  }(t, e) : O();
6507
6507
  }
@@ -6515,8 +6515,8 @@ function Fi(t, e) {
6515
6515
  const s = function(t) {
6516
6516
  return "NO_CHANGE" === t ? 0 /* WatchTargetChangeState.NoChange */ : "ADD" === t ? 1 /* WatchTargetChangeState.Added */ : "REMOVE" === t ? 2 /* WatchTargetChangeState.Removed */ : "CURRENT" === t ? 3 /* WatchTargetChangeState.Current */ : "RESET" === t ? 4 /* WatchTargetChangeState.Reset */ : O();
6517
6517
  }(e.targetChange.targetChangeType || "NO_CHANGE"), i = e.targetChange.targetIds || [], r = function(t, e) {
6518
- return t.useProto3Json ? ($(void 0 === e || "string" == typeof e), Pe.fromBase64String(e || "")) : ($(void 0 === e || e instanceof Uint8Array),
6519
- Pe.fromUint8Array(e || new Uint8Array));
6518
+ return t.useProto3Json ? ($(void 0 === e || "string" == typeof e), be.fromBase64String(e || "")) : ($(void 0 === e || e instanceof Uint8Array),
6519
+ be.fromUint8Array(e || new Uint8Array));
6520
6520
  }(t, e.targetChange.resumeToken), o = e.targetChange.cause, u = o && function(t) {
6521
6521
  const e = void 0 === t.code ? B.UNKNOWN : ui(t.code);
6522
6522
  return new L(e, t.message || "");
@@ -6534,7 +6534,7 @@ function Fi(t, e) {
6534
6534
  e.documentChange;
6535
6535
  const s = e.documentChange;
6536
6536
  s.document, s.document.name, s.document.updateTime;
6537
- const i = Di(t, s.document.name), r = Pi(s.document.updateTime), o = s.document.createTime ? Pi(s.document.createTime) : st.min(), u = new rn({
6537
+ const i = Di(t, s.document.name), r = bi(s.document.updateTime), o = s.document.createTime ? bi(s.document.createTime) : st.min(), u = new rn({
6538
6538
  mapValue: {
6539
6539
  fields: s.document.fields
6540
6540
  }
@@ -6544,7 +6544,7 @@ function Fi(t, e) {
6544
6544
  e.documentDelete;
6545
6545
  const s = e.documentDelete;
6546
6546
  s.document;
6547
- const i = Di(t, s.document), r = s.readTime ? Pi(s.readTime) : st.min(), o = un.newNoDocument(i, r), u = s.removedTargetIds || [];
6547
+ const i = Di(t, s.document), r = s.readTime ? bi(s.readTime) : st.min(), o = un.newNoDocument(i, r), u = s.removedTargetIds || [];
6548
6548
  n = new fi([], u, o.key, o);
6549
6549
  } else if ("documentRemove" in e) {
6550
6550
  e.documentRemove;
@@ -6586,7 +6586,7 @@ function Bi(t, e) {
6586
6586
  fieldPath: e.field.canonicalString(),
6587
6587
  setToServerValue: "REQUEST_TIME"
6588
6588
  };
6589
- if (n instanceof Ps) return {
6589
+ if (n instanceof bs) return {
6590
6590
  fieldPath: e.field.canonicalString(),
6591
6591
  appendMissingElements: {
6592
6592
  values: n.elements
@@ -6614,12 +6614,12 @@ function Bi(t, e) {
6614
6614
 
6615
6615
  function Li(t, e) {
6616
6616
  const n = e.currentDocument ? function(t) {
6617
- return void 0 !== t.updateTime ? $s.updateTime(Pi(t.updateTime)) : void 0 !== t.exists ? $s.exists(t.exists) : $s.none();
6617
+ return void 0 !== t.updateTime ? $s.updateTime(bi(t.updateTime)) : void 0 !== t.exists ? $s.exists(t.exists) : $s.none();
6618
6618
  }(e.currentDocument) : $s.none(), s = e.updateTransforms ? e.updateTransforms.map((e => function(t, e) {
6619
6619
  let n = null;
6620
6620
  if ("setToServerValue" in e) $("REQUEST_TIME" === e.setToServerValue), n = new vs; else if ("appendMissingElements" in e) {
6621
6621
  const t = e.appendMissingElements.values || [];
6622
- n = new Ps(t);
6622
+ n = new bs(t);
6623
6623
  } else if ("removeAllFromArray" in e) {
6624
6624
  const t = e.removeAllFromArray.values || [];
6625
6625
  n = new Vs(t);
@@ -6657,14 +6657,14 @@ function Li(t, e) {
6657
6657
  function qi(t, e) {
6658
6658
  return t && t.length > 0 ? ($(void 0 !== e), t.map((t => function(t, e) {
6659
6659
  // NOTE: Deletes don't have an updateTime.
6660
- let n = t.updateTime ? Pi(t.updateTime) : Pi(e);
6660
+ let n = t.updateTime ? bi(t.updateTime) : bi(e);
6661
6661
  return n.isEqual(st.min()) && (
6662
6662
  // The Firestore Emulator currently returns an update time of 0 for
6663
6663
  // deletes of non-existing documents (rather than null). This breaks the
6664
6664
  // test "get deleted doc while offline with source=cache" as NoDocuments
6665
6665
  // with version 0 are filtered by IndexedDb's RemoteDocumentCache.
6666
6666
  // TODO(#2149): Remove this when Emulator is fixed
6667
- n = Pi(e)), new Os(n, t.transformResults || []);
6667
+ n = bi(e)), new Os(n, t.transformResults || []);
6668
6668
  }(t, e)))) : [];
6669
6669
  }
6670
6670
 
@@ -7008,7 +7008,7 @@ function tr(t) {
7008
7008
  * resumed after disconnecting without retransmitting all the data that
7009
7009
  * matches the target. The resume token essentially identifies a point in
7010
7010
  * time from which the server should resume sending results.
7011
- */ , o = Pe.EMPTY_BYTE_STRING) {
7011
+ */ , o = be.EMPTY_BYTE_STRING) {
7012
7012
  this.target = t, this.targetId = e, this.purpose = n, this.sequenceNumber = s, this.snapshotVersion = i,
7013
7013
  this.lastLimboFreeSnapshotVersion = r, this.resumeToken = o;
7014
7014
  }
@@ -7143,7 +7143,7 @@ function cr(t, e) {
7143
7143
  return void 0 !== t.query.documents ? ($(1 === (i = t.query).documents.length),
7144
7144
  s = Wn(Un(xi(i.documents[0])))) : s = function(t) {
7145
7145
  return Wn(Gi(t));
7146
- }(t.query), new er(s, t.targetId, 0 /* TargetPurpose.Listen */ , t.lastListenSequenceNumber, e, n, Pe.fromBase64String(t.resumeToken));
7146
+ }(t.query), new er(s, t.targetId, 0 /* TargetPurpose.Listen */ , t.lastListenSequenceNumber, e, n, be.fromBase64String(t.resumeToken));
7147
7147
  }
7148
7148
 
7149
7149
  /** Encodes TargetData into a DbTarget for storage locally. */ function hr(t, e) {
@@ -7239,7 +7239,7 @@ function _r(t, e, n, s) {
7239
7239
  saveBundleMetadata(t, e) {
7240
7240
  return mr(t).put({
7241
7241
  bundleId: (n = e).id,
7242
- createTime: or(Pi(n.createTime)),
7242
+ createTime: or(bi(n.createTime)),
7243
7243
  version: n.version
7244
7244
  });
7245
7245
  var n;
@@ -7258,7 +7258,7 @@ function _r(t, e, n, s) {
7258
7258
  return gr(t).put(function(t) {
7259
7259
  return {
7260
7260
  name: t.name,
7261
- readTime: or(Pi(t.readTime)),
7261
+ readTime: or(bi(t.readTime)),
7262
7262
  bundledQuery: t.bundledQuery
7263
7263
  };
7264
7264
  }(e));
@@ -7528,7 +7528,7 @@ function Er(t) {
7528
7528
  for (;!n.done; ) this.Re(n.value), n = e.next();
7529
7529
  this.ve();
7530
7530
  }
7531
- /** Writes utf8 bytes into this byte sequence, ascending. */ Pe(t) {
7531
+ /** Writes utf8 bytes into this byte sequence, ascending. */ be(t) {
7532
7532
  for (const e of t) {
7533
7533
  const t = e.charCodeAt(0);
7534
7534
  if (t < 128) this.Te(t); else if (t < 2048) this.Te(960 | t >>> 6), this.Te(128 | 63 & t); else if (e < "\ud800" || "\udbff" < e) this.Te(480 | t >>> 12),
@@ -7540,7 +7540,7 @@ function Er(t) {
7540
7540
  }
7541
7541
  this.Ee();
7542
7542
  }
7543
- /** Writes utf8 bytes into this byte sequence, descending */ be(t) {
7543
+ /** Writes utf8 bytes into this byte sequence, descending */ Pe(t) {
7544
7544
  for (const e of t) {
7545
7545
  const t = e.charCodeAt(0);
7546
7546
  if (t < 128) this.Re(t); else if (t < 2048) this.Re(960 | t >>> 6), this.Re(128 | 63 & t); else if (e < "\ud800" || "\udbff" < e) this.Re(480 | t >>> 12),
@@ -7654,7 +7654,7 @@ class Rr {
7654
7654
  this.Me.Ie(t);
7655
7655
  }
7656
7656
  le(t) {
7657
- this.Me.Pe(t);
7657
+ this.Me.be(t);
7658
7658
  }
7659
7659
  he(t) {
7660
7660
  this.Me.Ve(t);
@@ -7672,7 +7672,7 @@ class vr {
7672
7672
  this.Me.Ae(t);
7673
7673
  }
7674
7674
  le(t) {
7675
- this.Me.be(t);
7675
+ this.Me.Pe(t);
7676
7676
  }
7677
7677
  he(t) {
7678
7678
  this.Me.Ce(t);
@@ -7685,7 +7685,7 @@ class vr {
7685
7685
  /**
7686
7686
  * Implements `DirectionalIndexByteEncoder` using `OrderedCodeWriter` for the
7687
7687
  * actual encoding.
7688
- */ class Pr {
7688
+ */ class br {
7689
7689
  constructor() {
7690
7690
  this.Me = new Ar, this.Fe = new Rr(this.Me), this.Be = new vr(this.Me);
7691
7691
  }
@@ -7719,7 +7719,7 @@ class vr {
7719
7719
  * See the License for the specific language governing permissions and
7720
7720
  * limitations under the License.
7721
7721
  */
7722
- /** Represents an index entry saved by the SDK in persisted storage. */ class br {
7722
+ /** Represents an index entry saved by the SDK in persisted storage. */ class Pr {
7723
7723
  constructor(t, e, n, s) {
7724
7724
  this.indexId = t, this.documentKey = e, this.arrayValue = n, this.directionalValue = s;
7725
7725
  }
@@ -7729,7 +7729,7 @@ class vr {
7729
7729
  */ qe() {
7730
7730
  const t = this.directionalValue.length, e = 0 === t || 255 === this.directionalValue[t - 1] ? t + 1 : t, n = new Uint8Array(e);
7731
7731
  return n.set(this.directionalValue, 0), e !== t ? n.set([ 0 ], this.directionalValue.length) : ++n[n.length - 1],
7732
- new br(this.indexId, this.documentKey, this.arrayValue, n);
7732
+ new Pr(this.indexId, this.documentKey, this.arrayValue, n);
7733
7733
  }
7734
7734
  }
7735
7735
 
@@ -8339,11 +8339,11 @@ class Kr {
8339
8339
  return a;
8340
8340
  }
8341
8341
  /** Generates the lower bound for `arrayValue` and `directionalValue`. */ rn(t, e, n, s) {
8342
- const i = new br(t, ct.empty(), e, n);
8342
+ const i = new Pr(t, ct.empty(), e, n);
8343
8343
  return s ? i : i.qe();
8344
8344
  }
8345
8345
  /** Generates the upper bound for `arrayValue` and `directionalValue`. */ on(t, e, n, s) {
8346
- const i = new br(t, ct.empty(), e, n);
8346
+ const i = new Pr(t, ct.empty(), e, n);
8347
8347
  return s ? i.qe() : i;
8348
8348
  }
8349
8349
  Xe(t, e) {
@@ -8391,7 +8391,7 @@ class Kr {
8391
8391
  * Returns `null` if the document does not have all fields specified in the
8392
8392
  * index.
8393
8393
  */ un(t, e) {
8394
- const n = new Pr;
8394
+ const n = new br;
8395
8395
  for (const s of lt(t)) {
8396
8396
  const t = e.data.field(s.fieldPath);
8397
8397
  if (null == t) return null;
@@ -8401,14 +8401,14 @@ class Kr {
8401
8401
  return n.$e();
8402
8402
  }
8403
8403
  /** Encodes a single value to the ascending index format. */ sn(t) {
8404
- const e = new Pr;
8404
+ const e = new br;
8405
8405
  return Ir.pe.oe(t, e.Le(0 /* IndexKind.ASCENDING */)), e.$e();
8406
8406
  }
8407
8407
  /**
8408
8408
  * Returns an encoded form of the document key that sorts based on the key
8409
8409
  * ordering of the field index.
8410
8410
  */ cn(t, e) {
8411
- const n = new Pr;
8411
+ const n = new br;
8412
8412
  return Ir.pe.oe(ze(this.databaseId, e), n.Le(function(t) {
8413
8413
  const e = lt(t);
8414
8414
  return 0 === e.length ? 0 /* IndexKind.ASCENDING */ : e[e.length - 1].kind;
@@ -8420,7 +8420,7 @@ class Kr {
8420
8420
  */ en(t, e, n) {
8421
8421
  if (null === n) return [];
8422
8422
  let s = [];
8423
- s.push(new Pr);
8423
+ s.push(new br);
8424
8424
  let i = 0;
8425
8425
  for (const r of lt(t)) {
8426
8426
  const t = n[i++];
@@ -8451,7 +8451,7 @@ class Kr {
8451
8451
  */ hn(t, e, n) {
8452
8452
  const s = [ ...t ], i = [];
8453
8453
  for (const t of n.arrayValue.values || []) for (const n of s) {
8454
- const s = new Pr;
8454
+ const s = new br;
8455
8455
  s.seed(n.$e()), Ir.pe.oe(t, s.Le(e.kind)), i.push(s);
8456
8456
  }
8457
8457
  return i;
@@ -8517,7 +8517,7 @@ class Kr {
8517
8517
  index: "documentKeyIndex",
8518
8518
  range: IDBKeyRange.only([ n.indexId, this.uid, this.cn(n, e) ])
8519
8519
  }, ((t, s) => {
8520
- i = i.add(new br(n.indexId, e, s.arrayValue, s.directionalValue));
8520
+ i = i.add(new Pr(n.indexId, e, s.arrayValue, s.directionalValue));
8521
8521
  })).next((() => i));
8522
8522
  }
8523
8523
  /** Creates the index entries for the given document. */ _n(t, e) {
@@ -8527,8 +8527,8 @@ class Kr {
8527
8527
  const i = ht(e);
8528
8528
  if (null != i) {
8529
8529
  const r = t.data.field(i.fieldPath);
8530
- if (We(r)) for (const i of r.arrayValue.values || []) n = n.add(new br(e.indexId, t.key, this.sn(i), s));
8531
- } else n = n.add(new br(e.indexId, t.key, Ur, s));
8530
+ if (We(r)) for (const i of r.arrayValue.values || []) n = n.add(new Pr(e.indexId, t.key, this.sn(i), s));
8531
+ } else n = n.add(new Pr(e.indexId, t.key, Ur, s));
8532
8532
  return n;
8533
8533
  }
8534
8534
  /**
@@ -9090,7 +9090,7 @@ class io {
9090
9090
  // '0', the backend would consider it unset and replace it with its own ID.
9091
9091
  return new io(0);
9092
9092
  }
9093
- static Pn() {
9093
+ static bn() {
9094
9094
  // Sync engine assigns target IDs for limbo document detection.
9095
9095
  return new io(-1);
9096
9096
  }
@@ -9122,30 +9122,30 @@ class io {
9122
9122
  // to IndexedDb whenever we need to read metadata. We can revisit if it turns
9123
9123
  // out to have a meaningful performance impact.
9124
9124
  allocateTargetId(t) {
9125
- return this.bn(t).next((e => {
9125
+ return this.Pn(t).next((e => {
9126
9126
  const n = new io(e.highestTargetId);
9127
9127
  return e.highestTargetId = n.next(), this.Vn(t, e).next((() => e.highestTargetId));
9128
9128
  }));
9129
9129
  }
9130
9130
  getLastRemoteSnapshotVersion(t) {
9131
- return this.bn(t).next((t => st.fromTimestamp(new nt(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds))));
9131
+ return this.Pn(t).next((t => st.fromTimestamp(new nt(t.lastRemoteSnapshotVersion.seconds, t.lastRemoteSnapshotVersion.nanoseconds))));
9132
9132
  }
9133
9133
  getHighestSequenceNumber(t) {
9134
- return this.bn(t).next((t => t.highestListenSequenceNumber));
9134
+ return this.Pn(t).next((t => t.highestListenSequenceNumber));
9135
9135
  }
9136
9136
  setTargetsMetadata(t, e, n) {
9137
- return this.bn(t).next((s => (s.highestListenSequenceNumber = e, n && (s.lastRemoteSnapshotVersion = n.toTimestamp()),
9137
+ return this.Pn(t).next((s => (s.highestListenSequenceNumber = e, n && (s.lastRemoteSnapshotVersion = n.toTimestamp()),
9138
9138
  e > s.highestListenSequenceNumber && (s.highestListenSequenceNumber = e), this.Vn(t, s))));
9139
9139
  }
9140
9140
  addTargetData(t, e) {
9141
- return this.Sn(t, e).next((() => this.bn(t).next((n => (n.targetCount += 1, this.Dn(e, n),
9141
+ return this.Sn(t, e).next((() => this.Pn(t).next((n => (n.targetCount += 1, this.Dn(e, n),
9142
9142
  this.Vn(t, n))))));
9143
9143
  }
9144
9144
  updateTargetData(t, e) {
9145
9145
  return this.Sn(t, e);
9146
9146
  }
9147
9147
  removeTargetData(t, e) {
9148
- return this.removeMatchingKeysForTargetId(t, e.targetId).next((() => oo(t).delete(e.targetId))).next((() => this.bn(t))).next((e => ($(e.targetCount > 0),
9148
+ return this.removeMatchingKeysForTargetId(t, e.targetId).next((() => oo(t).delete(e.targetId))).next((() => this.Pn(t))).next((e => ($(e.targetCount > 0),
9149
9149
  e.targetCount -= 1, this.Vn(t, e))));
9150
9150
  }
9151
9151
  /**
@@ -9168,7 +9168,7 @@ class io {
9168
9168
  e(s);
9169
9169
  }));
9170
9170
  }
9171
- bn(t) {
9171
+ Pn(t) {
9172
9172
  return uo(t).get("targetGlobalKey").next((t => ($(null !== t), t)));
9173
9173
  }
9174
9174
  Vn(t, e) {
@@ -9188,7 +9188,7 @@ class io {
9188
9188
  n = !0), n;
9189
9189
  }
9190
9190
  getTargetCount(t) {
9191
- return this.bn(t).next((t => t.targetCount));
9191
+ return this.Pn(t).next((t => t.targetCount));
9192
9192
  }
9193
9193
  getTargetData(t, e) {
9194
9194
  // Iterating by the canonicalId may yield more than one result because
@@ -10005,7 +10005,7 @@ function Ro(t, e) {
10005
10005
  * Represents a local view (overlay) of a document, and the fields that are
10006
10006
  * locally mutated.
10007
10007
  */
10008
- class Po {
10008
+ class bo {
10009
10009
  constructor(t,
10010
10010
  /**
10011
10011
  * The fields that are locally mutated by patch mutations.
@@ -10039,7 +10039,7 @@ class Po {
10039
10039
  * have a cached version in remoteDocumentCache or local mutations for the
10040
10040
  * document). The view is computed by applying the mutations in the
10041
10041
  * MutationQueue to the RemoteDocumentCache.
10042
- */ class bo {
10042
+ */ class Po {
10043
10043
  constructor(t, e, n, s) {
10044
10044
  this.remoteDocumentCache = t, this.mutationQueue = e, this.documentOverlayCache = n,
10045
10045
  this.indexManager = s;
@@ -10132,7 +10132,7 @@ class Po {
10132
10132
  })), this.recalculateAndSaveOverlays(t, i).next((t => (t.forEach(((t, e) => r.set(t, e))),
10133
10133
  e.forEach(((t, e) => {
10134
10134
  var n;
10135
- return o.set(t, new Po(e, null !== (n = r.get(t)) && void 0 !== n ? n : null));
10135
+ return o.set(t, new bo(e, null !== (n = r.get(t)) && void 0 !== n ? n : null));
10136
10136
  })), o)));
10137
10137
  }
10138
10138
  recalculateAndSaveOverlays(t, e) {
@@ -10289,7 +10289,7 @@ class Po {
10289
10289
  return this.Zn.set(e.id, {
10290
10290
  id: (n = e).id,
10291
10291
  version: n.version,
10292
- createTime: Pi(n.createTime)
10292
+ createTime: bi(n.createTime)
10293
10293
  }), At.resolve();
10294
10294
  }
10295
10295
  getNamedQuery(t, e) {
@@ -10300,7 +10300,7 @@ class Po {
10300
10300
  return {
10301
10301
  name: t.name,
10302
10302
  query: lr(t.bundledQuery),
10303
- readTime: Pi(t.readTime)
10303
+ readTime: bi(t.readTime)
10304
10304
  };
10305
10305
  }(e)), At.resolve();
10306
10306
  }
@@ -10806,7 +10806,7 @@ class ko extends go {
10806
10806
  * A ordered bidirectional mapping between documents and the remote target
10807
10807
  * IDs.
10808
10808
  */
10809
- this.vs = new Do, this.targetCount = 0, this.Ps = io.vn();
10809
+ this.vs = new Do, this.targetCount = 0, this.bs = io.vn();
10810
10810
  }
10811
10811
  forEachTarget(t, e) {
10812
10812
  return this.As.forEach(((t, n) => e(n))), At.resolve();
@@ -10818,7 +10818,7 @@ class ko extends go {
10818
10818
  return At.resolve(this.Rs);
10819
10819
  }
10820
10820
  allocateTargetId(t) {
10821
- return this.highestTargetId = this.Ps.next(), At.resolve(this.highestTargetId);
10821
+ return this.highestTargetId = this.bs.next(), At.resolve(this.highestTargetId);
10822
10822
  }
10823
10823
  setTargetsMetadata(t, e, n) {
10824
10824
  return n && (this.lastRemoteSnapshotVersion = n), e > this.Rs && (this.Rs = e),
@@ -10827,7 +10827,7 @@ class ko extends go {
10827
10827
  Sn(t) {
10828
10828
  this.As.set(t.target, t);
10829
10829
  const e = t.targetId;
10830
- e > this.highestTargetId && (this.Ps = new io(e), this.highestTargetId = e), t.sequenceNumber > this.Rs && (this.Rs = t.sequenceNumber);
10830
+ e > this.highestTargetId && (this.bs = new io(e), this.highestTargetId = e), t.sequenceNumber > this.Rs && (this.Rs = t.sequenceNumber);
10831
10831
  }
10832
10832
  addTargetData(t, e) {
10833
10833
  return this.Sn(e), this.targetCount += 1, At.resolve();
@@ -10904,7 +10904,7 @@ class $o {
10904
10904
  * checked or asserted on every access.
10905
10905
  */
10906
10906
  constructor(t, e) {
10907
- this.bs = {}, this.overlays = {}, this.Vs = new Ot(0), this.Ss = !1, this.Ss = !0,
10907
+ this.Ps = {}, this.overlays = {}, this.Vs = new Ot(0), this.Ss = !1, this.Ss = !0,
10908
10908
  this.referenceDelegate = t(this), this.Ds = new Oo(this);
10909
10909
  this.indexManager = new Lr, this.remoteDocumentCache = function(t) {
10910
10910
  return new No(t);
@@ -10936,8 +10936,8 @@ class $o {
10936
10936
  return e || (e = new So, this.overlays[t.toKey()] = e), e;
10937
10937
  }
10938
10938
  getMutationQueue(t, e) {
10939
- let n = this.bs[t.toKey()];
10940
- return n || (n = new xo(e, this.referenceDelegate), this.bs[t.toKey()] = n), n;
10939
+ let n = this.Ps[t.toKey()];
10940
+ return n || (n = new xo(e, this.referenceDelegate), this.Ps[t.toKey()] = n), n;
10941
10941
  }
10942
10942
  getTargetCache() {
10943
10943
  return this.Ds;
@@ -10955,7 +10955,7 @@ class $o {
10955
10955
  t)));
10956
10956
  }
10957
10957
  Os(t, e) {
10958
- return At.or(Object.values(this.bs).map((n => () => n.containsKey(t, e))));
10958
+ return At.or(Object.values(this.Ps).map((n => () => n.containsKey(t, e))));
10959
10959
  }
10960
10960
  }
10961
10961
 
@@ -11367,8 +11367,8 @@ class Bo {
11367
11367
  let s = null !== (e = n.get(t.userId)) && void 0 !== e ? e : ws();
11368
11368
  cr(this.serializer, t).keys().forEach((t => s = s.add(t))), n.set(t.userId, s);
11369
11369
  })), At.forEach(n, ((t, n) => {
11370
- const r = new P(n), o = yr.ie(this.serializer, r), u = i.getIndexManager(r), c = Xr.ie(r, this.serializer, u, i.referenceDelegate);
11371
- return new bo(s, c, o, u).recalculateAndSaveOverlaysForDocumentKeys(new fe(e, Ot.ct), t).next();
11370
+ const r = new b(n), o = yr.ie(this.serializer, r), u = i.getIndexManager(r), c = Xr.ie(r, this.serializer, u, i.referenceDelegate);
11371
+ return new Po(s, c, o, u).recalculateAndSaveOverlaysForDocumentKeys(new fe(e, Ot.ct), t).next();
11372
11372
  }));
11373
11373
  }));
11374
11374
  }
@@ -11650,7 +11650,7 @@ class Ko {
11650
11650
  })), this.ri.close(),
11651
11651
  // Remove the entry marking the client as zombied from LocalStorage since
11652
11652
  // we successfully deleted its metadata from IndexedDb.
11653
- this.Pi();
11653
+ this.bi();
11654
11654
  }
11655
11655
  /**
11656
11656
  * Returns clients that are not zombied and have an updateTime within the
@@ -11664,7 +11664,7 @@ class Ko {
11664
11664
  * ID.
11665
11665
  *
11666
11666
  * PORTING NOTE: This is only used for Web multi-tab.
11667
- */ bi() {
11667
+ */ Pi() {
11668
11668
  return this.runTransaction("getActiveClients", "readonly", (t => Qo(t).j().next((t => this.Ii(t, 18e5).map((t => t.clientId))))));
11669
11669
  }
11670
11670
  get started() {
@@ -11802,7 +11802,7 @@ class Ko {
11802
11802
  x("Failed to set zombie client id.", t);
11803
11803
  }
11804
11804
  }
11805
- /** Removes the zombied client entry if it exists. */ Pi() {
11805
+ /** Removes the zombied client entry if it exists. */ bi() {
11806
11806
  if (this.oi) try {
11807
11807
  this.oi.removeItem(this.Ti(this.clientId));
11808
11808
  } catch (t) {
@@ -12087,7 +12087,7 @@ class Ho {
12087
12087
  // TODO(indexing): Add spec tests that test these components change after a
12088
12088
  // user change
12089
12089
  this.documentOverlayCache = this.persistence.getDocumentOverlayCache(t), this.indexManager = this.persistence.getIndexManager(t),
12090
- this.mutationQueue = this.persistence.getMutationQueue(t, this.indexManager), this.localDocuments = new bo(this.Gi, this.mutationQueue, this.documentOverlayCache, this.indexManager),
12090
+ this.mutationQueue = this.persistence.getMutationQueue(t, this.indexManager), this.localDocuments = new Po(this.Gi, this.mutationQueue, this.documentOverlayCache, this.indexManager),
12091
12091
  this.Gi.setIndexManager(this.indexManager), this.Li.initialize(this.localDocuments, this.indexManager);
12092
12092
  }
12093
12093
  collectGarbage(t) {
@@ -12225,7 +12225,7 @@ function Xo(t) {
12225
12225
  // the updated assignment.
12226
12226
  o.push(n.Ds.removeMatchingKeys(t, r.removedDocuments, u).next((() => n.Ds.addMatchingKeys(t, r.addedDocuments, u))));
12227
12227
  let a = c.withSequenceNumber(t.currentSequenceNumber);
12228
- e.targetMismatches.has(u) ? a = a.withResumeToken(Pe.EMPTY_BYTE_STRING, st.min()).withLastLimboFreeSnapshotVersion(st.min()) : r.resumeToken.approximateByteSize() > 0 && (a = a.withResumeToken(r.resumeToken, s)),
12228
+ e.targetMismatches.has(u) ? a = a.withResumeToken(be.EMPTY_BYTE_STRING, st.min()).withLastLimboFreeSnapshotVersion(st.min()) : r.resumeToken.approximateByteSize() > 0 && (a = a.withResumeToken(r.resumeToken, s)),
12229
12229
  i = i.insert(u, a),
12230
12230
  // Update the target data if there are target changes (or if
12231
12231
  // sufficient time has passed since the last update).
@@ -12492,12 +12492,12 @@ async function hu(t, e, n = ws()) {
12492
12492
  // unlisten the query somehow.
12493
12493
  const s = await su(t, Wn(lr(e.bundledQuery))), i = F(t);
12494
12494
  return i.persistence.runTransaction("Save named query", "readwrite", (t => {
12495
- const r = Pi(e.readTime);
12495
+ const r = bi(e.readTime);
12496
12496
  // Simply save the query itself if it is older than what the SDK already
12497
12497
  // has.
12498
12498
  if (s.snapshotVersion.compareTo(r) >= 0) return i.xs.saveNamedQuery(t, e);
12499
12499
  // Update existing target data because the query from the bundle is newer.
12500
- const o = s.withResumeToken(Pe.EMPTY_BYTE_STRING, r);
12500
+ const o = s.withResumeToken(be.EMPTY_BYTE_STRING, r);
12501
12501
  return i.qi = i.qi.insert(o.targetId, o), i.Ds.updateTargetData(t, o).next((() => i.Ds.removeMatchingKeysForTargetId(t, s.targetId))).next((() => i.Ds.addMatchingKeys(t, n, s.targetId))).next((() => i.xs.saveNamedQuery(t, e)));
12502
12502
  }));
12503
12503
  }
@@ -12733,7 +12733,7 @@ class yu {
12733
12733
  async start() {
12734
12734
  // Retrieve the list of existing clients to backfill the data in
12735
12735
  // SharedClientState.
12736
- const t = await this.syncEngine.bi();
12736
+ const t = await this.syncEngine.Pi();
12737
12737
  for (const e of t) {
12738
12738
  if (e === this.sr) continue;
12739
12739
  const t = this.getItem(lu(this.persistenceKey, e));
@@ -12814,7 +12814,7 @@ class yu {
12814
12814
  this.vr(t);
12815
12815
  }
12816
12816
  notifyBundleLoaded(t) {
12817
- this.Pr(t);
12817
+ this.br(t);
12818
12818
  }
12819
12819
  shutdown() {
12820
12820
  this.started && (this.window.removeEventListener("storage", this.ir), this.removeItem(this.ar),
@@ -12840,7 +12840,7 @@ class yu {
12840
12840
  if (this.started) {
12841
12841
  if (null !== e.key) if (this.lr.test(e.key)) {
12842
12842
  if (null == e.newValue) {
12843
- const t = this.br(e.key);
12843
+ const t = this.Pr(e.key);
12844
12844
  return this.Vr(t, null);
12845
12845
  }
12846
12846
  {
@@ -12912,14 +12912,14 @@ class yu {
12912
12912
  const s = du(this.persistenceKey, t), i = new wu(t, e, n);
12913
12913
  this.setItem(s, i.tr());
12914
12914
  }
12915
- Pr(t) {
12915
+ br(t) {
12916
12916
  const e = JSON.stringify(Array.from(t));
12917
12917
  this.setItem(this.mr, e);
12918
12918
  }
12919
12919
  /**
12920
12920
  * Parses a client state key in WebStorage. Returns null if the key does not
12921
12921
  * match the expected key format.
12922
- */ br(t) {
12922
+ */ Pr(t) {
12923
12923
  const e = this.lr.exec(t);
12924
12924
  return e ? e[1] : null;
12925
12925
  }
@@ -12927,7 +12927,7 @@ class yu {
12927
12927
  * Parses a client state in WebStorage. Returns 'null' if the value could not
12928
12928
  * be parsed.
12929
12929
  */ Sr(t, e) {
12930
- const n = this.br(t);
12930
+ const n = this.Pr(t);
12931
12931
  return mu.Xi(n, e);
12932
12932
  }
12933
12933
  /**
@@ -12935,7 +12935,7 @@ class yu {
12935
12935
  * could not be parsed.
12936
12936
  */ Dr(t, e) {
12937
12937
  const n = this.dr.exec(t), s = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;
12938
- return _u.Xi(new P(i), s, e);
12938
+ return _u.Xi(new b(i), s, e);
12939
12939
  }
12940
12940
  /**
12941
12941
  * Parses a query target state from WebStorage. Returns 'null' if the value
@@ -13203,7 +13203,7 @@ function Ru() {
13203
13203
  * bridge to other implementations that are streams but do not implement the
13204
13204
  * interface. The stream callbacks are invoked with the callOn... methods.
13205
13205
  */
13206
- class Pu {
13206
+ class bu {
13207
13207
  constructor(t) {
13208
13208
  this.Hr = t.Hr, this.Jr = t.Jr;
13209
13209
  }
@@ -13248,7 +13248,7 @@ class Pu {
13248
13248
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13249
13249
  * See the License for the specific language governing permissions and
13250
13250
  * limitations under the License.
13251
- */ const bu = "WebChannelConnection";
13251
+ */ const Pu = "WebChannelConnection";
13252
13252
 
13253
13253
  class Vu extends
13254
13254
  /**
@@ -13285,7 +13285,7 @@ class {
13285
13285
  * Modifies the headers for a request, adding any authorization token if
13286
13286
  * present and any additional headers for the request.
13287
13287
  */ lo(t, e, n) {
13288
- t["X-Goog-Api-Client"] = "gl-js/ fire/" + b,
13288
+ t["X-Goog-Api-Client"] = "gl-js/ fire/" + P,
13289
13289
  // Content-Type: text/plain will avoid preflight requests which might
13290
13290
  // mess with CORS and redirects by proxies. If we add custom headers
13291
13291
  // we will need to change this code to potentially use the $httpOverwrite
@@ -13311,16 +13311,16 @@ class {
13311
13311
  switch (u.getLastErrorCode()) {
13312
13312
  case webchannelWrapper.ErrorCode.NO_ERROR:
13313
13313
  const e = u.getResponseJson();
13314
- C(bu, `XHR for RPC '${t}' ${i} received:`, JSON.stringify(e)), r(e);
13314
+ C(Pu, `XHR for RPC '${t}' ${i} received:`, JSON.stringify(e)), r(e);
13315
13315
  break;
13316
13316
 
13317
13317
  case webchannelWrapper.ErrorCode.TIMEOUT:
13318
- C(bu, `RPC '${t}' ${i} timed out`), o(new L(B.DEADLINE_EXCEEDED, "Request time out"));
13318
+ C(Pu, `RPC '${t}' ${i} timed out`), o(new L(B.DEADLINE_EXCEEDED, "Request time out"));
13319
13319
  break;
13320
13320
 
13321
13321
  case webchannelWrapper.ErrorCode.HTTP_ERROR:
13322
13322
  const n = u.getStatus();
13323
- if (C(bu, `RPC '${t}' ${i} failed with status:`, n, "response text:", u.getResponseText()),
13323
+ if (C(Pu, `RPC '${t}' ${i} failed with status:`, n, "response text:", u.getResponseText()),
13324
13324
  n > 0) {
13325
13325
  let t = u.getResponseJson();
13326
13326
  Array.isArray(t) && (t = t[0]);
@@ -13342,11 +13342,11 @@ class {
13342
13342
  O();
13343
13343
  }
13344
13344
  } finally {
13345
- C(bu, `RPC '${t}' ${i} completed.`);
13345
+ C(Pu, `RPC '${t}' ${i} completed.`);
13346
13346
  }
13347
13347
  }));
13348
13348
  const c = JSON.stringify(s);
13349
- C(bu, `RPC '${t}' ${i} sending request:`, s), u.send(e, "POST", c, n, 15);
13349
+ C(Pu, `RPC '${t}' ${i} sending request:`, s), u.send(e, "POST", c, n, 15);
13350
13350
  }));
13351
13351
  }
13352
13352
  wo(t, e, n) {
@@ -13386,7 +13386,7 @@ class {
13386
13386
  // which is recognized by the webchannel backend.
13387
13387
  u.encodeInitMessageHeaders = !0;
13388
13388
  const c = i.join("");
13389
- C(bu, `Creating RPC '${t}' stream ${s}: ${c}`, u);
13389
+ C(Pu, `Creating RPC '${t}' stream ${s}: ${c}`, u);
13390
13390
  const a = r.createWebChannel(c, u);
13391
13391
  // WebChannel supports sending the first message with the handshake - saving
13392
13392
  // a network round trip. However, it will have to call send in the same
@@ -13397,10 +13397,10 @@ class {
13397
13397
  // A flag to determine whether the stream was closed (by us or through an
13398
13398
  // error/close event) to avoid delivering multiple close events or sending
13399
13399
  // on a closed stream
13400
- const f = new Pu({
13400
+ const f = new bu({
13401
13401
  Hr: e => {
13402
- l ? C(bu, `Not sending because RPC '${t}' stream ${s} is closed:`, e) : (h || (C(bu, `Opening RPC '${t}' stream ${s} transport.`),
13403
- a.open(), h = !0), C(bu, `RPC '${t}' stream ${s} sending:`, e), a.send(e));
13402
+ l ? C(Pu, `Not sending because RPC '${t}' stream ${s} is closed:`, e) : (h || (C(Pu, `Opening RPC '${t}' stream ${s} transport.`),
13403
+ a.open(), h = !0), C(Pu, `RPC '${t}' stream ${s} sending:`, e), a.send(e));
13404
13404
  },
13405
13405
  Jr: () => a.close()
13406
13406
  }), d = (t, e, n) => {
@@ -13421,11 +13421,11 @@ class {
13421
13421
  // Note that eventually this function could go away if we are confident
13422
13422
  // enough the code is exception free.
13423
13423
  return d(a, webchannelWrapper.WebChannel.EventType.OPEN, (() => {
13424
- l || C(bu, `RPC '${t}' stream ${s} transport opened.`);
13424
+ l || C(Pu, `RPC '${t}' stream ${s} transport opened.`);
13425
13425
  })), d(a, webchannelWrapper.WebChannel.EventType.CLOSE, (() => {
13426
- l || (l = !0, C(bu, `RPC '${t}' stream ${s} transport closed`), f.io());
13426
+ l || (l = !0, C(Pu, `RPC '${t}' stream ${s} transport closed`), f.io());
13427
13427
  })), d(a, webchannelWrapper.WebChannel.EventType.ERROR, (e => {
13428
- l || (l = !0, N(bu, `RPC '${t}' stream ${s} transport errored:`, e), f.io(new L(B.UNAVAILABLE, "The operation could not be completed")));
13428
+ l || (l = !0, N(Pu, `RPC '${t}' stream ${s} transport errored:`, e), f.io(new L(B.UNAVAILABLE, "The operation could not be completed")));
13429
13429
  })), d(a, webchannelWrapper.WebChannel.EventType.MESSAGE, (e => {
13430
13430
  var n;
13431
13431
  if (!l) {
@@ -13438,7 +13438,7 @@ class {
13438
13438
  // Use any because msgData.error is not typed.
13439
13439
  const r = i, o = r.error || (null === (n = r[0]) || void 0 === n ? void 0 : n.error);
13440
13440
  if (o) {
13441
- C(bu, `RPC '${t}' stream ${s} received error:`, o);
13441
+ C(Pu, `RPC '${t}' stream ${s} received error:`, o);
13442
13442
  // error.status will be a string like 'OK' or 'NOT_FOUND'.
13443
13443
  const e = o.status;
13444
13444
  let n =
@@ -13457,10 +13457,10 @@ class {
13457
13457
  void 0 === n && (n = B.INTERNAL, i = "Unknown error status: " + e + " with message " + o.message),
13458
13458
  // Mark closed so no further events are propagated
13459
13459
  l = !0, f.io(new L(n, i)), a.close();
13460
- } else C(bu, `RPC '${t}' stream ${s} received:`, i), f.ro(i);
13460
+ } else C(Pu, `RPC '${t}' stream ${s} received:`, i), f.ro(i);
13461
13461
  }
13462
13462
  })), d(o, webchannelWrapper.Event.STAT_EVENT, (e => {
13463
- e.stat === webchannelWrapper.Stat.PROXY ? C(bu, `RPC '${t}' stream ${s} detected buffering proxy`) : e.stat === webchannelWrapper.Stat.NOPROXY && C(bu, `RPC '${t}' stream ${s} detected no buffering proxy`);
13463
+ e.stat === webchannelWrapper.Stat.PROXY ? C(Pu, `RPC '${t}' stream ${s} detected buffering proxy`) : e.stat === webchannelWrapper.Stat.NOPROXY && C(Pu, `RPC '${t}' stream ${s} detected no buffering proxy`);
13464
13464
  })), setTimeout((() => {
13465
13465
  // Technically we could/should wait for the WebChannel opened event,
13466
13466
  // but because we want to send the first message with the WebChannel
@@ -13624,7 +13624,7 @@ class xu {
13624
13624
  // bounds.
13625
13625
  this.Io *= this.yo, this.Io < this.mo && (this.Io = this.mo), this.Io > this.po && (this.Io = this.po);
13626
13626
  }
13627
- Po() {
13627
+ bo() {
13628
13628
  null !== this.To && (this.To.skipDelay(), this.To = null);
13629
13629
  }
13630
13630
  cancel() {
@@ -13685,7 +13685,7 @@ class xu {
13685
13685
  */
13686
13686
  class Nu {
13687
13687
  constructor(t, e, n, s, i, r, o, u) {
13688
- this.Hs = t, this.bo = n, this.Vo = s, this.connection = i, this.authCredentialsProvider = r,
13688
+ this.Hs = t, this.Po = n, this.Vo = s, this.connection = i, this.authCredentialsProvider = r,
13689
13689
  this.appCheckCredentialsProvider = o, this.listener = u, this.state = 0 /* PersistentStreamState.Initial */ ,
13690
13690
  /**
13691
13691
  * A close count that's incremented every time the stream is closed; used by
@@ -13748,7 +13748,7 @@ class Nu {
13748
13748
  */ Mo() {
13749
13749
  // Starts the idle time if we are in state 'Open' and are not yet already
13750
13750
  // running a timer (in which case the previous idle timeout still applies).
13751
- this.ko() && null === this.Do && (this.Do = this.Hs.enqueueAfterDelay(this.bo, 6e4, (() => this.Fo())));
13751
+ this.ko() && null === this.Do && (this.Do = this.Hs.enqueueAfterDelay(this.Po, 6e4, (() => this.Fo())));
13752
13752
  }
13753
13753
  /** Sends a message to the underlying stream. */ Bo(t) {
13754
13754
  this.Lo(), this.stream.send(t);
@@ -13888,7 +13888,7 @@ class Nu {
13888
13888
  // targets is empty). The backend is guaranteed to send such responses.
13889
13889
  if (!("targetChange" in t)) return st.min();
13890
13890
  const e = t.targetChange;
13891
- return e.targetIds && e.targetIds.length ? st.min() : e.readTime ? Pi(e.readTime) : st.min();
13891
+ return e.targetIds && e.targetIds.length ? st.min() : e.readTime ? bi(e.readTime) : st.min();
13892
13892
  }(t);
13893
13893
  return this.listener.jo(e, n);
13894
13894
  }
@@ -13969,7 +13969,7 @@ class Nu {
13969
13969
  // Note, that we could consider a successful handshake healthy, however,
13970
13970
  // the write itself might be causing an error we want to back off from.
13971
13971
  this.xo.reset();
13972
- const e = qi(t.writeResults, t.commitTime), n = Pi(t.commitTime);
13972
+ const e = qi(t.writeResults, t.commitTime), n = bi(t.commitTime);
13973
13973
  return this.listener.Xo(n, e);
13974
13974
  }
13975
13975
  // The first response is always the handshake response
@@ -14390,7 +14390,7 @@ async function Zu(t, e, n) {
14390
14390
  return;
14391
14391
  // Clear the resume token for the target, since we're in a known mismatch
14392
14392
  // state.
14393
- t.du.set(e, n.withResumeToken(Pe.EMPTY_BYTE_STRING, n.snapshotVersion)),
14393
+ t.du.set(e, n.withResumeToken(be.EMPTY_BYTE_STRING, n.snapshotVersion)),
14394
14394
  // Cause a hard reset by unwatching and rewatching immediately, but
14395
14395
  // deliberately don't send a resume token so that we get a full update.
14396
14396
  Qu(t, e);
@@ -14928,7 +14928,7 @@ async function Tc(t, e) {
14928
14928
  if (n.queries.set(s, r), r.listeners.push(e),
14929
14929
  // Run global snapshot listeners if a consistent snapshot has been emitted.
14930
14930
  e.vu(n.onlineState), r.Au) {
14931
- e.Pu(r.Au) && vc(n);
14931
+ e.bu(r.Au) && vc(n);
14932
14932
  }
14933
14933
  }
14934
14934
 
@@ -14949,7 +14949,7 @@ function Ac(t, e) {
14949
14949
  for (const t of e) {
14950
14950
  const e = t.query, i = n.queries.get(e);
14951
14951
  if (i) {
14952
- for (const e of i.listeners) e.Pu(t) && (s = !0);
14952
+ for (const e of i.listeners) e.bu(t) && (s = !0);
14953
14953
  i.Au = t;
14954
14954
  }
14955
14955
  }
@@ -14976,9 +14976,9 @@ function vc(t) {
14976
14976
  * when to raise the event.
14977
14977
  *
14978
14978
  * It uses an Observer to dispatch events.
14979
- */ class Pc {
14979
+ */ class bc {
14980
14980
  constructor(t, e, n) {
14981
- this.query = t, this.bu = e,
14981
+ this.query = t, this.Pu = e,
14982
14982
  /**
14983
14983
  * Initial snapshots (e.g. from cache) may not be propagated to the wrapped
14984
14984
  * observer. This flag is set to true once we've actually raised an event.
@@ -14991,7 +14991,7 @@ function vc(t) {
14991
14991
  * if applicable (depending on what changed, whether the user has opted into
14992
14992
  * metadata-only changes, etc.). Returns true if a user-facing event was
14993
14993
  * indeed raised.
14994
- */ Pu(t) {
14994
+ */ bu(t) {
14995
14995
  if (!this.options.includeMetadataChanges) {
14996
14996
  // Remove the metadata only changes.
14997
14997
  const e = [];
@@ -15000,11 +15000,11 @@ function vc(t) {
15000
15000
  /* excludesMetadataChanges= */ !0, t.hasCachedResults);
15001
15001
  }
15002
15002
  let e = !1;
15003
- return this.Vu ? this.Du(t) && (this.bu.next(t), e = !0) : this.Cu(t, this.onlineState) && (this.xu(t),
15003
+ return this.Vu ? this.Du(t) && (this.Pu.next(t), e = !0) : this.Cu(t, this.onlineState) && (this.xu(t),
15004
15004
  e = !0), this.Su = t, e;
15005
15005
  }
15006
15006
  onError(t) {
15007
- this.bu.error(t);
15007
+ this.Pu.error(t);
15008
15008
  }
15009
15009
  /** Returns whether a snapshot was raised. */ vu(t) {
15010
15010
  this.onlineState = t;
@@ -15038,7 +15038,7 @@ function vc(t) {
15038
15038
  }
15039
15039
  xu(t) {
15040
15040
  t = yc.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache, t.hasCachedResults),
15041
- this.Vu = !0, this.bu.next(t);
15041
+ this.Vu = !0, this.Pu.next(t);
15042
15042
  }
15043
15043
  }
15044
15044
 
@@ -15061,7 +15061,7 @@ function vc(t) {
15061
15061
  /**
15062
15062
  * A complete element in the bundle stream, together with the byte length it
15063
15063
  * occupies in the stream.
15064
- */ class bc {
15064
+ */ class Pc {
15065
15065
  constructor(t,
15066
15066
  // How many bytes this element takes to store in the bundle.
15067
15067
  e) {
@@ -15103,7 +15103,7 @@ function vc(t) {
15103
15103
  return t.metadata.exists ? $i(this.serializer, t.document, !1) : un.newNoDocument(this.Ji(t.metadata.name), this.Zi(t.metadata.readTime));
15104
15104
  }
15105
15105
  Zi(t) {
15106
- return Pi(t);
15106
+ return bi(t);
15107
15107
  }
15108
15108
  }
15109
15109
 
@@ -15547,7 +15547,7 @@ class kc {
15547
15547
  /** Stores user completion handlers, indexed by User and BatchId. */
15548
15548
  this.hc = {},
15549
15549
  /** Stores user callbacks waiting for all pending writes to be acknowledged. */
15550
- this.lc = new Map, this.fc = io.Pn(), this.onlineState = "Unknown" /* OnlineState.Unknown */ ,
15550
+ this.lc = new Map, this.fc = io.bn(), this.onlineState = "Unknown" /* OnlineState.Unknown */ ,
15551
15551
  // The primary state is set to `true` or `false` immediately after Firestore
15552
15552
  // startup. In the interim, a client should only be considered primary if
15553
15553
  // `isPrimary` is true.
@@ -16137,7 +16137,7 @@ function ca(t) {
16137
16137
  // PORTING NOTE: Multi-Tab only.
16138
16138
  function aa(t) {
16139
16139
  const e = F(t);
16140
- return F(F(e.localStore).persistence).bi();
16140
+ return F(F(e.localStore).persistence).Pi();
16141
16141
  }
16142
16142
 
16143
16143
  /** Applies a query target change from a different tab. */
@@ -16153,7 +16153,7 @@ async function ha(t, e, n, s) {
16153
16153
  case "current":
16154
16154
  case "not-current":
16155
16155
  {
16156
- const t = await uu(i.localStore, es(r[0])), s = hi.createSynthesizedRemoteEventForCurrentChange(e, "current" === n, Pe.EMPTY_BYTE_STRING);
16156
+ const t = await uu(i.localStore, es(r[0])), s = hi.createSynthesizedRemoteEventForCurrentChange(e, "current" === n, be.EMPTY_BYTE_STRING);
16157
16157
  await ta(i, t, s);
16158
16158
  break;
16159
16159
  }
@@ -16222,7 +16222,7 @@ function da(t) {
16222
16222
  try {
16223
16223
  const s = await e.getMetadata();
16224
16224
  if (await function(t, e) {
16225
- const n = F(t), s = Pi(e.createTime);
16225
+ const n = F(t), s = bi(e.createTime);
16226
16226
  return n.persistence.runTransaction("hasNewerBundle", "readonly", (t => n.xs.getBundleMetadata(t, e.id))).then((t => !!t && t.createTime.compareTo(s) >= 0));
16227
16227
  }
16228
16228
  /**
@@ -16382,7 +16382,7 @@ class ma extends wa {
16382
16382
  Mr: ra.bind(null, e),
16383
16383
  Fr: ha.bind(null, e),
16384
16384
  Br: la.bind(null, e),
16385
- bi: aa.bind(null, e),
16385
+ Pi: aa.bind(null, e),
16386
16386
  $r: ia.bind(null, e)
16387
16387
  }, await this.sharedClientState.start()),
16388
16388
  // NOTE: This will immediately call the listener, so we make sure to
@@ -16627,10 +16627,10 @@ class Ta {
16627
16627
  if (null === t) return null;
16628
16628
  const e = this.Ec.decode(t), n = Number(e);
16629
16629
  isNaN(n) && this.vc(`length string (${e}) is not valid number`);
16630
- const s = await this.Pc(n);
16631
- return new bc(JSON.parse(s), t.length + n);
16630
+ const s = await this.bc(n);
16631
+ return new Pc(JSON.parse(s), t.length + n);
16632
16632
  }
16633
- /** First index of '{' from the underlying buffer. */ bc() {
16633
+ /** First index of '{' from the underlying buffer. */ Pc() {
16634
16634
  return this.buffer.findIndex((t => t === "{".charCodeAt(0)));
16635
16635
  }
16636
16636
  /**
@@ -16639,13 +16639,13 @@ class Ta {
16639
16639
  *
16640
16640
  * If reached end of the stream, returns a null.
16641
16641
  */ async Rc() {
16642
- for (;this.bc() < 0; ) {
16642
+ for (;this.Pc() < 0; ) {
16643
16643
  if (await this.Vc()) break;
16644
16644
  }
16645
16645
  // Broke out of the loop because underlying stream is closed, and there
16646
16646
  // happens to be no more data to process.
16647
16647
  if (0 === this.buffer.length) return null;
16648
- const t = this.bc();
16648
+ const t = this.Pc();
16649
16649
  // Broke out of the loop because underlying stream is closed, but still
16650
16650
  // cannot find an open bracket.
16651
16651
  t < 0 && this.vc("Reached the end of bundle when a length string is expected.");
@@ -16658,7 +16658,7 @@ class Ta {
16658
16658
  * number of bytes, pulling more data from the underlying stream if needed.
16659
16659
  *
16660
16660
  * Returns a string decoded from the read bytes.
16661
- */ async Pc(t) {
16661
+ */ async bc(t) {
16662
16662
  for (;this.buffer.length < t; ) {
16663
16663
  await this.Vc() && this.vc("Reached the end of bundle when more is expected.");
16664
16664
  }
@@ -16923,7 +16923,7 @@ class va {
16923
16923
  */
16924
16924
  n, s) {
16925
16925
  this.authCredentials = t, this.appCheckCredentials = e, this.asyncQueue = n, this.databaseInfo = s,
16926
- this.user = P.UNAUTHENTICATED, this.clientId = Z.A(), this.authCredentialListener = () => Promise.resolve(),
16926
+ this.user = b.UNAUTHENTICATED, this.clientId = Z.A(), this.authCredentialListener = () => Promise.resolve(),
16927
16927
  this.appCheckCredentialListener = () => Promise.resolve(), this.authCredentials.start(n, (async t => {
16928
16928
  C("FirestoreClient", "Received user=", t.uid), await this.authCredentialListener(t),
16929
16929
  this.user = t;
@@ -16971,7 +16971,7 @@ class va {
16971
16971
  }
16972
16972
  }
16973
16973
 
16974
- async function Pa(t, e) {
16974
+ async function ba(t, e) {
16975
16975
  t.asyncQueue.verifyOperationInProgress(), C("FirestoreClient", "Initializing OfflineComponentProvider");
16976
16976
  const n = await t.getConfiguration();
16977
16977
  await e.initialize(n);
@@ -16984,7 +16984,7 @@ async function Pa(t, e) {
16984
16984
  e.persistence.setDatabaseDeletedListener((() => t.terminate())), t._offlineComponents = e;
16985
16985
  }
16986
16986
 
16987
- async function ba(t, e) {
16987
+ async function Pa(t, e) {
16988
16988
  t.asyncQueue.verifyOperationInProgress();
16989
16989
  const n = await Sa(t);
16990
16990
  C("FirestoreClient", "Initializing OnlineComponentProvider");
@@ -17014,20 +17014,20 @@ async function Sa(t) {
17014
17014
  if (!t._offlineComponents) if (t._uninitializedComponentsProvider) {
17015
17015
  C("FirestoreClient", "Using user provided OfflineComponentProvider");
17016
17016
  try {
17017
- await Pa(t, t._uninitializedComponentsProvider._offline);
17017
+ await ba(t, t._uninitializedComponentsProvider._offline);
17018
17018
  } catch (e) {
17019
17019
  const n = e;
17020
17020
  if (!Va(n)) throw n;
17021
- N("Error using user provided cache. Falling back to memory cache: " + n), await Pa(t, new wa);
17021
+ N("Error using user provided cache. Falling back to memory cache: " + n), await ba(t, new wa);
17022
17022
  }
17023
- } else C("FirestoreClient", "Using default OfflineComponentProvider"), await Pa(t, new wa);
17023
+ } else C("FirestoreClient", "Using default OfflineComponentProvider"), await ba(t, new wa);
17024
17024
  return t._offlineComponents;
17025
17025
  }
17026
17026
 
17027
17027
  async function Da(t) {
17028
17028
  return t._onlineComponents || (t._uninitializedComponentsProvider ? (C("FirestoreClient", "Using user provided OnlineComponentProvider"),
17029
- await ba(t, t._uninitializedComponentsProvider._online)) : (C("FirestoreClient", "Using default OnlineComponentProvider"),
17030
- await ba(t, new pa))), t._onlineComponents;
17029
+ await Pa(t, t._uninitializedComponentsProvider._online)) : (C("FirestoreClient", "Using default OnlineComponentProvider"),
17030
+ await Pa(t, new pa))), t._onlineComponents;
17031
17031
  }
17032
17032
 
17033
17033
  function Ca(t) {
@@ -17122,7 +17122,7 @@ function La(t, e, n = {}) {
17122
17122
  i.reject(new L(B.UNAVAILABLE, "Failed to get document because the client is offline.")) : u && r.fromCache && s && "server" === s.source ? i.reject(new L(B.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')) : i.resolve(r);
17123
17123
  },
17124
17124
  error: t => i.reject(t)
17125
- }), o = new Pc(Un(n.path), r, {
17125
+ }), o = new bc(Un(n.path), r, {
17126
17126
  includeMetadataChanges: !0,
17127
17127
  Nu: !0
17128
17128
  });
@@ -17159,7 +17159,7 @@ function Ua(t, e, n = {}) {
17159
17159
  e.enqueueAndForget((() => Ec(t, o))), n.fromCache && "server" === s.source ? i.reject(new L(B.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')) : i.resolve(n);
17160
17160
  },
17161
17161
  error: t => i.reject(t)
17162
- }), o = new Pc(n, r, {
17162
+ }), o = new bc(n, r, {
17163
17163
  includeMetadataChanges: !0,
17164
17164
  Nu: !0
17165
17165
  });
@@ -17592,13 +17592,13 @@ class eh {
17592
17592
  ssl: !1
17593
17593
  })), s.mockUserToken) {
17594
17594
  let e, n;
17595
- if ("string" == typeof s.mockUserToken) e = s.mockUserToken, n = P.MOCK_USER; else {
17595
+ if ("string" == typeof s.mockUserToken) e = s.mockUserToken, n = b.MOCK_USER; else {
17596
17596
  // Let createMockUserToken validate first (catches common mistakes like
17597
17597
  // invalid field "uid" and missing field "sub" / "user_id".)
17598
17598
  e = util.createMockUserToken(s.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);
17599
17599
  const r = s.mockUserToken.sub || s.mockUserToken.user_id;
17600
17600
  if (!r) throw new L(B.INVALID_ARGUMENT, "mockUserToken must contain 'sub' or 'user_id' field!");
17601
- n = new P(r);
17601
+ n = new b(r);
17602
17602
  }
17603
17603
  t._authCredentials = new G(new U(e, n));
17604
17604
  }
@@ -17827,7 +17827,7 @@ function ah(t, e, ...n) {
17827
17827
  // after page comes into foreground.
17828
17828
  this.Uc = () => {
17829
17829
  const t = Du();
17830
- t && C("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.xo.Po();
17830
+ t && C("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.xo.bo();
17831
17831
  };
17832
17832
  const t = Du();
17833
17833
  t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.Uc);
@@ -18272,7 +18272,7 @@ function Ih(t) {
18272
18272
  const s = new q;
18273
18273
  return t.asyncQueue.enqueue((async () => {
18274
18274
  try {
18275
- await Pa(t, n), await ba(t, e), s.resolve();
18275
+ await ba(t, n), await Pa(t, e), s.resolve();
18276
18276
  } catch (t) {
18277
18277
  const e = t;
18278
18278
  if (!Va(e)) throw e;
@@ -18345,7 +18345,7 @@ function Ih(t) {
18345
18345
  * call to {@link disableNetwork}.
18346
18346
  *
18347
18347
  * @returns A `Promise` that is resolved once the network has been enabled.
18348
- */ function Ph(t) {
18348
+ */ function bh(t) {
18349
18349
  return Ma(ph(t = Xa(t, mh)));
18350
18350
  }
18351
18351
 
@@ -18356,7 +18356,7 @@ function Ih(t) {
18356
18356
  * operations will be queued until the network is restored.
18357
18357
  *
18358
18358
  * @returns A `Promise` that is resolved once the network has been disabled.
18359
- */ function bh(t) {
18359
+ */ function Ph(t) {
18360
18360
  return Fa(ph(t = Xa(t, mh)));
18361
18361
  }
18362
18362
 
@@ -18525,7 +18525,7 @@ class xh {
18525
18525
  * @param base64 - The Base64 string used to create the `Bytes` object.
18526
18526
  */ static fromBase64String(t) {
18527
18527
  try {
18528
- return new kh(Pe.fromBase64String(t));
18528
+ return new kh(be.fromBase64String(t));
18529
18529
  } catch (t) {
18530
18530
  throw new L(B.INVALID_ARGUMENT, "Failed to construct data from Base64 string: " + t);
18531
18531
  }
@@ -18535,7 +18535,7 @@ class xh {
18535
18535
  *
18536
18536
  * @param array - The Uint8Array used to create the `Bytes` object.
18537
18537
  */ static fromUint8Array(t) {
18538
- return new kh(Pe.fromUint8Array(t));
18538
+ return new kh(be.fromUint8Array(t));
18539
18539
  }
18540
18540
  /**
18541
18541
  * Returns the underlying bytes as a Base64-encoded string.
@@ -18936,7 +18936,7 @@ class Jh extends Mh {
18936
18936
  }
18937
18937
  _toFieldTransform(t) {
18938
18938
  const e = Wh(this, t,
18939
- /*array=*/ !0), n = this.aa.map((t => nl(t, e))), s = new Ps(n);
18939
+ /*array=*/ !0), n = this.aa.map((t => nl(t, e))), s = new bs(n);
18940
18940
  return new Ns(t.path, s);
18941
18941
  }
18942
18942
  isEqual(t) {
@@ -19139,7 +19139,7 @@ class Zh extends Mh {
19139
19139
  const n = e.databaseId, s = t.firestore._databaseId;
19140
19140
  if (!s.isEqual(n)) throw e.ra(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);
19141
19141
  return {
19142
- referenceValue: bi(t.firestore._databaseId || e.databaseId, t._key.path)
19142
+ referenceValue: Pi(t.firestore._databaseId || e.databaseId, t._key.path)
19143
19143
  };
19144
19144
  }
19145
19145
  throw e.ra(`Unsupported field value: ${Za(t)}`);
@@ -19639,7 +19639,7 @@ function gl(t, e, ...n) {
19639
19639
  *
19640
19640
  * @param limit - The maximum number of items to return.
19641
19641
  * @returns The created {@link QueryLimitConstraint}.
19642
- */ function Pl(t) {
19642
+ */ function bl(t) {
19643
19643
  return th("limit", t), vl._create("limit", t, "F" /* LimitType.First */);
19644
19644
  }
19645
19645
 
@@ -19652,7 +19652,7 @@ function gl(t, e, ...n) {
19652
19652
  *
19653
19653
  * @param limit - The maximum number of items to return.
19654
19654
  * @returns The created {@link QueryLimitConstraint}.
19655
- */ function bl(t) {
19655
+ */ function Pl(t) {
19656
19656
  return th("limitToLast", t), vl._create("limitToLast", t, "L" /* LimitType.Last */);
19657
19657
  }
19658
19658
 
@@ -20474,7 +20474,7 @@ function ff(t, ...e) {
20474
20474
  }, _l(t._query);
20475
20475
  }
20476
20476
  return function(t, e, n, s) {
20477
- const i = new Ta(s), r = new Pc(e, i, n);
20477
+ const i = new Ta(s), r = new bc(e, i, n);
20478
20478
  return t.asyncQueue.enqueueAndForget((async () => Tc(await $a(t), r))), () => {
20479
20479
  i.Ic(), t.asyncQueue.enqueueAndForget((async () => Ec(await $a(t), r)));
20480
20480
  };
@@ -20710,7 +20710,7 @@ class Tf {
20710
20710
  return new pf(t);
20711
20711
  }
20712
20712
 
20713
- class Pf {
20713
+ class bf {
20714
20714
  constructor(t) {
20715
20715
  this.forceOwnership = t, this.kind = "persistentSingleTab";
20716
20716
  }
@@ -20726,7 +20726,7 @@ class Pf {
20726
20726
  }
20727
20727
  }
20728
20728
 
20729
- class bf {
20729
+ class Pf {
20730
20730
  constructor() {
20731
20731
  this.kind = "PersistentMultipleTab";
20732
20732
  }
@@ -20747,13 +20747,13 @@ class bf {
20747
20747
  *
20748
20748
  * @param settings Configures the created tab manager.
20749
20749
  */ function Vf(t) {
20750
- return new Pf(null == t ? void 0 : t.forceOwnership);
20750
+ return new bf(null == t ? void 0 : t.forceOwnership);
20751
20751
  }
20752
20752
 
20753
20753
  /**
20754
20754
  * Creates an instance of `PersistentMultipleTabManager`.
20755
20755
  */ function Sf() {
20756
- return new bf;
20756
+ return new Pf;
20757
20757
  }
20758
20758
 
20759
20759
  /**
@@ -21164,7 +21164,7 @@ function Uf(t, e) {
21164
21164
  * @packageDocumentation
21165
21165
  */ !function(t, e = !0) {
21166
21166
  !function(t) {
21167
- b = t;
21167
+ P = t;
21168
21168
  }(app.SDK_VERSION), app._registerComponent(new component.Component("firestore", ((t, {instanceIdentifier: n, options: s}) => {
21169
21169
  const i = t.getProvider("app").getImmediate(), r = new mh(new Q(t.getProvider("auth-internal")), new H(t.getProvider("app-check-internal")), function(t, e) {
21170
21170
  if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new L(B.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
@@ -21173,9 +21173,9 @@ function Uf(t, e) {
21173
21173
  return s = Object.assign({
21174
21174
  useFetchStreams: e
21175
21175
  }, s), r._setSettings(s), r;
21176
- }), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(v, "3.10.1-canary.0a27d2fbf", t),
21176
+ }), "PUBLIC").setMultipleInstances(!0)), app.registerVersion(v, "3.10.1-canary.195e82ebb", t),
21177
21177
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
21178
- app.registerVersion(v, "3.10.1-canary.0a27d2fbf", "cjs2017");
21178
+ app.registerVersion(v, "3.10.1-canary.195e82ebb", "cjs2017");
21179
21179
  }();
21180
21180
 
21181
21181
  exports.AbstractUserDataWriter = Ll;
@@ -21231,12 +21231,12 @@ exports.connectFirestoreEmulator = sh;
21231
21231
  exports.count = Ql;
21232
21232
  exports.deleteDoc = hf;
21233
21233
  exports.deleteField = Of;
21234
- exports.disableNetwork = bh;
21234
+ exports.disableNetwork = Ph;
21235
21235
  exports.doc = ah;
21236
21236
  exports.documentId = $h;
21237
21237
  exports.enableIndexedDbPersistence = Th;
21238
21238
  exports.enableMultiTabIndexedDbPersistence = Eh;
21239
- exports.enableNetwork = Ph;
21239
+ exports.enableNetwork = bh;
21240
21240
  exports.endAt = Nl;
21241
21241
  exports.endBefore = xl;
21242
21242
  exports.ensureFirestoreConfigured = ph;
@@ -21252,8 +21252,8 @@ exports.getDocsFromServer = uf;
21252
21252
  exports.getFirestore = yh;
21253
21253
  exports.increment = Bf;
21254
21254
  exports.initializeFirestore = gh;
21255
- exports.limit = Pl;
21256
- exports.limitToLast = bl;
21255
+ exports.limit = bl;
21256
+ exports.limitToLast = Pl;
21257
21257
  exports.loadBundle = Sh;
21258
21258
  exports.memoryEagerGarbageCollector = Ef;
21259
21259
  exports.memoryLocalCache = Rf;