@firebase/webchannel-wrapper 0.10.3 → 0.10.5-20231120214520

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.
@@ -111,7 +111,9 @@ function w(a, b) { this.type = a; this.g = this.target = b; this.defaultPrevente
111
111
  w.prototype.h = function () { this.defaultPrevented = !0; };
112
112
  var oa = function () { if (!l.addEventListener || !Object.defineProperty)
113
113
  return !1; var a = !1, b = Object.defineProperty({}, "passive", { get: function () { a = !0; } }); try {
114
- l.addEventListener("test", function () { }, b), l.removeEventListener("test", function () { }, b);
114
+ var c = function () { };
115
+ l.addEventListener("test", c, b);
116
+ l.removeEventListener("test", c, b);
115
117
  }
116
118
  catch (c) { } return a; }();
117
119
  function x(a) { return /^[\s\xa0]*$/.test(a); }
@@ -201,7 +203,7 @@ A.prototype.h = function () { A.$.h.call(this); var a = this.i; a.preventDefault
201
203
  var Ha = "closure_listenable_" + (1E6 * Math.random() | 0);
202
204
  var Ia = 0;
203
205
  function Ja(a, b, c, d, e) { this.listener = a; this.proxy = null; this.src = b; this.type = c; this.capture = !!d; this.la = e; this.key = ++Ia; this.fa = this.ia = !1; }
204
- function Ka(a) { a.fa = !0; a.listener = null; a.proxy = null; a.src = null; a.la = null; }
206
+ function Ma(a) { a.fa = !0; a.listener = null; a.proxy = null; a.src = null; a.la = null; }
205
207
  function Na(a, b, c) { for (var d in a)
206
208
  b.call(c, a[d], d, a); }
207
209
  function Oa(a, b) { for (var c in a)
@@ -221,7 +223,7 @@ Sa.prototype.add = function (a, b, c, d, e) { var f = a.toString(); a = this.g[f
221
223
  function Ua(a, b) { var c = b.type; if (c in a.g) {
222
224
  var d = a.g[c], e = ka(d, b), f;
223
225
  (f = 0 <= e) && Array.prototype.splice.call(d, e, 1);
224
- f && (Ka(b), 0 == a.g[c].length && (delete a.g[c], a.h--));
226
+ f && (Ma(b), 0 == a.g[c].length && (delete a.g[c], a.h--));
225
227
  } }
226
228
  function Ta(a, b, c, d) { for (var e = 0; e < a.length; ++e) {
227
229
  var f = a[e];
@@ -255,7 +257,7 @@ function fb(a, b, c, d, e) { if (Array.isArray(b))
255
257
  for (var f = 0; f < b.length; f++)
256
258
  fb(a, b[f], c, d, e);
257
259
  else
258
- (d = p(d) ? !!d.capture : !!d, c = $a(c), a && a[Ha]) ? (a = a.i, b = String(b).toString(), b in a.g && (f = a.g[b], c = Ta(f, c, d, e), -1 < c && (Ka(f[c]), Array.prototype.splice.call(f, c, 1), 0 == f.length && (delete a.g[b], a.h--)))) : a && (a = bb(a)) && (b = a.g[b.toString()], a = -1, b && (a = Ta(b, c, d, e)), (c = -1 < a ? b[a] : null) && gb(c)); }
260
+ (d = p(d) ? !!d.capture : !!d, c = $a(c), a && a[Ha]) ? (a = a.i, b = String(b).toString(), b in a.g && (f = a.g[b], c = Ta(f, c, d, e), -1 < c && (Ma(f[c]), Array.prototype.splice.call(f, c, 1), 0 == f.length && (delete a.g[b], a.h--)))) : a && (a = bb(a)) && (b = a.g[b.toString()], a = -1, b && (a = Ta(b, c, d, e)), (c = -1 < a ? b[a] : null) && gb(c)); }
259
261
  function gb(a) { if ("number" !== typeof a && a && !a.fa) {
260
262
  var b = a.src;
261
263
  if (b && b[Ha])
@@ -263,7 +265,7 @@ function gb(a) { if ("number" !== typeof a && a && !a.fa) {
263
265
  else {
264
266
  var c = a.type, d = a.proxy;
265
267
  b.removeEventListener ? b.removeEventListener(c, d, a.capture) : b.detachEvent ? b.detachEvent(db(c), d) : b.addListener && b.removeListener && b.removeListener(d);
266
- (c = bb(b)) ? (Ua(c, a), 0 == c.h && (c.src = null, b[Va] = null)) : Ka(a);
268
+ (c = bb(b)) ? (Ua(c, a), 0 == c.h && (c.src = null, b[Va] = null)) : Ma(a);
267
269
  }
268
270
  } }
269
271
  function db(a) { return a in Wa ? Wa[a] : Wa[a] = "on" + a; }
@@ -304,7 +306,7 @@ B.prototype.N = function () { B.$.N.call(this); if (this.i) {
304
306
  var a = this.i, c;
305
307
  for (c in a.g) {
306
308
  for (var d = a.g[c], e = 0; e < d.length; e++)
307
- Ka(d[e]);
309
+ Ma(d[e]);
308
310
  delete a.g[c];
309
311
  a.h--;
310
312
  }
@@ -400,7 +402,7 @@ var Ab = /** @class */ (function (_super) {
400
402
  function Bb(a) { v.call(this); this.h = a; this.g = {}; }
401
403
  r(Bb, v);
402
404
  var Cb = [];
403
- function Db(a, b, c, d) { Array.isArray(c) || (c && (Cb[0] = c.toString()), c = Cb); for (var e = 0; e < c.length; e++) {
405
+ function Eb(a, b, c, d) { Array.isArray(c) || (c && (Cb[0] = c.toString()), c = Cb); for (var e = 0; e < c.length; e++) {
404
406
  var f = Ya(b, c[e], d || a.handleEvent, !1, a.h || a);
405
407
  if (!f)
406
408
  break;
@@ -487,13 +489,13 @@ r(ac, Ub);
487
489
  ac.prototype.g = function () { return new XMLHttpRequest; };
488
490
  ac.prototype.i = function () { return {}; };
489
491
  $b = new ac;
490
- function bc(a, b, c, d) { this.l = a; this.j = b; this.m = c; this.W = d || 1; this.U = new Bb(this); this.P = cc; a = va ? 125 : void 0; this.V = new wb(a); this.I = null; this.i = !1; this.s = this.A = this.v = this.L = this.G = this.Y = this.B = null; this.F = []; this.g = null; this.C = 0; this.o = this.u = null; this.ca = -1; this.J = !1; this.O = 0; this.M = null; this.ba = this.K = this.aa = this.S = !1; this.h = new dc; }
492
+ function bc(a, b, c, d) { this.l = a; this.j = b; this.m = c; this.W = d || 1; this.U = new Bb(this); this.P = cc; a = va ? 125 : void 0; this.V = new wb(a); this.I = null; this.i = !1; this.u = this.B = this.A = this.L = this.G = this.Y = this.C = null; this.F = []; this.g = null; this.o = 0; this.s = this.v = null; this.ca = -1; this.J = !1; this.O = 0; this.M = null; this.ba = this.K = this.aa = this.S = !1; this.h = new dc; }
491
493
  function dc() { this.i = null; this.g = ""; this.h = !1; }
492
494
  var cc = 45E3, ec = {}, fc = {};
493
495
  k = bc.prototype;
494
496
  k.setTimeout = function (a) { this.P = a; };
495
- function gc(a, b, c) { a.L = 1; a.v = hc(G(b)); a.s = c; a.S = !0; ic(a, null); }
496
- function ic(a, b) { a.G = Date.now(); jc(a); a.A = G(a.v); var c = a.A, d = a.W; Array.isArray(d) || (d = [String(d)]); kc(c.i, "t", d); a.C = 0; c = a.l.J; a.h = new dc; a.g = lc(a.l, c ? b : null, !a.s); 0 < a.O && (a.M = new Ab(q(a.Pa, a, a.g), a.O)); Db(a.U, a.g, "readystatechange", a.nb); b = a.I ? Pa(a.I) : {}; a.s ? (a.u || (a.u = "POST"), b["Content-Type"] = "application/x-www-form-urlencoded", a.g.ha(a.A, a.u, a.s, b)) : (a.u = "GET", a.g.ha(a.A, a.u, null, b)); Ob(); Hb(a.j, a.u, a.A, a.m, a.W, a.s); }
497
+ function gc(a, b, c) { a.L = 1; a.A = hc(G(b)); a.u = c; a.S = !0; ic(a, null); }
498
+ function ic(a, b) { a.G = Date.now(); jc(a); a.B = G(a.A); var c = a.B, d = a.W; Array.isArray(d) || (d = [String(d)]); kc(c.i, "t", d); a.o = 0; c = a.l.J; a.h = new dc; a.g = lc(a.l, c ? b : null, !a.u); 0 < a.O && (a.M = new Ab(q(a.Pa, a, a.g), a.O)); Eb(a.U, a.g, "readystatechange", a.nb); b = a.I ? Pa(a.I) : {}; a.u ? (a.v || (a.v = "POST"), b["Content-Type"] = "application/x-www-form-urlencoded", a.g.ha(a.B, a.v, a.u, b)) : (a.v = "GET", a.g.ha(a.B, a.v, null, b)); Ob(); Hb(a.j, a.v, a.B, a.m, a.W, a.u); }
497
499
  k.nb = function (a) { a = a.target; var b = this.M; b && 3 == H(a) ? b.l() : this.Pa(a); };
498
500
  k.Pa = function (a) {
499
501
  try {
@@ -522,15 +524,16 @@ k.Pa = function (a) {
522
524
  }
523
525
  for (b = 0; b < e; b++)
524
526
  this.h.h = !0, a += this.h.i.decode(d[b], { stream: f && b == e - 1 });
525
- d.splice(0, e);
527
+ d.length =
528
+ 0;
526
529
  this.h.g += a;
527
- this.C = 0;
530
+ this.o = 0;
528
531
  h = this.h.g;
529
532
  }
530
533
  else
531
534
  h = this.g.ja();
532
535
  this.i = 200 == c;
533
- Ib(this.j, this.u, this.A, this.m, this.W, u, c);
536
+ Ib(this.j, this.v, this.B, this.m, this.W, u, c);
534
537
  if (this.i) {
535
538
  if (this.aa && !this.K) {
536
539
  b: {
@@ -547,37 +550,37 @@ k.Pa = function (a) {
547
550
  D(this.j, this.m, c, "Initial handshake response via X-HTTP-Initial-Response"), this.K = !0, qc(this, c);
548
551
  else {
549
552
  this.i = !1;
550
- this.o = 3;
553
+ this.s = 3;
551
554
  F(12);
552
555
  I(this);
553
556
  pc(this);
554
557
  break a;
555
558
  }
556
559
  }
557
- this.S ? (rc(this, u, h), va && this.i && 3 == u && (Db(this.U, this.V, "tick", this.mb),
560
+ this.S ? (rc(this, u, h), va && this.i && 3 == u && (Eb(this.U, this.V, "tick", this.mb),
558
561
  this.V.start())) : (D(this.j, this.m, h, null), qc(this, h));
559
562
  4 == u && I(this);
560
563
  this.i && !this.J && (4 == u ? sc(this.l, this) : (this.i = !1, jc(this)));
561
564
  }
562
565
  else
563
- tc(this.g), 400 == c && 0 < h.indexOf("Unknown SID") ? (this.o = 3, F(12)) : (this.o = 0, F(13)), I(this), pc(this);
566
+ tc(this.g), 400 == c && 0 < h.indexOf("Unknown SID") ? (this.s = 3, F(12)) : (this.s = 0, F(13)), I(this), pc(this);
564
567
  }
565
568
  }
566
569
  }
567
570
  catch (u) { }
568
571
  finally { }
569
572
  };
570
- function oc(a) { return a.g ? "GET" == a.u && 2 != a.L && a.l.Ha : !1; }
573
+ function oc(a) { return a.g ? "GET" == a.v && 2 != a.L && a.l.Ha : !1; }
571
574
  function rc(a, b, c) {
572
575
  var d = !0, e;
573
- for (; !a.J && a.C < c.length;)
576
+ for (; !a.J && a.o < c.length;)
574
577
  if (e = uc(a, c), e == fc) {
575
- 4 == b && (a.o = 4, F(14), d = !1);
578
+ 4 == b && (a.s = 4, F(14), d = !1);
576
579
  D(a.j, a.m, null, "[Incomplete Response]");
577
580
  break;
578
581
  }
579
582
  else if (e == ec) {
580
- a.o = 4;
583
+ a.s = 4;
581
584
  F(15);
582
585
  D(a.j, a.m, c, "[Invalid Chunk]");
583
586
  d = !1;
@@ -585,25 +588,25 @@ function rc(a, b, c) {
585
588
  }
586
589
  else
587
590
  D(a.j, a.m, e, null), qc(a, e);
588
- oc(a) && e != fc && e != ec && (a.h.g = "", a.C = 0);
589
- 4 != b || 0 != c.length || a.h.h || (a.o = 1, F(16), d = !1);
591
+ oc(a) && 0 != a.o && (a.h.g = a.h.g.slice(a.o), a.o = 0);
592
+ 4 != b || 0 != c.length || a.h.h || (a.s = 1, F(16), d = !1);
590
593
  a.i = a.i && d;
591
594
  d ? 0 < c.length && !a.ba && (a.ba = !0, b = a.l, b.g == a && b.ca && !b.M && (b.l.info("Great, no buffering proxy detected. Bytes received: " + c.length), vc(b), b.M = !0, F(11))) : (D(a.j, a.m, c, "[Invalid Chunked Response]"), I(a), pc(a));
592
595
  }
593
596
  k.mb = function () { if (this.g) {
594
597
  var a = H(this.g), b = this.g.ja();
595
- this.C < b.length && (nc(this), rc(this, a, b), this.i && 4 != a && jc(this));
598
+ this.o < b.length && (nc(this), rc(this, a, b), this.i && 4 != a && jc(this));
596
599
  } };
597
- function uc(a, b) { var c = a.C, d = b.indexOf("\n", c); if (-1 == d)
600
+ function uc(a, b) { var c = a.o, d = b.indexOf("\n", c); if (-1 == d)
598
601
  return fc; c = Number(b.substring(c, d)); if (isNaN(c))
599
602
  return ec; d += 1; if (d + c > b.length)
600
- return fc; b = b.slice(d, d + c); a.C = d + c; return b; }
603
+ return fc; b = b.slice(d, d + c); a.o = d + c; return b; }
601
604
  k.cancel = function () { this.J = !0; I(this); };
602
605
  function jc(a) { a.Y = Date.now() + a.P; wc(a, a.P); }
603
- function wc(a, b) { if (null != a.B)
604
- throw Error("WatchDog timer not null"); a.B = Rb(q(a.lb, a), b); }
605
- function nc(a) { a.B && (l.clearTimeout(a.B), a.B = null); }
606
- k.lb = function () { this.B = null; var a = Date.now(); 0 <= a - this.Y ? (Kb(this.j, this.A), 2 != this.L && (Ob(), F(17)), I(this), this.o = 2, pc(this)) : wc(this, this.Y - a); };
606
+ function wc(a, b) { if (null != a.C)
607
+ throw Error("WatchDog timer not null"); a.C = Rb(q(a.lb, a), b); }
608
+ function nc(a) { a.C && (l.clearTimeout(a.C), a.C = null); }
609
+ k.lb = function () { this.C = null; var a = Date.now(); 0 <= a - this.Y ? (Kb(this.j, this.B), 2 != this.L && (Ob(), F(17)), I(this), this.s = 2, pc(this)) : wc(this, this.Y - a); };
607
610
  function pc(a) { 0 == a.l.H || a.J || sc(a.l, a); }
608
611
  function I(a) { nc(a); var b = a.M; b && "function" == typeof b.sa && b.sa(); a.M = null; xb(a.V); Fb(a.U); a.g && (b = a.g, a.g = null, b.abort(), b.sa()); }
609
612
  function qc(a, b) {
@@ -658,19 +661,19 @@ function qc(a, b) {
658
661
  null != u && (c.ra = u, c.l.info("VER=" + c.ra));
659
662
  var L = m[4];
660
663
  null != L && (c.Ga = L, c.l.info("SVER=" + c.Ga));
661
- var La = m[5];
662
- null != La && "number" === typeof La && 0 < La && (d = 1.5 * La, c.L = d, c.l.info("backChannelRequestTimeoutMs_=" + d));
664
+ var Ka = m[5];
665
+ null != Ka && "number" === typeof Ka && 0 < Ka && (d = 1.5 * Ka, c.L = d, c.l.info("backChannelRequestTimeoutMs_=" + d));
663
666
  d = c;
664
667
  var la = a.g;
665
668
  if (la) {
666
- var Ma = la.g ? la.g.getResponseHeader("X-Client-Wire-Protocol") : null;
667
- if (Ma) {
669
+ var La = la.g ? la.g.getResponseHeader("X-Client-Wire-Protocol") : null;
670
+ if (La) {
668
671
  var f = d.i;
669
- f.g || -1 == Ma.indexOf("spdy") && -1 == Ma.indexOf("quic") && -1 == Ma.indexOf("h2") || (f.j = f.l, f.g = new Set, f.h && (Cc(f, f.h), f.h = null));
672
+ f.g || -1 == La.indexOf("spdy") && -1 == La.indexOf("quic") && -1 == La.indexOf("h2") || (f.j = f.l, f.g = new Set, f.h && (Cc(f, f.h), f.h = null));
670
673
  }
671
674
  if (d.F) {
672
- var Eb = la.g ? la.g.getResponseHeader("X-HTTP-Session-Id") : null;
673
- Eb && (d.Da = Eb, K(d.I, d.F, Eb));
675
+ var Db = la.g ? la.g.getResponseHeader("X-HTTP-Session-Id") : null;
676
+ Db && (d.Da = Db, K(d.I, d.F, Db));
674
677
  }
675
678
  }
676
679
  c.H = 3;
@@ -683,7 +686,7 @@ function qc(a, b) {
683
686
  Ec(d.i, h);
684
687
  var n = h, t = d.L;
685
688
  t && n.setTimeout(t);
686
- n.B && (nc(n), jc(n));
689
+ n.C && (nc(n), jc(n));
687
690
  d.g = h;
688
691
  }
689
692
  else
@@ -1216,15 +1219,15 @@ function Hc(a) { Fd(a); if (3 == a.H) {
1216
1219
  Gd(a, c);
1217
1220
  b = new bc(a, a.l, b);
1218
1221
  b.L = 2;
1219
- b.v = hc(G(c));
1222
+ b.A = hc(G(c));
1220
1223
  c = !1;
1221
1224
  if (l.navigator && l.navigator.sendBeacon)
1222
1225
  try {
1223
- c = l.navigator.sendBeacon(b.v.toString(), "");
1226
+ c = l.navigator.sendBeacon(b.A.toString(), "");
1224
1227
  }
1225
1228
  catch (d) { }
1226
- !c && l.Image && ((new Image).src = b.v, c = !0);
1227
- c || (b.g = lc(b.l, null), b.g.ha(b.v));
1229
+ !c && l.Image && ((new Image).src = b.A, c = !0);
1230
+ c || (b.g = lc(b.l, null), b.g.ha(b.A));
1228
1231
  b.G = Date.now();
1229
1232
  jc(b);
1230
1233
  } Hd(a); }
@@ -1343,7 +1346,7 @@ k.Ma = function () { this.u = null; Md(this); if (this.ca && !(this.M || null ==
1343
1346
  } };
1344
1347
  k.jb = function () { this.B && (this.B = null, this.l.info("BP detection timeout reached."), this.l.info("Buffering proxy detected and switch to long-polling!"), this.G = !1, this.M = !0, F(10), zc(this), Md(this)); };
1345
1348
  function vc(a) { null != a.B && (l.clearTimeout(a.B), a.B = null); }
1346
- function Md(a) { a.g = new bc(a, a.l, "rpc", a.ba); null === a.o && (a.g.I = a.s); a.g.O = 0; var b = G(a.wa); K(b, "RID", "rpc"); K(b, "SID", a.K); K(b, "AID", a.V); K(b, "CI", a.G ? "0" : "1"); !a.G && a.qa && K(b, "TO", a.qa); K(b, "TYPE", "xmlhttp"); Gd(a, b); a.o && a.s && Cd(b, a.o, a.s); a.L && a.g.setTimeout(a.L); var c = a.g; a = a.pa; c.L = 1; c.v = hc(G(b)); c.s = null; c.S = !0; ic(c, a); }
1349
+ function Md(a) { a.g = new bc(a, a.l, "rpc", a.ba); null === a.o && (a.g.I = a.s); a.g.O = 0; var b = G(a.wa); K(b, "RID", "rpc"); K(b, "SID", a.K); K(b, "AID", a.V); K(b, "CI", a.G ? "0" : "1"); !a.G && a.qa && K(b, "TO", a.qa); K(b, "TYPE", "xmlhttp"); Gd(a, b); a.o && a.s && Cd(b, a.o, a.s); a.L && a.g.setTimeout(a.L); var c = a.g; a = a.pa; c.L = 1; c.A = hc(G(b)); c.u = null; c.S = !0; ic(c, a); }
1347
1350
  k.ib = function () { null != this.v && (this.v = null, zc(this), Ac(this), F(19)); };
1348
1351
  function yc(a) { null != a.v && (l.clearTimeout(a.v), a.v = null); }
1349
1352
  function sc(a, b) { var c = null; if (a.g == b) {
@@ -1358,7 +1361,7 @@ else
1358
1361
  return; if (0 != a.H)
1359
1362
  if (b.i)
1360
1363
  if (1 == d) {
1361
- c = b.s ? b.s.length : 0;
1364
+ c = b.u ? b.u.length : 0;
1362
1365
  b = Date.now() - b.G;
1363
1366
  var e = a.C;
1364
1367
  d = Mb();
@@ -1367,7 +1370,7 @@ else
1367
1370
  }
1368
1371
  else
1369
1372
  Fc(a);
1370
- else if (e = b.o, 3 == e || 0 == e && 0 < b.ca || !(1 == d && Id(a, b) || 2 == d && Ac(a)))
1373
+ else if (e = b.s, 3 == e || 0 == e && 0 < b.ca || !(1 == d && Id(a, b) || 2 == d && Ac(a)))
1371
1374
  switch (c && 0 < c.length && (b = a.i, b.i = b.i.concat(c)), e) {
1372
1375
  case 1:
1373
1376
  J(a, 5);
@@ -1412,7 +1415,7 @@ else {
1412
1415
  d = f;
1413
1416
  } c = a.F; b = a.Da; c && b && K(d, c, b); K(d, "VER", a.ra); Gd(a, d); return d; }
1414
1417
  function lc(a, b, c) { if (b && !a.J)
1415
- throw Error("Can't create secondary domain capable XhrIo object."); b = c && a.Ha && !a.va ? new P(new ld({ ob: !0 })) : new P(a.va); b.Oa(a.J); return b; }
1418
+ throw Error("Can't create secondary domain capable XhrIo object."); b = a.Ha && !a.va ? new P(new ld({ ob: c })) : new P(a.va); b.Oa(a.J); return b; }
1416
1419
  k.isActive = function () { return !!this.h && this.h.isActive(this); };
1417
1420
  function Nd() { }
1418
1421
  k = Nd.prototype;