@vindral/web-sdk 4.0.0-138-g3fc34827 → 4.0.0-140-g33a0072d

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.
@@ -25,19 +25,19 @@ var gd = (s, e) => {
25
25
  var bi = (s) => {
26
26
  var e;
27
27
  return [, , , Jl((e = s == null ? void 0 : s[ht("metadata")]) != null ? e : null)];
28
- }, Ad = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Zn = (s) => s !== void 0 && typeof s != "function" ? It("Function expected") : s, im = (s, e, t, i, n) => ({ kind: Ad[s], name: e, metadata: i, addInitializer: (o) => t._ ? It("Already initialized") : n.push(Zn(o || null)) }), Gt = (s, e) => Qa(e, ht("metadata"), s[3]), yi = (s, e, t, i) => {
28
+ }, Ad = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], $n = (s) => s !== void 0 && typeof s != "function" ? It("Function expected") : s, im = (s, e, t, i, n) => ({ kind: Ad[s], name: e, metadata: i, addInitializer: (o) => t._ ? It("Already initialized") : n.push($n(o || null)) }), Gt = (s, e) => Qa(e, ht("metadata"), s[3]), yi = (s, e, t, i) => {
29
29
  for (var n = 0, o = s[e >> 1], c = o && o.length; n < c; n++) e & 1 ? o[n].call(t) : i = o[n].call(t, i);
30
30
  return i;
31
- }, ve = (s, e, t, i, n, o) => {
32
- var c, h, d, f, p, g = e & 7, w = !!(e & 8), b = !!(e & 16), S = g > 3 ? s.length + 1 : g ? w ? 1 : 2 : 0, x = Ad[g + 5], R = g > 3 && (s[S - 1] = []), D = s[S] || (s[S] = []), E = g && (!b && !w && (n = n.prototype), g < 5 && (g > 3 || !b) && em(g < 4 ? n : { get [t]() {
31
+ }, Se = (s, e, t, i, n, o) => {
32
+ var c, h, d, f, p, g = e & 7, w = !!(e & 8), y = !!(e & 16), S = g > 3 ? s.length + 1 : g ? w ? 1 : 2 : 0, x = Ad[g + 5], R = g > 3 && (s[S - 1] = []), D = s[S] || (s[S] = []), E = g && (!y && !w && (n = n.prototype), g < 5 && (g > 3 || !y) && em(g < 4 ? n : { get [t]() {
33
33
  return a(this, o);
34
34
  }, set [t](k) {
35
35
  return l(this, o, k);
36
36
  } }, t));
37
- g ? b && g < 4 && md(o, (g > 2 ? "set " : g > 1 ? "get " : "") + t) : md(n, t);
37
+ g ? y && g < 4 && md(o, (g > 2 ? "set " : g > 1 ? "get " : "") + t) : md(n, t);
38
38
  for (var U = i.length - 1; U >= 0; U--)
39
- f = im(g, t, d = {}, s[3], D), g && (f.static = w, f.private = b, p = f.access = { has: b ? (k) => sm(n, k) : (k) => t in k }, g ^ 3 && (p.get = b ? (k) => (g ^ 1 ? a : A)(k, n, g ^ 4 ? o : E.get) : (k) => k[t]), g > 2 && (p.set = b ? (k, _) => l(k, n, _, g ^ 4 ? o : E.set) : (k, _) => k[t] = _)), h = (0, i[U])(g ? g < 4 ? b ? o : E[x] : g > 4 ? void 0 : { get: E.get, set: E.set } : n, f), d._ = 1, g ^ 4 || h === void 0 ? Zn(h) && (g > 4 ? R.unshift(h) : g ? b ? o = h : E[x] = h : n = h) : typeof h != "object" || h === null ? It("Object expected") : (Zn(c = h.get) && (E.get = c), Zn(c = h.set) && (E.set = c), Zn(c = h.init) && R.unshift(c));
40
- return g || Gt(s, n), E && Nc(n, t, E), b ? g ^ 4 ? o : E : n;
39
+ f = im(g, t, d = {}, s[3], D), g && (f.static = w, f.private = y, p = f.access = { has: y ? (k) => sm(n, k) : (k) => t in k }, g ^ 3 && (p.get = y ? (k) => (g ^ 1 ? a : A)(k, n, g ^ 4 ? o : E.get) : (k) => k[t]), g > 2 && (p.set = y ? (k, _) => l(k, n, _, g ^ 4 ? o : E.set) : (k, _) => k[t] = _)), h = (0, i[U])(g ? g < 4 ? y ? o : E[x] : g > 4 ? void 0 : { get: E.get, set: E.set } : n, f), d._ = 1, g ^ 4 || h === void 0 ? $n(h) && (g > 4 ? R.unshift(h) : g ? y ? o = h : E[x] = h : n = h) : typeof h != "object" || h === null ? It("Object expected") : ($n(c = h.get) && (E.get = c), $n(c = h.set) && (E.set = c), $n(c = h.init) && R.unshift(c));
40
+ return g || Gt(s, n), E && Nc(n, t, E), y ? g ^ 4 ? o : E : n;
41
41
  }, r = (s, e, t) => Qa(s, typeof e != "symbol" ? e + "" : e, t), Vc = (s, e, t) => e.has(s) || It("Cannot " + t), sm = (s, e) => Object(e) !== e ? It('Cannot use the "in" operator on this value') : s.has(e), a = (s, e, t) => (Vc(s, e, "read from private field"), t ? t.call(s) : e.get(s)), u = (s, e, t) => e.has(s) ? It("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), l = (s, e, t, i) => (Vc(s, e, "write to private field"), i ? i.call(s, t) : e.set(s, t), t), A = (s, e, t) => (Vc(s, e, "access private method"), t);
42
42
  var vi = (s, e, t, i) => ({
43
43
  set _(n) {
@@ -68,9 +68,9 @@ var m = (s, e, t) => new Promise((i, n) => {
68
68
  var i = (c, h, d, f) => {
69
69
  try {
70
70
  var p = t[c](h), g = (h = p.value) instanceof $, w = p.done;
71
- Promise.resolve(g ? h[0] : h).then((b) => g ? i(c === "return" ? c : "next", h[1] ? { done: b.done, value: b.value } : b, d, f) : d({ value: b, done: w })).catch((b) => i("throw", b, d, f));
72
- } catch (b) {
73
- f(b);
71
+ Promise.resolve(g ? h[0] : h).then((y) => g ? i(c === "return" ? c : "next", h[1] ? { done: y.done, value: y.value } : y, d, f) : d({ value: y, done: w })).catch((y) => i("throw", y, d, f));
72
+ } catch (y) {
73
+ f(y);
74
74
  }
75
75
  }, n = (c) => o[c] = (h) => new Promise((d, f) => i(c, h, d, f)), o = {};
76
76
  return t = t.apply(s, e), o[ht("asyncIterator")] = () => o, n("next"), n("throw"), n("return"), o;
@@ -198,7 +198,7 @@ class W {
198
198
  ), t;
199
199
  }
200
200
  }
201
- class fe {
201
+ class pe {
202
202
  constructor(e = 50) {
203
203
  r(this, "maxSize");
204
204
  r(this, "values", []);
@@ -223,7 +223,7 @@ function Jh(s) {
223
223
  const e = new xc(s);
224
224
  return [e, e];
225
225
  }
226
- var kt, Gs, $e, Br;
226
+ var kt, Gs, $e, Ur;
227
227
  class xc {
228
228
  constructor(e) {
229
229
  /// The internal queue
@@ -233,15 +233,15 @@ class xc {
233
233
  /// Slows down pop when the queue is empty
234
234
  u(this, $e);
235
235
  /// The channel is closed
236
- u(this, Br, !1);
237
- l(this, kt, new fe(e));
236
+ u(this, Ur, !1);
237
+ l(this, kt, new pe(e));
238
238
  }
239
239
  isFull() {
240
240
  return a(this, kt).isFull();
241
241
  }
242
242
  close() {
243
243
  var e;
244
- (e = a(this, $e)) == null || e.resolve(), l(this, Br, !0);
244
+ (e = a(this, $e)) == null || e.resolve(), l(this, Ur, !0);
245
245
  }
246
246
  abort(e) {
247
247
  var t, i;
@@ -256,7 +256,7 @@ class xc {
256
256
  pop() {
257
257
  return m(this, null, function* () {
258
258
  var e;
259
- for (; !(a(this, Br) && a(this, kt).isEmpty()); ) {
259
+ for (; !(a(this, Ur) && a(this, kt).isEmpty()); ) {
260
260
  const t = a(this, kt).pop();
261
261
  if (t)
262
262
  return a(this, Gs).resolve(), l(this, Gs, new W()), t;
@@ -289,7 +289,7 @@ class xc {
289
289
  return this;
290
290
  }
291
291
  }
292
- kt = new WeakMap(), Gs = new WeakMap(), $e = new WeakMap(), Br = new WeakMap();
292
+ kt = new WeakMap(), Gs = new WeakMap(), $e = new WeakMap(), Ur = new WeakMap();
293
293
  function gu(s) {
294
294
  const e = atob(s), t = new Uint8Array(e.length);
295
295
  for (let i = 0; i < e.length; i++)
@@ -334,14 +334,14 @@ class Au {
334
334
  this.buffer = e, this.bytes = new Uint8Array(this.buffer), this.bitOffset = t;
335
335
  }
336
336
  }
337
- function Tr() {
337
+ function Cr() {
338
338
  const s = self.MediaSource, e = self.ManagedMediaSource;
339
339
  return s != null ? s : e;
340
340
  }
341
341
  const dm = new RegExp(
342
342
  "(android|bbd+|meego).+mobile|avantgo|bada/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)/|plucker|pocket|psp|series(4|6)0|symbian|treo|up.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/",
343
343
  "i"
344
- ), Te = navigator.userAgent.toLowerCase(), um = dm.test(Te), lm = () => {
344
+ ), Ie = navigator.userAgent.toLowerCase(), um = dm.test(Ie), lm = () => {
345
345
  const s = document.createElement("video");
346
346
  return s.canPlayType("application/vnd.apple.mpegURL") !== "" || s.canPlayType("audio/mpegurl") !== "";
347
347
  }, mm = () => {
@@ -354,23 +354,23 @@ const dm = new RegExp(
354
354
  return !1;
355
355
  }
356
356
  return !1;
357
- }, fm = () => Te.indexOf("CrKey") !== -1, wu = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints === 0, Lc = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, pm = () => Te.indexOf("iphone") >= 0 && Te.indexOf("like iphone") < 0 || Te.indexOf("ipad") >= 0 && Te.indexOf("like ipad") < 0 || Te.indexOf("ipod") >= 0 && Te.indexOf("like ipod") < 0 || Lc(), gm = () => {
357
+ }, fm = () => Ie.indexOf("CrKey") !== -1, wu = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints === 0, Lc = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, pm = () => Ie.indexOf("iphone") >= 0 && Ie.indexOf("like iphone") < 0 || Ie.indexOf("ipad") >= 0 && Ie.indexOf("like ipad") < 0 || Ie.indexOf("ipod") >= 0 && Ie.indexOf("like ipod") < 0 || Lc(), gm = () => {
358
358
  var s, e;
359
- return Lc() ? !1 : (e = (s = Tr()) == null ? void 0 : s.isTypeSupported('audio/mp4; codecs="opus"')) != null ? e : !1;
360
- }, JA = () => "ontouchstart" in window || navigator.maxTouchPoints > 0, Am = () => /^(?!.*chrome).*safari/i.test(Te);
359
+ return Lc() ? !1 : (e = (s = Cr()) == null ? void 0 : s.isTypeSupported('audio/mp4; codecs="opus"')) != null ? e : !1;
360
+ }, JA = () => "ontouchstart" in window || navigator.maxTouchPoints > 0, Am = () => /^(?!.*chrome).*safari/i.test(Ie);
361
361
  function wm() {
362
362
  var s, e;
363
- if (/(iPhone|iPod|iPad)/i.test(Te))
364
- return (e = (s = Te == null ? void 0 : Te.match(/OS [\d_]+/i)) == null ? void 0 : s[0]) == null ? void 0 : e.substring(3).split("_").map((t) => parseInt(t))[0];
363
+ if (/(iPhone|iPod|iPad)/i.test(Ie))
364
+ return (e = (s = Ie == null ? void 0 : Ie.match(/OS [\d_]+/i)) == null ? void 0 : s[0]) == null ? void 0 : e.substring(3).split("_").map((t) => parseInt(t))[0];
365
365
  }
366
366
  function bm() {
367
367
  var s, e;
368
- if (/^((?!chrome|android).)*safari/i.test(Te))
369
- return (e = (s = Te.match(/version\/([\d.]+)/)) == null ? void 0 : s[1]) == null ? void 0 : e.split(".").map((t) => parseInt(t))[0];
368
+ if (/^((?!chrome|android).)*safari/i.test(Ie))
369
+ return (e = (s = Ie.match(/version\/([\d.]+)/)) == null ? void 0 : s[1]) == null ? void 0 : e.split(".").map((t) => parseInt(t))[0];
370
370
  }
371
371
  const bu = () => {
372
372
  var t, i;
373
- const s = !!Tr();
373
+ const s = !!Cr();
374
374
  let e = !1;
375
375
  return s && (e = gm()), {
376
376
  isMobile: um,
@@ -397,7 +397,7 @@ const bu = () => {
397
397
  return i;
398
398
  };
399
399
  var ie, Bt, Qt;
400
- class Wn {
400
+ class Hn {
401
401
  constructor(e) {
402
402
  u(this, ie);
403
403
  u(this, Bt);
@@ -533,9 +533,9 @@ class Ss {
533
533
  }
534
534
  }
535
535
  }
536
- const Hn = (s) => s.reduce((e, t) => e + t, 0) / s.length, Xt = (s) => ({
536
+ const Qn = (s) => s.reduce((e, t) => e + t, 0) / s.length, Xt = (s) => ({
537
537
  last: s[s.length - 1] || 0,
538
- average: s.length === 0 ? 0 : Hn(s),
538
+ average: s.length === 0 ? 0 : Qn(s),
539
539
  max: s.length === 0 ? 0 : Math.max(...s),
540
540
  min: s.length === 0 ? 0 : Math.min(...s)
541
541
  }), vm = (s) => {
@@ -563,13 +563,13 @@ class Sm {
563
563
  const e = this.accumulatedValues / ((Date.now() - this.lastTickTime) / 1e3);
564
564
  this.rates.push(e), this.accumulatedValues = 0, this.lastTickTime = Date.now();
565
565
  });
566
- this.rates = new fe(e);
566
+ this.rates = new pe(e);
567
567
  }
568
568
  get total() {
569
569
  return this._total;
570
570
  }
571
571
  get average() {
572
- return this.rates.isEmpty() ? 0 : Hn(this.rates.items());
572
+ return this.rates.isEmpty() ? 0 : Qn(this.rates.items());
573
573
  }
574
574
  get minMaxAverage() {
575
575
  return Xt(this.rates.items());
@@ -586,11 +586,11 @@ const vs = (s, e) => {
586
586
  }, bd = ["off", "error", "warn", "info", "debug", "trace"], Em = {
587
587
  OFF: "off"
588
588
  };
589
- var Ui, Rr, Pi, js, Ws;
589
+ var Ui, Pr, Pi, js, Ws;
590
590
  const Wt = class Wt {
591
591
  constructor({ context: e, logLevel: t, debug: i }) {
592
592
  u(this, Ui, /* @__PURE__ */ new Map());
593
- u(this, Rr, "");
593
+ u(this, Pr, "");
594
594
  u(this, Pi, !1);
595
595
  u(this, js, "off");
596
596
  r(this, "trace", (...e) => {
@@ -607,7 +607,7 @@ const Wt = class Wt {
607
607
  });
608
608
  r(this, "count", (...e) => {
609
609
  });
610
- l(this, Rr, e), l(this, js, t), l(this, Pi, i || !1), this.setLevel(t), this.setDebug(a(this, Pi));
610
+ l(this, Pr, e), l(this, js, t), l(this, Pi, i || !1), this.setLevel(t), this.setDebug(a(this, Pi));
611
611
  }
612
612
  setDebug(e) {
613
613
  l(this, Pi, e);
@@ -629,7 +629,7 @@ const Wt = class Wt {
629
629
  "font-weight:bold;",
630
630
  n.toUpperCase(),
631
631
  "font-weight:normal;",
632
- a(this, Rr)
632
+ a(this, Pr)
633
633
  ) : this[n] = () => {
634
634
  });
635
635
  }
@@ -645,10 +645,10 @@ const Wt = class Wt {
645
645
  return a(Wt, Ws) || l(Wt, Ws, new Wt({ context: "Vindral", logLevel: "off" })), a(Wt, Ws);
646
646
  }
647
647
  };
648
- Ui = new WeakMap(), Rr = new WeakMap(), Pi = new WeakMap(), js = new WeakMap(), Ws = new WeakMap(), u(Wt, Ws);
649
- let pe = Wt;
648
+ Ui = new WeakMap(), Pr = new WeakMap(), Pi = new WeakMap(), js = new WeakMap(), Ws = new WeakMap(), u(Wt, Ws);
649
+ let ge = Wt;
650
650
  function xe(s) {
651
- const e = pe.get().createContext(s.context);
651
+ const e = ge.get().createContext(s.context);
652
652
  return function(i, n) {
653
653
  const o = String(n.name);
654
654
  function c(...h) {
@@ -673,10 +673,10 @@ function St() {
673
673
  function yu() {
674
674
  return typeof Symbol.dispose != "symbol" && Object.defineProperty(Symbol, "dispose", { value: Symbol.for("dispose") }), Symbol.dispose;
675
675
  }
676
- var Ur, nh;
676
+ var xr, nh;
677
677
  class Tm {
678
678
  constructor(e, t) {
679
- u(this, Ur);
679
+ u(this, xr);
680
680
  r(this, "value");
681
681
  r(this, "unlocker");
682
682
  this.value = e, this.unlocker = t;
@@ -686,13 +686,13 @@ class Tm {
686
686
  return (e = this.unlocker) == null ? void 0 : e.promise;
687
687
  }
688
688
  [yu()]() {
689
- A(this, Ur, nh).call(this);
689
+ A(this, xr, nh).call(this);
690
690
  }
691
691
  [Symbol.dispose]() {
692
- A(this, Ur, nh).call(this);
692
+ A(this, xr, nh).call(this);
693
693
  }
694
694
  }
695
- Ur = new WeakSet(), nh = function() {
695
+ xr = new WeakSet(), nh = function() {
696
696
  this.unlocker.resolve(this.value);
697
697
  };
698
698
  var xi, Li;
@@ -721,7 +721,7 @@ class Im {
721
721
  }
722
722
  xi = new WeakMap(), Li = new WeakMap();
723
723
  var Ge, Ye;
724
- class Ce {
724
+ class ke {
725
725
  constructor(e) {
726
726
  u(this, Ge);
727
727
  u(this, Ye);
@@ -828,7 +828,7 @@ const yd = (s, e) => {
828
828
  }
829
829
  };
830
830
  r(_o, "create", () => new _o());
831
- let ge = _o;
831
+ let Ae = _o;
832
832
  function vu(s) {
833
833
  try {
834
834
  return s();
@@ -961,7 +961,7 @@ const Xm = (s, e) => new P(
961
961
  code: Fm,
962
962
  type: "internal"
963
963
  }
964
- ), $m = () => new P("Web Audio Context resume timeout", { isFatal: !1, code: "web_audio_context_resume_timeout" }), qn = (s) => new P("Disconnected From Edge Server", {
964
+ ), $m = () => new P("Web Audio Context resume timeout", { isFatal: !1, code: "web_audio_context_resume_timeout" }), Yn = (s) => new P("Disconnected From Edge Server", {
965
965
  type: "external",
966
966
  source: s,
967
967
  isFatal: !1,
@@ -1136,19 +1136,19 @@ function df(s, e) {
1136
1136
  if (t[n] !== i[n]) return !1;
1137
1137
  return !0;
1138
1138
  }
1139
- var Pr;
1139
+ var Lr;
1140
1140
  class uf extends Dc {
1141
1141
  constructor(t, i) {
1142
1142
  super("clearkey", t, "");
1143
- u(this, Pr);
1144
- l(this, Pr, i);
1143
+ u(this, Lr);
1144
+ l(this, Lr, i);
1145
1145
  }
1146
1146
  handleLicenseRequest(t) {
1147
1147
  const i = new Uint8Array(t), n = String.fromCharCode(...i), o = JSON.parse(n), c = [];
1148
1148
  for (let f = 0; f < o.kids.length; f++) {
1149
1149
  const p = o.kids[f];
1150
1150
  if (p) {
1151
- const g = ku(p).toLowerCase(), w = a(this, Pr)[g];
1151
+ const g = ku(p).toLowerCase(), w = a(this, Lr)[g];
1152
1152
  w && c.push({
1153
1153
  kty: "oct",
1154
1154
  alg: "A128KW",
@@ -1164,7 +1164,7 @@ class uf extends Dc {
1164
1164
  return new TextEncoder().encode(h);
1165
1165
  }
1166
1166
  }
1167
- Pr = new WeakMap();
1167
+ Lr = new WeakMap();
1168
1168
  class lf extends Dc {
1169
1169
  constructor(e, t, i) {
1170
1170
  super("fairplay", e, t, i);
@@ -1176,8 +1176,8 @@ const mf = (s) => {
1176
1176
  let n = {};
1177
1177
  if (i) {
1178
1178
  const g = i.getElementsByTagName("name"), w = i.getElementsByTagName("value");
1179
- for (let b = 0; b < g.length; b++) {
1180
- const S = (h = g[b]) == null ? void 0 : h.childNodes[0], x = (d = w[b]) == null ? void 0 : d.childNodes[0];
1179
+ for (let y = 0; y < g.length; y++) {
1180
+ const S = (h = g[y]) == null ? void 0 : h.childNodes[0], x = (d = w[y]) == null ? void 0 : d.childNodes[0];
1181
1181
  S != null && S.nodeValue && x && x.nodeValue && (n[S.nodeValue] = x.nodeValue);
1182
1182
  }
1183
1183
  }
@@ -1218,7 +1218,7 @@ class pf extends Dc {
1218
1218
  }
1219
1219
  }
1220
1220
  const gf = 5e3;
1221
- var V, Mi, Rt, Je, xr, Lr, Re, Zt, qt, zs, No, Dr, Or, ne, Bu, Ru, Uu, Pu, Vo, Go, xu, Jn, jo, Lu, Du;
1221
+ var V, Mi, Rt, Je, zs, Hs, de, Zt, qt, Xs, No, Dr, Or, ne, Bu, Ru, Uu, Pu, Vo, Go, xu, er, jo, Lu, Du;
1222
1222
  class Rd {
1223
1223
  constructor(e, t, i, n) {
1224
1224
  u(this, ne);
@@ -1226,17 +1226,17 @@ class Rd {
1226
1226
  u(this, Mi);
1227
1227
  u(this, Rt);
1228
1228
  u(this, Je, new W());
1229
- u(this, xr, {});
1230
- u(this, Lr, {});
1231
- u(this, Re);
1229
+ u(this, zs, {});
1230
+ u(this, Hs, {});
1231
+ u(this, de);
1232
1232
  u(this, Zt, /* @__PURE__ */ new Map());
1233
1233
  u(this, qt);
1234
- u(this, zs);
1234
+ u(this, Xs);
1235
1235
  u(this, No, bu());
1236
1236
  u(this, Dr, (e) => {
1237
- if (a(this, V).info("Received DRM data", { options: e }), window.clearTimeout(a(this, zs)), a(this, Re)) {
1238
- const t = A(this, ne, Du).call(this, e)[a(this, Re).keySystem];
1239
- t && (a(this, Re).licenseServerUrl = t);
1237
+ if (a(this, V).info("Received DRM data", { options: e }), window.clearTimeout(a(this, Xs)), a(this, de)) {
1238
+ const t = A(this, ne, Du).call(this, e)[a(this, de).keySystem];
1239
+ t && (a(this, de).licenseServerUrl = t);
1240
1240
  }
1241
1241
  a(this, Je).resolve(e);
1242
1242
  });
@@ -1253,13 +1253,13 @@ class Rd {
1253
1253
  }
1254
1254
  a(this, V).debug("Requesting license for session", {
1255
1255
  sessionId: t.sessionId,
1256
- licenseServerUrl: (o = a(this, Re)) == null ? void 0 : o.licenseServerUrl
1257
- }), (c = a(this, Re)) == null || c.requestLicense(i).then((h) => {
1256
+ licenseServerUrl: (o = a(this, de)) == null ? void 0 : o.licenseServerUrl
1257
+ }), (c = a(this, de)) == null || c.requestLicense(i).then((h) => {
1258
1258
  a(this, V).debug("License received for session", { sessionId: t.sessionId }), t.update(h).catch((d) => {
1259
- A(this, ne, Jn).call(this, { message: "Failed to update session with license", isFatal: !1, error: d });
1259
+ A(this, ne, er).call(this, { message: "Failed to update session with license", isFatal: !1, error: d });
1260
1260
  });
1261
1261
  }).catch((h) => {
1262
- A(this, ne, Jn).call(this, { message: "Failed to request license", isFatal: !1, error: h });
1262
+ A(this, ne, er).call(this, { message: "Failed to request license", isFatal: !1, error: h });
1263
1263
  });
1264
1264
  });
1265
1265
  u(this, Go, (e) => {
@@ -1281,9 +1281,9 @@ class Rd {
1281
1281
  a(this, V).debug("Supported key system found", i.mediaKeySystemAccess.getConfiguration());
1282
1282
  const { keySystem: n, mediaKeySystemAccess: o } = i;
1283
1283
  let c = null;
1284
- return n === "clearkey" ? (He(e.clearkeys, "No clearkeys found"), c = new uf(o, e.clearkeys)) : n === "playready" ? (He(e.playreadyLicenseUrl, "No playreadyLicenseUrl found"), c = new ff(o, e.playreadyLicenseUrl)) : n === "widevine" ? (He(e.widevineLicenseUrl, "No widevineLicenseUrl found"), c = new pf(o, e.widevineLicenseUrl)) : n === "fairplay" && (He(e.fairplayLicenseUrl, "No fairplayLicenseUrl found"), He(e.fairplayCertificate, "No fairplayCertificate found"), c = new lf(o, e.fairplayLicenseUrl, e.fairplayCertificate)), c && (c.headers = a(this, xr), c.queryParams = a(this, Lr)), c;
1284
+ return n === "clearkey" ? (He(e.clearkeys, "No clearkeys found"), c = new uf(o, e.clearkeys)) : n === "playready" ? (He(e.playreadyLicenseUrl, "No playreadyLicenseUrl found"), c = new ff(o, e.playreadyLicenseUrl)) : n === "widevine" ? (He(e.widevineLicenseUrl, "No widevineLicenseUrl found"), c = new pf(o, e.widevineLicenseUrl)) : n === "fairplay" && (He(e.fairplayLicenseUrl, "No fairplayLicenseUrl found"), He(e.fairplayCertificate, "No fairplayCertificate found"), c = new lf(o, e.fairplayLicenseUrl, e.fairplayCertificate)), c && (c.headers = a(this, zs), c.queryParams = a(this, Hs)), c;
1285
1285
  }));
1286
- l(this, Mi, e), l(this, V, t), l(this, xr, i || {}), l(this, Lr, n || {}), a(this, Mi).on("received drm data", a(this, Dr));
1286
+ l(this, Mi, e), l(this, V, t), l(this, zs, i || {}), l(this, Hs, n || {}), a(this, Mi).on("received drm data", a(this, Dr));
1287
1287
  }
1288
1288
  static isSupported() {
1289
1289
  return !!navigator.requestMediaKeySystemAccess;
@@ -1293,35 +1293,41 @@ class Rd {
1293
1293
  }
1294
1294
  getStatistics() {
1295
1295
  var e, t;
1296
- return !a(this, Je).resolved && !((e = a(this, Re)) != null && e.statistics) ? null : v(v({}, a(this, Je).resolved), (t = a(this, Re)) == null ? void 0 : t.statistics);
1296
+ return !a(this, Je).resolved && !((e = a(this, de)) != null && e.statistics) ? null : v(v({}, a(this, Je).resolved), (t = a(this, de)) == null ? void 0 : t.statistics);
1297
1297
  }
1298
1298
  unload() {
1299
1299
  var e;
1300
1300
  a(this, V).info("Unloading EncryptedMediaExtensions"), a(this, Mi).off("received drm data", a(this, Dr)), (e = a(this, Rt)) == null || e.removeEventListener("encrypted", a(this, Or)), a(this, Zt).forEach((t, i) => {
1301
1301
  i.close();
1302
- }), a(this, Zt).clear(), l(this, qt, void 0), l(this, Re, void 0);
1302
+ }), a(this, Zt).clear(), l(this, qt, void 0), l(this, de, void 0);
1303
+ }
1304
+ set headers(e) {
1305
+ l(this, zs, e), a(this, de) && (a(this, de).headers = e);
1306
+ }
1307
+ set queryParams(e) {
1308
+ l(this, Hs, e), a(this, de) && (a(this, de).queryParams = e);
1303
1309
  }
1304
1310
  onChannelSwitch() {
1305
1311
  if (!a(this, Je).resolved) {
1306
1312
  a(this, V).debug("DRM is not used, skipping channel switch handling");
1307
1313
  return;
1308
1314
  }
1309
- Am() && a(this, No).platform.safariVersion < 18 && A(this, ne, Jn).call(this, {
1315
+ Am() && a(this, No).platform.safariVersion < 18 && A(this, ne, er).call(this, {
1310
1316
  message: "DRM channel switch not supported on Safari < 18",
1311
1317
  isFatal: !0
1312
- }), window.clearTimeout(a(this, zs));
1318
+ }), window.clearTimeout(a(this, Xs));
1313
1319
  const e = a(this, Je).resolved;
1314
- l(this, Je, new W()), l(this, zs, window.setTimeout(() => {
1320
+ l(this, Je, new W()), l(this, Xs, window.setTimeout(() => {
1315
1321
  a(this, Je).resolve(e);
1316
1322
  }, gf));
1317
1323
  }
1318
1324
  }
1319
- V = new WeakMap(), Mi = new WeakMap(), Rt = new WeakMap(), Je = new WeakMap(), xr = new WeakMap(), Lr = new WeakMap(), Re = new WeakMap(), Zt = new WeakMap(), qt = new WeakMap(), zs = new WeakMap(), No = new WeakMap(), Dr = new WeakMap(), Or = new WeakMap(), ne = new WeakSet(), Bu = function(e) {
1325
+ V = new WeakMap(), Mi = new WeakMap(), Rt = new WeakMap(), Je = new WeakMap(), zs = new WeakMap(), Hs = new WeakMap(), de = new WeakMap(), Zt = new WeakMap(), qt = new WeakMap(), Xs = new WeakMap(), No = new WeakMap(), Dr = new WeakMap(), Or = new WeakMap(), ne = new WeakSet(), Bu = function(e) {
1320
1326
  return m(this, null, function* () {
1321
1327
  try {
1322
1328
  yield A(this, ne, Ru).call(this), a(this, V).debug("Media keys initialization completed"), yield A(this, ne, Uu).call(this, e.initData, e.initDataType);
1323
1329
  } catch (t) {
1324
- A(this, ne, Jn).call(this, { message: "Failed to handle encrypted event", isFatal: !0, error: t });
1330
+ A(this, ne, er).call(this, { message: "Failed to handle encrypted event", isFatal: !0, error: t });
1325
1331
  }
1326
1332
  });
1327
1333
  }, Ru = function() {
@@ -1341,13 +1347,13 @@ V = new WeakMap(), Mi = new WeakMap(), Rt = new WeakMap(), Je = new WeakMap(), x
1341
1347
  const i = yield a(this, jo).call(this, e);
1342
1348
  a(this, V).debug("CDM obtained", { cdm: i }), He(a(this, Rt), "No media element found"), He(i, "No CDM found");
1343
1349
  const n = yield i.getMediaKeys();
1344
- i.certificate && (yield A(this, ne, xu).call(this, n, i.certificate)), a(this, V).debug("Setting media keys on media element"), yield a(this, Rt).setMediaKeys(n), l(this, Re, i);
1350
+ i.certificate && (yield A(this, ne, xu).call(this, n, i.certificate)), a(this, V).debug("Setting media keys on media element"), yield a(this, Rt).setMediaKeys(n), l(this, de, i);
1345
1351
  })), yield a(this, qt);
1346
1352
  });
1347
1353
  }, Uu = function(e, t) {
1348
1354
  return m(this, null, function* () {
1349
- He(a(this, Re), "No CDM manager found");
1350
- const i = yield a(this, Re).getMediaKeys();
1355
+ He(a(this, de), "No CDM manager found");
1356
+ const i = yield a(this, de).getMediaKeys();
1351
1357
  if (!e || !A(this, ne, Pu).call(this, e)) {
1352
1358
  a(this, V).debug("Duplicate initData, no need to create new session", { initData: e });
1353
1359
  return;
@@ -1369,7 +1375,7 @@ V = new WeakMap(), Mi = new WeakMap(), Rt = new WeakMap(), Je = new WeakMap(), x
1369
1375
  a(this, V).error("Failed to set server certificate", { error: i });
1370
1376
  }
1371
1377
  });
1372
- }, Jn = function(e) {
1378
+ }, er = function(e) {
1373
1379
  const { message: t, isFatal: i, error: n } = e;
1374
1380
  a(this, V).error(t, { error: n }), a(this, Mi).emit("error", Iu(t, i, n));
1375
1381
  }, jo = new WeakMap(), /**
@@ -1483,14 +1489,14 @@ const Af = 7, wf = 8, bf = (s) => {
1483
1489
  const x = c == 1 ? 1 : 0, D = 1 << (c == 1 || c == 2 ? 1 : 0), E = 2 - p << x, U = o.readUnsignedExpGolomb() * D, k = o.readUnsignedExpGolomb() * D, _ = o.readUnsignedExpGolomb() * E, he = o.readUnsignedExpGolomb() * E;
1484
1490
  g -= U + k, w -= _ + he;
1485
1491
  }
1486
- let b = {
1492
+ let y = {
1487
1493
  numerator: 1,
1488
1494
  denumerator: 1
1489
1495
  };
1490
- return o.readBit() && o.readBit() && (b = (S = Tf[o.readBits(8)]) != null ? S : { numerator: 0, denumerator: 0 }), {
1496
+ return o.readBit() && o.readBit() && (y = (S = Tf[o.readBits(8)]) != null ? S : { numerator: 0, denumerator: 0 }), {
1491
1497
  width: g,
1492
1498
  height: w,
1493
- pixelAspectRatio: b,
1499
+ pixelAspectRatio: y,
1494
1500
  profileIdc: t,
1495
1501
  constraintFlags: i,
1496
1502
  levelIdc: n
@@ -1515,11 +1521,11 @@ const Af = 7, wf = 8, bf = (s) => {
1515
1521
  { numerator: 2, denumerator: 1 }
1516
1522
  ], If = 184549376;
1517
1523
  function Cf(s) {
1518
- const e = new Wn(s), t = kf(e);
1524
+ const e = new Hn(s), t = kf(e);
1519
1525
  t.flags & If && Bf(e);
1520
1526
  const i = Rf(e);
1521
1527
  if (String.fromCharCode(...i.frameId) === "TXXX") {
1522
- const o = new Wn(e.readBytes(i.size));
1528
+ const o = new Hn(e.readBytes(i.size));
1523
1529
  return {
1524
1530
  header: t,
1525
1531
  txx: Uf(o)
@@ -1566,7 +1572,7 @@ function Mu(s) {
1566
1572
  };
1567
1573
  }
1568
1574
  function Pf(s, e) {
1569
- const t = Mu(e), i = new Wn(e.readBytes(t.size));
1575
+ const t = Mu(e), i = new Hn(e.readBytes(t.size));
1570
1576
  if (t.type !== s.type)
1571
1577
  throw new Error(`invalid error type: ${t.type}, expected ${s.type}`);
1572
1578
  const n = s.decodeData(i);
@@ -1627,22 +1633,22 @@ const Ps = class Ps {
1627
1633
  };
1628
1634
  r(Ps, "type", "emsg");
1629
1635
  let ho = Ps;
1630
- const rr = class rr {
1636
+ const or = class or {
1631
1637
  constructor(e) {
1632
- r(this, "type", rr.type);
1638
+ r(this, "type", or.type);
1633
1639
  r(this, "data");
1634
1640
  this.data = e;
1635
1641
  }
1636
1642
  static decodeData(e) {
1637
1643
  const t = e.readRemaining();
1638
- return new rr(t);
1644
+ return new or(t);
1639
1645
  }
1640
1646
  };
1641
- r(rr, "type", "mdat");
1642
- let uo = rr;
1643
- const ar = class ar {
1647
+ r(or, "type", "mdat");
1648
+ let uo = or;
1649
+ const cr = class cr {
1644
1650
  constructor(e, t, i) {
1645
- r(this, "type", ar.type);
1651
+ r(this, "type", cr.type);
1646
1652
  r(this, "extra");
1647
1653
  /**
1648
1654
  * The byte offset of the baseMediaDecodeTime field
@@ -1654,11 +1660,11 @@ const ar = class ar {
1654
1660
  static decodeData(e) {
1655
1661
  const t = wi(e), i = e.byteOffset();
1656
1662
  let n = 0;
1657
- return t.version === 1 ? n = e.readUint64() : n = e.readUint32(), new ar(t, i, n);
1663
+ return t.version === 1 ? n = e.readUint64() : n = e.readUint32(), new cr(t, i, n);
1658
1664
  }
1659
1665
  };
1660
- r(ar, "type", "tfdt");
1661
- let lo = ar;
1666
+ r(cr, "type", "tfdt");
1667
+ let lo = cr;
1662
1668
  const K = class K {
1663
1669
  constructor(e, t, i) {
1664
1670
  r(this, "type", K.type);
@@ -1689,10 +1695,10 @@ const K = class K {
1689
1695
  }
1690
1696
  };
1691
1697
  r(K, "TRUN_DATA_OFFSET", 1), r(K, "TRUN_FIRST_SAMPLE_FLAGS", 4), r(K, "SAMPLE_DURATION", 256), r(K, "SAMPLE_SIZE", 512), r(K, "SAMPLE_FLAGS", 1024), r(K, "SAMPLE_CTS", 2048), r(K, "FLAG_SAMPLE_FLAG_IS_NON_SYNC", 65536), r(K, "FLAG_SAMPLE_DEPENDS_NO", 33554432), r(K, "FLAG_SAMPLE_DEPENDS_YES", 16777216), r(K, "type", "trun");
1692
- let Ir = K;
1693
- const or = class or {
1698
+ let kr = K;
1699
+ const hr = class hr {
1694
1700
  constructor(e, t) {
1695
- r(this, "type", or.type);
1701
+ r(this, "type", hr.type);
1696
1702
  r(this, "tfdt");
1697
1703
  r(this, "trun");
1698
1704
  this.tfdt = e, this.trun = t;
@@ -1701,16 +1707,16 @@ const or = class or {
1701
1707
  let t, i;
1702
1708
  for (; e.remaining() > 0; ) {
1703
1709
  const n = at(e);
1704
- n instanceof lo && (t = n), n instanceof Ir && (i = n);
1710
+ n instanceof lo && (t = n), n instanceof kr && (i = n);
1705
1711
  }
1706
- return new or(t, i);
1712
+ return new hr(t, i);
1707
1713
  }
1708
1714
  };
1709
- r(or, "type", "traf");
1710
- let mo = or;
1711
- const cr = class cr {
1715
+ r(hr, "type", "traf");
1716
+ let mo = hr;
1717
+ const dr = class dr {
1712
1718
  constructor(e) {
1713
- r(this, "type", cr.type);
1719
+ r(this, "type", dr.type);
1714
1720
  r(this, "traf");
1715
1721
  this.traf = e;
1716
1722
  }
@@ -1722,24 +1728,24 @@ const cr = class cr {
1722
1728
  }
1723
1729
  if (!t)
1724
1730
  throw new Error("No traf found");
1725
- return new cr(t);
1731
+ return new dr(t);
1726
1732
  }
1727
1733
  };
1728
- r(cr, "type", "moof");
1729
- let fo = cr;
1730
- const hr = class hr {
1734
+ r(dr, "type", "moof");
1735
+ let fo = dr;
1736
+ const ur = class ur {
1731
1737
  constructor() {
1732
- r(this, "type", hr.type);
1738
+ r(this, "type", ur.type);
1733
1739
  }
1734
1740
  static decodeData(e) {
1735
- return new hr();
1741
+ return new ur();
1736
1742
  }
1737
1743
  };
1738
- r(hr, "type", "mvhd");
1739
- let po = hr;
1740
- const dr = class dr {
1744
+ r(ur, "type", "mvhd");
1745
+ let po = ur;
1746
+ const lr = class lr {
1741
1747
  constructor(e) {
1742
- r(this, "type", dr.type);
1748
+ r(this, "type", lr.type);
1743
1749
  r(this, "fourCC");
1744
1750
  this.fourCC = e;
1745
1751
  }
@@ -1758,11 +1764,11 @@ const dr = class dr {
1758
1764
  static decodeData(e) {
1759
1765
  wi(e), e.readUint32();
1760
1766
  const t = String.fromCharCode(...e.readBytes(4));
1761
- return new dr(t);
1767
+ return new lr(t);
1762
1768
  }
1763
1769
  };
1764
- r(dr, "type", "hdlr");
1765
- let go = dr;
1770
+ r(lr, "type", "hdlr");
1771
+ let go = lr;
1766
1772
  const xs = class xs {
1767
1773
  constructor(e, t, i, n) {
1768
1774
  r(this, "type", xs.type);
@@ -1784,9 +1790,9 @@ const xs = class xs {
1784
1790
  };
1785
1791
  r(xs, "type", "mdhd");
1786
1792
  let Ao = xs;
1787
- const ur = class ur {
1793
+ const mr = class mr {
1788
1794
  constructor(e, t, i, n) {
1789
- r(this, "type", ur.type);
1795
+ r(this, "type", mr.type);
1790
1796
  r(this, "av01");
1791
1797
  r(this, "avc1");
1792
1798
  r(this, "opus");
@@ -1826,14 +1832,14 @@ const ur = class ur {
1826
1832
  break;
1827
1833
  }
1828
1834
  }
1829
- return new ur(n, c, o, i);
1835
+ return new mr(n, c, o, i);
1830
1836
  }
1831
1837
  };
1832
- r(ur, "type", "stsd");
1833
- let wo = ur;
1834
- const lr = class lr {
1838
+ r(mr, "type", "stsd");
1839
+ let wo = mr;
1840
+ const fr = class fr {
1835
1841
  constructor(e) {
1836
- r(this, "type", lr.type);
1842
+ r(this, "type", fr.type);
1837
1843
  r(this, "stsd");
1838
1844
  this.stsd = e;
1839
1845
  }
@@ -1845,14 +1851,14 @@ const lr = class lr {
1845
1851
  }
1846
1852
  if (!t)
1847
1853
  throw new Error("No stsd found");
1848
- return new lr(t);
1854
+ return new fr(t);
1849
1855
  }
1850
1856
  };
1851
- r(lr, "type", "stbl");
1852
- let bo = lr;
1853
- const mr = class mr {
1857
+ r(fr, "type", "stbl");
1858
+ let bo = fr;
1859
+ const pr = class pr {
1854
1860
  constructor(e) {
1855
- r(this, "type", mr.type);
1861
+ r(this, "type", pr.type);
1856
1862
  r(this, "stbl");
1857
1863
  this.stbl = e;
1858
1864
  }
@@ -1864,14 +1870,14 @@ const mr = class mr {
1864
1870
  }
1865
1871
  if (!t)
1866
1872
  throw new Error("No stbl found");
1867
- return new mr(t);
1873
+ return new pr(t);
1868
1874
  }
1869
1875
  };
1870
- r(mr, "type", "minf");
1871
- let yo = mr;
1872
- const fr = class fr {
1876
+ r(pr, "type", "minf");
1877
+ let yo = pr;
1878
+ const gr = class gr {
1873
1879
  constructor(e, t, i) {
1874
- r(this, "type", fr.type);
1880
+ r(this, "type", gr.type);
1875
1881
  r(this, "hdlr");
1876
1882
  r(this, "minf");
1877
1883
  r(this, "mdhd");
@@ -1889,14 +1895,14 @@ const fr = class fr {
1889
1895
  throw new Error("No minf found");
1890
1896
  if (!n)
1891
1897
  throw new Error("No mdhd found");
1892
- return new fr(t, i, n);
1898
+ return new gr(t, i, n);
1893
1899
  }
1894
1900
  };
1895
- r(fr, "type", "mdia");
1896
- let vo = fr;
1897
- const pr = class pr {
1901
+ r(gr, "type", "mdia");
1902
+ let vo = gr;
1903
+ const Ar = class Ar {
1898
1904
  constructor(e, t, i, n, o, c, h, d) {
1899
- r(this, "type", pr.type);
1905
+ r(this, "type", Ar.type);
1900
1906
  r(this, "modificationTime");
1901
1907
  r(this, "creationTime");
1902
1908
  r(this, "trackId");
@@ -1920,14 +1926,14 @@ const pr = class pr {
1920
1926
  const f = e.readUint16();
1921
1927
  e.readUint16();
1922
1928
  const p = e.readUint16();
1923
- return e.readUint16(), new pr(i, n, o, c, h, d, f, p);
1929
+ return e.readUint16(), new Ar(i, n, o, c, h, d, f, p);
1924
1930
  }
1925
1931
  };
1926
- r(pr, "type", "tkhd");
1927
- let So = pr;
1928
- const gr = class gr {
1932
+ r(Ar, "type", "tkhd");
1933
+ let So = Ar;
1934
+ const wr = class wr {
1929
1935
  constructor(e, t) {
1930
- r(this, "type", gr.type);
1936
+ r(this, "type", wr.type);
1931
1937
  r(this, "tkhd");
1932
1938
  r(this, "mdia");
1933
1939
  this.tkhd = e, this.mdia = t;
@@ -1942,14 +1948,14 @@ const gr = class gr {
1942
1948
  throw new Error("No tkhd found");
1943
1949
  if (!i)
1944
1950
  throw new Error("No mdia found");
1945
- return new gr(t, i);
1951
+ return new wr(t, i);
1946
1952
  }
1947
1953
  };
1948
- r(gr, "type", "trak");
1949
- let Eo = gr;
1950
- const Ar = class Ar {
1954
+ r(wr, "type", "trak");
1955
+ let Eo = wr;
1956
+ const br = class br {
1951
1957
  constructor(e, t) {
1952
- r(this, "type", Ar.type);
1958
+ r(this, "type", br.type);
1953
1959
  r(this, "mvhd");
1954
1960
  r(this, "traks");
1955
1961
  this.mvhd = e, this.traks = t;
@@ -1963,14 +1969,14 @@ const Ar = class Ar {
1963
1969
  }
1964
1970
  if (!t)
1965
1971
  throw new Error("No mvhd found");
1966
- return new Ar(t, i);
1972
+ return new br(t, i);
1967
1973
  }
1968
1974
  };
1969
- r(Ar, "type", "moov");
1970
- let To = Ar;
1971
- const wr = class wr {
1975
+ r(br, "type", "moov");
1976
+ let To = br;
1977
+ const yr = class yr {
1972
1978
  constructor(e, t, i, n, o, c, h, d) {
1973
- r(this, "type", wr.type);
1979
+ r(this, "type", yr.type);
1974
1980
  r(this, "configurationVersion");
1975
1981
  r(this, "avcProfileIndication");
1976
1982
  r(this, "profileCompatibility");
@@ -1984,15 +1990,15 @@ const wr = class wr {
1984
1990
  static decodeData(e) {
1985
1991
  const t = e.buffer(), i = e.readUint8(), n = e.readUint8(), o = e.readUint8(), c = e.readUint8(), h = e.readUint8() & 3, d = e.readUint8() & 31, f = [];
1986
1992
  for (let w = 0; w < d; w++) {
1987
- const b = e.readBytes(e.readUint16());
1988
- f.push(b);
1993
+ const y = e.readBytes(e.readUint16());
1994
+ f.push(y);
1989
1995
  }
1990
1996
  const p = e.readUint8(), g = [];
1991
1997
  for (let w = 0; w < p; w++) {
1992
- const b = e.readBytes(e.readUint16());
1993
- g.push(b);
1998
+ const y = e.readBytes(e.readUint16());
1999
+ g.push(y);
1994
2000
  }
1995
- return new wr(
2001
+ return new yr(
1996
2002
  i,
1997
2003
  n,
1998
2004
  o,
@@ -2004,11 +2010,11 @@ const wr = class wr {
2004
2010
  );
2005
2011
  }
2006
2012
  };
2007
- r(wr, "type", "avcC");
2008
- let rh = wr;
2009
- const br = class br {
2013
+ r(yr, "type", "avcC");
2014
+ let rh = yr;
2015
+ const vr = class vr {
2010
2016
  constructor(e, t, i, n, o) {
2011
- r(this, "type", br.type);
2017
+ r(this, "type", vr.type);
2012
2018
  r(this, "avcC");
2013
2019
  r(this, "width");
2014
2020
  r(this, "height");
@@ -2031,24 +2037,24 @@ const br = class br {
2031
2037
  }
2032
2038
  if (!c)
2033
2039
  throw new Error("no avcC");
2034
- return new br(c, t, i, n, o);
2040
+ return new vr(c, t, i, n, o);
2035
2041
  }
2036
2042
  };
2037
- r(br, "type", "avc1");
2038
- let ah = br;
2039
- const yr = class yr {
2043
+ r(vr, "type", "avc1");
2044
+ let ah = vr;
2045
+ const Sr = class Sr {
2040
2046
  constructor() {
2041
- r(this, "type", yr.type);
2047
+ r(this, "type", Sr.type);
2042
2048
  }
2043
2049
  static decodeData(e) {
2044
- return new yr();
2050
+ return new Sr();
2045
2051
  }
2046
2052
  };
2047
- r(yr, "type", "dOps");
2048
- let oh = yr;
2049
- const vr = class vr {
2053
+ r(Sr, "type", "dOps");
2054
+ let oh = Sr;
2055
+ const Er = class Er {
2050
2056
  constructor(e, t, i) {
2051
- r(this, "type", vr.type);
2057
+ r(this, "type", Er.type);
2052
2058
  r(this, "dops");
2053
2059
  r(this, "channelCount");
2054
2060
  r(this, "sampleRate");
@@ -2063,11 +2069,11 @@ const vr = class vr {
2063
2069
  const n = e.readUint16();
2064
2070
  e.readUint16(), t === 1 && (e.readUint64(), e.readUint64());
2065
2071
  const o = Pf(oh, e);
2066
- return new vr(o, i, n);
2072
+ return new Er(o, i, n);
2067
2073
  }
2068
2074
  };
2069
- r(vr, "type", "Opus");
2070
- let ch = vr;
2075
+ r(Er, "type", "Opus");
2076
+ let ch = Er;
2071
2077
  const Ls = class Ls {
2072
2078
  constructor(e, t) {
2073
2079
  r(this, "type", Ls.type);
@@ -2112,7 +2118,7 @@ const Lf = {
2112
2118
  moof: fo,
2113
2119
  traf: mo,
2114
2120
  tfdt: lo,
2115
- trun: Ir,
2121
+ trun: kr,
2116
2122
  mdat: uo,
2117
2123
  mdia: vo,
2118
2124
  hdlr: go,
@@ -2127,7 +2133,7 @@ const Lf = {
2127
2133
  emsg: ho
2128
2134
  };
2129
2135
  function at(s) {
2130
- const e = Mu(s), t = Lf[e.type], i = new Wn(s.readBytes(e.size));
2136
+ const e = Mu(s), t = Lf[e.type], i = new Hn(s.readBytes(e.size));
2131
2137
  if (!t) {
2132
2138
  const o = new xf(e, i);
2133
2139
  return i.readRemaining(), o;
@@ -2138,7 +2144,7 @@ function at(s) {
2138
2144
  function Df(s) {
2139
2145
  if (s.byteLength < 8)
2140
2146
  throw new Error("Buffer too small");
2141
- const e = new Wn(s), t = /* @__PURE__ */ new Map();
2147
+ const e = new Hn(s), t = /* @__PURE__ */ new Map();
2142
2148
  for (; e.remaining() > 0; ) {
2143
2149
  const o = at(e);
2144
2150
  t.set(o.type, o);
@@ -2156,7 +2162,7 @@ function Df(s) {
2156
2162
  function Of(s) {
2157
2163
  if (s.byteLength < 8)
2158
2164
  throw new Error("Buffer too small");
2159
- const e = new Wn(s), t = /* @__PURE__ */ new Map(), i = [];
2165
+ const e = new Hn(s), t = /* @__PURE__ */ new Map(), i = [];
2160
2166
  for (; e.remaining() > 0; ) {
2161
2167
  const h = at(e);
2162
2168
  h instanceof ho && i.push(h), t.set(h.type, h);
@@ -2190,13 +2196,13 @@ class Mf {
2190
2196
  }
2191
2197
  }
2192
2198
  _r = new WeakMap(), Nr = new WeakMap();
2193
- var Se, Ue, X;
2199
+ var Ee, Ue, X;
2194
2200
  const rd = class rd {
2195
2201
  constructor(e, t) {
2196
- u(this, Se);
2202
+ u(this, Ee);
2197
2203
  u(this, Ue);
2198
2204
  u(this, X);
2199
- l(this, Se, t), l(this, Ue, e), l(this, X, Of(t));
2205
+ l(this, Ee, t), l(this, Ue, e), l(this, X, Of(t));
2200
2206
  }
2201
2207
  /**
2202
2208
  * @returns a new fragment with a clone of the raw bytes
@@ -2204,7 +2210,7 @@ const rd = class rd {
2204
2210
  clone() {
2205
2211
  return new rd(
2206
2212
  a(this, Ue),
2207
- new Uint8Array(a(this, Se).buffer.slice(a(this, Se).byteOffset, a(this, Se).byteOffset + a(this, Se).byteLength))
2213
+ new Uint8Array(a(this, Ee).buffer.slice(a(this, Ee).byteOffset, a(this, Ee).byteOffset + a(this, Ee).byteLength))
2208
2214
  );
2209
2215
  }
2210
2216
  /**
@@ -2212,13 +2218,13 @@ const rd = class rd {
2212
2218
  * @param baseMediaDecodeTime
2213
2219
  */
2214
2220
  updateBaseMediaDecodeTime(e) {
2215
- const t = new DataView(a(this, Se).buffer, a(this, Se).byteOffset, a(this, Se).byteLength);
2221
+ const t = new DataView(a(this, Ee).buffer, a(this, Ee).byteOffset, a(this, Ee).byteLength);
2216
2222
  if (a(this, X).moof.traf.tfdt)
2217
2223
  if (a(this, X).moof.traf.tfdt.baseMediaDecodeTime = e, a(this, X).moof.traf.tfdt.extra.version === 1) {
2218
2224
  const i = Math.floor(e / 4294967296), n = (e & 4294967295) >>> 0;
2219
- t.setUint32(a(this, X).moof.traf.tfdt.byteOffset - a(this, Se).byteOffset, i), t.setUint32(a(this, X).moof.traf.tfdt.byteOffset - a(this, Se).byteOffset + 4, n);
2225
+ t.setUint32(a(this, X).moof.traf.tfdt.byteOffset - a(this, Ee).byteOffset, i), t.setUint32(a(this, X).moof.traf.tfdt.byteOffset - a(this, Ee).byteOffset + 4, n);
2220
2226
  } else
2221
- t.setUint32(a(this, X).moof.traf.tfdt.byteOffset - a(this, Se).byteOffset, e);
2227
+ t.setUint32(a(this, X).moof.traf.tfdt.byteOffset - a(this, Ee).byteOffset, e);
2222
2228
  }
2223
2229
  producerReferenceTime() {
2224
2230
  if (!a(this, X).prft)
@@ -2239,7 +2245,7 @@ const rd = class rd {
2239
2245
  }
2240
2246
  startsWithKeyframe() {
2241
2247
  const e = a(this, X).moof.traf.trun, t = (e == null ? void 0 : e.firstSampleFlags) || (e == null ? void 0 : e.sampleFlags[0]);
2242
- return t ? (t & Ir.FLAG_SAMPLE_DEPENDS_NO) !== 0 : !1;
2248
+ return t ? (t & kr.FLAG_SAMPLE_DEPENDS_NO) !== 0 : !1;
2243
2249
  }
2244
2250
  compositionTimeOffset(e) {
2245
2251
  var t;
@@ -2269,18 +2275,18 @@ const rd = class rd {
2269
2275
  return ((e = a(this, X).moof.traf.trun) == null ? void 0 : e.samplesCount) || 0;
2270
2276
  }
2271
2277
  sample(e) {
2272
- var b, S, x, R, D, E, U, k, _, he, Fe, Q, Et, Tt, be;
2273
- const t = (b = a(this, Ue).init().moov.traks[0]) == null ? void 0 : b.mdia.minf.stbl.stsd.codec, i = ((S = a(this, X).moof.traf.trun) == null ? void 0 : S.samplesCount) || 0, n = (x = a(this, X).moof.traf.tfdt) == null ? void 0 : x.baseMediaDecodeTime;
2278
+ var y, S, x, R, D, E, U, k, _, he, Fe, Q, Et, Tt, ye;
2279
+ const t = (y = a(this, Ue).init().moov.traks[0]) == null ? void 0 : y.mdia.minf.stbl.stsd.codec, i = ((S = a(this, X).moof.traf.trun) == null ? void 0 : S.samplesCount) || 0, n = (x = a(this, X).moof.traf.tfdt) == null ? void 0 : x.baseMediaDecodeTime;
2274
2280
  if (e >= i || typeof n == "undefined" || !t)
2275
2281
  return;
2276
- const o = ((R = a(this, X).moof.traf.trun) == null ? void 0 : R.sampleDurations[e]) || 0, c = ((D = a(this, X).moof.traf.trun) == null ? void 0 : D.sampleDurations.slice(0, e).reduce((ye, y) => ye + y, 0)) || 0, h = n + c, d = ((E = a(this, Ue).init().moov.traks[0]) == null ? void 0 : E.mdia.mdhd.timescale) || 1e3, f = ((U = a(this, X).moof.traf.trun) == null ? void 0 : U.sampleSizes[e]) || a(this, X).mdat.data.byteLength, p = ((k = a(this, X).moof.traf.trun) == null ? void 0 : k.sampleSizes.slice(0, e).reduce((ye, y) => ye + y, 0)) || 0, g = a(this, X).mdat.data.subarray(p, p + f), w = ((_ = a(this, X).moof.traf.trun) == null ? void 0 : _.is_sync_sample(e)) || !1;
2282
+ const o = ((R = a(this, X).moof.traf.trun) == null ? void 0 : R.sampleDurations[e]) || 0, c = ((D = a(this, X).moof.traf.trun) == null ? void 0 : D.sampleDurations.slice(0, e).reduce((ve, b) => ve + b, 0)) || 0, h = n + c, d = ((E = a(this, Ue).init().moov.traks[0]) == null ? void 0 : E.mdia.mdhd.timescale) || 1e3, f = ((U = a(this, X).moof.traf.trun) == null ? void 0 : U.sampleSizes[e]) || a(this, X).mdat.data.byteLength, p = ((k = a(this, X).moof.traf.trun) == null ? void 0 : k.sampleSizes.slice(0, e).reduce((ve, b) => ve + b, 0)) || 0, g = a(this, X).mdat.data.subarray(p, p + f), w = ((_ = a(this, X).moof.traf.trun) == null ? void 0 : _.is_sync_sample(e)) || !1;
2277
2283
  if (this.mediaType() === "video") {
2278
- const ye = ((he = a(this, Ue).init().moov.traks[0]) == null ? void 0 : he.tkhd.width) || 0, y = ((Fe = a(this, Ue).init().moov.traks[0]) == null ? void 0 : Fe.tkhd.height) || 0;
2284
+ const ve = ((he = a(this, Ue).init().moov.traks[0]) == null ? void 0 : he.tkhd.width) || 0, b = ((Fe = a(this, Ue).init().moov.traks[0]) == null ? void 0 : Fe.tkhd.height) || 0;
2279
2285
  return {
2280
2286
  type: "video",
2281
2287
  codec: t,
2282
- width: ye,
2283
- height: y,
2288
+ width: ve,
2289
+ height: b,
2284
2290
  duration: o,
2285
2291
  isSync: w,
2286
2292
  timescale: d,
@@ -2292,7 +2298,7 @@ const rd = class rd {
2292
2298
  type: "audio",
2293
2299
  codec: t,
2294
2300
  channels: ((Et = (Q = a(this, Ue).init().moov.traks[0]) == null ? void 0 : Q.mdia.minf.stbl.stsd.opus) == null ? void 0 : Et.channelCount) || 0,
2295
- sampleRate: ((be = (Tt = a(this, Ue).init().moov.traks[0]) == null ? void 0 : Tt.mdia.minf.stbl.stsd.opus) == null ? void 0 : be.sampleRate) || 0,
2301
+ sampleRate: ((ye = (Tt = a(this, Ue).init().moov.traks[0]) == null ? void 0 : Tt.mdia.minf.stbl.stsd.opus) == null ? void 0 : ye.sampleRate) || 0,
2296
2302
  duration: o,
2297
2303
  isSync: w,
2298
2304
  timestamp: h,
@@ -2304,25 +2310,25 @@ const rd = class rd {
2304
2310
  * @returns the raw bytes of the cmaf fragment
2305
2311
  */
2306
2312
  rawBytes() {
2307
- return a(this, Se);
2313
+ return a(this, Ee);
2308
2314
  }
2309
2315
  };
2310
- Se = new WeakMap(), Ue = new WeakMap(), X = new WeakMap();
2316
+ Ee = new WeakMap(), Ue = new WeakMap(), X = new WeakMap();
2311
2317
  let hh = rd;
2312
- var Hs;
2318
+ var Qs;
2313
2319
  class Pd {
2314
2320
  constructor(e) {
2315
- u(this, Hs);
2316
- l(this, Hs, new Mf(e));
2321
+ u(this, Qs);
2322
+ l(this, Qs, new Mf(e));
2317
2323
  }
2318
2324
  header() {
2319
- return a(this, Hs);
2325
+ return a(this, Qs);
2320
2326
  }
2321
2327
  createFragment(e) {
2322
- return new hh(a(this, Hs), e);
2328
+ return new hh(a(this, Qs), e);
2323
2329
  }
2324
2330
  }
2325
- Hs = new WeakMap();
2331
+ Qs = new WeakMap();
2326
2332
  function C(s) {
2327
2333
  const e = new ArrayBuffer(s.length), t = new Uint8Array(e);
2328
2334
  for (let i = 0, n = s.length; i < n; i++)
@@ -2369,8 +2375,8 @@ const z = {
2369
2375
  prft: C("prft"),
2370
2376
  dOps: C("dOps"),
2371
2377
  emsg: C("emsg")
2372
- }, Ff = 1e3, Cr = C("iso6"), xd = new Uint8Array([0, 0, 2, 0]), _f = [
2373
- Cr,
2378
+ }, Ff = 1e3, Br = C("iso6"), xd = new Uint8Array([0, 0, 2, 0]), _f = [
2379
+ Br,
2374
2380
  new Uint8Array([105, 115, 111, 109]),
2375
2381
  // isom
2376
2382
  new Uint8Array([105, 115, 111, 50]),
@@ -2380,7 +2386,7 @@ const z = {
2380
2386
  new Uint8Array([109, 112, 52, 49])
2381
2387
  // mp41
2382
2388
  ], Nf = [
2383
- Cr,
2389
+ Br,
2384
2390
  new Uint8Array([105, 115, 111, 109]),
2385
2391
  // isom
2386
2392
  new Uint8Array([105, 115, 111, 50]),
@@ -2390,7 +2396,7 @@ const z = {
2390
2396
  new Uint8Array([109, 112, 52, 49])
2391
2397
  // mp41
2392
2398
  ], Vf = [
2393
- Cr,
2399
+ Br,
2394
2400
  new Uint8Array([105, 115, 111, 109]),
2395
2401
  // isom
2396
2402
  new Uint8Array([105, 115, 111, 50]),
@@ -2411,8 +2417,8 @@ const se = (s, e, t) => {
2411
2417
  se(
2412
2418
  s,
2413
2419
  z.ftyp,
2414
- Cr.byteLength + xd.byteLength + e.reduce((t, i) => t + i.byteLength, 0)
2415
- ), s.writer.writeBytes(Cr), s.writer.writeBytes(xd), e.forEach((t) => s.writer.writeBytes(t));
2420
+ Br.byteLength + xd.byteLength + e.reduce((t, i) => t + i.byteLength, 0)
2421
+ ), s.writer.writeBytes(Br), s.writer.writeBytes(xd), e.forEach((t) => s.writer.writeBytes(t));
2416
2422
  }, Gf = (s, e, t) => {
2417
2423
  oe(s, z.mvhd, 96, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(t), s.writer.writeUint32(e), s.writer.writeUint32(65536), s.writer.writeUint16(256), s.writer.writeBytes(new Uint8Array([
2418
2424
  // reserved and unused junk
@@ -2487,9 +2493,9 @@ const se = (s, e, t) => {
2487
2493
  0,
2488
2494
  0
2489
2495
  ])), s.writer.writeUint32(2);
2490
- }, _u = (s) => "sequenceParameterSets" in s, dh = (s) => "sequenceHeader" in s, gs = (s) => s.type == "video", sr = (s) => s.type == "audio", jf = (s, e, t) => {
2496
+ }, _u = (s) => "sequenceParameterSets" in s, dh = (s) => "sequenceHeader" in s, gs = (s) => s.type == "video", rr = (s) => s.type == "audio", jf = (s, e, t) => {
2491
2497
  const i = s.writer.position();
2492
- oe(s, z.tkhd, 0, 0, 3), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(e.trackId), s.writer.writeUint32(0), s.writer.writeUint32(e.duration * t / e.timescale), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint16(0), s.writer.writeUint16(sr(e) ? 1 : 0), s.writer.writeUint16(sr(e) ? 256 : 0), s.writer.writeUint16(0), s.writer.writeBytes(new Uint8Array(
2498
+ oe(s, z.tkhd, 0, 0, 3), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(e.trackId), s.writer.writeUint32(0), s.writer.writeUint32(e.duration * t / e.timescale), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint16(0), s.writer.writeUint16(rr(e) ? 1 : 0), s.writer.writeUint16(rr(e) ? 256 : 0), s.writer.writeUint16(0), s.writer.writeBytes(new Uint8Array(
2493
2499
  [
2494
2500
  0,
2495
2501
  1,
@@ -2528,7 +2534,7 @@ const se = (s, e, t) => {
2528
2534
  0,
2529
2535
  0
2530
2536
  ]
2531
- )), gs(e) ? (s.writer.writeUint32(e.width * 65536), s.writer.writeUint32(e.height * 65536)) : sr(e) && (s.writer.writeUint32(0), s.writer.writeUint32(0)), s.writer.writeUint32At(i, s.writer.position() - i);
2537
+ )), gs(e) ? (s.writer.writeUint32(e.width * 65536), s.writer.writeUint32(e.height * 65536)) : rr(e) && (s.writer.writeUint32(0), s.writer.writeUint32(0)), s.writer.writeUint32At(i, s.writer.position() - i);
2532
2538
  }, Wf = (s, e) => {
2533
2539
  oe(s, z.mdhd, 20, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(e.timescale), s.writer.writeUint32(e.duration);
2534
2540
  const t = e.lang || "und", i = (t.charCodeAt(0) & 31) << 10 | (t.charCodeAt(1) & 31) << 5 | t.charCodeAt(2) & 31;
@@ -2596,10 +2602,10 @@ const se = (s, e, t) => {
2596
2602
  const t = s.writer.position();
2597
2603
  se(s, z.stbl, 0);
2598
2604
  const i = s.writer.position();
2599
- oe(s, z.stsd, 0, 0, 0), s.writer.writeUint32(1), gs(e) ? Zf(s, e) : sr(e) && Jf(s, e), s.writer.writeUint32At(i, s.writer.position() - i), oe(s, C("stts"), 4, 0, 0), s.writer.writeUint32(0), oe(s, C("stsc"), 4, 0, 0), s.writer.writeUint32(0), oe(s, C("stsz"), 8, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32(0), oe(s, C("stco"), 4, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32At(t, s.writer.position() - t);
2605
+ oe(s, z.stsd, 0, 0, 0), s.writer.writeUint32(1), gs(e) ? Zf(s, e) : rr(e) && Jf(s, e), s.writer.writeUint32At(i, s.writer.position() - i), oe(s, C("stts"), 4, 0, 0), s.writer.writeUint32(0), oe(s, C("stsc"), 4, 0, 0), s.writer.writeUint32(0), oe(s, C("stsz"), 8, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32(0), oe(s, C("stco"), 4, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32At(t, s.writer.position() - t);
2600
2606
  }, ep = (s, e) => {
2601
2607
  const t = s.writer.position();
2602
- se(s, z.minf, 0), gs(e) ? (oe(s, z.vmhd, 8, 0, 1), s.writer.writeUint32(0), s.writer.writeUint32(0)) : sr(e) && (oe(s, z.smhd, 4, 0, 0), s.writer.writeUint16(0), s.writer.writeUint16(0)), Hf(s), Kf(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2608
+ se(s, z.minf, 0), gs(e) ? (oe(s, z.vmhd, 8, 0, 1), s.writer.writeUint32(0), s.writer.writeUint32(0)) : rr(e) && (oe(s, z.smhd, 4, 0, 0), s.writer.writeUint16(0), s.writer.writeUint16(0)), Hf(s), Kf(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2603
2609
  }, tp = (s, e) => {
2604
2610
  const t = s.writer.position();
2605
2611
  se(s, z.mdia, 0), Wf(s, e), zf(s, e), ep(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
@@ -2794,12 +2800,12 @@ const se = (s, e, t) => {
2794
2800
  d && s.readBit() !== 0 && s.readBits(4), g.push({ tier: re, operatingPointIdc: Qe, seqLevelIdx: q });
2795
2801
  }
2796
2802
  }
2797
- const w = s.readBits(4) + 1, b = s.readBits(4) + 1, S = s.readBits(w) + 1, x = s.readBits(b) + 1;
2803
+ const w = s.readBits(4) + 1, y = s.readBits(4) + 1, S = s.readBits(w) + 1, x = s.readBits(y) + 1;
2798
2804
  let R = !1;
2799
2805
  n ? R = !1 : R = s.readBit() !== 0, R && (f = s.readBits(4) + 2, p = s.readBits(3) + 1);
2800
2806
  const D = s.readBit() !== 0, E = s.readBit() !== 0, U = s.readBit() !== 0;
2801
- let k = !1, _ = !1, he = !1, Fe = !1, Q = !1, Et = !1, Tt = !1, be = Ld, ye = Hc, y = 0;
2802
- n || (k = s.readBit() !== 0, _ = s.readBit() !== 0, he = s.readBit() !== 0, Fe = s.readBit() !== 0, Q = s.readBit() !== 0, Q && (Et = s.readBit() !== 0, Tt = s.readBit() !== 0), s.readBit() !== 0 ? be = Ld : be = s.readBit(), be > 0 ? s.readBit() > 0 ? ye = Hc : ye = s.readBit() : ye = Hc, Q ? y = s.readBits(3) : y = 0);
2807
+ let k = !1, _ = !1, he = !1, Fe = !1, Q = !1, Et = !1, Tt = !1, ye = Ld, ve = Hc, b = 0;
2808
+ n || (k = s.readBit() !== 0, _ = s.readBit() !== 0, he = s.readBit() !== 0, Fe = s.readBit() !== 0, Q = s.readBit() !== 0, Q && (Et = s.readBit() !== 0, Tt = s.readBit() !== 0), s.readBit() !== 0 ? ye = Ld : ye = s.readBit(), ye > 0 ? s.readBit() > 0 ? ve = Hc : ve = s.readBit() : ve = Hc, Q ? b = s.readBits(3) : b = 0);
2803
2809
  const I = s.readBit() !== 0, H = s.readBit() !== 0, G = s.readBit() !== 0;
2804
2810
  return {
2805
2811
  seqProfile: e,
@@ -2816,7 +2822,7 @@ const se = (s, e, t) => {
2816
2822
  initialDisplayDelayPresentFlag: d,
2817
2823
  operatingPoints: g,
2818
2824
  frameWidthBits: w,
2819
- frameHeightBits: b,
2825
+ frameHeightBits: y,
2820
2826
  maxFrameWidth: S,
2821
2827
  maxFrameHeight: x,
2822
2828
  frameIdNumbersPresentFlag: R,
@@ -2832,9 +2838,9 @@ const se = (s, e, t) => {
2832
2838
  enableOrderHint: Q,
2833
2839
  enableJntComp: Et,
2834
2840
  enableRefFrameMvs: Tt,
2835
- seqForceScreenContentTools: be,
2836
- seqForceIntegerMv: ye,
2837
- orderHintBits: y,
2841
+ seqForceScreenContentTools: ye,
2842
+ seqForceIntegerMv: ve,
2843
+ orderHintBits: b,
2838
2844
  enableSuperres: I,
2839
2845
  enableCdef: H,
2840
2846
  enableRestoration: G,
@@ -2846,12 +2852,12 @@ const se = (s, e, t) => {
2846
2852
  let i = 8, n = !1;
2847
2853
  e === 2 && t ? i = s.readBit() !== 0 ? 12 : 10 : e <= 2 && (i = t ? 10 : 8), e === 1 ? n = !1 : n = s.readBit() !== 0;
2848
2854
  const o = n ? 1 : 3, c = s.readBit() !== 0;
2849
- let h = Tp, d = Ip, f = Bp, p = !1, g = 0, w = 0, b = Dd, S = !1;
2850
- return c && (h = s.readBits(8), d = s.readBits(8), f = s.readBits(8)), n ? (p = s.readBit() !== 0, g = 1, w = 1, b = Dd, S = !1, {
2855
+ let h = Tp, d = Ip, f = Bp, p = !1, g = 0, w = 0, y = Dd, S = !1;
2856
+ return c && (h = s.readBits(8), d = s.readBits(8), f = s.readBits(8)), n ? (p = s.readBit() !== 0, g = 1, w = 1, y = Dd, S = !1, {
2851
2857
  highBitDepth: t,
2852
2858
  bitDepth: i,
2853
2859
  monoChrome: n,
2854
- chromaSamplePosition: b,
2860
+ chromaSamplePosition: y,
2855
2861
  colorPrimaries: h,
2856
2862
  colorRange: p,
2857
2863
  matrixCoefficients: f,
@@ -2864,7 +2870,7 @@ const se = (s, e, t) => {
2864
2870
  highBitDepth: t,
2865
2871
  bitDepth: i,
2866
2872
  monoChrome: n,
2867
- chromaSamplePosition: b,
2873
+ chromaSamplePosition: y,
2868
2874
  colorPrimaries: h,
2869
2875
  colorRange: p,
2870
2876
  matrixCoefficients: f,
@@ -2873,11 +2879,11 @@ const se = (s, e, t) => {
2873
2879
  subsamplingX: g,
2874
2880
  subsamplingY: w,
2875
2881
  transferCharacteristics: d
2876
- }) : (p = s.readBit() !== 0, e === 0 ? (g = 1, w = 1) : e === 1 ? (g = 0, w = 0) : i === 12 ? (g = s.readBit(), g !== 0 ? w = s.readBit() : w = 0) : (g = 1, w = 0), g !== 0 && w !== 0 && (b = s.readBits(2)), S = s.readBit() !== 0, {
2882
+ }) : (p = s.readBit() !== 0, e === 0 ? (g = 1, w = 1) : e === 1 ? (g = 0, w = 0) : i === 12 ? (g = s.readBit(), g !== 0 ? w = s.readBit() : w = 0) : (g = 1, w = 0), g !== 0 && w !== 0 && (y = s.readBits(2)), S = s.readBit() !== 0, {
2877
2883
  highBitDepth: t,
2878
2884
  bitDepth: i,
2879
2885
  monoChrome: n,
2880
- chromaSamplePosition: b,
2886
+ chromaSamplePosition: y,
2881
2887
  colorPrimaries: h,
2882
2888
  colorRange: p,
2883
2889
  matrixCoefficients: f,
@@ -2961,7 +2967,7 @@ const se = (s, e, t) => {
2961
2967
  default:
2962
2968
  throw new Error(`Unsupported codec ${s[0].codec}`);
2963
2969
  }
2964
- }, nr = (s) => !!(s & 1), Gp = (s) => !!(s & 2), jp = (s) => !!(s & 4), Wp = (s) => !!(s & 8), zp = (s) => !!(s & 16), Hp = (s) => {
2970
+ }, ar = (s) => !!(s & 1), Gp = (s) => !!(s & 2), jp = (s) => !!(s & 4), Wp = (s) => !!(s & 8), zp = (s) => !!(s & 16), Hp = (s) => {
2965
2971
  const e = new DataView(s, 0), t = e.getUint8(0), i = e.getUint16(1), n = e.getUint8(3), o = e.getUint8(4), c = Kh(new Uint8Array(s), 5, 12), h = e.getUint32(13), d = zp(n) ? e.getInt16(17) : void 0, f = s.slice(i);
2966
2972
  return { version: t, renditionId: o, flags: n, timestamp: c, timescale: h, payload: f, compositionTimeOffset: d };
2967
2973
  }, Xp = "data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw", $a = () => "wakeLock" in navigator && window.navigator.userAgent.indexOf("Samsung") === -1;
@@ -3076,10 +3082,10 @@ As = new WeakSet(), ju = function(e) {
3076
3082
  let n = i.readLine(), o;
3077
3083
  if (n != null && n.includes("-->") || (o = n, n = i.readLine()), n === void 0)
3078
3084
  throw new Error("expected cue line");
3079
- const [c, h] = n.split("-->").map((b) => b.trim());
3085
+ const [c, h] = n.split("-->").map((y) => y.trim());
3080
3086
  if (!c || !h)
3081
3087
  throw new Error(`a cue needs both start and end time start: ${c} end: ${h}`);
3082
- const [d, f] = h.split(" ", 1).map((b) => b.trim());
3088
+ const [d, f] = h.split(" ", 1).map((y) => y.trim());
3083
3089
  if (!d)
3084
3090
  throw new Error(`missing end time: ${d}`);
3085
3091
  const p = i.readLine();
@@ -3106,11 +3112,11 @@ class lh extends gi {
3106
3112
  super();
3107
3113
  r(this, "element");
3108
3114
  r(this, "logger");
3109
- r(this, "seekTimes", new fe(10));
3115
+ r(this, "seekTimes", new pe(10));
3110
3116
  r(this, "seekStartTime");
3111
3117
  // represents the user specified "muted" state
3112
3118
  r(this, "_userProvidedMuted");
3113
- r(this, "timers", new ge());
3119
+ r(this, "timers", new Ae());
3114
3120
  r(this, "_userHasProvidedInput", !1);
3115
3121
  r(this, "_isPaused", !0);
3116
3122
  r(this, "isActivated", !1);
@@ -3221,7 +3227,7 @@ class lh extends gi {
3221
3227
  }, 0), this.element.addEventListener("stalled", this.onEvent), this.element.addEventListener("canplay", this.onEvent), this.element.addEventListener("loadeddata", this.onEvent), this.element.addEventListener("loadedmetadata", this.onEvent), this.element.addEventListener("canplaythrough", this.onEvent), this.element.addEventListener("waiting", this.onEvent), this.element.addEventListener("playing", this.onPlayPause), this.element.addEventListener("pause", this.onPlayPause), this.element.addEventListener("seeked", this.onSeekEnd), this.element.addEventListener("seeking", this.onSeekStart), this.element.addEventListener("volumechange", this.onVolumeChange), this.element.addEventListener("timeupdate", this.onBufferStateChange), this.element.addEventListener("progress", this.onBufferStateChange);
3222
3228
  }
3223
3229
  get seekTime() {
3224
- return this.seekTimes.isEmpty() ? 0 : Hn(this.seekTimes.items());
3230
+ return this.seekTimes.isEmpty() ? 0 : Qn(this.seekTimes.items());
3225
3231
  }
3226
3232
  get isSeeking() {
3227
3233
  return this.element.seeking;
@@ -3411,9 +3417,9 @@ const Jp = (s) => {
3411
3417
  recentDowngrades: c,
3412
3418
  timeSpentPlayingInAtLeastLevelRatio: d
3413
3419
  }), !1;
3414
- const g = Math.max(0, n.length - i.length - p), w = Date.now() - this.config.maxDowngradeLookbackMs * g, b = n.filter(Qc(w)).length;
3415
- return b && g > this.config.maxCooldownRatio ? (this.logger.debug("Too many downgrades compared to time spent playing", {
3416
- downgradesWithinCooldownTime: b,
3420
+ const g = Math.max(0, n.length - i.length - p), w = Date.now() - this.config.maxDowngradeLookbackMs * g, y = n.filter(Qc(w)).length;
3421
+ return y && g > this.config.maxCooldownRatio ? (this.logger.debug("Too many downgrades compared to time spent playing", {
3422
+ downgradesWithinCooldownTime: y,
3417
3423
  cooldownRatio: g
3418
3424
  }), !1) : !0;
3419
3425
  });
@@ -3423,8 +3429,8 @@ const Jp = (s) => {
3423
3429
  const { bufferFullness: t, general: i } = this.qualityOfServiceSource.getMetrics(), n = this.qualityOfServiceSource.getBufferFullnessRegression();
3424
3430
  if (!n)
3425
3431
  return;
3426
- const o = 10 * 1e3, { slope: c } = n, h = n.predict(Xc), d = c < 0, f = n.predict(Xc) < Md && n.slope < 0, p = n.predict(Xc) > sg, g = this.qualityOfServiceSource.timeSpentBufferingLast(30 * 1e3), w = this.qualityOfServiceSource.timeSpentActiveLast(30 * 1e3), b = g / w;
3427
- if (t < 0.15 && b > 0.8) {
3432
+ const o = 10 * 1e3, { slope: c } = n, h = n.predict(Xc), d = c < 0, f = n.predict(Xc) < Md && n.slope < 0, p = n.predict(Xc) > sg, g = this.qualityOfServiceSource.timeSpentBufferingLast(30 * 1e3), w = this.qualityOfServiceSource.timeSpentActiveLast(30 * 1e3), y = g / w;
3433
+ if (t < 0.15 && y > 0.8) {
3428
3434
  this.adaptLevel("reconnect");
3429
3435
  return;
3430
3436
  }
@@ -3511,7 +3517,7 @@ const rg = {
3511
3517
  r(zt, "BUFFER_TIME_STEP_SIZE", 500), r(zt, "BUFFER_TIME_MAX_STEPS", 3), r(zt, "create", (e, t, i, n, o = {}) => new zt(e, t, i, n, o));
3512
3518
  let fh = zt;
3513
3519
  var Co = /* @__PURE__ */ ((s) => (s[s.StreamHeaderGroup = 4] = "StreamHeaderGroup", s[s.FetchHeader = 5] = "FetchHeader", s[s.StreamHeaderTrack = 60] = "StreamHeaderTrack", s))(Co || {});
3514
- const Ie = {
3520
+ const Ce = {
3515
3521
  Normal: 0,
3516
3522
  ObjectDoesNotExist: 1,
3517
3523
  GroupDoesNotExist: 2,
@@ -3520,49 +3526,49 @@ const Ie = {
3520
3526
  };
3521
3527
  function Wu(s) {
3522
3528
  switch (s) {
3523
- case Ie.Normal:
3524
- case Ie.ObjectDoesNotExist:
3525
- case Ie.GroupDoesNotExist:
3526
- case Ie.EndOfGroup:
3527
- case Ie.EndOfTrackAndGroup:
3529
+ case Ce.Normal:
3530
+ case Ce.ObjectDoesNotExist:
3531
+ case Ce.GroupDoesNotExist:
3532
+ case Ce.EndOfGroup:
3533
+ case Ce.EndOfTrackAndGroup:
3528
3534
  return;
3529
3535
  }
3530
3536
  throw new Error("Unknown object status " + s);
3531
3537
  }
3532
- var ut, Xs, Qs, Vr, Gr, Zs, jr, Wr;
3538
+ var ut, Zs, qs, Vr, Gr, $s, jr, Wr;
3533
3539
  class ag {
3534
3540
  constructor(e, t, i, n, o, c) {
3535
3541
  u(this, ut);
3536
- u(this, Xs);
3537
- u(this, Qs);
3542
+ u(this, Zs);
3543
+ u(this, qs);
3538
3544
  u(this, Vr);
3539
3545
  u(this, Gr);
3540
- u(this, Zs, new W());
3546
+ u(this, $s, new W());
3541
3547
  u(this, jr, 0);
3542
3548
  u(this, Wr);
3543
- l(this, ut, e), l(this, Xs, t), l(this, Qs, i), l(this, Vr, n), l(this, Gr, o), l(this, Wr, c);
3549
+ l(this, ut, e), l(this, Zs, t), l(this, qs, i), l(this, Vr, n), l(this, Gr, o), l(this, Wr, c);
3544
3550
  }
3545
3551
  endStatus() {
3546
- return a(this, Zs).promise;
3552
+ return a(this, $s).promise;
3547
3553
  }
3548
3554
  groupId() {
3549
- return a(this, Xs);
3555
+ return a(this, Zs);
3550
3556
  }
3551
3557
  subscribeId() {
3552
- return a(this, Qs);
3558
+ return a(this, qs);
3553
3559
  }
3554
3560
  next() {
3555
3561
  return m(this, null, function* () {
3556
- if (!a(this, Zs).pending)
3562
+ if (!a(this, $s).pending)
3557
3563
  return { done: !0, value: void 0 };
3558
3564
  if (yield a(this, ut).isDone())
3559
3565
  return { done: !0, value: void 0 };
3560
- const e = a(this, jr) === 0 ? a(this, Xs) : yield a(this, ut).readBigVarInt(), t = yield a(this, ut).readBigVarInt(), i = yield a(this, ut).readVarInt();
3566
+ const e = a(this, jr) === 0 ? a(this, Zs) : yield a(this, ut).readBigVarInt(), t = yield a(this, ut).readBigVarInt(), i = yield a(this, ut).readVarInt();
3561
3567
  let n = 0, o = new Uint8Array();
3562
- return i > 0 ? o = yield a(this, ut).read(i) : n = yield a(this, ut).readVarInt(), Wu(n), (n === Ie.EndOfTrackAndGroup || n === Ie.EndOfGroup) && a(this, Zs).resolve(n), vi(this, jr)._++, {
3568
+ return i > 0 ? o = yield a(this, ut).read(i) : n = yield a(this, ut).readVarInt(), Wu(n), (n === Ce.EndOfTrackAndGroup || n === Ce.EndOfGroup) && a(this, $s).resolve(n), vi(this, jr)._++, {
3563
3569
  done: !1,
3564
3570
  value: {
3565
- subscribeId: a(this, Qs),
3571
+ subscribeId: a(this, qs),
3566
3572
  trackAlias: a(this, Vr),
3567
3573
  groupId: e,
3568
3574
  subGroupId: B(0),
@@ -3592,29 +3598,29 @@ class ag {
3592
3598
  return Promise.resolve();
3593
3599
  }
3594
3600
  }
3595
- ut = new WeakMap(), Xs = new WeakMap(), Qs = new WeakMap(), Vr = new WeakMap(), Gr = new WeakMap(), Zs = new WeakMap(), jr = new WeakMap(), Wr = new WeakMap();
3596
- var lt, qs, zr, Hr, $s, ws, zu, ph;
3601
+ ut = new WeakMap(), Zs = new WeakMap(), qs = new WeakMap(), Vr = new WeakMap(), Gr = new WeakMap(), $s = new WeakMap(), jr = new WeakMap(), Wr = new WeakMap();
3602
+ var lt, Ys, zr, Hr, Js, ws, zu, ph;
3597
3603
  class og {
3598
3604
  constructor(e, t, i, n, o) {
3599
3605
  u(this, ws);
3600
3606
  u(this, lt);
3601
- u(this, qs);
3607
+ u(this, Ys);
3602
3608
  u(this, zr);
3603
3609
  u(this, Hr);
3604
- u(this, $s);
3605
- l(this, lt, e), l(this, qs, t), l(this, zr, i), l(this, Hr, n), l(this, $s, o);
3610
+ u(this, Js);
3611
+ l(this, lt, e), l(this, Ys, t), l(this, zr, i), l(this, Hr, n), l(this, Js, o);
3606
3612
  }
3607
3613
  /**
3608
3614
  * @returns The underlying stream id that provided this object group
3609
3615
  */
3610
3616
  streamId() {
3611
- return a(this, $s);
3617
+ return a(this, Js);
3612
3618
  }
3613
3619
  groups() {
3614
3620
  return A(this, ws, zu).call(this);
3615
3621
  }
3616
3622
  subscribeId() {
3617
- return a(this, qs);
3623
+ return a(this, Ys);
3618
3624
  }
3619
3625
  return() {
3620
3626
  return m(this, null, function* () {
@@ -3631,18 +3637,18 @@ class og {
3631
3637
  return A(this, ws, ph).call(this);
3632
3638
  }
3633
3639
  }
3634
- lt = new WeakMap(), qs = new WeakMap(), zr = new WeakMap(), Hr = new WeakMap(), $s = new WeakMap(), ws = new WeakSet(), zu = function() {
3640
+ lt = new WeakMap(), Ys = new WeakMap(), zr = new WeakMap(), Hr = new WeakMap(), Js = new WeakMap(), ws = new WeakSet(), zu = function() {
3635
3641
  return Ct(this, null, function* () {
3636
3642
  for (; !(yield new $(a(this, lt).isDone())); ) {
3637
3643
  const e = yield new $(a(this, lt).readBigVarInt()), t = new ag(
3638
3644
  a(this, lt),
3639
3645
  e,
3640
- a(this, qs),
3646
+ a(this, Ys),
3641
3647
  a(this, zr),
3642
3648
  a(this, Hr),
3643
- a(this, $s)
3649
+ a(this, Js)
3644
3650
  );
3645
- if (yield t, (yield new $(Promise.race([t.endStatus(), a(this, lt).closed()]))) === Ie.EndOfTrackAndGroup)
3651
+ if (yield t, (yield new $(Promise.race([t.endStatus(), a(this, lt).closed()]))) === Ce.EndOfTrackAndGroup)
3646
3652
  return;
3647
3653
  }
3648
3654
  });
@@ -3650,32 +3656,32 @@ lt = new WeakMap(), qs = new WeakMap(), zr = new WeakMap(), Hr = new WeakMap(),
3650
3656
  return a(this, lt).close().catch(() => {
3651
3657
  });
3652
3658
  };
3653
- var Ke, Ys, Xr, Js, Qr, Zr, qr, Ks, zo, bs, Hu, gh;
3659
+ var Ke, Ks, Xr, en, Qr, Zr, qr, tn, zo, bs, Hu, gh;
3654
3660
  class cg {
3655
3661
  constructor(e, t, i, n, o, c, h) {
3656
3662
  u(this, bs);
3657
3663
  u(this, Ke);
3658
- u(this, Ys);
3664
+ u(this, Ks);
3659
3665
  u(this, Xr);
3660
- u(this, Js);
3666
+ u(this, en);
3661
3667
  u(this, Qr);
3662
3668
  u(this, Zr);
3663
3669
  u(this, qr, !1);
3664
- u(this, Ks);
3665
- u(this, zo, pe.get().createContext("GroupReader"));
3666
- l(this, Ke, e), l(this, Ys, t), l(this, Xr, i), l(this, Js, n), l(this, Qr, o), l(this, Zr, c), l(this, Ks, h);
3670
+ u(this, tn);
3671
+ u(this, zo, ge.get().createContext("GroupReader"));
3672
+ l(this, Ke, e), l(this, Ks, t), l(this, Xr, i), l(this, en, n), l(this, Qr, o), l(this, Zr, c), l(this, tn, h);
3667
3673
  }
3668
3674
  /**
3669
3675
  * @returns The underlying stream id that provided this object group
3670
3676
  */
3671
3677
  streamId() {
3672
- return a(this, Ks);
3678
+ return a(this, tn);
3673
3679
  }
3674
3680
  groupId() {
3675
- return a(this, Js);
3681
+ return a(this, en);
3676
3682
  }
3677
3683
  subscribeId() {
3678
- return a(this, Ys);
3684
+ return a(this, Ks);
3679
3685
  }
3680
3686
  next() {
3681
3687
  return m(this, null, function* () {
@@ -3684,15 +3690,15 @@ class cg {
3684
3690
  return { done: !0, value: void 0 };
3685
3691
  const e = yield a(this, Ke).readBigVarInt(), t = yield a(this, Ke).readVarInt();
3686
3692
  let i = 0, n = new Uint8Array();
3687
- return t > 0 ? n = yield a(this, Ke).read(t) : i = yield a(this, Ke).readVarInt(), Wu(i), i === Ie.EndOfGroup && l(this, qr, !0), {
3693
+ return t > 0 ? n = yield a(this, Ke).read(t) : i = yield a(this, Ke).readVarInt(), Wu(i), i === Ce.EndOfGroup && l(this, qr, !0), {
3688
3694
  done: !1,
3689
3695
  value: {
3690
- subscribeId: a(this, Ys),
3696
+ subscribeId: a(this, Ks),
3691
3697
  trackAlias: a(this, Xr),
3692
- groupId: a(this, Js),
3698
+ groupId: a(this, en),
3693
3699
  subGroupId: a(this, Qr),
3694
3700
  subscriberPriority: a(this, Zr),
3695
- streamId: a(this, Ks),
3701
+ streamId: a(this, tn),
3696
3702
  objectId: e,
3697
3703
  objectStatus: i,
3698
3704
  payload: n
@@ -3722,7 +3728,7 @@ class cg {
3722
3728
  return A(this, bs, gh).call(this);
3723
3729
  }
3724
3730
  }
3725
- Ke = new WeakMap(), Ys = new WeakMap(), Xr = new WeakMap(), Js = new WeakMap(), Qr = new WeakMap(), Zr = new WeakMap(), qr = new WeakMap(), Ks = new WeakMap(), zo = new WeakMap(), bs = new WeakSet(), Hu = function() {
3731
+ Ke = new WeakMap(), Ks = new WeakMap(), Xr = new WeakMap(), en = new WeakMap(), Qr = new WeakMap(), Zr = new WeakMap(), qr = new WeakMap(), tn = new WeakMap(), zo = new WeakMap(), bs = new WeakSet(), Hu = function() {
3726
3732
  return Ct(this, null, function* () {
3727
3733
  yield this;
3728
3734
  });
@@ -3792,7 +3798,7 @@ class dg {
3792
3798
  }
3793
3799
  }
3794
3800
  mt = new WeakMap(), Fi = new WeakMap(), _i = new WeakMap(), Ni = new WeakMap();
3795
- var ft, Yr, Vi, pt, Ho, j, Kn, Ja, Ii, Ka, jt;
3801
+ var ft, Yr, Vi, pt, Ho, j, tr, Ja, Ii, Ka, jt;
3796
3802
  class ko {
3797
3803
  constructor(e, t) {
3798
3804
  u(this, j);
@@ -3861,12 +3867,12 @@ class ko {
3861
3867
  return m(this, null, function* () {
3862
3868
  for (; yield A(this, j, Ja).call(this); )
3863
3869
  ;
3864
- return A(this, j, jt).call(this, A(this, j, Kn).call(this));
3870
+ return A(this, j, jt).call(this, A(this, j, tr).call(this));
3865
3871
  });
3866
3872
  }
3867
3873
  isDone() {
3868
3874
  return m(this, null, function* () {
3869
- return A(this, j, Kn).call(this) > 0 ? !1 : (yield A(this, j, Ja).call(this)) == 0;
3875
+ return A(this, j, tr).call(this) > 0 ? !1 : (yield A(this, j, Ja).call(this)) == 0;
3870
3876
  });
3871
3877
  }
3872
3878
  closed() {
@@ -3880,14 +3886,14 @@ class ko {
3880
3886
  });
3881
3887
  }
3882
3888
  }
3883
- ft = new WeakMap(), Yr = new WeakMap(), Vi = new WeakMap(), pt = new WeakMap(), Ho = new WeakMap(), j = new WeakSet(), Kn = function() {
3889
+ ft = new WeakMap(), Yr = new WeakMap(), Vi = new WeakMap(), pt = new WeakMap(), Ho = new WeakMap(), j = new WeakSet(), tr = function() {
3884
3890
  return a(this, ft).length - a(this, pt);
3885
3891
  }, Ja = function() {
3886
3892
  return m(this, null, function* () {
3887
3893
  const { value: e, done: t } = yield a(this, Vi).read();
3888
3894
  if (t)
3889
3895
  return Promise.resolve(0);
3890
- if (A(this, j, Kn).call(this) === 0)
3896
+ if (A(this, j, tr).call(this) === 0)
3891
3897
  l(this, ft, e);
3892
3898
  else {
3893
3899
  const n = a(this, ft).subarray(a(this, pt)), o = new Uint8Array(n.length + e.length);
@@ -3897,7 +3903,7 @@ ft = new WeakMap(), Yr = new WeakMap(), Vi = new WeakMap(), pt = new WeakMap(),
3897
3903
  });
3898
3904
  }, Ii = function(e) {
3899
3905
  return m(this, null, function* () {
3900
- for (; A(this, j, Kn).call(this) < e; )
3906
+ for (; A(this, j, tr).call(this) < e; )
3901
3907
  if ((yield A(this, j, Ja).call(this)) === 0)
3902
3908
  throw new Error("Read failed");
3903
3909
  });
@@ -3907,14 +3913,14 @@ ft = new WeakMap(), Yr = new WeakMap(), Vi = new WeakMap(), pt = new WeakMap(),
3907
3913
  const t = A(this, j, Ka).call(this, e);
3908
3914
  return l(this, pt, a(this, pt) + t.length), t;
3909
3915
  };
3910
- var en, tn, Pt, Xo;
3916
+ var sn, nn, Pt, Xo;
3911
3917
  class Qu {
3912
3918
  constructor(e) {
3913
- u(this, en, new Uint8Array(8));
3914
- u(this, tn);
3919
+ u(this, sn, new Uint8Array(8));
3920
+ u(this, nn);
3915
3921
  u(this, Pt);
3916
3922
  u(this, Xo, new TextEncoder());
3917
- l(this, tn, e), l(this, Pt, a(this, tn).getWriter());
3923
+ l(this, nn, e), l(this, Pt, a(this, nn).getWriter());
3918
3924
  }
3919
3925
  writeString(e) {
3920
3926
  return m(this, null, function* () {
@@ -3926,13 +3932,13 @@ class Qu {
3926
3932
  return a(this, Pt).write(e);
3927
3933
  }
3928
3934
  writeUnsigned8(e) {
3929
- return a(this, Pt).write(Fc(e, a(this, en)));
3935
+ return a(this, Pt).write(Fc(e, a(this, sn)));
3930
3936
  }
3931
3937
  writeVarInt(e) {
3932
- return a(this, Pt).write(il(e, a(this, en)));
3938
+ return a(this, Pt).write(il(e, a(this, sn)));
3933
3939
  }
3934
3940
  writeBigVarInt(e) {
3935
- return a(this, Pt).write(sl(e, a(this, en)));
3941
+ return a(this, Pt).write(sl(e, a(this, sn)));
3936
3942
  }
3937
3943
  flush() {
3938
3944
  return m(this, null, function* () {
@@ -3940,19 +3946,19 @@ class Qu {
3940
3946
  }
3941
3947
  close() {
3942
3948
  return m(this, null, function* () {
3943
- a(this, Pt).releaseLock(), yield a(this, tn).close();
3949
+ a(this, Pt).releaseLock(), yield a(this, nn).close();
3944
3950
  });
3945
3951
  }
3946
3952
  }
3947
- en = new WeakMap(), tn = new WeakMap(), Pt = new WeakMap(), Xo = new WeakMap();
3953
+ sn = new WeakMap(), nn = new WeakMap(), Pt = new WeakMap(), Xo = new WeakMap();
3948
3954
  const Zu = {
3949
3955
  OPEN: 1
3950
3956
  };
3951
3957
  var Pe, Le, Gi, Qo;
3952
- const Sr = class Sr {
3958
+ const Tr = class Tr {
3953
3959
  constructor(e) {
3954
3960
  u(this, Pe, 0);
3955
- u(this, Le, new Uint8Array(Sr.DEFAULT_BUFFER_SIZE));
3961
+ u(this, Le, new Uint8Array(Tr.DEFAULT_BUFFER_SIZE));
3956
3962
  u(this, Gi);
3957
3963
  u(this, Qo, new TextEncoder());
3958
3964
  l(this, Gi, e);
@@ -3988,14 +3994,14 @@ const Sr = class Sr {
3988
3994
  flush() {
3989
3995
  if (a(this, Gi).readyState !== Zu.OPEN)
3990
3996
  throw new Error("Writer is not open");
3991
- return a(this, Gi).send(a(this, Le).subarray(0, a(this, Pe))), l(this, Pe, 0), l(this, Le, new Uint8Array(Sr.DEFAULT_BUFFER_SIZE)), Promise.resolve();
3997
+ return a(this, Gi).send(a(this, Le).subarray(0, a(this, Pe))), l(this, Pe, 0), l(this, Le, new Uint8Array(Tr.DEFAULT_BUFFER_SIZE)), Promise.resolve();
3992
3998
  }
3993
3999
  close() {
3994
4000
  return a(this, Gi).close(), Promise.resolve();
3995
4001
  }
3996
4002
  };
3997
- Pe = new WeakMap(), Le = new WeakMap(), Gi = new WeakMap(), Qo = new WeakMap(), r(Sr, "DEFAULT_BUFFER_SIZE", 1024);
3998
- let kr = Sr;
4003
+ Pe = new WeakMap(), Le = new WeakMap(), Gi = new WeakMap(), Qo = new WeakMap(), r(Tr, "DEFAULT_BUFFER_SIZE", 1024);
4004
+ let Rr = Tr;
3999
4005
  const qu = Math.pow(2, 6) - 1, $u = Math.pow(2, 14) - 1, Yu = Math.pow(2, 30) - 1, ug = Number.MAX_SAFE_INTEGER, lg = typeof BigInt == "function" ? B(2) ** B(62) - B(1) : B(Number.MAX_SAFE_INTEGER);
4000
4006
  function Fc(s, e) {
4001
4007
  return e[0] = s, e.subarray(0, 1);
@@ -4058,7 +4064,7 @@ function td(s, e) {
4058
4064
  });
4059
4065
  }
4060
4066
  const Bo = B(2);
4061
- function Xn(s) {
4067
+ function Zn(s) {
4062
4068
  return m(this, null, function* () {
4063
4069
  const e = yield s.readVarInt(), t = /* @__PURE__ */ new Map();
4064
4070
  for (let i = 0; i < e; i++) {
@@ -4068,7 +4074,7 @@ function Xn(s) {
4068
4074
  return t;
4069
4075
  });
4070
4076
  }
4071
- function Qn(s, e) {
4077
+ function qn(s, e) {
4072
4078
  return m(this, null, function* () {
4073
4079
  yield s.writeVarInt(e.size);
4074
4080
  for (const [t, i] of e)
@@ -4080,13 +4086,13 @@ function mg(s) {
4080
4086
  return {
4081
4087
  type: T.Announce,
4082
4088
  namespace: yield _c(s),
4083
- params: yield Xn(s)
4089
+ params: yield Zn(s)
4084
4090
  };
4085
4091
  });
4086
4092
  }
4087
4093
  function fg(s, e) {
4088
4094
  return m(this, null, function* () {
4089
- yield td(s, e.namespace), yield Qn(s, e.params);
4095
+ yield td(s, e.namespace), yield qn(s, e.params);
4090
4096
  });
4091
4097
  }
4092
4098
  function pg(s) {
@@ -4125,7 +4131,7 @@ function wg(s, e) {
4125
4131
  yield s.writeVarInt(e.supportedVersions.length);
4126
4132
  for (const t of e.supportedVersions)
4127
4133
  yield s.writeVarInt(t.value);
4128
- yield Qn(s, e.parameters);
4134
+ yield qn(s, e.parameters);
4129
4135
  });
4130
4136
  }
4131
4137
  function bg(s) {
@@ -4133,7 +4139,7 @@ function bg(s) {
4133
4139
  const e = [], t = yield s.readVarInt();
4134
4140
  for (let n = 0; n < t; n++)
4135
4141
  e.push(yield rl(s));
4136
- const i = yield Xn(s);
4142
+ const i = yield Zn(s);
4137
4143
  if (!i.has(Ro.Role))
4138
4144
  throw new Error("Role parameter is required");
4139
4145
  return {
@@ -4145,7 +4151,7 @@ function bg(s) {
4145
4151
  }
4146
4152
  function yg(s, e) {
4147
4153
  return m(this, null, function* () {
4148
- yield s.writeVarInt(e.selectedVersion.value), yield Qn(s, e.parameters);
4154
+ yield s.writeVarInt(e.selectedVersion.value), yield qn(s, e.parameters);
4149
4155
  });
4150
4156
  }
4151
4157
  function vg(s) {
@@ -4153,7 +4159,7 @@ function vg(s) {
4153
4159
  const e = yield rl(s);
4154
4160
  if (e.type !== "known")
4155
4161
  throw new Error("Expected known version");
4156
- const t = yield Xn(s);
4162
+ const t = yield Zn(s);
4157
4163
  if (!t.has(Ro.Role))
4158
4164
  throw new Error("Role parameter is required");
4159
4165
  return {
@@ -4252,7 +4258,7 @@ function ol(s, e) {
4252
4258
  }
4253
4259
  function Ig(s) {
4254
4260
  return m(this, null, function* () {
4255
- const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield _c(s), n = yield s.readString(), o = yield s.readUnsigned8(), c = yield al(s), h = yield Eg(s), d = yield Xn(s);
4261
+ const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield _c(s), n = yield s.readString(), o = yield s.readUnsigned8(), c = yield al(s), h = yield Eg(s), d = yield Zn(s);
4256
4262
  if (h.type === "absolute-range") {
4257
4263
  const f = h.start.group > h.end.group, p = h.start.group === h.end.group && h.start.object > h.end.object;
4258
4264
  if (f || p)
@@ -4273,7 +4279,7 @@ function Ig(s) {
4273
4279
  }
4274
4280
  function Cg(s, e) {
4275
4281
  return m(this, null, function* () {
4276
- yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.trackAlias), yield td(s, e.namespace), yield s.writeString(e.name), yield s.writeUnsigned8(e.subscriberPriority), yield ol(s, e.groupOrder), yield Tg(s, e.filterType), yield Qn(s, e.params);
4282
+ yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.trackAlias), yield td(s, e.namespace), yield s.writeString(e.name), yield s.writeUnsigned8(e.subscriberPriority), yield ol(s, e.groupOrder), yield Tg(s, e.filterType), yield qn(s, e.params);
4277
4283
  });
4278
4284
  }
4279
4285
  const Ah = {
@@ -4327,7 +4333,7 @@ function Pg(s) {
4327
4333
  group: yield s.readBigVarInt(),
4328
4334
  object: yield s.readBigVarInt()
4329
4335
  });
4330
- const c = yield Xn(s);
4336
+ const c = yield Zn(s);
4331
4337
  return {
4332
4338
  type: T.SubscribeOk,
4333
4339
  id: e,
@@ -4340,12 +4346,12 @@ function Pg(s) {
4340
4346
  }
4341
4347
  function xg(s, e) {
4342
4348
  return m(this, null, function* () {
4343
- yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.expires), yield ol(s, e.groupOrder), yield s.writeUnsigned8(e.largestInfo ? 1 : 0), e.largestInfo && (yield s.writeBigVarInt(e.largestInfo.group), yield s.writeBigVarInt(e.largestInfo.object)), yield Qn(s, e.params);
4349
+ yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.expires), yield ol(s, e.groupOrder), yield s.writeUnsigned8(e.largestInfo ? 1 : 0), e.largestInfo && (yield s.writeBigVarInt(e.largestInfo.group), yield s.writeBigVarInt(e.largestInfo.object)), yield qn(s, e.params);
4344
4350
  });
4345
4351
  }
4346
4352
  function Lg(s) {
4347
4353
  return m(this, null, function* () {
4348
- const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield s.readBigVarInt(), n = yield s.readBigVarInt(), o = yield s.readBigVarInt(), c = yield s.readUnsigned8(), h = yield Xn(s), d = t > n, f = t === n && i > o;
4354
+ const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield s.readBigVarInt(), n = yield s.readBigVarInt(), o = yield s.readBigVarInt(), c = yield s.readUnsigned8(), h = yield Zn(s), d = t > n, f = t === n && i > o;
4349
4355
  if (d || f)
4350
4356
  throw new Error("Invalid filter range");
4351
4357
  return {
@@ -4360,7 +4366,7 @@ function Lg(s) {
4360
4366
  }
4361
4367
  function Dg(s, e) {
4362
4368
  return m(this, null, function* () {
4363
- yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.start.group), yield s.writeBigVarInt(e.start.object), yield s.writeBigVarInt(e.end.group), yield s.writeBigVarInt(e.end.object), yield s.writeUnsigned8(e.subscriberPriority), yield Qn(s, e.params);
4369
+ yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.start.group), yield s.writeBigVarInt(e.start.object), yield s.writeBigVarInt(e.end.group), yield s.writeBigVarInt(e.end.object), yield s.writeUnsigned8(e.subscriberPriority), yield qn(s, e.params);
4364
4370
  });
4365
4371
  }
4366
4372
  function Og(s) {
@@ -4376,25 +4382,25 @@ function Mg(s, e) {
4376
4382
  yield s.writeBigVarInt(e.id);
4377
4383
  });
4378
4384
  }
4379
- var xt, sn, ee, hl, dl, ul, ll, ml, fl, pl, gl, Al, wl;
4385
+ var xt, rn, ee, hl, dl, ul, ll, ml, fl, pl, gl, Al, wl;
4380
4386
  class cl {
4381
4387
  constructor(e) {
4382
4388
  u(this, ee);
4383
4389
  u(this, xt);
4384
4390
  // Temporary buffer that holds the message before it is written to the stream
4385
4391
  // This way we can calculate the byte length of the message before writing it
4386
- u(this, sn, new Uint8Array());
4392
+ u(this, rn, new Uint8Array());
4387
4393
  l(this, xt, e);
4388
4394
  }
4389
4395
  write(e) {
4390
4396
  return m(this, null, function* () {
4391
4397
  yield a(this, xt).writeVarInt(e.type);
4392
- const t = new kr({
4398
+ const t = new Rr({
4393
4399
  close: () => {
4394
4400
  },
4395
4401
  readyState: Zu.OPEN,
4396
4402
  send: (i) => {
4397
- l(this, sn, new Uint8Array(i));
4403
+ l(this, rn, new Uint8Array(i));
4398
4404
  }
4399
4405
  });
4400
4406
  switch (e.type) {
@@ -4431,7 +4437,7 @@ class cl {
4431
4437
  default:
4432
4438
  throw new Error(`Unknown message type: ${e.type}`);
4433
4439
  }
4434
- yield t.flush(), yield a(this, xt).writeVarInt(a(this, sn).byteLength), yield a(this, xt).write(a(this, sn)), yield a(this, xt).flush();
4440
+ yield t.flush(), yield a(this, xt).writeVarInt(a(this, rn).byteLength), yield a(this, xt).write(a(this, rn)), yield a(this, xt).flush();
4435
4441
  });
4436
4442
  }
4437
4443
  close() {
@@ -4440,7 +4446,7 @@ class cl {
4440
4446
  });
4441
4447
  }
4442
4448
  }
4443
- xt = new WeakMap(), sn = new WeakMap(), ee = new WeakSet(), hl = function(e, t) {
4449
+ xt = new WeakMap(), rn = new WeakMap(), ee = new WeakSet(), hl = function(e, t) {
4444
4450
  return m(this, null, function* () {
4445
4451
  yield wg(e, t);
4446
4452
  });
@@ -4481,24 +4487,24 @@ xt = new WeakMap(), sn = new WeakMap(), ee = new WeakSet(), hl = function(e, t)
4481
4487
  yield gg(e, t);
4482
4488
  });
4483
4489
  };
4484
- var nn, Jr, Kr;
4490
+ var an, Jr, Kr;
4485
4491
  class Fg {
4486
4492
  constructor(e, t) {
4487
- u(this, nn);
4493
+ u(this, an);
4488
4494
  u(this, Jr);
4489
4495
  u(this, Kr);
4490
- l(this, nn, e), l(this, Jr, new cl(e)), l(this, Kr, t);
4496
+ l(this, an, e), l(this, Jr, new cl(e)), l(this, Kr, t);
4491
4497
  }
4492
4498
  write(e) {
4493
4499
  return m(this, null, function* () {
4494
- yield a(this, nn).write(a(this, Kr)), yield a(this, Jr).write(e);
4500
+ yield a(this, an).write(a(this, Kr)), yield a(this, Jr).write(e);
4495
4501
  });
4496
4502
  }
4497
4503
  close() {
4498
- return a(this, nn).close();
4504
+ return a(this, an).close();
4499
4505
  }
4500
4506
  }
4501
- nn = new WeakMap(), Jr = new WeakMap(), Kr = new WeakMap();
4507
+ an = new WeakMap(), Jr = new WeakMap(), Kr = new WeakMap();
4502
4508
  function _g(s) {
4503
4509
  return m(this, null, function* () {
4504
4510
  return {
@@ -4559,15 +4565,15 @@ class Fd {
4559
4565
  }
4560
4566
  }
4561
4567
  ae = new WeakMap();
4562
- var ea, rn, an, ta, Zo, bl, qo;
4568
+ var ea, on, cn, ta, Zo, bl, qo;
4563
4569
  const Ds = class Ds {
4564
4570
  constructor(e, t) {
4565
4571
  u(this, Zo);
4566
4572
  u(this, ea);
4567
- u(this, rn);
4568
- u(this, an, new W());
4573
+ u(this, on);
4574
+ u(this, cn, new W());
4569
4575
  u(this, ta, new W());
4570
- l(this, ea, e), l(this, rn, t), a(this, an).resolve();
4576
+ l(this, ea, e), l(this, on, t), a(this, cn).resolve();
4571
4577
  }
4572
4578
  write(e) {
4573
4579
  return m(this, null, function* () {
@@ -4588,16 +4594,16 @@ const Ds = class Ds {
4588
4594
  // Not "thread" safe (:
4589
4595
  read() {
4590
4596
  return m(this, null, function* () {
4591
- return a(this, rn).read();
4597
+ return a(this, on).read();
4592
4598
  });
4593
4599
  }
4594
4600
  cancel() {
4595
- return a(this, rn).cancel();
4601
+ return a(this, on).cancel();
4596
4602
  }
4597
4603
  static wrapWebsocket(e) {
4598
4604
  const t = new ReadableStream(
4599
4605
  new hg(e, a(Ds, qo))
4600
- ), i = new Fd(new ko(new Uint8Array([]), t)), n = new Fg(new kr(e), new Uint8Array([0]));
4606
+ ), i = new Fd(new ko(new Uint8Array([]), t)), n = new Fg(new Rr(e), new Uint8Array([0]));
4601
4607
  return new Ds(n, i);
4602
4608
  }
4603
4609
  static wrapWebTransport(e) {
@@ -4608,9 +4614,9 @@ const Ds = class Ds {
4608
4614
  );
4609
4615
  }
4610
4616
  };
4611
- ea = new WeakMap(), rn = new WeakMap(), an = new WeakMap(), ta = new WeakMap(), Zo = new WeakSet(), bl = function() {
4612
- const e = new W(), t = a(this, an).promise.then(() => e);
4613
- return l(this, an, e), t;
4617
+ ea = new WeakMap(), on = new WeakMap(), cn = new WeakMap(), ta = new WeakMap(), Zo = new WeakSet(), bl = function() {
4618
+ const e = new W(), t = a(this, cn).promise.then(() => e);
4619
+ return l(this, cn, e), t;
4614
4620
  }, qo = new WeakMap(), u(Ds, qo, 0);
4615
4621
  let Uo = Ds;
4616
4622
  function yl(s, e) {
@@ -4627,25 +4633,25 @@ function yl(s, e) {
4627
4633
  throw new Error("Expected known version");
4628
4634
  });
4629
4635
  }
4630
- var on;
4636
+ var hn;
4631
4637
  class Vg {
4632
4638
  constructor(e) {
4633
4639
  r(this, "announce");
4634
- u(this, on, new W());
4640
+ u(this, hn, new W());
4635
4641
  this.announce = e;
4636
4642
  }
4637
4643
  onOk(e) {
4638
- a(this, on).resolve(e);
4644
+ a(this, hn).resolve(e);
4639
4645
  }
4640
4646
  onError(e) {
4641
4647
  const t = new Error(e.reason);
4642
- return a(this, on).reject(t), t;
4648
+ return a(this, hn).reject(t), t;
4643
4649
  }
4644
4650
  ok() {
4645
- return a(this, on).promise;
4651
+ return a(this, hn).promise;
4646
4652
  }
4647
4653
  }
4648
- on = new WeakMap();
4654
+ hn = new WeakMap();
4649
4655
  function Gg(s) {
4650
4656
  const e = new Vg(s);
4651
4657
  return new jg(e);
@@ -4656,11 +4662,11 @@ class jg {
4656
4662
  this.state = e;
4657
4663
  }
4658
4664
  }
4659
- var cn, Jt, ji, $o, Wi, et;
4665
+ var dn, Jt, ji, $o, Wi, et;
4660
4666
  const Os = class Os {
4661
4667
  constructor(e) {
4662
4668
  r(this, "subscribe");
4663
- u(this, cn, new W());
4669
+ u(this, dn, new W());
4664
4670
  u(this, Jt, new W());
4665
4671
  u(this, ji, new W());
4666
4672
  u(this, $o, Date.now());
@@ -4680,7 +4686,7 @@ const Os = class Os {
4680
4686
  }
4681
4687
  onError(e) {
4682
4688
  const t = new Error(e.reason);
4683
- return a(this, cn).reject(t), a(this, Jt).reject(t), t;
4689
+ return a(this, dn).reject(t), a(this, Jt).reject(t), t;
4684
4690
  }
4685
4691
  onDone(e) {
4686
4692
  e.finalInfo && (a(this, et) || l(this, et, { startGroup: B(0) }), a(this, et).endGroup = e.finalInfo.group), a(this, Jt).resolve(e);
@@ -4694,13 +4700,13 @@ const Os = class Os {
4694
4700
  const n = Math.max(Os.minGraceTime, Math.min(i / 10, Os.maxGraceTime));
4695
4701
  Promise.race([ps(i - n - t), this.done().catch(L)]).then(() => a(this, Wi).resolve(this.expiryState())).catch(L);
4696
4702
  }
4697
- a(this, cn).resolve(e);
4703
+ a(this, dn).resolve(e);
4698
4704
  }
4699
4705
  done() {
4700
4706
  return a(this, Jt).promise;
4701
4707
  }
4702
4708
  ok() {
4703
- return a(this, cn).promise;
4709
+ return a(this, dn).promise;
4704
4710
  }
4705
4711
  range() {
4706
4712
  return a(this, et);
@@ -4726,28 +4732,28 @@ const Os = class Os {
4726
4732
  return a(this, Wi).promise;
4727
4733
  }
4728
4734
  };
4729
- cn = new WeakMap(), Jt = new WeakMap(), ji = new WeakMap(), $o = new WeakMap(), Wi = new WeakMap(), et = new WeakMap(), r(Os, "maxGraceTime", 15e3), r(Os, "minGraceTime", 3e3);
4735
+ dn = new WeakMap(), Jt = new WeakMap(), ji = new WeakMap(), $o = new WeakMap(), Wi = new WeakMap(), et = new WeakMap(), r(Os, "maxGraceTime", 15e3), r(Os, "minGraceTime", 3e3);
4730
4736
  let Po = Os;
4731
- var Ae, ia;
4737
+ var we, ia;
4732
4738
  class Wg {
4733
4739
  constructor(e) {
4734
- u(this, Ae);
4740
+ u(this, we);
4735
4741
  u(this, ia, !1);
4736
- l(this, Ae, e);
4742
+ l(this, we, e);
4737
4743
  }
4738
4744
  write(e) {
4739
4745
  return m(this, null, function* () {
4740
- a(this, ia) || (yield a(this, Ae).writeVarInt(Co.StreamHeaderGroup), yield a(this, Ae).writeBigVarInt(e.subscribeId), yield a(this, Ae).writeBigVarInt(e.trackAlias), yield a(this, Ae).writeBigVarInt(e.groupId), yield a(this, Ae).writeBigVarInt(e.subGroupId), yield a(this, Ae).writeUnsigned8(e.subscriberPriority), l(this, ia, !0)), yield a(this, Ae).writeBigVarInt(e.objectId), yield a(this, Ae).writeVarInt(e.payload.length), e.payload.length > 0 ? yield a(this, Ae).write(e.payload) : yield a(this, Ae).writeVarInt(e.objectStatus), yield a(this, Ae).flush();
4746
+ a(this, ia) || (yield a(this, we).writeVarInt(Co.StreamHeaderGroup), yield a(this, we).writeBigVarInt(e.subscribeId), yield a(this, we).writeBigVarInt(e.trackAlias), yield a(this, we).writeBigVarInt(e.groupId), yield a(this, we).writeBigVarInt(e.subGroupId), yield a(this, we).writeUnsigned8(e.subscriberPriority), l(this, ia, !0)), yield a(this, we).writeBigVarInt(e.objectId), yield a(this, we).writeVarInt(e.payload.length), e.payload.length > 0 ? yield a(this, we).write(e.payload) : yield a(this, we).writeVarInt(e.objectStatus), yield a(this, we).flush();
4741
4747
  });
4742
4748
  }
4743
4749
  close() {
4744
4750
  return m(this, null, function* () {
4745
- yield a(this, Ae).close();
4751
+ yield a(this, we).close();
4746
4752
  });
4747
4753
  }
4748
4754
  }
4749
- Ae = new WeakMap(), ia = new WeakMap();
4750
- var sa, je, na, ra, hn, aa, Yo, vl;
4755
+ we = new WeakMap(), ia = new WeakMap();
4756
+ var sa, je, na, ra, un, aa, Yo, vl;
4751
4757
  class zg {
4752
4758
  constructor(e, t, i, n) {
4753
4759
  u(this, Yo);
@@ -4755,12 +4761,12 @@ class zg {
4755
4761
  u(this, je);
4756
4762
  u(this, na);
4757
4763
  u(this, ra);
4758
- u(this, hn);
4764
+ u(this, un);
4759
4765
  u(this, aa);
4760
- l(this, sa, t), l(this, je, e), l(this, na, i), l(this, ra, n), l(this, aa, pe.get().createContext(`SubscriptionWriter:${e.subscribe.name}`));
4766
+ l(this, sa, t), l(this, je, e), l(this, na, i), l(this, ra, n), l(this, aa, ge.get().createContext(`SubscriptionWriter:${e.subscribe.name}`));
4761
4767
  }
4762
4768
  finalInfo() {
4763
- return a(this, hn);
4769
+ return a(this, un);
4764
4770
  }
4765
4771
  run() {
4766
4772
  return m(this, null, function* () {
@@ -4781,7 +4787,7 @@ class zg {
4781
4787
  id: a(this, je).subscribe.id,
4782
4788
  errorCode: e,
4783
4789
  reason: t,
4784
- finalInfo: a(this, hn)
4790
+ finalInfo: a(this, un)
4785
4791
  };
4786
4792
  a(this, je).onDone(i), yield a(this, ra).push(i);
4787
4793
  });
@@ -4793,7 +4799,7 @@ class zg {
4793
4799
  return this.done(Ah.TrackEnded, "Track ended");
4794
4800
  }
4795
4801
  }
4796
- sa = new WeakMap(), je = new WeakMap(), na = new WeakMap(), ra = new WeakMap(), hn = new WeakMap(), aa = new WeakMap(), Yo = new WeakSet(), vl = function() {
4802
+ sa = new WeakMap(), je = new WeakMap(), na = new WeakMap(), ra = new WeakMap(), un = new WeakMap(), aa = new WeakMap(), Yo = new WeakSet(), vl = function() {
4797
4803
  return m(this, null, function* () {
4798
4804
  try {
4799
4805
  for (var c = J(a(this, sa)), h, d, f; h = !(d = yield c.next()).done; h = !1) {
@@ -4804,10 +4810,10 @@ sa = new WeakMap(), je = new WeakMap(), na = new WeakMap(), ra = new WeakMap(),
4804
4810
  if (g && (g.startGroup > p.id || g.endGroup && g.endGroup < p.id))
4805
4811
  break;
4806
4812
  const w = yield a(this, na).openSendStream();
4807
- const b = new Wg(w);
4808
- const S = _e(e, new Hg(b, p.consume(), a(this, je)), !0);
4813
+ const y = new Wg(w);
4814
+ const S = _e(e, new Hg(y, p.consume(), a(this, je)), !0);
4809
4815
  yield S.run();
4810
- l(this, hn, S.finalGroup());
4816
+ l(this, un, S.finalGroup());
4811
4817
  } catch (t) {
4812
4818
  var i = t, n = !0;
4813
4819
  } finally {
@@ -4827,28 +4833,28 @@ sa = new WeakMap(), je = new WeakMap(), na = new WeakMap(), ra = new WeakMap(),
4827
4833
  }
4828
4834
  });
4829
4835
  };
4830
- var zi, oa, dn, ca, un;
4836
+ var zi, oa, ln, ca, mn;
4831
4837
  class Hg {
4832
4838
  constructor(e, t, i) {
4833
4839
  u(this, zi);
4834
4840
  u(this, oa);
4835
- u(this, dn);
4841
+ u(this, ln);
4836
4842
  u(this, ca);
4837
- u(this, un);
4838
- l(this, zi, e), l(this, oa, t), l(this, dn, i), l(this, un, pe.get().createContext(`GroupSubscriptionWriter:${i.subscribe.name}`));
4843
+ u(this, mn);
4844
+ l(this, zi, e), l(this, oa, t), l(this, ln, i), l(this, mn, ge.get().createContext(`GroupSubscriptionWriter:${i.subscribe.name}`));
4839
4845
  }
4840
4846
  finalGroup() {
4841
4847
  return a(this, ca);
4842
4848
  }
4843
4849
  run() {
4844
4850
  return m(this, null, function* () {
4845
- a(this, un).debug("write group");
4851
+ a(this, mn).debug("write group");
4846
4852
  try {
4847
4853
  for (var e = J(a(this, oa)), t, i, n; t = !(i = yield e.next()).done; t = !1) {
4848
4854
  const o = i.value;
4849
4855
  yield a(this, zi).write({
4850
- subscribeId: a(this, dn).subscribe.id,
4851
- trackAlias: a(this, dn).subscribe.trackAlias,
4856
+ subscribeId: a(this, ln).subscribe.id,
4857
+ trackAlias: a(this, ln).subscribe.trackAlias,
4852
4858
  subGroupId: B(0),
4853
4859
  subscriberPriority: 0,
4854
4860
  groupId: o.groupId,
@@ -4867,7 +4873,7 @@ class Hg {
4867
4873
  throw n[0];
4868
4874
  }
4869
4875
  }
4870
- a(this, un).debug("write group done");
4876
+ a(this, mn).debug("write group done");
4871
4877
  });
4872
4878
  }
4873
4879
  [St()]() {
@@ -4877,7 +4883,7 @@ class Hg {
4877
4883
  return a(this, zi).close().catch(L);
4878
4884
  }
4879
4885
  }
4880
- zi = new WeakMap(), oa = new WeakMap(), dn = new WeakMap(), ca = new WeakMap(), un = new WeakMap();
4886
+ zi = new WeakMap(), oa = new WeakMap(), ln = new WeakMap(), ca = new WeakMap(), mn = new WeakMap();
4881
4887
  var ha, Hi, Kt, ks;
4882
4888
  class Xg {
4883
4889
  constructor(e, t, i) {
@@ -4938,32 +4944,32 @@ ha = new WeakMap(), Hi = new WeakMap(), Kt = new WeakSet(), ks = function(e, t)
4938
4944
  };
4939
4945
  return a(this, Hi).push(i);
4940
4946
  };
4941
- var eu, ln, da, mn, Xi, ei, ti, ii, th;
4947
+ var eu, fn, da, pn, Xi, ei, ti, ii, th;
4942
4948
  eu = [xe({ context: "Session", enter: "info", error: "error" })];
4943
4949
  class wh {
4944
4950
  constructor(e, t, i) {
4945
4951
  yi(th, 5, this);
4946
- u(this, ln);
4952
+ u(this, fn);
4947
4953
  u(this, da);
4948
- u(this, mn);
4949
- u(this, Xi, pe.get().createContext("Publisher"));
4950
- u(this, ei, new Ce(/* @__PURE__ */ new Map()));
4951
- u(this, ti, new Ce(/* @__PURE__ */ new Map()));
4954
+ u(this, pn);
4955
+ u(this, Xi, ge.get().createContext("Publisher"));
4956
+ u(this, ei, new ke(/* @__PURE__ */ new Map()));
4957
+ u(this, ti, new ke(/* @__PURE__ */ new Map()));
4952
4958
  u(this, ii, new xc(10));
4953
- l(this, ln, e), l(this, da, t), l(this, mn, i);
4959
+ l(this, fn, e), l(this, da, t), l(this, pn, i);
4954
4960
  }
4955
4961
  announce(e) {
4956
4962
  return m(this, null, function* () {
4957
4963
  if (a(this, ei).current().has(e.join("/")))
4958
4964
  throw new Error("Duplicate announcement");
4959
- const t = /* @__PURE__ */ new Map(), i = a(this, ln).authToken();
4965
+ const t = /* @__PURE__ */ new Map(), i = a(this, fn).authToken();
4960
4966
  i && t.set(Bo, { type: Bo, payload: new TextEncoder().encode(i) });
4961
4967
  const n = {
4962
4968
  type: T.Announce,
4963
4969
  namespace: e,
4964
4970
  params: t
4965
4971
  }, o = Gg(n);
4966
- if (a(this, ei).update((h) => h.set(n.namespace.join("/"), o)), yield a(this, mn).push(n), !(yield Promise.race([o.state.ok(), a(this, ln).closed()])))
4972
+ if (a(this, ei).update((h) => h.set(n.namespace.join("/"), o)), yield a(this, pn).push(n), !(yield Promise.race([o.state.ok(), a(this, fn).closed()])))
4967
4973
  throw new Error("Session closed");
4968
4974
  });
4969
4975
  }
@@ -4984,7 +4990,7 @@ class wh {
4984
4990
  yield i == null ? void 0 : i.timeout();
4985
4991
  }
4986
4992
  yield a(this, ii).push(
4987
- new Xg(t, a(this, da), a(this, mn))
4993
+ new Xg(t, a(this, da), a(this, pn))
4988
4994
  );
4989
4995
  }
4990
4996
  break;
@@ -5016,7 +5022,7 @@ class wh {
5016
5022
  });
5017
5023
  }
5018
5024
  }
5019
- th = bi(null), ln = new WeakMap(), da = new WeakMap(), mn = new WeakMap(), Xi = new WeakMap(), ei = new WeakMap(), ti = new WeakMap(), ii = new WeakMap(), ve(th, 1, "announce", eu, wh), Gt(th, wh);
5025
+ th = bi(null), fn = new WeakMap(), da = new WeakMap(), pn = new WeakMap(), Xi = new WeakMap(), ei = new WeakMap(), ti = new WeakMap(), ii = new WeakMap(), Se(th, 1, "announce", eu, wh), Gt(th, wh);
5020
5026
  function Qg(s, e) {
5021
5027
  const t = new Po(e), [i, n] = Jh(100), o = new Zg(t, i), c = new Sl(s, t, n);
5022
5028
  return [o, c];
@@ -5046,31 +5052,31 @@ class Zg {
5046
5052
  }
5047
5053
  }
5048
5054
  Qi = new WeakMap();
5049
- var tu, fn, de, pn, gn, ih, An, er;
5055
+ var tu, gn, ue, An, wn, ih, bn, ir;
5050
5056
  class Sl {
5051
5057
  constructor(e, t, i) {
5052
5058
  yi(ih, 5, this);
5059
+ u(this, bn);
5060
+ u(this, gn);
5061
+ u(this, ue);
5053
5062
  u(this, An);
5054
- u(this, fn);
5055
- u(this, de);
5056
- u(this, pn);
5057
- u(this, gn, new W());
5058
- l(this, fn, e), l(this, de, t), l(this, pn, i);
5063
+ u(this, wn, new W());
5064
+ l(this, gn, e), l(this, ue, t), l(this, An, i);
5059
5065
  }
5060
5066
  get id() {
5061
- return a(this, de).subscribe.id;
5067
+ return a(this, ue).subscribe.id;
5062
5068
  }
5063
5069
  get trackAlias() {
5064
- return a(this, de).subscribe.trackAlias;
5070
+ return a(this, ue).subscribe.trackAlias;
5065
5071
  }
5066
5072
  get name() {
5067
- return a(this, de).subscribe.name;
5073
+ return a(this, ue).subscribe.name;
5068
5074
  }
5069
5075
  range() {
5070
- return a(this, de).range();
5076
+ return a(this, ue).range();
5071
5077
  }
5072
5078
  expiryNotification() {
5073
- return a(this, de).expiryNotification();
5079
+ return a(this, ue).expiryNotification();
5074
5080
  }
5075
5081
  /**
5076
5082
  * Update the subscription range
@@ -5081,52 +5087,52 @@ class Sl {
5081
5087
  return m(this, null, function* () {
5082
5088
  const i = {
5083
5089
  type: T.SubscribeUpdate,
5084
- id: a(this, de).subscribe.id,
5090
+ id: a(this, ue).subscribe.id,
5085
5091
  start: { group: e, object: B(0) },
5086
5092
  end: { group: t + B(1), object: B(0) },
5087
5093
  params: /* @__PURE__ */ new Map(),
5088
5094
  subscriberPriority: 0
5089
5095
  };
5090
- a(this, de).onUpdate(i), yield a(this, fn).push(i);
5096
+ a(this, ue).onUpdate(i), yield a(this, gn).push(i);
5091
5097
  });
5092
5098
  }
5093
5099
  unsubscribe() {
5094
5100
  return m(this, null, function* () {
5095
- const e = { type: T.Unsubscribe, id: a(this, de).subscribe.id };
5096
- a(this, de).onUnsubscribe(e), yield a(this, fn).push(e);
5101
+ const e = { type: T.Unsubscribe, id: a(this, ue).subscribe.id };
5102
+ a(this, ue).onUnsubscribe(e), yield a(this, gn).push(e);
5097
5103
  });
5098
5104
  }
5099
5105
  /// Closes the object reader so any pending readData calls are resolved
5100
5106
  close() {
5101
5107
  var e, t;
5102
- return a(this, gn).resolve(), (t = (e = a(this, pn)).return) == null ? void 0 : t.call(e);
5108
+ return a(this, wn).resolve(), (t = (e = a(this, An)).return) == null ? void 0 : t.call(e);
5103
5109
  }
5104
5110
  /// Closed is resolved when the subscription has been fully consumed which means no more objects will be available
5105
5111
  closed() {
5106
- return a(this, gn).promise;
5112
+ return a(this, wn).promise;
5107
5113
  }
5108
5114
  /// Await this subscription to become done
5109
5115
  /// Done does not mean that the subscription is closed,
5110
5116
  /// it means that the server has confirmed our unsubscribe request
5111
5117
  done() {
5112
- return a(this, de).done();
5118
+ return a(this, ue).done();
5113
5119
  }
5114
5120
  expiryState() {
5115
- return a(this, de).expiryState();
5121
+ return a(this, ue).expiryState();
5116
5122
  }
5117
5123
  unsubscribed() {
5118
- return a(this, de).isUnsubscribed();
5124
+ return a(this, ue).isUnsubscribed();
5119
5125
  }
5120
5126
  return() {
5121
5127
  return m(this, null, function* () {
5122
- return a(this, gn).resolve(), yield this.unsubscribe(), { done: !0, value: void 0 };
5128
+ return a(this, wn).resolve(), yield this.unsubscribe(), { done: !0, value: void 0 };
5123
5129
  });
5124
5130
  }
5125
5131
  groups() {
5126
5132
  return Ct(this, null, function* () {
5127
5133
  var e, t;
5128
5134
  try {
5129
- for (var b = J(a(this, pn)), S, x, R; S = !(x = yield new $(b.next())).done; S = !1) {
5135
+ for (var y = J(a(this, An)), S, x, R; S = !(x = yield new $(y.next())).done; S = !1) {
5130
5136
  var h = x.value;
5131
5137
  var d = [];
5132
5138
  try {
@@ -5134,7 +5140,7 @@ class Sl {
5134
5140
  try {
5135
5141
  for (var i = J(D.groups()), n, o, c; n = !(o = yield new $(i.next())).done; n = !1) {
5136
5142
  const E = o.value;
5137
- const U = (e = a(this, de).range()) == null ? void 0 : e.startGroup, k = (t = a(this, de).range()) == null ? void 0 : t.endGroup;
5143
+ const U = (e = a(this, ue).range()) == null ? void 0 : e.startGroup, k = (t = a(this, ue).range()) == null ? void 0 : t.endGroup;
5138
5144
  if (U && E.groupId() < U)
5139
5145
  return { done: !0, value: void 0 };
5140
5146
  if (k && E.groupId() > k)
@@ -5162,7 +5168,7 @@ class Sl {
5162
5168
  R = [x];
5163
5169
  } finally {
5164
5170
  try {
5165
- S && (x = b.return) && (yield new $(x.call(b)));
5171
+ S && (x = y.return) && (yield new $(x.call(y)));
5166
5172
  } finally {
5167
5173
  if (R)
5168
5174
  throw R[0];
@@ -5210,17 +5216,17 @@ class Sl {
5210
5216
  });
5211
5217
  }
5212
5218
  [(tu = [xe({ context: "SubscriptionConsumer", enter: "info" })], St())]() {
5213
- return A(this, An, er).call(this);
5219
+ return A(this, bn, ir).call(this);
5214
5220
  }
5215
5221
  [Symbol.asyncDispose]() {
5216
- return A(this, An, er).call(this);
5222
+ return A(this, bn, ir).call(this);
5217
5223
  }
5218
5224
  }
5219
- ih = bi(null), fn = new WeakMap(), de = new WeakMap(), pn = new WeakMap(), gn = new WeakMap(), An = new WeakSet(), er = function() {
5225
+ ih = bi(null), gn = new WeakMap(), ue = new WeakMap(), An = new WeakMap(), wn = new WeakMap(), bn = new WeakSet(), ir = function() {
5220
5226
  return m(this, null, function* () {
5221
5227
  return yield this.close(), this.unsubscribe();
5222
5228
  });
5223
- }, er = ve(ih, 17, "#dispose", tu, An, er), Gt(ih, Sl);
5229
+ }, ir = Se(ih, 17, "#dispose", tu, bn, ir), Gt(ih, Sl);
5224
5230
  const qg = 2e3;
5225
5231
  var iu, su, nu, ru, Lt, De, Zi, qi, Is, vt, to, Bs;
5226
5232
  ru = [xe({ context: "Session", return: "debug" })], nu = [xe({ context: "Session", enter: "info", error: "error" })], su = [xe({ context: "Session", enter: "debug" })], iu = [xe({ context: "Session", enter: "debug" })];
@@ -5233,9 +5239,9 @@ class eo {
5233
5239
  // The next subscribe id
5234
5240
  r(this, "nextSubscribeId", B(0));
5235
5241
  // The active subscriptions
5236
- u(this, De, new Ce(/* @__PURE__ */ new Map()));
5242
+ u(this, De, new ke(/* @__PURE__ */ new Map()));
5237
5243
  u(this, Zi);
5238
- u(this, qi, pe.get().createContext("Subscriber"));
5244
+ u(this, qi, ge.get().createContext("Subscriber"));
5239
5245
  l(this, Lt, e), l(this, Zi, t), A(this, vt, to).call(this).catch(L);
5240
5246
  }
5241
5247
  subscribe(e, t) {
@@ -5332,8 +5338,8 @@ Is = bi(null), Lt = new WeakMap(), De = new WeakMap(), Zi = new WeakMap(), qi =
5332
5338
  });
5333
5339
  }, Bs = function(e) {
5334
5340
  a(this, De).isClosed() || a(this, De).update((t) => (t.delete(e), t));
5335
- }, to = ve(Is, 17, "#observeChanges", ru, vt, to), ve(Is, 1, "subscribe", nu, eo), ve(Is, 1, "close", su, eo), Bs = ve(Is, 17, "#deleteSubscription", iu, vt, Bs), Gt(Is, eo);
5336
- var au, ou, cu, hu, tt, ua, $i, wn, bn, ce, El, Tl, Cs, io, so, no, tr;
5341
+ }, to = Se(Is, 17, "#observeChanges", ru, vt, to), Se(Is, 1, "subscribe", nu, eo), Se(Is, 1, "close", su, eo), Bs = Se(Is, 17, "#deleteSubscription", iu, vt, Bs), Gt(Is, eo);
5342
+ var au, ou, cu, hu, tt, ua, $i, yn, vn, ce, El, Tl, Cs, io, so, no, sr;
5337
5343
  class id {
5338
5344
  constructor(e, t) {
5339
5345
  yi(Cs, 5, this);
@@ -5344,18 +5350,18 @@ class id {
5344
5350
  u(this, ua);
5345
5351
  // Outgoing messages
5346
5352
  u(this, $i);
5347
- u(this, wn, pe.get().createContext("Session"));
5353
+ u(this, yn, ge.get().createContext("Session"));
5348
5354
  r(this, "subscriber");
5349
5355
  r(this, "publisher");
5350
- u(this, bn);
5356
+ u(this, vn);
5351
5357
  const [i, n] = Jh(100);
5352
- l(this, tt, e), l(this, $i, n), this.subscriber = new eo(this, i), this.publisher = new wh(this, e, i), l(this, ua, A(this, ce, Tl).call(this)), l(this, bn, new Ce(t)), this.closed().then(() => this.close()).catch(L);
5358
+ l(this, tt, e), l(this, $i, n), this.subscriber = new eo(this, i), this.publisher = new wh(this, e, i), l(this, ua, A(this, ce, Tl).call(this)), l(this, vn, new ke(t)), this.closed().then(() => this.close()).catch(L);
5353
5359
  }
5354
5360
  updateAuthToken(e) {
5355
- a(this, bn).update(e);
5361
+ a(this, vn).update(e);
5356
5362
  }
5357
5363
  authToken() {
5358
- return a(this, bn).current();
5364
+ return a(this, vn).current();
5359
5365
  }
5360
5366
  transportType() {
5361
5367
  return a(this, tt).transportType();
@@ -5370,20 +5376,20 @@ class id {
5370
5376
  try {
5371
5377
  this.subscriber.close(), this.publisher.close(), a(this, $i).cancel("closing"), a(this, tt).close();
5372
5378
  } catch (e) {
5373
- a(this, wn).warn("Error closing session", e);
5379
+ a(this, yn).warn("Error closing session", e);
5374
5380
  }
5375
5381
  }
5376
5382
  [(hu = [xe({ context: "Session", return: "info", error: "error" })], cu = [xe({ context: "Session", return: "info", error: "error" })], ou = [xe({ context: "Session", return: "info", error: "error" })], au = [xe({ context: "Session", enter: "debug" })], yu())]() {
5377
- A(this, ce, tr).call(this);
5383
+ A(this, ce, sr).call(this);
5378
5384
  }
5379
5385
  [Symbol.dispose]() {
5380
- A(this, ce, tr).call(this);
5386
+ A(this, ce, sr).call(this);
5381
5387
  }
5382
5388
  }
5383
- Cs = bi(null), tt = new WeakMap(), ua = new WeakMap(), $i = new WeakMap(), wn = new WeakMap(), bn = new WeakMap(), ce = new WeakSet(), El = function(e) {
5389
+ Cs = bi(null), tt = new WeakMap(), ua = new WeakMap(), $i = new WeakMap(), yn = new WeakMap(), vn = new WeakMap(), ce = new WeakSet(), El = function(e) {
5384
5390
  return m(this, null, function* () {
5385
5391
  var t, i;
5386
- switch (a(this, wn).debug("received message", e), yield (t = this.subscriber) == null ? void 0 : t.onMessage(e), yield (i = this.publisher) == null ? void 0 : i.onMessage(e), e.type) {
5392
+ switch (a(this, yn).debug("received message", e), yield (t = this.subscriber) == null ? void 0 : t.onMessage(e), yield (i = this.publisher) == null ? void 0 : i.onMessage(e), e.type) {
5387
5393
  case T.Goaway:
5388
5394
  break;
5389
5395
  }
@@ -5398,7 +5404,7 @@ Cs = bi(null), tt = new WeakMap(), ua = new WeakMap(), $i = new WeakMap(), wn =
5398
5404
  try {
5399
5405
  for (var e = J(a(this, $i)), t, i, n; t = !(i = yield e.next()).done; t = !1) {
5400
5406
  const o = i.value;
5401
- a(this, wn).debug("sending message", o), yield a(this, tt).writeMessage(o);
5407
+ a(this, yn).debug("sending message", o), yield a(this, tt).writeMessage(o);
5402
5408
  }
5403
5409
  } catch (i) {
5404
5410
  n = [i];
@@ -5444,85 +5450,85 @@ Cs = bi(null), tt = new WeakMap(), ua = new WeakMap(), $i = new WeakMap(), wn =
5444
5450
  return t;
5445
5451
  }
5446
5452
  });
5447
- }, tr = function() {
5453
+ }, sr = function() {
5448
5454
  this.close();
5449
- }, io = ve(Cs, 17, "#runOutgoingMessages", hu, ce, io), so = ve(Cs, 17, "#runControl", cu, ce, so), no = ve(Cs, 17, "#runObjects", ou, ce, no), tr = ve(Cs, 17, "#dispose", au, ce, tr), Gt(Cs, id);
5455
+ }, io = Se(Cs, 17, "#runOutgoingMessages", hu, ce, io), so = Se(Cs, 17, "#runControl", cu, ce, so), no = Se(Cs, 17, "#runObjects", ou, ce, no), sr = Se(Cs, 17, "#dispose", au, ce, sr), Gt(Cs, id);
5450
5456
  const $g = 128;
5451
- var We, la, Yi, yn, ma, we, Ci, ki;
5457
+ var We, la, Yi, Sn, ma, be, Ci, ki;
5452
5458
  class Yg {
5453
5459
  constructor(e, t, i) {
5454
- u(this, we);
5460
+ u(this, be);
5455
5461
  u(this, We);
5456
5462
  u(this, la);
5457
5463
  u(this, Yi, !0);
5458
- u(this, yn, !1);
5464
+ u(this, Sn, !1);
5459
5465
  u(this, ma);
5460
5466
  l(this, We, e), l(this, la, t), l(this, ma, i);
5461
5467
  }
5462
5468
  writeUnsigned8(e) {
5463
5469
  return m(this, null, function* () {
5464
- return A(this, we, Ci).call(this), yield A(this, we, ki).call(this), a(this, We).writeUnsigned8(e);
5470
+ return A(this, be, Ci).call(this), yield A(this, be, ki).call(this), a(this, We).writeUnsigned8(e);
5465
5471
  });
5466
5472
  }
5467
5473
  writeVarInt(e) {
5468
5474
  return m(this, null, function* () {
5469
- return A(this, we, Ci).call(this), yield A(this, we, ki).call(this), a(this, We).writeVarInt(e);
5475
+ return A(this, be, Ci).call(this), yield A(this, be, ki).call(this), a(this, We).writeVarInt(e);
5470
5476
  });
5471
5477
  }
5472
5478
  writeBigVarInt(e) {
5473
5479
  return m(this, null, function* () {
5474
- return A(this, we, Ci).call(this), yield A(this, we, ki).call(this), a(this, We).writeBigVarInt(e);
5480
+ return A(this, be, Ci).call(this), yield A(this, be, ki).call(this), a(this, We).writeBigVarInt(e);
5475
5481
  });
5476
5482
  }
5477
5483
  write(e) {
5478
5484
  return m(this, null, function* () {
5479
- return A(this, we, Ci).call(this), yield A(this, we, ki).call(this), a(this, We).write(e);
5485
+ return A(this, be, Ci).call(this), yield A(this, be, ki).call(this), a(this, We).write(e);
5480
5486
  });
5481
5487
  }
5482
5488
  writeString(e) {
5483
5489
  return m(this, null, function* () {
5484
- return A(this, we, Ci).call(this), yield A(this, we, ki).call(this), a(this, We).writeString(e);
5490
+ return A(this, be, Ci).call(this), yield A(this, be, ki).call(this), a(this, We).writeString(e);
5485
5491
  });
5486
5492
  }
5487
5493
  flush() {
5488
5494
  return m(this, null, function* () {
5489
- A(this, we, Ci).call(this), l(this, Yi, !0), yield a(this, We).flush();
5495
+ A(this, be, Ci).call(this), l(this, Yi, !0), yield a(this, We).flush();
5490
5496
  });
5491
5497
  }
5492
5498
  close() {
5493
5499
  return m(this, null, function* () {
5494
- a(this, yn) || (l(this, Yi, !0), yield A(this, we, ki).call(this, !1), yield a(this, We).flush(), l(this, yn, !0), a(this, ma).call(this));
5500
+ a(this, Sn) || (l(this, Yi, !0), yield A(this, be, ki).call(this, !1), yield a(this, We).flush(), l(this, Sn, !0), a(this, ma).call(this));
5495
5501
  });
5496
5502
  }
5497
5503
  }
5498
- We = new WeakMap(), la = new WeakMap(), Yi = new WeakMap(), yn = new WeakMap(), ma = new WeakMap(), we = new WeakSet(), Ci = function() {
5499
- if (a(this, yn))
5504
+ We = new WeakMap(), la = new WeakMap(), Yi = new WeakMap(), Sn = new WeakMap(), ma = new WeakMap(), be = new WeakSet(), Ci = function() {
5505
+ if (a(this, Sn))
5500
5506
  throw new Error("Stream is closed");
5501
5507
  }, ki = function(e = !0) {
5502
5508
  if (a(this, Yi))
5503
5509
  return l(this, Yi, !1), a(this, We).writeUnsigned8(a(this, la) | (e ? $g : 0));
5504
5510
  };
5505
- var si, Dt, vn, Ji, Ot, Sn, En, Jo, Il;
5511
+ var si, Dt, En, Ji, Ot, Tn, In, Jo, Il;
5506
5512
  class Jg {
5507
5513
  constructor(e, t) {
5508
5514
  u(this, Jo);
5509
5515
  u(this, si);
5510
5516
  u(this, Dt);
5511
- u(this, vn);
5517
+ u(this, En);
5512
5518
  u(this, Ji);
5513
5519
  u(this, Ot, /* @__PURE__ */ new Map());
5514
- u(this, Sn, pe.get().createContext("WebSocketConnection"));
5515
- u(this, En, new Set(new Array(128).fill(0).map((e, t) => t + 1)));
5516
- l(this, si, e), l(this, Dt, t), l(this, vn, new ReadableStream(new dg(e))), a(this, si).addEventListener("close", () => {
5520
+ u(this, Tn, ge.get().createContext("WebSocketConnection"));
5521
+ u(this, In, new Set(new Array(128).fill(0).map((e, t) => t + 1)));
5522
+ l(this, si, e), l(this, Dt, t), l(this, En, new ReadableStream(new dg(e))), a(this, si).addEventListener("close", () => {
5517
5523
  a(this, Dt).markPostHandshake(), a(this, Ot).forEach((i) => i.close());
5518
5524
  });
5519
5525
  }
5520
5526
  openSendStream() {
5521
- const e = a(this, En).values().next().value;
5527
+ const e = a(this, In).values().next().value;
5522
5528
  if (!e)
5523
5529
  throw new Error("No stream IDs available");
5524
- return a(this, En).delete(e), Promise.resolve(
5525
- new Yg(new kr(a(this, si)), e, () => A(this, Jo, Il).call(this, e))
5530
+ return a(this, In).delete(e), Promise.resolve(
5531
+ new Yg(new Rr(a(this, si)), e, () => A(this, Jo, Il).call(this, e))
5526
5532
  );
5527
5533
  }
5528
5534
  transportType() {
@@ -5538,7 +5544,7 @@ class Jg {
5538
5544
  return m(this, null, function* () {
5539
5545
  var e;
5540
5546
  for (; ; ) {
5541
- l(this, Ji, a(this, vn).getReader());
5547
+ l(this, Ji, a(this, En).getReader());
5542
5548
  try {
5543
5549
  const { value: t, done: i } = yield a(this, Ji).read();
5544
5550
  if (i)
@@ -5548,10 +5554,10 @@ class Jg {
5548
5554
  const h = a(this, Ot).get(B(o));
5549
5555
  if (!h)
5550
5556
  throw new Error("Stream not found");
5551
- c.length > 0 && (yield h.push(c)), n || (a(this, Sn).debug("Closing stream", { streamId: o }), h.close(), a(this, Ot).delete(B(o)));
5557
+ c.length > 0 && (yield h.push(c)), n || (a(this, Tn).debug("Closing stream", { streamId: o }), h.close(), a(this, Ot).delete(B(o)));
5552
5558
  } else {
5553
5559
  let p;
5554
- a(this, Sn).debug("Creating new stream", { streamId: o });
5560
+ a(this, Tn).debug("Creating new stream", { streamId: o });
5555
5561
  const [h, d] = Jh(1e3), f = new ReadableStream({
5556
5562
  pull(g) {
5557
5563
  return m(this, null, function* () {
@@ -5560,7 +5566,7 @@ class Jg {
5560
5566
  });
5561
5567
  }
5562
5568
  });
5563
- if (a(this, Ot).set(B(o), h), n || (a(this, Sn).debug("Closing new stream", { streamId: o }), yield f.cancel(), a(this, Ot).delete(B(o))), c.length > 0)
5569
+ if (a(this, Ot).set(B(o), h), n || (a(this, Tn).debug("Closing new stream", { streamId: o }), yield f.cancel(), a(this, Ot).delete(B(o))), c.length > 0)
5564
5570
  return yield Xu(new ko(c, f), o);
5565
5571
  }
5566
5572
  } finally {
@@ -5571,7 +5577,7 @@ class Jg {
5571
5577
  }
5572
5578
  close() {
5573
5579
  var e;
5574
- return a(this, Dt).cancel().catch(L), a(this, vn).cancel("closing").catch(L), (e = a(this, Ji)) == null || e.cancel("closing").catch(L), a(this, si).close();
5580
+ return a(this, Dt).cancel().catch(L), a(this, En).cancel("closing").catch(L), (e = a(this, Ji)) == null || e.cancel("closing").catch(L), a(this, si).close();
5575
5581
  }
5576
5582
  closed() {
5577
5583
  return Promise.resolve();
@@ -5587,12 +5593,12 @@ class Jg {
5587
5593
  });
5588
5594
  }
5589
5595
  }
5590
- si = new WeakMap(), Dt = new WeakMap(), vn = new WeakMap(), Ji = new WeakMap(), Ot = new WeakMap(), Sn = new WeakMap(), En = new WeakMap(), Jo = new WeakSet(), /**
5596
+ si = new WeakMap(), Dt = new WeakMap(), En = new WeakMap(), Ji = new WeakMap(), Ot = new WeakMap(), Tn = new WeakMap(), In = new WeakMap(), Jo = new WeakSet(), /**
5591
5597
  * Return a stream ID to the pool of available stream IDs
5592
5598
  * @param streamId - The stream ID to return
5593
5599
  */
5594
5600
  Il = function(e) {
5595
- a(this, En).add(e);
5601
+ a(this, In).add(e);
5596
5602
  };
5597
5603
  var ni, ri, Ki, fa, pa, Ko, ec, Cl;
5598
5604
  class Kg {
@@ -5603,7 +5609,7 @@ class Kg {
5603
5609
  u(this, Ki, new xc(100));
5604
5610
  u(this, fa);
5605
5611
  u(this, pa, 0);
5606
- u(this, Ko, pe.get().createContext("WebTransportConnection"));
5612
+ u(this, Ko, ge.get().createContext("WebTransportConnection"));
5607
5613
  l(this, fa, i), l(this, ni, e), l(this, ri, t), A(this, ec, Cl).call(this).catch((n) => {
5608
5614
  a(this, Ko).debug("Incoming streams handling ended with error", n), a(this, ri).markPostHandshake(), a(this, Ki).close();
5609
5615
  });
@@ -5743,24 +5749,24 @@ class Vt {
5743
5749
  }
5744
5750
  }
5745
5751
  Mt = new WeakMap();
5746
- var Tn, ga;
5752
+ var Cn, ga;
5747
5753
  class kl {
5748
5754
  constructor(e, t) {
5749
- u(this, Tn);
5755
+ u(this, Cn);
5750
5756
  u(this, ga);
5751
- l(this, Tn, e), l(this, ga, t);
5757
+ l(this, Cn, e), l(this, ga, t);
5752
5758
  }
5753
5759
  subscribe(e) {
5754
- return a(this, Tn).subscribe(this.namespace(), e);
5760
+ return a(this, Cn).subscribe(this.namespace(), e);
5755
5761
  }
5756
5762
  closed() {
5757
- return a(this, Tn).closed();
5763
+ return a(this, Cn).closed();
5758
5764
  }
5759
5765
  namespace() {
5760
5766
  return a(this, ga).namespace;
5761
5767
  }
5762
5768
  }
5763
- Tn = new WeakMap(), ga = new WeakMap();
5769
+ Cn = new WeakMap(), ga = new WeakMap();
5764
5770
  function iA(s, e) {
5765
5771
  return ["com.vindral.moq", s];
5766
5772
  }
@@ -5785,7 +5791,7 @@ const ad = class ad {
5785
5791
  // The largest group id seen so far - used to switch seamlessly between tracks
5786
5792
  u(this, gt);
5787
5793
  // We keep track of the most recent groups to ensure we haven't missed any due to re-ordering before we close subscriptions
5788
- u(this, es, new fe(100));
5794
+ u(this, es, new pe(100));
5789
5795
  // This contains the unconsumed groups if this track has an absolute range
5790
5796
  u(this, ze);
5791
5797
  u(this, Aa);
@@ -5913,12 +5919,12 @@ const od = class od {
5913
5919
  yield a(this, Ft).push(p);
5914
5920
  a(this, At).info("Subscription renewed", n);
5915
5921
  } catch (w) {
5916
- var b = w, S = !0;
5922
+ var y = w, S = !0;
5917
5923
  } finally {
5918
- Ne(g, b, S);
5924
+ Ne(g, y, S);
5919
5925
  }
5920
5926
  }));
5921
- l(this, it, new Im(e)), l(this, ts, e), l(this, At, pe.get().createContext(`Renewable '${e.name()}'`));
5927
+ l(this, it, new Im(e)), l(this, ts, e), l(this, At, ge.get().createContext(`Renewable '${e.name()}'`));
5922
5928
  }
5923
5929
  static subscribe(e, t, i) {
5924
5930
  return m(this, null, function* () {
@@ -6088,12 +6094,12 @@ const sc = class sc {
6088
6094
  )
6089
6095
  ), n = W.fromPromise(i.promise.then((d) => d.objects()));
6090
6096
  if (t.catalog)
6091
- return new sc(i, new Ce(t.catalog), n);
6097
+ return new sc(i, new ke(t.catalog), n);
6092
6098
  const c = yield (yield n.promise).next();
6093
6099
  if (!c.value)
6094
6100
  throw new Error("No catalog found");
6095
6101
  const h = _d(c.value);
6096
- return new sc(i, new Ce(h), n);
6102
+ return new sc(i, new ke(h), n);
6097
6103
  });
6098
6104
  }
6099
6105
  };
@@ -6103,7 +6109,7 @@ ai = new WeakMap(), va = new WeakMap(), Sa = new WeakMap(), Ea = new WeakMap(),
6103
6109
  try {
6104
6110
  for (var t = J(e), i, n, o; i = !(n = yield t.next()).done; i = !1) {
6105
6111
  const c = n.value;
6106
- if (c.objectStatus !== Ie.Normal)
6112
+ if (c.objectStatus !== Ce.Normal)
6107
6113
  continue;
6108
6114
  const h = _d(c);
6109
6115
  a(this, ai).update(h);
@@ -6121,32 +6127,32 @@ ai = new WeakMap(), va = new WeakMap(), Sa = new WeakMap(), Ea = new WeakMap(),
6121
6127
  });
6122
6128
  };
6123
6129
  let vh = sc;
6124
- var Ta, In, Ia, Cn, Ca, Sh;
6130
+ var Ta, kn, Ia, Bn, Ca, Sh;
6125
6131
  class aA {
6126
6132
  constructor(e, t, i, n) {
6127
6133
  u(this, Ca);
6128
6134
  u(this, Ta);
6129
- u(this, In);
6135
+ u(this, kn);
6130
6136
  u(this, Ia);
6131
6137
  r(this, "track");
6132
- u(this, Cn, pe.get().createContext("CmafGroup"));
6133
- this.track = n, l(this, Ta, i), l(this, In, e), l(this, Ia, t);
6138
+ u(this, Bn, ge.get().createContext("CmafGroup"));
6139
+ this.track = n, l(this, Ta, i), l(this, kn, e), l(this, Ia, t);
6134
6140
  }
6135
6141
  [Symbol.asyncIterator]() {
6136
6142
  return Ct(this, null, function* () {
6137
6143
  const e = { name: this.track.trackObject.name, namespace: this.track.namespace };
6138
- a(this, Cn).debug("start", v({}, e));
6144
+ a(this, Bn).debug("start", v({}, e));
6139
6145
  try {
6140
- for (var t = J(a(this, In)), i, n, o; i = !(n = yield new $(t.next())).done; i = !1) {
6146
+ for (var t = J(a(this, kn)), i, n, o; i = !(n = yield new $(t.next())).done; i = !1) {
6141
6147
  const c = n.value;
6142
- if (c.objectStatus === Ie.EndOfTrackAndGroup && (yield new $(this.track.endOfTrack(c.groupId))), c.objectStatus !== Ie.Normal)
6148
+ if (c.objectStatus === Ce.EndOfTrackAndGroup && (yield new $(this.track.endOfTrack(c.groupId))), c.objectStatus !== Ce.Normal)
6143
6149
  continue;
6144
6150
  const h = a(this, Ia).createFragment(c.payload), d = h.timescale(), f = h.baseMediaDecodeTime() / d * 1e3, p = h.duration() / d * 1e3, g = f + p, w = a(this, Ta) / 1e3 * d;
6145
6151
  h.updateBaseMediaDecodeTime(h.baseMediaDecodeTime() - w);
6146
- const b = this.track.timestampRange();
6147
- if (b && f >= b[1])
6152
+ const y = this.track.timestampRange();
6153
+ if (y && f >= y[1])
6148
6154
  break;
6149
- a(this, Cn).debug("fragment", F(v({}, e), {
6155
+ a(this, Bn).debug("fragment", F(v({}, e), {
6150
6156
  startTime: f,
6151
6157
  endTime: g,
6152
6158
  subscribeId: c.subscribeId,
@@ -6165,7 +6171,7 @@ class aA {
6165
6171
  throw o[0];
6166
6172
  }
6167
6173
  }
6168
- a(this, Cn).debug("end", v({}, e));
6174
+ a(this, Bn).debug("end", v({}, e));
6169
6175
  });
6170
6176
  }
6171
6177
  [St()]() {
@@ -6175,10 +6181,10 @@ class aA {
6175
6181
  return A(this, Ca, Sh).call(this);
6176
6182
  }
6177
6183
  }
6178
- Ta = new WeakMap(), In = new WeakMap(), Ia = new WeakMap(), Cn = new WeakMap(), Ca = new WeakSet(), Sh = function() {
6184
+ Ta = new WeakMap(), kn = new WeakMap(), Ia = new WeakMap(), Bn = new WeakMap(), Ca = new WeakSet(), Sh = function() {
6179
6185
  return m(this, null, function* () {
6180
6186
  var e, t;
6181
- return yield (t = (e = a(this, In)).return) == null ? void 0 : t.call(e), Promise.resolve();
6187
+ return yield (t = (e = a(this, kn)).return) == null ? void 0 : t.call(e), Promise.resolve();
6182
6188
  });
6183
6189
  };
6184
6190
  var ka, wt, Ba, Ra, nc, Rl;
@@ -6203,11 +6209,11 @@ const Ms = class Ms {
6203
6209
  n && o.startGroup(n);
6204
6210
  const c = o.build();
6205
6211
  if (t.initTrack) {
6206
- const g = new Vt().name(t.initTrack).build(), [w, b] = yield Promise.all([
6212
+ const g = new Vt().name(t.initTrack).build(), [w, y] = yield Promise.all([
6207
6213
  A(p = Ms, nc, Rl).call(p, e, g),
6208
6214
  Ai.subscribe(e, c, n ? n - B(1) : void 0)
6209
6215
  ]), S = new Pd(w);
6210
- return new Ms(t, e.namespace(), b, S, i);
6216
+ return new Ms(t, e.namespace(), y, S, i);
6211
6217
  }
6212
6218
  He(t.initData, "no init data found on track");
6213
6219
  const h = gu(t.initData), d = new Pd(new Uint8Array(h)), f = yield Ai.subscribe(e, c, n ? n - B(1) : void 0);
@@ -6284,8 +6290,8 @@ var rc, oi, is, Ua, Pa, xa, ys, Ih, Ul;
6284
6290
  const cd = class cd {
6285
6291
  constructor(e, t, i) {
6286
6292
  u(this, ys);
6287
- u(this, rc, pe.get().createContext("Timeline"));
6288
- u(this, oi, new Ce([]));
6293
+ u(this, rc, ge.get().createContext("Timeline"));
6294
+ u(this, oi, new ke([]));
6289
6295
  u(this, is);
6290
6296
  u(this, Ua);
6291
6297
  u(this, Pa);
@@ -6309,7 +6315,7 @@ const cd = class cd {
6309
6315
  * This is useful for time aligning two streams based on the common wallclock time
6310
6316
  */
6311
6317
  timestampWallclockOffset() {
6312
- return Hn(this.timeline().map((e) => e.mediaPts - e.wallclock));
6318
+ return Qn(this.timeline().map((e) => e.mediaPts - e.wallclock));
6313
6319
  }
6314
6320
  static start(e, t) {
6315
6321
  const i = W.fromPromise(
@@ -6335,7 +6341,7 @@ rc = new WeakMap(), oi = new WeakMap(), is = new WeakMap(), Ua = new WeakMap(),
6335
6341
  return m(this, null, function* () {
6336
6342
  const t = yield e.promise;
6337
6343
  try {
6338
- for (var b = J(t), S, x, R; S = !(x = yield b.next()).done; S = !1) {
6344
+ for (var y = J(t), S, x, R; S = !(x = yield y.next()).done; S = !1) {
6339
6345
  var h = x.value;
6340
6346
  var d = [];
6341
6347
  try {
@@ -6343,7 +6349,7 @@ rc = new WeakMap(), oi = new WeakMap(), is = new WeakMap(), Ua = new WeakMap(),
6343
6349
  try {
6344
6350
  for (var i = J(D), n, o, c; n = !(o = yield i.next()).done; n = !1) {
6345
6351
  const E = o.value;
6346
- if (E.objectStatus !== Ie.Normal)
6352
+ if (E.objectStatus !== Ce.Normal)
6347
6353
  continue;
6348
6354
  const U = cA(E.payload);
6349
6355
  a(this, oi).update((k) => {
@@ -6376,7 +6382,7 @@ rc = new WeakMap(), oi = new WeakMap(), is = new WeakMap(), Ua = new WeakMap(),
6376
6382
  R = [x];
6377
6383
  } finally {
6378
6384
  try {
6379
- S && (x = b.return) && (yield x.call(b));
6385
+ S && (x = y.return) && (yield x.call(y));
6380
6386
  } finally {
6381
6387
  if (R)
6382
6388
  throw R[0];
@@ -6418,16 +6424,16 @@ function cA(s) {
6418
6424
  function hA(s) {
6419
6425
  return typeof s.language == "string";
6420
6426
  }
6421
- var ac, La, ci, kn;
6427
+ var ac, La, ci, Rn;
6422
6428
  const hd = class hd {
6423
6429
  constructor(e, t, i, n, o) {
6424
6430
  u(this, ac, new Gu());
6425
6431
  u(this, La);
6426
6432
  u(this, ci);
6427
- u(this, kn, 0);
6433
+ u(this, Rn, 0);
6428
6434
  r(this, "trackObject");
6429
6435
  r(this, "namespace");
6430
- l(this, ci, e), l(this, La, t), this.trackObject = i, this.namespace = n, l(this, kn, o);
6436
+ l(this, ci, e), l(this, La, t), this.trackObject = i, this.namespace = n, l(this, Rn, o);
6431
6437
  }
6432
6438
  static subscribe(e, t, i) {
6433
6439
  return m(this, null, function* () {
@@ -6452,9 +6458,9 @@ const hd = class hd {
6452
6458
  const e = yield a(this, La).next();
6453
6459
  if (e.done)
6454
6460
  return e;
6455
- if (e.value.objectStatus !== Ie.Normal)
6461
+ if (e.value.objectStatus !== Ce.Normal)
6456
6462
  continue;
6457
- const t = new TextDecoder().decode(e.value.payload), i = a(this, ac).parse(t).map((o) => (o.startTime -= a(this, kn) / 1e3, o.endTime -= a(this, kn) / 1e3, o));
6463
+ const t = new TextDecoder().decode(e.value.payload), i = a(this, ac).parse(t).map((o) => (o.startTime -= a(this, Rn) / 1e3, o.endTime -= a(this, Rn) / 1e3, o));
6458
6464
  return {
6459
6465
  done: !1,
6460
6466
  value: { language: this.trackObject.language, cues: i }
@@ -6477,13 +6483,13 @@ const hd = class hd {
6477
6483
  return this.unsubscribe();
6478
6484
  }
6479
6485
  };
6480
- ac = new WeakMap(), La = new WeakMap(), ci = new WeakMap(), kn = new WeakMap();
6486
+ ac = new WeakMap(), La = new WeakMap(), ci = new WeakMap(), Rn = new WeakMap();
6481
6487
  let Ch = hd;
6482
- var du, ss, ns, rs, hi, sh, Bn, ro;
6488
+ var du, ss, ns, rs, hi, sh, Un, ro;
6483
6489
  du = [xe({ context: "Channel", enter: "info" })];
6484
6490
  const Fs = class Fs {
6485
6491
  constructor(e, t, i, n, o) {
6486
- u(this, Bn);
6492
+ u(this, Un);
6487
6493
  r(this, "namespace");
6488
6494
  u(this, ss);
6489
6495
  u(this, ns);
@@ -6520,13 +6526,13 @@ const Fs = class Fs {
6520
6526
  }
6521
6527
  subscribeCmafTrack(e, t) {
6522
6528
  const i = this.catalog().current().tracks, n = e["com.vindral.variant_uid"] !== void 0 ? i.find((o) => o["com.vindral.variant_uid"] === e["com.vindral.variant_uid"]) : void 0;
6523
- return A(this, Bn, ro).call(this, () => Eh.subscribe(a(this, ss), n != null ? n : e, a(this, hi), t));
6529
+ return A(this, Un, ro).call(this, () => Eh.subscribe(a(this, ss), n != null ? n : e, a(this, hi), t));
6524
6530
  }
6525
6531
  subscribeWebVttTrack(e) {
6526
- return A(this, Bn, ro).call(this, () => Ch.subscribe(a(this, ss), e, a(this, hi)));
6532
+ return A(this, Un, ro).call(this, () => Ch.subscribe(a(this, ss), e, a(this, hi)));
6527
6533
  }
6528
6534
  subscribeTrack(e) {
6529
- return A(this, Bn, ro).call(this, () => a(this, ss).subscribe(e));
6535
+ return A(this, Un, ro).call(this, () => a(this, ss).subscribe(e));
6530
6536
  }
6531
6537
  /**
6532
6538
  * Closes the channel subscriptions
@@ -6535,7 +6541,7 @@ const Fs = class Fs {
6535
6541
  return Promise.all([a(this, rs).close(), a(this, ns).close()]);
6536
6542
  }
6537
6543
  };
6538
- sh = bi(null), ss = new WeakMap(), ns = new WeakMap(), rs = new WeakMap(), hi = new WeakMap(), Bn = new WeakSet(), ro = function(e) {
6544
+ sh = bi(null), ss = new WeakMap(), ns = new WeakMap(), rs = new WeakMap(), hi = new WeakMap(), Un = new WeakSet(), ro = function(e) {
6539
6545
  return m(this, null, function* () {
6540
6546
  const [t, i] = this.catalog().value();
6541
6547
  try {
@@ -6546,7 +6552,7 @@ sh = bi(null), ss = new WeakMap(), ns = new WeakMap(), rs = new WeakMap(), hi =
6546
6552
  throw n;
6547
6553
  }
6548
6554
  });
6549
- }, ve(sh, 9, "start", du, Fs), Gt(sh, Fs), yi(sh, 3, Fs);
6555
+ }, Se(sh, 9, "start", du, Fs), Gt(sh, Fs), yi(sh, 3, Fs);
6550
6556
  let Lo = Fs;
6551
6557
  var as, Da, oc, Pl;
6552
6558
  const dd = class dd {
@@ -6663,7 +6669,7 @@ const ud = class ud {
6663
6669
  r(this, "ip");
6664
6670
  r(this, "value");
6665
6671
  u(this, Oa);
6666
- this.ip = i, this.value = new Ce(t), l(this, Oa, A(this, cc, xl).call(this, e));
6672
+ this.ip = i, this.value = new ke(t), l(this, Oa, A(this, cc, xl).call(this, e));
6667
6673
  }
6668
6674
  closed() {
6669
6675
  return a(this, Oa);
@@ -6697,7 +6703,7 @@ Oa = new WeakMap(), cc = new WeakSet(), xl = function(e) {
6697
6703
  try {
6698
6704
  for (var t = J(e), i, n, o; i = !(n = yield t.next()).done; i = !1) {
6699
6705
  const c = n.value;
6700
- if (c.objectStatus !== Ie.Normal)
6706
+ if (c.objectStatus !== Ce.Normal)
6701
6707
  continue;
6702
6708
  const h = Vd(c.payload);
6703
6709
  this.value.update(h);
@@ -6715,21 +6721,21 @@ Oa = new WeakMap(), cc = new WeakSet(), xl = function(e) {
6715
6721
  });
6716
6722
  };
6717
6723
  let Bh = ud;
6718
- var hc, Rn;
6724
+ var hc, Pn;
6719
6725
  class pA {
6720
6726
  constructor(e) {
6721
- u(this, hc, pe.get().createContext("UpstreamWatcher"));
6722
- u(this, Rn);
6723
- l(this, Rn, new Ce(W.fromPromise(e.closed())));
6727
+ u(this, hc, ge.get().createContext("UpstreamWatcher"));
6728
+ u(this, Pn);
6729
+ l(this, Pn, new ke(W.fromPromise(e.closed())));
6724
6730
  }
6725
6731
  update(e) {
6726
- a(this, Rn).update(W.fromPromise(e.closed()));
6732
+ a(this, Pn).update(W.fromPromise(e.closed()));
6727
6733
  }
6728
6734
  closed() {
6729
6735
  return m(this, null, function* () {
6730
6736
  try {
6731
6737
  for (; ; ) {
6732
- const [e, t] = a(this, Rn).value();
6738
+ const [e, t] = a(this, Pn).value();
6733
6739
  let i = !1;
6734
6740
  yield Promise.race([
6735
6741
  t == null ? void 0 : t.then(() => i = !0),
@@ -6745,11 +6751,11 @@ class pA {
6745
6751
  });
6746
6752
  }
6747
6753
  }
6748
- hc = new WeakMap(), Rn = new WeakMap();
6749
- var Un, Ma, Fa;
6754
+ hc = new WeakMap(), Pn = new WeakMap();
6755
+ var xn, Ma, Fa;
6750
6756
  class qc {
6751
6757
  constructor(e, t) {
6752
- u(this, Un, pe.get().createContext("TracksIterator"));
6758
+ u(this, xn, ge.get().createContext("TracksIterator"));
6753
6759
  u(this, Ma);
6754
6760
  u(this, Fa);
6755
6761
  l(this, Ma, e), l(this, Fa, t);
@@ -6766,7 +6772,7 @@ class qc {
6766
6772
  name: c.trackObject.name,
6767
6773
  namespace: c.namespace
6768
6774
  };
6769
- a(this, Un).debug("track start", v({ mediaType: e }, h)), yield* Gc(c), a(this, Un).debug("track end", v({ mediaType: e }, h));
6775
+ a(this, xn).debug("track start", v({ mediaType: e }, h)), yield* Gc(c), a(this, xn).debug("track end", v({ mediaType: e }, h));
6770
6776
  }
6771
6777
  } catch (n) {
6772
6778
  o = [n];
@@ -6778,30 +6784,30 @@ class qc {
6778
6784
  throw o[0];
6779
6785
  }
6780
6786
  }
6781
- a(this, Un).debug("tracks ended", { mediaType: e });
6787
+ a(this, xn).debug("tracks ended", { mediaType: e });
6782
6788
  });
6783
6789
  }
6784
6790
  }
6785
- Un = new WeakMap(), Ma = new WeakMap(), Fa = new WeakMap();
6786
- var uu, lu, mu, Pn, xn, os, ue, st, nt, di, Ln, _a, Yn, ke, ao, ir, Ll, Uh;
6791
+ xn = new WeakMap(), Ma = new WeakMap(), Fa = new WeakMap();
6792
+ var uu, lu, mu, Ln, Dn, os, le, st, nt, di, On, _a, Kn, Be, ao, nr, Ll, Uh;
6787
6793
  mu = [xe({ context: "Player", enter: "info" })], lu = [xe({ context: "Player", enter: "info", return: "info" })], uu = [xe({ context: "Player", enter: "info" })];
6788
6794
  const _s = class _s {
6789
6795
  constructor(e, t, i) {
6790
- yi(Yn, 5, this);
6791
- u(this, ke);
6792
- u(this, Pn);
6793
- u(this, xn);
6794
- u(this, os);
6795
- u(this, ue);
6796
- u(this, st, new Ce(void 0));
6797
- u(this, nt, new Ce(void 0));
6798
- u(this, di, new Ce(void 0));
6796
+ yi(Kn, 5, this);
6797
+ u(this, Be);
6799
6798
  u(this, Ln);
6799
+ u(this, Dn);
6800
+ u(this, os);
6801
+ u(this, le);
6802
+ u(this, st, new ke(void 0));
6803
+ u(this, nt, new ke(void 0));
6804
+ u(this, di, new ke(void 0));
6805
+ u(this, On);
6800
6806
  u(this, _a);
6801
6807
  r(this, "subtitles", new qc(a(this, di), "subtitles"));
6802
6808
  r(this, "video", new qc(a(this, nt), "video"));
6803
6809
  r(this, "audio", new qc(a(this, st), "audio"));
6804
- l(this, Pn, e), l(this, xn, kh.start(i)), l(this, os, i), l(this, ue, new Ce(t)), l(this, Ln, new pA(t)), l(this, _a, Promise.race([i.idleTimeout(), A(this, ke, Ll).call(this), a(this, Ln).closed()])), a(this, Pn).closed().then(() => this.close()).catch(L);
6810
+ l(this, Ln, e), l(this, Dn, kh.start(i)), l(this, os, i), l(this, le, new ke(t)), l(this, On, new pA(t)), l(this, _a, Promise.race([i.idleTimeout(), A(this, Be, Ll).call(this), a(this, On).closed()])), a(this, Ln).closed().then(() => this.close()).catch(L);
6805
6811
  }
6806
6812
  closed() {
6807
6813
  return a(this, _a);
@@ -6831,10 +6837,10 @@ const _s = class _s {
6831
6837
  return a(this, os).value;
6832
6838
  }
6833
6839
  catalog() {
6834
- return a(this, ue).current().catalog();
6840
+ return a(this, le).current().catalog();
6835
6841
  }
6836
6842
  namespace() {
6837
- return a(this, ue).current().namespace;
6843
+ return a(this, le).current().namespace;
6838
6844
  }
6839
6845
  videoTrack() {
6840
6846
  var e;
@@ -6845,38 +6851,38 @@ const _s = class _s {
6845
6851
  return (e = a(this, st).current()) == null ? void 0 : e.trackObject;
6846
6852
  }
6847
6853
  referenceClock() {
6848
- return a(this, xn);
6854
+ return a(this, Dn);
6849
6855
  }
6850
6856
  drm() {
6851
6857
  return m(this, null, function* () {
6852
6858
  var t, i;
6853
6859
  if (this.catalog().current().tracks.find(({ name: n }) => n === "drm"))
6854
- return sd.create(a(this, ue).current(), (t = this.videoTrack()) == null ? void 0 : t.codec, (i = this.audioTrack()) == null ? void 0 : i.codec);
6860
+ return sd.create(a(this, le).current(), (t = this.videoTrack()) == null ? void 0 : t.codec, (i = this.audioTrack()) == null ? void 0 : i.codec);
6855
6861
  });
6856
6862
  }
6857
6863
  close() {
6858
6864
  return Promise.all([
6859
6865
  // Close the channel subscription
6860
- a(this, ue).current().close(),
6866
+ a(this, le).current().close(),
6861
6867
  // Close the channel ObservableValue
6862
- a(this, ue).close(),
6868
+ a(this, le).close(),
6863
6869
  // Close the consumers so that the iterators will stop
6864
- A(this, ke, ao).call(this, a(this, st)),
6865
- A(this, ke, ao).call(this, a(this, nt)),
6866
- A(this, ke, ao).call(this, a(this, di))
6870
+ A(this, Be, ao).call(this, a(this, st)),
6871
+ A(this, Be, ao).call(this, a(this, nt)),
6872
+ A(this, Be, ao).call(this, a(this, di))
6867
6873
  ]);
6868
6874
  }
6869
6875
  zap(e, t) {
6870
6876
  return m(this, null, function* () {
6871
6877
  var S, x;
6872
- const i = yield Lo.start(a(this, Pn), e), n = a(this, xn).wallclock() - t, o = a(this, ue).current(), c = o.timestampWallclockOffset(), h = yield i.waitForWallclockTime(n);
6873
- a(this, Ln).update(i), yield a(this, ue).current().close();
6878
+ const i = yield Lo.start(a(this, Ln), e), n = a(this, Dn).wallclock() - t, o = a(this, le).current(), c = o.timestampWallclockOffset(), h = yield i.waitForWallclockTime(n);
6879
+ a(this, On).update(i), yield a(this, le).current().close();
6874
6880
  const d = h.toReversed().find((R) => R.wallclock <= n), f = d != null && d.mediaPts ? d.mediaPts - o.timestampOffsetMs() : void 0, w = i.timestampWallclockOffset() - c + o.timestampOffsetMs();
6875
6881
  i.setTimestampOffsetMs(w);
6876
- const b = d != null && d.groupId ? B(d.groupId) : void 0;
6877
- f && ((S = a(this, nt).current()) == null || S.stopAfterTimestampReached(f), (x = a(this, st).current()) == null || x.stopAfterTimestampReached(f)), a(this, ue).update(i), yield Promise.all([
6878
- e.videoTrack ? this.setVideoTrack(e.videoTrack, b) : void 0,
6879
- e.audioTrack ? this.setAudioTrack(e.audioTrack, b) : void 0
6882
+ const y = d != null && d.groupId ? B(d.groupId) : void 0;
6883
+ f && ((S = a(this, nt).current()) == null || S.stopAfterTimestampReached(f), (x = a(this, st).current()) == null || x.stopAfterTimestampReached(f)), a(this, le).update(i), yield Promise.all([
6884
+ e.videoTrack ? this.setVideoTrack(e.videoTrack, y) : void 0,
6885
+ e.audioTrack ? this.setAudioTrack(e.audioTrack, y) : void 0
6880
6886
  ]);
6881
6887
  });
6882
6888
  }
@@ -6888,7 +6894,7 @@ const _s = class _s {
6888
6894
  return;
6889
6895
  }
6890
6896
  const [t] = yield Promise.all([
6891
- a(this, ue).current().subscribeWebVttTrack(e),
6897
+ a(this, le).current().subscribeWebVttTrack(e),
6892
6898
  (n = a(this, di).current()) == null ? void 0 : n.unsubscribe()
6893
6899
  ]);
6894
6900
  a(this, di).update(t);
@@ -6896,21 +6902,21 @@ const _s = class _s {
6896
6902
  }
6897
6903
  setVideoTrack(e, t) {
6898
6904
  return m(this, null, function* () {
6899
- const i = yield A(this, ke, ir).call(this, a(this, ue).current(), e, a(this, nt).current(), t);
6905
+ const i = yield A(this, Be, nr).call(this, a(this, le).current(), e, a(this, nt).current(), t);
6900
6906
  a(this, nt).update(i);
6901
6907
  });
6902
6908
  }
6903
6909
  setAudioTrack(e, t) {
6904
6910
  return m(this, null, function* () {
6905
- const i = yield A(this, ke, ir).call(this, a(this, ue).current(), e, a(this, st).current(), t);
6911
+ const i = yield A(this, Be, nr).call(this, a(this, le).current(), e, a(this, st).current(), t);
6906
6912
  a(this, st).update(i);
6907
6913
  });
6908
6914
  }
6909
6915
  };
6910
- Yn = bi(null), Pn = new WeakMap(), xn = new WeakMap(), os = new WeakMap(), ue = new WeakMap(), st = new WeakMap(), nt = new WeakMap(), di = new WeakMap(), Ln = new WeakMap(), _a = new WeakMap(), ke = new WeakSet(), ao = function(e) {
6916
+ Kn = bi(null), Ln = new WeakMap(), Dn = new WeakMap(), os = new WeakMap(), le = new WeakMap(), st = new WeakMap(), nt = new WeakMap(), di = new WeakMap(), On = new WeakMap(), _a = new WeakMap(), Be = new WeakSet(), ao = function(e) {
6911
6917
  const t = e.current(), i = t == null ? void 0 : t.largestGroupId();
6912
6918
  return e.isClosed() || e.update(void 0), e.close(), i ? t == null ? void 0 : t.update(i, i) : t == null ? void 0 : t.unsubscribe();
6913
- }, ir = function(e, t, i, n) {
6919
+ }, nr = function(e, t, i, n) {
6914
6920
  return m(this, null, function* () {
6915
6921
  const o = i == null ? void 0 : i.largestGroupId(), [c, h] = yield Promise.all([
6916
6922
  e.subscribeCmafTrack(
@@ -6924,14 +6930,14 @@ Yn = bi(null), Pn = new WeakMap(), xn = new WeakMap(), os = new WeakMap(), ue =
6924
6930
  }, Ll = function() {
6925
6931
  return m(this, null, function* () {
6926
6932
  try {
6927
- for (var o = J(a(this, ue)), c, h, d; c = !(h = yield o.next()).done; c = !1) {
6933
+ for (var o = J(a(this, le)), c, h, d; c = !(h = yield o.next()).done; c = !1) {
6928
6934
  const f = h.value;
6929
6935
  try {
6930
6936
  for (var e = J(f.catalog()), t, i, n; t = !(i = yield e.next()).done; t = !1) {
6931
6937
  const p = i.value;
6932
6938
  yield Promise.all([
6933
- A(this, ke, Uh).call(this, p, a(this, nt)),
6934
- A(this, ke, Uh).call(this, p, a(this, st))
6939
+ A(this, Be, Uh).call(this, p, a(this, nt)),
6940
+ A(this, Be, Uh).call(this, p, a(this, st))
6935
6941
  ]);
6936
6942
  }
6937
6943
  } catch (i) {
@@ -6967,31 +6973,31 @@ Yn = bi(null), Pn = new WeakMap(), xn = new WeakMap(), os = new WeakMap(), ue =
6967
6973
  t.update(void 0);
6968
6974
  return;
6969
6975
  }
6970
- t.update(yield a(this, ue).current().subscribeCmafTrack(h));
6976
+ t.update(yield a(this, le).current().subscribeCmafTrack(h));
6971
6977
  }
6972
6978
  });
6973
- }, ve(Yn, 1, "close", mu, _s), ve(Yn, 1, "zap", lu, _s), ir = ve(Yn, 17, "#replaceTrack", uu, ke, ir), Gt(Yn, _s);
6979
+ }, Se(Kn, 1, "close", mu, _s), Se(Kn, 1, "zap", lu, _s), nr = Se(Kn, 17, "#replaceTrack", uu, Be, nr), Gt(Kn, _s);
6974
6980
  let Rh = _s;
6975
6981
  function $c(s, e, t) {
6976
6982
  const i = new URL("/voq/subscribe", s);
6977
6983
  return i.searchParams.set("sessionId", e.sessionId), i.searchParams.set("clientId", e.clientId), i.searchParams.set("channelId", e.channelId), t && i.searchParams.set("authToken", t), i;
6978
6984
  }
6979
6985
  const gA = 1e4;
6980
- var le, Ee, rt, cs, Y, ui, Na, Va, dc, Dn, Be, Dl, On, Ga, Mn, Ol, Ml, Fl, _l, xh;
6986
+ var me, Te, rt, cs, Y, ui, Na, Va, dc, Mn, Re, Dl, Fn, Ga, _n, Ol, Ml, Fl, _l, xh;
6981
6987
  const ld = class ld {
6982
6988
  constructor(e, t, i, n, o, c) {
6983
- u(this, Be);
6984
- u(this, le);
6985
- u(this, Ee);
6989
+ u(this, Re);
6990
+ u(this, me);
6991
+ u(this, Te);
6986
6992
  u(this, rt);
6987
6993
  u(this, cs, "disconnected");
6988
6994
  u(this, Y);
6989
6995
  u(this, ui, /* @__PURE__ */ new Map());
6990
6996
  u(this, Na);
6991
- u(this, Va, new fe(10));
6997
+ u(this, Va, new pe(10));
6992
6998
  u(this, dc, Number.MAX_SAFE_INTEGER);
6993
- u(this, Dn, /* @__PURE__ */ new Map());
6994
- u(this, On, (e) => {
6999
+ u(this, Mn, /* @__PURE__ */ new Map());
7000
+ u(this, Fn, (e) => {
6995
7001
  if (!e) {
6996
7002
  a(this, Y).setSubtitleTrack(void 0).catch(L);
6997
7003
  return;
@@ -7003,17 +7009,17 @@ const ld = class ld {
7003
7009
  switch (e.type) {
7004
7010
  case "subscribe":
7005
7011
  {
7006
- if (a(this, Mn)) {
7007
- a(this, Ee).info("Ignoring - we are already switching");
7012
+ if (a(this, _n)) {
7013
+ a(this, Te).info("Ignoring - we are already switching");
7008
7014
  return;
7009
7015
  }
7010
- l(this, Mn, !0), A(this, Be, Ml).call(this, e.subscription).catch((t) => {
7011
- a(this, Ee).error("error handling subscription", t), a(this, le).emit("received signal", {
7016
+ l(this, _n, !0), A(this, Re, Ml).call(this, e.subscription).catch((t) => {
7017
+ a(this, Te).error("error handling subscription", t), a(this, me).emit("received signal", {
7012
7018
  type: "subscription changed",
7013
7019
  subscription: e.subscription,
7014
7020
  reset: !0
7015
7021
  });
7016
- }).finally(() => l(this, Mn, !1));
7022
+ }).finally(() => l(this, _n, !1));
7017
7023
  }
7018
7024
  break;
7019
7025
  case "telemetry":
@@ -7027,17 +7033,17 @@ const ld = class ld {
7027
7033
  break;
7028
7034
  }
7029
7035
  });
7030
- u(this, Mn, !1);
7036
+ u(this, _n, !1);
7031
7037
  r(this, "disconnect", (e = "Disconnect Requested") => {
7032
- a(this, Ee).info("Disconnecting", e), a(this, rt).close(), a(this, Y).close().catch(L), l(this, Dn, /* @__PURE__ */ new Map()), l(this, cs, "disconnected");
7038
+ a(this, Te).info("Disconnecting", e), a(this, rt).close(), a(this, Y).close().catch(L), l(this, Mn, /* @__PURE__ */ new Map()), l(this, cs, "disconnected");
7033
7039
  });
7034
- l(this, le, e), l(this, Ee, t), l(this, rt, i), l(this, Y, n), l(this, ui, o), l(this, Na, c), a(this, le).on("send signal", a(this, Ga)), a(this, le).on("disconnect", this.disconnect), a(this, le).on("text track", a(this, On)), A(this, Be, Dl).call(this).catch(L), A(this, Be, Fl).call(this).catch(L);
7040
+ l(this, me, e), l(this, Te, t), l(this, rt, i), l(this, Y, n), l(this, ui, o), l(this, Na, c), a(this, me).on("send signal", a(this, Ga)), a(this, me).on("disconnect", this.disconnect), a(this, me).on("text track", a(this, Fn)), A(this, Re, Dl).call(this).catch(L), A(this, Re, Fl).call(this).catch(L);
7035
7041
  }
7036
7042
  get estimatedBandwidth() {
7037
7043
  return a(this, dc);
7038
7044
  }
7039
7045
  unload() {
7040
- a(this, le).off("send signal", a(this, Ga)), a(this, le).off("disconnect", this.disconnect), a(this, le).off("text track", a(this, On)), this.disconnect();
7046
+ a(this, me).off("send signal", a(this, Ga)), a(this, me).off("disconnect", this.disconnect), a(this, me).off("text track", a(this, Fn)), this.disconnect();
7041
7047
  }
7042
7048
  suspend() {
7043
7049
  }
@@ -7060,7 +7066,7 @@ const ld = class ld {
7060
7066
  const o = new Map(
7061
7067
  n.connectInfo.channels.map((_) => [
7062
7068
  Si(_.catalog.namespace),
7063
- new Yc(new Ce(_.catalog))
7069
+ new Yc(new ke(_.catalog))
7064
7070
  ])
7065
7071
  ), c = yield n.onConnectInfo(n.connectInfo), h = n.options.get("authenticationToken");
7066
7072
  let d, f;
@@ -7075,7 +7081,7 @@ const ld = class ld {
7075
7081
  }
7076
7082
  const p = (D = n.connectInfo.channels.find((_) => _.channelId === c.channelId)) == null ? void 0 : D.catalog;
7077
7083
  t.debug("Resolved edge url", { edgeUrl: d, edgeWsUrl: f }), He(p, "no catalog found");
7078
- const g = (E = o.get(Si(p.namespace))) == null ? void 0 : E.getVideoTrack(c.video), w = (U = o.get(Si(p.namespace))) == null ? void 0 : U.getAudioTrack(c.audio), b = yield tA({
7084
+ const g = (E = o.get(Si(p.namespace))) == null ? void 0 : E.getVideoTrack(c.video), w = (U = o.get(Si(p.namespace))) == null ? void 0 : U.getAudioTrack(c.audio), y = yield tA({
7079
7085
  url: d,
7080
7086
  wsUrl: f,
7081
7087
  authToken: n.options.get("authenticationToken"),
@@ -7083,14 +7089,14 @@ const ld = class ld {
7083
7089
  role: Ag.Subscriber,
7084
7090
  websocketFallbackTimeoutMs: 2e3
7085
7091
  }), S = yield Promise.race([
7086
- Rh.start(b.subscriber, {
7092
+ Rh.start(y.subscriber, {
7087
7093
  namespace: p.namespace,
7088
7094
  catalog: p,
7089
7095
  videoTrack: g == null ? void 0 : g.track,
7090
7096
  audioTrack: w == null ? void 0 : w.track
7091
7097
  }),
7092
7098
  ed(gA, new Error("Timeout waiting for player to start")),
7093
- Cm(b.closed(), "Session closed before player started")
7099
+ Cm(y.closed(), "Session closed before player started")
7094
7100
  ]), x = new Yc(S.catalog());
7095
7101
  o.set(Si(p.namespace), x), e.emit("received signal", {
7096
7102
  type: "client ip",
@@ -7100,8 +7106,8 @@ const ld = class ld {
7100
7106
  }).catch((_) => {
7101
7107
  t.error("Error getting DRM data", _);
7102
7108
  });
7103
- const R = new ld(e, t, b, S, o, i);
7104
- return c.textTrack && a(k = R, On).call(k, c.textTrack), R;
7109
+ const R = new ld(e, t, y, S, o, i);
7110
+ return c.textTrack && a(k = R, Fn).call(k, c.textTrack), R;
7105
7111
  });
7106
7112
  }
7107
7113
  getState() {
@@ -7117,7 +7123,7 @@ const ld = class ld {
7117
7123
  return Promise.race([a(this, rt).closed(), a(this, Y).closed()]);
7118
7124
  }
7119
7125
  };
7120
- le = new WeakMap(), Ee = new WeakMap(), rt = new WeakMap(), cs = new WeakMap(), Y = new WeakMap(), ui = new WeakMap(), Na = new WeakMap(), Va = new WeakMap(), dc = new WeakMap(), Dn = new WeakMap(), Be = new WeakSet(), Dl = function() {
7126
+ me = new WeakMap(), Te = new WeakMap(), rt = new WeakMap(), cs = new WeakMap(), Y = new WeakMap(), ui = new WeakMap(), Na = new WeakMap(), Va = new WeakMap(), dc = new WeakMap(), Mn = new WeakMap(), Re = new WeakSet(), Dl = function() {
7121
7127
  return m(this, null, function* () {
7122
7128
  try {
7123
7129
  for (var e = J(a(this, Y).stats()), t, i, n; t = !(i = yield e.next()).done; t = !1) {
@@ -7135,7 +7141,7 @@ le = new WeakMap(), Ee = new WeakMap(), rt = new WeakMap(), cs = new WeakMap(),
7135
7141
  }
7136
7142
  }
7137
7143
  });
7138
- }, On = new WeakMap(), Ga = new WeakMap(), Mn = new WeakMap(), Ol = function(e) {
7144
+ }, Fn = new WeakMap(), Ga = new WeakMap(), _n = new WeakMap(), Ol = function(e) {
7139
7145
  return m(this, null, function* () {
7140
7146
  var n;
7141
7147
  const t = yield a(this, Na).connect({ channelId: e });
@@ -7149,11 +7155,11 @@ le = new WeakMap(), Ee = new WeakMap(), rt = new WeakMap(), cs = new WeakMap(),
7149
7155
  }, Ml = function(e) {
7150
7156
  return m(this, null, function* () {
7151
7157
  var c, h, d;
7152
- a(this, Ee).info("handle subscription", e);
7158
+ a(this, Te).info("handle subscription", e);
7153
7159
  const t = a(this, Y);
7154
7160
  let i = a(this, ui).get(e.channelId);
7155
- if (i || (i = new Yc(new Ce(yield A(this, Be, Ol).call(this, e.channelId))), a(this, ui).set(e.channelId, i)), t.namespace().join("/") !== i.namespace().join("/")) {
7156
- a(this, Ee).info("changing channel", e.channelId);
7161
+ if (i || (i = new Yc(new ke(yield A(this, Re, Ol).call(this, e.channelId))), a(this, ui).set(e.channelId, i)), t.namespace().join("/") !== i.namespace().join("/")) {
7162
+ a(this, Te).info("changing channel", e.channelId);
7157
7163
  const f = i.getVideoTrack(e.video), p = i.getAudioTrack(e.audio);
7158
7164
  yield t.zap(
7159
7165
  {
@@ -7164,10 +7170,10 @@ le = new WeakMap(), Ee = new WeakMap(), rt = new WeakMap(), cs = new WeakMap(),
7164
7170
  },
7165
7171
  500
7166
7172
  ), t.drm().then((g) => {
7167
- g && a(this, le).emit("received drm data", g.value);
7173
+ g && a(this, me).emit("received drm data", g.value);
7168
7174
  }).catch((g) => {
7169
- a(this, Ee).error("Error getting DRM data", g);
7170
- }), a(this, Ee).info("switched channel", e.channelId), (c = a(this, ui).get(Si(t.namespace()))) == null || c.updateCatalog(t.catalog()), a(this, le).emit("received signal", {
7175
+ a(this, Te).error("Error getting DRM data", g);
7176
+ }), a(this, Te).info("switched channel", e.channelId), (c = a(this, ui).get(Si(t.namespace()))) == null || c.updateCatalog(t.catalog()), a(this, me).emit("received signal", {
7171
7177
  type: "subscription changed",
7172
7178
  subscription: e
7173
7179
  });
@@ -7177,7 +7183,7 @@ le = new WeakMap(), Ee = new WeakMap(), rt = new WeakMap(), cs = new WeakMap(),
7177
7183
  yield Promise.all([
7178
7184
  n && n.track.name !== ((h = a(this, Y).videoTrack()) == null ? void 0 : h.name) ? a(this, Y).setVideoTrack(n.track) : void 0,
7179
7185
  o && o.track.name !== ((d = a(this, Y).audioTrack()) == null ? void 0 : d.name) ? a(this, Y).setAudioTrack(o.track) : void 0
7180
- ]), a(this, le).emit("received signal", {
7186
+ ]), a(this, me).emit("received signal", {
7181
7187
  type: "subscription changed",
7182
7188
  subscription: e
7183
7189
  });
@@ -7185,13 +7191,13 @@ le = new WeakMap(), Ee = new WeakMap(), rt = new WeakMap(), cs = new WeakMap(),
7185
7191
  }, Fl = function() {
7186
7192
  return m(this, null, function* () {
7187
7193
  try {
7188
- l(this, cs, "connecting"), a(this, Ee).info("Connecting..."), l(this, cs, "connected"), yield Promise.all([
7189
- A(this, Be, xh).call(this, a(this, Y).referenceClock(), a(this, Y).audio),
7190
- A(this, Be, xh).call(this, a(this, Y).referenceClock(), a(this, Y).video),
7191
- A(this, Be, _l).call(this, a(this, Y).subtitles)
7192
- ]), yield a(this, Y).closed(), a(this, rt).close(), a(this, Ee).info("Session closed");
7194
+ l(this, cs, "connecting"), a(this, Te).info("Connecting..."), l(this, cs, "connected"), yield Promise.all([
7195
+ A(this, Re, xh).call(this, a(this, Y).referenceClock(), a(this, Y).audio),
7196
+ A(this, Re, xh).call(this, a(this, Y).referenceClock(), a(this, Y).video),
7197
+ A(this, Re, _l).call(this, a(this, Y).subtitles)
7198
+ ]), yield a(this, Y).closed(), a(this, rt).close(), a(this, Te).info("Session closed");
7193
7199
  } catch (e) {
7194
- a(this, Ee).warn("Session error", e);
7200
+ a(this, Te).warn("Session error", e);
7195
7201
  }
7196
7202
  });
7197
7203
  }, _l = function(e) {
@@ -7199,7 +7205,7 @@ le = new WeakMap(), Ee = new WeakMap(), rt = new WeakMap(), cs = new WeakMap(),
7199
7205
  try {
7200
7206
  for (var t = J(e), i, n, o; i = !(n = yield t.next()).done; i = !1) {
7201
7207
  const c = n.value;
7202
- a(this, le).emit("text track data", c);
7208
+ a(this, me).emit("text track data", c);
7203
7209
  }
7204
7210
  } catch (n) {
7205
7211
  o = [n];
@@ -7218,7 +7224,7 @@ le = new WeakMap(), Ee = new WeakMap(), rt = new WeakMap(), cs = new WeakMap(),
7218
7224
  let i = "", n = "", o;
7219
7225
  const c = a(this, Y).videoTrack() === void 0;
7220
7226
  try {
7221
- for (var w = J(t), b, S, x; b = !(S = yield w.next()).done; b = !1) {
7227
+ for (var w = J(t), y, S, x; y = !(S = yield w.next()).done; y = !1) {
7222
7228
  const R = S.value;
7223
7229
  const D = Si(R.track.namespace), E = R.track.trackObject.language, U = nm((h = R.track.trackObject.codec) != null ? h : ""), k = R.track.trackObject.codec, _ = U ? Ri({ codec: U, codecString: k }) : void 0, he = !!R.track.trackObject["com.vindral.drm"];
7224
7230
  try {
@@ -7230,27 +7236,27 @@ le = new WeakMap(), Ee = new WeakMap(), rt = new WeakMap(), cs = new WeakMap(),
7230
7236
  drmTransition: o !== void 0 && o !== he
7231
7237
  };
7232
7238
  i = D, n = E, o = he;
7233
- const be = Q.producerReferenceTime(), ye = a(this, Dn).get(R.track.namespace) || 0;
7234
- if (be && Date.now() - ye > 1e3) {
7235
- a(this, Dn).set(R.track.namespace, Date.now());
7236
- const y = e.wallclock() - be.getTime();
7237
- a(this, Ee).debug("timing-info", {
7239
+ const ye = Q.producerReferenceTime(), ve = a(this, Mn).get(R.track.namespace) || 0;
7240
+ if (ye && Date.now() - ve > 1e3) {
7241
+ a(this, Mn).set(R.track.namespace, Date.now());
7242
+ const b = e.wallclock() - ye.getTime();
7243
+ a(this, Te).debug("timing-info", {
7238
7244
  mediaType: Q.mediaType(),
7239
7245
  referenceClock: e,
7240
- delta: y,
7246
+ delta: b,
7241
7247
  groupId: Fe,
7242
- timestamp: Q.baseMediaDecodeTime() / Q.timescale() * 1e3 + y,
7243
- wallclockTime: be.getTime()
7244
- }), a(this, le).emit("received signal", {
7248
+ timestamp: Q.baseMediaDecodeTime() / Q.timescale() * 1e3 + b,
7249
+ wallclockTime: ye.getTime()
7250
+ }), a(this, me).emit("received signal", {
7245
7251
  type: "timing info",
7246
7252
  timingInfo: {
7247
7253
  channelId: D,
7248
- timestamp: Q.baseMediaDecodeTime() / Q.timescale() * 1e3 + y,
7249
- wallclockTime: be.getTime()
7254
+ timestamp: Q.baseMediaDecodeTime() / Q.timescale() * 1e3 + b,
7255
+ wallclockTime: ye.getTime()
7250
7256
  }
7251
7257
  });
7252
7258
  }
7253
- a(this, le).emit("received moq data", {
7259
+ a(this, me).emit("received moq data", {
7254
7260
  payload: Q,
7255
7261
  channelId: D,
7256
7262
  groupId: Fe,
@@ -7276,7 +7282,7 @@ le = new WeakMap(), Ee = new WeakMap(), rt = new WeakMap(), cs = new WeakMap(),
7276
7282
  x = [S];
7277
7283
  } finally {
7278
7284
  try {
7279
- b && (S = w.return) && (yield S.call(w));
7285
+ y && (S = w.return) && (yield S.call(w));
7280
7286
  } finally {
7281
7287
  if (x)
7282
7288
  throw x[0];
@@ -7397,19 +7403,19 @@ class bA extends gi {
7397
7403
  isSuspended: this.isSuspended
7398
7404
  })), this.close("one websocket was closed"), t.code) {
7399
7405
  case 4e3:
7400
- this.emit("error", co(qn()));
7406
+ this.emit("error", co(Yn()));
7401
7407
  break;
7402
7408
  case 4001:
7403
- this.emit("error", co(qn()));
7409
+ this.emit("error", co(Yn()));
7404
7410
  break;
7405
7411
  case 4002:
7406
- this.emit("error", Ym(qn()));
7412
+ this.emit("error", Ym(Yn()));
7407
7413
  break;
7408
7414
  case 4003:
7409
- this.emit("error", Eu("internal", qn()));
7415
+ this.emit("error", Eu("internal", Yn()));
7410
7416
  break;
7411
7417
  case 4010:
7412
- this.emit("error", Jm("internal", qn()));
7418
+ this.emit("error", Jm("internal", Yn()));
7413
7419
  break;
7414
7420
  }
7415
7421
  this.emit("close", this);
@@ -7478,7 +7484,7 @@ const yA = 65536 * 8, vA = 0.9, Jc = (s) => yA * vA * 1e3 / s, dt = class dt {
7478
7484
  r(this, "transport");
7479
7485
  r(this, "logger");
7480
7486
  r(this, "config");
7481
- r(this, "rtts", new fe(10));
7487
+ r(this, "rtts", new pe(10));
7482
7488
  r(this, "lastPingSentTime", Date.now());
7483
7489
  r(this, "isPingInFlight", !1);
7484
7490
  r(this, "connectCount", 0);
@@ -7637,7 +7643,7 @@ const yA = 65536 * 8, vA = 0.9, Jc = (s) => yA * vA * 1e3 / s, dt = class dt {
7637
7643
  this._estimatedPingBandwidth = Jc(i.estimatedRtt), this.logger = t, this.emitter = e, this.config = i, this.emitter.on("send signal", this.sendSignal), this.emitter.on("disconnect", this.close), this.emitter.on("reconnect", this.reconnect), this.disconnected.promise.catch(L), this.transport = this.connectWebSocketTransport();
7638
7644
  }
7639
7645
  get rtt() {
7640
- return this.rtts.items().length > 0 ? Hn(this.rtts.items()) : 0;
7646
+ return this.rtts.items().length > 0 ? Qn(this.rtts.items()) : 0;
7641
7647
  }
7642
7648
  get estimatedBandwidth() {
7643
7649
  return this.rtt > 0 ? Jc(this.rtt) : this._estimatedPingBandwidth;
@@ -7651,13 +7657,13 @@ r(dt, "PING_INTERVAL", 5e3), r(dt, "MAX_MISSED_PINGS", 4), r(dt, "TLS_ROUNDTRIPS
7651
7657
  c.transport.once("error", (h) => o(h)), c.transport.once("open", () => n(c));
7652
7658
  }));
7653
7659
  let Lh = dt;
7654
- var Fn, li, _n;
7660
+ var Nn, li, Vn;
7655
7661
  class SA {
7656
7662
  constructor(e) {
7657
- u(this, Fn);
7663
+ u(this, Nn);
7658
7664
  u(this, li, []);
7659
- u(this, _n);
7660
- l(this, Fn, e);
7665
+ u(this, Vn);
7666
+ l(this, Nn, e);
7661
7667
  }
7662
7668
  /**
7663
7669
  * Select an edge url based on the provided list of edge urls, previous cached edges or the edgeUrl option
@@ -7670,11 +7676,11 @@ class SA {
7670
7676
  * @returns
7671
7677
  */
7672
7678
  select(e) {
7673
- if (a(this, Fn).edgeUrl)
7674
- return a(this, Fn).edgeUrl;
7679
+ if (a(this, Nn).edgeUrl)
7680
+ return a(this, Nn).edgeUrl;
7675
7681
  a(this, li).length === 0 && l(this, li, a(this, li).concat(e));
7676
7682
  const t = a(this, li).shift();
7677
- if (l(this, _n, t), t)
7683
+ if (l(this, Vn, t), t)
7678
7684
  return t;
7679
7685
  }
7680
7686
  /**
@@ -7682,17 +7688,17 @@ class SA {
7682
7688
  * @returns
7683
7689
  */
7684
7690
  shiftedEdge() {
7685
- return a(this, _n);
7691
+ return a(this, Vn);
7686
7692
  }
7687
7693
  /**
7688
7694
  * Resets the cached list of edges
7689
7695
  */
7690
7696
  reset() {
7691
- l(this, _n, void 0), l(this, li, []);
7697
+ l(this, Vn, void 0), l(this, li, []);
7692
7698
  }
7693
7699
  }
7694
- Fn = new WeakMap(), li = new WeakMap(), _n = new WeakMap();
7695
- var bt, Nn, Nt, Vn, Gn, jn, lc, mc, fc, Vl;
7700
+ Nn = new WeakMap(), li = new WeakMap(), Vn = new WeakMap();
7701
+ var bt, Gn, Nt, jn, Wn, zn, lc, mc, fc, Vl;
7696
7702
  const Ns = class Ns {
7697
7703
  constructor(e, t, i) {
7698
7704
  u(this, fc);
@@ -7702,11 +7708,11 @@ const Ns = class Ns {
7702
7708
  r(this, "apiClient");
7703
7709
  r(this, "connectionImpl");
7704
7710
  u(this, bt, !0);
7705
- u(this, Nn);
7706
- u(this, Nt, 0);
7707
- u(this, Vn, 0);
7708
7711
  u(this, Gn);
7709
- u(this, jn);
7712
+ u(this, Nt, 0);
7713
+ u(this, jn, 0);
7714
+ u(this, Wn);
7715
+ u(this, zn);
7710
7716
  r(this, "unload", () => {
7711
7717
  var e;
7712
7718
  this.logger.debug("Unloading module..."), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), this.logger.debug("Unloaded module");
@@ -7721,17 +7727,17 @@ const Ns = class Ns {
7721
7727
  });
7722
7728
  r(this, "getState", () => this.connectionImpl ? this.connectionImpl.getState() : "disconnected");
7723
7729
  r(this, "getStatistics", () => this.connectionImpl ? F(v({}, this.connectionImpl.getStatistics()), {
7724
- connectCount: a(this, Vn),
7730
+ connectCount: a(this, jn),
7725
7731
  connectionAttemptCount: a(this, Nt)
7726
7732
  }) : {
7727
7733
  rtt: { min: 0, max: 0, average: 0, last: 0 },
7728
7734
  estimatedBandwidth: 0,
7729
- connectCount: a(this, Vn),
7735
+ connectCount: a(this, jn),
7730
7736
  connectionAttemptCount: a(this, Nt),
7731
7737
  connectionProtocol: void 0
7732
7738
  });
7733
7739
  r(this, "connect", () => {
7734
- l(this, bt, !0), !a(this, Nn) && l(this, Nn, A(this, fc, Vl).call(this));
7740
+ l(this, bt, !0), !a(this, Gn) && l(this, Gn, A(this, fc, Vl).call(this));
7735
7741
  });
7736
7742
  r(this, "disconnect", (e = "Disconnect Requested") => {
7737
7743
  var t;
@@ -7780,16 +7786,16 @@ const Ns = class Ns {
7780
7786
  * The timestamp when the first connection was made
7781
7787
  */
7782
7788
  get firstConnectionTime() {
7783
- return a(this, Gn);
7789
+ return a(this, Wn);
7784
7790
  }
7785
7791
  /**
7786
7792
  * The timestamp when the last connection was made
7787
7793
  */
7788
7794
  get lastConnectionTime() {
7789
- return a(this, jn);
7795
+ return a(this, zn);
7790
7796
  }
7791
7797
  };
7792
- bt = new WeakMap(), Nn = new WeakMap(), Nt = new WeakMap(), Vn = new WeakMap(), Gn = new WeakMap(), jn = new WeakMap(), lc = new WeakMap(), mc = new WeakMap(), fc = new WeakSet(), Vl = function() {
7798
+ bt = new WeakMap(), Gn = new WeakMap(), Nt = new WeakMap(), jn = new WeakMap(), Wn = new WeakMap(), zn = new WeakMap(), lc = new WeakMap(), mc = new WeakMap(), fc = new WeakSet(), Vl = function() {
7793
7799
  return m(this, null, function* () {
7794
7800
  var t;
7795
7801
  const e = new SA({ edgeUrl: this.config.options.get("edgeUrl") });
@@ -7810,7 +7816,7 @@ bt = new WeakMap(), Nn = new WeakMap(), Nt = new WeakMap(), Vn = new WeakMap(),
7810
7816
  connectInfo: n,
7811
7817
  estimatedRtt: c,
7812
7818
  edgeUrl: h
7813
- }))), e.reset(), vi(this, Vn)._++, l(this, Nt, 0), l(this, jn, Date.now()), a(this, Gn) || l(this, Gn, a(this, jn)), yield this.connectionImpl.closed();
7819
+ }))), e.reset(), vi(this, jn)._++, l(this, Nt, 0), l(this, zn, Date.now()), a(this, Wn) || l(this, Wn, a(this, zn)), yield this.connectionImpl.closed();
7814
7820
  } catch (n) {
7815
7821
  this.logger.info("Failed to connect", n);
7816
7822
  const o = e.shiftedEdge();
@@ -7830,7 +7836,7 @@ bt = new WeakMap(), Nn = new WeakMap(), Nt = new WeakMap(), Vn = new WeakMap(),
7830
7836
  if (yield ps(1e3), !a(this, bt))
7831
7837
  break;
7832
7838
  }
7833
- l(this, Nn, void 0);
7839
+ l(this, Gn, void 0);
7834
7840
  });
7835
7841
  }, r(Ns, "PING_TIMEOUT", 1e3), r(Ns, "create", (e, t, i) => new Ns(e, t, i));
7836
7842
  let Dh = Ns;
@@ -7848,7 +7854,7 @@ const Kc = () => ({
7848
7854
  }), Vs = class Vs {
7849
7855
  constructor(e, t, i, n) {
7850
7856
  r(this, "emitter");
7851
- r(this, "timers", new ge());
7857
+ r(this, "timers", new Ae());
7852
7858
  r(this, "pictureInPictureSource");
7853
7859
  r(this, "element");
7854
7860
  r(this, "currentCap");
@@ -7910,8 +7916,8 @@ const Kc = () => ({
7910
7916
  }
7911
7917
  const i = this.renditionLevelSource.getRenditionLevels().find((g) => {
7912
7918
  if (g.video) {
7913
- const w = g.video.width / g.video.height, b = e.video.width / e.video.height;
7914
- return w > b ? g.video.width > e.video.width : g.video.height > e.video.height;
7919
+ const w = g.video.width / g.video.height, y = e.video.width / e.video.height;
7920
+ return w > y ? g.video.width > e.video.width : g.video.height > e.video.height;
7915
7921
  }
7916
7922
  });
7917
7923
  i && i.video && (e.video.width = i.video.width, e.video.height = i.video.height);
@@ -7940,7 +7946,7 @@ let Oh = Vs;
7940
7946
  const TA = 5, IA = 100, CA = 1e3;
7941
7947
  class nd {
7942
7948
  constructor(e, t, i, n) {
7943
- r(this, "timers", ge.create());
7949
+ r(this, "timers", Ae.create());
7944
7950
  r(this, "logger");
7945
7951
  r(this, "emitter");
7946
7952
  r(this, "trackContexts");
@@ -8047,23 +8053,23 @@ class nd {
8047
8053
  for (const h of i)
8048
8054
  switch (h.type) {
8049
8055
  case "audio": {
8050
- const { OpusDecoderContext: d } = yield import("./UM-nmkfd.js");
8056
+ const { OpusDecoderContext: d } = yield import("./DoM6G3ta.js");
8051
8057
  c.set(h.type, {
8052
8058
  buffer: [],
8053
8059
  decoderContext: yield d.create(48e3, 2),
8054
- decodeTime: new fe(100),
8055
- transportTime: new fe(100),
8060
+ decodeTime: new pe(100),
8061
+ transportTime: new pe(100),
8056
8062
  sampleDuration: 40
8057
8063
  });
8058
8064
  break;
8059
8065
  }
8060
8066
  case "video": {
8061
- const { H264DecoderWorkerContext: d } = yield import("./DxbpB13l.js");
8067
+ const { H264DecoderWorkerContext: d } = yield import("./Du4X7GdA.js");
8062
8068
  c.set(h.type, {
8063
8069
  buffer: [],
8064
8070
  decoderContext: yield d.create(o),
8065
- decodeTime: new fe(100),
8066
- transportTime: new fe(100),
8071
+ decodeTime: new pe(100),
8072
+ transportTime: new pe(100),
8067
8073
  sampleDuration: 40
8068
8074
  });
8069
8075
  break;
@@ -8132,7 +8138,7 @@ const kA = (s) => (e, t, i) => e.timestamp <= t || e.timestampAdded <= i - s, Ht
8132
8138
  r(this, "waitingEvents", []);
8133
8139
  r(this, "isTriggered", kA(Ht.EVENT_TIMEOUT));
8134
8140
  r(this, "timeSource");
8135
- r(this, "timers", new ge());
8141
+ r(this, "timers", new Ae());
8136
8142
  r(this, "load", () => {
8137
8143
  this.timers.setInterval(this.onBufferedStateChanged, Ht.EVENT_CHECK_INTERVAL), this.emitter.on("add event", this.addEvent);
8138
8144
  });
@@ -8171,7 +8177,7 @@ let Fh = Ht;
8171
8177
  const qe = class qe {
8172
8178
  constructor(e) {
8173
8179
  r(this, "emitter");
8174
- r(this, "timers", ge.create());
8180
+ r(this, "timers", Ae.create());
8175
8181
  r(this, "bytesReceived", /* @__PURE__ */ new Map());
8176
8182
  r(this, "timeoutInterval");
8177
8183
  r(this, "lastBytesUpdated", Date.now());
@@ -8230,7 +8236,7 @@ const BA = () => window.AudioContext || window.webkitAudioContext, gc = class gc
8230
8236
  super();
8231
8237
  // TODO: Checkout what happens when limit is reached
8232
8238
  r(this, "context", new (BA())());
8233
- r(this, "timers", ge.create());
8239
+ r(this, "timers", Ae.create());
8234
8240
  r(this, "previousCurrentTime", 0);
8235
8241
  r(this, "_isStuck", !1);
8236
8242
  r(this, "mediaStreamDestination");
@@ -8290,8 +8296,8 @@ const Ac = class Ac extends gi {
8290
8296
  r(this, "samples", new Float32Array(new ArrayBuffer(5 * 960 * 4 * 2)));
8291
8297
  // 100 ms flush interval
8292
8298
  // 500 samples == max 10 seconds buffer for instant activation of audio (assuming that each sample has 960 samples and 48000hz)
8293
- r(this, "preInitSampleQueue", new fe(500));
8294
- r(this, "unplayedBufferSources", new fe(100));
8299
+ r(this, "preInitSampleQueue", new pe(500));
8300
+ r(this, "unplayedBufferSources", new pe(100));
8295
8301
  r(this, "sampleRate", 48e3);
8296
8302
  r(this, "channels", 2);
8297
8303
  r(this, "index", 0);
@@ -8501,13 +8507,13 @@ class RA {
8501
8507
  throw new Error("Failed to create audio tag");
8502
8508
  }
8503
8509
  }
8504
- var ja, yt, me, ds, Xe, jl, Rs, Wl;
8510
+ var ja, yt, fe, ds, Xe, jl, Rs, Wl;
8505
8511
  class UA {
8506
8512
  constructor() {
8507
8513
  u(this, Xe);
8508
8514
  u(this, ja, []);
8509
8515
  u(this, yt, document.createElement("canvas"));
8510
- u(this, me);
8516
+ u(this, fe);
8511
8517
  u(this, ds, window.devicePixelRatio || 1);
8512
8518
  r(this, "config", {
8513
8519
  backgroundColor: "rgba(0,0,0,0.6)",
@@ -8518,7 +8524,7 @@ class UA {
8518
8524
  const e = a(this, yt).getContext("2d", { alpha: !0 });
8519
8525
  if (!e)
8520
8526
  throw new Error("Failed to create 2d context");
8521
- l(this, me, e), A(this, Xe, Rs).call(this);
8527
+ l(this, fe, e), A(this, Xe, Rs).call(this);
8522
8528
  }
8523
8529
  get canvas() {
8524
8530
  return a(this, yt);
@@ -8530,7 +8536,7 @@ class UA {
8530
8536
  const i = a(this, ja).flatMap((h) => h.text.split(`
8531
8537
  `).flatMap((f) => A(this, Xe, Wl).call(this, f, e.width)).map((f) => {
8532
8538
  A(this, Xe, Rs).call(this);
8533
- const p = a(this, me).measureText(f);
8539
+ const p = a(this, fe).measureText(f);
8534
8540
  return {
8535
8541
  text: f,
8536
8542
  measurement: p,
@@ -8541,23 +8547,23 @@ class UA {
8541
8547
  };
8542
8548
  })), n = Math.max(...i.map((h) => h.size.width)), o = i.reduce((h, { size: d }) => h + d.height, 0) + (i.length - 1) * this.config.lineGap;
8543
8549
  let c = 0;
8544
- A(this, Xe, jl).call(this, n, o), a(this, me).clearRect(0, 0, a(this, yt).width, a(this, yt).height);
8550
+ A(this, Xe, jl).call(this, n, o), a(this, fe).clearRect(0, 0, a(this, yt).width, a(this, yt).height);
8545
8551
  for (const { size: h, text: d } of i)
8546
- A(this, Xe, Rs).call(this), a(this, me).fillStyle = this.config.backgroundColor, a(this, me).fillRect(0, c, h.width, h.height), A(this, Xe, Rs).call(this), a(this, me).fillText(d, this.config.textPadding, c + this.config.textPadding), c += h.height + this.config.lineGap;
8547
- t && (a(this, me).strokeStyle = "red", a(this, me).strokeRect(0, 0, e.width, a(this, yt).height));
8552
+ A(this, Xe, Rs).call(this), a(this, fe).fillStyle = this.config.backgroundColor, a(this, fe).fillRect(0, c, h.width, h.height), A(this, Xe, Rs).call(this), a(this, fe).fillText(d, this.config.textPadding, c + this.config.textPadding), c += h.height + this.config.lineGap;
8553
+ t && (a(this, fe).strokeStyle = "red", a(this, fe).strokeRect(0, 0, e.width, a(this, yt).height));
8548
8554
  }
8549
8555
  }
8550
- ja = new WeakMap(), yt = new WeakMap(), me = new WeakMap(), ds = new WeakMap(), Xe = new WeakSet(), jl = function(e, t) {
8551
- a(this, yt).width = e * a(this, ds), a(this, yt).height = t * a(this, ds), a(this, me).scale(a(this, ds), a(this, ds)), this.canvas.style.width = `${e}px`, this.canvas.style.height = `${t}px`;
8556
+ ja = new WeakMap(), yt = new WeakMap(), fe = new WeakMap(), ds = new WeakMap(), Xe = new WeakSet(), jl = function(e, t) {
8557
+ a(this, yt).width = e * a(this, ds), a(this, yt).height = t * a(this, ds), a(this, fe).scale(a(this, ds), a(this, ds)), this.canvas.style.width = `${e}px`, this.canvas.style.height = `${t}px`;
8552
8558
  }, Rs = function() {
8553
- a(this, me).fillStyle = "white", a(this, me).textAlign = "left", a(this, me).textBaseline = "top", a(this, me).font = `${this.config.fontSize} sans-serif`;
8559
+ a(this, fe).fillStyle = "white", a(this, fe).textAlign = "left", a(this, fe).textBaseline = "top", a(this, fe).font = `${this.config.fontSize} sans-serif`;
8554
8560
  }, Wl = function(e, t) {
8555
8561
  const i = [], n = e.split(" ");
8556
8562
  let o = "";
8557
8563
  for (; n.length > 0; ) {
8558
8564
  A(this, Xe, Rs).call(this);
8559
8565
  let c = 0;
8560
- for (; a(this, me).measureText(o + (o.length > 0 ? " " : "") + n[0]).width + this.config.textPadding * 2 <= t && n.length > 0; )
8566
+ for (; a(this, fe).measureText(o + (o.length > 0 ? " " : "") + n[0]).width + this.config.textPadding * 2 <= t && n.length > 0; )
8561
8567
  c++, o += (o.length > 0 ? " " : "") + n.shift();
8562
8568
  if (c == 0) {
8563
8569
  i.push(n.shift() || ""), o = "";
@@ -8640,10 +8646,10 @@ void main() {
8640
8646
  }
8641
8647
  return i;
8642
8648
  };
8643
- var wc, N, Wa, za, Ha, fi, zn, zl, Hl, bc;
8649
+ var wc, N, Wa, za, Ha, fi, Xn, zl, Hl, bc;
8644
8650
  class LA {
8645
8651
  constructor(e) {
8646
- u(this, zn);
8652
+ u(this, Xn);
8647
8653
  u(this, wc, 96);
8648
8654
  u(this, N);
8649
8655
  u(this, Wa);
@@ -8677,7 +8683,7 @@ class LA {
8677
8683
  }
8678
8684
  render(e) {
8679
8685
  const t = this.subtitleRenderer.canvas, i = (e.padding + a(this, wc)) * window.devicePixelRatio;
8680
- t.width !== 0 && (a(this, N).useProgram(a(this, fi)), A(this, zn, zl).call(this), A(this, zn, Hl).call(this, this.subtitleRenderer.canvas.width / e.width, this.subtitleRenderer.canvas.height / e.height, -this.subtitleRenderer.canvas.width / e.width / 2, -(1 - (this.subtitleRenderer.canvas.height + i) / e.height)), a(this, N).uniform1i(a(this, N).getUniformLocation(a(this, fi), "texture"), 4), a(this, N).activeTexture(a(this, N).TEXTURE4), a(this, N).bindTexture(a(this, N).TEXTURE_2D, a(this, Wa)), a(this, N).enable(a(this, N).BLEND), a(this, N).blendFunc(a(this, N).SRC_ALPHA, a(this, N).ONE_MINUS_SRC_ALPHA), a(this, N).texImage2D(
8686
+ t.width !== 0 && (a(this, N).useProgram(a(this, fi)), A(this, Xn, zl).call(this), A(this, Xn, Hl).call(this, this.subtitleRenderer.canvas.width / e.width, this.subtitleRenderer.canvas.height / e.height, -this.subtitleRenderer.canvas.width / e.width / 2, -(1 - (this.subtitleRenderer.canvas.height + i) / e.height)), a(this, N).uniform1i(a(this, N).getUniformLocation(a(this, fi), "texture"), 4), a(this, N).activeTexture(a(this, N).TEXTURE4), a(this, N).bindTexture(a(this, N).TEXTURE_2D, a(this, Wa)), a(this, N).enable(a(this, N).BLEND), a(this, N).blendFunc(a(this, N).SRC_ALPHA, a(this, N).ONE_MINUS_SRC_ALPHA), a(this, N).texImage2D(
8681
8687
  a(this, N).TEXTURE_2D,
8682
8688
  0,
8683
8689
  a(this, N).RGBA,
@@ -8687,7 +8693,7 @@ class LA {
8687
8693
  ), a(this, N).texParameteri(a(this, N).TEXTURE_2D, a(this, N).TEXTURE_MAG_FILTER, a(this, N).LINEAR), a(this, N).drawArrays(a(this, N).TRIANGLE_STRIP, 0, 4));
8688
8694
  }
8689
8695
  }
8690
- wc = new WeakMap(), N = new WeakMap(), Wa = new WeakMap(), za = new WeakMap(), Ha = new WeakMap(), fi = new WeakMap(), zn = new WeakSet(), zl = function() {
8696
+ wc = new WeakMap(), N = new WeakMap(), Wa = new WeakMap(), za = new WeakMap(), Ha = new WeakMap(), fi = new WeakMap(), Xn = new WeakSet(), zl = function() {
8691
8697
  const e = a(this, N).getAttribLocation(a(this, fi), "position");
8692
8698
  a(this, N).enableVertexAttribArray(e), a(this, N).vertexAttribPointer(e, 2, a(this, N).FLOAT, !1, 0, 0);
8693
8699
  }, Hl = function(e, t, i, n) {
@@ -8731,14 +8737,14 @@ void main() {
8731
8737
  stencil: !1,
8732
8738
  antialias: !1,
8733
8739
  premultipliedAlpha: !1
8734
- }, Er = class Er extends gi {
8740
+ }, Ir = class Ir extends gi {
8735
8741
  constructor() {
8736
8742
  super();
8737
8743
  r(this, "canvas", document.createElement("canvas"));
8738
8744
  r(this, "context", Gd(this.canvas, Xd));
8739
8745
  r(this, "pixelShader", Us(this.context, this.context.FRAGMENT_SHADER, Wd));
8740
8746
  r(this, "vertexShader", Us(this.context, this.context.VERTEX_SHADER, zd));
8741
- r(this, "buffer", jd(this.context, Er.SQUARE_VERTICES));
8747
+ r(this, "buffer", jd(this.context, Ir.SQUARE_VERTICES));
8742
8748
  r(this, "program", Vh(this.context, this.vertexShader, this.pixelShader));
8743
8749
  r(this, "textures", {
8744
8750
  y: Bi(this.context),
@@ -8754,7 +8760,7 @@ void main() {
8754
8760
  this.emit("context lost", tf(i)), t.preventDefault();
8755
8761
  });
8756
8762
  r(this, "onContextRestored", () => {
8757
- this.emit("context restored"), this.context = Gd(this.canvas, Xd), this.pixelShader = Us(this.context, this.context.FRAGMENT_SHADER, Wd), this.vertexShader = Us(this.context, this.context.VERTEX_SHADER, zd), this.buffer = jd(this.context, Er.SQUARE_VERTICES), this.program = Vh(this.context, this.vertexShader, this.pixelShader), this.textures = {
8763
+ this.emit("context restored"), this.context = Gd(this.canvas, Xd), this.pixelShader = Us(this.context, this.context.FRAGMENT_SHADER, Wd), this.vertexShader = Us(this.context, this.context.VERTEX_SHADER, zd), this.buffer = jd(this.context, Ir.SQUARE_VERTICES), this.program = Vh(this.context, this.vertexShader, this.pixelShader), this.textures = {
8758
8764
  y: Bi(this.context),
8759
8765
  u: Bi(this.context),
8760
8766
  v: Bi(this.context)
@@ -8870,8 +8876,8 @@ void main() {
8870
8876
  return this.textRenderer || (this.textRenderer = new LA(this.context)), this.textRenderer;
8871
8877
  }
8872
8878
  };
8873
- r(Er, "SQUARE_VERTICES", new Float32Array([0, 0, 0, 1, 1, 0, 1, 1]));
8874
- let Gh = Er;
8879
+ r(Ir, "SQUARE_VERTICES", new Float32Array([0, 0, 0, 1, 1, 0, 1, 1]));
8880
+ let Gh = Ir;
8875
8881
  const yc = class yc {
8876
8882
  constructor(e, t, i, n) {
8877
8883
  r(this, "oldTimestampLimit", 400);
@@ -8950,7 +8956,7 @@ const vc = class vc {
8950
8956
  r(this, "unmuter", new RA());
8951
8957
  r(this, "_isPaused", !1);
8952
8958
  r(this, "isDisconnected", !1);
8953
- r(this, "timers", new ge());
8959
+ r(this, "timers", new Ae());
8954
8960
  r(this, "textTracks", new Gl());
8955
8961
  r(this, "playbackRate");
8956
8962
  r(this, "reset", () => {
@@ -9064,7 +9070,7 @@ const Sc = class Sc {
9064
9070
  r(this, "pool");
9065
9071
  r(this, "isDisconnected", !0);
9066
9072
  r(this, "_userProvidedMuted", !1);
9067
- r(this, "timers", new ge());
9073
+ r(this, "timers", new Ae());
9068
9074
  r(this, "volumeState");
9069
9075
  r(this, "textTracks", new Gl());
9070
9076
  r(this, "reset", () => {
@@ -9244,7 +9250,7 @@ class FA {
9244
9250
  class Ql extends gi {
9245
9251
  constructor() {
9246
9252
  super();
9247
- r(this, "MediaSource", Tr());
9253
+ r(this, "MediaSource", Cr());
9248
9254
  r(this, "mediaSource", new this.MediaSource());
9249
9255
  r(this, "isOpen", () => this.mediaSource.readyState === "open");
9250
9256
  r(this, "isClosed", () => this.mediaSource.readyState === "closed");
@@ -9301,7 +9307,7 @@ class Ql extends gi {
9301
9307
  }
9302
9308
  r(Ql, "isTypeSupported", (t) => {
9303
9309
  var i, n;
9304
- return (n = (i = Tr()) == null ? void 0 : i.isTypeSupported(t)) != null ? n : !1;
9310
+ return (n = (i = Cr()) == null ? void 0 : i.isTypeSupported(t)) != null ? n : !1;
9305
9311
  });
9306
9312
  class Zl {
9307
9313
  constructor() {
@@ -9349,7 +9355,7 @@ const Ec = class Ec {
9349
9355
  r(this, "minConsecutiveErrorsBeforeEmit", 5);
9350
9356
  r(this, "maxSecondsInBuffer", 60);
9351
9357
  r(this, "logger");
9352
- r(this, "timers", ge.create());
9358
+ r(this, "timers", Ae.create());
9353
9359
  r(this, "emitter");
9354
9360
  r(this, "mediaElement");
9355
9361
  r(this, "mediaSource", new Ql());
@@ -9501,7 +9507,7 @@ const Ec = class Ec {
9501
9507
  channelId: n,
9502
9508
  renditionId: o
9503
9509
  }) => {
9504
- const c = e.mediaType(), h = e.rawBytes(), d = e.header().rawBytes(), f = e.baseMediaDecodeTime(), p = e.timescale(), g = e.duration(), w = c === "video" ? e.startsWithKeyframe() : !0, b = e.compositionTimeOffset(0);
9510
+ const c = e.mediaType(), h = e.rawBytes(), d = e.header().rawBytes(), f = e.baseMediaDecodeTime(), p = e.timescale(), g = e.duration(), w = c === "video" ? e.startsWithKeyframe() : !0, y = e.compositionTimeOffset(0);
9505
9511
  if (c === "text") {
9506
9512
  this.logger.warn("Skipping unexpected text fragment");
9507
9513
  return;
@@ -9527,7 +9533,7 @@ const Ec = class Ec {
9527
9533
  isSync: w,
9528
9534
  codec: i,
9529
9535
  fragment: e,
9530
- compositionTimeOffset: b
9536
+ compositionTimeOffset: y
9531
9537
  };
9532
9538
  this.onCodedSample(x);
9533
9539
  });
@@ -9713,9 +9719,9 @@ const Qh = () => ({
9713
9719
  r(this, "minBufferFullnessLengthForRegression", 6);
9714
9720
  r(this, "logger");
9715
9721
  r(this, "emitter");
9716
- r(this, "timers", ge.create());
9722
+ r(this, "timers", Ae.create());
9717
9723
  r(this, "metrics", VA());
9718
- r(this, "bufferFullness", new fe(30));
9724
+ r(this, "bufferFullness", new pe(30));
9719
9725
  r(this, "bufferFullnessRegression");
9720
9726
  r(this, "currentLevel");
9721
9727
  r(this, "isSuspended", !1);
@@ -9783,9 +9789,9 @@ const Qh = () => ({
9783
9789
  var d, f, p, g;
9784
9790
  const t = this.timeSpentBuffering(), i = this.timeActive(), n = this.bufferingRatios(), o = this.activeRatios(), c = ((f = (d = e.video) == null ? void 0 : d.bitRate) != null ? f : 0) + ((g = (p = e.audio) == null ? void 0 : p.bitRate) != null ? g : 0), h = t / i;
9785
9791
  return Object.keys(this.metrics.levels).map((w) => parseInt(w, 10)).filter((w) => w >= c).reduce(
9786
- (w, b) => {
9792
+ (w, y) => {
9787
9793
  var S, x;
9788
- return ((S = o.get(b.toString())) != null ? S : 0) - ((x = n.get(b.toString())) != null ? x : 0) * h + w;
9794
+ return ((S = o.get(y.toString())) != null ? S : 0) - ((x = n.get(y.toString())) != null ? x : 0) * h + w;
9789
9795
  },
9790
9796
  0
9791
9797
  );
@@ -9799,8 +9805,8 @@ const Qh = () => ({
9799
9805
  fatalQosCount: this.fatalQosCount
9800
9806
  }));
9801
9807
  r(this, "onRenditionLevelChanged", (e) => {
9802
- var o, c, h, d, f, p, g, w, b, S, x, R, D, E;
9803
- const t = ((h = (c = (o = e.from) == null ? void 0 : o.video) == null ? void 0 : c.bitRate) != null ? h : 0) + ((p = (f = (d = e.from) == null ? void 0 : d.audio) == null ? void 0 : f.bitRate) != null ? p : 0), i = ((b = (w = (g = e.to) == null ? void 0 : g.video) == null ? void 0 : w.bitRate) != null ? b : 0) + ((R = (x = (S = e.to) == null ? void 0 : S.audio) == null ? void 0 : x.bitRate) != null ? R : 0);
9808
+ var o, c, h, d, f, p, g, w, y, S, x, R, D, E;
9809
+ const t = ((h = (c = (o = e.from) == null ? void 0 : o.video) == null ? void 0 : c.bitRate) != null ? h : 0) + ((p = (f = (d = e.from) == null ? void 0 : d.audio) == null ? void 0 : f.bitRate) != null ? p : 0), i = ((y = (w = (g = e.to) == null ? void 0 : g.video) == null ? void 0 : w.bitRate) != null ? y : 0) + ((R = (x = (S = e.to) == null ? void 0 : S.audio) == null ? void 0 : x.bitRate) != null ? R : 0);
9804
9810
  this.logger.info("rendition level changed", { fromLevel: t, toLevel: i }), this.metrics.general.activeRanges.length === 0 && this.setActive(), e.from && e.to && (t < i ? this.metrics.general.upgradesFromLevel.push(Date.now()) : this.metrics.general.downgradesFromLevel.push(Date.now()));
9805
9811
  let n = !1;
9806
9812
  if (e.from) {
@@ -9963,9 +9969,9 @@ const kc = class kc {
9963
9969
  var p;
9964
9970
  const { video: t, audio: i, channelId: n } = e, o = (p = this.renditions.get(n)) != null ? p : [], c = o.filter(ms).filter((g) => t && g.codec === t.codec), h = o.filter(fs).filter((g) => i && g.codec === i.codec && g.language === i.language), d = Math.max(c.length, h.length), f = [];
9965
9971
  for (let g = 0; g < d; g++) {
9966
- const w = c[Math.min(c.length - 1, g)], b = h[Math.min(h.length - 1, g)];
9972
+ const w = c[Math.min(c.length - 1, g)], y = h[Math.min(h.length - 1, g)];
9967
9973
  f.push({
9968
- audio: b,
9974
+ audio: y,
9969
9975
  video: w
9970
9976
  });
9971
9977
  }
@@ -9977,10 +9983,10 @@ const kc = class kc {
9977
9983
  };
9978
9984
  r(kc, "create", (e, t) => new kc(e, t));
9979
9985
  let qh = kc;
9980
- const $n = (s) => JSON.parse(JSON.stringify(s)), GA = 1e4, Bc = class Bc {
9986
+ const Jn = (s) => JSON.parse(JSON.stringify(s)), GA = 1e4, Bc = class Bc {
9981
9987
  constructor(e, t, i) {
9982
9988
  r(this, "logger");
9983
- r(this, "timers", new ge());
9989
+ r(this, "timers", new Ae());
9984
9990
  r(this, "emitter");
9985
9991
  r(this, "targetSubscription");
9986
9992
  r(this, "currentSubscription");
@@ -10031,13 +10037,13 @@ const $n = (s) => JSON.parse(JSON.stringify(s)), GA = 1e4, Bc = class Bc {
10031
10037
  return !vs(yd(this.currentSubscription, e), yd(this.targetSubscription, e));
10032
10038
  });
10033
10039
  r(this, "onSubscriptionChanged", ({ to: e, reset: t }) => {
10034
- this.logger.debug("onSubscriptionChanged", { to: e, reset: t }), t ? this.targetSubscription = $n(this.currentSubscription) : this.currentSubscription = $n(e), this._isSwitchingSubscription = this.isNewSubscription();
10040
+ this.logger.debug("onSubscriptionChanged", { to: e, reset: t }), t ? this.targetSubscription = Jn(this.currentSubscription) : this.currentSubscription = Jn(e), this._isSwitchingSubscription = this.isNewSubscription();
10035
10041
  });
10036
10042
  r(this, "scheduleSubscriptionChange", () => {
10037
- this.targetSubscription = $n(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
10043
+ this.targetSubscription = Jn(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
10038
10044
  const e = this.currentSubscription.channelId, t = this.targetSubscription.channelId, i = e !== t;
10039
10045
  this._isSwitchingSubscription && (i && this.burstMs ? this.setBurst(this.burstMs) : this.setBurst(0), this.pendingSubscriptionTimeoutId && (this.timers.clearTimeout(this.pendingSubscriptionTimeoutId), this.pendingSubscriptionTimeoutId = void 0), i && this.timers.setTimeout(() => {
10040
- this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = $n(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
10046
+ this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = Jn(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
10041
10047
  }, GA), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(
10042
10048
  () => this.emitter.emit("send signal", {
10043
10049
  type: "subscribe",
@@ -10046,7 +10052,7 @@ const $n = (s) => JSON.parse(JSON.stringify(s)), GA = 1e4, Bc = class Bc {
10046
10052
  0
10047
10053
  ));
10048
10054
  });
10049
- this.logger = e, this.targetSubscription = t, this.currentSubscription = $n(t), this.emitter = i, this.emitter.on("subscription changed", this.onSubscriptionChanged);
10055
+ this.logger = e, this.targetSubscription = t, this.currentSubscription = Jn(t), this.emitter = i, this.emitter.on("subscription changed", this.onSubscriptionChanged);
10050
10056
  }
10051
10057
  };
10052
10058
  r(Bc, "create", (e, t, i) => new Bc(e, i, t));
@@ -10057,7 +10063,7 @@ const $d = 5e3, jA = () => wu() || Lc() || fm(), Yd = () => jA() ? 100 : 0, Jd =
10057
10063
  r(this, "logger");
10058
10064
  r(this, "playbackSource");
10059
10065
  r(this, "bufferSource");
10060
- r(this, "keyframeTimestamps", new fe(10));
10066
+ r(this, "keyframeTimestamps", new pe(10));
10061
10067
  r(this, "lastSeekTime", Date.now());
10062
10068
  r(this, "seekCooldownTime", 1e3);
10063
10069
  r(this, "seekTimeoutTime", 5e3);
@@ -10091,7 +10097,7 @@ const $d = 5e3, jA = () => wu() || Lc() || fm(), Yd = () => jA() ? 100 : 0, Jd =
10091
10097
  * The max difference tolerated between server side sync info and local estimation
10092
10098
  */
10093
10099
  r(this, "maxTimeSyncDifferenceTolerance", 150);
10094
- r(this, "timers", ge.create());
10100
+ r(this, "timers", Ae.create());
10095
10101
  r(this, "rtt", 0);
10096
10102
  r(this, "channelSyncInfo", /* @__PURE__ */ new Map());
10097
10103
  r(this, "driftAdjustmentsCount", 0);
@@ -10311,7 +10317,7 @@ const $d = 5e3, jA = () => wu() || Lc() || fm(), Yd = () => jA() ? 100 : 0, Jd =
10311
10317
  if (this.isSuspended)
10312
10318
  return;
10313
10319
  if (!n || !o) {
10314
- this.logger.info("Initial timing info", { syncInfo: t }), this.channelSyncInfo.set(e, F(v({}, t), { localTimestamp: i, timeDifferences: new fe(12) }));
10320
+ this.logger.info("Initial timing info", { syncInfo: t }), this.channelSyncInfo.set(e, F(v({}, t), { localTimestamp: i, timeDifferences: new pe(12) }));
10315
10321
  return;
10316
10322
  }
10317
10323
  const c = t.wallclockTime - n.wallclockTime, h = t.timestamp - n.timestamp, d = i - n.localTimestamp, f = h - d;
@@ -10327,7 +10333,7 @@ const $d = 5e3, jA = () => wu() || Lc() || fm(), Yd = () => jA() ? 100 : 0, Jd =
10327
10333
  }), Math.abs(f) >= this.bufferSource.getTargetBufferTime() * 2) {
10328
10334
  this.logger.info("Resetting sync info", { diffFromEstimated: f }), this.channelSyncInfo.set(e, F(v({}, t), {
10329
10335
  localTimestamp: i,
10330
- timeDifferences: new fe(n.timeDifferences.maxSize + 1)
10336
+ timeDifferences: new pe(n.timeDifferences.maxSize + 1)
10331
10337
  })), this.currentChannelId && this.currentChannelId === e && (this.reset(), this.emitter.emit("channel reset"));
10332
10338
  return;
10333
10339
  }
@@ -10340,7 +10346,7 @@ const $d = 5e3, jA = () => wu() || Lc() || fm(), Yd = () => jA() ? 100 : 0, Jd =
10340
10346
  const i = this.channelSyncInfo.get(t);
10341
10347
  if (!i)
10342
10348
  return;
10343
- const n = Hn(i.timeDifferences.items());
10349
+ const n = Qn(i.timeDifferences.items());
10344
10350
  Math.abs(n) > e && (this.logger.info("Adjusting sync info", { averageDifference: n }), i.timestamp += n, i.timeDifferences.clear());
10345
10351
  }
10346
10352
  /**
@@ -10374,11 +10380,11 @@ const WA = {
10374
10380
  }, eh = (s, e) => F(v({}, e), { type: s, timestamp: (/* @__PURE__ */ new Date()).toISOString(), discriminator: "web" }), Uc = class Uc {
10375
10381
  constructor(e, t, i, n) {
10376
10382
  r(this, "logger");
10377
- r(this, "timers", new ge());
10383
+ r(this, "timers", new Ae());
10378
10384
  r(this, "emitter");
10379
10385
  r(this, "options");
10380
10386
  r(this, "parentContext");
10381
- r(this, "unsentLines", new fe(100));
10387
+ r(this, "unsentLines", new pe(100));
10382
10388
  r(this, "retries", 0);
10383
10389
  r(this, "errorCount", 0);
10384
10390
  r(this, "eventCount", 0);
@@ -10459,7 +10465,7 @@ const Pc = class Pc {
10459
10465
  r(this, "logger");
10460
10466
  r(this, "element");
10461
10467
  r(this, "documentState");
10462
- r(this, "timers", new ge());
10468
+ r(this, "timers", new Ae());
10463
10469
  r(this, "unload", () => {
10464
10470
  this.timers.unload();
10465
10471
  });
@@ -10475,8 +10481,8 @@ const zA = 6, HA = (s) => {
10475
10481
  let e = [s], t = 0, i = 0, n = !1;
10476
10482
  const o = (h, d) => {
10477
10483
  var R, D, E;
10478
- h.flags && nr(h.flags) && (t = (R = h.compositionTimeOffset) != null ? R : 0), h.timestamp += t, h.compositionTimeOffset = ((D = h.compositionTimeOffset) != null ? D : 0) - t;
10479
- const f = h.timestamp / h.timescale, g = d.flags && nr(d.flags) ? (E = d.compositionTimeOffset) != null ? E : 0 : t, b = (d.timestamp + g) / d.timescale, S = Math.max(0, Math.round((b - f) * h.timescale));
10484
+ h.flags && ar(h.flags) && (t = (R = h.compositionTimeOffset) != null ? R : 0), h.timestamp += t, h.compositionTimeOffset = ((D = h.compositionTimeOffset) != null ? D : 0) - t;
10485
+ const f = h.timestamp / h.timescale, g = d.flags && ar(d.flags) ? (E = d.compositionTimeOffset) != null ? E : 0 : t, y = (d.timestamp + g) / d.timescale, S = Math.max(0, Math.round((y - f) * h.timescale));
10480
10486
  return S > 0 && (i = S), F(v({}, h), {
10481
10487
  /*
10482
10488
  During resync timeshifts we may end up with negative durations (normalized to 0 above) which is not allowed in mse (the MseModule
@@ -10486,17 +10492,17 @@ const zA = 6, HA = (s) => {
10486
10492
  });
10487
10493
  };
10488
10494
  return (h, d = !1) => {
10489
- if (h.flags && nr(h.flags) && d && (n = !n), !(d && e.length < zA && n) && e.length > 0) {
10495
+ if (h.flags && ar(h.flags) && d && (n = !n), !(d && e.length < zA && n) && e.length > 0) {
10490
10496
  n = !1;
10491
10497
  let p = h;
10492
10498
  for (let w = e.length - 1; w > 0; w--) {
10493
- const b = e[w];
10494
- if (!b || !p)
10499
+ const y = e[w];
10500
+ if (!y || !p)
10495
10501
  break;
10496
- b.timestamp >= p.timestamp ? e.splice(w, 1) : p = b;
10502
+ y.timestamp >= p.timestamp ? e.splice(w, 1) : p = y;
10497
10503
  }
10498
10504
  const g = e.map(
10499
- (w, b) => o(w, e[b + 1] || h)
10505
+ (w, y) => o(w, e[y + 1] || h)
10500
10506
  );
10501
10507
  return e = [h], g;
10502
10508
  }
@@ -10507,7 +10513,7 @@ const zA = 6, HA = (s) => {
10507
10513
  return v(F(v({}, s), {
10508
10514
  type: "video",
10509
10515
  codec: e.codec,
10510
- isSync: nr(s.flags),
10516
+ isSync: ar(s.flags),
10511
10517
  data: s.payload,
10512
10518
  duration: 0,
10513
10519
  width: e.width,
@@ -10521,7 +10527,7 @@ const zA = 6, HA = (s) => {
10521
10527
  sampleRate: e.sampleRate,
10522
10528
  codec: e.codec,
10523
10529
  language: e.language,
10524
- isSync: nr(s.flags),
10530
+ isSync: ar(s.flags),
10525
10531
  data: s.payload,
10526
10532
  duration: 0
10527
10533
  });
@@ -10546,9 +10552,9 @@ class QA {
10546
10552
  if (self.navigator.userAgentData && this.highEntropyValues) {
10547
10553
  const g = "1", w = [...(c = this.highEntropyValues.brands) != null ? c : []];
10548
10554
  w.sort((E, U) => E.brand.localeCompare(U.brand));
10549
- const b = [...(h = this.highEntropyValues.fullVersionList) != null ? h : []];
10550
- b.sort((E, U) => E.brand.localeCompare(U.brand));
10551
- const S = b.map((E) => E.version), x = w.map((E) => E.brand), R = w.map((E) => E.version), D = parseInt((f = (d = this.highEntropyValues.platformVersion) == null ? void 0 : d.split(".")[0]) != null ? f : g);
10555
+ const y = [...(h = this.highEntropyValues.fullVersionList) != null ? h : []];
10556
+ y.sort((E, U) => E.brand.localeCompare(U.brand));
10557
+ const S = y.map((E) => E.version), x = w.map((E) => E.brand), R = w.map((E) => E.version), D = parseInt((f = (d = this.highEntropyValues.platformVersion) == null ? void 0 : d.split(".")[0]) != null ? f : g);
10552
10558
  return v({
10553
10559
  userAgentLegacy: window.navigator.userAgent,
10554
10560
  ua: {
@@ -10585,13 +10591,14 @@ const ZA = (s) => {
10585
10591
  var us, Me, ls;
10586
10592
  const Ve = class Ve extends gi {
10587
10593
  constructor(t) {
10588
- var be, ye;
10594
+ var ye, ve;
10589
10595
  super();
10590
10596
  // 10s
10591
10597
  /**
10592
10598
  * Picture in picture
10593
10599
  */
10594
10600
  r(this, "pictureInPicture");
10601
+ r(this, "drm");
10595
10602
  r(this, "browser", bu());
10596
10603
  r(this, "options");
10597
10604
  r(this, "element");
@@ -10760,7 +10767,7 @@ const Ve = class Ve extends gi {
10760
10767
  if (!ms(h) || !this.isSupportedVideoCodecProfile(h.codec, h.codecString))
10761
10768
  return !1;
10762
10769
  if (!this.willUseMediaSource()) {
10763
- const b = this.options.get("advanced"), S = (p = b.wasmDecodingConstraint.bitRate) != null ? p : Number.MAX_SAFE_INTEGER, x = (g = b.wasmDecodingConstraint.width) != null ? g : Number.MAX_SAFE_INTEGER, R = (w = b.wasmDecodingConstraint.height) != null ? w : Number.MAX_SAFE_INTEGER;
10770
+ const y = this.options.get("advanced"), S = (p = y.wasmDecodingConstraint.bitRate) != null ? p : Number.MAX_SAFE_INTEGER, x = (g = y.wasmDecodingConstraint.width) != null ? g : Number.MAX_SAFE_INTEGER, R = (w = y.wasmDecodingConstraint.height) != null ? w : Number.MAX_SAFE_INTEGER;
10764
10771
  return h.bitRate <= S && h.width <= x && h.height <= R;
10765
10772
  }
10766
10773
  const d = yield Kp(h);
@@ -10802,15 +10809,15 @@ const Ve = class Ve extends gi {
10802
10809
  bitRate: this.abrEnabled ? o : this.options.get("maxAudioBitRate"),
10803
10810
  language: this.options.get("language")
10804
10811
  }), (!w.includes(this.options.get("language")) || this.language === void 0) && this.modules.subscription.setLanguage(w[0])), this.alignSizeAndBitRate(this.targetSubscription);
10805
- const b = this.modules.subscription.getTargetSubscription();
10812
+ const y = this.modules.subscription.getTargetSubscription();
10806
10813
  this.emitter.emit("subscription changed", {
10807
- to: b,
10814
+ to: y,
10808
10815
  from: this.modules.subscription.getCurrentSubscription()
10809
10816
  });
10810
10817
  });
10811
10818
  r(this, "isSupportedVideoCodecProfile", (t, i) => {
10812
10819
  if (this.willUseMediaSource()) {
10813
- const n = Tr();
10820
+ const n = Cr();
10814
10821
  return n ? n.isTypeSupported(Ri({ codec: t, codecString: i })) : !0;
10815
10822
  }
10816
10823
  if (t === "h264") {
@@ -10927,7 +10934,7 @@ const Ve = class Ve extends gi {
10927
10934
  const t = this.modules.canvasModule ? this.options.get("iosMediaElementEnabled") : void 0;
10928
10935
  return v({
10929
10936
  uptime: Date.now() - this.createdAt,
10930
- version: "4.0.0-138-g3fc34827",
10937
+ version: "4.0.0-140-g33a0072d",
10931
10938
  clientId: this.clientId,
10932
10939
  sessionId: this.sessionId,
10933
10940
  channelId: this.channelId,
@@ -10973,12 +10980,12 @@ const Ve = class Ve extends gi {
10973
10980
  width: this.options.get("maxSize").width,
10974
10981
  height: this.options.get("maxSize").height
10975
10982
  }
10976
- }, o = pe.get();
10983
+ }, o = ge.get();
10977
10984
  o.setLevel(this.options.get("logLevel")), o.setDebug(!1), this.logger = o;
10978
10985
  const c = Hh.create(
10979
10986
  this.emitter,
10980
10987
  this.logger.createContext("PictureInPictureModule")
10981
- ), h = ge.create(), d = Dh.create(this.emitter, this.logger.createContext("ConnectionModule"), {
10988
+ ), h = Ae.create(), d = Dh.create(this.emitter, this.logger.createContext("ConnectionModule"), {
10982
10989
  reconnectHandler: this.options.get("reconnectHandler"),
10983
10990
  options: this.options,
10984
10991
  onConnectInfo: this.onConnectInfo
@@ -10998,22 +11005,29 @@ const Ve = class Ve extends gi {
10998
11005
  this.encryptedMediaExtensions = new Rd(
10999
11006
  this.emitter,
11000
11007
  this.logger.createContext("EncryptedMediaExtensions"),
11001
- (be = t.drm) == null ? void 0 : be.headers,
11002
- (ye = t.drm) == null ? void 0 : ye.queryParams
11003
- );
11004
- const b = Mh.create(this.emitter), S = this.options.get("poster"), x = S === !0 ? this.getThumbnailUrl() : S || void 0;
11008
+ (ye = t.drm) == null ? void 0 : ye.headers,
11009
+ (ve = t.drm) == null ? void 0 : ve.queryParams
11010
+ ), this.drm = {
11011
+ setHeaders: (b) => {
11012
+ this.encryptedMediaExtensions.headers = b;
11013
+ },
11014
+ setQueryParams: (b) => {
11015
+ this.encryptedMediaExtensions.queryParams = b;
11016
+ }
11017
+ };
11018
+ const y = Mh.create(this.emitter), S = this.options.get("poster"), x = S === !0 ? this.getThumbnailUrl() : S || void 0;
11005
11019
  let R, D, E;
11006
11020
  if (this.willUseMediaSource()) {
11007
- const y = new lh({
11021
+ const b = new lh({
11008
11022
  type: this.options.get("media") == "audio" ? "audio" : "video",
11009
11023
  autoplay: !1,
11010
11024
  muted: this.options.get("muted") || this.options.get("media") === "video",
11011
11025
  logger: this.logger.createContext("MediaElement"),
11012
11026
  poster: x
11013
11027
  });
11014
- y.on("buffer state", (I) => this.emitter.emit("buffer state", I)), y.on("needs user input", (I) => this.emitter.emit("needs user input", I)), y.on("volume state", (I) => this.emit("volume state", I)), y.on("media element state", (I) => this.onMediaElementState(I)), this.element = y.element, this.playbackSource = y, Rd.isSupported() && this.encryptedMediaExtensions.attach(y.element), R = zh.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (D = Fo.create(this.logger.createContext("UnpauseModule"), y, b)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: y.element });
11028
+ b.on("buffer state", (I) => this.emitter.emit("buffer state", I)), b.on("needs user input", (I) => this.emitter.emit("needs user input", I)), b.on("volume state", (I) => this.emit("volume state", I)), b.on("media element state", (I) => this.onMediaElementState(I)), this.element = b.element, this.playbackSource = b, Rd.isSupported() && this.encryptedMediaExtensions.attach(b.element), R = zh.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (D = Fo.create(this.logger.createContext("UnpauseModule"), b, y)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: b.element });
11015
11029
  } else if (this.browser.platform.iosVersion >= 15 && this.options.get("iosMediaElementEnabled")) {
11016
- const y = Wh.create(
11030
+ const b = Wh.create(
11017
11031
  this.emitter,
11018
11032
  this.logger.createContext("ModernCanvasModule"),
11019
11033
  this.pool,
@@ -11023,27 +11037,27 @@ const Ve = class Ve extends gi {
11023
11037
  muted: this.options.get("muted") || this.options.get("media") === "video",
11024
11038
  poster: x
11025
11039
  }
11026
- ), I = y.element();
11027
- this.element = I.element, this.playbackSource = y, E = y, this.options.get("pictureInPictureEnabled") && this.browser.platform.iosVersion > 15 && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (D = Fo.create(this.logger.createContext("UnpauseModule"), I, b));
11040
+ ), I = b.element();
11041
+ this.element = I.element, this.playbackSource = b, E = b, this.options.get("pictureInPictureEnabled") && this.browser.platform.iosVersion > 15 && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (D = Fo.create(this.logger.createContext("UnpauseModule"), I, y));
11028
11042
  } else {
11029
- const y = jh.create(
11043
+ const b = jh.create(
11030
11044
  this.emitter,
11031
11045
  this.logger.createContext("LegacyCanvasModule"),
11032
11046
  this.pool,
11033
11047
  this,
11034
11048
  this.options.get("muted") || this.options.get("media") === "video"
11035
11049
  );
11036
- this.element = y.element(), this.playbackSource = y, E = y, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new Qp());
11050
+ this.element = b.element(), this.playbackSource = b, E = b, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new Qp());
11037
11051
  }
11038
- this.emitter.on("channel reset", this.resetModules), this.emitter.on("no data timeout", this.resetModules), this.emitter.on("media element state", (y) => this.onMediaElementState(y)), this.emitter.on("volume state", (y) => this.emit("volume state", y)), this.options.get("pauseSupportEnabled") || this.emitter.on("exit picture in picture", () => h.setTimeout(() => this.play(), 0)), this.emitter.on("constraint cap changed", (y) => {
11039
- this.logger.info("new cap set", { cap: y }), this.alignSizeAndBitRate(this.targetSubscription);
11052
+ this.emitter.on("channel reset", this.resetModules), this.emitter.on("no data timeout", this.resetModules), this.emitter.on("media element state", (b) => this.onMediaElementState(b)), this.emitter.on("volume state", (b) => this.emit("volume state", b)), this.options.get("pauseSupportEnabled") || this.emitter.on("exit picture in picture", () => h.setTimeout(() => this.play(), 0)), this.emitter.on("constraint cap changed", (b) => {
11053
+ this.logger.info("new cap set", { cap: b }), this.alignSizeAndBitRate(this.targetSubscription);
11040
11054
  }), this.pictureInPicture = {
11041
11055
  enter: () => c.requestPictureInPicture(),
11042
11056
  exit: () => c.exitPictureInPicture(),
11043
11057
  isActive: () => c.isPictureInPictureActive(),
11044
11058
  isSupported: () => c.isPictureInPictureSupported()
11045
- }, this.emitter.on("error", (y) => {
11046
- if (y.type() === "external" && this.emit("error", y), y.isFatal())
11059
+ }, this.emitter.on("error", (b) => {
11060
+ if (b.type() === "external" && this.emit("error", b), b.isFatal())
11047
11061
  return () => void this.unload();
11048
11062
  });
11049
11063
  const U = this.browser.platform.isIOS && !this.browser.platform.isIpadOS, k = Yh.create(
@@ -11092,7 +11106,7 @@ const Ve = class Ve extends gi {
11092
11106
  ),
11093
11107
  event: Fh.create(this.emitter, this.logger.createContext("EventModule"), k),
11094
11108
  sync: k,
11095
- documentState: b,
11109
+ documentState: y,
11096
11110
  connection: d,
11097
11111
  playback: w,
11098
11112
  pictureInPicture: c,
@@ -11103,9 +11117,9 @@ const Ve = class Ve extends gi {
11103
11117
  mseModule: R,
11104
11118
  unpause: D,
11105
11119
  canvasModule: E
11106
- }, this.modules.adaptivity.isEnabled = this.options.get("abrEnabled"), this.emitter.on("page active", (y) => {
11120
+ }, this.modules.adaptivity.isEnabled = this.options.get("abrEnabled"), this.emitter.on("page active", (b) => {
11107
11121
  var I;
11108
- y && typeof this.disconnectTimeout == "number" && (this.modules.timer.clearInterval(this.disconnectTimeout), this.disconnectTimeout = void 0), y ? this.playbackSource.isPaused || (this.logger.debug("Unsuspending"), this.unsuspend()) : (this.logger.debug("Suspending"), this.suspend(), this.modules.decoder ? this.options.get("iosBackgroundPlayEnabled") ? (this.modules.decoder.unsuspend(), (I = this.modules.canvasModule) == null || I.unsuspend()) : this.modules.connection.disconnect() : (this.disconnectTimeout && this.modules.timer.clearInterval(this.disconnectTimeout), this.disconnectTimeout = this.modules.timer.setInterval(() => {
11122
+ b && typeof this.disconnectTimeout == "number" && (this.modules.timer.clearInterval(this.disconnectTimeout), this.disconnectTimeout = void 0), b ? this.playbackSource.isPaused || (this.logger.debug("Unsuspending"), this.unsuspend()) : (this.logger.debug("Suspending"), this.suspend(), this.modules.decoder ? this.options.get("iosBackgroundPlayEnabled") ? (this.modules.decoder.unsuspend(), (I = this.modules.canvasModule) == null || I.unsuspend()) : this.modules.connection.disconnect() : (this.disconnectTimeout && this.modules.timer.clearInterval(this.disconnectTimeout), this.disconnectTimeout = this.modules.timer.setInterval(() => {
11109
11123
  const H = this.playbackState === "paused" || this.muted;
11110
11124
  this.connectionState === "connected" && H && (this.emitter.emit("flush buffers"), this.modules.connection.disconnect("Page inactive timeout"));
11111
11125
  }, Ve.DISCONNECT_TIMEOUT)));
@@ -11115,41 +11129,41 @@ const Ve = class Ve extends gi {
11115
11129
  Q || (Q = window.setTimeout(() => {
11116
11130
  window.clearTimeout(Q), Q = void 0, this.emit("context switch", "completed"), this.emitLanguagesIfChanged();
11117
11131
  }, this.targetBufferTime));
11118
- }), this.emitter.on("context switch started", () => this.emit("context switch", "started")), this.emitter.on("needs user input", (y) => this.emit("needs user input", y)), this.emitter.on("event", (y) => {
11119
- switch (y.type) {
11132
+ }), this.emitter.on("context switch started", () => this.emit("context switch", "started")), this.emitter.on("needs user input", (b) => this.emit("needs user input", b)), this.emitter.on("event", (b) => {
11133
+ switch (b.type) {
11120
11134
  case "metadata":
11121
- this.emit("metadata", y);
11135
+ this.emit("metadata", b);
11122
11136
  break;
11123
11137
  case "channel switch":
11124
- this.emit("channel switch", { channelId: y.channelId });
11138
+ this.emit("channel switch", { channelId: b.channelId });
11125
11139
  break;
11126
11140
  case "language switch":
11127
- this.emit("language switch", { language: y.language });
11141
+ this.emit("language switch", { language: b.language });
11128
11142
  break;
11129
11143
  }
11130
- }), this.emitter.on("buffer state event", this.onBufferEvent), this.emitter.on("playback state", (y) => this.emit("playback state", y)), this.emitter.on("rendition level changed", ({ to: y }) => {
11131
- y && this.emit("rendition level", y);
11132
- }), this.emitter.on("connection state", (y) => {
11133
- this.emit("connection state", y);
11144
+ }), this.emitter.on("buffer state event", this.onBufferEvent), this.emitter.on("playback state", (b) => this.emit("playback state", b)), this.emitter.on("rendition level changed", ({ to: b }) => {
11145
+ b && this.emit("rendition level", b);
11146
+ }), this.emitter.on("connection state", (b) => {
11147
+ this.emit("connection state", b);
11134
11148
  }), this.emitter.on("recovered from media error", () => {
11135
11149
  this.modules.adaptivity.reset(this.targetBufferTime * 2);
11136
- }), this.emitter.once("connect info", (y) => {
11150
+ }), this.emitter.once("connect info", (b) => {
11137
11151
  var G, O, M;
11138
- const H = ((O = (G = y.telemetry) == null ? void 0 : G.probability) != null ? O : 1) >= Math.random();
11139
- y.telemetry && ((M = this.modules.telemetry) == null || M.unload(), this.modules.telemetry = Mo.create(
11152
+ const H = ((O = (G = b.telemetry) == null ? void 0 : G.probability) != null ? O : 1) >= Math.random();
11153
+ b.telemetry && ((M = this.modules.telemetry) == null || M.unload(), this.modules.telemetry = Mo.create(
11140
11154
  this.logger.createContext("TelemetryModule"),
11141
11155
  this.emitter,
11142
- F(v({}, y.telemetry), {
11156
+ F(v({}, b.telemetry), {
11143
11157
  enabled: this.options.get("telemetryEnabled") && H
11144
11158
  }),
11145
11159
  this
11146
11160
  ), this.modules.telemetry.load());
11147
- }), this.emitter.on("adapt level", (y) => {
11161
+ }), this.emitter.on("adapt level", (b) => {
11148
11162
  var Qe, q, re, ot, Ze;
11149
- this.logger.debug("adapt level", { direction: y });
11163
+ this.logger.debug("adapt level", { direction: b });
11150
11164
  const I = this.modules.renditions.getRenditionLevels(), H = this.modules.renditions.getRenditionLevel(), G = I.findIndex((te) => te === H), O = I.length - 1;
11151
11165
  let M = G;
11152
- switch (y) {
11166
+ switch (b) {
11153
11167
  case "upgrade":
11154
11168
  {
11155
11169
  const te = Math.min(G + 1, O), ct = I[te], ql = (Qe = this.modules.connection.estimatedBandwidth) != null ? Qe : pi(), $l = ((re = (q = ct == null ? void 0 : ct.audio) == null ? void 0 : q.bitRate) != null ? re : 0) + ((Ze = (ot = ct == null ? void 0 : ct.video) == null ? void 0 : ot.bitRate) != null ? Ze : 0), Yl = ql * 2 > $l;
@@ -11178,20 +11192,20 @@ const Ve = class Ve extends gi {
11178
11192
  video: v(v({}, this.targetSubscription.video), Z == null ? void 0 : Z.video),
11179
11193
  audio: v(v({}, this.targetSubscription.audio), Z == null ? void 0 : Z.audio)
11180
11194
  })), this.emitter.emit("adapted level");
11181
- }), this.emitter.on("text track data", (y) => {
11182
- const I = a(this, Me).find((M) => M.language === y.language), G = this.modules.sync.getTimeshiftOffset() / 1e3, O = G - a(this, us);
11195
+ }), this.emitter.on("text track data", (b) => {
11196
+ const I = a(this, Me).find((M) => M.language === b.language), G = this.modules.sync.getTimeshiftOffset() / 1e3, O = G - a(this, us);
11183
11197
  if (l(this, us, G), I) {
11184
11198
  if (I.cues)
11185
11199
  for (const M of I.cues)
11186
11200
  M.startTime -= O, M.endTime -= O;
11187
- for (const M of y.cues) {
11201
+ for (const M of b.cues) {
11188
11202
  const Z = new VTTCue(M.startTime - G, M.endTime - G, M.text);
11189
11203
  I.addCue(Z);
11190
11204
  }
11191
11205
  }
11192
- }), this.emitter.on("received signal", (y) => {
11206
+ }), this.emitter.on("received signal", (b) => {
11193
11207
  var G;
11194
- const I = y, H = this.modules.subscription.getCurrentSubscription();
11208
+ const I = b, H = this.modules.subscription.getCurrentSubscription();
11195
11209
  switch (this.logger.debug("received", v({}, I)), I.type) {
11196
11210
  case "client ip":
11197
11211
  this.clientIp = I.ip;
@@ -11229,27 +11243,27 @@ const Ve = class Ve extends gi {
11229
11243
  this.modules.sync.updateChannelSyncInfo(I.timingInfo.channelId, I.timingInfo), this.emit("server wallclock time", I.timingInfo.wallclockTime);
11230
11244
  break;
11231
11245
  }
11232
- }), this.emitter.on("channel switch timeout", (y) => {
11233
- this.emit("error", Cd(y)), this.emit("channel switch failed", { channelId: this.currentSubscription.channelId });
11234
- }), this.emitter.on("received data", (y) => {
11235
- const I = this.modules.subscription.getCurrentSubscription(), H = Hp(y);
11246
+ }), this.emitter.on("channel switch timeout", (b) => {
11247
+ this.emit("error", Cd(b)), this.emit("channel switch failed", { channelId: this.currentSubscription.channelId });
11248
+ }), this.emitter.on("received data", (b) => {
11249
+ const I = this.modules.subscription.getCurrentSubscription(), H = Hp(b);
11236
11250
  if (!I) {
11237
11251
  this.logger.warn("Received unwanted message", v({}, H));
11238
11252
  return;
11239
11253
  }
11240
11254
  Tt(F(v({}, H), { channelId: I.channelId }));
11241
- }), this.emitter.on("received moq data", (y) => {
11255
+ }), this.emitter.on("received moq data", (b) => {
11242
11256
  var M, Z, Qe;
11243
- const I = y.payload.mediaType(), H = y.channelId, G = y.renditionId, O = this.modules.sync.processFragment(H, y.payload);
11244
- if (y.switchInfo.channelId && (y.switchInfo.drmTransition && this.emitter.emit("error", Iu("Switching between DRM and non-DRM channels is not supported", !0)), this.encryptedMediaExtensions.onChannelSwitch(), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.modules.event.addEvent({
11257
+ const I = b.payload.mediaType(), H = b.channelId, G = b.renditionId, O = this.modules.sync.processFragment(H, b.payload);
11258
+ if (b.switchInfo.channelId && (b.switchInfo.drmTransition && this.emitter.emit("error", Iu("Switching between DRM and non-DRM channels is not supported", !0)), this.encryptedMediaExtensions.onChannelSwitch(), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.modules.event.addEvent({
11245
11259
  type: "channel switch",
11246
- channelId: y.switchInfo.channelId,
11260
+ channelId: b.switchInfo.channelId,
11247
11261
  timestamp: O.baseMediaDecodeTime() / O.timescale() * 1e3
11248
- })), y.switchInfo.language && this.modules.event.addEvent({
11262
+ })), b.switchInfo.language && this.modules.event.addEvent({
11249
11263
  type: "language switch",
11250
- language: y.switchInfo.language,
11264
+ language: b.switchInfo.language,
11251
11265
  timestamp: O.baseMediaDecodeTime() / O.timescale() * 1e3
11252
- }), this.modules.incomingData.add(I, y.payload.rawBytes().byteLength), O.fragment().emsgs.forEach((q) => {
11266
+ }), this.modules.incomingData.add(I, b.payload.rawBytes().byteLength), O.fragment().emsgs.forEach((q) => {
11253
11267
  if (!q.presentationTime)
11254
11268
  return;
11255
11269
  const re = Cf(q.data);
@@ -11287,18 +11301,18 @@ const Ve = class Ve extends gi {
11287
11301
  }));
11288
11302
  }
11289
11303
  } else
11290
- this.emitter.emit("fragment", { mimeType: y.mimeType, codec: y.codec, fragment: O, channelId: H, renditionId: G });
11304
+ this.emitter.emit("fragment", { mimeType: b.mimeType, codec: b.codec, fragment: O, channelId: H, renditionId: G });
11291
11305
  });
11292
11306
  const Et = this.options.get("container");
11293
11307
  Et && this.attach(Et), this.logger.info("Created Vindral instance", { options: this.options });
11294
- const Tt = (y) => m(this, null, function* () {
11295
- const I = y.channelId;
11308
+ const Tt = (b) => m(this, null, function* () {
11309
+ const I = b.channelId;
11296
11310
  a(this, ls) && (yield a(this, ls));
11297
- const H = this.modules.renditions.getRendition(y.renditionId, I);
11298
- if (!jp(y.flags)) {
11299
- if (Wp(y.flags)) {
11300
- const O = new TextDecoder().decode(y.payload), M = this.modules.sync.getTimeshiftOffset();
11301
- if (y.renditionId !== 0) {
11311
+ const H = this.modules.renditions.getRendition(b.renditionId, I);
11312
+ if (!jp(b.flags)) {
11313
+ if (Wp(b.flags)) {
11314
+ const O = new TextDecoder().decode(b.payload), M = this.modules.sync.getTimeshiftOffset();
11315
+ if (b.renditionId !== 0) {
11302
11316
  const Z = cm(O);
11303
11317
  if (Z && Z.language !== void 0) {
11304
11318
  const q = new Gu().parse(Z.content || ""), re = M / 1e3, ot = a(this, Me).find((te) => te.language === Z.language), Ze = re - a(this, us);
@@ -11314,7 +11328,7 @@ const Ve = class Ve extends gi {
11314
11328
  }
11315
11329
  } else
11316
11330
  this.modules.event.addEvent({
11317
- timestamp: y.timestamp / y.timescale * 1e3 - this.modules.sync.getTimeshiftOffset(),
11331
+ timestamp: b.timestamp / b.timescale * 1e3 - this.modules.sync.getTimeshiftOffset(),
11318
11332
  content: O,
11319
11333
  type: "metadata"
11320
11334
  });
@@ -11322,19 +11336,19 @@ const Ve = class Ve extends gi {
11322
11336
  const G = hm(H.codec);
11323
11337
  if (G === "text")
11324
11338
  throw new Error("Subtitles are not supported");
11325
- if (this.modules.incomingData.add(G, y.payload.byteLength), Gp(y.flags)) {
11339
+ if (this.modules.incomingData.add(G, b.payload.byteLength), Gp(b.flags)) {
11326
11340
  const O = F(v({
11327
11341
  type: G,
11328
- data: y.payload,
11342
+ data: b.payload,
11329
11343
  codec: H.codec
11330
- }, y), {
11344
+ }, b), {
11331
11345
  channelId: I
11332
11346
  }), M = Op(O.codec, O.payload);
11333
11347
  M && this.sizes.set(O.renditionId, M);
11334
11348
  const Z = Ri({ codec: H.codec, codecString: H.codecString });
11335
11349
  this.emitter.emit("init segment", { initSegment: O, mimeType: Z }), this.emit("initialized media");
11336
11350
  } else {
11337
- const O = XA(y, H, this.sizes.get(y.renditionId));
11351
+ const O = XA(b, H, this.sizes.get(b.renditionId));
11338
11352
  let M = this.sampleProcessingSesssions.get(G);
11339
11353
  if (!M)
11340
11354
  M = HA(
@@ -11766,9 +11780,9 @@ export {
11766
11780
  Wm as A,
11767
11781
  Bm as C,
11768
11782
  _m as D,
11769
- fe as F,
11783
+ pe as F,
11770
11784
  Dm as I,
11771
- pe as L,
11785
+ ge as L,
11772
11786
  Lm as N,
11773
11787
  Kd as V,
11774
11788
  JA as a,